:root {
  color-scheme: dark;
  font-family: Pretendard, "Noto Sans KR", "Noto Sans", system-ui, -apple-system, sans-serif;
  --bg: #050b15;
  --panel: #0c1524;
  --panel-soft: rgba(18, 31, 49, 0.72);
  --panel-deep: rgba(4, 13, 29, 0.88);
  --line: rgba(182, 204, 230, 0.28);
  --text: #edf5ff;
  --muted: #afc3d9;
  --gold: #e5c479;
  --gold-bright: #f5d58b;
  --gold-dark: #b7883d;
  --gold-line: rgba(229, 196, 121, 0.42);
  --teal: #39d0bd;
  --blue: #5cc8d5;
  --error: #ef8b8b;
  --shadow: 0 24px 64px rgba(0, 0, 0, 0.38);
  color: var(--text);
  background: var(--bg);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 0; min-height: 100vh; overflow-x: hidden; background: radial-gradient(circle at 20% 0%, #10223d 0%, var(--bg) 56%); color: var(--text); line-height: 1.5; }
body::before { content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: .34; background-image: linear-gradient(90deg, rgba(229, 196, 121, .04) 1px, transparent 1px), linear-gradient(rgba(92, 200, 213, .025) 1px, transparent 1px); background-size: 64px 64px; mask-image: linear-gradient(to bottom, #000, transparent 70%); }
button, input, label { font: inherit; }
button, a, label { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
button:focus-visible, a:focus-visible, summary:focus-visible, label:focus-within { outline: 2px solid #fff; outline-offset: 3px; }
.skip-link { position: fixed; z-index: 100; top: 8px; left: 8px; transform: translateY(-160%); padding: 11px 15px; border-radius: 999px; background: var(--gold-bright); color: #081324; font-weight: 800; }
.skip-link:focus { transform: translateY(0); }

.site-header { padding: 16px 0 0; }
.header-inner, .app-shell, .footer-inner { width: min(100% - 32px, 1180px); margin-inline: auto; }
.topbar { min-height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 12px 16px; border: 1px solid var(--gold-line); border-radius: 20px; background: linear-gradient(160deg, rgba(17, 28, 44, .92), rgba(10, 17, 30, .88)); box-shadow: var(--shadow); backdrop-filter: blur(10px); }
.brand { min-width: 0; display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand-logo { width: 50px; height: 50px; flex: 0 0 auto; object-fit: cover; border-radius: 12px; }
.brand-copy { min-width: 0; }
.brand-copy strong, .brand-copy small { display: block; }
.brand-copy strong { color: #fff8e7; font-size: .98rem; line-height: 1.2; letter-spacing: -.01em; }
.brand-copy small { margin-top: 4px; color: var(--muted); font-size: .7rem; line-height: 1.25; }
.header-actions { min-width: 0; display: flex; align-items: center; justify-content: flex-end; gap: 14px; flex-wrap: wrap; }
.header-links { display: flex; align-items: center; gap: 8px; }
.nav-pill, .language-badge { min-height: 38px; display: inline-flex; align-items: center; justify-content: center; padding: 7px 12px; border: 1px solid var(--gold-line); border-radius: 999px; background: rgba(229, 196, 121, .08); color: #fff5d9; font-size: .78rem; font-weight: 700; text-decoration: none; white-space: nowrap; }
.nav-pill:hover, .language-badge:hover { border-color: rgba(246, 218, 145, .92); background: rgba(229, 196, 121, .16); }
.language-character-selector { max-width: 100%; display: flex; align-items: flex-start; gap: 8px; padding: 3px; overflow-x: auto; overscroll-behavior-inline: contain; scrollbar-width: thin; }
.language-character-button { width: 62px; min-width: 62px; min-height: 78px; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 3px; border: 1px solid transparent; border-radius: 16px; background: transparent; color: var(--muted); cursor: pointer; }
.character-frame { position: relative; width: 54px; height: 54px; display: grid; place-items: center; overflow: hidden; border: 1px solid var(--gold-line); border-radius: 50%; background: rgba(8, 24, 48, .82); box-shadow: 0 8px 20px rgba(0, 0, 0, .28); }
.character-frame img { width: 100%; height: 100%; display: block; object-fit: contain; border-radius: 50%; }
.character-fallback { display: none; color: var(--gold-bright); font-size: .72rem; font-weight: 900; }
.character-name { max-width: 58px; overflow: hidden; color: inherit; font-size: .62rem; font-weight: 800; line-height: 1.15; text-overflow: ellipsis; white-space: nowrap; }
.language-character-button:hover .character-frame { border-color: rgba(92, 200, 213, .85); box-shadow: 0 0 22px rgba(92, 200, 213, .28); }
.language-character-button[aria-pressed="true"] { color: #fff5d9; background: rgba(229, 196, 121, .08); }
.language-character-button[aria-pressed="true"] .character-frame { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(57, 208, 189, .16), 0 0 26px rgba(57, 208, 189, .38); }
.language-character-button.image-failed img { display: none; }
.language-character-button.image-failed .character-fallback { display: block; }

.app-shell { padding: 44px 0 54px; }
.hero { max-width: 900px; margin: 0 auto; text-align: center; }
.service-label, .section-label { display: inline-flex; margin: 0 0 13px; padding: 6px 11px; border: 1px solid var(--gold-line); border-radius: 999px; background: rgba(229, 196, 121, .1); color: var(--gold-bright); font-size: .77rem; font-weight: 800; letter-spacing: .07em; }
h1, .session-heading h2 { margin: 0; color: #fff8e7; letter-spacing: -.035em; }
h1 { font-size: clamp(2rem, 5vw, 3.7rem); line-height: 1.16; text-shadow: 0 18px 48px rgba(0, 0, 0, .42); }
.hero-description { margin: 17px auto 0; color: #dbe6f3; font-size: clamp(.98rem, 2vw, 1.1rem); line-height: 1.7; }
.hero-vi { margin: 12px 0 0; color: var(--gold-bright); font-size: .94rem; font-weight: 700; }
.trust-badges { display: flex; justify-content: center; flex-wrap: wrap; gap: 9px; margin: 22px 0 0; padding: 0; list-style: none; }
.trust-badges li { min-height: 40px; display: inline-flex; align-items: center; gap: 7px; padding: 7px 13px; border: 1px solid rgba(229, 196, 121, .28); border-radius: 999px; background: rgba(255, 255, 255, .055); color: #e9f1fb; font-size: .78rem; font-weight: 700; }
.trust-badges span { color: var(--gold-bright); }

.session-panel { margin-top: 30px; padding: 24px; border: 1px solid rgba(229, 196, 121, .64); border-radius: 22px; background: linear-gradient(145deg, rgba(255, 248, 231, .08), rgba(5, 15, 34, .9)); box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, .08); backdrop-filter: blur(10px); }
.session-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 22px; }
.session-heading h2 { font-size: 1.45rem; }
.session-guide { margin: 7px 0 0; color: var(--muted); font-size: .88rem; }
.status { min-height: 40px; display: inline-flex; align-items: center; gap: 7px; padding: 7px 12px; border: 1px solid var(--gold-line); border-radius: 999px; background: rgba(3, 12, 27, .72); color: #fff5d9; font-size: .79rem; font-weight: 800; white-space: nowrap; }
.status::before { content: "○"; color: var(--gold-bright); font-weight: 900; }
.status.is-live { border-color: rgba(57, 208, 189, .55); background: rgba(24, 94, 85, .32); color: #bdfaf2; }
.status.is-live::before { content: "✓"; color: var(--teal); }
.status.is-busy { border-color: rgba(92, 200, 213, .55); background: rgba(25, 70, 92, .42); color: #d4f5ff; }
.status.is-busy::before { content: "…"; color: var(--blue); }
.interpretation-selector { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 20px; padding: 14px 16px; border: 1px solid rgba(229, 196, 121, .24); border-radius: 16px; background: rgba(3, 12, 27, .52); }
.interpretation-selector strong { color: #fff8e7; font-size: .9rem; }
.interpretation-selector p { margin: 3px 0 0; color: var(--muted); font-size: .75rem; }
.interpretation-options { display: flex; align-items: center; justify-content: flex-end; gap: 7px; flex-wrap: wrap; }
.interpretation-option { min-height: 44px; padding: 8px 13px; border: 1px solid var(--gold-line); border-radius: 999px; background: rgba(229, 196, 121, .06); color: #e9f1fb; cursor: pointer; font-size: .76rem; font-weight: 800; }
.interpretation-option:hover { border-color: var(--gold-bright); background: rgba(229, 196, 121, .13); }
.interpretation-option[aria-pressed="true"] { border-color: var(--teal); background: rgba(57, 208, 189, .16); color: #d9fffa; box-shadow: 0 0 0 2px rgba(57, 208, 189, .1); }
.interpretation-option:disabled { cursor: default; opacity: .78; }
.interpretation-option:disabled[aria-pressed="true"] { opacity: 1; }

.start-button, .talk-button, .secondary-button, .danger-button, .retry-button, .card-replay { border-radius: 999px; cursor: pointer; font-weight: 800; }
.start-button { width: 100%; min-height: 64px; margin-top: 20px; padding: 14px 22px; border: 0; background: linear-gradient(135deg, var(--gold-bright), var(--gold-dark)); color: #081324; font-size: 1rem; box-shadow: 0 16px 34px rgba(183, 136, 61, .24); }
.start-button:hover { filter: brightness(1.07); }
.session-privacy { margin: 11px 0 0; color: var(--muted); font-size: .76rem; text-align: center; }
.session-privacy span { color: var(--gold-bright); }

.talk-controls { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-top: 26px; }
.language-card { min-width: 0; display: flex; flex-direction: column; gap: 14px; padding: 19px; border: 1px solid var(--gold-line); border-radius: 20px; background: rgba(4, 13, 29, .68); box-shadow: 0 18px 48px rgba(0, 0, 0, .28), inset 0 1px 0 rgba(255, 255, 255, .05); }
.language-card.is-foreign { border-color: rgba(92, 200, 213, .5); background: linear-gradient(155deg, rgba(12, 35, 55, .8), rgba(4, 13, 29, .7)); }
.language-card-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.language-kicker { margin: 0; color: var(--gold-bright); font-size: .7rem; font-weight: 900; letter-spacing: .12em; }
.is-foreign .language-kicker { color: #91e7f2; }
.language-card h3 { margin: 3px 0 0; color: #fff8e7; font-size: 1rem; }
.card-status { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); font-size: .73rem; font-weight: 700; }
.card-status::before { content: "○"; color: var(--gold-bright); }
.language-card.is-listening .card-status { color: #bdfaf2; }
.language-card.is-listening .card-status::before { content: "●"; color: var(--teal); }
.card-caption { min-width: 0; min-height: 102px; padding: 14px; border: 1px solid rgba(182, 204, 230, .2); border-radius: 14px; background: rgba(3, 10, 24, .72); }
.card-caption.is-translation { min-height: 116px; border-color: rgba(229, 196, 121, .2); background: rgba(229, 196, 121, .055); }
.is-foreign .card-caption.is-translation { border-color: rgba(92, 200, 213, .22); background: rgba(92, 200, 213, .055); }
.card-caption-label { color: var(--muted); font-size: .7rem; font-weight: 800; }
.card-caption p { margin: 7px 0 0; color: #c6d5e8; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; word-break: break-word; }
.card-caption.is-translation p { color: #fff8e7; font-size: 1.12rem; font-weight: 800; }
.card-caption p.placeholder { color: #8293a8; font-size: .86rem; font-weight: 500; }
.talk-button { min-width: 0; min-height: 70px; padding: 13px 18px; border: 1px solid var(--gold-line); background: rgba(229, 196, 121, .1); color: #fff8e7; text-align: center; touch-action: none; user-select: none; transition: background .15s ease, border-color .15s ease, transform .15s ease; }
.is-foreign .talk-button { border-color: rgba(92, 200, 213, .48); background: rgba(56, 189, 248, .1); color: #e7faff; }
.talk-button strong, .talk-button span { display: block; overflow-wrap: anywhere; }
.talk-button strong { font-size: .98rem; }
.talk-button span { margin-top: 4px; color: var(--muted); font-size: .72rem; font-weight: 500; }
.talk-button.is-pressed { transform: translateY(1px); border-color: var(--teal); background: rgba(24, 150, 135, .42); color: #fff; box-shadow: 0 0 0 4px rgba(57, 208, 189, .12); }
.talk-button:disabled { cursor: wait; border-color: rgba(148, 163, 184, .24); background: rgba(71, 85, 105, .18); color: #8291a4; }
.card-replay { min-height: 48px; padding: 9px 14px; border: 1px solid var(--line); background: transparent; color: #dbe6f3; }
.card-replay:hover { border-color: var(--gold-line); background: rgba(255, 255, 255, .06); }

.canonical-captions { position: absolute !important; width: 1px !important; height: 1px !important; overflow: hidden !important; clip: rect(0 0 0 0) !important; clip-path: inset(50%) !important; white-space: nowrap !important; }
.session-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; margin-top: 18px; }
.secondary-button, .danger-button { min-height: 48px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 9px 15px; border: 1px solid var(--gold-line); background: rgba(255, 255, 255, .055); color: #fff4d4; font-size: .8rem; text-decoration: none; }
.secondary-button:hover, .danger-button:hover { border-color: rgba(246, 218, 145, .8); background: rgba(229, 196, 121, .1); }
.caption-toggle { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
.caption-toggle:checked + label { border-color: var(--gold-bright); background: rgba(229, 196, 121, .16); }
.session-panel:has(.caption-toggle:checked) .card-caption p { font-size: clamp(1.3rem, 4vw, 1.65rem); }
.end-button { margin-left: auto; border-color: rgba(182, 204, 230, .28); color: #d5dfeb; }
button:disabled { cursor: not-allowed; opacity: .48; }

.connection-error { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; margin-top: 16px; padding: 14px; border: 1px solid rgba(239, 139, 139, .38); border-radius: 14px; background: rgba(81, 24, 32, .52); color: #ffd6d6; }
.connection-error:has(#error-message[hidden]) { display: none; }
.error-icon { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: rgba(239, 139, 139, .18); color: var(--error); font-weight: 900; }
.connection-error strong { color: #fff0f0; }
.error-message, .error-guide { margin: 3px 0 0; color: #efc1c1; font-size: .8rem; }
.retry-button { min-height: 44px; padding: 8px 13px; border: 1px solid rgba(239, 139, 139, .42); background: rgba(255, 255, 255, .05); color: #ffe3e3; }

.safety-notice { margin-top: 14px; border: 1px solid var(--gold-line); border-radius: 16px; background: rgba(4, 13, 29, .72); color: #e9f1fb; }
.safety-notice summary { min-height: 58px; display: flex; align-items: center; gap: 9px; padding: 13px 16px; cursor: pointer; font-size: .84rem; }
.safety-notice summary::marker { content: ""; }
.safety-notice summary > span[aria-hidden="true"] { display: inline-grid; place-items: center; width: 25px; height: 25px; flex: 0 0 auto; border: 1px solid var(--gold-line); border-radius: 50%; color: var(--gold-bright); font-weight: 900; }
#safety-notice-text { min-width: 0; flex: 1 1 auto; overflow-wrap: anywhere; word-break: keep-all; }
.safety-notice summary strong { flex: 0 0 auto; margin-left: auto; color: var(--gold-bright); text-decoration: underline; text-underline-offset: 3px; white-space: nowrap; }
.safety-detail { padding: 0 16px 15px 50px; border-top: 1px solid rgba(229, 196, 121, .18); color: var(--muted); }
.safety-detail p { margin: 9px 0 0; font-size: .82rem; }

.site-footer { border-top: 1px solid rgba(229, 196, 121, .2); background: rgba(3, 10, 24, .72); }
.footer-inner { display: grid; grid-template-columns: 1fr auto; gap: 12px 24px; padding: 30px 0; color: var(--muted); font-size: .79rem; }
.footer-inner strong { color: #fff8e7; }
.footer-inner p { margin: 4px 0 0; }
.footer-links { display: flex; gap: 9px; flex-wrap: wrap; }
.footer-links a { min-height: 38px; display: inline-flex; align-items: center; padding: 6px 11px; border: 1px solid var(--gold-line); border-radius: 999px; color: #fff4d4; text-decoration: none; }
.copyright { grid-column: 1 / -1; padding-top: 11px; border-top: 1px solid rgba(229, 196, 121, .14); }

@media (max-width: 768px) {
  .topbar { align-items: flex-start; flex-wrap: wrap; }
  .brand { flex: 1 1 260px; }
  .header-actions { flex: 1 1 100%; align-items: flex-start; justify-content: flex-start; }
  .language-character-selector { width: 100%; }
  .interpretation-selector { align-items: flex-start; flex-direction: column; }
  .interpretation-options { width: 100%; justify-content: flex-start; flex-wrap: nowrap; overflow-x: auto; padding-bottom: 3px; }
  .app-shell { padding-top: 34px; }
  .talk-controls { grid-template-columns: 1fr; }
  .session-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .secondary-button, .danger-button { width: 100%; }
  .end-button { grid-column: 1 / -1; margin-left: 0; }
  .footer-inner { grid-template-columns: 1fr; }
  .copyright { grid-column: auto; }
}

@media (max-width: 480px) {
  .header-inner, .app-shell, .footer-inner { width: min(100% - 24px, 1180px); }
  .site-header { padding-top: 10px; }
  .topbar { padding: 12px; border-radius: 16px; }
  .brand-logo { width: 44px; height: 44px; }
  .brand-copy strong { font-size: .82rem; }
  .brand-copy small { font-size: .62rem; }
  .nav-pill, .language-badge { min-height: 36px; padding-inline: 10px; font-size: .7rem; }
  .language-character-button { width: 58px; min-width: 58px; min-height: 73px; }
  .character-frame { width: 50px; height: 50px; }
  .privacy-link { display: none; }
  .app-shell { padding-top: 28px; }
  h1 { font-size: clamp(1.85rem, 10vw, 2.45rem); }
  .hero-description { font-size: .92rem; }
  .trust-badges { justify-content: flex-start; }
  .trust-badges li { font-size: .7rem; }
  .session-panel { padding: 17px; border-radius: 18px; }
  .session-heading { display: block; }
  .status { margin-top: 13px; }
  .language-card { padding: 15px; }
  .talk-button { min-height: 72px; }
  .card-caption { min-height: 94px; }
  .session-actions { grid-template-columns: 1fr 1fr; }
  .connection-error { grid-template-columns: auto 1fr; }
  .retry-button { grid-column: 1 / -1; width: 100%; }
  .safety-notice summary { align-items: flex-start; }
  .safety-notice summary strong { display: none; }
  .safety-detail { padding-left: 16px; }
  .footer-links { gap: 7px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
