:root {
  color-scheme: light;
  --bg: #f6f7fb;
  --surface: #ffffff;
  --surface-2: #eef2f8;
  --text: #1b2430;
  --muted: #657185;
  --line: #dbe2ec;
  --primary: #2563eb;
  --primary-2: #e8f0ff;
  --accent: #0f9f86;
  --warning: #f59e0b;
  --danger: #dc2626;
  --shadow: 0 16px 45px rgba(31, 41, 55, 0.08);
  --radius: 8px;
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #111827;
  --surface: #192231;
  --surface-2: #222d3f;
  --text: #f7fafc;
  --muted: #a8b3c5;
  --line: #334155;
  --primary: #60a5fa;
  --primary-2: #1f3558;
  --accent: #34d399;
  --warning: #fbbf24;
  --danger: #f87171;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.24);
}

* {
  box-sizing: border-box;
}

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

button,
input,
textarea,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  min-height: 100vh;
  padding: 22px 24px 92px;
}

.app-shell.board-mode {
  padding: 8px 8px 20px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 0 auto 18px;
  max-width: 1380px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: var(--radius);
  background: var(--primary);
  color: #fff;
  padding: 0;
}

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

.brand h1 {
  margin: 0;
  font-size: 22px;
}

.brand p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.icon-button,
.nav-button,
.primary-button,
.ghost-button,
.danger-button {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
}

.icon-button {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  font-size: 20px;
}

.primary-button {
  padding: 10px 14px;
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
  font-weight: 700;
}

.ghost-button,
.danger-button {
  padding: 9px 12px;
}

.danger-button {
  color: var(--danger);
}

.view {
  max-width: 1380px;
  margin: 0 auto;
}

.view.board-view {
  max-width: 100%;
}

.hero-grid,
.tool-grid,
.settings-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 16px;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
  min-width: 0;
}

.hero-grid .panel {
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    border-color 180ms ease;
}

.hero-grid .panel:hover {
  transform: translateY(-6px) scale(1.01);
  border-color: color-mix(in srgb, var(--primary) 28%, var(--line));
  box-shadow:
    0 20px 34px rgba(15, 23, 42, 0.12),
    0 36px 80px rgba(15, 23, 42, 0.18);
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.panel-header h2,
.panel-header h3 {
  margin: 0;
  font-size: 18px;
}

.panel-header span,
.muted {
  color: var(--muted);
}

.span-3 { grid-column: span 3; }
.span-4 { grid-column: span 4; }
.span-5 { grid-column: span 5; }
.span-6 { grid-column: span 6; }
.span-7 { grid-column: span 7; }
.span-8 { grid-column: span 8; }
.span-12 { grid-column: span 12; }

.today-card {
  display: flex;
  min-height: 210px;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
  background: var(--surface);
}

.mini-calendar {
  height: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-2);
  padding: 12px;
}

.mini-calendar-title {
  margin-bottom: 10px;
  font-size: 15px;
  font-weight: 900;
}

.mini-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.mini-calendar-weekdays {
  margin-bottom: 6px;
}

.mini-weekday {
  text-align: center;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.mini-weekday.is-sunday {
  color: #dc2626;
}

.mini-weekday.is-saturday {
  color: #2563eb;
}

.mini-day {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 24px;
  border-radius: 999px;
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
}

.mini-day.is-muted {
  opacity: 0.42;
}

.mini-day.is-sunday {
  color: #dc2626;
}

.mini-day.is-saturday {
  color: #2563eb;
}

.mini-day.is-today {
  background: var(--primary);
  color: #fff;
}

.mini-day-dot {
  position: absolute;
  bottom: 2px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: currentColor;
}

.mini-day.is-today .mini-day-dot {
  background: #fff;
}

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

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

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

.meal-box {
  min-height: 190px;
  border-radius: var(--radius);
  background: var(--surface-2);
  padding: 12px;
  overflow: auto;
}

.meal-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
  color: var(--primary);
}

.meal-title span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.meal-body {
  font-size: 13px;
  line-height: 1.55;
  word-break: keep-all;
}

.meal-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-radius: var(--radius);
  background: var(--surface-2);
  padding: 8px 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.meal-nav .ghost-button {
  min-width: 38px;
  padding: 6px 0;
}

.mini-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius);
  background: var(--surface-2);
}

.tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--primary-2);
  color: var(--primary);
  font-size: 13px;
  font-weight: 800;
}

.calendar-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.calendar-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(92px, 1fr));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.weekday-cell,
.day-cell {
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.weekday-cell:nth-child(7n),
.day-cell:nth-child(7n) {
  border-right: 0;
}

.weekday-cell {
  padding: 10px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  text-align: center;
}

.weekday-cell.is-saturday {
  color: #2563eb;
}

.weekday-cell.is-sunday {
  color: #dc2626;
}

.day-cell {
  min-height: 118px;
  padding: 8px;
  background: var(--surface);
}

.day-cell.is-muted {
  opacity: 0.42;
}

.day-cell.is-today {
  outline: 2px solid var(--primary);
  outline-offset: -2px;
}

.day-number {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 7px;
  font-weight: 800;
}

.day-number-button {
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--text);
  width: 32px;
  height: 32px;
  font-weight: 900;
}

.day-number-button:hover,
.day-number-button:focus {
  outline: 0;
  background: var(--primary-2);
  color: var(--primary);
}

.day-cell.is-saturday .day-number-button {
  color: #2563eb;
}

.day-cell.is-sunday .day-number-button {
  color: #dc2626;
}

.event-pill {
  display: block;
  width: 100%;
  margin-top: 5px;
  padding: 6px 7px;
  border: 0;
  border-radius: 6px;
  border-left: 5px solid var(--event-color, var(--primary));
  background: color-mix(in srgb, var(--event-color, var(--primary)) 14%, var(--surface));
  color: var(--text);
  text-align: left;
  font-size: 13px;
}

.color-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.color-choice {
  display: inline-grid;
  place-items: center;
}

.color-choice input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.color-choice span {
  width: 32px;
  height: 32px;
  border: 2px solid transparent;
  border-radius: 999px;
  background: var(--choice-color);
  box-shadow: inset 0 0 0 3px var(--surface);
}

.color-choice input:checked + span {
  border-color: var(--text);
}

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

.field {
  display: grid;
  gap: 6px;
}

.field.full {
  grid-column: 1 / -1;
}

label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  padding: 10px 11px;
}

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

.notice-board {
  display: grid;
  min-height: calc(100vh - 28px);
  grid-template-rows: 1fr;
  gap: 0;
}

.board-shell {
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 22px;
  height: calc(100vh - 28px);
  border: 0;
  border-radius: 24px;
  background: var(--surface);
  padding: 10px 0 0;
  box-shadow: none;
}

.board-toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 0 10px;
}

.board-toolbar-left {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
}

.board-home-button {
  display: grid;
  place-items: center;
  width: 44px;
  min-width: 44px;
  height: 44px;
  padding: 0;
  color: var(--text);
}

.board-home-button svg {
  width: 21px;
  height: 21px;
  stroke: currentColor;
  stroke-width: 1.8;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.notice-history-dropdown {
  position: relative;
  padding-bottom: 6px;
}

.notice-history-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.notice-history-menu {
  position: absolute;
  top: calc(100% - 2px);
  left: 0;
  z-index: 4;
  display: none;
  width: min(420px, 62vw);
  max-height: 320px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: color-mix(in srgb, var(--surface) 96%, transparent);
  box-shadow: var(--shadow);
  padding: 10px;
  backdrop-filter: blur(16px);
}

.notice-history-dropdown:hover .notice-history-menu,
.notice-history-dropdown:focus-within .notice-history-menu {
  display: grid;
  gap: 8px;
}

.notice-history-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
}

.notice-history-load {
  display: grid;
  gap: 4px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
  padding: 10px 12px;
  text-align: left;
}

.notice-history-load strong {
  font-size: 13px;
}

.notice-history-load span {
  color: var(--muted);
  font-size: 13px;
}

.chalkboard {
  min-height: calc(100vh - 132px);
  border: 12px solid #9a6a36;
  border-radius: 26px;
  background: #9a6a36;
  box-shadow:
    inset 0 0 0 4px rgba(255, 255, 255, 0.18),
    0 12px 28px rgba(31, 41, 55, 0.18);
}

.chalkboard-inner {
  height: 100%;
  min-height: calc(100vh - 156px);
  border: 10px solid #2e5b46;
  border-radius: 16px;
  background:
    radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.05), transparent 32%),
    linear-gradient(135deg, #1f4a39, #143627);
  padding: clamp(24px, 3.4vw, 42px);
  color: rgba(248, 250, 252, 0.88);
}

.chalk-date {
  margin-bottom: 24px;
  font-size: clamp(22px, 2.2vw, 32px);
  font-weight: 900;
  color: rgba(248, 250, 252, 0.9);
}

.chalk-text {
  width: 100%;
  min-height: calc(100vh - 302px);
  border: 0;
  background: transparent;
  color: rgba(248, 250, 252, 0.78);
  font-weight: 900;
  line-height: 1.42;
  padding: 0;
  resize: none;
  outline: 0;
  text-shadow: 0 0 1px rgba(255, 255, 255, 0.25);
}

.chalk-text::placeholder {
  color: rgba(248, 250, 252, 0.66);
}

.slider-row {
  display: flex;
  align-items: flex-start;
  flex-direction: column;
  gap: 12px;
  color: var(--muted);
}

.slider-row input {
  width: min(360px, 45vw);
  padding: 0;
}

.student-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.student-input {
  min-height: 96px;
}

.student-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-2);
}

.student-number-input {
  width: 56px;
  padding: 5px 6px;
  text-align: center;
  font-weight: 900;
}

.student-chip.is-empty {
  border-style: dashed;
  color: var(--muted);
}

.seat-number {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.chip-remove {
  border: 0;
  background: transparent;
  color: var(--danger);
  font-weight: 900;
}

.picker-result {
  display: grid;
  place-items: center;
  min-height: 180px;
  border-radius: var(--radius);
  background: var(--surface-2);
  font-size: clamp(32px, 7vw, 72px);
  font-weight: 900;
}

.picker-overlay {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: rgba(9, 14, 25, 0.58);
  padding: 24px;
}

.picker-card {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 18px;
  width: min(680px, 100%);
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 20px;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.26);
  padding: clamp(28px, 7vw, 72px);
  text-align: center;
  backdrop-filter: blur(18px);
}

.picker-kicker {
  color: var(--primary);
  font-size: clamp(16px, 3vw, 24px);
  font-weight: 900;
}

.picker-big {
  position: relative;
  transform-style: preserve-3d;
  min-height: 1.2em;
  font-size: clamp(54px, 12vw, 140px);
  font-weight: 950;
  line-height: 1.05;
  word-break: keep-all;
  animation: none;
}

.picker-overlay.is-done .picker-big {
  color: var(--primary);
  animation: pageFlipReveal 620ms ease-out both;
}

@keyframes pageFlipReveal {
  from {
    opacity: 0.35;
    transform: perspective(900px) rotateX(78deg);
    transform-origin: top center;
  }
  62% {
    opacity: 1;
    transform: perspective(900px) rotateX(-8deg);
    transform-origin: top center;
  }
  to {
    opacity: 1;
    transform: perspective(900px) rotateX(0deg);
    transform-origin: top center;
  }
}

.seat-grid {
  display: grid;
  grid-template-columns: repeat(var(--seat-cols), minmax(70px, 1fr));
  gap: 10px;
}

.seat {
  display: grid;
  place-items: center;
  min-height: 74px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
  font-weight: 800;
  text-align: center;
}

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

.thai-text {
  font-size: 34px;
  font-weight: 900;
  line-height: 1.2;
}

.thai-feature {
  min-height: 360px;
  align-content: center;
}

.thai-feature .thai-text {
  font-size: clamp(42px, 7vw, 84px);
}

.pronunciation {
  color: var(--primary);
  font-size: 20px;
  font-weight: 800;
}

.timetable {
  display: grid;
  grid-template-columns: 74px repeat(5, minmax(110px, 1fr));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.ocr-dropzone {
  display: grid;
  place-items: center;
  gap: 8px;
  min-height: 150px;
  border: 2px dashed var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
  color: var(--muted);
  padding: 18px;
  text-align: center;
}

.ocr-dropzone strong {
  color: var(--text);
  font-size: 18px;
}

.ocr-dropzone.is-dragging,
.ocr-dropzone:focus {
  border-color: var(--primary);
  outline: 0;
  background: var(--primary-2);
}

.ocr-dropzone input {
  max-width: 260px;
  padding: 8px;
  background: var(--surface);
}

.review-box {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.review-grid {
  display: grid;
  grid-template-columns: 42px repeat(5, minmax(54px, 1fr));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.review-cell {
  min-height: 42px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  padding: 4px;
}

.review-cell:nth-child(6n) {
  border-right: 0;
}

.review-cell.header {
  display: grid;
  place-items: center;
  background: var(--surface-2);
  color: var(--muted);
  font-weight: 900;
}

.review-cell select {
  height: 34px;
  padding: 4px;
  font-size: 13px;
  text-align: center;
}

.time-cell {
  min-height: 58px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 8px;
  background: var(--surface);
}

.time-cell.header {
  display: grid;
  place-items: center;
  background: var(--surface-2);
  color: var(--muted);
  font-weight: 900;
}

.time-cell input {
  border: 0;
  background: transparent;
  padding: 5px;
  text-align: center;
  font-weight: 700;
}

.search-results {
  display: grid;
  gap: 10px;
}

.search-result-item {
  display: grid;
  gap: 5px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
}

.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: 14px;
  z-index: 10;
  display: flex;
  align-items: stretch;
  width: min(860px, calc(100% - 24px));
  gap: 6px;
  transform: translateX(-50%);
  border: 1px solid var(--line);
  border-radius: 16px;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  box-shadow: var(--shadow);
  padding: 8px;
  backdrop-filter: blur(18px);
  transition:
    transform 180ms ease,
    opacity 180ms ease;
}

.bottom-nav-trigger {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9;
  height: 34px;
}

.bottom-nav.auto-hide {
  opacity: 0;
  transform: translateX(-50%) translateY(calc(100% + 6px));
  pointer-events: none;
  transition:
    transform 3000ms ease,
    opacity 3000ms ease;
}

.bottom-nav-trigger:hover + .bottom-nav.auto-hide,
.bottom-nav.auto-hide:hover {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
  transition:
    transform 180ms ease,
    opacity 180ms ease;
}

.nav-button {
  display: grid;
  flex: 1 1 0;
  place-items: center;
  gap: 3px;
  min-height: 56px;
  padding: 6px 4px;
  border: 0;
  background: transparent;
  color: var(--muted);
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    background 180ms ease,
    color 180ms ease;
}

.nav-button.active {
  background: var(--primary-2);
  color: var(--primary);
  box-shadow:
    0 10px 20px rgba(15, 23, 42, 0.08),
    inset 0 0 0 1px rgba(37, 99, 235, 0.08);
}

.nav-button:hover {
  transform: translateY(-4px) scale(1.02);
  background: color-mix(in srgb, var(--primary) 12%, var(--surface));
  color: var(--text);
  box-shadow:
    0 14px 24px rgba(15, 23, 42, 0.12),
    0 24px 42px rgba(15, 23, 42, 0.12);
}

.nav-icon {
  font-size: 20px;
  line-height: 1;
}

.nav-icon svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  stroke-width: 1.8;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav-icon.home-icon {
  color: var(--text);
}

.nav-label {
  font-size: 12px;
  font-weight: 800;
}

.nav-autohide-toggle {
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 4px;
  flex: 0 0 auto;
  min-width: 92px;
  min-height: 56px;
  padding: 4px 6px;
  border-left: 1px solid var(--line);
}

.nav-toggle-label {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
}

.switch {
  position: relative;
  display: inline-flex;
  width: 42px;
  height: 24px;
}

.switch input {
  position: absolute;
  inset: 0;
  opacity: 0;
}

.switch-slider {
  width: 100%;
  border-radius: 999px;
  background: var(--line);
  transition: background 160ms ease;
}

.switch-slider::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.22);
  transition: transform 160ms ease;
}

.switch input:checked + .switch-slider {
  background: var(--primary);
}

.switch input:checked + .switch-slider::after {
  transform: translateX(18px);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  background: rgba(15, 23, 42, 0.56);
  padding: 18px;
}

.modal {
  width: min(560px, 100%);
  max-height: calc(100vh - 36px);
  overflow: auto;
  border-radius: var(--radius);
  background: var(--surface);
  padding: 18px;
  box-shadow: 0 24px 90px rgba(0, 0, 0, 0.28);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 14px;
}

.status {
  padding: 10px 12px;
  border-radius: var(--radius);
  background: var(--surface-2);
  color: var(--muted);
}

@media (max-width: 1050px) {
  .span-3,
  .span-4,
  .span-5,
  .span-6,
  .span-7,
  .span-8 {
    grid-column: span 6;
  }

  .calendar-grid {
    grid-template-columns: repeat(7, minmax(64px, 1fr));
  }
}

@media (max-width: 720px) {
  .app-shell {
    padding: 14px 12px 92px;
  }

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

  .brand h1 {
    font-size: 18px;
  }

  .brand p {
    font-size: 12px;
  }

  .span-3,
  .span-4,
  .span-5,
  .span-6,
  .span-7,
  .span-8,
  .span-12 {
    grid-column: 1 / -1;
  }

  .hero-grid,
  .tool-grid,
  .settings-grid {
    grid-template-columns: 1fr;
  }

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

  .meal-split {
    grid-template-columns: 1fr;
  }

  .calendar-grid {
    display: block;
    border: 0;
  }

  .weekday-cell {
    display: none;
  }

  .day-cell {
    min-height: 96px;
    margin-bottom: 8px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
  }

  .timetable {
    grid-template-columns: 56px repeat(5, minmax(86px, 1fr));
    overflow-x: auto;
  }

  .time-cell {
    min-width: 86px;
  }

  .bottom-nav {
    bottom: 8px;
    width: calc(100% - 12px);
    gap: 2px;
    padding: 6px;
    overflow-x: auto;
  }

  .bottom-nav-trigger {
    height: 46px;
  }

  .nav-button {
    min-height: 52px;
  }

  .nav-label {
    font-size: 10px;
  }

}
