:root {
  color-scheme: light;
  --bg: #f1f1ed;
  --text: #1a1a1a;
  --muted: #8a8a85;
  --line: rgba(0, 0, 0, 0.05);
  --card: #fff;
  --surface: #fff;
  --surface-soft: #f5f4ef;
  --surface-muted: #efeee9;
  --surface-raised: rgba(250,250,247,.96);
  --text-soft: #5e5e59;
  --chev: #c0c0bb;
  --tabbar: rgba(250,250,247,.88);
  --control-fill: rgba(0,0,0,.07);
  --control-fill-strong: rgba(0,0,0,.08);
  --field-border: rgba(0,0,0,.08);
  --field-focus: rgba(0,0,0,.28);
  --focus-ring: rgba(0,0,0,.06);
  --spinner-track: rgba(0,0,0,.12);
  --floating: rgba(26, 26, 26, .92);
  --floating-text: #fff;
  --glass: rgba(241,241,237,.68);
  --solid: #1a1a1a;
  --solid-text: #fff;
  --sheet-backdrop: rgba(0,0,0,.16);
  --danger: #d83232;
  --share: #8d8d92;
  --copy: #4e5968;
  --success: #28a65a;
  --success-text: #23714a;
  --badge-ok: #28a65a;
  --badge-low: #d83232;
  --badge-text: #fff;
  --tag-active-text: #fff;
  --error-text: #c0392b;
  --app-top-gap: 24px;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0d0f12;
  --text: #f4f4f2;
  --muted: #9b9b96;
  --line: rgba(255, 255, 255, 0.10);
  --card: #17191d;
  --surface: #17191d;
  --surface-soft: #22242a;
  --surface-muted: #24262c;
  --surface-raised: rgba(24,26,31,.96);
  --text-soft: #c9c9c4;
  --chev: #62656d;
  --tabbar: rgba(16,18,22,.88);
  --control-fill: rgba(255,255,255,.10);
  --control-fill-strong: rgba(255,255,255,.12);
  --field-border: rgba(255,255,255,.14);
  --field-focus: rgba(255,255,255,.38);
  --focus-ring: rgba(255,255,255,.10);
  --spinner-track: rgba(255,255,255,.18);
  --floating: rgba(58, 62, 70, .92);
  --floating-text: #fff;
  --glass: rgba(13,15,18,.68);
  --solid: #f4f4f2;
  --solid-text: #0d0f12;
  --sheet-backdrop: rgba(0,0,0,.42);
  --success-text: #58c988;
  --badge-ok: #8ee8b6;
  --badge-low: #ffb1aa;
  --badge-text: #111316;
  --tag-active-text: #0d0f12;
  --error-text: #ff6f61;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--text); font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
button { font: inherit; }
.shell { width: 100%; max-width: 430px; min-height: 100vh; margin: 0 auto; position: relative; padding-bottom: 96px; }
.view { min-height: calc(100vh - 96px); }
.page { padding: var(--app-top-gap) 24px 24px; }
.transcript-page { position: relative; padding-top: var(--app-top-gap); }
.account-page { position: relative; }
.account-page .detail-back { top: 25px; }
.account-page > .title { padding-top: 78px; }
.account-page > .card, .account-page > .tag-settings { margin-top: 28px; }
.eyebrow { margin: 0 0 4px; color: var(--muted); font-size: 13px; }
.title { margin: 0; font-size: 34px; line-height: 1.05; letter-spacing: -0.02em; }
.home-title { margin-bottom: 10px; }
.tag-filter { margin-top: 18px; }
.tag-filter-title { margin: 0 0 9px; color: var(--muted); font-size: 13px; font-weight: 650; }
.tag-filter-list { display: flex; gap: 8px; margin: 0 -24px; padding: 0 24px 2px; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.tag-filter-list::-webkit-scrollbar { display: none; }
.filter-chip { flex: 0 0 auto; min-height: 34px; max-width: 180px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--text); padding: 0 14px; font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tag-filter-chip { border-color: var(--line); background: var(--surface); color: var(--text); display: inline-flex; align-items: center; gap: 6px; }
.tag-filter-chip svg { width: 14px; height: 14px; flex: 0 0 auto; fill: var(--tag-color); }
.tag-filter-chip span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.filter-chip.active { background: var(--solid); border-color: var(--solid); color: var(--solid-text); }
.tag-filter-chip.active { background: var(--tag-color); border-color: var(--tag-color); color: var(--tag-active-text); }
.tag-filter-chip.active svg { fill: currentColor; }
.section-title { margin: 34px 0 14px; font-size: 22px; letter-spacing: -0.02em; }
.date-group:first-of-type .date-title { margin-top: 34px; }
.date-title { margin-top: 28px; text-transform: none; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 24px; box-shadow: 0 1px 2px rgba(0,0,0,.03); overflow: hidden; }
.home-page .card { margin-left: -25px; margin-right: -25px; border-left: 0; border-right: 0; border-radius: 0; }
.balance { display: block; padding: 24px; color: inherit; text-decoration: none; }
.home-page .balance { padding-left: 25px; padding-right: 25px; }
.balance-top, .balance-bottom { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 13px; }
.balance-top span { color: var(--text); font-weight: 700; }
.balance-top b { color: var(--muted); font-weight: 400; }
.balance-num { margin: 14px 0 0; display: flex; align-items: baseline; gap: 8px; }
.balance-num strong { font-size: 56px; line-height: 1; letter-spacing: -0.03em; }
.swipe-row { position: relative; overflow: hidden; background: var(--surface); }
.swipe-row:first-child { border-top: 0; }
.swipe-actions { position: absolute; top: 0; right: 0; bottom: 0; width: 76px; display: grid; grid-template-columns: 76px; opacity: 0; transition: opacity .12s ease; }
html[dir="rtl"] .swipe-actions { right: 0; left: auto; }
.swipe-action { border: 0; color: #fff; display: grid; place-items: center; }
.swipe-delete { background: var(--danger); }
.swipe-row.open-actions .swipe-actions, .swipe-row.dragging-actions .swipe-actions { opacity: 1; }
.swipe-action svg { width: 25px; height: 25px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.swipe-content { position: relative; z-index: 1; transition: transform .18s ease; touch-action: pan-y; will-change: transform; }
.swipe-row.swipe-locked .swipe-content { touch-action: none; }
.swipe-row.dragging .swipe-content { transition: none; }
.swipe-row.open-actions .swipe-content { transform: translateX(-76px); }
.list-row { width: 100%; display: flex; gap: 14px; align-items: center; padding: 16px 20px; border: 0; border-top: 1px solid var(--line); background: var(--surface); text-align: left; color: inherit; text-decoration: none; }
.swipe-row .list-row { border-top: 1px solid var(--line); }
.swipe-row:first-child .list-row { border-top: 0; }
.home-page .list-row { padding-left: 25px; padding-right: 25px; }
.list-row:first-child { border-top: 0; }
.row-main { min-width: 0; flex: 1; }
.privacy-action-row { align-items: flex-start; }
.privacy-action-row .row-main { display: grid; gap: 6px; line-height: 1.25; }
.privacy-action-row .row-main strong { font-size: 16px; font-weight: 650; }
.privacy-action-row .row-main small { color: var(--muted); font-size: 13px; line-height: 1.35; }
.privacy-action-row.danger .row-main strong { color: #ef4444; }
.privacy-action-row:disabled { opacity: .55; }
.support-compose, .support-reply, .support-rating { padding: 18px; display: grid; gap: 14px; }
.support-compose h2 { margin: 0; font-size: 17px; }
.support-compose label, .support-reply label { display: grid; gap: 7px; color: var(--muted); font-size: 13px; }
.support-compose input, .support-compose textarea, .support-reply textarea { width: 100%; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--text); padding: 12px; font: inherit; resize: vertical; }
.support-ticket-row .row-main { display: grid; gap: 5px; }
.support-ticket-row .row-main strong { font-size: 15px; font-weight: 650; }
.support-ticket-row .row-main small, .support-ticket-row .row-main em { color: var(--muted); font-size: 13px; font-style: normal; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.support-status { font-size: 12px; color: var(--muted); }
.support-status.open { color: #12b981; }
.support-status.pending { color: #f59e0b; }
.support-status.closed { color: var(--muted); }
.support-ticket-meta { margin-top: 8px; }
.support-thread { display: grid; gap: 12px; margin: 24px 0; }
.support-message { max-width: 84%; display: grid; gap: 5px; }
.support-message.mine { justify-self: end; text-align: right; }
.support-message.theirs { justify-self: start; }
.support-message small { color: var(--muted); font-size: 11px; }
.support-message div { border: 1px solid var(--line); border-radius: 16px; padding: 10px 12px; line-height: 1.4; white-space: pre-wrap; background: var(--card); }
.support-message.mine div { background: var(--text); border-color: var(--text); color: var(--bg); }
.stars { display: flex; gap: 7px; font-size: 28px; line-height: 1; color: #f59e0b; }
.stars button { border: 0; background: transparent; color: inherit; font: inherit; padding: 0 2px; }
.stars.readonly { font-size: 22px; }
.row-title { margin: 0; font-size: 15px; line-height: 1.25; font-weight: 650; }
.row-preview { margin: 7px 0 0; min-height: calc(14px * 1.35 * 3); color: var(--text-soft); font-size: 14px; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.row-sub { margin: 4px 0 0; color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-tags { margin-top: 7px; display: flex; flex-wrap: wrap; gap: 6px; }
.row-tag { max-width: 100%; min-height: 22px; border: 0; border-radius: 999px; background: transparent; color: var(--tag-color); display: inline-flex; align-items: center; gap: 5px; padding: 0; font-size: 12px; line-height: 1; font-weight: 500; }
.row-tag svg { width: 13px; height: 13px; flex: 0 0 auto; fill: currentColor; }
.row-tag bdi { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chev { color: var(--chev); font-size: 24px; }
.empty { color: var(--muted); text-align: center; padding: 36px 18px; font-size: 14px; }
.pagination { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.page-dot { min-width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--muted); font-size: 13px; font-weight: 700; }
.page-dot.active { background: var(--solid); border-color: var(--solid); color: var(--solid-text); }
.tabbar { position: fixed; left: 50%; bottom: 0; z-index: 80; transform: translateX(-50%); width: 100%; max-width: 430px; display: grid; grid-template-columns: repeat(3, 1fr); padding: 8px 12px max(env(safe-area-inset-bottom), 8px); background: var(--tabbar); backdrop-filter: blur(18px); border-top: 1px solid var(--line); }
.tab { position: relative; min-height: 60px; border: 0; background: transparent; color: var(--muted); display: flex; flex-direction: column; gap: 4px; align-items: center; justify-content: center; font-size: 22px; }
.tab svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.tab span { font-size: 11px; font-weight: 600; }
.tab.active { color: var(--text); }
.tab.active svg { stroke-width: 2.2; }
.tab-badge { position: absolute; top: 11px; left: calc(50% + 10px); min-width: 18px; max-width: 42px; height: 16px; padding: 0 5px; border-radius: 999px; background: linear-gradient(180deg, color-mix(in srgb, var(--badge-ok) 92%, #fff), var(--badge-ok)); color: var(--badge-text); border: 1.5px solid color-mix(in srgb, var(--tabbar) 82%, #fff); display: inline-flex; align-items: center; justify-content: center; font-size: 9px; line-height: 1; font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; box-shadow: 0 2px 5px rgba(0,0,0,.16), inset 0 1px 0 rgba(255,255,255,.22); transform: translate(0, -50%); }
.tab-badge.low { background: linear-gradient(180deg, color-mix(in srgb, var(--badge-low) 90%, #fff), var(--badge-low)); }
html[dir="rtl"] .tab-badge { left: auto; right: calc(50% + 10px); }
.toplink { min-height: 44px; display: inline-flex; align-items: center; border: 0; background: transparent; padding: 0; color: var(--text); font-weight: 650; }
.meta { color: var(--muted); font-size: 13px; margin: 12px 0 0; }
.transcript-page > .meta { display: flex; align-items: center; flex-wrap: wrap; gap: 14px; margin-top: 74px; line-height: 1; }
.meta-item { display: inline-flex; align-items: center; gap: 5px; line-height: 1; vertical-align: middle; }
.meta-item bdi { line-height: 1; }
.meta-item svg { width: 14px; height: 14px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.title-row { display: block; margin-top: 10px; }
.transcript-title { min-width: 0; font-size: 28px; margin-top: 0; }
.title-edit-button, .title-action { border: 0; border-radius: 999px; background: var(--control-fill); color: var(--text); display: grid; place-items: center; flex: 0 0 auto; }
.title-edit-button { display: inline-flex; width: 22px; height: 22px; margin-inline-start: 7px; padding: 0; vertical-align: -2px; background: transparent; color: var(--text); }
.title-action { width: 38px; height: 38px; }
.title-edit-button svg, .title-action svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.title-edit-button svg { width: 17px; height: 17px; }
.title-action.save { background: var(--solid); color: var(--solid-text); }
.title-action.cancel { color: var(--muted); }
.title-action:disabled { opacity: .55; }
.title-edit-form { margin-top: 8px; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px; }
.transcript-page > .title-edit-form { margin-top: 10px; }
.title-input { width: 100%; min-width: 0; box-sizing: border-box; border: 1px solid var(--field-border); border-radius: 16px; background: var(--surface); color: var(--text); padding: 12px 14px; font: inherit; font-size: 16px; line-height: 1.25; font-weight: 700; outline: none; }
.title-input:focus { border-color: var(--field-focus); box-shadow: 0 0 0 4px var(--focus-ring); }
.title-edit-actions { display: flex; gap: 8px; }
.tag-editor { margin-top: 12px; }
.tag-list { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.tag-chip { min-height: 32px; max-width: 100%; border: 0; border-radius: 999px; background: transparent; color: var(--tag-color); display: inline-flex; align-items: center; gap: 7px; padding: 0 4px; font-size: 13px; font-weight: 500; }
.tag-chip svg { width: 13px; height: 13px; flex: 0 0 auto; fill: currentColor; }
.tag-chip span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tag-chip b { color: var(--tag-color); font-size: 17px; line-height: 1; font-weight: 500; }
.tag-empty-hint { color: var(--text); font-size: 13px; line-height: 32px; }
.tag-actions { position: relative; display: inline-flex; align-items: center; gap: 8px; }
.tag-picker, .tag-color { position: relative; display: inline-flex; }
.tag-round-button { width: 32px; height: 32px; border: 0; border-radius: 999px; background: transparent; color: var(--text); display: grid; place-items: center; }
.tag-add-toggle { font-size: 22px; line-height: 1; font-weight: 500; padding-bottom: 2px; }
.tag-picker-button svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.tag-color-button span, .tag-color-dot span { width: 14px; height: 14px; border-radius: 999px; background: var(--tag-color); box-shadow: inset 0 0 0 1px rgba(0,0,0,.12); }
.tag-menu, .tag-color-menu, .tag-add-menu, .tag-edit-menu { position: absolute; top: calc(100% + 8px); left: 0; z-index: 90; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); box-shadow: 0 16px 40px rgba(0,0,0,.18); }
.tag-add-menu { width: min(286px, calc(100vw - 36px)); padding: 14px; transform: translateX(var(--tag-menu-shift, 0px)); }
.tag-popover-input { width: 100%; border: 1px solid var(--field-border); border-radius: 14px; background: var(--surface); color: var(--text); padding: 12px 13px; font: inherit; font-size: 15px; font-weight: 500; outline: none; }
.tag-popover-input:focus { border-color: var(--field-focus); box-shadow: 0 0 0 4px var(--focus-ring); }
.tag-popover-colors { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 12px; }
.tag-popover-submit { width: 100%; min-height: 42px; margin-top: 14px; border: 0; border-radius: 999px; background: var(--solid); color: var(--solid-text); font-size: 14px; font-weight: 650; }
.tag-menu { width: min(286px, calc(100vw - 36px)); padding: 8px; right: 0; left: auto; transform: translateX(calc(32px + var(--tag-menu-shift, 0px))); max-width: calc(100vw - 32px); }
.tag-menu-row { padding: 6px 0; border-bottom: 1px solid var(--line); }
.tag-menu-row:last-child { border-bottom: 0; }
.tag-menu-tag { width: 100%; min-height: 38px; border: 0; background: transparent; color: var(--tag-color); display: flex; align-items: center; gap: 9px; padding: 0 8px; text-align: start; font: inherit; font-size: 18px; font-weight: 400; }
.tag-menu-tag svg { width: 15px; height: 15px; flex: 0 0 auto; fill: currentColor; }
.tag-menu-tag span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tag-color-menu { display: flex; gap: 7px; right: 0; left: auto; padding: 9px; transform: translateX(calc(32px + var(--tag-menu-shift, 0px))); max-width: calc(100vw - 32px); overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none; }
.tag-color-menu::-webkit-scrollbar { display: none; }
.tag-color-dot { width: 24px; height: 24px; border: 0; border-radius: 999px; background: transparent; display: grid; place-items: center; padding: 0; }
.tag-color-dot.active { box-shadow: 0 0 0 2px color-mix(in srgb, var(--tag-color) 52%, transparent); }
.tag-color-dot span { width: 16px; height: 16px; }
.tag-settings { padding: 4px 0; overflow: visible; }
.tag-settings-row { padding: 12px 16px; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center; }
.tag-settings-row:last-child { border-bottom: 0; }
.tag-settings-chip { min-width: 0; color: var(--text); display: inline-flex; align-items: center; gap: 9px; font-size: 18px; font-weight: 400; }
.tag-settings-chip svg { width: 15px; height: 15px; flex: 0 0 auto; fill: var(--tag-color); }
.tag-settings-chip span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tag-settings-controls { position: relative; display: flex; align-items: center; justify-content: flex-end; gap: 10px; }
.tag-settings-action { width: 30px; height: 30px; border: 1px solid var(--line); border-radius: 999px; background: transparent; color: var(--muted); display: grid; place-items: center; padding: 0; }
.tag-settings-action.danger { margin-inline-start: 4px; }
.tag-settings-action.danger { color: var(--danger); }
.tag-settings-action svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.tag-edit-menu { right: 44px; left: auto; width: min(286px, calc(100vw - 36px)); padding: 14px; transform: translateX(var(--tag-menu-shift, 0px)); }
html[dir="rtl"] .tag-picker-button { border-left: 0; border-right: 0; }
html[dir="rtl"] .tag-menu { left: auto; right: 0; }
.language-switcher { position: relative; display: flex; width: max-content; max-width: 100%; gap: 2px; overflow-x: auto; margin: 0 auto 12px; padding: 3px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface-muted); overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.transcript-page > .language-switcher { position: absolute; top: 25px; left: 50%; z-index: 74; max-width: calc(100% - 116px); margin: 0; transform: translateX(-50%); }
.language-switcher::-webkit-scrollbar { display: none; }
.language-chip { flex: 0 0 auto; min-width: 0; min-height: 30px; border: 0; border-radius: 999px; background: transparent; color: var(--muted); display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 0 12px; font-size: 13px; font-weight: 560; white-space: nowrap; }
.language-chip.active { background: var(--surface); color: var(--text); box-shadow: 0 1px 4px rgba(0,0,0,.10), inset 0 0 0 1px rgba(255,255,255,.20); }
.language-chip.add { width: 34px; padding: 0; color: var(--text); }
.language-chip svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.translation-empty { grid-column: 1 / -1; margin: 0; color: var(--muted); font-size: 13px; text-align: center; }
.detail-tabs { display: flex; gap: 0; margin: 20px -24px 0; padding: 0 24px 0 8px; border-bottom: 0; overflow-x: auto; overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.detail-tabs::-webkit-scrollbar { display: none; }
.detail-tab { position: relative; bottom: -1px; flex: 0 0 auto; min-width: max-content; min-height: 40px; border: 1px solid transparent; border-bottom: 0; border-radius: 12px 12px 0 0; background: transparent; color: var(--muted); padding: 0 16px; font-size: 14px; font-weight: 500; white-space: nowrap; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.detail-tab.active { background: var(--surface); border-color: transparent; border-bottom: 0; color: var(--text); font-weight: 500; box-shadow: none; }
.detail-tab.active::after { content: ""; position: absolute; left: -1px; right: -1px; bottom: -2px; height: 3px; background: var(--surface); z-index: 2; }
.detail-tab.not-ready:not(.active) { color: var(--text-soft); }
.detail-subtitle { margin: 0; min-width: 0; font-size: 20px; line-height: 1.18; font-weight: 700; color: var(--text); }
.detail-back { position: absolute; top: 25px; left: 10px; z-index: 75; width: 38px; height: 38px; border: 0; border-radius: 999px; background: var(--control-fill); color: var(--text); display: grid; place-items: center; padding: 0; }
.detail-back svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2.1; stroke-linecap: round; stroke-linejoin: round; }
.detail-actions { position: fixed; right: max(16px, calc((100vw - 430px) / 2 + 16px)); top: 50%; transform: translateY(-50%); z-index: 70; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: auto; }
html[dir="rtl"] .detail-actions { right: auto; left: max(16px, calc((100vw - 430px) / 2 + 16px)); }
#panel { width: calc(100% + 50px); margin: 0 -25px; padding: 1px 25px 24px; background: var(--surface); }
.panel { margin-top: 12px; padding: 18px; border-radius: 20px; background: var(--surface); border: 1px solid var(--line); line-height: 1.55; font-size: 15px; white-space: pre-wrap; }
.language-list { padding: 0; white-space: normal; overflow: hidden; }
.translation-label { margin-top: 18px; }
.translation-tabs { display: flex; gap: 8px; overflow-x: auto; margin: 14px -2px 10px; padding: 0 2px 2px; }
.mini-tab { flex: 0 0 auto; min-height: 34px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--muted); padding: 0 14px; font-size: 13px; font-weight: 650; }
.mini-tab.active { background: var(--solid); border-color: var(--solid); color: var(--solid-text); }
.loading-panel { display: flex; gap: 12px; align-items: center; white-space: normal; }
.spinner { width: 18px; height: 18px; border: 2px solid var(--spinner-track); border-top-color: var(--text); border-radius: 999px; flex: 0 0 auto; animation: spin .8s linear infinite; }
.transcript { margin-top: 30px; padding-bottom: 18px; }
.generated-content { margin-top: 18px; padding-bottom: 18px; font-size: 16px; line-height: 1.55; }
.generated-content h1,
.generated-content h2,
.generated-content h3 { margin: 0; color: var(--text); letter-spacing: 0; line-height: 1.2; }
.generated-content h1 { font-size: 24px; font-weight: 750; margin-bottom: 18px; }
.generated-content h2 { font-size: 19px; font-weight: 720; margin-top: 28px; margin-bottom: 10px; }
.generated-content h3 { font-size: 16px; font-weight: 700; margin-top: 18px; margin-bottom: 8px; }
.generated-content p { margin: 0; }
.generated-content p + p { margin-top: 1.55em; }
.generated-content h1 + p,
.generated-content h2 + p,
.generated-content h3 + p { margin-top: 0; }
.generated-content p + h2,
.generated-content ul + h2,
.generated-content ol + h2 { margin-top: 30px; }
.generated-content p + h3,
.generated-content ul + h3,
.generated-content ol + h3 { margin-top: 20px; }
.generated-content strong { font-weight: 760; }
.generated-content ul,
.generated-content ol { margin: 10px 0 0; padding-inline-start: 1.35em; }
.generated-content li { margin: 6px 0 0; padding-inline-start: .15em; }
.generated-content li::marker { color: var(--muted); }
.speaker-controls { margin-top: 22px; display: flex; align-items: center; }
.speaker-toggle { min-height: 38px; border: 0; border-radius: 999px; background: transparent; color: var(--text); display: inline-flex; align-items: center; gap: 8px; padding: 0; font-size: 14px; font-weight: 550; }
.speaker-toggle svg { width: 23px; height: 23px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.speaker-toggle:disabled { color: var(--muted); }
.segment { margin-bottom: 24px; }
.segment-head { display: flex; gap: 8px; align-items: baseline; margin-bottom: 6px; font-size: 13px; font-weight: 700; }
.segment-head time { color: var(--muted); font-size: 12px; font-weight: 500; }
.segment p { margin: 0; font-size: 16px; line-height: 1.55; }
.copy-button { width: 44px; height: 44px; min-height: 44px; border: 0; border-radius: 999px; background: var(--floating); color: var(--floating-text); display: grid; place-items: center; pointer-events: auto; box-shadow: 0 10px 28px -10px rgba(0,0,0,.28); transition: background-color .16s ease, opacity .16s ease, transform .16s ease; }
.copy-button svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.file-type-icon { font-size: 11px; line-height: 1; font-weight: 800; letter-spacing: .01em; text-transform: uppercase; }
.copy-button:active { transform: scale(.96); }
.copy-button:disabled { opacity: .45; }
.copy-button.copied { background: var(--success); }
.scroll-top-button { position: fixed; right: max(16px, calc((100vw - 430px) / 2 + 16px)); bottom: calc(max(env(safe-area-inset-bottom), 8px) + 96px); z-index: 72; opacity: 0; pointer-events: none; transform: translateY(10px); }
.scroll-top-button.visible { opacity: 1; pointer-events: auto; transform: translateY(0); }
html[dir="rtl"] .scroll-top-button { right: auto; left: max(16px, calc((100vw - 430px) / 2 + 16px)); }
.translation-menu { position: absolute; left: 0; right: 0; top: 72px; z-index: 73; margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; overflow: visible; padding: 12px 24px 18px; border-radius: 0 0 24px 24px; background: var(--glass); -webkit-backdrop-filter: blur(9px) saturate(115%); backdrop-filter: blur(9px) saturate(115%); box-shadow: 0 24px 46px -30px rgba(0,0,0,.7), 0 14px 22px -22px rgba(0,0,0,.55); }
.transcript-page > .translation-menu { margin-top: 0; }
.translation-menu-head { grid-column: 1 / -1; min-height: 34px; display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.translation-hint { margin: 0 0 4px; color: var(--muted); font-size: 13px; line-height: 1.35; }
.translation-menu-close { width: 30px; height: 30px; flex: 0 0 auto; border: 0; border-radius: 999px; background: var(--control-fill); color: var(--text); display: grid; place-items: center; font-size: 21px; line-height: 1; padding: 0 0 2px; }
.translation-option { min-width: 0; min-height: 42px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--text); display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 12px; font-size: 13px; font-weight: 650; }
.translation-option span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.translation-option.active { background: var(--solid); border-color: var(--solid); color: var(--solid-text); }
.spinner.tiny { width: 14px; height: 14px; border-width: 2px; }
.translation-loading { min-height: 260px; margin: 22px -25px 0; padding: 68px 25px; background: var(--surface); color: var(--muted); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; text-align: center; }
.translation-loading p { margin: 0; font-size: 15px; line-height: 1.35; font-weight: 550; }
.ai-fab { position: fixed; right: max(20px, calc((100vw - 430px) / 2 + 20px)); bottom: calc(max(env(safe-area-inset-bottom), 8px) + 88px); z-index: 50; min-width: 82px; height: 58px; border: 0; border-radius: 999px; background: linear-gradient(120deg, #1684ff, #7b2cff, #1684ff); background-size: 220% 220%; color: #fff; display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 0 14px; box-shadow: 0 14px 32px -12px rgba(72, 72, 190, .65); animation: aiGradient 3.4s ease-in-out infinite; }
html[dir="rtl"] .ai-fab { right: auto; left: max(20px, calc((100vw - 430px) / 2 + 20px)); }
.ai-fab svg { width: 25px; height: 25px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ai-fab span { font-size: 25px; line-height: 1; font-weight: 800; letter-spacing: 0; }
.sheet-backdrop { position: fixed; inset: 0; z-index: 90; background: var(--sheet-backdrop); backdrop-filter: blur(2px); touch-action: none; }
.ai-sheet { position: fixed; left: 50%; bottom: 0; z-index: 91; width: 100%; max-width: 430px; max-height: calc(100dvh - max(env(safe-area-inset-top), 16px) - 24px); transform: translateX(-50%); padding: 18px 16px calc(max(env(safe-area-inset-bottom), 8px) + 16px); border-radius: 24px 24px 0 0; background: var(--surface-raised); box-shadow: 0 -18px 44px -18px rgba(0,0,0,.28); animation: sheetUp .18s ease-out; display: flex; flex-direction: column; overscroll-behavior: contain; }
.sheet-header { min-height: 38px; display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.sheet-title { margin: 0 0 10px; font-size: 17px; font-weight: 750; letter-spacing: 0; }
.sheet-header .sheet-title { margin: 0; }
.sheet-back { min-height: 34px; border: 0; background: transparent; padding: 0; color: var(--text); font-weight: 650; }
.sheet-close { width: 34px; height: 34px; border: 0; border-radius: 999px; background: var(--control-fill-strong); color: var(--text); font-size: 24px; line-height: 1; display: grid; place-items: center; padding: 0 0 2px; }
.ai-action-list { display: grid; gap: 8px; }
.ai-language-list { flex: 1 1 auto; min-height: 0; max-height: min(420px, calc(100dvh - 150px)); overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; padding-bottom: 4px; touch-action: pan-y; }
.ai-action { width: 100%; min-height: 54px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); color: inherit; display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 10px; padding: 0 14px; text-align: left; }
html[dir="rtl"] .ai-action { text-align: right; }
.ai-action span { font-size: 15px; font-weight: 650; }
.ai-action small { color: var(--muted); font-size: 12px; font-weight: 650; }
.ai-action.not-ready { background: var(--surface-soft); color: var(--text-soft); }
.ai-action.ready .ai-status-dot { width: 9px; height: 9px; border-radius: 999px; background: var(--success); }
.ai-action.not-ready .ai-status-dot { width: 9px; height: 9px; border-radius: 999px; background: var(--chev); }
.primary { width: 100%; min-height: 54px; border: 0; border-radius: 999px; background: var(--solid); color: var(--solid-text); font-weight: 650; pointer-events: auto; box-shadow: 0 8px 24px -8px rgba(0,0,0,.25); }
.primary:disabled { opacity: .45; }
.inline-primary { margin-top: 18px; box-shadow: none; }
.billing-card { padding: 18px; }
.billing-note { margin: 0 0 14px; color: var(--muted); font-size: 14px; line-height: 1.4; }
.package-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.package-pill { min-width: 0; min-height: 42px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface-soft); color: var(--text); font-weight: 700; }
.package-pill.active { background: var(--solid); border-color: var(--solid); color: var(--solid-text); }
.range-box { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.range-top, .range-scale { display: flex; align-items: center; justify-content: space-between; }
.range-top { color: var(--muted); font-size: 13px; }
.range-top strong { color: var(--text); font-size: 26px; line-height: 1; }
.range-scale { color: var(--muted); font-size: 12px; }
.minute-range { width: 100%; margin: 16px 0 8px; accent-color: var(--text); }
.subscription-list { display: grid; gap: 8px; }
.subscription-row { width: 100%; min-height: 62px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface-soft); display: flex; align-items: center; gap: 12px; padding: 12px; color: inherit; text-align: left; }
.subscription-row.active { border-color: var(--solid); background: var(--surface); }
.subscription-row .check { width: 28px; height: 28px; border-radius: 999px; background: var(--surface-muted); display: grid; place-items: center; font-size: 14px; font-weight: 800; flex: 0 0 auto; }
.subscription-row.active .check { background: var(--solid); color: var(--solid-text); }
.subscription-row strong, .subscription-row small { display: block; }
.subscription-row small { margin-top: 3px; color: var(--muted); font-size: 12px; }
.transactions-card { padding: 0; }
.transaction-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 15px 18px; border-top: 1px solid var(--line); }
.transaction-row:first-child { border-top: 0; }
.transaction-row span { min-width: 0; }
.transaction-row strong, .transaction-row small { display: block; }
.transaction-row strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.transaction-row small { margin-top: 4px; color: var(--muted); font-size: 12px; }
.transaction-row b { flex: 0 0 auto; font-size: 14px; }
.transaction-row b.negative { color: var(--text); }
.transaction-row b.positive { color: var(--success-text); }
.empty.compact { padding: 20px 18px; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stat { padding: 16px 8px; text-align: center; }
.stat strong { display: block; font-size: 22px; }
.stat span { display: block; color: var(--muted); font-size: 12px; margin-top: 4px; }
.danger { color: var(--error-text); }
.loader { padding: var(--app-top-gap) 24px 24px; text-align: center; color: var(--muted); }
.error { padding: var(--app-top-gap) 24px 24px; color: var(--error-text); text-align: center; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes sheetUp { from { transform: translate(-50%, 16px); opacity: .75; } to { transform: translate(-50%, 0); opacity: 1; } }
@keyframes aiGradient { 0%, 100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }
