:root {
  --bg: #f8f7f4;
  --surface: #ffffff;
  --surface-2: #f2f0eb;
  --text: #1b1a17;
  --muted: #625e56;
  --border: #e4e0d8;
  --accent: #e8590c;
  --accent-hover: #c94c08;
  --accent-soft: #fdeee4;
  --accent-text: #ffffff;
  --ok: #157f3b;
  --warn: #a15c07;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(27, 26, 23, 0.04), 0 8px 24px rgba(27, 26, 23, 0.06);
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #12110f;
    --surface: #1c1a17;
    --surface-2: #25231f;
    --text: #f1eee8;
    --muted: #a8a299;
    --border: #322f2a;
    --accent: #ff7a33;
    --accent-hover: #ff9457;
    --accent-soft: #3a2316;
    --accent-text: #1b1a17;
    --ok: #4cc77a;
    --warn: #f0a640;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.25);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
}
img, svg { display: block; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--accent-hover); }
h1, h2, h3 { line-height: 1.2; letter-spacing: -0.02em; }
.muted { color: var(--muted); }
.wrap { width: 100%; max-width: 1040px; margin: 0 auto; padding: 0 16px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* header */
.site-header {
  position: sticky; top: 0; z-index: 10;
  background: var(--bg);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--border);
}
.header-inner { display: flex; align-items: center; gap: 6px; height: 60px; }
.site-nav { margin-left: auto; }
.lang-switch { position: relative; }
.lang-switch summary { list-style: none; display: flex; align-items: center; gap: 4px; padding: 6px 10px; border-radius: 8px; cursor: pointer; font-weight: 600; font-size: 14px; color: var(--text); }
.lang-switch summary::-webkit-details-marker { display: none; }
.lang-switch summary:hover, .lang-switch[open] summary { background: var(--surface-2); }
.lang-menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; display: flex; flex-direction: column; min-width: 160px; padding: 6px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow); }
.lang-menu a { padding: 8px 10px; border-radius: 6px; color: var(--text); text-decoration: none; }
.lang-menu a:hover { background: var(--surface-2); color: var(--text); }
.lang-menu a[aria-current] { font-weight: 700; color: var(--accent); }
.logo { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 18px; color: var(--text); text-decoration: none; }
.logo:hover { color: var(--text); }
.site-nav { display: flex; align-items: center; gap: 4px; }
.site-nav a { padding: 6px 12px; border-radius: 8px; color: var(--text); text-decoration: none; font-weight: 500; }
.site-nav a:hover, .site-nav a[aria-current="page"] { background: var(--surface-2); }
.site-nav .nav-pro { color: var(--accent); }
.pro-badge { margin-left: 6px; padding: 2px 8px; border-radius: 99px; font-size: 12px; font-weight: 700; background: var(--accent); color: var(--accent-text); }
.nav-toggle { display: none; background: none; border: 0; color: var(--text); padding: 8px; cursor: pointer; }
@media (max-width: 900px) {
  .nav-toggle { display: block; margin-left: auto; }
  .lang-switch { margin-left: auto; }
  .lang-switch + .nav-toggle { margin-left: 0; }
  .site-nav {
    display: none; position: absolute; top: 60px; left: 0; right: 0;
    flex-direction: column; align-items: stretch; padding: 8px 16px 16px;
    background: var(--bg); border-bottom: 1px solid var(--border);
  }
  .site-nav.open { display: flex; }
  .site-nav a { padding: 10px 12px; }
}

/* hero */
.hero { text-align: center; padding: 48px 0 28px; }
.hero h1 { font-size: clamp(30px, 5vw, 46px); margin: 0 0 12px; }
.hero-home { padding: 64px 0 40px; }
.hero-home h1 { font-size: clamp(34px, 6vw, 56px); max-width: 820px; margin: 0 auto 16px; }
.hl { color: var(--accent); }
.lead { font-size: 18px; color: var(--muted); max-width: 680px; margin: 0 auto; }
.hero-cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 28px; }
.trust-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 20px; list-style: none; padding: 0; margin: 18px 0 0; font-size: 14px; color: var(--muted); }
.trust-row li { display: flex; align-items: center; gap: 6px; }
.trust-row svg { color: var(--ok); }

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px; border-radius: 10px; border: 1px solid transparent;
  font: inherit; font-weight: 600; font-size: 15px; line-height: 1.2;
  text-decoration: none; cursor: pointer; transition: background 0.15s, border-color 0.15s;
}
.btn-primary { background: var(--accent); color: var(--accent-text); }
.btn-primary:hover { background: var(--accent-hover); color: var(--accent-text); }
.btn-ghost { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-lg { padding: 14px 24px; font-size: 16px; }
.btn-sm { padding: 6px 12px; font-size: 14px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }

/* tool */
.tool { padding: 20px; max-width: 820px; margin: 0 auto; }
.tool > * + * { margin-top: 14px; }
.dropzone {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 36px 16px; text-align: center; cursor: pointer;
  border: 2px dashed var(--border); border-radius: 12px; background: var(--surface-2);
  transition: border-color 0.15s, background 0.15s;
}
.dropzone:hover, .dropzone.drag { border-color: var(--accent); background: var(--accent-soft); }
.dz-icon { color: var(--accent); }
.dropzone strong { font-size: 17px; }
.dropzone .link { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.dropzone .muted { font-size: 14px; }

.options { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px 18px; margin-top: 18px; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.field > label { font-weight: 600; display: flex; justify-content: space-between; }
.field output { color: var(--accent); font-variant-numeric: tabular-nums; }
.field input[type="number"], .field select {
  font: inherit; padding: 8px 10px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
}
.field input[type="range"] { accent-color: var(--accent); width: 100%; }
.field input[type="color"] { width: 100%; height: 38px; padding: 2px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); }
.field-check { justify-content: flex-end; }
.field-check label { font-weight: 500; justify-content: flex-start; gap: 8px; align-items: center; padding-bottom: 8px; }
.field-check input { accent-color: var(--accent); width: 16px; height: 16px; }
[data-when][hidden] { display: none; }

.tool-status { margin: 14px 0 0; font-size: 14px; color: var(--muted); min-height: 1px; }
.tool-status:empty { margin: 0; }
.tool-status .upsell { color: var(--warn); }
.results { list-style: none; padding: 0; margin: 14px 0 0; display: flex; flex-direction: column; gap: 8px; }
.results:empty { margin: 0; }
.result {
  display: grid; grid-template-columns: 52px 1fr auto; align-items: center; gap: 12px;
  padding: 8px 10px 8px 8px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface);
}
.result img { width: 52px; height: 52px; object-fit: cover; border-radius: 6px; background: var(--surface-2); }
.result .meta { min-width: 0; }
.result .name { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.result .sizes { font-size: 13px; color: var(--muted); }
.result .saved { color: var(--ok); font-weight: 600; }
.result .grew { color: var(--warn); font-weight: 600; }
.result.error .sizes { color: var(--warn); }
.result .spinner { width: 20px; height: 20px; border: 2px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.tool-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; margin-top: 14px; }
.tool-actions[hidden] { display: none; }

/* ads: generous spacing keeps them away from tool buttons (AdSense accidental-click policy) */
.ad-slot { margin: 40px auto; max-width: 820px; min-height: 90px; text-align: center; }
.ad-slot.placeholder {
  display: flex; align-items: center; justify-content: center;
  border: 1px dashed var(--border); border-radius: 10px; color: var(--muted); font-size: 13px;
}

/* content */
.prose { max-width: 760px; margin: 0 auto; padding: 8px 0 24px; }
.prose h1 { font-size: clamp(28px, 4.5vw, 40px); margin: 40px 0 8px; }
.prose h2 { font-size: 24px; margin: 40px 0 12px; }
.prose p, .prose li { color: var(--text); }
.prose ul, .prose ol { padding-left: 22px; }
.prose li { margin: 6px 0; }
.steps { counter-reset: step; list-style: none; padding: 0 !important; }
.steps li { counter-increment: step; position: relative; padding-left: 40px; margin: 12px 0; }
.steps li::before {
  content: counter(step); position: absolute; left: 0; top: 0;
  width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent); font-weight: 700; font-size: 14px;
}
.faq details { border-bottom: 1px solid var(--border); padding: 14px 0; }
.faq summary { cursor: pointer; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--accent); font-size: 20px; line-height: 1; }
.faq details[open] summary::after { content: "−"; }
.faq details p { margin: 10px 0 0; color: var(--muted); }
.legal h2 { font-size: 20px; }

.related { padding: 24px 0; }
.related h2 { font-size: 22px; text-align: center; margin: 16px 0 20px; }
.tool-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.tool-card {
  display: flex; align-items: center; gap: 12px; padding: 14px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  color: var(--text); text-decoration: none; transition: border-color 0.15s, transform 0.15s;
}
.tool-card:hover { border-color: var(--accent); color: var(--text); transform: translateY(-1px); }
.tool-card strong { display: block; font-size: 15px; }
.tool-card .muted { display: block; font-size: 13px; line-height: 1.4; }
.tool-icon {
  flex: none; width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent);
}

.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; padding: 16px 0; }
.feature { padding: 22px; }
.feature h3 { margin: 14px 0 6px; font-size: 18px; }
.feature p { margin: 0; }

/* pricing */
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; max-width: 760px; margin: 0 auto; }
.plan { padding: 26px; position: relative; display: flex; flex-direction: column; }
.plan h2 { margin: 0; font-size: 20px; }
.plan .price { font-size: 40px; font-weight: 800; margin: 10px 0 4px; letter-spacing: -0.03em; }
.plan .price small { display: block; font-size: 14px; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.plan .checks { flex: 1; }
.plan-pro { border: 2px solid var(--accent); }
.plan-tag { position: absolute; top: -12px; right: 20px; background: var(--accent); color: var(--accent-text); font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 99px; }
.checks { list-style: none; padding: 0; margin: 16px 0 22px; }
.checks li { padding-left: 26px; position: relative; margin: 8px 0; }
.checks li::before { content: "✓"; position: absolute; left: 0; color: var(--ok); font-weight: 700; }
.license { max-width: 760px; margin: 24px auto 0; padding: 24px; }
.license h2 { margin: 0 0 6px; font-size: 20px; }
.license-form { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.license-form input {
  flex: 1 1 260px; font: inherit; font-family: ui-monospace, Consolas, monospace; font-size: 14px;
  padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text);
}
.license-msg { margin: 10px 0 0; font-size: 14px; }
.license-msg:empty { margin: 0; }
.license-msg.err { color: var(--warn); }
.ok { color: var(--ok); font-weight: 600; }

/* footer */
.site-footer { margin-top: 48px; padding: 40px 0 24px; border-top: 1px solid var(--border); background: var(--surface); }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 24px; }
.footer-grid a.footer-all { display: inline-block; color: var(--accent); font-weight: 600; }
.footer-grid h3 { font-size: 14px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin: 4px 0 10px; }
.footer-grid a:not(.logo) { display: block; color: var(--text); text-decoration: none; font-size: 15px; margin: 6px 0; }
.footer-grid a:not(.logo):hover { color: var(--accent); }
.footer-grid p { font-size: 14px; max-width: 320px; }
.copyright { font-size: 13px; margin-top: 24px; }
@media (max-width: 640px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-grid > div:first-child { grid-column: 1 / -1; }
  .hero { padding: 32px 0 20px; }
  .tool { padding: 14px; }
  .result { grid-template-columns: 44px 1fr; }
  .result img { width: 44px; height: 44px; }
  .result > :last-child { grid-column: 1 / -1; justify-self: stretch; }
  .result > :last-child .btn { width: 100%; }
}

/* ---------- multi-tool components ---------- */
.tool-status.err { color: var(--warn); }
.result .ftype { width: 52px; height: 52px; display: grid; place-items: center; border-radius: 6px; background: var(--accent-soft); color: var(--accent); font-weight: 800; font-size: 13px; }
.results .zip-row { display: flex; justify-content: flex-end; }
.crumbs { display: flex; flex-wrap: wrap; gap: 6px; font-size: 13px; color: var(--muted); padding-top: 16px; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--accent); }
.crumbs + .hero { padding-top: 20px; }
.mono, textarea.mono, .prose code, kbd { font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace; }
.prose code { font-size: 0.9em; background: var(--surface-2); padding: 1px 5px; border-radius: 4px; }
kbd { font-size: 0.85em; padding: 1px 6px; border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 5px; background: var(--surface); }

.field input[type="text"], .field input[type="email"], .field input[type="date"],
.field input[type="datetime-local"], .field input[type="file"] {
  font: inherit; padding: 8px 10px; border-radius: 8px; width: 100%;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
}
.field-wide { grid-column: 1 / -1; }
textarea.io {
  display: block; width: 100%; font: inherit; font-size: 15px; line-height: 1.5; padding: 12px 14px; resize: vertical;
  border-radius: 10px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text);
}
textarea.io:focus { outline: 2px solid var(--accent); outline-offset: 0; background: var(--surface); }
textarea.mono { font-size: 13.5px; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; }
.btn-row.center { justify-content: center; }
.btn-row[hidden], .options[hidden] { display: none; }
.sub { font-size: 16px; margin: 22px 0 8px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid2 > * { min-width: 0; }
@media (max-width: 700px) { .grid2 { grid-template-columns: 1fr; } }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.stat { background: var(--surface-2); border-radius: 10px; padding: 12px 14px; min-width: 0; }
.stat b { display: block; font-size: 22px; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; overflow-wrap: anywhere; }
.stat span { font-size: 13px; color: var(--muted); }
.limits { display: flex; flex-wrap: wrap; gap: 8px; font-size: 13px; }
.limit { padding: 4px 10px; border-radius: 99px; background: var(--surface-2); color: var(--muted); }
.limit.over { background: var(--accent-soft); color: var(--warn); }
.keywords { columns: 2; font-size: 14px; margin: 0; }
.result-hero { font-size: 26px; font-weight: 800; text-align: center; padding: 18px; background: var(--accent-soft); border-radius: 12px; }
.result-hero b { font-size: 40px; display: block; }
.result-hero span { display: block; font-size: 15px; font-weight: 600; color: var(--muted); }
.big-result { font-size: clamp(32px, 7vw, 56px); font-weight: 800; text-align: center; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.big-time { font-size: clamp(48px, 13vw, 104px); font-weight: 700; text-align: center; font-variant-numeric: tabular-nums; letter-spacing: -0.03em; line-height: 1.1; }
.seg { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 3px; background: var(--surface-2); border-radius: 10px; }
.seg button { border: 0; background: none; padding: 8px 14px; border-radius: 8px; font: inherit; font-weight: 600; font-size: 14px; color: var(--muted); cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
[data-panel][hidden] { display: none; }

.calc-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 14px; border: 1px solid var(--border); border-radius: 10px; font-weight: 500; }
.calc-row input { width: 110px; font: inherit; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2); color: var(--text); }
.calc-row output { margin-left: auto; font-weight: 800; font-size: 18px; color: var(--accent); }
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
.table th, .table td { padding: 8px 10px; border-bottom: 1px solid var(--border); text-align: right; white-space: nowrap; }
.table th:first-child, .table td:first-child { text-align: left; }
.schedule summary { cursor: pointer; font-weight: 600; padding: 6px 0; }
.growth { display: flex; align-items: flex-end; gap: 3px; height: 160px; padding-top: 8px; }
.growth i { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; background: var(--accent); border-radius: 3px 3px 0 0; min-height: 2px; }
.growth b { display: block; background: var(--accent-soft); background: color-mix(in srgb, var(--accent) 40%, var(--surface)); }
.bmi-scale { position: relative; height: 12px; border-radius: 99px; background: linear-gradient(90deg, #60a5fa 0 21.7%, #22c55e 21.7% 43.3%, #f59e0b 43.3% 60%, #ef4444 60%); }
.bmi-scale i { position: absolute; top: -5px; width: 4px; height: 22px; background: var(--text); border-radius: 2px; transform: translateX(-50%); transition: left 0.2s; }
.bmi-legend { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 6px; font-size: 12px; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 14px; margin: 10px 0 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-family: ui-monospace, Consolas, monospace; overflow-wrap: anywhere; }
.now-box { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 12px 14px; background: var(--surface-2); border-radius: 10px; }
.now-box b { font-family: ui-monospace, Consolas, monospace; font-size: 18px; }
.hash-list { display: flex; flex-direction: column; gap: 8px; }
.hash-row { display: grid; grid-template-columns: 70px 1fr auto; gap: 10px; align-items: center; font-size: 14px; font-weight: 600; }
.hash-row code { font-size: 12.5px; font-weight: 400; overflow-wrap: anywhere; background: var(--surface-2); padding: 6px 8px; border-radius: 6px; }

.diff-out { border: 1px solid var(--border); border-radius: 10px; overflow: auto; max-height: 640px; font-size: 13px; line-height: 1.5; }
.diff-out[hidden] { display: none; }
.diff-out > div { display: grid; grid-template-columns: 42px 42px 18px 1fr; white-space: pre-wrap; overflow-wrap: anywhere; }
.diff-out .add { background: rgba(34, 197, 94, 0.18); }
.diff-out .del { background: rgba(239, 68, 68, 0.18); }
.diff-out .ln { color: var(--muted); text-align: right; padding-right: 8px; user-select: none; }
.diff-out .gap { display: block; color: var(--muted); background: var(--surface-2); padding: 2px 10px; }

.file-list { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.file-list:empty { display: none; }
.file-item { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 10px; font-size: 14px; }
.file-item .fname { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.file-item .fsize { color: var(--muted); font-size: 13px; white-space: nowrap; }
.icon-btn { flex: none; width: 30px; height: 30px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); cursor: pointer; font-size: 14px; }
.icon-btn:disabled { opacity: 0.35; cursor: default; }

.editor[hidden] { display: none; }
.editor > * + * { margin-top: 14px; }
.stage { display: flex; justify-content: center; padding: 10px; border-radius: 10px; background: repeating-conic-gradient(var(--surface-2) 0 25%, var(--surface) 0 50%) 0 0 / 20px 20px; }
.stage canvas { display: block; max-width: 100%; max-height: 60vh; width: auto; height: auto; }
.crop-wrap { position: relative; display: inline-block; overflow: hidden; touch-action: none; user-select: none; -webkit-user-select: none; }
.crop-wrap img { display: block; max-width: 100%; max-height: 60vh; pointer-events: none; }
.crop-box { position: absolute; border: 2px solid #fff; box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.5); cursor: move; }
.crop-box span { position: absolute; width: 18px; height: 18px; background: #fff; border: 2px solid var(--accent); border-radius: 3px; }
.crop-box [data-h="nw"] { left: -2px; top: -2px; cursor: nwse-resize; }
.crop-box [data-h="ne"] { right: -2px; top: -2px; cursor: nesw-resize; }
.crop-box [data-h="sw"] { left: -2px; bottom: -2px; cursor: nesw-resize; }
.crop-box [data-h="se"] { right: -2px; bottom: -2px; cursor: nwse-resize; }
.b64-preview { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }
.b64-preview[hidden] { display: none; }
.b64-preview img { max-width: 200px; max-height: 160px; border-radius: 8px; border: 1px solid var(--border); }

.qr-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; align-items: start; }
.qr-grid > div > * + *, [data-panel] > * + * { margin-top: 12px; }
@media (max-width: 760px) { .qr-grid { grid-template-columns: 1fr; } }
.qr-preview { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.qr-preview canvas { width: 100%; max-width: 300px; height: auto; border-radius: 8px; border: 1px solid var(--border); }
.pw-out { display: flex; gap: 8px; align-items: center; }
.pw-out code { flex: 1; min-width: 0; font-size: clamp(16px, 3vw, 22px); padding: 14px; background: var(--surface-2); border-radius: 10px; overflow-wrap: anywhere; }
.meter { height: 8px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.meter span { display: block; height: 100%; width: 0; transition: width 0.2s, background 0.2s; }
.pw-list { list-style: none; padding: 0; font-size: 14px; }
.pw-list:empty { display: none; }
.pw-list li { padding: 6px 10px; border-bottom: 1px solid var(--border); overflow-wrap: anywhere; }

.wheel-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.wheel-grid > div > * + * { margin-top: 12px; }
@media (max-width: 760px) { .wheel-grid { grid-template-columns: 1fr; } }
.wheel-wrap { position: relative; width: 100%; max-width: 520px; margin: 0 auto; }
.wheel-wrap canvas { display: block; width: 100%; height: auto; }
.wheel-pointer { position: absolute; top: 50%; right: -4px; transform: translateY(-50%); border-top: 16px solid transparent; border-bottom: 16px solid transparent; border-right: 30px solid var(--text); }
.wheel-spin {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 22%; aspect-ratio: 1; border-radius: 50%;
  border: 4px solid var(--surface); background: var(--accent); color: var(--accent-text); font: inherit; font-weight: 800; font-size: clamp(12px, 2.6vw, 18px); cursor: pointer; box-shadow: var(--shadow);
}
.wheel-spin:disabled { cursor: default; }
.winner { text-align: center; font-size: 22px; font-weight: 800; padding: 16px; border-radius: 12px; background: var(--accent-soft); }
.winner[hidden] { display: none; }

.rec-display { display: flex; align-items: center; justify-content: center; gap: 12px; font-size: 40px; font-variant-numeric: tabular-nums; }
.rec-dot { width: 16px; height: 16px; border-radius: 50%; background: var(--border); }
.recording .rec-dot { background: #ef4444; animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: 0.3; } }
.level { height: 10px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.level.big { height: 24px; }
.level span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #22c55e, #f59e0b 70%, #ef4444); background-size: 400px 100%; }
.recordings { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.recordings:empty { display: none; }
.recordings li { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 10px; border: 1px solid var(--border); border-radius: 10px; }
.recordings audio, .recordings video { flex: 1 1 260px; max-width: 100%; }
.recordings video { max-height: 280px; background: #000; border-radius: 8px; }
.video-box { display: flex; justify-content: center; overflow: hidden; background: #000; border-radius: 12px; }
.video-box[hidden] { display: none; }
.video-box video { display: block; max-width: 100%; max-height: 60vh; }
.video-box.mirror video { transform: scaleX(-1); }
.verdict { text-align: center; font-weight: 600; }
.timer-set { display: grid; grid-template-columns: repeat(3, minmax(0, 110px)); gap: 10px; justify-content: center; }
.timer-set input { text-align: center; font-size: 18px !important; }
.progress { height: 6px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.progress span { display: block; height: 100%; width: 100%; background: var(--accent); }
.laps { max-width: 360px; margin-left: auto; margin-right: auto; padding: 0; list-style: none; font-size: 15px; }
.laps li { display: flex; justify-content: space-between; padding: 6px 4px; border-bottom: 1px solid var(--border); }
.time-up .big-time { color: var(--accent); animation: pulse 0.8s infinite; }

.home-cat h2, .related .cat-head h2 { text-align: left; }
.cat-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.cat-head h2 { display: flex; align-items: center; gap: 8px; margin: 16px 0; }
.cat-head h2 svg { color: var(--accent); }
.cat-head a { font-weight: 600; text-decoration: none; }
.related h2 a { color: inherit; text-decoration: none; }
.cat-grid { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.cat-chip { display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px; border: 1px solid var(--border); border-radius: 99px; background: var(--surface); color: var(--text); text-decoration: none; font-weight: 600; }
.cat-chip:hover { border-color: var(--accent); color: var(--text); }
.cat-chip svg { color: var(--accent); }
