/* ============================================================
   Office Hours — Design System (ported from design handoff)
   Cool/calm blues + greens. All color in oklch so the theme
   re-skins from --primary + --accent. Plain-CSS port of the
   React prototype's tokens + primitives.
   ============================================================ */
:root {
  --bg:           oklch(0.985 0.006 236);
  --bg-sunken:    oklch(0.967 0.008 236);
  --surface:      oklch(1 0 0);
  --surface-2:    oklch(0.978 0.006 236);

  --ink:          oklch(0.255 0.03 258);
  --ink-2:        oklch(0.46 0.025 258);
  --ink-3:        oklch(0.60 0.018 258);

  --border:       oklch(0.918 0.008 250);
  --border-2:     oklch(0.865 0.012 250);

  --primary:      oklch(0.555 0.165 256);
  --primary-700:  color-mix(in oklab, var(--primary), black 18%);
  --primary-300:  color-mix(in oklab, var(--primary), white 46%);
  --primary-soft: color-mix(in oklab, var(--primary), white 88%);
  --on-primary:   oklch(0.99 0.01 256);

  --accent:       oklch(0.685 0.115 178);
  --accent-700:   color-mix(in oklab, var(--accent), black 22%);
  --accent-soft:  color-mix(in oklab, var(--accent), white 87%);

  --danger:       oklch(0.595 0.18 24);
  --danger-soft:  oklch(0.955 0.03 24);
  --warn:         oklch(0.72 0.14 75);
  --warn-soft:    oklch(0.96 0.04 75);
  --warn-ink:     oklch(0.52 0.12 70);
  --success:      oklch(0.64 0.13 158);
  --success-soft: oklch(0.955 0.035 158);

  --nav-bg:       oklch(0.255 0.035 262);
  --nav-bg-2:     oklch(0.225 0.035 262);
  --nav-ink:      oklch(0.96 0.01 256);
  --nav-ink-2:    oklch(0.72 0.02 256);
  --nav-line:     oklch(0.36 0.03 262);
  --nav-active:   oklch(0.33 0.06 258);

  --r-sm: 8px; --r: 12px; --r-lg: 16px; --r-xl: 22px; --r-pill: 999px;

  --sh-1: 0 1px 2px oklch(0.4 0.04 258 / 0.06), 0 1px 3px oklch(0.4 0.04 258 / 0.05);
  --sh-2: 0 2px 4px oklch(0.4 0.04 258 / 0.05), 0 6px 16px oklch(0.4 0.04 258 / 0.08);
  --sh-3: 0 8px 24px oklch(0.35 0.04 258 / 0.12), 0 2px 6px oklch(0.35 0.04 258 / 0.06);
  --sh-pop: 0 12px 40px oklch(0.3 0.05 258 / 0.18);

  --font: "Schibsted Grotesk", ui-sans-serif, system-ui, -apple-system, sans-serif;
  --maxw: 1160px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; min-height: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-size: 15px;
  line-height: 1.5;
}
a { color: var(--primary-700); }
button { font-family: inherit; }
::selection { background: var(--primary-soft); }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

/* ---- type ---- */
.h1 { font-size: 30px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; margin: 0; }
.h2 { font-size: 22px; font-weight: 700; letter-spacing: -0.015em; line-height: 1.15; margin: 0; }
.h3 { font-size: 17px; font-weight: 700; letter-spacing: -0.01em; margin: 0; }
.eyebrow { font-size: 11.5px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); }
.muted { color: var(--ink-2); }
.faint { color: var(--ink-3); }
.tnum { font-variant-numeric: tabular-nums; }

/* ---- buttons ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 10px 17px; min-height: 42px; font-size: 14.5px; font-weight: 600;
  border-radius: var(--r); cursor: pointer; letter-spacing: -0.01em;
  border: 1px solid transparent;
  transition: transform .12s ease, filter .15s ease, box-shadow .15s ease, background .15s ease;
}
.btn:hover:not(:disabled) { transform: translateY(-1px); filter: brightness(1.04); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.sm { padding: 7px 13px; min-height: 34px; font-size: 13.5px; gap: 6px; }
.btn.lg { padding: 13px 22px; min-height: 50px; font-size: 16px; gap: 8px; }
.btn.full { width: 100%; }
.btn.primary { background: var(--primary); color: var(--on-primary); box-shadow: var(--sh-1); }
.btn.accent  { background: var(--accent); color: oklch(0.99 0.01 178); box-shadow: var(--sh-1); }
.btn.dark    { background: var(--ink); color: var(--surface); }
.btn.outline { background: var(--surface); color: var(--ink); border-color: var(--border-2); }
.btn.ghost   { background: transparent; color: var(--ink-2); }
.btn.soft    { background: var(--primary-soft); color: var(--primary-700); }
.btn.danger  { background: var(--danger-soft); color: var(--danger); }

/* ---- badges ---- */
.badge {
  display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px;
  border-radius: var(--r-pill); font-size: 12.5px; font-weight: 600;
  letter-spacing: -0.005em; white-space: nowrap;
  background: var(--bg-sunken); color: var(--ink-2);
}
.badge.sm { padding: 3px 8px; font-size: 11.5px; }
.badge.primary { background: var(--primary-soft); color: var(--primary-700); }
.badge.accent  { background: var(--accent-soft); color: var(--accent-700); }
.badge.success { background: var(--success-soft); color: var(--success); }
.badge.danger  { background: var(--danger-soft); color: var(--danger); }
.badge.warn    { background: var(--warn-soft); color: var(--warn-ink); }

/* ---- card ---- */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 20px; box-shadow: var(--sh-1);
  transition: box-shadow .2s ease, transform .2s ease, border-color .2s ease;
}
.card.hover:hover { box-shadow: var(--sh-3); transform: translateY(-2px); border-color: var(--border-2); }
.card.clickable { cursor: pointer; }

/* ---- segmented ---- */
.seg { display: inline-flex; padding: 4px; gap: 2px; background: var(--bg-sunken);
  border-radius: var(--r); border: 1px solid var(--border); }
.seg button {
  border: none; cursor: pointer; border-radius: calc(var(--r) - 3px);
  padding: 8px 16px; font-size: 14px; font-weight: 600; letter-spacing: -0.01em;
  background: transparent; color: var(--ink-2); transition: all .15s ease;
}
.seg button.active { background: var(--surface); color: var(--ink); box-shadow: var(--sh-1); }
.seg.sm button { padding: 6px 12px; font-size: 13px; }

/* ---- inputs ---- */
.field { display: block; }
.field > .label { font-size: 13.5px; font-weight: 600; margin-bottom: 7px; color: var(--ink); }
.field > .hint { font-size: 12.5px; color: var(--ink-3); margin-top: 6px; }
.input {
  display: flex; align-items: center; gap: 9px; padding: 0 13px;
  background: var(--surface); border: 1px solid var(--border-2);
  border-radius: var(--r); height: 44px;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.input:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.input input, .input select {
  border: none; outline: none; background: transparent; width: 100%;
  font-family: inherit; font-size: 14.5px; color: var(--ink);
}
.input .ico { color: var(--ink-3); flex: none; display: flex; }

/* ---- avatar ---- */
.avatar {
  border-radius: 50%; display: grid; place-items: center; font-weight: 700;
  letter-spacing: -0.02em; flex: none;
}

/* ---- icons ---- */
.icon { display: inline-flex; vertical-align: middle; }

/* ---- capacity bar ---- */
.capbar { height: 8px; border-radius: var(--r-pill); background: var(--bg-sunken); overflow: hidden; }
.capbar > span { display: block; height: 100%; border-radius: var(--r-pill); background: var(--accent); transition: width .3s ease; }
.capbar.full > span { background: var(--warn); }

/* ---- status chip (per session) ---- */
.chip {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px;
  border-radius: var(--r-pill); font-size: 12px; font-weight: 700; white-space: nowrap;
}
.chip.going    { background: var(--success-soft); color: var(--success); }
.chip.waitlist { background: var(--warn-soft); color: var(--warn-ink); }
.chip.full     { background: var(--bg-sunken); color: var(--ink-3); }
.chip.open     { background: var(--primary-soft); color: var(--primary-700); }

/* ---- toast ---- */
.toast {
  position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%) translateY(8px);
  background: var(--ink); color: var(--surface); padding: 12px 18px; border-radius: var(--r);
  box-shadow: var(--sh-pop); font-weight: 600; font-size: 14px; z-index: 200;
  opacity: 0; pointer-events: none; transition: opacity .2s ease, transform .2s ease; max-width: 90vw;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.error { background: var(--danger); }

/* ---- slide-over panel + scrim ---- */
.scrim {
  position: fixed; inset: 0; background: oklch(0.2 0.03 258 / 0.42); z-index: 150;
  opacity: 0; transition: opacity .28s ease;
}
.scrim.show { opacity: 1; }
.panel {
  position: fixed; top: 0; right: 0; height: 100%; width: min(440px, 92vw);
  background: var(--surface); box-shadow: var(--sh-pop); z-index: 151;
  display: flex; flex-direction: column; transform: translateX(100%);
  transition: transform .28s cubic-bezier(0.2,0.7,0.2,1);
}
.panel.show { transform: translateX(0); }
.panel-head { display: flex; align-items: flex-start; justify-content: space-between;
  gap: 12px; padding: 20px 22px; border-bottom: 1px solid var(--border); }
.panel-body { padding: 20px 22px; overflow-y: auto; flex: 1; align-content: start; }
.panel-foot { padding: 16px 22px; border-top: 1px solid var(--border); }
.iconbtn {
  border: 1px solid var(--border-2); background: var(--surface); color: var(--ink-2);
  width: 36px; height: 36px; border-radius: var(--r-sm); cursor: pointer;
  display: grid; place-items: center; flex: none;
}
.iconbtn:hover { background: var(--bg-sunken); }

/* ---- animations ---- */
@keyframes oh-fade-up { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes oh-fade { from { opacity: 0; } to { opacity: 1; } }
.anim-up { animation: oh-fade-up 0.45s cubic-bezier(0.2,0.7,0.2,1) both; }
.anim-fade { animation: oh-fade 0.4s ease forwards; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: 0.001ms !important; } }

/* ---- helpers ---- */
.row { display: flex; align-items: center; gap: 10px; }
.col { display: flex; flex-direction: column; }
.wrap-pad { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }
.spacer { flex: 1 1 auto; }
.stack > * + * { margin-top: var(--gap, 12px); }
