:root {
  --ink: var(--rd-charcoal-900);
  --muted: var(--rd-taupe-500);
  --line: var(--rd-border);
  --paper: var(--rd-surface-warm);
  --surface: var(--rd-surface);
  --shadow: var(--rd-shadow-soft);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--rd-canvas);
  font-family: var(--rd-font-body);
}

button,
input,
select {
  font: inherit;
}

button {
  touch-action: manipulation;
}

.shell {
  width: min(1240px, calc(100% - 28px));
  min-height: 100svh;
  margin: 0 auto;
  padding: 18px 0 38px;
}

.app-header {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--rd-radius-md);
  box-shadow: var(--shadow);
}

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

.app-logo {
  width: 112px;
  height: auto;
  display: block;
  flex: 0 0 auto;
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--rd-success);
  font-size: var(--rd-text-xs);
  font-weight: 900;
  text-transform: uppercase;
}

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

h1,
h2 {
  font-family: var(--rd-font-display);
  line-height: 1.2;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(26px, 4vw, 42px);
}

h2 {
  margin-bottom: 0;
  font-size: clamp(25px, 3vw, 36px);
}

h3 {
  margin: 0;
  font-size: var(--rd-text-lg);
}

p {
  color: var(--muted);
  line-height: var(--rd-leading-body);
}

.app-menu {
  position: relative;
  flex: 0 0 auto;
}

.menu-toggle {
  width: 48px;
  height: 48px;
  display: grid;
  align-content: center;
  gap: 5px;
  padding: 0 13px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--rd-radius-md);
  cursor: pointer;
}

.menu-toggle span {
  width: 100%;
  height: 2px;
  display: block;
  background: currentColor;
  transition: transform 160ms ease, opacity 160ms ease;
}

.menu-toggle[aria-expanded="true"] span:first-child {
  transform: translateY(7px) rotate(45deg);
}

.menu-toggle[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}

.menu-toggle[aria-expanded="true"] span:last-child {
  transform: translateY(-7px) rotate(-45deg);
}

.surface-tabs {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(180px, 1fr);
  gap: 6px;
  padding: 5px;
  background: color-mix(in srgb, var(--rd-warm-grey-200) 40%, var(--rd-surface));
  border: 1px solid var(--line);
  border-radius: var(--rd-radius-md);
  box-shadow: var(--shadow);
}

.surface-tabs[hidden] {
  display: none;
}

.surface-tab,
.path-card,
.service-card,
.slot,
.primary,
.ghost,
.line-btn,
.ticket-actions button {
  cursor: pointer;
}

.surface-tab {
  min-height: 44px;
  padding: 0 14px;
  text-align: left;
  border: 0;
  border-radius: var(--rd-radius-sm);
  color: var(--muted);
  background: transparent;
  font-weight: 900;
}

.surface-tab.active {
  color: var(--rd-white);
  background: var(--ink);
}

.surface {
  display: none;
  margin-top: 16px;
}

.surface.active {
  display: block;
}

.customer-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 350px;
  gap: 16px;
}

.customer-main,
.summary-panel,
.admin-grid {
  min-width: 0;
}

.hero-strip {
  min-height: 260px;
  display: grid;
  align-items: end;
  padding: clamp(18px, 4vw, 34px);
  color: var(--rd-white);
  background:
    linear-gradient(90deg, rgba(47, 44, 37, 0.88), rgba(47, 44, 37, 0.25)),
    url("assets/drybar-interior.png") center / cover;
  border-radius: var(--rd-radius-md);
  overflow: hidden;
}

.hero-strip h2 {
  max-width: 620px;
  font-size: clamp(34px, 6vw, 62px);
}

.status-dot {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  color: color-mix(in srgb, var(--rd-white) 84%, var(--rd-warm-grey-200));
  font-weight: 900;
}

.status-dot::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--rd-success);
}

.path-picker {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.path-card {
  min-height: 140px;
  display: grid;
  gap: 8px;
  align-content: start;
  padding: 16px;
  text-align: left;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--rd-radius-md);
}

.path-card.active {
  border-color: var(--ink);
  box-shadow: inset 0 0 0 2px var(--ink);
}

.path-card span,
.service-group,
.fine-print {
  color: var(--muted);
  font-size: var(--rd-text-sm);
  font-weight: 900;
}

.path-card strong {
  font-size: var(--rd-text-lg);
  line-height: 1.35;
}

.path-card small,
.addon-row small {
  color: var(--muted);
  line-height: var(--rd-leading-body);
}

.step-block,
.summary-card,
.lane,
.admin-panel {
  margin-top: 16px;
  padding: clamp(16px, 3vw, 24px);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--rd-radius-md);
}

#serviceStep,
#availabilityStep,
#detailsStep,
#reservationStep {
  scroll-margin-top: 16px;
}

.section-head,
.staff-toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.muted {
  max-width: 330px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: var(--rd-text-sm);
}

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

.hair-size-panel {
  margin-top: 14px;
  padding: clamp(14px, 3vw, 20px);
  background: var(--rd-surface-warm);
  border: 1px solid var(--rd-border-strong);
  border-radius: var(--rd-radius-md);
}

.hair-size-panel[hidden] {
  display: none;
}

.hair-guide-copy {
  max-width: 700px;
  margin-bottom: 16px;
}

.hair-guide-copy h3 {
  margin-bottom: 5px;
  font-size: var(--rd-text-xl);
}

.hair-guide-copy p:last-child {
  margin-bottom: 0;
}

.hair-guide-layout {
  display: grid;
  grid-template-columns: minmax(220px, 0.78fr) minmax(300px, 1.22fr);
  gap: 16px;
  align-items: start;
}

.hair-guide-figure {
  margin: 0;
  overflow: hidden;
  background: var(--rd-white);
  border: 1px solid var(--line);
  border-radius: var(--rd-radius-md);
}

.hair-guide-figure img {
  width: 100%;
  height: auto;
  display: block;
}

.hair-size-options {
  display: grid;
  gap: 8px;
}

.hair-size-option {
  min-height: 76px;
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  color: var(--ink);
  text-align: left;
  background: var(--rd-white);
  border: 1px solid var(--line);
  border-radius: var(--rd-radius-md);
  cursor: pointer;
}

.hair-size-option.active {
  border-color: var(--rd-success);
  box-shadow: inset 0 0 0 2px var(--rd-success);
}

.size-mark {
  min-width: 54px;
  min-height: 54px;
  display: grid;
  place-items: center;
  color: var(--rd-white);
  background: var(--rd-taupe-500);
  border-radius: var(--rd-radius-sm);
  font-size: var(--rd-text-lg);
  font-weight: 900;
}

.size-mark.special {
  font-size: var(--rd-text-xs);
}

.size-copy,
.size-price {
  display: grid;
  gap: 2px;
}

.size-copy small,
.size-price small,
.size-note {
  color: var(--muted);
  font-size: var(--rd-text-sm);
  line-height: var(--rd-leading-body);
}

.size-price {
  text-align: right;
  font-weight: 900;
}

.size-note {
  margin: 4px 2px 0;
}

.service-card {
  min-height: 138px;
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 14px;
  text-align: left;
  color: var(--ink);
  background: var(--rd-white);
  border: 1px solid var(--line);
  border-radius: var(--rd-radius-md);
}

.service-card.active {
  border-color: var(--rd-success);
  box-shadow: inset 0 0 0 2px var(--rd-success);
}

.service-card strong {
  font-size: var(--rd-text-md);
  line-height: 1.35;
}

.en-sub,
.service-en {
  display: block;
  font-family: var(--rd-font-body);
  color: var(--muted);
  font-size: 0.72em;
  font-weight: 700;
  line-height: 1.35;
}

.hero-strip .en-sub {
  color: color-mix(in srgb, var(--rd-white) 78%, var(--rd-warm-grey-200));
}

.service-en {
  margin-top: 5px;
  font-size: var(--rd-text-sm);
}

.service-meta,
.ticket-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
  margin-top: auto;
  color: var(--rd-success);
  font-weight: 900;
}

.addon-row,
.check-row,
.staff-select {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.addon-row {
  margin-top: 12px;
  padding: 14px;
  background: var(--rd-success-soft);
  border: 1px solid color-mix(in srgb, var(--rd-success) 20%, var(--rd-surface));
  border-radius: var(--rd-radius-md);
}

.addon-row input,
.check-row input {
  width: 22px;
  height: 22px;
  accent-color: var(--rd-success);
}

.field {
  display: grid;
  gap: 8px;
  margin: 0;
}

.field span,
.addon-row strong,
.check-row span,
.staff-select span {
  color: var(--ink);
  font-weight: 900;
}

.field em {
  color: var(--muted);
  font-style: normal;
  font-weight: 700;
}

.field input,
.staff-select select {
  width: 100%;
  min-height: var(--rd-control-height);
  padding: 0 14px;
  color: var(--ink);
  background: var(--rd-white);
  border: 1px solid var(--line);
  border-radius: var(--rd-radius-md);
  outline: none;
}

.field input:focus,
.staff-select select:focus {
  border-color: var(--rd-success);
  box-shadow: var(--rd-shadow-focus);
}

.date-field {
  min-width: 190px;
}

.next-available {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px;
  margin-bottom: 14px;
  background: var(--rd-success-soft);
  border: 1px solid color-mix(in srgb, var(--rd-success) 24%, var(--rd-surface));
  border-radius: var(--rd-radius-md);
}

.next-available strong {
  display: block;
  font-family: var(--rd-font-display);
  font-size: clamp(28px, 5vw, 46px);
}

.next-available p {
  margin-bottom: 0;
}

.slot-period {
  margin-top: 14px;
}

.slot-period h3 {
  margin-bottom: 10px;
}

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

.slot {
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: var(--rd-radius-md);
  color: var(--ink);
  background: var(--rd-white);
  font-weight: 900;
}

.slot.active {
  color: var(--rd-white);
  border-color: var(--rd-success);
  background: var(--rd-success);
}

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

.line-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px;
  margin-top: 14px;
  background: var(--rd-success-soft);
  border: 1px solid color-mix(in srgb, var(--rd-success) 24%, var(--rd-surface));
  border-radius: var(--rd-radius-md);
}

.line-box p {
  margin-bottom: 0;
  font-size: var(--rd-text-sm);
}

.line-btn {
  min-width: 74px;
  min-height: var(--rd-control-height);
  border: 0;
  border-radius: var(--rd-radius-sm);
  color: var(--rd-white);
  background: var(--rd-line);
  font-weight: 900;
}

.line-btn.connected {
  background: var(--rd-success);
}

.check-row {
  margin-top: 12px;
  color: var(--muted);
  font-size: var(--rd-text-sm);
  line-height: var(--rd-leading-body);
}

.summary-panel {
  align-self: start;
}

.summary-card {
  position: sticky;
  top: 16px;
  margin-top: 0;
}

.summary-card h2 {
  min-height: 88px;
  font-size: clamp(24px, 3vw, 32px);
}

dl {
  display: grid;
  gap: 12px;
  margin: 18px 0;
}

dl div {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

dt {
  color: var(--muted);
  font-weight: 900;
}

dd {
  margin: 0;
  text-align: right;
  font-weight: 900;
}

.primary,
.ghost,
.ticket-actions button {
  min-height: var(--rd-control-height);
  border-radius: var(--rd-radius-md);
  font-weight: 900;
}

.primary {
  width: 100%;
  border: 0;
  color: var(--rd-white);
  background: var(--ink);
}

.primary:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.ghost {
  padding: 0 16px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
}

.ghost.danger {
  color: var(--rd-warning);
}

.fine-print {
  margin: 12px 0 0;
  line-height: var(--rd-leading-body);
}

.staff-toolbar {
  margin-bottom: 16px;
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--rd-radius-md);
}

.toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.metric-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.metric {
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--rd-radius-md);
}

.metric span {
  color: var(--muted);
  font-size: var(--rd-text-sm);
  font-weight: 900;
}

.metric strong {
  display: block;
  margin-top: 6px;
  font-family: var(--rd-font-display);
  font-size: var(--rd-text-2xl);
}

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

.lane {
  margin-top: 0;
  padding: 14px;
}

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

.lane-head span {
  min-width: 30px;
  min-height: 30px;
  display: grid;
  place-items: center;
  color: var(--rd-white);
  background: var(--ink);
  border-radius: 999px;
  font-weight: 900;
}

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

.ticket {
  display: grid;
  gap: 12px;
  padding: 14px;
  background: var(--rd-white);
  border: 1px solid var(--line);
  border-left: 5px solid var(--rd-taupe-500);
  border-radius: var(--rd-radius-md);
}

.ticket.late {
  border-left-color: var(--rd-warning);
}

.ticket.in_service {
  border-left-color: var(--rd-success);
}

.ticket.completed,
.ticket.rating {
  border-left-color: var(--rd-bronze-700);
}

.ticket-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.ticket-top strong {
  display: block;
}

.ticket-top p {
  margin: 4px 0 0;
  font-size: var(--rd-text-sm);
}

.status-badge {
  flex: 0 0 auto;
  padding: 5px 8px;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--rd-radius-sm);
  font-size: var(--rd-text-xs);
  font-weight: 900;
}

.ticket-meta {
  justify-content: flex-start;
  color: var(--muted);
  font-size: var(--rd-text-sm);
}

.ticket-meta span {
  padding: 5px 8px;
  background: var(--paper);
  border-radius: var(--rd-radius-sm);
}

.timer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px;
  color: var(--rd-white);
  background: var(--ink);
  border-radius: var(--rd-radius-md);
}

.timer span {
  font-weight: 900;
}

.timer strong {
  font-family: var(--rd-font-display);
  font-size: var(--rd-text-xl);
}

.staff-select {
  align-items: center;
  justify-content: space-between;
}

.staff-select select {
  width: auto;
  min-width: 130px;
  min-height: 42px;
}

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

.ticket-actions button {
  min-height: 44px;
  color: var(--rd-white);
  background: var(--ink);
  border: 0;
}

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

.admin-panel {
  margin-top: 0;
}

.admin-panel.wide {
  grid-column: 1 / -1;
}

.shift-list,
.membership-list,
.admin-service-table,
.template-grid {
  display: grid;
  gap: 10px;
}

.shift-list div,
.membership-row,
.admin-service-table div,
.template-grid div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  background: var(--rd-white);
  border: 1px solid var(--line);
  border-radius: var(--rd-radius-md);
}

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

.template-grid div {
  grid-template-columns: 1fr;
  align-items: start;
}

.shift-list span,
.membership-row span,
.admin-service-table span,
.template-grid span {
  color: var(--muted);
  font-size: var(--rd-text-sm);
  font-weight: 800;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%) translateY(110px);
  max-width: calc(100% - 28px);
  padding: 12px 16px;
  color: var(--rd-white);
  background: var(--ink);
  border-radius: var(--rd-radius-md);
  box-shadow: var(--shadow);
  transition: transform 180ms ease;
  font-weight: 900;
  z-index: 10;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
}

@media (max-width: 900px) {
  .customer-layout,
  .ticket-board,
  .admin-grid {
    grid-template-columns: 1fr;
  }

  .summary-card {
    position: static;
  }
}

@media (max-width: 760px) {
  .shell {
    width: 100%;
    padding-top: 0;
  }

  .app-header,
  .hero-strip,
  .step-block,
  .summary-card,
  .staff-toolbar,
  .lane,
  .admin-panel {
    border-inline: 0;
    border-radius: 0;
  }

  .brand-block,
  .section-head,
  .staff-toolbar,
  .next-available,
  .line-box {
    align-items: stretch;
    flex-direction: column;
  }

  .brand-block {
    display: grid;
  }

  .app-header {
    align-items: flex-start;
    flex-direction: row;
  }

  .app-logo {
    width: 124px;
  }

  .hero-strip {
    min-height: 230px;
  }

  .path-picker,
  .service-list,
  .form-grid,
  .metric-row,
  .template-grid {
    grid-template-columns: 1fr;
  }

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

  .date-field {
    min-width: 0;
  }

  .hair-guide-layout {
    grid-template-columns: 1fr;
  }

  .hair-size-option {
    grid-template-columns: 52px minmax(0, 1fr);
  }

  .size-mark {
    min-width: 48px;
    min-height: 48px;
  }

  .size-price {
    grid-column: 2;
    text-align: left;
  }

  .summary-card h2 {
    min-height: auto;
  }

  .ticket-actions {
    grid-template-columns: 1fr;
  }

  .admin-service-table div,
  .shift-list div,
  .membership-row {
    grid-template-columns: 1fr;
  }
}
