:root {
  color-scheme: light;
  --ink: #101828;
  --muted: #475467;
  --paper: #ffffff;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --line: #d0d5dd;
  --blue: #175cd3;
  --green: #067647;
  --red: #b42318;
  --yellow: #b54708;
  --focus: #1570ef;
  --shadow: 0 12px 30px rgba(16, 24, 40, 0.08);
  --bottom-safe: env(safe-area-inset-bottom, 0px);
  --visual-height: 100dvh;
  font-family: Pretendard, "Apple SD Gothic Neo", "Noto Sans KR", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
  background: var(--paper);
  color: var(--ink);
}

body {
  min-height: var(--visual-height);
  overflow: hidden;
}

button,
input {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

input {
  color: var(--ink);
}

input::placeholder {
  color: #667085;
  opacity: 1;
}

button:focus-visible,
input:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--guest-accent, var(--focus)) 32%, transparent);
  outline-offset: 2px;
}

.app-shell {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  width: min(100vw, 560px);
  height: var(--visual-height);
  margin: 0 auto;
  overflow: hidden;
  background: #ffffff;
  border-inline: 1px solid #e4e7ec;
}

.app-shell[data-guest-palette] {
  --ink: var(--guest-text);
  --muted: var(--guest-muted);
  --surface: #ffffff;
  --surface-soft: var(--guest-panel);
  --line: #d0d5dd;
  --blue: var(--guest-accent);
  background: #ffffff;
  color: var(--guest-text);
  transition: background-color 180ms ease, color 180ms ease;
}

.topbar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: calc(17px + env(safe-area-inset-top, 0px)) 16px 13px;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid #e4e7ec;
  backdrop-filter: blur(12px);
}

.topbar::before {
  position: absolute;
  top: 0;
  right: 16px;
  left: 16px;
  height: 3px;
  border-radius: 0 0 999px 999px;
  background: var(--guest-accent, var(--blue));
  content: "";
}

.my-table-card,
.peer-card,
.request-card {
  border: 1px solid color-mix(in srgb, var(--accent, var(--blue)) 22%, var(--line));
  border-radius: 14px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.my-table-card {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  min-width: 0;
  align-items: center;
  gap: 10px;
  flex: 1;
  padding: 11px;
}

.table-badge,
.peer-badge,
.request-signal {
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: color-mix(in srgb, var(--accent, var(--blue)) 9%, white);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent, var(--blue)) 18%, #e4e7ec);
}

.table-badge {
  width: 52px;
  height: 52px;
  font-size: 29px;
}

.table-copy {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.table-copy strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 18px;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.table-copy small,
.section-heading span,
.peer-card small,
.eyebrow {
  color: var(--muted);
  font-size: 12px;
}

.notice {
  margin: 12px 16px 0;
  padding: 12px;
  border: 1px solid #fda29b;
  border-radius: 12px;
  background: #fef3f2;
  color: #912018;
  font-size: 14px;
}

.guest-entry-loading {
  display: grid;
  min-height: 0;
  place-content: center;
  justify-items: center;
  gap: 8px;
  padding: 24px;
  color: #101828;
  text-align: center;
}

.guest-entry-loading[hidden] { display: none; }

.guest-entry-loading__mark {
  display: flex;
  height: 32px;
  align-items: end;
  gap: 5px;
}

.guest-entry-loading__mark i {
  width: 6px;
  border-radius: 999px;
  background: var(--guest-accent, var(--blue));
  animation: guest-entry-pulse 900ms ease-in-out infinite alternate;
}

.guest-entry-loading__mark i:nth-child(1) { height: 14px; }
.guest-entry-loading__mark i:nth-child(2) { height: 28px; animation-delay: 120ms; }
.guest-entry-loading__mark i:nth-child(3) { height: 20px; animation-delay: 240ms; }
.guest-entry-loading strong { font-size: 17px; }
.guest-entry-loading p { margin: 0; color: var(--muted); font-size: 13px; }

@keyframes guest-entry-pulse {
  to { transform: translateY(-4px); opacity: .55; }
}

.lobby,
.chat-panel {
  display: grid;
  min-height: 0;
  gap: 16px;
  padding: 18px 16px calc(18px + var(--bottom-safe));
  overflow: auto;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
}

.section-heading span {
  flex: 0 0 auto;
  white-space: nowrap;
}

.section-heading h1 {
  margin: 0;
  font-size: clamp(22px, 8vw, 34px);
  line-height: 1.12;
  letter-spacing: -0.035em;
}

.guest-experience-copy {
  display: grid;
  gap: 9px;
  padding: 2px 2px 4px;
}

.guest-industry {
  color: var(--guest-accent, var(--blue));
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.12em;
}

.guest-intro,
.guest-notice {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.guest-intro {
  font-size: 15px;
}

.guest-notice {
  padding: 9px 11px;
  border: 1px solid color-mix(in srgb, var(--guest-accent, var(--blue)) 22%, #e4e7ec);
  border-left: 3px solid var(--guest-accent, var(--blue));
  border-radius: 0 10px 10px 0;
  background: var(--surface-soft);
  color: var(--ink);
  font-size: 13px;
}

.introduction-editor {
  display: grid;
  gap: 8px;
  padding: 16px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--guest-accent, var(--blue));
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 6px 18px rgba(16, 24, 40, 0.04);
}

.introduction-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.introduction-heading label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 900;
}

.introduction-heading label::before {
  content: "“";
  display: inline-grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border-radius: 6px;
  background: color-mix(in srgb, var(--guest-accent, var(--blue)) 14%, var(--surface));
  color: var(--guest-accent, var(--blue));
  font-family: Georgia, serif;
  font-size: 20px;
  line-height: 1;
}

.introduction-counter,
.introduction-hint {
  color: var(--muted);
  font-size: 11px;
}

.introduction-hint {
  margin: 0;
  line-height: 1.45;
}

.introduction-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 58px 58px;
  gap: 6px;
}

.introduction-controls input {
  min-width: 0;
  height: 44px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
}

.introduction-clear,
.introduction-save {
  min-height: 44px;
  padding: 0 8px;
  font-size: 13px;
}

.introduction-controls input:focus-visible,
.introduction-clear:focus-visible,
.introduction-save:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--guest-accent, var(--blue)) 28%, transparent);
  outline-offset: 2px;
}

.age-range-selector {
  display: grid;
  gap: 8px;
  margin: 4px 0 0;
  padding: 12px 0 0;
  border: 0;
  border-top: 1px solid var(--line);
}

.age-range-selector legend {
  padding: 0;
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
}

.age-range-selector legend small {
  margin-left: 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

.age-range-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  padding: 2px 2px 4px;
}

.age-range-options button {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #ffffff;
  color: var(--ink);
  font-size: 13px;
  font-weight: 820;
}

@media (max-width: 340px) {
  .age-range-options {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.age-range-options button.is-selected {
  border-color: var(--guest-accent, var(--blue));
  background: color-mix(in srgb, var(--guest-accent, var(--blue)) 9%, white);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--guest-accent, var(--blue)) 14%, transparent);
}

.age-range-options button:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--guest-accent, var(--blue)) 28%, transparent);
  outline-offset: 2px;
}

.age-range-selector > p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.signal-composer {
  display: grid;
  gap: 9px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-soft);
}

.signal-composer > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.signal-list,
.emoji-rail {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
}

.signal-list::-webkit-scrollbar,
.emoji-rail::-webkit-scrollbar {
  display: none;
}

.emoji-rail {
  min-height: 54px;
}

.emoji-button {
  display: grid;
  width: 52px;
  height: 52px;
  flex: 0 0 52px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  font-size: 26px;
  transition: transform 140ms ease, border-color 140ms ease, box-shadow 140ms ease;
}

.emoji-button.is-selected {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--blue) 16%, transparent);
  transform: translateY(-1px);
}

.table-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.peer-card {
  position: relative;
  display: grid;
  min-height: 176px;
  justify-items: start;
  gap: 5px;
  padding: 14px 14px 52px;
  color: var(--ink);
  text-align: left;
}

.peer-card strong {
  font-size: 20px;
  line-height: 1.15;
}

.peer-introduction-card {
  display: -webkit-box;
  margin: 4px 0 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 13px;
  font-weight: 720;
  line-height: 1.4;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.peer-age-card,
.request-age,
.peer-age {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border: 1px solid color-mix(in srgb, var(--guest-accent, var(--blue)) 18%, var(--line));
  border-radius: 999px;
  background: color-mix(in srgb, var(--guest-accent, var(--blue)) 7%, white);
  color: var(--ink);
  font-size: 11px;
  font-weight: 850;
  line-height: 1.2;
}

.peer-age-card[hidden],
.request-age[hidden],
.peer-age[hidden] {
  display: none;
}

.peer-badge {
  width: 48px;
  height: 48px;
  font-size: 26px;
}

.peer-action {
  position: absolute;
  right: 10px;
  bottom: 10px;
  display: grid;
  min-width: 42px;
  height: 34px;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--accent, var(--blue)) 20%, var(--line));
  border-radius: 10px;
  background: color-mix(in srgb, var(--accent, var(--blue)) 8%, white);
  color: var(--ink);
  font-size: 22px;
}

.empty-state {
  grid-column: 1 / -1;
  margin: 0;
  padding: 18px;
  border: 1px dashed var(--line);
  border-radius: 14px;
  background: var(--surface-soft);
  color: var(--muted);
  text-align: center;
}

.request-panel {
  min-height: 0;
  padding: 0 16px 14px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.request-card {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 12px;
  max-width: 528px;
  margin: 0 auto;
  padding: 14px;
}

.request-signal {
  width: 58px;
  height: 58px;
  font-size: 32px;
}

.request-card strong,
.request-card p {
  margin: 0;
}

.request-card p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 14px;
}

.request-actions {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

#accept-request {
  grid-column: 1 / -1;
}

.hard-decline-button {
  border-color: #fda29b;
  color: #b42318;
}

.hard-decline-confirm {
  grid-column: 1 / -1;
  display: grid;
  gap: 7px;
  padding: 12px;
  border: 1px solid #fda29b;
  border-radius: 12px;
  background: #fff5f4;
}

.hard-decline-confirm[hidden] {
  display: none;
}

.hard-decline-confirm strong {
  color: #912018;
  font-size: 14px;
}

.hard-decline-confirm p {
  margin: 0;
  color: #7a271a;
  font-size: 12px;
  line-height: 1.45;
}

.hard-decline-confirm > div {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 8px;
}

.hard-decline-confirm-button {
  min-height: 46px;
  border-radius: 10px;
  background: #b42318;
  color: #ffffff;
  font-weight: 850;
}

.hard-decline-button:focus-visible,
.hard-decline-confirm-button:focus-visible {
  outline: 3px solid rgba(180, 35, 24, 0.24);
  outline-offset: 2px;
}

.primary-button,
.secondary-button {
  min-height: 46px;
  border-radius: 10px;
  font-weight: 850;
}

.primary-button {
  background: var(--guest-accent, var(--ink));
  color: var(--guest-on-accent, white);
  box-shadow: 0 6px 14px color-mix(in srgb, var(--guest-accent, var(--ink)) 18%, transparent);
}

.secondary-button {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
}

.primary-button:active,
.secondary-button:active,
.emoji-button:active,
.photo-action:active,
.quick-chip:active {
  transform: translateY(1px);
}

.chat-panel {
  grid-template-rows: none;
  grid-auto-rows: auto;
  align-content: start;
}

.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 2px;
}

.chat-header > div {
  min-width: 0;
}

.chat-header strong {
  display: block;
  font-size: 18px;
  overflow-wrap: anywhere;
}

.peer-introduction {
  display: block;
  max-width: 32ch;
  margin-top: 4px;
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.peer-presence {
  display: block;
  margin-top: 3px;
  color: #067647;
  font-size: 12px;
  font-weight: 800;
}

.peer-presence.is-reconnecting {
  color: #9a3412;
}

.chat-expiry {
  display: grid;
  gap: 9px;
  padding: 12px;
  border: 1px solid color-mix(in srgb, var(--yellow) 72%, var(--line));
  border-radius: 12px;
  background: #fffaeb;
  box-shadow: 0 10px 24px rgba(31, 40, 60, 0.08);
}

.chat-expiry.is-critical {
  border-color: color-mix(in srgb, var(--red) 72%, var(--line));
  background: #fef3f2;
}

.chat-expiry-copy {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.chat-expiry-copy strong {
  font-size: 14px;
  line-height: 1.35;
}

.chat-expiry-seconds {
  min-width: 2ch;
  color: #93370d;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 22px;
  font-weight: 900;
  line-height: 1;
  text-align: right;
}

.chat-expiry.is-critical .chat-expiry-seconds {
  color: #b42318;
}

.chat-expiry-fuse {
  display: grid;
  grid-template-columns: repeat(10, minmax(0, 1fr));
  gap: 4px;
}

.chat-expiry-fuse i {
  height: 5px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--muted) 24%, transparent);
  transform: scaleX(0.78);
  transform-origin: left;
  transition: background-color 160ms ease, transform 160ms ease;
}

.chat-expiry-fuse i.is-lit {
  background: var(--yellow);
  transform: scaleX(1);
}

.chat-expiry.is-critical .chat-expiry-fuse i.is-lit {
  background: var(--red);
}

.chat-expiry-continue {
  min-height: 44px;
  border: 1px solid color-mix(in srgb, var(--yellow) 58%, var(--line));
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
  font-weight: 850;
}

.chat-expiry.is-critical .chat-expiry-continue {
  border-color: color-mix(in srgb, var(--red) 58%, var(--line));
}

.message-feed {
  display: flex;
  min-height: 0;
  height: clamp(180px, 30dvh, 280px);
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f8fafc;
}

.quick-actions {
  display: grid;
  min-width: 0;
  gap: 8px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-soft);
}

.quick-actions-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.quick-actions-heading strong {
  color: var(--ink);
  font-size: 13px;
  font-weight: 850;
}

.quick-actions-heading small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.quick-list {
  display: grid;
  min-width: 0;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.message {
  max-width: 78%;
  padding: 10px 12px;
  border: 1px solid #e4e7ec;
  border-radius: 13px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 4px 12px rgba(16, 24, 40, 0.06);
  white-space: pre-wrap;
  word-break: break-word;
}

.message.is-self {
  align-self: flex-end;
  border-color: var(--guest-accent, #334155);
  background: var(--guest-accent, #172033);
  color: var(--guest-on-accent, white);
}

.message.is-peer {
  align-self: flex-start;
}

.message.is-emoji {
  padding: 8px 12px;
  font-size: 40px;
  line-height: 1.1;
}

.message.is-photo {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-width: min(78%, 250px);
  text-align: left;
}

.photo-message-icon {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid currentColor;
  border-radius: 50%;
  font-size: 20px;
  opacity: 0.74;
}

.message.is-photo strong,
.message.is-photo small {
  display: block;
}

.message.is-photo strong {
  font-size: 13px;
}

.message.is-photo small {
  margin-top: 3px;
  font-size: 10px;
  opacity: 0.72;
}

.message.is-photo.has-protected-view {
  display: block;
  width: min(84%, 292px);
  min-width: 0;
  padding: 6px;
}

.protected-photo-card {
  display: grid;
  width: 100%;
  min-height: 82px;
  grid-template-columns: 88px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: inherit;
  text-align: left;
}

.protected-photo-preview {
  position: relative;
  display: grid;
  width: 88px;
  height: 70px;
  place-items: center;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, currentColor 25%, transparent);
  border-radius: 5px;
  background-color: #111722;
  background-image: radial-gradient(rgba(255, 255, 255, 0.16) 0.7px, transparent 0.8px);
  background-size: 7px 7px;
}

.protected-photo-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: blur(2px) saturate(0.72);
  pointer-events: none;
  user-select: none;
  -webkit-touch-callout: none;
}

.protected-photo-veil {
  position: absolute;
  display: grid;
  inset: 0;
  place-items: center;
  border: 5px solid rgba(255, 255, 255, 0.10);
  background: rgba(9, 14, 22, 0.28);
  color: rgba(255, 255, 255, 0.92);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 22px;
  font-weight: 900;
  letter-spacing: -0.08em;
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.65);
}

.protected-photo-copy {
  min-width: 0;
}

.protected-photo-action {
  display: block;
  margin-top: 8px;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: -0.01em;
}

.protected-photo-card:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--guest-accent, var(--blue)) 38%, transparent);
  outline-offset: 2px;
}

.quick-chip {
  min-width: 0;
  min-height: 44px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--ink);
  font-size: 14px;
  font-weight: 750;
  line-height: 1.35;
  overflow-wrap: anywhere;
  text-align: center;
  white-space: normal;
}

.quick-chip:last-child:nth-child(odd) {
  grid-column: 1 / -1;
}

.photo-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.photo-action {
  display: grid;
  min-height: 54px;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  padding: 8px 11px;
  border: 1px solid color-mix(in srgb, var(--guest-accent, var(--blue)) 30%, var(--line));
  border-radius: 12px;
  background: #ffffff;
  color: var(--ink);
  text-align: left;
}

.photo-action > span:first-child {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--guest-accent, var(--blue)) 48%, transparent);
  border-radius: 10px;
  background: color-mix(in srgb, var(--guest-accent, var(--blue)) 8%, white);
  color: var(--guest-accent, var(--blue));
  font-size: 17px;
}

.photo-action strong,
.photo-action small {
  display: block;
}

.photo-action strong {
  font-size: 13px;
}

.photo-action small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
}

.photo-action:focus-visible,
.photo-editor button:focus-visible,
.photo-editor input:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--guest-accent, var(--blue)) 38%, transparent);
  outline-offset: 2px;
}

.text-composer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 76px;
  gap: 8px;
}

.text-composer input {
  min-width: 0;
  height: 46px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
}

.photo-editor {
  position: fixed;
  z-index: 40;
  inset: 0;
  display: grid;
  place-items: end center;
  color: var(--ink);
}

.photo-editor-backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background: rgba(16, 24, 40, 0.46);
  backdrop-filter: blur(7px);
}

.photo-editor-sheet {
  position: relative;
  display: grid;
  width: min(100%, 560px);
  max-height: calc(var(--visual-height) - env(safe-area-inset-top, 0px) - 12px);
  gap: 13px;
  padding: 16px 16px calc(16px + var(--bottom-safe));
  overflow: auto;
  border: 1px solid #d0d5dd;
  border-bottom: 0;
  border-radius: 18px 18px 0 0;
  background: #ffffff;
  box-shadow: 0 -24px 60px rgba(16, 24, 40, 0.18);
}

.photo-editor-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 14px;
}

.photo-editor-header h2 {
  margin: 3px 0 0;
  font-size: 21px;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.photo-editor-kicker {
  color: var(--guest-accent, #334155);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.16em;
}

.photo-editor-close {
  display: grid;
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  place-items: center;
  border: 1px solid #d0d5dd;
  border-radius: 50%;
  background: #ffffff;
  color: var(--ink);
  font-size: 26px;
  line-height: 1;
}

.photo-editor-expiry {
  display: flex;
  min-height: 46px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 8px 7px 12px;
  border: 1px solid #fec84b;
  border-radius: 10px;
  background: #fffaeb;
  color: #7a2e0e;
  font-size: 12px;
  font-weight: 800;
}

.photo-editor-expiry button {
  min-height: 34px;
  padding: 0 11px;
  border-radius: 6px;
  background: #b54708;
  color: #ffffff;
  font-size: 12px;
  font-weight: 900;
}

.photo-preview-stage {
  position: relative;
  display: grid;
  min-height: 220px;
  max-height: min(42vh, 380px);
  place-items: center;
  overflow: hidden;
  border: 1px solid #d0d5dd;
  border-radius: 10px;
  background-color: #101828;
  background-image: radial-gradient(rgba(255, 255, 255, 0.10) 0.7px, transparent 0.7px);
  background-size: 12px 12px;
}

.photo-preview-placeholder {
  display: grid;
  justify-items: center;
  gap: 12px;
  padding: 30px;
  color: #e4e7ec;
  font-size: 12px;
  text-align: center;
}

.photo-aperture {
  display: block;
  width: 58px;
  height: 58px;
  border: 8px double rgba(255, 255, 255, 0.72);
  border-right-color: var(--guest-accent, #6fa0ff);
  border-radius: 50%;
  animation: photo-aperture-turn 1.4s linear infinite;
}

@keyframes photo-aperture-turn {
  to { transform: rotate(360deg); }
}

.photo-canvas-slot {
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
}

.photo-preview-canvas {
  display: block;
  max-width: 100%;
  max-height: min(42vh, 380px);
  object-fit: contain;
}

.photo-style-control {
  display: grid;
  gap: 12px;
  padding: 12px;
  border: 1px solid #cbd5e1;
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.06);
}

.photo-style-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.photo-style-heading span,
.photo-style-heading strong {
  display: block;
}

.photo-style-heading span {
  color: #334155;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.16em;
}

.photo-style-heading strong {
  margin-top: 3px;
  color: #0f172a;
  font-size: 15px;
}

.photo-style-heading output {
  min-width: 88px;
  padding: 8px 10px;
  border: 1px solid #0f172a;
  border-radius: 999px;
  background: #0f172a;
  color: #ffffff;
  font-size: 11px;
  font-weight: 900;
  text-align: center;
}

.photo-style-presets {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.photo-style-presets button {
  display: grid;
  min-width: 0;
  min-height: 64px;
  grid-template-columns: 38px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  padding: 8px;
  border: 1px solid #d0d5dd;
  border-radius: 10px;
  background: #ffffff;
  color: #0f172a;
  text-align: left;
  transition: border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

.photo-style-presets button:not(:disabled):active {
  transform: translateY(1px);
}

.photo-style-presets button[aria-pressed="true"] {
  border-color: #0f172a;
  box-shadow: 0 0 0 2px #0f172a;
}

.photo-style-presets button > i {
  display: block;
  width: 38px;
  height: 44px;
  overflow: hidden;
  border: 1px solid #94a3b8;
  border-radius: 7px;
  background: repeating-linear-gradient(135deg, #ffffff 0 7px, #e2e8f0 7px 14px);
  box-shadow: inset 0 0 0 3px rgba(255, 255, 255, 0.56);
}

.photo-style-presets button[data-photo-style="anime"] > i {
  background: linear-gradient(150deg, #fff36d 0 35%, #ff5964 36% 58%, #3d7eff 59% 100%);
}

.photo-style-presets button[data-photo-style="ink"] > i {
  background: linear-gradient(155deg, #fff7df 0 42%, #101828 43% 57%, #e42f45 58% 100%);
}

.photo-style-presets button[data-photo-style="pastel"] > i {
  background: linear-gradient(145deg, #ffd9e8 0 34%, #d8d5ff 35% 67%, #c6f2dc 68% 100%);
}

.photo-style-presets button > span,
.photo-style-presets button b,
.photo-style-presets button small {
  display: block;
  min-width: 0;
}

.photo-style-presets button b {
  overflow: hidden;
  font-size: 12px;
  font-weight: 900;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.photo-style-presets button small {
  margin-top: 3px;
  color: #475569;
  font-size: 10px;
  font-weight: 750;
  line-height: 1.25;
}

.photo-effect-progress {
  height: 4px;
  overflow: hidden;
  border-radius: 999px;
  background: #e2e8f0;
}

.photo-effect-progress span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--guest-accent, #334155);
  transition: width 100ms linear;
}

.photo-style-control p {
  margin: 0;
  color: #475569;
  font-size: 11px;
  line-height: 1.45;
}

.photo-editor-status {
  min-height: 18px;
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.photo-editor-actions {
  display: grid;
  grid-template-columns: 1fr 0.72fr 1.25fr;
  gap: 7px;
}

.photo-editor-actions button {
  min-height: 48px;
  padding: 0 8px;
  font-size: 12px;
  font-weight: 900;
}

.photo-editor-actions .secondary-button {
  border-color: #d0d5dd;
  background: #ffffff;
  color: var(--ink);
}

.photo-use-button {
  border-radius: 10px;
  background: var(--guest-accent, #6fa0ff);
  color: var(--guest-on-accent, white);
}

.photo-viewer {
  position: fixed;
  z-index: 45;
  inset: 0;
  display: grid;
  place-items: center;
  padding: max(10px, env(safe-area-inset-top, 0px)) 10px max(10px, var(--bottom-safe));
  color: var(--ink);
}

.photo-viewer-backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background: rgba(16, 24, 40, 0.72);
  backdrop-filter: blur(10px);
}

.photo-viewer-sheet {
  position: relative;
  display: grid;
  width: min(100%, 720px);
  max-height: calc(var(--visual-height) - env(safe-area-inset-top, 0px) - var(--bottom-safe) - 20px);
  gap: 11px;
  padding: 12px;
  overflow: auto;
  border: 1px solid #d0d5dd;
  border-radius: 16px;
  background: #ffffff;
  box-shadow: 0 24px 80px rgba(16, 24, 40, 0.28);
}

.photo-viewer-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 62px 44px;
  align-items: center;
  gap: 10px;
}

.photo-viewer-header h2 {
  margin: 3px 0 0;
  font-size: clamp(18px, 5vw, 24px);
  line-height: 1.12;
  letter-spacing: -0.03em;
}

.photo-viewer-kicker {
  color: var(--guest-accent, #334155);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 8px;
  font-weight: 850;
  letter-spacing: 0.14em;
}

.photo-viewer-clock {
  display: grid;
  width: 62px;
  height: 44px;
  place-items: center;
  border: 1px solid var(--guest-accent, #334155);
  border-radius: 8px;
  background: var(--guest-accent, #334155);
  color: var(--guest-on-accent, #ffffff);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 22px;
  font-weight: 900;
  letter-spacing: -0.06em;
}

.photo-viewer.is-critical .photo-viewer-clock {
  border-color: #b42318;
  background: #b42318;
  color: #ffffff;
}

.photo-viewer-close {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid #d0d5dd;
  border-radius: 50%;
  background: #ffffff;
  color: var(--ink);
  font-size: 25px;
}

.photo-viewer button:focus-visible,
.photo-viewer-sheet:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--guest-accent, #6fa0ff) 42%, transparent);
  outline-offset: 2px;
}

.photo-viewer-stage {
  position: relative;
  display: grid;
  min-height: min(58vh, 440px);
  place-items: center;
  overflow: hidden;
  border: 1px solid #344054;
  border-radius: 7px;
  background-color: #05080d;
  background-image: radial-gradient(rgba(255, 255, 255, 0.09) 0.7px, transparent 0.8px);
  background-size: 11px 11px;
  user-select: none;
  -webkit-touch-callout: none;
}

.photo-viewer-stage img {
  display: block;
  max-width: 100%;
  max-height: min(64vh, 560px);
  object-fit: contain;
  pointer-events: none;
  user-select: none;
  -webkit-touch-callout: none;
}

.photo-viewer-loading {
  display: grid;
  justify-items: center;
  gap: 12px;
  padding: 28px;
  color: #e4e7ec;
  font-size: 12px;
  text-align: center;
}

.photo-viewer-loading span {
  width: 48px;
  height: 48px;
  border: 5px solid rgba(255, 255, 255, 0.13);
  border-top-color: var(--guest-accent, #6fa0ff);
  border-radius: 50%;
  animation: photo-aperture-turn 0.9s linear infinite;
}

.photo-viewer-rail {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  overflow: hidden;
  border: 1px solid #d0d5dd;
  border-radius: 8px;
  background: #d0d5dd;
}

.photo-viewer-rail span {
  min-width: 0;
  padding: 8px 4px;
  background: #f8fafc;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-align: center;
}

.photo-viewer-notice {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(18px + var(--bottom-safe));
  z-index: 50;
  max-width: min(92vw, 480px);
  padding: 11px 14px;
  border-radius: 8px;
  background: rgba(23, 32, 51, 0.92);
  color: white;
  font-size: 14px;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 10px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.admission-terminal {
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: calc(32px + env(safe-area-inset-top, 0px)) calc(24px + env(safe-area-inset-right, 0px)) calc(32px + var(--bottom-safe)) calc(24px + env(safe-area-inset-left, 0px));
  background: #ffffff;
  color: #172033;
}

.admission-terminal > div {
  width: 100%;
  max-width: 28rem;
}

.admission-terminal h1 {
  margin: 0 0 24px;
  font-size: clamp(28px, 8vw, 40px);
  line-height: 1.2;
  letter-spacing: -0.04em;
}

.admission-terminal p {
  margin: 0;
  color: #475467;
  font-size: 16px;
  line-height: 1.7;
}

.admission-terminal p + p {
  margin-top: 12px;
}

body.is-admission-terminal {
  min-height: 100%;
  overflow: auto;
}

body.is-admission-terminal .app-shell {
  width: 100%;
  min-height: 100vh;
  min-height: 100svh;
  height: auto;
  overflow: visible;
  border: 0;
}

[hidden] {
  display: none !important;
}

@media (max-width: 430px) {
  .section-heading {
    align-items: start;
    flex-direction: column;
  }
}

@media (max-width: 380px) {
  .chat-panel {
    gap: 12px;
    padding-inline: 12px;
  }

  .message-feed {
    height: clamp(168px, 28dvh, 220px);
  }

  .table-grid {
    grid-template-columns: 1fr;
  }

  .introduction-controls {
    grid-template-columns: 1fr 1fr;
  }

  .introduction-controls input {
    grid-column: 1 / -1;
  }

  .photo-actions {
    grid-template-columns: 1fr;
  }

  .photo-editor-actions {
    grid-template-columns: 1fr 1fr;
  }

  .photo-use-button {
    grid-column: 1 / -1;
    grid-row: 1;
  }

  .message.is-photo.has-protected-view {
    width: min(92%, 278px);
  }

  .protected-photo-card {
    grid-template-columns: 78px minmax(0, 1fr);
  }

  .protected-photo-preview {
    width: 78px;
    height: 66px;
  }

  .photo-viewer-sheet {
    padding: 10px;
  }

  .photo-viewer-header {
    grid-template-columns: minmax(0, 1fr) 52px 44px;
  }

  .photo-viewer-clock {
    width: 52px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .guest-entry-loading__mark i {
    animation: none;
  }

  .chat-expiry-fuse i {
    transition: none;
  }

  .photo-aperture {
    animation: none;
  }

  .photo-style-presets button,
  .photo-effect-progress span {
    transition: none;
  }

  .photo-viewer-loading span {
    animation: none;
  }
}
