:root {
  color-scheme: light dark;
  --scale: 0.75;
  --bg: #edf1f6;
  --surface: rgba(255, 255, 255, 0.88);
  --surface-strong: rgba(255, 255, 255, 0.96);
  --border: rgba(15, 23, 42, 0.1);
  --text: #102033;
  --muted: #5c6b7d;
  --accent: #d64646;
  --shadow: 0 18px 40px rgba(15, 23, 42, 0.08);
  --sidebar-width: calc(360px * var(--scale));
  --left-column-width: calc(340px * var(--scale));
  --day-width: calc(120px * var(--scale));
  --effective-left-column-width: var(--left-column-width);
  --effective-day-width: var(--day-width);
  --timeline-day-count: 365;
  --header-height: calc(68px * var(--scale));
  --shop-height: calc(64px * var(--scale));
  --lane-height: calc(86px * var(--scale));
  --radius: calc(22px * var(--scale));
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1520;
    --surface: rgba(18, 28, 39, 0.88);
    --surface-strong: rgba(15, 23, 33, 0.96);
    --border: rgba(148, 163, 184, 0.18);
    --text: #edf2f8;
    --muted: #9eb0c2;
    --shadow: 0 18px 40px rgba(0, 0, 0, 0.28);
  }
}

* {
  box-sizing: border-box;
}

.hidden {
  display: none !important;
}

html,
body {
  margin: 0;
  height: 100%;
  background: radial-gradient(circle at top, rgba(214, 70, 70, 0.16), transparent 26%), var(--bg);
  color: var(--text);
}

body {
  min-height: 100vh;
  overflow: hidden;
  font-size: calc(16px * var(--scale));
}

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

button {
  border: 1px solid var(--border);
  background: var(--surface-strong);
  color: var(--text);
  border-radius: calc(12px * var(--scale));
  padding: calc(0.72rem * var(--scale)) calc(1rem * var(--scale));
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

button:hover {
  transform: translateY(-1px);
}

button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

button:disabled:hover {
  transform: none;
}

button.primary {
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 92%, white 8%), color-mix(in srgb, var(--accent) 70%, black 30%));
  color: white;
  border-color: transparent;
}

input,
select,
textarea {
  width: 100%;
  border-radius: calc(12px * var(--scale));
  border: 1px solid var(--border);
  background: var(--surface-strong);
  color: var(--text);
  padding: calc(0.8rem * var(--scale)) calc(0.9rem * var(--scale));
}

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

label {
  display: grid;
  gap: calc(0.42rem * var(--scale));
  font-size: calc(0.92rem * var(--scale));
  color: var(--muted);
}

.app-shell {
  display: grid;
  grid-template-columns: minmax(300px, var(--sidebar-width)) minmax(0, 1fr);
  gap: calc(1.1rem * var(--scale));
  height: 100vh;
  padding: calc(1.2rem * var(--scale));
}

.app-shell.locked {
  visibility: hidden;
}

.splash-gate {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: calc(1.5rem * var(--scale));
  background: radial-gradient(circle at top, rgba(214, 70, 70, 0.2), transparent 28%), #05080d;
  z-index: 1200;
}

.splash-gate.hidden {
  display: none;
}

.splash-card {
  width: min(460px, 100%);
  display: grid;
  gap: calc(1rem * var(--scale));
  padding: calc(1.4rem * var(--scale));
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: calc(28px * var(--scale));
  background: rgba(10, 15, 22, 0.92);
  box-shadow: 0 24px 50px rgba(0, 0, 0, 0.35);
}

.splash-logo {
  width: calc(150px * var(--scale));
  height: calc(150px * var(--scale));
  margin: 0 auto;
  border-radius: calc(28px * var(--scale));
  object-fit: cover;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.3);
}

.splash-copy,
.splash-form {
  display: grid;
  gap: calc(0.45rem * var(--scale));
}

.splash-copy {
  text-align: center;
}

.splash-copy h1,
.splash-copy p {
  margin: 0;
}

.splash-copy h1 {
  color: #ffffff;
  font-size: calc(2rem * var(--scale));
  font-weight: 800;
  letter-spacing: 0.01em;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

.splash-copy p {
  color: #c9d4df;
}

.splash-calendar-picker {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: calc(0.75rem * var(--scale));
}

.splash-calendar-option {
  display: grid;
  gap: calc(0.45rem * var(--scale));
  justify-items: center;
  padding: calc(0.9rem * var(--scale));
  border-radius: calc(18px * var(--scale));
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.08);
  color: #f6fbff;
  text-align: center;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.splash-calendar-option.is-selected {
  border-color: color-mix(in srgb, var(--accent) 70%, white 30%);
  background: color-mix(in srgb, var(--accent) 24%, rgba(255, 255, 255, 0.1) 76%);
}

.splash-calendar-option strong {
  font-size: calc(1.05rem * var(--scale));
  font-weight: 700;
  letter-spacing: 0.01em;
  color: #ffffff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

.splash-calendar-glyph {
  display: grid;
  place-items: center;
  width: calc(52px * var(--scale));
  height: calc(52px * var(--scale));
  border-radius: calc(16px * var(--scale));
  background: rgba(255, 255, 255, 0.12);
  font-weight: 700;
  letter-spacing: 0.04em;
}

.splash-calendar-option small {
  color: #e2ebf3;
  font-size: calc(0.84rem * var(--scale));
  line-height: 1.4;
  text-wrap: balance;
}

.splash-form button {
  margin-top: calc(0.3rem * var(--scale));
}

.sidebar,
.main-pane {
  min-height: 0;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: calc(0.9rem * var(--scale));
  overflow: auto;
  min-width: 0;
  padding-right: 0.1rem;
}

.brand-card,
.sidebar-card,
.toolbar-card,
.schedule-card,
.modal-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.brand-card {
  display: flex;
  align-items: center;
  gap: calc(0.9rem * var(--scale));
  padding: calc(0.95rem * var(--scale)) calc(1rem * var(--scale));
}

.brand-card,
.toolbar-card {
  min-height: calc(98px * var(--scale));
}

.brand-logo {
  width: calc(68px * var(--scale));
  height: calc(68px * var(--scale));
  border-radius: calc(18px * var(--scale));
  object-fit: cover;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
}

.app-switcher-trigger {
  display: grid;
  place-items: center;
  width: calc(52px * var(--scale));
  height: calc(52px * var(--scale));
  padding: 0;
  border-radius: calc(16px * var(--scale));
  overflow: hidden;
}

.app-switcher-logo {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.brand-card h1,
.toolbar-card h2,
.schedule-header h3,
.section-heading h2,
.settings-panel h3,
.modal-header h2 {
  margin: 0;
  font-size: calc(1.55rem * var(--scale));
}

.brand-card p,
.toolbar-card p,
.schedule-header p,
.status-text,
.status-subtext,
.eyebrow {
  margin: 0;
  color: var(--muted);
}

.sidebar-card,
.toolbar-card,
.schedule-card {
  padding: calc(0.95rem * var(--scale)) calc(1rem * var(--scale));
}

.sidebar-card,
.schedule-card,
.settings-panel {
  display: grid;
  gap: calc(0.75rem * var(--scale));
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.action-grid,
.action-row,
.toolbar-actions,
.modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: calc(0.55rem * var(--scale));
}

.toolbar-calendar-select {
  min-width: calc(220px * var(--scale));
}

.toolbar-calendar-select span {
  font-size: calc(0.78rem * var(--scale));
}

.action-grid > * {
  flex: 1 1 46%;
}

.toggle-row {
  display: flex;
  align-items: center;
  gap: calc(0.55rem * var(--scale));
  justify-self: end;
  align-self: end;
  white-space: nowrap;
}

.toggle-row input {
  width: auto;
}

.list-stack {
  display: grid;
  gap: calc(0.6rem * var(--scale));
}

#shopsList {
  gap: calc(1.8rem * var(--scale));
}

.main-pane {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: calc(0.9rem * var(--scale));
  overflow: hidden;
}

.app-shell.shop-fullscreen-mode {
  grid-template-columns: minmax(0, 1fr);
}

.app-shell.shop-fullscreen-mode .sidebar,
.app-shell.shop-fullscreen-mode .toolbar-card {
  display: none;
}

.app-shell.shop-fullscreen-mode .schedule-card {
  height: calc(100vh - (2.4rem * var(--scale)));
}

.app-shell.all-shops-fullscreen-mode .board-scroll {
  overflow: hidden;
}

.toolbar-card,
.schedule-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: calc(0.8rem * var(--scale));
}

.toolbar-card {
  position: relative;
  z-index: 50;
  overflow: visible;
}

.eyebrow {
  text-transform: uppercase;
  font-size: calc(0.76rem * var(--scale));
  letter-spacing: 0.12em;
}

.schedule-title-button {
  padding: 0;
  border: none;
  background: transparent;
  box-shadow: none;
  color: inherit;
  font-size: calc(1.55rem * var(--scale));
  font-weight: 700;
}

.schedule-title-button:hover {
  transform: none;
  text-decoration: underline;
}

.schedule-card {
  min-height: 0;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
}

.schedule-header-actions {
  display: flex;
  align-items: center;
  gap: calc(0.5rem * var(--scale));
}

.schedule-filter {
  display: grid;
  gap: calc(0.2rem * var(--scale));
  min-width: calc(220px * var(--scale));
}

.schedule-filter span {
  font-size: calc(0.76rem * var(--scale));
  color: var(--muted);
}

.board-scroll {
  overflow: auto;
  min-height: 0;
  height: 100%;
  border-radius: calc(18px * var(--scale));
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface-strong) 92%, transparent 8%);
}

.app-shell.all-shops-fullscreen-mode .board-scroll {
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  overflow-x: auto;
  overflow-y: hidden;
}

.toolbar-settings {
  position: relative;
}

.settings-trigger {
  width: calc(112px * var(--scale));
  height: calc(112px * var(--scale));
  padding: 0;
  border-radius: 999px;
  font-size: calc(2.5rem * var(--scale));
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.gear-glyph {
  display: block;
  line-height: 1;
  transform: translateY(-0.02em);
}

.settings-panel {
  position: fixed;
  top: calc(1rem * var(--scale));
  right: calc(1rem * var(--scale));
  width: min(420px, calc(100vw - 3rem));
  padding: calc(0.95rem * var(--scale));
  border-radius: calc(20px * var(--scale));
  border: 1px solid var(--border);
  background: var(--surface-strong);
  box-shadow: var(--shadow);
  z-index: 1000;
  max-height: calc(100vh - 2rem * var(--scale));
  overflow: auto;
}

.settings-panel.hidden {
  display: none;
}

.board-scale-frame {
  min-width: max-content;
}

.board-inner {
  min-width: calc(var(--effective-left-column-width) + (var(--timeline-day-count) * var(--effective-day-width)));
}

.app-shell.all-shops-fullscreen-mode .board-scale-frame {
  width: var(--fullscreen-board-width, max-content);
  height: var(--fullscreen-board-height, auto);
  min-width: 0;
  flex: 0 0 auto;
}

.app-shell.all-shops-fullscreen-mode .board-inner {
  zoom: var(--fullscreen-board-scale, 1);
}

.board-row {
  display: flex;
  width: max-content;
}

.board-left {
  width: var(--effective-left-column-width);
  min-width: var(--effective-left-column-width);
  position: sticky;
  left: 0;
  z-index: 3;
  border-right: 1px solid var(--border);
}

.board-right {
  width: calc(var(--timeline-day-count) * var(--effective-day-width));
  min-width: calc(var(--timeline-day-count) * var(--effective-day-width));
}

.shop-label,
.shop-band,
.lane-label,
.lane-track {
  border-bottom: 1px solid var(--border);
}

.date-grid,
.shop-band,
.lane-track-grid {
  display: grid;
  grid-template-columns: repeat(var(--timeline-day-count), var(--effective-day-width));
}

.shop-label,
.shop-band {
  height: var(--shop-height);
}

.shop-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: calc(0.7rem * var(--scale));
  padding: 0 calc(0.9rem * var(--scale));
  font-weight: 700;
  backdrop-filter: blur(31.5px);
}

.shop-label-main {
  display: flex;
  align-items: center;
  gap: calc(0.7rem * var(--scale));
  min-width: 0;
}

.shop-name-button {
  padding: 0;
  border: none;
  background: transparent;
  box-shadow: none;
  color: inherit;
  font-weight: inherit;
}

.shop-name-button:hover {
  transform: none;
  text-decoration: underline;
}

.shop-subscribe-button {
  margin-left: auto;
  padding: calc(0.36rem * var(--scale)) calc(0.68rem * var(--scale));
  border-radius: 999px;
  font-size: calc(0.78rem * var(--scale));
  font-weight: 700;
  white-space: nowrap;
}

.shop-band-cell {
  height: 100%;
  padding: calc(0.38rem * var(--scale)) calc(0.7rem * var(--scale));
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
}

.shop-band-weekday {
  font-size: calc(0.78rem * var(--scale));
  font-weight: 700;
  line-height: 1.05;
  opacity: 0.88;
}

.shop-band-day {
  margin-top: calc(0.1rem * var(--scale));
  font-size: calc(0.98rem * var(--scale));
  font-weight: 700;
  line-height: 1.05;
}

.lane-label {
  min-height: var(--lane-height);
  padding: calc(0.8rem * var(--scale)) calc(0.9rem * var(--scale));
  display: grid;
  gap: calc(0.4rem * var(--scale));
  align-content: center;
  backdrop-filter: blur(28px);
}

.lane-label-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: calc(0.6rem * var(--scale));
}

.lane-meta {
  font-size: calc(0.82rem * var(--scale));
  color: var(--muted);
}

.lane-book-button {
  padding: calc(0.36rem * var(--scale)) calc(0.68rem * var(--scale));
  border-radius: 999px;
  font-size: calc(0.78rem * var(--scale));
  font-weight: 700;
}

.lane-track {
  position: relative;
  height: var(--lane-height);
}

.lane-track.lane-track-drop-target {
  background: color-mix(in srgb, var(--accent) 10%, transparent 90%);
}

.lane-track-grid {
  position: absolute;
  inset: 0;
}

.track-day {
  border-right: 1px solid var(--border);
}

.reservation-bar {
  position: absolute;
  display: grid;
  align-content: center;
  gap: calc(0.12rem * var(--scale));
  top: calc(3px * var(--scale));
  height: calc(100% - (6px * var(--scale)));
  padding: calc(0.3rem * var(--scale)) calc(8.5rem * var(--scale)) calc(0.3rem * var(--scale)) calc(0.7rem * var(--scale));
  border-radius: calc(12px * var(--scale));
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.18);
  cursor: grab;
  overflow: hidden;
  touch-action: none;
}

.reservation-content {
  display: flex;
  align-items: center;
  gap: calc(0.45rem * var(--scale));
  width: 100%;
  padding-left: calc(0.15rem * var(--scale));
}

.reservation-details,
.reservation-main {
  min-width: 0;
  display: grid;
}

.reservation-details {
  flex: 0 0 auto;
  gap: calc(0.08rem * var(--scale));
  justify-items: start;
}

.reservation-detail-line {
  font-size: calc(0.75rem * var(--scale));
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: 0.94;
}

.reservation-main {
  flex: 1 1 auto;
  gap: calc(0.12rem * var(--scale));
}

.reservation-bar:active {
  cursor: grabbing;
}

.reservation-bar.is-dragging {
  z-index: 6;
  opacity: 0.96;
}

.reservation-bar-overlay {
  opacity: 0.5;
  pointer-events: none;
  z-index: 1 !important;
  filter: saturate(0.92);
}

.reservation-bar-overlay .reservation-handle,
.reservation-bar-overlay .reservation-status-stack {
  display: none;
}

.reservation-handle {
  position: absolute;
  top: calc(4px * var(--scale));
  bottom: calc(4px * var(--scale));
  width: calc(8px * var(--scale));
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.35);
  opacity: 0.65;
}

.reservation-handle-left {
  left: calc(3px * var(--scale));
  cursor: ew-resize;
}

.reservation-handle-right {
  right: calc(3px * var(--scale));
  cursor: ew-resize;
}

.reservation-title {
  font-size: calc(0.84rem * var(--scale));
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.reservation-subtitle {
  font-size: calc(0.7rem * var(--scale));
  opacity: 0.88;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.reservation-status {
  width: calc(2.151rem * var(--scale));
  height: calc(2.151rem * var(--scale));
  display: grid;
  place-items: center;
  border-radius: 999px;
  font-size: calc(1.265rem * var(--scale));
  font-weight: 800;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.reservation-status-stack {
  position: absolute;
  right: calc(1rem * var(--scale));
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  gap: calc(0.18rem * var(--scale));
}

.reservation-status-badge {
  width: auto;
  min-width: calc(2.151rem * var(--scale));
  padding: 0 calc(0.34rem * var(--scale));
  display: inline-flex;
  align-items: center;
  gap: calc(0.14rem * var(--scale));
}

.reservation-status-icon {
  font-size: calc(0.936rem * var(--scale));
  line-height: 1;
}

.reservation-status-value {
  font-size: calc(0.56rem * var(--scale));
  font-weight: 700;
  line-height: 1;
  text-transform: uppercase;
}

.reservation-status-approved {
  color: #d7ffe4;
}

.reservation-status-pending {
  color: #eef2f6;
}

.reservation-bar-pending {
  border-color: rgba(255, 255, 255, 0.16);
}

.reservation-bar-pending .reservation-subtitle {
  opacity: 0.82;
}

.reservation-bar-pending .reservation-handle {
  background: rgba(255, 255, 255, 0.24);
}

.list-card,
.shop-card {
  border: 1px solid var(--border);
  border-radius: calc(18px * var(--scale));
  background: color-mix(in srgb, var(--surface-strong) 88%, transparent 12%);
  padding: calc(0.8rem * var(--scale));
}

.shop-card {
  display: grid;
  gap: calc(0.65rem * var(--scale));
  border-left: calc(4px * var(--scale)) solid rgba(0, 0, 0, 0);
  backdrop-filter: blur(31.5px);
}

.shop-card-header,
.list-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: calc(0.6rem * var(--scale));
}

.settings-section {
  display: grid;
  gap: calc(0.55rem * var(--scale));
}

.compact-list {
  gap: calc(0.45rem * var(--scale));
}

.compact-card {
  padding: calc(0.6rem * var(--scale));
}

.compact-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: calc(0.55rem * var(--scale));
}

.compact-subitem {
  padding-top: calc(0.5rem * var(--scale));
  margin-top: calc(0.5rem * var(--scale));
  border-top: 1px solid var(--border);
}

.compact-copy {
  display: grid;
  gap: calc(0.16rem * var(--scale));
}

.compact-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: calc(0.32rem * var(--scale));
}

.mobile-schedule,
.mobile-schedule-controls,
.mobile-prep-list,
.mobile-reservation-list {
  display: grid;
  gap: calc(0.75rem * var(--scale));
}

.mobile-schedule {
  padding: calc(0.8rem * var(--scale));
}

.mobile-day-strip {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: calc(0.45rem * var(--scale));
}

.mobile-day-chip {
  display: grid;
  gap: calc(0.1rem * var(--scale));
  justify-items: center;
  padding: calc(0.55rem * var(--scale)) calc(0.35rem * var(--scale));
}

.mobile-day-chip.is-selected {
  border-color: color-mix(in srgb, var(--accent) 50%, var(--border) 50%);
  background: color-mix(in srgb, var(--accent) 12%, var(--surface-strong) 88%);
}

.mobile-day-chip.is-today {
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 45%, transparent 55%);
}

.mobile-prep-card {
  display: grid;
  gap: calc(0.65rem * var(--scale));
  border: 1px solid var(--border);
  border-radius: calc(18px * var(--scale));
  background: color-mix(in srgb, var(--surface-strong) 92%, transparent 8%);
  padding: calc(0.8rem * var(--scale));
}

.mobile-prep-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: calc(0.65rem * var(--scale));
}

.mobile-reservation-card {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: calc(0.65rem * var(--scale));
  text-align: left;
  border-left: calc(4px * var(--scale)) solid transparent;
}

.mobile-reservation-card-overlay {
  opacity: 0.5;
}

.mobile-reservation-copy {
  display: grid;
  gap: calc(0.16rem * var(--scale));
}

.mobile-reservation-status {
  flex: 0 0 auto;
  width: calc(1.8rem * var(--scale));
  height: calc(1.8rem * var(--scale));
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: color-mix(in srgb, white 14%, transparent 86%);
  border: 1px solid rgba(255, 255, 255, 0.18);
  font-size: calc(1.15rem * var(--scale));
  font-weight: 800;
}

.shop-card-body {
  display: grid;
  gap: calc(0.45rem * var(--scale));
}

.shop-meta,
.reservation-meta,
.prep-info {
  display: grid;
  gap: calc(0.18rem * var(--scale));
}

.prep-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: calc(0.6rem * var(--scale));
  padding: calc(0.55rem * var(--scale)) calc(0.65rem * var(--scale));
  border-radius: calc(14px * var(--scale));
  background: color-mix(in srgb, var(--surface-strong) 94%, transparent 6%);
  backdrop-filter: blur(28px);
}

.prep-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: calc(0.35rem * var(--scale));
}

.color-dot {
  width: calc(12px * var(--scale));
  height: calc(12px * var(--scale));
  border-radius: 999px;
  flex: 0 0 auto;
}

.color-dot-input {
  width: calc(16px * var(--scale));
  height: calc(16px * var(--scale));
  padding: 0;
  border: none;
  background: transparent;
  box-shadow: 0 0 0 calc(1px * var(--scale)) rgba(15, 23, 42, 0.14);
  cursor: pointer;
  overflow: hidden;
}

.color-dot-input::-webkit-color-swatch-wrapper {
  padding: 0;
}

.color-dot-input::-webkit-color-swatch {
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 999px;
}

.color-dot-input::-moz-color-swatch {
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 999px;
}

.text-button,
.danger-button {
  padding: calc(0.28rem * var(--scale)) calc(0.5rem * var(--scale));
  border-radius: 999px;
  font-size: calc(0.76rem * var(--scale));
}

.danger-button {
  color: #f87171;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  background: rgba(5, 10, 18, 0.42);
  z-index: 2000;
}

.modal-overlay.hidden {
  display: none;
}

.context-menu {
  position: fixed;
  display: grid;
  gap: calc(0.2rem * var(--scale));
  min-width: calc(180px * var(--scale));
  padding: calc(0.35rem * var(--scale));
  border: 1px solid var(--border);
  border-radius: calc(14px * var(--scale));
  background: var(--surface-strong);
  box-shadow: var(--shadow);
  z-index: 1400;
}

.context-menu.hidden {
  display: none;
}

.context-menu-item {
  width: 100%;
  text-align: left;
  border: none;
  background: transparent;
  box-shadow: none;
}

.context-menu-item:hover {
  background: color-mix(in srgb, var(--accent) 10%, var(--surface-strong) 90%);
  transform: none;
}

.modal-card {
  position: relative;
  width: min(640px, 100%);
  padding: calc(1.05rem * var(--scale));
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: calc(0.8rem * var(--scale));
}

.icon-button {
  width: calc(42px * var(--scale));
  height: calc(42px * var(--scale));
  padding: 0;
  border-radius: 999px;
}

.icon-button svg {
  width: 58%;
  height: 58%;
  display: block;
  margin: 0 auto;
}

.modal-form,
.field-grid {
  display: grid;
  gap: calc(0.8rem * var(--scale));
}

.app-switcher-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: calc(0.9rem * var(--scale));
}

.app-switcher-option {
  display: grid;
  justify-items: center;
  gap: calc(0.65rem * var(--scale));
  padding: calc(1rem * var(--scale));
  text-align: center;
}

.app-switcher-option img {
  width: calc(96px * var(--scale));
  height: calc(96px * var(--scale));
  border-radius: calc(22px * var(--scale));
  object-fit: cover;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.18);
}

.app-switcher-option span {
  font-weight: 700;
}

.request-mode-note {
  display: grid;
  gap: calc(0.28rem * var(--scale));
  align-content: start;
  padding: calc(0.8rem * var(--scale)) calc(0.9rem * var(--scale));
  border: 1px dashed var(--border);
  border-radius: calc(12px * var(--scale));
  background: color-mix(in srgb, var(--surface-strong) 92%, transparent 8%);
  color: var(--muted);
}

.request-mode-note strong {
  color: var(--text);
}

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

.field-grid.order-title {
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 2.1fr) auto;
}

.modal-error {
  min-height: 1.2rem;
  margin: 0;
  color: #ef4444;
  font-size: calc(0.88rem * var(--scale));
}

.empty-state {
  padding: calc(0.9rem * var(--scale));
  color: var(--muted);
  text-align: center;
  border: 1px dashed var(--border);
  border-radius: calc(16px * var(--scale));
}

@media (max-width: 1180px) {
  .app-shell {
    grid-template-columns: 1fr;
    height: auto;
    min-height: 100vh;
  }

  body,
  .main-pane {
    overflow: auto;
  }

  .board-scroll {
    min-height: 60vh;
  }
}

@media (max-width: 720px) {
  .app-shell {
    padding: 0.8rem;
  }

  .sidebar {
    display: none;
  }

  .toolbar-card,
  .schedule-header,
  .toolbar-actions,
  .mobile-prep-card-header {
    align-items: stretch;
  }

  .toolbar-card,
  .schedule-header,
  .toolbar-actions {
    flex-direction: column;
  }

  .schedule-title-button {
    text-align: left;
  }

  .settings-panel {
    width: min(420px, calc(100vw - 1.5rem));
    right: 0.75rem;
  }

  .field-grid.two {
    grid-template-columns: 1fr;
  }

  .field-grid.order-title {
    grid-template-columns: 1fr;
  }

  .app-switcher-grid {
    grid-template-columns: 1fr;
  }

  .action-grid > * {
    flex-basis: 100%;
  }

  .board-left {
    width: 240px;
    min-width: 240px;
  }

  :root {
    --day-width: calc(100px * var(--scale));
  }

  .mobile-day-strip {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .mobile-reservation-card {
    padding: calc(0.65rem * var(--scale));
  }
}
