/* VBA PR cabinet in the look of Space VBA, the company platform.
   Every value below is taken from vba-platform/web (app/globals.css, tailwind.config.ts, components/Sidebar.tsx,
   Header.tsx, MobileShell.tsx, ui.tsx): the same tokens, Inter, sizes, radii, weights and motion. No Tailwind here,
   so the classes are named, but they render the same. Light / dark / system theme: class "dark" on <html>. */

/* ── Inter Variable, self-hosted like the platform (@fontsource-variable/inter) ── */
@font-face { font-family: "Inter Variable"; font-style: normal; font-display: swap; font-weight: 100 900;
  src: url(/static/fonts/inter-cyrillic-ext-wght-normal.woff2) format("woff2-variations");
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F; }
@font-face { font-family: "Inter Variable"; font-style: normal; font-display: swap; font-weight: 100 900;
  src: url(/static/fonts/inter-cyrillic-wght-normal.woff2) format("woff2-variations");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Inter Variable"; font-style: normal; font-display: swap; font-weight: 100 900;
  src: url(/static/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; }
@font-face { font-family: "Inter Variable"; font-style: normal; font-display: swap; font-weight: 100 900;
  src: url(/static/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; }

/* ── tokens (globals.css) ── */
:root {
  --page: #F6F7F9; --surface: #FFFFFF; --line: #E6E8EC; --line2: #D5D9E0;
  --ink: #15181E; --ink2: #3A404B; --mute: #5B6370; --side: #16181D;
  --brand: #E31D27; --brand-dark: #B9151E; --brand-soft: #FCE9EA; --brand-ink: #C4161F;
  --ok: #1F7A5A; --ok-soft: #E4F2EC; --ok-ink: #155C43;
  --warn: #C98A1E; --warn-soft: #FFF3DC; --warn-ink: #7A5212;
  --bad-soft: #FCE9EA; --bad-ink: #B9151E;
  --info: #2F5D8A; --info-soft: #E7EEF6; --info-ink: #2F5D8A;
  --violet-soft: #EDE7F5; --violet-ink: #4F3B78;
  --teal-soft: #E0F1F2; --teal-ink: #1E5C60;
  --seg: #EEF0F3; --today: #FFF6F6;
  --side-hover: #23262D; --side-text: #B4BAC4; --side-line: #2A2E36; --side-mute: #B5B0AA; --side-label: #9AA1AD;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04);
  --ease-out: cubic-bezier(.2, .8, .2, 1);
  color-scheme: light;
}
.dark {
  --page: #0F1115; --surface: #171A20; --line: #262A32; --line2: #343944;
  --ink: #F1F3F6; --ink2: #C9CED6; --mute: #9AA2AE; --side: #0B0D10;
  --brand-soft: #3A1E20; --brand-ink: #FF6B72;
  --ok-soft: #173129; --ok-ink: #8FD3B6; --warn-soft: #3A2E15; --warn-ink: #E9C77F;
  --bad-soft: #3A1E20; --bad-ink: #F2A7AB; --info-soft: #1B2A3A; --info-ink: #A9C6E6;
  --violet-soft: #2A2338; --violet-ink: #C9B8F0; --teal-soft: #15302F; --teal-ink: #8FD0D3;
  --seg: #0F1115; --today: #2A1A1C;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04);
  color-scheme: dark;
}

/* ── base ── */
*, *::before, *::after { box-sizing: border-box; }
html { background: var(--page); color: var(--ink); -webkit-font-smoothing: antialiased; -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100vh; background: var(--page); font-family: "Inter Variable", Inter, system-ui, sans-serif; font-size: 13.5px;
  line-height: 1.45; font-feature-settings: "cv11", "ss01", "tnum"; letter-spacing: -.005em; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p { margin: 0; }
img, svg { display: block; }
svg { flex: none; }
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; }
main { overflow-wrap: break-word; }
.grid > * { min-width: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); border: 0; }

/* ════════════════════════════════════════ shell ════════════════════════════════════════ */
/* sidebar (components/Sidebar.tsx) */
.side { position: fixed; inset: 0 auto 0 0; z-index: 30; width: 248px; padding: 20px 14px; background: var(--side); color: var(--side-text);
  display: flex; flex-direction: column; transition: width .3s var(--ease-out), padding .3s var(--ease-out); }
.brand { display: flex; align-items: center; gap: 12px; padding: 0 6px 14px; }
.brand img { width: 42px; height: 42px; border-radius: 50%; flex: none; }
.brand b { color: #fff; font-size: 17px; font-weight: 650; white-space: nowrap; }
.nav-collapse, .nav-close { margin-bottom: 12px; height: 36px; width: 100%; padding: 0 12px; border-radius: 6px; border: 1px solid var(--side-line);
  background: none; color: var(--side-mute); font-size: 12.5px; font-weight: 600; display: flex; align-items: center; gap: 10px; white-space: nowrap; }
.nav-collapse:hover, .nav-close:hover { color: #fff; }
.nav-close { display: none; }
.nav-scroll { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; margin: 0 -6px; padding: 0 6px;
  scrollbar-width: thin; scrollbar-color: #4A4744 transparent; }
.nav-scroll::-webkit-scrollbar { width: 6px; }
.nav-scroll::-webkit-scrollbar-thumb { background: #4A4744; border-radius: 3px; }
.nav-h { padding: 16px 12px 6px; font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--side-label); white-space: nowrap; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a { position: relative; display: flex; align-items: center; gap: 12px; padding: 8px 12px; border-radius: 8px; font-size: 13.5px; color: var(--side-text); }
.nav a:hover { background: rgba(255, 255, 255, .05); color: #fff; }
.nav a.on { background: rgba(227, 29, 39, .16); color: #fff; font-weight: 500; }
.nav a.on::before { content: ""; position: absolute; left: 0; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0; background: #E31D27; }
.nav .t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav .cnt { flex: none; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--brand); color: #fff;
  font-size: 11px; font-weight: 600; display: grid; place-items: center; }
.side-foot { display: none; }
.me-wrap { flex: none; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--side-line); }
.me { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 8px; background: var(--side-hover); }
.me .ini { width: 36px; height: 36px; flex: none; border-radius: 50%; background: #E3A33B; color: #3B2A0B; display: grid; place-items: center;
  font-size: 13px; font-weight: 650; }
.me .who { min-width: 0; }
.me .who b { display: block; color: #fff; font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me .who small { display: block; font-size: 12px; color: var(--side-mute); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* header (components/Header.tsx) */
.wrap { padding-left: 248px; min-height: 100vh; display: flex; flex-direction: column; transition: padding-left .3s var(--ease-out); }
.top { position: sticky; top: 0; z-index: 20; display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 12px 28px;
  background: var(--surface); border-bottom: 1px solid var(--line); }
.search { flex: 1; min-width: 220px; height: 36px; display: flex; align-items: center; gap: 10px; padding: 0 14px; border-radius: 6px;
  border: 1px solid var(--line); background: var(--page); color: var(--mute); }
.search:focus-within { border-color: var(--ink2); }
.search input, .search input[type=search] { flex: 1; min-width: 0; height: auto; padding: 0; border: 0; background: transparent; color: var(--ink); outline: none; box-shadow: none; font-size: 13.5px; }
.search input:focus, .search input[type=search]:focus { box-shadow: none; border: 0; }
.search input::-webkit-search-cancel-button { display: none; }
.kbd { flex: none; font-size: 12px; font-weight: 600; padding: 2px 6px; border-radius: 6px; border: 1px solid var(--line); line-height: 16px; }
.top-r { display: flex; align-items: center; gap: 12px; }
.top-r form { display: contents; }
.clock { line-height: 1.15; text-align: right; padding: 0 2px; }
.clock b { display: block; font-size: 15px; font-weight: 650; color: var(--ink); font-variant-numeric: tabular-nums; }
.clock small { display: block; font-size: 11.5px; color: var(--mute); }
.ibtn { position: relative; width: 44px; height: 44px; flex: none; display: grid; place-items: center; border-radius: 6px; border: 1px solid var(--line);
  background: transparent; color: var(--ink); }
.ibtn:hover { background: var(--page); }
.ibtn > span { display: none; }
html[data-theme=light] .ibtn .i-light, html[data-theme=dark] .ibtn .i-dark, html[data-theme=system] .ibtn .i-system { display: block; }
.bell i { position: absolute; top: 10px; right: 11px; width: 8px; height: 8px; border-radius: 50%; background: var(--brand); box-shadow: 0 0 0 2px var(--surface); }
main { flex: 1; min-width: 0; padding: 24px 28px; animation: vba-page .22s var(--ease-out); }

/* phone bar and bottom bar (components/MobileShell.tsx) */
.mbar, .bnav, .shade { display: none; }

/* narrow menu: icons only (cookie vba_nav=c) */
@media (min-width: 1024px) {
  html.navc .side { width: 72px; padding: 20px 10px; }
  html.navc .wrap { padding-left: 72px; }
  html.navc .brand { justify-content: center; padding: 0 0 14px; }
  html.navc .brand b, html.navc .nav .t, html.navc .nav-collapse span, html.navc .me .who { display: none; }
  html.navc .nav-collapse, html.navc .nav a, html.navc .me { justify-content: center; }
  html.navc .nav-collapse svg { transform: scaleX(-1); }
  html.navc .nav-scroll { overflow: visible; }
  html.navc .nav-h { font-size: 0; text-align: center; padding: 16px 0 6px; }
  html.navc .nav-h::before { content: "—"; font-size: 11px; }
  html.navc .nav .cnt { position: absolute; top: 6px; right: 12px; min-width: 10px; width: 10px; height: 10px; padding: 0; font-size: 0; }
  html.navc .me { padding: 10px 0; }
}

/* ════════════════════════════════════════ building blocks ════════════════════════════════════════ */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 20px; min-width: 0; box-shadow: var(--shadow); }
.card.flush, .tabs-card { padding: 0; overflow: hidden; }
.h2 { font-size: 14.5px; font-weight: 600; color: var(--ink); }
.sub { margin-top: 2px; font-size: 12.5px; color: var(--mute); }
.mute { color: var(--mute); }
.small { font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.hint { margin-top: 5px; font-size: 12px; color: var(--mute); }

/* page head: h1 20px, sub 12.5px, actions on the right */
.head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
.head h1 { font-size: 20px; font-weight: 560; line-height: 1.45; letter-spacing: -.01em; color: var(--ink); }
.head .sub { font-size: 12.5px; margin-top: 2px; }
.head .tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.head .tools form { display: inline; }
.eyebrow { display: none; }
.crumbs { margin-bottom: 12px; font-size: 12.5px; color: var(--mute); }
.crumbs a { color: var(--ink2); font-weight: 600; }
.crumbs a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }

/* layout */
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: 1fr 1fr; }
.g3 { grid-template-columns: repeat(3, 1fr); }
.g4 { grid-template-columns: repeat(4, 1fr); }
.g-side { grid-template-columns: minmax(0, 1fr) 380px; }
.g-media { grid-template-columns: 360px minmax(0, 1fr); }
.g-card { grid-template-columns: minmax(0, 5fr) minmax(0, 4fr); }
.g-new { grid-template-columns: minmax(0, 1fr) 320px; }
.g-cal { grid-template-columns: minmax(0, 1fr) 340px; }
.g-dash { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); align-items: stretch; }
.mb { margin-bottom: 16px; }
.mt { margin-top: 16px; }
.mt-s { margin-top: 6px; }
.row { display: flex; align-items: center; gap: 12px; }
.row.between { justify-content: space-between; }
.wrapflex { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* pills (.pill: 11.5px, radius 5) and their tones */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 2px 8px; border-radius: 5px; font-size: 11.5px; font-weight: 500; line-height: 16.7px; white-space: nowrap; }
.t-green { background: var(--ok-soft); color: var(--ok-ink); }
.t-amber { background: var(--warn-soft); color: var(--warn-ink); }
.t-rose { background: var(--bad-soft); color: var(--bad-ink); }
.t-sky { background: var(--info-soft); color: var(--info-ink); }
.t-violet { background: var(--violet-soft); color: var(--violet-ink); }
.t-teal { background: var(--teal-soft); color: var(--teal-ink); }
.t-stone { background: var(--page); color: var(--ink2); box-shadow: inset 0 0 0 1px var(--line); }
.t-brand { background: var(--brand); color: #fff; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; }

/* buttons (.btn / .btnp: 32px, 13px medium, radius 6) */
.btn, .btnp, .btng { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 32px; padding: 0 12px; border-radius: 6px;
  font-size: 13px; font-weight: 500; line-height: 1; white-space: nowrap; cursor: pointer; text-decoration: none; }
.btn { background: var(--surface); color: var(--ink); border: 1px solid var(--line2); box-shadow: 0 1px 2px rgba(16, 24, 40, .05); }
.btn:hover { background: var(--page); }
.btnp { background: var(--brand); color: #fff; border: 0; padding: 0 14px; box-shadow: 0 1px 2px rgba(16, 24, 40, .1); }
.btnp:hover { background: var(--brand-dark); }
.btng { background: var(--ok); color: #fff; border: 0; padding: 0 14px; box-shadow: 0 1px 2px rgba(16, 24, 40, .1); }
.btng:hover { background: var(--ok-ink); }
.btnp:disabled, .btng:disabled, .btn:disabled { opacity: .6; cursor: default; }
.btn.sm, .btnp.sm, .btng.sm { height: 28px; padding: 0 10px; font-size: 12.5px; }
.btn.danger { color: var(--bad-ink); }
.btn.danger:hover { background: var(--brand); border-color: var(--brand); color: #fff !important; }
.danger { color: var(--bad-ink) !important; }
button:active:not(:disabled), .btn:active, .btnp:active, .btng:active { transform: translateY(.5px) scale(.99); }

/* links are quiet: red is kept for the main action and what is overdue (globals.css .link) */
.link, .linkbtn, button.link { color: var(--ink2); font-weight: 600; text-underline-offset: 3px; }
.link:hover, .linkbtn:hover, button.link:hover { color: var(--ink); text-decoration: underline; }
.linkbtn, button.link { background: none; border: 0; padding: 0; cursor: pointer; font: inherit; font-weight: 600; }

/* fields (.field: 36px, radius 6, quiet focus ring) */
.field, input[type=text], input[type=password], input[type=tel], input[type=email], input[type=url], input[type=search], input[type=date],
input[type=time], input[type=number], input[type=datetime-local], input[type=month], select, textarea {
  width: 100%; height: 36px; padding: 0 12px; border-radius: 6px; border: 1px solid var(--line2); background: var(--surface); color: var(--ink);
  font-size: 13.5px; outline: none; }
textarea { height: auto; min-height: 120px; padding: 9px 12px; line-height: 1.5; resize: vertical; }
textarea.auto { min-height: 40px; }
input:focus, textarea:focus { border-color: var(--ink2); box-shadow: 0 0 0 2px rgba(21, 24, 30, .08); }
.dark input:focus, .dark textarea:focus { box-shadow: 0 0 0 2px rgba(255, 255, 255, .08); }
input::placeholder, textarea::placeholder { color: var(--mute); opacity: .8; }
input[type=file] { font-size: 13px; }
label.l { display: block; margin-bottom: 6px; font-size: 12px; font-weight: 500; color: var(--mute); }
.f { margin-bottom: 14px; }

/* dropdowns: no native chrome, chevron, theme colours (globals.css select) */
select { -webkit-appearance: none; appearance: none; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; padding-right: 30px !important;
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 10px center / 12px; }
select:focus { border-color: var(--brand); }
select:disabled { opacity: .6; cursor: default; }
select option { background: var(--surface); color: var(--ink); }
@supports (appearance: base-select) {
  select, ::picker(select) { appearance: base-select; }
  select { display: inline-flex; align-items: center; gap: 6px; background-image: none; padding-right: 10px !important; }
  select::picker-icon { content: ""; width: 12px; height: 12px; margin-left: auto; transition: rotate .15s;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") center / 12px no-repeat; }
  select:open::picker-icon { rotate: 180deg; }
  ::picker(select) { border: 1px solid var(--line2); border-radius: 8px; background: var(--surface); color: var(--ink); padding: 4px; margin-top: 4px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, .16), 0 2px 6px rgba(0, 0, 0, .06); max-height: min(360px, 60vh); overflow-y: auto; min-width: anchor-size(width); }
  select option { padding: 7px 10px; border-radius: 5px; font-size: 13.5px; cursor: pointer; background: transparent; color: var(--ink); }
  select option:hover, select option:focus-visible { background: var(--page); outline: none; }
  select option:checked { background: var(--brand-soft); color: var(--ink); font-weight: 600; }
  select option::checkmark { content: "✓"; order: 1; margin-left: auto; font-weight: 800; }
}

/* checkboxes: a drawn tick that pops in, brand red when on */
input[type=checkbox] { -webkit-appearance: none; appearance: none; width: 17px !important; height: 17px !important; flex: none; margin: 0; padding: 0;
  border-radius: 5px; border: 1.5px solid var(--line2); background: var(--surface); display: inline-grid; place-items: center; cursor: pointer;
  vertical-align: middle; transition: background-color .15s, border-color .15s, transform .15s; }
input[type=checkbox]::after { content: ""; width: 9px; height: 5px; border-left: 2px solid #fff; border-bottom: 2px solid #fff; margin-top: -2px;
  transform: rotate(-45deg) scale(0); transition: transform .22s cubic-bezier(.3, 1.6, .5, 1); }
input[type=checkbox]:checked { background: #E31D27; border-color: #E31D27; }
input[type=checkbox]:checked::after { transform: rotate(-45deg) scale(1); }
input[type=checkbox]:active { transform: scale(.9); }
input[type=checkbox]:disabled { opacity: .5; cursor: default; }
input[type=radio] { width: 16px; height: 16px; accent-color: #E31D27; margin: 0; flex: none; }
.check, .chk { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; cursor: pointer; }
.chk { margin: 4px 0; }
.chk input { width: auto; }

/* segmented controls and tabs: the chosen option is a raised chip on a grey track (PeopleView, PeriodTabs) */
.tabs, .seg { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 3px; border-radius: 7px; border: 1px solid var(--line); background: var(--seg); max-width: 100%; }
.tabs a, .seg span { display: inline-flex; align-items: center; justify-content: center; height: 30px; padding: 0 12px; border-radius: 8px; font-size: 13px; font-weight: 560; color: var(--mute);
  white-space: nowrap; }
.tabs a:hover, .seg span:hover { color: var(--ink); }
.tabs a.on, .seg input:checked + span { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(16, 24, 40, .12), 0 0 0 1px var(--line); }
.dark .tabs a.on, .dark .seg input:checked + span { background: var(--line); box-shadow: none; }
.tabs a .n { margin-left: 4px; font-weight: 500; opacity: .8; }
.seg label { margin: 0; cursor: pointer; display: block; }
.seg input { display: none; }
/* underlined tabs inside a card (the red bar of .tab-glide) */
.ctabs { display: flex; flex-wrap: wrap; gap: 2px; padding: 6px 12px 0; border-bottom: 1px solid var(--line); }
.ctabs a { padding: 10px 12px; margin-bottom: -1px; border-bottom: 2px solid transparent; font-size: 13.5px; font-weight: 500; color: var(--mute); }
.ctabs a:hover { color: var(--ink); }
.ctabs a.on { color: var(--ink); font-weight: 600; border-bottom-color: #E31D27; }
.ctabs .n { margin-left: 3px; font-size: 12px; font-weight: 500; color: var(--mute); }
.tpane { padding: 16px 20px 20px; }

/* tables: grey head row 11px uppercase, 10px × 16px cells, row hover (PeopleView) */
table.t { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.t th { padding: 10px 12px; text-align: left; font-size: 11px; font-weight: 650; letter-spacing: .04em; text-transform: uppercase; color: var(--mute);
  border-bottom: 1px solid var(--line); white-space: nowrap; }
.t td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.t tr:last-child td { border-bottom: 0; }
.t td.v, .t.mid td { vertical-align: middle; }
.t td.num, .t th.num, .t td.right { text-align: right; }
.t tr.click { cursor: pointer; }
.t tr.click:hover td { background: var(--page); }
.t tr.off td { color: var(--mute); }
.card.flush .t th { background: var(--page); }
.card.flush .t th:first-child, .card.flush .t td:first-child { padding-left: 16px; }
.card.flush .t th:last-child, .card.flush .t td:last-child { padding-right: 16px; }

/* friendly empty state: a soft icon tile, then the text (ui.tsx Empty) */
.empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 36px 20px; text-align: center;
  font-size: 13.5px; color: var(--mute); animation: vba-fade .4s ease both; }
.empty::before { content: ""; width: 48px; height: 48px; border-radius: 14px; border: 1px solid var(--line); animation: vba-float 3s ease-in-out infinite;
  background: var(--page) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' viewBox='0 0 24 24' fill='none' stroke='%235B6370' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 7h16M4 12h10M4 17h7'/%3E%3C/svg%3E") center / 22px no-repeat; }
.dark .empty::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' viewBox='0 0 24 24' fill='none' stroke='%239AA2AE' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 7h16M4 12h10M4 17h7'/%3E%3C/svg%3E"); }
.empty.sm, .card .empty { padding: 20px; }
.card .empty::before { width: 40px; height: 40px; background-size: 18px; }

/* notices (rounded 8, tones of the platform) */
.flash, .note, .warn, .err { border-radius: 8px; padding: 10px 14px; font-size: 13.5px; }
.flash { margin-bottom: 16px; background: var(--ok-soft); color: var(--ok-ink); font-size: 13px; font-weight: 600; animation: vba-drop .2s var(--ease-out); }
.note { background: var(--info-soft); color: var(--info-ink); }
.warn { background: var(--warn-soft); color: var(--warn-ink); }
.err { background: var(--bad-soft); color: var(--bad-ink); font-weight: 600; font-size: 13px; }
.note .link, .warn .link, .err .link { color: inherit; text-decoration: underline; }
.why { color: var(--warn-ink); font-size: 12.5px; }

/* lists */
.list > * { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.list > *:last-child { border-bottom: 0; }
.list .grow, .list > * > .grow, .evrow .grow { flex: 1 1 180px; min-width: 0; }
.list .ttl, .evrow .ttl { display: block; font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list .meta { font-size: 12.5px; color: var(--mute); }
.list a.ttl:hover, .list .ttl a:hover, .evrow:hover .ttl { text-decoration: underline; text-underline-offset: 3px; }
.list .pill, .evrow .pill { max-width: 100%; white-space: normal; text-align: center; }
.daylabel { margin: 16px 0 4px; font-size: 11px; font-weight: 650; letter-spacing: .04em; text-transform: uppercase; color: var(--mute); }
.daylabel:first-child { margin-top: 0; }
.daylabel.today { color: var(--brand-ink); }
.datebox { width: 52px; flex: none; text-align: center; line-height: 1.1; }
.datebox b { display: block; font-size: 19px; font-weight: 650; }
.datebox small { font-size: 11px; color: var(--mute); text-transform: uppercase; }
.evrow { display: flex; align-items: center; gap: 12px; }

/* avatars: the platform's pastel discs with dark initials (ui.tsx Avatar) */
.ava { position: relative; width: 32px; height: 32px; border-radius: 50%; flex: none; display: grid; place-items: center; overflow: hidden;
  font-size: 12px; font-weight: 650; color: #2B2722 !important; }
.ava.lg { width: 44px; height: 44px; font-size: 16px; }
.ava img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ava.t-amber { background: #E3A33B; } .ava.t-green { background: #9CC5B4; } .ava.t-violet { background: #C9C3E6; }
.ava.t-rose { background: #F2B8A8; } .ava.t-sky { background: #B9CDE3; } .ava.t-teal { background: #A9D3D9; } .ava.t-stone { background: #E6D49C; }

/* dashboard: one card of counters split by hairlines (my-day), the «now» card */
.kpis { padding: 0; display: grid; grid-template-columns: 1fr 1fr; overflow: hidden; }
.kpis a { padding: 14px 20px; display: flex; flex-direction: column; justify-content: center; gap: 2px; min-height: 92px; }
.kpis a:hover { background: var(--page); }
.kpis a:nth-child(even) { border-left: 1px solid var(--line); }
.kpis a:nth-child(n+3) { border-top: 1px solid var(--line); }
.kpis .lab { font-size: 12px; font-weight: 600; color: var(--mute); display: flex; align-items: center; gap: 6px; }
.kpis .num { font-size: 26px; font-weight: 650; line-height: 1.25; font-variant-numeric: tabular-nums; }
.kpis .cap { font-size: 12px; color: var(--mute); }
.kpis .num.bad { color: var(--brand-ink); }
.now-card { display: flex; flex-direction: column; gap: 10px; }
.now-card ul { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; }
.now-card li { display: flex; gap: 10px; align-items: baseline; font-size: 13.5px; }
.now-card li b { min-width: 22px; font-weight: 650; font-variant-numeric: tabular-nums; }
.now-card .foot { margin-top: auto; padding-top: 4px; display: flex; flex-wrap: wrap; gap: 8px; }
.kpi { display: block; }
.kpi .lab { display: flex; justify-content: space-between; align-items: center; font-size: 12px; font-weight: 600; color: var(--mute); }
.kpi .num { margin-top: 6px; font-size: 26px; font-weight: 650; line-height: 1.15; }
.kpi .cap { margin-top: 6px; font-size: 12px; color: var(--mute); }
.kpi:hover { border-color: var(--line2); }

/* charts */
.cols { display: flex; align-items: flex-end; gap: 8px; height: 150px; border-bottom: 1px solid var(--line); }
.cols .c { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; }
.cols .v { margin-bottom: 4px; text-align: center; font-size: 12px; font-weight: 600; color: var(--ink2); }
.cols .b { width: 100%; max-width: 38px; margin: 0 auto; border-radius: 4px 4px 0 0; background: var(--ink2); transform-origin: bottom;
  animation: vba-rise-bar .6s var(--ease-out) both; transition: background .15s; }
.cols .c:hover .b { background: var(--brand); }
.cols-l { display: flex; gap: 8px; margin-top: 6px; }
.cols-l div { flex: 1; text-align: center; font-size: 11px; color: var(--mute); }
.bars > div + div { margin-top: 12px; }
.bars .bl { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 4px; font-size: 13px; }
.bars .bl span:first-child { color: var(--ink2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bars .bl b { font-weight: 600; white-space: nowrap; }
.bars .bl b small { margin-left: 6px; font-weight: 400; color: var(--mute); }
.bars .track, .track { height: 6px; border-radius: 999px; background: var(--line); }
.bars .fill, .fill { height: 6px; border-radius: 999px; background: var(--ink2); transform-origin: left; animation: vba-grow .8s var(--ease-out) both; transition: background .15s; }
.bars > div:hover .fill { background: var(--brand); }

/* greeting page */
.story { width: 100%; border-radius: 10px; background: var(--page); }
.story-ph { aspect-ratio: 9/16; display: grid; place-items: center; padding: 20px; border-radius: 10px; border: 1px dashed var(--line2); color: var(--mute);
  text-align: center; font-size: 13px; }
.preview { white-space: pre-wrap; font-size: 13.5px; background: var(--page); border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; }
dl.kv { margin: 0; display: grid; grid-template-columns: 150px 1fr; gap: 8px 16px; font-size: 13.5px; }
dl.kv dt { color: var(--mute); font-size: 12.5px; }
dl.kv dd { margin: 0; }
dd.pre { white-space: pre-wrap; }
details > summary { cursor: pointer; font-weight: 600; font-size: 13.5px; list-style: none; }
details > summary::-webkit-details-marker { display: none; }
details > summary::after { content: " +"; color: var(--mute); }
details[open] > summary::after { content: " −"; }
details[open] > :not(summary) { animation: vba-drop .16s var(--ease-out); }

/* person card */
.photo { width: 100%; aspect-ratio: 4/5; object-fit: cover; border-radius: 10px; background: var(--page); }
.photo-ph { width: 100%; aspect-ratio: 4/5; display: grid; place-items: center; border-radius: 10px; border: 1px dashed var(--line2); color: var(--mute);
  font-size: 40px; font-weight: 600; }
.ph-col { width: 160px; flex: none; }
.sec-h { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 12px; }
.sec-h h2 { margin: 0; font-size: 11px; font-weight: 650; letter-spacing: .04em; text-transform: uppercase; color: var(--mute); }
.sec .edit, .sec-h .x { display: none; }
.sec.editing .edit { display: block; }
.sec.editing .view, .sec.editing .sec-h .v { display: none; }
.sec.editing .sec-h .x { display: inline; }
.kvs { margin: 0; display: grid; gap: 10px; }
.kv1 dt { font-size: 12px; color: var(--mute); }
.kv1 dd { margin: 2px 0 0; font-size: 13.5px; overflow-wrap: anywhere; }
.notes { white-space: pre-wrap; font-size: 13.5px; background: var(--page); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 12px; }
.gallery a { display: block; }
.gallery img { width: 100%; aspect-ratio: 9/16; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); background: var(--page); }
.gallery small { display: block; margin-top: 4px; font-size: 12px; color: var(--mute); }
.dform { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; align-items: center; margin-top: 8px; }
.dform.add { padding: 12px; background: var(--page); border: 1px solid var(--line); border-radius: 8px; }
.drow details summary { color: var(--mute); }
.gift { display: flex; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.gift:last-of-type { border-bottom: 0; }
.gift img { width: 84px; height: 84px; object-fit: cover; border-radius: 8px; flex: none; background: var(--page); }
.gift .ttl { font-weight: 600; }
.gift .meta { font-size: 12.5px; color: var(--mute); }
.folder + .folder { margin-top: 14px; }
.folder-h { font-size: 11px; font-weight: 650; letter-spacing: .04em; text-transform: uppercase; color: var(--ink2); }
.newfield { border-top: 1px dashed var(--line2); padding-top: 12px; margin-top: 4px; }
.filters .fl-grid { display: grid; grid-template-columns: 2fr repeat(5, minmax(0, 1fr)); gap: 12px; }
.filters-box > summary { display: none; }
form:has(input[name=person_type][value=client]:checked) .emp-only,
form:has(input[name=person_type][value=employee]:checked) .client-only { display: none; }

/* new card form */
.fgrid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 16px; }
.fgrid .span2 { grid-column: span 2; }
.fgrid .span3 { grid-column: 1 / -1; }
.drop { display: grid; place-items: center; aspect-ratio: 4/5; overflow: hidden; border: 1px dashed var(--line2); border-radius: 10px; background: var(--page);
  color: var(--mute); text-align: center; font-size: 13.5px; cursor: pointer; }
.drop:hover { border-color: #E31D27; background: var(--brand-soft); }
.drop img { width: 100%; height: 100%; object-fit: cover; }

/* month calendar */
main.wide { max-width: none; }
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.cal .wd { padding: 8px 10px; font-size: 11px; font-weight: 650; letter-spacing: .04em; text-transform: uppercase; color: var(--mute);
  border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--page); }
.cal .day { display: block; min-height: 132px; padding: 6px 6px 8px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line);
  background: var(--surface); cursor: pointer; }
.cal .day:nth-child(7n), .cal .day:nth-child(7n-1), .cal .day.out { background: var(--page); }
.cal .day:hover { background: var(--page); }
.cal .day.out .n { color: var(--line2); }
.cal .day.today { background: var(--today); }
.cal .day.sel { box-shadow: inset 0 0 0 2px #E31D27; }
.cal .n { display: inline-grid; place-items: center; min-width: 24px; height: 24px; border-radius: 999px; font-size: 12.5px; font-weight: 600; color: var(--ink2); }
.cal a.n:hover { box-shadow: inset 0 0 0 1px var(--line2); }
.cal .day.today .n { background: var(--brand); color: #fff; }
.cal .ev, .week .ev, .wcol .ev { display: block; margin-top: 3px; padding: 3px 7px; border-radius: 4px; border-left: 3px solid var(--c, #999); color: var(--ink);
  background: color-mix(in srgb, var(--c, #999) 14%, var(--surface)); font-size: 12px; line-height: 1.35; overflow-wrap: anywhere; }
.cal .ev { overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.cal a.ev:hover { filter: brightness(.95); }
.cal .ev .dot, .wcol .ev .dot { display: none; width: 7px; height: 7px; background: var(--c, #999); }
.cal .more { display: block; margin-top: 3px; padding-left: 5px; font-size: 11.5px; color: var(--mute); }
.cal a.more:hover { color: var(--ink); text-decoration: underline; }
.legend { display: flex; flex-wrap: wrap; gap: 6px; }
.legend label { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border: 1px solid var(--line2); border-radius: 999px; background: var(--surface);
  font-size: 12.5px; cursor: pointer; }
.legend input, .legend input[type=checkbox] { display: none; }
.legend input:not(:checked) + .dot { opacity: .25; }
.legend input:not(:checked) ~ span { color: var(--mute); text-decoration: line-through; }
.add-ev summary { list-style: none; cursor: pointer; display: flex; flex-direction: column; gap: 2px; }
.add-ev summary::-webkit-details-marker { display: none; }
.add-ev summary::after { content: none !important; }
.add-ev summary .h2::after { content: " +"; color: var(--mute); }
.add-ev[open] summary .h2::after { content: " −"; }
/* week, day and list */
.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-left: 1px solid var(--line); border-top: 1px solid var(--line); }
.wcol { min-height: 360px; padding: 6px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.wcol.today { background: var(--today); }
.wcol .wh { display: flex; align-items: baseline; gap: 6px; padding: 2px 4px 8px; color: var(--mute); font-size: 11px; text-transform: uppercase; }
.wcol .wh b { font-size: 18px; color: var(--ink); }
.lday { display: flex; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.lday:last-child { border-bottom: 0; }
.lday.today .datebox b { color: var(--brand-ink); }
.lday .datebox small { display: block; }

/* year calendar */
.year { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }
.mini h3 { margin-bottom: 8px; font-size: 13.5px; font-weight: 600; }
.mini .g { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.mini .g span, .mini .g a { display: grid; place-items: center; height: 26px; border-radius: 6px; font-size: 12px; color: var(--ink2); }
.mini .g .w { color: var(--mute); font-size: 10.5px; font-weight: 600; }
.mini .g .ref { background: var(--page); box-shadow: inset 0 0 0 1px var(--line); font-weight: 600; }
.mini .g .chosen { background: var(--warn); color: #fff; font-weight: 600; }
.mini .g .ref:hover, .mini .g .chosen:hover, .mini .g .sel { outline: 2px solid #E31D27; }
.mini .g .tod { color: var(--brand-ink); font-weight: 700; }

/* reminders, import, duplicates */
.rem-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
.is-done { opacity: .55; }
.is-done .ttl { text-decoration: line-through; }
.imp-k { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-top: 14px; }
.imp-k a { display: block; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; }
.imp-k a:hover { background: var(--page); }
.imp-k b { display: block; font-size: 22px; font-weight: 650; }
.imp-k small { color: var(--mute); font-size: 12px; }
.dup { padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; }
.dup-row { display: flex; align-items: center; gap: 10px; padding: 6px 0; cursor: pointer; }
.dup-row input[type=radio] { width: auto; }
.dup-row .meta { display: block; font-size: 12.5px; color: var(--mute); }
.dup-row .ttl { font-weight: 600; }

/* companies & directories */
.addrow, .editrow { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.addrow input[type=text] { flex: 1 1 260px; }
.addrow select, .editrow select { width: auto; }
.editrow input[type=text] { flex: 1 1 220px; min-width: 0; }
.inline-edit > summary { color: var(--mute); }
.inline-edit[open] { flex-basis: 100%; }
.inline-edit[open] .editrow { margin-top: 8px; }
.dep-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 0 24px; }
.dep { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.dep a:hover { text-decoration: underline; text-underline-offset: 3px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border: 1px solid var(--line2); border-radius: 999px; background: var(--surface); font-size: 13px; }
.chip.custom { border-color: #E31D27; }
.chip form { display: inline; }
.chip .x { padding: 0; border: 0; background: none; color: var(--mute); font-size: 15px; line-height: 1; cursor: pointer; }
.chip .x:hover { color: var(--brand-ink); }
.people-pick { max-height: 280px; overflow-y: auto; padding: 6px 10px; border: 1px solid var(--line2); border-radius: 8px; background: var(--surface); }
.people-pick label { display: flex; align-items: center; gap: 8px; padding: 5px 0; font-size: 13.5px; cursor: pointer; }

/* sign-in: one card in the middle of the page (components/AuthCard.tsx) */
.auth { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 40px 16px; background: var(--page); }
.auth .box { width: 100%; max-width: 420px; display: flex; flex-direction: column; gap: 16px; padding: 32px; border-radius: 18px; border: 1px solid var(--line);
  background: var(--surface); box-shadow: 0 10px 30px rgba(31, 30, 28, .06); animation: vba-pop .22s var(--ease-out); }
.auth .logo { display: flex; align-items: center; gap: 10px; }
.auth .logo img { width: 40px; height: 40px; border-radius: 50%; box-shadow: 0 0 0 1px var(--line); }
.auth .logo b { font-size: 18px; font-weight: 650; }
.auth h1 { font-size: 22px; font-weight: 650; letter-spacing: -.01em; }
.tg { display: flex; width: 100%; height: 48px; align-items: center; justify-content: center; gap: 10px; border-radius: 6px; background: #2AABEE; color: #fff;
  font-size: 14px; font-weight: 600; }
.tg:hover { background: #229ED9; }

/* ════════════════════════════════════════ motion: one calm rhythm (globals.css) ════════════════════════════════════════ */
a, button, input, select, textarea, summary, label {
  transition: color .15s ease, background-color .15s ease, border-color .15s ease, box-shadow .2s ease, opacity .15s ease, transform .15s var(--ease-out); }
:focus-visible { outline: 2px solid #2563EB; outline-offset: 2px; }
.search input:focus-visible { outline: none; }
@keyframes vba-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes vba-pop { from { opacity: 0; transform: translateY(8px) scale(.985); } to { opacity: 1; transform: none; } }
@keyframes vba-drop { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
@keyframes vba-page { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@keyframes vba-float { 50% { transform: translateY(-4px); } }
@keyframes vba-grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes vba-rise-bar { from { transform: scaleY(0); } to { transform: scaleY(1); } }
.lift, .kpi, .card.lift { transition: transform .25s cubic-bezier(.3, 1.3, .5, 1), box-shadow .25s ease, border-color .15s ease; }
.lift:hover, .kpi:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(16, 24, 40, .10); }
.dark .lift:hover, .dark .kpi:hover { box-shadow: 0 12px 28px rgba(0, 0, 0, .4); }

/* tooltips for icon buttons: <button data-tip="..."> */
[data-tip] { position: relative; }
[data-tip]::after { content: attr(data-tip); position: absolute; left: 50%; bottom: calc(100% + 8px); z-index: 60; transform: translate(-50%, 4px) scale(.94);
  transform-origin: bottom center; padding: 5px 9px; border-radius: 7px; background: #15181E; color: #fff; font-size: 12px; font-weight: 600; line-height: 1.3;
  white-space: nowrap; pointer-events: none; opacity: 0; transition: opacity .12s ease, transform .18s cubic-bezier(.3, 1.4, .5, 1);
  box-shadow: 0 6px 18px rgba(16, 24, 40, .25); }
.dark [data-tip]::after { background: #2A2F38; }
[data-tip]:hover::after, [data-tip]:focus-visible::after { opacity: 1; transform: translate(-50%, 0) scale(1); transition-delay: .3s; }
[data-tip-pos="bottom"]::after { bottom: auto; top: calc(100% + 8px); transform-origin: top center; }
[data-tip-pos="right"]::after { left: calc(100% + 10px); bottom: 50%; transform: translate(4px, 50%) scale(.94); transform-origin: left center; }
[data-tip-pos="right"]:hover::after, [data-tip-pos="right"]:focus-visible::after { transform: translate(0, 50%) scale(1); }
html:not(.navc) .nav a[data-tip]::after { display: none; }
@media (hover: none) { [data-tip]::after { display: none; } }

/* ════════════════════════════════════════ narrower screens ════════════════════════════════════════ */
@media (max-width: 1280px) {
  .clock { display: none; }
}
@media (max-width: 1100px) {
  .g-side, .g-media, .g3, .g-card, .g-new, .g-dash { grid-template-columns: 1fr; }
  .year { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .filters .fl-grid { grid-template-columns: 1fr 1fr; }
  .g-new .drop { max-width: 240px; }
}
@media (max-width: 1500px) { .g-cal { grid-template-columns: 1fr; } .g-cal > .grid { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); align-items: start; } }

/* phones and tablets: dark top bar, the menu as a drawer, a bottom bar with four sections (MobileShell.tsx) */
@media (max-width: 1023px) {
  .side { width: 280px; max-width: 85vw; padding: 20px 14px; z-index: 50; transform: translateX(-100%); transition: transform .28s var(--ease-out); }
  body.menu .side { transform: none; box-shadow: 0 10px 40px rgba(0, 0, 0, .3); }
  .nav-collapse { display: none; }
  .nav-close { display: flex; }
  .side-foot { display: flex; align-items: center; gap: 8px; flex: none; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--side-line); }
  .side-foot form { display: contents; }
  .theme-s, .out-s { height: 36px; border-radius: 6px; border: 1px solid var(--side-line); background: none; color: var(--side-text); }
  .theme-s { width: 36px; display: grid; place-items: center; }
  .out-s { padding: 0 12px; font-size: 13px; font-weight: 600; }
  .shade { display: block; position: fixed; inset: 0; z-index: 45; background: rgba(0, 0, 0, .5); opacity: 0; pointer-events: none; transition: opacity .2s; }
  body.menu .shade { opacity: 1; pointer-events: auto; }
  .wrap { padding-left: 0; }
  .mbar { position: sticky; top: 0; z-index: 30; height: 56px; display: flex; align-items: center; gap: 12px; padding: 0 12px; background: #16181D; color: #fff; }
  .mbar button, .mbar .bell { position: relative; width: 40px; height: 40px; display: grid; place-items: center; border: 0; border-radius: 6px; background: none; color: #fff; }
  .mbar img { width: 30px; height: 30px; border-radius: 50%; }
  .mbar-t { flex: 1; font-size: 16px; font-weight: 650; }
  .mbar .bell i { top: 9px; right: 9px; box-shadow: 0 0 0 2px #16181D; }
  .top { position: static; padding: 12px 16px; }
  .top-r { display: none; }
  main { padding: 20px 16px 96px; }
  .bnav { position: fixed; inset: auto 0 0 0; z-index: 30; height: calc(64px + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
    display: grid; grid-template-columns: repeat(4, 1fr); background: var(--surface); border-top: 1px solid var(--line); }
  .bnav a { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font-size: 11px; font-weight: 600; color: var(--mute); }
  .bnav a.on { color: var(--brand-ink); }
  .bnav i { position: absolute; top: 8px; left: calc(50% + 6px); min-width: 16px; height: 16px; padding: 0 4px; border-radius: 999px; background: var(--brand);
    color: #fff; font-style: normal; font-size: 10px; font-weight: 650; display: grid; place-items: center; }
  .g2, .g4 { grid-template-columns: 1fr 1fr; }
  .rtable thead { display: none; }
  .rtable tr { display: block; padding: 12px 16px; border-bottom: 1px solid var(--line); }
  .rtable tr:last-child { border-bottom: 0; }
  .rtable td { display: block; border: 0 !important; padding: 3px 0 !important; }
  .rtable td[data-l]::before { content: attr(data-l); display: inline-block; min-width: 96px; margin-right: 6px; font-size: 12px; color: var(--mute); }
  .cal .day { min-height: 64px; }
  .cal .ev .tx, .cal .more { display: none; }
  .cal .ev { display: inline-flex; margin-right: 2px; padding: 0; border: 0; background: none; }
  .cal .ev .dot { display: inline-block; }
  .week { grid-template-columns: 1fr; }
  .wcol { min-height: 0; }
  .rem-grid { grid-template-columns: 1fr; }
  .imp-k { grid-template-columns: 1fr 1fr; }
  /* every control is at least 44px for a finger */
  .btn, .btnp, .btng, .field, input[type=text], input[type=search], input[type=tel], input[type=email], input[type=date], input[type=number], select { min-height: 44px; }
  .search { height: 44px; }
  .search input, .search input[type=search] { min-height: 0; }
}
@media (max-width: 720px) {
  .fgrid { grid-template-columns: 1fr; }
  .fgrid .span2 { grid-column: auto; }
}
@media (max-width: 640px) {
  .g2, .g4 { grid-template-columns: 1fr; }
  .g4.keep { grid-template-columns: 1fr 1fr; }
  .kpis a { padding: 12px 16px; min-height: 0; }
  .kpis .num { font-size: 22px; }
  .year { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kbd { display: none; }
  dl.kv { grid-template-columns: 1fr; gap: 2px; }
  dl.kv dd { margin-bottom: 8px; }
  .head .tools { width: 100%; }
  .head .tools .tabs, .tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .tabs::-webkit-scrollbar { display: none; }
  .ctabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .ctabs a { white-space: nowrap; }
  .dep-grid, .fl-grid { grid-template-columns: 1fr !important; }
  .list > * { flex-wrap: wrap; }
  .list > * > form { margin-left: auto; }
  .list > * > .pill { order: 3; }
  .list .ttl, .evrow .ttl { white-space: normal; overflow-wrap: anywhere; }
  .evrow { flex-wrap: wrap; }
  .evrow .pill { margin-left: 22px; }
  .rem-grid .list > * > .datebox { align-self: flex-start; }
  .filters-box > summary { display: block; font-size: 13.5px; font-weight: 600; }
  .filters-box[open] > summary { margin-bottom: 12px; }
  .rtable td.num, .rtable td.right { text-align: left; }
  .ph-col { width: 110px; }
  .auth .box { padding: 28px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
