/* НормЛаб · дизайн-система (база: normlab_site/style.css, расширенная для динамических страниц) */
:root {
  --bg: #fff;
  --surface: #fafafa;
  --surface-2: #f4f5f5;
  --line: #e2e4e3;
  --line-strong: #c6cbc9;
  --text: #1b1f1e;
  --muted: #626b68;
  --accent: #0f5b52;
  --accent-soft: #edf5f3;
  --warn: #8a5a13;
  --warn-soft: #fdf3e3;
  --error: #8f2020;
  --error-soft: #fbeeee;
  --max: 1160px;
  --lab: var(--accent);
}
html { scroll-behavior: smooth; }
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.62 -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}
a { color: var(--accent); }
[hidden] { display: none !important; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 12px; }
h1 { font-size: 34px; }
h2 { font-size: 24px; }
h3 { font-size: 17px; }
.container { max-width: var(--max); margin: 0 auto; padding: 0 24px; }
.muted { color: var(--muted); }

/* ── Шапка ─────────────────────────────────────────────── */
.site-header { border-bottom: 1px solid var(--line); background: var(--bg); }
.lab-switch { background: var(--surface-2); border-bottom: 1px solid var(--line); }
.lab-switch-inner { display: flex; align-items: center; gap: 18px; min-height: 46px; flex-wrap: wrap; padding-top: 7px; padding-bottom: 7px; }
a.lab-switch-label { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); text-decoration: none; }
a.lab-switch-label:hover { color: var(--accent); }
.lab-switch-group { display: flex; gap: 10px; flex-wrap: wrap; }
.lab-switch-group a { text-decoration: none; color: var(--text); font-size: 14px; font-weight: 600; line-height: 1.45; padding: 5px 16px; border: 1px solid var(--line-strong); border-radius: 0; background: var(--bg); }
.lab-switch-group a:hover { border-color: var(--accent); color: var(--accent); }
.lab-switch-group a[aria-current="page"] { background: var(--lab); border-color: var(--lab); color: #fff; }
.lab-stripe { height: 3px; background: var(--lab); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding-top: 16px; padding-bottom: 16px; flex-wrap: wrap; }
.brand { text-decoration: none; display: flex; flex-direction: column; }
.brand-mark { font-size: 21px; font-weight: 700; color: var(--text); letter-spacing: .01em; }
.brand-sub { font-size: 12px; color: var(--muted); }
.site-nav { display: flex; gap: 18px; flex-wrap: wrap; }
.site-nav a { text-decoration: none; color: var(--text); font-size: 14px; }
.site-nav a:hover { color: var(--accent); }
.header-actions { display: flex; align-items: center; gap: 14px; }
.header-office { position: relative; display: inline-block; text-decoration: none; font-size: 14px; color: var(--text); border: 1px solid var(--line-strong); border-radius: 0; padding: 5px 16px; line-height: 1.45; white-space: nowrap; background: var(--bg); }
.header-office:hover { border-color: var(--accent); color: var(--accent); }
.office-badge { position: absolute; top: -8px; right: -8px; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 10px; background: var(--error); border: 2px solid var(--bg); color: #fff; font-size: 11px; font-weight: 700; line-height: 15px; text-align: center; }

/* ── Hero ──────────────────────────────────────────────── */
.hero { background: linear-gradient(180deg, var(--accent-soft), var(--bg) 90%); padding: 54px 0 46px; }
.eyebrow { font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); font-weight: 600; margin-bottom: 12px; }
.lead { font-size: 17px; color: var(--muted); }

/* ── Блоки и сетки ─────────────────────────────────────── */
.block { padding: 44px 0; border-top: 1px solid var(--line); }
.block-head { margin-bottom: 22px; }
.block-head p { color: var(--muted); margin: 6px 0 0; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: start; }
@media (max-width: 900px) { .grid-2, .grid-3, .split { grid-template-columns: 1fr; } }

.tile { border: 1px solid var(--line); border-radius: 10px; padding: 20px 22px; background: var(--bg); display: flex; flex-direction: column; gap: 8px; }
.tile:hover { border-color: var(--line-strong); }
.tile-num { font-size: 12px; color: var(--muted); letter-spacing: .06em; }
.tile h3 { margin: 0; }
.tile p { margin: 0; color: var(--muted); }
.tile-link { margin-top: auto; text-decoration: none; font-size: 14px; }
.tile.accent-top { border-top: 3px solid var(--lab); }

/* кликабельная карточка направления (вся область) */
a.tile { text-decoration: none; color: var(--text); cursor: pointer; transition: border-color .15s ease, box-shadow .15s ease; }
a.tile:hover { border-color: var(--lab); box-shadow: 0 2px 14px rgba(27, 31, 30, .07); }
a.tile:hover h3 { color: var(--accent); }
a.tile .tile-link { color: var(--accent); }

/* ── Лента выполненных заданий (обезличенная) ──────────── */
.feed { border-top: 1px solid var(--line); }
.feed-row { display: flex; flex-direction: column; gap: 2px; padding: 12px 2px; border-bottom: 1px solid var(--line); }
.feed-date { font-size: 11px; color: var(--muted); letter-spacing: .02em; }
.feed-line1 { font-size: 15px; }
.feed-line2 { font-size: 13px; color: var(--muted); }
.feed-empty { padding: 16px 2px; color: var(--muted); font-size: 14px; }

/* ── Шаги сценария ─────────────────────────────────────── */
.flow-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
@media (max-width: 900px) { .flow-grid { grid-template-columns: 1fr; } }
.flow-step { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 18px 20px; }
.flow-step p { margin: 8px 0 0; color: var(--muted); }

/* ── Форма задания ─────────────────────────────────────── */
.blank { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--bg); }
.blank-head { background: var(--surface); border-bottom: 1px solid var(--line); padding: 12px 18px; font-weight: 600; }
.blank-body { padding: 18px; display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field label { font-size: 13px; color: var(--muted); }
.field input, .field select, .field textarea {
  font: inherit; padding: 9px 12px; border: 1px solid var(--line-strong);
  border-radius: 8px; background: var(--bg); color: var(--text); width: 100%;
}
.field input[type="radio"] { width: auto; padding: 0; border: 0; accent-color: var(--accent); }
.field input:focus, .field select:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 620px) { .field-row { grid-template-columns: 1fr; } }
.field-hint { font-size: 12px; color: var(--muted); }
.file-drop { border: 1.5px dashed var(--line-strong); border-radius: 8px; padding: 14px; text-align: center; color: var(--muted); font-size: 13px; cursor: pointer; background: var(--surface); }
.file-drop:hover, .file-drop.over { border-color: var(--accent); color: var(--accent); }
.file-drop.has-file { border-style: solid; border-color: var(--accent); color: var(--text); background: var(--accent-soft); }
.or-divider { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .08em; }
.or-divider::before, .or-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* ── Пошаговая форма: выбор исследования ───────────────── */
.study-list { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
.study-card { position: relative; display: flex; gap: 12px; align-items: flex-start; border: 1px solid var(--line); border-radius: 10px; padding: 13px 16px; cursor: pointer; background: var(--bg); transition: border-color .15s ease, background .15s ease; }
.study-card:hover { border-color: var(--accent); }
.study-card input[type="radio"] { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
.study-card:has(input[type="radio"]:checked) { border-color: var(--accent); background: var(--accent-soft); }
.study-body { display: flex; flex-direction: column; gap: 3px; }
.study-title { font-weight: 600; }
.study-desc { font-size: 13px; color: var(--muted); }
.study-card.dev { border-style: dashed; background: var(--surface); cursor: default; }
.study-card.dev:hover { border-color: var(--line-strong); }
.study-fields { display: flex; flex-direction: column; gap: 14px; margin-top: 14px; }
.step-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.linklike { font: inherit; font-size: 13px; background: none; border: 0; color: var(--accent); cursor: pointer; padding: 0; text-decoration: underline; }

.btn { display: inline-block; font: inherit; font-weight: 600; border: 1px solid var(--line-strong); background: var(--bg); color: var(--text); padding: 10px 20px; border-radius: 8px; cursor: pointer; text-decoration: none; text-align: center; }
.btn:hover { border-color: var(--accent); color: var(--accent); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: #0c4c45; color: #fff; }
.btn[disabled] { opacity: .55; cursor: wait; }
.btn-block { width: 100%; }
/* кнопка «Создать задание»: увеличенный отступ от полей формы */
#task-form button[type="submit"] { margin-top: 26px; }

/* ── Карточка задания / статусы ────────────────────────── */
.job-panel { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.job-head { display: flex; justify-content: space-between; gap: 10px; background: var(--surface); border-bottom: 1px solid var(--line); padding: 10px 16px; font-weight: 600; flex-wrap: wrap; }
.job-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 16px; border-bottom: 1px solid var(--line); }
.job-row:last-child { border-bottom: 0; }
.tag { font-size: 12px; padding: 3px 10px; border-radius: 12px; white-space: nowrap; }
.tag-done { background: var(--accent-soft); color: var(--accent); }
.tag-run { background: var(--warn-soft); color: var(--warn); }
.tag-wait { background: var(--surface-2); color: var(--muted); }
.tag-error { background: var(--error-soft); color: var(--error); }
.tag-lab { background: var(--lab); color: #fff; }
.tag-dev { background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); font-weight: 400; }
.tag-new { background: var(--accent); color: #fff; }

.note { background: var(--accent-soft); border: 1px solid var(--line); border-radius: 10px; padding: 12px 16px; font-size: 14px; }
.note-warn { background: var(--warn-soft); }
.note-error { background: var(--error-soft); }

.ai-note { border-left: 3px solid var(--accent); background: var(--surface); padding: 10px 14px; font-size: 14px; color: var(--muted); border-radius: 0 8px 8px 0; }

/* ── Файлы ─────────────────────────────────────────────── */
.file-list { display: flex; flex-direction: column; gap: 8px; }
.file { display: flex; justify-content: space-between; align-items: center; gap: 12px; border: 1px solid var(--line); border-radius: 8px; padding: 9px 14px; background: var(--bg); flex-wrap: wrap; }
.file-name { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 13px; }
.file-meta { font-size: 12px; color: var(--muted); }
.file-role { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.downloads { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }

/* ── Кабинет ───────────────────────────────────────────── */
.new-badge { display: inline-block; background: var(--accent); color: #fff; font-weight: 600; font-size: 14px; padding: 8px 18px; border-radius: 20px; margin-bottom: 10px; }
.cab-list { display: flex; flex-direction: column; gap: 10px; }
.cab-item { display: grid; grid-template-columns: 130px 1fr auto auto; gap: 14px; align-items: center; border: 1px solid var(--line); border-radius: 10px; padding: 12px 16px; background: var(--bg); }
@media (max-width: 760px) { .cab-item { grid-template-columns: 1fr auto; } .cab-item .cab-lab, .cab-item .cab-date { display: none; } }
.cab-num { font-family: ui-monospace, Consolas, monospace; font-weight: 600; }
.cab-lab { font-size: 13px; color: var(--muted); }
.cab-date { font-size: 13px; color: var(--muted); }
.cab-tags { display: inline-flex; gap: 6px; align-items: center; justify-content: flex-end; }
.cab-eta { font-size: 12px; color: var(--warn); white-space: nowrap; }
.job-eta { margin-top: 6px; font-size: 14px; }

/* ── Прочее ────────────────────────────────────────────── */
.banner { background: var(--warn-soft); border-bottom: 1px solid var(--line); }
.banner-inner { padding: 10px 0; font-size: 14px; color: var(--warn); }
.doc-frame { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.doc-head { background: var(--surface); border-bottom: 1px solid var(--line); padding: 10px 16px; font-weight: 600; font-size: 14px; }
.doc-body { padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.list-plain { margin: 0; padding-left: 18px; color: var(--muted); }
.list-plain li { margin: 4px 0; }
.site-footer { border-top: 1px solid var(--line); background: var(--surface-2); margin-top: 40px; }
.token-strip { height: 4px; background: var(--line); }
.token-strip-fill { height: 100%; width: 0; background: var(--accent); transition: width .4s ease; }
.token-strip-fill.warn { background: var(--warn); }
.token-strip-fill.crit { background: var(--error); }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 24px; padding: 30px 24px; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr; } }
.footer-title { font-weight: 700; margin-bottom: 6px; }
.site-footer a { color: var(--muted); text-decoration: none; font-size: 14px; }
.site-footer a:hover { color: var(--accent); }
.page-title-pad { padding: 36px 0 0; }
