/* The pages outside the Angular app: sign-in, sign-up, links, account and admin. They follow the
   app's wobooks theme (src/styles.css): the system font on Apple devices, Inter elsewhere, navy #14213D for structure and the main action,
   orange #FCA311 as the highlight only, grey borders, a #F5F5F5 page with white cards. Dark follows
   the app's own theme switch: theme-prepaint.js puts `dark` on <html> (or the OS setting when the
   user never picked one). Keep the token values in step with src/styles.css. */

@font-face {
  font-family: 'Inter Variable';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url('/fonts/inter-latin-wght-normal.woff2') format('woff2-variations');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* latin-ext: carries the ₹ sign */
@font-face {
  font-family: 'Inter Variable';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url('/fonts/inter-latin-ext-wght-normal.woff2') format('woff2-variations');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --navy-50: #eef1f7; --navy-200: #b9c3d8; --navy-400: #5d6f96; --navy-600: #1f2f52; --navy-700: #14213d; --navy-800: #0f1930; --navy-900: #0a1122;
  --orange-50: #fff7e8; --orange-300: #fdc35e; --orange-400: #fca311; --orange-600: #b86e00;

  --bg: #f5f5f5; --card: #ffffff; --raised: #fafafa; --head: #f1f1f1;
  --text: #1c1c1c; --muted: #616161; --faint: #858585;
  --border: rgb(20 33 61 / 0.12); --input: rgb(20 33 61 / 0.2);
  --primary: var(--navy-700); --primary-hover: var(--navy-600); --primary-text: #ffffff;
  --link: var(--navy-600); --ring: var(--orange-600); --tint: rgb(20 33 61 / 0.07);
  --ok: #17795e; --ok-bg: #e3f4ec; --danger: #b42318; --danger-bg: #fde9e7;
  --warn: #985200; --warn-bg: #fdf1e1; --info: #1f4f8a; --info-bg: #e9eff8;
  --side: var(--navy-700); --side-text: #e8ecf4; --side-muted: #9aa7c0; --side-hover: rgb(255 255 255 / 0.08); --side-border: rgb(255 255 255 / 0.1);
  --shadow: inset 0 0 0 1px rgb(11 11 11 / 0.06), 0 1px 2px 0 rgb(11 11 11 / 0.05);
  --shadow-lg: 0 0 0 1px rgb(11 11 11 / 0.06), 0 8px 24px -6px rgb(11 11 11 / 0.14), 0 2px 6px -2px rgb(11 11 11 / 0.08);
  --radius: 12px; --radius-sm: 8px;
  color-scheme: light;
}
:root.dark {
  --bg: #0b1426; --card: #111c34; --raised: #1a2846; --head: #1a2846;
  --text: #f5f7fb; --muted: #c2cadb; --faint: #9aa7c0;
  --border: rgb(255 255 255 / 0.1); --input: rgb(255 255 255 / 0.16);
  --primary: var(--orange-400); --primary-hover: var(--orange-300); --primary-text: var(--navy-700);
  --link: var(--orange-300); --ring: var(--orange-400); --tint: rgb(252 163 17 / 0.12);
  --ok: #34d399; --ok-bg: #17332a; --danger: #f97066; --danger-bg: #3a1e1b;
  --warn: #f6b26b; --warn-bg: #3a2614; --info: #8fb3e8; --info-bg: #15233d;
  --side: #070d1a;
  --shadow: inset 0 0 0 1px rgb(255 255 255 / 0.06);
  --shadow-lg: 0 0 0 1px rgb(255 255 255 / 0.08), 0 12px 32px -8px rgb(0 0 0 / 0.5);
  color-scheme: dark;
}

/* ---- base ------------------------------------------------------------------------------- */

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.47 -apple-system, BlinkMacSystemFont, 'Inter Variable', 'Segoe UI', Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--link); text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
h1 { font-size: 26px; line-height: 32px; font-weight: 650; letter-spacing: -0.015em; margin: 0 0 6px; }
h2 { font-size: 18px; line-height: 26px; font-weight: 650; letter-spacing: -0.005em; margin: 0 0 12px; }
h3 { font-size: 16px; font-weight: 650; margin: 20px 0 6px; }
p { margin: 0 0 12px; }
code { font: 13px ui-monospace, SFMono-Regular, Menlo, monospace; }
.muted { color: var(--muted); }
.sub { color: var(--muted); margin: 0 0 20px; }
.note { color: var(--muted); font-size: 14px; margin: 14px 0 0; }
.eyebrow { font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--faint); margin: 0 0 2px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
svg.i { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---- the brand mark ---------------------------------------------------------------------- */

.logo { display: inline-flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; font-weight: 700; font-size: 20px; letter-spacing: -0.02em; }
.logo-mark { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 11px; background: var(--orange-400); color: var(--navy-700); }
.logo-mark svg.i { width: 21px; height: 21px; }
.logo b { color: var(--orange-400); font-weight: 700; }
/* The Vepaar Book logo is a picture (no font needed): navy on light backgrounds, white on navy
   ones (the auth side panel, top bar, admin sidebar) and in dark. */
.logo-img { display: block; height: 32px; width: auto; }
.logo .on-dark { display: none; }
.auth-side .logo .on-light, .topbar .logo .on-light, .side-head .logo .on-light, :root.dark .logo .on-light { display: none; }
.auth-side .logo .on-dark, .topbar .logo .on-dark, .side-head .logo .on-dark, :root.dark .logo .on-dark { display: block; }
.auth-mobile-logo .logo-img { height: 28px; }
.logo small { font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--side-muted); margin-left: 2px; align-self: center; padding: 2px 7px; border: 1px solid var(--side-border); border-radius: 999px; }

/* ---- controls (the app's 40px controls) ------------------------------------------------- */

label { display: block; font-size: 14px; font-weight: 600; margin: 16px 0 6px; }
label .muted { font-weight: 400; }
input, select, textarea {
  width: 100%; height: 42px; padding: 0 12px; border: 1px solid var(--input); border-radius: var(--radius-sm);
  background: var(--card); color: var(--text); font: inherit; transition: border-color 0.15s, box-shadow 0.15s;
}
select { padding-right: 32px; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%23858585' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; }
input::placeholder { color: var(--faint); }
input:hover, select:hover { border-color: var(--navy-400); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--ring); box-shadow: 0 0 0 3px color-mix(in srgb, var(--orange-400) 30%, transparent); }
input[readonly] { background: var(--raised); }
.hint { color: var(--muted); font-size: 13px; margin: 6px 0 0; }

.pw { position: relative; }
.pw input { padding-right: 46px; }
.pw button.eye { position: absolute; right: 4px; top: 4px; height: 34px; width: 38px; padding: 0; background: transparent; color: var(--faint); border-radius: 6px; }
.pw button.eye:hover { color: var(--text); background: var(--tint); }

button, .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 42px; padding: 0 18px;
  border: 1px solid transparent; border-radius: var(--radius-sm); background: var(--primary); color: var(--primary-text);
  font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; white-space: nowrap; transition: background 0.15s, border-color 0.15s, color 0.15s;
}
button:hover, .btn:hover { background: var(--primary-hover); text-decoration: none; }
button:focus-visible, .btn:focus-visible, a:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }
button.ghost, .btn.ghost { background: var(--card); color: var(--text); border-color: var(--input); }
button.ghost:hover, .btn.ghost:hover { background: var(--raised); border-color: var(--navy-400); }
button.danger { background: var(--card); color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, transparent); }
button.danger:hover { background: var(--danger-bg); }
button.small, .btn.small { height: 34px; padding: 0 12px; font-size: 14px; }
button[disabled] { opacity: 0.6; cursor: default; }
button.busy::before { content: ''; width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
form button[type='submit'].block, .auth-card form button[type='submit'] { width: 100%; margin-top: 22px; height: 46px; font-size: 16px; }
button.linkish { height: auto; background: none; border: 0; padding: 0; color: var(--link); font-weight: 600; text-align: left; text-decoration: underline; text-decoration-color: transparent; text-underline-offset: 3px; }
button.linkish:hover { background: none; text-decoration-color: currentColor; }

/* ---- messages ----------------------------------------------------------------------------- */

.error, .status {
  display: flex; gap: 10px; align-items: flex-start; border-radius: var(--radius-sm); padding: 11px 14px; font-size: 14px; margin-top: 14px;
}
.error { background: var(--danger-bg); color: var(--danger); }
.status { background: var(--warn-bg); color: var(--warn); }
.status.ok { background: var(--ok-bg); color: var(--ok); }
.status.bad { background: var(--danger-bg); color: var(--danger); }
.status.info { background: var(--info-bg); color: var(--info); }
.pill { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 2px 10px; font-size: 13px; font-weight: 600; background: var(--warn-bg); color: var(--warn); white-space: nowrap; }
.pill::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.ok { background: var(--ok-bg); color: var(--ok); }
.pill.bad { background: var(--danger-bg); color: var(--danger); }
.pill.plain { background: var(--tint); color: var(--muted); }
.pill.plain::before { display: none; }

/* ---- cards, tables ---------------------------------------------------------------------- */

.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px 24px; margin-bottom: 16px; }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.card-head h2 { margin: 0; }
.card-head .sub { margin: 2px 0 0; font-size: 14px; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.scroll { overflow-x: auto; margin: 0 -24px; padding: 0 24px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; color: var(--muted); font-weight: 600; font-size: 12px; letter-spacing: 0.04em; text-transform: uppercase; background: var(--head); padding: 9px 12px; white-space: nowrap; }
th:first-child { border-radius: 8px 0 0 8px; } th:last-child { border-radius: 0 8px 8px 0; }
td { text-align: left; padding: 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: color-mix(in srgb, var(--tint) 50%, transparent); }
td.actions { white-space: nowrap; text-align: right; }
td.actions button + button { margin-left: 6px; }
td.empty { text-align: center; color: var(--muted); padding: 28px 12px; }
td .muted { font-size: 13px; }
tr.muted td { color: var(--muted); }
.link-box { display: flex; gap: 8px; margin-top: 12px; }
.link-box input { font: 13px ui-monospace, SFMono-Regular, Menlo, monospace; }

/* ---- sign-in, sign-up, links: a navy brand panel beside the form -------------------------- */

.auth { display: grid; grid-template-columns: minmax(380px, 5fr) 7fr; min-height: 100vh; }
.auth-side {
  position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; gap: 40px;
  padding: 40px 48px; background: var(--side); color: var(--side-text);
}
.auth-side::before {
  content: ''; position: absolute; width: 520px; height: 520px; right: -220px; bottom: -200px; border-radius: 50%;
  background: radial-gradient(closest-side, rgb(252 163 17 / 0.22), rgb(252 163 17 / 0) 70%); pointer-events: none;
}
.auth-side::after {
  content: ''; position: absolute; inset: 0; pointer-events: none; opacity: 0.5;
  background-image: radial-gradient(rgb(255 255 255 / 0.07) 1px, transparent 1px); background-size: 22px 22px;
  mask-image: linear-gradient(160deg, #000 0%, transparent 55%);
}
.auth-side > * { position: relative; z-index: 1; }
.auth-side .logo { color: #fff; }
.pitch h2 { font-size: 32px; line-height: 40px; font-weight: 700; letter-spacing: -0.025em; color: #fff; margin: 0 0 14px; max-width: 420px; }
.pitch h2 em { font-style: normal; color: var(--orange-400); }
.pitch > p { color: var(--side-muted); font-size: 16px; max-width: 400px; margin: 0 0 28px; }
.ticks { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.ticks li { display: flex; gap: 12px; align-items: flex-start; }
.ticks .tile { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; background: rgb(255 255 255 / 0.08); color: var(--orange-400); flex: none; }
.ticks strong { display: block; color: #fff; font-weight: 600; }
.ticks span.d { color: var(--side-muted); font-size: 14px; }
.side-foot { display: flex; gap: 10px; align-items: center; color: var(--side-muted); font-size: 13px; }
.side-foot.meaning { display: block; margin: 10px 0 0; padding-top: 10px; border-top: 1px solid var(--side-border); }
.side-foot.meaning b { color: #fff; font-weight: 600; }
.side-foot svg.i { color: var(--orange-400); width: 16px; height: 16px; }

.auth-main { display: flex; flex-direction: column; padding: 28px 32px; }
.auth-top { display: flex; justify-content: flex-end; align-items: center; gap: 10px; font-size: 14px; color: var(--muted); min-height: 34px; }
.auth-center { flex: 1; display: grid; place-items: center; padding: 32px 0; }
.auth-card { width: 100%; max-width: 420px; }
.auth-card.wide { max-width: 520px; }
.auth-card h1 { font-size: 28px; line-height: 36px; }
.auth-card .sub { font-size: 16px; margin-bottom: 26px; }
.auth-card .eyebrow { color: var(--orange-600); }
:root.dark .auth-card .eyebrow { color: var(--orange-400); }
.auth-card .split { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.auth-card .divider { height: 1px; background: var(--border); margin: 26px 0 0; }
.auth-legal { text-align: center; font-size: 13px; color: var(--faint); margin-top: 8px; }
.trust { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 18px; color: var(--muted); font-size: 13px; }
.trust span { display: inline-flex; align-items: center; gap: 6px; }
.trust svg.i { width: 15px; height: 15px; color: var(--ok); }
.auth-mobile-logo { display: none; }

.steps { list-style: none; counter-reset: s; padding: 0; margin: 4px 0 0; display: grid; gap: 10px; }
.steps li { counter-increment: s; display: flex; gap: 12px; }
.steps li::before { content: counter(s); display: grid; place-items: center; flex: none; width: 24px; height: 24px; border-radius: 50%; background: var(--tint); color: var(--link); font-size: 13px; font-weight: 700; }
.key { font: 600 18px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: 0.08em; word-break: break-all; background: var(--raised); border: 1px dashed var(--input); border-radius: var(--radius-sm); padding: 12px 14px; margin: 12px 0 8px; text-align: center; }
.section-label { display: flex; align-items: center; gap: 10px; font-size: 16px; font-weight: 650; margin: 26px 0 10px; }
.section-label .n { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; background: var(--primary); color: var(--primary-text); font-size: 13px; }

@media (max-width: 900px) {
  .auth { grid-template-columns: 1fr; }
  .auth-side { display: none; }
  .auth-main { padding: 20px 16px; }
  .auth-top { justify-content: space-between; }
  .auth-mobile-logo { display: inline-flex; color: var(--text); }
  .auth-mobile-logo .logo-mark { width: 32px; height: 32px; border-radius: 9px; }
  .auth-center { place-items: start center; padding-top: 28px; }
}
@media (max-width: 480px) { .auth-card .split { grid-template-columns: 1fr; } }

/* ---- app frame: navy sidebar + content (admin), or a top bar (account) -------------------- */

.frame { display: grid; grid-template-columns: 264px 1fr; min-height: 100vh; }
.side { background: var(--side); color: var(--side-text); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; border-right: 1px solid var(--side-border); }
.side-head { padding: 18px 16px 16px; border-bottom: 1px solid var(--side-border); }
.side-head .logo { color: #fff; }
.side nav { flex: 1; overflow-y: auto; padding: 12px 8px; display: flex; flex-direction: column; gap: 2px; }
.side nav .label { font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--side-muted); padding: 8px 10px 6px; }
.nav-item {
  position: relative; display: flex; align-items: center; gap: 12px; width: 100%; height: 44px; padding: 0 10px; border: 0; border-radius: 8px;
  background: transparent; color: var(--side-text); font-weight: 500; font-size: 15px; justify-content: flex-start;
}
.nav-item svg.i { width: 20px; height: 20px; color: var(--side-muted); }
.nav-item:hover { background: var(--side-hover); color: #fff; }
.nav-item[aria-current='page'] { background: rgb(255 255 255 / 0.1); color: #fff; font-weight: 600; }
.nav-item[aria-current='page'] svg.i { color: var(--orange-400); }
.nav-item[aria-current='page']::before { content: ''; position: absolute; left: -8px; top: 10px; bottom: 10px; width: 3px; border-radius: 0 3px 3px 0; background: var(--orange-400); }
.side-head .mobile-out { display: none; height: 34px; padding: 0 12px; background: transparent; color: var(--side-text); border-color: var(--side-border); font-size: 14px; }
.side-foot-user { padding: 12px; border-top: 1px solid var(--side-border); display: flex; align-items: center; gap: 10px; }
.avatar { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: rgb(255 255 255 / 0.1); color: #fff; font-weight: 700; font-size: 14px; flex: none; }
.side-foot-user .who { flex: 1; min-width: 0; }
.side-foot-user .who strong { display: block; color: #fff; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-foot-user .who span { color: var(--side-muted); font-size: 12px; text-transform: capitalize; }
.side-foot-user button { height: 34px; width: 34px; padding: 0; background: transparent; color: var(--side-muted); }
.side-foot-user button:hover { background: var(--side-hover); color: #fff; }

.content { min-width: 0; padding: 28px 32px 48px; }
.content-inner { max-width: 1120px; margin: 0 auto; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head .title { display: flex; align-items: center; gap: 16px; min-width: 0; }
.head-tile { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 16px; background: var(--tint); color: var(--link); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--primary) 22%, transparent); flex: none; }
.head-tile svg.i { width: 28px; height: 28px; }
.page-head h1 { margin: 0; }
.page-head p.subtitle { color: var(--muted); margin: 2px 0 0; max-width: 64ch; }
.back { margin-bottom: 14px; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat {
  display: flex; align-items: center; gap: 14px; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 16px 18px; text-align: left; height: auto; color: var(--text); font-weight: 400; border: 1px solid transparent; justify-content: flex-start;
}
button.stat:hover { background: var(--card); border-color: var(--input); }
button.stat[aria-pressed='true'] { border-color: var(--primary); }
.stat .tile { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; background: var(--tint); color: var(--link); flex: none; }
.stat .tile.ok { background: var(--ok-bg); color: var(--ok); }
.stat .tile.warn { background: var(--warn-bg); color: var(--warn); }
.stat .tile.bad { background: var(--danger-bg); color: var(--danger); }
.stat .lbl { display: block; color: var(--muted); font-size: 13px; }
.stat .num { display: block; font-size: 24px; line-height: 30px; font-weight: 700; letter-spacing: -0.02em; }

.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.fact { background: var(--raised); box-shadow: inset 0 0 0 1px var(--border); border-radius: var(--radius-sm); padding: 12px 14px; overflow-wrap: anywhere; }
.fact .k { color: var(--muted); font-size: 12px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; margin-bottom: 2px; }
.fact .v { font-weight: 500; }

.toolbar { display: grid; grid-template-columns: 1fr 220px; gap: 10px; margin-bottom: 16px; }
.search { position: relative; }
.search svg.i { position: absolute; left: 12px; top: 12px; color: var(--faint); }
.search input { padding-left: 40px; }

.form-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0 14px; align-items: end; }
.form-grid.five { grid-template-columns: 2fr repeat(4, 1fr); }
.form-grid.three { grid-template-columns: 1fr 1fr 180px auto; }
.form-grid .wide { grid-column: 1 / -1; }
.form-grid > button { margin-top: 16px; }
.form-actions { display: flex; gap: 10px; margin-top: 18px; flex-wrap: wrap; }
pre.change { margin: 0; font: 12px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; white-space: pre-wrap; color: var(--muted); max-width: 340px; background: var(--raised); border-radius: 6px; padding: 6px 8px; }

.topbar { background: var(--side); color: var(--side-text); }
.topbar .inner { max-width: 880px; margin: 0 auto; padding: 14px 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.topbar .logo { color: #fff; }
.topbar .actions { display: flex; gap: 8px; }
.topbar .btn.ghost, .topbar button.ghost { background: transparent; color: var(--side-text); border-color: var(--side-border); }
.topbar .btn.ghost:hover, .topbar button.ghost:hover { background: var(--side-hover); color: #fff; }
main.page { max-width: 880px; margin: 0 auto; padding: 28px 16px 48px; }
.plans { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 16px; }
.plan { border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; display: flex; flex-direction: column; gap: 4px; }
.plan.best { border-color: var(--orange-400); box-shadow: 0 0 0 1px var(--orange-400); }
.plan .k { color: var(--muted); font-size: 13px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; }
.plan strong { font-size: 28px; line-height: 34px; letter-spacing: -0.02em; }
.plan .btn { margin-top: 10px; }

.loading { display: flex; align-items: center; gap: 10px; color: var(--muted); padding: 20px 0; }
.loading::before { content: ''; width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--input); border-top-color: var(--primary); animation: spin 0.7s linear infinite; }
.boot { min-height: 100vh; display: grid; place-items: center; }

@media (max-width: 900px) {
  .frame { grid-template-columns: 1fr; }
  .side { position: static; height: auto; flex-direction: column; }
  .side-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; }
  .side nav { flex-direction: row; overflow-x: auto; padding: 8px; gap: 4px; }
  .side nav .label { display: none; }
  .nav-item { width: auto; height: 38px; flex: none; }
  .nav-item[aria-current='page']::before { display: none; }
  .side-foot-user { display: none; }
  .side-head .mobile-out { display: inline-flex; }
  .content { padding: 20px 16px 40px; }
  .toolbar, .form-grid, .form-grid.five, .form-grid.three, .plans { grid-template-columns: 1fr; }
  .card { padding: 18px 16px; }
  .scroll { margin: 0 -16px; padding: 0 16px; }
  .head-tile { width: 46px; height: 46px; border-radius: 13px; }
  /* Touch screens: fields and buttons a finger can hit (44px), as in the app (styles.css). */
  input, select, button, .btn { height: 44px; }
  .auth-top { flex-wrap: wrap; row-gap: 4px; }
  .auth-top a { white-space: nowrap; }
}

/* A short table read as a list on a phone (`<table class="stack">`, e.g. the account's users):
   each row becomes a block, the first cell bold, the last (the buttons) on a line of its own. */
@media (max-width: 560px) {
  table.stack thead { display: none; }
  table.stack, table.stack tbody, table.stack tr, table.stack td { display: block; width: 100%; }
  table.stack tr { padding: 12px 0; border-bottom: 1px solid var(--border); }
  table.stack tbody tr:last-child { border-bottom: 0; }
  table.stack td { padding: 0; border: 0; overflow-wrap: anywhere; }
  table.stack td:first-child { font-weight: 600; }
  table.stack td:not(:first-child) { color: var(--muted); font-size: 14px; }
  table.stack td.actions { text-align: left; margin-top: 8px; white-space: normal; }
  table.stack td:empty { display: none; }
  table.stack tbody tr:hover td { background: transparent; }
}
