/* Loudr Resources - the shared app frame (Phase 3.1). Everything comes from design/DESIGN.md: the tokens (dark is the
   default, light via <html data-theme="light">), type, spacing, radius, shadows, motion (with reduced motion), focus,
   the components of section 4 (class prefix lr-, so module pages keep their own styles until 3.3) and the frame:
   sidebar, top bar, bottom nav on phones, Home, sign-in screens. Fonts are self-hosted (fonts/README.md); nothing is
   loaded from outside and nothing is inline (strict CSP). */

@font-face { font-family: "Fraunces"; font-weight: 400; font-display: swap;
  src: local("Fraunces"), url("fonts/Fraunces-Regular.woff2") format("woff2"); }
@font-face { font-family: "Fraunces"; font-weight: 600; font-display: swap;
  src: local("Fraunces SemiBold"), url("fonts/Fraunces-SemiBold.woff2") format("woff2"); }
@font-face { font-family: "Fraunces"; font-weight: 700; font-display: swap;
  src: local("Fraunces Bold"), url("fonts/Fraunces-Bold.woff2") format("woff2"); }
@font-face { font-family: "Nunito Sans"; font-weight: 400 700; font-display: swap;
  src: url("fonts/NunitoSans-latin.woff2") format("woff2");
  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; }
@font-face { font-family: "Nunito Sans"; font-weight: 400 700; font-display: swap;
  src: url("fonts/NunitoSans-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, 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: "JetBrains Mono"; font-weight: 100 800; font-display: swap;
  src: url("fonts/JetBrainsMono.woff2") format("woff2"); }
@font-face { font-family: "Material Symbols Rounded"; font-weight: 400; font-display: block;
  src: url("fonts/MaterialSymbolsRounded.woff2") format("woff2"); }

/* ================================================================== 1. Tokens (DESIGN.md 1, 3, 5.1) */
:root, :root[data-theme="dark"] {
  color-scheme: dark;
  --brand: #FFC83D; --brand-hover: #FFD873; --on-brand: #121833; --gold: #FFC83D;
  --brand-glow: rgba(255,200,61,0.22); --brand-soft: rgba(255,200,61,0.12); --brand-line: rgba(255,200,61,0.38);
  --surface-100: #0E1220; --surface-200: #151A2B; --surface-300: #1E2438; --surface-sidebar: #0A0D18;
  --ink: #F3EEE3; --ink-muted: #A3AAC0; --ink-faint: #5E6782;
  --border: #2A3149; --border-strong: #3D4663; --divider: rgba(243,238,227,0.06);
  --good: #5BE0A5; --good-soft: rgba(91,224,165,0.12); --good-line: rgba(91,224,165,0.40); --good-glow: rgba(91,224,165,0.22);
  --attention: #FFA257; --attention-soft: rgba(255,162,87,0.14); --attention-line: rgba(255,162,87,0.40);
  --attention-glow: rgba(255,162,87,0.22);
  --danger: #FF6177; --danger-soft: rgba(255,97,119,0.08); --danger-line: rgba(255,97,119,0.40);
  --info: #6FC3F5; --info-soft: rgba(111,195,245,0.12); --info-line: rgba(111,195,245,0.40);
  --ai: #A99BFF; --ai-soft: rgba(169,155,255,0.13); --ai-line: rgba(169,155,255,0.40); --ai-glow: rgba(169,155,255,0.22);
  --on-danger: #121833;
  --tone-money: #A2D8B0; --tone-customers: #97B0E6; --tone-team: #EC9D80; --tone-operations: #BFACEE; --tone-more: #BEB29F;
  --shadow-color: rgba(6,9,20,0.40); --shadow-color-strong: rgba(6,9,20,0.55);
  --scrim: rgba(6,9,20,0.55);
  /* the sign-in brand panel (Loudr Auth.dc.html): near-black in dark, navy in light; its tiles keep the dark tones */
  --panel-bg: #0A0D18; --panel-ink: #F3EEE3; --panel-muted: #B4BACD; --panel-line: rgba(243,238,227,0.08);
  --panel-money: #A2D8B0; --panel-customers: #97B0E6; --panel-team: #EC9D80; --panel-operations: #BFACEE;
  --panel-gold: #FFC83D;
}
:root[data-theme="light"] {
  color-scheme: light;
  --brand: #1F2C73; --brand-hover: #2C3C90; --on-brand: #FFFDF8; --gold: #D6981C;
  --brand-glow: rgba(242,182,50,0.45); --brand-soft: rgba(31,44,115,0.08); --brand-line: rgba(31,44,115,0.28);
  --surface-100: #F6F1E7; --surface-200: #FFFDF8; --surface-300: #EEE8DB; --surface-sidebar: #EDE6D6;
  --ink: #0F1530; --ink-muted: #454D69; --ink-faint: #5C6176;
  --border: #DFD6C3; --border-strong: #C7BBA3; --divider: rgba(15,21,48,0.07);
  --good: #138A5B; --good-soft: rgba(19,138,91,0.10); --good-line: rgba(19,138,91,0.34); --good-glow: rgba(19,138,91,0.16);
  --attention: #C8620A; --attention-soft: rgba(200,98,10,0.11); --attention-line: rgba(200,98,10,0.34);
  --attention-glow: rgba(200,98,10,0.16);
  --danger: #C8324C; --danger-soft: rgba(200,50,76,0.06); --danger-line: rgba(200,50,76,0.34);
  --info: #1F6FAE; --info-soft: rgba(31,111,174,0.09); --info-line: rgba(31,111,174,0.30);
  --ai: #6A45C9; --ai-soft: rgba(106,69,201,0.09); --ai-line: rgba(106,69,201,0.30); --ai-glow: rgba(106,69,201,0.14);
  --on-danger: #FFFDF8;
  --tone-money: #4E9B63; --tone-customers: #4C6DBA; --tone-team: #CC6342; --tone-operations: #7E64C6; --tone-more: #8A7D68;
  --shadow-color: rgba(60,48,28,0.10); --shadow-color-strong: rgba(60,48,28,0.18);
  --scrim: rgba(6,9,20,0.55);
  --panel-bg: #1F2C73; --panel-ink: #FFFDF8; --panel-muted: #CDD3EA; --panel-line: rgba(255,253,248,0.12);
  --panel-money: #A2D8B0; --panel-customers: #97B0E6; --panel-team: #EC9D80; --panel-operations: #BFACEE;
  --panel-gold: #FFC83D;
}
/* The paper a customer gets (DESIGN.md 4.15: "the same fixed paper palette as the invoice document"): an invoice or a
   receipt drawn on it looks the same in both themes - the light theme's values, fixed. */
.lr-paper { color-scheme: light;
  --surface-100: #F6F1E7; --surface-200: #FFFDF8; --surface-300: #EEE8DB;
  --ink: #0F1530; --ink-muted: #454D69; --ink-faint: #5C6176;
  --border: #DFD6C3; --border-strong: #C7BBA3; --divider: rgba(15,21,48,0.07);
  --good: #138A5B; --good-soft: rgba(19,138,91,0.10); --good-line: rgba(19,138,91,0.34);
  --attention: #C8620A; --attention-soft: rgba(200,98,10,0.11); --attention-line: rgba(200,98,10,0.34);
  --danger: #C8324C; --danger-soft: rgba(200,50,76,0.06); --danger-line: rgba(200,50,76,0.34);
  --info: #1F6FAE; --info-soft: rgba(31,111,174,0.09); --info-line: rgba(31,111,174,0.30);
  --brand: #1F2C73; --on-brand: #FFFDF8; --brand-soft: rgba(31,44,115,0.08); --brand-line: rgba(31,44,115,0.28);
  --shadow-color: rgba(60,48,28,0.10);
  background: var(--surface-200); color: var(--ink); }
:root {
  /* type families */
  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Nunito Sans", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
  /* spacing (core 4..80; half-steps inside components only) */
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 24px; --s-6: 32px; --s-7: 40px; --s-8: 64px; --s-9: 80px;
  /* radius (DESIGN.md 3.3) */
  --r-xs: 6px; --r-sm: 8px; --r-md: 10px; --r-control: 14px; --r-lg: 16px; --r-panel: 20px; --r-widget: 22px;
  --r-modal: 28px; --r-pill: 999px;
  /* shadows (DESIGN.md 3.4) */
  --sh-rest: 0 1px 2px var(--shadow-color);
  --sh-hover: 0 12px 28px var(--shadow-color);
  --sh-popover: 0 12px 40px var(--shadow-color-strong);
  --sh-toast: 0 12px 32px var(--shadow-color-strong);
  --sh-modal: 0 24px 64px var(--shadow-color-strong);
  --sh-drawer: -24px 0 64px var(--shadow-color-strong);
  --sh-focus: 0 0 0 4px var(--brand-glow);
  /* motion (DESIGN.md 5.1); --m-k is 0 when the person prefers reduced motion */
  --m-fast: 120ms; --m-mid: 200ms; --m-slow: 300ms; --m-exit: 100ms; --m-sb: 280ms;
  --m-out: cubic-bezier(0.2,0,0,1); --m-in: cubic-bezier(0.4,0,1,1);
  --m-pop: cubic-bezier(0.34,1.45,0.64,1); --m-inout: cubic-bezier(0.65,0,0.35,1);
  --m-k: 1; --m-d1: calc(2px * var(--m-k)); --m-d2: calc(4px * var(--m-k)); --m-d3: calc(6px * var(--m-k));
  --m-d4: calc(8px * var(--m-k));
  --m-press: 0.98; --m-hover: 1.02; --m-icon: 1.05; --m-settle: 0.985;
  --m-countup: 600ms; --m-toast-hold: 3200ms; --m-tip-delay: 300ms; --m-stagger-widgets: 40ms; --m-stagger-sidebar: 20ms;
  --sidebar-w: 272px; --sidebar-w-collapsed: 70px;
}
@media (prefers-reduced-motion: reduce) { :root { --m-k: 0; } }
/* loudr/motion.js: with reduced motion every shift, scale and turn becomes a plain fade, and the sidebar snaps */
@media (prefers-reduced-motion: reduce) {
  :root { --m-sb: 0ms; --m-press: 1; --m-hover: 1; --m-icon: 1; --m-settle: 1; --m-pop: cubic-bezier(0.2,0,0,1); --m-slow: 200ms; }
}

/* ================================================================== 2. Base and type (DESIGN.md 2) */
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { background: var(--surface-100); color: var(--ink); font: 400 15px/24px var(--font-body);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
/* the theme cross-fade (motion.js): every colour eases over --m-slow while html.theme-fade is on (340 ms) */
html.theme-fade, html.theme-fade * { transition: background-color var(--m-slow) var(--m-out), color var(--m-slow) var(--m-out),
  border-color var(--m-slow) var(--m-out), fill var(--m-slow), stroke var(--m-slow) !important; }
/* press (motion.js global rule): anything pressable settles to --m-press while held */
:where(button, [role="button"], [data-press], .lr-btn, .lr-icon-btn, .nav-row, .lr-bn-item):not(:disabled):active { scale: var(--m-press); }
a { color: var(--brand); text-underline-offset: 3px; }
p { text-wrap: pretty; }
h1, h2, h3 { text-wrap: balance; }
img { max-width: 100%; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.lr-display, .display { font: 600 40px/46px var(--font-display); margin: 0 0 8px; }
.page-title { font: 600 36px/42px var(--font-display); margin: 0 0 16px; }
.lr-auth-title { font: 600 34px/40px var(--font-display); margin: 0; }
.lr-h-section { font: 600 32px/38px var(--font-display); margin: 0; }
.lr-h-modal { font: 600 28px/34px var(--font-display); margin: 0; }
.lr-h-sub { font: 600 24px/30px var(--font-display); margin: 0; }
.lr-card-header, .section-title { font: 700 17px/24px var(--font-body); margin: 32px 0 16px; }
.lr-card-header { margin: 0; }
.lr-lead { font: 400 17px/26px var(--font-body); color: var(--ink-muted); margin: 0; max-width: 560px; }
.lr-body { font: 400 15px/24px var(--font-body); }
.lr-reading { font: 400 18px/28px var(--font-body); max-width: 880px; }
.lr-label { font: 700 15px/22px var(--font-body); color: var(--ink); }
.small { font: 400 14px/20px var(--font-body); }
.caption { font: 400 13px/19px var(--font-body); }
.eyebrow { font: 500 11px/16px var(--font-mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-muted); }
.lr-eyebrow-sm { font: 500 12px/16px var(--font-mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-muted); }
.lr-data { font: 400 14px/20px var(--font-mono); font-variant-numeric: tabular-nums; }
.lr-num-xl { font: 500 36px/42px var(--font-mono); }
.lr-num-l { font: 500 32px/38px var(--font-mono); }
.lr-num-m { font: 500 28px/34px var(--font-mono); }
.lr-num-s { font: 500 20px/28px var(--font-mono); }
.muted { color: var(--ink-muted); }
.lr-measure { max-width: 880px; }
.lr-form-measure { max-width: 560px; }

/* Icons: Material Symbols Rounded, hidden until the self-hosted font has loaded (loudr.js), so a missing font never
   shows ligature names. */
.icon { font-family: "Material Symbols Rounded"; font-weight: normal; font-style: normal; font-size: 22px; line-height: 1;
  width: 1em; height: 1em; display: inline-block; flex: none; overflow: hidden; white-space: nowrap; letter-spacing: normal;
  text-transform: none; word-wrap: normal; direction: ltr; visibility: hidden;
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24; -webkit-font-feature-settings: 'liga'; font-feature-settings: 'liga'; }
html.icons-ready .icon { visibility: visible; }
.icon-18 { font-size: 18px; } .icon-20 { font-size: 20px; } .icon-24 { font-size: 24px; } .icon-32 { font-size: 32px; }
.icon-fill { font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 24; }

/* Focus (DESIGN.md 5.2): fields get the glow + brand border, every other control a 2px brand outline. Never removed
   without a replacement. */
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: none; border-color: var(--brand);
  box-shadow: var(--sh-focus); }

/* Skip link: first thing a keyboard reaches. */
.skip-link { position: fixed; top: 8px; left: 8px; z-index: 130; padding: 10px 16px; border-radius: var(--r-control);
  background: var(--brand); color: var(--on-brand); font: 700 15px/24px var(--font-body); text-decoration: none;
  transform: translateY(-160%); transition: transform var(--m-fast) var(--m-out); }
.skip-link:focus, .skip-link:focus-visible { transform: none; }

/* ================================================================== 3. Motion (DESIGN.md 5) */
@keyframes lm-rise { from { opacity: 0; transform: translateY(calc(var(--rise, 4px) * var(--m-k))); } to { opacity: 1; transform: none; } }
@keyframes lm-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes lm-scale-in { from { opacity: 0; transform: scale(calc(1 - 0.02 * var(--m-k))); } to { opacity: 1; transform: none; } }
@keyframes lm-shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@keyframes lm-spin { to { transform: rotate(360deg); } }
@keyframes lm-shake { 0%, 100% { transform: none; } 20%, 60% { transform: translateX(calc(-6px * var(--m-k))); }
  40%, 80% { transform: translateX(calc(6px * var(--m-k))); } }
@keyframes lm-caret { 0%, 49% { opacity: 1; } 50%, 100% { opacity: 0; } }
@keyframes lm-badge { from { transform: scale(calc(1 - 0.6 * var(--m-k))); } to { transform: none; } }
@keyframes lm-highlight { from { background-color: var(--brand-soft); } to { background-color: transparent; } }
/* the rest of motion.js's named animations the frame uses (distances x --m-k, so reduced motion only fades) */
@keyframes lm-rise-b { from { opacity: 0; transform: translateY(calc(var(--rise, 4px) * var(--m-k))); } to { opacity: 1; transform: none; } }
@keyframes lm-toast-in { from { opacity: 0; transform: translateY(calc(8px * var(--m-k))); } }
@keyframes lm-toast-out { to { opacity: 0; transform: translateY(calc(8px * var(--m-k))); } }
@keyframes lm-tip { from { opacity: 0; transform: translateY(-50%) translateX(calc(-2px * var(--m-k))); } to { opacity: 1; transform: translateY(-50%); } }
@keyframes lm-slide-r { from { opacity: 0; transform: translateX(calc(-8px * var(--m-k))); } }
@keyframes lm-pop { 50% { transform: scale(calc(1 + 0.06 * var(--m-k))); } }
@keyframes lm-wiggle { 0%, 100% { transform: rotate(0); } 20% { transform: rotate(calc(14deg * var(--m-k))); }
  40% { transform: rotate(calc(-10deg * var(--m-k))); } 60% { transform: rotate(calc(6deg * var(--m-k))); }
  80% { transform: rotate(calc(-3deg * var(--m-k))); } }
@keyframes lm-ring { 0% { box-shadow: 0 0 0 0 transparent; }
  45% { box-shadow: 0 0 0 calc(1.5px + 4px * var(--m-k)) color-mix(in srgb, var(--ring, var(--brand)) 30%, transparent); }
  100% { box-shadow: 0 0 0 1.5px var(--ring, var(--brand)); } }
@keyframes lm-draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes lm-dot { 0%, 80%, 100% { opacity: .3; transform: none; } 40% { opacity: 1; transform: translateY(calc(-2px * var(--m-k))); } }
@keyframes lm-caret-out { to { opacity: 0; } }
/* the greeting types itself (loudr.js); the date and Customize fade in once it is done */
.lr-greeting.is-typing .lr-greeting-date, .lr-greeting.is-typing .lr-greeting-actions { opacity: 0; }
.lr-greeting-date, .lr-greeting-actions { transition: opacity var(--m-slow) var(--m-out); }
.lr-typed-caret.is-done { animation: lm-caret 500ms linear 0ms 3, lm-caret-out 220ms var(--m-in) 1500ms forwards; }
.lr-typed-rest { visibility: hidden; }
/* a group tile rings once when its group opens (SidebarGroup.dc.html) */
.nav-group[open] > .nav-group-head .nav-group-tile { --ring: var(--tone); animation: lm-ring 500ms var(--m-out); }
.lm-rise { animation: lm-rise var(--m-mid) var(--m-out) both; }
.lm-fade { animation: lm-fade var(--m-mid) var(--m-out) both; }

/* ================================================================== 4. Components (DESIGN.md 4) */
/* 4.1 Buttons */
.lr-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px;
  padding: 8px 22px; border-radius: var(--r-control); border: 0; font: 700 15px/24px var(--font-body);
  text-decoration: none; cursor: pointer; white-space: nowrap; color: var(--ink); background: transparent;
  transition: background-color var(--m-fast) var(--m-out), color var(--m-fast) var(--m-out),
    border-color var(--m-fast) var(--m-out), scale var(--m-fast) var(--m-out); }
.lr-btn:active:not([disabled]):not([aria-disabled="true"]) { scale: calc(1 - 0.02 * var(--m-k)); }
.lr-btn .icon { font-size: 20px; }
.lr-btn-l { min-height: 56px; padding: 0 24px; border-radius: var(--r-lg); font: 700 17px/24px var(--font-body); }
.lr-btn-m { min-height: 52px; padding: 0 24px; font: 700 16px/24px var(--font-body); }
.lr-btn-block { width: 100%; }
.lr-btn-primary { background: var(--brand); color: var(--on-brand); box-shadow: var(--sh-focus); }
.lr-btn-primary:hover { background: var(--brand-hover); }
.lr-btn-secondary { background: var(--surface-200); border: 1.5px solid var(--border-strong); color: var(--ink); }
.lr-btn-secondary:hover { background: var(--surface-300); }
.lr-btn-tertiary { border: 1px solid var(--border); border-radius: var(--r-control); padding: 8px 18px; color: var(--ink); }
.lr-btn-tertiary .icon, .lr-btn-secondary .icon { color: var(--ink-muted); }
.lr-btn-tertiary:hover { background: var(--surface-300); }
.lr-btn-danger { border: 1.5px solid var(--danger); color: var(--danger); }
.lr-btn-danger:hover { background: var(--danger-soft); }
.lr-btn-danger-solid { background: var(--danger); color: var(--on-danger); box-shadow: 0 0 0 4px var(--danger-soft); }
.lr-btn-danger-solid:hover { background: color-mix(in srgb, var(--danger) 88%, var(--ink)); }
.lr-btn-ghost { padding: 8px 12px; color: var(--ink-muted); font: 700 15px/22px var(--font-body); }
.lr-btn-ghost:hover { color: var(--ink); }
.lr-btn[disabled], .lr-btn[aria-disabled="true"] { opacity: 0.5; cursor: not-allowed; }
.lr-btn[aria-busy="true"]::before { content: ""; width: 18px; height: 18px; border-radius: 50%; border: 2px solid currentColor;
  border-right-color: transparent; animation: lm-spin 700ms linear infinite; }
.lr-icon-btn { width: 40px; height: 40px; flex: none; display: inline-grid; place-items: center; border-radius: var(--r-control);
  background: var(--surface-300); border: 1px solid var(--border); color: var(--ink-muted); cursor: pointer;
  text-decoration: none; position: relative; transition: background-color var(--m-fast) var(--m-out), color var(--m-fast) var(--m-out); }
.lr-icon-btn .icon { font-size: 20px; }
.lr-icon-btn:hover { background: var(--border); color: var(--ink); }
.lr-icon-btn-sm { width: 32px; height: 32px; border-radius: var(--r-md); background: transparent; border: 0; }
/* kept for module pages (Phase 2 classes) */
button.primary { margin-top: 16px; background: var(--brand); color: var(--on-brand); border: 0; border-radius: var(--r-control);
  min-height: 44px; padding: 10px 22px; font: 700 15px/24px var(--font-body); cursor: pointer; box-shadow: var(--sh-focus); }
button.primary:hover { background: var(--brand-hover); }
.text-button { background: none; border: 0; color: var(--brand); cursor: pointer; min-height: 44px;
  font: 700 14px/20px var(--font-body); padding: 0 4px; }
.icon-button { width: 40px; height: 40px; border-radius: var(--r-control); border: 1px solid var(--border); background: var(--surface-300);
  color: var(--ink-muted); cursor: pointer; display: grid; place-items: center; }
.icon-button:hover { background: var(--border); color: var(--ink); }

/* 4.2 Inputs */
.lr-field { display: flex; flex-direction: column; gap: 8px; }
.lr-field > label, .lr-field > .lr-label { font: 700 15px/22px var(--font-body); }
.lr-input, .form input[type=email], .form input[type=password], .form input[type=text] {
  width: 100%; min-height: 48px; padding: 11px 16px; border-radius: var(--r-control); background: var(--surface-200);
  border: 1.5px solid var(--border-strong); color: var(--ink); font: 400 15px/24px var(--font-body);
  transition: border-color var(--m-fast) var(--m-out), box-shadow var(--m-fast) var(--m-out); }
.lr-input-l { min-height: 56px; padding: 14px 16px; font: 400 17px/24px var(--font-body); }
.lr-input::placeholder { color: var(--ink-faint); }
.lr-help { font: 400 14px/20px var(--font-body); color: var(--ink-muted); margin: 0; }
.lr-field-error { display: flex; gap: 6px; align-items: center; margin: 0; font: 700 14px/20px var(--font-body);
  color: var(--danger); animation: lm-rise var(--m-mid) var(--m-out) both; }
.lr-field.is-error .lr-input { border-color: var(--danger); }
.lr-shake { animation: lm-shake 400ms var(--m-out); }
.lr-search { display: flex; align-items: center; gap: 8px; min-height: 38px; padding: 0 12px; border-radius: var(--r-control);
  background: var(--surface-300); border: 1px solid var(--border); color: var(--ink-muted); flex: 1; min-width: 160px;
  max-width: 480px; }
.lr-search input { flex: 1; min-width: 0; border: 0; background: transparent; color: var(--ink); font: 400 15px/22px var(--font-body);
  min-height: 36px; }
.lr-search input::placeholder { color: var(--ink-muted); }
.lr-search input:disabled { cursor: not-allowed; }
.lr-search:focus-within { border-color: var(--brand); box-shadow: var(--sh-focus); }
.lr-search input:focus-visible { box-shadow: none; }

/* 4.3 Select: a compact field with a trailing expand_more */
.lr-select { position: relative; display: flex; }
.lr-select select { appearance: none; -webkit-appearance: none; width: 100%; min-height: 48px; padding: 11px 44px 11px 16px;
  border-radius: var(--r-control); background: var(--surface-200); border: 1.5px solid var(--border-strong); color: var(--ink);
  font: 400 15px/24px var(--font-body); cursor: pointer; }
.lr-select .icon { position: absolute; right: 14px; top: 50%; margin-top: -10px; font-size: 20px; color: var(--ink-muted);
  pointer-events: none; transition: transform var(--m-mid) var(--m-out); }
.lr-select select:focus-visible + .icon { transform: rotate(180deg); }

/* 4.4 Toggle: a real checkbox with role="switch" (Space toggles it natively) */
.lr-switch-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 48px; }
.lr-switch-row > label { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.lr-switch-row .lr-help { font-weight: 400; }
.lr-switch-row > label.lr-tool-label { flex-direction: row; align-items: center; gap: 10px; }
html.js .lr-noscript-save { display: none; }
.lr-switch { appearance: none; -webkit-appearance: none; position: relative; flex: none; width: 44px; height: 26px; margin: 0;
  border-radius: var(--r-pill); background: var(--surface-300); border: 1px solid var(--border-strong); cursor: pointer;
  transition: background-color var(--m-mid) var(--m-out), border-color var(--m-mid) var(--m-out); }
.lr-switch::before { content: ""; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%;
  background: var(--ink-muted); box-shadow: var(--sh-rest); transition: transform var(--m-mid) var(--m-out), background-color var(--m-mid) var(--m-out); }
.lr-switch:checked { background: var(--brand); border-color: var(--brand); }
.lr-switch:checked::before { transform: translateX(18px); background: var(--on-brand); }
.lr-switch-sm { width: 36px; height: 20px; }
.lr-switch-sm::before { width: 14px; height: 14px; }
.lr-switch-sm:checked::before { transform: translateX(16px); }
.lr-switch[disabled] { opacity: 0.5; cursor: not-allowed; }

/* 4.5 Tables: CSS grids, never <table> */
.lr-rows { background: var(--surface-200); border: 1px solid var(--border); border-radius: var(--r-panel); box-shadow: var(--sh-rest);
  padding: 16px 0 0; overflow: hidden; }
.lr-row, .lr-row-head { display: grid; gap: 24px; align-items: center; padding: 16px 24px; }
.lr-row-head { padding: 0 24px 8px; font: 500 11px/16px var(--font-mono); letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--ink-muted); }
.lr-row { border-top: 1px solid var(--border); color: var(--ink); text-decoration: none; }
a.lr-row:hover, .lr-row-click:hover { background: var(--surface-300); }
.lr-row-new { animation: lm-highlight 1.2s var(--m-out); }
.lr-cols-2 { grid-template-columns: minmax(0,1.6fr) minmax(0,1fr); }
.lr-cols-3 { grid-template-columns: minmax(0,1.6fr) minmax(0,1fr) minmax(0,1fr); }
.lr-cols-4 { grid-template-columns: minmax(0,1.6fr) minmax(0,1fr) minmax(0,1fr) minmax(0,1fr); }
.lr-cols-5 { grid-template-columns: minmax(0,1.6fr) minmax(0,1fr) minmax(0,1fr) minmax(0,1fr) minmax(0,1fr); }
.lr-cell-name { font: 700 15px/24px var(--font-body); min-width: 0; overflow-wrap: anywhere; }
.lr-cell-name .caption { display: block; font-weight: 400; color: var(--ink-muted); }
.lr-cell-num { justify-self: end; text-align: right; font: 400 14px/20px var(--font-mono); font-variant-numeric: tabular-nums; }
.lr-row-head .lr-cell-num { font: inherit; }
.lr-money-in { color: var(--good); }
.lr-money-out { color: var(--ink-muted); }

/* 4.6 Cards, widgets, stat tiles */
.card, .lr-card { background: var(--surface-200); border: 1px solid var(--border); border-radius: var(--r-panel); padding: 24px;
  box-shadow: var(--sh-rest); }
.lr-card { display: flex; flex-direction: column; gap: 16px; }
.lr-widget { position: relative; display: flex; flex-direction: column; gap: 18px; min-width: 0; background: var(--surface-200);
  border: 1px solid var(--border); border-radius: var(--r-widget); padding: 20px 24px 24px; box-shadow: var(--sh-rest);
  color: var(--ink); text-decoration: none;
  transition: border-color var(--m-fast) var(--m-out), box-shadow var(--m-mid) var(--m-out), transform var(--m-mid) var(--m-out); }
.lr-widget:hover { border-color: var(--border-strong); }
a.lr-widget:hover, .lr-widget-click:hover, .lr-wgrid .lr-widget:not(.lr-widget-soon):hover { box-shadow: var(--sh-hover);
  transform: translateY(calc(-2px * var(--m-k))); }
.is-customizing .lr-wgrid .lr-widget:hover { box-shadow: var(--sh-rest); transform: none; }
.lr-widget-head { display: flex; align-items: center; gap: 10px; min-width: 0; min-height: 32px; }
.lr-widget-head > .icon { font-size: 20px; color: var(--ink-muted); }
.lr-widget-title { font: 700 16px/22px var(--font-body); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lr-tone-dot { width: 7px; height: 7px; flex: none; margin-left: -2px; border-radius: var(--r-pill); background: var(--tone, var(--tone-more)); }
.lr-widget-open { margin-left: auto; display: inline-flex; align-items: center; gap: 2px; flex: none; white-space: nowrap;
  font: 700 14px/20px var(--font-body); color: var(--ink-muted); }
.lr-widget-open .icon { font-size: 18px; }
a.lr-widget:hover .lr-widget-open { color: var(--ink); }
.lr-widget-body { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.lr-widget-body > .lr-pill { align-self: flex-start; }
.lr-widget-desc { margin: 0; color: var(--ink-muted); font: 400 14px/20px var(--font-body); }
.lr-stat { border-radius: var(--r-lg); background: var(--surface-100); padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; }
.lr-stat-value { font: 500 28px/34px var(--font-mono); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.lr-danger-zone { border-radius: var(--r-panel); border: 1.5px solid var(--danger-line); background: var(--danger-soft); padding: 24px; }
.lr-danger-zone .eyebrow { color: var(--danger); }
.tone-money { --tone: var(--tone-money); } .tone-customers { --tone: var(--tone-customers); }
.tone-team { --tone: var(--tone-team); } .tone-operations { --tone: var(--tone-operations); }
.tone-more { --tone: var(--tone-more); } .tone-core { --tone: var(--ink-muted); }

/* 4.7 Modals: the native <dialog> (Esc closes, focus stays inside) */
.lr-dialog { width: min(680px, calc(100vw - 48px)); max-height: calc(100vh - 48px); padding: 0; border-radius: var(--r-modal);
  background: var(--surface-200); color: var(--ink); border: 1px solid var(--border); box-shadow: var(--sh-modal); }
.lr-dialog[open] { display: flex; flex-direction: column; animation: lm-scale-in var(--m-mid) var(--m-out); }
.lr-dialog::backdrop { background: var(--scrim); animation: lm-fade var(--m-mid) var(--m-out); }
.lr-dialog-confirm { width: min(440px, calc(100vw - 48px)); }
.lr-dialog-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 24px 28px 18px;
  border-bottom: 1px solid var(--border); }
.lr-dialog-body { padding: 16px 24px 40px; overflow: auto; }
.lr-dialog-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 28px;
  border-top: 1px solid var(--border); }

/* the widget gallery: a drawer from the right */
.lr-drawer { margin: 0 0 0 auto; width: min(460px, 100vw); max-width: 100vw; height: 100vh; max-height: 100vh; border-radius: 0;
  border-width: 0 0 0 1px; box-shadow: var(--sh-drawer); }
.lr-drawer[open] { animation: lm-slide-l var(--m-slow) var(--m-out); }
.lr-drawer:not([open]) { display: none; }
@keyframes lm-slide-l { from { opacity: 0; transform: translateX(calc(8px * var(--m-k))); } to { opacity: 1; transform: none; } }
.lr-gallery { display: flex; flex-direction: column; gap: 28px; }
.lr-gallery-section { display: flex; flex-direction: column; gap: 10px; }
.lr-gallery-item { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border-radius: var(--r-lg); background: var(--surface-100);
  border: 1px solid var(--border); }
.lr-gallery-thumb { width: 48px; height: 48px; flex: none; display: grid; place-items: center; border-radius: var(--r-md);
  background: var(--surface-200); border: 1px solid var(--border); color: var(--ink-muted); }
.lr-gallery-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.lr-gallery-text strong { font: 700 15px/22px var(--font-body); }
.lr-gallery-text > span:not(.lr-gallery-sizes) { font: 400 14px/20px var(--font-body); color: var(--ink-muted); }
.lr-gallery-sizes { display: flex; gap: 4px; padding-top: 4px; }
.lr-gallery-sizes span { min-width: 22px; padding: 0 5px; border-radius: 6px; border: 1px solid var(--border); text-align: center;
  font: 500 11px/18px var(--font-mono); color: var(--ink-muted); }
.lr-gallery-added { display: flex; align-items: center; gap: 4px; padding: 6px 10px; font: 700 14px/20px var(--font-body); color: var(--ink-muted); }
.lr-gallery-added .icon { font-size: 18px; color: var(--good); }

/* 4.8 Tabs (segmented) */
.lr-tablist { display: inline-flex; gap: 4px; padding: 4px; border-radius: var(--r-control); background: var(--surface-100);
  border: 1px solid var(--border); max-width: 100%; overflow-x: auto; }
.lr-tab { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: var(--r-md);
  border: 1px solid transparent; background: transparent; color: var(--ink-muted); font: 700 15px/22px var(--font-body);
  cursor: pointer; white-space: nowrap; text-decoration: none; transition: color var(--m-mid) var(--m-out), background-color var(--m-mid) var(--m-out); }
.lr-tab .icon { font-size: 20px; }
.lr-tab[aria-selected="true"], .lr-tab[aria-current="page"] { background: var(--surface-300); border-color: var(--border-strong);
  color: var(--ink); box-shadow: var(--sh-rest); }
.lr-tab:hover { color: var(--ink); }
.lr-tabpanel[hidden] { display: none; }

/* 4.9 Badges and status pills */
.lr-badge-count { position: absolute; top: -6px; right: -6px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: var(--r-pill);
  background: var(--attention); color: var(--surface-100); border: 2px solid var(--surface-100); display: inline-grid; place-items: center;
  font: 500 11px/16px var(--font-mono); animation: lm-badge 320ms var(--m-pop); }
.lr-badge-count[hidden] { display: none; }
.lr-badge { display: inline-grid; place-items: center; min-width: 22px; padding: 0 7px; border-radius: var(--r-pill);
  background: var(--attention-soft); color: var(--attention); font: 500 11px/20px var(--font-mono); }
.lr-badge-good { background: color-mix(in srgb, var(--good) 16%, transparent); color: var(--good); }
.lr-dot { width: 8px; height: 8px; border-radius: var(--r-pill); background: var(--attention); box-shadow: 0 0 0 2px var(--surface-sidebar); }
.lr-pill { display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 10px; border-radius: var(--r-pill);
  font: 700 13px/18px var(--font-body); white-space: nowrap; border: 1px solid var(--border); background: var(--surface-300); color: var(--ink-muted); }
.lr-pill .icon { font-size: 14px; }
.lr-pill-good { background: var(--good-soft); border-color: var(--good-line); color: var(--good); }
.lr-pill-attention { background: var(--attention-soft); border-color: var(--attention-line); color: var(--attention); }
.lr-pill-danger { background: var(--danger-soft); border-color: var(--danger-line); color: var(--danger); }
.lr-pill-info { background: var(--info-soft); border-color: var(--info-line); color: var(--info); }
.lr-pill-ai { background: var(--ai-soft); border-color: var(--ai-line); color: var(--ai); }

/* Contrast (DESIGN.md 6 "text >= 4.5:1"): in light, --good and --attention text on their -soft fills measures 3.8 / 3.5,
   so small status text there uses a tint derived from the token (70% token + 30% ink; no new hex). */
:root[data-theme="light"] .lr-pill-good, :root[data-theme="light"] .lr-badge-good,
:root[data-theme="light"] .lr-money-in { color: color-mix(in srgb, var(--good) 70%, var(--ink)); }
:root[data-theme="light"] .lr-pill-attention, :root[data-theme="light"] .lr-badge { color: color-mix(in srgb, var(--attention) 70%, var(--ink)); }
:root[data-theme="light"] .lr-badge-count { background: color-mix(in srgb, var(--attention) 80%, var(--ink)); color: var(--surface-200); }

/* 4.12 Banners (and the Phase 2 banner classes module pages use) */
.banner, .lr-banner { display: flex; align-items: flex-start; gap: 10px; margin: 0; border-radius: var(--r-control); padding: 12px 16px;
  border: 1px solid var(--border); background: var(--surface-300); color: var(--ink); }
.lr-banner > .icon { font-size: 20px; margin-top: 2px; }
.lr-banner-body { flex: 1; min-width: 0; }
.banner-info, .lr-banner-info { background: var(--info-soft); border-color: var(--info-line); }
.lr-banner-info > .icon { color: var(--info); }
.banner-danger, .lr-banner-danger { background: var(--danger-soft); border-color: var(--danger-line); }
.lr-banner-danger > .icon { color: var(--danger); }
.lr-banner-good { background: var(--good-soft); border-color: var(--good-line); }
.lr-banner-good > .icon { color: var(--good); }
.lr-banner-attention { background: var(--attention-soft); border-color: var(--attention-line); }
.lr-banner-attention > .icon { color: var(--attention); }
.lr-banner-brand { background: var(--brand-soft); border-color: var(--brand-line); }
.lr-banner-brand > .icon { color: var(--brand); }
.flashes { display: flex; flex-direction: column; gap: 8px; margin-bottom: 24px; }

/* Toasts (aria-live region, top right) */
.lr-toasts { position: fixed; top: 72px; right: 24px; z-index: 120; display: flex; flex-direction: column; align-items: flex-end;
  gap: 8px; pointer-events: none; max-width: calc(100vw - 32px); }
.lr-toast { display: flex; align-items: center; gap: 10px; padding: 10px 16px 10px 12px; border-radius: var(--r-control);
  background: var(--surface-200); border: 1px solid var(--border); box-shadow: var(--sh-toast); color: var(--ink);
  max-width: 360px; font: 700 15px/22px var(--font-body); pointer-events: auto; animation: lm-toast-in var(--m-mid) var(--m-out) both; }
.lr-toast > .icon { font-size: 20px; color: var(--good); font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 24; }
.lr-toast-good > .icon { color: var(--good); }
.lr-toast-attention > .icon { color: var(--attention); }
.lr-toast.is-leaving { animation: lm-toast-out var(--m-mid) var(--m-in) forwards; }

/* Empty states */
.lr-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; text-align: center;
  padding: 16px 8px; animation: lm-rise var(--m-slow) var(--m-out) 120ms both; }
.lr-empty > .icon { font-size: 32px; color: var(--ink-faint); }
.lr-empty-text { margin: 0; font: 700 16px/22px var(--font-body); }
.lr-empty-help { margin: 0; color: var(--ink-muted); font: 400 14px/20px var(--font-body); }

/* Skeleton loading */
.lr-skel { display: flex; flex-direction: column; gap: 12px; }
.lr-skel-bar { height: 12px; border-radius: var(--r-xs); background: linear-gradient(90deg, var(--surface-300) 0%,
  var(--border) 50%, var(--surface-300) 100%); background-size: 200% 100%; animation: lm-shimmer 1.2s linear infinite; }
.lr-skel-bar.is-title { height: 18px; width: 45%; }
.lr-skel-bar.is-number { height: 34px; width: 60%; }
.lr-skel-bar.is-short { width: 70%; }

/* Avatars, progress, tooltips */
.lr-avatar { width: 32px; height: 32px; flex: none; border-radius: var(--r-pill); display: inline-grid; place-items: center;
  background: color-mix(in srgb, var(--brand) 22%, var(--surface-300)); color: var(--ink); font: 700 13px/1 var(--font-body); }
.lr-progress { height: 6px; border-radius: var(--r-pill); background: var(--surface-300); overflow: hidden; }
.lr-progress > span { display: block; height: 100%; background: var(--brand); border-radius: var(--r-pill); }

/* Guided tip */
.lr-tip { display: flex; align-items: flex-start; gap: 10px; margin: 0 0 24px; padding: 12px 16px; border-radius: var(--r-control);
  background: var(--brand-soft); border: 1px solid var(--brand-line); animation: lm-rise var(--m-mid) var(--m-out) both; }
.lr-tip > .icon { color: var(--brand); font-size: 20px; margin-top: 2px; }
.lr-tip-body { flex: 1; min-width: 0; }
.lr-tip-actions { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.lr-tip-actions form { margin: 0; }
.lr-tip[hidden] { display: none; }

/* Forms (Phase 2 class, kept) */
.form { display: flex; flex-direction: column; gap: 8px; margin: 16px 0; }
.lr-form { display: flex; flex-direction: column; gap: 16px; max-width: 560px; }
.lr-setup { max-width: 880px; }
.lr-form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 8px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 24px; }

/* Option cards (radio tiles) */
.lr-options { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; border: 0; padding: 0; margin: 0; }
.lr-option { position: relative; display: flex; gap: 12px; align-items: flex-start; min-height: 76px; padding: 12px 14px;
  border-radius: var(--r-lg); border: 1.5px solid var(--border-strong); background: var(--surface-200); cursor: pointer;
  transition: border-color var(--m-fast) var(--m-out), background-color var(--m-fast) var(--m-out); }
.lr-option:hover { background: var(--surface-300); }
.lr-option input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.lr-option-mark { flex: none; width: 22px; height: 22px; margin-top: 2px; border-radius: 50%; border: 2px solid var(--border-strong);
  display: grid; place-items: center; }
.lr-option-mark::after { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--brand); transform: scale(0);
  transition: transform var(--m-mid) var(--m-out); }
.lr-option input:checked ~ .lr-option-mark { border-color: var(--brand); }
.lr-option input:checked ~ .lr-option-mark::after { transform: none; }
.lr-option:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.lr-option:has(input:focus-visible) { outline: 2px solid var(--brand); outline-offset: 2px; }
.lr-option-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.lr-option-title { font: 700 15px/22px var(--font-body); }
.lr-option-desc { font: 400 13px/19px var(--font-body); color: var(--ink-muted); }
.lr-option > .icon { color: var(--ink-muted); margin-left: auto; }

/* ================================================================== 5. The app frame (DESIGN.md 3.5, 4.10, 4.11) */
.frame { display: flex; min-height: 100vh; }
/* Sidebar (DESIGN.md 4.10, Sidebar.dc.html): wordmark + collapse button, then a scrolling list - Home, Pinned, Me,
   Loudr AI, the groups - and the profile card at the bottom. Rows keep the same left padding in both widths, so
   collapsing only clips and fades the labels. */
.sidebar { position: sticky; top: 0; height: 100vh; width: var(--sidebar-w); flex: none; display: flex; flex-direction: column;
  background: var(--surface-sidebar); border-right: 1px solid var(--border); overflow: hidden;
  transition: width var(--m-sb) var(--m-inout); }
.brand { display: flex; align-items: center; gap: 8px; flex: none; padding: 20px 12px 16px 23px; min-height: 68px;
  transition: padding var(--m-sb) var(--m-inout), gap var(--m-sb) var(--m-inout); }
.brand-link { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-decoration: none; transition: opacity var(--m-fast) var(--m-out); }
.brand .lr-collapse { border: 1px solid var(--border); color: var(--ink-muted); }
/* while labels type or erase they clip; once typed they end in an ellipsis */
.sidebar.is-typing .nav-label, .sidebar.is-typing .lr-profile-name, .sidebar.is-typing .lr-profile-biz { text-overflow: clip; }
.brand .lr-collapse:hover { background: var(--surface-300); color: var(--ink); }
.nav-scroll { position: relative; flex: 1; min-height: 0; overflow-x: hidden; overflow-y: auto; padding: 4px 12px 24px;
  display: flex; flex-direction: column; gap: 14px; scrollbar-width: none; }
.nav-scroll::-webkit-scrollbar { display: none; }
.nav-hl { position: absolute; top: 0; left: 0; width: 0; height: 0; z-index: 0; opacity: 0; pointer-events: none;
  border-radius: var(--r-control); background: color-mix(in srgb, var(--tone, var(--brand)) 28%, transparent); }
.nav-hl.is-hover, .nav-hl.is-plain { background: var(--surface-300); }
.nav-hl.is-hover.is-in-group { background: color-mix(in srgb, var(--surface-300) 75%, transparent); }
/* while the sidebar changes width the pill follows its row every frame instead of easing behind it */
.nav-hl.is-ready.is-tracking { transition: opacity var(--m-fast) var(--m-out), background-color var(--m-mid) var(--m-out); }
.nav-hl.is-on { opacity: 1; }
.nav-hl.is-ready { transition: transform var(--m-mid) var(--m-out), height var(--m-mid) var(--m-out),
  opacity var(--m-fast) var(--m-out), background-color var(--m-fast) var(--m-out); }
.nav-item { position: relative; z-index: 1; display: flex; align-items: center; }
.nav-item.is-dragging { opacity: 0.5; }
.nav-row { position: relative; flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; min-height: 42px;
  padding: 7px 11px; margin: 0; border: 1px solid transparent; border-radius: var(--r-control); color: var(--ink);
  text-decoration: none; font: 400 15px/24px var(--font-body); white-space: nowrap; cursor: pointer;
  transition: background-color var(--m-fast) var(--m-out), scale var(--m-fast) var(--m-out), padding var(--m-sb) var(--m-inout),
    margin var(--m-sb) var(--m-inout); }
.nav-row .icon { font-size: 22px; color: var(--ink-muted); transition: transform var(--m-fast) var(--m-out); }
.nav-row:not(.is-active):hover > .icon:first-child { transform: translateX(calc(2px * var(--m-k))); }
.nav-group-body .nav-row { min-height: 40px; border: 0; }
.nav-row:hover { background: var(--surface-300); }
.nav-row.is-active { background: color-mix(in srgb, var(--tone, var(--brand)) 28%, transparent); font-weight: 600; }
.nav-row.is-active .icon { color: var(--ink); }
.nav-group-body .nav-row:hover { background: color-mix(in srgb, var(--surface-300) 75%, transparent); }
/* Home has no tone (Sidebar.dc.html tintAttr default): its active fill is the neutral surface, never the gold tint */
.nav-row.is-plain.is-active { background: var(--surface-300); }
.nav-row.is-plain.is-active .icon { color: var(--ink); }
html.has-pill .nav-row.is-active { background: transparent; }
.nav-row:active { scale: calc(1 - 0.02 * var(--m-k)); }
.nav-button { width: 100%; border: 0; background: none; cursor: pointer; text-align: left; }
.nav-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; transition: opacity var(--m-fast) var(--m-out); }
.nav-badge { flex: none; }
/* Phase 4 plans: a tool the business's plan doesn't open - still listed, dimmed, with a lock */
.nav-row .nav-lock { flex: none; font-size: 16px; color: var(--ink-faint); }
.nav-row.is-locked .nav-label { color: var(--ink-muted); }
.lr-account-banner { margin-bottom: 16px; }
.lr-account-downloads { margin-top: 24px; }
.lr-link-list { list-style: none; margin: 8px 0 16px; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.lr-link-list a { display: inline-flex; align-items: center; gap: 8px; }
.nav-dot { display: none; position: absolute; top: 5px; left: 26px; width: 8px; height: 8px; border-radius: var(--r-pill);
  background: var(--attention); box-shadow: 0 0 0 2px var(--surface-sidebar); }
.nav-pin { position: absolute; right: 8px; margin: 0; opacity: 0; transition: opacity var(--m-fast) var(--m-out); }
.nav-item:hover .nav-pin, .nav-pin:focus-within, .nav-item.is-pin .nav-pin { opacity: 1; }
.nav-item.is-pin .nav-pin { opacity: 0; }
.nav-item.is-pin:hover .nav-pin, .nav-item.is-pin .nav-pin:focus-within { opacity: 1; }
.nav-pin-btn { width: 28px; height: 28px; display: grid; place-items: center; border: 0; border-radius: var(--r-sm);
  background: transparent; color: var(--ink-muted); cursor: pointer; transition: transform var(--m-fast) var(--m-out); }
.nav-pin-btn .icon { font-size: 18px; }
.nav-pin-btn:hover { background: var(--border); color: var(--ink); transform: rotate(calc(-20deg * var(--m-k))); }
.nav-pin-btn.is-on .icon { font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 24; color: var(--ink); }
.nav-item:hover .nav-row, .nav-item:focus-within .nav-row { padding-right: 40px; }
.nav-block { display: flex; flex-direction: column; gap: 4px; }
.nav-caption { position: relative; display: flex; align-items: center; gap: 8px; height: 28px; margin: 0; padding: 6px 12px;
  overflow: hidden; font: 600 12px/16px var(--font-body); letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-muted);
  white-space: nowrap; transition: height var(--m-sb) var(--m-inout), padding var(--m-sb) var(--m-inout); flex: none; }
.nav-caption .icon { font-size: 14px; transition: opacity var(--m-fast) var(--m-out); }
/* Sidebar.dc.html PinnedSection: the pin sits in a 6px slot, so PINNED lines up with the row labels' left edge */
.nav-pins > .nav-caption .icon { width: 6px; display: flex; justify-content: center; overflow: visible; }
.nav-caption::after { content: ""; position: absolute; left: 12px; right: 12px; top: 4px; height: 1px; background: var(--divider);
  opacity: 0; transition: opacity var(--m-mid) var(--m-out); }
/* the hairline between two groups, shown only while collapsed (SidebarGroup.dc.html div) */
.nav-group { transition: margin var(--m-sb) var(--m-inout); }
.nav-group + .nav-group > .nav-group-head::before { content: ""; position: absolute; left: 10px; right: 10px; top: -9px;
  height: 1px; background: var(--divider); opacity: 0; pointer-events: none; transition: opacity var(--m-sb) var(--m-inout); }
.nav-pin-list { display: flex; flex-direction: column; gap: 4px; }
.nav-pin-empty { margin: 0 4px; padding: 12px; border-radius: var(--r-control); border: 1px dashed var(--border);
  font: 400 14px/20px var(--font-body); color: var(--ink-muted); }
.nav-divider { height: 1px; flex: none; margin: 6px 8px; background: var(--divider); }
/* Loudr AI (built last): the row, its switch drawn off, and a note that opens under it */
.nav-ai { position: relative; z-index: 1; }
.nav-ai-row { list-style: none; border: 1px dashed var(--border); color: var(--ink-muted); }
.nav-ai-row::-webkit-details-marker { display: none; }
.nav-ai-row .icon { color: var(--ink-muted); }
.nav-ai-switch { transition: opacity var(--m-fast) var(--m-out); }
.nav-ai-switch { position: relative; flex: none; width: 36px; height: 20px; border-radius: var(--r-pill); background: var(--surface-300);
  border: 1px solid var(--border-strong); }
.nav-ai-switch::before { content: ""; position: absolute; top: 1px; left: 1px; width: 16px; height: 16px; border-radius: 50%;
  background: var(--ink-muted); }
.nav-ai-note { margin: 4px 4px 0; padding: 10px 12px; border-radius: var(--r-control); background: var(--ai-soft);
  border: 1px solid var(--ai-line); font: 400 13px/19px var(--font-body); color: var(--ink); white-space: normal; }
/* groups: tone tile + tracked caps + chevron; the body opens with grid-template-rows 0fr -> 1fr */
.nav-group { position: relative; z-index: 1; }
.nav-group + .nav-group { margin-top: 6px; }
/* a 44px target (owner's choice: taps >= 44px) drawn as the design's 36px row: 4px of it overlaps the 20px gaps */
.nav-group-head { position: relative; list-style: none; display: flex; align-items: flex-start; gap: 10px; height: 44px;
  min-height: 44px; padding: 10px 12px 10px 11px; margin: -4px 0; border-radius: var(--r-control); cursor: pointer; user-select: none; color: var(--ink-muted);
  font: 600 12px/16px var(--font-body); letter-spacing: 0.08em; text-transform: uppercase; white-space: nowrap;
  transition: height var(--m-sb) var(--m-inout), margin var(--m-sb) var(--m-inout), padding var(--m-sb) var(--m-inout),
    background-color var(--m-fast) var(--m-out), scale var(--m-fast) var(--m-out); }
.nav-group-head::-webkit-details-marker { display: none; }
.nav-group-head > .nav-label { align-self: center; padding-right: 24px; transition: color var(--m-fast) var(--m-out), opacity var(--m-fast) var(--m-out); }
.nav-group-head:hover > .nav-label, .nav-group[data-current]:not([open]) > .nav-group-head > .nav-label {
  color: color-mix(in srgb, var(--ink) 55%, var(--ink-muted)); }
.nav-group-tile { position: relative; width: 24px; height: 24px; flex: none; display: grid; place-items: center; border-radius: var(--r-sm);
  background: color-mix(in srgb, var(--tone) 18%, transparent); color: var(--tone);
  transition: width var(--m-sb) var(--m-inout), height var(--m-sb) var(--m-inout), border-radius var(--m-sb) var(--m-inout),
    box-shadow var(--m-mid) var(--m-out), transform var(--m-fast) var(--m-out); }
.nav-group-head:hover .nav-group-tile { transform: scale(var(--m-icon)); }
/* the current page's group: a ring while it is closed (SidebarGroup.dc.html), and its dot always (owner's choice) */
.nav-group[data-current]:not([open]) > .nav-group-head .nav-group-tile { box-shadow: 0 0 0 1.5px var(--tone); }
.nav-group[data-current] > .nav-group-head .nav-group-tile::after { content: ""; position: absolute; top: -3px; right: -3px;
  width: 8px; height: 8px; border-radius: var(--r-pill); background: var(--tone); box-shadow: 0 0 0 2px var(--surface-sidebar);
  animation: lm-badge var(--m-mid) var(--m-pop) both; }
.nav-group-tile .icon { font-size: 17px; line-height: 1; transition: font-size var(--m-sb) var(--m-inout); }
/* SidebarGroup.dc.html: the chevron points right (>) while closed and turns down when open; it glides under the tile
   when the sidebar collapses */
.nav-chevron { position: absolute; right: 12px; top: 13px; width: 16px; height: 18px; display: grid; place-items: center;
  font-size: 18px; line-height: 1; color: inherit; transform: rotate(-90deg);
  transition: right var(--m-sb) var(--m-inout), top var(--m-sb) var(--m-inout), height var(--m-sb) var(--m-inout),
    font-size var(--m-sb) var(--m-inout), transform var(--m-mid) var(--m-out), color var(--m-fast) var(--m-out); }
.nav-group-head:hover .nav-chevron, .nav-group[data-current]:not([open]) .nav-chevron { color: color-mix(in srgb, var(--ink) 55%, var(--ink-muted)); }
.nav-group[open] > .nav-group-head .nav-chevron { transform: rotate(0deg); }
.nav-group-body { display: flex; flex-direction: column; gap: 2px; margin-top: 4px; padding: 4px; border-radius: var(--r-lg);
  background: color-mix(in srgb, var(--tone) 10%, transparent); }
.nav-section { height: 29px; padding: 8px 12px 2px; overflow: hidden; white-space: nowrap; color: var(--ink-muted);
  font: 600 13px/19px var(--font-body); transition: height var(--m-sb) var(--m-inout), padding var(--m-sb) var(--m-inout); }
/* the profile card, and its menu opening upward */
.nav-foot { flex: none; padding: 8px 12px 12px; border-top: 1px solid var(--divider); }
.nav-foot form { margin: 0; }
.nav-sheet-head { display: none; }
.lr-profile { position: relative; }
.lr-profile > summary { list-style: none; display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 8px; margin: 0;
  border-radius: var(--r-lg); cursor: pointer; transition: background-color var(--m-fast) var(--m-out), scale var(--m-fast) var(--m-out),
    min-height var(--m-sb) var(--m-inout), padding var(--m-sb) var(--m-inout), margin var(--m-sb) var(--m-inout),
    border-radius var(--m-sb) var(--m-inout); }
.lr-profile > summary::-webkit-details-marker { display: none; }
.lr-profile > summary:hover, .lr-profile[open] > summary { background: var(--surface-300); }
.lr-profile .lr-avatar { width: 36px; height: 36px; background: var(--surface-300); border: 1px solid var(--border);
  font: 500 13px/20px var(--font-mono); }
.lr-profile-text { display: flex; flex-direction: column; white-space: nowrap; }
.lr-profile-name { overflow: hidden; text-overflow: ellipsis; font: 700 15px/22px var(--font-body); color: var(--ink); }
.lr-profile-biz { overflow: hidden; text-overflow: ellipsis; font: 400 13px/19px var(--font-body); color: var(--ink-muted); }
.lr-profile-chev { font-size: 20px; color: var(--ink-muted); transition: transform var(--m-mid) var(--m-out), opacity var(--m-fast) var(--m-out); }
.lr-profile[open] .lr-profile-chev { transform: rotate(180deg); }
/* Sidebar.dc.html ProfileMenu: exactly as wide as the sidebar's rows (232px at the full width), compact 32px rows */
.lr-popover { position: absolute; left: 0; bottom: calc(100% + 8px); z-index: 85; width: 100%; min-width: 232px; max-width: calc(100vw - 32px);
  max-height: calc(100vh - 96px); overflow: auto; padding: 4px; border-radius: var(--r-control); background: var(--surface-200);
  border: 1px solid var(--border); box-shadow: 0 12px 32px var(--shadow-color-strong), 0 1px 3px var(--shadow-color);
  display: flex; flex-direction: column; gap: 0; transform-origin: bottom left;
  animation: lm-menu-in 150ms var(--m-out) both; }
.lr-profile.is-closing .lr-popover { animation: lm-menu-out var(--m-exit) var(--m-in) forwards; }
.lr-profile.is-side .lr-popover { position: fixed; width: 232px; animation-name: lm-menu-in-side; }
.lr-profile.is-side.is-closing .lr-popover { animation-name: lm-menu-out-side; }
@keyframes lm-menu-in { from { opacity: 0; transform: translateY(calc(4px * var(--m-k))) scale(calc(1 - 0.02 * var(--m-k))); } }
@keyframes lm-menu-out { to { opacity: 0; transform: translateY(calc(4px * var(--m-k))) scale(calc(1 - 0.02 * var(--m-k))); } }
@keyframes lm-menu-in-side { from { opacity: 0; transform: translateX(calc(-4px * var(--m-k))) scale(var(--m-settle)); } }
@keyframes lm-menu-out-side { to { opacity: 0; transform: translateX(calc(-4px * var(--m-k))) scale(var(--m-settle)); } }
/* the collapsed rail's tooltip (Sidebar.dc.html tip): beside the rail, after 300 ms */
.lr-nav-tip { position: fixed; z-index: 80; display: none; pointer-events: none; padding: 6px 12px; border-radius: var(--r-sm);
  background: var(--surface-200); border: 1px solid var(--border-strong); box-shadow: 0 8px 24px var(--shadow-color-strong);
  font: 700 14px/20px var(--font-body); color: var(--ink); white-space: nowrap; transform: translateY(-50%); }
.lr-nav-tip.is-on { display: block; animation: lm-tip var(--m-fast) var(--m-out) var(--m-tip-delay) both; }
/* the sidebar's overlay scrollbar (loudr.js initNavScrollbar) */
.nav-sb { position: absolute; right: 2px; top: 0; width: 10px; z-index: 5; pointer-events: none; }
.nav-sb[hidden] { display: none; }
.nav-sb-thumb { position: absolute; right: 0; top: 0; width: 10px; display: flex; justify-content: flex-end; padding: 0 2px;
  cursor: grab; opacity: 0; pointer-events: none; transition: opacity var(--m-mid) var(--m-out); }
.nav-sb-thumb::before { content: ""; width: 4px; height: 100%; border-radius: var(--r-pill);
  background: color-mix(in srgb, var(--ink-muted) 45%, transparent); transition: width var(--m-fast) var(--m-out); }
.nav-sb.is-on .nav-sb-thumb { opacity: 1; pointer-events: auto; }
.nav-sb.is-hot .nav-sb-thumb::before { width: 6px; }
.lr-popover-head { padding: 8px 10px 6px; }
.lr-popover-head strong, .lr-popover-sub { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lr-popover-head strong { font: 700 14px/20px var(--font-body); }
.lr-popover-sub { font: 400 13px/18px var(--font-body); color: var(--ink-muted); }
.lr-menu-item { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 32px; padding: 4px 10px; border: 0;
  border-radius: var(--r-sm); background: transparent; color: var(--ink); text-decoration: none; cursor: pointer; text-align: left;
  font: 400 14px/20px var(--font-body); transition: background-color var(--m-fast) var(--m-out); }
.lr-menu-item .icon { font-size: 18px; color: var(--ink-muted); }
.lr-menu-item:hover { background: var(--surface-300); }
.lr-menu-item.is-active { font-weight: 700; }
.lr-menu-item.is-inert { cursor: default; } .lr-menu-item.is-inert:hover { background: transparent; }
.lr-menu-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lr-menu-meta { flex: none; font: 500 11px/16px var(--font-mono); color: var(--ink-muted); }
.lr-menu-meta.is-attention { color: var(--attention); } .lr-menu-meta.is-danger { color: var(--danger); }
@media (pointer: coarse) { .lr-menu-item { min-height: 44px; } }
@media (pointer: coarse) { .nav-row, .nav-group-body .nav-row { min-height: 44px; } }   /* sidebar rows on touch screens */   /* a finger still gets a 44px target */
:root[data-theme="light"] .lr-menu-item .lr-theme-moon, :root:not([data-theme="light"]) .lr-menu-item .lr-theme-sun { display: none; }
.lr-menu-sep { height: 1px; background: var(--divider); margin: 4px 6px; }
.lr-menu-caption { padding: 6px 10px 2px; font: 600 12px/16px var(--font-body); letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--ink-muted); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 16px; min-height: 64px; padding: 12px 40px;
  background: var(--surface-100); border-bottom: 1px solid var(--border); }
/* the crumb: "SAT 26 SEP  .  MONEY · INVOICE TRACKER" in mono caps */
.lr-crumb { flex: 1 1 200px; min-width: 0; display: flex; align-items: center; gap: 8px; white-space: nowrap; overflow: hidden; }
.lr-crumb-date { flex: none; font: 500 11px/16px var(--font-mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-muted); }
.lr-crumb-dot { width: 4px; height: 4px; flex: none; border-radius: var(--r-pill); background: var(--border-strong); }
.lr-crumb .eyebrow { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); }
.lr-top-actions { flex: none; display: flex; align-items: center; gap: 16px; }
.lr-top-actions form { margin: 0; }
.lr-bell .icon { transform-origin: 50% 12%; }
.lr-bell:hover .icon { animation: lm-wiggle 400ms var(--m-out); }
.lr-search-icon { display: none; }
/* "Find an app": the field on the right, results in a popover under it */
.topbar .lr-search { position: relative; flex: 0 1000 280px; min-width: 160px; max-width: none; margin: 0; padding: 0 16px; }
.lr-search-pop { position: absolute; top: 50px; right: 0; z-index: 40; width: min(380px, calc(100vw - 32px)); max-height: 420px;
  overflow: auto; padding: 8px; border-radius: var(--r-panel); background: var(--surface-200); border: 1px solid var(--border);
  box-shadow: var(--sh-popover); display: flex; flex-direction: column; gap: 2px; transform-origin: top right;
  animation: lm-scale-in 150ms var(--m-out) both; }
.lr-search-pop[hidden] { display: none; }
.lr-search-list { display: flex; flex-direction: column; gap: 2px; }
.lr-search-list-page { margin-top: 16px; max-width: 560px; }
.lr-search-page { max-width: 560px; }
.lr-search-hit { display: flex; align-items: center; gap: 16px; padding: 12px; border-radius: var(--r-control); color: var(--ink);
  text-decoration: none; transition: background-color var(--m-fast) var(--m-out); }
.lr-search-hit[hidden] { display: none; }
.lr-search-hit > .icon { color: var(--ink-muted); }
.lr-search-hit:hover, .lr-search-hit:focus-visible { background: var(--surface-300); }
.lr-search-hit-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.lr-search-hit-text strong { font: 700 15px/24px var(--font-body); }
.lr-search-hit-text span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 400 13px/19px var(--font-body);
  color: var(--ink-muted); }
.lr-search-none { display: flex; flex-direction: column; gap: 4px; padding: 16px 12px; }
.lr-search-none[hidden] { display: none; }
.lr-search-none strong { font: 700 15px/24px var(--font-body); }
.lr-search-none span { font: 400 13px/19px var(--font-body); color: var(--ink-muted); }

/* The theme button: moon in dark, sun in light; after a switch the new one slides in (motion.js carousel). */
.lr-theme-form { margin: 0; display: inline-flex; }
.lr-theme-btn { overflow: hidden; }
.lr-theme-btn .icon { position: absolute; transition: opacity var(--m-fast) var(--m-out); }
:root[data-theme="light"] .lr-theme-moon, :root:not([data-theme="light"]) .lr-theme-sun { opacity: 0; }
html.theme-turn:not([data-theme="light"]) .lr-theme-moon, html.theme-turn[data-theme="light"] .lr-theme-sun {
  animation: lm-car-in var(--m-slow) var(--m-inout) both; }
html.theme-turn:not([data-theme="light"]) .lr-theme-sun, html.theme-turn[data-theme="light"] .lr-theme-moon {
  animation: lm-car-out var(--m-slow) var(--m-inout) both; }
@keyframes lm-car-in { 0% { opacity: 0; transform: translateX(calc(24px * var(--m-k))); }
  82% { opacity: 1; transform: translateX(calc(-1.5px * var(--m-k))); } 100% { opacity: 1; transform: none; } }
@keyframes lm-car-out { from { opacity: 1; transform: none; } to { opacity: 0; transform: translateX(calc(-24px * var(--m-k))); } }

.content { flex: 1; padding: 32px 40px 64px; min-width: 0; }
.content-inner { outline: none; }
.lr-page-head { display: flex; flex-direction: column; gap: 8px; margin-bottom: 32px; }
.solo { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px;
  padding: 40px 16px; }

/* bottom nav: phones only */
.lr-bottom-nav { display: none; }

/* Collapsed sidebar (70 px, Sidebar.dc.html collapsed): icons only. With script the labels erase letter by letter
   (loudr.js typing clock) and a tooltip names each row; without it they fade. Badges become dots. Desktop only:
   tablets start collapsed (section 8) and phones use the bottom nav and the sheet. */
@media (min-width: 1024px) {
  html.sidebar-collapsed .sidebar { width: var(--sidebar-w-collapsed); }
  html.sidebar-collapsed .sidebar .brand { padding: 20px 19px 16px; gap: 0; }
  html.sidebar-collapsed .sidebar .brand-link { flex: 0 0 0; pointer-events: none; }
  html.sidebar-collapsed .sidebar .nav-row { padding: 7px 8px; margin: 0 3px; }
  html.sidebar-collapsed .sidebar .nav-group-body .nav-row { padding: 7px 8px; margin: 0 -1px; }
  html.sidebar-collapsed .sidebar .nav-section { height: 0; padding: 0 12px; }
  html.sidebar-collapsed .sidebar .nav-caption { height: 9px; padding-top: 0; padding-bottom: 0; }
  html.sidebar-collapsed .sidebar .nav-caption .icon { opacity: 0; }
  html.sidebar-collapsed .sidebar .nav-caption::after { opacity: 1; }
  html.sidebar-collapsed .sidebar .nav-group + .nav-group { margin-top: 3px; }
  html.sidebar-collapsed .sidebar .nav-group + .nav-group > .nav-group-head::before { opacity: 1; }
  html.sidebar-collapsed .sidebar .nav-group-head { height: 58px; margin: 0 1px; padding: 7px; }
  html.sidebar-collapsed .sidebar .nav-group-head:hover { background: var(--surface-300); }
  html.sidebar-collapsed .sidebar .nav-group-tile { width: 30px; height: 30px; border-radius: 9px; }
  html.sidebar-collapsed .sidebar .nav-group-tile .icon { font-size: 20px; }
  html.sidebar-collapsed .sidebar .nav-chevron { right: 14px; top: 39px; height: 12px; font-size: 16px; color: var(--ink-muted); }
  html.sidebar-collapsed .sidebar .nav-group-body { margin-top: 6px; }
  html.sidebar-collapsed .sidebar .nav-badge { opacity: 0; }
  html.sidebar-collapsed .sidebar .nav-dot { display: block; }
  html.sidebar-collapsed .sidebar .nav-lock, html.sidebar-collapsed .sidebar .nav-pin, html.sidebar-collapsed .sidebar .nav-pin-empty, html.sidebar-collapsed .sidebar .nav-ai-note { display: none; }
  html.sidebar-collapsed .sidebar .nav-ai-switch { opacity: 0; pointer-events: none; }
  html.sidebar-collapsed .sidebar .lr-profile > summary { min-height: 44px; padding: 4px; margin: 0 1px; border-radius: var(--r-control); }
  html.sidebar-collapsed .sidebar .lr-profile-chev { opacity: 0; }
  html.sidebar-collapsed:not(.has-typing) .sidebar .nav-label, html.sidebar-collapsed:not(.has-typing) .sidebar .brand-link { opacity: 0; }
}

/* ================================================================== 6. Home (RoleHome.dc.html) */
.lr-home { display: flex; flex-direction: column; gap: 32px; }
.lr-greeting { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.lr-greeting-text { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.lr-greeting-date { margin: 0; font: 500 12px/16px var(--font-mono); letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--ink-muted); }
.lr-greeting .lr-display { margin: 0; }
.lr-greeting-actions { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.lr-greeting-actions form { margin: 0; }
.lr-customize .icon { color: var(--ink-muted); }
.lr-typed-caret { display: inline-block; width: 2px; height: 0.86em; margin-left: 3px; vertical-align: -0.06em; border-radius: 1px;
  background: var(--ink); }
.lr-customize-help { display: flex; align-items: center; gap: 12px; margin: -8px 0 0; padding: 12px 16px; border-radius: var(--r-control);
  background: var(--surface-200); border: 1px dashed var(--border-strong); font: 400 15px/22px var(--font-body); }
.lr-customize-help .icon { color: var(--ink-muted); font-size: 20px; }
.lr-section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin: 0 0 16px; }
.lr-section-head h2 { margin: 0; }
/* the first-run setup banner (a brand-soft banner, like the design's view-as bar) */
.lr-banner-card { display: flex; align-items: center; flex-wrap: wrap; gap: 16px 20px; padding: 16px 20px; border-radius: var(--r-panel);
  background: var(--brand-soft); border: 1px solid var(--brand-line); animation: lm-rise var(--m-mid) var(--m-out) both; }
.lr-banner-card-icon { width: 44px; height: 44px; flex: none; display: grid; place-items: center; border-radius: var(--r-control);
  background: var(--surface-200); border: 1px solid var(--brand-line); color: var(--brand); }
.lr-banner-card .lr-card-text { flex: 1; min-width: 220px; display: flex; flex-direction: column; gap: 2px; }
.lr-banner-card .lr-card-text p { margin: 0; }
.lr-home-empty { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 56px 24px; border-radius: var(--r-widget);
  background: var(--surface-200); border: 1px dashed var(--border-strong); text-align: center;
  animation: lm-rise var(--m-slow) var(--m-out) 120ms both; }
.lr-home-empty > .icon { font-size: 32px; color: var(--ink-faint); }
.lr-home-empty p { margin: 0; }
.lr-inline-form { margin: 0; display: inline-flex; }
.lr-link-button { border: 0; background: none; padding: 0; min-height: 44px; cursor: pointer; list-style: none;
  font: 700 14px/20px var(--font-body); color: var(--ink-muted); text-decoration: underline; text-underline-offset: 3px; }
.lr-link-button::-webkit-details-marker { display: none; }
.lr-link-button:hover { color: var(--ink); }

/* widget bodies (WidgetCard.dc.html and the widget DCs) */
.lr-widget-head a.lr-widget-open { text-decoration: none; }
.lr-widget-head a.lr-widget-open:hover { color: var(--ink); }
section.lr-widget { min-width: 0; }
/* Loudr AI, off (AIBriefingWidget.dc.html "off") */
.lr-ai-off { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; padding: 20px; border-radius: var(--r-lg);
  background: var(--ai-soft); border: 1px solid var(--ai-line); }
.lr-ai-off-icon { width: 52px; height: 52px; flex: none; display: grid; place-items: center; border-radius: var(--r-lg);
  background: var(--surface-200); border: 1px solid var(--ai-line); color: var(--ai); }
.lr-ai-off-icon .icon { font-size: 28px; }
.lr-ai-off-text { flex: 1; min-width: min(260px, 100%); display: flex; flex-direction: column; gap: 4px; }
.lr-ai-off-text strong { font: 700 18px/26px var(--font-body); }
.lr-ai-off-text > span:not(.lr-help) { font: 400 15px/23px var(--font-body); }
.lr-ai-off-actions { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
/* "Turn on Loudr AI": the design's gold button at full strength (not the dimmed disabled look), with a lock hint */
.lr-btn.lr-ai-on, .lr-btn.lr-ai-on[disabled] { min-height: 48px; padding: 0 22px; border-radius: 14px; opacity: 1;
  background: var(--brand); color: var(--on-brand); box-shadow: 0 0 0 4px var(--brand-glow); font: 700 16px/24px var(--font-body); }
.lr-btn.lr-ai-on[disabled] { cursor: not-allowed; }
.lr-ai-soon { display: inline-flex; align-items: center; gap: 4px; font: 500 12px/16px var(--font-mono); letter-spacing: 0.04em;
  text-transform: uppercase; color: var(--ink-muted); }
.lr-ai-soon .icon { font-size: 16px; }
/* Business Overview: four stat tiles */
.lr-overview { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(190px, 100%), 1fr)); gap: 12px; }
.lr-stat-link { border: 1px solid var(--border); color: var(--ink); text-decoration: none;
  transition: background-color var(--m-fast) var(--m-out), scale var(--m-fast) var(--m-out); }
.lr-stat-link:hover { background: var(--surface-300); }
.lr-stat-link:active { scale: calc(1 - 0.02 * var(--m-k)); }
.lr-stat-link.is-flag { border-color: var(--attention-line); }
.lr-stat-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.lr-stat-top .icon { font-size: 18px; color: var(--ink-faint); }
.lr-stat-note { display: flex; align-items: center; gap: 6px; font: 400 14px/20px var(--font-body); color: var(--ink-muted); }
.lr-flag-dot { width: 7px; height: 7px; flex: none; border-radius: var(--r-pill); background: var(--attention); }
/* Home widgets with data (round 2: SalesReports / TaskManager / InvoiceTracker / EmployeeScheduler widgets) */
.lr-widget-sub { margin-top: -6px; font: 500 12px/16px var(--font-mono); letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--ink-muted); }
.lr-w-sales, .lr-w-tasks, .lr-w-invoices { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.lr-w-invoices { gap: 16px; }
.lr-w-row { display: flex; align-items: flex-end; gap: 24px; flex-wrap: wrap; }
.lr-w-between { justify-content: space-between; gap: 12px; }
.lr-w-figure { display: flex; flex-direction: column; gap: 2px; }
.lr-w-caps { font: 500 12px/16px var(--font-mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-muted); }
.lr-w-big { font: 500 32px/38px var(--font-mono); font-variant-numeric: tabular-nums; color: var(--ink); }
.lr-w-mid { font: 500 20px/28px var(--font-mono); font-variant-numeric: tabular-nums; color: var(--ink); }
.lr-w-line { display: flex; align-items: baseline; gap: 10px; font: 400 15px/22px var(--font-body); color: var(--ink); }
.lr-w-muted { font: 400 14px/20px var(--font-body); color: var(--ink-muted); }
.lr-w-mono { font: 500 13px/18px var(--font-mono); color: var(--ink-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lr-w-pill { align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: var(--r-pill);
  --dot: var(--ink-muted); background: color-mix(in srgb, var(--dot) 12%, transparent); font: 700 13px/20px var(--font-body); color: var(--ink); }
.lr-w-row > .lr-w-pill { margin-bottom: 4px; }
.lr-w-pill .icon { font-size: 16px; color: var(--dot); }
.lr-dot { display: inline-block; width: 7px; height: 7px; flex: none; border-radius: var(--r-pill); background: var(--dot, var(--ink-muted)); }
.is-good { --dot: var(--good); } .is-attention { --dot: var(--attention); } .is-danger { --dot: var(--danger); }
.is-ink-muted { --dot: var(--ink-muted); } .is-ink-faint { --dot: var(--ink-faint); }
.lr-w-chart { display: flex; flex-direction: column; gap: 6px; }
.lr-chart { display: block; width: 100%; height: 64px; overflow: visible; }
.lr-chart-last { stroke: var(--ink-faint); stroke-width: 1.5; stroke-dasharray: 4 4; stroke-linecap: round; stroke-linejoin: round;
  animation: lm-fade var(--m-slow) var(--m-out) 150ms both; }
/* the line draws itself left to right (a clip wipe: a dash trick breaks on a stretched, non-scaling stroke) */
.lr-chart-this { stroke: var(--ink); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round;
  animation: lm-wipe 700ms var(--m-out) 250ms both; }
.lr-chart-dot { stroke: var(--ink); stroke-width: 9; stroke-linecap: round; animation: lm-fade var(--m-mid) var(--m-out) 900ms both; }
@keyframes lm-wipe { from { clip-path: inset(-8px 100% -8px 0); } to { clip-path: inset(-8px 0 -8px 0); } }
.lr-chart-key { display: flex; gap: 16px; font: 400 13px/18px var(--font-body); color: var(--ink-muted); }
.lr-chart-key > span { display: inline-flex; align-items: center; gap: 6px; }
.lr-key-this { width: 14px; height: 2.5px; border-radius: 2px; background: var(--ink); }
.lr-key-last { width: 14px; height: 0; border-top: 1.5px dashed var(--ink-faint); }
.lr-w-foot { display: flex; align-items: center; gap: 10px; padding-top: 12px; border-top: 1px solid var(--border);
  font: 400 15px/22px var(--font-body); color: var(--ink); }
.lr-w-foot .icon { font-size: 18px; color: var(--ink-muted); }
.lr-w-progress { display: flex; flex-direction: column; gap: 6px; }
.lr-bar { display: block; width: 100%; height: 8px; border-radius: var(--r-pill); overflow: hidden; }
.lr-bar-track { fill: var(--surface-300); } .lr-bar-fill { fill: var(--good); }
.lr-w-list { display: flex; flex-direction: column; }
.lr-w-item { display: flex; flex-direction: column; gap: 2px; padding: 10px 0; border-top: 1px solid var(--border); }
.lr-w-item-top { display: flex; align-items: center; gap: 8px; }
.lr-w-who { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 400 15px/22px var(--font-body); }
.lr-w-state { display: inline-flex; align-items: center; gap: 5px; flex: none; font: 700 13px/20px var(--font-body); }
.lr-w-person { display: flex; align-items: center; gap: 12px; padding: 9px 0; border-top: 1px solid var(--border); }
.lr-w-avatar { position: relative; width: 32px; height: 32px; flex: none; display: grid; place-items: center; border-radius: var(--r-pill);
  background: var(--surface-300); font: 500 12px/16px var(--font-mono); color: var(--ink); }
.lr-w-avatar .lr-dot { position: absolute; right: -1px; bottom: -1px; width: 10px; height: 10px; box-shadow: 0 0 0 2px var(--surface-200); }
.lr-w-person-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.lr-w-person-text strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 700 15px/22px var(--font-body); }
/* round 3: the staff's own cards (ClockInWidget, MyTasksWidget, MyScheduleWidget, MyTipsWidget) and the manager's
   (TeamTasksWidget, RequestsWidget) */
.lr-w-clock { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.lr-w-clock-text { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.lr-w-clock-time { font: 500 36px/42px var(--font-mono); font-variant-numeric: tabular-nums; color: var(--ink); }
.lr-w-clock-where { font: 400 16px/24px var(--font-body); color: var(--ink-muted); }
.lr-w-clock-status { display: flex; align-items: center; gap: 8px; font: 700 15px/22px var(--font-body); color: var(--ink); }
.lr-dot-glow { width: 9px; height: 9px; box-shadow: 0 0 12px var(--good-glow); }
.lr-clock-btn { flex: 0 1 320px; min-width: min(220px, 100%); min-height: 72px; padding: 0 28px; display: flex; align-items: center;
  justify-content: center; gap: 12px; border-radius: 20px; background: var(--brand); border: 1px solid var(--brand);
  box-shadow: 0 0 0 4px var(--brand-glow); color: var(--on-brand); font: 700 22px/28px var(--font-body); text-decoration: none;
  transition: background-color var(--m-fast) var(--m-out), scale var(--m-fast) var(--m-out); }
.lr-clock-btn .icon { font-size: 30px; }
.lr-clock-btn:hover { background: var(--brand-hover); } .lr-clock-btn:active { scale: 0.98; }
.lr-clock-btn.is-in { background: var(--surface-300); border-color: var(--border-strong); box-shadow: none; color: var(--ink); }
.lr-clock-btn.is-in:hover { background: var(--border); }
.lr-w-mytasks, .lr-w-tips, .lr-w-team { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.lr-w-mytasks strong { color: var(--ink); }
.lr-w-checks { display: flex; flex-direction: column; gap: 6px; }
.lr-w-check { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 6px 12px; border-radius: 12px;
  background: var(--surface-100); border: 1px solid var(--border); }
.lr-w-box { width: 26px; height: 26px; flex: none; border-radius: 7px; background: var(--surface-200); border: 1.5px solid var(--border-strong); }
.lr-w-check-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 400 16px/24px var(--font-body); color: var(--ink); }
.lr-w-check-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.lr-w-prep { display: flex; align-items: center; gap: 10px; min-height: 40px; }
.lr-w-prep .lr-w-box { width: 24px; height: 24px; background: var(--surface-100); }
.lr-w-prep.is-done .lr-w-box { background: var(--good); border-color: var(--good); }
.lr-w-prep.is-done .lr-w-check-text { color: var(--ink-muted); text-decoration: line-through; }
.lr-w-week { display: flex; flex-direction: column; gap: 4px; }
.lr-w-day { display: flex; align-items: center; gap: 14px; min-height: 40px; padding: 6px 12px; border-radius: 12px; border: 1px solid transparent; }
.lr-w-day.is-today { background: var(--surface-300); border-color: var(--border-strong); }
.lr-w-day-name { width: 36px; flex: none; font: 500 12px/16px var(--font-mono); letter-spacing: 0.08em; color: var(--ink-muted); }
.lr-w-day-date { width: 24px; flex: none; font: 500 15px/22px var(--font-mono); color: var(--ink); }
.lr-w-day-time { flex: 1; min-width: 0; font: 400 15px/22px var(--font-body); color: var(--ink); }
.lr-w-day.is-today .lr-w-day-time { font-weight: 700; }
.lr-w-day-time.is-off { color: var(--ink-muted); }
.lr-w-day-today { font: 700 12px/16px var(--font-body); letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink); }
.lr-w-tips .lr-w-foot { font: 400 14px/20px var(--font-body); color: var(--ink-muted); }
.lr-w-team { gap: 14px; }
.lr-w-teamrow { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-top: 1px solid var(--border); }
.lr-w-teamrow strong { width: 40px; flex: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 700 14px/20px var(--font-body); }
.lr-bar-sm { flex: 1; height: 6px; } .lr-bar-fill.is-muted { fill: var(--ink-muted); }
.lr-w-requests .lr-w-item { padding: 12px 0; }
.lr-w-requests .lr-w-who { font-weight: 700; }
@media (prefers-reduced-motion: reduce) { .lr-chart-this { animation-name: lm-fade; } }
/* Business Alerts list */
.lr-alert-list { display: flex; flex-direction: column; gap: 4px; }
.lr-alert-row { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 8px 10px; margin: 0 -10px;
  border-radius: 12px; color: var(--ink); text-decoration: none; transition: background-color var(--m-fast) var(--m-out); }
.lr-alert-row:hover { background: var(--surface-300); }
.lr-sev { flex: none; display: inline-flex; align-items: center; gap: 6px; min-width: 84px; padding: 2px 10px; border-radius: var(--r-pill);
  --sev: var(--ink-muted); background: color-mix(in srgb, var(--sev) 12%, transparent); font: 700 12px/20px var(--font-body); }
.lr-sev-danger { --sev: var(--danger); } .lr-sev-attention { --sev: var(--attention); }
.lr-sev-dot { width: 7px; height: 7px; border-radius: var(--r-pill); background: var(--sev); }
.lr-alert-text { flex: 1; min-width: 0; font: 400 15px/22px var(--font-body); }
.lr-alert-when { flex: none; font: 500 12px/16px var(--font-mono); letter-spacing: 0.08em; color: var(--ink-muted); }
.lr-see-all { align-self: flex-start; margin-top: 6px; font: 700 14px/20px var(--font-body); color: var(--ink); }
/* Quick Actions */
.lr-quick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(120px, 100%), 1fr)); gap: 8px; align-items: start; }
.lr-quick-item { display: flex; align-items: center; gap: 8px; min-height: 48px; padding: 8px 12px; border-radius: var(--r-control);
  background: var(--surface-100); border: 1px solid var(--border); color: var(--ink); text-decoration: none;
  font: 700 15px/22px var(--font-body); transition: background-color var(--m-fast) var(--m-out), scale var(--m-fast) var(--m-out); }
.lr-quick-item:hover { background: var(--surface-300); }
.lr-quick-item:active { scale: calc(1 - 0.02 * var(--m-k)); }
.lr-quick-plus { width: 26px; height: 26px; flex: none; display: grid; place-items: center; border-radius: var(--r-sm);
  background: var(--brand-soft); color: var(--brand); }
.lr-quick-plus .icon { font-size: 18px; }
.lr-quick-edit summary { display: inline-flex; align-items: center; }
.lr-quick-form { display: flex; flex-direction: column; gap: 2px; margin-top: 8px; }
.lr-check-row { min-height: 40px; font-size: 15px; }
/* Customize: dashed cards, a grip, size chips, move and remove */
.is-customizing .lr-widget { border-style: dashed; border-color: var(--border-strong); }
.is-customizing .lr-widget-body { pointer-events: none; }
.lr-widget-grip { margin-left: -8px; color: var(--ink-muted); cursor: grab; }
.lr-widget-tools { margin-left: auto; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.lr-size-chips { display: flex; gap: 2px; padding: 2px; border-radius: var(--r-md); background: var(--surface-100); border: 1px solid var(--border); }
.lr-size-chip { min-width: 30px; height: 28px; border: 0; border-radius: var(--r-sm); background: transparent; cursor: pointer;
  font: 500 12px/16px var(--font-mono); color: var(--ink-muted); }
.lr-size-chip.is-on { background: var(--surface-300); color: var(--ink); }
.lr-widget-tools .lr-icon-btn-sm { border: 1px solid var(--border); color: var(--ink); }
.lr-widget-tools .lr-icon-btn-sm .icon { font-size: 18px; }
.lr-widget.is-drag-over { box-shadow: 0 0 0 2px var(--brand); }
.lr-widget.is-dragging { opacity: 0.5; }
/* The fluid widget grid (DESIGN.md 3.6): no max-width; columns = clamp(1, floor((width + 24) / 284), 6).
   Each card carries its row-fill span for every column count (c<columns>-<span>, loudr/core/shell.py). */
.lr-wgrid-wrap { container-type: inline-size; container-name: wgrid; }
.lr-wgrid { display: grid; gap: 24px; grid-template-columns: minmax(0,1fr); }
.lr-wgrid > * { grid-column: span 1; animation: lm-rise var(--m-mid) var(--m-out) both; }
.lr-wgrid > :nth-child(2) { animation-delay: 40ms; } .lr-wgrid > :nth-child(3) { animation-delay: 80ms; } .lr-wgrid > :nth-child(4) { animation-delay: 120ms; } .lr-wgrid > :nth-child(5) { animation-delay: 160ms; } .lr-wgrid > :nth-child(6) { animation-delay: 200ms; } .lr-wgrid > :nth-child(7) { animation-delay: 240ms; } .lr-wgrid > :nth-child(8) { animation-delay: 280ms; } .lr-wgrid > :nth-child(9) { animation-delay: 320ms; } .lr-wgrid > :nth-child(10) { animation-delay: 360ms; } .lr-wgrid > :nth-child(11) { animation-delay: 400ms; } .lr-wgrid > :nth-child(12) { animation-delay: 440ms; } .lr-wgrid > :nth-child(13) { animation-delay: 480ms; } .lr-wgrid > :nth-child(14) { animation-delay: 520ms; } .lr-wgrid > :nth-child(15) { animation-delay: 560ms; } .lr-wgrid > :nth-child(16) { animation-delay: 600ms; }
.lr-wgrid > :nth-child(n+17) { animation-delay: 640ms; }
@container wgrid (min-width: 544px) {
  .lr-wgrid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .c2-1 { grid-column: span 1; } .c2-2 { grid-column: span 2; }
}
@container wgrid (min-width: 828px) {
  .lr-wgrid { grid-template-columns: repeat(3, minmax(0,1fr)); }
  .c3-1 { grid-column: span 1; } .c3-2 { grid-column: span 2; } .c3-3 { grid-column: span 3; }
}
@container wgrid (min-width: 1112px) {
  .lr-wgrid { grid-template-columns: repeat(4, minmax(0,1fr)); }
  .c4-1 { grid-column: span 1; } .c4-2 { grid-column: span 2; } .c4-3 { grid-column: span 3; } .c4-4 { grid-column: span 4; }
}
@container wgrid (min-width: 1396px) {
  .lr-wgrid { grid-template-columns: repeat(5, minmax(0,1fr)); }
  .c5-1 { grid-column: span 1; } .c5-2 { grid-column: span 2; } .c5-3 { grid-column: span 3; } .c5-4 { grid-column: span 4; }
  .c5-5 { grid-column: span 5; }
}
@container wgrid (min-width: 1680px) {
  .lr-wgrid { grid-template-columns: repeat(6, minmax(0,1fr)); }
  .c6-1 { grid-column: span 1; } .c6-2 { grid-column: span 2; } .c6-3 { grid-column: span 3; } .c6-4 { grid-column: span 4; }
  .c6-5 { grid-column: span 5; } .c6-6 { grid-column: span 6; }
}
.lr-widget-soon { border-style: dashed; box-shadow: none; }

/* ================================================================== 7. Sign-in screens (Loudr Auth.dc.html) */
/* The wordmark: "Loudr" (Fraunces) + "RESOURCES" (mono caps). */
.lr-wordmark { display: inline-flex; align-items: baseline; gap: 8px; white-space: nowrap; color: var(--ink); }
.lr-wordmark-name { font: 600 24px/28px var(--font-display); }
.lr-wordmark-sub { font: 500 11px/16px var(--font-mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-muted); }
.lr-wordmark-panel { gap: 10px; color: var(--panel-ink); }
.lr-wordmark-panel .lr-wordmark-name { font-size: 30px; line-height: 36px; }
.lr-wordmark-panel .lr-wordmark-sub { font-size: 12px; color: var(--panel-muted); }

/* Split layout: brand panel 5fr | screen 7fr from 960 px; one column below it. */
.lr-auth-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(0,1fr); background: var(--surface-100); }
.lr-brand-panel { display: none; }
.lr-auth-shell > .solo { display: flex; flex-direction: column; align-items: stretch; justify-content: flex-start; gap: 0;
  min-width: 0; min-height: 100vh; padding: 24px 32px; }
.lr-auth-top { display: flex; align-items: center; gap: 16px; min-height: 48px; }
.lr-auth-top-space { flex: 1; }
.lr-auth-top .lr-theme-btn { width: 44px; height: 44px; background: var(--surface-200); }
.lr-auth-top .lr-theme-btn .icon { font-size: 22px; }
.lr-auth-center { flex: 1; display: flex; align-items: center; justify-content: center; padding: 32px 0; }
.auth, .lr-auth { width: 100%; max-width: 480px; }
.lr-auth { display: flex; flex-direction: column; gap: 24px; padding: 40px; border-radius: var(--r-modal);
  box-shadow: 0 1px 2px var(--shadow-color), 0 24px 60px var(--shadow-color); animation: lm-rise var(--m-slow) var(--m-out) both; }
.lr-auth-head { display: flex; flex-direction: column; gap: 10px; }
.lr-auth-head .lr-lead-ink { color: var(--ink); font: 400 18px/28px var(--font-body); }
.lr-auth-icon { width: 56px; height: 56px; margin-bottom: 2px; border-radius: 18px; display: grid; place-items: center;
  background: var(--brand-soft); border: 1px solid var(--brand-line); color: var(--brand); }
.lr-auth-icon .icon { font-size: 30px; }
.lr-auth-icon.is-danger { background: var(--danger-soft); border-color: var(--danger-line); color: var(--danger); }
.lr-auth-icon.is-attention { background: var(--attention-soft); border-color: var(--attention-line); color: var(--attention); }
.lr-auth-icon.is-neutral { background: var(--surface-300); border-color: var(--border-strong); color: var(--ink); }
.lr-auth form { margin: 0; }
.lr-auth-form { max-width: none; gap: 24px; }
.lr-auth-fields { display: flex; flex-direction: column; gap: 20px; }
.lr-auth-links { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.lr-auth-links-center { align-items: center; }
.lr-auth-actions { display: flex; flex-direction: column; gap: 16px; }
.lr-auth-alt { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; }
.lr-auth-alt p { margin: 0; }
.lr-auth-new { margin: 0; font: 400 16px/24px var(--font-body); color: var(--ink); }
.lr-auth-new a { color: var(--ink); font-weight: 700; }
.lr-auth-alt .lr-btn-tertiary { margin-top: 6px; }
.lr-auth-alt .lr-btn-tertiary .icon { color: var(--ink-muted); }
.lr-auth-secure { display: flex; align-items: center; justify-content: center; gap: 6px; margin: 0; padding-top: 12px;
  border-top: 1px solid var(--border); font: 400 13px/18px var(--font-body); color: var(--ink-muted); }
.lr-center { text-align: center; }
.lr-auth-foot { display: flex; justify-content: center; gap: 20px; flex-wrap: wrap; padding-top: 8px; }
.lr-auth-foot form { margin: 0; }
.lr-auth-link { min-height: 44px; padding: 0 8px; border: 0; background: none; cursor: pointer; color: var(--ink-muted);
  font: 400 14px/20px var(--font-body); text-decoration: underline; text-underline-offset: 3px; }
.lr-auth-link:hover { color: var(--ink); }
.lr-code { font: 500 28px/34px var(--font-mono); letter-spacing: 0.5em; text-align: center; }
.lr-code-guest { min-height: 72px; background: var(--surface-100); font-size: 34px; line-height: 1; letter-spacing: 0.32em;
  text-transform: uppercase; }
/* Phase 4 step 9: the 2-step setup (TwoStepCode.dc.html "QR CODE" box + the key), the invite's business, a link to share */
.lr-auth-qr { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 20px; border-radius: var(--r-panel);
  background: var(--surface-100); border: 1px solid var(--border); text-align: center; }
.lr-qr { width: 180px; height: 180px; padding: 10px; border-radius: var(--r-lg); background: var(--surface-200); }
.lr-code-key, .lr-copy-link { font: 500 14px/20px var(--font-mono); word-break: break-all; color: var(--ink); }
.lr-invite-biz { display: flex; align-items: center; gap: 12px; }
.lr-avatar-lg { width: 48px; height: 48px; font-size: 20px; }
.lr-inline-form { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0; }

/* the label row with a link, and the password eye (AuthField.dc.html) */
.lr-field-top { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.lr-field-top > label { font: 700 15px/22px var(--font-body); }
.lr-field-aside { font: 700 15px/22px var(--font-body); color: var(--ink); }
.lr-input-wrap { position: relative; display: flex; align-items: center; }
html.js .lr-input-reveal { padding-right: 56px; }
.lr-eye { display: none; position: absolute; right: 6px; width: 44px; height: 44px; place-items: center; border: 0;
  border-radius: var(--r-md); background: transparent; color: var(--ink-muted); cursor: pointer; }
html.js .lr-eye { display: grid; }
.lr-eye:hover { background: var(--surface-300); color: var(--ink); }

/* "Remember this device": a real checkbox drawn as the design's 26 px box */
.lr-check { position: relative; align-self: flex-start; display: flex; align-items: center; gap: 12px; min-height: 44px;
  cursor: pointer; font: 400 16px/24px var(--font-body); color: var(--ink); }
.lr-check input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.lr-check-box { width: 26px; height: 26px; flex: none; display: grid; place-items: center; border-radius: var(--r-sm);
  background: var(--surface-100); border: 1.5px solid var(--border-strong);
  transition: background-color var(--m-fast) var(--m-out), border-color var(--m-fast) var(--m-out); }
.lr-check-box .icon { font-size: 20px; color: var(--on-brand); opacity: 0; transform: scale(0.6);
  transition: opacity var(--m-fast) var(--m-out), transform var(--m-mid) var(--m-pop); }
.lr-check input:checked + .lr-check-box { background: var(--brand); border-color: var(--brand); }
.lr-check input:checked + .lr-check-box .icon { opacity: 1; transform: none; }
.lr-check input:focus-visible + .lr-check-box { outline: 2px solid var(--brand); outline-offset: 2px; }

/* "or", and the Google button (drawn, off until Phase 4) */
.lr-or { display: flex; align-items: center; gap: 16px; color: var(--ink-muted); font: 400 15px/22px var(--font-body); }
.lr-or::before, .lr-or::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.lr-google-wrap { display: flex; flex-direction: column; gap: 8px; }
.lr-google-wrap .lr-help { margin: 0; }
.lr-google { gap: 12px; }
.lr-google-g { width: 26px; height: 26px; display: grid; place-items: center; border-radius: var(--r-pill); background: var(--surface-300);
  border: 1px solid var(--border-strong); font: 800 15px/1 var(--font-body); color: var(--ink); }

/* The brand panel: wordmark, six tone tiles that float gently, the headline, the promise. */
@keyframes lm-float { 0%, 100% { transform: none; } 50% { transform: translateY(calc(-6px * var(--m-k))); } }
.lr-brand-tiles { --tile: 68px; display: grid; grid-template-columns: repeat(3, var(--tile)); gap: 12px; align-items: start;
  animation: lm-rise 400ms var(--m-out) 180ms both; }
.lr-brand-tile { width: var(--tile); height: var(--tile); display: grid; place-items: center; border-radius: 26px;
  --t: var(--panel-money); color: var(--t); background: color-mix(in srgb, var(--t) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--t) 32%, transparent); animation: lm-float 6s ease-in-out infinite; }
.lr-brand-tile .icon { font-size: 42px; }
.lr-brand-tile.is-low { margin-top: 24px; }
.lr-brand-tile.is-gold { --t: var(--panel-gold); background: color-mix(in srgb, var(--t) 16%, transparent);
  border-color: color-mix(in srgb, var(--t) 45%, transparent); rotate: -6deg; animation-delay: -1.2s; }
.lr-brand-tile.is-gold .icon { font-size: 44px; }
.lr-brand-tile.is-customers { --t: var(--panel-customers); animation-delay: -2.4s; }
.lr-brand-tile.is-team { --t: var(--panel-team); animation-delay: -3.6s; animation-duration: 7s; }
.lr-brand-tile.is-operations { --t: var(--panel-operations); animation-delay: -0.6s; animation-duration: 6.5s; }
.lr-brand-tile.is-add { --t: var(--panel-muted); color: var(--panel-muted); background: color-mix(in srgb, var(--panel-ink) 6%, transparent);
  border: 1px dashed color-mix(in srgb, var(--panel-ink) 22%, transparent); animation-delay: -4.8s; }
.lr-brand-tile.is-add .icon { font-size: 36px; }
.lr-brand-middle { display: flex; flex-direction: column; gap: 28px; max-width: 520px; }
.lr-brand-copy { display: flex; flex-direction: column; gap: 16px; animation: lm-rise var(--m-slow) var(--m-out) 280ms both; }
.lr-brand-headline { margin: 0; font: 600 46px/54px var(--font-display); color: var(--panel-ink); text-wrap: balance; }
.lr-brand-sub { margin: 0; font: 400 19px/30px var(--font-body); color: var(--panel-muted); }
.lr-brand-foot { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding-top: 20px;
  border-top: 1px solid var(--panel-line); font: 400 14px/20px var(--font-body); color: var(--panel-muted); }
.lr-brand-safe { display: inline-flex; align-items: center; gap: 8px; }
@media (min-width: 960px) {
  .lr-auth-shell { grid-template-columns: minmax(420px, 5fr) minmax(0, 7fr); }
  .lr-brand-panel { position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column;
    justify-content: space-between; gap: 28px; padding: 32px 48px; background: var(--panel-bg); color: var(--panel-ink); }
  .lr-auth-mark { display: none; }
  .lr-auth-shell > .solo { padding: 24px 40px; }
}
@media (min-width: 960px) and (min-height: 820px) {
  .lr-brand-panel { gap: 40px; padding: 48px 56px; }
  .lr-brand-middle { gap: 40px; }
  .lr-brand-tiles { --tile: 88px; gap: 16px; }
  .lr-brand-tile.is-low { margin-top: 32px; }
}
@media (max-height: 639px) { .lr-brand-tiles { display: none; } }

/* ================================================================== 8. Breakpoints (DESIGN.md 3.7) */
/* Tablet (721-1023): the sidebar starts collapsed; the menu button expands it. */
@media (min-width: 721px) and (max-width: 1023px) {
  html:not(.sidebar-expanded) .sidebar { width: var(--sidebar-w-collapsed); }
  html:not(.sidebar-expanded) .sidebar .brand { padding: 20px 19px 16px; gap: 0; }
  html:not(.sidebar-expanded) .sidebar .brand-link { flex: 0 0 0; pointer-events: none; }
  html:not(.sidebar-expanded) .sidebar .nav-row { padding: 7px 8px; margin: 0 3px; }
  html:not(.sidebar-expanded) .sidebar .nav-group-body .nav-row { padding: 7px 8px; margin: 0 -1px; }
  html:not(.sidebar-expanded) .sidebar .nav-section { height: 0; padding: 0 12px; }
  html:not(.sidebar-expanded) .sidebar .nav-caption { height: 9px; padding-top: 0; padding-bottom: 0; }
  html:not(.sidebar-expanded) .sidebar .nav-caption .icon { opacity: 0; }
  html:not(.sidebar-expanded) .sidebar .nav-caption::after { opacity: 1; }
  html:not(.sidebar-expanded) .sidebar .nav-group + .nav-group { margin-top: 3px; }
  html:not(.sidebar-expanded) .sidebar .nav-group + .nav-group > .nav-group-head::before { opacity: 1; }
  html:not(.sidebar-expanded) .sidebar .nav-group-head { height: 58px; margin: 0 1px; padding: 7px; }
  html:not(.sidebar-expanded) .sidebar .nav-group-head:hover { background: var(--surface-300); }
  html:not(.sidebar-expanded) .sidebar .nav-group-tile { width: 30px; height: 30px; border-radius: 9px; }
  html:not(.sidebar-expanded) .sidebar .nav-group-tile .icon { font-size: 20px; }
  html:not(.sidebar-expanded) .sidebar .nav-chevron { right: 14px; top: 39px; height: 12px; font-size: 16px; color: var(--ink-muted); }
  html:not(.sidebar-expanded) .sidebar .nav-group-body { margin-top: 6px; }
  html:not(.sidebar-expanded) .sidebar .nav-badge { opacity: 0; }
  html:not(.sidebar-expanded) .sidebar .nav-dot { display: block; }
  html:not(.sidebar-expanded) .sidebar .nav-lock, html:not(.sidebar-expanded) .sidebar .nav-pin, html:not(.sidebar-expanded) .sidebar .nav-pin-empty, html:not(.sidebar-expanded) .sidebar .nav-ai-note { display: none; }
  html:not(.sidebar-expanded) .sidebar .nav-ai-switch { opacity: 0; pointer-events: none; }
  html:not(.sidebar-expanded) .sidebar .lr-profile > summary { min-height: 44px; padding: 4px; margin: 0 1px; border-radius: var(--r-control); }
  html:not(.sidebar-expanded) .sidebar .lr-profile-chev { opacity: 0; }
  html:not(.sidebar-expanded):not(.has-typing) .sidebar .nav-label, html:not(.sidebar-expanded):not(.has-typing) .sidebar .brand-link { opacity: 0; }
  .topbar { padding: 12px 24px; }
  .content { padding: 32px 24px 64px; }
}
/* Phone (<= 720): no sidebar; a bottom nav with Home, two pinned tools, Alerts and Menu. Menu opens the whole
   sidebar tree as a bottom sheet (#sidebar:target works without script; loudr.js adds focus and Esc). */
@media (max-width: 720px) {
  .sidebar { display: none; }
  .sidebar:target, html.sheet-open .sidebar { display: flex; position: fixed; z-index: 90; left: 0; right: 0; bottom: 0; top: auto;
    width: 100%; height: auto; max-height: 85vh; border-right: 0; border-top: 1px solid var(--border);
    border-radius: var(--r-modal) var(--r-modal) 0 0; box-shadow: var(--sh-modal); padding: 8px 16px calc(16px + env(safe-area-inset-bottom));
    animation: lm-rise var(--m-mid) var(--m-out) both; }
  .sidebar:target ~ .lr-sheet-scrim, html.sheet-open .lr-sheet-scrim { display: block; }
  .nav-sheet-head { position: relative; display: flex; align-items: center; justify-content: center; flex: none; height: 36px; }
  .nav-sheet-grip { width: 40px; height: 4px; border-radius: var(--r-pill); background: var(--border-strong); }
  .nav-sheet-head .lr-icon-btn { position: absolute; right: 0; top: 4px; border: 1px solid var(--border); }
  .sidebar .brand { display: none; }
  .nav-row, .nav-group-head { min-height: 48px; }
  .nav-pin { opacity: 1; }
  .topbar { padding: 12px 16px; min-height: 56px; gap: 8px; }
  .topbar .lr-search, .lr-collapse { display: none; }
  .lr-search-icon { display: inline-grid; }
  .lr-top-actions { gap: 8px; }
  .topbar.search-open .lr-crumb, .topbar.search-open .lr-search-icon { display: none; }
  .topbar.search-open .lr-search { display: flex; flex: 1 1 auto; min-width: 0; }
  .content { padding: 24px 16px 96px; }
  .lr-display, .display { font-size: 32px; line-height: 38px; }
  .page-title { font-size: 30px; line-height: 36px; }
  .lr-bottom-nav { display: flex; position: fixed; z-index: 80; left: 0; right: 0; bottom: 0; height: calc(64px + env(safe-area-inset-bottom));
    padding: 0 4px env(safe-area-inset-bottom); background: var(--surface-sidebar); border-top: 1px solid var(--border);
    box-shadow: 0 -1px 2px var(--shadow-color); }
  .lr-bn-item { position: relative; flex: 1 1 0; min-width: 0; min-height: 48px; display: flex; flex-direction: column; align-items: center;
    justify-content: center; gap: 2px; color: var(--ink-muted); text-decoration: none; border: 0; background: none; cursor: pointer;
    font: 600 12px/16px var(--font-body); }
  .lr-bn-item .icon { font-size: 24px; }
  .lr-bn-label { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 0 2px; }
  .lr-bn-item.is-active { color: var(--ink); }
  .lr-bn-item.is-active .icon { color: var(--brand); font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 24; }
  .lr-bn-icon { position: relative; display: inline-grid; }
  .lr-bn-item .lr-badge-count { top: -4px; right: -10px; min-width: 18px; height: 18px; padding: 0 4px;
    border-color: var(--surface-sidebar); font-size: 10px; line-height: 14px; }
  .lr-bn-item::before { content: ""; position: absolute; top: 2px; width: 32px; height: 4px; border-radius: var(--r-pill);
    background: var(--brand); opacity: 0; transform: scaleX(0.4); transition: opacity var(--m-mid) var(--m-out), transform var(--m-mid) var(--m-out); }
  .lr-bn-item.is-active::before, html.sheet-open .lr-bn-item[data-action="sheet"]::before { opacity: 1; transform: none; }
  html.sheet-open .lr-bn-item[data-action="sheet"] { color: var(--ink); }
  html.sheet-open .lr-bn-item[data-action="sheet"] .icon { color: var(--brand); font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 24; }
  .lr-bn-item:active { background: var(--surface-300); border-radius: var(--r-control); }
  .lr-rows .lr-row { grid-template-columns: minmax(0,1fr) auto; row-gap: 4px; }
  .lr-rows .lr-row > :nth-child(n+3) { grid-column: 1 / -1; color: var(--ink-muted); }
  .lr-rows .lr-row-head { display: none; }
  .lr-dialog-foot { flex-wrap: wrap; }
  .lr-auth { padding: 24px 20px; }
  .lr-auth-shell > .solo { padding: 16px 16px 24px; }
  .lr-auth-center { padding: 16px 0 24px; }
  .lr-greeting-actions { width: 100%; }
}
.lr-sheet-scrim { display: none; position: fixed; inset: 0; z-index: 85; background: var(--scrim); }

/* Reduced motion: every move becomes instant (DESIGN.md 5.2) */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important;
    animation-delay: 0ms !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}

/* Print: content only */
@media print { .sidebar, .topbar, .lr-bottom-nav, .skip-link, .lr-tip { display: none !important; } .content { padding: 0; } }

/* ================================================================== 9. Module pages (Phase 3.3, AppPage.dc.html)
   One frame for every module page: the header (icon tile, eyebrow, title, description, actions top-right), segmented
   tabs, then sections. Forms use the AuthField compact input (48px) even when a module writes a plain <input>;
   tables are the row grid (DESIGN.md 4.5). Tokens only. */
.lr-page { display: flex; flex-direction: column; gap: 32px; min-width: 0; }
.lr-app-head { display: flex; flex-direction: column; gap: 12px; }
.lr-app-head-row { display: flex; align-items: flex-end; gap: 16px 24px; flex-wrap: wrap; }
.lr-app-tile { width: 64px; height: 64px; flex: none; display: none; place-items: center; border-radius: var(--r-panel); background: var(--surface-200); border: 1px solid var(--border); box-shadow: var(--sh-rest); }
.lr-app-tile .icon { font-size: 34px; color: var(--ink); }
.lr-app-head-text { flex: 1 1 320px; min-width: 240px; display: flex; flex-direction: column; gap: 8px; }
.lr-app-head-text .page-title { margin: 0; overflow-wrap: anywhere; }
.lr-app-head-text .eyebrow { margin: 0; }
.lr-app-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.lr-app-actions form, .lr-actions form, .lr-inline { display: inline-flex; margin: 0; }
.lr-back { align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; min-height: 44px; color: var(--ink-muted);
  font: 700 15px/22px var(--font-body); text-decoration: none; transition: color var(--m-fast) var(--m-out); }
.lr-back:hover { color: var(--ink); }
.lr-back .icon { font-size: 20px; }
.lr-page > .lr-tablist { align-self: flex-start; }
.lr-section { display: flex; flex-direction: column; gap: 16px; min-width: 0; margin: 0; }
.lr-section-title { font: 700 17px/24px var(--font-body); margin: 0; }
.lr-section-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.lr-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.lr-actions-end { justify-content: flex-end; }
.lr-stack { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.lr-cluster { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.lr-card > p, .lr-section > p { margin: 0; }

/* Stat tiles on a page: widget number L on a card */
.lr-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; }
.lr-stat-card { background: var(--surface-200); border: 1.5px solid var(--border); box-shadow: var(--sh-rest); }
.lr-stat-card .lr-stat-value { font: 500 28px/34px var(--font-mono); }
.lr-stat-card.is-danger .lr-stat-value { color: var(--danger); }
.lr-stat-card.is-attention .lr-stat-value { color: var(--attention); }

/* A record's facts: label / value rows */
.lr-facts { display: flex; flex-direction: column; margin: 0; }
.lr-fact { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 24px; padding: 12px 0; border-top: 1px solid var(--border); }
.lr-fact:first-child { border-top: 0; padding-top: 0; }
.lr-fact dt { color: var(--ink-muted); font: 700 14px/22px var(--font-body); }
.lr-fact dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }

/* Forms: one column (max 560px), 16px between fields, the actions at the bottom */
.lr-form { display: flex; flex-direction: column; gap: 16px; max-width: 560px; margin: 0; }
.lr-form-wide { max-width: none; }
.lr-form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 16px; }
.lr-form fieldset, .lr-fieldset { border: 0; padding: 0; margin: 0; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.lr-form legend, .lr-fieldset legend { padding: 0; font: 700 15px/22px var(--font-body); color: var(--ink); }
.lr-form > label, .lr-form .lr-field-label { font: 700 15px/22px var(--font-body); margin-bottom: -8px; }
.lr-form-actions-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding-top: 8px; }
/* the AuthField compact input for plain controls inside module forms, toolbars and row grids */
:is(.lr-form, .lr-toolbar, .lr-rows, .lr-card) :is(input:not([type=checkbox]):not([type=radio]):not([type=hidden]):not([type=file]):not([type=submit]):not([type=button]):not([type=range]):not(.lr-switch), select, textarea):not(.lr-input) {
  width: 100%; min-width: 0; min-height: 48px; padding: 11px 16px; border-radius: var(--r-control); background: var(--surface-200);
  border: 1.5px solid var(--border-strong); color: var(--ink); font: 400 15px/24px var(--font-body);
  transition: border-color var(--m-fast) var(--m-out), box-shadow var(--m-fast) var(--m-out); }
:is(.lr-form, .lr-toolbar, .lr-rows, .lr-card) textarea:not(.lr-input) { min-height: 96px; resize: vertical; }
:is(.lr-form, .lr-toolbar, .lr-rows, .lr-card) select:not(.lr-input) { appearance: none; -webkit-appearance: none; padding-right: 44px; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink-muted) 50%), linear-gradient(135deg, var(--ink-muted) 50%, transparent 50%);
  background-position: calc(100% - 22px) 50%, calc(100% - 16px) 50%; background-size: 6px 6px; background-repeat: no-repeat; }
:is(.lr-form, .lr-toolbar, .lr-rows, .lr-card) :is(input, textarea)::placeholder { color: var(--ink-faint); }
:is(.lr-form, .lr-toolbar, .lr-rows, .lr-card) input[type=file] { font: 400 14px/20px var(--font-body); color: var(--ink-muted); min-height: 44px; }
.lr-page input[type=checkbox]:not(.lr-switch), .lr-page input[type=radio] { width: 20px; height: 20px; margin: 0; flex: none; accent-color: var(--brand); cursor: pointer; }
.lr-check { display: flex; align-items: center; gap: 10px; min-height: 44px; font: 400 15px/22px var(--font-body); color: var(--ink); cursor: pointer; }
/* a plain checkbox row (no drawn .lr-check-box): the real checkbox shows (the sign-in rule above hides it only when
   the drawn box stands in for it) */
.lr-check:not(:has(.lr-check-box)) input { position: static; opacity: 1; width: 20px; height: 20px; }
.lr-checks { display: flex; flex-wrap: wrap; gap: 0 16px; }
.lr-input-narrow { max-width: 160px; }
.lr-input-num { text-align: right; font-family: var(--font-mono) !important; font-variant-numeric: tabular-nums; }
.lr-toolbar { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin: 0; }
.lr-toolbar > .lr-field, .lr-toolbar > .lr-grow { flex: 1 1 220px; min-width: 0; }
.lr-toolbar > .lr-field > label { font: 700 14px/20px var(--font-body); color: var(--ink-muted); }

/* Row grids: wider tables, flat rows inside a card, totals, row states */
.lr-cols-6 { grid-template-columns: minmax(0,1.6fr) repeat(5, minmax(0,1fr)); }
.lr-cols-7 { grid-template-columns: minmax(0,1.6fr) repeat(6, minmax(0,1fr)); }
.lr-cols-8 { grid-template-columns: minmax(0,1.6fr) repeat(7, minmax(0,1fr)); }
.lr-rows-flat { background: transparent; border: 0; border-radius: 0; box-shadow: none; padding: 0; overflow: visible; }
.lr-rows-flat .lr-row-head, .lr-rows-flat .lr-row { padding-left: 0; padding-right: 0; }
.lr-rows-flat .lr-row-head { padding-bottom: 8px; }
.lr-row-foot { font-weight: 700; }
.lr-row-foot .lr-cell-num { font-weight: 500; }
.lr-row.is-good { background: var(--good-soft); }
.lr-row.is-attention { background: var(--attention-soft); }
.lr-row.is-muted { color: var(--ink-muted); }
.lr-cell-actions { justify-self: end; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.lr-cell-actions form { display: inline-flex; margin: 0; }
.lr-row-group { padding: 16px 24px 8px; border-top: 1px solid var(--border); }
.lr-rows-flat .lr-row-group { padding-left: 0; padding-right: 0; }
.lr-row a:not(.lr-btn) { color: var(--ink); text-decoration: underline; text-decoration-color: var(--border-strong); }
.lr-row a:not(.lr-btn):hover { text-decoration-color: currentColor; }
.lr-rows .lr-empty { padding: 24px; }
/* a row that is a record, not a table line: what it is (left), a figure or time (right), its controls below */
.lr-row-split { grid-template-columns: minmax(0, 1fr) auto; row-gap: 12px; }
.lr-row-split > .lr-cell-actions, .lr-row-split > .lr-row-below { grid-column: 1 / -1; justify-self: stretch; justify-content: flex-start; }
ul.lr-rows, ol.lr-rows { list-style: none; margin: 0; }
.lr-rows:not(:has(> .lr-row-head)) { padding-top: 0; }
.lr-rows > .lr-row:first-child { border-top: 0; }

/* Plain lists (files, charges, receipts) */
.lr-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.lr-list > li { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; min-height: 48px;
  padding: 8px 0; border-top: 1px solid var(--border); }
.lr-list > li:first-child { border-top: 0; }
.lr-pre { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; font: 400 14px/22px var(--font-mono); background: var(--surface-100);
  border: 1px solid var(--border); border-radius: var(--r-lg); padding: 16px; }
.lr-banner-attention { background: var(--attention-soft); border-color: var(--attention-line); }
.lr-banner-attention > .icon { color: var(--attention); }
.lr-banner-good > .icon { color: var(--good); }
.lr-banner-body > form, .lr-banner-body > .lr-actions { margin-top: 8px; }
.lr-footnote { margin: 0; text-align: center; font: 400 13px/19px var(--font-body); color: var(--ink-muted); }
.lr-spark { display: block; max-width: 100%; height: auto; overflow: visible; }
.lr-spark polyline { fill: none; stroke: var(--brand); stroke-width: 2; }
.lr-spark circle { fill: var(--brand); }
.lr-spark text { fill: var(--ink); font: 500 11px var(--font-mono); }

/* Pieces the stock and purchasing pages need (shared, tokens only) */
.lr-two-col { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 32px; align-items: start; }
.lr-card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 24px; align-items: stretch; }
.lr-card.is-current { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand), var(--sh-rest); }
.lr-card.is-locked { opacity: 0.7; }
.lr-card ul { margin: 0; padding-left: 20px; color: var(--ink-muted); }
.lr-stat-card.is-primary { background: var(--surface-300); border-color: var(--border-strong); }
.lr-stat-card.is-primary .lr-stat-value { color: var(--ink); }
a.lr-stat-card { color: var(--ink); text-decoration: none; transition: border-color var(--m-fast) var(--m-out), background-color var(--m-fast) var(--m-out); }
a.lr-stat-card:hover { border-color: var(--border-strong); background: var(--surface-200); }
.lr-stat-card .eyebrow { display: inline-flex; align-items: center; gap: 6px; }
.lr-stat-card .eyebrow .icon { font-size: 16px; }
.lr-pos { color: var(--good); } .lr-neg { color: var(--danger); } .lr-zero { color: var(--ink-muted); }
:root[data-theme="light"] .lr-pos { color: color-mix(in srgb, var(--good) 70%, var(--ink)); }
.lr-thumb { width: 40px; height: 40px; flex: none; border-radius: var(--r-sm); object-fit: cover; background: var(--surface-300); display: inline-block; }
.lr-with-thumb { display: flex; align-items: center; gap: 12px; min-width: 0; }
.lr-photo { display: block; width: 100%; max-width: 400px; height: auto; border-radius: var(--r-lg); background: var(--surface-300); }
.stock-dot { display: inline-block; width: 8px; height: 8px; flex: none; border-radius: var(--r-pill); margin-right: 8px; vertical-align: 2px; background: var(--ink-faint); }
.stock-dot.healthy { background: var(--good); } .stock-dot.low { background: var(--attention); } .stock-dot.out { background: var(--danger); }
.lr-row.is-flash { animation: lm-highlight 900ms var(--m-out); }
.lr-cell-check { width: 20px; }
.lr-bulk-bar { position: sticky; bottom: 16px; z-index: 20; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 16px;
  border-radius: var(--r-panel); background: var(--surface-200); border: 1px solid var(--border-strong); box-shadow: var(--sh-popover); }
.lr-bulk-bar[hidden] { display: none; }
.lr-bulk-bar :is(select, input) { width: auto !important; min-width: 160px; }
.lr-steps { display: flex; flex-wrap: wrap; gap: 4px 12px; margin: 0; padding: 0; list-style: none; }
.lr-steps li { display: inline-flex; align-items: center; gap: 6px; font: 400 13px/19px var(--font-body); color: var(--ink-muted); }
.lr-steps li.is-done { color: var(--good); } .lr-steps li.is-now { color: var(--ink); font-weight: 700; }
.lr-steps li + li::before { content: "→"; color: var(--ink-faint); margin-right: 6px; }
.lr-sum { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.lr-sum li { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px dashed var(--border); }
.lr-sum li > :last-child { font: 400 14px/20px var(--font-mono); font-variant-numeric: tabular-nums; }
.lr-sum li.is-total { border-bottom: 0; border-top: 1px solid var(--border-strong); font-weight: 700; padding-top: 8px; }
.lr-numbered { display: flex; gap: 16px; padding: 16px 0; border-top: 1px solid var(--border); }
.lr-numbered:first-child { border-top: 0; }
.lr-numbered-n { width: 28px; height: 28px; flex: none; display: grid; place-items: center; border-radius: var(--r-pill); background: var(--brand-soft);
  color: var(--brand); font: 500 13px/1 var(--font-mono); }
.lr-numbered > div { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.lr-code { font: 400 13px/20px var(--font-mono); background: var(--surface-300); border-radius: var(--r-xs); padding: 1px 6px; }
.lr-reading-col { max-width: 880px; display: flex; flex-direction: column; gap: 16px; }
.lr-reading-col h2 { font: 600 24px/30px var(--font-display); margin: 16px 0 0; scroll-margin-top: 24px; }
.lr-reading-col p, .lr-reading-col li { color: var(--ink-muted); max-width: 680px; }
.lr-toc { position: sticky; top: 24px; display: flex; flex-direction: column; gap: 2px; }
.lr-toc a { color: var(--ink-muted); text-decoration: none; padding: 6px 0; font: 400 14px/20px var(--font-body); }
.lr-toc a:hover { color: var(--ink); }
.lr-camera { position: relative; cursor: pointer; }
.lr-camera input[type=file] { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; clip: rect(0 0 0 0); }
.lr-camera:focus-within { outline: 2px solid var(--brand); outline-offset: 2px; }
.lr-input-big { font: 500 22px/30px var(--font-mono) !important; min-height: 56px !important; }
[hidden] { display: none !important; }
@media (max-width: 1023px) { .lr-two-col { grid-template-columns: minmax(0, 1fr); } }

@media (max-width: 720px) {
  .lr-page { gap: 24px; }
  .lr-app-head-row { gap: 16px; }
  .lr-app-tile { width: 48px; height: 48px; border-radius: var(--r-lg); }
  .lr-app-tile .icon { font-size: 26px; }
  .lr-app-head-row { align-items: flex-start; }
  .lr-app-head-text { min-width: 0; flex-basis: 100%; }
  .lr-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .lr-app-actions { width: 100%; }
  .lr-app-actions > .lr-btn, .lr-app-actions > form { flex: 1 1 auto; }
  .lr-app-actions > form > .lr-btn { width: 100%; }
  .lr-fact { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .lr-stat-card .lr-stat-value { font-size: 22px; line-height: 28px; }
  /* two-line rows (DESIGN.md 4.5): name + value on top, the rest wraps below as a muted caption line */
  .lr-rows .lr-row { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 12px; row-gap: 4px; padding: 14px 16px; }
  .lr-rows-flat .lr-row { padding-left: 0; padding-right: 0; }
  .lr-rows .lr-row::after { content: ""; order: 1; flex-basis: 100%; height: 0; }
  .lr-rows .lr-row > :first-child { flex: 1 1 0; min-width: 0; }
  .lr-rows .lr-row > :nth-child(2) { flex: none; margin-left: auto; text-align: right; }
  .lr-rows .lr-row > :nth-child(n+3) { order: 2; flex: 0 1 auto; grid-column: auto; min-width: 0; justify-self: auto;
    font: 400 13px/19px var(--font-body); color: var(--ink-muted); }
  .lr-rows .lr-row > :nth-child(n+3)[data-label]::before { content: attr(data-label) " "; font-weight: 700; }
  .lr-rows .lr-row > .lr-cell-actions { flex-basis: 100%; justify-content: flex-start; }
  .lr-rows .lr-row > :nth-child(n+3) :is(input, select) { min-width: 120px; }
  .lr-row-group { padding: 12px 16px 4px; }
}


/* ------------------------------------------------------------------ 9b. The module page frame (app_page.html)
   and its page helpers - merge train 11: p33-customers' app-page.css, folded into the one kit. Rules loudr.css
   already had (the header, actions, facts, stats, lists, toolbar ...) keep p33-ops' definition; the frame's
   header is ui.page_header, so .lr-app-icon / .lr-app-title are gone. Tokens only. */
/* ------------------------------------------------------------------ the page: header, tabs, notices, body */
.lr-app { display: flex; flex-direction: column; gap: 24px; min-width: 0; overflow-wrap: anywhere; }

.lr-app-tabs { max-width: 100%; }
.lr-app-tabs .lr-tablist { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
/* merge train 11: a page that fills the frame's tabs block with ui.tabs (p33-money's pages) - the tab list sits right
   in the frame; it scrolls sideways on its own, like the frame's own tabs */
.lr-app > .lr-tablist { align-self: flex-start; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.lr-app-notices { display: flex; flex-direction: column; gap: 8px; }
.lr-app-body { display: flex; flex-direction: column; gap: 24px; min-width: 0; }
.lr-app-body > section, .lr-app-body > .lr-card, .lr-app-body > .lr-rows { min-width: 0; }

/* ------------------------------------------------------------------ layout helpers */
.lr-split { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; align-items: start; }
.lr-split > * { display: flex; flex-direction: column; gap: 24px; min-width: 0; }
@media (min-width: 1024px) { .lr-split { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); } }

.lr-stack-sm { display: flex; flex-direction: column; gap: 8px; min-width: 0; }

.lr-between { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; }
.lr-card > h2, .lr-card > h3{ margin: 0; }
.lr-card-sub { font: 700 15px/22px var(--font-body); margin: 8px 0 0; color: var(--ink); }
.lr-note { margin: 0; font: 400 14px/20px var(--font-body); color: var(--ink-muted); }

a.lr-stat { color: var(--ink); text-decoration: none; border: 1px solid var(--border); }
a.lr-stat:hover { background: var(--surface-300); }

/* ------------------------------------------------------------------ facts (a record's details) */

.lr-facts > div { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.lr-facts dt { font: 500 11px/16px var(--font-mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-muted); }
.lr-facts dd { margin: 0; font: 400 15px/24px var(--font-body); color: var(--ink); }

/* ------------------------------------------------------------------ filters: a search bar and chips */

.lr-toolbar .lr-search { max-width: none; min-height: 44px; flex: 1 1 240px; background: var(--surface-300); border: 1px solid var(--border); }
.lr-toolbar .lr-search input { min-height: 42px; }
.lr-toolbar .lr-field { flex: 1 1 200px; }
.lr-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0; padding: 0; list-style: none; }
.lr-chip { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 14px; border-radius: var(--r-pill);
  border: 1px solid var(--border); background: var(--surface-200); color: var(--ink-muted); font: 700 14px/20px var(--font-body);
  text-decoration: none; white-space: nowrap; transition: background-color var(--m-fast) var(--m-out), color var(--m-fast) var(--m-out); }
a.lr-chip:hover { background: var(--surface-300); color: var(--ink); }
.lr-chip[aria-current="page"], .lr-chip.is-on { background: var(--brand-soft); border-color: var(--brand-line); color: var(--ink); }
.lr-chip .lr-badge { min-width: 20px; }

/* ------------------------------------------------------------------ rows: extras around loudr.css 4.5 */
.lr-rows .lr-row > * { min-width: 0; }
.lr-rows .lr-row .caption { display: block; color: var(--ink-muted); font-weight: 400; }
.lr-rows .lr-row .lr-inline { justify-content: flex-end; }
.lr-rows a.lr-row, .lr-rows .lr-row a.lr-row-link { color: var(--ink); text-decoration: none; }
.lr-rows .lr-row a.lr-row-link { font-weight: 700; }
.lr-rows .lr-row a.lr-row-link:hover { color: var(--brand); }
.lr-rows-plain { background: transparent; border: 0; box-shadow: none; padding: 0; border-radius: 0; }
.lr-rows-plain .lr-row { padding-left: 0; padding-right: 0; }
.lr-rows-plain .lr-row-head { padding-left: 0; padding-right: 0; }
.lr-cell-end { justify-self: end; text-align: right; }
.lr-pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px;
  font: 400 14px/20px var(--font-body); color: var(--ink-muted); }

/* ------------------------------------------------------------------ plain lists inside a card */

.lr-list > li:last-child { padding-bottom: 0; }
.lr-list-main { flex: 1 1 200px; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.lr-list-main strong, .lr-list-main a { font: 700 15px/24px var(--font-body); color: var(--ink); }
.lr-list-main a:hover { color: var(--brand); }

/* ------------------------------------------------------------------ activity timeline */
.lr-timeline { list-style: none; margin: 0 0 0 5px; padding: 0; }
.lr-timeline > li { position: relative; padding: 0 0 20px 24px; border-left: 1px solid var(--border-strong); min-width: 0; }
.lr-timeline > li:last-child { border-left-color: transparent; padding-bottom: 0; }
.lr-timeline-dot { position: absolute; left: -5px; top: 7px; width: 9px; height: 9px; border-radius: var(--r-pill);
  background: var(--surface-200); border: 2px solid var(--ink-muted); }
.lr-timeline-dot.is-good { border-color: var(--good); }
.lr-timeline-dot.is-attention { border-color: var(--attention); }
.lr-timeline-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0 12px; }
.lr-timeline-head strong { font: 700 15px/24px var(--font-body); }
.lr-timeline time, .lr-timeline .lr-when { font: 400 14px/20px var(--font-mono); color: var(--ink-muted); font-variant-numeric: tabular-nums; }
.lr-timeline-detail { margin: 2px 0 0; font: 400 14px/20px var(--font-body); color: var(--ink-muted); white-space: pre-wrap; }
.lr-timeline-reason { margin: 8px 0 0; padding-left: 12px; border-left: 2px solid var(--border-strong); font: 400 14px/20px var(--font-body);
  color: var(--ink-muted); }
.lr-timeline .lr-inline { margin-top: 8px; }

/* ------------------------------------------------------------------ forms: the AuthField pattern for the rest */
textarea.lr-input { min-height: 120px; resize: vertical; }
input.lr-input[type="date"], input.lr-input[type="number"] { font-family: var(--font-mono); font-size: 14px; }

.lr-fieldset + .lr-fieldset { padding-top: 24px; border-top: 1px solid var(--border); }
.lr-fieldset > legend { padding: 0; margin: 0 0 16px; font: 700 17px/24px var(--font-body); color: var(--ink); }
.lr-fieldset > legend .caption { display: block; font-weight: 400; color: var(--ink-muted); }

.lr-field-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr)); gap: 16px; }
.lr-details { border-top: 1px solid var(--border); padding-top: 12px; }
.lr-details > summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; gap: 8px;
  font: 700 15px/22px var(--font-body); color: var(--ink-muted); list-style: none; }
.lr-details > summary::-webkit-details-marker { display: none; }
.lr-details > summary::before { content: "expand_more"; font-family: "Material Symbols Rounded"; font-size: 20px;
  transition: transform var(--m-mid) var(--m-out); }
.lr-details[open] > summary::before { transform: rotate(180deg); }
.lr-details > summary:hover { color: var(--ink); }
.lr-details[open] > summary { margin-bottom: 12px; }

/* ------------------------------------------------------------------ small buttons inside rows and lists */
.lr-btn-compact { min-height: 36px; padding: 0 12px; font-size: 14px; line-height: 20px; }

/* ------------------------------------------------------------------ phones (DESIGN.md 3.7, 4.5) */
@media (max-width: 720px) {
  .lr-app { gap: 16px; }
  .lr-app-head { gap: 12px 16px; }
  
  
  
  
  .lr-app-tabs .lr-tablist { display: flex; width: 100%; }
  .lr-app-tabs .lr-tab { flex: 1 0 auto; justify-content: center; padding: 0 14px; }
  .lr-toolbar > .lr-btn { flex: 1 1 auto; }
  .lr-rows .lr-row .lr-inline { justify-content: flex-start; }
  .lr-rows { padding-top: 0; }                                   /* the column header is hidden on a phone */
  .lr-rows .lr-row-head + .lr-row { border-top: 0; }
  .lr-rows .lr-row > .lr-cell-end:nth-child(n+3), .lr-rows .lr-row > .lr-cell-num:nth-child(n+3) { justify-self: start; text-align: left; }
  .lr-form-actions > .lr-btn { flex: 1 1 auto; }
  .lr-facts { grid-template-columns: minmax(0, 1fr); gap: 12px; }
}

/* ------------------------------------------------------------------ a form inside a layout wrapper */
/* <div class="lr-form"><form method="POST" action="..."> keeps the form tag bare (the modules' tests read forms the
   way a browser does); the form's fields then lay out as the wrapper's own children. */
.lr-form > form, .lr-stack > form, .lr-stack-sm > form { display: contents; }

/* ------------------------------------------------------------------ embedded previews (an email's phone frame) */
.lr-app-body iframe { max-width: 100%; border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface-200); }

/* ------------------------------------------------------------------ 9c. Team pages' additions (merge train 11:
   p33-team's module-page CSS, folded into the one kit; selectors loudr.css already had keep p33-ops' definition,
   and the retired frame-header classes are gone - the header is ui.page_header). Tokens only. */
/* ================================================================== 7. Module pages (Phase 3.3; AppPage.dc.html)
   Every module page: the header (icon tile, group eyebrow, Fraunces title, description, actions on the right), the
   module's segmented tabs, then sections 40px apart. Tokens only; module CSS holds only what is truly its own. */

 .lr-section > h2 { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; margin: 0;
  font: 700 17px/24px var(--font-body); color: var(--ink); }
.lr-section-title .lr-section-meta { margin-left: auto; }
.lr-sub-title { margin: 0; font: 700 15px/22px var(--font-body); }

.lr-stats > .lr-stat { background: var(--surface-200); border: 1.5px solid var(--border); box-shadow: var(--sh-rest); }
.lr-stat.is-danger .lr-stat-value { color: var(--danger); }
.lr-stat.is-attention .lr-stat-value { color: var(--attention); }
.lr-stat .lr-pill { align-self: flex-start; }
.lr-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); gap: 24px; }
.lr-two { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(360px, 100%), 1fr)); gap: 24px; }

.lr-card.is-danger { border-color: var(--danger-line); }
.lr-card.is-attention { border-color: var(--attention-line); }

.lr-note.is-danger { color: var(--danger); font-weight: 700; }

/* the legal / "not advice" notes: quiet, always visible (disclaimers stay) */
.lr-legal { margin: 0; padding: 12px 16px; max-width: 880px; border-radius: var(--r-control); background: var(--surface-200);
  border: 1px solid var(--border); color: var(--ink-muted); font: 400 14px/20px var(--font-body); }
/* forms: AuthField inputs (compact 48px), a row of small fields, checks, groups */

.lr-input[type="file"] { padding: 10px 12px; cursor: pointer; }

.lr-inline > .lr-input, .lr-inline > .lr-select, .lr-inline > .lr-field { flex: 1 1 160px; width: auto; min-width: 0; }
.lr-inline > .lr-input-short, .lr-inline > .lr-field.is-short { flex: 0 1 104px; }
.lr-inline > .lr-unit { align-self: center; color: var(--ink-muted); font: 400 14px/20px var(--font-mono); }
.lr-filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 16px; margin: 0; }
.lr-filters > .lr-field { flex: 1 1 180px; min-width: 0; }

.lr-disclosure > summary { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; cursor: pointer; list-style: none;
  font: 700 15px/22px var(--font-body); color: var(--ink-muted); }
.lr-disclosure > summary::-webkit-details-marker { display: none; }
.lr-disclosure > summary::before { content: "chevron_right"; font-family: "Material Symbols Rounded"; font-size: 20px;
  transition: transform var(--m-mid) var(--m-out); }
.lr-disclosure[open] > summary::before { transform: rotate(90deg); }
.lr-disclosure > summary:hover { color: var(--ink); }
.lr-disclosure[open] > :not(summary) { animation: lm-rise var(--m-mid) var(--m-out) both; }
/* the "?" help popover */
.lr-help-pop { position: relative; display: inline-flex; vertical-align: middle; }
.lr-help-pop > summary { list-style: none; cursor: pointer; }
.lr-help-pop > summary::-webkit-details-marker { display: none; }
.lr-help-pop > p { position: absolute; z-index: 40; top: calc(100% + 8px); left: 0; width: min(320px, 80vw); margin: 0; padding: 12px 14px;
  border-radius: var(--r-panel); background: var(--surface-200); border: 1px solid var(--border); box-shadow: var(--sh-popover);
  font: 400 14px/20px var(--font-body); color: var(--ink); animation: lm-scale-in 150ms var(--m-out) both; }
/* wizard steps */

.lr-steps a, .lr-steps .lr-step { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px 0 8px;
  border-radius: var(--r-pill); border: 1px solid var(--border); background: var(--surface-200); color: var(--ink-muted);
  text-decoration: none; font: 700 15px/22px var(--font-body); }
.lr-steps a:hover { background: var(--surface-300); color: var(--ink); }
.lr-step-n { width: 28px; height: 28px; flex: none; display: inline-grid; place-items: center; border-radius: var(--r-pill);
  background: var(--surface-300); font: 500 13px/1 var(--font-mono); }
.lr-steps [aria-current="step"] { color: var(--ink); background: var(--brand-soft); border-color: var(--brand-line); }
.lr-steps [aria-current="step"] .lr-step-n { background: var(--brand); color: var(--on-brand); }
/* rows: more columns, actions, totals, muted rows */

.lr-cols-auto { grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); }
.lr-row.lr-cols-6, .lr-row.lr-cols-7, .lr-row.lr-cols-8, .lr-row.lr-cols-auto, .lr-row-head.lr-cols-6, .lr-row-head.lr-cols-7,
.lr-row-head.lr-cols-8, .lr-row-head.lr-cols-auto { gap: 16px; }
.lr-rows > .lr-rows-title { margin: 0; padding: 0 24px 12px; font: 700 17px/24px var(--font-body); }
.lr-rows.is-flat { padding-top: 0; }
.lr-row > span, .lr-row > div { min-width: 0; }
.lr-row .lr-cell-meta { font: 400 13px/19px var(--font-body); color: var(--ink-muted); }
.lr-row .lr-cell-actions { justify-self: end; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.lr-row .lr-cell-actions form { margin: 0; }
.lr-row .lr-cell-wide { grid-column: 1 / -1; }
.lr-row .lr-cell-pills { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.lr-row-total { font-weight: 700; border-top: 1.5px solid var(--border-strong); }
.lr-row-total .lr-cell-num { font-weight: 500; }

.lr-row.is-danger { background: var(--danger-soft); }

.lr-row-empty { display: block; }

.lr-list-plain { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.lr-list-plain > li { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 12px 0; border-top: 1px solid var(--border); }
.lr-list-plain > li:first-child { border-top: 0; }
.lr-list-plain > li form { margin: 0; }
.lr-kv { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 8px 24px; margin: 0; }
.lr-kv dt { color: var(--ink-muted); font: 500 11px/20px var(--font-mono); letter-spacing: 0.12em; text-transform: uppercase; }
.lr-kv dd { margin: 0; }
@media (max-width: 720px) {
  
  .lr-page > .lr-tablist { margin-top: -8px; align-self: stretch; }
  
  
  
  
  
  .lr-rows .lr-row.lr-cols-auto { grid-auto-flow: row; }
  .lr-row .lr-cell-actions { justify-self: stretch; grid-column: 1 / -1; }
  .lr-row-total > :nth-child(n+3) { color: var(--ink); }
  .lr-kv { grid-template-columns: minmax(0, 1fr); gap: 2px 0; }
  .lr-kv dd { margin-bottom: 8px; }
  .lr-input-big { max-width: none; }
  
  .lr-stats .lr-stat-value { font-size: 22px; line-height: 28px; }
}

/* merge train 11: p33-money's module-page CSS, folded into the one kit (selectors loudr.css already had keep
   the kit's definition; its own frame header .lr-page-header/-icon/-heading/-actions is retired - the frame's
   header is ui.page_header). Tokens only. */
/* ================================================================== Phase 3.3 module pages (app_page.html)
   The AppPage header (design/AppPage.dc.html), sections, stat rows, row-grid tables with actions, forms, toolbars.
   Tokens only. Phones (<= 720) stack everything into one column and rows into two lines (section 8 above). */

 .lr-section-head form { margin: 0; }

.lr-page > .lr-tablist::-webkit-scrollbar { display: none; }

.lr-section-head .lr-help { margin-top: 4px; }

.lr-card > .lr-stats { gap: 12px; }
.lr-stat .lr-stat-value.is-good { color: var(--good); } .lr-stat .lr-stat-value.is-danger { color: var(--danger); }
.lr-stat .lr-stat-value.is-attention { color: var(--attention); }
.lr-stat a { color: inherit; }

/* The actions column fits its buttons but never takes more than 40% (they wrap), so the name column keeps room. */
.lr-cols-2a { grid-template-columns: minmax(0,1fr) fit-content(50%); }
.lr-cols-3a { grid-template-columns: minmax(0,1.6fr) minmax(0,1fr) fit-content(40%); }
.lr-cols-4a { grid-template-columns: minmax(0,1.6fr) minmax(0,1fr) minmax(0,1fr) fit-content(40%); }
.lr-cols-5a { grid-template-columns: minmax(0,1.6fr) minmax(0,1fr) minmax(0,1fr) minmax(0,1fr) fit-content(40%); }
.lr-cols-6a { grid-template-columns: minmax(0,1.6fr) repeat(4, minmax(0,1fr)) fit-content(40%); }
/* A list narrower than 800px (a tablet, or a desktop with the sidebar open): rows with five or more columns read
   as the phone's two lines (name + value / the rest). A container query, so it follows the list's own width. */

@container lr-rows (max-width: 800px) {
  .lr-row:is(.lr-cols-5, .lr-cols-5a, .lr-cols-6, .lr-cols-6a) { grid-template-columns: minmax(0,1fr) auto; row-gap: 4px; }
  .lr-row:is(.lr-cols-5, .lr-cols-5a, .lr-cols-6, .lr-cols-6a) > :nth-child(n+3) { grid-column: 1 / -1; color: var(--ink-muted); }
  .lr-row:is(.lr-cols-5, .lr-cols-5a, .lr-cols-6, .lr-cols-6a) > .lr-cell-actions { justify-self: start; justify-content: flex-start; }
  .lr-row-head:is(.lr-cols-5, .lr-cols-5a, .lr-cols-6, .lr-cols-6a) { display: none; }
}

.lr-row > * { min-width: 0; }
.lr-row .caption { color: var(--ink-muted); }

.lr-rows > .lr-empty { border-top: 1px solid var(--border); padding: 32px 24px; }
.lr-rows-foot { display: flex; justify-content: space-between; gap: 16px; padding: 16px 24px; border-top: 1px solid var(--border);
  font: 700 15px/24px var(--font-body); }
.lr-rows-foot .lr-cell-num { font-weight: 500; }
a.lr-row { color: var(--ink); }

.lr-form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }

input[type="file"].lr-input { padding: 10px 12px; }
input[type="color"].lr-input { padding: 4px; min-height: 48px; width: 96px; }
.lr-input[type="date"], .lr-input[type="time"], .lr-input[type="month"] { color-scheme: dark light; }

.lr-check > input { flex: none; width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--brand); }
.lr-check > span { display: flex; flex-direction: column; gap: 2px; }

.lr-toolbar > .lr-search { flex: 1 1 240px; min-height: 48px; }

.lr-kv > dt { color: var(--ink-muted); }
.lr-kv > dd { margin: 0; justify-self: end; text-align: right; font: 400 14px/24px var(--font-mono); font-variant-numeric: tabular-nums; }
.lr-kv > dd.is-text { font: 400 15px/24px var(--font-body); }
.lr-kv > .is-total { font-weight: 700; color: var(--ink); padding-top: 8px; border-top: 1px solid var(--border); }

.lr-disclaimer { margin: 0; color: var(--ink-muted); font: 400 13px/19px var(--font-body); max-width: 880px; }

.lr-chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.lr-num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.lr-text-danger { color: var(--danger); } .lr-text-good { color: var(--good); } .lr-text-attention { color: var(--attention); }

.lr-bar > span { display: block; height: 100%; border-radius: var(--r-pill); background: var(--tone, var(--brand)); }
.lr-input-sm { width: 9em; min-height: 44px; padding: 8px 12px; }
/* Month calendar (Ledger & Calendar; any module's month view): 7 columns, day cells with event / bill items. */
.lr-cal-nav { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.lr-cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 1px; }
.lr-cal-head { padding: 10px 12px; text-align: left; font: 500 11px/16px var(--font-mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-muted); }
.lr-cal-day { min-height: 112px; min-width: 0; display: flex; flex-direction: column; gap: 4px; padding: 8px; border-radius: 0; border: 0; background: var(--surface-200); }
.lr-cal-day.is-blank { border: 0; background: color-mix(in srgb, var(--surface-200) 40%, var(--surface-100)); }
.lr-cal-num { font: 500 13px/20px var(--font-mono); color: var(--ink-muted); }
.lr-cal-item { display: block; padding: 1px 6px; border-radius: var(--r-xs); font: 700 11px/17px var(--font-body); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border: 0; }
.lr-cal-item.is-event { background: var(--surface-300); border-color: transparent; }
.lr-cal-item.is-bill { background: var(--info-soft); border-color: transparent; }
.lr-cal-item.is-overdue { background: var(--danger-soft); border-color: transparent; }
@media (max-width: 720px) {
  
  
  
  
  
  
  
  
  .lr-stat-value { font-size: 22px; line-height: 28px; }
  
  
  .lr-rows-foot { padding: 14px 16px; }
  
  .lr-split { grid-template-columns: minmax(0, 1fr); }
  .lr-cal { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .lr-cal-head, .lr-cal-day.is-blank, .lr-cal-day:not(.has-items) { display: none; }
  .lr-cal-day { min-height: 0; flex-direction: row; flex-wrap: wrap; align-items: center; padding: 10px 12px; }
  .lr-cal-num { min-width: 28px; }
  .lr-cal-item { white-space: normal; font-size: 14px; line-height: 20px; }}


/* ================================================================== 10. The designed app pages (Claude Design match)
   InvoicesPage / CustomersPage / ExpensesPage / LedgerPage / TaxPage.dc.html, applied to every module page through the
   one kit (app_page.html + components.html): the header is the group · app eyebrow, the Fraunces title and the
   actions on the right (no icon tile); stat cards carry a status dot, four to a row; tabs, the toolbar, row tables and
   status pills take the designed sizes. Tokens only. Looks only: no markup a module relies on changes. */
.lr-app, .lr-page { container: lr-app / inline-size; }

.lr-app-head-row { justify-content: space-between; }

.lr-app-crumb { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 6px; }
.lr-app-crumb > .eyebrow { margin: 0; }
.lr-app-crumb-app::before { content: "\00b7"; margin-right: 6px; }
.lr-app-head .lr-lead { font: 400 15px/22px var(--font-body); max-width: 720px; }
.lr-app-actions { flex: 0 1 auto; justify-content: flex-end; }

/* stat cards (InvoicesPage.dc.html cards): 16px 20px, radius 20, a 1.5px border, a status dot before the label */
.lr-stats > .lr-stat, .lr-stat-card { gap: 4px; padding: 16px 20px; border-radius: var(--r-panel); transition: border-color var(--m-fast) var(--m-out), box-shadow var(--m-mid) var(--m-out), scale var(--m-fast) var(--m-out); }
.lr-stats > a.lr-stat:hover { border-color: var(--border-strong); background: var(--surface-200); }
.lr-stats > .lr-stat > .eyebrow:first-child { display: flex; align-items: center; gap: 8px; }
.lr-stats > .lr-stat > .eyebrow:first-child::before { content: ""; width: 8px; height: 8px; flex: none; border-radius: var(--r-pill);
  background: var(--stat-dot, var(--info)); }
.lr-stats > .lr-stat.is-good { --stat-dot: var(--good); }
.lr-stats > .lr-stat.is-attention { --stat-dot: var(--attention); }
.lr-stats > .lr-stat.is-danger { --stat-dot: var(--danger); }
.lr-stats > .lr-stat:has(.lr-stat-value.is-good) { --stat-dot: var(--good); }
.lr-stats > .lr-stat:has(.lr-stat-value.is-attention) { --stat-dot: var(--attention); }
.lr-stats > .lr-stat:has(.lr-stat-value.is-danger) { --stat-dot: var(--danger); }
.lr-stats > .lr-stat:has(.lr-text-good) { --stat-dot: var(--good); }
.lr-stats > .lr-stat:has(.lr-text-attention) { --stat-dot: var(--attention); }
.lr-stats > .lr-stat:has(.lr-text-danger) { --stat-dot: var(--danger); }
.lr-stats > .lr-stat .lr-stat-value { font: 500 28px/34px var(--font-mono); }
.lr-stats > .lr-stat .caption { font: 400 13px/19px var(--font-body); color: var(--ink-muted); }
/* four to a row on every page wide enough for them (owner's choice), two on narrower ones */
:is(.lr-app, .lr-app-body, .lr-app-body > .lr-section, .lr-app-body > form, .lr-page, .lr-page > .lr-section) > .lr-stats {
  grid-template-columns: repeat(2, minmax(0, 1fr)); }
@container lr-app (min-width: 760px) {
  :is(.lr-app, .lr-app-body, .lr-app-body > .lr-section, .lr-app-body > form, .lr-page, .lr-page > .lr-section) > .lr-stats {
    grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* tabs (InvoicesPage.dc.html tablist): 14px sides, 700 14px; counts are neutral; 44px targets stay */
.lr-tab { padding: 0 14px; font: 700 14px/20px var(--font-body); }
.lr-tab .lr-badge, .lr-tab .lr-badge-good { min-width: 20px; padding: 0 6px; background: var(--surface-300); color: var(--ink-muted);
  font: 500 11px/18px var(--font-mono); }
.lr-tab[aria-current="page"] .lr-badge, .lr-tab[aria-selected="true"] .lr-badge { background: var(--border); color: var(--ink); }

.lr-app-tabs .lr-tablist::-webkit-scrollbar, .lr-app > .lr-tablist::-webkit-scrollbar { display: none; }

/* the toolbar (InvoicesPage.dc.html): a 44px search well and 44px selects in one row */

.lr-toolbar .lr-search { padding: 0 14px; border-radius: var(--r-control); }

/* the search well's own field has no second border (the kit's form-field rule would draw one inside the well) */
:is(.lr-form, .lr-toolbar, .lr-rows, .lr-card) .lr-search :is(input:not([type=checkbox]):not([type=radio]):not([type=hidden]):not([type=file]):not([type=submit]):not([type=button]):not([type=range]):not(.lr-switch)):not(.lr-input) {
  min-height: 42px; border: 0; border-radius: 0; background: transparent; padding: 0; box-shadow: none; }
.lr-toolbar .lr-select select, :is(.lr-toolbar) select:not(.lr-input) { min-height: 44px; padding-left: 14px;
  border-radius: var(--r-control); font: 700 14px/20px var(--font-body); }

/* row tables (InvoicesPage.dc.html section): 14px 24px rows, 16px between columns, amounts 500 in ink */
.lr-row, .lr-row-head { gap: 4px 16px; }
.lr-row { padding: 14px 24px; transition: background-color var(--m-fast) var(--m-out); }
.lr-row .lr-cell-num { font-weight: 500; }

/* status pills: a 6px dot in the pill's colour before the word (colour AND word) */
.lr-pill { gap: 6px; }
.lr-pill:not(:has(> .icon))::before { content: ""; width: 6px; height: 6px; flex: none; border-radius: var(--r-pill); background: currentColor; }

/* the month calendar (DESIGN.md 4.16, LedgerPage.dc.html): one grid with 1px rules, 112px days, today in a brand
   circle on a 7% tint; item chips are 11px bold on a soft fill with a 2px edge in their colour - danger overdue,
   info upcoming, neutral for events */
.lr-cal { background: var(--border); border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; }
.lr-cal-head { background: var(--surface-200); }

.lr-cal-num { align-self: flex-start; width: 24px; height: 24px; display: inline-grid; place-items: center; border-radius: var(--r-pill); }
.lr-cal-day.is-today { background: color-mix(in srgb, var(--brand) 7%, var(--surface-200)); }
.lr-cal-day.is-today .lr-cal-num { background: var(--brand); color: var(--on-brand); }
.lr-cal-item { color: var(--ink); box-shadow: inset 2px 0 0 var(--chip, var(--ink-muted)); }
.lr-cal-item .lr-num { font-weight: 500; }
.lr-cal-item.is-event { --chip: var(--ink-muted); color: var(--ink-muted); }
.lr-cal-item.is-bill { --chip: var(--info); }
.lr-cal-item.is-overdue { --chip: var(--danger); }

@media (max-width: 720px) {
  /* phones keep their list: each day with items is its own row card; numbers stay readable in two columns */
  .lr-stats > .lr-stat .lr-stat-value { font-size: 22px; line-height: 28px; }
  .lr-cal { background: transparent; border: 0; border-radius: 0; overflow: visible; }
  .lr-cal-day { border: 1px solid var(--border); border-radius: var(--r-control); }

}

/* a page's first-run empty state (InvoicesPage.dc.html emptyAll, RoleHome.dc.html): a dashed card, the icon in a 64px
   tile; the one action keeps its own kind */
:is(.lr-app-body, .lr-page, .lr-app-body > .lr-section, .lr-page > .lr-section) > :is(.lr-card, .lr-rows):has(> .lr-empty:only-child) {
  border-style: dashed; border-color: var(--border-strong); border-radius: var(--r-widget); box-shadow: none; padding: 48px 24px; }
:is(.lr-app-body, .lr-page) :is(.lr-card, .lr-rows) > .lr-empty:only-child > .icon:first-child { width: 64px; height: 64px; display: grid;
  place-items: center; border-radius: var(--r-panel); background: var(--surface-300); color: var(--ink-muted); font-size: 32px; }
.lr-rows > .lr-empty:only-child { border-top: 0; padding: 0; }

/* the row menu (components.html row_menu; InvoicesPage.dc.html "⋯"): a 44px button; its popover holds the row's own
   links, buttons and forms, drawn as menu rows */
.lr-row-menu { position: relative; display: inline-flex; justify-self: end; }
.lr-row-menu > summary { list-style: none; width: 44px; height: 44px; border-radius: var(--r-md); color: var(--ink-muted); }
.lr-row-menu > summary::-webkit-details-marker { display: none; }
.lr-row-menu > summary:hover, .lr-row-menu[open] > summary { background: var(--border); color: var(--ink); }
.lr-row-menu-pop { position: absolute; right: 0; top: calc(100% + 6px); z-index: 40; min-width: 240px; max-width: calc(100vw - 16px);
  display: flex; flex-direction: column; gap: 2px; padding: 8px; border-radius: var(--r-panel); background: var(--surface-200);
  border: 1px solid var(--border); box-shadow: var(--sh-popover); transform-origin: top right; animation: lm-scale-in 150ms var(--m-out) both; }
.lr-row-menu-pop.is-placed { position: fixed; right: auto; }
.lr-row-menu-pop > .lr-btn, .lr-row-menu-pop > form:not(:has(input:not([type=hidden]))) > .lr-btn {
  width: 100%; justify-content: flex-start; min-height: 44px; padding: 10px 12px; border: 0; border-radius: var(--r-control);
  background: transparent; box-shadow: none; color: var(--ink); font: 400 15px/22px var(--font-body); }
.lr-row-menu-pop > .lr-btn:hover, .lr-row-menu-pop > form:not(:has(input:not([type=hidden]))) > .lr-btn:hover { background: var(--surface-300); }
.lr-row-menu-pop > .lr-btn-danger, .lr-row-menu-pop > form:not(:has(input:not([type=hidden]))) > .lr-btn-danger { color: var(--danger); }
.lr-row-menu-pop .lr-btn .icon { color: currentColor; }
.lr-row-menu-pop form { display: flex; align-items: center; gap: 8px; margin: 0; }
.lr-row-menu-pop form:has(input:not([type=hidden])) { padding: 4px; flex-wrap: nowrap; }
.lr-row-menu-pop form:has(input:not([type=hidden])) > .lr-btn { flex: none; min-height: 44px; }
.lr-row-menu-pop form:has(input:not([type=hidden])) > .lr-input { flex: 1 1 auto; width: auto; min-width: 0; }

/* the invoice list (InvoicesPage.dc.html): number, customer, made, due, amount, state, "⋯" */
.lr-cols-inv { grid-template-columns: minmax(56px, 0.5fr) minmax(0, 1.8fr) minmax(0, 0.8fr) minmax(0, 0.8fr) minmax(0, 1fr) minmax(0, 1fr) 44px; }
.lr-row.lr-cols-inv { padding-top: 10px; padding-bottom: 10px; }
.lr-row.is-overdue { background: var(--danger-soft); }
.it-c-num { font: 500 14px/20px var(--font-mono); color: var(--ink); }
.it-num-inline { display: none; }
.lr-row .it-c-issued, .lr-row .it-c-due { font: 400 14px/20px var(--font-mono); color: var(--ink-muted); }
.lr-row .it-c-due.lr-text-danger { color: var(--danger); }
.it-c-amt { display: flex; flex-direction: column; align-items: flex-end; font: 500 15px/22px var(--font-mono); color: var(--ink); }
.it-c-amt .caption { font: 400 12px/16px var(--font-mono); }
.it-c-status { justify-self: start; }
.it-c-menu { justify-self: end; }
@container lr-app (max-width: 820px) {
  .lr-rows .lr-row.lr-cols-inv { display: grid; grid-template-columns: minmax(0, 1fr) auto 44px; column-gap: 12px; row-gap: 4px;
    grid-template-areas: "who amt menu" "due status menu"; align-items: center; padding: 12px 16px; }
  .lr-rows .lr-row.lr-cols-inv::after { display: none; }
  .lr-rows .lr-row.lr-cols-inv > .it-c-num, .lr-rows .lr-row.lr-cols-inv > .it-c-issued { display: none; }
  .lr-rows .lr-row.lr-cols-inv > .it-c-who { grid-area: who; text-align: left; margin-left: 0; }
  .lr-rows .lr-row.lr-cols-inv > .it-c-amt { grid-area: amt; }
  .lr-rows .lr-row.lr-cols-inv > .it-c-due { grid-area: due; }
  .lr-rows .lr-row.lr-cols-inv > .it-c-status { grid-area: status; justify-self: end; }
  .lr-rows .lr-row.lr-cols-inv > .it-c-menu { grid-area: menu; }
  .lr-row.lr-cols-inv .it-num-inline { display: inline; }
  .lr-row-head.lr-cols-inv { display: none; }
}


/* the customer list (CustomersPage.dc.html table): name, phone (mono), email, state, updated; on narrow screens the
   phone and email fold under the name */
.lr-rows.customer-list { container: crm-list / inline-size; }
.lr-cols-crm { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr) minmax(0, 1.4fr) minmax(0, 0.8fr) minmax(0, 0.8fr); }
.lr-row .crm-c-phone { font: 400 14px/20px var(--font-mono); color: var(--ink); }
.lr-row .crm-c-email { font: 400 14px/20px var(--font-body); color: var(--ink-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lr-rows .lr-row .crm-c-inline { display: none; }
@container crm-list (max-width: 760px) {
  .lr-rows .lr-row.lr-cols-crm { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 12px; padding: 12px 16px; }
  .lr-rows .lr-row.lr-cols-crm::after { display: none; }
  .lr-rows .lr-row.lr-cols-crm > .crm-c-phone, .lr-rows .lr-row.lr-cols-crm > .crm-c-email,
  .lr-rows .lr-row.lr-cols-crm > :last-child { display: none; }
  .lr-rows .lr-row.lr-cols-crm > :nth-child(4) { grid-column: 2; grid-row: 1; justify-self: end; order: 0; }
  .lr-rows .lr-row.lr-cols-crm .crm-c-inline { display: block; }
  .lr-row-head.lr-cols-crm { display: none; }
}

/* one customer (CustomersPage.dc.html profile): a 320px profile column - the initials, call / email, the facts, tags -
   beside the page's tabs and their content */
.crm-profile { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; align-items: start; }
@container lr-app (min-width: 900px) { .crm-profile { grid-template-columns: 320px minmax(0, 1fr); } }
.crm-profile-side { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
@container lr-app (min-width: 900px) { .crm-profile-side { position: sticky; top: 88px; } }
.crm-profile-main { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.crm-profile-main > .lr-tablist { align-self: flex-start; max-width: 100%; }
.crm-profile-card { gap: 16px; }
.crm-avatar { width: 64px; height: 64px; display: grid; place-items: center; border-radius: var(--r-pill);
  background: color-mix(in srgb, var(--tone-customers) 18%, transparent); color: var(--tone-customers);
  font: 500 20px/28px var(--font-mono); }
.crm-contact-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; }
.crm-profile-card .lr-facts > div { padding: 10px 0; border-top: 1px solid var(--border); }
.crm-profile-card .lr-facts dt { font: 500 11px/16px var(--font-mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-muted); }
.crm-overview { gap: 16px; }
/* numbers inside a card's own stat grid are one size down, so a date or an amount fits its tile */
.lr-card .lr-stats > .lr-stat .lr-stat-value { font-size: 22px; line-height: 28px; }

/* the page's "New ▾" (components.html action_menu): the button keeps its kind; the chevron turns while open */
.lr-action-menu > summary { width: auto; height: auto; border-radius: var(--r-control); }
.lr-action-menu > summary.lr-btn-primary { color: var(--on-brand); }
.lr-action-menu > summary.lr-btn-secondary, .lr-action-menu > summary.lr-btn-tertiary { color: var(--ink); }
.lr-action-menu > summary.lr-btn-primary:hover { background: var(--brand-hover); color: var(--on-brand); }
.lr-action-menu[open] > summary.lr-btn-primary { background: var(--brand-hover); color: var(--on-brand); }
.lr-action-menu-chev { font-size: 20px; margin-right: -4px; transition: transform var(--m-mid) var(--m-out); }
.lr-action-menu[open] .lr-action-menu-chev { transform: rotate(180deg); }
.lr-row-menu-pop > .lr-btn .icon:first-child { color: var(--ink-muted); }
/* a list search (loudr.js initRowFilters) hides rows and empty groups with the hidden attribute */
[data-find][hidden], [data-filter-group][hidden], [data-filter-none][hidden] { display: none; }
