[hidden] { display: none !important; }

:root {
  --bg: #f4f5f9;
  --bg-glow-1: rgba(99, 102, 241, .14);
  --bg-glow-2: rgba(20, 184, 166, .12);
  --surface: rgba(255, 255, 255, .82);
  --surface-solid: #ffffff;
  --surface-2: #eef0f5;
  --text: #0e1017;
  --muted: #646b7a;
  --line: rgba(14, 16, 23, .08);
  --line-strong: rgba(14, 16, 23, .14);
  --a: #6366f1;
  --a-soft: rgba(99, 102, 241, .12);
  --b: #0d9488;
  --b-soft: rgba(13, 148, 136, .12);
  --danger: #e5484d;
  --grad: linear-gradient(135deg, #6366f1 0%, #8b5cf6 45%, #14b8a6 100%);
  --stage: #0b0d13;
  --stage-text: #f5f7fb;
  --shadow: 0 1px 2px rgba(14, 16, 23, .04), 0 8px 24px rgba(14, 16, 23, .06);
  --shadow-lg: 0 18px 50px rgba(14, 16, 23, .16);
  --r: 18px;
  --r-sm: 12px;
  --nav-h: 0px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0a0c11;
    --bg-glow-1: rgba(99, 102, 241, .20);
    --bg-glow-2: rgba(20, 184, 166, .14);
    --surface: rgba(22, 25, 34, .78);
    --surface-solid: #161922;
    --surface-2: #1d212c;
    --text: #eceef4;
    --muted: #949bab;
    --line: rgba(255, 255, 255, .07);
    --line-strong: rgba(255, 255, 255, .13);
    --a: #818cf8;
    --a-soft: rgba(129, 140, 248, .16);
    --b: #2dd4bf;
    --b-soft: rgba(45, 212, 191, .14);
    --stage: #05060a;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
    --shadow-lg: 0 18px 50px rgba(0, 0, 0, .5);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(900px 500px at 8% -10%, var(--bg-glow-1), transparent 60%),
    radial-gradient(800px 500px at 100% 0%, var(--bg-glow-2), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font: 16px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Sans", "Noto Sans JP", "Yu Gothic UI", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px));
}
::selection { background: var(--a-soft); }
svg { width: 20px; height: 20px; flex: none; }

/* ---------- header & nav ---------- */
.top {
  display: flex; align-items: center; justify-content: space-between;
  max-width: 920px; margin: 0 auto;
  padding: max(14px, env(safe-area-inset-top, 0px)) 20px 10px;
}
.brand { display: flex; align-items: center; gap: 10px; }
.logo {
  width: 30px; height: 30px; border-radius: 9px; background: var(--grad);
  box-shadow: 0 6px 18px rgba(99, 102, 241, .35);
  position: relative;
}
.logo::before, .logo::after {
  content: ""; position: absolute; left: 7px; height: 2.6px; border-radius: 2px; background: #fff;
}
.logo::before { top: 10px; width: 12px; box-shadow: 0 5.5px 0 -0.1px #fff; }
.logo::after { top: 21px; width: 15px; }
h1 { font-size: 18px; margin: 0; font-weight: 700; letter-spacing: -.01em; }
h2 { font-size: 16px; margin: 0; font-weight: 650; letter-spacing: -.005em; display: flex; align-items: center; gap: 8px; }
.plan, .badge {
  font-size: 11.5px; font-weight: 650; letter-spacing: .04em; text-transform: uppercase;
  padding: 3px 10px; border-radius: 999px; border: 1px solid var(--line-strong); color: var(--muted);
  background: var(--surface);
}
.plan.pro, .badge { color: #fff; border-color: transparent; background: var(--grad); }
.badge { font-size: 10.5px; padding: 2px 8px; }

.tabs {
  display: flex; gap: 4px; max-width: 920px; margin: 6px auto 0; padding: 0 20px;
}
.tabs button {
  display: inline-flex; align-items: center; gap: 8px;
  background: transparent; border: 0; padding: 9px 14px; border-radius: 999px;
  color: var(--muted); font: inherit; font-size: 14.5px; font-weight: 560; cursor: pointer;
  transition: background .2s, color .2s;
}
.tabs button:hover { color: var(--text); background: var(--surface-2); }
.tabs button[aria-selected="true"] { color: var(--text); background: var(--surface-solid); box-shadow: var(--shadow); }
.tabs .ti { width: 18px; height: 18px; }
.tabs button[aria-selected="true"] .ti { color: var(--a); }

main { max-width: 920px; margin: 0 auto; padding: 18px 20px 8px; }
.panel { display: flex; flex-direction: column; gap: 14px; animation: fade .3s ease; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- basic controls ---------- */
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  box-shadow: var(--shadow); padding: 16px;
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
}
.form { display: flex; flex-direction: column; gap: 14px; }
label { color: var(--muted); font-size: 13px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.lbl { font-size: 12px; font-weight: 600; color: var(--muted); letter-spacing: .02em; display: inline-flex; align-items: center; gap: 6px; }
select, input, textarea {
  font: inherit; font-size: 15px; color: var(--text); width: 100%;
  background: var(--surface-solid); border: 1px solid var(--line-strong); border-radius: var(--r-sm);
  padding: 10px 12px; outline: none; transition: border-color .15s, box-shadow .15s;
}
select {
  appearance: none; -webkit-appearance: none; padding-right: 34px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M6 8l4 4 4-4' fill='none' stroke='%23888' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; background-size: 18px;
}
select:focus, input:focus, textarea:focus { border-color: var(--a); box-shadow: 0 0 0 4px var(--a-soft); }
textarea { resize: vertical; line-height: 1.6; }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: .7; }

button { font: inherit; cursor: pointer; color: var(--text); -webkit-tap-highlight-color: transparent; }
button:disabled { opacity: .45; cursor: not-allowed; }
button:focus-visible, select:focus-visible { outline: 3px solid var(--a-soft); outline-offset: 2px; }
.primary {
  border: 0; border-radius: 999px; padding: 10px 20px; font-weight: 650; font-size: 15px;
  color: #fff; background: var(--grad); background-size: 140% 140%;
  box-shadow: 0 6px 18px rgba(99, 102, 241, .32);
  transition: transform .12s, box-shadow .2s, background-position .4s;
}
.primary:hover:not(:disabled) { background-position: 100% 50%; box-shadow: 0 8px 24px rgba(99, 102, 241, .42); }
.primary:active:not(:disabled) { transform: scale(.97); }
.primary.lg { padding: 13px 26px; font-size: 16px; align-self: flex-start; }
.chip {
  border: 1px solid var(--line-strong); background: var(--surface-solid); border-radius: 999px;
  padding: 6px 13px; font-size: 13px; font-weight: 560; color: var(--text);
  transition: background .15s, border-color .15s;
}
.chip:hover { background: var(--surface-2); }
.chip.solid { background: var(--text); color: var(--bg); border-color: transparent; }
.chip.danger { color: var(--danger); }
.actions { display: flex; gap: 6px; flex-wrap: wrap; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.muted { color: var(--muted); font-size: 13px; }
.status { margin: 0; font-size: 13.5px; color: var(--muted); min-height: 1.5em; text-align: center; }

/* switch */
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 14px; color: var(--text); user-select: none; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch .track {
  width: 38px; height: 22px; border-radius: 999px; background: var(--line-strong); position: relative; flex: none;
  transition: background .2s;
}
.switch .track::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .2s;
}
.switch input:checked + .track { background: var(--a); }
.switch input:checked + .track::after { transform: translateX(16px); }
.switch input:focus-visible + .track { box-shadow: 0 0 0 4px var(--a-soft); }

fieldset { border: 0; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
fieldset:disabled { opacity: .5; }

/* ---------- language bar ---------- */
.lang-bar {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: end; gap: 10px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  box-shadow: var(--shadow); padding: 12px 14px;
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
}
.lang { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.lang select { border: 0; background-color: transparent; padding: 4px 30px 4px 0; font-size: 17px; font-weight: 650; box-shadow: none; }
.lang select:focus { box-shadow: none; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.dot.a { background: var(--a); }
.dot.b { background: var(--b); }
.swap {
  width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line-strong);
  background: var(--surface-solid); display: grid; place-items: center; margin-bottom: 2px;
  transition: transform .3s, background .15s;
}
.swap:hover { background: var(--surface-2); transform: rotate(180deg); }

/* ---------- caption stage ---------- */
.stage {
  position: relative; overflow: hidden;
  background:
    radial-gradient(600px 220px at 0% 0%, rgba(99, 102, 241, .28), transparent 70%),
    radial-gradient(500px 220px at 100% 100%, rgba(20, 184, 166, .22), transparent 70%),
    var(--stage);
  color: var(--stage-text); border-radius: 22px; padding: 14px 20px 22px;
  min-height: 210px; display: flex; flex-direction: column;
  box-shadow: var(--shadow-lg);
}
.stage-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.stage-tag {
  display: inline-flex; align-items: center; gap: 7px; font-size: 11.5px; font-weight: 650;
  letter-spacing: .08em; text-transform: uppercase; color: rgba(255, 255, 255, .6);
}
.live { width: 7px; height: 7px; border-radius: 50%; background: #ff5a5f; box-shadow: 0 0 0 0 rgba(255, 90, 95, .6); animation: beacon 2s infinite; }
@keyframes beacon { 0% { box-shadow: 0 0 0 0 rgba(255, 90, 95, .55); } 70% { box-shadow: 0 0 0 8px rgba(255, 90, 95, 0); } 100% { box-shadow: 0 0 0 0 rgba(255, 90, 95, 0); } }
.stage-actions { display: flex; gap: 6px; }
.stage .chip { background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .14); color: rgba(255, 255, 255, .85); }
.stage .chip:hover { background: rgba(255, 255, 255, .16); }
.stage-body { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; gap: 8px; padding-top: 18px; }
.stage-state {
  align-self: flex-start; display: inline-flex; align-items: center; gap: 8px; margin-bottom: auto;
  padding: 5px 12px 5px 10px; border-radius: 999px; font-size: 13px; font-weight: 600;
  background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .12); color: rgba(255, 255, 255, .78);
}
.stage-body:has(.stage-state:not([hidden])) { justify-content: space-between; }
.meter { display: inline-flex; align-items: center; gap: 2px; height: 14px; }
.meter i { width: 3px; height: 4px; border-radius: 2px; background: currentColor; transition: height .08s; }
.stage-state[data-st="speaking"] { color: #fff; border-color: rgba(129, 140, 248, .6); background: rgba(99, 102, 241, .28); }
.stage-state[data-st="speaking"] .meter i { height: calc(4px + var(--lv, 0) * 10px); }
.stage-state[data-st="speaking"] .meter i:nth-child(2), .stage-state[data-st="speaking"] .meter i:nth-child(4) { height: calc(4px + var(--lv, 0) * 7px); }
.stage-state[data-st="speaking"] .meter i:nth-child(1), .stage-state[data-st="speaking"] .meter i:nth-child(5) { height: calc(4px + var(--lv, 0) * 4px); }
.stage-state[data-st="processing"] { color: #fff; border-color: rgba(45, 212, 191, .55); background: rgba(20, 184, 166, .24); }
.stage-state[data-st="processing"] .meter i { animation: wait 1s ease-in-out infinite; }
.stage-state[data-st="processing"] .meter i:nth-child(2) { animation-delay: .1s; }
.stage-state[data-st="processing"] .meter i:nth-child(3) { animation-delay: .2s; }
.stage-state[data-st="processing"] .meter i:nth-child(4) { animation-delay: .3s; }
.stage-state[data-st="processing"] .meter i:nth-child(5) { animation-delay: .4s; }
@keyframes wait { 50% { height: 12px; } }
.sub-original { color: rgba(255, 255, 255, .58); font-size: 16px; line-height: 1.5; }
.sub-original:empty { display: none; }
.sub-translated { font-size: 27px; font-weight: 680; line-height: 1.38; letter-spacing: -.01em; text-wrap: balance; }
.sub-translated:empty::before { content: attr(data-empty); color: rgba(255, 255, 255, .38); font-size: 16px; font-weight: 500; }

body.big .tabs, body.big .consent { display: none; }
body.big { overflow: hidden; }
body.big #subtitle {
  position: fixed; inset: 0; z-index: 40; border-radius: 0; min-height: 0;
  padding: max(18px, env(safe-area-inset-top)) max(28px, env(safe-area-inset-right)) max(32px, env(safe-area-inset-bottom)) max(28px, env(safe-area-inset-left));
}
body.big #subtitle .sub-original { font-size: clamp(18px, 3vw, 28px); }
body.big #subtitle .sub-translated { font-size: clamp(32px, 6.5vw, 72px); }

/* ---------- talk buttons ---------- */
.talk { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.talk-btn {
  --c: var(--a); --soft: var(--a-soft);
  position: relative; display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto;
  column-gap: 14px; align-items: center; text-align: left;
  padding: 14px 16px; border-radius: var(--r); border: 1px solid var(--line);
  background: var(--surface); box-shadow: var(--shadow);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  transition: transform .12s, border-color .2s, box-shadow .2s;
}
.talk-btn.b { --c: var(--b); --soft: var(--b-soft); }
.talk-btn.auto { grid-column: 1 / -1; --c: #8b5cf6; --soft: rgba(139, 92, 246, .16); }
.talk-btn.auto::before { background-color: transparent; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round'%3E%3Crect x='9' y='3' width='6' height='11' rx='3'/%3E%3Cpath d='M5 11a7 7 0 0 0 14 0M12 18v3'/%3E%3C/svg%3E"), var(--grad); background-size: 22px, cover; background-position: center; background-repeat: no-repeat; }
.talk-btn::before {
  content: ""; grid-row: 1 / 3; width: 48px; height: 48px; border-radius: 50%;
  background: var(--c) center / 22px no-repeat;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round'%3E%3Crect x='9' y='3' width='6' height='11' rx='3'/%3E%3Cpath d='M5 11a7 7 0 0 0 14 0M12 18v3'/%3E%3C/svg%3E");
  box-shadow: 0 6px 16px var(--soft);
}
.talk-btn:hover { border-color: var(--c); }
.talk-btn:active { transform: scale(.98); }
.tb-hint { font-size: 12px; color: var(--muted); font-weight: 560; }
.tb-lang { font-size: 18px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.talk-btn.active { border-color: var(--c); box-shadow: 0 0 0 4px var(--soft), var(--shadow); }
.talk-btn.active::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Crect x='7' y='7' width='10' height='10' rx='2' fill='white'/%3E%3C/svg%3E");
  animation: ring 1.6s infinite;
}
.talk-btn.active .tb-hint { color: var(--c); }
.talk-btn.active .tb-hint { font-size: 0; }
.talk-btn.active .tb-hint::after { content: "聞き取り中…タップで停止"; font-size: 12px; }
@keyframes ring { 0% { box-shadow: 0 0 0 0 var(--c); } 70% { box-shadow: 0 0 0 12px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }

.options { display: flex; gap: 16px; align-items: end; flex-wrap: wrap; padding: 14px 16px; }
.options .grow { flex: 1 1 260px; }
.options .speak-row { display: flex; align-items: center; gap: 10px; padding-bottom: 6px; }

/* ---------- feeds ---------- */
.section-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 6px; }
.feed { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.feed:empty::before { content: attr(data-empty); color: var(--muted); font-size: 13.5px; padding: 18px; text-align: center; border: 1px dashed var(--line-strong); border-radius: var(--r); }
.feed:not([data-empty]):empty::before { content: none; }
.feed li {
  position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm);
  padding: 12px 14px 12px 18px; box-shadow: var(--shadow); animation: rise .25s ease both;
}
.feed li::before { content: ""; position: absolute; left: 0; top: 12px; bottom: 12px; width: 3px; border-radius: 0 3px 3px 0; background: var(--a); }
.feed li.b::before, .feed li.theirs::before { background: var(--b); }
.feed .t { font-size: 16px; font-weight: 560; }
.feed.selecting li { cursor: pointer; padding-right: 44px; -webkit-tap-highlight-color: transparent; }
.feed.selecting li::after { content: ""; position: absolute; right: 14px; top: 50%; width: 20px; height: 20px; margin-top: -10px; border-radius: 50%; border: 2px solid var(--muted); box-sizing: border-box; }
.feed.selecting li.sel { outline: 2px solid #ef4444; outline-offset: -2px; }
.feed.selecting li.sel::after { border-color: #ef4444; background: #ef4444 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5 10.5l3 3 7-7' fill='none' stroke='white' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/14px no-repeat; }
.feed .o { color: var(--muted); font-size: 14px; }
.feed .meta, .feed .who { font-size: 11.5px; color: var(--muted); font-weight: 600; }
.feed .meta { margin-top: 2px; }

/* ---------- text translate ---------- */
.translate-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.pane { display: flex; flex-direction: column; gap: 10px; padding: 12px; }
.pane textarea { border: 0; background: transparent; box-shadow: none; padding: 6px; font-size: 18px; flex: 1; min-height: 180px; }
.pane textarea:focus { box-shadow: none; }
.pane.out { background: var(--surface-2); }
.output { flex: 1; min-height: 180px; padding: 6px; white-space: pre-wrap; font-size: 18px; font-weight: 560; }
.output:empty::before { content: attr(data-empty); color: var(--muted); font-weight: 400; opacity: .8; }
.pane-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; }

.usage { display: grid; gap: 8px; }
.usage div { display: flex; justify-content: space-between; align-items: baseline; padding: 10px 12px; border-radius: var(--r-sm); background: var(--surface-2); font-size: 14px; }
.usage b { font-size: 15px; font-variant-numeric: tabular-nums; }
.usage .hq-row { background: linear-gradient(135deg, rgba(99,102,241,.14), rgba(139,92,246,.14)); }
.hq-badge { font-size: 11.5px; font-weight: 600; padding: 3px 9px; border-radius: 999px; color: #fff; background: var(--grad); font-variant-numeric: tabular-nums; white-space: nowrap; }
.hq-badge.off { color: rgba(255,255,255,.7); background: rgba(255,255,255,.12); }
.stage-top .hq-badge { margin-right: auto; }
.summary { margin: 0 0 12px; }
.summary .section-head { margin: 0 0 8px; }
.summary-out { white-space: pre-wrap; font-size: 14.5px; line-height: 1.7; }

/* ---------- room ---------- */
.hero { display: flex; flex-direction: column; gap: 12px; padding: 26px 22px; text-align: left; }
.hero p { margin: 0; font-size: 14.5px; line-height: 1.7; max-width: 600px; }
.hero h2 { font-size: 21px; }
.hero-art { display: flex; margin-bottom: 4px; }
.hero-art span { width: 40px; height: 40px; border-radius: 50%; border: 3px solid var(--surface-solid); margin-right: -10px; }
.hero-art span:nth-child(1) { background: linear-gradient(135deg, #6366f1, #8b5cf6); }
.hero-art span:nth-child(2) { background: linear-gradient(135deg, #14b8a6, #22d3ee); }
.hero-art span:nth-child(3) { background: linear-gradient(135deg, #f59e0b, #f43f5e); }
#roomLive { display: flex; flex-direction: column; gap: 14px; }
.share {
  display: flex; align-items: center; gap: 8px; padding: 6px 6px 6px 14px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 999px; box-shadow: var(--shadow);
}
.share .ti { color: var(--muted); width: 18px; height: 18px; }
.share input { flex: 1; min-width: 0; border: 0; background: transparent; padding: 6px 0; font-size: 13.5px; box-shadow: none; color: var(--muted); }
.share input:focus { box-shadow: none; }
.roster { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.roster li {
  font-size: 12.5px; font-weight: 560; border: 1px solid var(--line-strong); border-radius: 999px;
  padding: 4px 12px; background: var(--surface-solid);
}
.roster li.me { border-color: var(--a); color: var(--a); background: var(--a-soft); }
.mic-row { display: flex; justify-content: center; }
.mic-btn {
  display: inline-flex; align-items: center; gap: 10px; border: 0; border-radius: 999px;
  padding: 14px 30px 14px 22px; font-size: 17px; font-weight: 680; color: #fff; background: var(--grad);
  box-shadow: 0 10px 28px rgba(99, 102, 241, .38); transition: transform .12s;
}
.mic-btn::before {
  content: ""; width: 24px; height: 24px; background: center / 24px no-repeat;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round'%3E%3Crect x='9' y='3' width='6' height='11' rx='3'/%3E%3Cpath d='M5 11a7 7 0 0 0 14 0M12 18v3'/%3E%3C/svg%3E");
}
.mic-btn:active { transform: scale(.97); }
.mic-btn.active { background: var(--danger); box-shadow: 0 0 0 6px rgba(229, 72, 77, .18), 0 10px 28px rgba(229, 72, 77, .35); animation: breathe 1.8s ease-in-out infinite; }
.mic-btn.active::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Crect x='6' y='6' width='12' height='12' rx='2.5' fill='white'/%3E%3C/svg%3E"); }
@keyframes breathe { 50% { box-shadow: 0 0 0 12px rgba(229, 72, 77, .08), 0 10px 28px rgba(229, 72, 77, .35); } }
.composer {
  display: flex; gap: 8px; padding: 6px; background: var(--surface); border: 1px solid var(--line);
  border-radius: 999px; box-shadow: var(--shadow);
}
.composer input { flex: 1; min-width: 0; border: 0; background: transparent; box-shadow: none; padding: 8px 12px; }
.composer input:focus { box-shadow: none; }
.composer .primary { padding: 8px 18px; }

footer { max-width: 920px; margin: 28px auto 24px; padding: 0 20px; text-align: center; font-size: 12px; }

/* consent bar */
.consent {
  position: fixed; left: 12px; right: 12px; bottom: calc(12px + var(--nav-h) + env(safe-area-inset-bottom, 0px)); z-index: 50;
  max-width: 720px; margin: 0 auto;
  background: var(--surface-solid); border: 1px solid var(--line-strong); border-radius: var(--r);
  padding: 14px 16px; display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap;
  box-shadow: var(--shadow-lg); animation: rise .3s ease both;
}
.consent p { margin: 0; font-size: 13px; flex: 1 1 260px; }
.consent div { display: flex; gap: 8px; }
.consent .primary.small, .consent .small { padding: 7px 14px; font-size: 13px; }
.consent .small:not(.primary) { border: 1px solid var(--line-strong); background: var(--surface-solid); border-radius: 999px; font-weight: 560; }

/* ---------- mobile ---------- */
@media (max-width: 640px) {
  :root { --nav-h: 64px; }
  .top { padding-left: 16px; padding-right: 16px; }
  main { padding: 10px 16px 8px; }
  footer { padding: 0 16px; }
  .tabs {
    position: fixed; z-index: 30; left: 0; right: 0; bottom: 0; margin: 0;
    height: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px));
    padding: 6px 8px env(safe-area-inset-bottom, 0px);
    justify-content: space-around; gap: 0;
    background: var(--surface); border-top: 1px solid var(--line);
    -webkit-backdrop-filter: blur(18px) saturate(1.4); backdrop-filter: blur(18px) saturate(1.4);
  }
  .tabs button { flex: 1; flex-direction: column; gap: 3px; padding: 6px 2px; border-radius: 12px; font-size: 10.5px; }
  .tabs button[aria-selected="true"] { background: transparent; box-shadow: none; color: var(--a); }
  .tabs button:hover { background: transparent; }
  .tabs .ti { width: 22px; height: 22px; }
  .lang-bar { gap: 6px; padding: 10px 12px; }
  .lang select { font-size: 16px; }
  .stage { min-height: 190px; padding: 12px 16px 18px; }
  .sub-translated { font-size: 23px; }
  .talk { gap: 10px; }
  .talk-btn { grid-template-columns: 1fr; grid-template-rows: auto auto auto; justify-items: center; text-align: center; row-gap: 4px; padding: 14px 10px; }
  .talk-btn::before { grid-row: auto; margin-bottom: 4px; width: 52px; height: 52px; }
  .talk-btn.auto { grid-template-columns: auto 1fr; grid-template-rows: auto auto; justify-items: start; text-align: left; padding: 12px 14px; }
  .talk-btn.auto::before { grid-row: 1 / 3; margin-bottom: 0; width: 44px; height: 44px; }
  .tb-lang { font-size: 15.5px; max-width: 100%; }
  .talk-btn.active .tb-hint::after { content: "聞き取り中…"; }
  .translate-grid { grid-template-columns: 1fr; }
  .pane textarea, .output { min-height: 120px; }
  .hero { padding: 22px 18px; }
  .primary.lg { align-self: stretch; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
