:root {
  color-scheme: light;
  --bg: #eff0f4;
  --card: #ffffff;
  --text: #14151a;
  --subtle: #6b7078;
  --line: #d8dde5;
  --accent: #35c759;
  --danger: #d42c2c;
  --dark-card: #0f141b;
  --surface: #f8f9fc;
  --surface-strong: #f1f3f7;
  --radius-card: 26px;
  --radius-control: 16px;
  --shadow-soft: 0 8px 28px rgba(18, 24, 36, 0.06);
  --shadow-control: 0 2px 10px rgba(17, 24, 39, 0.06);
  --page-gutter: clamp(16px, 4vw, 56px);
  --content-max: 820px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  max-width: 100%;
  overflow-x: hidden;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.app {
  width: min(var(--content-max), calc(100% - (var(--page-gutter) * 2)));
  max-width: var(--content-max);
  margin: 0 auto;
  padding: max(18px, env(safe-area-inset-top)) 0 calc(112px + env(safe-area-inset-bottom));
  overflow-x: hidden;
}

.hidden {
  display: none !important;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  padding: 12px 4px 18px;
  min-width: 0;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.theme-toggle-btn {
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  color: var(--subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 140ms ease, color 140ms ease, border-color 140ms ease, transform 80ms ease;
  box-shadow: var(--shadow-control);
}

.theme-toggle-btn:hover {
  background: var(--surface-strong);
  color: var(--text);
}

.theme-toggle-btn:active { transform: scale(0.93); }

/* Moon in light mode, sun in dark mode */
.theme-icon-sun  { display: none; }
.theme-icon-moon { display: block; }
.dark-mode .theme-icon-sun  { display: block; }
.dark-mode .theme-icon-moon { display: none; }

.dark-mode .theme-toggle-btn {
  background: var(--surface);
  border-color: var(--line);
  color: #facc15;
}

.auth-brand,
.brand-lockup {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.auth-brand {
  align-items: flex-start;
}

.auth-brand img,
.brand-icon {
  width: 58px;
  height: 58px;
  border-radius: 16px;
  box-shadow: 0 8px 22px rgba(17, 24, 39, 0.12);
  flex: 0 0 auto;
}

.auth-brand h1 {
  margin-top: 2px;
}

.overline {
  margin: 0;
  font-size: 11px;
  letter-spacing: 0.2em;
  color: var(--subtle);
  font-weight: 700;
}

h1 {
  margin: 6px 0 0;
  font-size: clamp(30px, 5vw, 50px);
  line-height: 1.05;
}

.topbar h1 {
  font-size: clamp(34px, 7vw, 56px);
  max-width: 100%;
  overflow-wrap: anywhere;
}

h2,
h3 {
  margin: 0 0 12px;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  padding: 20px;
  box-shadow: var(--shadow-soft);
  min-width: 0;
  overflow: hidden;
}

.dark {
  background: linear-gradient(160deg, #111821 0%, #0d131a 100%);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: none;
}

.hero {
  margin-bottom: 16px;
}

.hero-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 15px;
  opacity: 0.86;
  gap: 12px;
}

.dot {
  color: var(--accent);
  letter-spacing: 0.14em;
  font-weight: 700;
}

.hero-main {
  margin-top: 12px;
  display: flex;
  gap: 16px;
  align-items: center;
}

.hero-spot {
  font-size: 78px;
  font-weight: 900;
  color: var(--accent);
  line-height: 1;
  min-width: 92px;
}

.hero-meta p {
  margin: 0 0 6px;
  font-size: 16px;
}

.tabbar {
  position: sticky;
  top: 8px;
  z-index: 10;
  margin: 0 0 16px;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(14px);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 6px;
  box-shadow: var(--shadow-control);
  max-width: 100%;
}

.tab {
  border: 0;
  background: transparent;
  border-radius: 14px;
  padding: 12px 8px;
  min-height: 46px;
  font-size: 14px;
  font-weight: 650;
  color: var(--subtle);
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tab.active {
  background: #ecf8ef;
  color: #22823d;
}

.tabpanel {
  display: grid;
  gap: 12px;
  min-width: 0;
  max-width: 100%;
}

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

.stack.dense {
  gap: 8px;
}

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

.row.between {
  justify-content: space-between;
  min-width: 0;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: nowrap;
  gap: 10px;
  margin-bottom: 10px;
}

.section-head h3 {
  margin: 0;
  min-width: 0;
}

.section-head .btn {
  margin-left: auto;
}

.field {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.field > span {
  color: var(--subtle);
  font-size: 13px;
  font-weight: 600;
}

.field.inline {
  grid-template-columns: auto auto;
  align-items: center;
  gap: 8px;
}

.remember-me {
  display: flex;
  align-items: center;
  gap: 10px;
}

.remember-me input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin: 0;
}

.remember-me > span {
  margin: 0;
  font-size: 14px;
}

.field-select-button {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  background: var(--surface);
  color: var(--text);
  padding: 12px 13px;
  font: inherit;
  font-size: 16px;
  min-height: 50px;
  min-width: 0;
  max-width: 100%;
  text-align: left;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.field-select-button:focus {
  outline: 3px solid var(--accent, #35c759);
  outline-offset: 2px;
}

.make-picker-row {
  border: 1px solid #e5ebf2;
  border-radius: 18px;
  background: var(--surface);
  padding: 10px 12px;
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr) 28px;
  gap: 12px;
  align-items: center;
  text-align: left;
  font: inherit;
  cursor: pointer;
}

.make-picker-row.selected {
  border-color: #35c759;
  background: #effbf2;
}

.make-picker-media {
  height: 58px;
  border-radius: 16px;
  background: #fff;
  display: grid;
  place-items: center;
  color: var(--subtle);
  font-weight: 800;
  font-size: 13px;
}

.make-picker-media img {
  width: 44px;
  height: 44px;
  object-fit: contain;
}

.make-picker-name {
  font-size: 15px;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.field input,
.field select,
.field textarea,
.admin-search {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  background: var(--surface);
  color: var(--text);
  padding: 12px 13px;
  font-size: 16px;
  min-height: 50px;
  min-width: 0;
  max-width: 100%;
}

.field select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236b7280' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 13px center;
  padding-right: 36px;
}

.field textarea {
  resize: vertical;
  line-height: 1.35;
  font-family: inherit;
}

.field input[readonly] {
  color: #1f2328;
  font-weight: 650;
}

.field input:focus,
.field select:focus,
.field textarea:focus,
.admin-search:focus {
  outline: 2px solid rgba(53, 199, 89, 0.28);
  border-color: #9fe2af;
}

.field input[type="date"],
.field input[type="time"] {
  min-width: 0;
  max-width: 100%;
}

.hidden-native-select {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.grow {
  flex: 1;
  min-width: 0;
}

.booking-time-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  min-width: 0;
}

.booking-time-grid .field {
  min-width: 0;
}

.btn {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--text);
  padding: 12px 16px;
  min-height: 46px;
  font-size: 15px;
  font-weight: 680;
  cursor: pointer;
  box-shadow: var(--shadow-control);
}

.btn.primary {
  background: var(--accent);
  border-color: #2db24d;
  color: #fff;
  box-shadow: 0 10px 18px rgba(53, 199, 89, 0.22);
}

.btn.danger {
  background: #ffe7e7;
  color: #8f1d1d;
  border-color: #ffd2d2;
}

.btn.subtle {
  background: var(--surface);
}

.btn:disabled {
  opacity: 0.56;
  cursor: default;
}

.auth-card,
.pending-card {
  max-width: 420px;
  margin: 12vh auto 0;
}

.auth-privacy {
  margin: 14px 0 0;
  text-align: center;
  font-size: 13px;
}

.auth-privacy a {
  color: #22823d;
  font-weight: 700;
  text-decoration: none;
}

.auth-privacy a:hover {
  text-decoration: underline;
}

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

.tiny {
  font-size: 12px;
}

.error {
  min-height: 18px;
  margin: 0;
  color: #aa2222;
  font-size: 13px;
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 10px 0 12px;
  min-width: 0;
}

.stats > div {
  background: var(--surface);
  border: 1px solid #e7ebf2;
  border-radius: 18px;
  padding: 12px;
  text-align: center;
  min-width: 0;
}

.stats span {
  display: block;
  font-size: 28px;
  font-weight: 800;
}

.stats small {
  color: var(--subtle);
  font-size: 12px;
}

.day-pills {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x proximity;
  scrollbar-width: thin;
}

.day-pill {
  flex: 0 0 108px;
  scroll-snap-align: start;
  border: 1px solid #d5dae2;
  border-radius: 18px;
  background: var(--surface);
  min-height: 74px;
  padding: 10px 8px;
  text-align: center;
  cursor: pointer;
  box-shadow: var(--shadow-control);
}

.day-pill strong {
  display: block;
  font-size: 14px;
  font-weight: 650;
  color: #5b616a;
}

.day-pill span {
  display: block;
  margin-top: 4px;
  font-size: 30px;
  line-height: 1;
  font-weight: 780;
  color: #1d2127;
}

.day-pill small {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  color: #6e7278;
}

.day-pill.active {
  background: #121417;
  border-color: #121417;
  box-shadow: none;
}

.day-pill.active strong,
.day-pill.active span,
.day-pill.active small {
  color: #fff;
}

.spot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(124px, 1fr));
  gap: 10px;
  min-width: 0;
}

.spot-cell {
  position: relative;
  border-radius: 18px;
  border: 1px solid #dfe3ea;
  background: var(--surface);
  padding: 13px 12px;
  min-height: 104px;
  text-align: left;
  cursor: pointer;
  transition: transform 140ms ease, box-shadow 140ms ease, border-color 140ms ease, background 140ms ease;
}

.spot-cell[data-state="free"] {
  border-color: #cfead7;
  background: #f6fcf8;
}

.spot-cell[data-state="free"]:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(24, 91, 40, 0.08);
}

.spot-cell strong {
  display: block;
  font-size: 30px;
  line-height: 1;
  overflow-wrap: anywhere;
}

.spot-cell small {
  color: var(--subtle);
  font-size: 12px;
}

.spot-cell[data-state="booked"] {
  border-color: rgba(212, 44, 44, 0.38);
  background: #fff5f5;
  cursor: default;
}

.spot-cell[data-state="booked"].admin-clickable {
  cursor: pointer;
}

.spot-cell[data-state="booked"].admin-clickable:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(140, 30, 30, 0.08);
}

.spot-cell[data-state="blocked"] {
  opacity: 0.7;
  background: var(--surface-strong);
  cursor: default;
}

.spot-cell.selected {
  border-color: #1f9f45;
  background: #e8f8ed;
  box-shadow: 0 0 0 2px rgba(53, 199, 89, 0.3) inset, 0 8px 16px rgba(25, 95, 43, 0.14);
}

.spot-cell:disabled {
  pointer-events: none;
}

.spot-cell-check {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 21px;
  height: 21px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 800;
  background: #35c759;
  color: #fff;
  box-shadow: 0 4px 10px rgba(34, 133, 58, 0.3);
}

.spot-cell-booking-owner {
  margin-top: 6px;
  color: #8a1b1b;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.spot-grid-hint {
  margin: 2px 0 10px;
}

.selection-hint {
  margin: -2px 0 2px;
}

.selection-hint.ok {
  color: #1f9f45;
  font-weight: 640;
}

.booking-row {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  border: 1px solid #e6eaf1;
  background: var(--surface);
  border-radius: 18px;
  padding: 12px 14px;
  min-width: 0;
}

.booking-row-summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  user-select: none;
}

.booking-row-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.booking-row-detail {
  max-height: 0;
  overflow: hidden;
  transition: max-height 240ms ease, opacity 240ms ease, padding-top 240ms ease;
  opacity: 0;
  padding-top: 0;
}

.booking-row.expanded .booking-row-detail {
  max-height: 160px;
  opacity: 1;
  padding-top: 10px;
}

.booking-row-detail-inner {
  border-top: 1px solid var(--line);
  padding-top: 10px;
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.booking-detail-spot {
  font-size: 34px;
  font-weight: 800;
  line-height: 1;
  color: var(--accent);
  min-width: 44px;
}

.booking-detail-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 13px;
  color: var(--subtle);
}

.booking-detail-info strong {
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
}

.booking-row .title {
  margin: 0;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.booking-row .meta {
  margin: 3px 0 0;
  font-size: 13px;
  color: var(--subtle);
  overflow-wrap: anywhere;
}

.admin-inspector {
  border: 1px solid #d8e6dc;
  background: #fbfefc;
  border-radius: 20px;
  padding: 14px;
  margin-top: 12px;
}

.admin-inspector-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.admin-inspector-header h4 {
  margin: 0;
  font-size: 18px;
}

.admin-booking-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  border: 1px solid #e5ebf2;
  border-radius: 16px;
  background: #ffffff;
  padding: 10px 12px;
  min-width: 0;
}

.admin-booking-main {
  min-width: 0;
}

.admin-booking-title {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-booking-meta {
  margin: 3px 0 0;
  color: var(--subtle);
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-booking-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

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

.admin-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  border: 1px solid #e5ebf2;
  border-radius: 18px;
  background: var(--surface);
  padding: 12px;
  min-width: 0;
}

.admin-item-main {
  min-width: 0;
}

.admin-item-title {
  margin: 0;
  font-size: 15px;
  font-weight: 760;
  overflow-wrap: anywhere;
}

.admin-item-meta {
  margin: 4px 0 0;
  color: var(--subtle);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.admin-item-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.admin-item-actions select {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  padding: 7px 10px;
  font: inherit;
  font-size: 13px;
  font-weight: 650;
}

.admin-spot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(128px, 1fr));
  gap: 10px;
}

.admin-spot-card {
  border: 1px solid #dde3eb;
  border-radius: 18px;
  background: var(--surface);
  padding: 12px;
  display: grid;
  gap: 8px;
  min-width: 0;
}

.admin-spot-card strong {
  font-size: 28px;
  line-height: 1;
}

.admin-spot-card.blocked {
  background: #fff5f5;
  border-color: rgba(212, 44, 44, 0.25);
}

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

.admin-search {
  max-width: 260px;
  min-height: 44px;
  padding: 10px 13px;
}

.settings-section-block {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid #e7ebf2;
  border-radius: 20px;
  background: var(--surface);
}

.settings-section-title {
  margin: 0;
  color: var(--subtle);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

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

.vehicle-preview {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) minmax(116px, 34%);
  align-items: center;
  gap: 12px;
  min-height: 112px;
  border-radius: 20px;
  background: #fff;
  border: 1px solid #e7ebf2;
  padding: 12px;
  overflow: hidden;
}

.vehicle-preview-logo {
  width: 48px;
  height: 48px;
  border-radius: 15px;
  background: var(--surface);
  display: grid;
  place-items: center;
  color: var(--subtle);
  font-weight: 800;
}

.vehicle-preview-logo img {
  width: 34px;
  height: 34px;
  object-fit: contain;
}

.vehicle-preview-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.vehicle-preview-copy strong {
  font-size: 17px;
  overflow-wrap: anywhere;
}

.vehicle-preview-copy span {
  color: var(--subtle);
  font-size: 13px;
}

.vehicle-preview-car {
  min-height: 82px;
  display: grid;
  place-items: center;
  color: var(--subtle);
  font-size: 13px;
  font-weight: 700;
}

.vehicle-preview-car img {
  width: 100%;
  max-width: 170px;
  max-height: 92px;
  object-fit: contain;
  display: block;
}

.settings-row-button,
.settings-link-card a {
  width: 100%;
  border: 1px solid #e2e7ef;
  border-radius: 18px;
  background: #fff;
  color: var(--text);
  padding: 14px;
  min-height: 58px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  font: inherit;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.settings-row-button span,
.settings-link-card span {
  font-weight: 760;
}

.settings-row-button strong,
.settings-link-card strong {
  color: var(--subtle);
  font-size: 13px;
  font-weight: 700;
  text-align: right;
}

.settings-link-card {
  padding: 12px;
}

.btn.small {
  min-height: 36px;
  padding: 8px 12px;
  font-size: 13px;
}

.announcement {
  border: 1px solid #e8ecf2;
  border-radius: 20px;
  background: var(--surface);
  overflow: hidden;
}

.announcement-media {
  width: 100%;
  aspect-ratio: 16 / 8;
  object-fit: cover;
  display: block;
  background: #eef2f6;
}

.announcement-body {
  padding: 12px;
}

.announcement h4 {
  margin: 0;
  font-size: 16px;
}

.announcement p {
  margin: 5px 0 0;
  color: var(--subtle);
  font-size: 14px;
}

.info-card-link {
  display: inline-block;
  margin-top: 8px;
  text-decoration: none;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(11, 14, 20, 0.38);
  backdrop-filter: blur(4px);
}

.modal-card {
  width: min(520px, 100%);
  max-width: calc(100vw - 32px);
  max-height: calc(100dvh - 32px);
  overflow: auto;
  background: #ffffff;
  border: 1px solid #dbe1ea;
  border-radius: 24px;
  box-shadow: 0 20px 48px rgba(13, 18, 28, 0.18);
  padding: 18px;
  display: grid;
  gap: 10px;
}

.modal-card h3 {
  margin: 0;
}

.modal-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.modal-card p {
  margin: 0;
  font-size: 15px;
}

.spot-detail-row {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  border: 1px solid #e6eaf1;
  background: var(--surface);
  border-radius: 18px;
  padding: 12px;
}

.spot-detail-avatar {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border-radius: 17px;
  background: #fff;
  color: var(--subtle);
  font-weight: 800;
  overflow: hidden;
}

.spot-detail-avatar img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.spot-detail-main {
  min-width: 0;
}

.spot-detail-title {
  font-weight: 800;
  overflow-wrap: anywhere;
}

.spot-detail-meta {
  color: var(--subtle);
  overflow-wrap: anywhere;
}

.spot-detail-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.vehicle-picker-card {
  width: min(620px, 100%);
}

.vehicle-picker-list {
  display: grid;
  gap: 8px;
}

.vehicle-picker-row {
  border: 1px solid #e5ebf2;
  border-radius: 18px;
  background: var(--surface);
  padding: 10px 12px;
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr) 28px;
  gap: 12px;
  align-items: center;
  text-align: left;
  font: inherit;
  cursor: pointer;
}

.vehicle-picker-row.selected {
  border-color: #35c759;
  background: #effbf2;
}

.vehicle-picker-media {
  height: 58px;
  display: grid;
  place-items: center;
}

.vehicle-picker-media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.vehicle-picker-auto {
  height: 58px;
  border-radius: 16px;
  background: #fff;
  display: grid;
  place-items: center;
  color: var(--subtle);
  font-weight: 800;
}

.vehicle-picker-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.vehicle-picker-copy strong {
  overflow-wrap: anywhere;
}

.vehicle-picker-copy small {
  color: var(--subtle);
  display: flex;
  align-items: center;
  gap: 5px;
}

.vehicle-picker-make-logo {
  width: 16px;
  height: 16px;
  object-fit: contain;
  flex-shrink: 0;
}

.vehicle-picker-check {
  color: #28b84d;
  font-size: 24px;
  font-weight: 900;
  text-align: right;
}

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

@media (max-width: 980px) {
  :root {
    --page-gutter: clamp(12px, 3vw, 28px);
  }

  .booking-time-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }

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

@media (max-width: 760px) {
  :root {
    --page-gutter: 10px;
  }

  .app {
    width: calc(100% - (var(--page-gutter) * 2));
    padding: max(10px, env(safe-area-inset-top)) 0 calc(112px + env(safe-area-inset-bottom));
  }

  .topbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    padding: 6px 2px 12px;
    align-items: start;
  }

  .brand-lockup {
    align-items: flex-start;
    gap: 10px;
  }

  .brand-icon {
    width: 46px;
    height: 46px;
    border-radius: 13px;
  }

  .topbar .btn {
    min-height: 50px;
    padding-inline: 18px;
    white-space: nowrap;
  }

  .topbar h1 {
    font-size: clamp(32px, 11vw, 46px);
  }

  .overline {
    letter-spacing: 0.16em;
  }

  .tabbar {
    position: fixed;
    left: 10px;
    right: 10px;
    bottom: calc(10px + env(safe-area-inset-bottom));
    top: auto;
    margin: 0;
    padding: 7px;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    border-radius: 28px;
    background: rgba(252, 252, 254, 0.92);
    box-shadow: 0 12px 32px rgba(13, 15, 18, 0.12);
  }

  .tab {
    font-size: 13px;
    padding: 11px 6px;
  }

  .hero {
    border-radius: 22px;
    padding: 14px;
  }

  .hero-main {
    align-items: flex-start;
    gap: 12px;
  }

  .hero-spot {
    font-size: 58px;
    min-width: 72px;
  }

  .hero-meta p {
    font-size: 14px;
  }

  .row {
    flex-wrap: wrap;
    align-items: stretch;
  }

  .row.between {
    align-items: flex-start;
  }

  .section-head {
    flex-wrap: wrap;
    align-items: center;
  }

  .section-head .btn {
    margin-left: 0;
  }

  .booking-time-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .field.inline {
    width: 100%;
    grid-template-columns: auto 1fr;
    gap: 10px;
  }

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

  .vehicle-preview {
    grid-template-columns: 44px minmax(0, 1fr);
  }

  .vehicle-preview-car {
    grid-column: 1 / -1;
    min-height: 92px;
  }

  .vehicle-preview-car img {
    max-width: 230px;
  }

  .stats span {
    font-size: 24px;
  }

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

  .spot-cell {
    min-height: 118px;
  }

  .day-pills {
    gap: 10px;
    padding-bottom: 6px;
  }

  .day-pill {
    flex-basis: 96px;
  }

  .booking-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .booking-row-actions {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr;
  }

  .booking-row .btn {
    width: 100%;
  }

  .admin-booking-row {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .admin-item {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .admin-item-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .admin-item-actions .btn,
  .admin-item-actions select {
    width: 100%;
  }

  .admin-search {
    max-width: none;
  }

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

  .admin-booking-title,
  .admin-booking-meta {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
  }

  .admin-booking-actions {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr;
  }

  .admin-booking-actions .btn {
    width: 100%;
  }

  .modal {
    padding: 14px;
    align-items: end;
  }

  .modal-card {
    border-radius: 22px;
    padding: 16px;
    width: 100%;
    max-width: calc(100vw - 28px);
  }

  .spot-detail-row {
    grid-template-columns: 48px minmax(0, 1fr);
    align-items: start;
  }

  .spot-detail-avatar {
    width: 48px;
    height: 48px;
  }

  .spot-detail-actions {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 1fr;
  }

  .vehicle-picker-row,
  .make-picker-row {
    grid-template-columns: 86px minmax(0, 1fr) 24px;
    padding: 10px;
  }

  .vehicle-picker-media,
  .vehicle-picker-auto,
  .make-picker-media {
    height: 50px;
  }

  .modal-actions {
    flex-direction: column-reverse;
  }

  .admin-option-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 390px) {
  :root {
    --page-gutter: 8px;
  }

  .topbar h1 {
    font-size: clamp(30px, 10vw, 34px);
  }

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

  .stats > div {
    padding: 10px 6px;
  }

  .stats span {
    font-size: 22px;
  }

  .hero-spot {
    font-size: 52px;
  }

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

  .spot-cell {
    min-height: 108px;
    padding: 12px 10px;
  }

  .spot-cell strong {
    font-size: 28px;
  }

  .day-pill {
    flex-basis: 88px;
  }
}

/* ── Occupancy heatmap ── */
.day-pill.occ-low  { background: #f0faf2; border-color: #c3e6cb; }
.day-pill.occ-medium { background: #fffbeb; border-color: #fde68a; }
.day-pill.occ-high { background: #fef2f2; border-color: #fca5a5; }
/* Active always wins — keep dark background regardless of occ tint */
.day-pill.active.occ-low,
.day-pill.active.occ-medium,
.day-pill.active.occ-high { background: #121417; border-color: #121417; }

/* ── Toast notifications ── */
.toast-container {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}

.toast {
  background: #1d2127;
  color: #fff;
  padding: 10px 18px;
  border-radius: 24px;
  font-size: 14px;
  font-weight: 500;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.2s, transform 0.2s;
  max-width: min(340px, 90vw);
  text-align: center;
}

.toast.toast-error { background: #dc2626; }
.toast.toast-visible { opacity: 1; transform: translateY(0); }

/* ── Bookings filter ── */
.bookings-filter {
  display: flex;
  background: var(--bg);
  border-radius: 12px;
  padding: 3px;
  gap: 2px;
  margin-bottom: 12px;
}

.bookings-filter-btn {
  flex: 1;
  border: none;
  background: transparent;
  border-radius: 10px;
  padding: 7px 12px;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--subtle);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.bookings-filter-btn.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 1px 3px rgba(0,0,0,.1);
}

/* ── Empty states ── */
.empty-state {
  text-align: center;
  padding: 28px 16px;
  color: var(--subtle);
}

.empty-state-icon {
  display: block;
  font-size: 36px;
  margin-bottom: 10px;
}

.empty-state p { margin: 4px 0; }

/* ── Booking success summary ── */
.booking-success-summary {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--bg);
  border-radius: 18px;
  padding: 14px;
  margin: 8px 0 4px;
}

.success-spot-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #121417;
  color: #fff;
  border-radius: 14px;
  width: 60px;
  height: 60px;
  flex-shrink: 0;
}

.success-spot-label { font-size: 10px; font-weight: 600; opacity: .6; text-transform: uppercase; }
.success-spot-number { font-size: 26px; font-weight: 800; line-height: 1; }

.success-info { flex: 1; min-width: 0; }
.success-info p { margin: 0; font-size: 15px; font-weight: 600; }
.success-info p.muted { font-weight: 400; font-size: 13px; }

.success-car-img {
  height: 52px;
  width: 90px;
  object-fit: contain;
  flex-shrink: 0;
}

/* ── Bulk cancel ── */
.bulk-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 2px 10px;
}

.bulk-checkbox {
  width: 18px;
  height: 18px;
  cursor: pointer;
  flex-shrink: 0;
}

.bulk-cancel-btn { margin-left: auto; }

.admin-booking-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.booking-checkbox { align-self: center; }

/* ── Skeleton loaders ── */
@keyframes shimmer {
  0%   { background-position: -400% 0; }
  100% { background-position:  400% 0; }
}

.skeleton {
  background: linear-gradient(
    90deg,
    var(--surface-strong) 25%,
    var(--surface) 50%,
    var(--surface-strong) 75%
  );
  background-size: 400% 100%;
  animation: shimmer 1.6s ease-in-out infinite;
  border-radius: 18px;
  border: none !important;
  box-shadow: none !important;
  pointer-events: none;
}

.skeleton-pill {
  flex: 0 0 108px;
  min-height: 74px;
  scroll-snap-align: start;
}

.skeleton-spot { min-height: 104px; }

/* ── Tab badge ── */
.tab { position: relative; }

.tab-badge {
  position: absolute;
  top: 7px;
  right: 7px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--danger);
  border: 2px solid var(--card);
  display: block;
}

.tab-badge.hidden { display: none; }

/* ── Button micro-animations ── */
.btn:active           { transform: scale(0.97); transition: transform 80ms ease; }
.day-pill:active:not(.active) { transform: scale(0.97); transition: transform 80ms ease; }

/* ── Tab panel fade-in ── */
@keyframes tabFadeIn {
  from { opacity: 0; transform: translateY(5px); }
  to   { opacity: 1; transform: translateY(0);   }
}

.tabpanel:not(.hidden) { animation: tabFadeIn 180ms ease; }

/* ── Spot search ── */
.spot-search {
  display: block;
  width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 14px;
  padding: 9px 14px;
  margin: 10px 0 12px;
  outline: none;
  box-shadow: var(--shadow-control);
  -webkit-appearance: none;
}

.spot-search:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(53, 199, 89, 0.15);
}

.spot-cell.search-hidden   { display: none; }
.spot-cell.search-match strong { color: var(--accent); }

/* ── Admin today bar ── */
.admin-today-bar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  padding: 10px 16px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-control);
}

.admin-today-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--subtle);
}

.admin-today-stats {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--text);
}

.admin-today-stats strong { font-weight: 800; font-size: 16px; }
.admin-today-sep { color: var(--subtle); }

/* ── Toasts above tab bar on mobile ── */
@media (max-width: 760px) {
  .toast-container {
    bottom: calc(env(safe-area-inset-bottom, 0px) + 88px);
  }
}

/* ── "Yours" badge variant on spot cells ── */
.spot-cell-booking-owner.yours { color: #1f7a3a; }

/* ── Dark mode ── */
/* ── Dark mode (applied via .dark-mode class on <html>, set by JS) ── */
.dark-mode {
  color-scheme: dark;
  --bg: #0f1117;
  --card: #1a1d24;
  --text: #e8eaf0;
  --subtle: #8c93a0;
  --line: #2c2f3a;
  --surface: #1e2128;
  --surface-strong: #252830;
  --dark-card: #090c12;
  --shadow-soft: 0 8px 28px rgba(0, 0, 0, 0.4);
  --shadow-control: 0 2px 10px rgba(0, 0, 0, 0.3);
}

/* Tab bar */
.dark-mode .tabbar { background: rgba(26, 29, 36, 0.9); border-color: var(--line); }
.dark-mode .tab.active { background: #1a3326; color: #4ade80; }
.dark-mode .tab-badge { border-color: #1a1d24; }

/* Cards */
.dark-mode .card { background: var(--card); }
.dark-mode .hero.dark { background: #0a1320; }

/* Day pills */
.dark-mode .day-pill { border-color: var(--line); }
.dark-mode .day-pill strong { color: #9ba3b0; }
.dark-mode .day-pill span   { color: var(--text); }
.dark-mode .day-pill small  { color: #6b7380; }
.dark-mode .day-pill.active { background: #e8eaf0; border-color: #e8eaf0; }
.dark-mode .day-pill.active strong,
.dark-mode .day-pill.active span,
.dark-mode .day-pill.active small { color: #0f1117; }
.dark-mode .day-pill.occ-low    { background: #0f1f14; border-color: #1a3d26; }
.dark-mode .day-pill.occ-medium { background: #1a160a; border-color: #3d300a; }
.dark-mode .day-pill.occ-high   { background: #1f0f0f; border-color: #3d1515; }
.dark-mode .day-pill.active.occ-low,
.dark-mode .day-pill.active.occ-medium,
.dark-mode .day-pill.active.occ-high { background: #e8eaf0; border-color: #e8eaf0; }

/* Spot grid */
.dark-mode .spot-cell { border-color: var(--line); background: var(--surface); }
.dark-mode .spot-cell strong { color: var(--text); }
.dark-mode .spot-cell small  { color: var(--subtle); }
.dark-mode .spot-cell[data-state="free"]   { border-color: #1a3d26; background: #0f1f14; }
.dark-mode .spot-cell[data-state="booked"] { border-color: rgba(212,44,44,.35); background: #1f0f0f; }
.dark-mode .spot-cell-booking-owner { color: #f87171; }
.dark-mode .spot-cell-booking-owner.yours { color: #4ade80; }
.dark-mode .spot-cell.selected {
  border-color: #22c55e;
  background: #0f2318;
  box-shadow: 0 0 0 2px rgba(53,199,89,.25) inset, 0 8px 16px rgba(0,0,0,.3);
}

/* Booking rows */
.dark-mode .booking-row       { border-color: var(--line); background: var(--surface); }
.dark-mode .admin-booking-row { border-color: var(--line); background: var(--surface); }
.dark-mode .booking-row .title, .dark-mode .admin-booking-title { color: var(--text); }
.dark-mode .booking-row .meta, .dark-mode .admin-booking-meta   { color: var(--subtle); }
.dark-mode .booking-row-detail-inner { border-color: var(--line); }

/* Bookings filter */
.dark-mode .bookings-filter { background: var(--surface-strong); }
.dark-mode .bookings-filter-btn.active { background: var(--surface); color: var(--text); }

/* Form inputs */
.dark-mode input, .dark-mode select, .dark-mode textarea {
  background: var(--surface);
  color: var(--text);
  border-color: var(--line);
}
.dark-mode input::placeholder { color: var(--subtle); }
.dark-mode .field select { background-color: var(--surface); color: var(--text); }

/* Buttons */
.dark-mode .btn.subtle { background: var(--surface-strong); color: var(--text); border-color: var(--line); }
.dark-mode .btn.subtle:hover { background: var(--surface); }

/* Admin */
.dark-mode .admin-today-bar { background: var(--card); border-color: var(--line); }
.dark-mode .admin-search { background: var(--surface); color: var(--text); border-color: var(--line); }
.dark-mode .admin-list .admin-user-row,
.dark-mode .admin-list .admin-announcement-row { border-color: var(--line); background: var(--surface); }

/* Pickers */
.dark-mode .vehicle-picker-row            { border-color: var(--line); background: var(--surface); }
.dark-mode .vehicle-picker-row.selected   { border-color: #1a3d26; background: #0f1f14; }
.dark-mode .vehicle-picker-copy .name     { color: var(--text); }
.dark-mode .vehicle-picker-copy small     { color: var(--subtle); }
.dark-mode .vehicle-picker-media, .dark-mode .make-picker-media { background: var(--surface-strong); }
.dark-mode .make-picker-row.selected      { border-color: #1a3d26; background: #0f1f14; }

/* Modal */
.dark-mode .modal-card { background: var(--card); border-color: var(--line); }

/* Toast */
.dark-mode .toast       { background: #e8eaf0; color: #0f1117; }
.dark-mode .toast-error { background: #7f1d1d; color: #fef2f2; }

/* Announcement / info cards */
.dark-mode .announcement { border-color: var(--line); background: var(--surface); }

/* Skeleton */
.dark-mode .skeleton {
  background: linear-gradient(
    90deg,
    var(--surface-strong) 25%,
    #2c2f3a 50%,
    var(--surface-strong) 75%
  );
  background-size: 400% 100%;
}

/* Empty state */
.dark-mode .empty-state p { color: var(--subtle); }

/* Stats */
.dark-mode .stats div span { color: var(--text); }

/* Theme toggle control */
.theme-toggle {
  display: flex;
  background: var(--bg);
  border-radius: 12px;
  padding: 3px;
  gap: 2px;
}

.theme-btn {
  flex: 1;
  border: none;
  background: transparent;
  border-radius: 10px;
  padding: 9px 12px;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--subtle);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.theme-btn.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.dark-mode .theme-btn.active {
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}


/* ════════════════════════════════════════════════════════════════════════
   Calm (Nordic) palette — toggled via .palette-calm on <html>
   ════════════════════════════════════════════════════════════════════════ */
/* Calm = cool, muted slate-grey tones with CRISP white cards (contrast =
   sharpness) and one restrained pine accent. Grey base, not washed beige. */
.palette-calm {
  --bg: #E3E6EA;
  --card: #FFFFFF;
  --text: #1B2128;
  --subtle: #687078;
  --line: #CCD2D9;
  --accent: #43795F;
  --danger: #B5603F;
  --surface: #DADFE4;
  --surface-strong: #CFD5DC;
  --shadow-soft: 0 8px 26px rgba(27, 33, 40, 0.10);
}
.palette-calm.dark-mode {
  --bg: #121417;
  --card: #1D2024;
  --text: #EAEDF0;
  --subtle: #99A1AA;
  --line: #2E343B;
  --accent: #6FA086;
  --danger: #C77E5C;
  --surface: #22272F;
  --surface-strong: #2A3038;
  --dark-card: #0C0E10;
}
.palette-calm .tab.active { background: rgba(67, 121, 95, 0.16); color: var(--accent); }
.palette-calm.dark-mode .tab.active { background: #1f2e26; color: #93c2a8; }
.palette-calm .yours { color: #356b4f; }
.palette-calm .announcement { border-color: var(--line); }

/* ════════════════════════════════════════════════════════════════════════
   Compact density — toggled via .density-compact on <html>
   ════════════════════════════════════════════════════════════════════════ */
.density-compact {
  --radius-card: 18px;
  --radius-control: 13px;
}
.density-compact .card { padding: 14px; }
.density-compact .tabbar { padding: 4px; }
.density-compact .tab { padding: 9px 6px; }
.density-compact .field { margin-bottom: 8px; }
.density-compact h3 { margin-bottom: 8px; }
.density-compact .settings-section-block { margin-top: 12px; }

/* Compact: announcements + info collapse into a denser grid of small tiles
   side by side — same idea as the iOS compact home layout. */
.density-compact #announcementsList,
.density-compact #infoList {
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  align-items: start;
}
.density-compact .announcement { border-radius: 14px; }
.density-compact .announcement-media { aspect-ratio: 16 / 9; }
.density-compact .announcement-body { padding: 9px 10px; }
.density-compact .announcement h4 { font-size: 13.5px; line-height: 1.25; }
.density-compact .announcement p {
  font-size: 12px;
  margin-top: 3px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ════════════════════════════════════════════════════════════════════════
   Segmented control — Appearance settings
   ════════════════════════════════════════════════════════════════════════ */
.seg {
  display: flex;
  gap: 6px;
  background: var(--surface);
  padding: 4px;
  border-radius: var(--radius-control);
}
.seg-btn {
  flex: 1;
  padding: 10px;
  border: none;
  background: transparent;
  color: var(--subtle);
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  border-radius: calc(var(--radius-control) - 4px);
  transition: background 140ms ease, color 140ms ease;
}
.seg-btn.active {
  background: var(--card);
  color: var(--text);
  box-shadow: var(--shadow-control);
}
