:root {
  --bf-ink: #020e19;
  --bf-navy: #031220;
  --bf-blue: #0f3e6b;
  --bf-orange: #ff7e34;
  --bf-mint: #33ffb9;
  --bf-sand: #f3f2ed;
  --bf-paper: #fffefa;
  --bf-line: #dde1dd;
  --bf-table-line: #e2e4df;
  --bf-text: #0a1824;
  --bf-muted: #5f6f78;
  --bf-success: #0a8f68;
  --bf-warning: #d76524;
  --bf-error: #c43d3d;
  --bf-info: #0f6fa8;
  --bf-hover: #fff5ee;
  --bf-font: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  --bf-mono: "Space Mono", ui-monospace, SFMono-Regular, monospace;
  --bf-radius-control: 10px;
  --bf-radius-surface: 14px;
  --bf-radius-hero: 18px;
  --bf-shadow-low: 0 8px 24px rgb(2 14 25 / 8%);
  --bf-shadow-raised: 0 14px 38px rgb(2 14 25 / 13%);
  --bf-focus: 0 0 0 3px rgb(255 126 52 / 28%);
  --bf-appbar-height: 56px;
  --bf-appbar-offset: calc(var(--bf-appbar-height) + env(safe-area-inset-top, 0px) + 10px);
  --bf-bottom-nav: 68px;
  --bf-speed: 160ms;
}

html, body {
  min-height: 100%;
  font-family: var(--bf-font);
  color: var(--bf-text);
}

body {
  margin: 0;
  background:
    radial-gradient(circle at 92% 4%, rgb(255 126 52 / 9%), transparent 24rem),
    linear-gradient(rgb(15 62 107 / 3%) 1px, transparent 1px),
    linear-gradient(90deg, rgb(15 62 107 / 3%) 1px, transparent 1px),
    var(--bf-sand);
  background-size: auto, 32px 32px, 32px 32px, auto;
  font-size: 15px;
  line-height: 1.5;
}

h1, h2, h3, h4, .mud-typography-h1, .mud-typography-h2, .mud-typography-h3, .mud-typography-h4 {
  color: var(--bf-text);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -.028em;
}

:focus-visible {
  outline: 2px solid var(--bf-orange) !important;
  outline-offset: 2px !important;
}

#app {
  min-height: 100vh;
}

.pwa-boot {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: var(--bf-ink);
  color: #fff;
  text-align: center;
  padding: 32px;
}

.pwa-boot img {
  width: 96px;
  height: 96px;
}

.pwa-boot small {
  display: block;
  margin-top: 12px;
  color: #afbdc4;
  font-family: var(--bf-mono);
  letter-spacing: .12em;
  text-transform: uppercase;
}

.pwa-shell .mud-appbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 30;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  overflow: visible;
  padding: calc(env(safe-area-inset-top, 0px) + 10px) 0 0 !important;
  min-height: var(--bf-appbar-offset) !important;
  height: var(--bf-appbar-offset) !important;
  max-height: var(--bf-appbar-offset) !important;
  pointer-events: none;
  background: var(--bf-paper) !important;
  color: var(--bf-text) !important;
  border-bottom: 1px solid var(--bf-line) !important;
  box-shadow: 0 8px 20px rgb(2 14 25 / 6%);
}

.pwa-shell .mud-appbar .mud-toolbar,
.pwa-shell .mud-appbar.mud-toolbar {
  width: 100%;
  min-height: var(--bf-appbar-height) !important;
  height: var(--bf-appbar-height) !important;
  padding: 0 4px 2px !important;
  align-items: flex-end;
  overflow: visible;
}

.pwa-shell .mud-appbar .mud-toolbar-gutters {
  padding-left: 4px !important;
  padding-right: 4px !important;
}

.pwa-shell .mud-appbar .mud-badge-root,
.pwa-shell .mud-appbar .mud-badge-wrapper {
  overflow: visible;
}

.pwa-shell .mud-appbar .mud-icon-root,
.pwa-shell .mud-appbar .mud-typography,
.pwa-shell .mud-appbar .mud-button-label {
  color: var(--bf-text);
}

.pwa-shell .mud-appbar .mud-typography-caption {
  color: var(--bf-muted) !important;
}

.pwa-shell .mud-appbar .mud-toolbar,
.pwa-shell .mud-appbar .mud-icon-button,
.pwa-shell .mud-appbar .mud-menu,
.pwa-shell .mud-appbar .mud-badge-root,
.pwa-shell .mud-appbar a,
.pwa-shell .mud-appbar button,
.pwa-shell .mud-appbar img,
.pwa-shell .mud-appbar .ml-2 {
  pointer-events: auto;
}

.pwa-shell .mud-appbar .mud-icon-button:hover {
  background: var(--bf-hover);
}

.pwa-select {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

.pwa-select label {
  font-size: 12px;
  font-weight: 700;
  color: var(--bf-muted);
}

.pwa-select select {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  border: 1px solid var(--bf-line);
  border-radius: var(--bf-radius-control);
  background: var(--bf-paper);
  color: var(--bf-text);
  font: inherit;
  appearance: auto;
}

.pwa-shell {
  min-height: 100vh;
}

.pwa-main {
  max-width: 920px;
  margin: 0 auto;
  padding: 16px 16px 24px;
}

/* Authenticated shell: keep content clear of the fixed app bar and bottom nav. */
.pwa-shell > .pwa-main {
  padding: calc(var(--bf-appbar-offset) + 16px) 16px calc(var(--bf-bottom-nav) + 24px + env(safe-area-inset-bottom, 0px));
}

.pwa-page-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin: 8px 0 18px;
}

.pwa-page-header::before {
  content: "";
  width: 3px;
  align-self: stretch;
  border-radius: 99px;
  background: var(--bf-orange);
}

.pwa-page-header .eyebrow {
  display: block;
  font-family: var(--bf-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--bf-muted);
}

.pwa-card {
  background: var(--bf-paper);
  border: 1px solid var(--bf-line);
  border-radius: var(--bf-radius-surface);
  box-shadow: var(--bf-shadow-low);
}

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

@media (min-width: 720px) {
  .pwa-tile-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .pwa-main { padding: 24px 24px 28px; }
  .pwa-shell > .pwa-main {
    padding: calc(var(--bf-appbar-offset) + 24px) 24px calc(var(--bf-bottom-nav) + 28px + env(safe-area-inset-bottom, 0px));
  }
}

.pwa-tile {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 108px;
  padding: 16px;
  text-align: left;
  text-decoration: none;
  color: var(--bf-text);
  background: var(--bf-paper);
  border: 1px solid var(--bf-line);
  border-radius: var(--bf-radius-surface);
  box-shadow: var(--bf-shadow-low);
}

.pwa-tile:hover { background: var(--bf-hover); }

.pwa-tile .mud-icon-root { color: var(--bf-orange); }

.pwa-stat-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.pwa-stat {
  background: var(--bf-paper);
  border: 1px solid var(--bf-line);
  border-radius: var(--bf-radius-surface);
  padding: 12px 10px;
  text-align: center;
}

.pwa-stat span {
  display: block;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--bf-muted);
}

.pwa-stat strong {
  display: block;
  margin-top: 4px;
  font-size: 1.15rem;
  font-weight: 800;
}

.pwa-stat.is-alert {
  border-color: var(--bf-warning);
  background: #fff7f1;
}

.pwa-split-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.pwa-split-actions .mud-button {
  min-height: 48px;
}

.pwa-qr {
  width: min(240px, 70vw);
  height: auto;
  border-radius: 12px;
  background: #fff;
}

.pwa-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pwa-bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  height: var(--bf-bottom-nav);
  background: var(--bf-ink);
  border-top: 1px solid rgb(255 255 255 / 8%);
  padding-bottom: env(safe-area-inset-bottom);
}

.pwa-bottom-nav a {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: #afbdc4;
  text-decoration: none;
  font-size: 11px;
  font-weight: 700;
}

.pwa-bottom-nav a.active {
  color: var(--bf-orange);
  box-shadow: inset 0 3px 0 var(--bf-orange);
}

.auth-shell {
  min-height: 100vh;
  display: grid;
}

@media (min-width: 900px) {
  .auth-shell { grid-template-columns: 1.05fr .95fr; }
}

.auth-story {
  display: none;
  background:
    radial-gradient(circle at 20% 10%, rgb(255 126 52 / 18%), transparent 18rem),
    var(--bf-ink);
  color: #fff;
  padding: 48px;
}

@media (min-width: 900px) {
  .auth-story { display: flex; flex-direction: column; justify-content: space-between; }
}

.auth-story img { width: min(280px, 70%); }

.auth-kicker {
  font-family: var(--bf-mono);
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--bf-orange);
  font-size: 12px;
}

.auth-panel {
  display: grid;
  place-items: center;
  padding: 24px 16px 40px;
}

.auth-panel-inner { width: min(420px, 100%); }

.pwa-cal-day-strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 2px 10px;
  margin: 0 -2px;
}

.pwa-cal-day {
  flex: 0 0 56px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 6px;
  border: 1px solid var(--bf-line);
  border-radius: 12px;
  background: var(--bf-paper);
  color: var(--bf-text);
  font: inherit;
  cursor: pointer;
}

.pwa-cal-day span {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--bf-muted);
}

.pwa-cal-day strong { font-size: 16px; }

.pwa-cal-day.is-on {
  border-color: var(--bf-orange);
  background: var(--bf-hover);
}

.pwa-cal-window {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  margin-top: 6px;
  border-radius: 10px;
  font-size: 14px;
}

.pwa-cal-window.is-open {
  background: #e7f6f0;
  color: var(--bf-success);
}

.pwa-cal-window.is-busy {
  background: #f3f2ed;
  color: var(--bf-muted);
}

.pwa-cal-filter {
  border: 1px solid var(--bf-line);
  background: var(--bf-paper);
  color: var(--bf-text);
  border-radius: 999px;
  padding: 6px 12px;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.pwa-cal-filter.is-on {
  border-color: var(--bf-orange);
  background: var(--bf-hover);
}

.pwa-gallery-strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
  -webkit-overflow-scrolling: touch;
}

.pwa-gallery-strip-cell {
  position: relative;
  flex: 0 0 72px;
  width: 72px;
  height: 72px;
}

.pwa-gallery-strip-thumb {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--bf-line);
  display: block;
  pointer-events: none;
  background: #111;
}

.pwa-gallery-thumb {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: var(--bf-radius-surface);
  border: 1px solid var(--bf-line);
  display: block;
  pointer-events: none;
  background: #111;
}

.pwa-gallery-cell {
  position: relative;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
  border-radius: var(--bf-radius-surface);
}

.pwa-gallery-play {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #fff;
  background: rgb(2 14 25 / 28%);
  border-radius: var(--bf-radius-surface);
  pointer-events: none;
}

.pwa-gallery-caption {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  color: var(--bf-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pwa-pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 16px;
}

.pwa-lightbox {
  width: min(920px, calc(100vw - 24px));
  max-height: calc(100dvh - 48px);
  overflow: auto;
  padding: 16px 12px 20px;
  color: #fff;
  outline: none;
}

.pwa-lightbox-close {
  color: #fff !important;
}

.pwa-lightbox-media {
  display: block;
  width: 100%;
  max-height: min(72dvh, 720px);
  object-fit: contain;
  background: #000;
  border-radius: 12px;
}

.studio-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
}

.studio-mark {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  object-fit: contain;
  object-position: left center;
  background: transparent;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  background: var(--bf-hover);
}

.booking-row {
  display: grid;
  gap: 4px;
}

.receipt-line {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 8px 0;
}

.receipt-line + .receipt-line {
  border-top: 1px solid var(--bf-table-line);
}

.receipt-line.is-total {
  font-weight: 700;
}

.receipt-line.is-credit span:last-child,
.receipt-line.is-credit strong {
  color: var(--bf-success);
}

.receipt-meta {
  display: block;
  font-size: 12px;
  color: var(--bf-muted);
  font-weight: 500;
}

.chat-thread {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-bottom: 88px;
}

.chat-composer {
  position: sticky;
  bottom: calc(var(--bf-bottom-nav) + env(safe-area-inset-bottom, 0px) + 8px);
  z-index: 15;
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 8px;
  background: var(--bf-paper);
  border: 1px solid var(--bf-line);
  border-radius: 22px;
  box-shadow: var(--bf-shadow-low);
}

.chat-composer-field {
  flex: 1 1 auto;
  min-width: 0;
}

.chat-attach {
  position: relative;
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
}

.chat-attach input[type="file"] {
  position: absolute;
  inset: 0;
  width: 44px;
  height: 44px;
  opacity: 0;
  cursor: pointer;
  z-index: 2;
}

.chat-attach-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--bf-hover);
  color: var(--bf-text);
}

.mud-picker-dialog {
  max-width: min(360px, calc(100vw - 32px));
}

/* Keep Mud dialogs and pickers in the visible band between app bar and bottom nav. */
.mud-overlay.mud-overlay-dialog,
.mud-dialog-container {
  align-items: center !important;
  justify-content: center !important;
  padding: var(--bf-appbar-offset) 12px calc(var(--bf-bottom-nav) + 16px + env(safe-area-inset-bottom, 0px)) !important;
  box-sizing: border-box;
}

.mud-dialog {
  margin: 0 auto !important;
  max-height: calc(100dvh - var(--bf-appbar-offset) - var(--bf-bottom-nav) - 32px) !important;
  overflow: auto;
}

.qr-box {
  min-height: 240px;
  border: 1px dashed var(--bf-line);
  border-radius: var(--bf-radius-surface);
  overflow: hidden;
  background: #000;
}

#blazor-error-ui {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 50;
  padding: 12px 16px;
  background: #c43d3d;
  color: #fff;
}

#blazor-error-ui.show { display: block; }

.pwa-funds-in { color: #198754; }
.pwa-funds-out { color: #c43d3d; }

.pwa-unread-modal {
  position: fixed;
  inset: 0;
  z-index: 1400;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(17, 17, 17, .48);
}

.pwa-unread-modal-card { width: min(420px, 100%); }

.pwa-booking-busy {
  position: fixed;
  inset: 0;
  z-index: 1400;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(17, 17, 17, .48);
}

/* Date/time pickers: always in the middle of the viewport. */
.mud-popover:has(.mud-picker),
.mud-popover:has(.mud-picker-content),
.mud-popover:has(.mud-picker-calendar-container),
.mud-popover:has(.mud-picker-timepicker-toolbar) {
  position: fixed !important;
  top: 50% !important;
  left: 50% !important;
  right: auto !important;
  bottom: auto !important;
  transform: translate(-50%, -50%) !important;
  max-height: calc(100vh - 24px);
  overflow: auto;
  z-index: 1600 !important;
}

.mud-picker-dialog {
  position: fixed !important;
  top: 50% !important;
  left: 50% !important;
  transform: translate(-50%, -50%) !important;
  z-index: 1600 !important;
}
