/* Design tokens — CLAUDE.md section 7. Lifted from docs/mockups/. */
:root {
  --ground: #121211;
  --bar: #171716;
  --surface: #1C1C1A;
  --raised: #262623;
  --line: #32322E;
  --line-strong: #45453F;
  --line-input: #5C5B55;
  --text: #F2F1ED;
  --muted: #A8A7A0;
  --tertiary: #8F8E88;
  --dim: #74736D;
  --accent: #F5B83D;
  --on-accent: #151513;
  --pole-red: #CF3B30;
  --pole-blue: #2D55C7;

  --r-card: 14px;
  --r-chip: 12px;
  --r-small: 10px;

  --display: 'Antonio', 'Arial Narrow', sans-serif;
  --body: 'Instrument Sans', 'Helvetica Neue', Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--ground);
  color: var(--text);
  font-family: var(--body);
  font-size: 15px;
  line-height: 1.35;
  -webkit-font-smoothing: antialiased;
}

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

a { color: var(--accent); }

/* The phone-width column every screen lives in. Designed at 390 px. */
.shell {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  max-width: 480px;
  margin: 0 auto;
  background: var(--ground);
}

/* Barber-pole stripe band at the top of every screen — the only gradient allowed. */
.pole {
  height: 10px;
  flex-shrink: 0;
  background-color: var(--text);
  background-image: repeating-linear-gradient(
    135deg,
    var(--pole-red) 0px, var(--pole-red) 8px,
    transparent 8px, transparent 16px,
    var(--pole-blue) 16px, var(--pole-blue) 24px,
    transparent 24px, transparent 32px);
}

.grow { flex-grow: 1; }

/* Language switch --------------------------------------------------------- */
.lang {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  padding: 12px 20px 0;
}

.lang__option {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0 14px;
  border: 1.5px solid var(--line);
  border-radius: var(--r-small);
  background: var(--surface);
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
}

.lang__option--on {
  background: var(--raised);
  border-color: var(--accent);
  color: var(--text);
  font-weight: 600;
}

/* Header ------------------------------------------------------------------ */
.barber-head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 22px 20px;
}

.avatar {
  width: 58px;
  height: 58px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--raised);
  border: 1px solid var(--line-strong);
  font-family: var(--display);
  font-weight: 700;
  font-size: 22px;
  line-height: 1;
  letter-spacing: 0.04em;
}

.barber-head__text {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.barber-name {
  margin: 0;
  font-family: var(--display);
  font-weight: 700;
  font-size: 30px;
  line-height: 1.05;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.barber-shop { font-size: 14px; color: var(--muted); }
.barber-hours { font-size: 13px; color: var(--muted); }

/* Steps ------------------------------------------------------------------- */
.steps {
  display: flex;
  flex-direction: column;
  gap: 26px;
  padding: 0 20px 24px;
}

.step { display: flex; flex-direction: column; gap: 10px; }

.step__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.step__title {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.step__num { color: var(--accent); }
.step__note { font-size: 13px; color: var(--muted); }

/* Service picker ---------------------------------------------------------- */
.services { display: flex; flex-direction: column; gap: 8px; }

.service {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 60px;
  padding: 0 16px;
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: var(--r-card);
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.service--on { background: var(--raised); border-color: var(--accent); }

.service__dot {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1.5px solid var(--dim);
}

.service--on .service__dot { border-color: var(--accent); background: var(--accent); }

.service__dot::after { content: ''; width: 8px; height: 8px; border-radius: 50%; }
.service--on .service__dot::after { background: var(--on-accent); }

.service__text { display: flex; flex-direction: column; flex-grow: 1; min-width: 0; }
.service__name { font-size: 16px; font-weight: 600; line-height: 1.3; }
.service__meta { font-size: 13px; line-height: 1.3; color: var(--muted); }

.service__price {
  font-family: var(--display);
  font-weight: 600;
  font-size: 22px;
  line-height: 1;
}

/* Day strip --------------------------------------------------------------- */
.days {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: calc((100% - 40px) / 6);
  gap: 8px;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  padding-bottom: 4px;
  scrollbar-width: none;
}

.days::-webkit-scrollbar { display: none; }

.day {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  height: 64px;
  padding: 0;
  scroll-snap-align: start;
  border: 1.5px solid var(--line);
  border-radius: var(--r-chip);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}

.day--on { background: var(--accent); border-color: transparent; color: var(--on-accent); }

.day--closed {
  background: transparent;
  border-style: dashed;
  color: var(--dim);
  cursor: not-allowed;
}

.day__name {
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.day--on .day__name { color: var(--on-accent); }
.day--closed .day__name { color: var(--dim); }

.day__num { font-family: var(--display); font-weight: 700; font-size: 24px; line-height: 1; }

/* Slots ------------------------------------------------------------------- */
.slot-group { display: flex; flex-direction: column; gap: 8px; }

.slot-group__label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--tertiary);
}

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

.slot { display: block; }

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

.slot span {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 44px;
  border: 1.5px solid var(--line);
  border-radius: var(--r-small);
  background: var(--surface);
  color: var(--text);
  font-size: 14.5px;
  font-weight: 500;
  cursor: pointer;
}

.slot input:checked + span {
  background: var(--accent);
  border-color: transparent;
  color: var(--on-accent);
  font-weight: 600;
}

.slot input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Taken or too soon: shown struck through, not hidden (decision D1). */
.slot--off span {
  background: transparent;
  border-color: var(--raised);
  color: var(--dim);
  text-decoration: line-through;
  cursor: not-allowed;
}

.empty-slots {
  padding: 18px 0;
  text-align: center;
  font-size: 14px;
  color: var(--muted);
}

/* Fields ------------------------------------------------------------------ */
.fields { display: flex; flex-direction: column; gap: 12px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 13px; color: var(--muted); }

.field input {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  background: var(--surface);
  border: 1.5px solid var(--line-input);
  border-radius: var(--r-chip);
  color: var(--text);
  font-size: 16px;
}

.field input:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

.field__error { font-size: 13px; color: var(--pole-red); }

.alert {
  margin: 0 20px 16px;
  padding: 12px 14px;
  border: 1.5px solid var(--pole-red);
  border-radius: var(--r-chip);
  background: var(--surface);
  font-size: 14px;
}

/* Sticky summary ---------------------------------------------------------- */
.summary {
  position: sticky;
  bottom: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px 20px 20px;
  background: var(--bar);
  border-top: 1px solid var(--line);
}

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

.summary__text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.summary__name { font-size: 16px; font-weight: 600; line-height: 1.3; }
.summary__meta { font-size: 14px; line-height: 1.3; color: var(--muted); }

.summary__price {
  font-family: var(--display);
  font-weight: 700;
  font-size: 30px;
  line-height: 1;
}

.summary__note { margin: 0; text-align: center; font-size: 13px; color: var(--muted); }
.summary__brand { margin: 0; text-align: center; font-size: 12px; color: var(--tertiary); }

/* Buttons ----------------------------------------------------------------- */
.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 56px;
  padding: 0 20px;
  border: 0;
  border-radius: var(--r-card);
  background: var(--accent);
  color: var(--on-accent);
  font-family: var(--display);
  font-weight: 700;
  font-size: 20px;
  line-height: 1;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
}

.btn:disabled { background: var(--raised); color: var(--dim); cursor: not-allowed; }

.btn--ghost {
  background: transparent;
  border: 1.5px solid var(--line-strong);
  color: var(--text);
}

.btn--danger { background: transparent; border: 1.5px solid var(--pole-red); color: var(--text); }

/* Confirmation and manage pages ------------------------------------------- */
.panel { display: flex; flex-direction: column; gap: 20px; padding: 8px 20px 24px; }

.panel__title {
  margin: 0;
  font-family: var(--display);
  font-weight: 700;
  font-size: 32px;
  line-height: 1.05;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.ticket {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px;
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: var(--r-card);
}

.ticket__when {
  font-family: var(--display);
  font-weight: 700;
  font-size: 26px;
  line-height: 1.1;
  letter-spacing: 0.02em;
}

.ticket__row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.ticket__label { font-size: 13px; color: var(--muted); }
.ticket__value { font-size: 15px; font-weight: 600; text-align: right; }
.ticket__sep { height: 1px; background: var(--line); }

.ticket--cancelled { opacity: 0.6; }

.manage-link {
  padding: 14px;
  background: var(--surface);
  border: 1px dashed var(--line-strong);
  border-radius: var(--r-chip);
  font-size: 13px;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.actions { display: flex; flex-direction: column; gap: 10px; }

/* A button inside a form is not a flex item of .actions, and buttons shrink to their
   content, so the form has to pass the full width down to it. */
.actions form { display: flex; flex-direction: column; }

.icon { flex-shrink: 0; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ========================================================================== */
/* Barber side: agenda                                                        */
/* ========================================================================== */

.agenda-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 20px 16px;
}

.agenda-head__text { display: flex; flex-direction: column; gap: 4px; min-width: 0; }

.agenda-head__eyebrow {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}

.agenda-head__date {
  margin: 0;
  font-family: var(--display);
  font-weight: 700;
  font-size: 28px;
  line-height: 1.05;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.agenda-head__nav { display: flex; gap: 8px; flex-shrink: 0; }

.icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border: 1.5px solid var(--line);
  border-radius: var(--r-chip);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  text-decoration: none;
}

.icon-btn--small { width: 36px; height: 36px; border-radius: var(--r-small); }

/* Stats strip ------------------------------------------------------------- */
.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0 20px;
  border: 1.5px solid var(--line);
  border-radius: var(--r-card);
  background: var(--surface);
  overflow: hidden;
}

.stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 14px 8px;
  border-left: 1px solid var(--line);
}

.stat:first-child { border-left: 0; }

.stat__value { font-family: var(--display); font-weight: 700; font-size: 26px; line-height: 1; }
.stat__label { font-size: 12px; color: var(--muted); text-align: center; }

/* Booking-link card ------------------------------------------------------- */
.link-card {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 12px 20px 0;
  padding: 12px 14px;
  border: 1.5px solid var(--line);
  border-radius: var(--r-card);
  background: var(--surface);
}

.link-card__text { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex-grow: 1; }
.link-card__label { font-size: 12px; color: var(--muted); }

.link-card__url {
  font-size: 14px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chip-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  min-height: 44px;
  padding: 0 9px;
  flex-shrink: 0;
  border: 1.5px solid var(--line-strong);
  border-radius: var(--r-small);
  background: transparent;
  color: var(--accent);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.chip-btn--quiet { border-color: var(--line); color: var(--muted); cursor: default; }

/* Day list ---------------------------------------------------------------- */
.agenda { display: flex; flex-direction: column; gap: 8px; padding: 16px 20px 8px; }

.row { display: flex; align-items: stretch; gap: 12px; }

.row__time {
  width: 58px;
  flex-shrink: 0;
  padding-top: 14px;
  font-family: var(--display);
  font-weight: 700;
  font-size: 17px;
  line-height: 1;
  color: var(--muted);
  text-align: right;
}

.row--done .row__time { padding-top: 10px; font-size: 15px; }

.card {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-grow: 1;
  min-width: 0;
  min-height: 56px;
  padding: 10px 12px;
  border: 1.5px solid var(--line);
  border-radius: var(--r-card);
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
}

.card--chair { border-color: var(--accent); background: var(--raised); }
.card--muted { opacity: 0.55; }

.card--free {
  justify-content: space-between;
  border-style: dashed;
  background: transparent;
  color: var(--muted);
}

/* Hatched band: the one gradient allowed besides the barber pole. */
.card--blocked {
  justify-content: space-between;
  border-color: var(--line);
  color: var(--muted);
  background-image: repeating-linear-gradient(
    135deg, transparent 0 6px, rgba(255, 255, 255, 0.04) 6px 12px);
}

.card__text { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex-grow: 1; }
.card__title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.card__name { font-size: 16px; font-weight: 600; line-height: 1.25; }
.card__meta { font-size: 13.5px; color: var(--muted); }
.card--blocked .card__text { flex-direction: row; align-items: center; gap: 8px; }

.card__action { display: flex; align-items: center; gap: 6px; color: var(--accent); font-weight: 600; }
.card__actions { display: flex; align-items: center; gap: 2px; flex-shrink: 0; }

/* The mockup's card has no overflow menu; ours does, so the text column is tighter. */
.card__meta { overflow-wrap: anywhere; }

.tag {
  padding: 3px 7px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}

.tag--accent { border-color: var(--accent); color: var(--accent); }

/* Now marker -------------------------------------------------------------- */
.now-marker { display: flex; align-items: center; gap: 10px; padding: 2px 0; }

.now-marker__label {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  white-space: nowrap;
}

.now-marker__line { flex-grow: 1; height: 1.5px; background: var(--accent); }

/* Completed, collapsed ---------------------------------------------------- */
.done-group { border: 0; }

.done-group__summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 48px;
  padding: 0 14px;
  border: 1.5px solid var(--line);
  border-radius: var(--r-card);
  background: var(--surface);
  color: var(--muted);
  font-size: 14px;
  cursor: pointer;
  list-style: none;
}

.done-group__summary::-webkit-details-marker { display: none; }
.done-group__text { display: flex; align-items: center; gap: 8px; }
.done-group[open] .done-group__summary { margin-bottom: 8px; }
.done-group .row { margin-bottom: 8px; }

/* Row menu ---------------------------------------------------------------- */
.more { position: relative; }
.more > summary { list-style: none; }
.more > summary::-webkit-details-marker { display: none; }

.more__menu {
  position: absolute;
  right: 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  min-width: 160px;
  padding: 6px;
  border: 1.5px solid var(--line-strong);
  border-radius: var(--r-chip);
  background: var(--bar);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.5);
}

.more__item {
  width: 100%;
  min-height: 44px;
  padding: 0 10px;
  border: 0;
  border-radius: var(--r-small);
  background: transparent;
  color: var(--text);
  font-size: 15px;
  text-align: left;
  cursor: pointer;
}

.more__item--danger { color: var(--pole-red); }

/* Bottom actions and sheets ----------------------------------------------- */
.agenda-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 20px;
  background: var(--ground);
}

.sheet > summary { list-style: none; }
.sheet > summary::-webkit-details-marker { display: none; }

.sheet__body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 10px;
  padding: 14px;
  border: 1.5px solid var(--line);
  border-radius: var(--r-card);
  background: var(--surface);
}

.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.field select,
.field input[type="time"] {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  background: var(--surface);
  border: 1.5px solid var(--line-input);
  border-radius: var(--r-chip);
  color: var(--text);
  font-size: 16px;
}

/* Tab bar ----------------------------------------------------------------- */
.tabs {
  position: sticky;
  bottom: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  background: var(--bar);
  border-top: 1px solid var(--line);
}

.tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-height: 64px;
  color: var(--muted);
  font-size: 11.5px;
  text-decoration: none;
}

.tab--on { color: var(--accent); }

/* Clients ----------------------------------------------------------------- */
.client-list { display: flex; flex-direction: column; gap: 8px; padding: 16px 20px 8px; }

.client {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1.5px solid var(--line);
  border-radius: var(--r-card);
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
}

.client__text { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex-grow: 1; }
.client__history { font-size: 12.5px; color: var(--tertiary); }

.client__right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  color: var(--accent);
}

.client__spent { font-family: var(--display); font-weight: 700; font-size: 20px; line-height: 1; }

.client-note { margin: 4px 0 0; font-size: 13px; color: var(--tertiary); }

/* Settings ---------------------------------------------------------------- */
.settings { display: flex; flex-direction: column; gap: 12px; padding: 8px 20px 20px; }

.settings__title {
  margin: 8px 0 0;
  font-family: var(--display);
  font-weight: 700;
  font-size: 20px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.settings__sub { margin: 0; font-size: 15px; font-weight: 600; }

.sheet__body--off { opacity: 0.6; border-style: dashed; }

.field__hint { font-size: 12.5px; color: var(--tertiary); }

.chip-btn--plain { color: var(--muted); border-color: var(--line); }

.notice {
  margin: 0 20px 8px;
  padding: 10px 14px;
  border: 1.5px solid var(--accent);
  border-radius: var(--r-chip);
  background: var(--surface);
  font-size: 14px;
}

.hours-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.hours-row:last-of-type { border-bottom: 0; padding-bottom: 0; }

.hours-row__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }

.hours-row__day {
  font-family: var(--display);
  font-weight: 700;
  font-size: 18px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.hours-row__closed {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  font-size: 14px;
  color: var(--muted);
  cursor: pointer;
}

.hours-row__closed input { width: 20px; height: 20px; accent-color: var(--accent); }

.confirm-bar { display: flex; flex-direction: column; margin: 0 20px 8px; }

.daypick {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 20px 12px;
}

.daypick input[type="date"] {
  flex-grow: 1;
  min-width: 0;
  height: 44px;
  padding: 0 12px;
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: var(--r-chip);
  color: var(--text);
  font-size: 15px;
}

/* The native picker icon is black on black without this. */
.daypick input[type="date"]::-webkit-calendar-picker-indicator { filter: invert(1); opacity: 0.6; }
