:root {
  color-scheme: light;
  --background: #f7f8fa;
  --surface: #ffffff;
  --surface-subtle: #f0f2f5;
  --border: #e4e7ec;
  --text: #18202b;
  --muted: #657080;
  --accent: #315f74;
  --accent-hover: #264c5e;
  --accent-soft: #e7f0f3;
  --focus: #22739a;
  --radius-small: 8px;
  --radius: 12px;
  --radius-large: 20px;
  --shadow: 0 1px 3px rgba(16, 24, 40, 0.08);
  --font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html { min-width: 320px; background: var(--background); }

body {
  margin: 0;
  color: var(--text);
  background: var(--background);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

button, input { font: inherit; }
button { color: inherit; }

.skip-link {
  position: fixed;
  z-index: 10;
  top: 12px;
  left: 12px;
  padding: 10px 14px;
  color: var(--surface);
  background: var(--accent);
  border-radius: var(--radius-small);
  transform: translateY(-160%);
}

.skip-link:focus { transform: translateY(0); }

.noscript-message {
  max-width: 1120px;
  margin: 12px auto;
  padding: 12px 16px;
  color: #713b00;
  background: #fff4e5;
  border: 1px solid #f1d2a5;
  border-radius: var(--radius-small);
  font-size: 14px;
}

.page-shell {
  width: min(1120px, calc(100% - 48px));
  margin: 0 auto;
}

.site-header {
  min-height: 88px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
}

.header-actions { display: flex; align-items: center; gap: 20px; }

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
}

.brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 10px;
}

.brand-mark svg, button svg, .note svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.text-button {
  min-height: 40px;
  padding: 0 4px;
  color: var(--accent);
  background: transparent;
  border: 0;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
}

.secondary-button {
  min-height: 44px;
  padding: 0 14px;
  color: var(--accent);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-small);
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
}

.secondary-button:hover { background: var(--surface-subtle); }

.hero { max-width: 720px; padding: 64px 0 36px; }

.eyebrow, .section-kicker {
  margin: 0 0 12px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

h1 {
  max-width: 670px;
  margin: 0;
  font-size: clamp(36px, 6vw, 58px);
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 1.05;
}

.intro {
  max-width: 620px;
  margin: 24px 0 0;
  color: var(--muted);
  font-size: 18px;
}

.year-panel {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-large);
  box-shadow: var(--shadow);
}

.year-field, .country-field { min-width: 0; }
.year-field { flex: 0.65; }
.country-field { flex: 1.35; }

.year-field label, .country-field label {
  display: block;
  margin: 0 0 6px 2px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.year-field input, .country-field select {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  color: var(--text);
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: var(--radius-small);
  font-size: 20px;
  font-weight: 600;
  appearance: textfield;
}

.country-field select { appearance: auto; }

.year-field input::-webkit-inner-spin-button { appearance: none; }

.icon-button, .primary-button {
  min-width: 48px;
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-small);
  cursor: pointer;
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease;
}

.icon-button {
  background: var(--surface);
  border: 1px solid var(--border);
}

.icon-button:hover { background: var(--surface-subtle); }

.primary-button {
  gap: 9px;
  padding: 0 18px;
  color: var(--surface);
  background: var(--accent);
  border: 1px solid var(--accent);
  font-size: 14px;
  font-weight: 600;
}

.primary-button:hover { background: var(--accent-hover); border-color: var(--accent-hover); }

button:focus-visible, input:focus-visible, a:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--focus) 35%, transparent);
  outline-offset: 2px;
}

.results-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  padding: 56px 0 20px;
}

.section-kicker { margin-bottom: 6px; }

.results-heading h2 {
  margin: 0;
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.025em;
}

.holiday-count { margin: 0 0 4px; color: var(--muted); font-size: 14px; }

.holiday-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.empty-state {
  grid-column: 1 / -1;
  padding: 32px;
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.empty-state h3 { margin: 0; font-size: 17px; }
.empty-state p { margin: 8px auto 18px; color: var(--muted); font-size: 14px; }

.holiday-card {
  min-height: 128px;
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.holiday-card:hover { border-color: #cdd3db; box-shadow: var(--shadow); }

.date-tile {
  width: 68px;
  min-width: 68px;
  height: 76px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--accent-soft);
  border-radius: 10px;
}

.date-month {
  color: var(--accent);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.date-day { font-size: 28px; font-weight: 600; line-height: 1.15; }
.holiday-details { min-width: 0; }

.holiday-name {
  margin: 0 0 5px;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.3;
}

.holiday-date, .observed-date { margin: 0; color: var(--muted); font-size: 14px; }
.observed-date { margin-top: 4px; color: var(--accent); font-size: 12px; font-weight: 600; }

.note {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-top: 40px;
  padding: 20px;
  color: var(--muted);
  background: var(--surface-subtle);
  border-radius: var(--radius);
}

.note svg { min-width: 20px; margin-top: 2px; color: var(--accent); }
.note p { margin: 0; font-size: 14px; }
.note strong { color: var(--text); font-weight: 600; }

footer {
  margin-top: 48px;
  padding: 24px 0 40px;
  color: var(--muted);
  border-top: 1px solid var(--border);
  font-size: 12px;
}

footer p { margin: 0; }

.share-dialog {
  width: min(460px, calc(100% - 32px));
  padding: 0;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-large);
  box-shadow: 0 16px 48px rgba(16, 24, 40, 0.18);
}

.share-dialog::backdrop { background: rgba(24, 32, 43, 0.42); }
.dialog-content { padding: 28px; }
.dialog-content .section-kicker { margin-bottom: 8px; }
.dialog-content h2 { margin: 0; font-size: 24px; letter-spacing: -0.025em; }
.dialog-content > p:not(.section-kicker):not(.share-status) { margin: 10px 0 22px; color: var(--muted); font-size: 14px; }

.share-links { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }

.share-link {
  min-height: 44px;
  display: grid;
  place-items: center;
  padding: 0 8px;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-small);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}

.share-link:hover { color: var(--accent); background: var(--accent-soft); border-color: var(--accent-soft); }

.copy-row { display: flex; gap: 8px; margin-top: 16px; }
.copy-row input {
  min-width: 0;
  flex: 1;
  height: 44px;
  padding: 0 10px;
  color: var(--muted);
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: var(--radius-small);
  font-size: 13px;
}

.share-status { min-height: 20px; margin: 8px 0 0; color: var(--accent); font-size: 12px; font-weight: 600; }

.dialog-close {
  min-height: 40px;
  margin-top: 12px;
  padding: 0 4px;
  color: var(--muted);
  background: transparent;
  border: 0;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
}

.dialog-close:hover { color: var(--text); }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 720px) {
  .page-shell { width: min(100% - 32px, 1120px); }
  .site-header { min-height: 72px; }
  .hero { padding: 48px 0 28px; }
  h1 { font-size: clamp(36px, 11vw, 48px); }
  .intro { font-size: 16px; }
  .year-panel { flex-wrap: wrap; padding: 14px; }
  .year-field, .country-field { order: -1; flex-basis: calc(50% - 5px); }
  .icon-button { flex: 1; }
  .primary-button { flex: 2; }
  .holiday-grid { grid-template-columns: 1fr; }
  .results-heading { padding-top: 44px; }
}

@media (max-width: 420px) {
  .holiday-card { gap: 14px; padding: 16px; }
  .date-tile { width: 60px; min-width: 60px; }
  .primary-button span { display: none; }
}

@media (max-width: 380px) {
  .header-actions { gap: 10px; }
  .dialog-content { padding: 22px; }
  .share-links { grid-template-columns: 1fr; }
  .copy-row { flex-direction: column; }
}

@media print {
  :root { --background: #ffffff; }
  .page-shell { width: 100%; }
  .site-header, .year-panel, .note, footer { display: none; }
  .hero { padding: 0 0 24px; }
  .hero h1 { font-size: 32px; }
  .intro { display: none; }
  .results-heading { padding: 0 0 16px; }
  .holiday-grid { gap: 8px; }
  .holiday-card { min-height: 105px; break-inside: avoid; box-shadow: none; }
}
