/* NFC Tag Generator — one stylesheet for the generator and /dash. */

:root {
  --accent: #f2591a;
  --on-accent: #16130f;
  --bg: #f1eee8;
  --panel: #fbfaf7;
  --raised: #ffffff;
  --stage: #e7e3db;
  --ink: #1c1a17;
  --muted: #655f56;
  --line: #d9d4c9;
  --line-strong: #bdb6a8;
  --danger: #b3261e;
  --ok: #1d6b3a;
  --shadow: 0 1px 2px rgba(40, 30, 10, .08), 0 8px 24px rgba(40, 30, 10, .07);
  --radius: 10px;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #131211;
  --panel: #1a1917;
  --raised: #23211e;
  --stage: #0d0c0b;
  --ink: #efebe4;
  --muted: #a39c90;
  --line: #322f2a;
  --line-strong: #4a463f;
  --danger: #ff8a80;
  --ok: #7fd49b;
  --shadow: 0 1px 2px rgba(0, 0, 0, .5), 0 10px 28px rgba(0, 0, 0, .4);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.45 var(--sans);
}
h1, h2, p, ul { margin: 0; }
ul { padding: 0; list-style: none; }
a { color: inherit; }
[hidden] { display: none !important; }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.muted { color: var(--muted); }
.hint { color: var(--muted); font-size: 12.5px; line-height: 1.4; }

/* ------------------------------------------------------------------ topbar */
.topbar {
  height: 52px;
  display: flex; align-items: center; gap: 20px;
  padding: 0 16px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
}
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 650; letter-spacing: -.01em; text-decoration: none; white-space: nowrap; }
.brand-logo { display: inline-flex; flex: none; }
.brand-logo img { width: 34px; height: 34px; display: block; }
.brand-logo .logo-dark, [data-theme="dark"] .brand-logo .logo-light { display: none; }
[data-theme="dark"] .brand-logo .logo-dark { display: block; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.topbar-actions form { margin: 0; }
.save-state { font-size: 13px; color: var(--muted); }
.link-btn { padding: 0; border: 0; background: none; color: inherit; font: inherit; text-decoration: underline; cursor: pointer; }

/* ---------------------------------------------------------------- projects */
.projects {
  width: min(560px, calc(100vw - 32px)); max-height: min(640px, calc(100vh - 48px));
  padding: 16px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--panel); color: var(--ink);
}
.projects::backdrop { background: rgba(0, 0, 0, .45); }
.projects-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.projects-head h2 { font-size: 17px; margin: 0; }
.dropzone p.dropzone-or { margin-top: 14px; }
.dropzone-or .link-btn { color: var(--accent); font-weight: 600; }
.library { width: min(720px, calc(100vw - 32px)); }
.library-search { width: 100%; min-height: 38px; padding: 0 10px; margin-bottom: 12px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--raised); color: inherit; font: inherit; }
.library-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.library-item { width: 100%; display: grid; justify-items: center; gap: 6px; padding: 10px 6px 8px; border: 1px solid var(--line); border-radius: 8px; background: none; color: inherit; font: inherit; font-size: 12.5px; cursor: pointer; }
.library-item:hover, .library-item:focus-visible { border-color: var(--accent); }
.library-item:disabled { opacity: .5; cursor: progress; }
/* the artwork is black line art, so it always sits on a white tile */
.library-item img { width: 56px; height: 56px; padding: 6px; border-radius: 6px; background: #fff; object-fit: contain; }
.library-item span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.project-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.project { display: flex; align-items: center; gap: 10px; padding: 8px; border: 1px solid var(--line); border-radius: 8px; }
.project.is-current { border-color: var(--accent); }
.project-open { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; text-decoration: none; color: inherit; }
.project-open img, .project-nothumb { width: 56px; height: 56px; flex: none; border-radius: 6px; background: var(--stage); object-fit: cover; }
.project-text { min-width: 0; display: grid; gap: 2px; }
.project-text b { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.project-text small { color: var(--muted); font-size: 12.5px; }
.icon-btn {
  width: 36px; height: 36px; display: grid; place-items: center;
  border: 1px solid var(--line); border-radius: 50%; background: transparent; cursor: pointer;
}
.icon-btn:hover { border-color: var(--line-strong); }
.theme-glyph {
  width: 16px; height: 16px; border-radius: 50%;
  background: linear-gradient(90deg, var(--ink) 50%, transparent 50%);
  border: 1.5px solid var(--ink);
}

/* ----------------------------------------------------------------- buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 38px; padding: 0 14px;
  border: 1px solid var(--line-strong); border-radius: 8px;
  background: var(--raised); color: var(--ink);
  font-weight: 600; text-decoration: none; cursor: pointer; white-space: nowrap;
}
.btn:hover { border-color: var(--ink); }
.btn:disabled { opacity: .55; cursor: progress; }
.btn small { font-weight: 500; font-size: 12px; opacity: .75; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn-primary:hover { border-color: var(--accent); filter: brightness(1.06); }
.btn-quiet { background: transparent; border-color: transparent; color: var(--muted); }
.btn-quiet:hover { border-color: var(--line-strong); color: var(--ink); }
.btn-danger { color: var(--danger); }
.btn-danger:hover { border-color: var(--danger); }
.btn-block { width: 100%; }
.btn-large { min-height: 46px; padding: 0 20px; font-size: 16px; }
.btn-small { min-height: 30px; padding: 0 10px; font-size: 13px; }
.btn.is-working { position: relative; color: transparent; }
.btn.is-working small { visibility: hidden; }
.btn.is-working::after {
  content: ""; position: absolute; width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid var(--ink); border-right-color: transparent; animation: spin .7s linear infinite;
}
.btn-primary.is-working::after { border-color: var(--on-accent); border-right-color: transparent; }
@keyframes spin { to { transform: rotate(360deg); } }
.link-btn {
  padding: 0; border: 0; background: none; cursor: pointer;
  color: var(--muted); font-size: 13px; text-decoration: underline; text-underline-offset: 2px;
}
.link-btn:hover { color: var(--ink); }

/* --------------------------------------------------------------- workbench */
.workbench {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 372px;
  height: calc(100vh - 52px);
  height: calc(100dvh - 52px);
}
.stage {
  position: relative; min-width: 0; min-height: 0; overflow: hidden;
  background:
    radial-gradient(120% 90% at 50% 0%, transparent 40%, rgba(0, 0, 0, .06) 100%),
    var(--stage);
}
.stage canvas#view { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; cursor: grab; }
.stage canvas#view:active { cursor: grabbing; }
.is-empty .stage canvas#view { visibility: hidden; }

.dropzone { position: absolute; inset: 0; display: none; place-items: center; padding: 24px; }
.is-empty .dropzone { display: grid; }
.dropzone-inner {
  width: min(560px, 100%); padding: 44px 32px; text-align: center;
  border: 2px dashed var(--line-strong); border-radius: 18px; background: var(--panel);
}
.dropzone h1 { font-size: clamp(24px, 3.4vw, 34px); line-height: 1.12; letter-spacing: -.02em; text-wrap: balance; }
.dropzone p { margin-top: 12px; color: var(--muted); text-wrap: pretty; }
.dropzone .hint { margin-top: 16px; }
.dropzone-actions { margin-top: 24px; display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.stage.is-drag::after {
  content: "Drop to use this file"; position: absolute; inset: 12px; z-index: 5;
  display: grid; place-items: center; font-size: 20px; font-weight: 650;
  border: 2px dashed var(--accent); border-radius: 16px;
  background: color-mix(in srgb, var(--stage) 86%, transparent);
}

.stage-tools { position: absolute; top: 12px; left: 12px; right: 12px; display: flex; flex-wrap: wrap; gap: 8px; justify-content: space-between; pointer-events: none; }
.tool-group {
  display: inline-flex; padding: 3px; gap: 2px; pointer-events: auto;
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow);
}
.tool {
  min-width: 36px; height: 34px; padding: 0 8px; border: 0; border-radius: 7px;
  background: transparent; cursor: pointer; font-size: 18px; line-height: 1;
}
.tool-text { font-size: 13px; font-weight: 600; padding: 0 11px; }
.tool:hover { background: color-mix(in srgb, var(--ink) 9%, transparent); }
.tool[aria-pressed="true"] { background: var(--ink); color: var(--panel); }

.stage-foot {
  position: absolute; left: 12px; right: 12px; bottom: 12px; pointer-events: none;
  display: flex; flex-wrap: wrap-reverse; gap: 8px; justify-content: space-between; align-items: flex-end;
}
.stage-foot > * { pointer-events: auto; }
.stage-status {
  display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: baseline;
  padding: 7px 12px; max-width: 100%;
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow);
  font-family: var(--mono); font-size: 12.5px; font-variant-numeric: tabular-nums;
}
.stage-status .dims { font-weight: 700; font-size: 13.5px; }
.stage-status .tris, .stage-status .busy { color: var(--muted); }
.stage-warn {
  position: absolute; left: 50%; top: 62px; transform: translateX(-50%); width: max-content; max-width: calc(100% - 24px);
  padding: 8px 14px; border-radius: 10px; font-size: 13.5px; font-weight: 550;
  background: #ffe9a8; color: #3d2c00; border: 1px solid #d9b23c; box-shadow: var(--shadow);
}

.stage-move {
  position: absolute; left: 50%; top: 62px; transform: translateX(-50%); width: max-content; max-width: calc(100% - 24px);
  display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; justify-content: center;
  padding: 8px 10px 8px 14px; border-radius: 10px; font-size: 13.5px; font-weight: 550;
  background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow);
}
.stage-move-actions { display: inline-flex; gap: 6px; }
.is-moving .stage-warn { display: none; }
.is-moving .stage canvas#view { cursor: move; }

/* ------------------------------------------------------------------- panel */
.panel {
  min-height: 0; overflow-y: auto; overscroll-behavior: contain;
  background: var(--panel); border-left: 1px solid var(--line);
}
.is-empty .panel .group:not(.group-file) { opacity: .4; pointer-events: none; }
.is-empty .group-file { display: none; }
.group { padding: 16px 18px 18px; border-bottom: 1px solid var(--line); display: grid; gap: 12px; }
.group:last-child { border-bottom: 0; }
.group h2 { font-size: 11.5px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); }

.file-row { display: flex; gap: 12px; align-items: center; }
.file-thumb {
  width: 56px; height: 56px; flex: none; border-radius: 8px; border: 1px solid var(--line);
  background: repeating-conic-gradient(color-mix(in srgb, var(--ink) 10%, transparent) 0% 25%, transparent 0% 50%) 50% / 12px 12px;
}
.file-info { min-width: 0; flex: 1; display: grid; gap: 4px; justify-items: start; }
.name-input {
  width: 100%; padding: 6px 8px; margin-left: -8px;
  border: 1px solid transparent; border-radius: 6px; background: transparent;
  font-size: 16px; font-weight: 650; letter-spacing: -.01em; text-overflow: ellipsis;
}
.name-input:hover { border-color: var(--line); }
.name-input:focus { border-color: var(--line-strong); background: var(--raised); }

.slider { display: grid; grid-template-columns: 92px minmax(0, 1fr) auto; gap: 10px; align-items: center; }
.slider label, .field-inline label { font-size: 13.5px; }
.slider input[type="range"] { width: 100%; min-width: 0; accent-color: var(--accent); }
.unit { display: inline-flex; align-items: baseline; gap: 4px; color: var(--muted); font-size: 12.5px; }
.unit input[type="number"], .unit output {
  width: 66px; padding: 5px 6px; text-align: right;
  border: 1px solid var(--line); border-radius: 6px; background: var(--raised); color: var(--ink);
  font-family: var(--mono); font-size: 13px; font-variant-numeric: tabular-nums;
}
.unit output { display: inline-block; border-color: transparent; background: transparent; font-weight: 700; }
.unit input[type="number"]:focus { border-color: var(--line-strong); }

.segmented { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; padding: 3px; gap: 2px; background: color-mix(in srgb, var(--ink) 8%, transparent); border-radius: 9px; }
.segmented-wrap { grid-auto-flow: row; grid-auto-columns: auto; grid-template-columns: repeat(4, 1fr); }
.segmented label { position: relative; cursor: pointer; }
.segmented input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.segmented span { display: block; padding: 7px 6px; text-align: center; border-radius: 7px; font-size: 13px; font-weight: 600; color: var(--muted); }
.segmented input:checked + span { background: var(--raised); color: var(--ink); box-shadow: 0 1px 2px rgba(0, 0, 0, .14); }
.segmented input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 1px; }

.check { display: flex; gap: 9px; align-items: flex-start; font-size: 13.5px; cursor: pointer; }
.check input, .mini-check input { width: 16px; height: 16px; margin: 2px 0 0; accent-color: var(--accent); flex: none; }
#holeOpts, #nfcOpts { display: grid; gap: 12px; }
.field-inline { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 10px; align-items: center; }
select {
  width: 100%; min-height: 34px; padding: 0 8px;
  border: 1px solid var(--line); border-radius: 6px; background: var(--raised);
}

.palette { display: grid; gap: 6px; }
.palette li { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 10px; align-items: center; }
.palette input[type="color"] {
  width: 34px; height: 30px; padding: 0; border: 1px solid var(--line-strong); border-radius: 7px; background: none; cursor: pointer;
}
.palette input[type="color"]::-webkit-color-swatch-wrapper { padding: 2px; }
.palette input[type="color"]::-webkit-color-swatch { border: 0; border-radius: 4px; }
.palette input[type="color"]::-moz-color-swatch { border: 0; border-radius: 4px; }
.palette-name { font-size: 13.5px; font-variant-numeric: tabular-nums; }
button.palette-name {
  justify-self: start; max-width: 100%; padding: 4px 8px; margin-left: -8px; text-align: left;
  border: 1px solid transparent; border-radius: 6px; background: none; color: inherit; font-family: inherit; cursor: pointer;
}
button.palette-name:hover { border-color: var(--line); }
button.palette-name:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.palette li.is-first button.palette-name { box-shadow: inset 3px 0 0 var(--accent); }
.palette li.is-joined .palette-name { color: var(--muted); }
.palette li.is-joined input[type="color"] { opacity: .45; }
.palette li.is-picked button.palette-name { border-color: var(--accent); background: var(--raised); }
.palette li.is-merged .palette-name { color: var(--muted); text-decoration: line-through; }
.palette li.is-merged input[type="color"] { opacity: .35; }
.mini-check { display: inline-flex; gap: 6px; align-items: center; font-size: 12.5px; color: var(--muted); cursor: pointer; }
.mini-check input { margin: 0; }

.btn-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.btn-pair .btn { flex-direction: column; gap: 0; min-height: 46px; line-height: 1.15; }
.save-box { display: grid; gap: 8px; padding-top: 4px; }
.share { display: flex; gap: 6px; }
.share input { flex: 1; min-width: 0; padding: 0 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--raised); font-family: var(--mono); font-size: 12.5px; }

.toast {
  position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 50;
  width: max-content; max-width: min(520px, calc(100vw - 32px));
  padding: 12px 16px; border-radius: 10px; font-weight: 550;
  background: #2a1210; color: #ffd9d4; border: 1px solid #7a2a22; box-shadow: var(--shadow);
}

/* ----------------------------------------------------------------- notices */
.notice { padding: 10px 12px; border-radius: 8px; font-size: 14px; border: 1px solid; }
.notice-error { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 45%, transparent); background: color-mix(in srgb, var(--danger) 9%, transparent); }
.notice-lock { color: var(--ink); border-color: var(--line); background: var(--raised); font-size: 13.5px; }
.notice-lock a { color: var(--accent); font-weight: 600; }
.group-export .btn:disabled:not(.is-working) { cursor: not-allowed; }
.notice-ok { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 45%, transparent); background: color-mix(in srgb, var(--ok) 9%, transparent); }

/* -------------------------------------------------------------------- dash */
.dash-nav { display: flex; gap: 4px; }
.dash-nav a { padding: 7px 12px; border-radius: 7px; text-decoration: none; font-weight: 600; color: var(--muted); }
.dash-nav a:hover { color: var(--ink); }
.dash-nav a.is-active { color: var(--ink); background: color-mix(in srgb, var(--ink) 9%, transparent); }
.dash-main { max-width: 1120px; margin: 0 auto; padding: 28px 20px 64px; display: grid; gap: 20px; }
.dash-head { display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: center; justify-content: space-between; }
.dash-head h1 { font-size: 26px; letter-spacing: -.02em; }
.search { display: flex; gap: 8px; flex: 0 1 380px; }
.search input, .field input, .field select {
  width: 100%; min-height: 38px; padding: 0 10px;
  border: 1px solid var(--line-strong); border-radius: 8px; background: var(--raised);
}
.field input[type="color"] { padding: 3px; width: 64px; cursor: pointer; }
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.stat-row li { padding: 14px 16px; background: var(--panel); display: grid; gap: 2px; }
.stat-row b { font-family: var(--mono); font-size: 22px; font-variant-numeric: tabular-nums; }
.stat-row span { color: var(--muted); font-size: 13px; }

.design-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.design-card { display: grid; grid-template-rows: auto 1fr auto; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.design-thumb { display: block; aspect-ratio: 1; background: var(--stage); }
.design-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.design-thumb-none { width: 100%; height: 100%; display: grid; place-items: center; color: var(--muted); font-family: var(--mono); font-weight: 700; }
.design-meta { padding: 12px 14px 4px; display: grid; gap: 2px; align-content: start; }
.design-meta h2 { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.design-meta p { font-size: 12.5px; }
.design-actions { padding: 10px 14px 14px; display: flex; flex-wrap: wrap; gap: 6px; }
.design-actions form { margin: 0 0 0 auto; }
.pager { display: flex; gap: 14px; align-items: center; justify-content: center; }
.empty { padding: 56px 20px; text-align: center; display: grid; gap: 10px; justify-items: center; border: 1px dashed var(--line-strong); border-radius: var(--radius); }
.empty h2 { font-size: 20px; }
.empty .btn { margin-top: 8px; }

.legal { width: min(720px, 100%); margin: 0 auto; padding: 28px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); line-height: 1.6; }
.legal h1 { font-size: 28px; letter-spacing: -.02em; }
.legal h2 { font-size: 18px; margin-top: 28px; }
.legal h3 { font-size: 15px; margin-top: 16px; }
.legal p, .legal ul { margin-top: 10px; }
.legal ul { padding-left: 22px; display: grid; gap: 6px; }
.legal a, .check a, .card .muted a { color: var(--accent); font-weight: 600; }
.legal code { font-family: var(--mono); font-size: .92em; }
.legal-links { display: flex; flex-wrap: wrap; gap: 6px 16px; justify-content: center; font-size: 12.5px; }
.legal-links a { color: var(--muted); }
.legal-links a:hover { color: var(--ink); }
.field textarea { width: 100%; padding: 8px 10px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--raised); color: inherit; font: inherit; resize: vertical; }
.currency-pick { display: flex; flex-wrap: wrap; gap: 6px; }
.currency-pick .btn { flex: 1; }
.currency-pick .btn.is-on { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.price-lines { display: grid; gap: 6px; margin: 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--raised); font-size: 14px; }
.price-lines div { display: flex; justify-content: space-between; gap: 12px; }
.price-lines dd { margin: 0; font-variant-numeric: tabular-nums; }
.price-total { padding-top: 6px; border-top: 1px solid var(--line); font-weight: 700; }
.promo-form { grid-template-columns: 1fr auto; align-items: end; }
.auth-card .hint a, .notice a { color: var(--accent); font-weight: 600; }
.copy-line { display: inline-block; margin: 4px 0; padding: 3px 6px; border-radius: 5px; background: var(--raised); font-family: var(--mono); user-select: all; word-break: break-all; }
.table code { font-family: var(--mono); }
.table .cell-note { max-width: 220px; overflow: hidden; text-overflow: ellipsis; color: var(--muted); }
.auth-links { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 14px; }
.auth-links a { color: var(--accent); font-weight: 600; }
.field-trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.table-wrap { overflow-x: auto; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { padding: 10px 14px; text-align: left; white-space: nowrap; border-bottom: 1px solid var(--line); }
.table tbody tr:last-child td { border-bottom: 0; }
.table th { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table .cell-main { font-weight: 600; max-width: 320px; overflow: hidden; text-overflow: ellipsis; }
.table a { color: var(--accent); font-weight: 600; }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; margin: 0; }
.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12.5px; font-weight: 600; border: 1px solid var(--line-strong); }
.badge-ok { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 45%, transparent); }
.badge-off { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 45%, transparent); }
.badge-wait { color: var(--muted); }
.stat-row a { color: var(--accent); }
.test-mail { display: grid; gap: 10px; padding-top: 14px; border-top: 1px solid var(--line); }
.settings-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; align-items: start; }
.card { padding: 20px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); display: grid; gap: 14px; }
.card h2 { font-size: 17px; }
.card form { display: grid; gap: 14px; justify-items: start; }
.card form > .field, .card form > .field-row { width: 100%; }
.field { display: grid; gap: 5px; }
.field > span { font-size: 13px; font-weight: 600; }
.field-row { display: grid; grid-template-columns: auto 1fr; gap: 14px; }
.auth-card { width: min(400px, 100%); margin: 6vh auto 0; padding: 26px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); display: grid; gap: 14px; }
.auth-card h1 { font-size: 22px; letter-spacing: -.01em; }
.auth-card form { display: grid; gap: 14px; }

/* ------------------------------------------------------------------ mobile */
@media (max-width: 860px) {
  .workbench { display: block; height: auto; }
  .stage { height: 58vh; height: 58dvh; min-height: 340px; position: sticky; top: 0; z-index: 2; border-bottom: 1px solid var(--line); }
  .is-empty .stage { height: calc(100dvh - 52px); position: relative; }
  .is-empty .panel { display: none; }
  .panel { border-left: 0; overflow: visible; }
  .dropzone-inner { padding: 32px 20px; }
  .tool-text { padding: 0 8px; }
  .topbar { padding: 0 12px; gap: 10px; }
  .dash-nav a { padding: 7px 8px; }
  .dash .brand span:last-child { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .btn.is-working::after { animation-duration: 2s; }
}
