:root {
  --bg: #f3f5f8;
  --bg2: #eef2f6;
  --card: #ffffff;
  --line: #e2e8ef;
  --text: #142033;
  --muted: #5d6b7e;
  --navy: #163a5f;
  --navy-2: #0f2c4a;
  --accent: #1b7a72;
  --accent-dim: rgba(27, 122, 114, 0.1);
  --bad: #c4453c;
  --warn: #b7791f;
  --ok: #1b7a72;
  --radius: 16px;
  --shadow: 0 10px 30px rgba(20, 32, 51, 0.06);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; min-height: 100%; }
html { background: var(--bg); }
body {
  font-family: "Manrope", system-ui, sans-serif;
  color: var(--text);
  background-color: var(--bg);
  background-image: linear-gradient(180deg, #f7f9fb 0%, var(--bg) 180px);
  min-height: 100dvh;
}

button, input, select { font-family: inherit; }
button { cursor: pointer; }
a { color: var(--accent); }

.app {
  width: min(440px, 100%);
  margin: 0 auto;
  min-height: 100dvh;
  padding: calc(20px + var(--safe-t)) 20px calc(28px + var(--safe-b));
  position: relative;
  z-index: 1;
}

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}
.brand {
  display: flex;
  align-items: center;
  text-decoration: none;
  color: inherit;
}
.word {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-weight: 600;
  letter-spacing: 0.14em;
  font-size: 22px;
  color: var(--navy);
}
.word span { color: var(--accent); font-weight: 600; }
.admin-link {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  padding: 8px 4px;
  background: none;
  border: 0;
}
.top-actions { display: flex; align-items: center; gap: 4px; }
.gear {
  width: 44px;
  height: 44px;
  border: 0;
  background: transparent;
  color: var(--navy);
  display: grid;
  place-items: center;
  border-radius: 12px;
}
.gear:active { background: #e8eef3; }
.gear.on { background: #e8eef3; }

.earn-grid {
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
}
.earn-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px 18px;
  box-shadow: var(--shadow);
}
.earn-card span {
  display: block;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.earn-card b {
  display: block;
  font-size: 32px;
  color: var(--navy);
  margin: 4px 0 0;
  line-height: 1.1;
}
.earn-card small {
  color: var(--muted);
  font-size: 13px;
}
.earn-card strong {
  display: block;
  margin-top: 8px;
  font-size: 20px;
  color: var(--accent);
}

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(20, 32, 51, 0.45);
  z-index: 40;
  display: grid;
  place-items: end center;
  padding: 16px 16px calc(16px + env(safe-area-inset-bottom, 0px));
}
.overlay-card {
  width: min(430px, 100%);
  background: #fff;
  border-radius: 20px;
  padding: 20px 18px 16px;
  box-shadow: 0 20px 50px rgba(20, 32, 51, 0.2);
}
.overlay-card h3 {
  margin: 0 0 6px;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 26px;
  color: var(--navy);
}
.overlay-card textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  font-size: 16px;
  font-family: inherit;
  resize: none;
  margin: 10px 0 8px;
  outline: none;
  color: var(--text);
}
.overlay-card textarea:focus { border-color: var(--navy); }

.hero h1 {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 36px;
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -0.02em;
  margin: 0 0 8px;
  color: var(--navy);
}
.hero p {
  margin: 0 0 22px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.5;
}

.steps {
  display: flex;
  gap: 6px;
  margin-bottom: 18px;
}
.dot {
  height: 3px;
  flex: 1;
  border-radius: 99px;
  background: #d5dde6;
}
.dot.on { background: var(--navy); }

.screen { display: none; animation: up .22s ease; }
.screen.on { display: block; }
@keyframes up {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

.services { display: grid; gap: 10px; }
.svc {
  text-align: left;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--text);
  border-radius: var(--radius);
  padding: 16px;
  display: grid;
  grid-template-columns: 48px 1fr auto;
  gap: 12px;
  align-items: center;
  box-shadow: var(--shadow);
}
.svc:active { transform: scale(.99); }
.svc.on {
  border-color: var(--navy);
  box-shadow: 0 0 0 1px var(--navy), var(--shadow);
}
.svc .ico {
  width: 48px; height: 48px;
  border-radius: 12px;
  display: grid; place-items: center;
  background: #eef3f7;
  color: var(--navy);
}
.svc b { display: block; font-size: 17px; font-weight: 700; }
.svc small { color: var(--muted); font-size: 13px; }
.price {
  font-weight: 700;
  font-size: 17px;
  color: var(--navy);
}

label.k {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  margin: 6px 0 10px;
}

.days {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 0 0 18px;
}
.days:has(:only-child) { grid-template-columns: 1fr; }

.day {
  height: 72px;
  width: 100%;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--navy);
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.04em;
  box-shadow: var(--shadow);
}
.day:active { transform: scale(.99); }
.day.on {
  background: var(--navy);
  color: #fff;
  border-color: var(--navy);
}

.slots {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.slot {
  height: 52px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--text);
  font-size: 15px;
  font-weight: 650;
}
.slot:disabled, .slot.gone {
  opacity: .42;
  color: var(--muted);
  background: #f4f6f8;
}
.slot.on {
  background: var(--navy);
  color: #fff;
  border-color: var(--navy);
}
.slot.lunch {
  opacity: .7;
  background: #f7f1e6;
  color: var(--warn);
  border-color: #ead9b5;
}
.empty {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--muted);
  padding: 28px 10px;
}

.sheet {
  margin-top: 8px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 18px;
  box-shadow: var(--shadow);
}
.field { margin-bottom: 14px; }
.field span {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 6px;
  font-weight: 650;
}
.field input {
  width: 100%;
  height: 54px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fbfcfd;
  color: var(--text);
  font-size: 17px;
  padding: 0 14px;
  outline: none;
}
.field input:focus { border-color: var(--navy); background: #fff; }

.summary {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 4px 0 16px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}
.summary b { color: var(--text); font-weight: 700; display: block; margin-top: 2px; font-size: 14px; }

.err {
  display: none;
  color: var(--bad);
  background: #fdf2f1;
  border: 1px solid #f3d0cd;
  border-radius: 12px;
  padding: 10px 12px;
  margin: 10px 0 0;
  font-size: 14px;
}
.err.on { display: block; }

.bar {
  position: sticky;
  bottom: 0;
  padding: 14px 0 calc(8px + var(--safe-b));
  background: linear-gradient(180deg, transparent, var(--bg) 28%);
}
.btn {
  width: 100%;
  height: 56px;
  border: 0;
  border-radius: 12px;
  background: var(--navy);
  color: #fff;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.01em;
}
.btn:disabled { opacity: .38; }
.btn.ghost {
  background: transparent;
  color: var(--navy);
  border: 1px solid var(--line);
  margin-top: 10px;
}
.btn.bad { background: var(--bad); color: #fff; }
.btn.ok { background: #1b7a72; color: #fff; }
.btn.mute { background: #e8eef3; color: var(--navy); border: 0; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

.done {
  text-align: center;
  padding: 18px 8px 8px;
}
.badge {
  width: 78px; height: 78px;
  margin: 8px auto 18px;
  border-radius: 24px;
  background: var(--navy);
  display: grid; place-items: center;
}
.done h2 {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 34px;
  font-weight: 600;
  margin: 0 0 8px;
  color: var(--navy);
}
.done p { color: var(--muted); margin: 0 0 18px; }
.ticket {
  text-align: left;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px 18px;
  margin-bottom: 18px;
}
.ticket div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  font-size: 15px;
  color: var(--muted);
}
.ticket div:last-child { border-bottom: 0; }
.ticket b { color: var(--text); font-weight: 700; }

.hint { color: var(--muted); font-size: 13px; text-align: center; margin-top: 14px; }

.login { margin-top: 28px; }
.login h1 {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 32px;
  font-weight: 600;
  margin: 0 0 8px;
  color: var(--navy);
}

.live {
  display: inline-block;
  margin-left: 8px;
  font-family: Manrope, sans-serif;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  vertical-align: middle;
}
.now-banner {
  background: var(--navy);
  color: #fff;
  border-radius: 18px;
  padding: 16px 18px;
  margin-bottom: 12px;
}
.now-banner em {
  display: block;
  font-style: normal;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 0.7;
  margin-bottom: 4px;
}
.now-banner .t {
  font-size: 40px;
  font-weight: 800;
  line-height: 1;
}
.now-banner p { margin: 6px 0 0; font-size: 18px; font-weight: 650; }
.now-banner a { color: #fff; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px 16px;
  margin-bottom: 10px;
  box-shadow: var(--shadow);
}
.card h3 { margin: 0 0 4px; font-size: 18px; }
.card.queue {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 12px;
  align-items: center;
}
.card.queue .t {
  font-size: 26px;
  font-weight: 800;
  color: var(--navy);
  line-height: 1;
}
.card.next {
  border-color: var(--navy);
  box-shadow: 0 0 0 2px var(--navy);
}
.card.fresh {
  border-color: var(--accent);
  animation: popin 0.9s ease 2;
}
@keyframes popin {
  0%, 100% { transform: none; }
  50% { transform: scale(1.02); }
}
.tag.new {
  background: var(--accent);
  color: #fff;
}
.slot-fold {
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  padding: 4px 12px 12px;
}
.slot-fold summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--muted);
  padding: 12px 0;
}
.meta { color: var(--muted); font-size: 14px; display: flex; flex-wrap: wrap; gap: 8px 12px; }
.meta a { color: var(--accent); text-decoration: none; font-weight: 700; }
.tag {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--accent-dim);
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
}
.tag.off { background: #fdf2f1; color: var(--bad); }
.tag.block { background: #f7f1e6; color: var(--warn); }

.tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  background: #e8eef3;
  padding: 4px;
  border-radius: 14px;
  margin-bottom: 16px;
}
.tabs-4 { grid-template-columns: 1fr 1fr; }
.tab {
  height: 44px;
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}
.tab span {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  margin-left: 4px;
  padding: 0 6px;
  border-radius: 999px;
  background: rgba(20, 32, 51, 0.08);
  font-size: 12px;
}
.tab.on {
  background: #fff;
  color: var(--navy);
  box-shadow: 0 1px 4px rgba(20, 32, 51, 0.08);
}
.tab.on span { background: var(--navy); color: #fff; }

.toolbar {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 14px;
}
.toolbar input[type="date"], .toolbar select, .pin {
  height: 48px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--text);
  padding: 0 12px;
  font-size: 16px;
}
.stats {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  margin-bottom: 14px;
}
.stat {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
  text-align: center;
}
.stat b { display: block; font-size: 22px; color: var(--navy); }
.stat span { color: var(--muted); font-size: 12px; }

.tiny {
  width: auto;
  height: 40px;
  padding: 0 12px;
  font-size: 14px;
  border-radius: 10px;
}

.slot-admin { height: 44px; font-size: 13px; }
.muted { color: var(--muted); }
.hidden { display: none !important; }

.mine { margin: 0 0 18px; display: grid; gap: 10px; }
.mine-card {
  background: #fff;
  border: 1px solid var(--line);
  border-left: 4px solid var(--navy);
  border-radius: 14px;
  padding: 14px 16px;
  box-shadow: var(--shadow);
}
.mine-card.cancel {
  border-left-color: var(--bad);
  background: #fff;
}
.mine-card .when {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 22px;
  margin: 4px 0 2px;
  color: var(--navy);
}
.mine-card .who { color: var(--muted); font-size: 14px; }
.mine-card .btn { margin-top: 12px; }
.notice {
  text-align: left;
  background: #f7f1e6;
  border: 1px solid #ead9b5;
  color: #5c4a24;
  border-radius: 14px;
  padding: 12px 14px;
  font-size: 14px;
  line-height: 1.45;
  margin: 0 0 14px;
}
.notice a { color: var(--navy); font-weight: 800; text-decoration: none; }
.hours-box .field input { font-size: 20px; font-weight: 700; text-align: center; }
#price-list .field input {
  font-size: 16px;
  font-weight: 600;
  text-align: left;
}

.panel-title {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 32px;
  font-weight: 600;
  margin: 0 0 16px;
  color: var(--navy);
}
