:root {
  --ground: #ffffff;
  --surface: #f3f5f3;
  --surface-2: #e9ecea;
  --raised: #ffffff;
  --border: #e3e6e3;
  --control: #d3d7d3;
  --active: #e7eae7;
  --text: #1f201d;
  --muted: #5f625e;
  --accent: #1b6e66;
  --accent-ink: #ffffff;
  --accent-soft: #e2f0ee;
  --positive: #2e7d32;
  --negative: #b42318;
  --warning: #92400e;
  --pill-positive-bg: #dcfae5; --pill-positive-ink: #04250e;
  --pill-negative-bg: #fdecea; --pill-negative-ink: #7a1d14;
  --pill-warning-bg: #fff4d6; --pill-warning-ink: #7a3a0c;
  --radius-card: 22px;
  --radius-inner: 14px;
  --radius-control: 999px;
  --sidebar-width: 272px;
  --gap: 16px;
  --pad: 20px;
  --control-height: 40px;
  --fs-title: 34px;
  --fs-kpi: 32px;
  --fs-body: 15px;
  --fs-small: 13px;
  --font: "Golos Text", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Unbounded", "Golos Text", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ground: #151716;
    --surface: #1d201f;
    --surface-2: #262a28;
    --raised: #222524;
    --border: #2f3331;
    --control: #3c413e;
    --active: #2a2e2c;
    --text: #ecefed;
    --muted: #a3a8a5;
    --accent: #4fb3a8;
    --accent-ink: #0d1f1d;
    --accent-soft: #1d3532;
    --positive: #6cc072;
    --negative: #f0857a;
    --warning: #e6b45c;
    --pill-positive-bg: #18321f; --pill-positive-ink: #b9efc6;
    --pill-negative-bg: #3a1d1a; --pill-negative-ink: #ffc9c2;
    --pill-warning-bg: #3a2c12; --pill-warning-ink: #f6d89c;
  }
}

:root[data-theme="dark"] {
    --ground: #151716;
    --surface: #1d201f;
    --surface-2: #262a28;
    --raised: #222524;
    --border: #2f3331;
    --control: #3c413e;
    --active: #2a2e2c;
    --text: #ecefed;
    --muted: #a3a8a5;
    --accent: #4fb3a8;
    --accent-ink: #0d1f1d;
    --accent-soft: #1d3532;
    --positive: #6cc072;
    --negative: #f0857a;
    --warning: #e6b45c;
    --pill-positive-bg: #18321f; --pill-positive-ink: #b9efc6;
    --pill-negative-bg: #3a1d1a; --pill-negative-ink: #ffc9c2;
    --pill-warning-bg: #3a2c12; --pill-warning-ink: #f6d89c;
  }
:root[data-theme="dark"] { color-scheme: dark; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { color-scheme: dark; } }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--text);
  font: 400 var(--fs-body)/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; flex: none; }
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -0.01em; }
h1 { font-family: var(--font-display); font-weight: 700; }
p { margin: 0; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
::selection { background: var(--accent-soft); }
.num, .tabular { font-variant-numeric: tabular-nums; }

/* Brand: КАЛЬКУЛЯТОР + кнопка ON, где «O» — значок питания */
.brand { display: inline-flex; align-items: center; gap: .3em; font-family: var(--font-display); font-weight: 700; font-size: 15px; line-height: 1; letter-spacing: -.01em; text-decoration: none; white-space: nowrap; color: var(--text); }
.brand .on { display: inline-flex; align-items: center; gap: .02em; height: 1.42em; padding: 0 .36em 0 .3em; border-radius: 999px; background: var(--accent); color: var(--accent-ink); transition: filter .15s ease; }
.brand .on svg { width: 1em; height: 1em; stroke-width: 3.1; }
.brand:hover .on { filter: brightness(1.1); }

/* Shell */
.topbar { display: none; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--sidebar-width);
  display: flex; flex-direction: column; gap: 14px;
  padding: 24px 12px 16px; background: var(--ground);
  border-right: 1px solid var(--border);
  overflow-y: auto; overscroll-behavior: contain;
}
.sidebar > .brand { padding: 0 10px; font-size: 17px; }
.search { position: relative; display: block; margin: 4px 0 2px; }
.search svg { position: absolute; left: 12px; top: 11px; color: var(--muted); width: 17px; height: 17px; }
.search input {
  width: 100%; height: 38px; padding: 0 12px 0 36px;
  border: 0; border-radius: var(--radius-control); background: var(--surface);
}
.search input::placeholder { color: var(--muted); }
.nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.nav-group { display: flex; flex-direction: column; }
.nav-head {
  display: flex; align-items: center; gap: 10px; width: 100%;
  min-height: 36px; padding: 6px 10px; border: 0; border-radius: 10px;
  background: none; cursor: pointer; text-align: left; font-size: 15px;
}
.nav-head:hover { background: var(--surface); }
.nav-head .chev { width: 16px; height: 16px; color: var(--muted); transition: transform .18s ease; transform: rotate(-90deg); }
.nav-group.open .nav-head .chev { transform: none; }
.nav-group.current .nav-head { font-weight: 600; }
.nav-head .ico { width: 20px; height: 20px; }
.nav-head .count { margin-left: auto; color: var(--muted); font-size: var(--fs-small); font-variant-numeric: tabular-nums; }
.nav-list { display: none; list-style: none; margin: 0 0 6px; padding: 0; }
.nav-group.open .nav-list { display: block; }
.nav-list a {
  display: block; padding: 6px 10px 6px 56px; border-radius: 10px;
  text-decoration: none; color: var(--muted); font-size: 14px; line-height: 1.35;
}
.nav-list a:hover { color: var(--text); background: var(--surface); }
.nav-list a[aria-current="page"] { background: var(--active); color: var(--text); font-weight: 500; }
.nav-empty { padding: 8px 10px; color: var(--muted); font-size: 14px; }
.side-foot { display: flex; flex-direction: column; gap: 10px; padding: 12px 10px 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.theme-btn { align-self: flex-start; display: inline-flex; align-items: center; gap: 8px; min-height: 34px; padding: 0 12px; border: 0; border-radius: 999px; background: var(--surface); color: var(--text); font-size: 13.5px; cursor: pointer; transition: background .15s ease; }
.theme-btn:hover { background: var(--surface-2); }
.theme-btn svg { width: 16px; height: 16px; }

.main { margin-left: var(--sidebar-width); padding: 40px 48px 80px; min-height: 100vh; outline: none; }
.wrap { max-width: 1100px; margin: 0 auto; container-type: inline-size; }

/* Home */
.greet h1 { font-size: var(--fs-title); line-height: 1.15; letter-spacing: -0.02em; max-width: 24ch; }
.greet p { margin-top: 14px; color: var(--muted); font-size: 17px; max-width: 60ch; }
.home-search { position: relative; display: block; margin-top: 28px; max-width: 560px; }
.home-search svg { position: absolute; left: 18px; top: 16px; width: 20px; height: 20px; color: var(--muted); }
.home-search input {
  width: 100%; height: 52px; padding: 0 20px 0 50px; font-size: 17px;
  border: 1px solid var(--control); border-radius: var(--radius-control); background: var(--raised);
}
.home-search input:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }
.search-results { margin-top: 12px; max-width: 560px; display: flex; flex-direction: column; gap: 2px; }
.search-results a { display: flex; justify-content: space-between; gap: 12px; padding: 10px 16px; border-radius: 12px; text-decoration: none; }
.search-results a:hover, .search-results a:focus-visible { background: var(--surface); }
.search-results span { color: var(--muted); font-size: var(--fs-small); }

.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--gap); margin-top: 44px; }
.tile {
  display: flex; flex-direction: column; justify-content: space-between; gap: 10px; min-height: 128px;
  padding: 18px 20px; border-radius: var(--radius-card); background: var(--surface); text-decoration: none;
  transition: background .15s ease, transform .15s ease;
}
.tile:hover { background: var(--surface-2); }
.tile:active { transform: scale(.985); }
.tile-label { color: var(--muted); font-size: 14px; }
.tile-value { font-size: var(--fs-kpi); line-height: 1.05; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.tile-cap { font-size: var(--fs-small); color: var(--muted); }

.sections { display: grid; grid-template-columns: repeat(12, 1fr); gap: var(--gap); margin-top: var(--gap); }
.panel { background: var(--surface); border-radius: var(--radius-card); padding: var(--pad); }
.sec-panel { grid-column: span 4; display: flex; flex-direction: column; gap: 12px; }
.sec-panel header { display: flex; align-items: center; gap: 10px; }
.sec-panel header h3 { font-size: inherit; }
.sec-panel header a { text-decoration: none; font-weight: 600; font-size: 16px; }
.sec-panel header a:hover { color: var(--accent); }
.sec-panel header svg { width: 20px; height: 20px; }
.sec-panel header .count { margin-left: auto; font-size: 12px; color: var(--muted); background: var(--raised); padding: 2px 9px; border-radius: 999px; font-variant-numeric: tabular-nums; }
.sec-panel ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.sec-panel li a { display: block; padding: 5px 0; text-decoration: none; font-size: 14.5px; }
.sec-panel li a:hover { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }

.recent { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 18px; font-size: 14px; color: var(--muted); }
.recent a { padding: 6px 14px; border-radius: 999px; background: var(--surface); color: var(--text); text-decoration: none; transition: background .15s ease; }
.recent a:hover { background: var(--surface-2); }

/* Entrance */
@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
.greet, .page-head, .page-sub, .tile, .sec-panel, .calc-link, .calc-grid > .panel, .about, .related {
  animation: rise .5s cubic-bezier(.2, .7, .2, 1) both;
  animation-delay: calc(var(--i, 0) * 45ms + 60ms);
}
.page-sub { animation-delay: 90ms; }
.r-value { transition: color .2s ease; }

/* Section page */
.crumbs { display: flex; flex-wrap: wrap; gap: 6px; color: var(--muted); font-size: 14px; margin-bottom: 14px; }
.crumbs a { text-decoration: none; }
.crumbs a:hover { color: var(--text); }
.page-head { display: flex; align-items: center; gap: 14px; }
.page-head svg { width: 30px; height: 30px; }
.page-head h1 { font-size: 28px; line-height: 1.2; letter-spacing: -0.02em; }
.page-sub { margin-top: 10px; color: var(--muted); font-size: 16px; max-width: 70ch; }
.calc-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--gap); margin-top: 32px; }
.calc-link {
  display: flex; flex-direction: column; gap: 6px; padding: 18px 20px;
  border-radius: var(--radius-card); background: var(--surface); text-decoration: none;
  transition: background .15s ease;
}
.calc-link:hover { background: var(--surface-2); }
.calc-link strong { font-weight: 600; font-size: 16px; }
.calc-link span { color: var(--muted); font-size: 14px; }

/* Calculator page */
.calc-grid { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: var(--gap); margin-top: 28px; align-items: start; }
.calc-grid.wide { grid-template-columns: minmax(0, 1fr); }
.calc-grid.wide .result { position: static; }
.form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.field { display: flex; flex-direction: column; gap: 7px; grid-column: span 2; }
.field.half { grid-column: span 1; }
.field[hidden] { display: none; }
.field > label, .field > .flabel { font-size: 14px; font-weight: 500; }
.field .hint { font-size: 12.5px; color: var(--muted); }
.ctrl { position: relative; display: flex; align-items: center; }
.ctrl input, .ctrl select, .field textarea {
  width: 100%; min-height: var(--control-height); padding: 8px 14px;
  border: 1px solid var(--control); border-radius: 12px; background: var(--raised);
  font-variant-numeric: tabular-nums;
}
.ctrl select { appearance: none; padding-right: 36px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23777' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; background-size: 16px; }
.field textarea { min-height: 120px; resize: vertical; line-height: 1.5; }
.ctrl input:focus, .ctrl select:focus, .field textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.ctrl .unit { position: absolute; right: 14px; color: var(--muted); font-size: 14px; pointer-events: none; }
.ctrl.has-unit input { padding-right: 56px; }
.check { display: flex; align-items: center; gap: 10px; font-size: 14.5px; cursor: pointer; min-height: 32px; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }
.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg label { cursor: pointer; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: inline-flex; align-items: center; min-height: 36px; padding: 0 14px; border-radius: 999px; background: var(--raised); border: 1px solid var(--control); font-size: 14px; transition: background .12s ease; }
.seg input:checked + span { background: var(--text); color: var(--ground); border-color: var(--text); }
.seg input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 42px; padding: 0 22px; border: 0; border-radius: var(--radius-control);
  background: var(--accent); color: var(--accent-ink); font-weight: 500; cursor: pointer;
  transition: transform .12s ease, filter .12s ease;
}
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: scale(.97); }
.btn.ghost { background: var(--raised); color: var(--text); border: 1px solid var(--control); }
.btn.small { min-height: 32px; padding: 0 14px; font-size: 13.5px; }
.form-actions { grid-column: span 2; display: flex; gap: 10px; flex-wrap: wrap; }

.result { position: sticky; top: 24px; display: flex; flex-direction: column; gap: 14px; background: var(--raised); border: 1px solid var(--border); }
.result-empty { color: var(--muted); }
.r-main { display: flex; flex-direction: column; gap: 4px; }
.r-label { color: var(--muted); font-size: 14px; }
.r-value { font-size: var(--fs-kpi); line-height: 1.15; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; word-break: break-word; }
.r-value.text { font-size: 22px; letter-spacing: -0.01em; }
.r-value.mono { font-family: var(--font-mono); font-size: 20px; letter-spacing: 0; }
.r-rows { display: flex; flex-direction: column; }
.r-row { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 9px 0; border-top: 1px solid var(--border); font-size: 14.5px; }
.r-row dt { color: var(--muted); }
.r-row dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; font-weight: 500; }
.r-note { font-size: 13px; color: var(--muted); line-height: 1.5; }
.r-error { color: var(--negative); font-size: 14.5px; }
.r-copy { align-self: flex-start; }
.pill { display: inline-flex; align-items: center; padding: 2px 10px; border-radius: 999px; font-size: 13px; font-weight: 500; }
.pill.pos { background: var(--pill-positive-bg); color: var(--pill-positive-ink); }
.pill.neg { background: var(--pill-negative-bg); color: var(--pill-negative-ink); }
.pill.warn { background: var(--pill-warning-bg); color: var(--pill-warning-ink); }
.bigtext { font-size: 18px; line-height: 1.55; word-break: break-word; white-space: pre-wrap; }

.meter { height: 10px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--accent); border-radius: inherit; }

.table-wrap { max-height: 420px; overflow: auto; border-radius: var(--radius-inner); border: 1px solid var(--border); }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; font-variant-numeric: tabular-nums; }
th, td { padding: 8px 12px; text-align: right; white-space: nowrap; }
th:first-child, td:first-child { text-align: left; }
th { position: sticky; top: 0; background: var(--raised); font-weight: 500; color: var(--muted); border-bottom: 1px solid var(--border); }
td { border-bottom: 1px solid var(--surface); }

.about { margin-top: 28px; max-width: 72ch; color: var(--text); font-size: 15px; }
.about h2 { font-size: 18px; margin-bottom: 8px; }
.about p + p { margin-top: 8px; }
.sources ul { margin: 0 0 10px; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; }
.sources a { color: var(--accent); text-underline-offset: 3px; }
.sources a:hover { text-decoration-thickness: 2px; }
.related { margin-top: 32px; }
.related h2 { font-size: 18px; margin-bottom: 12px; }
.related ul { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.related a { display: inline-block; padding: 7px 14px; border-radius: 999px; background: var(--surface); text-decoration: none; font-size: 14px; }
.related a:hover { background: var(--surface-2); }

/* Production calendar */
.cal-year { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px 24px; }
.cal-month h3 { font-size: 15px; margin-bottom: 8px; display: flex; justify-content: space-between; }
.cal-month h3 span { font-weight: 400; color: var(--muted); font-size: 13px; }
.cal-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; font-size: 13px; text-align: center; font-variant-numeric: tabular-nums; }
.cal-days b { font-weight: 500; color: var(--muted); font-size: 11.5px; padding-bottom: 2px; }
.cal-days i { font-style: normal; padding: 5px 0; border-radius: 8px; }
.cal-days i.off { background: var(--pill-negative-bg); color: var(--pill-negative-ink); }
.cal-days i.short { background: var(--pill-warning-bg); color: var(--pill-warning-ink); }
.cal-days i.today { outline: 2px solid var(--accent); outline-offset: -2px; }
.legend { display: flex; flex-wrap: wrap; gap: 16px; font-size: 13px; color: var(--muted); margin-bottom: 18px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 14px; height: 14px; border-radius: 4px; display: inline-block; }

/* Games */
.game { display: flex; flex-direction: column; gap: 16px; align-items: flex-start; }
.ttt { display: grid; grid-template-columns: repeat(3, 88px); grid-template-rows: repeat(3, 88px); gap: 8px; }
.ttt button { border: 0; border-radius: 16px; background: var(--raised); font-size: 40px; font-weight: 500; cursor: pointer; transition: background .12s ease, transform .12s ease; }
.ttt button:hover:not(:disabled) { background: var(--surface-2); }
.ttt button:active:not(:disabled) { transform: scale(.95); }
.ttt button:disabled { cursor: default; }
.ttt button.win { background: var(--accent-soft); color: var(--accent); }
.reaction { width: 100%; min-height: 220px; border: 0; border-radius: var(--radius-card); font-size: 22px; font-weight: 500; cursor: pointer; background: var(--surface-2); color: var(--text); padding: 20px; }
.reaction.wait { background: var(--pill-negative-bg); color: var(--pill-negative-ink); }
.reaction.go { background: var(--accent); color: var(--accent-ink); }
.math-q { font-size: 44px; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.inline-form { display: flex; gap: 10px; flex-wrap: wrap; width: 100%; }
.inline-form .ctrl { flex: 1; min-width: 140px; }

.noscript { padding: 40px; }

@media (max-width: 1180px) {
  .sec-panel { grid-column: span 6; }
  .tiles { grid-template-columns: repeat(2, 1fr); }
  .cal-year { grid-template-columns: repeat(2, 1fr); }
}
@container (max-width: 820px) {
  .calc-grid { grid-template-columns: minmax(0, 1fr); }
  .result { position: static; }
  .calc-list { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .topbar {
    display: flex; align-items: center; gap: 8px; position: sticky; top: 0; z-index: 20;
    height: 56px; padding: 0 12px; background: var(--ground); border-bottom: 1px solid var(--border);
  }
  .menu-btn { width: 40px; height: 40px; border: 0; background: none; border-radius: 10px; display: grid; place-items: center; cursor: pointer; }
  .menu-btn svg { width: 22px; height: 22px; }
  .sidebar { z-index: 40; width: min(320px, 88vw); transform: translateX(-102%); transition: transform .22s ease; }
  .sidebar.open { transform: none; }
  .scrim { position: fixed; inset: 0; z-index: 30; background: rgba(10, 12, 11, .38); }
  .main { margin-left: 0; padding: 24px 16px 64px; }
  .greet h1 { font-size: 24px; }
  .page-head h1 { font-size: 21px; }
  .page-head svg { width: 24px; height: 24px; }
  .sec-panel { grid-column: span 12; }
  .calc-list { grid-template-columns: 1fr; }
  .tiles { margin-top: 28px; gap: 10px; }
  .tile { min-height: 112px; padding: 14px 16px; }
  .tile-value { font-size: 26px; }
  .cal-year { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .form { grid-template-columns: minmax(0, 1fr); }
  .field.half { grid-column: span 2; }
  .ttt { grid-template-columns: repeat(3, 76px); grid-template-rows: repeat(3, 76px); }
  .r-value { font-size: 28px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0s !important; animation: none !important; }
}

/* Список логинов */
.logins { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; }
.logins li { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 6px 6px 14px; border-radius: 12px; background: var(--raised); }
.logins code { font-family: var(--font-mono); font-size: 15px; overflow-wrap: anywhere; }
.logins .btn { flex: none; }

/* Главная: заголовок, быстрые ссылки, блоки */
.greet h1 { font-size: clamp(30px, 4.2vw, 46px); max-width: 20ch; }
.greet .hl { color: var(--accent); }
.quick { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; max-width: 640px; }
.quick a { padding: 7px 14px; border-radius: 999px; border: 1px solid var(--control); text-decoration: none; font-size: 14px; transition: border-color .15s ease, color .15s ease; }
.quick a:hover { border-color: var(--accent); color: var(--accent); }
.home-h { font-size: 20px; line-height: 1.25; letter-spacing: -0.01em; margin: 56px 0 16px; display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.home-h span { font-family: var(--font); font-size: 14px; font-weight: 400; color: var(--muted); }
.tiles { margin-top: 0; }
.home-block .sections { margin-top: 0; }
.popular { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--gap); }
.pop-card { display: flex; flex-direction: column; gap: 8px; padding: 20px; border-radius: var(--radius-card); background: var(--surface); text-decoration: none; transition: background .15s ease, transform .15s ease; animation: rise .5s cubic-bezier(.2, .7, .2, 1) both; animation-delay: calc(var(--i, 0) * 45ms + 60ms); }
.pop-card:hover { background: var(--accent-soft); }
.pop-card:active { transform: scale(.985); }
.pop-card svg { width: 26px; height: 26px; color: var(--accent); margin-bottom: 6px; }
.pop-card strong { font-size: 16px; font-weight: 600; line-height: 1.3; }
.pop-card span { font-size: 14px; color: var(--muted); line-height: 1.45; }
.trust-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--gap); }
.trust-list li { display: flex; flex-direction: column; gap: 8px; padding: 20px 0 0; border-top: 2px solid var(--accent); }
.trust-list strong { font-size: 16px; font-weight: 600; }
.trust-list span { font-size: 15px; color: var(--muted); line-height: 1.5; }
.cta { display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; margin-top: 56px; padding: 36px 40px; border-radius: var(--radius-card); background: var(--accent); color: var(--accent-ink); }
.cta h2 { font-size: 24px; line-height: 1.2; }
.cta p { margin-top: 8px; max-width: 52ch; opacity: .88; font-size: 16px; }
.cta-btn { background: var(--accent-ink); color: var(--accent); height: 48px; padding: 0 22px; font-size: 16px; }
.cta-btn:hover { filter: brightness(.96); background: var(--accent-ink); }
.cta-btn svg, .foot-brand .btn svg, .side-foot svg { width: 18px; height: 18px; }

/* Подвал */
.site-foot { margin-left: var(--sidebar-width); padding: 40px 48px 48px; border-top: 1px solid var(--border); background: var(--ground); }
.foot-grid { display: grid; grid-template-columns: minmax(240px, 1fr) 2fr; gap: 24px 48px; }
.foot-brand { display: flex; flex-direction: column; align-items: flex-start; gap: 14px; }
.foot-brand .brand { font-size: 17px; }
.foot-brand p { color: var(--muted); font-size: 14px; line-height: 1.5; max-width: 36ch; }
.foot-nav ul { list-style: none; margin: 0; padding: 0; columns: 3 160px; column-gap: 24px; }
.foot-nav li { break-inside: avoid; }
.foot-nav a { display: inline-block; padding: 4px 0; font-size: 14px; color: var(--muted); text-decoration: none; }
.foot-nav a:hover { color: var(--text); }
.foot-note { grid-column: 1 / -1; padding-top: 20px; border-top: 1px solid var(--border); color: var(--muted); font-size: 13px; line-height: 1.5; }

/* Ссылка «Сообщите нам» под калькулятором */
.calc-fb { margin-top: 24px; color: var(--muted); font-size: 14px; }
.link-btn { border: 0; padding: 0; background: none; color: var(--accent); font: inherit; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }

/* Окно предложений */
dialog.fb { width: min(520px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); padding: 0; border: 0; border-radius: var(--radius-card); background: var(--ground); color: var(--text); box-shadow: 0 24px 64px rgba(0, 0, 0, .25); }
dialog.fb::backdrop { background: rgba(10, 12, 11, .45); }
.fb-form, .fb-done { display: flex; flex-direction: column; gap: 16px; padding: 24px; }
.fb-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.fb-head h2 { font-size: 20px; }
.fb-x { width: 36px; height: 36px; border: 0; border-radius: 50%; background: var(--surface); color: var(--text); font-size: 22px; line-height: 1; cursor: pointer; }
.fb-x:hover { background: var(--surface-2); }
.fb-sub, .fb-done p { color: var(--muted); font-size: 15px; line-height: 1.5; }
.fb-sub b { color: var(--text); font-weight: 500; }
.fb-types { display: flex; flex-wrap: wrap; gap: 8px; border: 0; margin: 0; padding: 0; }
.fb-types label { cursor: pointer; }
.fb-types input { position: absolute; opacity: 0; pointer-events: none; }
.fb-types span { display: inline-block; padding: 7px 14px; border-radius: 999px; background: var(--surface); font-size: 14px; transition: background .15s ease; }
.fb-types input:checked + span { background: var(--accent); color: var(--accent-ink); }
.fb-types input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.fb-field { display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.fb-field i { color: var(--muted); font-style: normal; }
.fb-field textarea, .fb-field input { width: 100%; padding: 10px 14px; border: 1px solid var(--control); border-radius: var(--radius-inner); background: var(--raised); color: var(--text); font: inherit; font-size: 15px; resize: vertical; }
.fb-field textarea:focus, .fb-field input:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }
.fb-error { color: var(--negative); font-size: 14px; }
.fb-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.fb-done .btn { align-self: flex-start; }

@media (max-width: 1180px) {
  .popular, .trust-list { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 860px) {
  .site-foot { margin-left: 0; padding: 32px 16px 40px; }
  .foot-grid { grid-template-columns: 1fr; }
  .home-h { margin-top: 40px; }
  .cta { padding: 28px 22px; margin-top: 40px; }
  .cta h2 { font-size: 21px; }
}
@media (max-width: 520px) {
  .popular, .trust-list { grid-template-columns: 1fr; }
  .pop-card { padding: 16px 18px; }
}

/* Обычный калькулятор */
.basic { display: grid; grid-template-columns: minmax(0, 400px) minmax(0, 1fr); gap: 32px; align-items: start; }
.basic-calc { display: flex; flex-direction: column; gap: 12px; }
.basic-screen { display: flex; flex-direction: column; align-items: flex-end; justify-content: flex-end; gap: 4px; min-height: 116px; padding: 16px 20px; border-radius: var(--radius-inner); background: var(--raised); overflow: hidden; }
.basic-expr { max-width: 100%; overflow-x: auto; white-space: nowrap; scrollbar-width: none; font-size: 36px; line-height: 1.2; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.basic-expr::-webkit-scrollbar { display: none; }
.basic-expr.done { font-weight: 600; }
.basic-res { min-height: 22px; color: var(--muted); font-size: 18px; font-variant-numeric: tabular-nums; }
.basic-res.err { color: var(--negative); font-size: 15px; }
.basic-keys { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.bk { height: 60px; border: 0; border-radius: 16px; background: var(--raised); color: var(--text); font: inherit; font-size: 22px; font-variant-numeric: tabular-nums; cursor: pointer; transition: background .12s ease, transform .08s ease; touch-action: manipulation; user-select: none; }
.bk:hover { background: var(--surface-2); }
.bk:active, .bk.hit { transform: scale(.95); }
.bk.fn { background: var(--surface-2); font-size: 18px; color: var(--muted); }
.bk.fn:hover { background: var(--control); color: var(--text); }
.bk.op { background: var(--accent-soft); color: var(--accent); font-size: 26px; }
.bk.op:hover { filter: brightness(.97); }
.bk.eq { background: var(--accent); color: var(--accent-ink); font-size: 26px; }
.bk.eq:hover { filter: brightness(1.08); }
.basic-side { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.basic-side-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 32px; }
.basic-side-head h2 { font-size: 16px; }
.basic-hist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; max-height: 380px; overflow-y: auto; }
.basic-hist button { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; width: 100%; padding: 8px 12px; border: 0; border-radius: 12px; background: none; color: var(--text); font: inherit; text-align: right; cursor: pointer; font-variant-numeric: tabular-nums; }
.basic-hist button:hover { background: var(--raised); }
.basic-hist span { color: var(--muted); font-size: 14px; overflow-wrap: anywhere; }
.basic-hist b { font-size: 18px; font-weight: 600; }
.basic-empty { color: var(--muted); font-size: 14px; padding: 8px 0; }
@container (max-width: 700px) {
  .basic { grid-template-columns: minmax(0, 1fr); }
  .basic-calc { max-width: 440px; width: 100%; margin: 0 auto; }
}
@media (max-width: 480px) {
  .bk { height: 56px; }
  .basic-expr { font-size: 30px; }
}
.basic-side-head .btn[hidden] { display: none; }
