/* Standalyzer — dark stage, one brand-yellow accent (silnereci.sk palette), traffic-light
   verdict colours for bits. Mobile-first; desktop gets a top nav and two columns. */
@font-face { font-family: "Nunito"; src: url("/static/fonts/Nunito.ttf") format("truetype"); font-weight: 200 1000; font-display: swap; }

:root {
  color-scheme: dark light;
  --bg: #131313; --bg-2: #1e1e1d; --bg-3: #2a2a29; --line: #353533; --line-strong: #4a4a47;
  --text: #f4f3f1; --muted: #a8a6a0; --faint: #7a7873;
  --accent: #ffc700; --accent-ink: #1e1e1d; --accent-text: #ffc700;
  --highlight: #e6ff4b;
  --ok: #5fd3a0; --warn: #ffb547; --err: #ff6b6b; --info: #6fb6ff;
  --killer: #19c37d; --works: #a5d95c; --weak: #ffb547; --silent: #ff6b6b;
  --laugh: #ffc700; --applause: #6fb6ff;
  --radius: 16px; --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(0,0,0,.35), 0 8px 24px -10px rgba(0,0,0,.6);
  --font: "Nunito", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --tab-h: 62px; --top-h: 56px;
}
@media (prefers-color-scheme: light) {
  :root {
    --bg: #f4f3f1; --bg-2: #ffffff; --bg-3: #ebe9e5; --line: #dcd9d2; --line-strong: #c9c5bc;
    --text: #1e1e1d; --muted: #6b6963; --faint: #9a978f; --accent-text: #8a6a00;
    --ok: #1f8f5f; --warn: #b8620a; --err: #c53030; --info: #2c6fd6;
    --killer: #1f9d5f; --works: #5a9d1f; --weak: #c47a0a; --silent: #c53030;
    --shadow: 0 1px 2px rgba(31,36,48,.06), 0 6px 20px -8px rgba(31,36,48,.14);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scrollbar-gutter: stable; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.5 var(--font); min-height: 100dvh; overflow-x: hidden; -webkit-font-smoothing: antialiased; }
[hidden] { display: none !important; }
a { color: var(--accent-text); text-decoration: none; }
button { font: inherit; color: inherit; }
h1 { font-size: 1.35rem; margin: 0; font-weight: 900; letter-spacing: -.01em; text-transform: uppercase; }
h2 { font-size: 1.05rem; margin: 0 0 .5rem; font-weight: 800; }
h3 { font-size: .95rem; margin: .8rem 0 .3rem; font-weight: 800; }
.h-small { font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 0 0 .6rem; font-weight: 800; }
.ico { display: inline-flex; width: 18px; height: 18px; flex: none; vertical-align: -3px; }
.ico svg { width: 100%; height: 100%; }
.muted { color: var(--muted); } .faint { color: var(--faint); } .small { font-size: .85rem; } .center { text-align: center; }
.row { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.row--between { justify-content: space-between; }
.grow { flex: 1; }
.mt { margin-top: 12px; }
p { margin: 0 0 .7rem; }
p:last-child { margin-bottom: 0; }

/* layout */
.app { min-height: 100dvh; display: flex; flex-direction: column; }
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 1rem; height: calc(var(--top-h) + env(safe-area-inset-top)); padding: env(safe-area-inset-top) 16px 0; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(12px) saturate(140%); border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; align-items: center; gap: .5rem; color: var(--text); font-weight: 900; font-size: 1.1rem; text-transform: uppercase; }
.brand__mark { height: 30px; width: auto; display: block; }
.login__mark { width: min(320px, 80vw); height: auto; margin-bottom: 8px; }
.nav--top { display: none; gap: .25rem; }
.nav--top a { padding: .45rem .9rem; border-radius: 999px; color: var(--muted); font-weight: 700; }
.nav--top a.is-active { color: var(--text); background: var(--bg-3); }
.top__right { margin-left: auto; display: flex; gap: .5rem; align-items: center; }
.main { flex: 1; width: 100%; max-width: 1100px; margin: 0 auto; padding: 14px 16px calc(var(--tab-h) + 24px + env(safe-area-inset-bottom)); }
.main--fab { padding-bottom: calc(var(--tab-h) + 54px + 28px + env(safe-area-inset-bottom)); }
.main:focus { outline: none; }
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: grid; grid-template-columns: repeat(3, 1fr); height: calc(var(--tab-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); background: color-mix(in srgb, var(--bg-2) 92%, transparent); backdrop-filter: blur(12px) saturate(140%); border-top: 1px solid var(--line); }
.tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: var(--muted); font-size: .7rem; font-weight: 800; }
.tabbar a svg { width: 24px; height: 24px; }
.tabbar a.is-active { color: var(--accent-text); }
.tabbar--4 { grid-template-columns: repeat(4, 1fr); }
@media (min-width: 860px) {
  .nav--top { display: flex; }
  .tabbar { display: none; }
  .main { padding-bottom: 40px; padding-top: 22px; }
}

/* cards & controls */
.card { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); margin-bottom: 14px; }
.card--link { display: flex; align-items: center; gap: .75rem; color: var(--text); }
.card--link:active { background: var(--bg-3); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; min-height: 44px; padding: 0 18px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--bg-2); color: var(--text); font-weight: 800; cursor: pointer; text-decoration: none; transition: transform .08s ease, background .12s ease; user-select: none; -webkit-tap-highlight-color: transparent; }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .5; cursor: default; }
.btn--primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn--danger { background: var(--err); border-color: var(--err); color: #fff; }
.btn--ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn--ghost:hover { background: var(--bg-3); color: var(--text); }
.btn--small { min-height: 34px; padding: 0 12px; font-size: .88rem; }
.btn--block { width: 100%; }
.btn--big { min-height: 56px; font-size: 1.05rem; }
.iconbtn { width: 40px; height: 40px; border-radius: 50%; border: 0; background: transparent; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; color: var(--muted); }
.iconbtn:hover { background: var(--bg-3); color: var(--text); }
.iconbtn--accent { background: var(--accent); color: var(--accent-ink); }
.iconbtn svg { width: 22px; height: 22px; }
.field { display: flex; flex-direction: column; gap: .3rem; margin-bottom: .9rem; }
.field > span { font-size: .85rem; font-weight: 800; color: var(--muted); }
.field .hint { font-size: .8rem; color: var(--faint); font-weight: 400; }
input:not([type=checkbox]):not([type=radio]):not([type=range]), select, textarea { width: 100%; font: inherit; color: var(--text); background: var(--bg-2); border: 1px solid var(--line-strong); border-radius: var(--radius-sm); padding: 10px 12px; min-height: 44px; font-size: 16px; }
input:focus, select:focus, textarea:focus, .btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
input[type=checkbox] { width: 20px; height: 20px; accent-color: var(--accent); }
select { appearance: auto; }
textarea { min-height: 80px; resize: vertical; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
@media (max-width: 480px) { .grid-2 { grid-template-columns: 1fr; } }
.alert { padding: 10px 14px; border-radius: var(--radius-sm); background: var(--bg-3); margin-bottom: .9rem; font-weight: 600; }
.alert--err { background: color-mix(in srgb, var(--err) 14%, var(--bg-2)); color: var(--err); }
.alert--ok { background: color-mix(in srgb, var(--ok) 14%, var(--bg-2)); color: var(--ok); }
.alert--warn { background: color-mix(in srgb, var(--warn) 18%, var(--bg-2)); color: var(--warn); }
.switch { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 12px 0; border-top: 1px solid var(--line); }
.switch:first-of-type { border-top: 0; }
.switch__text b { display: block; }
.switch__text span { font-size: .85rem; color: var(--muted); }
.toggle { position: relative; width: 50px; height: 30px; flex: none; }
.toggle input { position: absolute; inset: 0; opacity: 0; margin: 0; width: 100%; height: 100%; cursor: pointer; }
.toggle i { position: absolute; inset: 0; border-radius: 999px; background: var(--line-strong); transition: background .15s; }
.toggle i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3); transition: transform .15s; }
.toggle input:checked + i { background: var(--accent); }
.toggle input:checked + i::after { transform: translateX(20px); }
.chips { display: flex; gap: .4rem; flex-wrap: wrap; }
.chip { min-height: 36px; padding: 0 12px; border-radius: 999px; border: 1.5px solid var(--line-strong); background: var(--bg-2); font-weight: 800; font-size: .85rem; cursor: pointer; display: inline-flex; align-items: center; gap: .4rem; }
.chip.is-active { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 16%, var(--bg-2)); }
.chip--static { cursor: default; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-block; line-height: 28px; min-height: 28px; padding: 0 10px; font-size: .78rem; border-color: var(--line); color: var(--muted); }
.seg-ctl { display: inline-flex; background: var(--bg-3); border-radius: 999px; padding: 3px; }
.seg-ctl button { border: 0; background: transparent; border-radius: 999px; padding: 6px 16px; font-weight: 800; color: var(--muted); cursor: pointer; min-height: 36px; }
.seg-ctl button.is-active { background: var(--bg-2); color: var(--text); box-shadow: var(--shadow); }
.pill { display: inline-flex; align-items: center; gap: .3rem; padding: 2px 10px; border-radius: 999px; font-size: .78rem; font-weight: 800; background: var(--bg-3); color: var(--muted); white-space: nowrap; }
.pill--btn { border: 0; font: inherit; cursor: pointer; min-height: 30px; }
.pill--ok { background: color-mix(in srgb, var(--ok) 16%, var(--bg-2)); color: var(--ok); }
.pill--err { background: color-mix(in srgb, var(--err) 14%, var(--bg-2)); color: var(--err); }
.pill--warn { background: color-mix(in srgb, var(--warn) 18%, var(--bg-2)); color: var(--warn); }
.pill--accent { background: color-mix(in srgb, var(--accent) 18%, var(--bg-2)); color: var(--accent-text); }
.pill--live { background: color-mix(in srgb, var(--err) 18%, var(--bg-2)); color: var(--err); }
.pill--live::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--err); animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: .2; } }
.empty { text-align: center; padding: 2rem 1rem; color: var(--muted); }
.empty svg { width: 48px; height: 48px; color: var(--faint); margin-bottom: .5rem; }
.lines { padding-left: 1.2rem; margin: .4rem 0 .8rem; line-height: 1.55; }
.lines li { margin-bottom: .35rem; }
.list { list-style: none; padding: 0; margin: 0; }
.list li { display: flex; gap: .6rem; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); font-size: .92rem; flex-wrap: wrap; }
.list li:first-child { border-top: 0; }
@media (max-width: 600px) { .list li > .grow { flex: 1 1 100%; } }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .85em; }
input.mono { font-size: 16px; }
pre.code { margin: 8px 0; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--bg-3); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .78rem; line-height: 1.5; white-space: pre-wrap; word-break: break-all; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; font-size: .9rem; }
.kv dt { color: var(--muted); font-weight: 700; } .kv dd { margin: 0; }
.fab { position: fixed; right: 16px; bottom: calc(var(--tab-h) + 16px + env(safe-area-inset-bottom)); z-index: 15; height: 54px; padding: 0 20px 0 16px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); border: 0; font-weight: 900; box-shadow: 0 8px 24px -6px color-mix(in srgb, var(--accent) 60%, transparent); display: inline-flex; align-items: center; gap: .5rem; cursor: pointer; }
.fab svg { width: 22px; height: 22px; }
@media (min-width: 860px) { .fab { bottom: 28px; right: max(16px, calc((100vw - 1100px) / 2 + 16px)); } .main--fab { padding-bottom: 96px; } }
.skeleton { height: 60px; border-radius: var(--radius); background: linear-gradient(90deg, var(--bg-3), var(--bg-2), var(--bg-3)); background-size: 200% 100%; animation: sk 1.2s infinite; margin-bottom: 8px; }
@keyframes sk { to { background-position: -200% 0; } }

/* page head */
.pagehead { display: flex; align-items: center; gap: .5rem; margin-bottom: 12px; flex-wrap: wrap; }
.pagehead h1 { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.pagehead .sub { width: 100%; color: var(--muted); font-size: .9rem; }

/* set list */
.setcard { display: grid; grid-template-columns: 52px 1fr auto; gap: 12px; align-items: center; color: var(--text); }
.setcard__score { width: 52px; height: 52px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 900; font-size: 1.15rem; background: var(--bg-3); color: var(--muted); border: 3px solid var(--c, var(--line-strong)); flex: none; }
.setcard__score.is-scored { color: var(--text); }
.setcard__body { min-width: 0; }
.setcard__title { font-weight: 800; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.setcard__meta { font-size: .82rem; color: var(--muted); display: flex; gap: .5rem; flex-wrap: wrap; }
.setcard__stats { display: flex; gap: .4rem; flex-wrap: wrap; margin-top: 4px; }
.setcard .ico { color: var(--faint); }

/* stat tiles */
.tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-bottom: 14px; }
@media (min-width: 620px) { .tiles { grid-template-columns: repeat(4, 1fr); } }
.tile { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px; border-left: 4px solid var(--c, var(--line-strong)); }
.tile b { display: block; font-size: 1.35rem; font-weight: 900; line-height: 1.15; }
.tile span { font-size: .75rem; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.tile small { display: block; font-size: .75rem; color: var(--faint); }
.lvl-green { --c: var(--killer); } .lvl-yellow { --c: var(--weak); } .lvl-red { --c: var(--silent); } .lvl-none { --c: var(--line-strong); }

/* player + laugh map */
.player__legend { margin: -6px 0 12px; }
.player.is-playing .player__hint { display: none; }
.player { position: sticky; top: calc(var(--top-h) + env(safe-area-inset-top)); z-index: 10; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px 8px; margin-bottom: 12px; box-shadow: var(--shadow); }
.player audio { display: none; }
.player__row { display: flex; align-items: center; gap: .6rem; }
.player__time { font-variant-numeric: tabular-nums; font-weight: 800; font-size: .85rem; color: var(--muted); min-width: 92px; text-align: right; }
.laughmap { position: relative; height: 56px; }
@media (max-width: 620px) { .laughmap { height: 40px; } }
.laughmap { position: relative; margin-top: 6px; border-radius: 8px; background: var(--bg-3); overflow: hidden; cursor: pointer; touch-action: pan-y; }
.laughmap__bit { position: absolute; top: 0; bottom: 0; left: var(--l); width: var(--w); background: color-mix(in srgb, var(--c) 18%, transparent); border-right: 1px solid color-mix(in srgb, var(--bg) 60%, transparent); }
.laughmap__laugh { position: absolute; bottom: 0; left: var(--l); width: max(2px, var(--w)); height: var(--h); background: var(--laugh); border-radius: 2px 2px 0 0; opacity: .9; }
.laughmap__laugh.is-applause { background: var(--applause); }
.laughmap__laugh.is-chuckle { opacity: .5; }
.laughmap__laugh.is-tag { opacity: .45; background: var(--muted); }
.laughmap__cursor { position: absolute; top: 0; bottom: 0; left: var(--l); width: 2px; background: var(--text); pointer-events: none; }
.laughmap__gap { position: absolute; top: 0; height: 4px; left: var(--l); width: var(--w); background: var(--silent); opacity: .8; }
.legend { display: flex; gap: .8rem; flex-wrap: wrap; font-size: .75rem; color: var(--muted); font-weight: 700; margin-top: 6px; }
.legend span { display: inline-flex; align-items: center; gap: .3rem; }
.legend i { width: 14px; height: 10px; border-radius: 3px; background: var(--c); display: inline-block; }

/* transcript with bits */
.bit { border-left: 5px solid var(--c, var(--line-strong)); }
.bit--killer { --c: var(--killer); } .bit--works { --c: var(--works); } .bit--weak { --c: var(--weak); } .bit--silent { --c: var(--silent); }
.bit__head { display: grid; grid-template-columns: 26px 1fr auto; gap: .35rem .5rem; align-items: center; cursor: pointer; }
.bit__head h3 { margin: 0; min-width: 0; line-height: 1.3; }
.bit__head .bit__pills { grid-column: 2 / -1; display: flex; gap: .35rem; flex-wrap: wrap; }
.bit__chev { color: var(--faint); transition: transform .15s; }
.bit.is-open .bit__chev { transform: rotate(90deg); }
.bit__num { width: 26px; height: 26px; border-radius: 50%; background: var(--c); color: #111; display: inline-flex; align-items: center; justify-content: center; font-weight: 900; font-size: .8rem; flex: none; }
.bit--killer .bit__num { box-shadow: 0 0 0 2px var(--bg-2), 0 0 0 4px var(--killer); }
.bit__stats { display: flex; gap: .35rem; flex-wrap: wrap; margin: 6px 0 4px; }
.bit__premise { color: var(--muted); font-size: .9rem; margin: 4px 0 8px; }
.tx { margin: 6px 0 0; display: flex; flex-direction: column; gap: 2px; }
.tx__line { display: grid; grid-template-columns: 44px 1fr; gap: 8px; align-items: baseline; padding: 4px 6px; border-radius: 8px; cursor: pointer; line-height: 1.45; position: relative; }
.tx__line:hover, .tx__line.is-playing { background: var(--bg-3); }
.tx__line.is-playing { outline: 2px solid var(--accent); outline-offset: -2px; }
.tx__t { font-size: .72rem; color: var(--faint); font-weight: 800; font-variant-numeric: tabular-nums; padding-top: 3px; }
.tx__text { min-width: 0; }
.tx__text mark { background: none; color: inherit; border-radius: 4px; padding: 0 3px; }
.tx__line.l-big .tx__text mark { background: color-mix(in srgb, var(--killer) 38%, transparent); }
.tx__line.l-laugh .tx__text mark { background: color-mix(in srgb, var(--works) 30%, transparent); }
.tx__line.l-chuckle .tx__text mark { background: color-mix(in srgb, var(--weak) 22%, transparent); }
.tx__line.l-applause .tx__text mark { background: color-mix(in srgb, var(--applause) 38%, transparent); }
.tx__badges { display: inline-flex; gap: 4px; flex-wrap: wrap; margin-left: 6px; vertical-align: middle; }
.tag { display: inline-flex; align-items: center; gap: 2px; padding: 0 7px; border-radius: 999px; font-size: .7rem; font-weight: 800; background: var(--bg-3); color: var(--muted); border: 1px solid var(--line); white-space: nowrap; }
.tag--laugh { background: color-mix(in srgb, var(--laugh) 22%, var(--bg-2)); color: var(--accent-text); border-color: transparent; }
.tag--applause { background: color-mix(in srgb, var(--applause) 24%, var(--bg-2)); color: var(--info); border-color: transparent; }
.tag--flag { background: color-mix(in srgb, var(--err) 14%, var(--bg-2)); color: var(--err); border-color: transparent; }
.tag--warn { background: color-mix(in srgb, var(--warn) 18%, var(--bg-2)); color: var(--warn); border-color: transparent; }
.gapline { grid-column: 1 / -1; font-size: .75rem; color: var(--silent); font-weight: 800; padding: 2px 6px; border-top: 1px dashed color-mix(in srgb, var(--silent) 50%, transparent); }
.advice { margin-top: 8px; border-top: 1px solid var(--line); padding-top: 8px; font-size: .93rem; }
.advice h4 { margin: 8px 0 3px; font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.advice .rewrite { background: color-mix(in srgb, var(--accent) 10%, var(--bg-2)); border-left: 3px solid var(--accent); padding: 8px 10px; border-radius: 6px; white-space: pre-wrap; }
.advice .worked { color: var(--ok); }

/* mentor page */
.score-ring { width: 84px; height: 84px; border-radius: 50%; display: flex; flex-direction: column; align-items: center; justify-content: center; background: conic-gradient(var(--c) calc(var(--p) * 1%), var(--bg-3) 0); flex: none; }
.score-ring b { width: 68px; height: 68px; border-radius: 50%; background: var(--bg-2); display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 1.5rem; font-weight: 900; line-height: 1; }
.score-ring b small { font-size: .65rem; color: var(--muted); font-weight: 800; }
.ratings { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px 14px; margin-top: 10px; }
.rating { font-size: .85rem; }
.rating__bar { height: 8px; border-radius: 4px; background: var(--bg-3); overflow: hidden; margin-top: 3px; }
.rating__bar i { display: block; height: 100%; width: var(--p); background: var(--c, var(--accent)); border-radius: 4px; }
.setlist { list-style: none; padding: 0; margin: 0; counter-reset: sl; }
.setlist li { display: flex; gap: .6rem; align-items: flex-start; padding: 8px 0; border-top: 1px solid var(--line); counter-increment: sl; }
.setlist li:first-child { border-top: 0; }
.setlist li::before { content: counter(sl); width: 26px; height: 26px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font-weight: 900; font-size: .8rem; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.setlist .why { display: block; color: var(--muted); font-size: .85rem; }
.summary { font-size: 1.02rem; line-height: 1.6; }
.actions li { font-weight: 700; }

/* chat */
.chat { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.msg { max-width: 92%; padding: 10px 14px; border-radius: 16px; white-space: pre-wrap; word-break: break-word; font-size: .95rem; line-height: 1.5; }
.msg--user { align-self: flex-end; background: var(--accent); color: var(--accent-ink); border-bottom-right-radius: 4px; }
.msg--bot { align-self: flex-start; background: var(--bg-3); border-bottom-left-radius: 4px; }
.chat__form { display: flex; gap: .5rem; align-items: flex-end; }
.chat__form textarea { min-height: 44px; }

/* recorder */
.rec { text-align: center; padding: 20px 14px; }
.rec__time { font-size: 3rem; font-weight: 900; font-variant-numeric: tabular-nums; letter-spacing: .02em; line-height: 1; margin: 6px 0; }
.rec__state { color: var(--muted); font-weight: 700; min-height: 1.5em; }
.rec__meter { height: 8px; border-radius: 4px; background: var(--bg-3); margin: 14px auto; max-width: 320px; overflow: hidden; }
.rec__meter i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .08s; }
.rec__btns { display: flex; gap: .6rem; justify-content: center; flex-wrap: wrap; margin-top: 8px; }
.rec__btn-rec { width: 84px; height: 84px; border-radius: 50%; background: var(--err); border: 0; color: #fff; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; box-shadow: 0 8px 26px -6px color-mix(in srgb, var(--err) 70%, transparent); }
.rec__btn-rec svg { width: 34px; height: 34px; }
.rec__btn-rec:disabled { opacity: .4; }
.rec__counts { font-size: .8rem; color: var(--faint); margin-top: 10px; }
.dropzone { display: block; cursor: pointer; border: 2px dashed var(--line-strong); border-radius: var(--radius); padding: 18px; text-align: center; color: var(--muted); }
.dropzone input { display: none; }
.progress { height: 10px; border-radius: 5px; background: var(--bg-3); overflow: hidden; margin-top: 10px; }
.progress i { display: block; height: 100%; width: var(--p, 0%); background: var(--accent); transition: width .2s; }
.pipeline { list-style: none; padding: 0; margin: 10px 0 0; display: flex; flex-direction: column; gap: 6px; }
.pipeline li { display: flex; align-items: center; gap: .6rem; color: var(--faint); font-weight: 700; }
.pipeline li::before { content: ""; width: 12px; height: 12px; border-radius: 50%; background: var(--line-strong); flex: none; }
.pipeline li.is-done { color: var(--muted); } .pipeline li.is-done::before { background: var(--ok); }
.pipeline li.is-now { color: var(--text); } .pipeline li.is-now::before { background: var(--accent); animation: blink 1s infinite; }

/* bits across sets */
.trend { display: flex; gap: 6px; align-items: flex-end; height: 44px; }
.trend i { flex: 1; min-width: 10px; max-width: 28px; background: var(--c); border-radius: 3px 3px 0 0; height: var(--h); }

/* sheets (bottom on mobile, dialog on desktop) */
.sheet-backdrop { position: fixed; inset: 0; z-index: 40; background: rgba(0,0,0,.55); display: flex; align-items: flex-end; justify-content: center; animation: fade .15s ease; }
.sheet { width: 100%; max-height: 92dvh; overflow: auto; background: var(--bg-2); border-radius: 22px 22px 0 0; padding: 8px 16px calc(20px + env(safe-area-inset-bottom)); animation: up .2s ease; box-shadow: 0 -10px 40px rgba(0,0,0,.35); }
.sheet__grip { width: 44px; height: 5px; border-radius: 3px; background: var(--line-strong); margin: 4px auto 12px; }
.sheet__head { display: flex; align-items: center; gap: .5rem; margin-bottom: .8rem; }
.sheet__head h2 { flex: 1; margin: 0; font-size: 1.15rem; }
@media (min-width: 720px) {
  .sheet-backdrop { align-items: center; }
  .sheet { max-width: 560px; border-radius: 22px; padding-bottom: 20px; animation: fade .15s ease; }
  .sheet__grip { display: none; }
}
@keyframes up { from { transform: translateY(40px); opacity: .6; } to { transform: none; opacity: 1; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* toast */
.toast { position: fixed; left: 50%; bottom: calc(var(--tab-h) + 20px + env(safe-area-inset-bottom)); transform: translateX(-50%) translateY(20px); background: var(--text); color: var(--bg); padding: 10px 18px; border-radius: 999px; font-weight: 800; opacity: 0; pointer-events: none; transition: all .2s; z-index: 60; max-width: 92vw; text-align: center; }
.toast.is-on { opacity: 1; transform: translateX(-50%); }
.toast.is-err { background: var(--err); color: #fff; }
.toast.is-top { bottom: auto; top: calc(16px + env(safe-area-inset-top)); z-index: 70; }
@media (min-width: 860px) { .toast { bottom: 28px; } }

/* login */
.login-body { display: flex; align-items: center; justify-content: center; min-height: 100dvh; padding: 24px 16px; }
.login { width: 100%; max-width: 400px; }
.login__brand { text-align: center; margin-bottom: 18px; }
.login__brand img { border-radius: 18px; margin-bottom: 6px; }
.login__brand h1 { font-size: 1.7rem; }
.login__form { padding: 22px; }

/* two-column detail on desktop */
@media (min-width: 960px) {
  .detail { display: grid; grid-template-columns: 1fr 380px; gap: 16px; align-items: start; }
  .detail__main { grid-column: 1; grid-row: 1; }
  .detail__side { grid-column: 2; grid-row: 1; position: sticky; top: calc(var(--top-h) + 16px); }
  .only-mobile { display: none !important; }
}
@media (max-width: 959px) { .only-desktop { display: none !important; } }
@media (pointer: coarse) {
  .btn--small { min-height: 44px; padding: 0 14px; }
  .chip { min-height: 44px; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* markdown (the mentor's manual) */
.md h2 { font-size: 1.1rem; margin: 1.4rem 0 .5rem; padding-top: .6rem; border-top: 1px solid var(--line); }
.md h2:first-child { border-top: 0; margin-top: 0; padding-top: 0; }
.md h3 { font-size: .98rem; margin: 1rem 0 .3rem; }
.md h4 { font-size: .9rem; margin: .8rem 0 .3rem; color: var(--muted); }
.md p, .md li { font-size: .93rem; line-height: 1.55; }
.md hr { border: 0; border-top: 1px solid var(--line); margin: 1rem 0; }
.md code { background: var(--bg-3); padding: 0 4px; border-radius: 4px; }
.md__tablewrap { overflow-x: auto; margin: .6rem -4px; -webkit-overflow-scrolling: touch; }
.md__table { border-collapse: collapse; font-size: .82rem; min-width: 100%; }
.md__table th, .md__table td { border: 1px solid var(--line); padding: 6px 8px; vertical-align: top; text-align: left; min-width: 120px; }
.md__table th { background: var(--bg-3); font-weight: 800; }

/* sticky save row (settings) */
.savebar { position: sticky; bottom: calc(var(--tab-h) + 8px + env(safe-area-inset-bottom)); z-index: 5; display: flex; gap: .5rem; padding: 10px 0; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(8px); }
@media (min-width: 860px) { .savebar { bottom: 8px; } }
/* install tip */
.install { display: flex; gap: .7rem; align-items: center; }
.install img { width: 44px; height: 44px; border-radius: 10px; flex: none; }
/* technique note */
.tech { font-size: .8rem; color: var(--muted); margin-bottom: 6px; }
@media (max-width: 859px) { .pagehead .only-desktop { display: none; } }
