/* Базовые стили мини-аппа: мобильная раскладка, без горизонтального скролла,
   тач-элементы не меньше 44x44px, единая цветовая схема (критерии «удобно»). */
:root {
  --color-bg: #101014;
  --color-surface: #1b1b22;
  --color-surface-alt: #24242e;
  --color-text: #f2f2f5;
  --color-text-muted: #9a9aa5;
  --color-accent: #d4a24c;
  --color-accent-text: #101014;
  --color-danger: #e2574c;
  --color-border: #2f2f3a;
  --radius: 12px;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  width: 100%;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

#app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.screen {
  flex: 1;
  padding: 16px;
  padding-bottom: 32px;
  max-width: 100%;
}

h1, h2, h3 {
  margin: 0 0 12px;
  font-family: Georgia, "PT Serif", "Times New Roman", serif;
  letter-spacing: 0.01em;
}

h1 { font-size: 24px; margin-top: 4px; }
h2 { font-size: 21px; }
h3 { font-size: 17px; }

p {
  color: var(--color-text-muted);
  line-height: 1.4;
}

button, .button, input[type="submit"] {
  min-height: 44px;
  min-width: 44px;
  border-radius: var(--radius);
  border: none;
  background: var(--color-accent);
  color: var(--color-accent-text);
  font-size: 16px;
  font-weight: 600;
  padding: 10px 16px;
  cursor: pointer;
}

button.secondary {
  background: var(--color-surface);
  color: var(--color-text);
  border: 1px solid var(--color-border);
  font-weight: 500;
}

button:disabled {
  opacity: 0.5;
  cursor: default;
}

input[type="text"], input[type="tel"], input[type="date"], input[type="number"], textarea, select {
  width: 100%;
  min-height: 44px;
  border-radius: var(--radius);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text);
  padding: 10px 12px;
  font-size: 16px;
}

/* Главное меню: hero-кнопка, плитки, сворачиваемые группы персонала. */
.brand {
  text-align: center;
  padding: 8px 0 18px;
}

.brand-name {
  font-family: Georgia, "PT Serif", "Times New Roman", serif;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.brand-sub {
  margin-top: 4px;
  font-size: 13px;
  color: var(--color-text-muted);
  letter-spacing: 0.04em;
}

.hero-cta {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 76px;
  padding: 14px 18px;
  text-align: left;
  background: linear-gradient(135deg, #e0b25e 0%, var(--color-accent) 60%, #b98630 100%);
  color: var(--color-accent-text);
  box-shadow: 0 6px 18px rgba(212, 162, 76, 0.22);
}

.hero-cta:active {
  transform: scale(0.99);
}

.hero-icon {
  font-size: 30px;
  line-height: 1;
}

.hero-text {
  display: flex;
  flex-direction: column;
}

.hero-title {
  font-size: 20px;
  font-weight: 700;
}

.hero-sub {
  font-size: 13px;
  font-weight: 500;
  opacity: 0.8;
}

.tiles {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-top: 12px;
}

.tile {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  min-height: 92px;
  padding: 14px;
  text-align: left;
  background: var(--color-surface);
  color: var(--color-text);
  border: 1px solid var(--color-border);
}

.tile:active {
  background: var(--color-surface-alt);
}

.tile-icon {
  font-size: 24px;
  line-height: 1;
}

.tile-label {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.2;
}

.group {
  margin-top: 16px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 0 12px;
}

.group summary {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  cursor: pointer;
  list-style: none;
  font-weight: 600;
}

.group summary::-webkit-details-marker {
  display: none;
}

.group summary::after {
  content: "›";
  margin-left: auto;
  font-size: 22px;
  color: var(--color-text-muted);
  transition: transform 0.15s;
}

.group[open] summary::after {
  transform: rotate(90deg);
}

.group-count {
  min-width: 22px;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--color-surface-alt);
  color: var(--color-text-muted);
  font-size: 12px;
  text-align: center;
}

.group .tiles {
  margin: 0 0 12px;
}

.group .tile {
  background: var(--color-surface-alt);
}

@media (prefers-reduced-motion: reduce) {
  .hero-cta:active { transform: none; }
  .group summary::after { transition: none; }
}

.spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid var(--color-border);
  border-top-color: var(--color-accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.error {
  color: var(--color-danger);
}

.card {
  background: var(--color-surface);
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 12px;
}

.stub {
  text-align: center;
  padding: 40px 16px;
  color: var(--color-text-muted);
}


/* Списки выбора: строки на всю ширину с тонкими линиями и стрелкой. */
.menu-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--color-border);
}

.menu-list button {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 58px;
  padding: 12px 4px;
  text-align: left;
  background: transparent;
  color: var(--color-text);
  border: 0;
  border-bottom: 1px solid var(--color-border);
  border-radius: 0;
  font-weight: 500;
}

.menu-list button:active {
  background: var(--color-surface);
}

.menu-list button::after {
  content: "›";
  font-size: 22px;
  line-height: 1;
  color: var(--color-text-muted);
}

.row-label {
  flex: 1;
  min-width: 0;
}

.row-hint {
  color: var(--color-text-muted);
  font-size: 14px;
  font-weight: 400;
  white-space: nowrap;
}

/* Даты и время: компактные «чипы» в сетке. */
.chips {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(84px, 1fr));
  gap: 8px;
}

.chips button {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-height: 52px;
  padding: 8px 4px;
  border-radius: 10px;
  background: var(--color-surface);
  color: var(--color-text);
  border: 1px solid var(--color-border);
  font-weight: 600;
}

.chips button:active,
.chips button:focus-visible {
  border-color: var(--color-accent);
  color: var(--color-accent);
}

.chip-hint {
  font-size: 12px;
  font-weight: 400;
  color: var(--color-text-muted);
  text-transform: uppercase;
}

/* Кнопки «назад» — текстовые ссылки, а не рамки. */
.back-link,
.screen button[id$="-back"] {
  display: inline-flex;
  align-items: center;
  width: auto;
  min-height: 44px;
  margin: 0 0 4px -4px;
  padding: 8px 4px;
  background: none;
  border: 0;
  color: var(--color-text-muted);
  font-size: 15px;
  font-weight: 500;
}

.back-link:active,
.screen button[id$="-back"]:active {
  color: var(--color-text);
}

/* Строки с ценой: услуга слева, цена справа, тонкая линия между строками. */
.price-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.price-list li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid var(--color-border);
}

.price-list li:first-child {
  border-top: 0;
}

.price-list strong {
  color: var(--color-accent);
  font-weight: 600;
  white-space: nowrap;
}

/* Текст внутри карточек: без «пустого экрана» отступов у строк со служебным классом. */
.card > :first-child {
  margin-top: 0;
}

.card p {
  margin: 4px 0;
}

.card .stub {
  padding: 0;
  text-align: left;
}

/* Поля форм: подпись над полем. */
.field {
  display: block;
  margin-top: 12px;
  color: var(--color-text-muted);
  font-size: 14px;
}

.field input,
.field select {
  display: block;
  margin-top: 4px;
  color: var(--color-text);
  color-scheme: dark;
}

.notice {
  margin: 12px 0;
  padding: 12px 14px;
  border-radius: var(--radius);
  background: var(--color-surface-alt);
  border-left: 3px solid var(--color-accent);
  color: var(--color-text);
  font-size: 14px;
  line-height: 1.45;
}
