/* Base styles shared by the home page and every tool page. Dark, calm, one accent. */
:root {
  --cream: #f7f6ee; --ink: #151711; --olive: #2e3525; --night: #141612; --lemon: #dcff3a; --lemon-pale: #f4ffc4; --sage: #c9d0bd;
  --bg: var(--cream); --bg2: #ffffff; --card: #ffffff; --card2: #efeee3; --line: #dcdbcf;
  --text: var(--ink); --muted: #5d6053; --accent: var(--ink); --accent2: #3f5d00; --pink: #c2410c;
  --ok: #3f7d00; --warn: #a15c00; --err: #c0262d;
  --radius: 14px; --text-font: 'Inter Tight', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; --font: var(--text-font);
  --display: 'Archivo', 'Arial Narrow', system-ui, sans-serif; --serif: 'Instrument Serif', Georgia, serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.6 var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--ink); text-decoration: underline; text-decoration-color: #b9c27a; text-underline-offset: 3px; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { font-family: var(--text-font); line-height: 1.15; margin: 0 0 .5em; }
h1, h2 { font-family: var(--display); font-weight: 800; font-stretch: 80%; text-transform: uppercase; letter-spacing: -.01em; line-height: .92; }
img, canvas, video { max-width: 100%; }
.container { width: min(1100px, 92vw); margin: 0 auto; }
.muted { color: var(--muted); } .small { font-size: .875rem; }
[hidden] { display: none !important; }

/* top bar */
.topbar { position: sticky; top: 0; z-index: 20; display: flex; justify-content: space-between; align-items: center; padding: 12px max(2.4vw, 16px); background: rgba(247,246,238,.88); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.logo { display: flex; flex-direction: column; line-height: .86; color: var(--ink); text-decoration: none; }
.logo b { font: 800 22px/1 var(--display); font-stretch: 78%; text-transform: uppercase; }
.logo em { font: 400 17px/1 var(--serif); font-style: normal; text-transform: uppercase; }
.logo:hover { text-decoration: none; }
.logo-orb { display: none; }
.back { display: inline-flex; align-items: center; height: 38px; padding: 0 14px; border-radius: 10px; background: var(--lemon); color: var(--ink); font: 600 14px var(--text-font); text-decoration: none; }
.back:hover { text-decoration: none; transform: translateY(-1px); }
.foot { padding: 40px 0; color: var(--muted); font-size: .9rem; border-top: 1px solid var(--line); margin-top: 60px; }
body.tool-page { background: var(--cream); }
body.tool-page .foot { border: 0; border-top: 12px solid var(--lemon); margin-top: 80px; padding: 28px max(2.4vw,16px); width: auto; background: var(--olive); color: #c9ceb8; }
body.tool-page .foot a { color: var(--lemon); }

/* tool page */
.crumbs { margin: 24px 0 8px; color: var(--muted); font-size: .9rem; }
.tool-head h1 { font-size: clamp(44px, 7vw, 96px); margin-top: 8px; }
.lead { font: 400 clamp(20px, 2vw, 26px)/1.25 var(--serif); color: #3d4034; margin: 0 0 12px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.chip { padding: 4px 12px; border-radius: 8px; background: var(--card2); border: 1px solid var(--line); font-size: .85rem; }
.load-light { color: var(--ok); } .load-medium { color: var(--warn); } .load-heavy { color: var(--pink); }
.soon-chip { color: var(--warn); }
.tool-root { margin: 28px 0; display: flex; flex-direction: column; gap: 16px; }
.about { margin: 24px 0; padding: 14px 18px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.about summary { cursor: pointer; font-weight: 600; }
.warn-text { color: var(--warn); }
.related { margin-top: 40px; }

/* controls */
.btn { appearance: none; border: 1.5px solid var(--ink); background: transparent; color: var(--ink); padding: 10px 18px; border-radius: 12px; font: 600 .95rem var(--font); cursor: pointer; transition: transform .15s, background .15s, box-shadow .15s; }
.btn:hover { transform: translateY(-2px); box-shadow: 0 6px 0 -2px var(--ink); }
.btn:disabled { opacity: .5; cursor: wait; transform: none; }
.btn.primary { background: var(--lemon); border-color: var(--lemon); color: var(--ink); }
.btn.ghost { background: transparent; border-color: #c9c8bb; }
.btn.small { padding: 6px 12px; font-size: .85rem; }
.btn.rec { background: var(--err); border-color: var(--err); animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { opacity: .7; } }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.row.grow > input { flex: 1; min-width: 200px; }
.form { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.field { display: flex; flex-direction: column; gap: 6px; font-size: .9rem; color: var(--muted); }
.field-textarea { grid-column: 1 / -1; }
.field-checkbox { flex-direction: row-reverse; justify-content: flex-end; align-items: center; }
input[type=text], input[type=number], input[type=url], input:not([type]), textarea, select {
  width: 100%; background: var(--bg2); color: var(--text); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; font: inherit; }
textarea { resize: vertical; min-height: 120px; }
input:focus, textarea:focus, select:focus { outline: 3px solid var(--lemon); outline-offset: 0; border-color: var(--ink); }
input[type=range] { accent-color: var(--accent); }

/* drop zone */
.drop { border: 2px dashed var(--line); border-radius: var(--radius); padding: 40px 20px; text-align: center; cursor: pointer; background: #fff; transition: border-color .2s, transform .2s; }
.drop { border-color: #b9b8aa; }
.drop:hover, .drop.over { border-color: var(--ink); background: var(--lemon-pale); }
.drop-icon { font-size: 2rem; } .drop-label { font-weight: 600; margin-top: 6px; } .drop-hint { color: var(--muted); font-size: .85rem; }

/* status + progress */
.status { padding: 10px 14px; border-radius: 12px; background: var(--card2); border: 1px solid var(--line); font-size: .92rem; }
.status.ok { border-color: rgba(52,211,153,.4); } .status.warn { border-color: rgba(251,191,36,.5); } .status.error { border-color: rgba(248,113,113,.6); color: var(--err); }
.progress-box { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 50; width: min(520px, 92vw); padding: 14px 16px; background: var(--ink); color: var(--cream); border: 0; border-radius: 14px; box-shadow: 0 20px 60px -20px rgba(0,0,0,.5); }
.progress-text { font-size: .9rem; margin-bottom: 8px; }
.bar { height: 6px; border-radius: 9px; background: rgba(128,128,110,.35); overflow: hidden; }
.bar-fill { height: 100%; background: var(--lemon); transition: width .2s; }
.bar-fill.indeterminate { width: 40% !important; animation: indet 1.2s infinite ease-in-out; }
@keyframes indet { 0% { transform: translateX(-100%); } 100% { transform: translateX(250%); } }

/* output */
.output { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; position: relative; }
.output-tools { display: flex; gap: 8px; justify-content: flex-end; margin-bottom: 6px; }
.output-body { overflow-x: auto; }
.output-body table, .md table { border-collapse: collapse; width: 100%; }
.output-body th, .output-body td, .md th, .md td { border: 1px solid var(--line); padding: 6px 10px; text-align: left; }
pre { background: var(--bg2); padding: 14px; border-radius: 12px; overflow: auto; font-size: .88rem; white-space: pre-wrap; }
code { font-family: 'JetBrains Mono', ui-monospace, Consolas, monospace; }
.svg-preview { display: grid; place-items: center; padding: 20px; background: #fff; border-radius: 12px; max-width: 280px; }
.svg-preview svg { width: 200px; height: 200px; }
.three-frame { width: 100%; height: 440px; border: 0; border-radius: 12px; background: #000; }

/* media results */
.result-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.result-grid figure { margin: 0; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; }
.result-grid figcaption { color: var(--muted); font-size: .85rem; margin-top: 6px; }
.checker { background-image: conic-gradient(#e7e6dc 25%, #fff 0 50%, #e7e6dc 0 75%, #fff 0); background-size: 20px 20px; border-radius: 10px; }
.stage { position: relative; display: inline-block; max-width: 100%; }
.stage canvas, .stage video { display: block; border-radius: 12px; }
.player { width: 100%; }
.labels { display: flex; flex-direction: column; gap: 6px; }
.label-row { display: grid; grid-template-columns: 1fr 3fr auto; gap: 10px; align-items: center; font-size: .92rem; }
.label-bar { height: 8px; border-radius: 9px; background: var(--line); overflow: hidden; }
.label-bar > i { display: block; height: 100%; background: var(--ink); }

/* chat */
.chat-log { min-height: 300px; max-height: 60vh; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; padding: 16px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.msg { max-width: 85%; padding: 10px 14px; border-radius: 14px; }
.msg p { margin: .3em 0; }
.msg.user { align-self: flex-end; background: var(--lemon); color: var(--ink); }
.msg.assistant { align-self: flex-start; background: var(--card2); }
.msg.typing:empty::after { content: '● ● ●'; color: var(--muted); animation: pulse 1s infinite; }
.chat-input { display: flex; flex-direction: column; gap: 8px; }
.chat-input textarea { min-height: 60px; }
.chat-setup { display: flex; flex-direction: column; gap: 12px; }

/* quiz + flashcards */
.quiz-q { padding: 12px 0; border-bottom: 1px solid var(--line); }
.options { display: grid; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.option { text-align: left; }
.option.right { background: rgba(52,211,153,.2); border-color: var(--ok); } .option.wrong { background: rgba(248,113,113,.2); border-color: var(--err); } .option.dim { opacity: .5; }
.quiz-score { font-weight: 700; margin-top: 12px; font-size: 1.1rem; }
.cards { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.flashcard { position: relative; height: 160px; perspective: 800px; cursor: pointer; }
.flashcard > div { position: absolute; inset: 0; display: grid; place-items: center; padding: 14px; text-align: center; border-radius: 14px; border: 1px solid var(--line); backface-visibility: hidden; transition: transform .5s; overflow: auto; }
.flashcard .front { background: var(--card2); font-weight: 600; } .flashcard .back { background: var(--olive); color: var(--cream); transform: rotateY(180deg); }
.flashcard.flipped .front { transform: rotateY(180deg); } .flashcard.flipped .back { transform: rotateY(360deg); }

/* rag */
.file-list { list-style: none; padding: 0; margin: 0; }
.rag-answer { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 20px; margin-bottom: 12px; }
.sources blockquote { margin: 8px 0; padding: 8px 12px; border-left: 3px solid var(--accent); background: var(--bg2); font-size: .88rem; }

/* tool cards / grids (shared with home) */
.tool-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.tool-card { display: flex; flex-direction: column; gap: 4px; padding: 16px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); color: var(--text); transition: transform .2s, border-color .2s, box-shadow .2s; }
.tool-card { text-decoration: none; }
.tool-card:hover { text-decoration: none; transform: translateY(-3px); border-color: var(--ink); box-shadow: 0 8px 0 -3px var(--lemon); }
.tool-card span { color: var(--muted); font-size: .88rem; }

/* coming soon */
.soon { text-align: center; padding: 40px 20px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.soon-orb { width: 80px; height: 80px; margin: 0 auto 16px; border-radius: 50%; background: var(--lemon); border: 2px solid var(--ink); animation: float 3s ease-in-out infinite; }
@keyframes float { 50% { transform: translateY(-10px) scale(1.05); } }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }

/* group: vision */
.v-preview { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.v-preview img { max-height: 360px; border-radius: 12px; border: 1px solid var(--line); }
.v-out { display: flex; flex-direction: column; gap: 12px; }
.v-text { min-height: 140px; font-family: inherit; }
.v-fig { margin: 0; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; }
.v-fig canvas, .redact-fig canvas, .crop-canvas, .meme-wrap canvas { display: block; max-width: 100%; height: auto; border-radius: 10px; }
.v-fig figcaption { display: flex; justify-content: space-between; align-items: center; gap: 10px; color: var(--muted); font-size: .88rem; margin-top: 8px; }
.two-col { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.cap-block textarea { min-height: 70px; }
.latex-preview { padding: 16px; background: #fff; color: #111; border-radius: 12px; overflow-x: auto; min-height: 50px; }
.count-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.count-chip { padding: 6px 14px; border-radius: 99px; background: var(--card2); border: 1px solid var(--line); }
.count-chip b { color: var(--accent2); font-size: 1.15rem; }
.gallery { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.gallery figure { margin: 0; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 6px; }
.gallery figure.top { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.gallery img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; }
.gallery figcaption { font-size: .78rem; color: var(--muted); word-break: break-all; display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.gallery.tags .chip { font-size: .72rem; padding: 2px 8px; }
.dupe-group { display: flex; gap: 10px; overflow-x: auto; padding: 10px; margin: 8px 0; background: var(--card); border: 1px solid var(--line); border-radius: 12px; }
.dupe-group figure { margin: 0; width: 160px; flex: none; }
.dupe-group img { width: 160px; height: 120px; object-fit: cover; border-radius: 8px; }
.dupe-group figcaption { font-size: .75rem; color: var(--muted); word-break: break-all; }
.kcal-box { padding: 14px 18px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.kcal { font-size: 1.2rem; margin-bottom: 8px; } .kcal b { color: var(--warn); font-size: 1.6rem; }
.score-big { font: 800 4rem var(--display); background: linear-gradient(135deg, var(--accent2), var(--pink)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.score-big small { font-size: 1.4rem; }
.gauge { height: 14px; border-radius: 9px; background: linear-gradient(90deg, var(--ok), var(--warn), var(--err)); position: relative; opacity: .35; }
.gauge-fill { height: 100%; border-radius: 9px; background: linear-gradient(90deg, var(--ok), var(--warn), var(--err)); opacity: 1; }
.meme-wrap { max-width: 640px; }
.kv { border-collapse: collapse; width: 100%; } .kv th, .kv td { border: 1px solid var(--line); padding: 6px 10px; text-align: left; } .kv th { color: var(--muted); font-weight: 600; width: 30%; }
.scroll-x { overflow-x: auto; }
.edit-table { border-collapse: collapse; min-width: 100%; } .edit-table td { border: 1px solid var(--line); padding: 6px 10px; min-width: 60px; } .edit-table td:focus { outline: 2px solid var(--accent); }
.redact-page { display: flex; flex-direction: column; gap: 8px; } .redact-fig { margin: 0; } .redact-canvas { cursor: pointer; }
.sudoku { display: grid; grid-template-columns: repeat(9, 1fr); width: min(420px, 92vw); border: 3px solid var(--text); border-radius: 6px; overflow: hidden; }
.sd-cell { width: 100%; aspect-ratio: 1; text-align: center; font: 700 1.3rem var(--font); padding: 0; border-radius: 0; border: 1px solid var(--line); background: var(--bg2); }
.sd-cell:nth-child(9n+3), .sd-cell:nth-child(9n+6) { border-right: 2px solid var(--text); }
.sd-cell:nth-child(n+19):nth-child(-n+27), .sd-cell:nth-child(n+46):nth-child(-n+54) { border-bottom: 2px solid var(--text); }
.sd-cell.solved { color: var(--ok); background: rgba(52,211,153,.08); }
.crop-canvas { touch-action: none; cursor: crosshair; }
.fun-out { font-size: 1.05rem; }

/* group: camera */
.cam-wrap { display: grid; grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr); gap: 16px; align-items: start; }
@media (max-width: 820px) { .cam-wrap { grid-template-columns: 1fr; } }
.cam-stage { position: relative; background: #000; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; min-height: 260px; display: grid; place-items: center; }
.cam-canvas { width: 100%; height: auto; display: block; }
.cam-placeholder { text-align: center; padding: 40px 20px; }
.cam-icon { font-size: 3rem; }
.cam-side { display: flex; flex-direction: column; gap: 12px; padding: 16px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.cam-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); gap: 8px; }
.cam-stat { background: var(--bg2); border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px; }
.cam-stat-value { font: 700 1.2rem var(--display); }
.cam-big-number { font: 800 4.5rem/1 var(--display); text-align: center; background: linear-gradient(135deg, var(--accent2), var(--accent)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.cam-feedback { font-weight: 600; }
.cam-result h3 { margin-bottom: .3em; }
.cam-emoji { font-size: 5rem; text-align: center; line-height: 1.1; }
.emoji-collection { display: flex; flex-wrap: wrap; gap: 6px; font-size: 1.6rem; }
.emoji-collection span { filter: grayscale(1) opacity(.35); transition: filter .3s, transform .3s; }
.emoji-collection span.got { filter: none; transform: scale(1.1); }
.emoji-collection p { width: 100%; margin: 4px 0 0; }
.swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.swatch { width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--line); cursor: pointer; }
.swatch.on { outline: 3px solid var(--text); outline-offset: 2px; }
.focus-chart { width: 100%; height: 60px; background: var(--bg2); border-radius: 10px; }
.privacy-note { margin: 0; }
.vlm-caption { font: 600 1.15rem/1.4 var(--display); padding: 12px; background: var(--bg2); border-radius: 12px; min-height: 3em; }
.vlm-log { max-height: 200px; overflow: auto; padding-left: 1.2em; }
/* slides */
.slides-mode .cam-wrap { grid-template-columns: minmax(0, 1fr) minmax(260px, 1fr); }
.slide-box { position: relative; background: #000; border-radius: var(--radius); overflow: hidden; }
.slide-box:fullscreen { display: grid; place-items: center; }
.slide-canvas { width: 100%; height: auto; display: block; }
.slide-box:fullscreen .slide-canvas { width: 100vw; height: 100vh; object-fit: contain; }
.slide-counter { position: absolute; right: 12px; bottom: 10px; padding: 2px 10px; border-radius: 99px; background: rgba(0,0,0,.6); font-size: .85rem; }
/* pictionary */
.pict-wrap { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(260px, 1fr); gap: 16px; align-items: start; }
@media (max-width: 820px) { .pict-wrap { grid-template-columns: 1fr; } }
.pict-board { display: flex; flex-direction: column; gap: 10px; }
.pict-top { display: flex; justify-content: space-between; align-items: center; }
.pict-word { font: 700 1.6rem var(--display); }
.pict-timer { font: 800 2rem var(--display); color: var(--accent2); min-width: 2.5ch; text-align: right; }
.pict-timer.low { color: var(--err); animation: pulse .6s infinite; }
.doodle-canvas { width: 100%; aspect-ratio: 1; background: #fff; border-radius: var(--radius); touch-action: none; cursor: crosshair; }
.pict-side { display: flex; flex-direction: column; gap: 12px; padding: 16px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.pict-score { font: 700 1.4rem var(--display); }
.pict-guess { font-size: 1.1rem; padding: 12px 14px; background: var(--bg2); border-radius: 14px; min-height: 3em; }
.pict-guess.win { border: 1px solid var(--ok); color: var(--ok); }
.pict-scorecard { width: 100%; border-radius: 12px; }

/* group: text */
.scroll-table { max-height: 460px; overflow: auto; border-radius: 12px; border: 1px solid var(--line); }
.scroll-table table { border-collapse: collapse; width: 100%; font-size: .9rem; }
.scroll-table th { position: sticky; top: 0; background: var(--card2); }
.scroll-table th, .scroll-table td { border-bottom: 1px solid var(--line); padding: 6px 10px; text-align: left; vertical-align: top; }
.output table { border-collapse: collapse; width: 100%; }
.output td, .output th { border-bottom: 1px solid var(--line); padding: 6px 10px; text-align: left; vertical-align: top; }
.ent-groups { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.ent-text { line-height: 2; white-space: pre-wrap; background: var(--bg2); padding: 14px; border-radius: 12px; }
mark.ent { color: var(--text); border-radius: 6px; padding: 1px 4px; }
mark.ent-PER { background: #dcff3a; } mark.ent-LOC { background: #bfe3ff; } mark.ent-ORG { background: #ffd2bf; } mark.ent-MISC { background: #e6dcff; }
.kw-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 12px; }
.chip.miss { color: var(--err); border-color: rgba(248,113,113,.4); }
pre.tall { max-height: 480px; }
.data-panel { display: flex; flex-direction: column; gap: 14px; }
.chart-list canvas { max-height: 320px; }
.md p:first-child { margin-top: 0; }

/* group: audio-video */
.av-input { display: flex; flex-direction: column; gap: 10px; }
.av-preview:empty { display: none; }
.av-results { display: flex; flex-direction: column; gap: 14px; }
.av-video { width: 100%; max-height: 70vh; border-radius: 14px; background: #000; }
.video-result { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.transcript { line-height: 1.9; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 18px; max-height: 60vh; overflow-y: auto; }
.transcript p { margin: .3em 0; }
.ts { font: 600 .8rem 'JetBrains Mono', ui-monospace, monospace; color: var(--accent2); }
.filler { background: #ffd2bf; color: #7a2a00; border-radius: 4px; }
.text-editor .word { cursor: pointer; border-radius: 4px; padding: 1px 0; }
.text-editor .word:hover { background: var(--lemon-pale); }
.text-editor .word.cut { background: #ffd9d9; color: #9b1c1c; text-decoration: line-through; }
.live-caption { min-height: 180px; max-height: 50vh; overflow-y: auto; padding: 18px 22px; background: var(--ink); color: var(--cream); border-radius: var(--radius); font-size: 1.3rem; line-height: 1.6; }
.live-caption.big { font-size: 2.4rem; font-weight: 700; }
.big-text { font-size: 1.35rem; font-weight: 600; }
.stats { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
.stat { display: flex; flex-direction: column; padding: 14px 16px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.stat b { font: 700 1.7rem var(--display); }
.stat span { color: var(--muted); font-size: .85rem; }
.score-big { font: 800 3rem var(--display); background: linear-gradient(90deg, var(--accent), var(--accent2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.pron { font-size: 1.5rem; line-height: 1.8; }
.pron .good { color: var(--ok); } .pron .bad { color: var(--err); text-decoration: underline wavy; cursor: pointer; }
.checklist { list-style: none; padding: 0; } .checklist li { padding: 6px 0; border-bottom: 1px solid var(--line); }
.voice-list { display: flex; flex-direction: column; gap: 6px; max-height: 60vh; overflow-y: auto; }
.voice-row { display: grid; grid-template-columns: 2fr 2fr auto; gap: 10px; align-items: center; padding: 8px 12px; background: var(--card); border-radius: 10px; }
.audiobook-part { padding: 12px 16px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.piano-roll { width: 100%; height: auto; border-radius: 12px; border: 1px solid var(--line); }
.note-names { font: .95rem 'JetBrains Mono', ui-monospace, monospace; word-spacing: .3em; }
.chord-grid { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); }
.chord { display: flex; flex-direction: column; align-items: center; padding: 10px 6px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; color: var(--text); cursor: pointer; font: inherit; }
.chord b { font: 700 1.2rem var(--display); } .chord small { color: var(--muted); }
.chord.now { border-color: var(--ink); background: var(--lemon); }
.v2v-log { display: flex; flex-direction: column; gap: 10px; }
.v2v-line { padding: 12px 16px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.phrase-table { width: 100%; border-collapse: collapse; }
.phrase-table th, .phrase-table td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.sub-list { display: flex; flex-direction: column; gap: 6px; max-height: 50vh; overflow-y: auto; }
.sub-row { display: grid; grid-template-columns: auto 1fr; gap: 8px; align-items: center; }
.moments { display: flex; flex-direction: column; gap: 8px; }
.moment { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; text-align: left; padding: 10px 14px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; color: var(--text); cursor: pointer; font: inherit; }
.moment:hover { border-color: var(--accent); }
.clip-card { padding: 14px 18px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }

/* group: photo */
.img-work { display: flex; flex-direction: column; gap: 14px; }
.img-panel:empty { display: none; }
.img-panel .stage, .img-result figure { max-width: 100%; }
.stage.preview canvas, .img-panel canvas, .img-result canvas, .img-result img { max-height: 70vh; width: auto; max-width: 100%; height: auto; }
.editor { display: flex; flex-direction: column; gap: 8px; }
.stage .overlay { position: absolute; inset: 0; width: 100% !important; height: 100% !important; max-height: none !important; touch-action: none; cursor: crosshair; }
.brush-stage .overlay { opacity: 1; }
.sel-overlay { opacity: .55 !important; }
.clickable { cursor: crosshair; }
.focus-mark { position: absolute; width: 26px; height: 26px; margin: -13px 0 0 -13px; border: 2px solid #fff; border-radius: 50%; box-shadow: 0 0 0 2px var(--ink), 0 0 0 5px var(--lemon); pointer-events: none; }
.cmp-fig { margin: 0; display: flex; flex-direction: column; gap: 8px; }
.cmp { position: relative; display: inline-block; max-width: 100%; line-height: 0; border-radius: 12px; overflow: hidden; align-self: flex-start; }
.cmp > img { display: block; max-width: 100%; max-height: 70vh; width: auto; height: auto; }
.cmp > canvas.cmp-after { position: absolute; inset: 0; width: 100% !important; height: 100% !important; max-height: none !important; }
.cmp-line { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: #fff; box-shadow: 0 0 8px rgba(0,0,0,.6); pointer-events: none; }
.cmp-range { width: min(100%, 600px); }
.img-result figure.single { margin: 0; }
.img-result figure.single > div { display: inline-block; line-height: 0; border-radius: 12px; }
.img-result .result-grid canvas { width: 100%; height: auto; max-height: none; border-radius: 8px; }
.img-result .result-grid figure { display: flex; flex-direction: column; gap: 6px; }
.parallax-wrap { display: inline-block; max-width: 100%; }
.parallax-canvas { max-width: 100%; max-height: 70vh; border-radius: 12px; cursor: grab; }
.svg-result img { max-width: 100%; max-height: 60vh; background-color: #fff; }
label.chip { display: inline-flex; gap: 6px; align-items: center; cursor: pointer; }

/* group: gen */
.gen-box { display: flex; flex-direction: column; gap: 14px; padding: 18px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.gen-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-btn { appearance: none; border: 1px solid var(--line); background: var(--bg2); color: var(--text); padding: 6px 14px; border-radius: 99px; font: 500 .9rem var(--font); cursor: pointer; transition: border-color .15s, background .15s; }
.chip-btn:hover { border-color: var(--accent); }
.chip-btn.on { background: var(--lemon); border-color: var(--ink); }
.gen-opts .field.grow { flex: 1; min-width: 220px; }
.gen-gallery canvas { width: 100%; height: auto; border-radius: 10px; display: block; }
.gen-gallery .gen-img { image-rendering: auto; }
.gen-nogpu { text-align: center; padding: 36px 20px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.s2c-shot img { max-height: 280px; border-radius: 10px; border: 1px solid var(--line); }
.s2c-frame { width: 100%; height: 520px; border: 0; border-radius: 12px; background: #fff; margin-top: 10px; }
.s2c-code { max-height: 520px; margin-top: 10px; }
.img3d-view { width: 100%; min-height: 320px; border-radius: var(--radius); overflow: hidden; background: radial-gradient(circle at 50% 40%, #3a4230, var(--night)); border: 1px solid var(--line); }
.img3d-view canvas { display: block; touch-action: none; }

/* video tools, part 2 */
.v2-progress { display: grid; grid-template-columns: 1fr auto; gap: 8px 12px; align-items: center; margin: 12px 0; }
.v2-progress .bar { grid-column: 1 / -1; grid-row: 2; height: 8px; border-radius: 99px; background: var(--card2); overflow: hidden; }
.v2-progress .bar-fill { height: 100%; background: var(--ink); transition: width .3s; }
.v2-caps { display: flex; flex-direction: column; gap: 6px; padding-left: 1.4em; max-height: 50vh; overflow-y: auto; }
.v2-pick { max-width: 100%; border-radius: 12px; cursor: crosshair; touch-action: none; margin: 8px 0; }

/* voice tools */
.voice-out { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 10px 12px; margin: 8px 0; background: var(--card); border-radius: 12px; }
.voice-out b { flex-basis: 100%; }
.consent { padding: 16px; border-radius: 14px; background: var(--card); margin: 12px 0; }
.consent-line { margin: 10px 0; padding: 12px 14px; border-left: 3px solid var(--ink); background: var(--lemon-pale); font-size: 1.05em; }
.consent .check { display: flex; gap: 8px; align-items: flex-start; margin: 10px 0; }
.dub-lines { display: flex; flex-direction: column; gap: 6px; margin: 10px 0; }
.dub-line { display: grid; grid-template-columns: 56px 1fr; gap: 8px; align-items: center; }

/* diffusion tools */
.terms { margin: 12px 0; padding: 14px 16px; border-radius: 14px; background: #fff; border: 1.5px solid var(--ink); }
.terms summary { cursor: pointer; font-weight: 600; }
.terms ul { margin: 8px 0 8px 1.2em; display: grid; gap: 4px; }
.terms .check { display: flex; gap: 8px; align-items: flex-start; font-weight: 600; margin-top: 10px; }
.sd-preview canvas, .sd-card canvas { max-width: 100%; height: auto; border-radius: 12px; display: block; }
.sd-results { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; margin-top: 14px; }
.sd-card { margin: 0; padding: 10px; background: var(--card); border-radius: 14px; }
.sd-card figcaption { margin-top: 8px; }
.sd-pad { width: min(100%, 512px); aspect-ratio: 1; border-radius: 12px; background: #fff; touch-action: none; cursor: crosshair; display: block; }
.legal { max-width: 760px; padding-bottom: 40px; }
.legal h2 { margin-top: 28px; }
.legal ul { margin-left: 1.2em; display: grid; gap: 6px; }

/* crawlable about/how-to/FAQ block under every tool */
.seo-info { margin-top: 40px; padding-top: 28px; border-top: 1px solid var(--line); color: #3d4034; }
.seo-info h2 { font-size: clamp(28px, 3.4vw, 44px); }
.seo-info h3 { margin-top: 26px; font: 600 18px var(--text-font); }
.seo-info details { border-bottom: 1px solid var(--line); padding: 12px 0; }
.seo-info summary { cursor: pointer; font-weight: 600; }
.seo-links { padding-left: 18px; }
.seo-links li { margin: 4px 0; }
