:root {
  --bg: #f6f7f5;
  --surface: #ffffff;
  --text: #1c2321;
  --muted: #5d6764;
  --border: #dfe3e0;
  --accent: #1f6f5c;
  --accent-soft: #e3f1ec;
  --holiday: #c8372d;
  --holiday-bg: #fde8e6;
  --off-bg: #f0f1ef;
  --short-bg: #fff4d6;
  --work-sat-bg: #dcecff;
  --radius: 12px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121615;
    --surface: #1b2120;
    --text: #e6ebe9;
    --muted: #9aa5a1;
    --border: #2d3533;
    --accent: #4fbf9f;
    --accent-soft: #1d3530;
    --holiday: #ff7b70;
    --holiday-bg: #3a2220;
    --off-bg: #232a28;
    --short-bg: #3a3320;
    --work-sat-bg: #1f2f45;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}
a { color: var(--accent); }
.wrap { max-width: 980px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }

.site-header { background: var(--surface); border-bottom: 1px solid var(--border); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 60px; flex-wrap: wrap; padding-top: 8px; padding-bottom: 8px; }
.logo { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 18px; color: var(--text); text-decoration: none; }
.logo-mark { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; background: var(--accent); color: #fff; font-size: 13px; }
.main-nav { display: flex; gap: 4px; flex-wrap: wrap; }
.main-nav a { padding: 6px 10px; border-radius: 8px; color: var(--text); text-decoration: none; font-size: 15px; }
.main-nav a:hover, .main-nav a[aria-current] { background: var(--accent-soft); color: var(--accent); }

main { padding-bottom: 40px; }
.crumbs { font-size: 14px; color: var(--muted); margin-top: 16px; }
.crumbs a { color: var(--muted); }
h1 { font-size: clamp(26px, 5vw, 36px); line-height: 1.2; margin: 16px 0 8px; }
h2 { font-size: 22px; margin: 36px 0 12px; line-height: 1.3; }
h3 { font-size: 17px; margin: 0 0 8px; }
.lead { font-size: 18px; color: var(--muted); margin-top: 0; }

table { border-collapse: collapse; width: 100%; background: var(--surface); }
th, td { padding: 8px 12px; border-bottom: 1px solid var(--border); text-align: left; }
th { font-size: 14px; color: var(--muted); font-weight: 600; }
.table-scroll { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); }
.table-scroll table { min-width: 480px; }
.table-scroll tr:last-child td { border-bottom: 0; }
.norms td:not(:first-child), .norms th:not(:first-child) { text-align: right; }
.norms tr.sub td { background: var(--off-bg); font-weight: 600; }
.norms tr.total td { background: var(--accent-soft); font-weight: 700; }

.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin: 20px 0; }
.fact { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; color: var(--muted); font-size: 14px; }
.fact span { display: block; font-size: 30px; font-weight: 700; color: var(--text); line-height: 1.2; }

.legend { display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 14px; color: var(--muted); margin-bottom: 12px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.lg { width: 16px; height: 16px; border-radius: 4px; display: inline-block; border: 1px solid var(--border); }
.lg.holiday { background: var(--holiday-bg); }
.lg.off { background: var(--off-bg); }
.lg.short { background: var(--short-bg); }
.lg.tr-work { background: var(--work-sat-bg); }
.months { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 14px; }
.month { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; }
.cal { background: none; }
.cal th, .cal td { text-align: center; padding: 5px 0; border: 0; font-size: 14px; }
.cal td { border-radius: 6px; }
.cal th:nth-child(n+6) { color: var(--holiday); }
.cal td.off { background: var(--off-bg); color: var(--muted); }
.cal td.holiday { background: var(--holiday-bg); color: var(--holiday); font-weight: 700; }
.cal td.short { background: var(--short-bg); }
.cal td.tr-work { background: var(--work-sat-bg); font-weight: 600; }
.cal td[title] { cursor: help; }
.month-sum { font-size: 13px; color: var(--muted); margin: 8px 0 0; }
.holidays { padding-left: 20px; }

.hero-value { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; margin: 20px 0; }
.hero-num { font-size: 52px; font-weight: 800; color: var(--accent); line-height: 1; }
.hero-num small { font-size: 22px; font-weight: 600; }
.hero-value .muted { font-size: 14px; }

.calc { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; margin: 20px 0; }
.calc h2 { margin-top: 0; }
.calc-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.calc-grid .wide { grid-column: 1 / -1; }
label { display: flex; flex-direction: column; gap: 6px; font-size: 14px; color: var(--muted); }
input, select, button { font: inherit; }
input[type=number], input[type=date], select {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px;
  background: var(--bg); color: var(--text); font-size: 17px;
}
input:focus, select:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
.calc-result { margin: 18px 0 0; padding: 16px; background: var(--accent-soft); border-radius: 10px; font-size: 18px; }
.calc-result:empty { display: none; }
.calc-result b { font-size: 22px; }
.calc-result .words { display: block; font-size: 14px; color: var(--muted); margin-top: 6px; }
.calc-actions { margin-top: 12px; display: flex; gap: 10px; flex-wrap: wrap; }
button { cursor: pointer; }
.btn-secondary { padding: 9px 14px; border-radius: 8px; border: 1px dashed var(--accent); background: none; color: var(--accent); }
.btn-copy { margin-top: 8px; padding: 6px 12px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font-size: 14px; }

.period { display: grid; grid-template-columns: 1fr 1fr auto; gap: 10px; align-items: end; padding: 12px 0; border-bottom: 1px solid var(--border); }
.period .check { flex-direction: row; align-items: center; grid-column: 1 / -1; gap: 8px; }
.period .del { background: none; border: 1px solid var(--border); color: var(--muted); border-radius: 8px; width: 44px; height: 44px; font-size: 20px; }
.period .sub { grid-column: 1 / -1; font-size: 14px; color: var(--muted); margin: 0; }
@media (max-width: 520px) { .period { grid-template-columns: 1fr 1fr; } .period .del { grid-column: 2; justify-self: end; grid-row: 1; position: relative; } }

.tabs { display: inline-flex; background: var(--bg); border: 1px solid var(--border); border-radius: 10px; padding: 3px; margin-bottom: 16px; }
.tabs button { border: 0; background: none; padding: 8px 14px; border-radius: 8px; color: var(--muted); }
.tabs button[aria-selected=true] { background: var(--surface); color: var(--text); font-weight: 600; box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.formula { background: var(--surface); border-left: 3px solid var(--accent); padding: 10px 14px; border-radius: 0 8px 8px 0; font-family: ui-monospace, Consolas, monospace; font-size: 15px; }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; margin-top: 20px; }
.card { display: block; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; text-decoration: none; color: var(--text); transition: border-color .15s, transform .15s; }
.card:hover { border-color: var(--accent); transform: translateY(-2px); }
.card h2, .card h3 { font-size: 18px; margin: 0 0 6px; color: var(--accent); }

.related { margin-top: 36px; }
.related-list { display: flex; flex-wrap: wrap; gap: 8px; }
.related-list a { padding: 8px 14px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); text-decoration: none; font-size: 15px; }
.related-list a:hover { border-color: var(--accent); }

.helper { margin-top: 14px; }
.helper summary { cursor: pointer; color: var(--accent); font-size: 15px; margin-bottom: 10px; }
.helper .btn-secondary { margin-top: 12px; }
.card p { margin: 0; color: var(--muted); font-size: 15px; }

.faq details { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; margin-bottom: 8px; }
.faq summary { padding: 12px 16px; cursor: pointer; font-weight: 600; }
.faq details > div { padding: 0 16px 14px; color: var(--muted); }

.ad { margin: 24px 0; min-height: 100px; }
.site-footer { border-top: 1px solid var(--border); background: var(--surface); font-size: 14px; padding: 12px 0; }
