/* ==========================================================
   English Texts Analysis — design system
   Concept: ink on warm paper + highlighter marker
   ========================================================== */
@font-face { font-family: 'Fraunces'; src: url('fonts/fraunces.woff2') format('woff2'); font-weight: 100 900; font-display: swap; }
@font-face { font-family: 'Manrope'; src: url('fonts/manrope-400.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Manrope'; src: url('fonts/manrope-500.woff2') format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Manrope'; src: url('fonts/manrope-600.woff2') format('woff2'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Manrope'; src: url('fonts/manrope-700.woff2') format('woff2'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'JetBrains Mono'; src: url('fonts/jetbrains-mono-500.woff2') format('woff2'); font-weight: 500; font-display: swap; }
:root {
  --paper: #f5f1e8;
  --surface: #fffdf8;
  --surface-2: #f0ebdf;
  --surface-3: #e8e1d2;
  --ink: #18223a;
  --ink-2: #414b62;
  --muted: #747c8f;
  --line: #e2dac9;
  --line-2: #d3c9b4;

  --mark: #ffd84a;          /* highlighter */
  --mark-soft: #fff1b3;
  --primary: #1f2d55;       /* ink blue */
  --primary-hover: #2b3d70;
  --on-primary: #fffdf8;
  --accent: #e0592a;        /* terracotta */
  --success: #23794a;
  --success-soft: #dff1e5;
  --danger: #b9382a;
  --danger-soft: #fbe4df;
  --info-soft: #e3e9f8;

  /* POS groups */
  --g-noun: #2f6fdb;  --g-noun-bg: #e2ecfd;
  --g-verb: #c4412d;  --g-verb-bg: #fbe5df;
  --g-adj:  #26825a;  --g-adj-bg:  #dcf1e5;
  --g-adv:  #7a4bc4;  --g-adv-bg:  #ece3fa;
  --g-pron: #0f7d86;  --g-pron-bg: #d9f1f2;
  --g-func: #6b6f7c;  --g-func-bg: #eceae4;
  --g-multi:#9a6a00;  --g-multi-bg:#fff0b8;

  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 0 rgba(24, 34, 58, .04), 0 10px 30px -14px rgba(24, 34, 58, .22);
  --shadow-lg: 0 24px 60px -20px rgba(24, 34, 58, .35);
  --font: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-display: 'Fraunces', Georgia, serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;
  --topbar-h: 64px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #141821; --surface: #1b2130; --surface-2: #222a3b; --surface-3: #2b3447;
    --ink: #ece7dc; --ink-2: #c3c6cf; --muted: #8f95a3; --line: #2c3446; --line-2: #3a4458;
    --primary: #ffd84a; --primary-hover: #ffe27a; --on-primary: #1a1d26;
    --mark-soft: #4a4020; --success-soft: #173326; --danger-soft: #3d1f1b; --info-soft: #222d47;
    --g-noun-bg:#1d2c4a; --g-verb-bg:#3d221d; --g-adj-bg:#173327; --g-adv-bg:#2c2242;
    --g-pron-bg:#123336; --g-func-bg:#2a2d35; --g-multi-bg:#3d3418;
    --g-noun:#8db4ff; --g-verb:#ff9b85; --g-adj:#79d4a3; --g-adv:#c3a2ff; --g-pron:#6fd6dd; --g-func:#b4b8c3; --g-multi:#ffd84a;
    --shadow: 0 1px 0 rgba(0,0,0,.2), 0 10px 30px -14px rgba(0,0,0,.6);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #141821; --surface: #1b2130; --surface-2: #222a3b; --surface-3: #2b3447;
  --ink: #ece7dc; --ink-2: #c3c6cf; --muted: #8f95a3; --line: #2c3446; --line-2: #3a4458;
  --primary: #ffd84a; --primary-hover: #ffe27a; --on-primary: #1a1d26;
  --mark-soft: #4a4020; --success-soft: #173326; --danger-soft: #3d1f1b; --info-soft: #222d47;
  --g-noun-bg:#1d2c4a; --g-verb-bg:#3d221d; --g-adj-bg:#173327; --g-adv-bg:#2c2242;
  --g-pron-bg:#123336; --g-func-bg:#2a2d35; --g-multi-bg:#3d3418;
  --g-noun:#8db4ff; --g-verb:#ff9b85; --g-adj:#79d4a3; --g-adv:#c3a2ff; --g-pron:#6fd6dd; --g-func:#b4b8c3; --g-multi:#ffd84a;
  --shadow: 0 1px 0 rgba(0,0,0,.2), 0 10px 30px -14px rgba(0,0,0,.6);
  color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  font-family: var(--font); font-size: 15.5px; line-height: 1.55;
  color: var(--ink); background: var(--paper);
  background-image: radial-gradient(circle at 1px 1px, rgba(120, 100, 60, .07) 1px, transparent 0);
  background-size: 22px 22px;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 650; letter-spacing: -.01em; line-height: 1.15; margin: 0; }
h1 { font-size: clamp(1.55rem, 1.1rem + 1.8vw, 2.25rem); }
h2 { font-size: 1.3rem; }
h3 { font-size: 1.05rem; font-family: var(--font); font-weight: 700; letter-spacing: 0; }
p { margin: 0 0 .8em; }
small { color: var(--muted); }
code, .mono { font-family: var(--font-mono); font-size: .86em; }
.ico { width: 1.15em; height: 1.15em; flex: none; }
.only-dark { display: none; }
:root[data-theme="dark"] .only-dark { display: inline; } :root[data-theme="dark"] .only-light { display: none; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .only-dark { display: inline; } :root:not([data-theme="light"]) .only-light { display: none; } }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: -999px; top: 8px; background: var(--primary); color: var(--on-primary); padding: 8px 14px; border-radius: 8px; z-index: 100; }
.skip-link:focus { left: 8px; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--mark) 80%, transparent); outline-offset: 2px; border-radius: 6px; }
.mark { background: linear-gradient(transparent 55%, var(--mark) 55%, var(--mark) 92%, transparent 92%); padding: 0 .1em; color: inherit; }
:root[data-theme="dark"] .mark { color: var(--ink); background: linear-gradient(transparent 55%, color-mix(in srgb, var(--mark) 45%, transparent) 55%); }
.muted { color: var(--muted); }
.hide-sm { }
@media (max-width: 640px) { .hide-sm { display: none !important; } }

/* ---------- Top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 40; height: var(--topbar-h);
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner { max-width: 1240px; margin: 0 auto; height: 100%; padding: 0 16px; display: flex; align-items: center; gap: 12px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; min-width: 0; }
.brand-mark {
  width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; flex: none;
  font-family: var(--font-display); font-weight: 650; font-size: 1.05rem; color: var(--ink);
  background: var(--mark); box-shadow: inset 0 -3px 0 rgba(0,0,0,.08); transform: rotate(-4deg);
}
.brand-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.15; }
.brand-name { font-family: var(--font-display); font-weight: 650; font-size: 1.02rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-sub { font-size: .72rem; color: var(--muted); white-space: nowrap; }
.mainnav { display: none; align-items: center; gap: 2px; margin-left: 12px; }
.mainnav-link { display: flex; align-items: center; gap: 7px; padding: 8px 11px; border-radius: 10px; text-decoration: none; color: var(--ink-2); font-weight: 600; font-size: .9rem; white-space: nowrap; }
.mainnav-link:hover { background: var(--surface-2); color: var(--ink); }
.mainnav-link.is-active { background: var(--surface); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line), 0 2px 0 -1px var(--mark) inset; }
.mainnav-link.is-active .ico { color: var(--accent); }
.mainnav-sep { width: 1px; height: 22px; background: var(--line-2); margin: 0 6px; }
.topbar-tools { margin-left: auto; display: flex; align-items: center; gap: 6px; }
@media (min-width: 1120px) { .mainnav { display: flex; } .nav-toggle { display: none !important; } }
@media (max-width: 520px) { .brand-sub { display: none; } .topbar-tools .lang-switch { display: none; } }

.lang-switch { display: inline-flex; padding: 3px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); }
.lang-opt { padding: 3px 9px; border-radius: 999px; font-size: .75rem; font-weight: 700; letter-spacing: .04em; text-decoration: none; color: var(--muted); }
.lang-opt.is-active { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.12); }

.btn-icon { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 11px; border: 0; background: transparent; color: var(--ink-2); cursor: pointer; }
.btn-icon:hover { background: var(--surface-2); color: var(--ink); }
.btn-icon .ico { width: 20px; height: 20px; }
.btn-icon.btn-sm { width: 30px; height: 30px; border-radius: 8px; }
.btn-icon.btn-sm .ico { width: 16px; height: 16px; }

.usermenu { position: relative; }
.avatar { width: 38px; height: 38px; border-radius: 50%; border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--line-2); background: var(--primary); color: var(--on-primary); font-weight: 700; cursor: pointer; overflow: hidden; padding: 0; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.pop { position: absolute; right: 0; top: calc(100% + 8px); min-width: 230px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 6px; z-index: 50; }
.pop-head { padding: 10px 12px 8px; display: flex; flex-direction: column; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.pop a, .pop button.pop-item { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 9px; text-decoration: none; font-weight: 600; font-size: .92rem; color: var(--ink-2); width: 100%; background: none; border: 0; cursor: pointer; font-family: inherit; text-align: left; }
.pop a:hover, .pop button.pop-item:hover { background: var(--surface-2); color: var(--ink); }
.pop .is-danger { color: var(--danger); }

/* Drawer */
.drawer-backdrop { position: fixed; inset: 0; background: rgba(15, 18, 28, .45); z-index: 60; }
.drawer { position: fixed; top: 0; bottom: 0; left: 0; width: min(320px, 86vw); background: var(--surface); z-index: 61; padding: 14px; overflow-y: auto; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; gap: 2px; animation: slideIn .22s ease; }
@keyframes slideIn { from { transform: translateX(-100%); } }
.drawer-head { display: flex; align-items: center; gap: 10px; padding: 4px 4px 12px; }
.drawer-head .btn-icon { margin-left: auto; }
.drawer-group { font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 14px 12px 6px; }
.drawer-link { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 10px; text-decoration: none; font-weight: 600; color: var(--ink-2); }
.drawer-link:hover { background: var(--surface-2); }
.drawer-link.is-active { background: var(--mark-soft); color: var(--ink); }
.drawer-link.is-danger { color: var(--danger); margin-top: 8px; }
.drawer-foot { margin-top: auto; padding: 16px 8px 4px; }

/* ---------- Layout ---------- */
.main { flex: 1; width: 100%; max-width: 1240px; margin: 0 auto; padding: 24px 16px 40px; }
.main-bare { flex: 1; width: 100%; }
@media (min-width: 768px) { .main { padding: 34px 24px 56px; } }
.narrow { max-width: 860px; margin-left: auto; margin-right: auto; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.page-head-text { display: flex; gap: 14px; align-items: flex-start; }
.page-icon { width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center; background: var(--surface); border: 1px solid var(--line); color: var(--accent); flex: none; box-shadow: var(--shadow); }
.page-icon .ico { width: 22px; height: 22px; }
.lead { color: var(--ink-2); margin: 6px 0 0; max-width: 62ch; }
.page-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.grid { display: grid; gap: 18px; }
.grid-2 { display: grid; gap: 18px; }
@media (min-width: 900px) { .grid-2 { grid-template-columns: 1fr 1fr; } .grid-main-side { grid-template-columns: minmax(0, 1.6fr) minmax(280px, 1fr); } }
.stack { display: flex; flex-direction: column; gap: 14px; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.spacer { flex: 1; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }
@media (min-width: 768px) { .card { padding: 26px; } }
.card-title { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.card-title .ico { color: var(--accent); }
.card-flat { box-shadow: none; }
.section-label { font-size: .74rem; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); margin: 0 0 10px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 42px; padding: 0 18px; border-radius: 11px; border: 1px solid transparent;
  font: 700 .92rem/1 var(--font); text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background .15s, transform .08s, box-shadow .15s, border-color .15s;
}
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: var(--on-primary); box-shadow: 0 6px 16px -8px color-mix(in srgb, var(--primary) 80%, transparent); }
.btn-primary:hover { background: var(--primary-hover); }
.btn-mark { background: var(--mark); color: #1a1d26; }
.btn-mark:hover { filter: brightness(1.04); }
.btn-soft { background: var(--surface-2); color: var(--ink); border-color: var(--line); }
.btn-soft:hover { background: var(--surface-3); }
.btn-ghost { background: transparent; color: var(--ink-2); border-color: var(--line-2); }
.btn-ghost:hover { background: var(--surface-2); color: var(--ink); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { filter: brightness(1.08); }
.btn-sm { min-height: 34px; padding: 0 12px; font-size: .84rem; border-radius: 9px; }
.btn-lg { min-height: 50px; padding: 0 26px; font-size: 1rem; border-radius: 13px; }
.btn-block { width: 100%; }
.btn .ico { width: 18px; height: 18px; }
@media (max-width: 480px) { .btn-collapse span { display: none; } .btn-collapse { padding: 0 12px; } }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field-inline { margin-bottom: 0; }
.field-row { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.label { font-weight: 700; font-size: .92rem; }
.label-sm { font-weight: 700; font-size: .78rem; color: var(--ink-2); display: flex; justify-content: space-between; gap: 8px; }
.label-sm output { color: var(--muted); font-family: var(--font-mono); font-size: .9em; }
.hint { font-size: .82rem; color: var(--muted); }
.input, .textarea, .select {
  width: 100%; font: 500 .96rem/1.45 var(--font); color: var(--ink);
  background: var(--paper); border: 1px solid var(--line-2); border-radius: var(--radius-sm);
  padding: 11px 13px; transition: border-color .15s, box-shadow .15s, background .15s;
}
.input:focus, .textarea:focus, .select:focus { outline: none; border-color: var(--primary); background: var(--surface); box-shadow: 0 0 0 4px color-mix(in srgb, var(--mark) 40%, transparent); }
.textarea { resize: vertical; min-height: 120px; }
.textarea-lg { min-height: 220px; font-size: 1rem; line-height: 1.6; }
.select { appearance: none; padding-right: 36px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23747c8f' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; background-size: 16px; }
.select-sm, .input-sm { padding: 7px 11px; font-size: .88rem; }
.select-sm { padding-right: 32px; }
.counter { font-size: .8rem; color: var(--muted); font-family: var(--font-mono); }
.input-icon { position: relative; }
.input-icon .ico { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.input-icon .input { padding-left: 38px; }
.input-icon .btn-icon { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); }

.or-sep { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; margin: 4px 0 14px; }
.or-sep::before, .or-sep::after { content: ""; height: 1px; background: var(--line); flex: 1; }

.dropzone { position: relative; display: flex; align-items: center; gap: 14px; padding: 16px 18px; border: 1.5px dashed var(--line-2); border-radius: var(--radius); background: var(--paper); cursor: pointer; transition: border-color .15s, background .15s; margin-bottom: 18px; }
.dropzone:hover, .dropzone.is-over { border-color: var(--primary); background: var(--mark-soft); }
.dropzone input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.dropzone-icon { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--surface); border: 1px solid var(--line); color: var(--accent); flex: none; }
.dropzone-text { display: flex; flex-direction: column; }
.dropzone-file { position: relative; z-index: 2; margin-left: auto; display: flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--line); padding: 4px 4px 4px 10px; border-radius: 9px; font-weight: 600; font-size: .86rem; max-width: 55%; }
.dropzone-file span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dropzone.has-file .dropzone-text { display: none; }
.dropzone.has-file .dropzone-file { margin-left: 0; max-width: 100%; }

/* Switch */
.switch { display: flex; align-items: center; gap: 12px; cursor: pointer; padding: 10px 0; }
.switch input { appearance: none; width: 42px; height: 24px; border-radius: 999px; background: var(--line-2); position: relative; cursor: pointer; transition: background .15s; flex: none; margin: 0; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .18s; }
.switch input:checked { background: var(--success); }
.switch input:checked::after { transform: translateX(18px); }
.switch-text { display: flex; flex-direction: column; line-height: 1.3; }
.switch-text small { font-size: .8rem; }

.checkbox { width: 18px; height: 18px; accent-color: var(--primary); cursor: pointer; }

.range { width: 100%; accent-color: var(--primary); height: 28px; }

/* Segmented */
.seg { display: inline-flex; padding: 3px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; gap: 2px; }
.seg a, .seg button { display: inline-flex; align-items: center; gap: 7px; padding: 7px 13px; border-radius: 9px; border: 0; background: none; font: 700 .86rem var(--font); color: var(--ink-2); text-decoration: none; cursor: pointer; white-space: nowrap; }
.seg .is-active { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.1); }
.seg .ico { width: 16px; height: 16px; }
.seg .count { font-family: var(--font-mono); font-size: .76rem; color: var(--muted); }

/* ---------- Flash / toast ---------- */
.flash-stack { display: flex; flex-direction: column; gap: 8px; margin-bottom: 18px; }
.flash { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 11px; font-weight: 600; font-size: .93rem; }
.flash .ico { margin-top: 2px; }
.flash-success { background: var(--success-soft); color: var(--success); }
.flash-error { background: var(--danger-soft); color: var(--danger); }
.flash-info { background: var(--info-soft); color: var(--ink); }
.toast-stack { position: fixed; z-index: 90; bottom: 18px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; align-items: center; width: min(92vw, 440px); pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 10px; padding: 11px 16px; border-radius: 12px; background: var(--ink); color: var(--paper); box-shadow: var(--shadow-lg); font-weight: 600; font-size: .92rem; animation: toastIn .25s ease; }
.toast.is-error { background: var(--danger); color: #fff; }
.toast.is-out { opacity: 0; transform: translateY(8px); transition: .25s; }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px); } }

/* ---------- Modal / overlay ---------- */
.modal { border: 0; border-radius: 18px; padding: 0; background: var(--surface); color: var(--ink); box-shadow: var(--shadow-lg); width: min(92vw, 440px); }
.modal::backdrop { background: rgba(15, 18, 28, .5); backdrop-filter: blur(2px); }
.modal form { padding: 22px; }
.modal-lg { width: min(94vw, 640px); }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.modal-msg { font-weight: 600; font-size: 1.02rem; margin: 0 0 20px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.overlay { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; background: rgba(20, 24, 33, .55); backdrop-filter: blur(3px); }
.overlay[hidden] { display: none; }
.overlay-card { background: var(--surface); border-radius: 20px; padding: 30px 34px; text-align: center; box-shadow: var(--shadow-lg); width: min(90vw, 360px); }
.overlay-title { font-family: var(--font-display); font-size: 1.3rem; font-weight: 650; margin: 16px 0 4px; }
.overlay-hint { color: var(--muted); font-size: .88rem; margin-bottom: 18px; }
.loader { display: inline-flex; gap: 7px; }
.loader span { width: 12px; height: 26px; border-radius: 4px; background: var(--mark); animation: bounce 1s infinite ease-in-out; }
.loader span:nth-child(2) { animation-delay: .15s; background: var(--accent); }
.loader span:nth-child(3) { animation-delay: .3s; background: var(--primary); }
@keyframes bounce { 0%, 100% { transform: scaleY(.45); } 50% { transform: scaleY(1); } }

/* ---------- Chips / badges ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: .86rem; font-weight: 600; background: var(--surface-2); border: 1px solid var(--line); color: var(--ink); cursor: default; line-height: 1.4; }
button.chip { cursor: pointer; font-family: inherit; }
button.chip:hover { border-color: var(--line-2); background: var(--surface-3); }
.chip .ico { width: 14px; height: 14px; }
.badge { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 6px; font: 600 .72rem var(--font-mono); background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line); letter-spacing: .02em; }
.badge-mark { background: var(--mark-soft); border-color: transparent; color: var(--ink); }
[data-g="noun"]  { --gc: var(--g-noun);  --gb: var(--g-noun-bg); }
[data-g="verb"]  { --gc: var(--g-verb);  --gb: var(--g-verb-bg); }
[data-g="adj"]   { --gc: var(--g-adj);   --gb: var(--g-adj-bg); }
[data-g="adv"]   { --gc: var(--g-adv);   --gb: var(--g-adv-bg); }
[data-g="pron"]  { --gc: var(--g-pron);  --gb: var(--g-pron-bg); }
[data-g="func"]  { --gc: var(--g-func);  --gb: var(--g-func-bg); }
[data-g="multi"] { --gc: var(--g-multi); --gb: var(--g-multi-bg); }
.badge[data-g], .chip[data-g] { background: var(--gb); color: var(--gc); border-color: color-mix(in srgb, var(--gc) 25%, transparent); }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.table { width: 100%; border-collapse: collapse; font-size: .93rem; }
.table th { text-align: left; font-size: .74rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); padding: 12px 14px; background: var(--surface-2); border-bottom: 1px solid var(--line); white-space: nowrap; }
.table th a { text-decoration: none; display: inline-flex; align-items: center; gap: 4px; }
.table th a:hover { color: var(--ink); }
.table th .sort { font-size: .9em; color: var(--accent); }
.table td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: color-mix(in srgb, var(--mark-soft) 45%, transparent); }
.table .num { text-align: right; font-family: var(--font-mono); font-size: .86rem; white-space: nowrap; }
.table .rank { color: var(--muted); font-family: var(--font-mono); font-size: .82rem; width: 1%; }
.table .actions { text-align: right; white-space: nowrap; width: 1%; }
.table .word { font-weight: 700; }
.table .check { width: 1%; }
@media (max-width: 680px) {
  .table-cards thead { display: none; }
  .table-cards, .table-cards tbody, .table-cards tr, .table-cards td { display: block; width: 100%; }
  .table-cards tr { padding: 12px 14px; border-bottom: 1px solid var(--line); position: relative; }
  .table-cards tr:last-child { border-bottom: 0; }
  .table-cards td { border: 0; padding: 3px 0; text-align: left !important; }
  .table-cards td[data-label]::before { content: attr(data-label); display: block; font-size: .7rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
  .table-cards td.actions { position: absolute; right: 8px; top: 8px; width: auto; }
  .table-cards td.check { position: absolute; left: 14px; top: 14px; width: auto; }
  .table-cards tr.has-check { padding-left: 46px; }
  .table-cards td.rank { display: none; }
}

.bar { height: 6px; border-radius: 99px; background: var(--surface-3); overflow: hidden; min-width: 60px; }
.bar > span { display: block; height: 100%; background: linear-gradient(90deg, var(--mark), var(--accent)); border-radius: 99px; }

/* ---------- Pager ---------- */
.pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 4px; margin-top: 18px; }
.pager-btn { min-width: 38px; height: 38px; padding: 0 10px; display: inline-flex; align-items: center; justify-content: center; border-radius: 10px; text-decoration: none; font-weight: 700; font-size: .9rem; color: var(--ink-2); border: 1px solid transparent; background: none; cursor: pointer; font-family: inherit; }
.pager-btn:hover { background: var(--surface); border-color: var(--line); }
.pager-btn.is-current { background: var(--primary); color: var(--on-primary); }
.pager-btn.is-disabled { opacity: .3; pointer-events: none; }
.pager-gap { color: var(--muted); padding: 0 4px; }
@media (max-width: 420px) { .pager-btn { min-width: 34px; height: 34px; } }

/* ---------- Stats ---------- */
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 18px; }
@media (min-width: 760px) { .stats { grid-template-columns: repeat(4, 1fr); } }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.stat-label { font-size: .74rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.stat-value { font-family: var(--font-display); font-size: 1.75rem; font-weight: 650; line-height: 1.2; }

/* ---------- Toolbar ---------- */
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px; }
.toolbar .input-icon { flex: 1 1 220px; max-width: 380px; }
.toolbar .seg { overflow-x: auto; max-width: 100%; }
.empty { text-align: center; padding: 46px 20px; color: var(--muted); }
.empty .ico { width: 40px; height: 40px; color: var(--line-2); margin-bottom: 8px; }

/* ---------- Menu dashboard ---------- */
.hello { margin-bottom: 26px; }
.hello h1 { font-size: clamp(1.8rem, 1.2rem + 2.4vw, 2.8rem); }
.tiles { display: grid; gap: 14px; grid-template-columns: 1fr; margin-bottom: 30px; }
@media (min-width: 620px) { .tiles { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 980px) { .tiles { grid-template-columns: repeat(3, 1fr); } }
.tile { position: relative; display: flex; flex-direction: column; gap: 10px; padding: 20px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); text-decoration: none; box-shadow: var(--shadow); transition: transform .15s, box-shadow .15s, border-color .15s; overflow: hidden; }
.tile:hover { transform: translateY(-3px); border-color: var(--line-2); box-shadow: var(--shadow-lg); }
.tile-top { display: flex; align-items: center; justify-content: space-between; }
.tile-icon { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; background: var(--mark-soft); color: var(--ink); }
.tile-icon .ico { width: 22px; height: 22px; }
.tile-num { font-family: var(--font-mono); font-size: .8rem; color: var(--muted); }
.tile h3 { font-size: 1.08rem; }
.tile p { margin: 0; color: var(--ink-2); font-size: .9rem; }
.tile-meta { margin-top: auto; padding-top: 6px; font-size: .82rem; font-weight: 700; color: var(--accent); display: flex; align-items: center; gap: 6px; }
.tile-lib .tile-icon { background: var(--info-soft); }
.tile-acc .tile-icon { background: var(--surface-2); }
.tile-danger .tile-icon { background: var(--danger-soft); color: var(--danger); }

/* ---------- Login ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1fr; }
@media (min-width: 940px) { .auth { grid-template-columns: 1.05fr 1fr; } }
.auth-aside { display: none; position: relative; padding: 48px; background: var(--primary); color: #f7f2e6; overflow: hidden; }
:root[data-theme="dark"] .auth-aside { background: #1f2a47; }
@media (min-width: 940px) { .auth-aside { display: flex; flex-direction: column; } }
.auth-aside .brand-name { font-size: 1.2rem; }
.auth-aside .brand-sub { color: rgba(247, 242, 230, .6); }
.auth-aside .auth-quote { margin-top: auto; font-family: var(--font-display); font-size: clamp(2rem, 1.3rem + 2vw, 3.1rem); line-height: 1.12; max-width: 14ch; }
.auth-quote .mark { color: #18223a; background: var(--mark); padding: 0 .12em; border-radius: 6px; box-decoration-break: clone; -webkit-box-decoration-break: clone; }
.auth-aside p { color: rgba(247, 242, 230, .75); max-width: 42ch; margin-top: 20px; }
.auth-words { position: absolute; right: -30px; top: 130px; display: flex; flex-direction: column; gap: 12px; opacity: .14; font-family: var(--font-display); font-size: 3rem; transform: rotate(-8deg); pointer-events: none; }
.auth-main { display: flex; flex-direction: column; padding: 20px; }
.auth-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.auth-box { width: 100%; max-width: 420px; margin: auto; padding: 30px 0; }
.auth-box h1 { margin-bottom: 6px; }
.auth-box .lead { margin-bottom: 24px; }
.auth-links { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; margin-top: 18px; font-size: .9rem; }
.auth-links a { color: var(--ink-2); font-weight: 600; text-decoration-color: var(--mark); text-decoration-thickness: 2px; text-underline-offset: 3px; }

/* ---------- Speech panel ---------- */
.speech { display: flex; flex-direction: column; gap: 14px; }
.speech-settings { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 560px) { .speech-settings { grid-template-columns: 1.4fr 1fr 1fr; align-items: end; } .speech-compact .speech-settings { grid-template-columns: 1.4fr 1fr; } }
.speech-buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.speech.is-speaking [data-speak-all] { box-shadow: 0 0 0 4px color-mix(in srgb, var(--mark) 50%, transparent); }
.speak-btn { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; border: 0; background: none; color: var(--muted); cursor: pointer; }
.speak-btn:hover { background: var(--mark-soft); color: var(--ink); }
.speak-btn .ico { width: 16px; height: 16px; }

/* Reader (text-to-speech & highlighted text) */
.reader { font-size: 1.12rem; line-height: 1.85; padding: 18px 20px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); min-height: 220px; max-height: 60vh; overflow-y: auto; white-space: pre-wrap; }
.reader .s { border-radius: 4px; cursor: pointer; transition: background .2s; }
.reader .s:hover { background: var(--surface-3); }
.reader .s.is-reading { background: var(--mark); color: #1a1d26; box-shadow: 0 0 0 3px var(--mark); }
.reader-hint { font-size: .82rem; color: var(--muted); margin-top: 8px; }

/* ---------- POS ---------- */
.pos-groups { display: grid; gap: 16px; }
@media (min-width: 720px) { .pos-groups { grid-template-columns: repeat(2, 1fr); } }
.pos-group-title { display: flex; align-items: center; gap: 8px; font-size: .76rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.pos-group-title::before { content: ""; width: 10px; height: 10px; border-radius: 3px; background: var(--gc); }
.pos-opt { display: inline-flex; align-items: center; gap: 7px; margin: 0 6px 6px 0; padding: 6px 11px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--paper); cursor: pointer; font-size: .88rem; font-weight: 600; user-select: none; transition: .12s; }
.pos-opt input { position: absolute; opacity: 0; pointer-events: none; }
.pos-opt code { color: var(--muted); font-size: .76rem; }
.pos-opt:has(input:checked) { background: var(--gb); border-color: var(--gc); color: var(--gc); }
.pos-opt:has(input:checked) code { color: var(--gc); }
.pos-opt:has(input:focus-visible) { outline: 3px solid var(--mark); }
.pos-opt.is-locked { opacity: .45; cursor: not-allowed; }
.pos-counter { font-family: var(--font-mono); font-size: .85rem; padding: 4px 10px; border-radius: 99px; background: var(--surface-2); }
.pos-counter.is-full { background: var(--mark); color: #1a1d26; }

.pos-cards { display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 700px) { .pos-cards { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1080px) { .pos-cards { grid-template-columns: repeat(3, 1fr); } }
.pos-card { background: var(--surface); border: 1px solid var(--line); border-top: 4px solid var(--gc); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.pos-card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.pos-card-head h3 { font-size: .98rem; }
.pos-card .chip { background: var(--gb); border-color: transparent; color: var(--ink); }
.pos-card .chip:hover { box-shadow: inset 0 0 0 1px var(--gc); }
.pos-card.is-wide { grid-column: 1 / -1; }
.ctx { display: block; padding: 8px 12px; border-left: 3px solid var(--mark); background: var(--paper); border-radius: 0 8px 8px 0; margin-bottom: 6px; font-size: .92rem; cursor: pointer; }
.ctx b { background: var(--mark-soft); padding: 0 3px; border-radius: 3px; }
.legend { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.legend button { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface); font: 600 .82rem var(--font); cursor: pointer; color: var(--ink-2); }
.legend button::before { content: ""; width: 9px; height: 9px; border-radius: 3px; background: var(--gc); }
.legend button[aria-pressed="false"] { opacity: .45; }
.hl-text { font-size: 1.08rem; line-height: 2.1; }
.hl-text .w[data-g] { padding: 1px 2px; border-radius: 4px; background: var(--gb); box-shadow: inset 0 -2px 0 var(--gc); cursor: help; }
.hl-text.off-noun .w[data-g="noun"], .hl-text.off-verb .w[data-g="verb"], .hl-text.off-adj .w[data-g="adj"],
.hl-text.off-adv .w[data-g="adv"], .hl-text.off-pron .w[data-g="pron"], .hl-text.off-func .w[data-g="func"],
.hl-text.off-multi .w[data-g="multi"] { background: none; box-shadow: none; }
.pos-table { font-size: .88rem; }
.pos-table th { text-transform: none; letter-spacing: 0; font-family: var(--font-mono); color: var(--gc, var(--muted)); border-top: 3px solid var(--gc, transparent); }
.pos-table td { white-space: nowrap; }

/* ---------- Lexicon management ---------- */
.lex-form { display: grid; gap: 12px; }
@media (min-width: 760px) { .lex-form-2 { grid-template-columns: 1fr 1fr; } }
.forms-preview { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 12px; }
.forms-preview label { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 999px; background: var(--mark-soft); font-weight: 600; font-size: .88rem; cursor: pointer; }
.forms-preview label small { font-size: .72rem; }
.bulkbar { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 12px; background: var(--ink); color: var(--paper); margin-bottom: 12px; font-weight: 600; }
.bulkbar[hidden] { display: none; }
.cell-sub { display: block; font-size: .86rem; color: var(--ink-2); font-weight: 500; }
.cell-es { display: block; font-size: .86rem; color: var(--muted); font-style: italic; }
.details { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.details summary { cursor: pointer; padding: 14px 18px; font-weight: 700; list-style: none; display: flex; align-items: center; gap: 10px; }
.details summary::-webkit-details-marker { display: none; }
.details[open] summary { border-bottom: 1px solid var(--line); }
.details-body { padding: 16px 18px; }

/* ---------- Footer ---------- */
.footer { text-align: center; padding: 22px 16px 30px; font-size: .84rem; color: var(--muted); }
.footer p { margin: 0; }
.footer a { color: var(--ink-2); }
.whatsapp { position: fixed; right: 18px; bottom: 18px; z-index: 30; width: 52px; height: 52px; border-radius: 50%; background: #25d366; color: #fff; display: grid; place-items: center; box-shadow: 0 10px 24px -8px rgba(37, 211, 102, .6); transition: transform .15s; }
.whatsapp:hover { transform: scale(1.06); }
.whatsapp svg { width: 28px; height: 28px; }

/* Sticky action bar on mobile for long forms */
.form-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 8px; }
@media (max-width: 640px) {
  .form-actions.sticky { position: sticky; bottom: 0; margin: 12px -20px -20px; padding: 12px 20px calc(12px + env(safe-area-inset-bottom)); background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(8px); border-top: 1px solid var(--line); border-radius: 0 0 var(--radius) var(--radius); z-index: 5; }
  .form-actions.sticky .btn-primary { flex: 1; }
  .whatsapp { bottom: 84px; width: 46px; height: 46px; }
}

@media print {
  .topbar, .drawer, .footer, .whatsapp, .page-actions, .toolbar, .pager, .speech { display: none !important; }
  body { background: #fff; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
.input-icon:has(.btn-icon) .input { padding-right: 44px; }
.footer-brand { display: flex; align-items: center; justify-content: center; gap: 8px; margin-bottom: 6px !important; }
.footer-brand img { height: 28px; width: auto; opacity: .9; }
.show-sm { display: none; }
@media (max-width: 680px) { .show-sm { display: inline; } .table-cards td.hide-sm { display: none !important; } .table-cards td.nl { padding: 2px 0; } .table-cards tr { padding-right: 84px; } }

/* Auth pages extras */
.auth-brand-sm { visibility: visible; }
.auth-brand-sm .brand-name { font-size: .98rem; }
@media (min-width: 940px) { .auth-brand-sm { visibility: hidden; } }
.field-error { color: var(--danger); font-size: .84rem; font-weight: 600; }
.input.is-invalid, .is-invalid .input { border-color: var(--danger); }
.pass-rules { list-style: none; padding: 0; margin: 4px 0 0; display: flex; flex-wrap: wrap; gap: 6px; }
.pass-rules li { display: inline-flex; align-items: center; gap: 5px; font-size: .78rem; font-weight: 600; padding: 3px 9px 3px 7px; border-radius: 99px; background: var(--surface-2); color: var(--muted); transition: .15s; }
.pass-rules li .ico { width: 13px; height: 13px; opacity: .35; }
.pass-rules li.ok { background: var(--success-soft); color: var(--success); }
.pass-rules li.ok .ico { opacity: 1; }
.auth-done { text-align: center; }
.auth-done .done-icon { width: 64px; height: 64px; border-radius: 20px; display: grid; place-items: center; margin: 0 auto 18px; background: var(--mark); color: #1a1d26; }
.auth-done .done-icon .ico { width: 30px; height: 30px; }
.form-grid { display: grid; gap: 0 14px; }
@media (min-width: 560px) { .form-grid-2 { grid-template-columns: 1fr 1fr; } }
.auth-box-wide { max-width: 520px; }
/* Admin */
.status { display: inline-flex; align-items: center; gap: 6px; font-size: .8rem; font-weight: 700; padding: 3px 10px; border-radius: 99px; }
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.status-1 { background: var(--success-soft); color: var(--success); }
.status-0 { background: var(--surface-2); color: var(--muted); }
.user-cell { display: flex; align-items: center; gap: 10px; }
.user-cell .avatar { width: 34px; height: 34px; font-size: .85rem; flex: none; cursor: default; }
.profile-head { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; }
.profile-head .avatar { width: 64px; height: 64px; font-size: 1.5rem; cursor: default; }
span.avatar { display: inline-grid; place-items: center; }
.auth-top > .row { flex-wrap: nowrap; }
@media (max-width: 420px) { .auth-brand-sm .brand-name { display: none; } }
/* Stopword groups */
.sg-profiles { margin-bottom: 4px; flex-wrap: wrap; }
.sg-custom { display: none; padding: 7px 13px; font-weight: 700; font-size: .86rem; color: var(--accent); }
.sg-custom.is-active { display: inline-flex; }
.sg-hint { margin: 10px 0 6px; }
.sg-list { display: flex; flex-direction: column; gap: 2px; }
.sg-opt { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 9px; cursor: pointer; }
.sg-opt:hover { background: var(--surface-2); }
.sg-name { display: flex; flex-direction: column; line-height: 1.25; font-weight: 600; font-size: .9rem; flex: 1; min-width: 0; }
.sg-name small { font-weight: 500; font-size: .74rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sg-occ { font-size: .78rem; color: var(--muted); background: var(--surface-2); padding: 1px 8px; border-radius: 99px; }
.sg-opt:has(input:checked) .sg-name { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--accent); }
.sg-note { display: flex; gap: 6px; align-items: flex-start; margin: 10px 0 0; font-size: .78rem; }
.sg-note .ico { width: 15px; height: 15px; margin-top: 1px; flex: none; }
.row-excluded .word { text-decoration: line-through; text-decoration-color: var(--accent); color: var(--muted); }
.lex-tabs { flex-wrap: wrap; max-width: 100%; }
.is-dimmed textarea { opacity: .45; }
.file-wins { margin: 8px 0 0; }
/* Help */
.help-q { font-family: var(--font-display); font-weight: 650; font-size: 1.1rem; line-height: 1; }
.btn-icon.is-active { background: var(--mark-soft); color: var(--ink); }
.help { display: grid; gap: 18px; align-items: start; }
@media (min-width: 960px) { .help { grid-template-columns: 250px minmax(0, 1fr); } .help-toc { position: sticky; top: calc(var(--topbar-h) + 16px); } }
.help-toc { padding: 14px; display: flex; flex-direction: column; gap: 2px; }
.help-toc a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 9px; text-decoration: none; font-weight: 600; font-size: .9rem; color: var(--ink-2); }
.help-toc a:hover { background: var(--surface-2); color: var(--ink); }
.help-toc a .ico { color: var(--accent); }
.help-body { display: flex; flex-direction: column; gap: 18px; }
.help-section { scroll-margin-top: calc(var(--topbar-h) + 16px); }
.help-section h3 { margin: 18px 0 6px; font-size: 1rem; }
.help-section p, .help-section li { color: var(--ink-2); max-width: 75ch; }
.help-section ul, .help-section ol { padding-left: 20px; margin: 0 0 10px; }
.help-section li { margin-bottom: 5px; }
.help-section .tip { background: var(--mark-soft); color: var(--ink); padding: 10px 14px; border-radius: 10px; margin-top: 12px; }
.help-section details { border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; margin-bottom: 8px; background: var(--paper); }
.help-section summary { cursor: pointer; font-weight: 700; }
.help-section details p { margin: 8px 0 0; }
kbd { font-family: var(--font-mono); font-size: .8em; padding: 1px 6px; border-radius: 5px; border: 1px solid var(--line-2); border-bottom-width: 2px; background: var(--surface); }
:target.help-section { box-shadow: 0 0 0 3px var(--mark), var(--shadow); }
/* TextRazor usage */
.usage { display: flex; flex-direction: column; gap: 6px; }
.usage-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.usage-top strong { font-size: 1.05rem; }
.usage-warn .bar > span { background: linear-gradient(90deg, var(--mark), #e08a00); }
.usage-danger .bar > span { background: var(--danger); }
.usage-danger .usage-top strong { color: var(--danger); }
.usage-link { font-size: .82rem; font-weight: 700; color: var(--accent); }
.days { display: grid; grid-template-columns: repeat(30, minmax(0, 1fr)); gap: 3px; height: 200px; align-items: end; }
.day { position: relative; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; }
.day-bar { width: 100%; max-width: 22px; background: linear-gradient(180deg, var(--accent), var(--mark)); border-radius: 4px 4px 0 0; min-height: 0; }
.day.is-today .day-bar { background: var(--primary); }
.day-n { position: absolute; font-size: .62rem; font-family: var(--font-mono); color: var(--muted); bottom: calc(100% - 0px); display: none; }
.day:hover .day-n { display: block; top: -2px; bottom: auto; }
.day-d { font-size: .62rem; font-family: var(--font-mono); color: var(--muted); margin-top: 4px; height: 12px; }
@media (max-width: 640px) { .day-d { visibility: hidden; } .day:nth-child(5n) .day-d, .day.is-today .day-d { visibility: visible; } }
