:root {
  color-scheme: light dark;
  --bg: #edf6f5;
  --text: #102027;
  --muted: #5d6f74;
  --glass: rgba(255, 255, 255, 0.54);
  --glass-border: rgba(255, 255, 255, 0.62);
  --accent: #e9b44c;
  --accent-2: #2b8c7f;
  --shadow: 0 24px 70px rgba(7, 34, 39, 0.22);
}

body.dark {
  --bg: #071214;
  --text: #f3fbfa;
  --muted: #bdd0d1;
  --glass: rgba(8, 24, 28, 0.58);
  --glass-border: rgba(255, 255, 255, 0.16);
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.42);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  min-height: 100vh;
  margin: 0;
  font-family: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--text);
  background: var(--bg) url("../assets/alps-background.png") center / cover fixed no-repeat;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  content: "";
  background: linear-gradient(110deg, rgba(237, 246, 245, 0.78), rgba(237, 246, 245, 0.24));
}

body.dark::before {
  background: linear-gradient(110deg, rgba(4, 14, 17, 0.84), rgba(4, 14, 17, 0.42));
}

button,
input,
select {
  font: inherit;
}

.app-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 42px;
}

.topbar,
.section-title,
.topbar-actions,
.settings-actions,
.progress-copy {
  display: flex;
  align-items: center;
}

.topbar,
.section-title,
.progress-copy {
  justify-content: space-between;
  gap: 18px;
}

.topbar {
  margin-bottom: 22px;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(2.3rem, 7vw, 5.8rem);
  line-height: 0.92;
}

h2 {
  margin-bottom: 14px;
  font-size: 1.12rem;
}

.topbar-actions {
  gap: 10px;
}

.icon-button {
  display: inline-grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  color: var(--text);
  background: var(--glass);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.12);
  cursor: pointer;
  backdrop-filter: blur(18px);
}

.glass {
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  background: var(--glass);
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px) saturate(145%);
}

.hero-panel {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  padding: clamp(18px, 3vw, 34px);
}

.metric {
  min-width: 0;
}

.metric-label,
.info-card span,
.countdown-grid span {
  display: block;
  color: var(--muted);
  font-weight: 700;
}

.giant strong {
  display: block;
  margin-top: 8px;
  font-size: clamp(3.4rem, 13vw, 9.4rem);
  line-height: 0.88;
  letter-spacing: 0;
}

.accent strong {
  color: var(--accent);
}

.progress-area {
  grid-column: 1 / -1;
}

.progress-copy strong {
  font-size: 1.4rem;
}

.progress-track {
  height: 18px;
  margin-top: 10px;
  overflow: hidden;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.36);
}

.progress-fill {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent-2), var(--accent));
  transition: width 900ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.countdown,
.year-panel,
.dashboard-grid,
.feature-grid,
.calendar-panel,
.bridge-panel,
.export-panel {
  margin-top: 18px;
}

.countdown {
  padding: 22px;
}

.countdown-grid,
.dashboard-grid {
  display: grid;
  gap: 14px;
}

.countdown-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.countdown-grid div,
.info-card {
  min-width: 0;
}

.countdown-grid strong {
  display: block;
  font-size: clamp(2rem, 6vw, 4rem);
}

.motivation {
  margin: 18px 0 0;
  color: var(--muted);
  font-weight: 650;
}

.dashboard-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.info-card,
.feature-panel,
.calendar-panel,
.bridge-panel,
.export-panel {
  padding: 18px;
}

.info-card strong {
  display: block;
  margin-top: 8px;
  font-size: 1.38rem;
  line-height: 1.18;
}

.info-card small,
.mini-tile small,
.export-panel p,
.calendar-legend {
  color: var(--muted);
}

.today-card {
  border-color: rgba(233, 180, 76, 0.58);
}

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

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

.mini-tile {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.22);
}

body.dark .mini-tile {
  background: rgba(0, 0, 0, 0.16);
}

.mini-tile span,
.mini-tile small {
  display: block;
}

.mini-tile span {
  color: var(--muted);
  font-weight: 700;
}

.mini-tile strong {
  display: block;
  margin: 8px 0 4px;
  font-size: 1.28rem;
}

.calendar-actions,
.calendar-legend,
.export-actions {
  display: flex;
  align-items: center;
}

.calendar-actions,
.export-actions {
  gap: 10px;
}

.compact {
  width: 34px;
  height: 34px;
}

.calendar-legend {
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 14px;
  font-weight: 700;
}

.calendar-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.dot.workday,
.calendar-day.workday {
  --day-color: rgba(43, 140, 127, 0.18);
}

.dot.weekend,
.calendar-day.weekend {
  --day-color: rgba(93, 111, 116, 0.18);
}

.dot.holiday,
.calendar-day.holiday {
  --day-color: rgba(233, 180, 76, 0.36);
}

.dot.vacation,
.calendar-day.vacation {
  --day-color: rgba(86, 139, 202, 0.32);
}

.dot.sick,
.calendar-day.sick {
  --day-color: rgba(172, 81, 118, 0.32);
}

.dot.special,
.calendar-day.special {
  --day-color: rgba(205, 102, 86, 0.34);
}

.dot {
  background: var(--day-color);
}

.month-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
}

.calendar-head {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 800;
  text-align: center;
}

.calendar-day {
  min-height: 72px;
  padding: 8px;
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  background: var(--day-color, rgba(255, 255, 255, 0.22));
  cursor: context-menu;
  overflow: hidden;
}

.calendar-day:hover {
  border-color: rgba(233, 180, 76, 0.72);
}

.calendar-day strong,
.calendar-day span {
  display: block;
}

.calendar-day span {
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.calendar-day.current {
  outline: 2px solid var(--accent);
}

.calendar-day.blank,
.calendar-day.retired {
  opacity: 0.35;
}

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

.day-dialog {
  width: min(440px, calc(100% - 28px));
  border: 1px solid var(--glass-border);
  color: var(--text);
  padding: 0;
}

.day-dialog::backdrop {
  background: rgba(0, 0, 0, 0.42);
}

.export-panel {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
}

.export-panel h2,
.export-panel p {
  margin-bottom: 0;
}

.year-panel {
  padding: 22px;
}

.year-list {
  display: grid;
  gap: 10px;
}

.year-row {
  display: grid;
  grid-template-columns: 74px 1fr 92px;
  gap: 12px;
  align-items: center;
}

.year-bar {
  height: 12px;
  overflow: hidden;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.34);
}

.year-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent-2), var(--accent));
}

.settings-dialog {
  width: min(520px, calc(100% - 28px));
  max-height: min(92vh, 820px);
  border: 1px solid var(--glass-border);
  color: var(--text);
  padding: 0;
  overflow: auto;
}

.settings-dialog::backdrop {
  background: rgba(0, 0, 0, 0.42);
}

.settings-form {
  display: grid;
  gap: 14px;
  padding: 22px;
}

.settings-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-weight: 700;
}

.settings-form fieldset {
  margin: 0;
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  padding: 12px;
}

.settings-form legend {
  color: var(--muted);
  font-weight: 800;
}

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

.checkbox-grid label {
  display: flex;
  grid-template-columns: none;
  align-items: center;
  gap: 8px;
  font-weight: 650;
}

.checkbox-grid input {
  width: auto;
}

.settings-form input,
.settings-form select {
  width: 100%;
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.56);
  padding: 10px 12px;
}

body.dark .settings-form input,
body.dark .settings-form select {
  background: rgba(0, 0, 0, 0.22);
}

.settings-actions {
  justify-content: flex-end;
  gap: 10px;
  padding: 0;
  margin: 8px 0 0;
}

.primary,
.secondary {
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  padding: 10px 14px;
  color: var(--text);
  cursor: pointer;
}

.primary {
  background: var(--accent);
}

.secondary {
  background: var(--glass);
}

@media (max-width: 820px) {
  .hero-panel,
  .dashboard-grid,
  .feature-grid,
  .bridge-list {
    grid-template-columns: 1fr;
  }

  .year-row {
    grid-template-columns: 56px 1fr;
  }

  .year-row strong:last-child {
    grid-column: 2;
  }
}

@media (max-width: 560px) {
  .app-shell {
    width: min(100% - 20px, 1180px);
    padding-top: 16px;
  }

  .countdown-grid {
    grid-template-columns: 1fr;
  }

  .topbar {
    align-items: flex-start;
  }

  .tile-list,
  .export-panel {
    grid-template-columns: 1fr;
  }

  .tile-list {
    display: grid;
  }

  .export-panel,
  .section-title {
    align-items: flex-start;
    flex-direction: column;
  }

  .calendar-day {
    min-height: 56px;
    padding: 6px;
  }

  .calendar-day span {
    font-size: 0.68rem;
  }

  .checkbox-grid {
    grid-template-columns: 1fr;
  }
}
