:root {
  color-scheme: light;
  --font-sans: Arial, Helvetica, sans-serif;
  --color-background: #f7f7f5;
  --color-foreground: #191a1b;
  --color-border: #d9d9d5;
  --color-muted-foreground: #5d5f5a;
  --color-primary: #c92f2f;
  --density-compact: 4px;
  --density-normal: 8px;
  --density-touch: 44px;
}

* { box-sizing: border-box; }
body { margin: 0; background: #f7f7f5; color: #191a1b; font-family: var(--font-sans); }
a { color: inherit; text-decoration: none; }

.site-header { border-bottom: 1px solid #d9d9d5; background: #f7f7f5; }
.header-inner, .page-shell { width: min(1180px, calc(100% - 40px)); margin: 0 auto; }
.header-inner { min-height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 32px; padding: 8px 0; }
.brand { display: flex; align-items: center; gap: 10px; font-size: 11px; line-height: 1.1; letter-spacing: .08em; text-transform: uppercase; }
.brand b { font-size: 14px; letter-spacing: 0; text-transform: none; }
.brand-mark { display: grid; place-items: center; width: 31px; height: 31px; color: #c92f2f; border: 1.5px solid #c92f2f; border-radius: 50%; }
.brand-mark svg { width: 16px; height: 16px; }

.year-switcher { display: flex; align-items: center; gap: 6px; flex: 0 1 auto; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.year-switcher::-webkit-scrollbar { display: none; }

/* FRONT-007: навигация разделов шапки (design: section-nav + icon-button) */
.section-nav { display: flex; align-items: center; gap: 30px; margin-left: auto; font-size: 13px; color: #70716d; }
.section-nav a { padding: 28px 0 25px; border-bottom: 2px solid transparent; }
.section-nav a.active { color: #191a1b; border-color: #c92f2f; }
.section-nav a:hover { color: #191a1b; }
.icon-button { display: grid; place-items: center; width: 44px; height: 44px; border: 1px solid #d9d9d5; background: transparent; color: #70716d; border-radius: 4px; cursor: pointer; }
.icon-button svg { width: 16px; height: 16px; }
.icon-button:hover { color: #191a1b; border-color: #b7b8b3; }
.nav-menu { position: relative; margin-left: 8px; }
.nav-menu summary { list-style: none; }
.nav-menu summary::-webkit-details-marker { display: none; }
.nav-menu-list { position: absolute; right: 0; top: calc(100% + 6px); min-width: 200px; padding: 6px; background: #fff; border: 1px solid #d9d9d5; border-radius: 4px; box-shadow: 0 6px 20px rgba(25, 26, 27, .08); z-index: 10; }
.nav-menu-list a { display: block; padding: 10px 12px; border-radius: 3px; font-size: 13px; color: #191a1b; }
.nav-menu-list a:hover { background: #f4f4f2; }
.nav-menu-list a.active { color: #c92f2f; font-weight: 700; }
.nav-menu[open] .icon-button { color: #191a1b; border-color: #191a1b; }
.year-chip { min-width: 42px; height: 30px; padding: 0 10px; display: inline-flex; align-items: center; justify-content: center; gap: 4px; border: 1px solid #b7b8b3; border-radius: 999px; color: #5d5f5a; font: 600 12px/1 var(--font-sans); white-space: nowrap; flex: 0 0 auto; }
a.year-chip:hover { border-color: #191a1b; color: #191a1b; }
.year-chip.active { background: #191a1b; border-color: #191a1b; color: #fff; }
.year-chip.soon { border-style: dashed; border-color: #d9d9d5; color: #a6a7a1; }
.year-chip small { font-size: 8px; font-weight: 500; }
.year-chip:focus-visible, a:focus-visible { outline: 2px solid #2767ad; outline-offset: 2px; }

.topline { width: min(1180px, calc(100% - 40px)); margin: 0 auto; display: flex; justify-content: space-between; gap: 16px; padding: 19px 0; color: #70716d; font-size: 11px; letter-spacing: .02em; }
.topline a { display: inline-flex; align-items: center; gap: 4px; color: #191a1b; text-decoration: underline; text-underline-offset: 3px; }
.status-dot { display: inline-block; width: 6px; height: 6px; margin-right: 6px; border-radius: 50%; background: #1a8b62; }

.hero { display: flex; justify-content: space-between; align-items: end; gap: 48px; padding: 54px 0 48px; }
.eyebrow { margin: 0 0 15px; color: #c92f2f; font-size: 10px; font-weight: 700; letter-spacing: .14em; }
.hero h1 { margin: 0; font-size: clamp(47px, 7vw, 88px); line-height: .9; letter-spacing: -.07em; font-weight: 700; }
.hero h1 em { color: #c92f2f; font-style: normal; }
.hero-copy { max-width: 430px; margin: 28px 0 0; color: #70716d; font-size: 15px; line-height: 1.55; }
.hero-actions { display: flex; flex-direction: column; gap: 10px; min-width: 180px; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 9px; height: 46px; padding: 0 16px; border: 1px solid #191a1b; border-radius: 3px; font-size: 12px; font-weight: 700; }
.button.primary { color: #fff; background: #c92f2f; border-color: #c92f2f; }
.button.primary:hover { background: #a82626; }
.hero-month .hero-actions { margin-top: 20px; min-width: 0; }
.hero-month { padding: 40px 0 32px; }
.hero-month h1 { font-size: clamp(36px, 5vw, 56px); }
.hero-month .eyebrow a { color: #c92f2f; }
.rule { height: 1px; background: #191a1b; }

.calendar-intro { display: flex; justify-content: space-between; align-items: end; gap: 20px; padding: 33px 0 24px; }
.calendar-intro h2, .panel h2 { margin: 0; font-size: 22px; letter-spacing: -.03em; }
.muted { color: #70716d; font-size: 12px; }
.calendar-intro .muted { margin: 8px 0 0; }
.legend { display: flex; flex-wrap: wrap; justify-content: end; gap: 13px; color: #5d5f5a; font-size: 11px; }
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.legend-dot { width: 10px; height: 10px; display: inline-block; border: 1px solid #191a1b; }
.legend-dot.working { background: #fff; }
.legend-dot.weekend { background: #f4dede; }
.legend-dot.holiday { background: #c92f2f; border-color: #c92f2f; }
.legend-dot.transferred { background: #e8b54c; }
.legend-dot.shortened { background: repeating-linear-gradient(135deg, #d9d9d5 0 2px, transparent 2px 4px); }

.year-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 25px 20px; }
.month-card { min-width: 0; }
.month-heading { display: flex; align-items: baseline; justify-content: space-between; padding-bottom: 9px; border-bottom: 1px solid #191a1b; }
.month-heading h3 { margin: 0; font-size: 16px; }
.month-heading a:hover { text-decoration: underline; text-underline-offset: 3px; }
.month-stat { font-size: 10px; color: #70716d; font-variant-numeric: tabular-nums; }
.week-labels, .month-grid { display: grid; grid-template-columns: repeat(7, 1fr); }
.week-labels { padding: 8px 0 5px; color: #5d5f5a; font-size: 9px; font-weight: 700; text-align: center; }
.day-cell { min-height: 39px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; border: 1px solid transparent; font-variant-numeric: tabular-nums; font-size: 13px; }
.day-weekend { background: #f4dede; color: #a32a2a; }
.day-holiday { background: #c92f2f; color: #fff; }
.day-transferred { background: #f1d99d; color: #574112; }
.day-shortened { background: repeating-linear-gradient(135deg, transparent 0 4px, #e8e8e5 4px 5px); }
.day-today { outline: 2px solid #2767ad; outline-offset: -3px; }
.day-mark { font-size: 8px; line-height: 1; font-weight: 700; }
.day-empty { background: transparent; }

.month-page-grid { max-width: 480px; margin: 0 auto; }
.month-page-grid .week-labels { border-bottom: 1px solid #191a1b; }
.month-page-grid .day-cell { min-height: 46px; }

.info-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 20px; margin-top: 58px; }
.panel { border-top: 2px solid #191a1b; padding-top: 18px; }
.panel-heading { display: flex; justify-content: space-between; align-items: start; }
.panel ul { list-style: none; padding: 0; margin: 18px 0 0; }
.panel li { display: grid; grid-template-columns: 116px 1fr auto; gap: 12px; padding: 12px 0; border-bottom: 1px solid #d9d9d5; font-size: 12px; }
.panel li time, .panel li b { font-variant-numeric: tabular-nums; }
.panel li time { font-weight: 700; }
.panel li span { color: #70716d; }
.panel li b { font-size: 11px; font-weight: 400; color: #c92f2f; }
.norm-main { display: flex; align-items: baseline; gap: 9px; margin: 20px 0 24px; }
.norm-main strong { font-size: 48px; letter-spacing: -.06em; font-variant-numeric: tabular-nums; }
.norm-main span { color: #70716d; font-size: 13px; }
.norms-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; border-top: 1px solid #d9d9d5; padding-top: 14px; }
.norms-row div { display: flex; flex-direction: column; gap: 4px; }
.norms-row b { font-size: 14px; font-variant-numeric: tabular-nums; }
.norms-row span { color: #70716d; font-size: 10px; }
.norm-note { margin: 16px 0 0; line-height: 1.4; }

/* Калькулятор (FR-006, порт дизайна DateRangeCalculator) */
.calculator { display: grid; grid-template-columns: 1fr 1.1fr auto; align-items: center; gap: 34px; margin: 44px 0 20px; padding: 28px 30px; background: #191a1b; color: #fff; }
.calculator .eyebrow { color: #e66b6b; }
.calculator h2 { margin: 0; color: #fff; font-size: 22px; letter-spacing: -.03em; }
.calculator .muted { color: #b4b4af; line-height: 1.4; }
.date-fields { display: flex; align-items: end; gap: 12px; }
.date-fields label { display: flex; flex-direction: column; gap: 8px; color: #b4b4af; font-size: 10px; }
.date-fields input { width: 150px; height: 38px; padding: 0 9px; border: 1px solid #555653; border-radius: 3px; background: #2c2d2d; color: #fff; font-size: 12px; color-scheme: dark; }
.date-arrow { padding-bottom: 10px; color: #b4b4af; }
.calc-result { display: flex; flex-direction: column; align-items: end; white-space: nowrap; }
.calc-result strong { color: #e66b6b; font-size: 47px; line-height: .9; letter-spacing: -.06em; font-variant-numeric: tabular-nums; }
.calc-result span { font-size: 11px; }
.calc-result .result-sub { margin-top: 6px; color: #b4b4af; font-size: 10px; }
.calc-flag { color: #e66b6b; }
.calc-notes li span { color: #70716d; }

/* FRONT-005: сравнение лет (CompareView) */
.compare-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin: 34px 0 8px; }
.compare-cards .norms-row { grid-template-columns: repeat(4, 1fr); }
.compare-norms { margin: 4px 0 26px; line-height: 1.5; }
.compare-section { margin-top: 34px; }
.compare-table { max-width: none; }
.compare-table td { width: 25%; text-align: right; }
.compare-table th[scope="row"] { text-align: left; }
.compare-table .diff-pos { color: #1a8b62; font-weight: 700; }
.compare-table .diff-neg { color: #c92f2f; font-weight: 700; }
.compare-grid { grid-template-columns: 1fr 1fr; }

.year-list { list-style: none; margin: 18px 0 0; padding: 0; }
.year-list a { display: inline-block; padding: 10px 0; font-size: 15px; }
.year-list a:hover { color: #c92f2f; }

.quarter-links { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 34px 0 8px; padding: 14px 0; border-top: 1px solid #191a1b; font-size: 13px; }
.quarter-links a { padding: 6px 12px; border: 1px solid #b7b8b3; border-radius: 999px; color: #5d5f5a; }
.quarter-links a:hover { border-color: #191a1b; color: #191a1b; }
.quarter-links a:first-child { border-color: #c92f2f; color: #c92f2f; }

.panel-more { color: #c92f2f; font-size: 11px; white-space: nowrap; }

.norm-table { width: 100%; max-width: 46rem; margin: 18px 0 6px; border-collapse: collapse; font-variant-numeric: tabular-nums; font-size: 13px; }
.norm-table th, .norm-table td { border: 1px solid #d9d9d5; padding: 6px 10px; text-align: left; }
.norm-table thead th { background: #191a1b; color: #fff; font-size: 11px; letter-spacing: .04em; }
.norm-table tbody tr:nth-child(3n) { border-bottom-color: #191a1b; }
.norm-table tbody td, .norm-table tbody th { font-variant-numeric: tabular-nums; }
.norm-table tfoot th, .norm-table tfoot td { background: #f4dede; font-weight: 700; }
.norm-table a { color: inherit; }
.norm-table a:hover { color: #c92f2f; text-decoration: underline; text-underline-offset: 3px; }
.norm-table-panel { margin-top: 34px; }
.period-grid { grid-template-columns: repeat(3, 1fr); }

.month-links { display: flex; flex-wrap: wrap; gap: 1rem; align-items: baseline; justify-content: space-between; margin: 48px 0 20px; padding: 18px 0; border-top: 1px solid #191a1b; }
.month-links a { color: #c92f2f; font-size: 13px; }
.month-links .nav-ghost { color: #a6a7a1; font-size: 13px; }

.site-footer { display: flex; align-items: center; gap: 18px; padding: 22px 0 34px; margin-top: 12px; border-top: 1px solid #d9d9d5; color: #70716d; font-size: 10px; }
.footer-brand { color: #191a1b; font-size: 15px; font-weight: 800; letter-spacing: -.05em; }
.footer-brand span { color: #c92f2f; }
.site-footer p { margin: 0; }
.footer-source { margin-left: auto; }
.site-footer a { text-decoration: underline; text-underline-offset: 3px; }

@media (max-width: 800px) {
  .header-inner, .page-shell, .topline { width: min(100% - 28px, 560px); }
  .header-inner { min-height: 64px; gap: 12px; }
  .year-switcher { flex: 1 1 auto; }
  .section-nav { display: none; }
  .nav-menu-list a { padding: 14px 12px; }
  .topline { font-size: 9px; }
  .hero { display: block; padding: 36px 0 30px; }
  .hero h1 { font-size: clamp(36px, 10vw, 52px); }
  .hero-copy { font-size: 13px; margin-top: 22px; }
  .hero-actions { flex-direction: row; margin-top: 24px; }
  .button { flex: 1; padding: 0 9px; font-size: 11px; }
  .calendar-intro { display: block; padding-top: 26px; }
  .legend { justify-content: start; margin-top: 18px; gap: 10px; font-size: 11px; }
  .year-grid { grid-template-columns: 1fr; gap: 28px; }
  .month-heading h3 { font-size: 14px; }
  .month-stat { font-size: 8px; }
  .day-cell { min-height: 40px; font-size: 13px; }
  .day-mark { font-size: 8px; }
  .info-grid { grid-template-columns: 1fr; gap: 42px; margin-top: 48px; }
  .panel li { grid-template-columns: 96px 1fr auto; }
  .period-grid { grid-template-columns: 1fr; }
  .norm-table { font-size: 11px; }
  .norm-table th, .norm-table td { padding: 4px 6px; }
  .calculator { grid-template-columns: 1fr; gap: 24px; padding: 24px 20px; }
  .date-fields { justify-content: space-between; }
  .date-fields input { width: 100%; min-width: 0; }
  .date-fields label { flex: 1; }
  .calc-result { align-items: start; }
  .calc-result strong { font-size: 40px; }
  .compare-cards { grid-template-columns: 1fr; }
  .compare-grid { grid-template-columns: 1fr; }
  .compare-table { font-size: 10px; }
  .footer-source { margin-left: 0; }
  .site-footer { align-items: start; flex-wrap: wrap; gap: 10px; }
  .footer-source { flex-basis: 100%; line-height: 1.5; }
}

/* Десктоп: details-меню скрыто, работает inline section-nav */
@media (min-width: 801px) {
  .nav-menu { display: none; }
}

/* FR-005: печать — год/месяц ≤ 1 лист A4, без навигации; РСЯ-блоки скрыты
   (FR-007 AC-002, класс появится с MON-001). Ч/б: типы дней различимы метками. */
@media print {
  .site-header, .topline, .month-links, .quarter-links, .hero-actions, .button, .ad-slot, .legend, .calculator, .calc-notes, .section-nav, .nav-menu { display: none !important; }
  body { background: #fff; }
  .page-shell { width: 100%; }
  .hero, .hero-month { padding: 8px 0 6px; display: block; }
  .hero h1 { font-size: 26px; }
  .hero-month h1 { font-size: 22px; }
  .hero-copy { margin-top: 6px; font-size: 11px; }
  .calendar-intro { padding: 10px 0 6px; }
  .calendar-intro h2, .panel h2 { font-size: 14px; }
  .year-grid { grid-template-columns: repeat(4, 1fr); gap: 6px 8px; }
  .month-heading { padding-bottom: 3px; }
  .month-heading h3 { font-size: 11px; }
  .month-stat { font-size: 8px; }
  .week-labels { padding: 3px 0 1px; font-size: 7px; }
  .day-cell { min-height: 17px; font-size: 9px; gap: 1px; }
  .day-mark { font-size: 6px; }
  .month-page-grid { max-width: none; }
  .month-page-grid .day-cell { min-height: 20px; font-size: 10px; }
  .info-grid { grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 14px; }
  .panel { padding-top: 8px; break-inside: avoid; }
  .panel ul { margin-top: 8px; }
  .panel li { padding: 4px 0; font-size: 9px; grid-template-columns: 80px 1fr auto; gap: 8px; }
  .norm-main { margin: 8px 0; }
  .norm-main strong { font-size: 26px; }
  .norms-row { padding-top: 6px; }
  .norm-note { font-size: 8px; }
  .norm-table { font-size: 8px; max-width: none; }
  .norm-table th, .norm-table td { padding: 2px 4px; }
  .site-footer { padding: 6px 0 0; }
}
