/* reten-pilot — внутренний раннбук. Дизайн-токены дома (demo/styles.css). */

:root {
  --canvas: #fffaf0;
  --surface-soft: #faf5e8;
  --surface-card: #f5f0e0;
  --surface-strong: #ebe6d6;
  --surface-dark: #0a1a1a;
  --surface-dark-elevated: #1a2a2a;

  --ink: #0a0a0a;
  --body: #3a3a3a;
  --body-strong: #1a1a1a;
  --muted: #6a6a6a;
  --muted-soft: #9a9a9a;
  --hairline: #e5e5e5;
  --hairline-soft: #f0f0f0;
  --on-dark: #ffffff;
  --on-dark-soft: #a0a0a0;

  --pink: #ff4d8b;
  --teal: #1a3a3a;
  --lavender: #b8a4ed;
  --peach: #ffb084;
  --ochre: #e8b94a;
  --mint: #a4d4c5;
  --coral: #ff6b5a;

  --success: #22c55e;
  --warning: #f59e0b;
  --error: #ef4444;

  --r-xs: 6px;
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 24px;

  --content: 1240px;

  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--canvas);
  color: var(--body);
  font-family: var(--font);
  font-size: 15.5px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { background: var(--pink); color: #fff; }

h1, h2, h3 { color: var(--body-strong); margin: 0; }
h1 { font-size: clamp(26px, 3.4vw, 40px); font-weight: 500; letter-spacing: -0.045em; line-height: 1.08; color: var(--ink); }
h2 { font-size: 21px; font-weight: 600; letter-spacing: -0.02em; }
h3 { font-size: 16.5px; font-weight: 600; letter-spacing: -0.01em; }
p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }
a { color: inherit; }
code, .mono { font-family: var(--mono); font-size: 0.92em; }

.wrap { width: 100%; max-width: var(--content); margin: 0 auto; padding: 0 24px; }

/* ── topbar ── */
.topbar {
  position: sticky; top: 0; z-index: 40;
  background: rgba(255, 250, 240, 0.86);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--hairline);
}
.topbar-in {
  max-width: var(--content); margin: 0 auto; padding: 11px 24px;
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
}
.brand {
  font-weight: 600; font-size: 14px; letter-spacing: -0.02em; color: var(--ink);
  display: flex; align-items: center; gap: 9px; text-decoration: none;
}
.brand-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--pink); flex: none; }
.brand-sub { color: var(--muted-soft); font-weight: 400; }
.internal-badge {
  font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase;
  color: #7a4a00; background: #ffe9c7; border: 1px solid #f0cf94;
  border-radius: 999px; padding: 3px 10px; white-space: nowrap;
}
.top-links { margin-left: auto; display: flex; gap: 4px; flex-wrap: wrap; }
.top-links a {
  font-size: 12.5px; color: var(--muted); text-decoration: none;
  padding: 6px 8px; border-radius: var(--r-sm); white-space: nowrap;
}
.top-links a:hover { color: var(--ink); background: var(--surface-card); }

/* ── hero ── */
.hero { padding: 40px 0 8px; }
.hero .lede { font-size: clamp(15px, 1.3vw, 17px); color: var(--body-strong); max-width: 78ch; margin-top: 14px; }
.hero .lede .muted { color: var(--muted); }

.progress-line { display: flex; align-items: center; gap: 14px; margin-top: 20px; flex-wrap: wrap; }
.progress-track { flex: 1 1 220px; height: 8px; border-radius: 999px; background: var(--surface-strong); overflow: hidden; }
.progress-fill { height: 100%; border-radius: 999px; background: var(--pink); width: 0; transition: width 0.35s ease; }
.progress-label { font-family: var(--mono); font-size: 12.5px; color: var(--muted); white-space: nowrap; }

/* ── sections ── */
section { padding: 30px 0; }
.section-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.section-head .hint { font-size: 13px; color: var(--muted); }
.section-head .spacer { flex: 1; }

/* ── checklist ── */
.phase { background: var(--surface-soft); border: 1px solid var(--hairline); border-radius: var(--r-lg); padding: 18px 20px; margin-bottom: 14px; }
.phase-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 6px; }
.phase-head h3 { flex: 1; }
.phase-count { font-family: var(--mono); font-size: 12px; color: var(--muted); }

.check-item {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 10px 8px; border-radius: var(--r-md);
  border-bottom: 1px solid var(--hairline-soft);
}
.check-item:last-child { border-bottom: none; }

.status-pill {
  flex: none; margin-top: 2px; width: 108px; text-align: center;
  font: inherit; font-size: 11px; font-weight: 600; letter-spacing: 0.04em;
  border-radius: 999px; padding: 4px 8px; border: 1px solid transparent;
  user-select: none; cursor: pointer;
}
.status-pill:hover { filter: brightness(0.96); box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.06); }
.status-todo { background: #fff; color: var(--muted); border-color: var(--hairline); }
.status-wip { background: #fff3d6; color: #8a5a00; border-color: #eed9a4; }
.status-done { background: #dcf5e4; color: #14672f; border-color: #b5e6c5; }
.status-blocked { background: #ffe2e0; color: #8f2018; border-color: #f5c2be; }

.check-body { flex: 1; min-width: 0; }
.check-title { font-size: 14.5px; color: var(--body-strong); font-weight: 500; }
.check-item.is-done .check-title { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--muted-soft); }
.check-detail { font-size: 13px; color: var(--muted); margin-top: 2px; }
.check-detail code { background: var(--surface-card); padding: 1px 5px; border-radius: 4px; }
.tag-net {
  display: inline-block; font-family: var(--mono); font-size: 10.5px; font-weight: 600;
  border-radius: 5px; padding: 1px 6px; margin-left: 6px; vertical-align: 1px;
}
.tag-kadam { background: #e8e0fa; color: #4a3a8a; }
.tag-exo { background: #ffe4d1; color: #8a4a1a; }
.tag-gtm { background: #d9efe6; color: #1a5a40; }
.tag-check { background: #fff3d6; color: #8a5a00; }

.owner-note { font-size: 13px; color: var(--muted); margin: -6px 0 14px; max-width: 80ch; }

/* ── toolbar ── */
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; }
.btn {
  font: inherit; font-size: 12.5px; font-weight: 600; color: var(--body-strong);
  background: #fff; border: 1px solid var(--hairline); border-radius: 999px;
  padding: 6px 14px; cursor: pointer;
}
.btn:hover { border-color: var(--muted-soft); }
.btn-primary { background: var(--pink); border-color: var(--pink); color: #fff; }
.btn-primary:hover { filter: brightness(1.06); }
.btn-danger:hover { border-color: var(--error); color: var(--error); }

/* ── network cards ── */
.net-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 16px; }
.net-card { background: var(--surface-soft); border: 1px solid var(--hairline); border-radius: var(--r-lg); padding: 20px 22px; }
.net-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 4px; }
.net-head h3 { font-size: 19px; }
.type-badge {
  font-size: 11px; font-weight: 700; letter-spacing: 0.05em;
  border-radius: 6px; padding: 3px 8px;
}
.type-1 { background: var(--teal); color: #fff; }
.type-2 { background: var(--peach); color: #5a2a00; }
.net-sub { font-size: 13px; color: var(--muted); margin-bottom: 12px; }
.net-card dl { margin: 0; display: grid; grid-template-columns: 128px 1fr; gap: 7px 12px; }
.net-card dt { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; padding-top: 2px; }
.net-card dd { margin: 0; font-size: 13.5px; color: var(--body-strong); }
.net-card dd code { background: #fff; border: 1px solid var(--hairline-soft); padding: 1px 5px; border-radius: 4px; word-break: break-all; }
.net-card dd .unverified { color: #8a5a00; }
.net-foot { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--hairline-soft); font-size: 12.5px; color: var(--muted); }
.net-foot a { color: var(--muted); }
.net-foot a:hover { color: var(--ink); }

/* ── risks / criteria ── */
.risk-list, .crit-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.risk-list li, .crit-list li {
  background: var(--surface-soft); border: 1px solid var(--hairline);
  border-radius: var(--r-md); padding: 11px 14px; font-size: 13.5px;
}
.risk-list li strong, .crit-list li strong { color: var(--body-strong); }
.risk-net { font-family: var(--mono); font-size: 11px; font-weight: 600; color: var(--muted); margin-right: 6px; }
.crit-list li::before { content: "✓"; color: var(--success); font-weight: 700; margin-right: 8px; }

.undoc { border-left: 3px solid var(--warning); }
.undoc-label { display: inline-block; font-size: 11px; font-weight: 700; color: #8a5a00; background: #fff3d6; border-radius: 5px; padding: 1px 7px; margin-right: 6px; }

/* ── artifacts ── */
.artifact-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 12px; }
.artifact {
  display: block; background: var(--surface-soft); border: 1px solid var(--hairline);
  border-radius: var(--r-md); padding: 14px 16px; text-decoration: none;
}
.artifact:hover { border-color: var(--muted-soft); }
.artifact .a-name { font-weight: 600; font-size: 14px; color: var(--body-strong); font-family: var(--mono); }
.artifact .a-desc { font-size: 12.5px; color: var(--muted); margin-top: 3px; }

/* ── test console ── */
.console { background: var(--surface-dark); border-radius: var(--r-lg); padding: 20px 22px; color: var(--on-dark); }
.console h3 { color: var(--on-dark); }
.console .hint { color: var(--on-dark-soft); font-size: 12.5px; }
.console-form { display: flex; gap: 10px; flex-wrap: wrap; margin: 14px 0 12px; align-items: flex-end; }
.console-form label { display: flex; flex-direction: column; gap: 4px; font-size: 11.5px; color: var(--on-dark-soft); }
.console-form input, .console-form select {
  font: inherit; font-family: var(--mono); font-size: 12.5px;
  background: var(--surface-dark-elevated); color: var(--on-dark);
  border: 1px solid #2a3a3a; border-radius: var(--r-sm); padding: 7px 9px; min-width: 110px;
}
.console-form input:focus, .console-form select:focus { outline: 1px solid var(--pink); }
.console-form .grow { flex: 1 1 200px; }
.console-form .grow input { width: 100%; }
.check-inline { flex-direction: row !important; align-items: center; gap: 6px !important; padding-bottom: 8px; }
.console-out {
  font-family: var(--mono); font-size: 12px; line-height: 1.5;
  background: var(--surface-dark-elevated); border-radius: var(--r-md);
  padding: 14px 16px; margin: 0; min-height: 60px; max-height: 380px; overflow: auto;
  white-space: pre-wrap; word-break: break-word; color: #c8e6d8;
}

/* ── footer ── */
.footer { border-top: 1px solid var(--hairline); margin-top: 30px; padding: 22px 0 40px; font-size: 12.5px; color: var(--muted); }
.footer a { color: var(--muted); }

@media (max-width: 640px) {
  .net-card dl { grid-template-columns: 1fr; gap: 2px; }
  .net-card dt { padding-top: 8px; }
  .status-pill { width: 92px; }
}
