/* Минимализм в духе Apple: нейтральный серый фон, белые карточки без рамок, системный шрифт,
   один плоский синий акцент. Крупный текст и четыре цвета статусов остаются ради читаемости. */
:root {
  color-scheme: light;
  --bg: #f5f5f7;
  --card: #fff;
  --card-solid: #fff;
  --ink: #1d1d1f;
  --muted: #6e6e73;
  --line: #e5e5ea;
  --navy: #0071e3;        /* акцентный синий Apple: кнопки, ссылки, заливка диаграммы */
  --navy-deep: #0062c3;
  --blue-ice: #eef4fc;
  --blue-soft: #e8e8ed;
  --late: #d70015;
  --late-bg: #fdecec;
  --work: #b25000;
  --work-bg: #fff3e8;
  --done: #1f8a3b;
  --done-bg: #e9f7ee;
  --none: #6e6e73;
  --none-bg: #f2f2f7;
  --radius: 18px;
  --radius-s: 12px;
  --shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 6px 20px rgba(0, 0, 0, .05);
  --shadow-up: 0 2px 4px rgba(0, 0, 0, .05), 0 12px 32px rgba(0, 0, 0, .08);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 17px/1.5 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Inter, Roboto, "Segoe UI", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  padding-bottom: calc(80px + env(safe-area-inset-bottom));
}
[hidden] { display: none !important; }
/* Фон: три мягких пятна цвета медленно плывут. Без движения, если система просит его убрать. */
body::before {
  content: "";
  position: fixed;
  inset: -20%;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(38% 34% at 18% 18%, rgba(0, 113, 227, .16), transparent 70%),
    radial-gradient(34% 34% at 82% 26%, rgba(255, 59, 48, .09), transparent 70%),
    radial-gradient(40% 40% at 55% 88%, rgba(52, 199, 89, .10), transparent 70%);
  animation: drift 30s ease-in-out infinite alternate;
  will-change: transform;
}
@keyframes drift {
  from { transform: translate3d(-3%, -2%, 0) scale(1); }
  to { transform: translate3d(3%, 3%, 0) scale(1.08); }
}
@media (prefers-reduced-motion: reduce) { body::before { animation: none; } }
a { color: var(--navy); }
img { max-width: 100%; display: block; }
h1, h2, h3 { line-height: 1.2; margin: 0; letter-spacing: -.022em; font-weight: 600; }
h2 { font-size: 21px; }
h3 { font-size: 18px; }
p { margin: 0; }
.ic { flex: none; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.muted { color: var(--muted); font-size: 15px; }
.accent { color: var(--navy); }

.demo-bar { background: #fff3d6; color: #6a4600; font-size: 14px; text-align: center; padding: 6px 12px; }

/* Шапка и меню */
.top {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(255, 255, 255, .8);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid rgba(0, 0, 0, .08);
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 16px;
  min-height: 56px;
}
.brand { display: inline-flex; align-items: center; gap: 9px; color: var(--ink); font-weight: 600; font-size: 18px; letter-spacing: -.02em; text-decoration: none; margin-right: auto; overflow: hidden; white-space: nowrap; min-width: 0; }
.brand span { overflow: hidden; text-overflow: ellipsis; }
.logo { flex: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--ink); color: #fff; }
.top-nav { display: none; }
.lang { display: flex; flex: none; background: #e8e8ed; border-radius: 999px; padding: 3px; }
.lang a { color: var(--muted); font-size: 14px; font-weight: 600; padding: 6px 11px; border-radius: 999px; text-decoration: none; min-width: 46px; text-align: center; }
.lang a.on { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }

.bottom-nav {
  position: fixed;
  z-index: 20;
  left: 0; right: 0; bottom: 0;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  background: rgba(255, 255, 255, .85);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-top: 1px solid rgba(0, 0, 0, .08);
  padding: 4px 6px;
  padding-bottom: calc(4px + env(safe-area-inset-bottom));
}
.bottom-nav a {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 8px 2px 7px;
  border-radius: 14px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  text-decoration: none;
  min-height: 58px;
}
.bottom-nav a.on { color: var(--navy); }

.wrap { max-width: 1060px; margin: 0 auto; padding: 16px; display: grid; gap: 18px; min-width: 0; }
.wrap > * { min-width: 0; }
.foot { max-width: 1060px; margin: 0 auto; padding: 8px 16px 28px; color: var(--muted); font-size: 14px; }

.page-title { font-size: 28px; font-weight: 700; }
.page-title.small { font-size: 22px; }
.lead { color: var(--muted); }
.meta { color: var(--muted); font-size: 15px; display: flex; flex-wrap: wrap; align-items: center; gap: 5px; }
.meta.big { font-size: 17px; }
.desc { white-space: normal; overflow-wrap: anywhere; }
.back { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; text-decoration: none; min-height: 40px; }
.sec-title { font-size: 22px; font-weight: 700; margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
section > .sec-title + .stack { margin-top: 0; }

.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
  display: grid;
  gap: 12px;
  min-width: 0;
}
.stack { display: grid; gap: 10px; min-width: 0; grid-template-columns: minmax(0, 1fr); }
/* Колонка всегда по ширине карточки: длинный текст и фото не выталкивают содержимое за край. */
.card, .wcard, .wrap, .form, .field, .auth, .stages, .notes, .history, .report-items, .thread, .ladder, .review, .topic-items, .stage-form, .note-reply, .stages li > div, .report-items li, .history li, .meter-body, .day-modal-body { grid-template-columns: minmax(0, 1fr); }
.columns { display: grid; gap: 18px; min-width: 0; }
.columns > * { min-width: 0; }

/* Главная */
.hero {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #ffffff 0%, #eef3ff 100%);
  box-shadow: var(--shadow);
  color: var(--ink);
  border-radius: var(--radius);
  padding: 22px 20px;
  display: grid;
  gap: 12px;
}
.hero::before, .hero::after { content: ""; position: absolute; border-radius: 50%; pointer-events: none; display: none; }
.hero::before { width: 240px; height: 240px; right: -80px; top: -110px; background: radial-gradient(circle, rgba(255, 255, 255, .95), rgba(255, 255, 255, 0) 70%); }
.hero::after { width: 200px; height: 200px; left: -70px; bottom: -120px; background: radial-gradient(circle, rgba(120, 170, 240, .45), rgba(120, 170, 240, 0) 70%); }
.hero > * { position: relative; }
.hero-info { display: grid; gap: 10px; min-width: 0; }
.hero.has-photo { background-size: cover; background-position: center; color: #fff; border-color: rgba(255, 255, 255, .5); min-height: 340px; padding: 10px; align-content: end; }
.hero.has-photo::before { display: block; inset: 0; width: auto; height: auto; border-radius: 0; background:
  linear-gradient(160deg, rgba(0, 113, 227, .30) 0%, rgba(0, 113, 227, 0) 42%),
  linear-gradient(20deg, rgba(255, 59, 48, .16) 0%, rgba(255, 59, 48, 0) 40%),
  linear-gradient(180deg, rgba(0, 0, 0, 0) 48%, rgba(0, 0, 0, .42) 100%); }
.hero.has-photo .hero-info { gap: 5px; padding: 9px 12px 10px; border-radius: 14px; background: rgba(20, 20, 22, .55); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border: 1px solid rgba(255, 255, 255, .18); }
.hero.has-photo .hero-dev { padding-right: 0; font-size: 14px; }
.hero.has-photo h1 { font-size: 24px; padding-right: 0; }
.hero.has-photo .hero-sub { font-size: 13px; }
.hero.has-photo .bar { height: 8px; }
.hero.has-photo .hero-chev { width: 30px; height: 30px; }
.hero.has-photo .hot-panel { margin-top: 6px; }
.hero.has-photo::after { display: none; }
.hero.has-photo h1 .accent, .hero.has-photo .hero-dev, .hero.has-photo .hero-sub { color: #fff; }
.hero.has-photo .hero-dev, .hero.has-photo .hero-sub { color: rgba(255, 255, 255, .85); }
.hero.has-photo .bar { background: rgba(255, 255, 255, .3); box-shadow: none; }
.hero.has-photo .bar i { background: #fff; }
.hero-preview { width: 100%; max-height: 220px; object-fit: cover; border-radius: 14px; }
.hero h1 { font-size: clamp(26px, 8vw, 34px); font-weight: 700; padding-right: 62px; }
.hero h1 .accent { color: var(--navy); }
.hero-toggle { all: unset; cursor: pointer; display: inline-flex; align-items: center; flex-wrap: wrap; gap: 10px; border-radius: 12px; }
.hero-toggle:focus-visible { outline: 3px solid #7fb0ff; outline-offset: 4px; }
.hero-chev { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: #e8e8ed; color: var(--ink); transition: transform .2s; }
.hero.has-photo .hero-chev { background: rgba(255, 255, 255, .9); }
.hero-chev .ic { transform: rotate(90deg); }
.hero-toggle[aria-expanded="true"] .hero-chev { transform: rotate(180deg); }
.chart .sec-head { margin: 0; }
.chart h2 { display: flex; align-items: center; gap: 8px; }
.hero-dev { color: var(--muted); font-size: 15px; font-weight: 500; }
.hero-sub { color: var(--muted); font-size: 16px; font-weight: 500; }
.hot { position: static; }
.hot summary { position: absolute; top: 14px; right: 14px; z-index: 2; list-style: none; cursor: pointer; display: grid; place-items: center; width: 56px; height: 56px; padding: 0; border-radius: 50%; background: #ff3b30; color: #fff; box-shadow: 0 6px 18px rgba(255, 59, 48, .35); transition: transform .15s; }
.hot summary::-webkit-details-marker { display: none; }
.hot summary:focus { outline: none; }
.hot summary:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
.hot summary:hover { transform: scale(1.05); }
.hot[open] summary { background: #d70015; }
.hero-dev { padding-right: 70px; }
.hot-panel { position: relative; z-index: 1; margin-top: 4px; background: #fff; border-radius: 18px; padding: 10px; display: grid; gap: 4px; box-shadow: 0 10px 30px rgba(36, 74, 140, .18); color: var(--ink); }
.hot-panel h3 { display: flex; align-items: center; gap: 8px; padding: 4px 10px 6px; font-size: 17px; color: var(--ink); }
.hot-row { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; align-items: center; gap: 8px; padding: 8px 6px; border-radius: 14px; text-decoration: none; color: inherit; }
.hot-row .btn { min-height: 36px; padding: 5px 11px; font-size: 13px; background: #ff3b30; color: #fff; }
.hot-who small { white-space: nowrap; font-size: 14px; }
.hot-panel.in-modal { position: static; z-index: auto; background: none; box-shadow: none; padding: 0; margin: 0; }
.hot-panel.in-modal h3 { font-size: 22px; padding: 0 44px 6px 0; }
.hot-who b { font-size: 16px; }
.hot-row:hover { background: var(--blue-ice); }
.hot-ic { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--late-bg); color: #ff3b30; }
.hot-who { display: grid; min-width: 0; }
.hot-who b { font-size: 17px; }
.hot-who small { color: var(--muted); font-size: 15px; font-variant-numeric: tabular-nums; }
.contacts-edit { display: grid; gap: 8px; }
.contact-edit { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: 8px; }
.bar { height: 10px; border-radius: 999px; background: #e8e8ed; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--navy); border-radius: 999px; }

.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.tile { border-radius: 16px; padding: 12px 4px 10px; text-decoration: none; display: grid; gap: 4px; align-content: start; justify-items: center; text-align: center; background: #fff; box-shadow: var(--shadow); min-width: 0; }
.tile strong { font-size: clamp(26px, 8vw, 40px); line-height: 1.02; font-weight: 700; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.tile span { display: block; font-size: clamp(10px, 2.95vw, 15px); font-weight: 600; line-height: 1.2; letter-spacing: -.01em; min-width: 0; max-width: 100%; white-space: nowrap; }
.tile span .ic { display: none; }
@media (max-width: 340px) { .tiles { gap: 4px; } .tile { padding-left: 2px; padding-right: 2px; } }
.tile.late { color: var(--late); }
.tile.none { color: var(--none); }
.tile.work { color: var(--work); }
.tile.done { color: var(--done); }
.tile.on { box-shadow: var(--shadow), inset 0 0 0 2px currentColor; }

.report-line { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 11px; align-items: center; background: var(--card); box-shadow: var(--shadow); border-radius: var(--radius); padding: 13px 15px; text-decoration: none; color: var(--ink); }
.report-line > span { display: grid; gap: 1px; min-width: 0; }
.report-line small { color: var(--muted); font-size: 14px; }
.report-line-state { font-weight: 700; font-size: 16px; }
.report-line.ok > .ic:first-child, .report-line.ok .report-line-state { color: var(--done); }
.report-line.wait > .ic:first-child, .report-line.wait .report-line-state { color: var(--work); }
.report-line.idle > .ic:first-child, .report-line.idle .report-line-state { color: var(--none); }
.report-line > .ic:last-child { color: var(--muted); }
.works { display: grid; gap: 12px; min-width: 0; }
/* Диаграмма готовности: один оттенок, подложка светлее, числа текстом */
.meter { display: block; height: 12px; border-radius: 999px; background: var(--blue-soft); overflow: hidden; min-width: 0; }
.meter i { display: block; height: 100%; background: var(--navy); border-radius: 999px; }
.meter.small { height: 8px; }
.meter-line { display: flex; align-items: center; gap: 8px; }
.meter-line .meter { flex: 1; }
.meter-line b { font-size: 15px; color: var(--ink); font-variant-numeric: tabular-nums; min-width: 38px; text-align: right; }
.meters { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.meters li { border-top: 1px solid var(--line); padding-top: 8px; }
.meters li:first-child { border-top: 0; padding-top: 0; }
.meter-row summary { list-style: none; cursor: pointer; display: grid; grid-template-columns: minmax(0, 1fr) 58px 26px; grid-template-areas: "label val chev" "bar val chev"; gap: 5px 10px; align-items: center; color: inherit; min-height: 48px; border-radius: 12px; }
.meter-row summary::-webkit-details-marker { display: none; }
.meter-row summary:hover .meter-label { color: var(--navy); }
.meter-chev { grid-area: chev; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: #e8e8ed; color: var(--ink); transition: transform .2s; }
.meter-chev .ic { transform: rotate(90deg); }
.meter-row[open] .meter-chev { transform: rotate(180deg); }
.meter-body { display: grid; gap: 10px; padding: 10px 0 6px 2px; }
.meter-body .dl { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.stages.compact { gap: 8px; padding: 10px 12px; background: var(--none-bg); border-radius: 14px; }
.stages.compact li { grid-template-columns: 24px minmax(0, 1fr); gap: 8px; }
.stages.compact b { font-weight: 600; font-size: 16px; }
.stages.compact li.with-acts { grid-template-columns: 24px minmax(0, 1fr) auto; align-items: start; }
.stage-acts { display: flex; gap: 6px; }
.stage-act { position: relative; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: #e8e8ed; color: var(--ink); text-decoration: none; }
.stage-act:hover { background: #dcdce1; }
.stage-act.add { background: var(--navy); color: #fff; }
.stage-act.add:hover { background: var(--navy-deep); }
.stage-act .cnt { position: absolute; top: -5px; right: -5px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--late); color: #fff; font-size: 11px; font-weight: 700; font-style: normal; display: grid; place-items: center; }
.meter-label { grid-area: label; font-weight: 700; font-size: 16px; line-height: 1.25; overflow-wrap: anywhere; }
.meter-label small { display: block; color: var(--muted); font-weight: 500; font-size: 14px; }
.meters .meter { grid-area: bar; }
.meter-val { grid-area: val; text-align: right; font-weight: 700; font-size: 20px; color: var(--ink); font-variant-numeric: tabular-nums; }
.percent-field { max-width: 180px; }
.works .sec-head { margin: 0; }
.works h2 { display: flex; align-items: center; gap: 8px; font-size: 22px; }
.loc-line { font-weight: 600; overflow-wrap: anywhere; }
.optional { color: var(--muted); font-weight: 400; font-size: 14px; }

.report-state { display: flex; align-items: flex-start; gap: 7px; font-weight: 700; }
.report-state.ok { color: var(--done); }
.report-state.bad { color: var(--late); }
.report-state.wait { color: var(--work); }
.report-state.idle { color: var(--none); }
.report-prev { color: var(--muted); font-size: 15px; }
.report-lines { margin: 0; padding: 0; list-style: none; display: grid; gap: 7px; }
.card-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; border-top: 1px solid var(--line); padding-top: 10px; }
.link { display: inline-flex; align-items: center; gap: 2px; font-weight: 700; color: var(--navy); text-decoration: none; min-height: 32px; }

/* Кнопки-пилюли */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 10px 20px;
  border-radius: 999px;
  border: 0;
  background: rgba(0, 113, 227, .1);
  color: var(--navy);
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  text-align: center;
  cursor: pointer;
  transition: background .15s, transform .15s;
}
.btn:hover { background: rgba(0, 113, 227, .16); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 3px solid #7fb0ff; outline-offset: 2px; }
.btn.primary { background: var(--navy); color: #fff; }
.btn.primary:hover { background: var(--navy-deep); }
.btn.danger { background: var(--late-bg); color: var(--late); }
.btn.danger:hover { background: #fbdcdc; }
.btn.ghost { background: #f2f2f7; color: var(--muted); }
.btn.pressed { background: var(--done-bg); color: var(--done); }
.btn.small { min-height: 40px; padding: 6px 14px; font-size: 15px; }
.btn.big { min-height: 56px; font-size: 18px; }
.wide { width: 100%; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.cta { min-height: 56px; font-size: 18px; }

/* Статусы */
.badge { display: inline-flex; align-items: center; gap: 5px; align-self: flex-start; justify-self: start; border-radius: 999px; padding: 4px 11px 4px 8px; font-size: 14px; font-weight: 600; line-height: 1.3; width: fit-content; }
.badge.late { background: var(--late-bg); color: var(--late); }
.badge.work { background: var(--work-bg); color: var(--work); }
.badge.done { background: var(--done-bg); color: var(--done); }
.badge.none { background: var(--none-bg); color: var(--none); }
.pill { background: #e8e8ed; color: var(--muted); border-radius: 999px; padding: 1px 10px; font-size: 14px; font-weight: 600; }
.pill.late { background: var(--late-bg); color: var(--late); }

/* Карточка работы в списке */
.wcard { background: var(--card); box-shadow: var(--shadow); border-radius: var(--radius); padding: 16px 17px; display: grid; gap: 6px; text-decoration: none; color: inherit; min-width: 0; transition: box-shadow .15s, transform .15s; }
a.wcard:hover { box-shadow: var(--shadow-up); transform: translateY(-1px); }
.wcard.attention { border: 2px solid #f0c66a; background: #fffaf0; }
.wcard h3 { overflow-wrap: anywhere; }
.wcard-head { display: grid; gap: 7px; }
.dl { font-weight: 600; }
.dl.late { color: var(--late); }
.dl.done { color: var(--done); }
.dl.none { color: var(--none); }
.note-line { color: var(--work); font-size: 15px; font-weight: 600; }
.stages-mini { color: var(--muted); font-size: 15px; }
.flag { color: var(--work) !important; font-weight: 600; }

/* Поиск и фильтры */
.search { display: flex; gap: 8px; min-width: 0; }
.search input { flex: 1; min-width: 0; }
.chips { display: flex; gap: 8px; overflow-x: auto; margin: -4px -16px; padding: 4px 16px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; display: inline-flex; align-items: center; gap: 5px; min-height: 40px; padding: 7px 15px; border-radius: 999px; background: #e8e8ed; color: var(--ink); text-decoration: none; font-size: 15px; font-weight: 500; white-space: nowrap; }
.chip small { color: var(--muted); }
.chips.fit { flex-wrap: wrap; overflow: visible; margin: 0; padding: 0; }
.chip.on { background: var(--ink); color: #fff; }
.chip.on small { color: #c7c7cc; }
.empty { color: var(--muted); padding: 22px 16px; text-align: center; background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); }
.empty-page { text-align: center; padding: 50px 16px; display: grid; gap: 16px; justify-items: center; }

/* Страница работы */
.work-head { display: grid; gap: 10px; }
.work-head h1 { font-size: 27px; overflow-wrap: anywhere; }
.status-big { display: flex; gap: 11px; align-items: flex-start; border-radius: var(--radius); padding: 15px; }
.status-big div { display: grid; gap: 1px; min-width: 0; }
.status-big strong { font-size: 21px; line-height: 1.25; }
.status-big span { font-size: 16px; }
.status-big.late { background: var(--late-bg); color: var(--late); }
.status-big.work { background: var(--work-bg); color: var(--work); }
.status-big.done { background: var(--done-bg); color: var(--done); }
.status-big.none { background: var(--none-bg); color: var(--none); }
.note-box { background: var(--work-bg); color: #6a4600; border-radius: var(--radius-s); padding: 11px 14px; font-size: 16px; overflow-wrap: anywhere; }
.facts .fact, .fact-line { display: flex; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); padding-bottom: 9px; }
.fact-line.col { flex-direction: column; gap: 2px; border-bottom: 0; }
.fact span, .fact-line span { color: var(--muted); }
.fact b, .fact-line b { text-align: right; overflow-wrap: anywhere; }
.fact-line.col b { text-align: left; font-weight: 500; }
.red { color: var(--late); }
.moves { margin: 0; padding: 0 0 0 18px; color: var(--muted); font-size: 15px; display: grid; gap: 5px; overflow-wrap: anywhere; }

.next-steps.is-late { box-shadow: var(--shadow), inset 0 0 0 1.5px #f3c3be; }
.ladder { list-style: none; margin: 0; padding: 0; display: grid; }
.ladder li { position: relative; padding: 0 0 13px 26px; display: grid; gap: 1px; min-width: 0; }
.ladder li::before { content: ""; position: absolute; left: 3px; top: 5px; width: 13px; height: 13px; border-radius: 50%; border: 2.5px solid #b4c3d8; background: #fff; }
.ladder li::after { content: ""; position: absolute; left: 9px; top: 20px; bottom: -3px; width: 2px; background: var(--line); }
.ladder li:last-child { padding-bottom: 0; }
.ladder li:last-child::after { display: none; }
.ladder li.sent::before { background: var(--navy); border-color: var(--navy); }
.ladder li.due::before { background: var(--late); border-color: var(--late); }
.ladder-date { font-size: 14px; color: var(--muted); font-weight: 700; }
.ladder li.due .ladder-date { color: var(--late); }
.ladder-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 7px; }

.stages { list-style: none; margin: 0; padding: 0; display: grid; gap: 13px; }
.stages li { display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 9px; }
.stages li > div { display: grid; gap: 4px; min-width: 0; }
.stages b { overflow-wrap: anywhere; }
.stage-mark { color: #b4c3d8; padding-top: 1px; }
.is-done .stage-mark { color: var(--done); }
.stages small { color: var(--muted); font-size: 14px; overflow-wrap: anywhere; }
.topics-list { display: grid; gap: 8px; }
.topic-sec summary { list-style: none; cursor: pointer; display: grid; grid-template-columns: minmax(0, 1fr) auto 26px; align-items: center; gap: 10px; min-height: 58px; padding: 10px 14px; background: var(--card); box-shadow: var(--shadow); border-radius: 16px; }
.topic-sec summary::-webkit-details-marker { display: none; }
.topic-sec .meter-chev { grid-area: auto; }
.topic-name { font-weight: 600; font-size: 18px; }
.topic-sec[open] summary { border-radius: 16px 16px 0 0; }
.topic-sec[open] .meter-chev { transform: rotate(180deg); }
.topic-items { padding: 6px 0 2px; display: grid; gap: 2px; }
.problem-row { display: grid; grid-template-columns: 46px minmax(0, 1fr) 18px; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; text-decoration: none; color: inherit; min-height: 60px; }
.problem-row:hover { background: var(--none-bg); }
.problem-thumb { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 10px; background: var(--late-bg); color: var(--late); overflow: hidden; }
.problem-thumb img { width: 100%; height: 100%; object-fit: cover; }
.problem-main { display: grid; gap: 1px; min-width: 0; }
.problem-main b { font-size: 15px; line-height: 1.25; overflow-wrap: anywhere; }
.problem-main small { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.problem-row > .ic { color: var(--muted); }
.problem { gap: 8px; }
.del-form { display: flex; justify-content: flex-end; }
.btn.del { background: none; color: var(--late); min-height: 36px; padding: 4px 10px; font-size: 14px; font-weight: 500; }
.btn.del:hover { background: var(--late-bg); }
.issue-block { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; min-width: 0; }
.tl { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; }
.tl li { display: grid; grid-template-columns: minmax(0, 1fr); gap: 3px; padding: 8px 10px; border-radius: 10px; background: var(--none-bg); overflow-wrap: anywhere; }
.tl b { font-size: 14px; }
.tl small { color: var(--muted); font-size: 13px; }
.tl-fixed b { color: var(--done); }
.tl-disputed { background: var(--late-bg); }
.tl-disputed b { color: var(--late); }
.tl-accepted b, .tl-archived b { color: var(--muted); }
.decide { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; padding: 12px; border-radius: 14px; background: var(--work-bg); min-width: 0; }
.decide-note { font-weight: 600; color: #6a4600; font-size: 15px; }
.stage-do.dispute-do summary { background: var(--late-bg); color: var(--late); width: 100%; justify-content: center; min-height: 46px; }
.stage-do.dispute-do[open] summary { background: var(--late); color: #fff; }
.stage-do.dispute-do[open] .stage-form { background: #fff; border-radius: 0 0 16px 16px; }
.topic-cards { padding: 10px 0 4px; }
.topic-sec.archive summary { background: #f2f2f7; box-shadow: none; }
.st-late { color: var(--late) !important; font-weight: 600; }
.st-work { color: var(--work) !important; font-weight: 600; }
.st-done { color: var(--done) !important; font-weight: 600; }
.st-none { color: var(--muted) !important; }
.nav-badge { position: absolute; top: 3px; left: calc(50% + 6px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--late); color: #fff; font-size: 11px; font-weight: 700; font-style: normal; display: grid; place-items: center; }
.bottom-nav a { position: relative; }
.top-nav a { position: relative; }
.top-nav .nav-badge { position: static; display: inline-grid; margin-left: 5px; }
.problem-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.problem h3 { font-size: 17px; }
.note-btn { display: inline-flex; align-items: center; gap: 5px; margin-top: 4px; min-height: 36px; padding: 5px 12px; border-radius: 999px; background: #f2f2f7; color: var(--navy); font-size: 14px; font-weight: 600; text-decoration: none; width: fit-content; }
.note-btn:hover { background: #e8e8ed; }
.notes { display: grid; gap: 6px; margin-top: 4px; }
.note-reply { margin-top: 6px; padding: 8px 10px; border-left: 3px solid var(--done); background: #fff; border-radius: 8px; display: grid; gap: 4px; }
.note-reply b { color: var(--done); font-size: 14px; }
.reply-do { margin-top: 8px; }
.review.note { padding: 9px 12px; font-size: 15px; }
.stage-do { margin-top: 4px; }
.stage-do summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 6px 16px; border-radius: 999px; background: rgba(0, 113, 227, .1); color: var(--navy); font-weight: 600; font-size: 15px; }
.stage-do summary::-webkit-details-marker { display: none; }
.stage-do[open] summary { background: var(--navy); color: #fff; border-radius: 16px 16px 0 0; }
.stage-do[open] .stage-form { margin-top: 0; border-radius: 0 16px 16px 16px; }
.stage-form { display: grid; gap: 10px; margin-top: 5px; padding: 12px; background: var(--none-bg); border-radius: 16px; min-width: 0; }
.inline-add { display: grid; gap: 8px; border-top: 1px solid var(--line); padding-top: 12px; }

.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 7px; }
.photos.small { grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); max-width: 340px; }
.photos a { display: block; aspect-ratio: 4 / 3; border-radius: 12px; overflow: hidden; background: var(--none-bg); box-shadow: 0 2px 8px rgba(36, 74, 140, .1); }
.photos img { width: 100%; height: 100%; object-fit: cover; }
.sub { font-size: 15px; color: var(--muted); font-weight: 700; }

.check-count { display: flex; flex-wrap: wrap; gap: 8px 16px; font-weight: 700; }
.check-count span { display: inline-flex; align-items: center; gap: 5px; }
.check-count .ok { color: var(--done); }
.check-count .bad { color: var(--late); }
.review { margin: 0; padding: 12px 14px; border-radius: var(--radius-s); background: var(--none-bg); display: grid; gap: 7px; overflow-wrap: anywhere; }
.review.bad { background: var(--late-bg); }
.review footer { color: var(--muted); font-size: 14px; }
.history { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.history li { display: grid; gap: 1px; border-bottom: 1px solid var(--line); padding-bottom: 9px; overflow-wrap: anywhere; }
.history li:last-child { border-bottom: 0; padding-bottom: 0; }
.history time { color: var(--muted); font-size: 14px; }
.history small { color: var(--muted); font-size: 13px; }
.log { background: var(--card); box-shadow: var(--shadow); border-radius: var(--radius); padding: 16px; }

/* Отчёты */
.report-summary { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; font-weight: 700; }
.report-summary span { display: inline-flex; align-items: center; gap: 5px; }
.report-summary .ok { color: var(--done); }
.report-summary .bad { color: var(--late); }
.report-summary .bad.zero { color: var(--muted); }
.reports-layout { display: grid; gap: 14px; min-width: 0; }
.reports-layout > * { min-width: 0; }
.cal-head { display: flex; align-items: center; justify-content: space-between; }
.cal-head b { font-size: 18px; }
.cal-nav { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: #e8e8ed; color: var(--ink); }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; text-align: center; }
.wd { color: var(--muted); font-size: 13px; padding-bottom: 3px; }
.cal-day { display: grid; place-items: center; aspect-ratio: 1; min-height: 38px; border-radius: 12px; font-weight: 700; font-size: 16px; text-decoration: none; color: var(--ink); }
.cal-day { position: relative; }
.cal-day .dot { position: absolute; left: 50%; bottom: 4px; width: 6px; height: 6px; margin-left: -3px; border-radius: 50%; background: var(--navy); }
.cal-day.before .dot { background: var(--navy); }
.cal-day.before:is(a) { color: var(--ink); font-weight: 600; background: var(--none-bg); }
.day-events li { display: grid; gap: 2px; }
.day-more summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; min-height: 36px; color: var(--muted); font-size: 15px; font-weight: 500; }
.day-more summary::-webkit-details-marker { display: none; }
.day-more summary .ic { transform: rotate(90deg); transition: transform .2s; }
.day-more[open] summary .ic { transform: rotate(-90deg); }
.day-more[open] .day-events { margin-top: 8px; }
.day-events .link { font-size: 15px; min-height: 0; }
.cal-day.ok { background: var(--done-bg); color: var(--done); }
.cal-day.miss { background: var(--late-bg); color: var(--late); }
.cal-day.wait { background: var(--work-bg); color: var(--work); }
.cal-day.future, .cal-day.before { color: #aab8cc; font-weight: 400; }
.cal-day.sel { outline: 2.5px solid var(--navy); outline-offset: 1px; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; color: var(--muted); font-size: 14px; }
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.legend i { width: 13px; height: 13px; border-radius: 4px; }
.legend i.ok { background: #8ed1a8; }
.legend i.miss { background: #eca29c; }
.legend i.wait { background: #eec66f; }
.legend i.chg { width: 7px; height: 7px; border-radius: 50%; background: var(--navy); margin: 0 3px; }
/* Всплывающее окно дня */
.has-day-modal [data-day-panel] { display: none; }
.has-day-modal .reports-layout { grid-template-columns: 1fr; }
.has-day-modal .calendar { max-width: 560px; }
.day-modal { border: 0; padding: 0; margin: auto; width: min(560px, calc(100vw - 24px)); max-height: min(88vh, 780px); border-radius: 20px; background: #fff; box-shadow: var(--shadow-up); color: var(--ink); overflow: hidden; display: none; grid-template-rows: minmax(0, 1fr) auto; }
.day-modal[open] { display: grid; animation: pop-in .3s cubic-bezier(.2, .8, .2, 1); }
.day-modal[open]::backdrop { animation: fade-in .25s ease; }
@keyframes pop-in { from { opacity: 0; transform: translateY(18px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
.confirm-modal { border: 0; margin: auto; padding: 22px 20px 18px; width: min(400px, calc(100vw - 32px)); border-radius: 20px; background: #fff; color: var(--ink); box-shadow: var(--shadow-up); }
.confirm-modal[open] { animation: pop-in .25s cubic-bezier(.2, .8, .2, 1); }
.confirm-modal::backdrop { background: rgba(0, 0, 0, .4); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.confirm-modal[open]::backdrop { animation: fade-in .2s ease; }
.confirm-modal p { font-size: 18px; font-weight: 600; line-height: 1.3; text-align: center; margin-bottom: 18px; }
.confirm-btns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.confirm-btns .btn { padding: 10px 8px; }
.confirm-yes { background: var(--late); color: #fff; }
.btn.confirm-yes:hover { background: #b0000f; }
@media (prefers-reduced-motion: reduce) { .day-modal[open], .day-modal[open]::backdrop, .confirm-modal[open], .confirm-modal[open]::backdrop { animation: none; } }
.day-modal-foot { padding: 10px 14px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: #fff; }
.day-modal::backdrop { background: rgba(0, 0, 0, .35); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.day-modal-body > * { min-width: 0; }
.day-modal-body .history, .day-modal-body .report-items { grid-template-columns: minmax(0, 1fr); }
.day-modal-body .history li, .day-modal-body .report-items li { min-width: 0; grid-template-columns: minmax(0, 1fr); }
.day-modal-body .photos { max-width: 100%; }
.day-modal-body .link { min-width: 0; overflow-wrap: anywhere; }
.day-modal-body .fact-line b { flex: none; }
.day-modal-body { grid-template-columns: minmax(0, 1fr); scrollbar-gutter: stable; min-width: 0; min-height: 0; overflow: auto; overflow-x: hidden; padding: 20px 18px 18px; display: grid; gap: 12px; -webkit-overflow-scrolling: touch; }
.day-close { position: absolute; top: 10px; right: 10px; width: 36px; height: 36px; border: 0; border-radius: 50%; background: #e8e8ed; color: var(--ink); font-size: 16px; font-weight: 600; cursor: pointer; z-index: 5; }
.day-close:hover { background: #dcdce1; }
.day-close:focus { outline: none; }
.day-close:focus-visible { outline: 3px solid #7fb0ff; outline-offset: 2px; }
.day-modal-body:focus { outline: none; }
.day-modal-body > h2:first-child { padding-right: 44px; overflow-wrap: anywhere; }
.answered { display: inline-flex; align-items: center; gap: 4px; color: var(--done) !important; font-weight: 600; }
.report-items { list-style: none; margin: 0; padding: 0; display: grid; gap: 13px; }
.report-items li { display: grid; gap: 5px; overflow-wrap: anywhere; }
.report-items a { text-decoration: none; }

/* Формы */
.form { display: grid; gap: 14px; min-width: 0; }
.field { display: grid; gap: 5px; border: 0; padding: 0; margin: 0; min-width: 0; }
.field > span, .field > legend { font-weight: 700; padding: 0; }
.field > legend { margin-bottom: 6px; }
.polls { display: grid; gap: 8px; min-width: 0; }
.polls-track { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding: 0 16px; margin: -6px -16px -14px; padding: 6px 16px 14px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.polls-track::-webkit-scrollbar { display: none; }
.polls-track:focus { outline: none; }
.polls-track > .poll { flex: 0 0 100%; min-width: 0; scroll-snap-align: start; align-content: start; }
.polls.many .polls-track > .poll { flex-basis: calc(100% - 22px); }
.polls-nav { display: flex; align-items: center; justify-content: center; gap: 14px; }
.polls-arrow { display: grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 50%; background: #e8e8ed; color: var(--ink); cursor: pointer; }
.polls-arrow:hover:not(:disabled) { background: #dcdce1; }
.polls-arrow:disabled { opacity: .35; cursor: default; }
.polls-arrow:focus-visible { outline: 3px solid #7fb0ff; outline-offset: 2px; }
.polls-count { min-width: 104px; text-align: center; color: var(--muted); font-size: 15px; font-weight: 500; font-variant-numeric: tabular-nums; }
.poll { gap: 10px; scroll-margin-top: 70px; }
.poll-kicker { color: var(--muted); font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.poll-list { display: grid; gap: 8px; }
.poll-opt { position: relative; overflow: hidden; display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; min-height: 50px; padding: 10px 14px; border: 0; border-radius: 12px; background: #f2f2f7; color: var(--ink); font: inherit; text-align: left; }
button.poll-opt { cursor: pointer; }
button.poll-opt:hover { background: #e8e8ed; }
button.poll-opt:focus-visible { outline: 3px solid #7fb0ff; outline-offset: 2px; }
.poll-fill { position: absolute; left: 0; top: 0; bottom: 0; background: rgba(0, 113, 227, .16); transition: width .4s ease; }
.poll-opt.on .poll-fill { background: rgba(0, 113, 227, .28); }
.poll-text { position: relative; display: inline-flex; align-items: center; gap: 6px; font-weight: 500; line-height: 1.25; min-width: 0; overflow-wrap: anywhere; }
.poll-opt.on .poll-text { font-weight: 600; color: var(--navy); }
.poll-opt b { position: relative; flex: none; font-variant-numeric: tabular-nums; }
.issued { box-shadow: var(--shadow), inset 0 0 0 1.5px var(--done); }
.pw-big { font-size: 30px; font-weight: 700; letter-spacing: .06em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.pw-input { flex: 1 1 100%; min-height: 42px !important; font-size: 15px !important; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
input[type=text], input[type=tel], input[type=password], input[type=search], input[type=number], input[type=date], textarea, select {
  width: 100%;
  min-height: 50px;
  padding: 11px 15px;
  border: 1px solid #d2d2d7;
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  max-width: 100%;
  min-width: 0;
}
input[type=search] { border-radius: 999px; }
input[type=date] { -webkit-appearance: none; appearance: none; }
textarea { resize: vertical; }
.code-input { font-size: 28px; letter-spacing: .25em; text-align: center; font-variant-numeric: tabular-nums; }
.hint { color: var(--muted); font-size: 15px; }
.auth { max-width: 460px; width: 100%; margin: 0 auto; display: grid; gap: 14px; }
.forgot-link { justify-self: center; font-weight: 500; font-size: 15px; }
.confirm-way { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; padding-top: 14px; border-top: 1px solid var(--line); }
.confirm-way h3, .confirm-way p { margin: 0; }
.hint.center { text-align: center; }
.reg-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.lesson-btn { gap: 6px; }
.lesson-video { display: block; justify-self: center; height: min(58vh, 560px); aspect-ratio: 9 / 16; max-width: 100%; margin: 0 auto; border-radius: 16px; background: #000; object-fit: contain; }
.lesson-steps { margin: 0; padding-left: 22px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; overflow-wrap: anywhere; }
.lesson-push { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.tel-wrap { position: relative; display: block; min-width: 0; font-weight: 400; }
.tel-prefix { position: absolute; left: 16px; top: 0; bottom: 0; display: flex; align-items: center; color: var(--ink); pointer-events: none; }
.tel-wrap input[type=tel] { padding-left: 46px; }
.ticket-rest { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; min-width: 0; }
.proposal-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0; padding: 4px 14px; }
.proposal-row { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px; padding: 10px 0; border-bottom: 1px solid var(--line); min-width: 0; }
.proposal-row:last-child { border-bottom: 0; }
.proposal-row b, .proposal-row small { overflow-wrap: anywhere; }
.proposal-row small { font-size: 14px; }
.proposal h3 { overflow-wrap: anywhere; }
.proposal-stages { margin: 0; padding-left: 20px; display: grid; gap: 3px; }
.proposal-stages li { overflow-wrap: anywhere; }
.dev-rows, .admin-todo { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0; padding: 4px 6px; }
.dev-row { display: grid; grid-template-columns: minmax(0, 1fr) 18px; align-items: center; gap: 8px; padding: 12px 8px; text-decoration: none; color: inherit; border-bottom: 1px solid var(--line); }
.dev-row:last-child { border-bottom: 0; }
.dev-row:hover { background: var(--none-bg); }
.dev-row > .ic, .todo-row > .ic { color: var(--muted); }
.dev-row-main { display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px; min-width: 0; }
.dev-row-main > b { font-size: 16px; line-height: 1.25; overflow-wrap: anywhere; }
.dev-row-main > small { font-size: 14px; line-height: 1.3; overflow-wrap: anywhere; }
.dev-row-main > small:not([class]) { color: var(--muted); }
.dev-done summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; min-height: 40px; color: var(--muted); font-weight: 500; }
.dev-done summary::-webkit-details-marker { display: none; }
.dev-done summary .ic { transform: rotate(90deg); transition: transform .2s; }
.dev-done[open] summary .ic { transform: rotate(-90deg); }
.stages li.stage-open { display: block; }
.stage-check summary { list-style: none; cursor: pointer; display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 9px; align-items: start; min-height: 44px; }
.stage-check summary::-webkit-details-marker { display: none; }
.check-circle { display: block; width: 24px; height: 24px; margin-top: 1px; border: 2px solid #b4c3d8; border-radius: 50%; background: #fff; }
.stage-check summary:hover .check-circle, .stage-check[open] .check-circle { border-color: var(--navy); background: var(--blue-soft); }
.stage-check-text { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1px; min-width: 0; }
.stages .stage-check-text small { color: var(--navy); font-weight: 500; }
.stage-check .stage-form { margin-top: 8px; }
.stage-notes-link { margin-left: 35px; }
.todo-row { display: grid; grid-template-columns: 38px minmax(0, 1fr) 18px; align-items: center; gap: 10px; min-height: 56px; padding: 8px; text-decoration: none; color: inherit; border-bottom: 1px solid var(--line); }
.todo-row:last-child { border-bottom: 0; }
.todo-row:hover { background: var(--none-bg); }
.todo-num { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--late-bg); color: var(--late); font-weight: 700; font-variant-numeric: tabular-nums; }
.todo-label { font-weight: 600; overflow-wrap: anywhere; min-width: 0; }
.admin-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.admin-tile { position: relative; display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px; align-content: start; min-width: 0; padding: 14px; border-radius: 18px; background: var(--card); box-shadow: var(--shadow); color: inherit; text-decoration: none; transition: box-shadow .15s, transform .15s; }
.admin-tile:hover { box-shadow: var(--shadow-up); transform: translateY(-1px); }
.admin-tile > .ic { color: var(--navy); }
.admin-tile b { font-size: 16px; overflow-wrap: anywhere; }
.admin-tile small { color: var(--muted); font-size: 13.5px; line-height: 1.3; overflow-wrap: anywhere; }
.tile-num { position: absolute; top: 12px; right: 12px; display: grid; place-items: center; min-width: 24px; height: 24px; padding: 0 7px; border-radius: 12px; background: var(--late); color: #fff; font-size: 13px; font-style: normal; font-weight: 700; }
@media (min-width: 760px) { .admin-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.add-staff summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 8px; min-height: 28px; font-weight: 600; }
.add-staff summary::-webkit-details-marker { display: none; }
.add-staff summary .ic { color: var(--muted); transform: rotate(90deg); transition: transform .2s; }
.add-staff[open] summary .ic { transform: rotate(-90deg); }
.add-staff[open] summary { margin-bottom: 12px; }
.people { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.people .sec-title { margin-bottom: 0; }
.user-filter { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.user-filter select { grid-column: 1 / -1; width: 100%; }
.user-list, .complaint-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0; padding: 4px 6px; }
.user-link { display: grid; grid-template-columns: minmax(0, 1fr) auto 18px; align-items: center; gap: 8px; min-height: 62px; padding: 9px 8px; text-decoration: none; color: inherit; border-bottom: 1px solid var(--line); }
.user-link:last-child { border-bottom: 0; }
.user-link:hover { background: var(--none-bg); }
.user-link > .ic { color: var(--muted); }
.user-main { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1px; min-width: 0; }
.user-main b { overflow-wrap: anywhere; }
.user-main small { font-size: 13.5px; overflow-wrap: anywhere; }
.user-main small:not([class]) { color: var(--muted); }
.user-count { color: var(--late); font-size: 13px; font-weight: 600; white-space: nowrap; }
.complaint { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px; padding: 4px 0; border-bottom: 1px solid var(--line); min-width: 0; }
.complaint:last-child { border-bottom: 0; }
.complaint-foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 6px 10px; padding: 0 10px 6px; min-width: 0; }
.complaint-foot .link { min-width: 0; font-size: 14px; overflow-wrap: anywhere; }
.complaint-foot .del-form { margin-left: auto; }
.pw-form { padding-top: 12px; border-top: 1px solid var(--line); }
.cab-name { margin: 2px 0 0; font-weight: 600; overflow-wrap: anywhere; }
.report-rows { display: grid; grid-template-columns: minmax(0, 1fr); border-top: 1px solid var(--line); }
.report-row { min-width: 0; border-bottom: 1px solid var(--line); }
.report-row summary { list-style: none; cursor: pointer; display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 8px; min-height: 56px; padding: 9px 0; }
.report-row summary::-webkit-details-marker { display: none; }
.report-row summary > .ic { color: var(--muted); transform: rotate(90deg); transition: transform .2s; }
.report-row[open] summary > .ic { transform: rotate(-90deg); }
.report-row-head { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1px; min-width: 0; }
.report-row-head b { overflow-wrap: anywhere; }
.report-row-head small { color: var(--muted); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.report-row[open] .report-row-head small { display: none; }
.report-row-count { display: inline-flex; align-items: center; gap: 3px; color: var(--muted); font-size: 14px; }
.report-row-body { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; padding: 0 0 13px; overflow-wrap: anywhere; }
.report-row-body p { margin: 0; }
@media (prefers-reduced-motion: reduce) { .report-row summary > .ic { transition: none; } }
.register-box { gap: 8px; text-align: center; }
.demo-roles { background: rgba(255, 250, 240, .9); border-color: #f1dcae; }
.role-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.role-grid .btn { padding: 8px 8px; gap: 5px; font-size: 15px; min-width: 0; overflow-wrap: anywhere; }
.check-line { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.check-line input { width: 24px; height: 24px; flex: none; margin: 1px 0 0; accent-color: var(--navy); }
.check-line small { display: block; color: var(--muted); font-size: 14px; }
.pick-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.pick-chips label { cursor: pointer; }
.pick-chips input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.pick-chips span { display: inline-flex; align-items: center; min-height: 44px; min-width: 44px; justify-content: center; padding: 8px 16px; background: #e8e8ed; border-radius: 999px; font-weight: 500; }
.pick-chips input:checked + span { background: var(--ink); color: #fff; }
.pick-chips input:focus-visible + span { outline: 3px solid #7fb0ff; outline-offset: 2px; }

.photo-pick { display: grid; gap: 9px; cursor: pointer; min-width: 0; }
.photo-pick-btn { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 56px; padding: 10px 13px; border: 1.5px dashed #c7c7cc; border-radius: 16px; color: var(--navy); font-weight: 600; text-align: center; background: #fff; }
.photo-pick input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.photo-pick input:focus-visible + * { outline: 3px solid #7fb0ff; }
.photo-preview { display: grid; grid-template-columns: repeat(auto-fill, minmax(74px, 1fr)); gap: 6px; }
.photo-preview:empty { display: none; }
.photo-preview img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 10px; }

.scope-pick { display: grid; gap: 10px; }
.scope-pick label { cursor: pointer; }
.scope-pick input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.scope-pick span { display: grid; gap: 3px; padding: 15px; background: #fff; border: 1px solid var(--line); border-radius: 16px; color: var(--navy); }
.scope-pick b { color: var(--ink); font-size: 19px; }
.scope-pick small { color: var(--muted); font-size: 15px; }
.scope-pick input:checked + span { border-color: var(--navy); background: var(--blue-ice); box-shadow: inset 0 0 0 1.5px var(--navy); }
.scope-pick input:focus-visible + span { outline: 3px solid #7fb0ff; outline-offset: 2px; }
.similar { background: var(--work-bg); border-radius: 16px; padding: 12px; display: grid; gap: 8px; }
.similar h3 { font-size: 16px; color: #6a4600; }
.similar [data-similar-list] { display: grid; gap: 7px; }
.similar-item { background: #fff; border-radius: 12px; padding: 10px 12px; display: grid; gap: 2px; text-decoration: none; color: inherit; }
.similar-item small { color: var(--muted); }

.verdict { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.verdict label { cursor: pointer; }
.verdict input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.verdict span { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 5px; min-height: 84px; padding: 10px; background: #fff; border: 1.5px solid #d2d2d7; border-radius: 16px; font-weight: 600; height: 100%; }
.v-ok input:checked + span { background: var(--done-bg); border-color: var(--done); color: var(--done); }
.v-bad input:checked + span { background: var(--late-bg); border-color: var(--late); color: var(--late); }
.verdict input:focus-visible + span { outline: 3px solid #7fb0ff; outline-offset: 2px; }

/* Кабинеты */
.cab-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.banner { display: flex; gap: 9px; align-items: flex-start; border-radius: var(--radius); padding: 15px; font-weight: 600; }
.banner p { display: flex; gap: 9px; align-items: flex-start; }
.banner.ok { background: var(--done-bg); color: var(--done); }
.banner.wait { background: var(--work-bg); color: #6a4600; flex-direction: column; align-items: stretch; gap: 11px; }
.banner.idle { background: var(--none-bg); color: var(--none); }
.wcard.static { gap: 9px; }
.report-work { border-bottom: 1px solid var(--line); padding-bottom: 12px; display: grid; gap: 11px; }
.report-work.on .check-line { font-weight: 700; }
.report-works { display: grid; gap: 12px; }
.report-work-body { display: grid; gap: 10px; padding-left: 34px; min-width: 0; }
.no-work { margin-top: 2px; }
.ticket-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; }
.ticket-steps li { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; color: var(--muted); }
.ticket-steps li span { color: #b4c3d8; display: flex; }
.ticket-steps li.done { color: var(--ink); }
.ticket-steps li.done span { color: var(--done); }
.ticket-steps small { color: var(--muted); font-size: 14px; }
.thread { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.thread li { background: var(--none-bg); border-radius: 14px; padding: 9px 13px; overflow-wrap: anywhere; }
.thread small { color: var(--muted); font-size: 13px; }

/* Админка */
.admin-tabs { display: flex; gap: 6px; overflow-x: auto; margin: 0 -16px; padding: 4px 16px; scrollbar-width: none; }
.admin-tabs::-webkit-scrollbar { display: none; }
.admin-tabs a { flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 6px 15px; border-radius: 999px; background: #e8e8ed; color: var(--ink); font-weight: 500; text-decoration: none; font-size: 15px; }
.admin-tabs a.on { background: var(--ink); color: #fff; }
.admin-tabs small { background: var(--late-bg); color: var(--late); border-radius: 999px; padding: 0 7px; font-size: 13px; }
.admin-tabs a.on small { background: rgba(255, 255, 255, .25); color: #fff; }
.subtabs { display: flex; gap: 8px; }
.subtabs a { flex: 1; text-align: center; padding: 9px; border-radius: 999px; background: #e8e8ed; color: var(--ink); text-decoration: none; font-weight: 500; }
.subtabs a.on { background: var(--ink); color: #fff; }
.ticket-card header, .review-head { display: grid; gap: 4px; }
.who { color: var(--muted); font-size: 15px; }
.who summary { cursor: pointer; min-height: 32px; font-weight: 600; }
.who form { margin-top: 7px; }
.overdue-card header { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 5px 12px; }
.overdue-card a { text-decoration: none; }
.days-late { color: var(--late); }
.row-links { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }
.user-row { gap: 9px; }
.user-row > div { display: grid; }
.user-row small { color: var(--muted); font-size: 14px; }
.user-row.off { opacity: .6; }
.user-row select { width: auto; min-height: 40px; padding: 5px 9px; font-size: 15px; }
.archive-form { margin-top: -4px; }

.table-wrap { min-width: 0; }
.table { width: 100%; border-collapse: collapse; display: block; }
.table thead { display: none; }
.table tbody { display: grid; gap: 10px; }
.table tr { display: grid; gap: 5px; background: var(--card); box-shadow: var(--shadow); border-radius: var(--radius); padding: 14px 16px; }
.table td { display: flex; justify-content: space-between; align-items: center; gap: 10px; overflow-wrap: anywhere; }
.table td:first-child { display: grid; gap: 2px; justify-content: stretch; }
.table td:not(:first-child)::before { content: attr(data-label); color: var(--muted); font-size: 15px; }
.table td small { color: var(--muted); font-size: 14px; display: block; }
.table a { text-decoration: none; }

/* Документ для печати */
.doc { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 18px; font-size: 15px; display: grid; gap: 10px; overflow-wrap: anywhere; min-width: 0; font-family: Georgia, "Times New Roman", serif; }
.doc h1 { font-size: 22px; text-align: center; margin: 12px 0 4px; }
.doc h2 { font-size: 16px; margin-top: 8px; }
.doc-to { text-align: right; }
.doc table { width: 100%; border-collapse: collapse; }
.doc th, .doc td { border: 1px solid #b9c0ca; padding: 5px 8px; text-align: left; vertical-align: top; font-size: 14px; }
.doc th { width: 44%; font-weight: 600; background: #f7f8fa; }
.doc ul { margin: 0; padding-left: 18px; }
.doc .sign { margin-top: 20px; }
.doc-tools { display: grid; gap: 10px; }

.tg-btn { background: #2aabee; color: #fff; }
.tg-btn:hover { background: #1f9bdc; color: #fff; }
.tg-steps { margin: 0; padding-left: 22px; display: grid; gap: 6px; }
.tg-wait { display: flex; align-items: center; gap: 7px; color: var(--muted); font-weight: 600; }
.push-bar { display: grid; gap: 10px; padding: 14px 16px; border-radius: var(--radius); background: #fff; box-shadow: var(--shadow); }
.push-bar p { font-weight: 600; }
.flash { border-radius: var(--radius-s); padding: 12px 15px; font-weight: 600; overflow-wrap: anywhere; }
.flash.ok { background: var(--done-bg); color: var(--done); }
.flash.err { background: var(--late-bg); color: var(--late); }

@media (min-width: 760px) {
  body { padding-bottom: 0; }
  .bottom-nav { display: none; }
  .top { padding: 6px max(16px, calc((100vw - 1028px) / 2)); min-height: 60px; }
  .brand { margin-right: 22px; font-size: 19px; }
  .top-nav { display: flex; gap: 4px; margin-right: auto; }
  .top-nav a { display: flex; align-items: center; padding: 8px 14px; border-radius: 999px; color: var(--muted); text-decoration: none; font-weight: 500; min-height: 40px; }
  .top-nav a:hover { color: var(--ink); }
  .top-nav a.on { color: var(--ink); font-weight: 600; }
  .wrap { padding: 28px 16px; gap: 24px; }
  .hero { padding: 34px 32px; }
  .hero.has-photo { min-height: 420px; padding: 14px; }
  .hero.has-photo h1 { font-size: 32px; }
  .hero.has-photo .hero-info { max-width: 520px; padding: 12px 18px; }
  .hero.has-photo .hero-sub { font-size: 15px; }
  .hot-panel { max-width: 520px; }
  .hero h1 { font-size: 46px; }
  .hero-sub { font-size: 18px; }
  .tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
  .tile { border-radius: var(--radius); padding: 14px 16px; min-height: 100px; align-content: center; justify-items: start; text-align: left; }
  .tile strong { font-size: 48px; }
  .tile span { display: flex; align-items: flex-start; gap: 5px; font-size: 15px; }
  .tile span .ic { display: inline-block; }
  .card { padding: 22px; }
  .columns { grid-template-columns: 1fr 1fr; align-items: start; }
  .grid-2 { grid-template-columns: 1fr 1fr; }
  .wcard-head { grid-template-columns: minmax(0, 1fr) auto; align-items: start; }
  .cta { justify-self: start; width: auto; min-width: 340px; }
  .polls-track { margin-left: 0; margin-right: 0; padding-left: 0; padding-right: 0; scroll-padding: 0; }
  .polls.many .polls-track > .poll { flex-basis: 100%; }
  .meter-row summary { grid-template-columns: minmax(0, 320px) minmax(0, 1fr) 64px 26px; grid-template-areas: "label bar val chev"; gap: 0 14px; }
  .stages.compact { grid-template-columns: 1fr 1fr; }
  .meters li { padding-top: 6px; }
  .reports-layout { grid-template-columns: minmax(0, 420px) minmax(0, 1fr); align-items: start; }
  .chips { flex-wrap: wrap; margin: -4px 0; padding: 4px 0; overflow: visible; }
  .admin-tabs { margin: 0; padding: 0; flex-wrap: wrap; }
  .table { display: table; background: var(--card-solid); box-shadow: var(--shadow); border-radius: var(--radius); border-collapse: separate; border-spacing: 0; overflow: hidden; }
  .table thead { display: table-header-group; }
  .table th { text-align: left; font-size: 13px; color: var(--muted); padding: 12px 16px; font-weight: 600; border-bottom: 1px solid var(--line); background: #fafafa; }
  .table tbody { display: table-row-group; }
  .table tr { display: table-row; padding: 0; border: 0; background: none; box-shadow: none; }
  .table td, .table td:first-child { display: table-cell; padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
  .table tr:last-child td { border-bottom: 0; }
  .table td:not(:first-child)::before { display: none; }
  .doc { padding: 40px; }
  .form .wide:not(.btn) { width: 100%; }
  .wrap > .form, .wrap > form.card { max-width: 680px; width: 100%; }
}

@media print {
  body { background: #fff; padding: 0; font-size: 13px; }
  .top, .bottom-nav, .foot, .demo-bar, .no-print, .flash { display: none !important; }
  .wrap { padding: 0; max-width: none; display: block; }
  .doc { border: 0; padding: 0; box-shadow: none; }
  .photos a { break-inside: avoid; }
}
