/* Nimbrae site, console and sign-in pages. One stylesheet, light and dark. */
:root {
  --bg: #f7f6fa; --surface: #ffffff; --surface-2: #f1eff6; --line: #e4e0ec; --line-strong: #cfc8dc;
  --ink: #1b1822; --ink-2: #4a4556; --muted: #6c6679;
  --brand: #5b3fd6; --brand-ink: #ffffff; --brand-soft: #ece7ff; --brand-strong: #4a2fc0;
  --ok: #157a4a; --ok-soft: #e3f5ec; --warn: #8a5a00; --warn-soft: #fff3d6; --err: #b42318; --err-soft: #fde8e6;
  --ext: #9a3c00; --ext-soft: #ffeedd;
  --radius: 14px; --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(20, 10, 40, .06), 0 8px 24px rgba(20, 10, 40, .06);
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ff-display: 'Rajdhani', 'Segoe UI', system-ui, sans-serif;
  --ff-body: 'IBM Plex Sans', -apple-system, 'Segoe UI', Roboto, sans-serif;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f0d14; --surface: #17141f; --surface-2: #1f1b29; --line: #2c2738; --line-strong: #3d364d;
    --ink: #f1eef7; --ink-2: #c9c3d6; --muted: #9a93a8;
    --brand: #8b74ff; --brand-ink: #120d24; --brand-soft: #2a2246; --brand-strong: #a594ff;
    --ok: #4fd18f; --ok-soft: #10301f; --warn: #f2c14e; --warn-soft: #33270b; --err: #ff8a7a; --err-soft: #3a1512;
    --ext: #ffb27a; --ext-soft: #3a2210;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .35);
  }
}

* { box-sizing: border-box; }
html { -webkit-tap-highlight-color: transparent; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.55 var(--ff-body); min-height: 100svh; }
h1, h2, h3 { font-family: var(--ff-display); line-height: 1.12; letter-spacing: -0.005em; margin: 0 0 .5em; }
h1 { font-size: clamp(2rem, 5vw, 3.2rem); font-weight: 700; }
h2 { font-size: clamp(1.5rem, 3.2vw, 2rem); font-weight: 700; }
h3 { font-size: 1.2rem; font-weight: 600; }
p { margin: 0 0 1em; }
a { color: var(--brand); text-underline-offset: 3px; }
img, svg { max-width: 100%; }
code, .mono { font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-size: .92em; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 560px; }
.stack > * + * { margin-top: 12px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); border: 0; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 8px 12px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 8px; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 6px; }
.break { overflow-wrap: anywhere; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 18px;
  border-radius: var(--radius-sm); border: 1px solid transparent; background: var(--brand); color: var(--brand-ink); font: 600 1rem/1.2 var(--ff-body);
  text-decoration: none; cursor: pointer; touch-action: manipulation; user-select: none; -webkit-user-select: none;
  transition: transform 140ms var(--ease-out), background-color 140ms ease, border-color 140ms ease; }
.btn:active { transform: scale(0.97); }
.btn.secondary { background: var(--surface); color: var(--ink); border-color: var(--line-strong); }
.btn.ghost { background: transparent; color: var(--ink); }
.btn.danger { background: var(--err); color: #fff; }
.btn.small { min-height: 36px; padding: 6px 12px; font-size: .9rem; }
.btn.block { width: 100%; }
.btn svg { width: 20px; height: 20px; flex: none; }
.check > span { display: block; }
.check .hint { margin-top: 2px; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; transform: none; }
@media (hover: hover) and (pointer: fine) {
  .btn:hover { background: var(--brand-strong); }
  .btn.secondary:hover, .btn.ghost:hover { background: var(--surface-2); }
  .card.link:hover { border-color: var(--line-strong); transform: translateY(-1px); }
  .nav a:hover { color: var(--ink); }
}

/* forms */
label { display: block; font-weight: 600; font-size: .95rem; margin-bottom: 6px; }
.hint { display: block; font-weight: 400; color: var(--muted); font-size: .875rem; margin-top: 4px; }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=search], input[type=number], input:not([type]), select, textarea {
  width: 100%; min-height: 46px; padding: 10px 12px; border-radius: var(--radius-sm); border: 1px solid var(--line-strong);
  background: var(--surface); color: var(--ink); font: 16px/1.3 var(--ff-body); }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brand); outline-offset: 0; border-color: var(--brand); }
.field { margin-bottom: 16px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 500; }
.check input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--brand); flex: none; }
fieldset { border: 0; padding: 0; margin: 0 0 16px; }
legend { font-weight: 700; margin-bottom: 8px; }

/* choice cards (radio) */
.choices { display: grid; gap: 10px; }
.choice { position: relative; display: block; border: 1px solid var(--line-strong); border-radius: var(--radius); padding: 14px 16px 14px 48px;
  background: var(--surface); cursor: pointer; font-weight: 500; transition: border-color 140ms ease, background-color 140ms ease; }
.choice input { position: absolute; left: 16px; top: 17px; width: 20px; height: 20px; accent-color: var(--brand); }
.choice b { display: block; font-weight: 700; }
.choice span { color: var(--muted); font-size: .92rem; }
.choice:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }

/* segmented toggle */
.seg { display: inline-grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; padding: 4px; gap: 4px; }
.seg button, .seg a { min-height: 40px; padding: 8px 18px; border-radius: 999px; border: 0; background: transparent; color: var(--ink-2); font: 600 .95rem var(--ff-body);
  cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; touch-action: manipulation; user-select: none;
  transition: background-color 160ms var(--ease-out), color 160ms ease; }
.seg [aria-pressed="true"], .seg [aria-current="true"], .seg [aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }

/* cards and panels */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.card.link { display: block; color: inherit; text-decoration: none; transition: transform 160ms var(--ease-out), border-color 160ms ease; }
.card.link:active { transform: scale(0.99); }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.panel > .ph { padding: 16px 20px; border-bottom: 1px solid var(--line); display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.panel > .pb { padding: 20px; }
.list { list-style: none; margin: 0; padding: 0; }
.list > li { padding: 14px 20px; border-top: 1px solid var(--line); display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.list > li:first-child { border-top: 0; }
.list .who { min-width: 0; flex: 1 1 220px; }
.list .who b { display: block; overflow-wrap: anywhere; }

/* badges */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 999px; font-size: .78rem; font-weight: 700; letter-spacing: .02em;
  background: var(--surface-2); color: var(--ink-2); white-space: nowrap; }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.err { background: var(--err-soft); color: var(--err); }
.badge.brand { background: var(--brand-soft); color: var(--brand); }
.badge.ext { background: var(--ext-soft); color: var(--ext); }
.example { display: inline-flex; padding: 1px 7px; border-radius: 6px; font-size: .72rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  background: var(--warn-soft); color: var(--warn); vertical-align: middle; }

/* notices */
.note { border-radius: var(--radius-sm); padding: 12px 14px; background: var(--surface-2); border: 1px solid var(--line); margin-bottom: 16px; }
.note.warn { background: var(--warn-soft); border-color: transparent; color: var(--ink); }
.note.err { background: var(--err-soft); border-color: transparent; color: var(--ink); }
.note.ok { background: var(--ok-soft); border-color: transparent; color: var(--ink); }
.note.brand { background: var(--brand-soft); border-color: transparent; }

/* site header / footer */
.top { position: sticky; top: 0; z-index: 40; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: saturate(1.4) blur(10px);
  -webkit-backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line); padding-top: env(safe-area-inset-top, 0px); }
.top .wrap { display: flex; align-items: center; gap: 16px; min-height: 64px; }
.logo { display: inline-flex; align-items: center; gap: 10px; font: 700 1.35rem var(--ff-display); color: var(--ink); text-decoration: none; letter-spacing: .01em; }
.logo .mark { width: 30px; height: 30px; border-radius: 9px; background: linear-gradient(135deg, var(--brand), #c04ae0); display: inline-grid; place-items: center; color: #fff; font-size: 1rem; }
.nav { display: flex; gap: 4px; align-items: center; }
.nav a { color: var(--ink-2); text-decoration: none; font-weight: 500; padding: 8px 10px; border-radius: 8px; }
.nav a[aria-current="page"] { color: var(--ink); background: var(--surface-2); }
.top .actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.cart-link { position: relative; }
.cart-count { position: absolute; top: -4px; right: -6px; min-width: 20px; height: 20px; border-radius: 10px; background: var(--brand); color: var(--brand-ink);
  font-size: .75rem; font-weight: 700; display: grid; place-items: center; padding: 0 5px; }
.cart-count[hidden] { display: none; }
.menu-btn { display: none; }
@media (max-width: 860px) {
  .menu-btn { display: inline-flex; }
  .nav { display: none; position: absolute; left: 0; right: 0; top: 100%; background: var(--surface); border-bottom: 1px solid var(--line); flex-direction: column;
    align-items: stretch; padding: 8px 16px 16px; box-shadow: var(--shadow); }
  .nav.open { display: flex; }
  .nav a { padding: 12px; }
  .top .actions .hide-sm { display: none; }
}
footer.site { border-top: 1px solid var(--line); margin-top: 64px; padding: 40px 0 calc(40px + env(safe-area-inset-bottom, 0px)); color: var(--muted); font-size: .92rem; }
footer.site .cols { display: grid; gap: 24px; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
footer.site h4 { color: var(--ink); margin: 0 0 8px; font-size: .95rem; }
footer.site a { color: var(--muted); text-decoration: none; display: block; padding: 3px 0; }

/* marketing sections */
.hero { padding: 64px 0 40px; }
.hero p.lead { font-size: clamp(1.05rem, 2.2vw, 1.25rem); color: var(--ink-2); max-width: 640px; }
.kicker { font: 600 .82rem var(--ff-body); letter-spacing: .12em; text-transform: uppercase; color: var(--brand); margin-bottom: 10px; }
section.block { padding: 40px 0; }
.app-ico { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); margin-bottom: 12px; flex: none; }
.app-ico svg { width: 24px; height: 24px; }
.points { margin: 12px 0 0; padding-left: 0; list-style: none; }
.points li { padding-left: 24px; position: relative; margin: 6px 0; color: var(--ink-2); }
.points li::before { content: ""; position: absolute; left: 4px; top: .62em; width: 8px; height: 8px; border-radius: 50%; background: var(--brand); }
.price { font: 700 2rem var(--ff-display); }
.price small { font: 500 .95rem var(--ff-body); color: var(--muted); }
.plan { display: flex; flex-direction: column; }
.plan .grow { flex: 1; }
.steps { counter-reset: s; list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.steps li { counter-increment: s; position: relative; padding-left: 44px; }
.steps li::before { content: counter(s); position: absolute; left: 0; top: 0; width: 30px; height: 30px; border-radius: 50%; background: var(--brand-soft); color: var(--brand);
  font-weight: 700; display: grid; place-items: center; }

/* checkout */
.progress { display: flex; gap: 6px; list-style: none; padding: 0; margin: 0 0 24px; flex-wrap: wrap; }
.progress li { font-size: .82rem; font-weight: 600; color: var(--muted); padding: 6px 10px; border-radius: 999px; background: var(--surface-2); }
.progress li[aria-current="step"] { background: var(--brand); color: var(--brand-ink); }
.progress li.done { color: var(--ok); background: var(--ok-soft); }
.layout-2 { display: grid; gap: 24px; grid-template-columns: minmax(0, 1fr) 340px; align-items: start; }
@media (max-width: 900px) { .layout-2 { grid-template-columns: 1fr; } }
.summary { position: sticky; top: 84px; }
.line { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-top: 1px solid var(--line); }
.line:first-child { border-top: 0; }
.records { width: 100%; border-collapse: collapse; font-size: .92rem; }
.records th, .records td { text-align: left; padding: 8px 10px; border-top: 1px solid var(--line); vertical-align: top; }
.records td.mono { overflow-wrap: anywhere; }
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; }

/* console */
.console { display: grid; grid-template-columns: 240px minmax(0, 1fr); min-height: calc(100dvh - 64px); }
.side { border-right: 1px solid var(--line); padding: 20px 12px; background: var(--surface); }
.side a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; color: var(--ink-2); text-decoration: none; font-weight: 500; }
.side a[aria-current="page"] { background: var(--brand-soft); color: var(--brand); font-weight: 700; }
.side .biz { padding: 0 12px 12px; }
.side .biz b { display: block; overflow-wrap: anywhere; }
.main { padding: 28px 24px 64px; min-width: 0; }
@media (max-width: 860px) {
  .console { grid-template-columns: 1fr; }
  .side { border-right: 0; border-bottom: 1px solid var(--line); padding: 8px 8px 0; display: flex; overflow-x: auto; gap: 4px; position: sticky; top: 64px; z-index: 30;
    overscroll-behavior-x: contain; scrollbar-width: none; }
  .side .biz { display: none; }
  .side a { white-space: nowrap; padding: 10px 12px; border-radius: 10px 10px 0 0; }
  .main { padding: 20px 16px 64px; }
}

/* sign-in (employee host) and station */
.center { min-height: 100svh; display: grid; place-items: center; padding: 24px 16px calc(24px + env(safe-area-inset-bottom, 0px)); }
.center .card { width: 100%; max-width: 440px; }
.qr { display: grid; place-items: center; background: #fff; border-radius: var(--radius); padding: 12px; width: fit-content; margin: 0 auto; }
.code { font: 700 clamp(2rem, 9vw, 3.4rem)/1 ui-monospace, Menlo, monospace; letter-spacing: .08em; text-align: center; user-select: all; }
.pin { font: 600 1.6rem ui-monospace, Menlo, monospace; letter-spacing: .2em; text-align: center; }
.station { min-height: 100dvh; display: flex; flex-direction: column; padding: env(safe-area-inset-top, 0px) 0 env(safe-area-inset-bottom, 0px); }
.station header { padding: 14px 16px; border-bottom: 1px solid var(--line); display: flex; gap: 12px; align-items: center; flex-wrap: wrap; background: var(--surface); }
.station main { flex: 1; padding: 24px 16px; }
.tiles { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); }
.tile { display: flex; flex-direction: column; gap: 6px; padding: 18px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); color: inherit;
  text-decoration: none; min-height: 120px; transition: transform 140ms var(--ease-out); touch-action: manipulation; }
.tile:active { transform: scale(0.98); }
.tile b { font-size: 1.05rem; }

/* toggles on account page */
.toggle-panel[hidden] { display: none; }

/* toast */
.toast { position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); background: var(--ink); color: var(--bg);
  padding: 12px 16px; border-radius: 12px; box-shadow: var(--shadow); z-index: 90; max-width: calc(100vw - 32px); opacity: 1;
  transition: opacity 300ms ease, transform 300ms ease; }
@starting-style { .toast { opacity: 0; transform: translate(-50%, 12px); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 1ms !important; animation-duration: 1ms !important; }
  .btn:active, .tile:active, .card.link:active { transform: none; }
}
