:root {
  --ink: #18262d;
  --muted: #66767d;
  --line: #d9e0e2;
  --line-strong: #bdc9cd;
  --surface: #ffffff;
  --page: #f2f5f5;
  --navy: #173f4d;
  --navy-soft: #e8f0f1;
  --green: #26734e;
  --green-soft: #e5f1e8;
  --red: #b64355;
  --red-soft: #f7e5e8;
  --amber: #c59a30;
  --amber-soft: #faf1d8;
  --shadow: 0 10px 30px rgba(24, 45, 53, .07), 0 1px 2px rgba(24, 45, 53, .06);
  --font: "Segoe UI Variable", Aptos, Inter, "Segoe UI", system-ui, sans-serif;
}

body { font-family: var(--font); letter-spacing: 0; }
[hidden] { display: none !important; }
button, input, select { font-family: inherit; letter-spacing: 0; }
.mobile-data-toggle { display: none !important; }
.app-shell { padding: 12px; }
.app-topbar {
  grid-template-columns: 220px minmax(320px, 1fr) auto;
  min-height: 64px;
  border-color: rgba(177, 193, 198, .75);
  border-radius: 8px 8px 0 0;
  box-shadow: var(--shadow);
}
.compact-brand span, .eyebrow { letter-spacing: 0; }
.compact-brand span { color: #77868c; font-size: 9px; }
.compact-brand strong { font-family: var(--font); font-size: 20px; font-weight: 780; }
.section-switch, .view-switch { border-radius: 7px; background: #f3f6f6; }
.section-switch button, .view-switch button { min-height: 36px; background: transparent; font-weight: 720; transition: color .16s ease, background-color .16s ease; }
.section-switch button.active, .view-switch button.active { background: var(--navy); }
.top-actions { gap: 6px; }
.top-actions button, .top-actions a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 36px;
  border-radius: 7px;
  padding: 0 11px;
  font-weight: 720;
  line-height: 34px;
  transition: transform .14s ease, border-color .14s ease, background-color .14s ease;
}
.top-actions button:hover, .top-actions a:hover { border-color: #81969e; transform: translateY(-1px); }
.top-actions .print-button { border-color: var(--line-strong); background: #fff; color: var(--ink); }
.top-actions .pdf-button { border-color: var(--navy); background: var(--navy); color: #fff; }
.history-button { position: relative; border: 1px solid var(--line-strong); background: #fff; color: var(--ink); }
.history-button b { display: inline-grid; place-items: center; min-width: 18px; height: 18px; border-radius: 9px; padding: 0 5px; background: #dcebee; color: #173f4d; font-size: 9px; }
.top-panel { border-color: rgba(177, 193, 198, .75); }
.person-form { gap: 9px; padding: 12px 14px 13px; }
.person-form label > span, .text-calculator label > span { color: #617178; font-size: 9px; letter-spacing: 0; }
.person-form input, .text-calculator input {
  height: 40px;
  border-color: #c6d1d5;
  border-radius: 7px;
  background: #fbfcfc;
  font-weight: 620;
  transition: border-color .16s ease, box-shadow .16s ease, background-color .16s ease;
}
.person-form input:hover, .text-calculator input:hover { border-color: #98abb2; background: #fff; }
.person-form input:focus, .text-calculator input:focus { border-color: #3e788d; box-shadow: 0 0 0 3px rgba(62, 120, 141, .12); }
.calculate-button, .text-calculator button { height: 40px; border-radius: 7px; box-shadow: 0 4px 10px rgba(23, 63, 77, .15); }
.location-results { border-radius: 8px; box-shadow: 0 18px 50px rgba(24, 45, 53, .17); }
.summary-grid { background: #fbfcfc; }
.summary-card { padding: 9px 11px; }
.summary-card strong { color: #173f4d; }
.workspace { gap: 12px; margin-top: 12px; }
.calendar-zone, .info-panel, .calculator-zone { border-color: rgba(177, 193, 198, .75); border-radius: 8px; box-shadow: var(--shadow); }
.calendar-zone { padding: 12px; }
.calendar-toolbar { padding: 2px 2px 11px; }
.calendar-toolbar h1 { font-size: 25px; font-weight: 760; }
.month-navigation { border-radius: 7px; background: #fafcfc; }
.calendar-grid { gap: 9px; }
.month-card { border-color: #c7d1d4; border-radius: 7px; box-shadow: 0 2px 7px rgba(22, 45, 54, .045); }
.month-card > header { min-height: 48px; padding: 7px 9px; }
.month-identity h2 { font-size: 14px; font-weight: 780; }
.month-meta { border-radius: 4px; background: rgba(255,255,255,.76); }
.weekday-row { background: #1a3c49; }
.day-cell { transition: filter .13s ease, box-shadow .13s ease, transform .13s ease; }
.day-cell:hover { z-index: 3; transform: translateY(-1px); }
.day-cell.selected { z-index: 2; box-shadow: inset 0 0 0 2px #173f4d; }
.day-cell.is-today { z-index: 2; outline: 3px solid #123e50; outline-offset: -3px; }
.day-cell.is-today::before {
  content: "сегодня";
  position: absolute;
  top: 2px;
  left: 3px;
  max-width: calc(100% - 6px);
  overflow: hidden;
  font-size: 5px;
  font-weight: 900;
  text-overflow: clip;
  text-transform: uppercase;
  white-space: nowrap;
}
.day-icon, .day-number { background: rgba(255,255,255,.08); color: var(--day-ink, #172126); opacity: .84; }
.day-icon.solar { background: rgba(4, 24, 42, .76); color: #fff; }
.day-icon.lunar { background: rgba(73, 82, 88, .82); color: #fff; }
.status-solar { border-color: #315b7c; background: #e6eef5; }
.eclipse-intro { margin-bottom: 12px; }
.eclipse-list .eclipse-event { border-left: 3px solid #4b5359; border-radius: 6px; background: #f7f9fa; }
.eclipse-list .eclipse-event.solar { border-left-color: #183653; background: #eef3f7; }
.eclipse-event-title { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.visibility-badge { flex: 0 0 auto; border-radius: 999px; padding: 3px 6px; font-size: 7px; letter-spacing: 0; text-transform: uppercase; }
.visibility-badge.visible { background: #dcefe4; color: #19643d; }
.visibility-badge.hidden { background: #e4e8ea; color: #56636a; }
.eclipse-event small { color: #6c797f; font-size: 8px; line-height: 1.35; }
.info-panel { top: 12px; }
.tabs { min-height: 74px; grid-auto-rows: 37px; overflow-anchor: none; background: #f5f7f7; }
.tabs button { width: 100%; height: 37px; font-weight: 740; transition: background-color .14s ease, color .14s ease, box-shadow .14s ease; }
.tabs button.active { color: #173f4d; box-shadow: inset 0 -2px #2b7895; }
.info-content { overflow-anchor: none; }
.status-row, .number-item { border-radius: 7px; }
.status-row { padding: 9px; }
.day-guidance { border-radius: 0 7px 7px 0; background: #eef3f4; }
.number-summary { padding: 9px; }
.moon-hero, .event-list li { border-radius: 7px; }
.tooltip { border-radius: 8px; box-shadow: 0 20px 55px rgba(16, 38, 48, .2); }
.calculator-zone { background: #fff; }
.calculator-copy h1 { font-family: var(--font); font-weight: 780; }

.pdf-dialog {
  width: min(520px, calc(100vw - 24px));
  border: 1px solid #c7d2d6;
  border-radius: 8px;
  padding: 0;
  color: var(--ink);
  background: #fff;
  box-shadow: 0 25px 80px rgba(16, 38, 48, .24);
}
.pdf-dialog::backdrop { background: rgba(18, 35, 43, .48); }
.pdf-dialog-content { position: relative; display: grid; gap: 14px; padding: 24px; }
.pdf-dialog-content h2, .pdf-dialog-content p { margin: 0; }
.pdf-dialog-content h2 { font-size: 24px; }
.pdf-dialog-content > p:not(.eyebrow) { color: var(--muted); font-size: 12px; line-height: 1.45; }
.dialog-close { position: absolute; top: 12px; right: 12px; width: 32px; height: 32px; border: 0; background: transparent; color: #607078; font-size: 23px; cursor: pointer; }
.pdf-layout-options { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.pdf-layout-options label { position: relative; cursor: pointer; }
.pdf-layout-options input { position: absolute; opacity: 0; pointer-events: none; }
.pdf-layout-options span { display: grid; gap: 5px; min-height: 88px; border: 1px solid #ccd7da; border-radius: 7px; padding: 14px; background: #f8fafa; }
.pdf-layout-options b { font-size: 14px; }
.pdf-layout-options small { color: var(--muted); font-size: 11px; line-height: 1.4; }
.pdf-layout-options input:checked + span { border-color: #2f748d; background: #eaf2f4; box-shadow: inset 0 0 0 1px #2f748d; }
.pdf-progress { min-height: 17px; color: #2a6e86 !important; font-weight: 700; }
.pdf-confirm { min-height: 42px; border: 0; border-radius: 7px; background: var(--navy); color: #fff; font-weight: 780; cursor: pointer; }
.pdf-confirm:disabled { cursor: wait; opacity: .6; }

.access-dialog {
  width: min(560px, calc(100vw - 24px));
  max-height: min(760px, calc(100vh - 24px));
  border: 1px solid #c7d2d6;
  border-radius: 8px;
  padding: 0;
  overflow: hidden;
  color: var(--ink);
  background: #fff;
  box-shadow: 0 28px 90px rgba(16, 38, 48, .27);
}
.access-dialog::backdrop { background: rgba(14, 31, 39, .58); backdrop-filter: blur(3px); }
.access-dialog-content { position: relative; display: grid; gap: 15px; max-height: min(760px, calc(100vh - 24px)); overflow: auto; padding: 26px; }
.access-dialog-content h2, .access-dialog-content p { margin: 0; }
.access-dialog-content h2 { font-size: 25px; line-height: 1.15; }
.access-dialog-content > p:not(.eyebrow):not(.access-message):not(.history-note) { color: var(--muted); font-size: 12px; line-height: 1.5; }
.promo-input-label { display: grid; gap: 6px; }
.promo-input-label span { color: #617178; font-size: 9px; font-weight: 850; text-transform: uppercase; }
.promo-input-label input { width: 100%; height: 52px; border: 1px solid #b9c8cd; border-radius: 7px; padding: 0 14px; background: #f9fbfb; color: #173f4d; font-size: 22px; font-weight: 800; text-align: center; outline: none; }
.promo-input-label input:focus { border-color: #3e788d; box-shadow: 0 0 0 3px rgba(62, 120, 141, .13); }
.access-message { min-height: 18px; color: #a3384c; font-size: 11px; font-weight: 700; text-align: center; }
.access-confirm { min-height: 44px; border: 0; border-radius: 7px; background: var(--navy); color: #fff; font-weight: 780; cursor: pointer; }
.access-confirm:disabled { cursor: wait; opacity: .62; }
.access-whatsapp, .admin-entry { color: #2d7189; font-size: 11px; font-weight: 720; text-align: center; text-decoration: none; }
.access-overview { display: grid; grid-template-columns: 1fr 1.4fr; border-block: 1px solid #dde5e7; background: #f7f9f9; }
.access-overview > div { display: grid; gap: 4px; min-width: 0; padding: 12px; }
.access-overview > div + div { border-left: 1px solid #dde5e7; }
.access-overview span { color: #728087; font-size: 8px; font-weight: 850; text-transform: uppercase; }
.access-overview strong { overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.history-list { display: grid; gap: 7px; }
.history-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 58px; border: 1px solid #d4dee1; border-radius: 7px; padding: 9px 11px; background: #fff; color: var(--ink); text-align: left; cursor: pointer; transition: border-color .14s ease, background-color .14s ease, transform .14s ease; }
.history-item:hover { border-color: #7f9ba5; background: #f5f9fa; transform: translateY(-1px); }
.history-item span { display: grid; gap: 4px; min-width: 0; }
.history-item strong, .history-item small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.history-item strong { font-size: 13px; }
.history-item small { color: var(--muted); font-size: 10px; }
.history-item b { flex: 0 0 auto; border-radius: 4px; padding: 5px 7px; background: #e8f0f1; color: #173f4d; font-size: 10px; }
.history-empty { border: 1px dashed #cbd6da; border-radius: 7px; padding: 24px 14px; color: var(--muted); font-size: 11px; text-align: center; }
.history-note { color: #78868c; font-size: 9px; line-height: 1.45; }

.pdf-export-root { position: fixed; top: 0; left: -100000px; width: 1584px; background: #fff; }
.pdf-export-page { width: 1584px; height: 1120px; overflow: hidden; padding: 24px; background: #fff; color: #18262d; font-family: var(--font); }
.pdf-export-header { display: flex; align-items: end; justify-content: space-between; height: 58px; padding: 0 2px 12px; border-bottom: 2px solid #173f4d; }
.pdf-export-header > div:first-child { display: grid; gap: 2px; }
.pdf-export-header span { color: #68777d; font-size: 10px; font-weight: 800; }
.pdf-export-header strong { font-size: 22px; }
.pdf-export-header > div:last-child { color: #617178; font-size: 11px; font-weight: 700; }
.pdf-export-grid { display: grid; height: 1014px; gap: 7px; padding-top: 8px; }
.pdf-export-one .pdf-export-grid { grid-template-columns: repeat(4, 1fr); grid-template-rows: repeat(3, 1fr); }
.pdf-export-two .pdf-export-grid { grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(2, 1fr); gap: 11px; }
.pdf-export-page .month-card { display: grid; grid-template-rows: auto auto 1fr; height: 100%; box-shadow: none; }
.pdf-export-page .month-card > header { min-height: 40px; }
.pdf-export-page .weekday-row { height: 18px; }
.pdf-export-page .month-days { grid-template-rows: repeat(6, 1fr); min-height: 0; }
.pdf-export-page .day-cell, .pdf-export-page .day-blank { height: auto; min-height: 0; }
.pdf-export-page .day-cell > strong { font-size: 13px; }
.pdf-export-page .day-cell:hover { transform: none; }
.pdf-export-page .day-cell.is-today::before { content: ""; }
.pdf-export-two .month-card > header { min-height: 48px; }
.pdf-export-two .month-identity h2 { font-size: 17px; }
.pdf-export-two .weekday-row { height: 24px; }
.pdf-export-two .weekday-row span { font-size: 10px; }
.pdf-export-two .day-cell > strong { font-size: 20px; }
.pdf-export-two .day-bottom { height: 16px; }
.pdf-export-two .day-icon, .pdf-export-two .day-number { width: 15px; height: 15px; font-size: 9px; }

@media (max-width: 820px) {
  .app-shell { padding: 0; }
  .app-topbar { grid-template-columns: minmax(0, 1fr) auto; border-radius: 0; box-shadow: 0 4px 16px rgba(24, 45, 53, .06); }
  .compact-brand strong { font-size: 16px; }
  .section-switch, .section-switch button { min-width: 0; }
  .mobile-data-toggle { display: inline-flex !important; width: 34px; padding: 0 !important; font-size: 0 !important; }
  .mobile-data-toggle::after { content: "✎"; font-size: 14px; }
  .top-actions .admin-link { width: 34px; padding: 0; font-size: 0; }
  .top-actions .admin-link::after { content: "A"; font-size: 11px; }
  .top-actions .print-button, .top-actions .pdf-button { width: 34px; padding: 0; font-size: 0; }
  .top-actions .history-button { width: 34px; padding: 0; }
  .top-actions .history-button span { display: none; }
  .top-actions .history-button::before { content: "◷"; font-size: 15px; }
  .top-actions .history-button b { position: absolute; top: -4px; right: -4px; min-width: 16px; height: 16px; border: 2px solid #fff; padding: 0 3px; font-size: 7px; }
  .top-actions .print-button span, .top-actions .pdf-button span { font-size: 13px; }
  .top-actions .print-button::after { content: none; }
  .calendar-zone, .info-panel { border-radius: 0; }
  .tabs { position: relative; width: 100%; min-height: 78px; grid-auto-rows: 39px; }
  .tabs button { height: 39px; font-size: 9px; }
  .info-content { min-height: 560px; }
  .day-cell.is-today::before { font-size: 6px; }
  .pdf-layout-options { grid-template-columns: 1fr; }
  .access-dialog-content { padding: 22px 17px; }
  .access-overview { grid-template-columns: 1fr; }
  .access-overview > div + div { border-top: 1px solid #dde5e7; border-left: 0; }
}

@media print {
  .pdf-dialog, .access-dialog { display: none !important; }
}
