/* ─────────────────────────────────────────────────────────────────────────
   tm.hub — дизайн-система перенесена с sokolovk.com.
   Тёплая бумага и чернила, один акцент. Глубина от волосяных линий
   и плотности текста, никогда от теней, свечений и градиентов.
   Заголовки — Source Serif, интерфейс — Geist, цифры и метки — Geist Mono.
   ───────────────────────────────────────────────────────────────────────── */

@font-face { font-family: Geist; src: url("/static/fonts/Geist-Variable.woff2") format("woff2");
             font-weight: 100 900; font-style: normal; font-display: swap; }
@font-face { font-family: "Geist Mono"; src: url("/static/fonts/GeistMono-Variable.woff2") format("woff2");
             font-weight: 100 900; font-style: normal; font-display: swap; }
@font-face { font-family: "Source Serif 4"; src: url("/static/fonts/SourceSerif4-Variable-Roman.woff2") format("woff2");
             font-weight: 200 900; font-style: normal; font-display: swap; }





:root {
  --surface:      #f5f2ea;
  --surface-sunk: #eae5db;
  --surface-mint: #ddefea;
  --ink:          #292723;
  --ink-muted:    #67635c;
  --ink-subtle:   #656058;
  --ink-inv:      #f5f2ea;
  --line:         #ded8ca;
  --line-strong:  #c7bfae;

  --accent:       #006a63;
  --accent-hover: #005f59;
  --accent-soft:  #ddefea;
  --accent-mark:  #00afa3;
  --accent-warm:  #c69a62;

  --crit:    #9d3b32;
  --crit-bg: #f5e6e3;
  --warn:    #8a6d1f;
  --warn-bg: #f4ecda;
  --money:   #006a63;

  --serif: "Source Serif 4", ui-serif, Georgia, serif;
  --sans:  Geist, ui-sans-serif, system-ui, sans-serif;
  --mono:  "Geist Mono", ui-monospace, SFMono-Regular, monospace;

  --t-display: clamp(2.25rem, 1.2rem + 4.4vw, 4.25rem);
  --t-h1:      clamp(2rem, 1.4rem + 2.6vw, 3.1rem);
  --t-h2:      clamp(1.6rem, 1.25rem + 1.6vw, 2.2rem);
  --t-h3:      1.25rem;
  --t-lead:    clamp(1.0625rem, 0.95rem + 0.5vw, 1.25rem);
  --t-body:    1.0625rem;
  --t-small:   0.9375rem;
  --t-label:   0.75rem;
  --t-metric:  clamp(2rem, 1.4rem + 2.4vw, 3rem);

  --radius-xs: 2px;
  --radius-sm: 4px;
  --radius-md: 8px;
  --ease: cubic-bezier(.22, 1, .36, 1);
}

* { box-sizing: border-box; }

body {
  margin: 0; background: var(--surface); color: var(--ink);
  font: 400 var(--t-body)/1.65 var(--sans);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--accent-hover); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

h1, h2, h3 { font-family: var(--serif); font-weight: 600; letter-spacing: -.02em; margin: 0; }
h1 { font-size: var(--t-h1); line-height: 1.08; }
h2 { font-size: var(--t-h2); line-height: 1.14; }
h3 { font-size: var(--t-h3); line-height: 1.35; letter-spacing: -.01em; }

.label, .eyebrow, .tile-cat, .state, .proof-k-mono {
  font: 500 var(--t-label)/1.2 var(--mono);
  letter-spacing: .14em; text-transform: uppercase; color: var(--ink-muted);
}
.lede { font-size: var(--t-lead); line-height: 1.6; color: var(--ink-muted);
        max-width: 62ch; margin: 0 0 1.5rem; }
.hint { font-size: var(--t-small); color: var(--ink-subtle); }

/* ─── кнопки: прямоугольные, без пилюль ─── */
button, .btn {
  font: 500 var(--t-small)/1 var(--sans); color: var(--ink);
  background: transparent; border: 1px solid var(--line-strong);
  border-radius: var(--radius-xs); padding: 11px 18px; cursor: pointer;
  text-decoration: none; display: inline-block;
  transition: border-color .15s var(--ease), background .15s var(--ease);
}
button:hover, .btn:hover { border-color: var(--ink); color: var(--ink); }
button[disabled] { opacity: .4; cursor: not-allowed; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--ink-inv); }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover);
                     color: var(--ink-inv); }

label { display: block; font-size: var(--t-small); color: var(--ink-muted); margin-bottom: 6px; }
select, input[type=text], input[type=email] {
  font: var(--t-body) var(--sans); padding: 10px 12px; width: 100%;
  border: 1px solid var(--line-strong); border-radius: var(--radius-xs);
  background: var(--surface); color: var(--ink);
}
.fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
          gap: 18px; margin-bottom: 22px; }
.actions { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-top: 26px; }

/* ─── каркас кабинета ─── */
.shell { display: flex; min-height: 100vh; }
.side { width: 232px; flex: none; border-right: 1px solid var(--line);
        padding: 26px 0; background: var(--surface-sunk); }
.brand { font: 500 1.05rem/1 var(--mono); letter-spacing: .02em; padding: 0 24px 24px; }
.brand span { color: var(--accent-mark); }
.nav a { display: block; padding: 9px 24px; text-decoration: none;
         color: var(--ink-muted); border-left: 2px solid transparent; }
.nav a:hover { color: var(--ink); background: var(--surface); }
.nav a[aria-current] { color: var(--ink); border-left-color: var(--accent);
                       background: var(--surface); }
.nav a.nav-exit { margin-top: 14px; font-size: var(--t-small); opacity: .8; }
.side-foot { margin-top: 30px; padding: 18px 24px 0; border-top: 1px solid var(--line);
             font-size: 0.8125rem; color: var(--ink-muted); line-height: 1.55; }
.side-foot b { display: block; font-weight: 500; color: var(--ink); margin-bottom: 4px; }
.main { flex: 1; min-width: 0; padding: 30px 40px 80px; max-width: 1120px; }

/* ─── лендинг ─── */
.page { max-width: 80rem; margin: 0 auto; padding: 0 clamp(1.25rem, 5vw, 4.5rem) 96px; }
.top { display: flex; align-items: center; justify-content: space-between; padding: 26px 0; }
.top .brand { padding: 0; }
.top-nav { display: flex; gap: 12px; align-items: center; }

.section { padding: clamp(3rem, 7vw, 6rem) 0 0; }
.section-head { border-top: 1px solid var(--line-strong); padding-top: 14px;
                margin-bottom: 30px; display: flex; align-items: baseline;
                justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.section-head h2 { font-size: var(--t-h2); }

.hero { padding: clamp(2.5rem, 6vw, 4.5rem) 0 clamp(2rem, 4vw, 3.5rem); }
.hero h1 { font-size: var(--t-display); line-height: 1.06; letter-spacing: -.022em;
           max-width: 19ch; margin: 20px 0 22px; }
.hero h1 em { font-style: normal; color: var(--ink-muted); }
.hero .lede { max-width: 58ch; }
.hero-proof { border-top: 1px solid var(--line); padding-top: 16px; margin-top: 26px;
              font: 500 var(--t-label)/1.7 var(--mono); letter-spacing: .1em;
              text-transform: uppercase; color: var(--ink-subtle); }

.proof { display: grid; gap: 28px 32px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.proof > div { border-top: 1px solid var(--line-strong); padding-top: 14px; }
.proof-v { font: 500 var(--t-metric)/1 var(--sans); letter-spacing: -.02em;
           font-variant-numeric: tabular-nums; }
.proof-v.crit { color: var(--crit); }
.proof-k { margin-top: 8px; font-size: var(--t-small); color: var(--ink-muted); max-width: 26ch; }

/* шаги */
.steps-grid { display: grid; gap: 26px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.step { border-top: 1px solid var(--line-strong); padding-top: 16px; }
.step-no { font: 500 var(--t-label)/1 var(--mono); letter-spacing: .14em; color: var(--accent); }
.step h3 { margin: 12px 0 8px; font-size: 1.15rem; }
.step p { margin: 0; font-size: var(--t-small); color: var(--ink-muted); }

/* рамка со скриншотом */
.shot { border: 1px solid var(--line-strong); border-radius: var(--radius-md);
        background: var(--surface-sunk); overflow: hidden; }
.shot-bar { display: flex; align-items: center; gap: 7px; padding: 11px 14px;
            border-bottom: 1px solid var(--line); background: var(--surface); }
.shot-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--line-strong); }
.shot-url { margin-left: 10px; font: 500 var(--t-label)/1 var(--mono); color: var(--ink-subtle); }
.shot img { display: block; width: 100%; height: auto; }
.shot-empty { padding: 72px 24px; text-align: center; color: var(--ink-subtle);
              font-size: var(--t-small); }

/* плитки модулей */
.tiles { display: grid; gap: 20px; grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); }
.tile { display: flex; flex-direction: column; border: 1px solid var(--line);
        border-radius: var(--radius-sm); background: var(--surface); overflow: hidden;
        text-decoration: none; color: inherit; transition: border-color .2s var(--ease); }
.tile:hover { border-color: var(--line-strong); }
.tile.muted { background: none; }
.tile.muted .tile-art { opacity: .5; }
.tile-art { background: var(--surface-sunk); border-bottom: 1px solid var(--line);
            padding: 12px 4px; }
.tile-art svg { display: block; width: 100%; height: 104px; }
.tile-art .af  { fill: var(--surface); stroke: var(--ink); stroke-width: 1.5; }
.tile-art .af2 { fill: var(--surface-mint); stroke: var(--ink); stroke-width: 1.5; }
.tile-art .al  { fill: none; stroke: var(--accent); stroke-width: 1.5; stroke-linecap: round; }
.tile-body { padding: 20px 22px 22px; display: flex; flex-direction: column; flex: 1; }
.tile h3 { margin: 12px 0 8px; min-height: 2.4em; }
.tile p { margin: 0 0 18px; font-size: var(--t-small); color: var(--ink-muted);
          display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical;
          overflow: hidden; }
.chips { display: flex; gap: 7px; flex-wrap: wrap; margin-bottom: 18px; }
.chip { font: 500 var(--t-label)/1 var(--mono); letter-spacing: .06em; padding: 5px 9px;
        border: 1px solid var(--line); border-radius: var(--radius-xs); color: var(--ink-muted); }
.tile-foot { margin-top: auto; display: flex; align-items: baseline; justify-content: space-between;
             gap: 12px; border-top: 1px solid var(--line); padding-top: 15px; }
.tile-price { font: 500 1.05rem/1.3 var(--mono); font-variant-numeric: tabular-nums; }
.tile-price small { color: var(--ink-muted); font-size: var(--t-label); }
.state.live { color: var(--accent); }
.state.coming, .state.on_request { color: var(--ink-subtle); }

/* мятная плоскость — снятие возражения и финальный призыв */
.mint { background: var(--surface-mint); border-radius: var(--radius-md);
        padding: clamp(2rem, 4vw, 3.25rem); margin-top: clamp(3rem, 7vw, 6rem); }
.mint h2 { margin-bottom: 16px; }
.cols { display: grid; gap: 28px; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.col h4 { margin: 0 0 10px; font: 500 var(--t-label)/1 var(--mono); letter-spacing: .14em;
          text-transform: uppercase; color: var(--ink-muted); }
.col p { margin: 0; font-size: var(--t-small); color: var(--ink); line-height: 1.6; }

/* вопросы */
.qa { border-top: 1px solid var(--line); }
.qa details { border-bottom: 1px solid var(--line); padding: 18px 0; }
.qa summary { cursor: pointer; font-family: var(--serif); font-weight: 600; font-size: 1.1rem;
              list-style: none; }
.qa summary::-webkit-details-marker { display: none; }
.qa summary::after { content: "+"; float: right; color: var(--accent); font-family: var(--mono); }
.qa details[open] summary::after { content: "–"; }
.qa p { margin: 12px 0 0; font-size: var(--t-small); color: var(--ink-muted); max-width: 68ch; }

.site-foot { margin-top: clamp(3rem, 6vw, 5rem); border-top: 1px solid var(--line);
             padding-top: 22px; display: flex; justify-content: space-between;
             gap: 20px; flex-wrap: wrap; font-size: var(--t-small); color: var(--ink-muted); }

/* ─── рабочие экраны: ведомость ─── */
.totals { display: flex; flex-wrap: wrap; gap: 36px; padding: 18px 0 16px;
          border-top: 1px solid var(--ink); border-bottom: 3px double var(--ink);
          margin-bottom: 28px; }
.total-k { font: 500 var(--t-label)/1 var(--mono); letter-spacing: .12em;
           text-transform: uppercase; color: var(--ink-muted); }
.total-v { font: 500 1.7rem/1.15 var(--mono); margin-top: 8px; font-variant-numeric: tabular-nums; }
.total-v.crit { color: var(--crit); }
.total-v.money { color: var(--money); }

.ledger { border-top: 1px solid var(--line-strong); }
.row { display: grid; grid-template-columns: 48px 1fr auto; border-bottom: 1px solid var(--line); }
.row-no { font: 500 0.8125rem/1 var(--mono); color: var(--ink-subtle);
          padding: 18px 0 0 4px; border-right: 1px solid var(--line); }
.row-body { padding: 16px 20px; min-width: 0; }
.row-amt { padding: 16px 0 16px 20px; text-align: right; white-space: nowrap;
           font: 500 1.05rem/1.5 var(--mono); font-variant-numeric: tabular-nums; }
.row-amt.dim { color: var(--ink-subtle); font-size: var(--t-small); }
.row-title { font-size: var(--t-body); }
.row-detail { font-size: var(--t-small); color: var(--ink-muted); margin-top: 5px; }
.row-src { font: var(--t-label)/1.5 var(--mono); color: var(--ink-subtle); margin-top: 8px; }
.tag { display: inline-block; font: 500 var(--t-label)/1 var(--mono); letter-spacing: .08em;
       text-transform: uppercase; padding: 5px 8px; border: 1px solid currentColor;
       border-radius: var(--radius-xs); margin-bottom: 9px; }
.tag.crit { color: var(--crit); background: var(--crit-bg); }
.tag.warn { color: var(--warn); background: var(--warn-bg); }
.verdict { margin-top: 12px; display: flex; gap: 7px; flex-wrap: wrap; }
.verdict button { font-size: 0.8125rem; padding: 5px 11px; }

/* слоты загрузки */
.slot { border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
        padding: 16px 18px; margin-bottom: 12px; background: var(--surface); }
.slot.empty { border-style: dashed; background: none; }
.slot-head { display: flex; justify-content: space-between; gap: 14px; align-items: baseline; }
.slot-name { font-size: var(--t-body); }
.slot-req { font: 500 var(--t-label)/1 var(--mono); color: var(--ink-subtle); }
.slot-hint { font-size: var(--t-small); color: var(--ink-muted); margin-top: 5px; }
.file { display: flex; gap: 12px; align-items: baseline; margin-top: 12px;
        padding: 10px 12px; background: var(--surface-sunk); border-radius: var(--radius-xs); }
.file.warn { background: var(--warn-bg); color: var(--warn); }
.file-name { font: 500 var(--t-small)/1.4 var(--mono); }
.file-meta { font-size: 0.8125rem; color: var(--ink-muted); }

.steps { display: flex; flex-wrap: wrap; gap: 6px 16px; font: 500 var(--t-label)/1 var(--mono);
         color: var(--ink-subtle); margin: 0 0 24px; letter-spacing: .06em; }
.steps b { font-weight: 500; color: var(--accent); }

.note { border-left: 2px solid var(--accent); padding: 14px 18px; background: var(--accent-soft);
        font-size: var(--t-small); margin: 24px 0; border-radius: 0 var(--radius-xs) var(--radius-xs) 0; }
.empty { border: 1px dashed var(--line-strong); border-radius: var(--radius-sm);
         padding: 40px 20px; text-align: center; color: var(--ink-muted); }

.cards { border-top: 1px solid var(--line-strong); }
.card { display: grid; grid-template-columns: 1fr 150px 116px; gap: 20px; align-items: start;
        padding: 20px 0; border-bottom: 1px solid var(--line); }

.login { max-width: 420px; margin: 12vh auto; padding: 0 24px; }
.login .brand { padding-left: 0; font-size: 1.25rem; }

/* страница модуля */
.mod-head { display: grid; grid-template-columns: 1.15fr 1fr; gap: 44px; align-items: center;
            padding: clamp(2rem, 5vw, 3.5rem) 0; }
.mod-head h1 { font-size: var(--t-h1); margin: 16px 0 18px; }
.mod-io { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; }
.io-box { border-top: 1px solid var(--line-strong); padding-top: 16px; }
.io-box h4 { margin: 0 0 14px; font: 500 var(--t-label)/1 var(--mono); letter-spacing: .14em;
             text-transform: uppercase; color: var(--ink-muted); }
.io-box ul { margin: 0; padding-left: 18px; }
.io-box li { font-size: var(--t-small); margin-bottom: 8px; color: var(--ink-muted); }

@media (max-width: 860px) {
  .shell { display: block; }
  .side { width: auto; border-right: 0; border-bottom: 1px solid var(--line); padding: 18px 0 10px; }
  .nav { display: flex; gap: 4px; padding: 0 16px; flex-wrap: wrap; }
  .nav a { border-left: 0; border-bottom: 2px solid transparent; padding: 8px 12px; }
  .nav a[aria-current] { border-left: 0; border-bottom-color: var(--accent); }
  .nav a.nav-exit { margin-top: 0; }
  .side-foot { display: none; }
  .main { padding: 24px 18px 64px; }
  .tiles { grid-template-columns: 1fr; }
  .mod-head { grid-template-columns: 1fr; gap: 26px; }
  .card { grid-template-columns: 1fr; gap: 10px; }
  .row { grid-template-columns: 36px 1fr; }
  .row-amt { grid-column: 2; text-align: left; padding: 0 0 16px; }
}

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

.offer-accept { display:flex; gap:8px; align-items:flex-start; margin:0 0 10px;
                font-size:13px; line-height:1.4; color:var(--muted, #5c574e); }
.offer-accept input { margin-top:2px; flex:none; }
.btn-link { background:none; border:0; padding:0; font:inherit; font-size:13px;
            color:var(--accent, #006a63); cursor:pointer; text-decoration:underline; }

/* --- правки 23.08 --- */

/* Заголовки объявлены с margin:0 на всех уровнях (строка 70), поэтому h2
   прилипал к h1 — заметнее всего в настройках. Отступ только внутри
   основной колонки, плитки не трогаем. */
.main h2 { margin-top: 44px; }
.main h3 { margin-top: 24px; }
.main .tile h3, .main .tile-body h3 { margin-top: 0; }

/* .tile-foot — flex в строку, поэтому вторая форма уезжала вбок на чекбокс.
   Обёртка занимает всю ширину и ставит действия колонкой. */
.tile-foot .plan-actions { display: block; width: 100%; }
.plan-actions form { margin: 0; }
.plan-actions form + form { margin-top: 8px; }
.plan-actions .btn-link { display: inline-block; }
