/* Versa portal - design tokens, layout and components. No build step. */

:root {
  color-scheme: light;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Code", Consolas, monospace;

  --bg: #f5f6f8;
  --surface: #ffffff;
  --surface-2: #f8f9fb;
  --surface-3: #eef0f4;
  --border: #e3e6eb;
  --border-strong: #cfd4dc;
  --text: #121620;
  --text-2: #4a5263;
  --text-3: #7a8293;
  --brand: #2453d4;
  --brand-hover: #1d45b3;
  --brand-soft: #e8eefc;
  --brand-ink: #ffffff;
  --focus: #2453d4;
  --danger: #c42f2f;
  --danger-soft: #fdecec;
  --warn: #9a6200;
  --warn-soft: #fff4dc;
  --ok: #187a2f;
  --ok-soft: #e6f5ea;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .06);
  --shadow: 0 1px 3px rgba(16, 24, 40, .08), 0 4px 12px rgba(16, 24, 40, .05);
  --shadow-lg: 0 12px 40px rgba(16, 24, 40, .18);
  --radius: 10px;
  --radius-sm: 7px;
  --sidebar: 248px;

  /* category tiles */
  --cat-organize: #2a78d6;  --cat-organize-bg: #e6f0fc;
  --cat-convert-to: #128a5e; --cat-convert-to-bg: #e2f5ed;
  --cat-convert-from: #0f7f95; --cat-convert-from-bg: #e0f3f7;
  --cat-edit: #b86e00;      --cat-edit-bg: #fdf1dc;
  --cat-security: #c23a5c;  --cat-security-bg: #fce8ee;
  --cat-inspect: #6250d6;   --cat-inspect-bg: #eeebfc;
  --cat-images: #a8329a;    --cat-images-bg: #fbe7f6;
  --cat-audio: #c4470f;     --cat-audio-bg: #fdeae0;
  --cat-video: #5a7612;     --cat-video-bg: #eef4dc;
  --cat-documents: #4a5a73; --cat-documents-bg: #e9edf3;

  /* charts (dataviz reference palette) */
  --chart-surface: #ffffff;
  --series-1: #2a78d6;
  --series-1-track: #cde2fb;
  --status-critical: #d03b3b;
  --status-warning: #fab219;
  --grid: #e1e0d9;
  --axis: #c3c2b7;
  --muted-ink: #898781;
}

@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) {
    color-scheme: dark;
    --bg: #0e1015;
    --surface: #161920;
    --surface-2: #1b1f27;
    --surface-3: #232833;
    --border: #2a303c;
    --border-strong: #3a4250;
    --text: #eef0f4;
    --text-2: #b5bccb;
    --text-3: #858d9e;
    --brand: #5b8cff;
    --brand-hover: #7aa2ff;
    --brand-soft: #1c2742;
    --brand-ink: #0b1020;
    --focus: #7aa2ff;
    --danger: #ff6b6b;
    --danger-soft: #3a1c1f;
    --warn: #f2b84b;
    --warn-soft: #33290f;
    --ok: #4cc970;
    --ok-soft: #14301c;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow: 0 1px 3px rgba(0, 0, 0, .5), 0 4px 12px rgba(0, 0, 0, .3);
    --shadow-lg: 0 12px 40px rgba(0, 0, 0, .6);
    --cat-organize: #6aa5f0;  --cat-organize-bg: #18263b;
    --cat-convert-to: #3fc495; --cat-convert-to-bg: #13302a;
    --cat-convert-from: #43c0d6; --cat-convert-from-bg: #122d33;
    --cat-edit: #f0ad45;      --cat-edit-bg: #33260f;
    --cat-security: #f07597;  --cat-security-bg: #36192a;
    --cat-inspect: #9085e9;   --cat-inspect-bg: #241f40;
    --cat-images: #e07fd2;    --cat-images-bg: #3a1a35;
    --cat-audio: #f48a55;     --cat-audio-bg: #3a1f12;
    --cat-video: #a3c55a;     --cat-video-bg: #232c12;
    --cat-documents: #9fb0c8; --cat-documents-bg: #1f2530;
    --chart-surface: #161920;
    --series-1: #3987e5;
    --series-1-track: #184f95;
    --grid: #2c2c2a;
    --axis: #383835;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0e1015;
  --surface: #161920;
  --surface-2: #1b1f27;
  --surface-3: #232833;
  --border: #2a303c;
  --border-strong: #3a4250;
  --text: #eef0f4;
  --text-2: #b5bccb;
  --text-3: #858d9e;
  --brand: #5b8cff;
  --brand-hover: #7aa2ff;
  --brand-soft: #1c2742;
  --brand-ink: #0b1020;
  --focus: #7aa2ff;
  --danger: #ff6b6b;
  --danger-soft: #3a1c1f;
  --warn: #f2b84b;
  --warn-soft: #33290f;
  --ok: #4cc970;
  --ok-soft: #14301c;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow: 0 1px 3px rgba(0, 0, 0, .5), 0 4px 12px rgba(0, 0, 0, .3);
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, .6);
  --cat-organize: #6aa5f0;  --cat-organize-bg: #18263b;
  --cat-convert-to: #3fc495; --cat-convert-to-bg: #13302a;
  --cat-convert-from: #43c0d6; --cat-convert-from-bg: #122d33;
  --cat-edit: #f0ad45;      --cat-edit-bg: #33260f;
  --cat-security: #f07597;  --cat-security-bg: #36192a;
  --cat-inspect: #9085e9;   --cat-inspect-bg: #241f40;
  --cat-images: #e07fd2;    --cat-images-bg: #3a1a35;
  --cat-audio: #f48a55;     --cat-audio-bg: #3a1f12;
  --cat-video: #a3c55a;     --cat-video-bg: #232c12;
  --cat-documents: #9fb0c8; --cat-documents-bg: #1f2530;
  --chart-surface: #161920;
  --series-1: #3987e5;
  --series-1-track: #184f95;
  --grid: #2c2c2a;
  --axis: #383835;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); border: 0; }
.hidden { display: none !important; }
svg.icon { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.muted { color: var(--text-3); }
.mono { font-family: var(--mono); font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------- shell */
.app { display: grid; grid-template-columns: var(--sidebar) 1fr; min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column;
  background: var(--surface); border-right: 1px solid var(--border);
  padding: 16px 12px;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand img { width: 30px; height: 30px; }
.brand-name { font-weight: 700; font-size: 16px; letter-spacing: -.01em; }
.brand-sub { font-size: 11.5px; color: var(--text-3); margin-top: -2px; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); padding: 14px 10px 6px; }
.nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: var(--radius-sm);
  color: var(--text-2); font-weight: 500;
}
.nav a:hover { background: var(--surface-3); color: var(--text); text-decoration: none; }
.nav a.active { background: var(--brand-soft); color: var(--brand); }
.nav .badge { margin-left: auto; }
.sidebar-foot { margin-top: auto; border-top: 1px solid var(--border); padding-top: 12px; }
.user-card { display: flex; align-items: center; gap: 10px; padding: 6px 8px; }
.avatar {
  width: 32px; height: 32px; border-radius: 50%; flex: none;
  display: grid; place-items: center;
  background: var(--brand-soft); color: var(--brand); font-weight: 700; font-size: 13px;
}
.user-meta { min-width: 0; }
.user-name { font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-email { font-size: 12px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.foot-actions { display: flex; gap: 6px; padding: 8px 4px 0; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 12px;
  padding: 12px 28px; background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(8px); border-bottom: 1px solid transparent;
}
.topbar.scrolled { border-bottom-color: var(--border); }
.icon-btn.menu-btn { display: none; }
.search {
  position: relative; flex: 1; max-width: 560px;
}
.search input {
  width: 100%; height: 38px; padding: 0 70px 0 38px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); box-shadow: var(--shadow-sm);
}
.search input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.search > .icon { position: absolute; left: 11px; top: 10px; color: var(--text-3); }
.search kbd { position: absolute; right: 9px; top: 8px; }
kbd {
  font-family: var(--font); font-size: 11px; color: var(--text-3);
  border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 5px; padding: 1px 6px; background: var(--surface-2);
}
.search-results {
  position: absolute; left: 0; right: 0; top: 44px; z-index: 30;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); padding: 6px; max-height: 420px; overflow: auto;
}
.search-item { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: var(--radius-sm); cursor: pointer; }
.search-item.active, .search-item:hover { background: var(--surface-3); }
.search-item .t { font-weight: 600; }
.search-item .d { font-size: 12.5px; color: var(--text-3); }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }

.content { padding: 8px 28px 48px; max-width: 1320px; width: 100%; }
.banner {
  display: flex; gap: 10px; align-items: flex-start;
  margin: 0 28px 4px; padding: 10px 14px; border-radius: var(--radius-sm);
  background: var(--warn-soft); color: var(--text); border: 1px solid color-mix(in srgb, var(--warn) 30%, transparent);
}
.banner.dev { background: var(--danger-soft); border-color: color-mix(in srgb, var(--danger) 35%, transparent); }

/* -------------------------------------------------------------- headings */
.page-head { display: flex; align-items: flex-end; gap: 16px; margin: 12px 0 20px; flex-wrap: wrap; }
.page-head h1 { font-size: 24px; line-height: 1.2; margin: 0; letter-spacing: -.02em; }
.page-head p { margin: 4px 0 0; color: var(--text-2); }
.page-head .actions { margin-left: auto; display: flex; gap: 8px; }
.crumbs { font-size: 13px; color: var(--text-3); margin-top: 8px; display: flex; gap: 6px; align-items: center; }
.crumbs a { color: var(--text-3); }
h2.section { font-size: 15px; margin: 28px 0 12px; display: flex; align-items: center; gap: 8px; }
h2.section .count { color: var(--text-3); font-weight: 500; }
.section-desc { color: var(--text-3); font-weight: 400; font-size: 13px; }

/* ---------------------------------------------------------------- buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 36px; padding: 0 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
  font-weight: 600; cursor: pointer; white-space: nowrap; text-decoration: none;
  transition: background .12s, border-color .12s, box-shadow .12s;
}
.btn:hover { background: var(--surface-3); text-decoration: none; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); box-shadow: var(--shadow-sm); }
.btn.primary:hover:not(:disabled) { background: var(--brand-hover); border-color: var(--brand-hover); }
.btn.danger { color: var(--danger); }
.btn.ghost { border-color: transparent; background: transparent; color: var(--text-2); }
.btn.ghost:hover { background: var(--surface-3); color: var(--text); }
.btn.sm { height: 30px; padding: 0 10px; font-size: 13px; }
.btn.lg { height: 44px; padding: 0 20px; font-size: 15px; }
.btn.block { width: 100%; }
.icon-btn {
  display: inline-grid; place-items: center; width: 32px; height: 32px;
  border-radius: var(--radius-sm); border: 1px solid transparent; background: transparent; color: var(--text-2); cursor: pointer;
}
.icon-btn:hover { background: var(--surface-3); color: var(--text); }
.icon-btn.on { color: #e3a008; }

.badge {
  display: inline-flex; align-items: center; gap: 4px; height: 20px; padding: 0 7px; border-radius: 999px;
  font-size: 11.5px; font-weight: 600; background: var(--surface-3); color: var(--text-2); white-space: nowrap;
}
.badge.brand { background: var(--brand-soft); color: var(--brand); }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.err { background: var(--danger-soft); color: var(--danger); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }

/* ------------------------------------------------------------------ cards */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.card-pad { padding: 18px; }
.card h3 { margin: 0 0 4px; font-size: 14px; }
.card .sub { color: var(--text-3); font-size: 12.5px; margin: 0 0 14px; }

.hero { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin: 12px 0 8px; flex-wrap: wrap; }
.hero h1 { font-size: 26px; margin: 0; letter-spacing: -.02em; }
.hero p { margin: 4px 0 0; color: var(--text-2); }

.chips { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0 4px; }
.chip {
  height: 30px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text-2); font-weight: 500; cursor: pointer;
}
.chip:hover { border-color: var(--border-strong); color: var(--text); }
.chip.active { background: var(--text); color: var(--surface); border-color: var(--text); }

.tool-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(232px, 1fr)); gap: 12px; }
.tool-card {
  position: relative; display: flex; gap: 12px; align-items: flex-start;
  padding: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  color: var(--text); text-align: left; cursor: pointer; box-shadow: var(--shadow-sm);
  transition: border-color .12s, box-shadow .12s, transform .12s;
}
.tool-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow); text-decoration: none; transform: translateY(-1px); }
.tool-card .name { font-weight: 600; margin-top: 1px; }
.tool-card .desc { font-size: 12.5px; color: var(--text-3); margin-top: 2px; line-height: 1.4; }
.tool-card .fav { position: absolute; top: 8px; right: 8px; opacity: 0; transition: opacity .12s; }
.tool-card:hover .fav, .tool-card .fav.on { opacity: 1; }
.tool-card .body { padding-right: 18px; min-width: 0; }

.tile {
  width: 38px; height: 38px; border-radius: 9px; flex: none;
  display: grid; place-items: center;
  background: var(--cat-organize-bg); color: var(--cat-organize);
}
.tile.lg { width: 48px; height: 48px; border-radius: 12px; }
.tile.lg svg.icon { width: 24px; height: 24px; }
.tile.sm { width: 28px; height: 28px; border-radius: 7px; }
.tile.sm svg.icon { width: 15px; height: 15px; }
.tile[data-cat="convert-to"] { background: var(--cat-convert-to-bg); color: var(--cat-convert-to); }
.tile[data-cat="convert-from"] { background: var(--cat-convert-from-bg); color: var(--cat-convert-from); }
.tile[data-cat="edit"] { background: var(--cat-edit-bg); color: var(--cat-edit); }
.tile[data-cat="security"] { background: var(--cat-security-bg); color: var(--cat-security); }
.tile[data-cat="inspect"] { background: var(--cat-inspect-bg); color: var(--cat-inspect); }
.tile[data-cat="images"] { background: var(--cat-images-bg); color: var(--cat-images); }
.tile[data-cat="audio"] { background: var(--cat-audio-bg); color: var(--cat-audio); }
.tile[data-cat="video"] { background: var(--cat-video-bg); color: var(--cat-video); }
.tile[data-cat="documents"] { background: var(--cat-documents-bg); color: var(--cat-documents); }
.tile[data-cat="file"] { background: var(--surface-3); color: var(--text-2); }

.empty {
  text-align: center; padding: 36px 16px; color: var(--text-3);
  border: 1px dashed var(--border-strong); border-radius: var(--radius); background: var(--surface-2);
}
.empty .icon { width: 28px; height: 28px; margin-bottom: 8px; }

/* ----------------------------------------------------------- tool runner */
.tool-head { display: flex; gap: 16px; align-items: center; margin: 4px 0 18px; }
.tool-head h1 { margin: 0; font-size: 24px; letter-spacing: -.02em; }
.tool-head p { margin: 2px 0 0; color: var(--text-2); }
.tool-head .fav { margin-left: auto; }
.runner { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(320px, 1fr); gap: 18px; align-items: start; }
.panel-title { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; gap: 8px; }
.panel-title h3 { margin: 0; font-size: 14px; }

.dropzone {
  border: 2px dashed var(--border-strong); border-radius: var(--radius); background: var(--surface-2);
  padding: 30px 18px; text-align: center; cursor: pointer; transition: border-color .12s, background .12s;
}
.dropzone:hover, .dropzone.over { border-color: var(--brand); background: var(--brand-soft); }
.dropzone .icon { width: 30px; height: 30px; color: var(--brand); }
.dropzone .big { font-weight: 600; font-size: 15px; margin: 8px 0 2px; }
.dropzone .small { color: var(--text-3); font-size: 12.5px; }
.dropzone.compact { padding: 14px; }
.dropzone.compact .big { font-size: 13.5px; margin: 0; }
.dropzone.compact .icon { width: 20px; height: 20px; }
.dropzone.compact .dz-inner { display: flex; align-items: center; justify-content: center; gap: 10px; }

.file-list { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.file-item {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px;
  border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface);
}
.file-item.dragging { opacity: .5; }
.file-item.drop-target { border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand-soft); }
.file-item .fname { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-item .fmeta { font-size: 12px; color: var(--text-3); }
.file-item .grow { flex: 1; min-width: 0; }
.file-item .handle { cursor: grab; color: var(--text-3); }
.file-item .order { width: 22px; text-align: center; font-size: 12px; color: var(--text-3); font-weight: 600; }

.form { display: flex; flex-direction: column; gap: 14px; }
.field label.lbl, .field .lbl { display: block; font-weight: 600; font-size: 13px; margin-bottom: 6px; }
.field .help { font-size: 12px; color: var(--text-3); margin-top: 5px; }
.field.invalid .input, .field.invalid textarea, .field.invalid select { border-color: var(--danger); }
.field .err { font-size: 12px; color: var(--danger); margin-top: 5px; }
.input, select.input, textarea.input {
  width: 100%; height: 36px; padding: 0 10px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--surface);
}
textarea.input { height: auto; min-height: 96px; padding: 8px 10px; resize: vertical; font-family: var(--mono); font-size: 13px; }
.input:focus, textarea.input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
input[type="color"].input { padding: 3px; width: 64px; cursor: pointer; }
.color-row { display: flex; gap: 8px; align-items: center; }
.color-row .input.hex { width: 110px; font-family: var(--mono); }

.seg { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 3px; border-radius: 9px; background: var(--surface-3); max-width: 100%; }
.seg button {
  border: 0; background: transparent; padding: 6px 12px; border-radius: 7px; cursor: pointer; color: var(--text-2); font-weight: 500;
}
.seg button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); font-weight: 600; }

.switch { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch .track {
  position: relative; width: 36px; height: 20px; border-radius: 999px; background: var(--border-strong); flex: none; margin-top: 1px;
  transition: background .15s;
}
.switch .track::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .25); transition: transform .15s;
}
.switch input:checked + .track { background: var(--brand); }
.switch input:checked + .track::after { transform: translateX(16px); }
.switch input:focus-visible + .track { outline: 2px solid var(--focus); outline-offset: 2px; }
.switch .txt { font-weight: 500; }
.switch .txt .help { font-weight: 400; }

.range-row { display: flex; align-items: center; gap: 12px; }
.range-row input[type="range"] { flex: 1; accent-color: var(--brand); }
.range-row .val { min-width: 44px; text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }

.pos-grid { display: grid; grid-template-columns: repeat(3, 34px); grid-template-rows: repeat(3, 26px); gap: 4px; padding: 6px; background: var(--surface-3); border-radius: 8px; width: max-content; }
.pos-grid button { border: 1px solid var(--border-strong); background: var(--surface); border-radius: 5px; cursor: pointer; }
.pos-grid button.on { background: var(--brand); border-color: var(--brand); }

.lang-picker { display: flex; flex-wrap: wrap; gap: 6px; }
.lang-picker .chip.active { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }

details.advanced { border-top: 1px solid var(--border); padding-top: 12px; }
details.advanced > summary { cursor: pointer; font-weight: 600; color: var(--text-2); list-style: none; display: flex; align-items: center; gap: 6px; }
details.advanced > summary::-webkit-details-marker { display: none; }
details.advanced > summary .icon { transition: transform .15s; width: 16px; height: 16px; }
details.advanced[open] > summary .icon { transform: rotate(90deg); }
details.advanced .form { margin-top: 14px; }

.note { display: flex; gap: 10px; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--brand-soft); color: var(--text); font-size: 13px; margin-bottom: 14px; }
.note .icon { color: var(--brand); margin-top: 1px; }
.note.warn { background: var(--warn-soft); }
.note.warn .icon { color: var(--warn); }
.note.err { background: var(--danger-soft); }
.note.err .icon { color: var(--danger); }

.run-bar { margin-top: 18px; display: flex; flex-direction: column; gap: 10px; }
.progress { height: 6px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.progress > div { height: 100%; width: 0; background: var(--brand); border-radius: 999px; transition: width .2s; }
.progress.indeterminate > div { width: 35%; animation: slide 1.2s ease-in-out infinite; }
@keyframes slide { 0% { transform: translateX(-100%); } 100% { transform: translateX(300%); } }
.run-status { font-size: 12.5px; color: var(--text-2); display: flex; justify-content: space-between; }

.results { margin-top: 18px; display: flex; flex-direction: column; gap: 10px; }
.result {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px;
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm);
  flex-wrap: wrap;
}
.result.err { border-color: color-mix(in srgb, var(--danger) 35%, var(--border)); background: var(--danger-soft); }
.result .grow { flex: 1; min-width: 180px; }
.result .rname { font-weight: 600; word-break: break-all; }
.result .rmeta { font-size: 12px; color: var(--text-3); }
.result .ractions { display: flex; gap: 6px; flex-wrap: wrap; }
.result-body { width: 100%; }

.json-view { font-family: var(--mono); font-size: 12.5px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; max-height: 520px; overflow: auto; }
.json-view details { margin-left: 14px; }
.json-view summary { cursor: pointer; margin-left: -14px; }
.json-view .k { color: var(--brand); }
.json-view .s { color: var(--ok); }
.json-view .n { color: var(--cat-edit); }
.json-view .b { color: var(--cat-inspect); }
.json-view .row { white-space: pre-wrap; word-break: break-word; }
pre.text-view { font-family: var(--mono); font-size: 12.5px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; max-height: 520px; overflow: auto; white-space: pre-wrap; word-break: break-word; margin: 0; }

/* ----------------------------------------------------------------- tables */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th { text-align: left; font-weight: 600; color: var(--text-3); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; padding: 10px 12px; border-bottom: 1px solid var(--border); background: var(--surface-2); white-space: nowrap; }
.table td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: var(--surface-2); }
.table .r { text-align: right; font-variant-numeric: tabular-nums; }
.table .clip { max-width: 280px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cell-tool { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.table-foot { display: flex; justify-content: space-between; align-items: center; padding: 10px 12px; border-top: 1px solid var(--border); color: var(--text-3); font-size: 12.5px; }

.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.toolbar .input { width: auto; min-width: 160px; }
.toolbar .search-input { min-width: 240px; flex: 1; max-width: 360px; }

/* ------------------------------------------------------------------- tabs */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 20px; overflow-x: auto; }
.tabs a { padding: 10px 14px; color: var(--text-2); font-weight: 600; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a:hover { color: var(--text); text-decoration: none; }
.tabs a.active { color: var(--brand); border-bottom-color: var(--brand); }

/* ------------------------------------------------------------------- stats */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 16px; }
.big-figure { font-size: 26px; font-weight: 650; letter-spacing: -.02em; }
.stat { padding: 16px; }
.stat .label { color: var(--text-3); font-size: 12.5px; font-weight: 500; }
.stat .value { font-size: 26px; font-weight: 650; letter-spacing: -.02em; margin-top: 4px; }
.stat .delta { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 16px; margin-bottom: 16px; }
.grid-even { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; margin-bottom: 16px; }

/* meter (allowance) */
.meter { height: 10px; border-radius: 999px; background: var(--series-1-track); overflow: hidden; margin: 12px 0 8px; }
.meter > div { height: 100%; background: var(--series-1); border-radius: 999px; }
.meter.warning > div { background: var(--status-warning); }
.meter.critical > div { background: var(--status-critical); }
.meter-legend { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--text-2); }

/* charts */
.chart { position: relative; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .gridline { stroke: var(--grid); stroke-width: 1; }
.chart .baseline { stroke: var(--axis); stroke-width: 1; }
.chart .tick { fill: var(--muted-ink); font-size: 11px; font-family: var(--font); font-variant-numeric: tabular-nums; }
.chart .s-ok { fill: var(--series-1); }
.chart .s-err { fill: var(--status-critical); }
.chart .hit { fill: transparent; cursor: default; }
.chart .hit:hover + .col-hover, .chart .col-hover { pointer-events: none; }
.chart .hover-band { fill: var(--surface-3); opacity: 0; }
.chart .hover-band.on { opacity: .8; }
.legend { display: flex; gap: 16px; font-size: 12.5px; color: var(--text-2); margin-bottom: 8px; flex-wrap: wrap; }
.legend .key { display: inline-flex; align-items: center; gap: 6px; }
.sw { width: 10px; height: 10px; border-radius: 3px; display: inline-block; flex: none; }
.sw.ok { background: var(--series-1); }
.sw.err { background: var(--status-critical); }
.toolbar .grow { flex: 1; }
.badge svg.icon { width: 12px; height: 12px; }
.tooltip {
  position: absolute; z-index: 5; pointer-events: none; min-width: 140px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 8px; box-shadow: var(--shadow-lg);
  padding: 8px 10px; font-size: 12.5px; color: var(--text);
}
.tooltip .tt-title { font-weight: 600; margin-bottom: 4px; }
.tooltip .tt-row { display: flex; align-items: center; gap: 6px; justify-content: space-between; }
.tooltip .tt-row span:first-child { display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); }

.hbars { display: flex; flex-direction: column; gap: 9px; }
.hbar { display: grid; grid-template-columns: minmax(110px, 40%) 1fr; gap: 10px; align-items: center; font-size: 13px; }
.hbar .lbl { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text-2); }
.hbar .barline { display: flex; align-items: center; gap: 8px; }
.hbar .bar { height: 14px; border-radius: 0 4px 4px 0; background: var(--series-1); min-width: 2px; }
.hbar .v { font-variant-numeric: tabular-nums; color: var(--text); font-weight: 600; font-size: 12.5px; }

details.table-view { margin-top: 10px; }
details.table-view summary { cursor: pointer; font-size: 12.5px; color: var(--text-3); }

/* kv list */
.kv { display: grid; grid-template-columns: minmax(140px, 220px) 1fr; gap: 8px 16px; font-size: 13px; }
.kv dt { color: var(--text-3); }
.kv dd { margin: 0; word-break: break-all; display: flex; gap: 8px; align-items: center; }

/* --------------------------------------------------------- modal & toast */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 100; background: rgba(10, 14, 22, .55);
  display: grid; place-items: center; padding: 20px; animation: fade .12s ease-out;
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.modal {
  width: min(560px, 100%); max-height: calc(100vh - 40px); display: flex; flex-direction: column;
  background: var(--surface); border-radius: 14px; box-shadow: var(--shadow-lg); border: 1px solid var(--border);
}
.modal.wide { width: min(1100px, 100%); height: calc(100vh - 40px); }
.modal-head { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.modal-head h3 { margin: 0; font-size: 15px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.modal-body { padding: 16px; overflow: auto; flex: 1; }
.modal-body.flush { padding: 0; display: flex; }
.modal-body iframe { border: 0; width: 100%; height: 100%; flex: 1; background: #525659; border-radius: 0 0 14px 14px; }
.modal-body img.preview { max-width: 100%; display: block; margin: 0 auto; }
.picker-list { display: flex; flex-direction: column; gap: 4px; }
.picker-list button {
  display: flex; align-items: center; gap: 10px; padding: 8px; border: 0; background: transparent; border-radius: 8px; text-align: left; cursor: pointer;
}
.picker-list button:hover { background: var(--surface-3); }
.picker-list .d { font-size: 12px; color: var(--text-3); }

.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 200; display: flex; flex-direction: column; gap: 8px; max-width: 380px; }
.toast {
  display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 10px;
  background: var(--text); color: var(--surface); box-shadow: var(--shadow-lg); font-size: 13.5px; animation: rise .18s ease-out;
}
.toast.err { background: var(--danger); color: #fff; }
@keyframes rise { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }

.skeleton { background: linear-gradient(90deg, var(--surface-3), var(--surface-2), var(--surface-3)); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: 8px; }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.loading-block { height: 120px; }
.spinner { width: 16px; height: 16px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ------------------------------------------------------------- responsive */
@media (max-width: 1080px) {
  .runner { grid-template-columns: 1fr; }
  .grid-2, .grid-even { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; z-index: 60; left: 0; top: 0; width: 272px; transform: translateX(-100%); transition: transform .2s; box-shadow: var(--shadow-lg); }
  .sidebar.open { transform: none; }
  .scrim { position: fixed; inset: 0; z-index: 50; background: rgba(10, 14, 22, .45); }
  .icon-btn.menu-btn { display: inline-grid; }
  .topbar { padding: 10px 16px; }
  .content { padding: 8px 16px 40px; }
  .banner { margin: 0 16px 4px; }
  .search kbd { display: none; }
  .search input { padding-right: 12px; }
  .kv { grid-template-columns: 1fr; gap: 2px 0; }
  .kv dd { margin-bottom: 8px; }
  .tool-grid { grid-template-columns: 1fr; }
  .page-head .actions { margin-left: 0; }
  .tool-head { flex-wrap: wrap; gap: 12px; }
  .tool-head > div:not(.tile) { flex: 1; min-width: 0; }
  .tool-head h1 { font-size: 21px; }
  .tool-head .fav { margin-left: 0; order: 3; width: 100%; justify-content: flex-start; padding: 0; height: 30px; }
  .result .ractions { width: 100%; }
}

/* ------------------------------------------------------------------ login */
.login-page { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); background: var(--surface); }
.login-art {
  position: relative; overflow: hidden; padding: 48px; color: #fff; display: flex; flex-direction: column; justify-content: space-between;
  background: radial-gradient(1200px 600px at -10% -10%, #3c6df0 0%, transparent 60%), radial-gradient(900px 600px at 110% 110%, #0f9bb3 0%, transparent 55%), #0d1b3d;
}
.login-art .brand { color: #fff; padding: 0; }
.login-art .brand-sub { color: rgba(255, 255, 255, .7); }
.login-art h2 { font-size: 34px; line-height: 1.15; letter-spacing: -.02em; margin: 0 0 14px; max-width: 520px; }
.login-art p { color: rgba(255, 255, 255, .78); max-width: 480px; font-size: 15px; margin: 0; }
.login-art ul { list-style: none; padding: 0; margin: 28px 0 0; display: grid; gap: 12px; }
.login-art li { display: flex; gap: 10px; align-items: center; color: rgba(255, 255, 255, .88); }
.login-art li .icon { color: #8fb3ff; }
.login-art .foot { font-size: 12.5px; color: rgba(255, 255, 255, .55); }
.login-panel { display: grid; place-items: center; padding: 40px 24px; background: var(--bg); }
.login-card { width: min(400px, 100%); }
.login-card h1 { font-size: 24px; margin: 0 0 6px; letter-spacing: -.02em; }
.login-card .lead { color: var(--text-2); margin: 0 0 24px; }
.google-btn {
  display: flex; align-items: center; justify-content: center; gap: 12px; width: 100%; height: 46px;
  border-radius: 10px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
  font-weight: 600; font-size: 15px; box-shadow: var(--shadow-sm); cursor: pointer;
}
.google-btn:hover { background: var(--surface-2); text-decoration: none; box-shadow: var(--shadow); }
.google-btn img { width: 20px; height: 20px; }
.login-card .fine { font-size: 12.5px; color: var(--text-3); margin-top: 18px; }
.setup-wrap { margin-top: 18px; border-top: 1px solid var(--border); padding-top: 14px; }
.setup-wrap > summary { cursor: pointer; color: var(--text-2); font-weight: 600; font-size: 13px; }
.setup-wrap .form { margin-top: 12px; }
.setup-wrap code, .help code { font-family: var(--mono); font-size: 12px; background: var(--surface-3); padding: 1px 5px; border-radius: 4px; }
.steps { display: flex; flex-direction: column; gap: 16px; }
.step-card { position: relative; padding-left: 60px; }
.step-num {
  position: absolute; left: 18px; top: 18px; width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center; font-weight: 700; font-size: 13px;
  background: var(--brand-soft); color: var(--brand);
}
.step-card.done .step-num { background: var(--ok-soft); color: var(--ok); }
.status-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.drop-xml { border: 2px dashed var(--border-strong); border-radius: var(--radius-sm); padding: 18px; text-align: center; cursor: pointer; background: var(--surface-2); }
.drop-xml.over { border-color: var(--brand); background: var(--brand-soft); }
.divider { display: flex; align-items: center; gap: 10px; color: var(--text-3); font-size: 12px; margin: 20px 0; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }
@media (max-width: 860px) {
  .login-page { grid-template-columns: 1fr; }
  .login-art { display: none; }
}

/* ---- 1.3: accounts, roles, retention, media ---- */
.help { font-size: 12px; color: var(--text-3); }
p.help { margin: 4px 0 12px; }
h2.section { font-size: 15px; margin: 24px 0 10px; }
.grow { flex: 1; }
.lbl.inline { font-weight: 600; font-size: 13px; }
.badges { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 4px; }
.secret-box {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  padding: 10px 12px; margin: 10px 0; border: 1px dashed var(--border-strong); border-radius: var(--radius-sm);
  background: var(--surface-2); font-size: 15px; word-break: break-all;
}
details.menu { position: relative; display: inline-block; text-align: left; }
details.menu > summary { list-style: none; }
details.menu > summary::-webkit-details-marker { display: none; }
details.menu > summary .icon { width: 14px; height: 14px; }
.menu-list {
  position: absolute; right: 0; top: calc(100% + 4px); z-index: 20; min-width: 200px; padding: 4px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); box-shadow: var(--shadow);
  display: flex; flex-direction: column;
}
.menu-list button {
  text-align: left; padding: 8px 10px; border: 0; border-radius: 5px; background: transparent; color: var(--text);
  font: inherit; cursor: pointer;
}
.menu-list button:hover, .menu-list button:focus-visible { background: var(--surface-3); }
.role-card { display: flex; flex-direction: column; gap: 6px; }
.role-head { display: flex; align-items: center; gap: 8px; }
.role-head h3 { margin: 0; }
.role-perms { font-size: 13px; }
.role-card .toolbar { margin: 6px 0 0; }
fieldset.perm-group { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 14px 12px; margin: 0; }
fieldset.perm-group legend { font-weight: 600; font-size: 13px; padding: 0 4px; }
.perm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 6px 14px; }
label.check { display: flex; align-items: center; gap: 8px; font-size: 13.5px; cursor: pointer; }
label.check input { width: 16px; height: 16px; accent-color: var(--brand); }
label.check input:disabled + span { color: var(--text-3); }
.duration { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.duration .input.num { width: 96px; }
.duration select.input { width: auto; }
.duration .switch { margin-right: 4px; }
.recovery .codes { columns: 2; column-gap: 24px; padding-left: 22px; margin: 10px 0; font-size: 14px; line-height: 1.9; }
.enrol .qr { display: flex; justify-content: center; }
.enrol .qr img { width: 200px; height: 200px; border-radius: 8px; border: 1px solid var(--border); background: #fff; }
.steps-list { margin: 0; padding-left: 20px; color: var(--text-2); display: grid; gap: 4px; }
.code-input { font-family: var(--mono); font-size: 20px; letter-spacing: .2em; text-align: center; height: 46px; }
.mfa-icon { display: flex; justify-content: center; color: var(--brand); }
.mfa-icon .icon { width: 40px; height: 40px; }
#step h1 { font-size: 22px; margin: 0 0 6px; letter-spacing: -.02em; }
#step .lead { color: var(--text-2); margin: 0 0 18px; }
#step .note.err { margin-bottom: 12px; }
.media-preview { width: 100%; max-height: 70vh; border-radius: var(--radius-sm); background: #000; }
audio.media-preview { background: transparent; }
/* =====================================================================
   1.4: vibrant theme (overrides the tokens above) + editor, logs, updates
   ===================================================================== */
:root {
  --bg: #f6f4fd;
  --surface-2: #faf9ff;
  --surface-3: #f0edfb;
  --border: #e6e2f3;
  --border-strong: #d2cbe8;
  --text: #17132b;
  --text-2: #4b4568;
  --text-3: #7a7397;
  --brand: #6d28d9;
  --brand-hover: #5b21b6;
  --brand-soft: #efe8fe;
  --focus: #7c3aed;
  --grad: linear-gradient(135deg, #7c3aed 0%, #4f46e5 48%, #db2777 100%);
  --grad-soft: linear-gradient(135deg, rgba(124, 58, 237, .12), rgba(79, 70, 229, .10) 50%, rgba(219, 39, 119, .12));
  --glow: 0 10px 30px rgba(109, 40, 217, .22);
  --page-wash: radial-gradient(900px 500px at 100% -10%, rgba(219, 39, 119, .10), transparent 60%),
               radial-gradient(900px 600px at -10% 0%, rgba(124, 58, 237, .12), transparent 60%),
               radial-gradient(700px 500px at 50% 120%, rgba(14, 165, 233, .10), transparent 60%);
  --cat-organize: #2563eb;  --cat-organize-bg: #e3ecff;
  --cat-convert-to: #059669; --cat-convert-to-bg: #dcf7ec;
  --cat-convert-from: #0891b2; --cat-convert-from-bg: #dbf4fa;
  --cat-edit: #d97706;      --cat-edit-bg: #fff0d6;
  --cat-security: #e11d48;  --cat-security-bg: #ffe4ea;
  --cat-inspect: #7c3aed;   --cat-inspect-bg: #efe7ff;
  --cat-images: #c026d3;    --cat-images-bg: #fbe3fc;
  --cat-audio: #ea580c;     --cat-audio-bg: #ffe8da;
  --cat-video: #65a30d;     --cat-video-bg: #ecf8d6;
  --cat-documents: #475569; --cat-documents-bg: #e7ecf3;
}
@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) {
    --bg: #0d0b18;
    --surface: #15122a;
    --surface-2: #1a1631;
    --surface-3: #241f40;
    --border: #2d2750;
    --border-strong: #3d3566;
    --text: #f1eefc;
    --text-2: #c2bbdf;
    --text-3: #8d86ad;
    --brand: #a78bfa;
    --brand-hover: #c4b5fd;
    --brand-soft: #2a2050;
    --brand-ink: #120c26;
    --focus: #c4b5fd;
    --grad: linear-gradient(135deg, #8b5cf6 0%, #6366f1 48%, #ec4899 100%);
    --grad-soft: linear-gradient(135deg, rgba(139, 92, 246, .18), rgba(99, 102, 241, .14) 50%, rgba(236, 72, 153, .16));
    --glow: 0 10px 30px rgba(139, 92, 246, .28);
    --page-wash: radial-gradient(900px 500px at 100% -10%, rgba(236, 72, 153, .14), transparent 60%),
                 radial-gradient(900px 600px at -10% 0%, rgba(139, 92, 246, .18), transparent 60%),
                 radial-gradient(700px 500px at 50% 120%, rgba(14, 165, 233, .12), transparent 60%);
    --cat-organize: #7aa7ff;  --cat-organize-bg: #1b2547;
    --cat-convert-to: #34d399; --cat-convert-to-bg: #12302a;
    --cat-convert-from: #38c6e6; --cat-convert-from-bg: #102c38;
    --cat-edit: #fbbf24;      --cat-edit-bg: #36280c;
    --cat-security: #fb7194;  --cat-security-bg: #3b1526;
    --cat-inspect: #b39bff;   --cat-inspect-bg: #2a1f4f;
    --cat-images: #f08cf5;    --cat-images-bg: #3b1840;
    --cat-audio: #fb9a5e;     --cat-audio-bg: #3d2010;
    --cat-video: #a6dd52;     --cat-video-bg: #22300f;
    --cat-documents: #a9b8cf; --cat-documents-bg: #1f2535;
  }
}
:root[data-theme="dark"] {
  --bg: #0d0b18;
  --surface: #15122a;
  --surface-2: #1a1631;
  --surface-3: #241f40;
  --border: #2d2750;
  --border-strong: #3d3566;
  --text: #f1eefc;
  --text-2: #c2bbdf;
  --text-3: #8d86ad;
  --brand: #a78bfa;
  --brand-hover: #c4b5fd;
  --brand-soft: #2a2050;
  --brand-ink: #120c26;
  --focus: #c4b5fd;
  --grad: linear-gradient(135deg, #8b5cf6 0%, #6366f1 48%, #ec4899 100%);
  --grad-soft: linear-gradient(135deg, rgba(139, 92, 246, .18), rgba(99, 102, 241, .14) 50%, rgba(236, 72, 153, .16));
  --glow: 0 10px 30px rgba(139, 92, 246, .28);
  --page-wash: radial-gradient(900px 500px at 100% -10%, rgba(236, 72, 153, .14), transparent 60%),
               radial-gradient(900px 600px at -10% 0%, rgba(139, 92, 246, .18), transparent 60%),
               radial-gradient(700px 500px at 50% 120%, rgba(14, 165, 233, .12), transparent 60%);
  --cat-organize: #7aa7ff;  --cat-organize-bg: #1b2547;
  --cat-convert-to: #34d399; --cat-convert-to-bg: #12302a;
  --cat-convert-from: #38c6e6; --cat-convert-from-bg: #102c38;
  --cat-edit: #fbbf24;      --cat-edit-bg: #36280c;
  --cat-security: #fb7194;  --cat-security-bg: #3b1526;
  --cat-inspect: #b39bff;   --cat-inspect-bg: #2a1f4f;
  --cat-images: #f08cf5;    --cat-images-bg: #3b1840;
  --cat-audio: #fb9a5e;     --cat-audio-bg: #3d2010;
  --cat-video: #a6dd52;     --cat-video-bg: #22300f;
  --cat-documents: #a9b8cf; --cat-documents-bg: #1f2535;
}

body { background: var(--page-wash), var(--bg); background-attachment: fixed; }
.sidebar { background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: blur(12px); }
.brand-name { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; font-weight: 800; }
.nav a.active { background: var(--grad); color: #fff; box-shadow: var(--glow); }
.nav a.active svg.icon { color: #fff; }
.btn.primary { background: var(--grad); border-color: transparent; color: #fff; box-shadow: var(--glow); }
.btn.primary:hover:not(:disabled) { background: var(--grad); filter: brightness(1.08) saturate(1.1); border-color: transparent; }
.btn.primary:disabled { filter: grayscale(.4); opacity: .55; box-shadow: none; }
.tabs a.active { color: var(--brand); border-image: var(--grad) 1; border-bottom-width: 3px; }
.hero { padding: 22px 24px; border-radius: 16px; background: var(--grad-soft); border: 1px solid var(--border); }
.hero h1 { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.card { border-color: var(--border); }
.stat { position: relative; overflow: hidden; }
.stat::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: var(--grad); }
.tool-card:hover { border-color: transparent; box-shadow: var(--glow); }
.tile { background: linear-gradient(140deg, var(--cat-organize-bg), color-mix(in srgb, var(--cat-organize-bg) 55%, var(--cat-organize))); }
.tile[data-cat="convert-to"] { background: linear-gradient(140deg, var(--cat-convert-to-bg), color-mix(in srgb, var(--cat-convert-to-bg) 55%, var(--cat-convert-to))); }
.tile[data-cat="convert-from"] { background: linear-gradient(140deg, var(--cat-convert-from-bg), color-mix(in srgb, var(--cat-convert-from-bg) 55%, var(--cat-convert-from))); }
.tile[data-cat="edit"] { background: linear-gradient(140deg, var(--cat-edit-bg), color-mix(in srgb, var(--cat-edit-bg) 55%, var(--cat-edit))); }
.tile[data-cat="security"] { background: linear-gradient(140deg, var(--cat-security-bg), color-mix(in srgb, var(--cat-security-bg) 55%, var(--cat-security))); }
.tile[data-cat="inspect"] { background: linear-gradient(140deg, var(--cat-inspect-bg), color-mix(in srgb, var(--cat-inspect-bg) 55%, var(--cat-inspect))); }
.tile[data-cat="images"] { background: linear-gradient(140deg, var(--cat-images-bg), color-mix(in srgb, var(--cat-images-bg) 55%, var(--cat-images))); }
.tile[data-cat="audio"] { background: linear-gradient(140deg, var(--cat-audio-bg), color-mix(in srgb, var(--cat-audio-bg) 55%, var(--cat-audio))); }
.tile[data-cat="video"] { background: linear-gradient(140deg, var(--cat-video-bg), color-mix(in srgb, var(--cat-video-bg) 55%, var(--cat-video))); }
.tile[data-cat="documents"] { background: linear-gradient(140deg, var(--cat-documents-bg), color-mix(in srgb, var(--cat-documents-bg) 55%, var(--cat-documents))); }
.chip.active { background: var(--grad); color: #fff; border-color: transparent; }
.avatar { background: var(--grad); color: #fff; }

/* ---- sign-in page: aurora background, glass card ---- */
.login-page { background: #120a2e; position: relative; isolation: isolate; }
.login-page::before, .login-page::after {
  content: ""; position: fixed; z-index: -1; width: 70vmax; height: 70vmax; border-radius: 50%; filter: blur(90px); opacity: .55;
  animation: aurora 22s ease-in-out infinite alternate;
}
.login-page::before { background: radial-gradient(circle, #7c3aed, transparent 60%); top: -30vmax; left: -20vmax; }
.login-page::after { background: radial-gradient(circle, #ec4899, transparent 60%); bottom: -35vmax; right: -25vmax; animation-delay: -11s; }
@keyframes aurora { from { transform: translate(0, 0) scale(1); } to { transform: translate(8vmax, 6vmax) scale(1.15); } }
@media (prefers-reduced-motion: reduce) { .login-page::before, .login-page::after { animation: none; } }
.login-art { background: radial-gradient(800px 500px at 20% 10%, rgba(124, 58, 237, .65), transparent 60%),
                         radial-gradient(700px 500px at 90% 90%, rgba(14, 165, 233, .45), transparent 60%),
                         radial-gradient(600px 400px at 70% 30%, rgba(236, 72, 153, .45), transparent 60%), transparent; }
.login-art h2 { background: linear-gradient(90deg, #fff, #f5d0fe 60%, #c4b5fd); -webkit-background-clip: text; background-clip: text; color: transparent; }
.login-art li .icon { color: #f0abfc; }
.login-panel { background: transparent; }
.login-card {
  background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(18px);
  border: 1px solid color-mix(in srgb, var(--border) 70%, transparent); border-radius: 20px; padding: 32px;
  box-shadow: 0 30px 80px rgba(10, 4, 40, .45);
}
.login-card h1 { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.login-card .brand-name { font-size: 18px; }
.google-btn:hover { box-shadow: var(--glow); }
.pw-wrap .form { margin-top: 4px; }
@media (max-width: 860px) { .login-panel { padding: 24px 16px; } .login-card { padding: 24px 18px; } }

/* ---- shared bits ---- */
h4.mini { margin: 16px 0 4px; font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-3); }
.small { font-size: 12px; }
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid var(--brand-soft); border-top-color: var(--brand); animation: spin .8s linear infinite; display: inline-block; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.log-tail { max-height: 260px; overflow: auto; font-size: 12px; }
.checks { list-style: none; padding: 0; margin: 8px 0; display: grid; gap: 8px; }
.checks li { display: grid; grid-template-columns: 12px 1fr auto; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); }
.checks .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--ok); }
.checks .lvl-warn .dot { background: var(--warn); }
.checks .lvl-err .dot { background: var(--danger); }
.checks .lvl-info .dot { background: var(--brand); }
.progress-card { border: 1px solid transparent; background: linear-gradient(var(--surface), var(--surface)) padding-box, var(--grad) border-box; }
.act { font-weight: 600; }
.act-auth { color: var(--cat-organize); } .act-tool { color: var(--cat-convert-to); } .act-editor { color: var(--cat-edit); }
.act-user, .act-role { color: var(--cat-inspect); } .act-settings, .act-signin { color: var(--cat-documents); } .act-system { color: var(--cat-security); }
.act-account { color: var(--cat-images); }

/* ---- PDF editor ---- */
.dropzone.big { padding: 48px 20px; }
.feature-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin-top: 16px; }
.feature { display: flex; gap: 10px; padding: 14px; border-radius: 12px; background: var(--grad-soft); border: 1px solid var(--border); }
.feature svg.icon { color: var(--brand); width: 22px; height: 22px; }
.editor-loading { display: flex; gap: 12px; align-items: center; justify-content: center; padding: 80px 0; color: var(--text-2); }
.ed-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 12px; position: sticky; top: 64px; z-index: 20; margin-bottom: 12px; }
.ed-bar select.input { width: auto; }
.ed-file { display: flex; gap: 8px; align-items: center; min-width: 0; }
.ed-file strong { display: block; max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ed-main { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start; }
.ed-pages { display: flex; flex-direction: column; align-items: center; gap: 22px; overflow-x: auto; padding-bottom: 40px; }
.ed-page-block { display: flex; flex-direction: column; gap: 6px; max-width: 100%; }
.ed-page-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ed-ocr { display: inline-flex; gap: 6px; align-items: center; }
.ed-ocr select.input.sm { height: 30px; width: auto; }
.ed-page { position: relative; background: #fff; box-shadow: var(--shadow-lg); border-radius: 4px; overflow: hidden; }
.ed-img { position: absolute; inset: 0; width: 100%; height: 100%; user-select: none; }
.ed-layer { position: absolute; inset: 0; }
.editor.adding .ed-layer { cursor: crosshair; }
.ed-span { position: absolute; padding: 0; margin: 0; border: 0; background: transparent; cursor: text; border-radius: 2px;
  outline: 1px dashed transparent; display: flex; align-items: flex-end; overflow: visible; }
.ed-span:hover { outline-color: color-mix(in srgb, var(--brand) 70%, transparent); background: color-mix(in srgb, var(--brand) 8%, transparent); }
.ed-span.ocr { outline-color: color-mix(in srgb, #0ea5e9 55%, transparent); }
.ed-span.locked { cursor: not-allowed; }
.ed-span.locked:hover { outline-color: rgba(120, 120, 120, .6); background: rgba(120, 120, 120, .08); }
.ed-span.edited { outline: 1.5px solid #f59e0b; }
.ed-span.added { outline: 1.5px dashed #10b981; background: rgba(16, 185, 129, .06); }
.ed-span.sel { outline: 2px solid var(--brand); box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 25%, transparent); }
.ed-preview { white-space: pre; line-height: 1; pointer-events: none; }
.ed-inspector { position: sticky; top: 132px; padding: 16px; display: flex; flex-direction: column; gap: 10px; max-height: calc(100vh - 150px); overflow: auto; }
.ed-inspector h3 { margin: 0; }
textarea.input.ed-text { font-family: var(--font); font-size: 15px; min-height: 72px; resize: vertical; }
.ed-inspector .kv { grid-template-columns: 76px minmax(0, 1fr); }
.ed-inspector .kv dd { word-break: break-word; display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.ed-original { font-size: 12px; word-break: break-word; }
.ed-verdict { font-size: 12.5px; color: var(--text-2); line-height: 1.45; }
.ed-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ed-row .input.num { width: 84px; }
.ed-row input[type="color"].input { width: 48px; padding: 2px; }
.kv.tight dt, .kv.tight dd { padding: 3px 0; }
.swatch { display: inline-block; width: 12px; height: 12px; border-radius: 3px; border: 1px solid var(--border-strong); margin-right: 6px; vertical-align: -1px; }
.ed-legend { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; font-size: 13px; }
.ed-legend .sw { display: inline-block; width: 18px; height: 12px; border-radius: 3px; margin-right: 8px; vertical-align: -1px; }
.ed-legend .sw.edit { outline: 1px dashed var(--brand); }
.ed-legend .sw.edited { outline: 1.5px solid #f59e0b; }
.ed-legend .sw.ocr { outline: 1px dashed #0ea5e9; }
.ed-legend .sw.locked { outline: 1px dashed #888; background: rgba(120, 120, 120, .1); }
.ed-report { padding-left: 0; list-style: none; display: grid; gap: 6px; }
@media (max-width: 1100px) {
  .ed-main { grid-template-columns: 1fr; }
  .ed-inspector { position: static; max-height: none; order: -1; }
  .ed-bar { top: 56px; }
}
/* ---- 1.4.1: full editor - tools, objects, images, pages ---- */
.ed-tools { display: flex; flex-wrap: wrap; gap: 2px; padding: 3px; border-radius: 10px; background: var(--surface-3); }
.ed-tool { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 9px; border: 0; border-radius: 8px; background: transparent; color: var(--text-2); cursor: pointer; font-size: 12.5px; font-weight: 600; }
.ed-tool:hover { background: var(--surface); color: var(--text); }
.ed-tool.on { background: var(--grad); color: #fff; box-shadow: var(--glow); }
.ed-tool svg.icon { width: 16px; height: 16px; }
@media (max-width: 1400px) { .ed-tool span { display: none; } .ed-tool { padding: 0 8px; } }
.ed-draw { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.ed-draw .ed-obj, .ed-draw .ed-handle { pointer-events: auto; cursor: move; }
.ed-draw .ed-handle { fill: #fff; stroke: var(--brand); stroke-width: 1.5; vector-effect: non-scaling-stroke; cursor: nwse-resize; }
.ed-draw .ed-selbox { fill: none; stroke: var(--brand); stroke-dasharray: 4 3; stroke-width: 1; vector-effect: non-scaling-stroke; pointer-events: none; }
.editor:not([data-tool="select"]) .ed-draw { pointer-events: all; cursor: crosshair; }
.editor[data-tool="text"] .ed-draw { cursor: text; }
.editor[data-tool="image"] .ed-draw { cursor: copy; }
.editor:not([data-tool="select"]) .ed-layer { pointer-events: none; }
.ed-imgbox { position: absolute; padding: 0; border: 0; background: transparent; cursor: pointer; outline: 1px dashed transparent; overflow: hidden; }
.ed-imgbox:hover { outline-color: #10b981; background: rgba(16, 185, 129, .08); }
.ed-imgbox.sel { outline: 2px solid var(--brand); }
.ed-imgbox.locked { cursor: not-allowed; }
.ed-imgbox.ed-delete { background: repeating-linear-gradient(45deg, rgba(220, 38, 38, .18) 0 8px, rgba(255, 255, 255, .55) 8px 16px); outline: 1.5px solid #dc2626; }
.ed-removed { position: absolute; inset: auto 4px 4px auto; font-size: 11px; font-weight: 700; color: #fff; background: #dc2626; padding: 1px 6px; border-radius: 999px; }
.ed-replaced { width: 100%; height: 100%; object-fit: fill; display: block; background: #fff; }
.ed-page.deleted { opacity: .35; filter: grayscale(1); }
.ed-pagetools { display: inline-flex; align-items: center; gap: 2px; }
.ed-pagetools .icon-btn { width: 28px; height: 28px; }
.ed-legend .sw.img { outline: 1px dashed #10b981; }
.grid-even.tight { gap: 4px 16px; margin-bottom: 4px; }
.plan-out { margin: 8px 0; }
.fail-banner { align-items: flex-start; }
.fail-banner .log-tail { margin-top: 8px; max-height: 320px; }
.plain-list { margin: 4px 0 8px; padding-left: 18px; display: grid; gap: 4px; font-size: 13px; }

/* ---- 1.5.0: select text, comments, redaction, clipboard, undo ---- */
.editor[data-tool="textsel"] .ed-draw { pointer-events: none; cursor: auto; }
.editor[data-tool="textsel"] .ed-layer { pointer-events: auto; cursor: text; user-select: text; -webkit-user-select: text; }
.editor[data-tool="note"] .ed-draw { cursor: cell; }
.ed-ch { position: absolute; display: block; margin: 0; padding: 0; color: transparent; white-space: pre; line-height: 1; overflow: hidden; cursor: text; user-select: text; -webkit-user-select: text; }
.ed-ch::selection { background: rgba(37, 99, 235, .32); color: transparent; }
.ed-br { display: none; }
.ed-seltools { position: absolute; z-index: 6; display: flex; flex-wrap: wrap; gap: 2px; padding: 4px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-lg); max-width: calc(100% - 8px); }
.ed-st { display: inline-flex; align-items: center; gap: 5px; height: 30px; padding: 0 8px; border: 0; border-radius: 8px; background: transparent; color: var(--text); font-size: 12.5px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.ed-st:hover { background: var(--surface-3); }
.ed-st.danger { color: var(--danger); }
.ed-st svg.icon { width: 15px; height: 15px; }
@media (max-width: 900px) { .ed-st span { display: none; } }
.ed-hist { display: inline-flex; gap: 2px; }
.ed-hist .icon-btn:disabled { opacity: .35; cursor: default; }
.ed-draw .ed-ann { cursor: pointer; }
.ed-annot { position: absolute; padding: 0; border: 0; background: transparent; cursor: pointer; border-radius: 2px; outline: 1px dashed transparent; }
.ed-annot:hover { outline-color: #7c3aed; background: rgba(124, 58, 237, .08); }
.ed-annot.sel { outline: 2px solid #7c3aed; }
.ed-annot.gone { outline: 1.5px solid var(--danger); background: repeating-linear-gradient(45deg, rgba(220, 38, 38, .22) 0 6px, transparent 6px 12px); }
.ed-quote { margin: 0; padding: 6px 10px; border-left: 3px solid var(--brand); background: var(--surface-3); border-radius: 0 8px 8px 0; font-size: 13px; color: var(--text-2); white-space: pre-wrap; word-break: break-word; }
.ed-comments { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.ed-comments li { padding: 6px 8px; border-radius: 8px; cursor: pointer; border: 1px solid var(--border); }
.ed-comments li:hover { background: var(--surface-3); }
.ed-comments li.gone { opacity: .5; text-decoration: line-through; }
.ed-cm-text { margin-top: 2px; word-break: break-word; }
.ed-draw .ed-hl { mix-blend-mode: multiply; }

/* ---- 1.6.0: desktop-style PDF editor (modes, thumbnails, panel, in-place typing, find, organize) ---- */
.ed-shell { display: flex; flex-direction: column; min-height: 480px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; box-shadow: var(--shadow); }
.editor.ed-full .ed-shell { position: fixed; inset: 0; z-index: 900; border-radius: 0; border: 0; height: auto !important; }
.ed-top { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.ed-file { display: flex; align-items: center; gap: 8px; min-width: 0; max-width: 260px; }
.ed-file > svg.icon { color: var(--brand); flex: none; }
.ed-file-txt { min-width: 0; }
.ed-file-txt strong { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ed-tabs { display: inline-flex; gap: 2px; padding: 3px; background: var(--surface-3); border-radius: 11px; }
.ed-tab { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border: 0; border-radius: 8px; background: transparent; color: var(--text-2); font-weight: 600; font-size: 13px; cursor: pointer; white-space: nowrap; }
.ed-tab:hover { color: var(--text); background: var(--surface); }
.ed-tab.on { background: var(--grad); color: #fff; box-shadow: var(--glow); }
.ed-tab svg.icon { width: 16px; height: 16px; }
.ed-counter { font-size: 12.5px; white-space: nowrap; padding: 0 4px; }
.ed-toolrow { display: flex; align-items: center; gap: 6px; padding: 5px 10px; border-bottom: 1px solid var(--border); background: var(--surface-2); flex-wrap: wrap; }
.ed-toolrow .ed-tools { background: transparent; padding: 0; }
.ed-hint { font-size: 12px; min-width: 0; flex: 1 1 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ed-sep { width: 1px; height: 22px; background: var(--border); margin: 0 4px; align-self: center; }
.ed-nav, .ed-zoom { display: inline-flex; align-items: center; gap: 3px; }
.ed-pagein { width: 46px; text-align: center; height: 30px; padding: 0 4px; }
select.input.ed-zoomsel { width: auto; height: 30px; padding-top: 0; padding-bottom: 0; }
.ed-body { position: relative; flex: 1; min-height: 0; display: grid; grid-template-columns: 150px minmax(0, 1fr) 300px; }
.ed-shell.no-thumbs .ed-body { grid-template-columns: minmax(0, 1fr) 300px; }
.ed-shell.no-panel .ed-body { grid-template-columns: 150px minmax(0, 1fr); }
.ed-shell.no-thumbs.no-panel .ed-body { grid-template-columns: minmax(0, 1fr); }
.ed-shell.no-thumbs .ed-thumbs, .ed-shell.no-panel .ed-panel { display: none; }
.ed-warn { margin: 8px 12px 0; }
.ed-thumbs { position: relative; overflow-y: auto; padding: 12px 10px; display: flex; flex-direction: column; gap: 10px; border-right: 1px solid var(--border); background: var(--surface); }
.ed-thumb { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 6px; border: 0; background: transparent; border-radius: 10px; cursor: pointer; color: inherit; }
.ed-thumb:hover { background: var(--surface-3); }
.ed-thumb-img { width: 100%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); outline: 2px solid transparent; outline-offset: 1px; border-radius: 2px; overflow: hidden; display: flex; align-items: center; justify-content: center; }
.ed-thumb-img img { width: 100%; height: 100%; object-fit: contain; display: block; }
.ed-thumb.on .ed-thumb-img { outline-color: var(--brand); }
.ed-thumb.on .ed-thumb-no { color: var(--brand); font-weight: 700; }
.ed-thumb.deleted { opacity: .4; }
.ed-thumb.blank .ed-thumb-img { aspect-ratio: 3 / 4; }
.ed-thumb-no { font-size: 12px; color: var(--text-2); }
.ed-stage { position: relative; min-width: 0; min-height: 0; display: flex; flex-direction: column; background: var(--surface-3); }
.ed-viewport { position: relative; flex: 1; min-height: 0; overflow: auto; outline: none; }
.ed-viewport .ed-pages { gap: 18px; padding: 18px 24px 80px; min-width: max-content; overflow: visible; }
.ed-viewport .ed-page-block { max-width: none; }
.ed-viewport .ed-page { box-shadow: 0 2px 12px rgba(15, 23, 42, .18); border-radius: 2px; }
.ed-page-no { font-size: 12px; color: var(--text-2); font-weight: 600; }
.ed-page-head { min-height: 30px; }
.ed-blank { display: flex; align-items: center; justify-content: center; background: #fff; }
.ed-inline-host { position: absolute; inset: 0; pointer-events: none; }
.ed-inline { position: absolute; pointer-events: auto; white-space: pre; padding: 0; margin: 0; cursor: text; transform-origin: left center; caret-color: var(--brand);
  outline: 1.5px solid var(--brand); outline-offset: 1px; border-radius: 1px; box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 16%, transparent); }
.ed-inline.add:empty::before { content: attr(data-placeholder); color: #9ca3af; }
.ed-span { align-items: center; }
.ed-span .ed-preview { transform-origin: left center; }
.ed-span.passive, .ed-imgbox.passive { pointer-events: none; outline: 0 !important; }
.ed-span.edited:not(.sel) { outline: 1px solid rgba(245, 158, 11, .5); }
.ed-span.passive.edited { outline: 0; }
.editor[data-layer="text"] .ed-draw { pointer-events: none; cursor: auto; }
.editor[data-layer="text"] .ed-layer { pointer-events: auto; cursor: text; user-select: text; -webkit-user-select: text; }
.editor[data-layer="text"] .ed-draw .ed-obj { pointer-events: auto; cursor: pointer; }
.editor[data-layer="text"] .ed-draw .ed-ann.markup { pointer-events: none; }
.editor[data-tool="redact"] .ed-draw .ed-obj:not(.pickable-redact) { pointer-events: none; }
.ed-draw .as-comment { filter: drop-shadow(0 0 1.5px rgba(124, 58, 237, .7)); }
.ed-draw .h-n, .ed-draw .h-s { cursor: ns-resize; }
.ed-draw .h-e, .ed-draw .h-w { cursor: ew-resize; }
.ed-draw .h-ne, .ed-draw .h-sw { cursor: nesw-resize; }
.ed-find { position: absolute; top: 10px; right: 18px; z-index: 8; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 6px 8px; display: flex; flex-direction: column; gap: 6px; max-width: calc(100% - 36px); }
.ed-find-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.ed-find-row > svg.icon { color: var(--text-3); width: 16px; height: 16px; }
.ed-find-row .input { width: 220px; height: 30px; }
.ed-find-count { min-width: 74px; text-align: center; }
.ed-hit { position: absolute; pointer-events: none; background: rgba(250, 204, 21, .38); border-radius: 2px; mix-blend-mode: multiply; }
.ed-hit.cur { background: rgba(249, 115, 22, .45); outline: 2px solid #f97316; }
.ed-hit.done { background: rgba(16, 185, 129, .28); }
.ed-toggle { min-width: 30px; height: 30px; padding: 0 8px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text-2); font-weight: 700; cursor: pointer; }
.ed-toggle:hover { color: var(--text); }
.ed-toggle.on { background: var(--brand-soft); color: var(--brand); border-color: color-mix(in srgb, var(--brand) 45%, transparent); }
.ed-toggle.i { font-style: italic; font-family: Georgia, serif; }
.icon-btn.on { color: var(--brand); background: var(--brand-soft); }
.icon-btn.sm { width: 28px; height: 28px; }
.ed-panel { overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 12px; border-left: 1px solid var(--border); background: var(--surface); }
.ed-panel-head { display: flex; align-items: flex-start; gap: 10px; }
.ed-panel-head h3 { margin: 0; font-size: 15px; }
.ed-panel-head > svg.icon { width: 20px; height: 20px; color: var(--brand); margin-top: 2px; flex: none; }
.ed-fmt { display: grid; grid-template-columns: 46px minmax(0, 1fr); gap: 8px 10px; align-items: center; }
.ed-fmt .lbl { margin: 0; }
.ed-fmt .input.num { width: 72px; }
.input.ed-color { width: 42px; height: 30px; padding: 2px; }
.ed-tips { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.ed-tips li { display: flex; gap: 10px; font-size: 13px; }
.ed-tips svg.icon { color: var(--brand); flex: none; margin-top: 2px; width: 18px; height: 18px; }
.ed-kinds { display: flex; gap: 4px; }
.ed-swatches { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.ed-swatch { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--border-strong); cursor: pointer; padding: 0; }
.ed-keys td { padding: 6px 8px; vertical-align: top; }
.ed-keys kbd { font-family: var(--mono); font-size: 12px; background: var(--surface-2); border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 6px; padding: 1px 6px; white-space: nowrap; }
.ed-org { flex: 1; min-height: 0; overflow: auto; padding: 22px 30px 60px; }
.ed-org-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 24px 30px; }
.ed-card { position: relative; display: flex; flex-direction: column; gap: 8px; padding: 10px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; cursor: grab; transition: box-shadow .15s; }
.ed-card:hover { box-shadow: var(--shadow-lg); }
.ed-card:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.ed-card.dragging { opacity: .4; }
.ed-card.drop-before { box-shadow: -5px 0 0 0 var(--brand); }
.ed-card.drop-after { box-shadow: 5px 0 0 0 var(--brand); }
.ed-card.deleted .ed-card-img { opacity: .35; filter: grayscale(1); }
.ed-card-img { background: #fff; border-radius: 2px; box-shadow: 0 1px 4px rgba(0, 0, 0, .2); display: flex; align-items: center; justify-content: center; overflow: hidden; width: 100%; }
.ed-card-img img { width: 100%; height: 100%; object-fit: contain; transition: transform .2s; }
.ed-card-img.blank { aspect-ratio: 3 / 4; }
.ed-card-foot { display: flex; align-items: center; gap: 2px; }
.ed-card-foot .icon-btn { width: 28px; height: 28px; }
.ed-card-foot strong { margin-right: 4px; }
.ed-card-move { position: absolute; top: 16px; left: 16px; right: 16px; display: flex; justify-content: space-between; opacity: 0; transition: opacity .15s; pointer-events: none; }
.ed-card:hover .ed-card-move, .ed-card:focus-within .ed-card-move { opacity: 1; }
.ed-card-move .icon-btn { pointer-events: auto; background: var(--surface); box-shadow: var(--shadow); width: 28px; height: 28px; }
.ed-card-insert { position: absolute; right: -26px; top: 38%; width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--border); background: var(--surface); color: var(--brand); display: flex; align-items: center; justify-content: center; padding: 0; cursor: pointer; opacity: 0; transition: opacity .15s; z-index: 2; }
.ed-card:hover .ed-card-insert, .ed-card-insert:focus-visible { opacity: 1; }
.ed-card-insert svg.icon { width: 14px; height: 14px; }
@media (max-width: 1500px) { .ed-tab span { display: none; } .ed-tab.on span { display: inline; } }
@media (max-width: 1100px) {
  .ed-body, .ed-shell.no-thumbs .ed-body, .ed-shell.no-panel .ed-body { grid-template-columns: minmax(0, 1fr); }
  .ed-thumbs { display: none; }
  .ed-panel { position: absolute; top: 0; right: 0; bottom: 0; width: min(320px, 92%); z-index: 9; box-shadow: var(--shadow-lg); }
  .ed-hint { display: none; }
}/* the tool row stays on one line: labels only for the active tool when space is short */
@media (max-width: 1750px) { .ed-toolrow .ed-tool:not(.on) span { display: none; } .ed-toolrow .ed-tool:not(.on) { padding: 0 8px; } }
@media (min-width: 1401px) and (max-width: 1750px) { .ed-toolrow .ed-tool.on span { display: inline; } }
@media (max-width: 700px) {
  .ed-top { gap: 4px; padding: 6px 8px; }
  .ed-top .ed-counter, .ed-top [aria-label="Keyboard shortcuts"], .ed-file .muted { display: none; }
  .ed-toolrow { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .ed-toolrow .ed-tools { flex-wrap: nowrap; }
  .ed-toolrow > [aria-label="Toggle page thumbnails"], .ed-fullbtn { display: none; }
  .ed-toolrow > * { flex: none; }
  .ed-viewport .ed-pages { padding: 10px 8px 60px; }
}

/* ---- 1.7.0: PDF Studio - panel tabs, tools, fill & sign, forms, crop, versions, compare, full screen ---- */
.editor:fullscreen { background: var(--bg, var(--surface)); overflow: hidden; }
.editor:fullscreen .ed-shell { border-radius: 0; border: 0; height: 100vh !important; }
.btn.ed-alltools { height: 32px; }
.ed-busy { position: absolute; left: 50%; top: 110px; transform: translateX(-50%); z-index: 20; display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-lg); font-weight: 600; font-size: 13px; }
.ed-shell { position: relative; }
.ed-ptabs { display: flex; gap: 2px; padding: 3px; background: var(--surface-3); border-radius: 10px; margin: -2px 0 2px; }
.ed-ptab { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 5px; height: 30px; border: 0; border-radius: 8px; background: transparent; color: var(--text-2); font-size: 12px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.ed-ptab svg.icon { width: 14px; height: 14px; }
.ed-ptab.on { background: var(--surface); color: var(--brand); box-shadow: var(--shadow); }
.ed-toollist { display: flex; flex-direction: column; gap: 14px; }
.ed-toolgroup { display: flex; flex-direction: column; gap: 2px; }
.ed-toolgroup .nav-label { display: flex; align-items: center; gap: 6px; margin: 0 0 4px; }
.ed-toolgroup .nav-label svg.icon { width: 14px; height: 14px; }
.ed-toolitem { display: flex; gap: 10px; align-items: flex-start; text-align: left; padding: 7px 8px; border: 0; border-radius: 10px; background: transparent; cursor: pointer; color: inherit; }
.ed-toolitem:hover { background: var(--surface-3); }
.ed-toolitem .n { font-weight: 600; font-size: 13px; }
.ed-toolitem .d { font-size: 12px; color: var(--text-3); line-height: 1.35; }
.ed-runstatus { min-height: 18px; }
.ed-versions { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.ed-versions li { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 10px; }
.ed-versions li.cur { border-color: var(--brand); background: var(--brand-soft); }
.ed-recent { margin-top: 16px; }
.ed-field { position: absolute; display: flex; border-radius: 2px; background: rgba(219, 234, 254, .55); outline: 1px solid rgba(59, 130, 246, .55); }
.ed-field.changed { background: rgba(254, 243, 199, .7); outline-color: #f59e0b; }
.ed-field input, .ed-field textarea, .ed-field select { width: 100%; height: 100%; border: 0; background: transparent; padding: 0 3px; font-family: Helvetica, Arial, sans-serif; color: #111; resize: none; outline: none; }
.ed-field textarea { padding-top: 2px; }
.ed-field input:focus, .ed-field textarea:focus, .ed-field select:focus { background: rgba(255, 255, 255, .85); box-shadow: inset 0 0 0 2px var(--brand); }
.ed-field.t-checkbox button, .ed-field.t-radio button { width: 100%; height: 100%; border: 0; padding: 0; background: transparent; cursor: pointer; color: #111; line-height: 1; font-weight: 700; }
.ed-field.t-radio { border-radius: 50%; }
.ed-field.t-radio button.on::after { content: ""; display: block; width: 50%; height: 50%; margin: 25%; border-radius: 50%; background: #111; }
.ed-field button.sig { display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%; height: 100%; border: 1.5px dashed #d97706; background: rgba(254, 243, 199, .6); color: #92400e; font-weight: 700; font-size: 12px; cursor: pointer; border-radius: 3px; }
.ed-field-old { position: absolute; padding: 0 3px; border: 1.5px solid #7c3aed; background: rgba(124, 58, 237, .08); color: #5b21b6; font-size: 10px; text-align: left; overflow: hidden; white-space: nowrap; cursor: pointer; border-radius: 2px; }
.ed-field-old.sel { box-shadow: 0 0 0 3px rgba(124, 58, 237, .3); }
.ed-field-old.gone { border-color: var(--danger); background: repeating-linear-gradient(45deg, rgba(220, 38, 38, .2) 0 5px, transparent 5px 10px); color: var(--danger); text-decoration: line-through; }
.ed-draw .ed-fieldbox { fill: rgba(124, 58, 237, .1); stroke: #7c3aed; stroke-width: 1.2; stroke-dasharray: 3 2; vector-effect: non-scaling-stroke; }
.ed-draw .ed-fieldtxt { fill: #5b21b6; font-family: Arial, sans-serif; pointer-events: none; }
.editor[data-mode="forms"] .ed-draw { cursor: crosshair; }
.editor[data-mode="forms"][data-tool="fselect"] .ed-draw { cursor: default; }
.editor[data-mode="fill"][data-tool="fill"] .ed-draw { pointer-events: none; }
.editor[data-mode="fill"][data-tool="fill"] .ed-draw .ed-obj { pointer-events: auto; }
.editor[data-mode="fill"] .ed-layer { pointer-events: auto; }
.editor[data-mode="forms"] .ed-layer { pointer-events: auto; }
.editor[data-mode="forms"]:not([data-tool="fselect"]) .ed-layer { pointer-events: none; }
.ed-draw .ed-cropshade { fill: rgba(15, 23, 42, .45); pointer-events: none; }
.ed-draw .ed-cropline { fill: none; stroke: #fff; stroke-width: 1.5; stroke-dasharray: 6 4; vector-effect: non-scaling-stroke; pointer-events: none; }
.ed-draw .ed-imgproxy { fill: transparent; stroke: var(--brand); stroke-width: 1.5; stroke-dasharray: 5 3; vector-effect: non-scaling-stroke; cursor: move; }
.ed-vacated { position: absolute; background: repeating-linear-gradient(45deg, #eef2f7 0 6px, #ffffff 6px 12px); outline: 1px dashed #94a3b8; pointer-events: none; }
.ed-imgbox.ed-move { outline: 1.5px solid var(--brand); }
.ed-card-check { position: absolute; top: 14px; left: 50%; transform: translateX(-50%); width: 18px; height: 18px; z-index: 3; cursor: pointer; }
.ed-card.picked { outline: 2px solid var(--brand); outline-offset: 1px; }
.ed-tool.danger { color: var(--danger); }
.ed-sig { display: flex; flex-direction: column; gap: 12px; }
.ed-sigpad { width: 100%; aspect-ratio: 600 / 180; border: 1.5px dashed var(--border-strong); border-radius: 12px; background: #fff; touch-action: none; cursor: crosshair; }
.ed-sig-extra .input { min-width: 0; flex: 1; }
.ed-sig-saved { display: flex; flex-wrap: wrap; gap: 8px; }
.ed-sig-saved img { height: 44px; max-width: 160px; object-fit: contain; background: #fff; border: 1px solid var(--border); border-radius: 8px; padding: 4px; }
.ed-sig-item { display: flex; align-items: center; gap: 2px; }
.ed-sig-pick { border: 0; padding: 0; background: transparent; cursor: pointer; }
.ed-sig-pick:hover img { outline: 2px solid var(--brand); }
.ed-cmp { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.ed-cmp-bar { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-bottom: 1px solid var(--border); background: var(--surface); flex-wrap: wrap; }
.ed-cmp-heads { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 6px 12px 0; font-size: 12px; font-weight: 600; color: var(--text-2); }
.ed-cmp-heads div { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ed-cmp-cols { flex: 1; min-height: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 6px 8px 0; }
.ed-cmp-col { overflow: auto; padding: 6px 6px 60px; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.ed-cmp-block { display: flex; flex-direction: column; gap: 4px; }
.ed-cmp-page { position: relative; background: #fff; box-shadow: 0 2px 10px rgba(15, 23, 42, .18); }
.ed-cmp-page img { width: 100%; height: 100%; display: block; }
.ed-cmp-mark { position: absolute; border-radius: 2px; mix-blend-mode: multiply; }
.ed-cmp-mark.m-changed { background: rgba(245, 158, 11, .4); outline: 1px solid #d97706; }
.ed-cmp-mark.m-removed { background: rgba(239, 68, 68, .35); outline: 1px solid #dc2626; }
.ed-cmp-mark.m-added { background: rgba(34, 197, 94, .35); outline: 1px solid #16a34a; }
.ed-cmp-mark.m-visual { outline: 2px dashed #6366f1; mix-blend-mode: normal; }
.chip.c-changed { background: rgba(245, 158, 11, .18); color: #92400e; }
.chip.c-removed { background: rgba(239, 68, 68, .15); color: #991b1b; }
.chip.c-added { background: rgba(34, 197, 94, .15); color: #166534; }
.chip.c-visual { background: rgba(99, 102, 241, .15); color: #3730a3; }
@media (max-width: 1750px) { .ed-tab span { display: none; } .ed-tab.on span { display: inline; } .ed-closebtn span { display: none; } .ed-tab { padding: 0 10px; } }
/* ---- 1.7.1: the release being installed ---- */
.release-card { margin-top: 12px; padding: 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); display: flex; flex-direction: column; gap: 10px; }
.release-card.upgrade { border-color: color-mix(in srgb, var(--ok) 45%, var(--border)); }
.release-card.same { border-color: color-mix(in srgb, var(--warn) 50%, var(--border)); }
.release-card.older, .release-card.bad { border-color: color-mix(in srgb, var(--danger) 50%, var(--border)); }
.release-row { display: flex; align-items: center; gap: 10px; }
.release-versions { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.release-v { font-size: 22px; font-weight: 800; letter-spacing: -.01em; }
.release-v.new { color: var(--brand); }
.release-notes { max-height: 280px; overflow: auto; font-size: 13px; }
.release-notes ul { margin: 4px 0 10px; padding-left: 18px; }
.release-notes li { margin: 2px 0; }
.release-notes p { margin: 4px 0; }

/* =====================================================================
   1.8: accent colours (Appearance). data-theme is always set by JS, so each
   accent has a light and a dark rule; violet keeps the 1.4 tokens above.
   ===================================================================== */
:root[data-theme="light"]:not([data-accent="violet"]) {
  --bg: #f5f6f8; --surface: #ffffff; --surface-2: #f8f9fb; --surface-3: #eef0f4;
  --border: #e3e6eb; --border-strong: #cfd4dc;
  --text: #121620; --text-2: #4a5263; --text-3: #6b7385;
  --brand-ink: #ffffff;
  --grad: linear-gradient(135deg, var(--a1) 0%, var(--a2) 48%, var(--a3) 100%);
  --grad-soft: linear-gradient(135deg, color-mix(in srgb, var(--a1) 12%, transparent), color-mix(in srgb, var(--a2) 10%, transparent) 50%, color-mix(in srgb, var(--a3) 12%, transparent));
  --glow: 0 10px 30px color-mix(in srgb, var(--brand) 22%, transparent);
  --page-wash: radial-gradient(900px 500px at 100% -10%, color-mix(in srgb, var(--a3) 9%, transparent), transparent 60%),
               radial-gradient(900px 600px at -10% 0%, color-mix(in srgb, var(--a1) 11%, transparent), transparent 60%);
}
:root[data-theme="dark"]:not([data-accent="violet"]) {
  --bg: #0e1015; --surface: #161920; --surface-2: #1b1f27; --surface-3: #232833;
  --border: #2a303c; --border-strong: #3a4250;
  --text: #eef0f4; --text-2: #b5bccb; --text-3: #8b93a4;
  --grad: linear-gradient(135deg, var(--a1) 0%, var(--a2) 48%, var(--a3) 100%);
  --grad-soft: linear-gradient(135deg, color-mix(in srgb, var(--a1) 18%, transparent), color-mix(in srgb, var(--a2) 14%, transparent) 50%, color-mix(in srgb, var(--a3) 16%, transparent));
  --glow: 0 10px 30px color-mix(in srgb, var(--brand) 28%, transparent);
  --page-wash: radial-gradient(900px 500px at 100% -10%, color-mix(in srgb, var(--a3) 13%, transparent), transparent 60%),
               radial-gradient(900px 600px at -10% 0%, color-mix(in srgb, var(--a1) 16%, transparent), transparent 60%);
}
:root[data-accent="indigo"] { --a1: #4f46e5; --a2: #6366f1; --a3: #0284c7; }
:root[data-accent="blue"] { --a1: #2563eb; --a2: #0284c7; --a3: #0891b2; }
:root[data-accent="teal"] { --a1: #0d9488; --a2: #0891b2; --a3: #2563eb; }
:root[data-accent="green"] { --a1: #15803d; --a2: #047857; --a3: #0f766e; }
:root[data-accent="amber"] { --a1: #b45309; --a2: #c2410c; --a3: #be123c; }
:root[data-accent="rose"] { --a1: #e11d48; --a2: #db2777; --a3: #9333ea; }
:root[data-accent="pink"] { --a1: #db2777; --a2: #c026d3; --a3: #7c3aed; }
:root[data-accent="graphite"] { --a1: #475569; --a2: #334155; --a3: #1e293b; }
:root[data-theme="light"][data-accent="indigo"] { --brand: #4338ca; --brand-hover: #3730a3; --brand-soft: #e8e9fe; --focus: #4f46e5; }
:root[data-theme="light"][data-accent="blue"] { --brand: #1d4ed8; --brand-hover: #1e40af; --brand-soft: #e3edff; --focus: #2563eb; }
:root[data-theme="light"][data-accent="teal"] { --brand: #0f766e; --brand-hover: #115e59; --brand-soft: #d9f4ef; --focus: #0d9488; }
:root[data-theme="light"][data-accent="green"] { --brand: #15803d; --brand-hover: #166534; --brand-soft: #dcf5e4; --focus: #16a34a; }
:root[data-theme="light"][data-accent="amber"] { --brand: #b45309; --brand-hover: #92400e; --brand-soft: #fdf0d8; --focus: #d97706; }
:root[data-theme="light"][data-accent="rose"] { --brand: #be123c; --brand-hover: #9f1239; --brand-soft: #ffe4e9; --focus: #e11d48; }
:root[data-theme="light"][data-accent="pink"] { --brand: #be185d; --brand-hover: #9d174d; --brand-soft: #fde5f1; --focus: #db2777; }
:root[data-theme="light"][data-accent="graphite"] { --brand: #334155; --brand-hover: #1e293b; --brand-soft: #e8ecf2; --focus: #475569; }
:root[data-theme="dark"][data-accent="indigo"] { --brand: #a5b4fc; --brand-hover: #c7d2fe; --brand-soft: #1f2347; --brand-ink: #0d1030; --focus: #c7d2fe; }
:root[data-theme="dark"][data-accent="blue"] { --brand: #7cb0ff; --brand-hover: #a7c8ff; --brand-soft: #172a4a; --brand-ink: #0a1428; --focus: #a7c8ff; }
:root[data-theme="dark"][data-accent="teal"] { --brand: #2dd4bf; --brand-hover: #5eead4; --brand-soft: #0f2f2c; --brand-ink: #04201c; --focus: #5eead4; }
:root[data-theme="dark"][data-accent="green"] { --brand: #5ee08a; --brand-hover: #86efac; --brand-soft: #12301d; --brand-ink: #062010; --focus: #86efac; }
:root[data-theme="dark"][data-accent="amber"] { --brand: #fbbf24; --brand-hover: #fcd34d; --brand-soft: #33270c; --brand-ink: #201400; --focus: #fcd34d; }
:root[data-theme="dark"][data-accent="rose"] { --brand: #fb7194; --brand-hover: #fda4af; --brand-soft: #3a1522; --brand-ink: #24060f; --focus: #fda4af; }
:root[data-theme="dark"][data-accent="pink"] { --brand: #f472b6; --brand-hover: #f9a8d4; --brand-soft: #3a1530; --brand-ink: #24061a; --focus: #f9a8d4; }
:root[data-theme="dark"][data-accent="graphite"] { --brand: #cbd5e1; --brand-hover: #e2e8f0; --brand-soft: #232a36; --brand-ink: #0f141c; --focus: #e2e8f0; }

.appearance .lbl { margin: 4px 0 8px; }
.appearance .seg { margin-bottom: 18px; }
.appearance .seg button { display: inline-flex; align-items: center; gap: 6px; }
.appearance .seg .icon { width: 15px; height: 15px; }
.accent-opts { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
.accent-opt { display: flex; align-items: center; gap: 9px; padding: 9px 10px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text); font: inherit; font-size: 13px; cursor: pointer; text-align: left; }
.accent-opt:hover { border-color: var(--border-strong); }
.accent-opt.on { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand); font-weight: 600; }
.accent-opt .dot { width: 18px; height: 18px; border-radius: 50%; flex: none; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .12); }
.accent-opt .icon { width: 15px; height: 15px; margin-left: auto; color: var(--brand); }
.accent-opt:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.ws-mode { display: flex; align-items: center; gap: 16px; margin-bottom: 16px; }
.switch-field { display: flex; align-items: center; gap: 16px; }
.dim { opacity: .45; pointer-events: none; }