:root {
  --bg: #f3efe8; --surface: #fbf9f5; --card: #ffffff; --ink: #1f1d1a; --muted: #6f6a62; --line: #e4ddd1;
  --accent: #8a6f4d; --accent-soft: #efe6d8; --ok: #4f7a5b; --ok-soft: #e3eee5; --warn: #b3743a; --warn-soft: #f6e8da;
  --bad: #b3563a; --bad-soft: #f5e1da; --info: #4d6a8a; --info-soft: #dfe7f0;
  --shadow: 0 20px 40px -24px rgba(0, 0, 0, .25);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #141311; --surface: #1c1a17; --card: #23201c; --ink: #f1ece4; --muted: #a39c90; --line: #35302a;
    --accent: #c9a878; --accent-soft: #2f2921; --ok: #7fb08b; --ok-soft: #1f2c22; --warn: #d69a5c; --warn-soft: #33261a;
    --bad: #d8826a; --bad-soft: #3a221b; --info: #8fb0d6; --info-soft: #1d2833;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body { background: var(--bg); color: var(--ink); font: 15px/1.45 Inter, system-ui, -apple-system, sans-serif; min-height: 100vh; }
h1, h2, h3, .serif { font-family: "Cormorant Garamond", Georgia, serif; font-weight: 600; letter-spacing: .01em; line-height: 1.1; }
h1 { font-size: 32px; } h2 { font-size: 28px; } h3 { font-size: 21px; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
button:disabled { cursor: default; opacity: .45; }
input, select, textarea {
  width: 100%; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px;
}
input:focus, select:focus, textarea:focus, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
input[type="checkbox"] { width: auto; accent-color: var(--accent); }
label { display: block; font-size: 13px; color: var(--muted); margin: 10px 0 4px; }
label.check { display: flex; gap: 8px; align-items: center; color: var(--ink); font-size: 14px; margin: 6px 0; }
textarea { min-height: 70px; resize: vertical; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .08em; }
.nowrap { white-space: nowrap; }

/* ── chrome ── */
.demo-bar { background: var(--ink); color: var(--bg); font-size: 12px; text-align: center; padding: 5px 12px; letter-spacing: .02em; }
header.top {
  max-width: 1200px; margin: 0 auto; padding: 14px 16px 10px; display: flex; gap: 12px; align-items: center; justify-content: space-between;
}
.brand { font-family: "Cormorant Garamond", serif; font-size: 24px; letter-spacing: .28em; text-decoration: none; line-height: 1; }
.brand small { display: block; font: 500 10px Inter, sans-serif; letter-spacing: .2em; color: var(--muted); margin-top: 3px; }
.top-right { display: flex; gap: 8px; align-items: center; }
.lang { display: flex; gap: 2px; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 3px; }
.lang button { padding: 4px 9px; border-radius: 999px; font-size: 12px; color: var(--muted); }
.lang button.on { background: var(--ink); color: var(--bg); }
.link { font-size: 13px; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }

main#view { max-width: 480px; margin: 0 auto; padding: 8px 16px 110px; }
body.mode-staff main#view { max-width: 1200px; padding-bottom: 40px; }
body.mode-plain main#view { max-width: 720px; padding-bottom: 40px; }

nav.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 5; display: flex; justify-content: center;
  background: var(--card); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom);
}
nav.tabs .inner { display: flex; width: 100%; max-width: 480px; }
nav.tabs a { flex: 1; padding: 9px 0 11px; font-size: 11px; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 3px; text-decoration: none; }
nav.tabs a.on { color: var(--accent); }
nav.tabs svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.6; }
body:not(.mode-client) nav.tabs { display: none; }

/* ── building blocks ── */
.eyebrow { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin: 18px 0 6px; }
.eyebrow:first-child { margin-top: 4px; }
.hello { font-size: 34px; margin: 2px 0 16px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 16px; margin-bottom: 12px; }
.card.soft { background: var(--accent-soft); border-color: transparent; }
.card.flat { background: var(--surface); }
.row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.stack > * + * { margin-top: 8px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; background: var(--ink); color: var(--bg);
  padding: 11px 16px; border-radius: 12px; font-weight: 500; font-size: 14px; text-decoration: none; border: 1px solid var(--ink);
}
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn.danger { background: transparent; color: var(--bad); border-color: var(--bad-soft); }
.btn.accent { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.sm { padding: 6px 10px; font-size: 12px; border-radius: 9px; }
.btn.full { width: 100%; }
.btns { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.chip { display: inline-block; font-size: 11px; padding: 3px 8px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-weight: 500; white-space: nowrap; }
.chip.ok { background: var(--ok-soft); color: var(--ok); }
.chip.warn { background: var(--warn-soft); color: var(--warn); }
.chip.bad { background: var(--bad-soft); color: var(--bad); }
.chip.info { background: var(--info-soft); color: var(--info); }
.chip.gray { background: var(--surface); color: var(--muted); border: 1px solid var(--line); }
.bar { height: 6px; border-radius: 6px; background: var(--line); overflow: hidden; margin-top: 8px; }
.bar i { display: block; height: 100%; background: var(--accent); }
.notice { border-radius: 12px; padding: 10px 12px; font-size: 13px; background: var(--info-soft); color: var(--ink); margin: 10px 0; }
.notice.warn { background: var(--warn-soft); }
.notice.bad { background: var(--bad-soft); }
.back { font-size: 13px; color: var(--muted); margin-bottom: 10px; display: inline-block; text-decoration: none; }
.empty { color: var(--muted); font-size: 14px; padding: 14px 0; }
.spinner { width: 20px; height: 20px; border: 2px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; margin: 20px auto; }
@keyframes spin { to { transform: rotate(360deg); } }

.list .item { display: flex; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); text-decoration: none; }
.list .item:last-child { border-bottom: 0; }
.thumb { width: 52px; height: 52px; border-radius: 14px; flex: none; background: linear-gradient(135deg, var(--accent-soft), var(--accent)); }
.thumb.thermal { background: linear-gradient(135deg, #f0d9c4, #b3743a); }
.thumb.face { background: linear-gradient(135deg, #efe3e0, #a77b70); }
.thumb.recovery { background: linear-gradient(135deg, #dde8df, #4f7a5b); }
.item .grow { flex: 1; min-width: 0; }
.item small { color: var(--muted); font-size: 12px; }
.price { font-weight: 600; font-size: 14px; white-space: nowrap; }
.filters { display: flex; gap: 6px; overflow-x: auto; margin: 0 0 12px; padding-bottom: 2px; scrollbar-width: none; }
.filters button { white-space: nowrap; padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; font-size: 12px; background: var(--card); }
.filters button.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }

.days { display: flex; gap: 6px; margin: 12px 0 14px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
.days button { flex: none; width: 54px; padding: 7px 0; border: 1px solid var(--line); border-radius: 12px; font-size: 11px; line-height: 1.25; background: var(--card); }
.days button b { display: block; font-size: 17px; }
.days button.on, .slots button.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.slots { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-bottom: 14px; }
.slots button { padding: 9px 0; border: 1px solid var(--line); border-radius: 10px; font-size: 13px; background: var(--card); }

.toast {
  position: fixed; left: 50%; bottom: 84px; transform: translateX(-50%) translateY(160px); background: var(--ink); color: var(--bg);
  padding: 10px 16px; border-radius: 12px; font-size: 13px; transition: transform .25s; z-index: 50; max-width: calc(100% - 32px); text-align: center;
}
.toast.on { transform: translateX(-50%) translateY(0); }
.toast.bad { background: var(--bad); color: #fff; }

.code-box { display: flex; align-items: center; gap: 12px; margin-top: 10px; padding: 10px; border: 1px dashed var(--line); border-radius: 12px; }
.code-box .mono { font-size: 18px; font-weight: 600; }
.qr svg { display: block; width: 100%; height: auto; }

/* ── staff ── */
.staff-head { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; justify-content: space-between; margin: 6px 0 14px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.toolbar input[type="date"], .toolbar select { width: auto; padding: 7px 10px; font-size: 13px; }
.seg { display: inline-flex; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 3px; }
.seg button, .seg a { padding: 6px 11px; border-radius: 7px; font-size: 13px; color: var(--muted); text-decoration: none; }
.seg .on { background: var(--ink); color: var(--bg); }
.desk { display: grid; grid-template-columns: 1fr 330px; gap: 14px; align-items: start; }
.agenda-wrap { background: var(--card); border: 1px solid var(--line); border-radius: 18px; overflow: auto; max-height: calc(100vh - 170px); }
.agenda { display: grid; position: relative; min-width: 100%; }
.agenda .colh { position: sticky; top: 0; z-index: 3; background: var(--card); border-bottom: 1px solid var(--line); padding: 8px 10px; font-size: 13px; font-weight: 600; }
.agenda .colh small { display: block; font-weight: 400; color: var(--muted); font-size: 11px; }
.agenda .axis { position: relative; border-right: 1px solid var(--line); }
.agenda .axis span { position: absolute; right: 6px; font-size: 11px; color: var(--muted); transform: translateY(-50%); }
.agenda .col { position: relative; border-right: 1px solid var(--line); }
.agenda .col:last-child { border-right: 0; }
.agenda .hr { position: absolute; left: 0; right: 0; border-top: 1px solid var(--line); opacity: .6; }
.agenda .off { position: absolute; left: 0; right: 0; background: repeating-linear-gradient(45deg, transparent 0 6px, var(--surface) 6px 12px); }
.agenda .now { position: absolute; left: 0; right: 0; border-top: 2px solid var(--bad); z-index: 2; }
.appt {
  position: absolute; left: 4px; right: 4px; border-radius: 9px; padding: 4px 7px; font-size: 12px; line-height: 1.25; overflow: hidden;
  background: var(--accent-soft); border-left: 3px solid var(--accent); cursor: pointer; text-align: left; z-index: 1;
}
.appt b { display: block; font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.appt .buf { position: absolute; left: 0; right: 0; bottom: 0; background: repeating-linear-gradient(-45deg, transparent 0 4px, rgba(0,0,0,.06) 4px 8px); }
.appt.st-arrived { background: var(--info-soft); border-left-color: var(--info); }
.appt.st-in_progress { background: var(--warn-soft); border-left-color: var(--warn); }
.appt.st-done { background: var(--ok-soft); border-left-color: var(--ok); opacity: .8; }
.appt.st-no_show, .appt.st-cancelled { background: var(--bad-soft); border-left-color: var(--bad); opacity: .7; text-decoration: line-through; }
.appt.sel { outline: 2px solid var(--ink); }
.side { position: sticky; top: 10px; }
.status { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 12px 0; }
.status button { padding: 8px 4px; border: 1px solid var(--line); border-radius: 10px; font-size: 12px; background: var(--card); }
.status button.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; font-size: 13px; margin-top: 10px; }
dt { color: var(--muted); }

/* ── admin ── */
.tabs-h { display: flex; gap: 4px; flex-wrap: wrap; margin: 4px 0 16px; border-bottom: 1px solid var(--line); }
.tabs-h a { padding: 8px 12px; font-size: 14px; color: var(--muted); text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs-h a.on { color: var(--ink); border-bottom-color: var(--ink); }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: left; font-weight: 500; color: var(--muted); font-size: 12px; padding: 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
.table-wrap { overflow-x: auto; background: var(--card); border: 1px solid var(--line); border-radius: 14px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 12px; }
.checks { display: flex; flex-wrap: wrap; gap: 4px 16px; }
.hours-row { display: grid; grid-template-columns: 90px 1fr; gap: 8px; align-items: center; margin: 6px 0; font-size: 13px; }

/* ── kiosk ── */
body.mode-kiosk { background: #15130f; color: #f1ece4; }
body.mode-kiosk header.top, body.mode-kiosk .demo-bar { display: none; }
body.mode-kiosk main#view { max-width: none; padding: 0; }
.kiosk { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; gap: 48px; padding: 48px 56px; align-items: center; }
.kiosk .eyebrow { color: #a39c90; }
.kiosk h1 { font-size: 64px; line-height: 1; margin: 6px 0 14px; }
.kiosk p { color: #cfc7ba; font-size: 18px; }
.kiosk .kc { background: #221f1a; border-radius: 20px; padding: 22px; margin-bottom: 16px; }
.kiosk .kc.hi { background: #2c2822; }
.kiosk .btn { background: #c9a878; border-color: #c9a878; color: #15130f; font-size: 18px; padding: 14px 22px; }
.kiosk .btn.ghost { background: transparent; color: #a39c90; border-color: #3a352e; }
.kiosk input { background: #221f1a; border-color: #3a352e; color: #f1ece4; font-size: 26px; text-align: center; letter-spacing: .3em; text-transform: uppercase; padding: 14px; }
.kiosk .qr { background: #f1ece4; padding: 16px; border-radius: 18px; width: 280px; }
.kiosk .qr svg { color: #15130f; }
.kiosk .brandk { font-family: "Cormorant Garamond", serif; letter-spacing: .3em; font-size: 22px; color: #c9a878; }
.kiosk .visit { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid #3a352e; font-size: 18px; }
.kiosk .visit:last-child { border-bottom: 0; }
.kiosk .tick { color: #7fb08b; }
.kiosk .bar { background: #3a352e; } .kiosk .bar i { background: #c9a878; }
.kiosk-corner { position: fixed; right: 16px; bottom: 12px; display: flex; gap: 8px; opacity: .5; font-size: 12px; }
.kiosk-corner button, .kiosk-corner a { color: #a39c90; text-decoration: underline; }

/* ── privacy ── */
.prose h2 { margin: 18px 0 8px; font-size: 24px; }
.prose p, .prose li { margin: 6px 0; font-size: 14px; }
.prose ul { padding-left: 20px; }

@media (max-width: 900px) {
  .desk { grid-template-columns: 1fr; }
  .side { position: static; }
  .agenda-wrap { max-height: 70vh; }
  .kiosk { grid-template-columns: 1fr; padding: 28px 22px; gap: 24px; }
  .kiosk h1 { font-size: 44px; }
  .grid3 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 520px) {
  .grid2, .grid3 { grid-template-columns: 1fr; }
  .slots { grid-template-columns: repeat(3, 1fr); }
  header.top { padding: 12px 16px 8px; }
  .brand { font-size: 21px; }
}
