/* Дизайн-система по мотивам datafk: shadcn neutral + «терминальная» типографика.
   Geist — текст, JetBrains Mono — подписи, цифры, заголовки. Акцент --hi (бирюзовый). */

:root {
  --radius: .625rem;
  --background: oklch(100% 0 0);
  --foreground: oklch(14.5% 0 0);
  --card: oklch(100% 0 0);
  --muted: oklch(97% 0 0);
  --muted-foreground: oklch(55.6% 0 0);
  --border: oklch(92.2% 0 0);
  --hi: oklch(62% .16 200);
  --rose: oklch(64.5% .246 16.439);
  --emerald: oklch(59.6% .145 163.225);
  --amber: oklch(66.6% .179 58.318);
  --fg-03: color-mix(in oklch, var(--foreground) 3%, transparent);
  --fg-06: color-mix(in oklch, var(--foreground) 6%, transparent);
  --fg-10: color-mix(in oklch, var(--foreground) 10%, transparent);
  --fg-15: color-mix(in oklch, var(--foreground) 15%, transparent);
  --fg-20: color-mix(in oklch, var(--foreground) 20%, transparent);
  --fg-40: color-mix(in oklch, var(--foreground) 40%, transparent);
  --fg-60: color-mix(in oklch, var(--foreground) 60%, transparent);
  --hi-05: color-mix(in oklch, var(--hi) 5%, transparent);
  --hi-10: color-mix(in oklch, var(--hi) 10%, transparent);
  --hi-30: color-mix(in oklch, var(--hi) 30%, transparent);
  --font-sans: "Geist", ui-sans-serif, system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
  color-scheme: light;
}
:root.dark {
  --background: oklch(14.5% 0 0);
  --foreground: oklch(98.5% 0 0);
  --card: oklch(20.5% 0 0);
  --muted: oklch(26.9% 0 0);
  --muted-foreground: oklch(70.8% 0 0);
  --border: oklch(100% 0 0 / .1);
  --hi: oklch(78% .18 195);
  --rose: oklch(71.2% .194 13.428);
  --emerald: oklch(76.5% .177 163.223);
  --amber: oklch(82.8% .189 84.429);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--background);
  color: var(--foreground);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
button, input, select { font: inherit; color: inherit; }
.mono { font-family: var(--font-mono); }
.hi { color: var(--hi); }
.muted { color: var(--muted-foreground); }
.num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

/* ---------- анимации ---------- */
@keyframes fade-up { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.reveal { animation: .35s cubic-bezier(.2,.7,.2,1) both fade-up; }
.reveal-2 { animation-delay: 50ms; } .reveal-3 { animation-delay: .1s; } .reveal-4 { animation-delay: .15s; }
@keyframes blink { 0%, 49% { opacity: 1; } 50%, 100% { opacity: 0; } }
.caret { animation: 1.05s step-end infinite blink; }
@keyframes pulse-soft { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }
.pulse-dot { animation: 1.6s ease-in-out infinite pulse-soft; }
@media (prefers-reduced-motion: reduce) { .reveal, .caret, .pulse-dot { animation: none; } }

/* ---------- каркас ---------- */
.page { max-width: 1280px; margin: 0 auto; padding: 24px 32px 64px; }
@media (max-width: 640px) { .page { padding: 16px 16px 48px; } }

.topbar { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; }
.nav {
  display: flex; align-items: flex-end; flex-wrap: wrap; gap: 8px 20px;
  border-bottom: 1px solid var(--fg-10); padding-bottom: 10px; margin-bottom: 8px;
}
.nav a, .nav span.tab {
  display: inline-flex; align-items: center; padding: 4px 2px;
  font-family: var(--font-mono); font-size: 14px; text-transform: uppercase; letter-spacing: .12em;
  text-decoration: none; white-space: nowrap; color: color-mix(in oklch, var(--muted-foreground) 80%, transparent);
  font-weight: 500; transition: color .15s;
}
.nav a:hover { color: color-mix(in oklch, var(--foreground) 85%, transparent); }
.nav .br { color: var(--hi); opacity: 0; transition: opacity 75ms; }
.nav .br:first-child { margin-right: 6px; } .nav .br:last-child { margin-left: 6px; }
.nav a:hover .br { opacity: .6; }
.nav a[aria-selected="true"] { color: var(--hi); font-weight: 600; }
.nav a[aria-selected="true"] .br { opacity: 1; }
.nav span.tab { opacity: .45; cursor: default; }
.nav .badge {
  margin-left: 8px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--hi); color: var(--background); font-size: 11px; letter-spacing: 0;
  display: inline-flex; align-items: center; justify-content: center; font-weight: 700;
}

.prompt { font-family: var(--font-mono); font-size: 12px; color: var(--muted-foreground); margin: 10px 0 4px; }
.prompt .path { color: var(--fg-60); }
.prompt .cmd { color: var(--foreground); }
.title {
  font-family: var(--font-mono); font-weight: 700; letter-spacing: -.04em;
  font-size: clamp(40px, 6vw, 60px); line-height: 1; margin: 0;
}
.sublabel { margin-top: 10px; font-family: var(--font-mono); font-size: 12px; color: var(--muted-foreground); }

.userbox { display: flex; align-items: center; gap: 6px; font-family: var(--font-mono); font-size: 10px; flex-shrink: 0; }
.userbox .who { text-align: right; line-height: 1.25; }
.userbox .role { color: var(--fg-40); }
.userbox .role.admin { color: color-mix(in oklch, var(--hi) 80%, transparent); }
.btn-xs {
  height: 28px; padding: 0 8px; display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-mono); font-size: 10px; text-transform: uppercase; letter-spacing: .08em;
  background: transparent; border: 1px solid var(--fg-15); border-radius: 4px; color: color-mix(in oklch, var(--foreground) 55%, transparent);
  cursor: pointer; text-decoration: none; transition: color .15s, border-color .15s;
}
.btn-xs:hover { color: var(--foreground); border-color: var(--fg-40); }
.btn-xs.danger:hover { color: var(--rose); border-color: color-mix(in oklch, var(--rose) 40%, transparent); }
.btn-xs.on { color: var(--hi); border-color: var(--hi-30); }

/* ---------- панели ---------- */
.panel { position: relative; border: 1px solid var(--border); background: var(--card); }
.panel.ticks::before, .panel.ticks::after,
.panel.ticks > .tick-b::before, .panel.ticks > .tick-b::after {
  content: "+"; position: absolute; font-family: var(--font-mono); font-size: 10px; line-height: 1;
  color: var(--fg-40); pointer-events: none;
}
.panel.ticks::before { top: 4px; left: 5px; } .panel.ticks::after { top: 4px; right: 5px; }
.panel.ticks > .tick-b::before { bottom: 4px; left: 5px; } .panel.ticks > .tick-b::after { bottom: 4px; right: 5px; }

.label {
  font-family: var(--font-mono); font-size: 10px; text-transform: uppercase; letter-spacing: .18em;
  color: var(--muted-foreground);
}
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 20px 0; }
.stat { padding: 14px 16px; border-right: 1px dashed var(--fg-15); }
.stat:last-child { border-right: 0; }
.stat .v { font-family: var(--font-mono); font-size: 28px; font-weight: 700; letter-spacing: -.03em; line-height: 1.1; margin-top: 4px; }
.stat .v.hi { color: var(--hi); }
@media (max-width: 640px) { .stat .v { font-size: 22px; } .stat { padding: 10px 12px; } }

/* ---------- фильтры ---------- */
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin-bottom: 16px; }
.seg { display: inline-flex; border: 1px solid var(--fg-15); border-radius: 6px; overflow: hidden; }
.seg a {
  padding: 5px 10px; font-family: var(--font-mono); font-size: 11px; text-transform: lowercase;
  text-decoration: none; color: var(--muted-foreground); border-right: 1px solid var(--fg-15);
}
.seg a:last-child { border-right: 0; }
.seg a:hover { color: var(--foreground); background: var(--fg-03); }
.seg a.on { color: var(--hi); background: var(--hi-05); font-weight: 600; }
.select {
  height: 30px; padding: 0 28px 0 10px; font-family: var(--font-mono); font-size: 12px;
  border: 1px solid var(--fg-15); border-radius: 6px; background: var(--background);
  appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted-foreground) 50%), linear-gradient(135deg, var(--muted-foreground) 50%, transparent 50%);
  background-position: calc(100% - 14px) 13px, calc(100% - 9px) 13px; background-size: 5px 5px; background-repeat: no-repeat;
}
.spacer { flex: 1; }

/* ---------- лента ---------- */
.day { margin-top: 28px; }
.day-h { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.day-h::after { content: ""; flex: 1; border-top: 1px dashed var(--fg-15); }
.batch { margin-bottom: 14px; }
.batch-h {
  display: flex; align-items: center; gap: 10px; padding: 8px 14px; border-bottom: 1px dashed var(--fg-15);
  font-family: var(--font-mono); font-size: 12px; color: var(--muted-foreground);
}
.batch-h .t { color: var(--foreground); font-weight: 600; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--hi); display: inline-block; flex-shrink: 0; }
.factory { padding: 10px 14px 4px; }
.factory + .factory { border-top: 1px solid var(--fg-06); }
.factory-h { display: flex; align-items: baseline; gap: 8px; margin-bottom: 6px; }
.factory-h .name { font-family: var(--font-mono); font-weight: 700; font-size: 13px; text-transform: uppercase; letter-spacing: .08em; }

.item {
  display: grid; grid-template-columns: 14px minmax(0, 1fr) auto; gap: 4px 10px; align-items: start;
  padding: 8px 0; border-top: 1px dashed var(--fg-10);
}
.item:first-of-type { border-top: 0; }
.item .mark { padding-top: 7px; }
.item.read .mark .dot { background: transparent; border: 1px solid var(--fg-20); }
.item.read { opacity: .62; }
.item .art { font-family: var(--font-mono); font-size: 14px; font-weight: 600; text-decoration: none; word-break: break-word; }
.item a.art:hover { color: var(--hi); text-decoration: underline; text-underline-offset: 3px; }
.item .tag {
  display: inline-block; margin-left: 8px; padding: 0 6px; border-radius: 4px; font-family: var(--font-mono);
  font-size: 10px; text-transform: uppercase; letter-spacing: .08em; vertical-align: 2px;
  border: 1px solid var(--hi-30); color: var(--hi); background: var(--hi-05);
}
.item .tag.warn { border-color: color-mix(in oklch, var(--amber) 40%, transparent); color: var(--amber); background: color-mix(in oklch, var(--amber) 6%, transparent); }
.item .tag.del { border-color: color-mix(in oklch, var(--rose) 40%, transparent); color: var(--rose); background: color-mix(in oklch, var(--rose) 6%, transparent); }
.item .side span { display: block; }
.item .side { font-family: var(--font-mono); font-size: 11px; color: var(--muted-foreground); text-align: right; white-space: nowrap; padding-top: 2px; }
.secs { margin: 4px 0 0; padding: 0; list-style: none; font-size: 13px; }
.secs li { display: grid; grid-template-columns: 16px minmax(0, 1fr); color: var(--fg-60); }
.secs li .tree { font-family: var(--font-mono); color: var(--fg-40); }
.secs .sec { font-family: var(--font-mono); font-size: 12px; color: var(--muted-foreground); }
.secs .ph { font-family: var(--font-mono); color: var(--foreground); font-variant-numeric: tabular-nums; }
.secs .rm { font-family: var(--font-mono); color: var(--rose); }

.empty { padding: 48px 16px; text-align: center; }
.empty .big { font-family: var(--font-mono); font-size: 13px; color: var(--muted-foreground); }

/* ---------- формы / таблицы ---------- */
.field { display: grid; gap: 6px; }
.input {
  height: 36px; padding: 0 12px; font-family: var(--font-mono); font-size: 14px;
  border: 1px solid var(--fg-15); border-radius: 6px; background: var(--background); width: 100%;
}
.input:focus { outline: none; border-color: var(--hi); box-shadow: 0 0 0 1px var(--hi-30); }
.btn {
  height: 36px; padding: 0 16px; display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--font-mono); font-size: 13px; font-weight: 600;
  border: 0; border-radius: 10px; background: var(--hi); color: var(--background); cursor: pointer;
  transition: background .15s, transform .05s;
}
.btn:hover { background: color-mix(in oklch, var(--hi) 85%, transparent); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
:root.dark .btn { box-shadow: 0 0 12px color-mix(in oklch, var(--hi) 45%, transparent); }

.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
.table th {
  text-align: left; padding: 8px 12px; border-bottom: 1px dashed var(--fg-20);
  font-family: var(--font-mono); font-size: 10px; text-transform: uppercase; letter-spacing: .14em; color: var(--muted-foreground); font-weight: 500;
}
.table td { padding: 10px 12px; border-bottom: 1px solid var(--fg-06); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tr.off td { opacity: .45; }
.scroll-x { overflow-x: auto; }
.inline-form { display: inline-flex; gap: 6px; align-items: center; }
.inline-form .input { height: 28px; font-size: 12px; width: 150px; }

.flash { margin: 0 0 16px; padding: 8px 12px; border: 1px solid var(--hi-30); background: var(--hi-05); color: var(--hi); font-family: var(--font-mono); font-size: 12px; border-radius: 6px; }
.flash.err { border-color: color-mix(in oklch, var(--rose) 40%, transparent); background: color-mix(in oklch, var(--rose) 6%, transparent); color: var(--rose); }

.grid-2 { display: grid; grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); gap: 20px; align-items: start; }
@media (max-width: 900px) { .grid-2 { grid-template-columns: minmax(0, 1fr); } }

/* ---------- логин ---------- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login { width: 100%; max-width: 384px; padding: 24px; }
.login .brand { font-family: var(--font-mono); font-weight: 700; letter-spacing: -.04em; font-size: 24px; line-height: 1; }
.login .cmd { margin-top: 6px; font-family: var(--font-mono); font-size: 11px; text-transform: uppercase; letter-spacing: .18em; color: var(--muted-foreground); }
.login form { display: grid; gap: 16px; margin-top: 20px; }
.login .err { font-family: var(--font-mono); font-size: 12px; color: var(--rose); }

@media (max-width: 720px) {
  .topbar { flex-direction: column-reverse; gap: 12px; }
  .userbox { align-self: flex-end; }
  .title { font-size: 36px; }
  .item { grid-template-columns: 14px minmax(0, 1fr); }
  .item .side { grid-column: 2; text-align: left; padding-top: 0; }
  .item .side span { display: inline; }
  .item .side .ph-n::after { content: " · "; }
}

/* статусы товаров */
.st { font-family: var(--font-mono); font-size: 11px; padding: 1px 6px; border-radius: 4px; border: 1px solid var(--fg-15); color: var(--muted-foreground); white-space: nowrap; }
.st-active { color: var(--emerald); border-color: color-mix(in oklch, var(--emerald) 40%, transparent); }
.st-test { color: var(--hi); border-color: var(--hi-30); }
.st-temp_withdrawn, .st-phasing_out { color: var(--amber); border-color: color-mix(in oklch, var(--amber) 40%, transparent); }
.table td.hi { font-weight: 600; }
.table .out { font-family: var(--font-mono); font-size: 10px; color: var(--amber); font-weight: 400; }
.table tr.dim td { color: var(--muted-foreground); }
.stack { display: grid; gap: 20px; }
.item .tag.mp { color: var(--foreground); border-color: var(--fg-20); background: var(--fg-03); }
.item .tag.mp.warn { color: var(--amber); border-color: color-mix(in oklch, var(--amber) 40%, transparent); background: color-mix(in oklch, var(--amber) 6%, transparent); }
.item .tag.who { color: var(--muted-foreground); border-color: var(--fg-15); background: none; text-transform: none; letter-spacing: 0; }

/* окно артикула: слева новые фото с Диска, справа карточка WB */
/* строка артикула — кликабельная: подсветка при наведении, пунктир под названием, метка «▸ фото» */
.item[data-item] {
  cursor: pointer; margin: 0 -8px; padding-left: 8px; padding-right: 8px; border-radius: 6px;
  transition: background-color .12s;
}
.item[data-item]:hover { background: var(--fg-03); }
.item[data-item]:hover .art-name { text-decoration-color: var(--hi); color: var(--hi); }
.item[data-item]:hover .open-pill { border-color: var(--hi); color: var(--hi); background: var(--hi-10); }
.item .art-toggle {
  padding: 0; border: 0; background: none; cursor: pointer; text-align: left;
  display: inline; color: inherit;
}
.item .art-name {
  text-decoration: underline dashed var(--fg-40); text-decoration-thickness: 1px; text-underline-offset: 4px;
  transition: color .12s, text-decoration-color .12s;
}
.item .art-toggle:focus-visible { outline: 2px solid var(--hi-30); outline-offset: 2px; border-radius: 2px; }
.open-pill {
  display: inline-flex; align-items: center; gap: 5px; margin-left: 8px; padding: 0 9px; height: 20px;
  vertical-align: 1px; border: 1px solid var(--hi-30); border-radius: 999px; background: var(--hi-05);
  color: var(--hi); font-family: var(--font-mono); font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .08em; white-space: nowrap;
  transition: background-color .12s, border-color .12s;
}
.open-pill .chev { display: inline-block; font-size: 9px; transition: transform .15s; }
.open-pill .when-open { display: none; }
.item.open .open-pill { background: var(--hi); border-color: var(--hi); color: var(--background); }
.item.open .open-pill .chev { transform: rotate(90deg); }
.item.open .open-pill .when-open { display: inline; }
.item.open .open-pill .when-closed { display: none; }
.item.open { opacity: 1; background: var(--hi-05); border-radius: 6px 6px 0 0; }
.item.open .art-name { color: var(--hi); text-decoration-color: var(--hi); }
.item.open + .media { margin-top: 0; border-top: 0; border-radius: 0 0 6px 6px; }
@media (hover: none) { .item[data-item]:hover { background: none; } }
.item .drive-link {
  margin-left: 8px; font-family: var(--font-mono); font-size: 11px; color: var(--muted-foreground);
  text-decoration: none; white-space: nowrap;
}
.item .drive-link:hover { color: var(--hi); text-decoration: underline; text-underline-offset: 3px; }

.media { margin: 0 -8px 10px; border: 1px dashed var(--hi-30); background: var(--hi-05); padding: 12px; }
.media-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
.media-col { min-width: 0; }
.media-col + .media-col { border-left: 1px dashed var(--fg-15); padding-left: 16px; }
.media-h { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.media-h .label { color: var(--foreground); }
.media-a { font-family: var(--font-mono); font-size: 11px; color: var(--hi); text-decoration: none; white-space: nowrap; }
.media-a:hover { text-decoration: underline; text-underline-offset: 3px; }
.media-sec { margin: 10px 0 6px; font-family: var(--font-mono); font-size: 11px; color: var(--muted-foreground); }
.media-sec:first-of-type { margin-top: 0; }
.media-note { margin: 4px 0 8px; font-size: 12px; color: var(--muted-foreground); }
.media-note.err { color: var(--rose); }
.media-loading { font-family: var(--font-mono); font-size: 12px; color: var(--muted-foreground); }
.media-loading::after { content: "▍"; color: var(--hi); animation: blink 1s steps(1) infinite; }

.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 8px; }
.tile { margin: 0; min-width: 0; }
.tile-img {
  position: relative; display: block; aspect-ratio: 3 / 4; overflow: hidden;
  border: 1px solid var(--border); background: var(--card); border-radius: 4px;
}
.tile-img img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .2s; }
a.tile-img:hover { border-color: var(--hi-30); }
a.tile-img:hover img { transform: scale(1.03); }
.tile-img.empty, .tile-img.broken {
  display: grid; place-items: center; padding: 6px; text-align: center;
  background: repeating-linear-gradient(135deg, var(--fg-03) 0 6px, transparent 6px 12px);
}
.tile-img.empty span { font-family: var(--font-mono); font-size: 11px; color: var(--muted-foreground); word-break: break-all; }
.tile-img.broken::after { content: "нет превью"; font-family: var(--font-mono); font-size: 10px; color: var(--muted-foreground); }
.tile-badge {
  position: absolute; left: 4px; top: 4px; padding: 0 4px; border-radius: 3px;
  font-family: var(--font-mono); font-size: 9px; text-transform: uppercase; letter-spacing: .06em;
  background: var(--hi); color: var(--background);
}
.tile figcaption {
  margin-top: 3px; font-family: var(--font-mono); font-size: 10px; color: var(--muted-foreground);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

@media (max-width: 720px) {
  .media { padding: 10px; }
  .media-grid { grid-template-columns: minmax(0, 1fr); }
  .media-col + .media-col { border-left: 0; padding-left: 0; border-top: 1px dashed var(--fg-15); padding-top: 12px; }
  .thumbs { grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); }
}

/* редактор карточки WB: перетаскивание и черновик */
.wb-card + .wb-card { margin-top: 14px; padding-top: 10px; border-top: 1px dashed var(--fg-15); }
.tile { position: relative; }
.tile.can-drag .tile-img, .wb-grid .tile[data-drag] .tile-img { cursor: grab; }
.tile.can-drag .tile-img { outline: 1px dashed var(--hi-30); outline-offset: 2px; }
.tile.is-new .tile-img { border-color: var(--hi); box-shadow: 0 0 0 1px var(--hi); }
.tile.is-new .tile-badge { background: var(--emerald); }
.tile.drag-src { display: none; }
.tile-x {
  position: absolute; right: 3px; top: 3px; width: 20px; height: 20px; padding: 0; line-height: 18px;
  border-radius: 50%; border: 1px solid var(--border); background: var(--card); color: var(--muted-foreground);
  font-size: 13px; cursor: pointer; opacity: 0; transition: opacity .12s;
}
.tile:hover .tile-x, .tile-x:focus-visible { opacity: 1; }
.tile-x:hover { color: var(--rose); border-color: color-mix(in oklch, var(--rose) 50%, transparent); }
@media (hover: none) { .tile-x { opacity: 1; } }
.drop-slot { border: 2px dashed var(--hi); border-radius: 4px; background: var(--hi-05); aspect-ratio: 3 / 4; }
.drag-ghost {
  position: fixed; left: 0; top: 0; z-index: 50; width: 72px; aspect-ratio: 3 / 4; pointer-events: none;
  border: 2px solid var(--hi); border-radius: 4px; overflow: hidden; background: var(--card); opacity: .9;
  box-shadow: 0 8px 24px rgb(0 0 0 / .25); display: grid; place-items: center;
  font-family: var(--font-mono); font-size: 10px;
}
.drag-ghost img { width: 100%; height: 100%; object-fit: cover; }
body.dragging, body.dragging * { cursor: grabbing !important; user-select: none; }
.draft { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; }
.draft .spacer { flex: 1; }
.draft-sum { font-family: var(--font-mono); font-size: 12px; color: var(--hi); }
.draft-hint { font-size: 12px; color: var(--muted-foreground); }
.draft .btn-xs:disabled { opacity: .45; cursor: not-allowed; }
.draft .media-note { flex-basis: 100%; margin: 0; }
.history { flex-basis: 100%; margin-top: 6px; display: grid; gap: 4px; }
.history-row { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-size: 12px; }
.history-row .num { color: var(--muted-foreground); font-size: 11px; }
.st-sent { color: var(--hi); border-color: var(--hi-30); }
.st-done { color: var(--emerald); border-color: color-mix(in oklch, var(--emerald) 40%, transparent); }
.st-failed { color: var(--rose); border-color: color-mix(in oklch, var(--rose) 40%, transparent); }
.history-row .media-note { flex-basis: 100%; margin: 0; }

/* плашка «необходимо сменить пароль» */
.must-change {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 16px 0 0; padding: 10px 14px;
  border: 1px solid color-mix(in oklch, var(--amber) 45%, transparent); border-radius: 6px;
  background: color-mix(in oklch, var(--amber) 8%, transparent); color: var(--foreground); font-size: 13px;
}
.must-change > span:nth-child(2) { flex: 1; min-width: 200px; }
.must-change-ico {
  display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%;
  background: var(--amber); color: var(--background); font-family: var(--font-mono); font-weight: 700; font-size: 12px;
}
.must-change .btn-xs { color: var(--amber); border-color: color-mix(in oklch, var(--amber) 45%, transparent); }

/* подсказка у кнопки «обновить» в окне артикула */
.media-h .refresh { display: flex; align-items: center; gap: 8px; }
.refresh-hint { margin: -2px 0 10px; font-size: 12px; color: var(--muted-foreground); }

/* режим руководителя */
.head-note {
  margin: 16px 0 0; padding: 8px 12px; border: 1px dashed var(--hi-30); border-radius: 6px; background: var(--hi-05);
  font-family: var(--font-mono); font-size: 12px; color: var(--hi);
}

/* просмотр фото крупно */
.lightbox {
  position: fixed; inset: 0; z-index: 100; display: grid; grid-template-columns: 56px minmax(0, 1fr) 56px;
  align-items: center; padding: 24px 8px; background: rgb(0 0 0 / .86); backdrop-filter: blur(2px);
}
.lightbox[hidden] { display: none; }
body.lb-open { overflow: hidden; }
.lb-fig { grid-column: 2; margin: 0; display: grid; justify-items: center; gap: 10px; min-height: 0; height: 100%; align-content: center; }
.lb-img {
  max-width: 100%; max-height: calc(100vh - 110px); object-fit: contain; border-radius: 6px;
  background: #fff; box-shadow: 0 12px 40px rgb(0 0 0 / .5); transition: opacity .15s;
}
.lightbox.loading .lb-img { opacity: .35; }
.lb-cap { font-family: var(--font-mono); font-size: 12px; color: rgb(255 255 255 / .8); text-align: center; }
.lb-nav, .lb-close {
  border: 1px solid rgb(255 255 255 / .25); background: rgb(255 255 255 / .08); color: #fff; cursor: pointer;
  border-radius: 999px; display: grid; place-items: center; transition: background-color .12s, border-color .12s;
}
.lb-nav { width: 44px; height: 44px; font-size: 26px; line-height: 1; justify-self: center; }
.lb-prev { grid-column: 1; grid-row: 1; }
.lb-next { grid-column: 3; grid-row: 1; }
.lb-nav[hidden] { visibility: hidden; display: grid; }
.lb-close { position: absolute; top: 14px; right: 14px; width: 40px; height: 40px; font-size: 22px; }
.lb-nav:hover, .lb-close:hover { background: rgb(255 255 255 / .2); border-color: rgb(255 255 255 / .5); }
.lb-nav:focus-visible, .lb-close:focus-visible { outline: 2px solid var(--hi); outline-offset: 2px; }
@media (max-width: 640px) {
  .lightbox { grid-template-columns: 40px minmax(0, 1fr) 40px; padding: 56px 4px 16px; }
  .lb-nav { width: 36px; height: 36px; font-size: 22px; }
}
