:root {
  color-scheme: light dark;
  font-family: ui-rounded, "Instrument Sans", "Hiragino Sans", "PingFang TC", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #0a1628;
  background: #faf7f2;
  --green: #185d61;
  --ink: #0a1628;
  --muted: #626270;
  --border: #e4ded6;
  --white: #fff;
  --surface: #fffcf7;
  --aqua: #5ed6d3;
  --coral: #ff8a7a;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 300px; min-height: 100dvh; }
button, input, select { font: inherit; }
button { cursor: pointer; }
button:disabled, select:disabled { cursor: default; opacity: .55; }
button, input, select { min-height: 46px; border-radius: 11px; }
button:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid #237d80; outline-offset: 3px; }
h1, h2, p { margin: 0; }
h1 { letter-spacing: -.045em; font-size: clamp(2.1rem, 4.8vw, 4.4rem); line-height: 1.15; }
h2 { letter-spacing: -.025em; font-size: 1.2rem; }
.site-header { max-width: 1392px; padding: 24px clamp(18px, 5vw, 68px); margin: auto; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.wordmark { display: flex; align-items: center; gap: 10px; font-weight: 760; font-size: 1.38rem; letter-spacing: -.04em; white-space: nowrap; }
.brand-icon { display: block; width: 32px; height: 32px; border-radius: 9px; }
.product { color: var(--muted); font-weight: 500; font-size: .85rem; letter-spacing: 0; padding-left: 10px; border-left: 1px solid #ded7cd; }
.ui-language select { width: auto; min-height: 36px; padding: 4px 8px; background: transparent; font-size: .83rem; }
main { max-width: 1392px; margin: auto; padding: 18px clamp(18px, 5vw, 68px) 48px; }
.setup { min-height: min(660px, calc(100dvh - 140px)); display: grid; grid-template-columns: 1.1fr 1fr; align-items: center; gap: clamp(28px, 8vw, 124px); }
.guest-setup { max-width: 470px; margin: clamp(28px, 9vh, 100px) auto 0; }
.guest-setup h1 { font-size: clamp(1.65rem, 4vw, 2.4rem); }
.intro { padding: 42px 0; }
.intro p { max-width: 30rem; color: var(--muted); font-size: 1.12rem; line-height: 1.75; margin-top: 22px; }
.conversation-mark { display: flex; width: 70px; height: 54px; align-items: flex-start; margin-bottom: 28px; }
.conversation-mark span { width: 44px; height: 33px; position: relative; border-radius: 13px; background: #bde9e7; border: 1px solid #bbd7c5; }
.conversation-mark span + span { margin: 16px 0 0 -17px; background: #ffdcd5; border-color: #e5c5b5; }
.conversation-mark span::after { content: ""; position: absolute; top: 10px; left: 10px; width: 19px; height: 3px; border-radius: 3px; background: #63907a; box-shadow: 0 7px 0 #88ae9b; }
.conversation-mark span + span::after { background: #b57c65; box-shadow: 0 7px 0 #d49d86; }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: 20px; box-shadow: 0 12px 38px #0a162810; }
.form { display: grid; gap: 22px; padding: clamp(23px, 4vw, 40px); }
label { display: grid; gap: 8px; min-width: 0; font-size: .9rem; font-weight: 620; }
input, select { width: 100%; padding: 10px 12px; border: 1px solid #d9d1c6; background: var(--white); color: var(--ink); }
/* Safari's native controls use different vertical metrics. */
.form input, .language-select select {
  -webkit-appearance: none;
  appearance: none;
  height: max(46px, 3em);
  line-height: 1.25;
  margin: 0;
}
.language-select { position: relative; display: block; min-width: 0; }
.language-select select { display: block; padding-inline-end: 34px; }
.language-select::after {
  content: "";
  position: absolute;
  inset-inline-end: 15px;
  top: calc(50% - 5px);
  width: 7px;
  height: 7px;
  border: solid currentColor;
  border-width: 0 1.5px 1.5px 0;
  transform: rotate(45deg);
  pointer-events: none;
}
.primary, .secondary { padding: 10px 16px; font-weight: 680; }
.primary { background: var(--green); border: 1px solid var(--green); color: white; }
.primary:not(:disabled):hover { background: #104c50; }
.secondary { border: 1px solid #d9d1c6; background: #f6f3ed; color: var(--green); }
.secondary:not(:disabled):hover { background: #dff4f2; }
.notice { font-size: .88rem; color: #9c3c2c; line-height: 1.5; }
.notice:empty, .mic-ready:empty, #mic-status:empty { display: none; }
.room { padding-top: 20px; }
.room-header { display: flex; justify-content: space-between; align-items: end; gap: 20px; margin-bottom: 24px; }
.room-header h1 { font-size: clamp(1.9rem, 4vw, 3.2rem); }
.room-status { color: var(--green); font-size: .85rem; font-weight: 650; margin-bottom: 8px; }
.captions { display: grid; grid-template-rows: auto 1fr; min-height: clamp(230px, 47dvh, 590px); padding: clamp(20px, 3vw, 32px); }
.caption-header { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
#caption-language { font-size: .83rem; color: var(--green); background: #e0f4f3; padding: 6px 10px; border-radius: 20px; white-space: nowrap; }
.caption-empty { align-self: center; text-align: center; color: var(--muted); padding: 24px; line-height: 1.7; }
#caption-feed { margin: 18px 0 0; padding: 0 4px 0 0; list-style: none; overflow-y: auto; max-height: min(44dvh, 560px); align-self: end; }
#caption-feed:empty { display: none; }
#caption-feed li { padding: 12px 0; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; border-bottom: 1px solid #eee8e1; }
#caption-feed li:last-child { border: 0; }
.caption-translation { color: var(--ink); font-size: clamp(1.18rem, 2.1vw, 1.7rem); font-weight: 600; }
.caption-translation .caption-speaker { color: var(--speaker, var(--green)); font-weight: 700; }
.caption-original { color: var(--muted); font-size: clamp(1rem, 1.65vw, 1.3rem); }
.caption-original .caption-speaker { font-weight: 600; }
.room-controls { display: grid; gap: 8px; margin-top: 12px; padding: 12px 14px; }
.room-tools { position: relative; display: flex; align-items: stretch; flex-wrap: wrap; gap: 8px; }
.room-tools > * { min-height: 46px; }
.room-tools .microphone-control, .room-tools .more-control { width: 46px; padding: 0; }
.room-tools .settings { margin-inline-start: auto; }
.more-control { display: grid; place-items: center; min-height: 46px; border-radius: 11px; cursor: pointer; list-style: none; }
.more-control::-webkit-details-marker { display: none; }
.more-control:focus-visible { outline: 2px solid var(--green); outline-offset: 3px; }
.more-icon { width: 4px; height: 4px; border-radius: 50%; background: currentColor; box-shadow: -6px 0 currentColor, 6px 0 currentColor; }
.copy-control { display: flex; align-items: center; justify-content: center; gap: 8px; padding-inline: 12px; min-width: 46px; }
.link-icon { width: 19px; height: 16px; display: inline-flex; align-items: center; justify-content: center; transform: rotate(-42deg); }
.link-icon::before, .link-icon::after { content: ""; width: 10px; height: 7px; border: 1.5px solid currentColor; border-radius: 4px; }
.link-icon::after { margin-inline-start: -4px; }
.settings-content { position: absolute; z-index: 1; inset-inline-end: 0; bottom: calc(100% + 8px); width: min(100%, 330px); max-height: 45dvh; overflow: auto; display: grid; gap: 12px; padding: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 10px 32px #0a16282b; }
.invite-message, .mic-ready { color: var(--green); font-size: .86rem; line-height: 1.5; }
.invite-message { margin: -10px 0 12px; }
.mic-off-hint {
  padding: 10px 12px;
  border-inline-start: 3px solid var(--green);
  border-radius: 8px;
  background: color-mix(in srgb, var(--aqua) 14%, var(--surface));
  color: var(--green);
  font-weight: 650;
  line-height: 1.5;
}
.participants { font-size: .86rem; line-height: 1.5; }
.other-members > div { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0; }
.other-members > div { border-top: 1px solid #eee8e1; }
.quiet { color: var(--muted); }
.quiet { font-size: .84rem; line-height: 1.55; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }
@media (max-width: 730px) {
  .setup { grid-template-columns: 1fr; }
  .setup { gap: 16px; min-height: 0; }
  .intro { padding: 20px 0 12px; }
  .intro p { margin-top: 12px; }
  .conversation-mark { margin-bottom: 14px; }
  .room { padding-top: 0; }
  .captions { min-height: clamp(190px, 35dvh, 290px); }
  #caption-feed { max-height: 37vh; }
  .room-header { align-items: start; gap: 10px; margin-bottom: 16px; }
}
@media (max-width: 520px) {
  .site-header { flex-wrap: wrap; row-gap: 8px; }
  .room-controls { padding: 10px; }
  .room-tools { gap: 5px; }
  .copy-control > .copy-label { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
}

.demo-notice { padding: 12px 16px; border-radius: 10px; background: #f5e8d7; color: #68482e; line-height: 1.5; }

.other-members bdi { color: var(--speaker, var(--green)); font-weight: 650; overflow-wrap: anywhere; }
[data-seat="host"] { --speaker: #185d61; }
[data-seat="guest"] { --speaker: #4b4f9a; }
[data-seat="guest2"] { --speaker: #914a35; }
[data-seat="guest3"] { --speaker: #6c447c; }
.microphone-control { display: flex; align-items: center; justify-content: center; gap: 8px; }
.mic-icon { position: relative; width: 16px; height: 18px; flex: 0 0 16px; display: inline-block; }
.mic-icon::before { content: ""; position: absolute; inset: 1px 5px 6px; border: 1.5px solid; border-radius: 5px; }
.mic-icon::after { content: ""; position: absolute; inset: 7px 2px 1px; border: 1.5px solid; border-top: 0; border-radius: 0 0 8px 8px; }
.mic-indicator { position: relative; display: inline-flex; align-items: center; color: var(--muted); }
.mic-indicator[data-mic="active"] { color: var(--green); }
.mic-indicator[data-mic="muted"]::after, .microphone-control:not([data-mic="active"]) .mic-indicator::after { content: ""; position: absolute; width: 18px; height: 1.5px; background: currentColor; box-shadow: 0 0 0 1px var(--surface); transform: rotate(-48deg); }
#microphone[data-mic="muted"]:not(:disabled) .mic-indicator { color: var(--ink); }
#microphone[data-mic="connecting"] .mic-indicator, #microphone[data-mic="active"] .mic-indicator { color: var(--green); }
#microphone[data-mic="active"] { background: color-mix(in srgb, var(--aqua) 22%, var(--surface)); border-color: var(--green); }
#microphone[data-mic="connecting"] { border-style: dashed; }
.audio-control { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 6px; min-height: 46px; padding: 4px 7px; cursor: pointer; }
.audio-control input { position: absolute; inset: 0; width: 100%; height: 100%; min-height: 0; margin: 0; opacity: 0; cursor: pointer; }
.audio-switch { pointer-events: none; flex: 0 0 36px; height: 24px; padding: 3px; border: 1px solid var(--border); border-radius: 999px; background: var(--white); }
.audio-switch::before { content: ""; display: block; width: 16px; height: 16px; border-radius: 50%; background: var(--muted); }
.audio-control input:checked + .audio-switch { background: var(--green); border-color: var(--green); }
.audio-control input:checked + .audio-switch::before { margin-inline-start: auto; background: var(--surface); }
.audio-control input:focus-visible + .audio-switch { outline: 2px solid var(--green); outline-offset: 3px; }
.audio-control:has(input:disabled) { opacity: .55; cursor: default; }
#audio-info p + p { margin-top: 8px; }

#account-login { display: grid; gap: 8px; }
#login-start, .login-link { display: flex; align-items: center; justify-content: center; gap: 7px; }
.login-link { min-height: 46px; border-radius: 11px; text-decoration: none; }
.login-link:focus-visible { outline: 3px solid #237d80; outline-offset: 3px; }
#account-login button img, .login-link img { flex: none; border-radius: 6px; }
.login-prefix:empty { display: none; }
#login-divider { width: 100%; border: 0; border-top: 1px solid var(--border); margin: 0; }
.login-pairing { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
.login-pairing strong { font-variant-numeric: tabular-nums; letter-spacing: .16em; }
#login-qr { width: min(240px, 100%); height: auto; margin: 4px auto; }
#login-message:empty { display: none; }
.account-balance { display: grid; gap: 6px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 11px; }
.balance-row { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 4px 12px; font-size: .9rem; font-weight: 650; }
#balance-value { color: var(--green); font-variant-numeric: tabular-nums; }
.balance-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 4px 12px; }
.text-button { min-height: 36px; padding: 4px 2px; border: 0; background: transparent; color: var(--green); text-decoration: underline; font-size: .85rem; }

@media (prefers-color-scheme: dark) {
  :root {
    color: #f4f4f5;
    background: #0a1628;
    --ink: #f4f4f5;
    --muted: #adb2c1;
    --green: #8bdad8;
    --border: #344258;
    --surface: #142033;
    --white: #101a2b;
  }
  input, select, .product { border-color: var(--border); }
  .primary { color: #0a1628; background: var(--aqua); border-color: var(--aqua); }
  .primary:not(:disabled):hover { background: #91e5e2; }
  .secondary, #caption-language { background: #203249; border-color: var(--border); }
  .secondary:not(:disabled):hover { background: #29405a; }
  #caption-feed li, .other-members > div { border-color: var(--border); }
  .notice { color: #ffb4a9; }
  [data-seat="host"] { --speaker: #8bdad8; }
  [data-seat="guest"] { --speaker: #b9bcff; }
  [data-seat="guest2"] { --speaker: #ffc0aa; }
  [data-seat="guest3"] { --speaker: #e4b5f5; }
}

#host-caption-languages { border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; }
#host-caption-languages > p { margin-top: 8px; }
#host-caption-languages legend { font-size: .88rem; font-weight: 650; }
#host-caption-options { display: flex; flex-wrap: wrap; gap: 5px 14px; }
#host-caption-options label { display: flex; align-items: center; gap: 5px; line-height: 1.2; }
#host-caption-options input, .form .transcript-choice input {
  -webkit-appearance: auto;
  appearance: auto;
  width: 16px;
  height: 16px;
  min-height: 16px;
  margin: 0;
  accent-color: var(--green);
}

.caption-provisional { opacity: .78; }

.transcript-choice {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-height: 44px;
}

.transcript-notice {
  padding: 0.65rem 0.85rem;
  border-radius: 0.75rem;
  background: var(--surface);
}
