:root {
  --red: #d52b1e;
  --green: #0c7c59;
  --amber: #e5a62a;
  --blue: #4d6fae;
  --other-holiday: #7a4bb3;
  --ink: #17211b;
  --muted: #5e6962;
  --bg: #f6f7f4;
  --soft-red: #ffe9e5;
  --soft-green: #e4f4ec;
  --soft-amber: #fff2d6;
  --soft-blue: #e8eef8;
  --soft-other-holiday: #f0e8fb;
  --line: #e5ebe7;
  --card: #ffffff;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input {
  font: inherit;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 18px 10px;
  background: color-mix(in srgb, var(--bg) 92%, white);
  backdrop-filter: blur(10px);
}

.brand-title {
  margin: 0;
  font-size: clamp(28px, 7vw, 44px);
  line-height: 1;
  font-weight: 900;
  letter-spacing: -0.04em;
}

.noscript-notice,
.seo-home-content,
.site-footer {
  width: min(980px, calc(100% - 32px));
  margin-inline: auto;
}

.noscript-notice {
  border-radius: 16px;
  background: var(--soft-amber);
  padding: 14px 16px;
  color: #704500;
}

.seo-home-content {
  margin-top: 24px;
  padding: 28px clamp(18px, 4vw, 36px);
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--card);
}

.seo-home-content h1 {
  margin: 0;
  font-size: clamp(30px, 6vw, 46px);
  letter-spacing: -0.04em;
}

.seo-home-content h2 {
  margin: 0 0 10px;
  font-size: clamp(21px, 4vw, 27px);
  letter-spacing: -0.025em;
}

.seo-home-content h3 {
  margin: 0 0 7px;
  font-size: 18px;
}

.seo-home-content p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.seo-home-content a,
.site-footer a {
  color: #a82117;
  font-weight: 750;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.seo-lead {
  max-width: 760px;
  margin-top: 12px !important;
  font-size: 18px;
}

.seo-home-grid {
  display: grid;
  gap: 26px;
  margin-top: 30px;
}

.seo-home-grid article {
  min-width: 0;
}

.seo-link-section,
.seo-faq {
  margin-top: 34px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
}

.seo-link-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.seo-link-list a {
  border-radius: 999px;
  background: var(--soft-red);
  padding: 10px 14px;
  text-decoration: none;
}

.seo-faq {
  display: grid;
  gap: 16px;
}

.seo-faq h2 {
  margin-bottom: 0;
}

.seo-faq article {
  border-radius: 18px;
  background: var(--bg);
  padding: 17px;
}

.site-footer {
  margin-top: 18px;
  padding: 22px 14px 116px;
  color: var(--muted);
  font-size: 14px;
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
}

.site-footer p {
  margin: 16px 0 0;
}

.topbar p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: clamp(15px, 4vw, 20px);
}

.location-chip {
  border: 0;
  border-radius: 24px;
  background: var(--soft-red);
  color: var(--ink);
  padding: 12px 14px;
  font-weight: 800;
  max-width: 42vw;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
  min-width: 0;
}

.language-select {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--card);
  color: var(--ink);
  padding: 9px 7px;
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
}

@media (max-width: 430px) {
  .topbar-actions {
    gap: 5px;
  }

  .language-select {
    padding: 8px 5px;
    font-size: 12px;
  }

  .location-chip {
    max-width: 34vw;
    padding-inline: 10px;
  }
}

.app-shell {
  width: min(980px, 100%);
  margin: 0 auto;
  padding: 8px 16px 108px;
}

.bottom-nav {
  position: fixed;
  z-index: 30;
  left: 0;
  right: 0;
  bottom: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  padding: 10px 18px max(12px, env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, 0.96);
  border-top: 1px solid var(--line);
}

.bottom-nav button {
  display: grid;
  justify-items: center;
  gap: 3px;
  border: 0;
  border-radius: 18px;
  background: transparent;
  color: var(--muted);
  padding: 8px 10px;
  font-weight: 800;
  cursor: pointer;
}

.bottom-nav button.active {
  color: var(--red);
  background: var(--soft-red);
}

.bottom-nav span {
  font-size: 13px;
}

.card,
.loading-card,
.map-panel,
.summary-card,
.holiday-card,
.date-switcher,
.location-card {
  border-radius: 22px;
  background: var(--card);
  box-shadow: 0 1px 0 rgba(23, 33, 27, 0.03);
}

.loading-card {
  display: grid;
  gap: 6px;
  padding: 20px;
  color: var(--muted);
}

.loading-card strong {
  color: var(--ink);
}

.page-title {
  display: flex;
  align-items: flex-end;
  gap: 9px;
  margin: 0 0 8px;
}

.page-title h2 {
  margin: 0;
  font-size: 28px;
  letter-spacing: -0.03em;
}

.page-title span {
  color: var(--muted);
  font-weight: 700;
  padding-bottom: 3px;
}

.stack {
  display: grid;
  gap: 10px;
}

.location-card {
  display: grid;
  grid-template-columns: 40px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 12px;
}

.pin {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--soft-red);
  color: var(--red);
}

.eyebrow {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.location-name {
  font-size: 18px;
  font-weight: 900;
}

.link-button,
.text-button,
.secondary-button {
  border: 0;
  background: transparent;
  color: var(--red);
  font-weight: 900;
  cursor: pointer;
}

.secondary-button {
  border-radius: 14px;
  background: var(--soft-red);
  padding: 9px 12px;
}

.date-switcher {
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  align-items: center;
  padding: 8px;
}

.arrow-button,
.icon-button,
.map-button {
  border: 0;
  border-radius: 14px;
  background: #fff;
  color: var(--ink);
  min-width: 42px;
  min-height: 42px;
  font-size: 24px;
  font-weight: 900;
  cursor: pointer;
}

.date-center {
  display: grid;
  gap: 3px;
  justify-items: center;
  text-align: center;
}

.date-center strong {
  font-size: 16px;
}

.date-center small {
  color: var(--muted);
  font-size: 12px;
}

.date-actions {
  display: flex;
  gap: 14px;
  align-items: center;
  justify-content: center;
}

.hidden-date-input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.legend {
  display: flex;
  align-items: center;
  gap: 15px;
  color: var(--muted);
  font-weight: 700;
}

.dot {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  margin-right: 5px;
  vertical-align: -1px;
}

.dot.holiday {
  background: var(--green);
}

.dot.partial {
  background: var(--amber);
}

.dot.none {
  background: #d5dbd7;
}

.green {
  background: var(--green);
}

.amber {
  background: var(--amber);
}

.gray {
  background: #d5dbd7;
}

.blue {
  background: var(--blue);
}

.violet {
  background: var(--other-holiday);
}

.stripe {
  background: repeating-linear-gradient(135deg, rgba(77, 111, 174, 0.2) 0 4px, rgba(77, 111, 174, 0.72) 4px 7px);
  border: 1px solid rgba(77, 111, 174, 0.32);
}

.map-panel {
  position: relative;
  overflow: hidden;
  background: #dceef7;
  border: 8px solid #fff;
}

#map-canvas {
  display: block;
  width: 100%;
  height: clamp(280px, 58vw, 520px);
  touch-action: none;
  cursor: grab;
}

#map-canvas:active {
  cursor: grabbing;
}

.map-tools {
  position: absolute;
  z-index: 3;
  top: 10px;
  right: 10px;
  display: grid;
  gap: 8px;
}

.map-home-button {
  font-size: 14px;
  letter-spacing: -0.03em;
}

.map-selection-info {
  position: relative;
  z-index: 2;
  width: max-content;
  max-width: calc(100% - 118px);
  display: grid;
  gap: 6px;
  margin: 10px 98px 6px 10px;
  padding: 9px 10px;
  border: 1px solid rgba(23, 33, 27, 0.08);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 3px 14px rgba(23, 33, 27, 0.1);
  pointer-events: none;
}

.map-selection-title {
  display: flex;
  align-items: baseline;
  gap: 7px;
  min-width: 0;
}

.map-selection-title strong,
.map-selection-title small,
.map-status-pill {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.map-selection-title strong {
  font-size: 14px;
}

.map-selection-title small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.map-selection-statuses {
  display: grid;
  gap: 3px;
}

.map-status-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.map-status-pill i {
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #c5cdc8;
}

.map-status-pill.holiday {
  color: var(--green);
}

.map-status-pill.holiday i {
  background: var(--green);
}

.map-status-pill.partial {
  color: #9b6100;
}

.map-status-pill.partial i {
  background: var(--amber);
}

.map-status-pill.school {
  color: var(--blue);
}

.map-status-pill.school i {
  background: var(--blue);
}

.map-status-pill.school.inactive {
  color: var(--muted);
}

.map-status-pill.school.inactive i {
  background: #c5cdc8;
}

.map-credit {
  position: absolute;
  right: 10px;
  bottom: 8px;
  color: rgba(94, 105, 98, 0.8);
  font-weight: 800;
  pointer-events: none;
}

.place-head {
  margin-top: 2px;
}

.place-head h3,
.section-title {
  margin: 0;
  font-size: 22px;
  font-weight: 950;
  letter-spacing: -0.02em;
}

.place-head p {
  margin: 2px 0 0;
  color: var(--muted);
}

.summary-card {
  padding: 16px;
}

.summary-card.holiday {
  background: var(--soft-green);
}

.summary-card.partial {
  background: var(--soft-amber);
}

.summary-card.school {
  background: var(--soft-blue);
}

.summary-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-weight: 800;
}

.summary-card h3 {
  margin: 10px 0 6px;
  color: var(--muted);
  font-size: 24px;
  line-height: 1.1;
}

.summary-card.holiday h3 {
  color: var(--green);
}

.summary-card.partial h3 {
  color: #9b6100;
}

.summary-card.school h3 {
  color: var(--blue);
}

.summary-card ul {
  margin: 8px 0 0;
  padding-left: 20px;
  font-weight: 750;
}

.section-title {
  margin-top: 10px;
}

.holiday-card,
.canton-row {
  padding: 14px;
}

.holiday-card {
  display: grid;
  grid-template-columns: 58px 1fr;
  gap: 13px;
}

.date-badge {
  display: grid;
  place-items: center;
  align-self: start;
  border-radius: 15px;
  min-height: 70px;
  background: var(--soft-red);
  color: var(--red);
  font-weight: 900;
}

.date-badge .day {
  font-size: 25px;
  line-height: 1;
}

.date-badge .month {
  font-size: 13px;
}

.date-badge.status-holiday {
  background: var(--soft-green);
  color: var(--green);
}

.date-badge.status-partial {
  background: var(--soft-amber);
  color: var(--amber);
}

.date-badge.status-none {
  background: var(--soft-blue);
  color: var(--blue);
}

.date-badge.status-school {
  background: var(--soft-blue);
  color: var(--blue);
}

.school-card {
  border: 1px solid rgba(77, 111, 174, 0.18);
}

.holiday-card h3 {
  margin: 0 0 5px;
  font-size: 20px;
}

.status-text {
  font-size: 13px;
  font-weight: 900;
}

.status-text.status-holiday {
  color: var(--green);
}

.status-text.status-partial {
  color: var(--amber);
}

.status-text.status-none {
  color: var(--blue);
}

.status-text.status-school {
  color: var(--blue);
}

.source-note {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.muted {
  color: var(--muted);
}

.holiday-actions {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  margin-top: 8px;
}

.history-title {
  margin-top: 8px;
  font-weight: 900;
}

.canton-row {
  border-radius: 17px;
  background: #fff;
}

.canton-main {
  display: grid;
  grid-template-columns: 16px 1fr auto;
  gap: 11px;
  align-items: center;
}

.canton-row h3 {
  margin: 0;
  font-size: 18px;
}

.canton-row p {
  margin: 3px 0 0;
  color: var(--muted);
}

.municipality-list {
  margin-top: 10px;
  border-top: 1px solid var(--line);
  padding-top: 8px;
  max-height: 260px;
  overflow: auto;
}

.municipality-item {
  display: grid;
  grid-template-columns: 14px 1fr;
  gap: 8px;
  padding: 7px 3px;
  border-radius: 10px;
  cursor: pointer;
}

.calendar-head {
  display: grid;
  gap: 10px;
}

.year-switcher {
  display: grid;
  grid-template-columns: 48px 1fr 48px;
  align-items: center;
  border-radius: 20px;
  background: #fff;
  padding: 8px;
}

.year-switcher strong {
  text-align: center;
  font-size: 30px;
}

.month-title {
  margin: 22px 0 8px;
  color: var(--red);
  font-size: 25px;
  font-weight: 950;
}

.info-grid {
  display: grid;
  gap: 12px;
}

.info-grid .card {
  padding: 16px;
}

.info-grid h3 {
  margin: 0 0 6px;
}

.info-grid p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.info-sources p {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
}

.info-sources a {
  color: var(--red);
  font-weight: 850;
}

.feedback-card {
  padding: 18px;
}

.feedback-card h2 {
  margin: 0 0 6px;
  font-size: 23px;
}

.feedback-card > p {
  margin: 0 0 16px;
  line-height: 1.45;
}

.feedback-form,
.feedback-form label {
  display: grid;
  gap: 7px;
}

.feedback-form {
  gap: 13px;
}

.feedback-form label {
  color: var(--ink);
  font-size: 13px;
  font-weight: 850;
}

.feedback-fields {
  display: grid;
  gap: 12px;
}

.feedback-form input,
.feedback-form select,
.feedback-form textarea {
  width: 100%;
  border: 1px solid #cfd8d2;
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  padding: 11px 12px;
  font: inherit;
}

.feedback-form textarea {
  min-height: 120px;
  resize: vertical;
}

.feedback-form input:focus,
.feedback-form select:focus,
.feedback-form textarea:focus {
  outline: 3px solid rgba(213, 43, 30, 0.14);
  border-color: var(--red);
}

.feedback-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.feedback-footer small {
  color: var(--muted);
}

.feedback-submit {
  flex: 0 0 auto;
  border: 0;
  border-radius: 13px;
  background: var(--red);
  color: #fff;
  padding: 11px 15px;
  font-weight: 900;
  cursor: pointer;
}

.feedback-submit:disabled {
  opacity: 0.55;
  cursor: wait;
}

.feedback-status {
  min-height: 20px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.feedback-status.success {
  color: var(--green);
}

.feedback-status.error-text {
  color: var(--red);
}

.feedback-honeypot {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.modal {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  place-items: end center;
  padding: 18px;
  background: rgba(0, 0, 0, 0.38);
}

.modal[hidden] {
  display: none;
}

.modal-card {
  width: min(720px, 100%);
  max-height: min(820px, 88vh);
  overflow: hidden;
  display: grid;
  grid-template-rows: auto auto auto 1fr;
  gap: 12px;
  border-radius: 28px;
  background: #fff;
  padding: 18px;
}

.modal-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
}

.modal-head h2 {
  margin: 0;
}

.modal-head p {
  margin: 3px 0 0;
  color: var(--muted);
}

.search-input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 17px;
  padding: 13px 14px;
  outline: none;
}

.modal-actions {
  display: flex;
  justify-content: flex-start;
}

.location-results {
  overflow: auto;
  display: grid;
  gap: 4px;
  padding-right: 4px;
}

.location-result {
  display: grid;
  grid-template-columns: 24px 1fr auto;
  gap: 10px;
  align-items: center;
  border: 0;
  border-radius: 14px;
  background: transparent;
  padding: 11px 8px;
  text-align: left;
  cursor: pointer;
}

.location-result:hover {
  background: var(--bg);
}

.date-modal-card {
  grid-template-rows: auto;
  max-width: 520px;
}

#date-picker-content {
  display: grid;
  gap: 14px;
}

.date-picker-head {
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  gap: 8px;
  align-items: center;
  text-align: center;
}

.date-picker-head h2 {
  margin: 0;
  font-size: 26px;
  letter-spacing: -0.03em;
}

.date-picker-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.date-picker-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 11px;
  justify-content: center;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.date-picker-weekdays,
.date-picker-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 7px;
}

.date-picker-weekdays {
  color: var(--muted);
  font-weight: 900;
  text-align: center;
}

.date-picker-day,
.date-picker-empty {
  min-height: 44px;
}

.date-picker-day {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 2px;
  border: 2px solid transparent;
  border-radius: 14px;
  background: transparent;
  color: var(--ink);
  font-weight: 900;
  cursor: pointer;
}

.date-picker-day small {
  min-height: 10px;
  color: currentColor;
  font-size: 8px;
  line-height: 1;
  font-weight: 900;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.day-dots {
  display: flex;
  gap: 3px;
  min-height: 6px;
}

.date-picker-day i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.date-picker-day i.school-dot {
  background: var(--blue);
}

.date-picker-day.status-holiday {
  background: var(--soft-green);
  color: var(--green);
}

.date-picker-day.status-partial {
  background: var(--soft-amber);
  color: #9b6100;
}

.date-picker-day.status-anywhere {
  background: var(--soft-other-holiday);
  color: var(--other-holiday);
  border-color: rgba(122, 75, 179, 0.22);
}

.date-picker-day.status-school {
  background: var(--soft-blue);
  color: var(--blue);
}

.date-picker-day.status-none.school-anywhere:not(.status-school) {
  color: var(--blue);
  background: repeating-linear-gradient(135deg, rgba(77, 111, 174, 0.06) 0 6px, rgba(77, 111, 174, 0.22) 6px 10px);
}

.date-picker-day.status-holiday.school-selected,
.date-picker-day.status-partial.school-selected,
.date-picker-day.status-anywhere.school-selected,
.date-picker-day.status-holiday.school-anywhere,
.date-picker-day.status-partial.school-anywhere,
.date-picker-day.status-anywhere.school-anywhere {
  box-shadow: inset 0 -6px 0 rgba(77, 111, 174, 0.34);
}

.date-picker-day.status-anywhere.school-anywhere {
  background:
    repeating-linear-gradient(135deg, rgba(77, 111, 174, 0.04) 0 6px, rgba(77, 111, 174, 0.18) 6px 10px),
    var(--soft-other-holiday);
}

.date-picker-day.selected {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(213, 43, 30, 0.12);
}

.date-picker-day.status-holiday.school-selected.selected,
.date-picker-day.status-partial.school-selected.selected,
.date-picker-day.status-anywhere.school-selected.selected,
.date-picker-day.status-holiday.school-anywhere.selected,
.date-picker-day.status-partial.school-anywhere.selected,
.date-picker-day.status-anywhere.school-anywhere.selected {
  box-shadow:
    inset 0 -6px 0 rgba(77, 111, 174, 0.34),
    0 0 0 3px rgba(213, 43, 30, 0.12);
}

.date-picker-day.today:not(.selected) {
  border-color: rgba(213, 43, 30, 0.35);
}

.date-picker-day:disabled,
.arrow-button:disabled {
  opacity: 0.32;
  cursor: not-allowed;
}

.date-picker-actions {
  display: flex;
  justify-content: flex-end;
  gap: 20px;
  padding-top: 4px;
}

.error {
  border-radius: 18px;
  background: var(--soft-red);
  color: #7a160f;
  padding: 14px;
}

@media (min-width: 760px) {
  .topbar {
    padding-left: max(24px, calc((100vw - 980px) / 2));
    padding-right: max(24px, calc((100vw - 980px) / 2));
  }

  .desktop-grid {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 14px;
    align-items: start;
  }

  .seo-home-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .feedback-fields {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .bottom-nav {
    width: min(520px, calc(100% - 40px));
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    border: 1px solid var(--line);
    border-radius: 26px 26px 0 0;
  }
}
