/* =========================================================
   Mono Beauty — Mini App
   Monochrome editorial UI. Hairlines, air, oversized type.
   Red appears only for cancellation and errors.
   ========================================================= */

/* ---------- 01. Fonts ---------- */
@font-face {
  font-family: "Onest";
  src: url("assets/fonts/onest-cyrillic.woff2") format("woff2");
  font-weight: 400 800;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Onest";
  src: url("assets/fonts/onest-latin.woff2") format("woff2");
  font-weight: 400 800;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("assets/fonts/jetbrains-mono-cyrillic.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("assets/fonts/jetbrains-mono-latin.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ---------- 02. Tokens ---------- */
:root {
  color-scheme: light;
  --paper: #f4f4f4;
  --ink: #0a0a0a;
  --ink-2: #2c2c2c;
  --muted: #686868;
  --faint: #8c8c8c;
  --line: #d8d8d8;
  --line-strong: #b8b8b8;
  --red: #b3261e;
  --red-ink: #8c1d18;
  --on-red: #ffffff;
  --ticket-line: rgba(244, 244, 244, 0.26);

  --maxw: 620px;
  --pad: clamp(20px, 5.4vw, 28px);
  --nav-h: 52px;
  --safe-top: max(env(safe-area-inset-top, 0px), var(--tg-top, 0px));
  --safe-bottom: max(env(safe-area-inset-bottom, 0px), var(--tg-bottom, 0px));

  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);
  --dur-press: 120ms;
  --dur-enter: 200ms;
}

[data-theme="dark"] {
  color-scheme: dark;
  --paper: #0d0d0d;
  --ink: #f2f2f2;
  --ink-2: #d2d2d2;
  --muted: #9b9b9b;
  --faint: #707070;
  --line: #272727;
  --line-strong: #3d3d3d;
  --red: #ff6a5e;
  --red-ink: #ffa39b;
  --on-red: #0d0d0d;
  --ticket-line: rgba(13, 13, 13, 0.26);
}

/* ---------- 03. Reset & base ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--paper);
  color: var(--ink);
  font-family: "Onest", "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

h1,
h2,
h3,
p,
figure {
  margin: 0;
}

ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

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

button {
  padding: 0;
  border: 0;
  background: none;
  text-align: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
}

img,
svg {
  display: block;
  max-width: 100%;
}

::selection {
  background: var(--ink);
  color: var(--paper);
}

:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

/* ---------- 04. Type primitives ---------- */
.display {
  font-size: clamp(2.15rem, 9.2vw, 2.9rem);
  font-weight: 500;
  line-height: 0.99;
  letter-spacing: -0.045em;
}

.page-title {
  font-size: clamp(2rem, 8.6vw, 2.65rem);
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.045em;
  text-wrap: balance;
}

.mega {
  font-size: clamp(3.4rem, 17vw, 5.2rem);
  font-weight: 500;
  line-height: 0.88;
  letter-spacing: -0.06em;
}

.eyebrow {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
}

.lead {
  color: var(--ink-2);
  font-size: 15px;
  line-height: 1.55;
  max-width: 46ch;
}

.note {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
  max-width: 46ch;
}

.mono {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-variant-numeric: tabular-nums;
}

.money {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* ---------- 05. Chrome ---------- */
.app {
  width: 100%;
  max-width: var(--maxw);
  min-height: 100dvh;
  margin: 0 auto;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 52px;
  padding: calc(8px + var(--safe-top)) var(--pad) 8px;
  background: var(--paper);
}

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

.topbar__brand {
  overflow: hidden;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: -0.01em;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.back {
  flex: 0 0 auto;
  margin-left: -4px;
  padding: 6px 4px;
  color: var(--muted);
  font-size: 13px;
}

.back:active {
  transform: scale(0.97);
}

.avatar {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.avatar:active {
  transform: scale(0.94);
}

.preview-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 8px var(--pad);
  background: var(--ink);
  color: var(--paper);
  font-size: 12px;
  line-height: 1.3;
}

.preview-banner button {
  flex: 0 0 auto;
  color: inherit;
  font-size: 12px;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.screen {
  padding: 10px var(--pad) calc(30px + var(--safe-bottom));
}

body.has-nav .screen {
  padding-bottom: calc(var(--nav-h) + var(--safe-bottom) + 30px);
}

body.has-main .screen {
  padding-bottom: calc(96px + var(--safe-bottom));
}

/* ---------- 06. Motion ---------- */
.screen-enter .reveal {
  animation: rise var(--dur-enter) var(--ease-out) both;
  animation-delay: calc(var(--i, 0) * 28ms);
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translate3d(0, 7px, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes pulse {
  0%,
  100% {
    opacity: 0.42;
  }
  50% {
    opacity: 0.2;
  }
}

.btn,
.category-row,
.service-row,
.day,
.time-slot,
.chip,
.choice,
.tab,
.avatar,
.back {
  transition: transform var(--dur-press) var(--ease-out);
}

.btn:active {
  transform: scale(0.97);
}

.category-row:active,
.service-row:active,
.choice:active,
.staff-row:active,
.svc-row:active {
  transform: scale(0.985);
}

.day:active,
.time-slot:active,
.chip:active {
  transform: scale(0.95);
}

/* ---------- 07. Home ---------- */
.masthead {
  padding: 18px 0 0;
}

.wordmark {
  display: flex;
  flex-direction: column;
  font-size: clamp(3.6rem, 18.5vw, 6.2rem);
  font-weight: 600;
  line-height: 0.8;
  letter-spacing: -0.07em;
}

.wordmark span:last-child {
  padding-left: 0.5em;
}

.masthead__meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 6px 18px;
  margin-top: clamp(26px, 7vw, 38px);
  padding-top: 10px;
  border-top: 1px solid var(--line-strong);
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.4;
}

.section {
  margin-top: clamp(34px, 9vw, 48px);
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line-strong);
}

.section-head h2 {
  font-size: 18px;
  font-weight: 500;
  letter-spacing: -0.02em;
}

.section-head__meta {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 11px;
}

.category-row {
  display: block;
  width: 100%;
  padding: 21px 0;
  border-bottom: 1px solid var(--line);
  transform-origin: left center;
}

.category-row__name {
  display: block;
  font-size: 24px;
  font-weight: 500;
  line-height: 1.06;
  letter-spacing: -0.03em;
}

.category-row__meta {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
}

.home-note {
  margin-top: 26px;
}

/* ---------- 08. Service lists ---------- */
.page-head {
  padding-top: 14px;
}

.page-head .page-title {
  margin-top: 8px;
}

.page-head__meta {
  margin-top: 10px;
  color: var(--muted);
  font-size: 12px;
}

.service-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 18px;
  width: 100%;
  padding: 17px 0;
  border-bottom: 1px solid var(--line);
  transform-origin: left center;
}

.service-row__name {
  display: block;
  font-size: 16.5px;
  font-weight: 500;
  line-height: 1.25;
  letter-spacing: -0.015em;
}

.service-row__meta {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 11.5px;
}

.service-row__price {
  flex: 0 0 auto;
  font-size: 14.5px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.detail-head {
  padding-top: 16px;
}

.detail-head .eyebrow {
  margin-bottom: 10px;
}

.price-line {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin-top: 18px;
}

.price-line__value {
  font-size: 30px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.045em;
  font-variant-numeric: tabular-nums;
}

.price-line__meta {
  color: var(--muted);
  font-size: 12px;
}

.detail-description {
  margin-top: 16px;
}

.subsection {
  margin-top: 36px;
}

.subsection-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line-strong);
}

.subsection-head h2 {
  font-size: 16px;
  font-weight: 500;
  letter-spacing: -0.02em;
}

.subsection-head span {
  color: var(--muted);
  font-size: 11px;
}

.choice {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  width: 100%;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
  transform-origin: left center;
}

.choice__dot {
  flex: 0 0 auto;
  width: 15px;
  height: 15px;
  margin-top: 3px;
  border: 1px solid var(--ink);
  border-radius: 50%;
}

.choice[aria-pressed="true"] .choice__dot {
  background: var(--ink);
  box-shadow: inset 0 0 0 3px var(--paper);
}

.choice__name {
  display: block;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.3;
}

.choice__meta {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11.5px;
}

.inline-empty {
  padding: 38px 0;
  border-bottom: 1px solid var(--line);
}

.inline-empty h3 {
  font-size: 21px;
  font-weight: 500;
  letter-spacing: -0.025em;
}

.inline-empty p {
  max-width: 38ch;
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
}

/* ---------- 09. Date & time ---------- */
.date-context {
  color: var(--muted);
  font-size: 12px;
}

.rail {
  display: flex;
  gap: 6px;
  margin: 22px calc(var(--pad) * -1) 0;
  padding: 2px var(--pad);
  overflow-x: auto;
  scrollbar-width: none;
  scroll-snap-type: x proximity;
  overscroll-behavior-x: contain;
}

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

.day {
  position: relative;
  display: flex;
  flex: 0 0 54px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  height: 68px;
  border: 1px solid var(--line);
  scroll-snap-align: center;
}

.day__wd {
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1;
  text-transform: lowercase;
}

.day__num {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 17px;
  line-height: 1.1;
}

.day__dot {
  width: 3px;
  height: 3px;
  margin-top: 1px;
  border-radius: 50%;
  background: currentColor;
  visibility: hidden;
}

.day.has-bookings .day__dot {
  visibility: visible;
}

.day[aria-pressed="true"] {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--paper);
}

.day[aria-pressed="true"] .day__wd {
  color: inherit;
  opacity: 0.65;
}

.day-label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-top: 28px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line-strong);
}

.day-label h2 {
  font-size: 21px;
  font-weight: 500;
  letter-spacing: -0.03em;
}

.day-label span {
  color: var(--muted);
  font-size: 11px;
}

.time-group {
  margin-top: 26px;
}

.time-group__label {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 11px;
}

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

.time-slot {
  display: grid;
  place-items: center;
  height: 48px;
  border: 1px solid var(--line);
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 13.5px;
  font-variant-numeric: tabular-nums;
}

.time-slot[aria-pressed="true"] {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--paper);
}

.skeleton-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  margin-top: 26px;
}

.skeleton {
  height: 48px;
  background: var(--line);
  animation: pulse 1.4s ease-in-out infinite;
}

.skeleton:nth-child(2n) {
  animation-delay: 120ms;
}

.skeleton:nth-child(3n) {
  animation-delay: 240ms;
}

.slots-empty {
  margin-top: 26px;
  padding: 32px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.slots-empty h3 {
  font-size: 21px;
  font-weight: 500;
  letter-spacing: -0.025em;
}

.slots-empty p {
  max-width: 38ch;
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
}

/* ---------- 10. Confirmation & ticket ---------- */
.summary {
  margin-top: 28px;
  border-top: 1px solid var(--line-strong);
}

.summary__row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}

.summary__label {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 12px;
}

.summary__value {
  max-width: 68%;
  text-align: right;
}

.total-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
  margin-top: 24px;
}

.total-row span:first-child {
  color: var(--muted);
  font-size: 12px;
}

.total-row strong {
  font-size: clamp(2.1rem, 8.5vw, 2.7rem);
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.05em;
  font-variant-numeric: tabular-nums;
}

.confirm-note {
  margin-top: 26px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.success-head {
  padding-top: 26px;
}

.success-head .mega {
  margin-top: 10px;
}

.success-lead {
  margin-top: 16px;
}

.ticket {
  margin-top: 30px;
  padding: 22px;
  background: var(--ink);
  color: var(--paper);
}

.ticket__top {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}

.ticket__date {
  font-size: 12px;
  line-height: 1.3;
  opacity: 0.68;
}

.ticket__time {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: clamp(2.1rem, 9vw, 2.7rem);
  line-height: 0.9;
  letter-spacing: -0.04em;
}

.ticket__divider {
  margin: 18px 0 4px;
  border-top: 1px solid var(--ticket-line);
}

.ticket__row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 18px;
  padding: 9px 0;
  font-size: 13px;
}

.ticket__row span:first-child {
  opacity: 0.6;
}

.ticket__row span:last-child {
  text-align: right;
}

.stack {
  display: grid;
  gap: 10px;
  margin-top: 28px;
}

/* ---------- 11. Bookings ---------- */
.segmented {
  display: flex;
  gap: 22px;
  margin-top: 20px;
  border-bottom: 1px solid var(--line);
}

.segmented button {
  position: relative;
  padding: 10px 0;
  color: var(--muted);
  font-size: 13px;
}

.segmented button[aria-selected="true"] {
  color: var(--ink);
}

.segmented button[aria-selected="true"]::after {
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 1px;
  background: var(--ink);
  content: "";
}

.booking {
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}

.booking__top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  color: var(--muted);
  font-size: 11.5px;
}

.booking__time {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  color: var(--ink);
  font-size: 12px;
}

.booking__title {
  margin-top: 7px;
  font-size: 18px;
  font-weight: 500;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

.booking__meta {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.booking__bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 12px;
}

.status {
  display: inline-block;
  padding: 4px 7px;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.15;
}

.status--pending {
  border-color: var(--ink);
  color: var(--ink);
}

.status--cancelled {
  border-color: var(--red);
  color: var(--red);
}

.link-danger {
  color: var(--red);
  font-size: 12.5px;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.empty {
  padding: 44px 0 18px;
}

.empty h2 {
  font-size: 24px;
  font-weight: 500;
  letter-spacing: -0.035em;
}

.empty p {
  max-width: 40ch;
  margin-top: 9px;
  color: var(--muted);
  font-size: 13px;
}

.empty .btn {
  margin-top: 22px;
}

/* ---------- 12. Worker schedule ---------- */
.schedule-head {
  padding-top: 16px;
}

.schedule-name {
  margin-top: 6px;
  font-size: clamp(2rem, 8.5vw, 2.7rem);
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.045em;
}

.schedule-meta {
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
}

.worker-chips {
  display: flex;
  gap: 6px;
  margin: 18px calc(var(--pad) * -1) 0;
  padding: 0 var(--pad) 2px;
  overflow-x: auto;
  scrollbar-width: none;
}

.worker-chips::-webkit-scrollbar {
  display: none;
}

.chip {
  flex: 0 0 auto;
  min-height: 34px;
  padding: 8px 11px;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  line-height: 1;
}

.chip[aria-pressed="true"] {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--paper);
}

.day-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-top: 28px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line-strong);
}

.day-title h2 {
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -0.03em;
}

.day-title span {
  color: var(--muted);
  font-size: 11px;
}

.appointment {
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr);
  gap: 14px;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}

.appointment__time {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 17px;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}

.appointment__client {
  font-size: 16px;
  font-weight: 500;
  line-height: 1.3;
}

.appointment__service {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.4;
}

.appointment__status {
  margin-top: 8px;
}

.appointment__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  grid-column: 2;
  margin-top: 3px;
}

/* ---------- 13. Admin ---------- */
.admin-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding-top: 14px;
}

.admin-head__meta {
  margin-top: 10px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.text-action {
  flex: 0 0 auto;
  padding: 6px 0;
  border-bottom: 1px solid currentColor;
  font-size: 12px;
  line-height: 1.2;
}

.filters {
  display: flex;
  gap: 6px;
  margin: 18px calc(var(--pad) * -1) 0;
  padding: 0 var(--pad) 2px;
  overflow-x: auto;
  scrollbar-width: none;
}

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

.date-head {
  margin-top: 26px;
  padding-bottom: 8px;
  color: var(--muted);
  font-size: 11px;
}

.admin-row {
  padding: 16px 0;
  border-top: 1px solid var(--line);
}

.admin-row__top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  color: var(--muted);
  font-size: 11.5px;
}

.admin-row__time {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  color: var(--ink);
  font-size: 12px;
}

.admin-row__title {
  margin-top: 6px;
  font-size: 17px;
  font-weight: 500;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

.admin-row__meta {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.admin-row__bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
}

.admin-row__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-left: auto;
}

.staff-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
  transform-origin: left center;
}

.staff-row__name {
  font-size: 16.5px;
  font-weight: 500;
  line-height: 1.3;
}

.staff-row__meta {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11.5px;
}

.role-tag {
  flex: 0 0 auto;
  padding: 4px 7px;
  border: 1px solid var(--line-strong);
  font-size: 10.5px;
  line-height: 1.15;
  white-space: nowrap;
}

.admin-note {
  margin-top: 24px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.svc-group {
  margin-top: 28px;
}

.svc-group h2 {
  padding-bottom: 7px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 400;
}

.svc-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  transform-origin: left center;
}

.svc-row__name {
  font-size: 15px;
  font-weight: 500;
  line-height: 1.3;
}

.svc-row__meta {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.svc-row__price {
  flex: 0 0 auto;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.svc-row.is-inactive {
  opacity: 0.45;
}

/* ---------- 14. Buttons ---------- */
.btn {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  padding: 0 18px;
  border: 1px solid var(--ink);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.2;
  text-align: center;
}

.btn--primary {
  background: var(--ink);
  color: var(--paper);
}

.btn--ghost {
  background: transparent;
  color: var(--ink);
}

.btn--danger {
  border-color: var(--red);
  background: var(--red);
  color: var(--on-red);
}

.btn--block {
  width: 100%;
}

.btn--sm {
  min-height: 36px;
  padding: 0 11px;
  font-size: 12px;
}

.btn[disabled] {
  opacity: 0.34;
  pointer-events: none;
}

/* ---------- 15. Support screen ---------- */
.support-head {
  padding-top: 34px;
}

.support-head .mega {
  margin-top: 10px;
}

.support-copy {
  margin-top: 22px;
  border-top: 1px solid var(--line-strong);
  padding-top: 16px;
}

.support-copy p + p {
  margin-top: 14px;
}

/* ---------- 16. Tabbar & actionbar ---------- */
.tabbar {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 40;
  border-top: 1px solid var(--line);
  background: var(--paper);
  padding-bottom: var(--safe-bottom);
}

.tabbar__inner {
  display: grid;
  grid-auto-columns: 1fr;
  grid-auto-flow: column;
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
}

.tab {
  position: relative;
  padding: 15px 4px 13px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.tab[aria-current="page"] {
  color: var(--ink);
  font-weight: 500;
}

.tab[aria-current="page"]::before {
  position: absolute;
  top: 0;
  left: 50%;
  width: 20px;
  height: 2px;
  background: var(--ink);
  content: "";
  transform: translateX(-50%);
}

.actionbar {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 45;
  padding: 12px var(--pad) calc(12px + var(--safe-bottom));
  border-top: 1px solid var(--line);
  background: var(--paper);
}

.actionbar .btn {
  width: 100%;
  max-width: calc(var(--maxw) - var(--pad) * 2);
  margin: 0 auto;
}

/* ---------- 17. Toast ---------- */
.toast-host {
  --toast-offset: calc(16px + var(--safe-bottom));
  position: fixed;
  right: 0;
  bottom: var(--toast-offset);
  left: 0;
  z-index: 90;
  display: flex;
  justify-content: center;
  padding: 0 var(--pad);
  pointer-events: none;
}

body.has-nav .toast-host {
  --toast-offset: calc(var(--nav-h) + var(--safe-bottom) + 12px);
}

body.has-main .toast-host {
  --toast-offset: calc(86px + var(--safe-bottom));
}

.toast {
  max-width: 440px;
  padding: 11px 14px;
  background: var(--ink);
  color: var(--paper);
  font-size: 12.5px;
  line-height: 1.4;
  opacity: 0;
  transform: translateY(6px);
  transition:
    opacity 160ms var(--ease-out),
    transform 160ms var(--ease-out);
}

.toast.is-in {
  opacity: 1;
  transform: translateY(0);
}

.toast--error {
  background: var(--red);
  color: var(--on-red);
}

/* ---------- 18. Sheet ---------- */
dialog.sheet {
  position: fixed;
  top: auto;
  right: 0;
  bottom: 0;
  left: 0;
  width: 100%;
  max-width: var(--maxw);
  max-height: 94dvh;
  margin: 0 auto;
  padding: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 0;
  border-top: 1px solid var(--line-strong);
  background: var(--paper);
  color: var(--ink);
  transform: translate3d(0, 100%, 0);
  transition: transform 260ms var(--ease-drawer);
}

dialog.sheet.is-open {
  transform: translate3d(0, 0, 0);
}

dialog.sheet.is-closing {
  transform: translate3d(0, 100%, 0);
  transition-duration: 200ms;
  transition-timing-function: var(--ease-out);
}

dialog.sheet::backdrop {
  background: rgba(0, 0, 0, 0.42);
  opacity: 0;
  transition: opacity 200ms var(--ease-out);
}

dialog.sheet.is-open::backdrop {
  opacity: 1;
}

body.sheet-open {
  overflow: hidden;
}

.sheet__inner {
  padding: 22px var(--pad) calc(24px + var(--safe-bottom));
}

.sheet__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.sheet__title {
  font-size: 26px;
  font-weight: 500;
  line-height: 1.04;
  letter-spacing: -0.035em;
  text-wrap: balance;
}

.sheet__close {
  flex: 0 0 auto;
  padding: 4px 0;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.2;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.sheet__body {
  margin-top: 18px;
}

.sheet__actions {
  display: grid;
  gap: 9px;
  margin-top: 26px;
}

.sheet-note {
  margin-top: 16px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.sheet-profile-name {
  font-size: 27px;
  font-weight: 500;
  line-height: 1.05;
  letter-spacing: -0.035em;
}

.sheet-profile-meta {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12.5px;
}

.sheet-section {
  margin-top: 24px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.sheet-section__label {
  margin-bottom: 9px;
  color: var(--muted);
  font-size: 11px;
}

.profile-actions {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

/* ---------- 19. Forms ---------- */
.form {
  margin-top: 6px;
}

.field {
  display: block;
  margin-top: 18px;
}

.field__label {
  display: block;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.3;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  margin-top: 2px;
  padding: 9px 0;
  border: 0;
  border-bottom: 1px solid var(--line-strong);
  border-radius: 0;
  background: transparent;
  font-size: 17px;
  line-height: 1.3;
  appearance: none;
}

.field textarea {
  min-height: 86px;
  resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-bottom-color: var(--ink);
  box-shadow: 0 1px 0 0 var(--ink);
}

.field__hint {
  margin-top: 6px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}

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

.role-picker {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
  margin-top: 8px;
}

.role-option {
  position: relative;
  cursor: pointer;
}

.role-option input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.role-option span {
  display: flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  padding: 8px;
  border: 1px solid var(--line);
  font-size: 12.5px;
  line-height: 1.2;
  text-align: center;
}

.role-option input:checked + span {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--paper);
}

.role-option input:focus-visible + span {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

.switch {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 20px;
  padding: 13px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}

.switch input {
  position: relative;
  flex: 0 0 auto;
  width: 44px;
  height: 24px;
  margin: 0;
  border: 1px solid var(--ink);
  border-radius: 0;
  background: transparent;
  appearance: none;
}

.switch input::after {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  background: var(--ink);
  content: "";
  transition: transform 150ms var(--ease-out);
}

.switch input:checked::after {
  transform: translateX(20px);
}

/* ---------- 20. Boot & fatal ---------- */
.boot {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 22vh var(--pad) 40px;
  background: var(--paper);
  opacity: 1;
  transition: opacity 240ms var(--ease-out);
}

.boot.is-done {
  opacity: 0;
  pointer-events: none;
}

.boot__mark {
  font-size: clamp(3.4rem, 15vw, 4.6rem);
  font-weight: 600;
  line-height: 0.82;
  letter-spacing: -0.065em;
}

.boot__rule {
  width: 34px;
  height: 1px;
  margin: 26px 0 14px;
  background: var(--ink);
}

.boot__status {
  color: var(--muted);
  font-size: 12px;
}

.fatal {
  padding-top: 42px;
}

.fatal h1 {
  max-width: 12ch;
  font-size: clamp(2.2rem, 10vw, 3rem);
  font-weight: 500;
  line-height: 0.98;
  letter-spacing: -0.05em;
}

.fatal p {
  max-width: 42ch;
  margin-top: 16px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.fatal code {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 12px;
}

.fatal .btn {
  margin-top: 24px;
}

/* ---------- 21. Hover ---------- */
@media (hover: hover) and (pointer: fine) {
  .category-row:hover .category-row__name,
  .service-row:hover .service-row__name,
  .choice:hover .choice__name,
  .staff-row:hover .staff-row__name,
  .svc-row:hover .svc-row__name {
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 4px;
  }

  .tab:hover {
    color: var(--ink);
  }
}

/* ---------- 22. Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .screen-enter .reveal {
    animation: fade-in 160ms ease-out both;
    animation-delay: 0ms;
  }

  .btn:active,
  .category-row:active,
  .service-row:active,
  .choice:active,
  .day:active,
  .time-slot:active,
  .chip:active,
  .staff-row:active,
  .svc-row:active,
  .tab:active,
  .avatar:active,
  .back:active {
    transform: none;
  }

  dialog.sheet,
  dialog.sheet.is-closing {
    transition: none;
  }

  dialog.sheet::backdrop {
    transition: none;
  }

  .toast {
    transition: opacity 120ms linear;
  }

  .skeleton {
    animation: none;
    opacity: 0.32;
  }

  .switch input::after {
    transition: none;
  }
}

/* ---------- 23. Wider viewports ---------- */
@media (min-width: 680px) {
  .topbar {
    padding-top: calc(14px + var(--safe-top));
  }

  .screen {
    padding-top: 16px;
  }

  .time-slot {
    height: 50px;
  }
}
