:root {
  --page: #eef2f0;
  --paper: #ffffff;
  --ink: #1b2a33;
  --ink-2: #4a5a63;
  --ink-3: #7b8a92;
  --line: #d8e0dd;
  --rule: #bbd3e6;
  --brand: #1f4fa3;
  --brand-text: var(--brand);
  --ok: #2b8a1f;
  --ok-soft: #e4f3df;
  --hover: #f3f6fa;
  --field-line: #c3ccd6;
  --th: #f5f7fa;
  --brand-ink: #ffffff;
  --brand-soft: #e4ebf7;
  --margin: #d43a3a;
  --margin-soft: #fbe7e5;
  --khaki: #b8924a;
  --khaki-soft: #f4ecdc;
  --blue: #2c6aa0;
  --blue-soft: #e3eef7;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 1px 0 rgba(27, 42, 51, 0.06), 0 2px 8px rgba(27, 42, 51, 0.05);
  --head: "Bricolage Grotesque", system-ui, sans-serif;
  --body: "Atkinson Hyperlegible", system-ui, sans-serif;
  --nav-h: 64px;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--page);
  color: var(--ink);
  font: 16px/1.5 var(--body);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
h1, h2, h3, h4 { font-family: var(--head); line-height: 1.15; margin: 0; letter-spacing: -0.01em; }
h1 { font-size: 1.75rem; font-weight: 700; }
h2 { font-size: 1.3rem; font-weight: 650; }
h3 { font-size: 1.08rem; font-weight: 650; }
p { margin: 0 0 0.75em; }
a { color: var(--brand-text); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand) 55%, white); outline-offset: 2px; border-radius: 4px; }
img { max-width: 100%; display: block; }
.muted { color: var(--ink-2); }
.faint { color: var(--ink-3); font-size: 0.9rem; }
.small { font-size: 0.875rem; }
.num { font-family: var(--head); font-variant-numeric: tabular-nums; }
.hidden { display: none !important; }
.row { display: flex; align-items: center; gap: 0.6rem; }
.row.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.stack > * + * { margin-top: 0.75rem; }
.right { margin-left: auto; }
.center { text-align: center; }

/* ---------- Shell ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: var(--brand); color: var(--brand-ink);
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.65rem 1rem; min-height: 56px;
}
.crest {
  width: 36px; height: 36px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.16); border: 2px solid rgba(255, 255, 255, 0.55);
  display: grid; place-items: center; font: 700 1rem var(--head); flex: none; overflow: hidden;
}
.crest img { width: 100%; height: 100%; object-fit: cover; }
.topbar .school { font: 650 1.02rem/1.15 var(--head); }
.topbar .term { font-size: 0.8rem; opacity: 0.8; }
.iconbtn {
  background: none; border: 0; color: inherit; width: 42px; height: 42px; border-radius: 50%;
  display: grid; place-items: center; cursor: pointer; position: relative; flex: none;
}
.iconbtn:hover { background: rgba(255, 255, 255, 0.12); }
.iconbtn svg { width: 22px; height: 22px; }
.dot {
  position: absolute; top: 4px; right: 4px; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 9px; background: var(--margin); color: #fff; font: 700 11px/18px var(--body); text-align: center;
  box-shadow: 0 0 0 2px var(--brand);
}

.layout { display: block; }
main { padding: 1rem 1rem calc(var(--nav-h) + 1.5rem); max-width: 760px; margin: 0 auto; }
main.wide { max-width: 1120px; }

.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 20; height: var(--nav-h);
  background: var(--paper); border-top: 1px solid var(--line);
  display: flex; padding-bottom: env(safe-area-inset-bottom);
}
.tabbar a {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  color: var(--ink-3); text-decoration: none; font-size: 0.74rem; position: relative;
}
.tabbar a svg { width: 24px; height: 24px; }
.tabbar a.on { color: var(--brand-text); font-weight: 700; }
.tabbar a .dot { top: 6px; right: calc(50% - 22px); box-shadow: 0 0 0 2px var(--paper); }
.sidenav { display: none; }

@media (min-width: 900px) {
  .layout { display: grid; grid-template-columns: 240px 1fr; min-height: calc(100vh - 56px); }
  .tabbar { display: none; }
  main { padding: 1.75rem 2rem 3rem; }
  .sidenav {
    display: block; background: var(--paper); border-right: 1px solid var(--line);
    padding: 1rem 0.75rem; position: sticky; top: 56px; height: calc(100vh - 56px); overflow-y: auto;
  }
  .sidenav a {
    display: flex; align-items: center; gap: 0.7rem; padding: 0.6rem 0.75rem; border-radius: var(--radius-sm);
    color: var(--ink-2); text-decoration: none; position: relative; font-weight: 500;
  }
  .sidenav a svg { width: 20px; height: 20px; }
  .sidenav a:hover { background: var(--page); color: var(--ink); }
  .sidenav a.on { background: var(--brand-soft); color: var(--brand-text); font-weight: 700; }
  .sidenav a .dot { position: static; margin-left: auto; box-shadow: none; }
  .sidenav .group { margin: 1.1rem 0.75rem 0.35rem; font-size: 0.8rem; color: var(--ink-3); }
}

/* ---------- Page header ---------- */
.pagehead { display: flex; align-items: flex-end; gap: 0.75rem; margin: 0.25rem 0 1.1rem; flex-wrap: wrap; }
.pagehead h1 { flex: 1; min-width: 12rem; }
.back { display: inline-flex; align-items: center; gap: 0.3rem; color: var(--ink-2); text-decoration: none; font-size: 0.92rem; margin-bottom: 0.5rem; }

/* ---------- Buttons & forms ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.45rem;
  border: 1px solid transparent; border-radius: var(--radius-sm); padding: 0.62rem 1rem; min-height: 44px;
  background: var(--brand); color: var(--brand-ink); font-weight: 700; cursor: pointer; text-decoration: none;
  white-space: nowrap;
}
.btn:hover { filter: brightness(1.06); }
.btn:disabled { opacity: 0.55; cursor: default; }
.btn.ghost { background: var(--paper); color: var(--ink); border-color: var(--line); }
.btn.quiet { background: transparent; color: var(--brand-text); padding-inline: 0.5rem; }
.btn.danger { background: var(--paper); color: var(--margin); border-color: #efc4c0; }
.btn.small { min-height: 34px; padding: 0.35rem 0.7rem; font-size: 0.88rem; }
.btn.block { width: 100%; }
.btn svg { width: 18px; height: 18px; }

label.field { display: block; margin-bottom: 0.9rem; }
label.field > span { display: block; font-weight: 700; font-size: 0.92rem; margin-bottom: 0.3rem; }
label.field small { display: block; color: var(--ink-3); margin-top: 0.3rem; font-size: 0.84rem; }
input[type=text], input[type=url], input[type=tel], input[type=password], input[type=email], input[type=number], input[type=date],
input[type=datetime-local], input[type=search], select, textarea {
  width: 100%; background: var(--paper); border: 1px solid var(--field-line); border-radius: var(--radius-sm);
  padding: 0.62rem 0.75rem; min-height: 44px; font-size: 1rem;
}
textarea { min-height: 110px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand-text); box-shadow: 0 0 0 3px var(--brand-soft); }
.check { display: flex; gap: 0.6rem; align-items: flex-start; margin: 0.6rem 0; cursor: pointer; }
.check input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--brand-text); flex: none; }
.grid2 { display: grid; gap: 0 0.9rem; grid-template-columns: 1fr; }
@media (min-width: 560px) { .grid2 { grid-template-columns: 1fr 1fr; } }
.err { color: var(--margin); font-weight: 700; margin: 0.25rem 0 0.75rem; }

/* ---------- Surfaces ---------- */
.card { background: var(--paper); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1rem 1.1rem; }
.card + .card { margin-top: 0.75rem; }
.section { margin-top: 1.6rem; }
.section > h2 { margin-bottom: 0.7rem; }
.list { background: var(--paper); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.list > .item {
  display: flex; align-items: center; gap: 0.75rem; padding: 0.8rem 1rem; border-top: 1px solid var(--line);
  text-decoration: none; color: inherit;
}
.list > .item:first-child { border-top: 0; }
a.item:hover, button.item:hover { background: var(--hover); }
button.item { width: 100%; background: none; border: 0; border-top: 1px solid var(--line); text-align: left; cursor: pointer; }
.list > button.item:first-child { border-top: 0; }
.item .title { font-weight: 700; }
.item .sub { color: var(--ink-2); font-size: 0.9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar {
  width: 40px; height: 40px; border-radius: 50%; background: var(--brand-soft); color: var(--brand-text);
  display: grid; place-items: center; font: 700 0.95rem var(--head); flex: none;
}
.chev { color: var(--ink-3); flex: none; }

.tag {
  display: inline-flex; align-items: center; gap: 0.3rem; padding: 0.12rem 0.55rem; border-radius: 999px;
  font-size: 0.8rem; font-weight: 700; background: var(--page); color: var(--ink-2); white-space: nowrap;
}
.tag.green { background: var(--ok-soft); color: var(--ok); }
.tag.red { background: var(--margin-soft); color: var(--margin); }
.tag.khaki { background: var(--khaki-soft); color: #7d6127; }
.tag.blue { background: var(--blue-soft); color: var(--blue); }

.empty { text-align: center; padding: 2.5rem 1rem; color: var(--ink-2); }
.empty h3 { color: var(--ink); margin-bottom: 0.35rem; }

.banner { border-radius: var(--radius); padding: 0.8rem 1rem; background: var(--khaki-soft); color: #5e4818; margin-bottom: 1rem; }
.banner.info { background: var(--blue-soft); color: #1f4c74; }

/* ---------- The exercise-book post ---------- */
.post {
  position: relative; background: var(--paper); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 1rem 1.1rem 1rem 2rem; margin-bottom: 0.9rem; overflow: hidden;
}
.post::before { content: ""; position: absolute; left: 1.15rem; top: 0; bottom: 0; width: 2px; background: var(--margin); opacity: 0.75; }
.post.unread::after {
  content: ""; position: absolute; left: 0.42rem; top: 1.35rem; width: 9px; height: 9px; border-radius: 50%; background: var(--brand);
}
.post.urgent { box-shadow: inset 0 0 0 2px var(--margin), var(--shadow); }
.post .meta { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; font-size: 0.86rem; color: var(--ink-2); margin-bottom: 0.4rem; }
.post .meta b { color: var(--ink); }
.post h3 { font-size: 1.15rem; margin-bottom: 0.35rem; }
.post .body {
  white-space: pre-wrap; overflow-wrap: anywhere;
  background-image: repeating-linear-gradient(to bottom, transparent 0, transparent calc(1.5em - 1px), var(--rule) calc(1.5em - 1px), var(--rule) 1.5em);
  background-position: 0 -0.15em;
}
.post .body.clamp { display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; }
.post .photo { margin: 0.75rem 0 0.25rem; border-radius: var(--radius-sm); overflow: hidden; background: var(--page); }
.post .photo img { width: 100%; max-height: 420px; object-fit: cover; }
.post .foot { display: flex; align-items: center; gap: 0.75rem; margin-top: 0.6rem; font-size: 0.88rem; color: var(--ink-3); flex-wrap: wrap; }
.post .foot a, .post .foot button { color: var(--ink-2); background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.attach { display: inline-flex; align-items: center; gap: 0.4rem; margin-top: 0.6rem; padding: 0.45rem 0.7rem; border: 1px solid var(--line); border-radius: var(--radius-sm); text-decoration: none; color: var(--ink); font-size: 0.92rem; }

/* ---------- Children strip ---------- */
.kids { display: grid; gap: 0.75rem; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); margin-bottom: 1.25rem; }
.kid { display: block; background: var(--paper); border-radius: var(--radius); box-shadow: var(--shadow); padding: 0.9rem 1rem; text-decoration: none; color: inherit; border-top: 4px solid var(--brand); }
.kid .name { font: 700 1.1rem var(--head); }
.kid .facts { display: flex; gap: 0.4rem; flex-wrap: wrap; margin-top: 0.55rem; }

/* ---------- Stats ---------- */
.stats { display: grid; gap: 0.75rem; grid-template-columns: repeat(2, 1fr); }
@media (min-width: 760px) { .stats { grid-template-columns: repeat(4, 1fr); } }
.stat { background: var(--paper); border-radius: var(--radius); box-shadow: var(--shadow); padding: 0.85rem 1rem; }
.stat .v { font: 700 1.6rem/1.1 var(--head); font-variant-numeric: tabular-nums; }
.stat .l { color: var(--ink-2); font-size: 0.88rem; margin-top: 0.2rem; }
.bar { height: 8px; border-radius: 4px; background: var(--page); overflow: hidden; margin-top: 0.55rem; }
.bar > i { display: block; height: 100%; background: var(--brand); }

/* ---------- Register (attendance) ---------- */
.register { background: var(--paper); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.reg-row { display: flex; align-items: center; gap: 0.6rem; padding: 0.55rem 0.8rem; border-top: 1px solid var(--line); }
.reg-row:first-child { border-top: 0; }
.reg-row .n { flex: 1; min-width: 0; font-weight: 700; }
.reg-row .n small { display: block; font-weight: 400; color: var(--ink-3); }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; flex: none; }
.seg button {
  border: 0; background: var(--paper); width: 40px; height: 40px; font: 700 0.95rem var(--head); color: var(--ink-3); cursor: pointer;
  border-left: 1px solid var(--line);
}
.seg button:first-child { border-left: 0; }
.seg button.on[data-v=present] { background: var(--ok); color: #fff; }
.seg button.on[data-v=absent] { background: var(--margin); color: #fff; }
.seg button.on[data-v=late] { background: var(--khaki); color: #fff; }
.seg button.on[data-v=excused] { background: var(--blue); color: #fff; }
.days { display: flex; flex-wrap: wrap; gap: 4px; }
.days span { width: 26px; height: 26px; border-radius: 4px; display: grid; place-items: center; font: 700 0.72rem var(--head); color: #fff; }
.st-present { background: var(--ok); }
.st-absent { background: var(--margin); }
.st-late { background: var(--khaki); }
.st-excused { background: var(--blue); }
.legend { display: flex; gap: 0.9rem; flex-wrap: wrap; font-size: 0.85rem; color: var(--ink-2); margin-top: 0.6rem; }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 0.3rem; vertical-align: -1px; }

/* ---------- Tables ---------- */
.tablewrap { background: var(--paper); border-radius: var(--radius); box-shadow: var(--shadow); overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.94rem; }
th, td { text-align: left; padding: 0.65rem 0.85rem; border-top: 1px solid var(--line); vertical-align: middle; }
th { border-top: 0; font-weight: 700; color: var(--ink-2); font-size: 0.85rem; background: var(--th); white-space: nowrap; }
td.money, th.money { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
tr.click { cursor: pointer; }
tr.click:hover td { background: var(--hover); }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 0.25rem; border-bottom: 1px solid var(--line); margin-bottom: 1rem; overflow-x: auto; }
.tabs button {
  background: none; border: 0; padding: 0.65rem 0.85rem; cursor: pointer; color: var(--ink-2); font-weight: 700;
  border-bottom: 3px solid transparent; margin-bottom: -1px; white-space: nowrap;
}
.tabs button.on { color: var(--brand-text); border-color: var(--brand-text); }

/* ---------- Messages ---------- */
.chat { display: flex; flex-direction: column; gap: 0.4rem; padding-bottom: 5.5rem; }
.bubble { max-width: 80%; padding: 0.55rem 0.8rem; border-radius: 14px; background: var(--paper); box-shadow: var(--shadow); white-space: pre-wrap; overflow-wrap: anywhere; }
.bubble.me { align-self: flex-end; background: var(--brand); color: var(--brand-ink); border-bottom-right-radius: 4px; }
.bubble.them { align-self: flex-start; border-bottom-left-radius: 4px; }
.bubble time { display: block; font-size: 0.72rem; opacity: 0.7; margin-top: 0.2rem; }
.daymark { align-self: center; font-size: 0.8rem; color: var(--ink-3); margin: 0.6rem 0 0.2rem; }
.composer {
  position: fixed; left: 0; right: 0; bottom: var(--nav-h); background: var(--paper); border-top: 1px solid var(--line);
  padding: 0.55rem 0.75rem; display: flex; gap: 0.5rem; z-index: 15;
}
.composer textarea { min-height: 44px; height: 44px; max-height: 140px; resize: none; }
@media (min-width: 900px) { .composer { left: 240px; bottom: 0; } }

/* ---------- Calendar ---------- */
.month { font: 650 1rem var(--head); color: var(--ink-2); margin: 1.2rem 0 0.5rem; }
.event { display: flex; gap: 0.85rem; align-items: stretch; background: var(--paper); border-radius: var(--radius); box-shadow: var(--shadow); padding: 0.75rem 0.9rem; text-decoration: none; color: inherit; margin-bottom: 0.6rem; }
.datebox { width: 52px; flex: none; text-align: center; border-right: 1px solid var(--line); padding-right: 0.75rem; }
.datebox .d { font: 700 1.5rem/1 var(--head); }
.datebox .w { font-size: 0.78rem; color: var(--ink-3); }
.event.past { opacity: 0.6; }

/* ---------- Sheet / modal ---------- */
.scrim { position: fixed; inset: 0; background: rgba(20, 30, 36, 0.45); z-index: 50; display: flex; align-items: flex-end; justify-content: center; }
.sheet {
  background: var(--paper); width: 100%; max-width: 620px; max-height: 92vh; overflow-y: auto;
  border-radius: 16px 16px 0 0; padding: 1.1rem 1.1rem calc(1.25rem + env(safe-area-inset-bottom));
  animation: up 0.18s ease-out;
}
@media (min-width: 700px) { .scrim { align-items: center; } .sheet { border-radius: 14px; } }
@keyframes up { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .sheet { animation: none; } }
.sheet .sheethead { display: flex; align-items: center; margin-bottom: 0.9rem; }
.sheet .sheethead h2 { flex: 1; }
.sheet .actions { display: flex; gap: 0.6rem; justify-content: flex-end; margin-top: 1rem; flex-wrap: wrap; }

.toast {
  position: fixed; left: 50%; bottom: calc(var(--nav-h) + 1rem); transform: translateX(-50%); z-index: 60;
  background: #22303a; color: #fff; padding: 0.7rem 1.1rem; border-radius: 999px; font-weight: 700; max-width: calc(100% - 2rem);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}
.toast.bad { background: var(--margin); }
@media (min-width: 900px) { .toast { bottom: 1.5rem; } }

/* ---------- Auth ---------- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 1.5rem 1rem;
  background:
    linear-gradient(90deg, transparent 0, transparent 46px, var(--margin) 46px, var(--margin) 48px, transparent 48px),
    repeating-linear-gradient(to bottom, var(--page) 0, var(--page) 31px, var(--rule) 31px, var(--rule) 32px);
}
.auth .box { width: 100%; max-width: 410px; background: var(--paper); border-radius: 14px; box-shadow: 0 10px 40px rgba(27, 42, 51, 0.12); padding: 1.6rem 1.4rem; }
.wordmark { font: 800 2rem/1 var(--head); letter-spacing: -0.03em; color: var(--brand-text); margin-bottom: 0.35rem; }
.wordmark span { color: var(--ink); }
.auth .lede { color: var(--ink-2); margin-bottom: 1.3rem; }
.auth .links { margin-top: 1rem; display: grid; gap: 0.35rem; font-size: 0.95rem; }

.spinner { width: 28px; height: 28px; border: 3px solid var(--line); border-top-color: var(--brand-text); border-radius: 50%; animation: spin 0.8s linear infinite; margin: 3rem auto; }
@keyframes spin { to { transform: rotate(360deg); } }
.codebox { font: 700 1.6rem var(--head); letter-spacing: 0.15em; background: var(--brand-soft); color: var(--brand-text); padding: 0.4rem 0.8rem; border-radius: var(--radius-sm); display: inline-block; }
.copyline { background: var(--page); border-radius: var(--radius-sm); padding: 0.7rem 0.8rem; font-size: 0.9rem; white-space: pre-wrap; overflow-wrap: anywhere; }
@media print { .topbar, .tabbar, .sidenav, .btn { display: none !important; } main { padding: 0; } }

/* Icon sizing inside lists and links */
.item > svg, .back svg, .chev svg, .avatar svg, .attach svg { width: 20px; height: 20px; flex: none; }
.item > svg { color: var(--ink-3); }
.back svg { width: 18px; height: 18px; }
.item.wrap { flex-wrap: wrap; }
/* Tables scroll sideways on phones instead of squashing */
.tablewrap table { min-width: 620px; }
td a[href^="tel:"], .nowrap { white-space: nowrap; }

@supports (color: color-mix(in srgb, red 10%, white)) {
  :root { --brand-soft: color-mix(in srgb, var(--brand) 12%, var(--paper)); }
}
.unread-bg { background: color-mix(in srgb, var(--brand) 7%, var(--paper)); }
.auth .logo { width: 210px; max-width: 70%; display: block; margin: 0 auto 0.5rem; }
.auth .lede { text-align: center; }

/* ---------- Dark mode (follows the phone setting) ---------- */
@media (prefers-color-scheme: dark) {
  :root {
    --page: #0e1216; --paper: #191f25; --ink: #e9eef2; --ink-2: #b2bec6; --ink-3: #85929b;
    --line: #2b343c; --rule: #263646; --hover: #212a31; --field-line: #3a4650; --th: #1f262d;
    --margin-soft: rgba(212, 58, 58, 0.16); --khaki-soft: rgba(184, 146, 74, 0.18); --blue-soft: rgba(44, 106, 160, 0.22);
    --ok: #5cc14d; --ok-soft: rgba(43, 138, 31, 0.2); --brand-text: #8fb0ee;
    --shadow: 0 1px 0 rgba(0, 0, 0, 0.3);
  }
  @supports (color: color-mix(in srgb, red 10%, white)) {
    :root { --brand-text: color-mix(in srgb, var(--brand) 45%, white); --brand-soft: color-mix(in srgb, var(--brand) 22%, var(--paper)); }
  }
  .tag.khaki { color: #e3c27f; } .banner { color: #ecd9ad; } .banner.info { color: #b9d4ee; } .tag.red { color: #ff8a80; }
  .btn.danger { border-color: #5a2a2a; color: #ff8a80; }
  input[type=date], input[type=datetime-local], input[type=color] { color-scheme: dark; }
  .auth .box { box-shadow: none; border: 1px solid var(--line); }
}

/* ---------- Account menu (ParentSquare style) ---------- */
.menu-page { min-height: 100vh; min-height: 100dvh; background: var(--paper); display: flex; flex-direction: column; }
.menu-head { position: relative; text-align: center; padding: 1.4rem 1rem 1.1rem; background: var(--page); border-bottom: 1px solid var(--line); }
.menu-close { position: absolute; left: 1rem; top: 1rem; width: 48px; height: 48px; border-radius: 50%; border: 1px solid var(--line); background: var(--paper); color: var(--ink); display: grid; place-items: center; cursor: pointer; }
.menu-close svg { width: 24px; height: 24px; }
.menu-photo { position: relative; width: 104px; height: 104px; border-radius: 50%; margin: 0 auto 0.65rem; border: 3px solid var(--brand); background: var(--brand-soft); color: var(--brand-text); display: grid; place-items: center; font: 700 2.1rem var(--head); overflow: hidden; }
.menu-photo img { width: 100%; height: 100%; object-fit: cover; }
.menu-name { font: 700 1.45rem/1.2 var(--head); }
.menu-role { color: var(--ink-2); margin-top: 0.2rem; }
.menu-switch { margin-top: 0.7rem; background: none; border: 0; color: var(--brand-text); font-weight: 700; font-size: 1.02rem; display: inline-flex; align-items: center; gap: 0.45rem; cursor: pointer; }
.menu-switch svg { width: 18px; height: 18px; transform: rotate(90deg); }
.menu-body { flex: 1; display: grid; grid-template-columns: 96px 1fr; }
.menu-rail { background: var(--page); border-right: 1px solid var(--line); }
.menu-rail a { display: flex; flex-direction: column; align-items: center; gap: 0.35rem; padding: 1rem 0.3rem; border-bottom: 1px solid var(--line); color: var(--ink-2); text-decoration: none; font-size: 0.82rem; text-align: center; }
.menu-rail a svg { width: 28px; height: 28px; }
.menu-rail a.on { background: var(--paper); color: var(--brand-text); font-weight: 700; box-shadow: inset 4px 0 0 var(--brand); }
.menu-pane { min-width: 0; display: flex; flex-direction: column; }
.menu-pane > h2 { font: 700 0.98rem var(--body); color: var(--ink-2); padding: 0.8rem 1rem; background: var(--page); border-bottom: 1px solid var(--line); }
.menu-item { display: flex; align-items: center; gap: 0.9rem; padding: 1rem; border-bottom: 1px solid var(--line); color: inherit; text-decoration: none; width: 100%; background: none; border-top: 0; border-left: 0; border-right: 0; text-align: left; cursor: pointer; font: inherit; }
.menu-item:hover { background: var(--hover); }
.menu-item .avatar { width: 54px; height: 54px; font-size: 1.1rem; overflow: hidden; }
.menu-item .avatar img { width: 100%; height: 100%; object-fit: cover; }
.menu-item .t { font-size: 1.08rem; }
.menu-item .s1 { color: var(--brand-text); font-weight: 700; font-size: 0.95rem; }
.menu-item .s2 { color: var(--brand-text); font-size: 0.9rem; }
.menu-pad { padding: 1rem; }
.menu-foot { margin-top: auto; padding: 1rem; text-align: right; color: var(--ink-3); font-size: 0.85rem; border-top: 1px solid var(--line); }
.help details { border-bottom: 1px solid var(--line); }
.help summary { padding: 0.95rem 1rem; cursor: pointer; font-weight: 700; list-style-position: inside; }
.help details p { padding: 0 1rem 1rem; margin: 0; color: var(--ink-2); }
.me-btn { width: 38px; height: 38px; border-radius: 50%; border: 2px solid rgba(255,255,255,.7); overflow: hidden; display: grid; place-items: center; font: 700 0.9rem var(--head); color: #fff; background: rgba(255,255,255,.16); text-decoration: none; flex: none; }
.me-btn img { width: 100%; height: 100%; object-fit: cover; }
@media (min-width: 760px) {
  .menu-page { max-width: 760px; margin: 1.5rem auto; min-height: calc(100vh - 3rem); border-radius: 16px; overflow: hidden; box-shadow: 0 10px 40px rgba(0,0,0,.12); }
  .menu-body { grid-template-columns: 120px 1fr; }
}
.menu-item > svg { width: 20px; height: 20px; flex: none; color: var(--ink-3); }

.powered { display: flex; align-items: center; justify-content: flex-end; gap: 0.45rem; font-size: 0.85rem; color: var(--ink-3); }
.powered img { border-radius: 5px; }
.powered.side { justify-content: flex-start; margin: 1.5rem 0.75rem 0; }

.demo-bar { background: var(--khaki-soft); color: var(--ink); padding: 0.5rem 1rem; font-size: 0.9rem; text-align: center; }
.demo-bar a { font-weight: 700; margin-left: 0.3rem; }
.toast { border-radius: 14px; text-align: center; width: max-content; max-width: min(92vw, 460px); line-height: 1.35; }

/* Public welcome page */
.site { background: var(--paper); color: var(--ink); }
.site section, .site-top, .site-foot { max-width: 1040px; margin: 0 auto; padding-left: 16px; padding-right: 16px; }
.site-top { display: flex; align-items: center; justify-content: space-between; padding-top: 12px; padding-bottom: 12px; }
.site-top nav { display: flex; gap: 14px; align-items: center; }
.site-top img { width: 70px; height: auto; }
.btn.small { padding: 0.45rem 1rem; min-height: 0; }
.hero { padding-top: 24px; padding-bottom: 32px; text-align: center; }
.hero h1 { font-size: clamp(1.9rem, 6vw, 3.2rem); line-height: 1.1; margin: 0 auto 14px; max-width: 760px; color: var(--brand-text); }
.hero p { font-size: 1.12rem; color: var(--ink-2); max-width: 640px; margin: 0 auto 22px; }
.cta { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.cta.center { margin-top: 20px; }
.shots { display: flex; gap: 16px; justify-content: center; margin-top: 30px; }
.shots img { width: min(42vw, 240px); height: auto; border-radius: 22px; border: 6px solid var(--ink); box-shadow: 0 16px 40px rgba(27,42,51,.18); background: var(--page); }
.band { padding-top: 44px; padding-bottom: 44px; }
.band.alt { max-width: none; background: var(--page); }
.band.alt > * { max-width: 1008px; margin-left: auto; margin-right: auto; }
.band h2 { font-size: clamp(1.4rem, 4vw, 2rem); text-align: center; margin: 0 0 10px; }
.band .sub { text-align: center; color: var(--ink-2); max-width: 640px; margin: 0 auto 24px; }
.feat { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; margin-top: 22px; }
.feat > div, .plans > div { background: var(--paper); border: 1px solid var(--line); border-radius: 14px; padding: 18px; }
.feat h3, .plans h3 { margin: 0 0 6px; font-size: 1.08rem; }
.feat p { margin: 0; color: var(--ink-2); }
.wide-shot { display: block; width: 100%; height: auto; border-radius: 14px; border: 1px solid var(--line); box-shadow: 0 12px 34px rgba(27,42,51,.12); }
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
.plans p { margin: 0 0 10px; }
.plans strong { font-size: 1.35rem; color: var(--brand-text); }
.offer { text-align: center; margin: 22px auto 0; padding: 14px; border-radius: 12px; background: var(--ok-soft); max-width: 640px; }
.steps { max-width: 620px; margin: 18px auto 0; padding-left: 1.3rem; display: grid; gap: 10px; }
.site-foot { display: flex; flex-wrap: wrap; gap: 16px; padding-top: 24px; padding-bottom: 36px; border-top: 1px solid var(--line); font-size: .95rem; }
.site-foot span { flex-basis: 100%; }

/* Careers (matches Rayden Group roles) */
.careers { max-width: 780px; margin: 0 auto; padding: 1.25rem 16px 3rem; }
.careers .eyebrow, .eyebrow { text-transform: uppercase; letter-spacing: .08em; font-size: .78rem; color: var(--ink-3); margin: .6rem 0 .2rem; }
.careers h1 { font-size: clamp(1.7rem, 5vw, 2.4rem); margin: 0 0 .6rem; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { padding: .4rem .85rem; border: 1px solid var(--line); border-radius: 999px; text-decoration: none; color: var(--ink); font-size: .92rem; }
.chip.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.role { margin-top: 10px; }
.role summary { display: flex; align-items: center; gap: 10px; cursor: pointer; list-style: none; }
.role summary::-webkit-details-marker { display: none; }
.role .plus { font-size: 1.5rem; color: var(--brand-text); transition: transform .15s; }
.role[open] .plus { transform: rotate(45deg); }
.role h4 { margin: 1rem 0 .3rem; }
.role ul { margin: 0 0 .8rem; padding-left: 1.2rem; }
fieldset.ref { border: 1px solid var(--line); border-radius: 10px; padding: .6rem .8rem .8rem; margin: 0 0 .7rem; display: grid; gap: .5rem; }
fieldset.ref legend { font-weight: 700; padding: 0 .3rem; font-size: .92rem; }
