:root {
  --bg: #faf6f0;
  --card-bg: #ffffff;
  --text: #211a15;
  --muted: #8a7c6f;
  --accent: #e11d34;
  --accent-dark: #ad1226;
  --accent-ink: #ffffff;
  --teal: #0f6b5c;
  --amber: #d68a1f;
  --border: #ecdfd0;
  --border-strong: rgba(33, 26, 21, 0.16);
  --danger: #7a1a20;
  --shadow-hard: 2px 2px 0 rgba(33, 26, 21, 0.08);
  --shadow-hard-lg: 3px 3px 0 rgba(33, 26, 21, 0.14);
}

[data-theme="dark"] {
  --bg: #16130f;
  --card-bg: #221d17;
  --text: #f3ece3;
  --muted: #a3968a;
  --accent: #ff4d5e;
  --accent-dark: #ff8a94;
  --accent-ink: #16130f;
  --teal: #3ecbb0;
  --amber: #f0b84c;
  --border: #3a322a;
  --border-strong: rgba(243, 236, 227, 0.2);
  --danger: #ff8a80;
  --shadow-hard: 2px 2px 0 rgba(0, 0, 0, 0.35);
  --shadow-hard-lg: 3px 3px 0 rgba(0, 0, 0, 0.45);
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

body {
  margin: 0;
  font-family: 'Manrope', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

#app { max-width: 480px; margin: 0 auto; padding: 18px 16px 56px; }

.brand-bar { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; }
.brand-mark { width: 22px; height: 22px; flex-shrink: 0; }
.brand-name { font-size: 15px; font-weight: 800; letter-spacing: -0.01em; flex: 1; }
.theme-toggle {
  background: var(--card-bg); border: 1.5px solid var(--text); border-radius: 10px; cursor: pointer;
  font-size: 15px; padding: 5px 9px; box-shadow: var(--shadow-hard); line-height: 1;
}

body, .card, .btn-primary, .btn-outline, .stat-card, .chip, .date-tile {
  transition: background-color .2s ease, border-color .2s ease, color .2s ease;
}

.business-cover {
  width: 100%; height: 120px; object-fit: cover; border-radius: 14px; border: 1.5px solid var(--text);
  box-shadow: var(--shadow-hard); margin-bottom: 12px;
}

.pause-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: var(--card-bg); border: 1.5px solid var(--text); border-radius: 12px;
  padding: 12px 14px; margin-bottom: 16px; font-size: 14px; font-weight: 700;
}

.sub-tabs { display: flex; gap: 8px; margin-bottom: 12px; }
.sub-tab {
  padding: 6px 12px; border-radius: 999px; border: 1.5px solid var(--border); background: var(--card-bg);
  color: var(--muted); font-weight: 700; font-size: 12.5px; cursor: pointer; font-family: inherit;
}
.sub-tab.active { border-color: var(--text); color: var(--text); background: var(--bg); }

.review-card { flex-direction: column; align-items: stretch; gap: 6px; }
.review-card .review-text { font-size: 13.5px; color: var(--text); }

.service-thumb { width: 44px; height: 44px; border-radius: 10px; object-fit: cover; border: 1.5px solid var(--text); flex-shrink: 0; }

.screen { animation: fade-in .22s ease-out; }
.fade-in { animation: fade-in .18s ease-out; }
@keyframes fade-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }

.center { display: flex; align-items: center; justify-content: center; min-height: 60vh; }

.spinner {
  width: 32px; height: 32px; border-radius: 50%;
  border: 3px solid var(--border); border-top-color: var(--accent);
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.demo-banner {
  background: #fff2e0; color: #8a4b12; font-size: 13px; font-weight: 700;
  padding: 10px 14px; border-radius: 10px; margin-bottom: 14px; text-align: center;
  border: 1.5px solid #f0c98a;
}

.header { margin-bottom: 18px; }
.header h1 { font-size: 24px; margin: 0 0 4px; font-weight: 800; letter-spacing: -0.02em; }
.muted { color: var(--muted); font-size: 14px; margin: 0; }

.business-header { display: flex; align-items: center; gap: 14px; }
.business-header h1 { margin: 0 0 2px; }

.avatar {
  width: 54px; height: 54px; border-radius: 14px; object-fit: cover; flex-shrink: 0;
  border: 2px solid var(--text); background: var(--border);
}

.tabs { display: flex; gap: 6px; margin-bottom: 18px; border-bottom: 2px solid var(--border); }
.tab {
  flex: 1; padding: 10px 4px; border: none; border-bottom: 3px solid transparent;
  background: transparent; color: var(--muted); font-weight: 700; font-size: 13.5px;
  cursor: pointer; transition: all .12s ease; font-family: inherit; margin-bottom: -2px;
}
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }

.card-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 18px; }

.card {
  background: var(--card-bg); border: 1.5px solid var(--text); border-radius: 12px;
  padding: 14px 16px; display: flex; justify-content: space-between; align-items: center; gap: 10px;
  box-shadow: var(--shadow-hard); transition: transform .1s ease, box-shadow .1s ease;
}
.card:hover { transform: translate(-1px, -1px); box-shadow: var(--shadow-hard-lg); }
.card-title { font-weight: 700; font-size: 15px; }
.card-sub { color: var(--muted); font-size: 13px; margin-top: 3px; }

.chip-list { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.chip {
  padding: 8px 14px; border-radius: 999px; border: 1.5px solid var(--text);
  background: var(--card-bg); font-size: 13.5px; cursor: pointer; font-weight: 700;
  font-family: inherit; transition: all .1s ease; box-shadow: var(--shadow-hard);
}
.chip:hover { transform: translate(-1px, -1px); }
.chip.selected { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }

.form { display: flex; flex-direction: column; gap: 14px; }
.form label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); font-weight: 700; }
.form input, .form textarea, .form select {
  font-size: 15px; padding: 11px 13px; border-radius: 10px; border: 1.5px solid var(--border);
  background: var(--card-bg); color: var(--text); font-family: inherit; transition: border-color .12s ease;
}
.form input:focus, .form textarea:focus, .form select:focus { outline: none; border-color: var(--accent); }
.row { display: flex; gap: 12px; }
.row label { flex: 1; }

.search-row { display: flex; gap: 8px; margin-bottom: 18px; }
.search-row input {
  flex: 1; font-size: 15px; padding: 11px 13px; border-radius: 10px; border: 1.5px solid var(--border);
  background: var(--card-bg); color: var(--text); font-family: inherit;
}
.search-row input:focus { outline: none; border-color: var(--accent); }

.schedule-editor { display: flex; flex-direction: column; gap: 8px; }
.schedule-row {
  display: flex; align-items: center; gap: 10px; background: var(--card-bg); border: 1.5px solid var(--border);
  border-radius: 12px; padding: 10px 12px;
}
.schedule-row .day-name { width: 34px; font-weight: 700; font-size: 14px; flex-shrink: 0; }
.schedule-row .times { display: flex; gap: 6px; flex: 1; }
.schedule-row .times input { flex: 1; min-width: 0; padding: 8px 6px; font-size: 13px; }
.schedule-row.off { opacity: 0.5; }
.schedule-row.off .times { visibility: hidden; }

.switch { position: relative; width: 40px; height: 24px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch-track {
  position: absolute; inset: 0; background: var(--border); border-radius: 999px; cursor: pointer; transition: background .15s ease;
}
.switch-track::before {
  content: ""; position: absolute; width: 18px; height: 18px; left: 3px; top: 3px; background: #fff; border-radius: 50%;
  transition: transform .15s ease; box-shadow: 0 1px 3px rgba(0,0,0,0.25);
}
.switch input:checked + .switch-track { background: var(--accent); }
.switch input:checked + .switch-track::before { transform: translateX(16px); }

.btn-primary {
  background: var(--accent); color: var(--accent-ink); border: 1.5px solid var(--text); border-radius: 12px;
  padding: 14px; font-size: 15px; font-weight: 800; cursor: pointer; font-family: inherit;
  box-shadow: var(--shadow-hard-lg); transition: transform .1s ease;
}
.btn-primary:active { transform: translate(2px, 2px); box-shadow: none; }
.btn-outline {
  background: var(--card-bg); color: var(--text); border: 1.5px solid var(--text); border-radius: 12px;
  padding: 11px 14px; font-size: 14px; font-weight: 700; cursor: pointer; font-family: inherit;
  box-shadow: var(--shadow-hard); white-space: nowrap;
}
.btn-small {
  background: var(--text); color: var(--bg); border: none; border-radius: 8px;
  padding: 7px 12px; font-size: 13px; cursor: pointer; font-family: inherit; font-weight: 700;
}
.btn-text { background: none; border: none; color: var(--accent); font-size: 14px; padding: 12px; cursor: pointer; width: 100%; font-weight: 800; font-family: inherit; }
.back-link { width: auto; padding: 0 0 12px; text-align: left; color: var(--muted); font-weight: 700; font-size: 13px; }
.btn-danger { background: none; border: 1.5px solid var(--danger); color: var(--danger); border-radius: 8px; padding: 7px 12px; font-size: 13px; cursor: pointer; font-family: inherit; font-weight: 700; }

.stats-row { display: flex; gap: 8px; margin-bottom: 18px; }
.stat-card {
  flex: 1; background: var(--card-bg); border: 1.5px solid var(--text); border-radius: 12px;
  padding: 14px 6px; text-align: center; box-shadow: var(--shadow-hard);
}
.stat-value { font-size: 20px; font-weight: 800; color: var(--accent); }
.stat-label { font-size: 11px; color: var(--muted); margin-top: 3px; font-weight: 700; }

.share-box {
  background: #fdf0e6; border: 1.5px solid var(--text); border-radius: 12px;
  padding: 14px; margin-bottom: 18px; font-size: 13px; color: var(--muted); font-weight: 700;
}
.share-link { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.share-link code { flex: 1; overflow-x: auto; white-space: nowrap; font-size: 12px; color: var(--text); background: var(--card-bg); padding: 6px 10px; border-radius: 8px; border: 1px solid var(--border); }

.inline-form { flex-direction: row; flex-wrap: wrap; align-items: flex-end; margin-bottom: 28px; gap: 10px 8px; }
.inline-form label { flex: 1; min-width: 90px; }
.inline-form label.field-full { flex: 1 1 100%; }
.inline-form input { width: 100%; }

.empty-state { color: var(--muted); font-size: 14px; text-align: center; padding: 28px 0; font-weight: 600; }

h3 { font-size: 15px; font-weight: 800; margin: 4px 0 10px; }

.rating-line { font-size: 13px; font-weight: 800; color: var(--amber); margin: 2px 0 0; }

.date-tile {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-width: 54px; padding: 10px 6px; border-radius: 12px; border: 1.5px solid var(--text);
  background: var(--card-bg); cursor: pointer; box-shadow: var(--shadow-hard); transition: all .1s ease;
  font-family: inherit;
}
.date-tile .dow { font-size: 11px; color: var(--muted); font-weight: 700; text-transform: uppercase; }
.date-tile .num { font-size: 18px; font-weight: 800; margin-top: 2px; }
.date-tile:hover { transform: translate(-1px, -1px); }
.date-tile.selected { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.date-tile.selected .dow, .date-tile.selected .num { color: var(--accent-ink); }

.stars { display: flex; gap: 4px; }
.stars button {
  background: none; border: none; font-size: 22px; cursor: pointer; padding: 0; line-height: 1; opacity: 0.3; color: var(--amber);
  transition: opacity .1s ease, transform .1s ease;
}
.stars button.filled { opacity: 1; }
.stars button:hover { transform: scale(1.15); }
.stars.readonly button { cursor: default; }
.stars.readonly button:hover { transform: none; }

.history-card { flex-direction: column; align-items: stretch; gap: 10px; }
.history-card .history-top { display: flex; justify-content: space-between; align-items: flex-start; }
.history-card .history-actions { display: flex; justify-content: space-between; align-items: center; gap: 8px; }

.mp-card { align-items: flex-start; }
.mp-card .mp-avatar { width: 46px; height: 46px; border-radius: 12px; object-fit: cover; border: 1.5px solid var(--text); flex-shrink: 0; }
.mp-card .mp-info { flex: 1; }
.mp-tag {
  display: inline-block; font-size: 11px; font-weight: 800; color: var(--teal); background: #e3f1ee;
  padding: 2px 8px; border-radius: 999px; margin-top: 4px;
}
.mp-distance { font-size: 12px; font-weight: 800; color: var(--accent); white-space: nowrap; }
.mp-next-slot { font-size: 12px; font-weight: 700; color: var(--teal); margin-top: 4px; }

.mp-card { position: relative; }
.top-badge {
  position: absolute; top: -8px; left: 12px; background: var(--accent); color: var(--accent-ink);
  font-size: 10.5px; font-weight: 800; padding: 3px 8px 3px 6px; border-radius: 6px;
  border: 1.5px solid var(--text); letter-spacing: 0.02em; box-shadow: var(--shadow-hard);
}

.fav-btn {
  background: none; border: none; cursor: pointer; font-size: 20px; padding: 4px; line-height: 1;
  color: var(--border-strong); flex-shrink: 0;
}
.fav-btn.active { color: var(--accent); }

.sort-row { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; }
.sort-row .chip-list { margin-bottom: 0; flex: 1; }

.trust-line { font-size: 12.5px; color: var(--muted); font-weight: 700; margin: 2px 0 0; }
