/* video-notes — styles (iOS 26 "Liquid Glass" look). Tokens and components come from the approved mockup v2 (mockup/styles.css). */
:root {
  --page: #E6E4F0;
  --bg: #F2F2F7;
  --amb-1: rgba(98, 80, 255, 0.20);
  --amb-2: rgba(236, 72, 153, 0.11);
  --amb-3: rgba(14, 165, 233, 0.12);
  --surface: rgba(255, 255, 255, 0.84);
  --surface-solid: #FFFFFF;
  --card-rim: rgba(255, 255, 255, 0.9);
  --card-shadow: 0 1px 2px rgba(20, 16, 60, 0.04), 0 6px 20px rgba(20, 16, 60, 0.05);
  --fill: rgba(118, 118, 128, 0.12);
  --fill-2: rgba(118, 118, 128, 0.2);
  --text: #0B0B10;
  --text-2: #4E4E58;
  --text-3: #6B6B75;
  --sep: rgba(60, 60, 67, 0.14);
  --accent: #5B4BF0;
  --accent-hi: #7A6CFF;
  --accent-ink: #FFFFFF;
  --accent-text: #4A3AD8;
  --accent-tint: rgba(91, 75, 240, 0.11);
  --accent-tint-2: rgba(91, 75, 240, 0.2);
  --glass: rgba(255, 255, 255, 0.62);
  --glass-bar: rgba(255, 255, 255, 0.74);
  --glass-strong: rgba(250, 250, 253, 0.78);
  --glass-solid: rgba(248, 248, 251, 0.97);
  --glass-rim: rgba(255, 255, 255, 0.78);
  --glass-edge: rgba(15, 15, 40, 0.07);
  --glass-hi: rgba(255, 255, 255, 0.95);
  --glass-shadow: 0 10px 30px rgba(28, 20, 90, 0.14), 0 2px 6px rgba(28, 20, 90, 0.06);
  --seg-thumb: #FFFFFF;
  --glyph-cut: #FFFFFF;
  --sheet-glass: rgba(246, 246, 250, 0.9);
  --sheet-group: rgba(255, 255, 255, 0.78);
  --backdrop: rgba(10, 8, 30, 0.26);
  --mark: #FFE27A;
  --danger: #D70015;
  --danger-tint: rgba(255, 59, 48, 0.12);
  --success: #1F8A3B;
  --success-tint: rgba(52, 199, 89, 0.15);
  --switch-on: #34C759;
  --frame: #121214;
  --toast-bg: rgba(28, 28, 34, 0.8);
  --toast-ink: #FFFFFF;
  --tabbar-h: 64px;
  --top-inset: env(safe-area-inset-top, 0px);
  --bottom-inset: env(safe-area-inset-bottom, 0px);
  --spring: cubic-bezier(.32, 1.24, .52, 1);
  --spring-soft: cubic-bezier(.3, 1.12, .5, 1);
  --ease-out: cubic-bezier(.2, .8, .2, 1);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --page: #050507; --bg: #000000;
    --amb-1: rgba(124, 108, 255, 0.30); --amb-2: rgba(236, 72, 153, 0.15); --amb-3: rgba(14, 165, 233, 0.14);
    --surface: rgba(30, 30, 35, 0.84); --surface-solid: #1C1C1F;
    --card-rim: rgba(255, 255, 255, 0.07); --card-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
    --fill: rgba(118, 118, 128, 0.24); --fill-2: rgba(118, 118, 128, 0.34);
    --text: #F5F5F7; --text-2: #B6B6C0; --text-3: #9393A0; --sep: rgba(255, 255, 255, 0.1);
    --accent: #8B7CFF; --accent-hi: #A499FF; --accent-ink: #0B0A1F; --accent-text: #ABA1FF;
    --accent-tint: rgba(139, 124, 255, 0.17); --accent-tint-2: rgba(139, 124, 255, 0.28);
    --glass: rgba(44, 44, 52, 0.5); --glass-bar: rgba(34, 34, 42, 0.7); --glass-strong: rgba(36, 36, 44, 0.74); --glass-solid: rgba(32, 32, 38, 0.97);
    --glass-rim: rgba(255, 255, 255, 0.14); --glass-edge: rgba(0, 0, 0, 0.4); --glass-hi: rgba(255, 255, 255, 0.16);
    --glass-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 2px 6px rgba(0, 0, 0, 0.3);
    --seg-thumb: rgba(255, 255, 255, 0.16); --glyph-cut: #17151F;
    --sheet-glass: rgba(30, 30, 36, 0.88); --sheet-group: rgba(255, 255, 255, 0.07);
    --backdrop: rgba(0, 0, 0, 0.5);
    --mark: rgba(250, 204, 21, 0.4); --danger: #FF6961; --danger-tint: rgba(255, 105, 97, 0.16);
    --success: #4CD964; --success-tint: rgba(76, 217, 100, 0.16); --switch-on: #30D158;
    --frame: #2A2A30; --toast-bg: rgba(245, 245, 250, 0.84); --toast-ink: #111114;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --page: #050507; --bg: #000000;
  --amb-1: rgba(124, 108, 255, 0.30); --amb-2: rgba(236, 72, 153, 0.15); --amb-3: rgba(14, 165, 233, 0.14);
  --surface: rgba(30, 30, 35, 0.84); --surface-solid: #1C1C1F;
  --card-rim: rgba(255, 255, 255, 0.07); --card-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
  --fill: rgba(118, 118, 128, 0.24); --fill-2: rgba(118, 118, 128, 0.34);
  --text: #F5F5F7; --text-2: #B6B6C0; --text-3: #9393A0; --sep: rgba(255, 255, 255, 0.1);
  --accent: #8B7CFF; --accent-hi: #A499FF; --accent-ink: #0B0A1F; --accent-text: #ABA1FF;
  --accent-tint: rgba(139, 124, 255, 0.17); --accent-tint-2: rgba(139, 124, 255, 0.28);
  --glass: rgba(44, 44, 52, 0.5); --glass-bar: rgba(34, 34, 42, 0.7); --glass-strong: rgba(36, 36, 44, 0.74); --glass-solid: rgba(32, 32, 38, 0.97);
  --glass-rim: rgba(255, 255, 255, 0.14); --glass-edge: rgba(0, 0, 0, 0.4); --glass-hi: rgba(255, 255, 255, 0.16);
  --glass-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 2px 6px rgba(0, 0, 0, 0.3);
  --seg-thumb: rgba(255, 255, 255, 0.16); --glyph-cut: #17151F;
  --sheet-glass: rgba(30, 30, 36, 0.88); --sheet-group: rgba(255, 255, 255, 0.07);
  --backdrop: rgba(0, 0, 0, 0.5);
  --mark: rgba(250, 204, 21, 0.4); --danger: #FF6961; --danger-tint: rgba(255, 105, 97, 0.16);
  --success: #4CD964; --success-tint: rgba(76, 217, 100, 0.16); --switch-on: #30D158;
  --frame: #2A2A30; --toast-bg: rgba(245, 245, 250, 0.84); --toast-ink: #111114;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background:
    radial-gradient(60% 50% at 18% 12%, var(--amb-1), transparent 70%),
    radial-gradient(50% 50% at 85% 88%, var(--amb-2), transparent 70%),
    var(--page);
  color: var(--text);
  font-family: -apple-system, "SF Pro Text", system-ui, "Inter", sans-serif;
  font-size: 17px;
  line-height: 1.35;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  text-rendering: optimizeLegibility;
  overflow: hidden;
}
button { font: inherit; color: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
input { font: inherit; }
svg { flex: none; }
code, .mono { font-family: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace; }

/* ---------- Liquid glass material (shared) ---------- */
.tabbar, .back, .device.scrolled .navbar, .toast, .tabs, .seg, .chip, .light-hint,
.glass-card, .extras, .round-btn, .search-field, .cost-hint {
  -webkit-backdrop-filter: blur(22px) saturate(185%);
  backdrop-filter: blur(22px) saturate(185%);
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .tabbar, .back, .device.scrolled .navbar, .sheet, .glass-card, .round-btn { background: var(--glass-solid) !important; }
  .toast { background: var(--toast-bg); }
}

/* ---------- Device: full-bleed phone / framed desktop ---------- */
.device {
  position: relative;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  background: var(--bg);
  overflow: hidden;
  isolation: isolate;
}
/* Ambient, accent-derived colour field behind the content so glass reads as glass. */
.device::before {
  content: ''; position: absolute; inset: 0; pointer-events: none; z-index: 0;
  background:
    radial-gradient(70% 38% at 0% 0%, var(--amb-1), transparent 72%),
    radial-gradient(60% 34% at 100% 22%, var(--amb-2), transparent 72%),
    radial-gradient(80% 40% at 40% 100%, var(--amb-3), transparent 72%);
}
@media (min-width: 500px) {
  body { display: flex; align-items: center; justify-content: center; min-height: 100dvh; }
  .device {
    width: 430px;
    height: min(900px, calc(100dvh - 40px));
    border-radius: 36px;
    box-shadow: 0 0 0 1px var(--glass-edge), 0 30px 80px rgba(0, 0, 0, 0.22);
    --top-inset: 8px;
    --bottom-inset: 16px;
  }
}

.view {
  position: absolute; inset: 0; z-index: 1;
  overflow-y: auto; overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding-bottom: calc(var(--tabbar-h) + max(12px, calc(var(--bottom-inset) - 10px)) + 36px);
}
.view.no-tabbar { padding-bottom: 0; }
.view.anim-forward { animation: pushIn .52s var(--spring-soft); }
.view.anim-back { animation: popIn .48s var(--spring-soft); }
.view.anim-tab { animation: tabIn .34s var(--ease-out); }
@keyframes pushIn { from { transform: translateX(34%); opacity: .35; } to { transform: none; opacity: 1; } }
@keyframes popIn { from { transform: translateX(-24%); opacity: .35; } to { transform: none; opacity: 1; } }
@keyframes tabIn { from { transform: translateY(8px) scale(.988); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- Floating glass tab bar ---------- */
.tabbar {
  position: absolute; z-index: 20;
  left: 16px; right: 16px;
  bottom: max(12px, calc(var(--bottom-inset) - 10px));
  height: var(--tabbar-h);
  display: flex; gap: 2px; padding: 5px;
  border-radius: 32px;
  background: var(--glass-bar);
  -webkit-backdrop-filter: blur(28px) saturate(190%) !important; backdrop-filter: blur(28px) saturate(190%) !important;
  border: 0.5px solid var(--glass-rim);
  box-shadow: inset 0 1px 0 var(--glass-hi), inset 0 0 0 0.5px var(--glass-edge), var(--glass-shadow);
}
@media (max-width: 499px) { .tabbar { position: fixed; } }
.tabbar.hidden { display: none; }
.tabbar button {
  flex: 1; min-width: 0; min-height: 44px; border: 0; background: none; padding: 0;
  border-radius: 27px; position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  color: var(--text); font-size: 11px; font-weight: 600; letter-spacing: .01em;
  transition: background-color .3s var(--ease-out), color .3s var(--ease-out), transform .35s var(--spring);
}
.tabbar button:active { transform: scale(.94); }
.tabbar .tab-ico { display: grid; place-items: center; height: 27px; }
.tabbar .tab-l { white-space: nowrap; }
.tabbar button.active { color: var(--accent-text); background: var(--accent-tint-2); }
.tabbar button.active .tab-ico { animation: tabPop .45s var(--spring); }
@keyframes tabPop { from { transform: scale(.82); } to { transform: none; } }
.tab-dot {
  position: absolute; top: 3px; left: calc(50% + 7px); min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 9px; background: #FF3B30; color: #fff; font-size: 11px; font-weight: 700; line-height: 18px;
  font-variant-numeric: tabular-nums; box-shadow: 0 0 0 2px var(--glass-hi);
}

/* ---------- Navigation bar & titles ---------- */
.navbar {
  position: sticky; top: 0; z-index: 10;
  padding-top: var(--top-inset);
  background: transparent;
  border-bottom: 0.5px solid transparent;
  transition: background-color .25s var(--ease-out), border-color .25s var(--ease-out);
}
.device.scrolled .navbar { background: var(--glass-strong); border-bottom-color: var(--sep); }
.navrow { position: relative; height: 52px; display: flex; align-items: center; padding: 0 12px; }
.back {
  position: relative; z-index: 1;
  display: inline-flex; align-items: center; justify-content: center; gap: 2px;
  height: 44px; min-width: 44px; padding: 0 12px; border-radius: 22px;
  border: 0.5px solid var(--glass-rim); background: var(--glass); color: var(--text);
  box-shadow: inset 0 1px 0 var(--glass-hi), 0 4px 14px rgba(28, 20, 90, 0.1);
  font-size: 17px; font-weight: 500;
  transition: padding .3s var(--ease-out), transform .35s var(--spring);
}
.back:active { transform: scale(.94); }
.back svg { margin-left: -2px; }
.back-l {
  position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}
.back.with-label { padding: 0 16px 0 11px; }
.back.with-label .back-l {
  position: static; width: auto; height: auto; clip: auto; max-width: 150px; overflow: hidden;
  transition: max-width .3s var(--ease-out), opacity .2s;
}
.device.scrolled .back.with-label { padding: 0 12px; }
.device.scrolled .back.with-label .back-l { max-width: 0; opacity: 0; }
.nav-title {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -30%);
  max-width: calc(100% - 136px);
  font-size: 17px; font-weight: 600; letter-spacing: -0.01em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  opacity: 0; pointer-events: none;
  transition: opacity .2s var(--ease-out), transform .3s var(--ease-out);
}
.device.scrolled .nav-title { opacity: 1; transform: translate(-50%, -50%); }
.large-title {
  font-size: 34px; line-height: 41px; font-weight: 700; letter-spacing: -0.022em;
  margin: 2px 20px 14px; overflow-wrap: anywhere;
  transition: opacity .2s var(--ease-out);
}
.device.scrolled .large-title:not(.sm) { opacity: .0; }
.large-title.sm { font-size: 28px; line-height: 34px; letter-spacing: -0.02em; margin-top: 18px; margin-bottom: 10px; }
.subtitle { color: var(--text-2); margin: -8px 20px 18px; font-size: 16px; }

.section-h { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 30px 20px 12px; }
.section-h h2 { font-size: 22px; line-height: 28px; font-weight: 700; margin: 0; letter-spacing: -0.016em; }
.section-h small { color: var(--text-2); font-size: 15px; text-align: right; }
.footnote { color: var(--text-2); font-size: 14px; margin: 10px 24px 0; line-height: 1.4; }

/* ---------- Inset grouped lists ---------- */
.group {
  background: var(--surface); border-radius: 22px; margin: 0 16px; overflow: hidden;
  box-shadow: inset 0 0 0 0.5px var(--card-rim), var(--card-shadow);
}
.row {
  display: flex; align-items: center; gap: 14px; width: 100%;
  min-height: 56px; padding: 12px 16px; text-align: left;
  border: 0; background: none; position: relative;
  transition: background-color .2s;
}
button.row:active { background: var(--fill); }
.row + .row::before, .row + .row-wrap::before, .row-wrap + .row::before {
  content: ''; position: absolute; top: 0; left: 16px; right: 0; border-top: 0.5px solid var(--sep);
}
.row:has(> .ico-tile) + .row::before, .row + .row:has(> .ico-tile)::before, .row:has(> .job-ico) + .row::before { left: 62px; }
.row .grow { flex: 1; min-width: 0; }
.row .label { font-size: 17px; }
.row .sub { font-size: 15px; color: var(--text-2); margin-top: 2px; line-height: 1.35; }
.row .value { color: var(--text-2); font-size: 17px; }
.row .chev { color: var(--text-3); display: grid; place-items: center; transition: transform .3s var(--spring); }
.row[disabled] { opacity: 1; cursor: default; }
.ico-tile {
  --th: 250;
  width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; flex: none;
  background: linear-gradient(180deg, hsl(var(--th) 92% 66%), hsl(var(--th) 78% 50%));
  color: #fff; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3);
}
.ico-tile.off { background: var(--fill); color: var(--text-3); box-shadow: none; }
.count-pill {
  font-size: 15px; font-weight: 600; color: var(--text-2); font-variant-numeric: tabular-nums;
  min-width: 28px; height: 26px; padding: 0 9px; border-radius: 13px; background: var(--fill);
  display: inline-grid; place-items: center;
}
.tag { font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 999px; background: var(--fill); color: var(--text-2); white-space: nowrap; }

/* ---------- Search field (home & search) ---------- */
.search-field {
  display: flex; align-items: center; gap: 8px; height: 46px; margin: 0 16px;
  padding: 0 16px; border-radius: 23px; color: var(--text-3);
  background: var(--glass); border: 0.5px solid var(--glass-rim);
  box-shadow: inset 0 1px 0 var(--glass-hi), inset 0 0 0 0.5px var(--glass-edge);
  width: calc(100% - 32px); text-align: left; font-size: 17px;
}
.search-field > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search-field input { flex: 1; min-width: 0; border: 0; background: none; outline: none; color: var(--text); font-size: 17px; height: 100%; }
.search-field input::placeholder { color: var(--text-3); }
.search-field input::-webkit-search-cancel-button { -webkit-appearance: none; }

/* ---------- 9:16 thumbnails ---------- */
.thumb {
  --h: 250;
  flex: none; width: 80px; height: 142px; border-radius: 18px; position: relative; overflow: hidden;
  display: grid; place-items: center; color: #fff;
  background:
    radial-gradient(90% 55% at 30% 18%, hsl(var(--h) 100% 78% / .9), transparent 70%),
    radial-gradient(70% 45% at 80% 85%, hsl(calc(var(--h) + 60) 90% 55% / .7), transparent 70%),
    linear-gradient(170deg, hsl(var(--h) 72% 56%), hsl(calc(var(--h) + 35) 68% 36%) 60%, hsl(calc(var(--h) + 70) 60% 18%));
  box-shadow: inset 0 0 0 0.5px rgba(255, 255, 255, 0.2);
}
.thumb::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 45%; background: linear-gradient(transparent, rgba(0, 0, 0, 0.35)); }
.thumb .pl {
  position: relative; z-index: 1; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; padding-left: 2px;
  background: rgba(255, 255, 255, 0.26); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.thumb .pf, .thumb .dur {
  position: absolute; z-index: 1; font-size: 9.5px; font-weight: 700; line-height: 1; letter-spacing: 0;
  padding: 4px 6px; border-radius: 999px; background: rgba(0, 0, 0, 0.34); color: #fff;
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.thumb .pf { left: 5px; top: 5px; max-width: calc(100% - 10px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.thumb .dur { right: 6px; bottom: 6px; font-variant-numeric: tabular-nums; }
.thumb.sm { width: 40px; height: 71px; border-radius: 11px; }
.thumb.sm .pl { width: 22px; height: 22px; }

/* ---------- Note cards ---------- */
.cards { display: flex; flex-direction: column; gap: 12px; margin: 0 16px; }
.card {
  display: flex; gap: 14px; padding: 10px; width: 100%; text-align: left;
  background: var(--surface); border: 0; border-radius: 26px;
  box-shadow: inset 0 0 0 0.5px var(--card-rim), var(--card-shadow);
  transition: transform .4s var(--spring);
}
.card:active, .topic-tile:active { transform: scale(.975); }
.card .body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; padding: 6px 6px 6px 0; }
.card .title { font-size: 17px; font-weight: 600; line-height: 1.28; letter-spacing: -0.01em; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 15px; color: var(--text-2); }
.meta .sep { color: var(--text-3); }
.platform { font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: var(--fill); color: var(--text-2); letter-spacing: .01em; }
.badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; }

/* ---------- Lens · Depth badge ---------- */
.badge {
  display: inline-block; white-space: nowrap; line-height: 20px;
  font-size: 13px; font-weight: 600; padding: 3px 3px 3px 10px; border-radius: 999px;
  background: var(--accent-tint); color: var(--accent-text);
}
.badge .dot, .tab .dot { padding: 0 4px; opacity: .6; }
.tab .tl { white-space: nowrap; }
.depth { display: inline-block; padding: 0 8px; border-radius: 999px; font-size: 12px; font-weight: 700; line-height: 18px; border: 1px solid var(--accent); vertical-align: 0; }
.depth.full { background: linear-gradient(180deg, var(--accent-hi), var(--accent)); color: var(--accent-ink); border-color: transparent; }
.depth.light { background: transparent; color: var(--accent-text); border-color: var(--accent-text); }

/* ---------- Buttons (capsules) ---------- */
.btn {
  min-height: 50px; border-radius: 25px; padding: 0 20px; border: 0;
  font-size: 17px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  transition: transform .35s var(--spring), opacity .2s;
}
.btn:active { transform: scale(.96); }
.btn > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.btn-primary {
  background: linear-gradient(180deg, var(--accent-hi), var(--accent)); color: var(--accent-ink);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28), 0 6px 18px rgba(91, 75, 240, 0.32);
}
.btn-secondary { background: var(--accent-tint); color: var(--accent-text); box-shadow: inset 0 0 0 0.5px var(--accent-tint-2); }
.btn-plain { background: none; color: var(--accent-text); padding: 0 10px; min-height: 44px; }
.btn-sm { min-height: 36px; padding: 0 14px; font-size: 15px; border-radius: 18px; position: relative; }
.btn-sm::before { content: ''; position: absolute; inset: -4px 0; }
.btn[disabled] { opacity: .42; cursor: default; transform: none; }
.btn-block { width: 100%; }
.round-btn {
  width: 34px; height: 34px; border-radius: 50%; border: 0; display: grid; place-items: center; flex: none; position: relative;
  background: var(--fill); color: var(--text-2);
}
.round-btn::before { content: ''; position: absolute; inset: -5px; }

/* ---------- Processing (glass card + smooth bar) ---------- */
.proc { display: flex; flex-direction: column; gap: 10px; margin: 0 16px; }
.glass-card {
  background: var(--glass); border: 0.5px solid var(--glass-rim);
  box-shadow: inset 0 1px 0 var(--glass-hi), inset 0 0 0 0.5px var(--glass-edge), var(--glass-shadow);
}
.proc-row { display: flex; align-items: center; gap: 12px; border-radius: 24px; padding: 12px 14px 12px 12px; }
.proc-row .grow { flex: 1; min-width: 0; }
.proc-row .t { font-size: 16px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.proc-row .s { font-size: 15px; color: var(--text-2); display: flex; align-items: center; gap: 6px; margin: 3px 0 9px; min-width: 0; }
.proc-row .s > span:not(.spin) { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.proc-row .s.ok { color: var(--success); }
.proc-row .frac { color: var(--text-3); font-variant-numeric: tabular-nums; flex: none; }
.progress { display: block; height: 6px; border-radius: 3px; background: var(--fill); overflow: hidden; position: relative; }
.progress i {
  display: block; height: 100%; border-radius: 3px; position: relative; overflow: hidden;
  background: linear-gradient(90deg, var(--accent), var(--accent-hi));
  animation: grow .9s var(--spring-soft);
}
@keyframes grow { from { width: var(--from); } }
.progress.live i::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.55), transparent);
  transform: translateX(-100%); animation: shimmer 1.6s ease-in-out infinite;
}
@keyframes shimmer { to { transform: translateX(100%); } }
.empty-line { margin: 0 16px; padding: 16px 18px; border-radius: 22px; background: var(--surface); color: var(--text-2); font-size: 16px; box-shadow: inset 0 0 0 0.5px var(--card-rim); }

.spin { width: 14px; height: 14px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .8s linear infinite; display: inline-block; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Home topic tiles ---------- */
.topic-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 0 16px; }
.topic-tile {
  --th: 250;
  display: flex; flex-direction: column; align-items: stretch; gap: 4px; text-align: left; min-width: 0;
  padding: 14px 14px 16px; border: 0; border-radius: 24px;
  background: linear-gradient(155deg, hsl(var(--th) 95% 62% / .16), transparent 62%), var(--surface);
  box-shadow: inset 0 0 0 0.5px var(--card-rim), var(--card-shadow);
  transition: transform .4s var(--spring);
}
.topic-grid > .topic-tile:last-child:nth-child(odd) {
  grid-column: 1 / -1; display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 14px; row-gap: 2px; align-items: center; padding: 14px;
}
.topic-grid > .topic-tile:last-child:nth-child(odd) .tt-top { display: contents; }
.topic-grid > .topic-tile:last-child:nth-child(odd) .sym { grid-row: 1 / 3; }
.topic-grid > .topic-tile:last-child:nth-child(odd) .tt-count { grid-column: 3; grid-row: 1 / 3; }
.topic-grid > .topic-tile:last-child:nth-child(odd) .tt-name { align-self: end; }
.topic-grid > .topic-tile:last-child:nth-child(odd) .tt-subs { align-self: start; }
.topic-tile .tt-top { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 10px; }
.topic-tile .sym {
  width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; color: #fff;
  background: linear-gradient(180deg, hsl(var(--th) 95% 64%), hsl(var(--th) 80% 48%));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.32), 0 6px 14px hsl(var(--th) 80% 45% / .28);
}
.topic-tile .tt-count {
  font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--text-2);
  min-width: 30px; height: 28px; padding: 0 10px; border-radius: 14px; background: var(--fill); display: inline-grid; place-items: center;
}
.topic-tile .tt-name { font-size: 17px; font-weight: 600; letter-spacing: -0.01em; }
.topic-tile .tt-subs { font-size: 14px; line-height: 1.35; color: var(--text-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ---------- Note screen ---------- */
.player {
  --h: 250;
  position: relative; display: grid; place-items: center; overflow: hidden; isolation: isolate;
  margin: 6px 16px 0; width: calc(100% - 32px); height: clamp(236px, 70vw, 310px); padding: 0; border: 0;
  border-radius: 30px; color: #fff; background: #0A0A10;
  box-shadow: 0 14px 36px hsl(var(--h) 60% 30% / .3), inset 0 0 0 0.5px rgba(255, 255, 255, 0.12);
}
.player .backdrop-art, .player .frame {
  background:
    radial-gradient(90% 55% at 30% 18%, hsl(var(--h) 100% 78% / .9), transparent 70%),
    radial-gradient(70% 45% at 80% 85%, hsl(calc(var(--h) + 60) 90% 55% / .7), transparent 70%),
    linear-gradient(170deg, hsl(var(--h) 72% 56%), hsl(calc(var(--h) + 35) 68% 36%) 60%, hsl(calc(var(--h) + 70) 60% 18%));
}
.player .backdrop-art { position: absolute; inset: -30px; z-index: -2; filter: blur(26px) saturate(1.3) brightness(.75); }
.player .frame {
  position: absolute; z-index: -1; top: 14px; left: 50%; height: calc(100% - 28px); aspect-ratio: 9 / 16; transform: translateX(-50%);
  border-radius: 20px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35), inset 0 0 0 0.5px rgba(255, 255, 255, 0.25);
}
.player .play {
  width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; padding-left: 3px;
  background: rgba(255, 255, 255, 0.24); border: 0.5px solid rgba(255, 255, 255, 0.4);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45), 0 8px 24px rgba(0, 0, 0, 0.25);
  -webkit-backdrop-filter: blur(18px) saturate(180%); backdrop-filter: blur(18px) saturate(180%);
  transition: transform .35s var(--spring);
}
.player.playing .play { padding-left: 0; }
.player:active .play { transform: scale(.92); }
.player .ph, .player .cap {
  position: absolute; font-size: 13px; font-weight: 600; padding: 6px 11px; border-radius: 999px; line-height: 1.2;
  background: rgba(0, 0, 0, 0.28); border: 0.5px solid rgba(255, 255, 255, 0.22);
  -webkit-backdrop-filter: blur(14px) saturate(160%); backdrop-filter: blur(14px) saturate(160%);
}
.player .ph { left: 14px; top: 14px; font-variant-numeric: tabular-nums; }
.player .cap { bottom: 34px; left: 50%; transform: translateX(-50%); white-space: nowrap; }
.player .bar { position: absolute; left: 20px; right: 20px; bottom: 18px; height: 5px; border-radius: 3px; background: rgba(255, 255, 255, 0.3); overflow: hidden; }
.player .bar i { display: block; height: 100%; width: 100%; background: #fff; transform-origin: left; animation: fill linear forwards; }
@keyframes fill { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.note-meta { margin: -2px 20px 14px; }
.note-links { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 16px; }
.chip {
  min-height: 40px; display: inline-flex; align-items: center; gap: 6px; padding: 0 14px; border-radius: 20px;
  border: 0.5px solid var(--glass-rim); background: var(--glass); color: var(--text); font-size: 15px; font-weight: 500;
  box-shadow: inset 0 1px 0 var(--glass-hi), inset 0 0 0 0.5px var(--glass-edge), 0 2px 8px rgba(28, 20, 90, 0.06);
  max-width: 100%; position: relative; transition: transform .35s var(--spring);
}
.chip:active { transform: scale(.95); }
.chip::before { content: ''; position: absolute; inset: -2px 0; }
.chip span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chip.accent { color: var(--accent-text); }
.explain { margin: -4px 20px 12px; font-size: 15px; color: var(--text-2); }

/* Analysis tabs = glass segmented control (scrolls when it has more than 3). */
.tabs-wrap { margin: 0 16px; }
.tabs {
  display: inline-flex; max-width: 100%; gap: 2px; padding: 4px; border-radius: 26px;
  overflow-x: auto; scrollbar-width: none; scroll-snap-type: x proximity;
  background: var(--glass); border: 0.5px solid var(--glass-rim);
  box-shadow: inset 0 1px 0 var(--glass-hi), inset 0 0 0 0.5px var(--glass-edge), 0 4px 14px rgba(28, 20, 90, 0.07);
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  flex: none; min-height: 44px; padding: 0 16px; border-radius: 22px; scroll-snap-align: start;
  border: 0; background: transparent; color: var(--text-2);
  font-size: 15px; font-weight: 600; display: inline-flex; align-items: center; gap: 0;
  transition: background-color .3s var(--ease-out), color .3s, box-shadow .3s;
}
.tab.active { background: var(--seg-thumb); color: var(--text); box-shadow: 0 2px 10px rgba(20, 16, 60, 0.12), inset 0 0 0 0.5px var(--card-rim); }
.tab.active .lens { color: var(--accent-text); }
.tab .spin { margin-right: 8px; color: var(--accent-text); }
.note-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 14px 16px 0; }
.note-actions .btn { flex: 1 1 auto; min-width: min(100%, max-content); padding: 0 18px; }
.note-actions .btn > span { overflow: visible; }
.light-hint {
  margin: 14px 16px 0; padding: 12px 14px; border-radius: 18px; font-size: 15px; color: var(--text-2);
  display: flex; gap: 10px; align-items: flex-start; line-height: 1.4;
  background: var(--glass); border: 0.5px solid var(--glass-rim); box-shadow: inset 0 1px 0 var(--glass-hi);
}
.light-hint svg { color: var(--accent-text); margin-top: 1px; }

.group.analysis { margin: 14px 16px 0; background: none; box-shadow: none; border-radius: 0; overflow: visible; display: flex; flex-direction: column; gap: 10px; }
.field {
  padding: 14px 18px 16px; position: relative; border-radius: 22px;
  background: var(--surface); box-shadow: inset 0 0 0 0.5px var(--card-rim), var(--card-shadow);
}
.field h4 { margin: 0 0 6px; font-size: 12px; font-weight: 700; color: var(--text-3); letter-spacing: .07em; text-transform: uppercase; }
.field p { margin: 0; font-size: 17px; line-height: 1.47; overflow-wrap: anywhere; }
.field ol, .field ul { margin: 0; padding-left: 22px; font-size: 17px; line-height: 1.47; overflow-wrap: anywhere; }
.field li + li { margin-top: 8px; }
.field li::marker { color: var(--accent-text); font-weight: 600; font-variant-numeric: tabular-nums; }
.hook-part { display: grid; grid-template-columns: 96px 1fr; gap: 10px; margin-top: 10px; }
.hook-part + .hook-part { padding-top: 10px; border-top: 0.5px solid var(--sep); }
.hook-part b { font-size: 14px; font-weight: 600; color: var(--accent-text); padding-top: 3px; }
.extras {
  margin: 12px 16px 0; padding: 16px 18px; border-radius: 24px; position: relative;
  background: linear-gradient(140deg, var(--accent-tint-2), var(--accent-tint) 55%, var(--glass));
  border: 1px solid var(--accent-tint-2);
  box-shadow: inset 0 1px 0 var(--glass-hi), 0 8px 24px rgba(91, 75, 240, 0.12);
}
.extras h4 { margin: 0 0 10px; font-size: 16px; font-weight: 700; color: var(--accent-text); display: flex; align-items: center; gap: 8px; }
.extras .x-ico { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(180deg, var(--accent-hi), var(--accent)); color: var(--accent-ink); flex: none; }
.extras ul { margin: 0; padding-left: 20px; font-size: 16px; line-height: 1.45; }
.extras li + li { margin-top: 6px; }
.extras .up { margin-top: 12px; font-size: 14px; font-weight: 600; color: var(--text-2); }
.a-meta { margin: 12px 24px 0; font-size: 13px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.busy-box { margin: 14px 16px 0; padding: 18px; border-radius: 22px; background: var(--surface); box-shadow: inset 0 0 0 0.5px var(--card-rim), var(--card-shadow); }
.busy-box .l { display: flex; align-items: center; gap: 10px; font-weight: 600; color: var(--accent-text); }
.busy-box .track { height: 6px; border-radius: 3px; background: var(--fill); margin-top: 14px; overflow: hidden; }
.busy-box .track i { display: block; height: 100%; border-radius: 3px; background: linear-gradient(90deg, var(--accent), var(--accent-hi)); transform-origin: left; animation: fill 3s var(--ease-out) forwards; }
.busy-box .skel {
  height: 12px; border-radius: 6px; margin-top: 14px;
  background: linear-gradient(90deg, var(--fill) 0%, var(--fill-2) 50%, var(--fill) 100%); background-size: 200% 100%;
  animation: skel 1.4s ease-in-out infinite;
}
@keyframes skel { from { background-position: 100% 0; } to { background-position: -100% 0; } }
.transcript { padding: 2px 0 12px; }
.transcript-line { display: grid; grid-template-columns: 48px 1fr; gap: 10px; padding: 7px 18px; font-size: 16px; line-height: 1.4; }
.transcript-line .ts { color: var(--accent-text); font-variant-numeric: tabular-nums; font-weight: 600; font-size: 14px; padding-top: 2px; }

/* ---------- Search ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 16px 0; }
.result .snip { font-size: 15px; color: var(--text-2); line-height: 1.4; overflow-wrap: anywhere; }
.result .where { font-size: 12px; font-weight: 700; color: var(--text-3); text-transform: uppercase; letter-spacing: .06em; }
mark { background: var(--mark); color: inherit; border-radius: 4px; padding: 0 2px; }
.empty-state { margin: 48px 24px; text-align: center; color: var(--text-3); }
.empty-state .big { font-size: 17px; font-weight: 600; color: var(--text); margin-top: 12px; }

/* ---------- Activity ---------- */
.job-ico { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; flex: none; }
.job-ico.done { background: var(--success-tint); color: var(--success); }
.job-ico.failed { background: var(--danger-tint); color: var(--danger); }
.job-ico.processing { background: var(--accent-tint); color: var(--accent-text); }
.job-progress { margin-top: 8px; }
.reason { color: var(--danger); font-size: 15px; margin-top: 2px; font-weight: 500; }

/* ---------- Settings ---------- */
.switch {
  position: relative; width: 51px; height: 31px; border-radius: 16px; border: 0; background: var(--fill-2); flex: none; padding: 0;
  transition: background-color .25s;
}
.switch::before { content: ''; position: absolute; inset: -7px -4px; }
.switch::after {
  content: ''; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15), 0 1px 1px rgba(0, 0, 0, 0.16); transition: transform .4s var(--spring);
}
.switch[aria-checked="true"] { background: var(--switch-on); }
.switch[aria-checked="true"]::after { transform: translateX(20px); }
.big-value { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }

.card-block {
  background: var(--surface); border-radius: 24px; margin: 0 16px 14px; padding: 16px 18px 18px;
  box-shadow: inset 0 0 0 0.5px var(--card-rim), var(--card-shadow);
}
.card-block h3 { margin: 0 0 6px; font-size: 17px; font-weight: 600; letter-spacing: -0.01em; }
.card-block h3 code { font-size: 15px; padding: 1px 6px; border-radius: 6px; background: var(--fill); }
.card-block p { margin: 0 0 12px; color: var(--text-2); font-size: 15px; }
.card-block .lbl { font-size: 14px; font-weight: 600; color: var(--text-2); margin: 16px 0 8px; }
.code {
  position: relative; background: var(--fill); border-radius: 14px; padding: 11px 12px 11px 14px; font-size: 13px; line-height: 1.5;
  white-space: pre-wrap; overflow-wrap: anywhere; word-break: break-word; font-family: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
}
.code .copy {
  float: right; width: 34px; height: 34px; margin: -5px -6px 2px 8px; border: 0; border-radius: 17px; position: relative;
  background: var(--accent-tint); color: var(--accent-text); display: grid; place-items: center;
}
.code .copy::before { content: ''; position: absolute; inset: -5px; }
.tools-list .row { padding-left: 0; padding-right: 0; min-height: 48px; }
.tools-list .row + .row::before { left: 0; }
.seg {
  display: flex; padding: 3px; margin: 0 16px 16px; border-radius: 24px;
  background: var(--glass); border: 0.5px solid var(--glass-rim);
  box-shadow: inset 0 1px 0 var(--glass-hi), inset 0 0 0 0.5px var(--glass-edge);
}
.seg button {
  flex: 1; min-height: 40px; border: 0; border-radius: 20px; background: none; font-size: 15px; font-weight: 600; color: var(--text-2);
  transition: background-color .3s var(--ease-out), color .3s, box-shadow .3s;
}
.seg button.on { background: var(--seg-thumb); color: var(--text); box-shadow: 0 2px 8px rgba(20, 16, 60, 0.13), inset 0 0 0 0.5px var(--card-rim); }
.step { display: flex; gap: 14px; padding: 14px 0; position: relative; }
.step + .step::before { content: ''; position: absolute; top: 0; left: 44px; right: 0; border-top: 0.5px solid var(--sep); }
.step .n {
  width: 30px; height: 30px; border-radius: 50%; color: var(--accent-ink); font-weight: 700; font-size: 15px; display: grid; place-items: center; flex: none;
  background: linear-gradient(180deg, var(--accent-hi), var(--accent)); font-variant-numeric: tabular-nums;
}
.step .grow { flex: 1; min-width: 0; }
.step .t { font-weight: 600; }
.step .d { color: var(--text-2); font-size: 15px; margin-top: 2px; }
.step .code { margin-top: 10px; }

/* ---------- Sheets (floating glass, grabber) ---------- */
.sheet-layer { position: absolute; inset: 0; z-index: 50; pointer-events: none; }
.sheet-layer.open { pointer-events: auto; }
.backdrop { position: absolute; inset: 0; background: var(--backdrop); opacity: 0; transition: opacity .3s var(--ease-out); }
.sheet-layer.open .backdrop { opacity: 1; }
.sheet {
  position: absolute; left: 8px; right: 8px; bottom: 8px; max-height: calc(100% - 96px);
  display: flex; flex-direction: column;
  background: var(--sheet-glass); border-radius: 36px;
  border: 0.5px solid var(--glass-rim);
  box-shadow: inset 0 1px 0 var(--glass-hi), 0 -4px 40px rgba(0, 0, 0, 0.18);
  -webkit-backdrop-filter: blur(40px) saturate(190%); backdrop-filter: blur(40px) saturate(190%);
  transform: translateY(calc(100% + 24px)); transition: transform .5s var(--spring-soft);
  padding-bottom: calc(max(0px, var(--bottom-inset) - 8px) + 10px);
  touch-action: pan-y;
}
.sheet-layer.open .sheet { transform: translateY(0); }
.sheet.dragging { transition: none; }
.grab { width: 36px; height: 5px; border-radius: 3px; background: var(--fill-2); margin: 8px auto 4px; flex: none; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 14px 12px 22px; flex: none; }
.sheet-head h3 { margin: 0; font-size: 20px; font-weight: 700; letter-spacing: -0.015em; }
.sheet-head .sub { color: var(--text-2); font-size: 15px; margin-top: 1px; }
.sheet-head .btn-plain { min-height: 36px; padding: 0 16px; border-radius: 18px; background: var(--fill); color: var(--text); font-size: 16px; position: relative; }
.sheet-head .btn-plain::before { content: ''; position: absolute; inset: -4px 0; }
.sheet-body { overflow-y: auto; overscroll-behavior: contain; padding-bottom: 6px; }
.sheet .group { margin: 0 12px 12px; background: var(--sheet-group); border-radius: 22px; box-shadow: none; }
.sheet .caption { text-align: center; color: var(--text-2); font-size: 14px; margin: 4px 20px 8px; }
/* "Save this video?" — a shared link is confirmed before anything is submitted. */
.share-link { margin: 0 12px 14px; padding: 14px 16px; background: var(--sheet-group); border-radius: 18px; font-size: 15px; line-height: 1.35; color: var(--text-2); overflow-wrap: anywhere; word-break: break-word; }
.share-actions { display: flex; gap: 10px; margin: 0 12px 10px; }
.share-actions .btn { flex: 1 1 0; min-width: 0; }
.cost-hint {
  margin: 0 12px 12px; padding: 11px 16px; border-radius: 18px; font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums;
  background: var(--accent-tint); color: var(--accent-text); box-shadow: inset 0 0 0 0.5px var(--accent-tint-2);
}
.lens-row { padding: 16px; position: relative; }
.lens-row + .lens-row::before { content: ''; position: absolute; top: 0; left: 16px; right: 0; border-top: 0.5px solid var(--sep); }
.lens-row .top { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.lens-row .name { font-size: 17px; font-weight: 600; }
.lens-row .d { color: var(--text-2); font-size: 15px; margin: 2px 0 12px; }
.lens-row .ctl { display: flex; gap: 10px; align-items: center; }
.lens-row .seg { margin: 0; flex: 1; min-width: 0; }
.lens-row .btn-sm { min-height: 40px !important; border-radius: 20px; }
.tree-topic { font-size: 12px; font-weight: 700; color: var(--text-3); margin: 14px 26px 8px; text-transform: uppercase; letter-spacing: .07em; }
.check { color: var(--accent-text); display: grid; place-items: center; }
/* ---------- Toast (glass capsule) ---------- */
.toast {
  position: absolute; left: 50%; z-index: 60;
  bottom: calc(var(--tabbar-h) + max(12px, calc(var(--bottom-inset) - 10px)) + 14px);
  transform: translate(-50%, 16px) scale(.96); opacity: 0; pointer-events: none;
  max-width: calc(100% - 32px); width: max-content;
  padding: 12px 18px; border-radius: 24px; font-size: 15px; font-weight: 600; text-align: center;
  background: var(--toast-bg); color: var(--toast-ink);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14), 0 10px 30px rgba(0, 0, 0, 0.25);
  transition: none;
}
.toast.show { opacity: 1; transform: translate(-50%, 0) scale(1); transition: opacity .25s var(--ease-out), transform .5s var(--spring); }
.toast.high { bottom: calc(var(--bottom-inset) + 24px); }

/* ---------- Real-app additions (posters, video, add-by-URL, failed states) ---------- */
.thumb > img.poster { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.player .frame { overflow: hidden; }
.player .frame > img.poster { width: 100%; height: 100%; object-fit: cover; display: block; }
.player .backdrop-art > img.poster { width: 100%; height: 100%; object-fit: cover; opacity: .9; }
.player.playing { cursor: default; }
.player.playing .frame { z-index: 1; background: #000; }
.player.playing .frame video { width: 100%; height: 100%; object-fit: contain; display: block; background: #000; }
.player .ph { z-index: 2; }
.add-url {
  display: flex; align-items: center; gap: 10px; margin: 12px 16px 0; padding: 6px 6px 6px 16px; min-height: 52px;
  border-radius: 26px; background: var(--surface); box-shadow: inset 0 0 0 0.5px var(--card-rim), var(--card-shadow); color: var(--text-3);
}
.add-url input { flex: 1; min-width: 0; border: 0; background: none; outline: none; color: var(--text); font-size: 17px; height: 40px; }
.add-url input::placeholder { color: var(--text-3); }
.add-url .btn-sm { flex: none; }
.analysis-failed { margin: 14px 16px 0; padding: 16px 18px; border-radius: 22px; background: var(--danger-tint); color: var(--danger); font-size: 15px; font-weight: 500; display: flex; gap: 10px; align-items: flex-start; }
.analysis-failed .grow { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.analysis-failed .btn { flex: none; }
.tab .fail-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--danger); margin-right: 8px; flex: none; }
.empty-line.err { color: var(--danger); }
.code.secret { filter: none; }
.code .muted { color: var(--text-3); }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .view.anim-forward, .view.anim-back, .view.anim-tab, .progress i, .progress.live i::after,
  .tabbar button.active .tab-ico, .busy-box .skel { animation: none !important; }
  .sheet, .toast, .backdrop, .switch::after, .card, .topic-tile, .btn, .chip, .tab, .seg button, .tabbar button,
  .nav-title, .navbar, .back, .back-l, .large-title, .player .play { transition: none !important; }
}

/* ---------- Sign-in (single password, glass card in the mockup's style) ---------- */
.device.signed-out .tabbar { display: none; }
.login { min-height: 100%; display: flex; flex-direction: column; justify-content: center; padding: 40px 0 60px; }
.login .large-title { text-align: center; margin-top: 10px; }
.login-mark { width: 72px; height: 72px; margin: 0 auto; border-radius: 22px; display: grid; place-items: center; color: #fff;
  background: linear-gradient(160deg, var(--accent-hi), var(--accent)); box-shadow: 0 10px 28px rgba(91, 75, 240, 0.35); }
.login-card { margin: 8px 16px 14px; padding: 18px; border-radius: 26px; display: flex; flex-direction: column; gap: 10px; background: var(--glass);
  border: 0.5px solid var(--glass-rim); box-shadow: inset 0 1px 0 var(--glass-hi), inset 0 0 0 0.5px var(--glass-edge), var(--glass-shadow); }
.login-card .lbl { font-size: 14px; font-weight: 600; color: var(--text-2); }
.login-card input { height: 50px; border-radius: 16px; border: 0; padding: 0 16px; font-size: 17px; color: var(--text); background: var(--fill, rgba(120, 120, 128, 0.12)); outline: none; min-width: 0; }
.login-card input:focus { box-shadow: 0 0 0 3px var(--accent-tint, rgba(91, 75, 240, 0.2)); }
.login-err { min-height: 20px; color: var(--danger); font-size: 15px; }
.login-card .btn { width: 100%; }
.player.yt .yt-open { position: absolute; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 2; }
.player.yt .yt-open:active { transform: translateX(-50%) scale(.96); }

/* ---------- Language (Settings) + longer Ukrainian labels ---------- */
.lang-row { padding-top: 10px; padding-bottom: 10px; }
.lang-row .seg { margin: 0; flex: 1; min-width: 0; }
/* "Текстовий розбір" / "Глибокий розбір" do not fit next to the run button on a phone: the button goes below. */
.lens-row .ctl { flex-wrap: wrap; }
.lens-row .ctl .seg { flex: 1 1 100%; }
.lens-row .ctl .btn-sm { flex: 1 1 100%; }
.seg button { padding: 0 8px; }
.section-h h2 { flex: none; }
.lens-row .seg button { font-size: 14px; white-space: nowrap; }
/* The topic path chip on a note may be long in Ukrainian: it wraps instead of being cut. */
.note-links .chip[data-action="move"] { min-height: 40px; padding-top: 8px; padding-bottom: 8px; }
.note-links .chip[data-action="move"] span { white-space: normal; overflow-wrap: anywhere; }
/* Ukrainian labels are longer: tab bar labels a little smaller; analysis tabs put the depth under the lens and wrap
   onto a second line instead of hiding tabs behind a horizontal scroll. */
html[lang="uk"] .tabbar button { font-size: 10px; letter-spacing: 0; }
html[lang="uk"] .tabs { flex-wrap: wrap; overflow-x: visible; }
html[lang="uk"] .tab { min-height: 54px; padding: 6px 14px; }
html[lang="uk"] .tab .tl { display: inline-flex; flex-direction: column; align-items: center; gap: 3px; line-height: 1.1; }
html[lang="uk"] .tab .tl .dot { display: none; }
