/* Пульт klara-hub. Токены — из согласованного docs/prototypes/pult_shell.html:
   те же цвета, шрифты и тёмная тема, но вёрстка сначала для телефона. */
:root {
  --ground: #FBFAF8; --surface: #FFFFFF; --surface-2: #F4F2F0;
  --line: #E3E0DC; --line-soft: #EEEBE8;
  --ink: #17161C; --ink-2: #46434F; --muted: #6B6875;
  --accent: #3D3A8C; --accent-soft: #EDECFA;
  --good: #2C7355; --good-soft: #E4F0EA;
  --warn: #96650F; --warn-soft: #F8EFDC;
  --crit: #A83A31; --crit-soft: #F9E7E4;
  --cold: #35648B; --cold-soft: #E5EEF5;
  --dead: #706B79; --dead-soft: #EDEBEE;
  --shadow: 0 1px 2px rgba(23,22,28,.05), 0 8px 24px -12px rgba(23,22,28,.14);
  --radius: 12px;
}

/* Навигация по рабочим разделам. Политика доступа формирует пункты на сервере. */
.menu-shell { margin-bottom: 20px; }
.menu-shell > summary { cursor: pointer; padding: 10px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); list-style: none; }
.menu-shell > summary::-webkit-details-marker { display: none; }
.side-nav { padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); margin-top: 8px; }
.side-nav__brand { display: none; }
.side-nav__group { margin: 12px 0 20px; }
.side-nav__group h2 { font: inherit; font-size: 11px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); margin: 0 12px 8px; }
.side-nav a { display: block; color: var(--ink-2); text-decoration: none; border-radius: 9px; padding: 10px 12px; }
.side-nav a:hover { background: var(--surface-2); }
.side-nav a[aria-current="page"] { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.sales-units { padding: 10px 0; }
.sales-weeks { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.sales-weeks span { background: var(--surface-2); border-radius: 8px; padding: 8px; display: flex; flex-direction: column; gap: 4px; }
.sales-weeks small { color: var(--muted); font-size: 10px; }
@media (min-width: 1000px) {
  .has-user .wrap { max-width: 1600px; margin-left: 230px; padding: 22px 32px; }
  .menu-shell { position: fixed; top: 0; left: 0; bottom: 0; width: 230px; margin: 0; z-index: 20; }
  .menu-shell > summary { display: none; }
  .side-nav { margin: 0; border-radius: 0; border-width: 0 1px 0 0; height: 100vh; height: 100dvh; overflow-y: auto; padding: 26px 14px; }
  .side-nav__brand { display: block; font-family: "Instrument Serif", Georgia, serif; font-size: 27px; padding: 0 12px 22px; }
  .side-nav__brand small { display: block; font: 12px "IBM Plex Sans", sans-serif; color: var(--muted); margin-top: 6px; }
}
@media (prefers-color-scheme: dark) {
  :root {
    --ground: #131218; --surface: #1B1A22; --surface-2: #23212C;
    --line: #302E3B; --line-soft: #272531;
    --ink: #EFEDF4; --ink-2: #C3BFCE; --muted: #918DA0;
    --accent: #A29CF5; --accent-soft: #262347;
    --good: #6FC79B; --good-soft: #1B3229;
    --warn: #E0AC55; --warn-soft: #362A16;
    --crit: #E88B80; --crit-soft: #3A211E;
    --cold: #7FB3DA; --cold-soft: #1C2E3C;
    --dead: #9B95A6; --dead-soft: #262430;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px -12px rgba(0,0,0,.6);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--ground); color: var(--ink);
  font-family: "IBM Plex Sans", ui-sans-serif, system-ui, -apple-system, sans-serif;
  font-size: 15px; line-height: 1.45; -webkit-font-smoothing: antialiased;
}
code { font-family: "IBM Plex Mono", ui-monospace, Menlo, monospace; font-size: .92em; }
a { color: var(--accent); }
.wrap { max-width: 720px; margin: 0 auto; padding: 14px 14px calc(28px + env(safe-area-inset-bottom)); }
.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }
.good { color: var(--good); }
.crit { color: var(--crit); }

/* шапка */
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 4px 0 16px; }
.brand { display: flex; align-items: baseline; gap: 8px; text-decoration: none; color: inherit; }
.brand__name { font-family: "Instrument Serif", Georgia, serif; font-size: 26px; line-height: 1; letter-spacing: -.01em; }
.brand__sub { color: var(--muted); font-size: 13px; }
.who { display: flex; align-items: center; gap: 10px; margin: 0; }
.who__name { font-size: 13.5px; color: var(--ink-2); }

/* кнопки и форма */
.btn {
  display: inline-block; border-radius: 999px; padding: 9px 16px; font: inherit; font-size: 14px;
  cursor: pointer; text-decoration: none; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2);
  min-height: 40px;
}
.btn--ghost { padding: 7px 13px; min-height: 36px; font-size: 13px; }
.btn--primary { background: var(--accent); border-color: var(--accent); color: #fff; width: 100%; font-weight: 600; font-size: 15px; min-height: 46px; }
.btn:focus-visible, input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.form { display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field__label { font-size: 12.5px; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.field input {
  font: inherit; font-size: 16px; /* 16px — iOS не зумит поле при фокусе */
  padding: 11px 12px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink); width: 100%;
}
.login { max-width: 400px; margin: 8vh auto 0; }
.login__title { font-family: "Instrument Serif", Georgia, serif; font-weight: 400; font-size: 30px; margin: 0 0 16px; }

/* карточки */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.flag { border-radius: 10px; padding: 10px 12px; font-size: 13.5px; margin: 12px 0 0; }
.flag--crit { background: var(--crit-soft); color: var(--crit); }
.flag code { background: rgba(0,0,0,.06); padding: 1px 5px; border-radius: 4px; }

/* статус конвейера */
.status { border-left: 4px solid var(--dead); }
.status--good { border-left-color: var(--good); }
.status--crit { border-left-color: var(--crit); }
.status--cold { border-left-color: var(--cold); }
.status__head { display: flex; gap: 12px; align-items: flex-start; }
.status__icon { font-size: 24px; line-height: 1.2; flex: none; }
.status__title { margin: 0; font-size: 18px; font-weight: 600; letter-spacing: -.01em; line-height: 1.25; }
.status__sub { margin: 4px 0 0; color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.status__sub b { color: var(--ink); font-weight: 600; }
.rows { margin: 14px 0 0; padding: 0; border-top: 1px solid var(--line-soft); }
.row { display: flex; gap: 12px; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--line-soft); font-size: 13.5px; }
.row dt { color: var(--muted); flex: none; }
.row dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }

/* KPI */
h2.section { font-family: "Instrument Serif", Georgia, serif; font-weight: 400; font-size: 22px; margin: 22px 0 10px; letter-spacing: -.01em; }
.kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 13px; display: flex; flex-direction: column; gap: 3px; }
.kpi__label { font-size: 11px; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.kpi__value { font-size: 21px; font-weight: 600; line-height: 1.15; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.kpi__note { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.kpi--flag { border-color: color-mix(in srgb, var(--crit) 40%, var(--line)); }
.kpi--flag .kpi__value { color: var(--crit); }

/* решения недели */
.chips { padding: 0; }
.chip { display: grid; grid-template-columns: 10px 1fr auto; align-items: center; gap: 10px; padding: 11px 15px; border-top: 1px solid var(--line-soft); }
.chip:first-child { border-top: none; }
.chip__dot { width: 10px; height: 10px; border-radius: 3px; background: var(--dead); }
.chip__dot--exit { background: var(--dead); }
.chip__dot--probe_step { background: var(--cold); }
.chip__dot--first_markdown { background: var(--warn); }
.chip__dot--season_rush { background: var(--crit); }
.chip__name { font-size: 14px; }
.chip__count { font-variant-numeric: tabular-nums; font-weight: 600; font-size: 15px; }

/* подвал */
.foot { margin-top: 26px; display: flex; flex-direction: column; gap: 4px; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.foot code { background: var(--surface-2); padding: 1px 5px; border-radius: 4px; }

@media (min-width: 560px) {
  .wrap { padding: 24px 22px 60px; }
  .kpis { grid-template-columns: repeat(3, 1fr); }
  .kpi__value { font-size: 24px; }
  .brand__name { font-size: 30px; }
  .foot { flex-direction: row; justify-content: space-between; }
}

/* ------------------------------------------------------------- навигация */
.nav { display: flex; gap: 6px; margin: -6px 0 14px; }
.nav a {
  text-decoration: none; color: var(--ink-2); font-size: 14px;
  padding: 6px 13px; border-radius: 999px; border: 1px solid transparent;
}
.nav a[aria-current] { background: var(--surface); border-color: var(--line); color: var(--ink); font-weight: 600; box-shadow: var(--shadow); }

/* ------------------------------------------------- «Модели»: инструменты */
.searchbar { display: flex; gap: 8px; }
.searchbar input {
  flex: 1; min-width: 0; font: inherit; font-size: 16px; padding: 10px 12px;
  border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--ink);
}
.filters { margin-top: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.filters summary { padding: 11px 14px; cursor: pointer; font-size: 14px; color: var(--ink-2); user-select: none; }
.filters[open] summary { border-bottom: 1px solid var(--line-soft); }
.filters__grid { padding: 12px 14px 14px; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.filters select {
  font: inherit; font-size: 16px; padding: 9px 10px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink); width: 100%;
}
.check { display: flex; gap: 8px; align-items: center; font-size: 14px; }
.filters__actions { grid-column: 1 / -1; display: flex; gap: 10px; align-items: center; }

.dchips { display: flex; gap: 8px; margin-top: 10px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.dchips::-webkit-scrollbar { display: none; }
.dchip {
  display: inline-flex; gap: 7px; align-items: center; white-space: nowrap; flex: none;
  font-size: 13px; padding: 7px 12px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); text-decoration: none;
}
.dchip b { font-variant-numeric: tabular-nums; }
.dchip--active { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }

.listmeta { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-top: 14px; font-size: 13px; color: var(--muted); flex-wrap: wrap; }
.sorts { display: flex; gap: 12px; flex-wrap: wrap; }
.sorts a { text-decoration: none; color: var(--muted); white-space: nowrap; }
.sorts a[aria-current] { color: var(--accent); font-weight: 600; }

/* ------------------------------------------------- «Модели»: список строк */
.mlist { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.mrow {
  display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; gap: 4px 12px; align-items: center;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 10px 12px; text-decoration: none; color: inherit; box-shadow: var(--shadow);
}
.mrow[aria-current] { border-color: var(--accent); }
.thumb { width: 56px; height: 74px; border-radius: 8px; object-fit: cover; background: var(--surface-2); grid-row: 1 / span 2; }
.thumb--none { display: flex; align-items: center; justify-content: center; font-size: 10px; color: var(--muted); text-align: center; border: 1px dashed var(--line); }
.mrow__main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.mrow__head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.mrow__code { font-weight: 600; font-size: 14px; font-family: "IBM Plex Mono", ui-monospace, Menlo, monospace; }
.mrow__name { font-size: 13px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mrow__cat { font-size: 12px; color: var(--muted); }
.mrow__nums { display: flex; flex-direction: column; gap: 1px; text-align: right; font-variant-numeric: tabular-nums; font-size: 12.5px; color: var(--ink-2); }
.mnum b { font-size: 14px; color: var(--ink); }
.empty { margin-top: 20px; color: var(--muted); }

.pill { display: inline-block; padding: 2.5px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.pill--good { background: var(--good-soft); color: var(--good); }
.pill--warn { background: var(--warn-soft); color: var(--warn); }
.pill--crit { background: var(--crit-soft); color: var(--crit); }
.pill--cold { background: var(--cold-soft); color: var(--cold); }
.pill--dead { background: var(--dead-soft); color: var(--dead); }

.pager { display: flex; justify-content: space-between; align-items: center; margin-top: 16px; gap: 10px; }
.pager__info { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------ карточка модели */
.backlink { margin: 0 0 10px; font-size: 14px; }
.mcard { display: flex; flex-direction: column; gap: 10px; }
.mcard__bar { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.mcard__open { font-size: 13px; }
.mcard__head { display: flex; gap: 14px; align-items: flex-start; }
.mcard__photo { width: 120px; flex: none; border-radius: 10px; overflow: hidden; display: block; background: var(--surface-2); }
.mcard__photo img { width: 100%; height: auto; display: block; }
.mcard__photo--none { height: 156px; display: flex; align-items: center; justify-content: center; text-align: center; color: var(--muted); font-size: 12px; border: 1px dashed var(--line); }
.mcard__id { min-width: 0; }
.mcard__title { margin: 0; font-size: 24px; font-weight: 600; letter-spacing: -.01em; font-family: "IBM Plex Mono", ui-monospace, Menlo, monospace; }
.mcard__name { margin: 3px 0 0; font-size: 14px; color: var(--ink-2); }
.mcard__meta { margin: 5px 0 0; font-size: 12.5px; color: var(--muted); }

.verdict { border-left: 4px solid var(--dead); }
.verdict--good { border-left-color: var(--good); }
.verdict--warn { border-left-color: var(--warn); }
.verdict--crit { border-left-color: var(--crit); }
.verdict--cold { border-left-color: var(--cold); }
.verdict__reason { margin: 9px 0 0; font-size: 13.5px; color: var(--ink-2); }
.verdict__act { margin: 8px 0 0; font-size: 14px; }
.verdict__sub { margin: 6px 0 0; font-size: 13px; color: var(--muted); }
.verdict__flags { margin: 6px 0 0; }
.tag { display: inline-block; background: var(--surface-2); border-radius: 6px; padding: 2px 7px; font-size: 12px; margin: 4px 4px 0 0; color: var(--ink-2); }
.flag--warn { background: var(--warn-soft); color: var(--warn); }
.flag--good { background: var(--good-soft); color: var(--good); }

.block h3 { margin: 0; font-size: 15px; font-weight: 600; }
.block .rows { margin-top: 10px; }
.row dd em { color: var(--muted); font-style: normal; font-size: 12px; }
.small { font-size: 12px; }
.scrollx { overflow-x: auto; margin-top: 10px; }
.mini { width: 100%; border-collapse: collapse; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.mini th { text-align: left; font-size: 10.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 500; padding: 4px 6px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.mini td { padding: 5px 6px; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
.mini .num, .mini th.num { text-align: right; }
.mini td em { color: var(--muted); font-style: normal; font-size: 11px; }
.mini__active td { background: var(--accent-soft); }
.mini-h { margin: 12px 0 0; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; }

/* десктоп: список слева, панель карточки справа */
@media (min-width: 960px) {
  .wrap--wide { max-width: 1160px; }
  .wrap--wide main { display: flex; gap: 18px; align-items: flex-start; }
  .wrap--wide .listcol { flex: 1; min-width: 0; }
  .wrap--wide .panel {
    width: 420px; flex: none; position: sticky; top: 14px;
    max-height: calc(100vh - 28px); overflow-y: auto;
    background: var(--ground); border-radius: var(--radius);
  }
}
@media (max-width: 959.98px) {
  .panel { display: none; }
}

/* --------------------------------------------- «Матрица»: категория × стиль */
.mtx { overflow-x: auto; margin-top: 12px; }
.mtx table { border-collapse: collapse; width: 100%; min-width: 760px; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.mtx th { text-align: right; font-size: 10.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 500; padding: 4px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.mtx td { padding: 6px 8px; border-bottom: 1px solid var(--line-soft); text-align: right; vertical-align: top; }
.mtx .mtx__cat { position: sticky; left: 0; background: var(--ground); text-align: left; font-weight: 600; font-size: 13px; z-index: 1; }
.mtx__link { display: block; text-decoration: none; color: inherit; }
.mtx__link b { font-size: 13.5px; }
.mtx__sub { display: block; font-size: 11px; color: var(--muted); white-space: nowrap; }
.mtx--crit { background: var(--crit-soft); }
.mtx--dead { background: var(--dead-soft); }
.mtx tfoot td { border-top: 2px solid var(--line); border-bottom: none; }
.mtx tfoot .mtx__link b { font-size: 14px; }
.mtx__legend { margin-top: 12px; font-size: 12px; color: var(--muted); max-width: 640px; }

/* ------------------------------------------------- «Каталог»: капсулы картами */
.csec { margin-top: 22px; }
.csec__head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.csec__head .section { margin: 0; }
.csec__stat { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.csec__stat b { color: var(--ink); }
.cgrid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 10px; }
@media (min-width: 560px) { .cgrid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); } }
.ccard {
  display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden; text-decoration: none; color: inherit; box-shadow: var(--shadow);
}
.ccard[aria-current] { border-color: var(--accent); }
.ccard__ph { position: relative; display: block; aspect-ratio: 3 / 4; background: var(--surface-2); }
.ccard__ph img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ccard__none { display: flex; align-items: center; justify-content: center; height: 100%; color: var(--muted); font-size: 11px; }
.ccard__abc { position: absolute; top: 6px; left: 6px; font-size: 11px; font-weight: 600; color: var(--ink-2); background: var(--surface); border: 1px solid var(--line); border-radius: 5px; padding: 0 5px; }
.ccard__body { display: flex; flex-direction: column; gap: 3px; padding: 8px 10px 10px; align-items: flex-start; }
.ccard__code { font-weight: 600; font-size: 13.5px; font-family: "IBM Plex Mono", ui-monospace, Menlo, monospace; }
.ccard__cat { font-size: 11.5px; color: var(--muted); }
.ccard__cover { font-size: 12px; color: var(--ink-2); margin-top: 2px; font-variant-numeric: tabular-nums; }
.ccard__cover--crit { color: var(--crit); font-weight: 600; }
.ccard__cover--dead { color: var(--muted); }
.cslot {
  border: 1.5px dashed var(--line); border-radius: var(--radius); min-height: 180px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  color: var(--muted); font-size: 12.5px; text-align: center; padding: 12px;
}
.cslot__plus { width: 30px; height: 30px; border: 1.5px dashed var(--line); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 18px; }

/* --- Реклама ------------------------------------------------------------- */
.adshead { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.adshead select {
  flex: 1; min-width: 180px; padding: 9px 10px; border: 1px solid var(--line);
  border-radius: 10px; background: var(--surface); color: var(--ink); font-size: 14px;
}
.kpis--ads { grid-template-columns: repeat(3, 1fr); margin-top: 12px; }
@media (max-width: 559.98px) { .kpis--ads { grid-template-columns: 1fr 1fr; } }
/* ячейка миниатюры в .arow есть всегда (фото или плейсхолдер) — сетка базовая .mrow */
.arow__title { font-size: 14px; font-weight: 600; line-height: 1.3; }
.arow .mrow__nums { min-width: 96px; flex: none; }
.mcard__title--text { font-family: inherit; font-size: 19px; line-height: 1.3; }
.section { margin: 22px 0 6px; font-size: 16px; font-weight: 600; }
.bars { display: flex; align-items: flex-end; gap: 2px; height: 44px; margin-top: 6px; }
.bars i { flex: 1; min-width: 2px; background: var(--accent); border-radius: 2px 2px 0 0; opacity: .85; }
.bars--sold i { background: var(--good); }
.statusrow { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.btn--busy { position: relative; padding-left: 30px; color: var(--muted); }
.btn--busy::before {
  content: ""; position: absolute; left: 10px; top: 50%; width: 12px; height: 12px;
  margin-top: -7px; border: 2px solid var(--line); border-top-color: var(--accent);
  border-radius: 50%; animation: busyspin .8s linear infinite;
}
@keyframes busyspin { to { transform: rotate(360deg); } }
.arow--new { border-style: dashed; }
.thumb--add { cursor: pointer; border-color: var(--accent); color: var(--accent); font-size: 9.5px; line-height: 1.25; }
.thumb--add:hover { background: var(--accent-soft); }
.thumb--busy { position: relative; color: transparent; }
.thumb--busy::before {
  content: ""; position: absolute; left: 50%; top: 50%; width: 14px; height: 14px;
  margin: -8px 0 0 -8px; border: 2px solid var(--line); border-top-color: var(--accent);
  border-radius: 50%; animation: busyspin .8s linear infinite;
}
.thumb--fail { border-color: var(--line); color: var(--muted); cursor: default; }
.arow { grid-template-columns: 74px minmax(0, 1fr) auto; }
.arow .thumb { width: 74px; height: 96px; }
.mcard__photo--ad { width: 240px; }
.mcard__photo--ad.mcard__photo--none { height: 200px; }
@media (max-width: 559.98px) { .mcard__photo--ad { width: 180px; } .mcard__photo--ad.mcard__photo--none { height: 150px; } }

/* ------------------------------------------------------------------ Контент-задачи (0014) */
.trow { align-items: center; }
.trow__photos { display: flex; gap: 4px; flex: none; }
.trow__photos img { width: 38px; height: 50px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line-soft); }
.trow__photos--none { width: 38px; height: 50px; display: flex; align-items: center; justify-content: center;
  font-size: 10px; line-height: 1.2; text-align: center; color: var(--muted);
  background: var(--surface-2); border-radius: 6px; }
.trow__models { font-weight: 500; display: block; margin-top: 2px; }
.trow--closed { opacity: .75; }
.task-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.task-actions form { margin: 0; }
.task-actions__hint { flex-basis: 100%; margin: 4px 0 0; }
.task-model { display: flex; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line-soft); }
.task-model:first-of-type { border-top: 0; }
.task-model__photo { width: 76px; height: 100px; object-fit: cover; border-radius: 8px; flex: none; }
.task-model__photo--none { display: flex; align-items: center; justify-content: center; font-size: 11px;
  line-height: 1.3; text-align: center; color: var(--muted); background: var(--surface-2); }
.task-model__info p { margin: 2px 0; }
.task-run { display: flex; gap: 12px; align-items: flex-start; }
.task-run__thumb { width: 76px; height: 100px; object-fit: cover; border-radius: 8px; }
.task-send { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.task-send--inline { margin-top: 8px; }
.note { padding: 8px 12px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line); margin: 0 0 12px; }
.task-story { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.task-story form { margin: 0; }

/* Контент: первая волна + календарь съёмок (0017) */
.cov { display: flex; gap: 18px; flex-wrap: wrap; margin: 6px 0 2px; }
.cov__item b { font-size: 17px; }
.cov__delta { font-size: 12px; color: var(--muted); margin-left: 4px; }
.cov__delta--up { color: var(--good, #2e7d32); }
.cov__delta--down { color: var(--crit, #c0392b); }
.crit-ink { color: var(--crit, #c0392b); }
.prio { font-family: "IBM Plex Mono", monospace; font-size: 12px; color: var(--muted);
  border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; }
.fchips { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 14px; }
.fchip { padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line);
  text-decoration: none; color: var(--ink-2); background: var(--surface); font-size: 13.5px; }
.fchip--active { background: var(--ink); color: var(--ground); border-color: var(--ink); }
.fchip--link { margin-left: auto; }
.comment-form textarea { width: 100%; box-sizing: border-box; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--surface);
  color: var(--ink); font: inherit; margin-bottom: 8px; }
.why { margin: 0; padding-left: 18px; }
.why li { margin: 4px 0; }
.task-plan { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.task-plan form { margin: 0; }
.task-plan select, .task-send select, .assign-bar select { padding: 9px 10px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; max-width: 100%; }
.slot-new summary { cursor: pointer; font-weight: 500; }
.slot-new__form { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; margin-top: 12px; }
.slot-new__form label { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; color: var(--muted); }
.slot-new__form input { padding: 9px 10px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink); font: inherit; }
.plan-day--today .mini-h { color: var(--ink); }
.slot { margin-bottom: 10px; }
.slot--over { border-color: var(--warn, #c98a00); }
.slot__head { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.slot__fill { margin-left: auto; font-variant-numeric: tabular-nums; color: var(--muted); }
.slot__fill--over { color: var(--warn, #c98a00); font-weight: 600; }
.slot-task { border-top: 1px solid var(--line-soft); padding: 10px 0 6px; margin-top: 10px; }
.slot-task__head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.slot-task__models { display: flex; gap: 12px; flex-wrap: wrap; margin: 8px 0; }
.slot-model { display: flex; gap: 8px; align-items: center; }
.slot-model img { width: 42px; height: 56px; object-fit: cover; border-radius: 6px; }
.slot-model__info { display: flex; flex-direction: column; line-height: 1.35; }
.slot-task__actions { display: flex; gap: 8px; flex-wrap: wrap; }
.slot-task__actions form { margin: 0; }
.assign-bar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
  position: sticky; top: 8px; z-index: 5; margin-bottom: 10px; }
.trow--pick { cursor: pointer; }
.trow--pick input[type="checkbox"] { width: 18px; height: 18px; flex: none; margin-right: 4px; }

.product-search { display: flex; align-items: end; gap: 12px; }
.product-search .field { flex: 1; }
.product-pick { grid-template-columns: 64px minmax(0, 1fr) auto; align-items: center; }
.product-pick img { width: 64px; height: 84px; object-fit: cover; border-radius: 8px; }
.product-pick p { margin: 4px 0; }
.slot-edit { margin: 10px 0; }
.slot-edit summary { cursor: pointer; color: var(--accent); font-size: 13px; }
@media (max-width: 520px) {
  .product-pick { grid-template-columns: 52px minmax(0, 1fr); }
  .product-pick img { width: 52px; height: 70px; }
  .product-pick button { grid-column: 2; justify-self: start; }
  .brand__sub { display: none; }
}
