:root {
  --bg: #f6fffc;
  --surface: #ffffff;
  --text: #141210;
  --muted: #4a5c56;
  --accent: #00b89e;
  --accent-dark: #008f7a;
  --accent-soft: #d8faf4;
  --accent-glow: rgba(0, 184, 158, 0.28);
  --telegram: #1aabf0;
  --telegram-soft: #dff3fd;
  --border: #cce8e0;
  --danger: #d64545;
  --warning: #9a6700;
  --radius: 18px;
  --shadow: 0 12px 40px rgba(20, 18, 16, 0.09);
  --shadow-accent: 0 8px 28px rgba(0, 184, 158, 0.32);
  --max: 520px;
  --max-panel: 980px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: "Manrope", system-ui, sans-serif;
  background: linear-gradient(180deg, #f9fffe 0%, #f2f8f5 100%);
  color: var(--text);
  line-height: 1.5;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}

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

.app {
  width: min(var(--max), calc(100% - 1.5rem));
  margin: 0 auto;
  padding: 1rem 0 2.5rem;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.brand {
  font-weight: 800;
  font-size: 0.95rem;
  color: var(--accent-dark);
  letter-spacing: -0.02em;
}

.brand span { color: var(--text); font-weight: 600; }

.step-dots {
  display: flex;
  gap: 0.35rem;
}

.step-dots i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border);
  display: block;
  transition: transform 0.2s, background 0.2s;
}

.step-dots i.on {
  background: var(--accent);
  transform: scale(1.15);
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem;
  margin-bottom: 1rem;
}

.hero-card {
  background: linear-gradient(135deg, #ffffff 0%, #f0fffb 100%);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 4px);
  padding: 1.35rem 1.25rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow);
}

.hero-card h1 {
  font-size: 1.45rem;
  line-height: 1.2;
  letter-spacing: -0.03em;
  margin-bottom: 0.35rem;
}

.hero-card p {
  color: var(--muted);
  font-size: 0.92rem;
}

.location {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.65rem;
  font-size: 0.88rem;
  color: var(--muted);
}

.section-title {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 0.65rem;
}

.choice-grid {
  display: grid;
  gap: 0.55rem;
}

.choice {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.85rem;
  width: 100%;
  border: 1.5px solid var(--border);
  background: #fff;
  border-radius: 14px;
  padding: 0.9rem 1rem;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.1s, background 0.15s;
  font: inherit;
  color: inherit;
  text-decoration: none;
}

.choice:hover {
  border-color: var(--accent);
  box-shadow: 0 4px 16px var(--accent-glow);
}

.choice.on {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: 0 4px 16px var(--accent-glow);
}

.choice:active { transform: scale(0.99); }

.choice-body { flex: 1; min-width: 0; }
.choice strong { font-size: 0.98rem; display: block; }
.choice small { color: var(--muted); font-size: 0.82rem; display: block; margin-top: 0.15rem; line-height: 1.35; }

.choice-badge {
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
}

.choice-badge svg {
  width: 22px;
  height: 22px;
}

.choice-badge--web {
  background: var(--accent-soft);
  color: var(--accent-dark);
}

.choice-badge--telegram {
  background: var(--telegram-soft);
  color: var(--telegram);
}

.choice-chevron {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  color: var(--muted);
  background: #f4faf8;
  margin-left: auto;
}

.choice .meta {
  color: var(--accent-dark);
  font-weight: 700;
  white-space: nowrap;
  font-size: 0.9rem;
  flex-shrink: 0;
  margin-left: auto;
}

.choice-chevron svg {
  width: 18px;
  height: 18px;
}

.choice-chevron--tg {
  background: var(--telegram-soft);
  color: var(--telegram);
}

.choice-chevron--tg svg {
  width: 16px;
  height: 16px;
}

.choice--telegram:hover {
  border-color: #8fd4f7;
  background: linear-gradient(135deg, #fff 0%, #f3fbff 100%);
  box-shadow: 0 4px 16px rgba(26, 171, 240, 0.18);
}

.choice--telegram:hover .choice-chevron--tg {
  background: var(--telegram);
  color: #fff;
}

.choice--web:hover .choice-chevron {
  background: var(--accent-soft);
  color: var(--accent-dark);
}

.location a {
  font-size: 0.82rem;
  font-weight: 600;
  margin-left: 0.35rem;
}

.appt-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1rem;
  margin-bottom: 0.65rem;
}

.appt-card__time {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 1.05rem;
  font-weight: 700;
}

.appt-card__service {
  margin-top: 0.35rem;
  font-weight: 600;
}

.appt-card__client {
  margin-top: 0.15rem;
  font-size: 0.82rem;
  color: var(--muted);
}

.days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.35rem;
  margin-bottom: 0.75rem;
}

.day {
  border: none;
  background: var(--accent-soft);
  color: var(--accent-dark);
  border-radius: 12px;
  padding: 0.55rem 0.2rem;
  font: inherit;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
}

.day.off {
  opacity: 0.35;
  pointer-events: none;
}

.day.on {
  background: var(--accent);
  color: #fff;
  box-shadow: var(--shadow-accent);
}

.slots {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.45rem;
}

.slot {
  border: 1.5px solid var(--border);
  background: #fff;
  border-radius: 12px;
  padding: 0.65rem 0.25rem;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.slot.on {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-dark);
}

.slot:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.field {
  margin-bottom: 0.85rem;
}

.field label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
  color: var(--muted);
}

.field input {
  width: 100%;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 0.8rem 0.9rem;
  font: inherit;
  font-size: 1rem;
  background: #fff;
}

.field input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.btn-row {
  display: grid;
  gap: 0.55rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  width: 100%;
  border: none;
  border-radius: 14px;
  padding: 0.9rem 1rem;
  font: inherit;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.1s, box-shadow 0.15s;
}

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

.btn-primary {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
  color: #fff;
  box-shadow: var(--shadow-accent);
}

.btn-secondary {
  background: #fff;
  border: 1.5px solid var(--border);
  color: var(--text);
}

.btn-telegram {
  background: var(--telegram);
  color: #fff;
}

.btn-ghost {
  background: transparent;
  color: var(--muted);
  font-weight: 600;
}

.summary {
  background: var(--accent-soft);
  border-radius: 14px;
  padding: 0.9rem 1rem;
  font-size: 0.92rem;
  margin-bottom: 1rem;
}

.summary div + div { margin-top: 0.35rem; }

.note {
  font-size: 0.82rem;
  color: var(--muted);
  margin-top: 0.75rem;
}

.success-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-dark);
  display: grid;
  place-items: center;
  font-size: 1.6rem;
  margin-bottom: 0.75rem;
}

.hidden { display: none !important; }

.error-banner {
  background: #fff0f0;
  border: 1px solid #ffc9c9;
  color: var(--danger);
  border-radius: 12px;
  padding: 0.75rem 0.9rem;
  font-size: 0.88rem;
  margin-bottom: 0.85rem;
}

.loading {
  text-align: center;
  color: var(--muted);
  padding: 2rem 0;
}

.footer-note {
  text-align: center;
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 1rem;
}

@media (min-width: 540px) {
  .slots { grid-template-columns: repeat(4, 1fr); }
}

.choice-grid .choice small {
  display: block;
  margin-top: 0.15rem;
}

.tg-login-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 48px;
  margin: 0.65rem auto 0.35rem;
  padding: 0;
  width: fit-content;
  max-width: 100%;
  border-radius: 20px;
  overflow: hidden;
  line-height: 0;
  background: transparent;
  box-shadow: none;
  border: none;
  isolation: isolate;
}

.tg-login-wrap iframe {
  border: 0 !important;
  outline: 0 !important;
  box-shadow: none !important;
  background: transparent !important;
  display: block;
  max-width: 100%;
  border-radius: 20px !important;
  /* Скрываем тёмную рамку iframe у виджета Telegram */
  margin: -1px;
  transform: scale(1.01);
  transform-origin: center center;
}

.login-card {
  text-align: left;
}

.login-card .login-divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 1.35rem 0 1rem;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.login-card .login-divider::before,
.login-card .login-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

.login-card .login-step-hint {
  font-size: 0.86rem;
  color: var(--muted);
  line-height: 1.45;
  margin: 0 0 0.85rem;
}

.login-card .otp-sent-box {
  background: #eef9f4;
  border: 1px solid #c6e9dc;
  color: #0f5c45;
  border-radius: 12px;
  padding: 0.75rem 0.9rem;
  font-size: 0.88rem;
  margin-bottom: 0.85rem;
  line-height: 1.4;
}

.login-card .field {
  text-align: left;
}

.login-card .btn-primary,
.login-card .btn-secondary {
  width: 100%;
}

.login-card .btn-row {
  margin-top: 0.15rem;
}

.login-methods {
  display: grid;
  gap: 0.35rem;
}

.modal-error-text {
  margin: 0;
  color: var(--danger);
  font-size: 0.95rem;
  line-height: 1.45;
}

.modal-info-text {
  margin: 0;
  color: var(--text, #1a1816);
  font-size: 0.95rem;
  line-height: 1.45;
}

.modal-backdrop--alert {
  z-index: 120;
  background: rgba(20, 18, 16, 0.55);
}

.hint-details {
  margin-top: 0.85rem;
  font-size: 0.82rem;
  color: var(--muted);
  text-align: left;
}

.hint-details summary {
  cursor: pointer;
  color: var(--accent-dark);
  font-weight: 600;
  list-style: none;
}

.hint-details summary::-webkit-details-marker { display: none; }

.hint-details summary::before {
  content: "› ";
  display: inline-block;
  transition: transform 0.15s;
}

.hint-details[open] summary::before {
  transform: rotate(90deg);
}

.hint-details p {
  margin-top: 0.5rem;
  line-height: 1.45;
}

.hint-details code {
  font-size: 0.78rem;
  background: #f0f4f2;
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
}

.gate-lead {
  font-size: 0.92rem;
  color: var(--muted);
  margin-bottom: 1rem;
  line-height: 1.45;
}

/* ── Shared panels (owner / staff) ── */

.panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.panel-header h1 { font-size: 1.35rem; letter-spacing: -0.03em; }

.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--accent-soft);
  color: var(--accent-dark);
  border-radius: 999px;
  padding: 0.35rem 0.7rem;
  font-size: 0.78rem;
  font-weight: 700;
}

.nav-tabs {
  display: flex;
  gap: 0.35rem;
  overflow-x: auto;
  padding-bottom: 0.15rem;
  margin-bottom: 1rem;
  scrollbar-width: none;
}

.nav-tabs::-webkit-scrollbar { display: none; }

.nav-tab {
  flex: 0 0 auto;
  border: 1.5px solid var(--border);
  background: #fff;
  color: var(--muted);
  border-radius: 999px;
  padding: 0.55rem 0.9rem;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.nav-tab.on {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-dark);
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.55rem;
}

.stat-card {
  background: linear-gradient(135deg, #fff 0%, #f4fffb 100%);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 0.85rem 0.9rem;
}

.stat-card strong {
  display: block;
  font-size: 1.35rem;
  letter-spacing: -0.03em;
  margin-bottom: 0.15rem;
}

.stat-card span {
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 600;
}

.link-card {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.75rem;
  background: #f8fffd;
  border: 1px dashed var(--border);
  border-radius: 14px;
  padding: 0.9rem 1rem;
  margin-bottom: 0.55rem;
}

@media (min-width: 480px) {
  .link-card {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

.link-card .url {
  font-size: 0.82rem;
  word-break: break-all;
  color: var(--accent-dark);
  font-weight: 600;
}

.link-card .actions {
  display: flex;
  gap: 0.35rem;
  flex-shrink: 0;
}

.link-card--highlight {
  border-style: solid;
  border-color: var(--accent);
  background: linear-gradient(135deg, #ffffff 0%, #f0fffb 100%);
  box-shadow: 0 4px 18px var(--accent-glow);
}

.btn-sm {
  width: auto;
  padding: 0.5rem 0.75rem;
  font-size: 0.82rem;
  border-radius: 10px;
}

.type-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.55rem;
}

.type-btn {
  border: 1.5px solid var(--border);
  background: #fff;
  border-radius: 14px;
  padding: 0.85rem 0.75rem;
  text-align: left;
  cursor: pointer;
  font: inherit;
  color: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.type-btn:hover,
.type-btn.on {
  border-color: var(--accent);
  box-shadow: 0 4px 16px var(--accent-glow);
  background: var(--accent-soft);
}

.type-btn .icon { font-size: 1.35rem; display: block; margin-bottom: 0.25rem; }
.type-btn strong { font-size: 0.88rem; display: block; }
.type-btn small { color: var(--muted); font-size: 0.72rem; }

.field select,
.field textarea {
  width: 100%;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 0.8rem 0.9rem;
  font: inherit;
  font-size: 1rem;
  background: #fff;
}

.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.field textarea { min-height: 4.5rem; resize: vertical; }

.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.2rem 0.55rem;
  font-size: 0.72rem;
  font-weight: 700;
}

.badge-ok { background: var(--accent-soft); color: var(--accent-dark); }
.badge-warn { background: #fff6e8; color: #9a6700; }
.badge-muted { background: #eef2f0; color: var(--muted); }

.info-box {
  background: #f0fbff;
  border: 1px solid #c5e8f7;
  border-radius: 14px;
  padding: 0.85rem 0.95rem;
  font-size: 0.86rem;
  color: #1a4d66;
  margin-bottom: 0.85rem;
}

.info-box strong { display: block; margin-bottom: 0.25rem; }

.empty-state {
  text-align: center;
  padding: 1.5rem 0.5rem;
  color: var(--muted);
}

.empty-state .icon { font-size: 2rem; margin-bottom: 0.5rem; }

.list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid #edf5f2;
}

.list-item:last-child { border-bottom: none; padding-bottom: 0; }
.list-item:first-child { padding-top: 0; }

.list-item strong { display: block; font-size: 0.95rem; }
.list-item small { color: var(--muted); font-size: 0.8rem; }

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(20, 18, 16, 0.45);
  display: grid;
  place-items: end center;
  padding: 1rem;
  z-index: 100;
  animation: fadeIn 0.15s ease;
}

@media (min-width: 540px) {
  .modal-backdrop { place-items: center; }
}

.modal {
  width: min(var(--max), 100%);
  max-height: calc(100dvh - 2rem);
  overflow: auto;
  background: #fff;
  border-radius: calc(var(--radius) + 2px);
  box-shadow: 0 24px 80px rgba(20, 18, 16, 0.2);
  padding: 1.25rem;
  animation: slideUp 0.2s ease;
}

.modal h2 {
  font-size: 1.15rem;
  margin-bottom: 0.85rem;
  letter-spacing: -0.02em;
}

.modal-actions {
  display: grid;
  gap: 0.5rem;
  margin-top: 1rem;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 1.25rem;
  transform: translateX(-50%);
  background: #141210;
  color: #fff;
  padding: 0.7rem 1rem;
  border-radius: 999px;
  font-size: 0.86rem;
  font-weight: 600;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
  z-index: 200;
  animation: slideUp 0.2s ease;
}

.spinner {
  width: 28px;
  height: 28px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin: 1.5rem auto;
}

.btn-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.55rem;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ── Desktop panels (owner / staff / admin) ── */

.app--panel {
  width: min(var(--max-panel), calc(100% - 1.5rem));
}

.panel-shell {
  display: grid;
  gap: 1rem;
}

.panel-sidebar {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.panel-sidebar .card {
  margin-bottom: 0;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  width: 100%;
  border: 1.5px solid transparent;
  background: transparent;
  border-radius: 12px;
  padding: 0.65rem 0.75rem;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--muted);
  cursor: pointer;
  text-align: left;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.sidebar-link:hover {
  background: #f4faf8;
  color: var(--text);
}

.sidebar-link.on {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent-dark);
}

.sidebar-link .ico {
  width: 1.35rem;
  text-align: center;
  flex-shrink: 0;
}

.panel-main {
  min-width: 0;
}

.sub-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.85rem;
}

.sub-nav .nav-tab {
  flex: 0 0 auto;
}

.schedule-grid {
  display: grid;
  gap: 0.45rem;
}

.schedule-row {
  display: grid;
  grid-template-columns: 2.5rem 1fr auto;
  align-items: center;
  gap: 0.65rem;
  padding: 0.65rem 0;
  border-bottom: 1px solid #edf5f2;
}

.schedule-row:last-child { border-bottom: none; }

.schedule-row .day-label {
  font-weight: 800;
  font-size: 0.82rem;
  color: var(--accent-dark);
}

.schedule-row .hours {
  font-size: 0.88rem;
}

.schedule-row .hours.off {
  color: var(--muted);
  font-style: italic;
}

.phase-banner {
  border-radius: 14px;
  padding: 0.85rem 1rem;
  font-size: 0.88rem;
  margin-bottom: 0.85rem;
}

.phase-banner.ok {
  background: var(--accent-soft);
  border: 1px solid var(--border);
  color: var(--accent-dark);
}

.phase-banner.warn {
  background: #fff6e8;
  border: 1px solid #f0d9a8;
  color: var(--warning);
}

.phase-banner.block {
  background: #fff0f0;
  border: 1px solid #ffc9c9;
  color: var(--danger);
}

.checklist {
  list-style: none;
  margin: 0.5rem 0 0;
  padding: 0;
}

.checklist li {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.86rem;
  padding: 0.35rem 0;
  color: var(--muted);
}

.checklist li.done {
  color: var(--accent-dark);
}

.quick-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.45rem;
  margin-bottom: 0.85rem;
}

.quick-stat {
  background: #f8fffd;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.65rem 0.5rem;
  text-align: center;
}

.quick-stat strong {
  display: block;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
}

.quick-stat span {
  font-size: 0.72rem;
  color: var(--muted);
  font-weight: 600;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.btn-icon {
  width: auto;
  padding: 0.45rem 0.65rem;
  min-width: unset;
}

@media (min-width: 860px) {
  .panel-shell {
    grid-template-columns: 240px 1fr;
    align-items: start;
  }

  .panel-sidebar {
    position: sticky;
    top: 1rem;
  }

  .nav-tabs--mobile-only {
    display: none;
  }
}

@media (max-width: 859px) {
  .sidebar-nav--desktop {
    display: none;
  }

  .app--panel {
    width: calc(100% - 1rem);
    padding-bottom: 1.5rem;
  }

  .app--panel .hero-card {
    padding: 0.9rem 1rem;
  }

  .app--panel .hero-card h1 {
    font-size: 1.15rem;
  }

  .panel-sidebar-card {
    padding: 1rem;
  }

  .quick-stats {
    gap: 0.35rem;
  }

  .quick-stat strong {
    font-size: 1.05rem;
  }

  .link-card .actions {
    width: 100%;
  }

  .link-card .actions .btn {
    flex: 1;
  }
}

/* Panel layout polish */

.app--panel .hero-card {
  padding: 1rem 1.15rem;
  margin-bottom: 0.75rem;
}

.app--panel .hero-card h1 {
  font-size: 1.28rem;
}

.app--panel .hero-card p {
  font-size: 0.86rem;
}

.panel-main {
  position: relative;
  min-width: 0;
}

.panel-loader {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: grid;
  place-items: center;
  pointer-events: none;
}

.panel-main.is-loading .panel-content {
  opacity: 0.45;
  pointer-events: none;
}

.panel-content {
  transition: opacity 0.15s ease;
}

.panel-section + .panel-section {
  margin-top: 1.15rem;
  padding-top: 1.15rem;
  border-top: 1px solid #edf5f2;
}

.link-hint {
  font-size: 0.82rem;
  color: var(--muted);
  margin: 0 0 0.55rem;
  line-height: 1.45;
}

.field--compact {
  margin-bottom: 0.65rem;
}

.btn-row-2--compact {
  margin-bottom: 0.65rem;
}

.panel-sidebar-card .sidebar-nav {
  margin-top: 0.35rem;
  padding-top: 0.35rem;
  border-top: 1px solid #edf5f2;
}

.spinner {
  margin: 0;
}

/* ── Portal hub ── */

.app--portal {
  width: min(640px, calc(100% - 1.5rem));
}

.portal-hero {
  text-align: center;
  padding: 1.5rem 0.5rem 1rem;
}

.portal-hero h1 {
  font-size: 1.65rem;
  letter-spacing: -0.04em;
  margin-bottom: 0.35rem;
}

.portal-hero p {
  color: var(--muted);
  font-size: 0.92rem;
  max-width: 28rem;
  margin: 0 auto;
}

.portal-grid {
  display: grid;
  gap: 0.65rem;
}

.portal-card {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  width: 100%;
  border: 1.5px solid var(--border);
  background: #fff;
  border-radius: calc(var(--radius) + 2px);
  padding: 1rem 1.05rem;
  text-align: left;
  cursor: pointer;
  font: inherit;
  color: inherit;
  text-decoration: none;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.1s;
}

.portal-card:hover {
  border-color: var(--accent);
  box-shadow: 0 6px 22px var(--accent-glow);
}

.portal-card:active { transform: scale(0.99); }

.portal-card__ico {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-size: 1.35rem;
  flex-shrink: 0;
  background: var(--accent-soft);
}

.portal-card__ico--staff { background: #eef6ff; }
.portal-card__ico--admin { background: #fff6e8; }

.portal-card__body { flex: 1; min-width: 0; }
.portal-card__body strong { display: block; font-size: 1rem; }
.portal-card__body small {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
  margin-top: 0.15rem;
  line-height: 1.35;
}

.portal-card__arrow {
  color: var(--muted);
  font-weight: 700;
  flex-shrink: 0;
}

/* ── Mobile bottom navigation ── */

.bottom-nav {
  display: none;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--border);
  padding: 0.35rem 0.5rem calc(0.45rem + env(safe-area-inset-bottom));
  grid-template-columns: repeat(4, 1fr);
  gap: 0.15rem;
  box-shadow: 0 -8px 32px rgba(20, 18, 16, 0.06);
}

.bottom-nav__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.15rem;
  border: none;
  background: transparent;
  border-radius: 12px;
  padding: 0.45rem 0.25rem;
  font: inherit;
  color: var(--muted);
  cursor: pointer;
  min-height: 52px;
}

.bottom-nav__item.on {
  color: var(--accent-dark);
  background: var(--accent-soft);
}

.bottom-nav__ico {
  font-size: 1.15rem;
  line-height: 1;
}

.bottom-nav__label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.more-menu {
  margin-bottom: 0.5rem;
}

.more-menu__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.55rem;
}

.more-menu__item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
  border: 1.5px solid var(--border);
  background: #fff;
  border-radius: 14px;
  padding: 0.85rem 0.9rem;
  font: inherit;
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--text);
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.more-menu__item:hover,
.more-menu__item.on {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-dark);
}

.more-menu__ico {
  font-size: 1.25rem;
}

.app--panel.has-bottom-nav {
  padding-bottom: calc(5.5rem + env(safe-area-inset-bottom));
}

.app--panel.has-bottom-nav .footer-note {
  margin-bottom: 0.5rem;
}

/* ── Subscription upload ── */

.upload-zone {
  display: block;
  width: 100%;
  box-sizing: border-box;
  margin-top: 0.35rem;
  border: 2px dashed var(--border);
  border-radius: 14px;
  padding: 1.35rem 1rem;
  text-align: center;
  background: #f8fffd;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.upload-zone__icon {
  display: block;
  font-size: 1.75rem;
  line-height: 1;
  margin-bottom: 0.5rem;
}

.upload-zone:hover,
.upload-zone.dragover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.upload-zone input[type="file"] {
  display: none;
}

.upload-zone strong {
  display: block;
  margin-bottom: 0.25rem;
}

.upload-zone small {
  color: var(--muted);
  font-size: 0.82rem;
}

.qr-box {
  display: grid;
  place-items: center;
  margin: 0.85rem 0;
}

.qr-box img {
  max-width: 180px;
  border-radius: 12px;
  border: 1px solid var(--border);
}

.biz-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 0.9rem 1rem;
  margin-bottom: 0.55rem;
}

.biz-card strong {
  display: block;
  font-size: 0.95rem;
  margin-bottom: 0.2rem;
}

.biz-card small {
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.4;
}

.biz-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.65rem;
}

.pending-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: #fff6e8;
  color: var(--warning);
  border-radius: 999px;
  padding: 0.35rem 0.7rem;
  font-size: 0.78rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
}

.today-preview {
  margin-top: 0.85rem;
}

.today-preview .appt-card:last-child {
  margin-bottom: 0;
}

.toast {
  bottom: calc(1.25rem + env(safe-area-inset-bottom));
}

@media (max-width: 859px) {
  .bottom-nav {
    display: grid;
  }

  .nav-tabs--mobile-only {
    display: none;
  }
}

@media (min-width: 860px) {
  .more-menu {
    display: none;
  }
}

.plan-picker {
  display: grid;
  gap: 0.65rem;
  margin-bottom: 1rem;
}
.plan-picker .choice {
  text-align: left;
}
.plan-picker .choice--active,
.choice.choice--active {
  border-color: var(--accent, #00b89e);
  box-shadow: 0 0 0 2px rgba(0, 184, 158, 0.25);
}
.plan-picker .choice span {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.85rem;
  color: var(--muted, #4a5c56);
}
