/* ============================================================
   MagicBot — client cabinet
   Same visual language as the studio landing template (styles.css):
   white sheet, glass cards, brand green #56A64B as the single
   dominant accent, coral and peach dosed as warm highlights.
   No tile backgrounds, no yellow-green gradients.
   ============================================================ */
:root {
  --ink: #161c2c;
  --muted: #667064;
  --gray: #8a94a5;
  --line: rgba(22, 28, 44, 0.09);
  --brand-green: #56a64b;
  --brand-green-dark: #3f8d3b;
  --green-ink: #438f3d;
  --green-soft: rgba(86, 166, 75, 0.12);
  --coral: #f26f5b;
  --coral-dark: #d95743;
  --coral-soft: rgba(242, 111, 91, 0.12);
  --peach: #ffb36b;
  --peach-ink: #c66c2f;
  --peach-soft: rgba(255, 179, 107, 0.18);
  --blush: #fff1ec;
  --shadow: 0 18px 54px rgba(74, 93, 125, 0.07), inset 0 1px 0 rgba(255, 255, 255, 0.92);
  --shadow-h: 0 28px 72px rgba(74, 93, 125, 0.12), inset 0 1px 0 white;
  --radius-lg: 26px;
  --radius-md: 18px;
  --radius-sm: 13px;
  --container: 1180px;
}

* , *::before, *::after { box-sizing: border-box; }

body {
  min-width: 320px;
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 11% 8%, rgba(242, 111, 91, 0.055), transparent 24rem),
    radial-gradient(circle at 91% 18%, rgba(255, 179, 107, 0.06), transparent 28rem),
    #ffffff;
  color: var(--ink);
  font-family: Inter, Manrope, "Segoe UI", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

button, input, textarea, select { font: inherit; }
a { color: inherit; text-decoration: none; }
img, svg { display: block; }

.wrap { width: min(calc(100% - 40px), var(--container)); margin-inline: auto; }
.spacer { flex: 1; }

/* ============================================================ type */
h1 {
  margin: 0 0 18px;
  font-size: clamp(38px, 4.6vw, 52px);
  font-weight: 600;
  letter-spacing: -0.045em;
  line-height: 1.02;
}
h1 span { color: var(--brand-green); }
h2 {
  margin: 0;
  font-size: clamp(24px, 3vw, 30px);
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1.12;
}
h2 .dim { color: var(--gray); font-weight: 600; }
h3 { margin: 0 0 4px; font-size: 17px; font-weight: 600; letter-spacing: -0.02em; }
p { margin: 0; }
.lead { max-width: 62ch; margin: 0 0 34px; color: var(--muted); font-size: 17px; line-height: 1.65; }
.muted { color: var(--muted); font-size: 14.5px; }
.tiny { color: var(--gray); font-size: 13px; }
.eyebrow {
  display: flex; align-items: center; gap: 9px;
  margin: 0 0 14px;
  color: var(--brand-green-dark);
  font-size: 12px; font-weight: 600; letter-spacing: 0.15em; text-transform: uppercase;
}

/* ============================================================ topbar */
.topbar {
  position: sticky; top: 0; z-index: 100;
  border-bottom: 1px solid rgba(255, 255, 255, 0.76);
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}
.topbar .wrap { display: flex; min-height: 78px; align-items: center; gap: 18px; }
.logo { width: 232px; height: 50px; object-fit: contain; object-position: left center; }
.who { color: var(--muted); font-size: 14px; font-weight: 600; }

/* ============================================================ tabs */
.tabs {
  position: sticky; top: 78px; z-index: 99;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}
.tabs .wrap { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; padding-block: 10px; }
.tabs .wrap::-webkit-scrollbar { display: none; }
.tab {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 16px;
  border: 0; border-radius: 999px;
  background: none; cursor: pointer; white-space: nowrap;
  color: #475467; font-size: 14px; font-weight: 600;
  transition: background 180ms ease, color 180ms ease;
}
.tab:hover { color: var(--ink); background: rgba(22, 28, 44, 0.05); }
.tab[aria-current="page"] { background: var(--ink); color: white; }
.tab .n {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 20px; height: 20px; padding: 0 6px;
  border-radius: 999px;
  background: var(--coral-soft); color: var(--coral-dark);
  font-size: 12px; font-weight: 600;
}
.tab[aria-current="page"] .n { background: rgba(255, 255, 255, 0.22); color: white; }

/* ============================================================ cards */
.card {
  padding: 26px;
  border: 1px solid rgba(44, 72, 107, 0.07);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.68);
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  transition: transform 240ms ease, box-shadow 240ms ease;
}
.card.lift:hover { transform: translateY(-4px); box-shadow: var(--shadow-h); }
.card.flat { background: rgba(255, 253, 248, 0.72); }
.grid { display: grid; gap: 16px; }
.grid.g4 { grid-template-columns: repeat(auto-fit, minmax(215px, 1fr)); }
.grid.g2 { grid-template-columns: repeat(auto-fit, minmax(330px, 1fr)); }
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.split { display: flex; gap: 22px; align-items: center; flex-wrap: wrap; }
.split > :first-child { flex: 1 1 290px; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; margin-left: auto; }
.section { margin: 60px 0 20px; }
.bar-line { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }

/* ============================================================ tiles
   Soft tinted panels; neighbouring tiles never repeat a hue. */
.tile {
  padding: 26px;
  border: 1px solid rgba(44, 72, 107, 0.06);
  border-radius: var(--radius-lg);
  transition: transform 240ms ease, box-shadow 240ms ease;
}
.tile:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.tile.green { background: linear-gradient(150deg, rgba(86, 166, 75, 0.13), rgba(86, 166, 75, 0.04)); }
.tile.blush { background: linear-gradient(150deg, #fff1ec, rgba(255, 241, 236, 0.35)); }
.tile.peach { background: linear-gradient(150deg, rgba(255, 179, 107, 0.22), rgba(255, 179, 107, 0.06)); }
.tile.coral { background: linear-gradient(150deg, rgba(242, 111, 91, 0.14), rgba(242, 111, 91, 0.04)); }
.tile .k { font-size: 42px; font-weight: 600; letter-spacing: -0.045em; line-height: 1; }
.tile.green .k { color: var(--brand-green-dark); }
.tile.blush .k { color: var(--ink); }
.tile.peach .k { color: var(--peach-ink); }
.tile.coral .k { color: var(--coral-dark); }
.tile .label { margin-top: 8px; color: var(--ink); font-size: 14.5px; font-weight: 600; }
.tile .foot { margin-top: 16px; color: var(--muted); font-size: 13px; }

/* ============================================================ badges */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px;
  border-radius: 9px;
  font-size: 12px; font-weight: 600; letter-spacing: 0.01em; white-space: nowrap;
}
.badge.green { background: var(--green-soft); color: var(--green-ink); }
.badge.peach { background: rgba(255, 179, 107, 0.28); color: #8f5312; }
.badge.red   { background: var(--coral-dark); color: white; }
.badge.dark  { background: var(--ink); color: white; }
h3 .badge { margin-left: 10px; vertical-align: middle; }

/* ============================================================ buttons */
.btn {
  display: inline-flex; min-height: 44px; align-items: center; justify-content: center; gap: 8px;
  padding: 0 20px;
  border: 0; border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 10px 30px rgba(83, 104, 139, 0.07), inset 0 0 0 1px rgba(26, 50, 82, 0.1);
  color: #25314a;
  cursor: pointer; white-space: nowrap;
  font-size: 14px; font-weight: 600;
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
}
.btn:hover { transform: translateY(-2px); background: white; box-shadow: 0 16px 36px rgba(83, 104, 139, 0.12), inset 0 0 0 1px rgba(26, 50, 82, 0.1); }
.btn:active { transform: translateY(0); }
.btn.primary {
  background: var(--brand-green);
  box-shadow: 0 16px 34px rgba(63, 141, 59, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.28);
  color: white;
}
.btn.primary:hover { background: var(--brand-green-dark); box-shadow: 0 18px 38px rgba(63, 141, 59, 0.28); }
.btn.tint { background: var(--green-soft); box-shadow: none; color: var(--green-ink); }
.btn.tint:hover { background: rgba(86, 166, 75, 0.2); box-shadow: none; }
.btn.peach { background: var(--peach-soft); box-shadow: none; color: var(--peach-ink); }
.btn.peach:hover { background: rgba(255, 179, 107, 0.3); box-shadow: none; }
.btn.danger { background: var(--coral-soft); box-shadow: none; color: var(--coral-dark); }
.btn.danger:hover { background: rgba(242, 111, 91, 0.2); box-shadow: none; }
.btn.plain { background: none; box-shadow: none; color: var(--muted); }
.btn.plain:hover { background: rgba(22, 28, 44, 0.05); box-shadow: none; color: var(--ink); }
.btn.sm { min-height: 38px; padding-inline: 15px; font-size: 13px; border-radius: 11px; }
.btn:disabled { opacity: 0.38; cursor: default; transform: none; }
.w100 { width: 100%; }
.btn:focus-visible, .tab:focus-visible, .seg button:focus-visible,
input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 3px solid rgba(86, 166, 75, 0.25);
  outline-offset: 2px;
}

/* ============================================================ segmented */
.seg { display: inline-flex; gap: 2px; padding: 3px; border-radius: 999px; background: rgba(22, 28, 44, 0.05); }
.seg button {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 15px;
  border: 0; border-radius: 999px;
  background: none; cursor: pointer; white-space: nowrap;
  color: var(--muted); font-size: 13.5px; font-weight: 600;
  transition: background 180ms ease, color 180ms ease;
}
.seg button:hover { color: var(--ink); }
.seg button[aria-pressed="true"] { background: white; color: var(--ink); font-weight: 600; box-shadow: 0 6px 18px rgba(74, 93, 125, 0.12); }
.seg.sm button { padding: 5px 12px; font-size: 12.5px; }
.seg .n {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 19px; height: 19px; padding: 0 5px;
  border-radius: 999px;
  background: rgba(22, 28, 44, 0.07); color: var(--muted);
  font-size: 11.5px; font-weight: 600;
}

/* ============================================================ funnel
   Magnitude = one hue: a green ramp, light to brand. */
.funnel { display: grid; gap: 8px; }
.step {
  display: grid; grid-template-columns: minmax(150px, 215px) 1fr auto auto; gap: 18px;
  align-items: center;
  width: 100%; margin: 0 -10px; padding: 8px 10px;
  border: 0; border-radius: 14px;
  background: none; cursor: pointer; text-align: left; font: inherit; color: inherit;
  transition: background 150ms ease;
}
.step:hover { background: rgba(22, 28, 44, 0.04); }
.step .go { color: var(--gray); font-size: 17px; line-height: 1; }
.step:hover .go { color: var(--ink); }
.step .name { font-size: 14.5px; font-weight: 600; }
.step .bar { height: 38px; border-radius: 11px; background: rgba(22, 28, 44, 0.05); overflow: hidden; }
.step .bar i { display: block; height: 100%; border-radius: 11px; }
.step .bar i.s1 { background: #d9edd4; }
.step .bar i.s2 { background: #b7dfae; }
.step .bar i.s3 { background: #8fcb82; }
.step .bar i.s4 { background: var(--brand-green); }
.step .n { min-width: 96px; text-align: right; font-size: 17px; font-weight: 600; font-variant-numeric: tabular-nums; }
.step .n small { color: var(--gray); font-size: 13px; font-weight: 500; }
.funnel.pct .n .cnt { display: none; }
.funnel.pct .n small { color: var(--ink); font-size: 17px; font-weight: 600; }
@media (max-width: 640px) {
  .step { grid-template-columns: 1fr auto auto; }
  .step .bar { grid-column: 1 / -1; height: 28px; }
}

.outcomes { display: flex; flex-wrap: wrap; gap: 10px 24px; margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); }
.outcomes .o { display: inline-flex; align-items: center; gap: 9px; color: var(--muted); font-size: 13.5px; font-weight: 600; }
.outcomes .o b { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.outcomes .o::before { content: ""; width: 10px; height: 10px; border-radius: 3px; flex: none; }
.outcomes .o.self::before  { background: var(--brand-green); }
.outcomes .o.lead::before  { background: var(--peach); }
.outcomes .o.human::before { background: var(--coral); }
.outcomes .o.none::before  { background: #c7cfda; }

/* ============================================================ bar chart
   One series, one hue. The peak day is inked and carries the only
   permanent label; every bar names itself on hover. */
.chart { display: grid; grid-auto-flow: column; gap: 6px; align-items: end; height: 180px; padding-top: 26px; }
.chart .b { position: relative; display: flex; flex-direction: column; justify-content: end; height: 100%; }
.chart .b i {
  display: block; height: var(--v); min-height: 4px;
  border-radius: 7px 7px 3px 3px;
  background: linear-gradient(180deg, var(--brand-green), var(--brand-green-dark));
  transition: filter 150ms ease;
}
.chart .b:hover i { filter: brightness(1.1); }
.chart .b .v {
  position: absolute; top: -24px; left: 50%; transform: translateX(-50%);
  color: var(--ink); font-size: 12.5px; font-weight: 600; font-variant-numeric: tabular-nums;
  opacity: 0; white-space: nowrap;
  transition: opacity 150ms ease;
}
.chart .b:hover .v, .chart .b.peak .v { opacity: 1; }
.chart .b.peak i { background: linear-gradient(180deg, #232c44, var(--ink)); }
.chart-x { display: grid; grid-auto-flow: column; gap: 6px; margin-top: 10px; }
.chart-x span { color: var(--gray); font-size: 12px; text-align: center; }

/* ============================================================ status + tags */
.st { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-size: 13.5px; font-weight: 600; white-space: nowrap; }
.st::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--gray); flex: none; }
.st.ok::before   { background: var(--brand-green); box-shadow: 0 0 0 4px rgba(86, 166, 75, 0.12); }
.st.warn::before { background: var(--peach); box-shadow: 0 0 0 4px rgba(255, 179, 107, 0.16); }
.st.bad::before  { background: var(--coral); box-shadow: 0 0 0 4px rgba(242, 111, 91, 0.12); }
.st.info::before { background: #97a2b4; box-shadow: 0 0 0 4px rgba(151, 162, 180, 0.14); }
.tag {
  display: inline-flex; align-items: center; white-space: nowrap;
  padding: 4px 11px;
  border-radius: 9px;
  background: rgba(22, 28, 44, 0.05);
  color: var(--muted); font-size: 12.5px; font-weight: 600;
}
.tag.green { background: var(--green-soft); color: var(--green-ink); }
.tag.peach { background: rgba(255, 179, 107, 0.26); color: #8f5312; }
.tag.info  { background: var(--blush); color: var(--coral-dark); }

/* ============================================================ tables */
.table {
  overflow: hidden;
  border: 1px solid rgba(44, 72, 107, 0.07);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.8);
  box-shadow: var(--shadow);
}
.table .scroll { overflow-x: auto; }
table { width: 100%; min-width: 620px; border-collapse: collapse; font-size: 14.5px; }
thead th {
  padding: 14px 22px;
  border-bottom: 1px solid var(--line);
  color: var(--gray); text-align: left; white-space: nowrap;
  font-size: 11px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase;
}
tbody td { padding: 16px 22px; border-top: 1px solid var(--line); vertical-align: middle; color: var(--muted); }
tbody tr:first-child td { border-top: 0; }
tbody tr:hover { background: rgba(255, 241, 236, 0.4); }
td b { color: var(--ink); font-weight: 600; }
td.clip { max-width: 340px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
td .num { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.table .toolbar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.table .foot { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; padding: 18px 22px; border-top: 1px solid var(--line); }

/* ============================================================ forms */
label { display: block; margin: 0 0 8px; color: #4b5668; font-size: 12.5px; font-weight: 600; }
input[type="text"], input[type="password"], input[type="url"], input[type="search"], input[type="email"], textarea, select {
  width: 100%; padding: 12px 14px;
  border: 1px solid rgba(45, 74, 108, 0.12); border-radius: var(--radius-sm);
  outline: 0;
  background: rgba(255, 255, 255, 0.85);
  color: var(--ink); font-size: 15px;
  transition: border 160ms ease, box-shadow 160ms ease;
}
input::placeholder, textarea::placeholder { color: #a2abba; }
input:focus, textarea:focus, select:focus {
  border-color: rgba(86, 166, 75, 0.48);
  box-shadow: 0 0 0 4px rgba(86, 166, 75, 0.09);
}
textarea { min-height: 100px; resize: vertical; line-height: 1.5; }
.field { margin-bottom: 20px; }
.field:last-child { margin-bottom: 0; }
.field .hint { margin-top: 8px; }
.inline { display: flex; gap: 10px; align-items: center; }
.inline input { flex: 1; }
input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--brand-green); }

.switch { display: flex; align-items: flex-start; gap: 14px; cursor: pointer; padding: 14px 0; }
.switch + .switch { border-top: 1px solid var(--line); }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch .track {
  position: relative; flex: none;
  width: 46px; height: 27px; margin-top: 1px;
  border-radius: 999px;
  background: #dce1eb;
  transition: background 220ms ease;
}
.switch .track::after {
  content: ""; position: absolute; top: 2px; left: 2px;
  width: 23px; height: 23px; border-radius: 50%;
  background: white; box-shadow: 0 2px 6px rgba(22, 28, 44, 0.28);
  transition: transform 220ms ease;
}
.switch input:checked + .track { background: var(--brand-green); }
.switch input:checked + .track::after { transform: translateX(19px); }
.switch .txt b { display: block; font-size: 15px; font-weight: 600; }

.drop {
  padding: 38px 26px;
  border: 1.5px dashed rgba(45, 74, 108, 0.22);
  border-radius: var(--radius-lg);
  text-align: center; cursor: pointer;
  transition: border-color 180ms ease, background 180ms ease;
}
.drop:hover { border-color: var(--brand-green); background: rgba(86, 166, 75, 0.05); }
.drop .big { margin-bottom: 6px; font-size: 16px; font-weight: 600; }

/* ============================================================ notes */
.note {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 16px 20px;
  border-radius: var(--radius-md);
  background: rgba(22, 28, 44, 0.04);
  color: var(--muted); font-size: 14.5px;
}
.note b { color: var(--ink); font-weight: 600; }
.note.ok   { background: var(--green-soft); }
.note.info { background: var(--blush); }
.note.warn { background: rgba(255, 179, 107, 0.2); }
.note.bad  { background: var(--coral-soft); }

/* ============================================================ dialog
   Client speaks in brand green (like the landing demo), the bot
   answers on a white card beside the panda avatar. */
.dialog { display: flex; flex-direction: column; gap: 12px; }
.bubble { max-width: min(620px, 90%); padding: 12px 16px; font-size: 14.5px; line-height: 1.5; }
.bubble.ask {
  align-self: flex-start;
  border-radius: 17px 17px 17px 5px;
  background: var(--brand-green); color: white;
}
.answer { display: flex; gap: 12px; align-items: flex-start; }
/* the icon carries no background of its own, so the panda's white face
   is a hole in the artwork — the avatar has to supply the white */
.avatar {
  flex: none; overflow: hidden;
  width: 38px; height: 38px; padding: 4px; border-radius: 13px;
  background: #fff;
  box-shadow: inset 0 0 0 1px rgba(22, 28, 44, 0.06);
}
.avatar img { width: 100%; height: 100%; object-fit: contain; }
.bubble.reply {
  border-radius: 5px 17px 17px 17px;
  border: 1px solid rgba(47, 82, 116, 0.07);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 8px 24px rgba(88, 105, 139, 0.07);
  color: var(--ink);
}
.dialog .when { align-self: center; margin: 2px 0; color: var(--gray); font-size: 12px; }
.dialog + .row { margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--line); }

/* ============================================================ screens */
.screen { display: none; padding: 48px 0 110px; }
.screen.on { display: block; animation: in 340ms cubic-bezier(0.2, 0.7, 0.2, 1) both; }
@keyframes in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ============================================================ login */
.login {
  position: fixed; inset: 0; z-index: 200;
  display: grid; place-items: center;
  padding: 24px; overflow: auto;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
}
.login[hidden] { display: none; }
.login .box {
  position: relative; overflow: hidden;
  width: min(430px, 100%); padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.9);
  text-align: center;
  box-shadow: 0 35px 90px rgba(88, 77, 82, 0.14), inset 0 1px 0 white;
}
.login .box::before {
  content: ""; display: block; height: 10px;
  background: linear-gradient(90deg, var(--brand-green), var(--peach) 55%, var(--coral));
}
.login .inner { padding: 34px 34px 36px; }
.login .box .logo { width: 232px; height: 50px; margin: 0 auto 8px; }
.login form { margin-top: 26px; text-align: left; }
.login .or { display: flex; align-items: center; gap: 12px; margin: 16px 0; color: var(--gray); font-size: 12.5px; }
.login .or::before, .login .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* ============================================================ responsive */
@media (max-width: 760px) {
  .wrap { width: min(calc(100% - 28px), var(--container)); }
  .topbar .wrap { min-height: 68px; }
  .tabs { top: 68px; }
  .logo { width: 196px; height: 42px; }
  .hide-sm { display: none; }
  .card, .tile { padding: 20px; }
  .section { margin-top: 46px; }
  .screen { padding-top: 36px; }
  .chart { height: 130px; }
  .chart-x span:nth-child(odd) { visibility: hidden; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* запуск бота: главное действие карточки подключения, отделено от полей */
.launch {
  margin-top: 22px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.launch .tiny {
  margin-top: 10px;
  text-align: center;
}

/* ============================================================ two-level nav
   Sections down the left, subsections across the top of the panel (SPEC-NAV).
   On narrow screens the rail folds into the familiar horizontal strip. */
.layout { display: flex; align-items: stretch; min-height: calc(100vh - 78px); }
.rail {
  display: flex; flex-direction: column; gap: 4px; flex: none;
  width: 218px; padding: 24px 14px;
  border-right: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.55);
  position: sticky; top: 78px; align-self: flex-start;
  max-height: calc(100vh - 78px); overflow-y: auto;
}
.ritem {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px; border-radius: 12px;
  color: #475467; font-size: 14px; font-weight: 600; white-space: nowrap;
  transition: background 180ms ease, color 180ms ease;
}
.ritem:hover { background: rgba(22, 28, 44, 0.05); color: var(--ink); }
.ritem[aria-current="page"] { background: var(--ink); color: white; }
.ritem .n {
  display: inline-flex; align-items: center; justify-content: center; margin-left: auto;
  min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px;
  background: var(--coral-soft); color: var(--coral-dark);
  font-size: 12px; font-weight: 600;
}
.ritem[aria-current="page"] .n { background: rgba(255, 255, 255, 0.22); color: white; }
.panel { flex: 1; min-width: 0; max-width: 1080px; padding: 34px 40px 90px; }
.panel h1 { font-size: clamp(28px, 3vw, 38px); }
.panel .sub1 { margin: 0 0 24px; color: var(--muted); font-size: 14.5px; }
.subtabs {
  display: flex; gap: 4px; flex-wrap: wrap;
  margin: 0 0 24px; padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

/* Маршрут: полоса шагов вместо вкладок на странице сборки. Ширины не задаются в
   процентах — шагов бывает шесть до запуска и четыре после, полоса делит место сама. */
.route {
  display: flex; gap: 0; overflow-x: auto; scrollbar-width: none;
  margin: 0 0 26px; padding-bottom: 22px;
  border-bottom: 1px solid var(--line);
}
.route::-webkit-scrollbar { display: none; }
.rstep {
  position: relative; display: flex; flex: 1 1 0; min-width: 132px;
  align-items: center; gap: 9px; padding-right: 14px;
  color: inherit;
}
.rstep::after {
  content: ""; position: absolute; top: 15px; right: 6px; left: calc(100% - 8px);
  height: 2px; background: var(--line);
}
.rstep:last-child::after { display: none; }
.rstep .no {
  display: grid; flex: 0 0 30px; place-items: center; width: 30px; height: 30px;
  border-radius: 50%; background: var(--line); color: var(--gray);
  font-size: 13px; font-weight: 600;
}
.rstep.done .no { background: var(--green-soft); color: var(--green-ink); }
.rstep.now .no {
  background: var(--brand-green); color: #fff;
  box-shadow: 0 0 0 5px var(--green-soft);
}
.rstep .t { color: var(--gray); font-size: 13.5px; font-weight: 600; line-height: 1.25; }
.rstep.done .t { color: var(--muted); }
.rstep.now .t { color: var(--ink); font-weight: 600; }

/* Подвал маршрута: одна главная кнопка и выход в обычный кабинет. */
.routefoot {
  display: flex; flex-wrap: wrap; align-items: center; gap: 16px;
  margin-top: 30px; padding-top: 18px;
  border-top: 1px solid var(--line);
}
.routefoot .exit {
  color: var(--gray); font-size: 13.5px; font-weight: 600;
  text-decoration: underline; text-underline-offset: 3px;
}
.routefoot .exit:hover { color: var(--ink); }

@media (max-width: 900px) {
  .layout { display: block; min-height: 0; }
  .rail {
    flex-direction: row; width: auto; max-height: none; overflow-x: auto; overflow-y: hidden;
    padding: 10px 14px; gap: 2px;
    border-right: 0; border-bottom: 1px solid var(--line);
    position: sticky; top: 78px; z-index: 99;
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    scrollbar-width: none;
  }
  .rail::-webkit-scrollbar { display: none; }
  .ritem { padding: 8px 13px; }
  .panel { padding: 26px 16px 70px; }
}
@media (max-width: 760px) {
  .rail { top: 68px; }
}

/* ============================================================ checklist (Главная) */
.check { display: flex; flex-direction: column; gap: 10px; max-width: 760px; }
.chk {
  display: flex; gap: 16px; align-items: center; flex-wrap: wrap;
  padding: 16px 20px;
  border: 1px solid var(--line); border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.62);
}
.chk .no {
  display: grid; place-items: center; flex: none;
  width: 36px; height: 36px; border-radius: 50%;
  background: rgba(22, 28, 44, 0.06); color: var(--muted);
  font-size: 15px; font-weight: 600;
}
.chk .t { flex: 1 1 230px; }
.chk .t b { display: block; font-size: 15.5px; font-weight: 600; }
.chk .t .sub { color: var(--muted); font-size: 13.5px; }
.chk.done .no { background: var(--green-soft); color: var(--green-ink); }
.chk.now { border-color: rgba(86, 166, 75, 0.5); background: white; box-shadow: var(--shadow); }
.chk.now .no { background: var(--brand-green); color: white; }
.chk.todo { opacity: 0.5; }

/* ============================================================ blocks of topics */
details.group + details.group, .check + details.group { margin-top: 12px; }
details.group > summary {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 20px; cursor: pointer; list-style: none;
  border: 1px solid var(--line); border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.75);
}
details.group > summary::-webkit-details-marker { display: none; }
details.group > summary .chev { color: var(--gray); font-size: 15px; transition: transform 180ms ease; }
details.group[open] > summary .chev { transform: rotate(90deg); }
details.group > summary .gt { font-size: 16.5px; font-weight: 600; letter-spacing: -0.02em; }
details.group > summary .gc { margin-left: auto; color: var(--muted); font-size: 13px; white-space: nowrap; }
details.group[open] > summary { background: white; box-shadow: var(--shadow); }
details.group > .items { padding: 10px 0 2px 16px; }
@media (max-width: 640px) { details.group > .items { padding-left: 0; } }

/* ============================================================ topic rows */
details.trow {
  border: 1px solid var(--line); border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.62);
}
details.trow + details.trow { margin-top: 8px; }
details.trow summary {
  display: flex; gap: 14px; align-items: center;
  padding: 13px 18px; cursor: pointer; list-style: none;
}
details.trow summary::-webkit-details-marker { display: none; }
details.trow .chev { color: var(--gray); font-size: 15px; transition: transform 180ms ease; flex: none; }
details.trow[open] > summary .chev { transform: rotate(90deg); }
details.trow[open] > summary { border-bottom: 1px solid var(--line); }
details.trow .q { font-weight: 600; }
details.trow .a {
  flex: 1; min-width: 60px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: var(--muted); font-size: 14px;
}
details.trow .body { padding: 18px; }
details.trow[open] { background: white; box-shadow: var(--shadow); }
@media (max-width: 640px) {
  details.trow summary { flex-wrap: wrap; gap: 8px 14px; }
  details.trow .a { flex-basis: 100%; order: 3; }
}

/* ============================================================ figures stand apart
   A number is a different object from prose: it gets a chip — label, big value,
   a cross to reject. A promo is the same chip in peach with its expiry date. */
.figrow { display: flex; gap: 10px; flex-wrap: wrap; margin: 16px 0 6px; }
.figchip {
  position: relative; min-width: 150px;
  padding: 12px 34px 12px 16px; border-radius: 15px;
  background: var(--green-soft);
}
.figchip .fl {
  display: block; color: var(--green-ink); opacity: 0.8;
  font-size: 10.5px; font-weight: 600; letter-spacing: 0.09em; text-transform: uppercase;
}
.figchip .fv {
  display: block; color: var(--green-ink);
  font-size: 21px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.2;
  font-variant-numeric: tabular-nums;
}
.figchip .fp { display: block; margin-top: 3px; color: var(--peach-ink); font-size: 12px; font-weight: 600; }
.figchip .fx {
  position: absolute; top: 9px; right: 11px;
  border: 0; background: none; padding: 0; cursor: pointer;
  color: var(--green-ink); opacity: 0.45; font-size: 14px; font-weight: 600;
}
.figchip .fx:hover { opacity: 1; }
.figchip.promo { background: var(--peach-soft); }
.figchip.promo .fl, .figchip.promo .fv, .figchip.promo .fx { color: var(--peach-ink); }
.tag.num {
  background: var(--green-soft); color: var(--green-ink);
  font-weight: 600; font-variant-numeric: tabular-nums;
}

/* a pressed button that will take a while: spinner instead of silence */
.btn.busy { pointer-events: none; opacity: 0.85; }
.btn.busy::after {
  content: ""; width: 17px; height: 17px; flex: none;
  border: 3px solid currentColor; border-top-color: transparent; border-radius: 50%;
  animation: spin 700ms linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
/* Совсем без вращения индикатор перестаёт быть индикатором, поэтому не отключаем,
   а замедляем: движение остаётся, мельтешение уходит. */
@media (prefers-reduced-motion: reduce) {
  .btn.busy::after { animation-duration: 2.4s; }
}

/* Работа идёт: та же крутилка, что на кнопке, но в плашке. Без неё «Собираю базу»
   выглядит как обычное предупреждение, и непонятно, работает что-то или зависло. */
.note.work { background: var(--peach-soft); align-items: center; }
.note.work::before {
  content: ""; width: 20px; height: 20px; flex: none;
  border: 3px solid var(--peach-ink); border-top-color: transparent; border-radius: 50%;
  animation: spin 700ms linear infinite;
}
@media (prefers-reduced-motion: reduce) {
  .note.work::before { animation-duration: 2.4s; }
}

/* «Готово» должно быть видно значком, а не только словами: галочка у зелёной
   плашки и у каждого принятого материала. */
.note.ok::before {
  content: "✓";
  display: grid; place-items: center;
  width: 22px; height: 22px; flex: none;
  border-radius: 50%;
  background: var(--brand-green); color: white;
  font-size: 12px; font-weight: 600;
}
.done-mark {
  display: grid; place-items: center;
  width: 21px; height: 21px; flex: none;
  border-radius: 50%;
  background: var(--green-soft); color: var(--green-ink);
  font-size: 12px; font-weight: 600;
}

/* segmented switchers built of links: same look as the button variant above */
.seg a {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 15px; border-radius: 999px; white-space: nowrap;
  color: var(--muted); font-size: 13.5px; font-weight: 600;
  transition: background 180ms ease, color 180ms ease;
}
.seg a:hover { color: var(--ink); }
.seg a[aria-pressed="true"] { background: white; color: var(--ink); font-weight: 600; box-shadow: 0 6px 18px rgba(74, 93, 125, 0.12); }
.seg.sm a { padding: 5px 12px; font-size: 12.5px; }

/* ============================================================ pairs
   Пары «что — сколько» на карточке клиента в админке. Таблица здесь была бы честнее по
   разметке, но у неё min-width 620px, и три подряд превращают карточку в горизонтальную
   прокрутку из ничего. */
.pairs { display: grid; grid-template-columns: minmax(140px, auto) 1fr; gap: 12px 22px; margin: 0; }
.pairs dt { color: var(--muted); font-size: 14.5px; }
.pairs dd { margin: 0; font-weight: 600; }
.pairs dd .muted { font-weight: 400; }
