/* AI-Deate Meet: an iOS-style PWA. Dark only, black background, brand yellow for actions. */
:root {
  --bg: #000;
  --cell: #1c1c1e;
  --cell-2: #2c2c2e;
  --cell-3: #3a3a3c;
  --label: #fff;
  --label-2: rgba(235, 235, 245, 0.6);
  --label-3: rgba(235, 235, 245, 0.3);
  --sep: rgba(84, 84, 88, 0.6);
  --fill: rgba(118, 118, 128, 0.24);
  --accent: #ffd300;
  --on-accent: #000;
  --red: #ff453a;
  --green: #30d158;
  --blur: rgba(30, 30, 32, 0.72);
  --font: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Helvetica Neue', 'DM Sans', 'Noto Sans Thai', 'Noto Sans JP', 'Noto Sans SC', system-ui, sans-serif;
  --top: env(safe-area-inset-top, 0px);
  --bottom: env(safe-area-inset-bottom, 0px);
  color-scheme: dark;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--label); font: 17px/1.35 var(--font); letter-spacing: -0.41px; -webkit-font-smoothing: antialiased; }
body { min-height: 100dvh; overscroll-behavior-y: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; letter-spacing: inherit; }
input, textarea { font: inherit; color: var(--label); letter-spacing: inherit; }
svg.i { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.hidden { display: none !important; }

/* ---- navigation bar ---- */
.nav { position: sticky; top: 0; z-index: 20; padding: var(--top) 8px 0; min-height: calc(44px + var(--top)); display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; transition: background 0.2s, border-color 0.2s; border-bottom: 0.5px solid transparent; }
.nav.scrolled { background: var(--blur); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px); border-bottom-color: var(--sep); }
.nav .left, .nav .right { display: flex; align-items: center; gap: 4px; min-width: 0; }
.nav .right { justify-content: flex-end; }
.nav .mid { font-weight: 600; font-size: 17px; text-align: center; opacity: 0; transition: opacity 0.2s; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 56vw; }
.nav.scrolled .mid, .nav.always .mid { opacity: 1; }
.nav-btn { color: var(--accent); display: inline-flex; align-items: center; gap: 2px; height: 44px; padding: 0 8px; font-size: 17px; white-space: nowrap; }
.nav-btn.red { color: var(--red); font-weight: 600; }
.nav-btn .i { width: 22px; height: 22px; }
.nav-btn.back .i { width: 13px; height: 22px; stroke-width: 2.6; margin-right: 4px; }
.brand { display: flex; align-items: center; gap: 7px; padding-left: 8px; height: 44px; font-weight: 600; font-size: 15px; color: var(--label); white-space: nowrap; }
.brand img { height: 22px; }
.brand b { color: var(--accent); font-weight: 700; }
.avatar-btn { width: 32px; height: 32px; border-radius: 50%; background: var(--cell-2); display: grid; place-items: center; font-size: 13px; font-weight: 600; margin-right: 8px; color: var(--label-2); }
.avatar-btn.on { background: var(--accent); color: #000; }

.large-title { font-size: 34px; line-height: 41px; font-weight: 700; letter-spacing: 0.37px; padding: 2px 20px 8px; margin: 0; }
.page { padding-bottom: calc(120px + var(--bottom)); }

/* ---- grouped lists ---- */
.section-h { font-size: 13px; text-transform: uppercase; color: var(--label-2); padding: 22px 36px 7px; letter-spacing: -0.08px; }
.section-f { font-size: 13px; color: var(--label-2); padding: 7px 36px 0; letter-spacing: -0.08px; line-height: 18px; }
.group { margin: 0 16px; background: var(--cell); border-radius: 10px; overflow: hidden; }
.row { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 16px; position: relative; width: 100%; text-align: left; }
.row + .row::before { content: ''; position: absolute; top: 0; right: 0; left: var(--inset, 16px); border-top: 0.5px solid var(--sep); }
button.row:active, a.row:active { background: var(--cell-3); }
.row .main { flex: 1; min-width: 0; padding: 11px 0; }
.row .title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .sub { font-size: 15px; color: var(--label-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: -0.24px; }
.row .value { color: var(--label-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 55%; }
.row .chev { width: 8px; height: 14px; stroke: var(--label-3); stroke-width: 2.4; }
.row .check { color: var(--accent); width: 20px; height: 20px; stroke-width: 2.6; }
.row.danger { color: var(--red); justify-content: center; }
.row.accent { color: var(--accent); }
.row input { flex: 1; background: none; border: 0; outline: 0; padding: 11px 0; min-width: 0; }
.row input::placeholder { color: var(--label-3); }
.row label { color: var(--label); white-space: nowrap; width: 78px; flex: none; }
a { color: var(--accent); text-decoration: none; }

.stack { display: flex; }
.stack .av { margin-left: -8px; box-shadow: 0 0 0 2px var(--cell); }
.stack .av:first-child { margin-left: 0; }
.av { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 600; color: #000; flex: none; text-transform: uppercase; }
.av.lg { width: 40px; height: 40px; font-size: 16px; }

/* ---- home ---- */
.hero { margin: 8px 16px 0; padding: 22px 20px 20px; border-radius: 16px; background: linear-gradient(160deg, #1d1d1f 0%, #121213 100%); border: 0.5px solid var(--sep); }
.hero h2 { margin: 14px 0 6px; font-size: 22px; line-height: 28px; letter-spacing: 0.35px; }
.hero p { margin: 0; color: var(--label-2); font-size: 15px; line-height: 20px; }
.bubbles { display: grid; gap: 8px; }
.bubble { display: flex; gap: 8px; align-items: flex-start; }
.bubble .who { font-size: 12px; font-weight: 600; }
.bubble .txt { background: var(--cell-2); border-radius: 14px; border-top-left-radius: 4px; padding: 7px 11px; font-size: 14px; line-height: 19px; }
.bubble .txt em { display: block; font-style: normal; color: var(--label-2); font-size: 13px; }
.empty-list { padding: 30px 20px; text-align: center; color: var(--label-2); font-size: 15px; }

/* ---- floating bottom bar ---- */
.dock { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--bottom) + 14px); z-index: 30; display: flex; align-items: center; gap: 2px; padding: 6px; border-radius: 40px; background: var(--blur); -webkit-backdrop-filter: saturate(180%) blur(24px); backdrop-filter: saturate(180%) blur(24px); border: 0.5px solid rgba(255, 255, 255, 0.12); box-shadow: 0 10px 40px rgba(0, 0, 0, 0.55); max-width: calc(100vw - 24px); }
.dock .tool { width: 62px; height: 56px; border-radius: 28px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--label); font-size: 10.5px; font-weight: 500; letter-spacing: 0.07px; position: relative; }
.dock .tool:active { background: var(--fill); }
.dock .tool .i { width: 23px; height: 23px; }
.dock .tool .badge { position: absolute; top: 5px; right: 11px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: var(--accent); color: #000; font-size: 11px; font-weight: 700; display: grid; place-items: center; }
.dock .tool:disabled { opacity: 0.35; }
.dock .pill { white-space: nowrap; height: 56px; padding: 0 24px; border-radius: 28px; background: var(--accent); color: var(--on-accent); font-weight: 600; font-size: 17px; display: flex; align-items: center; gap: 8px; margin: 0 4px; }
.dock .pill:active { filter: brightness(0.85); }
.dock .pill .i { width: 22px; height: 22px; stroke-width: 2.2; }
.rec { width: 68px; height: 68px; margin: -10px 6px; border-radius: 50%; background: var(--accent); color: #000; display: grid; place-items: center; position: relative; box-shadow: 0 6px 22px rgba(255, 211, 0, 0.35); transition: transform 0.12s; }
.rec:active { transform: scale(0.94); }
.rec .i { width: 28px; height: 28px; stroke-width: 2.2; }
.rec .dot { width: 22px; height: 22px; border-radius: 50%; background: var(--red); }
.rec .ring { position: absolute; inset: -6px; border-radius: 50%; border: 2.5px solid var(--accent); opacity: 0; transform: scale(var(--lvl, 1)); transition: transform 0.08s linear, opacity 0.2s; }
.rec.live .ring { opacity: 0.7; }
.rec.live { background: #fff; box-shadow: 0 6px 22px rgba(255, 255, 255, 0.2); }
.rec:disabled { opacity: 0.4; }

/* ---- meeting ---- */
.meta { display: flex; gap: 8px; align-items: center; padding: 6px 16px 10px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 11px; border-radius: 14px; background: var(--cell); font-size: 13px; font-weight: 500; color: var(--label-2); white-space: nowrap; letter-spacing: -0.08px; }
.chip .i { width: 15px; height: 15px; }
.chip.live { color: #fff; background: rgba(255, 69, 58, 0.18); }
.chip.live .led { width: 8px; height: 8px; border-radius: 50%; background: var(--red); animation: pulse 1.4s ease-in-out infinite; }
.chip.paused { color: var(--accent); background: rgba(255, 211, 0, 0.12); }
.chip.code { font-variant-numeric: tabular-nums; }
.chip.tap:active { background: var(--cell-2); }
@keyframes pulse { 50% { opacity: 0.3; } }
.title-edit { font-size: 28px; line-height: 34px; font-weight: 700; letter-spacing: 0.36px; padding: 0 20px; margin: 0; word-break: break-word; }

.transcript { padding: 6px 16px 0; }
.turn { display: flex; gap: 10px; padding: 10px 0; }
.ln.enter { animation: rise 0.25s ease-out; }
.turn .av { margin-top: 1px; }
.turn .body { flex: 1; min-width: 0; }
.turn .who { display: flex; align-items: baseline; gap: 6px; font-size: 15px; font-weight: 600; letter-spacing: -0.24px; }
.turn .who .role { font-weight: 400; color: var(--label-2); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.turn .who .t { margin-left: auto; font-weight: 400; color: var(--label-3); font-size: 12px; font-variant-numeric: tabular-nums; }
.turn .who button { color: inherit; font-weight: 600; }
.ln { margin-top: 3px; }
.ln .o { font-size: 17px; line-height: 23px; }
.ln .tr { font-size: 16px; line-height: 22px; color: var(--accent); margin-top: 2px; }
.ln .tr.pending { color: var(--label-3); }
.view-tr .ln .o { font-size: 14px; line-height: 19px; color: var(--label-2); }
.view-tr .ln .tr { font-size: 18px; line-height: 24px; color: var(--label); margin-top: 0; }
.view-tr .ln .tr + .o { margin-top: 1px; }
.view-orig .ln .tr { display: none; }
.partial .ln .o { color: var(--label-2); }
.partial .ln .o::after { content: ''; display: inline-block; width: 2px; height: 1em; background: var(--accent); margin-left: 3px; vertical-align: -2px; animation: pulse 1s steps(1) infinite; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } }
[dir='rtl'] { text-align: right; }

.empty { padding: 40px 28px; text-align: center; color: var(--label-2); }
.empty .big { font-size: 20px; font-weight: 600; color: var(--label); margin: 14px 0 6px; }
.empty .mic { width: 64px; height: 64px; margin: 0 auto; border-radius: 50%; background: var(--cell); display: grid; place-items: center; color: var(--accent); }
.empty .mic .i { width: 30px; height: 30px; }
.jump { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--bottom) + 100px); z-index: 25; height: 34px; padding: 0 14px; border-radius: 17px; background: var(--cell-2); color: var(--accent); font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 4px; box-shadow: 0 4px 18px rgba(0, 0, 0, 0.5); }
.jump .i { width: 16px; height: 16px; stroke-width: 2.4; }

.summary-card { margin: 0 16px; background: var(--cell); border-radius: 12px; padding: 16px; white-space: pre-wrap; font-size: 16px; line-height: 23px; }
.summary-card.pending { color: var(--label-2); display: flex; gap: 10px; align-items: center; }
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--cell-3); border-top-color: var(--accent); animation: spin 0.8s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.seg { display: flex; margin: 4px 16px 12px; background: var(--fill); border-radius: 9px; padding: 2px; }
.seg button { flex: 1; height: 30px; border-radius: 7px; font-size: 13px; font-weight: 600; color: var(--label); }
.seg button.on { background: var(--cell-3); box-shadow: 0 3px 8px rgba(0, 0, 0, 0.3); }

/* ---- sheets ---- */
.scrim { position: fixed; inset: 0; z-index: 50; background: rgba(0, 0, 0, 0.5); opacity: 0; transition: opacity 0.3s; }
.scrim.open { opacity: 1; }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 51; max-height: calc(100dvh - var(--top) - 24px); background: #1c1c1e; border-radius: 12px 12px 0 0; transform: translateY(100%); transition: transform 0.38s cubic-bezier(0.32, 0.72, 0, 1); display: flex; flex-direction: column; padding-bottom: var(--bottom); max-width: 640px; margin: 0 auto; }
.sheet.open { transform: none; }
.sheet .grab { width: 36px; height: 5px; border-radius: 3px; background: var(--cell-3); margin: 6px auto 0; flex: none; }
.sheet .bar { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; min-height: 52px; padding: 0 8px; flex: none; }
.sheet .bar .t { font-weight: 600; text-align: center; }
.sheet .bar .r { justify-self: end; }
.sheet .bar .nav-btn.strong { font-weight: 600; }
.sheet .content { overflow-y: auto; padding-bottom: 24px; -webkit-overflow-scrolling: touch; }
.sheet .group { background: var(--cell-2); }
.sheet .row + .row::before { border-top-color: rgba(84, 84, 88, 0.5); }
.sheet .section-h:first-child { padding-top: 8px; }
.cta { display: flex; align-items: center; justify-content: center; gap: 8px; height: 50px; margin: 20px 16px 0; border-radius: 14px; background: var(--accent); color: #000; font-weight: 600; font-size: 17px; width: calc(100% - 32px); }
.cta:disabled { opacity: 0.4; }
.cta.ghost { background: var(--cell-2); color: var(--accent); }
.cta:active { filter: brightness(0.85); }
.search { margin: 0 16px 8px; display: flex; align-items: center; gap: 6px; background: var(--fill); border-radius: 10px; height: 36px; padding: 0 8px; color: var(--label-2); }
.search .i { width: 17px; height: 17px; }
.search input { flex: 1; background: none; border: 0; outline: 0; font-size: 17px; }
.code-in { display: block; width: calc(100% - 32px); margin: 8px 16px 0; height: 64px; text-align: center; font-size: 34px; font-weight: 600; letter-spacing: 10px; border-radius: 14px; border: 0; outline: 0; background: var(--cell-2); font-variant-numeric: tabular-nums; }
.note { font-size: 13px; color: var(--label-2); padding: 10px 20px 0; line-height: 18px; }
.err { color: var(--red); font-size: 14px; padding: 10px 20px 0; }
.evidence { font-size: 13px; color: var(--label-2); }
.evidence q { color: var(--label); }

/* ---- action sheet ---- */
.actions { position: fixed; left: 8px; right: 8px; bottom: calc(var(--bottom) + 8px); z-index: 51; max-width: 520px; margin: 0 auto; transform: translateY(calc(100% + 40px)); transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1); }
.actions.open { transform: none; }
.actions .list { background: rgba(44, 44, 46, 0.85); -webkit-backdrop-filter: blur(30px); backdrop-filter: blur(30px); border-radius: 14px; overflow: hidden; }
.actions .head { padding: 14px 16px; text-align: center; font-size: 13px; color: var(--label-2); border-bottom: 0.5px solid var(--sep); }
.actions .head b { display: block; color: var(--label-2); font-weight: 600; }
.actions button { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; height: 57px; font-size: 20px; color: var(--accent); }
.actions button + button { border-top: 0.5px solid var(--sep); }
.actions button.red { color: var(--red); }
.actions .cancel { margin-top: 8px; background: #2c2c2e; border-radius: 14px; font-weight: 600; }
.actions button:active { background: rgba(255, 255, 255, 0.08); }

#toast { position: fixed; left: 50%; top: calc(var(--top) + 10px); transform: translate(-50%, -140%); z-index: 60; background: rgba(44, 44, 46, 0.92); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); padding: 10px 18px; border-radius: 22px; font-size: 15px; font-weight: 500; max-width: calc(100vw - 32px); box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5); transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1); text-align: center; }
#toast.show { transform: translate(-50%, 0); }

@media (min-width: 700px) {
  .page, .nav-inner { max-width: 720px; margin: 0 auto; }
}
.sheet.tall { height: calc(100dvh - var(--top) - 24px); }
