 :root {
  color-scheme: dark;
  --font-system: "SF Pro Text", "SF Pro Display", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;

  /* Brandbook: Точность в движении */
  --brand-yellow: #ffc400;
  --brand-cream: #e6e0d6;
  --brand-brown: #2f241f;
  --brand-graphite: #1a1d21;
  --brand-steel: #5b5f68;

  /* Apple-like semantic system mapped onto the brand */
  --color-bg: #0b0d0f;
  --color-bg-elevated: rgba(26, 29, 33, 0.88);
  --color-surface: rgba(26, 29, 33, 0.82);
  --color-surface-solid: #1a1d21;
  --color-surface-2: #23272c;
  --color-label: #f5f5f7;
  --color-label-secondary: #b7b7bc;
  --color-label-tertiary: #7f838a;
  --color-separator: rgba(230, 224, 214, 0.14);
  --color-separator-strong: rgba(230, 224, 214, 0.24);
  --color-accent: var(--brand-yellow);
  --color-accent-pressed: #ffd633;
  --color-accent-soft: rgba(255, 196, 0, 0.12);
  --color-success: #30d158;
  --color-success-soft: rgba(48, 209, 88, 0.14);
  --color-warning: #ff9f0a;
  --color-warning-soft: rgba(255, 159, 10, 0.14);
  --color-danger: #ff453a;
  --color-danger-soft: rgba(255, 69, 58, 0.14);
  --shadow-soft: 0 18px 55px rgba(0, 0, 0, 0.34);
  --shadow-float: 0 24px 80px rgba(0, 0, 0, 0.48);
  --radius-xs: 10px;
  --radius-sm: 14px;
  --radius-md: 20px;
  --radius-lg: 28px;
  --radius-pill: 999px;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;
  --spring-ease: cubic-bezier(.2, 1.55, .35, 1);
  --ease-standard: cubic-bezier(.2, .8, .2, 1);
  --focus-ring: 0 0 0 4px rgba(255, 196, 0, 0.20);
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--color-bg); }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  font-family: var(--font-system);
  background: var(--color-bg);
  color: var(--color-label);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
button, input, select, textarea { font: inherit; }
a, button { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }

.app-shell {
  position: relative;
  z-index: 1;
  width: min(100%, 680px);
  min-height: 100vh;
  margin: 0 auto;
  padding: max(14px, env(safe-area-inset-top)) 20px max(48px, env(safe-area-inset-bottom));
  isolation: isolate;
}
.ambient {
  position: fixed;
  z-index: -2;
  width: 360px;
  height: 360px;
  border-radius: 50%;
  filter: blur(70px);
  opacity: .12;
  pointer-events: none;
}
.ambient-one { top: -170px; right: -130px; background: var(--brand-yellow); }
.ambient-two { bottom: -220px; left: -170px; background: var(--brand-brown); opacity: .08; }

.topbar {
  position: sticky;
  top: max(8px, env(safe-area-inset-top));
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-6);
}
.icon-button {
  backdrop-filter: saturate(180%) blur(22px);
  -webkit-backdrop-filter: saturate(180%) blur(22px);
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-separator);
  box-shadow: var(--shadow-soft);
}
.brand-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: clamp(118px, 23vw, 150px);
  padding: 0;
  border-radius: 16px;
  text-decoration: none;
  transform-origin: center center;
}
.topbar-centered {
  position: sticky;
  min-height: 96px;
  justify-content: flex-end;
}
.topbar-centered .brand-logo {
  position: absolute;
  left: 50%;
  top: 0;
  transform: translateX(-50%);
}
.brand-logo img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 9px 24px rgba(0,0,0,.28));
}
.icon-button {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 50%;
  cursor: pointer;
}
.icon { width: 19px; height: 19px; fill: currentColor; }
.icon-sound-off { display: none; }
:root[data-sound="off"] .icon-sound-on { display: none; }
:root[data-sound="off"] .icon-sound-off { display: block; }

.content-shell { animation: pageEnter .52s var(--spring-ease) both; }
.brand-logo:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.hero::before {
  content: "";
  display: block;
  width: 38px;
  height: 3px;
  margin-bottom: 18px;
  border-radius: 999px;
  background: var(--brand-yellow);
}
.date-card:hover, .date-card:focus-visible, .slot-card:hover, .slot-card:focus-visible {
  border-color: rgba(255,196,0,.42);
}

.eyebrow {
  margin: 0 0 var(--space-2);
  color: var(--color-accent);
  font-size: 13px;
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: .02em;
  text-transform: uppercase;
}
.display-title {
  margin: 0;
  max-width: 640px;
  font-family: "SF Pro Display", var(--font-system);
  font-size: clamp(38px, 5.4vw, 56px);
  line-height: 1.02;
  font-weight: 600;
  letter-spacing: -0.035em;
}
.page-title {
  margin: 0;
  font-size: clamp(32px, 8vw, 48px);
  line-height: 1.02;
  font-weight: 700;
  letter-spacing: -0.045em;
}
.section-title {
  margin: 0;
  font-size: 20px;
  line-height: 1.15;
  font-weight: 700;
  letter-spacing: -0.025em;
}
.subhead {
  margin: var(--space-3) 0 0;
  max-width: 530px;
  color: var(--color-label-secondary);
  font-size: 17px;
  line-height: 1.48;
  letter-spacing: -0.01em;
}
.meta-text { color: var(--color-label-secondary); font-size: 14px; line-height: 1.45; }

.hero { margin: 0 0 var(--space-7); }
.section { margin-top: var(--space-7); }
.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-4);
}

.surface {
  background: var(--color-surface);
  border: 1px solid var(--color-separator);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  backdrop-filter: saturate(180%) blur(24px);
  -webkit-backdrop-filter: saturate(180%) blur(24px);
}
.card { padding: var(--space-5); }

.date-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-3);
}
.date-card {
  position: relative;
  display: flex;
  min-height: 96px;
  flex-direction: column;
  justify-content: space-between;
  padding: 14px 13px;
  border-radius: var(--radius-md);
  background: var(--color-surface);
  border: 1px solid var(--color-separator);
  color: var(--color-label);
  text-decoration: none;
  box-shadow: 0 8px 26px rgba(0,0,0,.05);
}
.date-card__dow { color: var(--color-label-secondary); font-size: 13px; font-weight: 600; }
.date-card__date { font-size: 21px; line-height: 1; font-weight: 700; letter-spacing: -0.03em; }
.date-card__dot { position: absolute; top: 12px; right: 12px; width: 6px; height: 6px; border-radius: 50%; background: var(--color-accent); opacity: 0; transform: scale(.4); transition: .22s var(--spring-ease); }
.date-card:hover .date-card__dot, .date-card:focus-visible .date-card__dot { opacity: 1; transform: scale(1); }

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  margin: -4px 0 var(--space-4);
  color: var(--color-accent);
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
}
.back-link svg { width: 16px; height: 16px; fill: currentColor; }

.slot-list { display: grid; gap: var(--space-3); }
.slot-card {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: var(--space-4);
  min-height: 92px;
  padding: 18px 20px;
  border-radius: var(--radius-md);
  background: var(--color-surface);
  border: 1px solid var(--color-separator);
  box-shadow: 0 8px 26px rgba(0,0,0,.05);
  color: var(--color-label);
  text-decoration: none;
}
.slot-card__time { font-size: 22px; font-weight: 700; letter-spacing: -0.03em; }
.slot-card__meta { margin-top: 6px; color: var(--color-label-secondary); font-size: 14px; }
.slot-card__chevron { color: var(--color-label-tertiary); width: 20px; height: 20px; fill: currentColor; }

.summary-capsule {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 14px;
  align-items: center;
  margin: var(--space-5) 0;
  padding: 16px 18px;
  border-radius: var(--radius-md);
  background: var(--color-accent-soft);
  border: 1px solid rgba(255,196,0,.18);
}
.summary-capsule__icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 13px;
  background: var(--color-accent);
  color: #fff;
}
.summary-capsule__icon svg { width: 21px; height: 21px; fill: currentColor; }
.summary-capsule__title { font-size: 16px; font-weight: 700; letter-spacing: -0.015em; }
.summary-capsule__meta { margin-top: 3px; color: var(--color-label-secondary); font-size: 13px; line-height: 1.35; }

.form-card { padding: var(--space-5); }
.field { margin-bottom: 20px; }
.field:last-of-type { margin-bottom: var(--space-5); }
.field label {
  display: block;
  margin-bottom: 8px;
  color: var(--color-label-secondary);
  font-size: 13px;
  font-weight: 600;
}
input, select, textarea {
  display: block;
  width: 100%;
  min-height: 50px;
  padding: 13px 14px;
  border: 1px solid var(--color-separator-strong);
  border-radius: var(--radius-sm);
  outline: 0;
  background: var(--color-surface-solid);
  color: var(--color-label);
  font-size: 17px;
  line-height: 1.35;
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}
textarea { min-height: 92px; resize: vertical; }
input::placeholder, textarea::placeholder { color: var(--color-label-tertiary); }
input:focus, select:focus, textarea:focus { border-color: var(--color-accent); box-shadow: var(--focus-ring); }

.button {
  display: inline-flex;
  width: 100%;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 18px;
  border: 1px solid transparent;
  border-radius: 16px;
  background: var(--color-accent);
  color: #fff;
  text-decoration: none;
  text-align: center;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.015em;
  cursor: pointer;
  box-shadow: 0 10px 28px rgba(0,122,255,.18);
}
.button:hover { filter: brightness(1.03); }
.button-secondary { background: var(--color-surface-solid); color: var(--color-label); border-color: var(--color-separator-strong); box-shadow: none; }
.button-danger { background: var(--color-danger); box-shadow: 0 10px 28px rgba(255,59,48,.18); }
.button-compact { width: auto; min-height: 44px; padding: 10px 14px; font-size: 14px; border-radius: 13px; }

.pressable {
  transform: translateZ(0) scale(1);
  transition: transform .34s var(--spring-ease), filter .18s ease, background .18s ease, border-color .18s ease, box-shadow .18s ease;
  will-change: transform;
}
.pressable:hover { transform: translateY(-1px) scale(1.01); }
.pressable:active, .pressable.is-pressed { transform: scale(.965); transition-duration: .1s; transition-timing-function: ease-out; }
.topbar-centered .brand-logo:hover { transform: translateX(-50%) translateY(-1px) scale(1.01); }
.topbar-centered .brand-logo:active, .topbar-centered .brand-logo.is-pressed { transform: translateX(-50%) scale(.965); }
.pressable:focus-visible { outline: none; box-shadow: var(--focus-ring), var(--shadow-soft); }

.notice {
  display: grid;
  gap: var(--space-3);
  padding: var(--space-5);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-separator);
  background: var(--color-surface);
  box-shadow: var(--shadow-soft);
}
.notice__icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 17px;
}
.notice__icon svg { width: 28px; height: 28px; fill: currentColor; }
.notice__title { margin: 0; font-size: 26px; line-height: 1.05; letter-spacing: -0.035em; }
.notice__text { margin: 0; color: var(--color-label-secondary); font-size: 16px; line-height: 1.5; }
.notice-success { background: linear-gradient(180deg, var(--color-success-soft), var(--color-surface)); }
.notice-success .notice__icon { color: var(--color-success); background: var(--color-success-soft); animation: successSpring .56s var(--spring-ease) both; }
.notice-error { background: linear-gradient(180deg, var(--color-danger-soft), var(--color-surface)); }
.notice-error .notice__icon { color: var(--color-danger); background: var(--color-danger-soft); }
.notice-empty { text-align: left; }
.notice-empty .notice__icon { color: var(--color-label-secondary); background: var(--color-surface-2); }

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  padding: 5px 10px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  line-height: 1;
  font-weight: 700;
}
.status-pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status-free { color: var(--color-success); background: var(--color-success-soft); }
.status-booked { color: var(--color-danger); background: var(--color-danger-soft); }

.admin-stack { display: grid; gap: var(--space-3); }
.admin-slot__head { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--space-4); }
.admin-slot__client { margin-top: var(--space-4); padding-top: var(--space-4); border-top: 1px solid var(--color-separator); font-size: 14px; line-height: 1.5; }
.actions-row { display: flex; gap: var(--space-2); margin-top: var(--space-4); }

@keyframes pageEnter {
  0% { opacity: 0; transform: translateY(14px) scale(.985); }
  65% { opacity: 1; transform: translateY(-2px) scale(1.004); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes itemSpring {
  0% { opacity: 0; transform: translateY(12px) scale(.975); }
  70% { opacity: 1; transform: translateY(-1px) scale(1.008); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes successSpring {
  0% { opacity: 0; transform: scale(.65) rotate(-8deg); }
  68% { opacity: 1; transform: scale(1.12) rotate(2deg); }
  100% { opacity: 1; transform: scale(1) rotate(0); }
}
.stagger > * { animation: itemSpring .5s var(--spring-ease) both; }
.stagger > *:nth-child(2) { animation-delay: .035s; }
.stagger > *:nth-child(3) { animation-delay: .07s; }
.stagger > *:nth-child(4) { animation-delay: .105s; }
.stagger > *:nth-child(5) { animation-delay: .14s; }
.stagger > *:nth-child(6) { animation-delay: .175s; }
.stagger > *:nth-child(n+7) { animation-delay: .2s; }

@media (max-width: 560px) {
  .app-shell { padding-left: 16px; padding-right: 16px; }
  .date-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .display-title { font-size: clamp(36px, 9.5vw, 46px); }
  .topbar-centered { min-height: 104px; }
  .brand-logo { width: clamp(110px, 30vw, 136px); }
  .brand-chip__text { display: none; }
  .brand-chip { width: 44px; padding: 6px; justify-content: center; }
}

@media (max-width: 360px) {
  .date-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  .pressable:hover, .pressable:active, .pressable.is-pressed { transform: none !important; }
  .content-shell, .stagger > *, .notice-success .notice__icon { animation: none !important; }
}

