@font-face {
  font-family: "Brand";
  src: url("/static/fonts/montserrat-italic.woff2") format("woff2");
  font-weight: 100 900; font-style: italic; font-display: swap;
}

:root {
  color-scheme: dark;
  --bg: #000;
  --card: #0f0f10;
  --card-2: #18181a;
  --ink: #f5f5f5;
  --muted: #8a8a8f;
  --line: #262628;
  --accent: #ffffff;          /* overridden from BRAND_ACCENT */
  --accent-ink: #000;         /* text on accent */
  --accent-soft: rgb(255 255 255 / .1);
  --ok: #4ade80;
  --ok-soft: rgb(74 222 128 / .12);
  --danger: #f87171;
  --radius: 16px;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  background: var(--bg);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
body { margin: 0; min-height: 100dvh; padding-bottom: calc(76px + env(safe-area-inset-bottom)); background: var(--bg); }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.center { text-align: center; }
a { color: var(--accent); }

/* ---------- brand ---------- */
.display { font-family: "Brand", system-ui, sans-serif; font-style: italic; font-weight: 800; letter-spacing: -.01em; text-transform: uppercase; }
.mark { display: inline-flex; align-items: center; gap: 10px; }
.mark .logo { font-family: "Brand", system-ui, sans-serif; font-style: italic; font-weight: 900; font-size: 1.6rem; line-height: 1; letter-spacing: -.04em; }
.mark .logo-img { height: 30px; width: auto; display: block; }
.mark .sep { width: 1px; align-self: stretch; background: var(--line); margin: 3px 0; }
.mark .subt { font-size: .7rem; font-weight: 600; letter-spacing: .22em; text-transform: uppercase; color: var(--ink); }
.mark.big { flex-direction: column; gap: 14px; }
.mark.big .logo { font-size: 5.5rem; }
.mark.big .logo-img { height: 96px; }
.mark.big .sep { display: none; }
.mark.big .subt { font-size: .85rem; letter-spacing: .32em; }

.topbar {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(14px + env(safe-area-inset-top)) 18px 14px;
  background: rgb(0 0 0 / .85); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.topbar h1 { margin: 0; font-size: inherit; font-weight: inherit; display: flex; }
.topbar .link { color: var(--muted); }

.hero { text-align: center; padding: 40px 4px 26px; }
.hero .tagline { margin: 18px 0 0; color: var(--muted); font-size: .95rem; }
.pills { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 22px; }
.pills span { padding: 6px 11px; border: 1px solid var(--line); border-radius: 999px; font-size: .78rem; color: var(--ink); background: var(--card); }

.greet { margin: 4px 0 16px; }
.greet h2 { margin: 0; font-size: 1.6rem; line-height: 1.15; }
.greet h2 .hl { color: var(--accent); text-decoration: underline; text-decoration-thickness: 3px; text-underline-offset: 5px; }
.greet p { margin: 6px 0 0; color: var(--muted); }

.next {
  display: flex; align-items: center; gap: 14px; margin-bottom: 16px; padding: 14px 16px;
  background: linear-gradient(135deg, var(--accent-soft), transparent 70%), var(--card);
  border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: var(--radius);
}
.next .k { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--accent); font-weight: 700; }
.next .v { font-weight: 700; margin-top: 2px; }
.next .in { margin-left: auto; text-align: right; font-size: .8rem; color: var(--muted); white-space: nowrap; }
.next .in b { display: block; font-family: "Brand", sans-serif; font-style: italic; font-size: 1.4rem; color: var(--ink); }

.insta { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 22px 0 8px; color: var(--muted); text-decoration: none; font-size: .9rem; }
.insta svg { width: 18px; height: 18px; }
.insta:hover { color: var(--accent); }

/* ---------- layout ---------- */
main { max-width: 640px; margin: 0 auto; padding: 18px 16px; }
.card { background: var(--card); border-radius: var(--radius); padding: 16px; margin-bottom: 12px; border: 1px solid var(--line); }
.card.first { border-color: var(--accent); }
.day { margin: 22px 0 10px; font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }

.row { display: flex; align-items: center; gap: 12px; }
.grow { flex: 1; min-width: 0; }
.actions { margin-top: 14px; }
.time { font-weight: 700; font-variant-numeric: tabular-nums; }
.sub { font-size: .85rem; color: var(--muted); }

.slot { display: flex; align-items: center; gap: 12px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-bottom: 8px; }

.people { list-style: none; margin: 12px 0 0; padding: 0; border-top: 1px solid var(--line); }
.people li { display: flex; align-items: center; gap: 8px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.people li:last-child { border-bottom: 0; }

/* ---------- controls ---------- */
button, .btn {
  font: inherit; font-weight: 700; border: 0; border-radius: 12px;
  padding: 12px 16px; cursor: pointer; background: var(--accent); color: var(--accent-ink);
  transition: transform .08s, filter .15s;
}
button:active:not(:disabled) { transform: scale(.97); }
button:disabled { opacity: .35; cursor: default; }
button.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
button.danger { background: transparent; color: var(--danger); border: 1px solid rgb(248 113 113 / .35); }
button.small { padding: 7px 12px; font-size: .85rem; border-radius: 10px; }
button.link { background: none; padding: 4px; color: var(--muted); font-weight: 500; }
button.block { width: 100%; }
button.cta { text-transform: uppercase; letter-spacing: .06em; padding: 15px; }

label { display: block; font-size: .8rem; font-weight: 600; margin: 14px 0 6px; color: var(--muted); }
input, select {
  font: inherit; width: 100%; padding: 12px 14px; border: 1px solid var(--line);
  border-radius: 12px; background: var(--card-2); color: var(--ink); min-width: 0;
}
input:focus, select:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
input::placeholder { color: #5b5b63; }
.grid2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
input[type=date], input[type=time] { appearance: none; -webkit-appearance: none; min-height: 48px; }
.weekdays { display: flex; gap: 6px; flex-wrap: wrap; }
.weekdays label { margin: 0; font-weight: 500; }
.weekdays input { display: none; }
.weekdays span { display: inline-block; padding: 8px 11px; border: 1px solid var(--line); border-radius: 999px; background: var(--card-2); color: var(--ink); cursor: pointer; font-size: .85rem; }
.weekdays input:checked + span { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 700; }

.seg { display: flex; background: var(--card-2); border: 1px solid var(--line); border-radius: 12px; padding: 3px; margin-bottom: 14px; }
.seg button { flex: 1; background: none; color: var(--muted); padding: 9px; border-radius: 9px; }
.seg button.on { background: var(--ink); color: var(--bg); }

.tabs {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 5;
  display: flex; background: rgb(0 0 0 / .9); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom);
}
.tabs button { flex: 1; background: none; color: var(--muted); border-radius: 0; padding: 16px 4px; font-size: .85rem; text-transform: uppercase; letter-spacing: .06em; }
.tabs button.on { color: var(--accent); box-shadow: inset 0 3px 0 var(--accent); }

dialog { border: 1px solid var(--line); border-radius: 20px; padding: 0; width: min(520px, 94vw); max-height: 88dvh; background: var(--bg); color: var(--ink); }
dialog::backdrop { background: rgb(0 0 0 / .7); }
#sheet-body { padding: 18px; overflow: auto; max-height: 88dvh; }
#sheet-body h2 { margin: 0 0 12px; font-size: 1.2rem; }

.toast {
  position: fixed; left: 50%; bottom: calc(90px + env(safe-area-inset-bottom)); transform: translateX(-50%) translateY(20px);
  background: var(--accent); color: var(--accent-ink); font-weight: 700; padding: 11px 18px; border-radius: 12px; font-size: .9rem;
  opacity: 0; pointer-events: none; transition: .2s; width: max-content; max-width: 90vw; z-index: 20; box-shadow: 0 8px 30px rgb(0 0 0 / .5);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.err { background: var(--danger); color: #1a0606; }

.badge { font-size: .75rem; padding: 3px 9px; border-radius: 999px; background: var(--card-2); color: var(--ink); white-space: nowrap; }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.empty { text-align: center; color: var(--muted); padding: 40px 12px; }

/* ---------- calendar ---------- */
.cal { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.cal-head strong { text-transform: capitalize; font-size: 1.05rem; }
.cal-head button { width: 40px; font-size: 1.3rem; line-height: 1; padding: 6px 0; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; text-align: center; }
.cal-wd { font-size: .72rem; color: var(--muted); padding: 4px 0; text-transform: uppercase; letter-spacing: .04em; }
.cal-day {
  position: relative; aspect-ratio: 1; display: flex; align-items: center; justify-content: center;
  border-radius: 12px; font-size: .95rem; font-variant-numeric: tabular-nums; padding: 0;
  background: none; color: var(--ink); font-weight: 500;
}
.cal-day.off { color: #3a3a40; }
.cal-day.full { color: var(--muted); background: var(--card-2); }
.cal-day.free { background: var(--accent-soft); color: var(--accent); font-weight: 800; }
.cal-day.mine::after { content: ""; position: absolute; bottom: 5px; width: 5px; height: 5px; border-radius: 50%; background: var(--ok); }
.cal-day.sel { background: var(--accent); color: var(--accent-ink); box-shadow: 0 0 0 3px var(--accent-soft); }
.cal-day.sel.mine::after { background: var(--accent-ink); }

.chips { display: grid; grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); gap: 8px; }
.chip {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  padding: 13px 6px; border-radius: 12px; font-weight: 800; font-variant-numeric: tabular-nums; font-size: 1rem;
  background: var(--card); color: var(--ink); border: 1.5px solid var(--line);
}
button.chip:hover { border-color: var(--accent); color: var(--accent); }
.chip small { font-size: .68rem; font-weight: 600; color: var(--muted); }
.chip.full { color: #4a4a52; background: transparent; text-decoration: line-through; }
.chip.full small { text-decoration: none; color: #4a4a52; }
.chip.mine { color: var(--ok); border-color: var(--ok); background: var(--ok-soft); }
.chip.mine small { color: var(--ok); }
