/* Kalkulatory pracy: деловая тема (засечки, тёмно-синий и красный, острые углы, ведомость). Слой поверх shared/engine/style.css */
@font-face {
  font-family: "Source Serif 4";
  src: url("/assets/serif-latin-ext.woff2") format("woff2");
  font-weight: 200 900; font-style: normal; font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Source Serif 4";
  src: url("/assets/serif-latin.woff2") format("woff2");
  font-weight: 200 900; font-style: normal; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
:root {
  --bg: #f3f5f9;
  --fg: #14213d;
  --muted: #55607a;
  --card: #ffffff;
  --line: #d5dbe8;
  --fill: #eaeef6;
  --accent: #c8102e;
  --accent-soft: #ffffff;
  --accent-fg: #ffffff;
  --navy: #14213d;
  --shadow: 0 1px 0 rgba(20, 33, 61, 0.06);
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0c1322;
    --fg: #e9edf7;
    --muted: #9aa5bf;
    --card: #131c30;
    --line: #26324d;
    --fill: #182238;
    --accent: #ff7a8a;
    --accent-soft: #131c30;
    --accent-fg: #0c1322;
    --navy: #1b2a4a;
    --shadow: none;
  }
}
body { font-size: 16px; line-height: 1.7; background: var(--bg); }
.wrap { max-width: 860px; }

/* шапка: тёмно-синяя полоса, название с засечками */
header.site { background: var(--navy); border: 0; border-bottom: 3px solid var(--accent); padding: 16px 0; }
header.site .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
header.site > .wrap > a:first-child { color: #f3f5f9; font-family: var(--serif); font-size: 1.3rem; font-weight: 700; letter-spacing: -0.01em; }
header.site > .wrap > a:first-child { align-items: center; gap: 11px; }
header.site > .wrap > a:first-child::before {
  content: ""; width: 28px; height: 28px; border-radius: 4px; box-shadow: 0 0 0 1px rgba(243, 245, 249, 0.3);
  background: url("/assets/icon.svg") center / contain no-repeat;
}
header.site nav { display: flex; gap: 22px; flex-wrap: wrap; }
header.site nav a { color: rgba(243, 245, 249, 0.78); font-size: 0.88rem; font-weight: 500; text-decoration: none; border-bottom: 2px solid transparent; padding: 2px 0; }
header.site nav a::before { content: none; }
header.site nav a:hover { color: #f3f5f9; border-bottom-color: var(--accent); }

h1 { font-family: var(--serif); font-size: clamp(2rem, 4.8vw, 2.9rem); line-height: 1.12; font-weight: 700; letter-spacing: -0.025em; margin: 48px 0 12px; }
.lead { font-size: 1.08rem; color: var(--muted); max-width: 60ch; margin-bottom: 32px; padding-left: 16px; border-left: 3px solid var(--accent); }
h2 { font-family: var(--serif); font-size: 1.45rem; font-weight: 700; letter-spacing: -0.02em; margin: 52px 0 14px; padding-bottom: 8px; border-bottom: 2px solid var(--fg); }

/* листы бумаги: острые углы, толстый верх */
.card { background: var(--card); border: 1px solid var(--line); border-top: 4px solid var(--navy); border-radius: 3px; padding: 24px; box-shadow: var(--shadow); }
.calc { gap: 24px; }
@media (min-width: 800px) { .calc { grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); } }
label { font-size: 0.8rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.row { gap: 4px; margin-bottom: 18px; }

/* поля с нижней линией, как в бланке */
input, select {
  min-height: 46px; background: transparent; color: var(--fg); font-size: 1.05rem; font-weight: 500; font-variant-numeric: tabular-nums;
  border: 0; border-bottom: 2px solid var(--line); border-radius: 0; padding: 8px 2px;
}
select { background-color: transparent; padding-right: 28px; background-position: calc(100% - 10px) 50%, calc(100% - 5px) 50%; }
input:hover, select:hover { border-color: var(--muted); }
input:focus-visible, select:focus-visible { outline: none; border-bottom-color: var(--accent); box-shadow: 0 2px 0 0 var(--accent); background: var(--fill); }

/* результат: ведомость, цифры моноширинные */
#calc-result { background: var(--card); border-top-color: var(--accent); }
#calc-result p { padding: 11px 0; border-bottom: 1px solid var(--line); }
#calc-result p:nth-child(even) { background: color-mix(in srgb, var(--fill) 55%, transparent); margin: 0 -24px; padding-left: 24px; padding-right: 24px; }
/* последняя строка: общий стиль обнуляет её нижний отступ; полоса зебры доходит до края карточки */
#calc-result p:last-child { border-bottom: 0; padding-bottom: 11px; }
#calc-result p:last-child:nth-child(even) { margin-bottom: -24px; padding-bottom: 35px; }
#calc-result .out-name { font-size: 0.9rem; }
#calc-result strong { color: var(--fg); font-weight: 650; font-size: 1.02rem; font-variant-numeric: tabular-nums; font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; letter-spacing: -0.02em; }
#calc-result p:first-child { display: block; padding: 0 0 16px; background: none; margin: 0; }
#calc-result p:first-child .out-name { display: block; font-size: 0.78rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 4px; }
#calc-result p:first-child strong {
  display: block; text-align: left; white-space: normal; overflow-wrap: anywhere; color: var(--accent);
  font-family: var(--serif); font-size: clamp(1.9rem, 4.4vw, 2.6rem); font-weight: 700; line-height: 1.1; letter-spacing: -0.03em;
}

.formula { background: var(--fill); border: 0; border-left: 4px solid var(--navy); border-radius: 0; padding: 14px 18px; font-size: 0.9rem; }

details { background: none; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; padding: 0; margin: 0; }
details:first-of-type { border-top: 1px solid var(--line); }
summary { padding: 16px 0; font-family: var(--serif); font-size: 1.08rem; font-weight: 650; }
summary::after { color: var(--accent); font-family: sans-serif; font-weight: 400; }
details p { color: var(--muted); }

/* список: ведомость со строками */
ul.tools { display: block; counter-reset: tool; border-top: 2px solid var(--fg); }
ul.tools li { counter-increment: tool; border-bottom: 1px solid var(--line); }
ul.tools a {
  position: relative; display: grid; grid-template-columns: 2.2rem 1fr; column-gap: 8px; row-gap: 2px; align-items: baseline;
  padding: 16px 8px 16px 0; background: none; border: 0; border-radius: 0; box-shadow: none; transform: none; color: var(--fg);
  transition: background 0.12s, padding 0.12s;
}
ul.tools a::before { content: counter(tool); grid-row: 1 / span 2; font-family: var(--serif); font-size: 1.4rem; font-weight: 700; color: var(--accent); }
ul.tools a strong { grid-column: 2; font-family: var(--serif); font-size: 1.18rem; font-weight: 650; letter-spacing: -0.01em; padding-right: 28px; }
ul.tools a span { grid-column: 2; color: var(--muted); font-size: 0.92rem; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
ul.tools a::after { content: "→"; position: absolute; right: 8px; top: 50%; margin-top: -0.7em; color: var(--muted); transition: transform 0.12s, color 0.12s; }
ul.tools a:hover, ul.tools a:focus-visible { background: var(--fill); padding-left: 10px; outline: none; transform: none; box-shadow: none; }
ul.tools a:hover::after { color: var(--accent); transform: translateX(4px); }
/* «связанные» на странице инструмента: без описаний, одной строкой */
ul.tools a:not(:has(strong)) { grid-template-columns: 1fr; font-family: var(--serif); font-size: 1.08rem; font-weight: 600; }
ul.tools a:not(:has(strong))::before { display: none; }
#pay, #leave, #time { scroll-margin-top: 16px; }

.note { font-size: 0.82rem; }
footer.site { border-top: 3px solid var(--navy); margin-top: 80px; padding-top: 22px; }

@media (max-width: 560px) {
  h1 { margin-top: 32px; }
  .card { padding: 18px; }
  #calc-result p:nth-child(even) { margin: 0 -18px; padding-left: 18px; padding-right: 18px; }
  header.site nav { gap: 14px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* правки: описания обычным весом, отступ от стрелки, без двойной линии под h2 */
ul.tools { border-top: 0; }
ul.tools a span { font-weight: 400; padding-right: 32px; }

/* телефон: навигация одной строкой с прокруткой, шапка компактнее */
@media (max-width: 799px) {
  header.site { padding: 8px 0 4px; }
  header.site nav { flex-wrap: nowrap; overflow-x: auto; width: 100%; gap: 15px; scrollbar-width: none; }
  header.site nav a { font-size: 0.84rem; }
  header.site nav::-webkit-scrollbar { display: none; }
  header.site nav a { white-space: nowrap; flex: none; border-bottom: 0; }
}
