@font-face { font-family: 'Medeo Sans'; src: url('/assets/fonts/MedeoSans-Variable.ttf'); font-weight: 100 900; }
@font-face { font-family: Unbounded; src: url('/assets/fonts/Unbounded-Variable.ttf'); font-weight: 200 900; }

:root {
  --ink: #0b0b0f; --ink-2: #26262d; --ink-3: #3a3a44;
  --muted: #6f6b76; --faint: #9a96a1;
  --bg: #f7f4ee; --surface: #fff; --surface-2: #fbf9f5;
  --line: #e8e3da; --line-2: #f1ede6;
  --lime: #c8ff3d; --lime-soft: #f0ffcc;
  --violet: #6c5ce7; --violet-soft: #eeebff; --violet-ink: #4a3bc2;
  --amber: #b86e00; --amber-soft: #fff1d6;
  --coral: #c43d2c; --coral-soft: #ffe6e1;
  --green: #2f6b12; --green-soft: #e6f6d6;
  --radius: 12px; --radius-lg: 18px;
  --drawer: 600px;
  --display: Unbounded, 'Medeo Sans', system-ui, sans-serif;
  font-family: 'Medeo Sans', system-ui, -apple-system, sans-serif;
  color: var(--ink);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); font-size: 14px; line-height: 1.45; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
[hidden] { display: none !important; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; letter-spacing: 0; }
.muted { color: var(--muted); }
.small { font-size: 12px; }

/* ——— login ——— */
.login { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login form { width: min(400px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: 24px; padding: 32px; display: grid; gap: 12px; box-shadow: 0 30px 60px -40px #0b0b0f55; }
.login h1 { font-family: var(--display); font-size: 22px; letter-spacing: -1px; margin: 12px 0 0; }
.login p { margin: 0 0 8px; color: var(--muted); }
.login .error { color: var(--coral); font-weight: 600; min-height: 20px; }

.brand { display: flex; align-items: center; gap: 9px; font-family: var(--display); font-weight: 800; font-size: 15px; letter-spacing: -1.2px; }
.brand img { width: 28px; height: 28px; border-radius: 8px; }
.brand small { font-family: 'Medeo Sans', sans-serif; font-size: 11px; font-weight: 700; letter-spacing: 0; padding: 3px 8px; border-radius: 99px; background: var(--lime); color: var(--ink); }

/* ——— controls ——— */
.input, .select, .textarea { width: 100%; border: 1px solid var(--line); background: var(--surface); border-radius: 10px; padding: 9px 12px; outline: none; transition: border-color .15s, box-shadow .15s; }
.textarea { min-height: 92px; resize: vertical; line-height: 1.5; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--violet); box-shadow: 0 0 0 3px var(--violet-soft); }
:where(a, button, select, input, textarea, [tabindex]):focus-visible { outline: 2px solid var(--violet); outline-offset: 2px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid transparent; border-radius: 10px; padding: 8px 14px; font-weight: 650; white-space: nowrap; background: var(--surface); border-color: var(--line); transition: background .15s, border-color .15s, transform .1s; }
.btn:hover { border-color: #d6d0c5; background: var(--surface-2); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: default; transform: none; }
.btn.primary { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn.primary:hover { background: var(--ink-2); }
.btn.accept { background: var(--lime); border-color: #b3ea2a; color: var(--ink); }
.btn.accept:hover { background: #bdf52f; }
.btn.warn { color: var(--coral); }
.btn.warn:hover { background: var(--coral-soft); border-color: #f3c3ba; }
.btn.danger { background: var(--coral); border-color: var(--coral); color: #fff; }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: #0b0b0f0d; }
.btn.sm { padding: 5px 10px; font-size: 13px; border-radius: 8px; }
.btn.icon { padding: 7px; width: 34px; height: 34px; }
.link { background: none; border: 0; padding: 0; color: var(--violet-ink); font-weight: 650; text-decoration: none; }
.link:hover { text-decoration: underline; }
kbd { font-family: ui-monospace, monospace; font-size: 11px; padding: 1px 5px; border-radius: 5px; background: var(--line-2); border: 1px solid var(--line); color: var(--muted); }
svg.i { width: 16px; height: 16px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ——— layout ——— */
.app { display: grid; grid-template-columns: 236px minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; background: var(--ink); color: #e9e7ee; padding: 20px 12px; display: flex; flex-direction: column; gap: 18px; overflow: hidden; }
.sidebar .brand { padding: 0 8px; color: #fff; }
#nav { display: grid; gap: 16px; overflow-y: auto; min-height: 0; }
.nav-group { display: grid; gap: 2px; }
.nav-label { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #77737f; padding: 0 10px 4px; }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 9px; text-decoration: none; color: #c9c6cf; font-weight: 600; }
.nav-item:hover { background: #1c1c22; color: #fff; }
.nav-item.active { background: #26262e; color: #fff; box-shadow: inset 3px 0 0 var(--lime); }
.nav-item .badge { margin-left: auto; }
.badge { min-width: 22px; height: 20px; padding: 0 6px; border-radius: 99px; display: inline-grid; place-items: center; font-size: 11px; font-weight: 800; background: #2d2d35; color: #cfcbd6; }
.badge.hot { background: var(--lime); color: var(--ink); }
.badge:empty { display: none; }
.sidebar-foot { margin-top: auto; border-top: 1px solid #24242b; padding: 14px 10px 0; display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 13px; color: #a9a5b0; }
.sidebar > .brand, .sidebar-foot { flex: none; }
.sidebar-foot b { color: #fff; font-weight: 650; display: block; }
.sidebar-foot button { background: none; border: 0; color: #a9a5b0; padding: 4px; }
.sidebar-foot button:hover { color: #fff; }

.main { min-width: 0; padding: 26px clamp(18px, 3vw, 40px) 60px; transition: margin-right .2s ease; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page-head h1 { font-family: var(--display); font-size: 24px; line-height: 1.15; letter-spacing: -1.2px; margin: 0; }
.page-head p { margin: 6px 0 0; color: var(--muted); max-width: 640px; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 20px 0 12px; }
#queue-filters { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: end; }
#queue-filters .search { grid-column: 1 / -1; width: 100%; margin-left: 0; }
#queue-filters > label { display: grid; gap: 4px; }
#queue-presets .select { width: min(300px, 100%); }
.queue-task-title { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
@media (max-width: 720px) { #queue-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { #queue-filters { grid-template-columns: minmax(0, 1fr); } }
.tabs { display: inline-flex; gap: 2px; padding: 3px; background: #ece7df; border-radius: 11px; flex-wrap: wrap; }
.tab { border: 0; background: transparent; padding: 6px 12px; border-radius: 8px; font-weight: 650; color: var(--ink-3); display: inline-flex; gap: 6px; align-items: center; }
.tab:hover { color: var(--ink); }
.tab.active { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px #0b0b0f1f; }
.tab .n { font-size: 11px; font-weight: 800; color: var(--muted); }
.tab.active .n { color: var(--violet-ink); }
.search { position: relative; margin-left: auto; width: min(320px, 100%); }
.search svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--faint); }
.search .input { padding-left: 34px; }
.toolbar-note { color: var(--muted); font-size: 13px; }
.plain { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.kpi { padding: 16px; display: grid; gap: 6px; align-content: start; }
.kpi .label { display: flex; justify-content: space-between; align-items: center; gap: 8px; color: var(--muted); font-weight: 650; font-size: 13px; }
.kpi .value { font-size: 26px; font-weight: 800; letter-spacing: -.8px; line-height: 1.1; }
.kpi .value small { font-size: 13px; font-weight: 600; color: var(--muted); letter-spacing: 0; }
.kpi .note { font-size: 12px; color: var(--muted); }
.meter { height: 8px; border-radius: 8px; background: var(--green-soft); overflow: hidden; }
.meter > span { display: block; height: 100%; border-radius: 8px; background: var(--green); }
.meter.warn { background: var(--amber-soft); } .meter.warn > span { background: var(--amber); }
.meter.fail { background: var(--coral-soft); } .meter.fail > span { background: var(--coral); }
.charts-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 12px; }
.chart-card { padding: 16px 16px 10px; min-width: 0; }
.chart-card h3 { margin: 0; font-size: 14px; font-weight: 750; }
.chart-card .sub { margin: 2px 0 8px; font-size: 12px; color: var(--muted); }
.chart { position: relative; height: 150px; }
.chart svg { display: block; width: 100%; height: 100%; overflow: visible; }
.chart .axis { fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.chart .grid { stroke: var(--line-2); stroke-width: 1; }
.chart .cross { stroke: var(--line); stroke-width: 1; }
.chart-tip { position: absolute; top: 0; pointer-events: none; background: var(--ink); color: #fff; border-radius: 10px; padding: 7px 10px; font-size: 12px; white-space: nowrap; transform: translateX(-50%); box-shadow: 0 8px 20px -10px #0b0b0f80; }
.chart-tip b { display: block; font-size: 14px; }
.chart-tip span { color: #bdb9c4; }
.chart-empty { height: 150px; display: grid; place-items: center; text-align: center; color: var(--muted); font-size: 13px; padding: 0 20px; }
.status-list { padding: 6px 16px; margin-top: 12px; }
.status-row { display: grid; grid-template-columns: 22px minmax(120px, 180px) minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 11px 0; border-top: 1px solid var(--line-2); }
.status-row:first-child { border-top: 0; }
.status-row .dot { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 900; color: #fff; }
.status-row .dot.ok { background: var(--green); } .status-row .dot.warn { background: var(--amber); } .status-row .dot.fail { background: var(--coral); } .status-row .dot.unknown { background: var(--faint); }
.status-row .name { font-weight: 700; }
.status-row .detail { color: var(--muted); font-size: 13px; min-width: 0; }
.status-row .detail.bad { color: var(--coral); }
@media (max-width: 1100px) { .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .charts-grid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 560px) { .kpi-grid { grid-template-columns: minmax(0, 1fr); } .status-row { grid-template-columns: 22px minmax(0, 1fr) auto; } .status-row .detail { grid-column: 2 / -1; } }
.letter { white-space: pre-wrap; word-break: break-word; font-size: 14px; line-height: 1.55; }
.bulk-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0 0 12px; padding: 9px 12px; background: var(--violet-soft); border-radius: var(--radius); font-size: 13px; }
.bulk-bar b { color: var(--violet-ink); }
.bulk-bar .spacer { flex: 1; }
.bulk-bar label { display: inline-flex; gap: 6px; align-items: center; color: var(--ink-3); }
.check { width: 16px; height: 16px; margin: 0; accent-color: var(--violet); cursor: pointer; vertical-align: middle; }
th.pick, td.pick { width: 28px; padding-right: 0; }

/* ——— обработка ——— */
.work-list { padding: 4px 16px 8px; }
.work-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 13px 0; border-top: 1px solid var(--line-2); }
.work-row:first-child { border-top: 0; }
.work-row .what b { display: block; font-weight: 700; }
.work-row .what p { margin: 3px 0 0; color: var(--muted); font-size: 13px; max-width: 560px; }
.work-row .buttons { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.work-num { font-variant-numeric: tabular-nums; font-weight: 800; font-size: 19px; letter-spacing: -.5px; }
.work-num.idle { color: var(--faint); }
.btn.paid { border-color: #e6d4a8; background: #fdf6e6; }
.btn.paid:hover { background: #fbefd6; }
.job-live { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--radius); background: var(--violet-soft); margin-bottom: 10px; font-size: 13px; }
.job-live .spin { width: 13px; height: 13px; border-radius: 50%; border: 2px solid var(--violet); border-right-color: transparent; animation: spin 1s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (max-width: 720px) { .work-row { grid-template-columns: minmax(0, 1fr); } .work-row .buttons { justify-content: flex-start; } }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--surface-2); white-space: nowrap; position: sticky; top: 0; }
th:first-child { border-top-left-radius: var(--radius-lg); }
th:last-child { border-top-right-radius: var(--radius-lg); }
td { padding: 11px 14px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr.row { cursor: pointer; }
tbody tr.row:hover { background: #faf8f3; }
tbody tr.row.active { background: var(--violet-soft); }
@media (min-width: 1280px) { body.drawer-open .opt { display: none; } }
@media (max-width: 820px) { .opt { display: none; } }
tbody tr.row:focus-visible { outline: 2px solid var(--violet); outline-offset: -2px; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.cell-title { font-weight: 650; }
.cell-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; max-width: 520px; }
.empty { padding: 48px 20px; text-align: center; color: var(--muted); }
.empty b { display: block; color: var(--ink); font-size: 15px; margin-bottom: 4px; }
.more { display: flex; justify-content: center; padding: 12px; border-top: 1px solid var(--line-2); }
.skeleton { padding: 48px; text-align: center; color: var(--faint); }

.chip { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 99px; font-size: 12px; font-weight: 700; background: var(--line-2); color: var(--ink-3); white-space: nowrap; }
.chip.green { background: var(--green-soft); color: var(--green); }
.chip.amber { background: var(--amber-soft); color: var(--amber); }
.chip.coral { background: var(--coral-soft); color: var(--coral); }
.chip.violet { background: var(--violet-soft); color: var(--violet-ink); }
.chip.lime { background: var(--lime-soft); color: #4d6400; }
.chips { display: flex; gap: 4px; flex-wrap: wrap; }

.score { display: inline-grid; place-items: center; min-width: 34px; height: 26px; padding: 0 6px; border-radius: 8px; font-weight: 800; font-size: 13px; font-variant-numeric: tabular-nums; }
.score.good { background: #2f7d32; color: #fff; }
.score.meh { background: #ffc15c; color: var(--ink); }
.score.bad { background: #e5533f; color: #fff; }
.score.none { background: var(--violet-soft); color: var(--violet-ink); }
.score.big { min-width: 54px; height: 44px; font-size: 20px; border-radius: 12px; font-family: var(--display); letter-spacing: -1px; }
.thumb { width: 38px; height: 38px; border-radius: 9px; object-fit: cover; background: var(--line-2); flex: none; display: grid; place-items: center; font-weight: 800; color: var(--muted); }
.with-thumb { display: flex; align-items: center; gap: 11px; min-width: 220px; }
.stars { color: #e3a008; letter-spacing: 1px; white-space: nowrap; }
.stars .off { color: #ddd6ca; }
.bar { height: 6px; border-radius: 99px; background: var(--line-2); overflow: hidden; min-width: 60px; }
.bar i { display: block; height: 100%; background: var(--violet); border-radius: 99px; }

/* ——— today ——— */
.section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 26px 0 10px; }
.section-title h2 { font-size: 15px; margin: 0; font-weight: 750; }
.queue-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.queue-tile { display: grid; gap: 4px; text-decoration: none; padding: 16px; border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--line); transition: border-color .15s, transform .15s; }
.queue-tile:hover { border-color: #cfc8bb; transform: translateY(-1px); }
.queue-tile .top { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-weight: 650; }
.queue-tile b { font-family: var(--display); font-size: 30px; letter-spacing: -1.5px; line-height: 1.1; }
.queue-tile small { color: var(--muted); }
.queue-tile.hot { background: var(--ink); border-color: var(--ink); color: #fff; }
.queue-tile.hot .top, .queue-tile.hot small { color: #bdb9c4; }
.queue-tile.hot b { color: var(--lime); }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: 12px; }
.panel { padding: 18px; min-width: 0; }
.panel h3 { margin: 0 0 12px; font-size: 14px; font-weight: 750; display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.stat-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-bottom: 16px; }
.stat { padding: 10px 12px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line-2); text-decoration: none; display: block; }
a.stat:hover { border-color: var(--line); }
.stat b { font-size: 20px; font-weight: 800; letter-spacing: -.6px; display: block; font-variant-numeric: tabular-nums; }
.stat span { font-size: 12px; color: var(--muted); }
.stat.alert b { color: var(--coral); }
.bars { display: grid; gap: 7px; }
.bars .line { display: grid; grid-template-columns: minmax(90px, 160px) 1fr 34px; gap: 10px; align-items: center; font-size: 13px; }
.bars .line span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bars .line b { text-align: right; font-variant-numeric: tabular-nums; }
.list { display: grid; grid-template-columns: minmax(0, 1fr); }
.list-item { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 9px 0; border-top: 1px solid var(--line-2); text-decoration: none; }
.list-item:first-child { border-top: 0; padding-top: 0; }
.list-item .grow { min-width: 0; flex: 1; }
.list-item .ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ——— drawer ——— */
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(var(--drawer), 100vw); background: var(--surface); border-left: 1px solid var(--line); box-shadow: -30px 0 60px -40px #0b0b0f66; display: flex; flex-direction: column; z-index: 20; visibility: hidden; transform: translateX(100%); transition: transform .22s ease, visibility 0s linear .22s; }
.drawer.open { visibility: visible; transform: none; transition-delay: 0s; }
.drawer-head { padding: 18px 20px 14px; border-bottom: 1px solid var(--line); display: flex; gap: 12px; align-items: flex-start; }
.drawer-head .grow { flex: 1; min-width: 0; }
.drawer-head h2 { margin: 0; font-size: 19px; line-height: 1.25; letter-spacing: -.5px; overflow-wrap: anywhere; }
.drawer-head .meta { margin-top: 6px; display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; color: var(--muted); font-size: 13px; }
.drawer-body { flex: 1; overflow-y: auto; padding: 18px 20px 24px; display: grid; gap: 18px; align-content: start; }
.drawer-foot { border-top: 1px solid var(--line); padding: 12px 20px; display: grid; gap: 10px; background: var(--surface-2); }
.drawer-foot .row-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.drawer-foot .spacer { flex: 1; }
.drawer-foot .hint { font-size: 12px; color: var(--faint); display: flex; gap: 10px; flex-wrap: wrap; }
.drawer-backdrop { position: fixed; inset: 0; background: #0b0b0f40; z-index: 19; opacity: 0; pointer-events: none; transition: opacity .2s; }
.drawer-backdrop.open { opacity: 1; pointer-events: auto; }
@media (min-width: 1280px) {
  body.drawer-open .main { margin-right: var(--drawer); }
  .drawer-backdrop { display: none; }
}
.block h4 { margin: 0 0 8px; font-size: 11px; font-weight: 750; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.block h4 .chip, .block h4 .btn { text-transform: none; letter-spacing: 0; }
.block h4 > span { display: inline-flex; gap: 6px; align-items: center; }
.block p { margin: 0; white-space: pre-wrap; }
.block .lead { font-size: 15px; line-height: 1.55; }
.kv { display: grid; grid-template-columns: 150px 1fr; gap: 6px 12px; font-size: 13px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.nutri { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.nutri div { padding: 8px 10px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line-2); }
.nutri b { display: block; font-size: 16px; font-variant-numeric: tabular-nums; }
.nutri span { font-size: 12px; color: var(--muted); }
.nutri .unknown b { color: var(--faint); font-weight: 600; }
.nutri .estimate { border-style: dashed; border-color: var(--violet); }
.nutri .estimate span::after { content: ' · оценка ИИ'; color: var(--violet-ink); }
.draft-nutri { display: grid; gap: 4px; margin: 8px 0 10px; }
.draft-nutri label { display: grid; grid-template-columns: 20px minmax(90px, 1fr) 80px minmax(0, 1.4fr); gap: 8px; align-items: center; padding: 6px 8px; border-radius: 8px; background: var(--surface); font-size: 13px; }
.draft-nutri b { font-variant-numeric: tabular-nums; }
.draft-nutri .muted { font-size: 12px; }
.compare-nutri label { grid-template-columns: 20px minmax(90px, 1fr) minmax(90px, 1fr) 80px; }
.input.ai-filled { border-color: var(--violet); background: var(--violet-soft); }
.photos { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.photos figure { margin: 0; }
.photos img { width: 100%; height: 200px; object-fit: contain; background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 12px; }
.photos figcaption { font-size: 12px; color: var(--muted); margin-top: 4px; }
.callout { padding: 11px 13px; border-radius: 12px; background: var(--amber-soft); color: #6f4300; font-size: 13px; line-height: 1.5; }
.callout.info { background: var(--violet-soft); color: var(--violet-ink); }
.callout.bad { background: var(--coral-soft); color: #8d2a1d; }
.callout.good { background: var(--green-soft); color: var(--green); }
.score-line { display: flex; align-items: center; gap: 12px; }
.score-line .grow { min-width: 0; }
.score-line b { display: block; font-size: 15px; }
.summary-list { margin: 8px 0 0; padding: 0; list-style: none; display: grid; gap: 3px; }
.summary-list li::before { content: attr(data-sign) ' '; font-weight: 800; }

/* ——— forms ——— */
.form { display: grid; gap: 18px; }
.fieldset { display: grid; gap: 10px; }
.fieldset > h4 { margin: 0; font-size: 12px; font-weight: 750; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.fieldset > p { margin: -4px 0 0; font-size: 12px; color: var(--muted); }
.fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.fields.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.field { display: grid; gap: 5px; font-size: 13px; font-weight: 650; }
.field.full { grid-column: 1 / -1; }
.field small { font-weight: 500; color: var(--muted); }
.form-error { color: var(--coral); font-weight: 650; font-size: 13px; min-height: 0; }
.form-error:empty { display: none; }

/* ——— toast & dialog ——— */
.toasts { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); display: grid; gap: 8px; z-index: 40; }
.toast { background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 12px; box-shadow: 0 12px 30px -10px #0b0b0f80; font-weight: 600; display: flex; gap: 10px; align-items: center; animation: toast-in .2s ease; }
.toast.error { background: var(--coral); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }
.dialog-backdrop { position: fixed; inset: 0; background: #0b0b0f59; z-index: 30; display: grid; place-items: center; padding: 20px; }
.dialog { width: min(440px, 100%); background: var(--surface); border-radius: 18px; padding: 22px; display: grid; gap: 12px; box-shadow: 0 30px 60px -20px #0b0b0f80; }
.dialog h3 { margin: 0; font-size: 17px; overflow-wrap: anywhere; }
.dialog p { margin: 0; color: var(--muted); }
.dialog .row-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }

@media (max-width: 1100px) {
  .queue-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-2 { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 820px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .sidebar { min-width: 0; top: 0; }
  #nav { min-width: 0; overflow-x: auto; }
  .sidebar { position: sticky; z-index: 10; height: auto; flex-direction: row; align-items: center; padding: 10px 12px; gap: 12px; overflow-x: auto; }
  #nav { display: flex; gap: 4px; }
  .drawer-foot .hint, kbd { display: none; }
  .sidebar .brand small { display: none; }
  .nav-group { display: flex; gap: 2px; }
  .nav-label, .sidebar-foot > div { display: none; }
  .sidebar { overflow: hidden; }
  .sidebar > .brand { flex: none; }
  #nav { flex: 1; }
  .sidebar-foot { display: flex; flex: none; margin: 0; border: 0; padding: 0; }
  .sidebar-foot button { min-width: 40px; min-height: 40px; }
  .nav-item { white-space: nowrap; padding: 7px 10px; }
  .nav-item svg { display: none; }
  .main { padding: 18px 14px 40px; }
  .search { margin-left: 0; width: 100%; }
  .stat-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fields, .fields.three, .photos { grid-template-columns: 1fr; }
  .kv { grid-template-columns: 1fr; gap: 2px; }
  .kv dd { margin-bottom: 6px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
.nav-item > span:first-of-type { min-width: 0; overflow-wrap: anywhere; }
.toolbar > .input { width: auto; max-width: 100%; flex: 1 1 150px; }
#promo-form .select { width: auto; }
#promo-form label { display: grid; gap: 4px; }
#promo-form { align-items: end; }
