.section-help {
  display: block;
  color: #8b9991;
  margin-top: 6px;
  font-size: 11px;
}
.project-card {
  background: #fff;
  border: 1px solid #e0e7e1;
  border-radius: 10px;
  overflow: hidden;
}
.project-band { grid-column: 1 / -1; display: flex; align-items: baseline; gap: 9px; margin: 4px 0 -4px; color: #274d40; }
.project-band span { font-weight: 650; font-size: 13px; }
.project-band small { color: #8b9991; font-size: 10px; }
.project-band.other { margin-top: 12px; padding-top: 18px; border-top: 1px solid #e3e9e4; }
.monthly-group { grid-column: 1 / -1; margin: 12px 0; border: 1px solid #d9e4dc; border-radius: 12px; background: #f8faf8; overflow: hidden; }
.monthly-group > summary { list-style: none; cursor: pointer; display: grid; grid-template-columns: 1.3fr repeat(3, 1fr); align-items: center; gap: 18px; padding: 20px 22px; background: #edf4ef; }
.monthly-group > summary::-webkit-details-marker { display: none; }
.monthly-group > summary > span small { display: block; margin-bottom: 5px; color: #789085; font-size: 9px; letter-spacing: .5px; }
.monthly-group > summary > span strong { display: inline-block; margin-right: 10px; font-size: 20px; }
.monthly-group > summary > span em { color: #6f8379; font-size: 10px; font-style: normal; }
.monthly-group > summary > div { text-align: right; }
.monthly-group > summary > div small { display: block; margin-bottom: 5px; color: #809088; font-size: 9px; }
.monthly-group > summary > div b { font-size: 15px; font-variant-numeric: tabular-nums; }
.monthly-group[open] > summary { border-bottom: 1px solid #d9e4dc; }
.monthly-group[open] > summary > span em::after { content: ' · 已展开'; color: #24634e; }
.monthly-content { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; padding: 16px; }
.project-head {
  background: linear-gradient(135deg, #f1f5f0, #f8faf8);
  padding: 16px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.project-head span small {
  display: block;
  color: #8b9991;
  font-size: 9px;
  margin-bottom: 4px;
}
.project-head strong { font-size: 15px; }
.project-head > div { text-align: right; }
.project-head > div small { display: block; color: #8b9991; font-size: 9px; margin-bottom: 4px; }
.project-head > div b { font-size: 17px; font-weight: 650; font-variant-numeric: tabular-nums; }
.project-split { display: grid; grid-template-columns: 1fr 1fr; border-bottom: 1px solid #edf1ed; }
.project-split span { padding: 11px 16px; color: #77877e; font-size: 10px; }
.project-split span + span { border-left: 1px solid #edf1ed; }
.project-split b { display: block; margin-top: 4px; color: #354c43; font-size: 12px; font-variant-numeric: tabular-nums; }
.holder-list { padding: 4px 12px; }
.holder-row {
  width: 100%;
  border: 0;
  border-bottom: 1px solid #edf1ed;
  border-radius: 0;
  padding: 12px 6px;
  text-align: left;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.holder-row:last-child { border-bottom: 0; }
.holder-row span small {
  display: block;
  color: #8c9a92;
  margin-top: 4px;
  font-size: 9px;
}
.holder-row b { font-size: 13px; font-weight: 550; }
.holder-row em { display: inline-block; margin-right: 7px; padding: 2px 6px; border-radius: 999px; background: #f0f2f0; color: #78877f; font-size: 8px; font-style: normal; }
.holder-row.is-owner em { background: #dff0e7; color: #24634e; }
.holder-row.is-owner { background: #fbfdfb; }
.holder-add { margin: 4px 12px 12px; padding: 8px 6px; font-size: 11px; }

.boss-overview { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(260px, 1fr); gap: 18px; }
.cash-hero { min-height: 230px; padding: 30px; border-radius: 16px; color: white; background: linear-gradient(135deg, #174b39 0%, #24634e 65%, #32775e 100%); display: flex; align-items: stretch; justify-content: space-between; gap: 24px; box-shadow: 0 18px 45px #163f3214; }
.cash-hero .kicker { color: #afd4c1; font-size: 10px; letter-spacing: 2px; }
.cash-hero h2 { margin: 15px 0 8px; font-size: 18px; font-weight: 500; }
.cash-hero strong { display: block; margin: 6px 0 10px; font-size: clamp(32px, 4vw, 48px); line-height: 1.1; letter-spacing: -1.5px; font-variant-numeric: tabular-nums; }
.cash-hero small { color: #b9d5c8; }
.owner-picker { width: 210px; align-self: flex-end; margin: 0; padding: 12px; border: 1px solid #ffffff26; border-radius: 10px; color: #cce1d7; background: #0d352846; }
.owner-picker select { margin-top: 7px; padding: 9px; border-color: #ffffff24; color: white; background: #1d503f; }
.summary-stack { display: grid; grid-template-rows: 1fr 1fr; gap: 14px; }
.summary-stack article { padding: 22px 24px; border: 1px solid #e0e7e1; border-radius: 14px; background: white; }
.summary-stack span { color: #687a70; font-size: 12px; }
.summary-stack h2 { margin: 13px 0 8px; font-size: 25px; font-weight: 650; font-variant-numeric: tabular-nums; }
.summary-stack small { color: #91a098; font-size: 10px; }
.flow-stats { display: grid; grid-template-columns: repeat(3, 1fr); margin-top: 14px; border: 1px solid #e0e7e1; border-radius: 12px; background: white; overflow: hidden; }
.flow-stats article { padding: 15px 20px; display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.flow-stats article + article { border-left: 1px solid #edf1ed; }
.flow-stats span { color: #7b8981; font-size: 11px; }
.flow-stats b { font-size: 14px; font-variant-numeric: tabular-nums; }

@media(max-width: 900px) {
  .boss-overview { grid-template-columns: 1fr; }
  .summary-stack { grid-template-columns: 1fr 1fr; grid-template-rows: auto; }
  .monthly-content { grid-template-columns: 1fr 1fr; }
  .monthly-group > summary { grid-template-columns: 1.2fr 1fr 1fr; }
  .monthly-group > summary > div:nth-of-type(2) { display: none; }
}
@media(max-width: 600px) {
  .cash-hero { min-height: 0; padding: 24px 20px; flex-direction: column; }
  .cash-hero strong { font-size: 34px; }
  .owner-picker { width: 100%; align-self: auto; }
  .summary-stack { gap: 8px; }
  .summary-stack article { padding: 17px 15px; }
  .summary-stack h2 { font-size: 19px; }
  .flow-stats { grid-template-columns: 1fr; }
  .flow-stats article + article { border-left: 0; border-top: 1px solid #edf1ed; }
  .project-split span { padding: 10px 12px; }
  .monthly-group > summary { grid-template-columns: 1fr 1fr; gap: 10px; padding: 16px; }
  .monthly-group > summary > span { grid-column: 1 / -1; }
  .monthly-group > summary > div { text-align: left; }
  .monthly-group > summary > div:nth-of-type(1) { display: none; }
  .monthly-content { grid-template-columns: 1fr; padding: 10px; }
}

/* Material 3 Expressive redesign */
:root {
  color-scheme: light dark;
  --m3-primary: #2e6a45;
  --m3-on-primary: #fff;
  --m3-primary-container: #b0f1c2;
  --m3-on-primary-container: #00210f;
  --m3-secondary: #516356;
  --m3-secondary-container: #d3e8d8;
  --m3-on-secondary-container: #102016;
  --m3-tertiary-container: #c2e8ff;
  --m3-on-tertiary-container: #001e2c;
  --m3-surface: #f6fbf4;
  --m3-surface-low: #f0f5ee;
  --m3-surface-container: #eaf0e8;
  --m3-surface-high: #e4eae2;
  --m3-surface-highest: #dee4dc;
  --m3-on-surface: #181d18;
  --m3-on-surface-variant: #414941;
  --m3-outline: #707972;
  --m3-outline-variant: #bfc9c0;
  --m3-inverse-surface: #2d322d;
  --m3-inverse-on-surface: #eef2eb;
  --m3-error: #b3261e;
  --m3-error-container: #f9dedc;
  --m3-on-error-container: #410e0b;
  --m3-shadow: rgba(24,29,24,.12);
}

@media (prefers-color-scheme: dark) {
  :root {
    --m3-primary: #96d5a9;
    --m3-on-primary: #00391c;
    --m3-primary-container: #12512e;
    --m3-on-primary-container: #b1f1c5;
    --m3-secondary: #b7cbbd;
    --m3-secondary-container: #3a4b3f;
    --m3-on-secondary-container: #d3e8d8;
    --m3-tertiary-container: #1e4d54;
    --m3-on-tertiary-container: #bbebf2;
    --m3-surface: #101411;
    --m3-surface-low: #181c1a;
    --m3-surface-container: #1c211e;
    --m3-surface-high: #272b28;
    --m3-surface-highest: #313633;
    --m3-on-surface: #dee4e0;
    --m3-on-surface-variant: #bdcac0;
    --m3-outline: #87948b;
    --m3-outline-variant: #3e4941;
    --m3-inverse-surface: #dee4e0;
    --m3-inverse-on-surface: #2d312e;
    --m3-error: #f2b8b5;
    --m3-error-container: #8c1d18;
    --m3-on-error-container: #f9dedc;
    --m3-shadow: rgba(0,0,0,.35);
  }
}

html,body { color: var(--m3-on-surface); background: var(--m3-surface-low); }
body,button,input,select { font-family: -apple-system,BlinkMacSystemFont,"Segoe UI","PingFang SC","Noto Sans CJK SC",sans-serif; }
button,input,select,dialog,article,section,aside,main { box-sizing: border-box; }
button { min-height: 48px; border-color: var(--m3-outline-variant); border-radius: 999px; color: var(--m3-on-surface); background: var(--m3-surface); transition: transform .24s cubic-bezier(.2,.9,.2,1.2),background-color .18s ease; }
button:hover { background: var(--m3-surface-high); }
button:active { transform: scale(.97); }
.primary { min-height: 56px; padding: 0 26px; border: 0; border-radius: 999px; color: var(--m3-on-primary); background: var(--m3-primary); font-weight: 700; }
.primary:hover { background: color-mix(in srgb,var(--m3-primary) 88%,var(--m3-on-surface)); }
input,select { min-height: 56px; border: 1px solid var(--m3-outline); border-radius: 16px; color: var(--m3-on-surface); background: var(--m3-surface); }
input::placeholder { color: var(--m3-on-surface-variant); opacity: .72; }
input:focus-visible,select:focus-visible { outline: 2px solid var(--m3-primary); outline-offset: 0; border-color: var(--m3-primary); }
p,.section-help,small,label { color: var(--m3-on-surface-variant); }
.green { color: var(--m3-primary); }
.red { color: var(--m3-error); }

aside { width: 220px; padding: 24px 16px; color: var(--m3-on-surface); background: var(--m3-surface-container); }
main { max-width: none; min-height: 100vh; margin-left: 220px; padding: 34px clamp(28px,4vw,64px) 56px; background: var(--m3-surface-low); }
.menu-toggle { top: 20px; left: 18px; width: 56px; min-height: 56px; border: 0; border-radius: 50%; color: var(--m3-on-surface); background: var(--m3-surface-high); }
.menu-toggle img { filter: none; opacity: .75; }
.nav-menu { gap: 8px; margin-top: 78px; }
.nav-menu .nav { min-height: 56px; padding: 0 18px; border-radius: 999px; color: var(--m3-on-surface-variant); background: transparent; font-weight: 650; }
.nav-menu .nav span { color: inherit; font-size: 20px; }
.nav-menu .nav:hover { color: var(--m3-on-surface); background: var(--m3-surface-high); }
.nav-menu .nav.active { color: var(--m3-on-secondary-container); background: var(--m3-secondary-container); }
.nav-menu .nav.active span { color: var(--m3-on-secondary-container); }
.sidebar-tools,.sidebar-account { right: 16px; left: 16px; }
.sidebar-tools { bottom: 142px; }
.sidebar-account { bottom: 20px; }
.sidebar-tools select,.sidebar-tools button,.sidebar-account button { min-height: 48px; border: 0; border-radius: 999px; color: var(--m3-on-surface); background: var(--m3-surface-high); }
.sidebar-tools button:hover,.sidebar-account button:hover { color: var(--m3-on-secondary-container); background: var(--m3-secondary-container); }
aside.is-collapsed { width: 96px; padding-right: 12px; padding-left: 12px; }
aside.is-collapsed+main { margin-left: 96px; }
aside.is-collapsed .nav-menu .nav { min-height: 64px; border-radius: 24px; }
aside.is-collapsed .nav-menu .nav span { font-size: 22px; }
aside.is-collapsed .sidebar-tools,aside.is-collapsed .sidebar-account { right: 12px; left: 12px; }

header { align-items: center; }
header>div { min-width: 0; }
header h1 { margin: 0; color: var(--m3-on-surface); font-size: clamp(32px,3vw,42px); line-height: 1.15; letter-spacing: -.8px; }
header p { margin: 7px 0 0; color: var(--m3-on-surface-variant); }
header>.primary { min-width: 150px; }
.notice { width: fit-content; margin: 22px 0 26px; padding: 8px 10px 8px 14px; border: 0; border-radius: 999px; color: var(--m3-on-secondary-container); background: var(--m3-secondary-container); }
.notice .text { min-height: 34px; padding: 0 12px; color: var(--m3-on-secondary-container); }
.role-badge { color: var(--m3-on-tertiary-container); background: var(--m3-tertiary-container); }

.executive-stats { grid-template-columns: 1fr 1fr; gap: 3px; }
.executive-stats article { min-height: 126px; padding: 24px 28px; border: 1px solid var(--m3-outline-variant); border-radius: 8px; color: var(--m3-on-surface); background: var(--m3-surface); box-shadow: none; }
.executive-stats .primary-stat { grid-column: 1/-1; min-height: 156px; padding: 28px 34px; border: 0; border-radius: 32px; color: var(--m3-on-primary-container); background: var(--m3-primary-container); }
.executive-stats .owner-stat { border-radius: 32px 8px 8px 32px; }
.executive-stats article:last-child { border-radius: 8px 32px 32px 8px; }
.executive-stats span { color: inherit; font-size: 15px; font-weight: 650; }
.executive-stats h2 { margin: 12px 0 8px; color: inherit; font-size: clamp(30px,4vw,54px); font-weight: 750; line-height: 1; letter-spacing: -1.6px; }
.executive-stats article:not(.primary-stat) h2 { font-size: clamp(25px,2.5vw,38px); }
.executive-stats small { color: inherit; opacity: .78; }
.owner-inline select { min-height: 40px; border: 0; border-radius: 999px; color: var(--m3-on-secondary-container); background: var(--m3-secondary-container); }

.overview-projects { margin-top: 36px; }
.section-title h3,.overview-projects h3,.accounts-section h3 { color: var(--m3-on-surface); font-size: 24px; }
.overview-project-grid { gap: 16px; }
.overview-group { overflow: hidden; border: 0; border-radius: 32px; background: var(--m3-surface); box-shadow: 0 2px 8px var(--m3-shadow); }
.overview-group-head { padding: 20px 24px; background: var(--m3-surface-container); }
.overview-group-head strong,.overview-group-head b { color: var(--m3-on-surface); }
.overview-table-head { color: var(--m3-on-surface-variant); background: var(--m3-surface-low); }
.overview-project-row { min-height: 72px; border-color: var(--m3-outline-variant); color: var(--m3-on-surface); background: var(--m3-surface); }
.overview-project-row:hover { background: var(--m3-surface-high); }
.overview-project-row span { color: var(--m3-on-surface-variant); }
.zero-projects { color: var(--m3-on-surface-variant); background: var(--m3-surface); }

.accounts-section,.ledger,.weekly { color: var(--m3-on-surface); }
.accounts-section>.section-title,.ledger>.section-title { align-items: center; }
#account-add,.more-actions>summary { min-height: 48px; padding: 0 18px; border: 0; border-radius: 999px; color: var(--m3-on-primary); background: var(--m3-primary); }
.cash-ledger-head { color: var(--m3-on-surface-variant); background: var(--m3-surface-container); }
.cash-ledger-group { overflow: hidden; border: 0; border-radius: 28px; background: var(--m3-surface); box-shadow: 0 2px 8px var(--m3-shadow); }
.cash-ledger-row { border-color: var(--m3-outline-variant); background: var(--m3-surface); }
.cash-ledger-row.group-row { background: var(--m3-secondary-container); }
.row-actions button { min-height: 40px; border-radius: 999px; }
.row-actions .row-primary { color: var(--m3-on-primary); background: var(--m3-primary); }
.row-delete,.danger-soft { color: var(--m3-on-error-container); background: var(--m3-error-container); }

.ledger { border: 0; border-radius: 32px; background: var(--m3-surface); box-shadow: 0 2px 8px var(--m3-shadow); }
.ledger-summary { gap: 3px; border: 0; border-radius: 28px; background: transparent; box-shadow: none; }
.ledger-summary article { background: var(--m3-surface-container); }
.ledger-summary article:first-child { border-radius: 28px 8px 8px 28px; }
.ledger-summary article:last-child { border-radius: 8px 28px 28px 8px; }
.filters #search { border: 0; border-radius: 999px; background: var(--m3-surface-high); }
.filters select,.filters input,.filters button { border-color: var(--m3-outline); border-radius: 999px; background: var(--m3-surface); }
.transaction-row { min-height: 76px; border-color: var(--m3-outline-variant); }
.transaction-icon { color: var(--m3-on-primary-container); background: var(--m3-primary-container); }
.transaction-icon.red { color: var(--m3-on-error-container); background: var(--m3-error-container); }
.transaction-actions button { border: 0; border-radius: 999px; color: var(--m3-on-secondary-container); background: var(--m3-secondary-container); }

.weekly-switch,.cash-type-toggle { border-radius: 999px; background: var(--m3-surface-high); }
.weekly-switch button,.cash-type-toggle button { border-radius: 999px; }
.weekly-switch button.active,.cash-type-toggle button.active { color: var(--m3-on-primary); background: var(--m3-primary); box-shadow: none; }
.weekly-empty,.weekly-stats,.weekly-entry,.weekly-report,.weekly-archive details { border-color: var(--m3-outline-variant); border-radius: 28px; color: var(--m3-on-surface); background: var(--m3-surface); }
.weekly-stats .weekly-grand { color: var(--m3-on-primary-container); background: var(--m3-primary-container); }
.weekly-stats .weekly-grand span { color: inherit; }
.weekly-section-title { color: var(--m3-on-secondary-container); background: var(--m3-secondary-container); }

dialog { padding: 30px; border-radius: 40px; color: var(--m3-on-surface); background: var(--m3-surface); box-shadow: 0 24px 80px var(--m3-shadow); }
dialog::backdrop { background: color-mix(in srgb,var(--m3-on-surface) 38%,transparent); backdrop-filter: blur(3px); }
dialog .section-title>button { width: 48px; min-height: 48px; border: 0; border-radius: 50%; color: var(--m3-on-surface-variant); background: var(--m3-surface-high); }
dialog input,dialog select { background: var(--m3-surface); }
.quick-entry-dialog .cash-type-toggle { padding: 4px; }
.entry-more { border-color: var(--m3-outline-variant); }
.locations-total { border-radius: 28px; color: var(--m3-on-primary-container); background: var(--m3-primary-container); }
.locations-list,.viewer-item { border-color: var(--m3-outline-variant); border-radius: 24px; background: var(--m3-surface-container); }

.auth-shell { min-height: 100dvh; padding: 28px; background: var(--m3-surface-low); }
.auth-card { width: 500px; padding: 38px 44px 42px; border: 0; border-radius: 40px; color: var(--m3-on-surface); background: var(--m3-surface); box-shadow: 0 8px 28px var(--m3-shadow); }
.auth-card .brand { margin-bottom: 34px; color: var(--m3-on-surface); font-size: 26px; font-weight: 750; text-align: center; }
.auth-card h1 { margin: 0 0 6px; color: var(--m3-on-surface); font-size: 32px; }
.auth-card label { margin-top: 22px; color: var(--m3-on-surface-variant); }
.auth-card input { background: var(--m3-surface); }
.auth-card>.language-select { min-height: 40px; border: 0; background: var(--m3-surface-high); }
.auth-note,#auth-hint { color: var(--m3-on-surface-variant); }
#toast { border-radius: 999px; color: var(--m3-inverse-on-surface); background: var(--m3-inverse-surface); }

.mobile-bottom-nav { display: none; }

@media (max-width:600px) {
  body { background: var(--m3-surface-low); }
  #workspace { padding-bottom: 82px; }
  aside { position: sticky; top: 0; z-index: 20; width: 100%; min-height: 64px; padding: 8px 16px; color: var(--m3-on-surface); background: color-mix(in srgb,var(--m3-surface) 92%,transparent); box-shadow: none; backdrop-filter: blur(16px); }
  .menu-toggle { width: 48px; min-height: 48px; color: var(--m3-on-surface); background: var(--m3-surface-high); }
  .menu-toggle img { filter: none; }
  .nav-menu { inset: 64px auto 0 0; width: min(84vw,340px); height: calc(100dvh - 64px); padding: 18px 14px 170px; color: var(--m3-on-surface); background: var(--m3-surface-container); box-shadow: 18px 0 50px var(--m3-shadow); }
  .nav-menu .nav { min-height: 56px; color: var(--m3-on-surface-variant); background: transparent; }
  .nav-menu .nav.active { color: var(--m3-on-secondary-container); background: var(--m3-secondary-container); }
  .menu-scrim { inset: 64px 0 auto; height: calc(100dvh - 64px); background: color-mix(in srgb,var(--m3-on-surface) 32%,transparent); }
  .sidebar-tools,.sidebar-account { width: calc(min(84vw,340px) - 28px); }
  .sidebar-tools select,.sidebar-tools button,.sidebar-account button { color: var(--m3-on-surface); background: var(--m3-surface-high); }
  main { width: 100%; margin: 0; padding: 12px 16px 104px; background: var(--m3-surface-low); }
  header { min-height: 64px; align-items: center; flex-direction: row; gap: 10px; }
  header>div { flex: 1; }
  header h1 { font-size: 30px; }
  header p { display: none; }
  header>.primary { width: 52px; min-width: 52px; height: 52px; min-height: 52px; overflow: hidden; padding: 0; font-size: 0; }
  header>.primary::before { content: '+'; font-size: 28px; font-weight: 400; }
  .notice { max-width: 100%; margin: 10px 0 16px; padding: 7px 12px; align-items: center; flex-direction: row; }
  .notice .account-actions { display: none; }
  .executive-stats { grid-template-columns: 1fr; gap: 8px; }
  .executive-stats .primary-stat { min-height: 140px; padding: 24px; border-radius: 32px; }
  .executive-stats .owner-stat,.executive-stats article:last-child { min-height: 96px; padding: 18px 20px; border: 0; border-radius: 24px; background: var(--m3-surface); box-shadow: 0 1px 4px var(--m3-shadow); }
  .executive-stats h2,.executive-stats article:not(.primary-stat) h2 { margin: 9px 0 4px; font-size: 29px; }
  .executive-stats .primary-stat h2 { font-size: 38px; }
  .overview-projects { margin-top: 28px; }
  .section-title h3,.overview-projects h3,.accounts-section h3 { font-size: 23px; }
  .overview-group { border-radius: 28px; box-shadow: none; }
  .overview-group-head { padding: 17px 18px; }
  .overview-table-head { display: none; }
  .overview-project-row { grid-template-columns: minmax(0,1fr) auto 22px; min-height: 76px; padding: 14px 18px; }
  .overview-project-row span { grid-column: 1; grid-row: 2; }
  .overview-project-row i { grid-column: 3; grid-row: 1/3; }
  .accounts-section>.section-title,.ledger>.section-title { align-items: stretch; flex-direction: column; }
  #account-add { width: 100%; }
  .cash-ledger-group { border-radius: 28px; box-shadow: none; }
  .ledger { padding: 16px; border-radius: 28px; box-shadow: none; }
  .ledger-summary { grid-template-columns: 1fr; gap: 3px; }
  .ledger-summary article,.ledger-summary article:first-child,.ledger-summary article:last-child { border-radius: 14px; }
  .filters { grid-template-columns: 1fr 1fr; }
  .filters #search { grid-column: 1/-1; }
  .transaction-row { padding: 12px 2px; }
  dialog,.quick-entry-dialog,.locations-dialog,.password-dialog,.viewers-dialog { inset: 0 0 0; width: calc(100vw - 16px); max-width: calc(100vw - 16px); max-height: calc(100dvh - 16px); margin: auto; padding: 24px 20px; border-radius: 36px; }
  .auth-shell { padding: 0; background: var(--m3-surface-low); }
  .auth-card { width: 100%; min-height: 100dvh; padding: max(24px,env(safe-area-inset-top)) 20px 30px; border-radius: 0; box-shadow: none; background: var(--m3-surface-low); }
  .auth-card .brand { margin: 6px 0 70px; font-size: 21px; text-align: left; }
  .auth-card h1 { font-size: 32px; }
  .auth-card input { background: var(--m3-surface); }
  .auth-card>.language-select { float: none; position: absolute; top: max(18px,env(safe-area-inset-top)); right: 20px; margin: 0; }
  .mobile-bottom-nav { position: fixed; right: 0; bottom: 0; left: 0; z-index: 18; display: grid; grid-template-columns: repeat(3,1fr); min-height: 80px; padding: 8px max(12px,env(safe-area-inset-right)) calc(8px + env(safe-area-inset-bottom)) max(12px,env(safe-area-inset-left)); background: var(--m3-surface-container); box-shadow: 0 -2px 10px var(--m3-shadow); }
  .mobile-bottom-nav button { display: grid; place-items: center; align-content: center; gap: 3px; min-height: 58px; padding: 4px; border: 0; border-radius: 22px; color: var(--m3-on-surface-variant); background: transparent; font-size: 11px; }
  .mobile-bottom-nav button span { display: grid; place-items: center; width: 64px; height: 32px; border-radius: 999px; font-size: 20px; }
  .mobile-bottom-nav button.active { color: var(--m3-on-secondary-container); }
  .mobile-bottom-nav button.active span { background: var(--m3-secondary-container); }
}

@media (prefers-reduced-motion: no-preference) {
  .page-panel { animation: m3-page-in .38s cubic-bezier(.2,.9,.2,1.15); }
  dialog[open] { animation: m3-dialog-in .36s cubic-bezier(.2,.9,.2,1.15); }
}
@keyframes m3-page-in { from { opacity: 0; transform: translateY(10px) scale(.99); } to { opacity: 1; transform: none; } }
@keyframes m3-dialog-in { from { opacity: 0; transform: translateY(18px) scale(.96); } to { opacity: 1; transform: none; } }

/* Executive ledger layout */
.executive-stats { display: grid; grid-template-columns: 1.35fr 1fr 1fr; gap: 12px; margin-bottom: 28px; }
.executive-stats article { min-width: 0; padding: 20px 22px; border: 1px solid #dfe6e1; border-radius: 11px; background: #fff; }
.executive-stats article > span { display: block; color: #63766c; font-size: 12px; }
.executive-stats h2 { margin: 14px 0 8px; font-size: clamp(20px, 2vw, 29px); font-weight: 650; letter-spacing: -.6px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.executive-stats small { color: #8b9891; font-size: 10px; }
.executive-stats .primary-stat { border-color: #245b48; color: #fff; background: #215540; }
.executive-stats .primary-stat > span,.executive-stats .primary-stat small { color: #c4d9cf; }
.owner-inline { display: flex; align-items: center; gap: 8px; margin: 6px 0 0; color: #6f8278; font-size: 10px; }
.owner-inline select { width: auto; min-width: 92px; margin: 0; padding: 6px 24px 6px 8px; border-color: #ffffff2e; color: #fff; background: #174735; font-size: 11px; }
.primary-stat .owner-inline { color: #c4d9cf; }
.net-stat h2 { color: #24634e; }
.net-stat small b { margin: 0 3px; font-size: 10px; }

.overview-projects { margin-top: 30px; }
.overview-project-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 12px; }
.project-summary-card { min-width: 0; padding: 18px 19px; border: 1px solid #dfe6e1; border-radius: 11px; text-align: left; background: #fff; }
.project-summary-card:hover { border-color: #9ebcad; background: #f7faf8; transform: translateY(-1px); }
.project-summary-card > span { display: block; color: #789087; font-size: 9px; letter-spacing: 1px; }
.project-summary-card > strong { display: block; margin-top: 8px; color: #263f36; font-size: 15px; }
.project-summary-card > b { display: block; margin: 18px 0 12px; color: #1f5944; font-size: 21px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.project-summary-card > small { display: flex; justify-content: space-between; align-items: center; color: #84938b; font-size: 9px; }
.project-summary-card > small i { float: none; color: #2d7057; font-size: 18px; line-height: 1; }
.overview-project-empty { grid-column: 1/-1; padding: 28px; border: 1px dashed #ccd9d1; border-radius: 10px; color: #839188; text-align: center; background: #fafcfb; }

/* Grouped executive overview */
.overview-project-grid { display: grid; grid-template-columns: 1fr; gap: 18px; }
.overview-group { overflow: hidden; border: 1px solid #dce5df; border-radius: 11px; background: #fff; }
.overview-group-head { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 15px 20px; background: #eaf2ed; }
.overview-group-head > div { display: flex; align-items: baseline; gap: 10px; }
.overview-group-head strong { color: #214c3c; font-size: 16px; }
.overview-group-head span,.overview-group-head small { color: #71847a; font-size: 10px; }
.overview-group-head > div:last-child { justify-content: flex-end; }
.overview-group-head > div:last-child b { color: #173f31; font-size: 17px; font-variant-numeric: tabular-nums; }
.overview-table-head,.overview-project-row { display: grid; grid-template-columns: 1.45fr 1fr 1fr 28px; align-items: center; gap: 16px; }
.overview-table-head { padding: 11px 20px; color: #86948d; background: #f7f9f7; font-size: 10px; }
.overview-project-row { width: 100%; min-height: 52px; padding: 10px 20px; border: 0; border-top: 1px solid #e8ece9; border-radius: 0; text-align: left; background: #fff; }
.overview-project-row:hover { background: #f6faf7; }
.overview-project-row strong { font-size: 13px; }
.overview-project-row b { color: #1d5842; font-size: 14px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.overview-project-row span { color: #77887f; font-size: 11px; }
.overview-project-row i { float: none; color: #2f6a55; font-size: 20px; text-align: right; }
.zero-projects { border-top: 1px solid #e8ece9; background: #f9fbf9; }
.zero-projects > summary { display: flex; align-items: center; gap: 8px; padding: 12px 20px; list-style: none; color: #446558; cursor: pointer; font-size: 12px; }
.zero-projects > summary::-webkit-details-marker { display: none; }
.zero-projects > summary::before { content: '›'; font-size: 18px; transition: transform .15s ease; }
.zero-projects[open] > summary::before { transform: rotate(90deg); }
.zero-projects > summary b { color: #73847b; font-weight: 500; }
.zero-projects > summary span { margin-left: auto; color: #8b9891; font-size: 10px; }

.ledger-summary { display: grid; grid-template-columns: repeat(3,1fr); margin: 4px 0 20px; border: 1px solid #e1e7e3; border-radius: 9px; overflow: hidden; }
.ledger-summary article { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; background: #fafcfb; }
.ledger-summary article + article { border-left: 1px solid #e1e7e3; }
.ledger-summary span { color: #718078; font-size: 11px; }
.ledger-summary b { font-size: 14px; font-variant-numeric: tabular-nums; }
.more-actions { position: relative; }
.more-actions > summary { padding: 8px 13px; border: 1px solid #dce4df; border-radius: 7px; list-style: none; cursor: pointer; }
.more-actions > summary::-webkit-details-marker { display: none; }
.more-actions-menu { position: absolute; right: 0; z-index: 4; display: grid; gap: 4px; width: 150px; margin-top: 6px; padding: 7px; border: 1px solid #dce4df; border-radius: 9px; background: #fff; box-shadow: 0 12px 32px #153b321a; }
.more-actions-menu button { width: 100%; border: 0; text-align: left; background: transparent; }
.locations-dialog { width: 480px; }
.locations-dialog .section-title { align-items: flex-start; }
.locations-dialog .section-title small { display: block; margin-bottom: 6px; color: #6d8d7e; font-size: 9px; letter-spacing: 1.2px; }
.locations-total { display: flex; align-items: center; justify-content: space-between; margin: 22px 0 12px; padding: 18px; border-radius: 10px; color: #fff; background: #225a45; }
.locations-total span { color: #c8ddd3; font-size: 11px; }
.locations-total strong { font-size: 24px; font-variant-numeric: tabular-nums; }
.locations-list { border: 1px solid #e1e7e3; border-radius: 10px; overflow: hidden; }
.location-item { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 15px 17px; background: #fff; }
.location-item + .location-item { border-top: 1px solid #e8ece9; }
.location-item span b { display: block; font-size: 13px; }
.location-item span small { display: block; margin-top: 4px; color: #87958d; font-size: 9px; }
.location-item-actions { display: flex; align-items: center; gap: 10px; }
.location-item-actions strong { font-size: 15px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.location-item-actions button,.row-delete { border-color: #ebc9c4; color: #a84f43; background: #fff7f5; }
.location-item-actions button:hover,.row-delete:hover { background: #fbe9e6; }
.locations-note { margin: 14px 2px 0; font-size: 10px; }

.accounts { display: block; }
.cash-ledger-head,.cash-ledger-row { display: grid; grid-template-columns: minmax(170px,1.7fr) .8fr 1.15fr 1.15fr 1.15fr 1fr; align-items: center; column-gap: 16px; }
.cash-ledger-head { padding: 12px 18px; border-radius: 8px 8px 0 0; color: #fff; background: #235b47; font-size: 11px; font-weight: 600; }
.cash-ledger-group { display: block; border: 1px solid #dfe6e1; border-top: 0; background: #fff; }
.cash-group-title { display: flex; align-items: baseline; gap: 12px; padding: 12px 18px; border-bottom: 1px solid #e6ebe7; color: #274d40; background: #edf4ef; }
.cash-group-title strong { font-size: 13px; }
.cash-group-title span { color: #78887f; font-size: 10px; }
.cash-ledger-row { min-height: 64px; padding: 10px 18px; border-bottom: 1px solid #e8ece9; }
.cash-ledger-row:last-child { border-bottom: 0; }
.cash-ledger-row:hover { background: #fafcfb; }
.project-name { min-width: 0; display: flex; align-items: center; gap: 8px; }
.project-name strong { font-size: 14px; white-space: nowrap; }
.project-name small { color: #849189; font-size: 9px; }
.frequency { color: #708078; font-size: 12px; }
.ledger-amount,.holder-cell { min-width: 0; font-variant-numeric: tabular-nums; }
.ledger-amount b { font-size: 13px; white-space: nowrap; }
.holder-cell { display: grid; gap: 3px; }
.amount-link { width: 100%; padding: 2px 0; border: 0; border-radius: 3px; text-align: left; background: transparent; }
.amount-link:hover { background: #eef5f1; }
.amount-link b { display: block; font-size: 12px; font-weight: 600; white-space: nowrap; }
.amount-link small { display: block; margin-top: 2px; color: #849189; font-size: 8px; }
.zero { color: #9ba69f; font-size: 11px; }
.row-actions { display: flex; align-items: center; justify-content: flex-end; gap: 5px; }
.row-actions button { padding: 7px 10px; font-size: 11px; }
.row-primary { border-color: #24634e; color: #fff; background: #24634e; }
.row-primary:hover { background: #174b39; }
.row-manage { border: 0; color: #527568; background: transparent; }
.row-delete { padding-right: 8px!important; padding-left: 8px!important; }
.cash-ledger-group.monthly { border-top: 0; }
.cash-ledger-group.monthly > summary { list-style: none; cursor: pointer; }
.cash-ledger-group.monthly > summary::-webkit-details-marker { display: none; }
.group-row { min-height: 68px; color: #1e4b3b; background: #e7f0ea; }
.group-row:hover { background: #e1ece5; }
.chevron { display: inline-block; font-size: 23px; line-height: 1; transition: transform .15s ease; }
.monthly[open] .chevron { transform: rotate(90deg); }
.expand-label { justify-self: end; color: #24634e; font-size: 11px; font-weight: 600; }
.expand-label .when-open { display: none; }
.monthly[open] .expand-label .when-closed { display: none; }
.monthly[open] .expand-label .when-open { display: inline; }
.monthly-rows { background: #fbfcfb; }
.cash-ledger-row.child { min-height: 60px; padding-left: 30px; }
.cash-ledger-row.child .project-name strong { font-size: 13px; }
.branch { color: #9caaa2; }

@media(max-width: 1100px) {
  .executive-stats { grid-template-columns: 1fr 1fr; }
  .overview-project-grid { grid-template-columns: 1fr; }
  .cash-ledger-head,.cash-ledger-row { grid-template-columns: minmax(150px,1.5fr) 1fr 1fr 1fr .9fr; }
  .cash-ledger-head > span:nth-child(2),.cash-ledger-row > .frequency { display: none; }
}
/* With the permanent sidebar, the ledger needs its card layout before the
   browser itself becomes phone-sized. This keeps amounts readable in a
   half-width desktop window and on tablets. */
@media(max-width: 980px) {
  .executive-stats { grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 22px; }
  .executive-stats article { padding: 15px 14px; }
  .executive-stats h2 { margin: 10px 0 6px; font-size: 18px; white-space: normal; }
  .executive-stats .primary-stat { grid-column: 1 / -1; }
  .net-stat { grid-column: 1 / -1; }
  .cash-ledger-head { display: none; }
  .cash-ledger-group { border-top: 1px solid #dfe6e1; margin-bottom: 10px; border-radius: 9px; overflow: hidden; }
  .cash-ledger-row { grid-template-columns: 1fr auto; gap: 8px 12px; padding: 13px 14px; }
  .cash-ledger-row > .project-name { grid-column: 1; }
  .cash-ledger-row > .ledger-amount { grid-column: 2; text-align: right; }
  .cash-ledger-row > .holder-cell { grid-column: auto; padding-top: 8px; border-top: 1px solid #edf0ed; }
  .cash-ledger-row > .row-actions,.cash-ledger-row > .expand-label { grid-column: 1 / -1; justify-self: stretch; justify-content: flex-end; }
  .group-row > .holder-cell { display: none; }
  .group-row > .ledger-amount:nth-of-type(3) { display: none; }
  .cash-ledger-row.child { padding-left: 14px; }
  .row-actions button { min-height: 36px; }
  .overview-table-head { display: none; }
  .overview-project-row { grid-template-columns: 1fr auto 24px; gap: 7px 12px; }
  .overview-project-row strong { grid-column: 1; }
  .overview-project-row b { grid-column: 2; text-align: right; }
  .overview-project-row span { grid-column: 1 / 3; }
  .overview-project-row i { grid-column: 3; grid-row: 1 / 3; }
}

@media(max-width: 520px) {
  .executive-stats { grid-template-columns: 1fr; }
  .executive-stats .primary-stat,.net-stat { grid-column: auto; }
  .executive-stats h2 { font-size: clamp(20px, 7vw, 27px); overflow-wrap: anywhere; }
  .owner-inline { align-items: stretch; flex-direction: column; }
  .owner-inline select { width: 100%; }
  .cash-hero strong { font-size: clamp(25px, 9vw, 34px); overflow-wrap: anywhere; }
  .project-name strong { white-space: normal; overflow-wrap: anywhere; }
  .cash-ledger-row { grid-template-columns: minmax(0,1fr) auto; }
  .row-actions { display: grid; grid-template-columns: repeat(3,1fr); }
  .row-actions button { width: 100%; }
  .location-item { align-items: flex-start; }
  .location-item-actions { align-items: flex-end; flex-direction: column; }
  .overview-project-grid { grid-template-columns: 1fr; }
  .locations-total { align-items: flex-start; flex-direction: column; gap: 8px; }
  .overview-group-head { align-items: flex-start; flex-direction: column; gap: 6px; }
  .overview-group-head > div:last-child { width: 100%; justify-content: space-between; }
  .zero-projects > summary span { display: none; }
  .ledger-summary { grid-template-columns: 1fr; }
  .ledger-summary article + article { border-left: 0; border-top: 1px solid #e1e7e3; }
}

/* Phone cards keep the same Cashbook visual tokens as desktop. */
@media(max-width:600px) {
  .executive-stats { gap: 10px; }
  .executive-stats article { border: 1px solid #dfe6e1; border-radius: 11px; background: #fff; box-shadow: none; }
  .executive-stats .primary-stat { border: 1px solid #245b48; background: #215540; box-shadow: none; }
  .executive-stats article > span { color: #63766c; }
  .executive-stats h2 { color: #263a35; }
  .executive-stats .primary-stat h2 { color: #fff; }
  .executive-stats .primary-stat > span,.executive-stats .primary-stat small { color: #c4d9cf; }
  .overview-projects { margin-top: 28px; }
  .overview-group { border: 1px solid #dfe6e1; border-radius: 11px; box-shadow: none; }
  .overview-group-head { padding: 15px 16px; background: #e8f0eb; }
  .overview-project-row { min-height: 58px; padding: 12px 16px; border-color: #e8ece9; }
  .overview-project-row:hover { background: #fff; }
  .zero-projects { border-color: rgba(60,60,67,.12); background: #f9f9fb; }
  .monthly-group,.project-card { border: 1px solid #dfe6e1; border-radius: 11px; box-shadow: none; }
  .monthly-group > summary { background: #e8f0eb; }
  .cash-ledger-group { border: 1px solid #dfe6e1; border-radius: 11px; box-shadow: none; }
  .cash-ledger-row { border-color: rgba(60,60,67,.12); background: #fff; }
  .cash-ledger-row:hover { background: #fff; }
  .group-row { background: #e8f0eb; }
  .row-actions button { border: 0; border-radius: 10px; color: #246b52; background: #f2f2f7; }
  .row-actions .row-primary { color: #fff; background: #246b52; }
  .ledger-summary { gap: 0; border: 0; border-radius: 14px; background: #f9f9fb; box-shadow: inset 0 0 0 .5px rgba(60,60,67,.15); }
  .ledger-summary article { background: transparent; }
  .ledger-summary article + article { border-color: rgba(60,60,67,.12); }
  .locations-total { border-radius: 14px; background: #246b52; }
  .locations-list { border: 0; border-radius: 14px; background: #f2f2f7; }
  .location-item { background: transparent; }
}

/* Fast cash entry and weekly close */
.cash-type-toggle { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 6px; padding: 5px; border-radius: 12px; background: #edf1ee; }
.cash-type-toggle button { width: 100%; min-width: 0; min-height: 42px; padding-right: 6px; padding-left: 6px; border: 0; border-radius: 9px; color: #65766e; background: transparent; font-size: 12px; font-weight: 650; white-space: nowrap; }
.cash-type-toggle button.active { color: #fff; background: #246b52; box-shadow: 0 2px 7px #143d2f24; }
.quick-entry-dialog { width: min(560px,calc(100vw - 28px)); }
.quick-entry-dialog form { display: grid; gap: 16px; }
.quick-entry-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.quick-entry-fields label { margin: 0; }
.quick-entry-fields .wide,.quick-entry-fields #target-label { grid-column: 1/-1; }
.entry-more { border-top: 1px solid #e3e9e5; }
.entry-more summary { padding: 13px 2px 4px; color: #688077; cursor: pointer; font-size: 11px; }
.entry-more .form-grid { margin-top: 10px; }

.transaction-list { display: grid; }
.transaction-row { display: grid; grid-template-columns: 38px minmax(0,1fr) auto; align-items: center; gap: 12px; min-height: 72px; padding: 12px 6px; border-bottom: 1px solid #e7ece8; }
.transaction-icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; color: #315d4d; background: #dff3e8; font-size: 18px; font-weight: 700; }
.transaction-icon.red { color: #9b4e42; background: #fce8e4; }
.transaction-copy { min-width: 0; }
.transaction-copy b,.transaction-copy small { display: block; }
.transaction-copy b { overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.transaction-copy small { margin-top: 5px; overflow: hidden; color: #819088; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.transaction-actions { display: flex; gap: 5px; }
.transaction-actions button { padding: 7px 9px; border-color: #dfe6e1; color: #47675b; background: #fff; font-size: 10px; }

.weekly { max-width: 1080px; }
.weekly-switch { display: inline-grid; grid-template-columns: 1fr 1fr; gap: 4px; margin-bottom: 18px; padding: 4px; border-radius: 11px; background: #e7ede9; }
.weekly-switch button { min-width: 150px; padding: 10px 16px; border: 0; border-radius: 8px; color: #64786e; background: transparent; font-size: 12px; font-weight: 650; }
.weekly-switch button.active { color: #fff; background: #215b45; box-shadow: 0 2px 8px #153d2f25; }
.weekly-empty { max-width: 520px; padding: 28px; border: 1px solid #dde6e0; border-radius: 14px; background: #fff; }
.weekly-empty > span { color: #71867b; font-size: 10px; letter-spacing: 1px; }
.weekly-empty h3 { margin: 8px 0; font-size: 22px; }
.weekly-empty p { margin: 0 0 22px; color: #718078; font-size: 12px; line-height: 1.7; }
.weekly-empty form { display: grid; gap: 14px; }
.weekly-head { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 12px; }
.weekly-head small { color: #75867e; font-size: 10px; }
.weekly-head h3 { margin: 5px 0 0; font-size: 22px; }
.weekly-holder-label { display: flex; align-items: center; gap: 8px; margin: 10px 0 0; color: #6f8178; font-size: 10px; }
.weekly-holder-label select { width: auto; min-width: 150px; margin: 0; padding: 7px 28px 7px 10px; font-size: 11px; }
.danger-soft { border-color: #efc8c2; color: #a64f43; background: #fff7f5; }
.weekly-stats { display: grid; grid-template-columns: repeat(4,1fr); overflow: hidden; margin-bottom: 14px; border: 1px solid #dce5df; border-radius: 13px; background: #fff; }
.weekly-stats article { min-width: 0; padding: 16px 18px; }
.weekly-stats article + article { border-left: 1px solid #e4e9e6; }
.weekly-stats span,.weekly-stats b { display: block; }
.weekly-stats span { color: #7a8981; font-size: 9px; letter-spacing: .7px; }
.weekly-stats b { margin-top: 8px; font-size: 17px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.weekly-stats .weekly-grand { color: #fff; background: #215b45; }
.weekly-stats .weekly-grand span { color: #c5dbd0; }
.weekly-entry { display: grid; grid-template-columns: 270px 1fr 1fr 1.35fr auto; align-items: end; gap: 10px; padding: 14px; border: 1px solid #dce5df; border-radius: 13px; background: #f8faf8; }
.weekly-entry .cash-type-toggle { grid-template-columns: 1fr 1fr; }
.weekly-entry label { margin: 0; }
.weekly-entry input { margin: 5px 0 0; }
.weekly-entry > button { min-height: 42px; }
.weekly-report { overflow: hidden; margin-top: 14px; border: 1px solid #dce5df; border-radius: 13px; background: #fff; }
.weekly-section + .weekly-section { border-top: 1px solid #dfe6e1; }
.weekly-section-title { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; background: #eaf2ed; }
.weekly-section-title strong { color: #214d3c; font-size: 14px; }
.weekly-section-title b { font-size: 12px; font-variant-numeric: tabular-nums; }
.weekly-line { display: grid; grid-template-columns: 34px minmax(0,1fr) auto; align-items: center; gap: 11px; min-height: 61px; padding: 9px 16px; border-top: 1px solid #edf0ee; }
.weekly-sign { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: #e4f5ec; font-size: 16px; }
.weekly-sign.red { background: #fceae6; }
.weekly-line b,.weekly-line small { display: block; }
.weekly-line b { font-size: 12px; }
.weekly-line small { margin-top: 4px; color: #819088; font-size: 9px; }
.weekly-line button { padding: 6px 8px; border-color: #edc9c3; color: #a24e43; background: #fff7f5; font-size: 9px; }
.weekly-no-entry { padding: 30px; color: #83928a; text-align: center; font-size: 12px; }
.weekly-archive { margin-top: 28px; }
.weekly-archive h3 { font-size: 15px; }
.weekly-archive-list,.weekly-archive #weekly-archive-list { display: grid; gap: 7px; }
.weekly-archive details { overflow: hidden; border: 1px solid #e0e7e2; border-radius: 9px; background: #fff; }
.weekly-archive summary { display: flex; justify-content: space-between; gap: 12px; padding: 12px 14px; color: #486359; cursor: pointer; font-size: 11px; }
.weekly-archive details div { padding: 10px 14px; border-top: 1px solid #edf0ee; color: #7a8981; font-size: 10px; }
.weekly-archive p { color: #89968f; font-size: 11px; }

@media(max-width: 980px) {
  .weekly-stats { grid-template-columns: 1fr 1fr; }
  .weekly-stats article:nth-child(3) { border-top: 1px solid #e4e9e6; border-left: 0; }
  .weekly-stats article:nth-child(4) { border-top: 1px solid #e4e9e6; }
  .weekly-entry { grid-template-columns: 1fr 1fr; }
  .weekly-entry .cash-type-toggle,.weekly-entry .weekly-note { grid-column: 1/-1; }
}

@media(max-width: 600px) {
  dialog,.quick-entry-dialog,.locations-dialog,.password-dialog { inset: 0; width: calc(100vw - 24px); max-width: calc(100vw - 24px); max-height: calc(100dvh - 24px); margin: auto; padding: 22px; border-radius: 22px; overflow-x: hidden; overflow-y: auto; }
  .quick-entry-dialog form { gap: 18px; }
  .quick-entry-dialog .section-title { align-items: center; margin: 0 0 4px; }
  .quick-entry-dialog .section-title h2 { line-height: 34px; }
  .quick-entry-dialog .cash-type-toggle { width: 100%; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 4px; padding: 4px; }
  .quick-entry-dialog .cash-type-toggle button { min-height: 48px; padding: 0 3px; font-size: 13px; text-align: center; }
  .quick-entry-fields { grid-template-columns: 1fr; }
  .quick-entry-fields { gap: 16px; }
  .quick-entry-fields .wide,.quick-entry-fields #target-label { grid-column: auto; }
  .quick-entry-dialog label { width: 100%; margin: 0; font-size: 13px; }
  .quick-entry-dialog input,.quick-entry-dialog select { width: 100%; min-height: 52px; margin-top: 8px; padding-right: 14px; padding-left: 14px; }
  .quick-entry-dialog .entry-more { width: 100%; }
  .quick-entry-dialog .entry-more summary { min-height: 44px; display: flex; align-items: center; padding: 10px 2px; }
  .quick-entry-dialog .full { width: 100%; min-height: 52px; margin: 0; }
  .transaction-row { grid-template-columns: 34px minmax(0,1fr); }
  .transaction-actions { grid-column: 2; }
  .weekly-switch { display: grid; width: 100%; }
  .weekly-switch button { min-width: 0; }
  .weekly-empty { padding: 20px; }
  .weekly-head { align-items: flex-start; flex-direction: column; }
  .weekly-head button { width: 100%; }
  .weekly-holder-label { align-items: stretch; flex-direction: column; }
  .weekly-holder-label select { width: 100%; }
  .weekly-stats { grid-template-columns: 1fr; }
  .weekly-stats article + article,.weekly-stats article:nth-child(3),.weekly-stats article:nth-child(4) { border-top: 1px solid #e4e9e6; border-left: 0; }
  .weekly-entry { grid-template-columns: 1fr; }
  .weekly-entry .cash-type-toggle,.weekly-entry .weekly-note { grid-column: auto; }
  .weekly-line { padding: 10px 12px; }
}

/* Final M3 cascade: keep legacy responsive rules from overriding the theme. */
.executive-stats { grid-template-columns: 1fr 1fr; gap: 3px; margin-bottom: 28px; }
.executive-stats article { min-height: 126px; padding: 24px 28px; border: 1px solid var(--m3-outline-variant); border-radius: 8px; color: var(--m3-on-surface); background: var(--m3-surface); box-shadow: none; }
.executive-stats article>span { color: inherit; font-size: 15px; }
.executive-stats h2 { margin: 12px 0 8px; color: inherit; font-size: clamp(25px,2.5vw,38px); font-weight: 750; white-space: normal; }
.executive-stats small { color: inherit; opacity: .78; }
.executive-stats .primary-stat { grid-column: 1/-1; min-height: 156px; padding: 28px 34px; border: 0; border-radius: 32px; color: var(--m3-on-primary-container); background: var(--m3-primary-container); }
.executive-stats .primary-stat>span,.executive-stats .primary-stat small { color: inherit; }
.executive-stats .primary-stat h2 { color: inherit; font-size: clamp(36px,4vw,54px); }
.executive-stats .owner-stat { border-radius: 32px 8px 8px 32px; }
.executive-stats article:last-child { border-radius: 8px 32px 32px 8px; }
.owner-inline { color: var(--m3-on-surface-variant); }
.owner-inline select { border: 0; border-radius: 999px; color: var(--m3-on-secondary-container); background: var(--m3-secondary-container); }
.overview-project-grid { grid-template-columns: 1fr; gap: 16px; }
.overview-group { border: 0; border-radius: 32px; color: var(--m3-on-surface); background: var(--m3-surface); box-shadow: 0 2px 8px var(--m3-shadow); }
.overview-group-head { padding: 20px 24px; background: var(--m3-surface-container); }
.overview-group-head strong,.overview-group-head>div:last-child b { color: var(--m3-on-surface); }
.overview-group-head span,.overview-group-head small { color: var(--m3-on-surface-variant); }
.overview-table-head { color: var(--m3-on-surface-variant); background: var(--m3-surface-low); }
.overview-project-row { min-height: 72px; border-color: var(--m3-outline-variant); color: var(--m3-on-surface); background: var(--m3-surface); }
.overview-project-row:hover { background: var(--m3-surface-high); }
.overview-project-row b,.overview-project-row i { color: var(--m3-primary); }
.overview-project-row span { color: var(--m3-on-surface-variant); }
.zero-projects { border-color: var(--m3-outline-variant); color: var(--m3-on-surface-variant); background: var(--m3-surface); }
.cash-ledger-head { border-radius: 28px 28px 8px 8px; color: var(--m3-on-secondary-container); background: var(--m3-secondary-container); }
.cash-ledger-group { border-color: var(--m3-outline-variant); color: var(--m3-on-surface); background: var(--m3-surface); }
.cash-ledger-row { border-color: var(--m3-outline-variant); background: var(--m3-surface); }
.cash-ledger-row:hover { background: var(--m3-surface-high); }
.group-row,.cash-group-title { color: var(--m3-on-secondary-container); background: var(--m3-secondary-container); }
.amount-link { color: var(--m3-on-surface); }
.amount-link:hover { background: var(--m3-surface-high); }
.amount-link small,.project-name small,.frequency { color: var(--m3-on-surface-variant); }
.ledger-summary { gap: 3px; border: 0; border-radius: 28px; background: transparent; box-shadow: none; }
.ledger-summary article { color: var(--m3-on-surface); background: var(--m3-surface-container); }
.ledger-summary article:first-child { border-radius: 28px 8px 8px 28px; }
.ledger-summary article:last-child { border-radius: 8px 28px 28px 8px; }
.more-actions>summary { border: 0; border-radius: 999px; color: var(--m3-on-primary); background: var(--m3-primary); }
.more-actions-menu { border-color: var(--m3-outline-variant); border-radius: 20px; background: var(--m3-surface); box-shadow: 0 12px 32px var(--m3-shadow); }
.locations-total { border-radius: 28px; color: var(--m3-on-primary-container); background: var(--m3-primary-container); }
.locations-total span { color: inherit; }
.locations-list { border-color: var(--m3-outline-variant); border-radius: 24px; background: var(--m3-surface-container); }
.location-item { color: var(--m3-on-surface); background: transparent; }
.location-item+.location-item { border-color: var(--m3-outline-variant); }
.cash-type-toggle,.weekly-switch { border-radius: 999px; background: var(--m3-surface-high); }
.cash-type-toggle button,.weekly-switch button { border-radius: 999px; color: var(--m3-on-surface-variant); background: transparent; }
.cash-type-toggle button.active,.weekly-switch button.active { color: var(--m3-on-primary); background: var(--m3-primary); box-shadow: none; }
.transaction-row { border-color: var(--m3-outline-variant); }
.transaction-icon { color: var(--m3-on-primary-container); background: var(--m3-primary-container); }
.transaction-actions button { border: 0; border-radius: 999px; color: var(--m3-on-secondary-container); background: var(--m3-secondary-container); }
.weekly-empty,.weekly-stats,.weekly-entry,.weekly-report,.weekly-archive details { border-color: var(--m3-outline-variant); border-radius: 28px; color: var(--m3-on-surface); background: var(--m3-surface); }
.weekly-stats .weekly-grand { color: var(--m3-on-primary-container); background: var(--m3-primary-container); }
.weekly-stats .weekly-grand span { color: inherit; }

@media(max-width:600px) {
  .executive-stats { grid-template-columns: 1fr; gap: 8px; }
  .executive-stats article,.executive-stats .owner-stat,.executive-stats article:last-child { min-height: 96px; padding: 18px 20px; border: 0; border-radius: 24px; color: var(--m3-on-surface); background: var(--m3-surface); box-shadow: 0 1px 4px var(--m3-shadow); }
  .executive-stats .primary-stat { min-height: 140px; padding: 24px; border-radius: 32px; color: var(--m3-on-primary-container); background: var(--m3-primary-container); }
  .executive-stats h2,.executive-stats .primary-stat h2 { color: inherit; font-size: 29px; }
  .executive-stats .primary-stat h2 { font-size: 38px; }
  .executive-stats article>span,.executive-stats .primary-stat>span,.executive-stats .primary-stat small { color: inherit; }
  .overview-group { border: 0; border-radius: 28px; background: var(--m3-surface); }
  .overview-group-head { background: var(--m3-surface-container); }
  .overview-project-row { min-height: 76px; border-color: var(--m3-outline-variant); background: var(--m3-surface); }
  .overview-project-row:hover { background: var(--m3-surface-high); }
  .cash-ledger-group { border-color: var(--m3-outline-variant); border-radius: 28px; background: var(--m3-surface); }
  .cash-ledger-row { border-color: var(--m3-outline-variant); background: var(--m3-surface); }
  .group-row { background: var(--m3-secondary-container); }
  .row-actions button { border-radius: 999px; color: var(--m3-on-secondary-container); background: var(--m3-secondary-container); }
  .row-actions .row-primary { color: var(--m3-on-primary); background: var(--m3-primary); }
  .ledger-summary { gap: 3px; border-radius: 28px; background: transparent; box-shadow: none; }
  .ledger-summary article { border: 0; border-radius: 14px!important; background: var(--m3-surface-container); }
  .locations-total { color: var(--m3-on-primary-container); background: var(--m3-primary-container); }
  .locations-list { background: var(--m3-surface-container); }
}

/* Contrast guard: every dark/light component uses a paired Material role. */
body,#workspace,main,.page-panel { color: var(--m3-on-surface); background-color: var(--m3-surface-low); }
header h1,.section-title h3,.weekly-empty h3,.weekly-head h3,.weekly-archive h3,.weekly-section-title strong,.location-item span b,.viewer-item b,dialog h2 { color: var(--m3-on-surface); }
header p,.section-help,.weekly-empty>span,.weekly-empty p,.weekly-head small,.weekly-holder-label,.weekly-archive p,.weekly-archive details div,.weekly-line small,.location-item span small,.viewer-item small,.locations-note,.password-help,.viewer-help { color: var(--m3-on-surface-variant); }
.weekly-empty,.weekly-stats,.weekly-entry,.weekly-report,.weekly-archive details,.ledger,.more-actions-menu,dialog,.auth-card { color: var(--m3-on-surface); background-color: var(--m3-surface); }
.weekly-empty input,.weekly-empty select,.weekly-entry input,.weekly-entry select,.weekly-holder-label select,dialog input,dialog select,.auth-card input,.filters input,.filters select { border-color: var(--m3-outline); color: var(--m3-on-surface); background-color: var(--m3-surface-highest); }
.weekly-empty input::placeholder,.weekly-entry input::placeholder,dialog input::placeholder,.auth-card input::placeholder { color: var(--m3-on-surface-variant); opacity: .76; }
.weekly-stats article,.weekly-line,.weekly-section+.weekly-section,.weekly-archive details div,.transaction-row { border-color: var(--m3-outline-variant); }
.expand-label,.row-manage,.amount-link,.overview-project-row i { color: var(--m3-primary); }
.cash-ledger-group .group-row .expand-label { color: var(--m3-primary); }
.weekly-stats span,.weekly-entry label,.weekly-empty label,.weekly-line b,.weekly-archive summary,.transaction-copy b { color: var(--m3-on-surface); }
.weekly-section-title { color: var(--m3-on-secondary-container); background-color: var(--m3-secondary-container); }
.weekly-section-title strong { color: inherit; }
.weekly-sign,.transaction-icon { color: var(--m3-on-primary-container); background-color: var(--m3-primary-container); }
.weekly-sign.red,.transaction-icon.red { color: var(--m3-on-error-container); background-color: var(--m3-error-container); }
.danger-soft,.location-item-actions button,.row-delete { border-color: var(--m3-error); color: var(--m3-on-error-container); background-color: var(--m3-error-container); }
.quick-entry-dialog .section-title>button,dialog .section-title>button { color: var(--m3-on-surface-variant); background-color: var(--m3-surface-high); }
.entry-more { border-color: var(--m3-outline-variant); }
.entry-more summary { color: var(--m3-on-surface-variant); }
.viewer-item { border-color: var(--m3-outline-variant); background-color: var(--m3-surface-container); }
.viewer-item button { border-color: var(--m3-error); color: var(--m3-on-error-container); background-color: var(--m3-error-container); }
.auth-shell { background-color: var(--m3-surface-low); }
.auth-card .brand,.auth-card h1 { color: var(--m3-on-surface); }
#toast { color: var(--m3-inverse-on-surface); background-color: var(--m3-inverse-surface); }

@media(max-width:600px) {
  body,#workspace,main,.page-panel { background-color: var(--m3-surface-low); }
  aside { color: var(--m3-on-surface); background-color: var(--m3-surface); }
  .nav-menu { color: var(--m3-on-surface); background-color: var(--m3-surface-container); }
  .mobile-bottom-nav { color: var(--m3-on-surface); background-color: var(--m3-surface-container); }
  dialog,.quick-entry-dialog,.locations-dialog,.password-dialog,.viewers-dialog { color: var(--m3-on-surface); background-color: var(--m3-surface); }
  .auth-card { color: var(--m3-on-surface); background-color: var(--m3-surface-low); }
  .menu-toggle { width: 48px; min-width: 48px; padding: 0; border-radius: 50%; }
  .menu-toggle b { display: none; }
}

/* Account identity belongs to the single sidebar navigation. */
.sidebar-profile {
  position: absolute;
  right: 16px;
  bottom: 260px;
  left: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 11px 12px;
  border-radius: 24px;
  color: var(--m3-on-surface);
  background: var(--m3-surface-high);
}
.sidebar-avatar {
  display: grid;
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 50%;
  color: var(--m3-on-primary-container);
  background: var(--m3-primary-container);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .3px;
}
.sidebar-profile>div { min-width: 0; }
.sidebar-profile strong,.sidebar-profile small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sidebar-profile strong { color: var(--m3-on-surface); font-size: 13px; }
.sidebar-profile small { margin-top: 3px; color: var(--m3-on-surface-variant); font-size: 10px; }
aside.is-collapsed .sidebar-profile {
  right: 12px;
  bottom: 260px;
  left: 12px;
  justify-content: center;
  padding: 5px;
  background: transparent;
}
aside.is-collapsed .sidebar-profile>div { display: none; }
.mobile-bottom-nav { display: none!important; }

@media(max-width:600px) {
  #workspace { padding-bottom: 0; }
  aside { backdrop-filter: none; }
  main { padding-bottom: 32px; }
  .nav-menu {
    inset: 0 auto auto 0;
    height: 100dvh;
    padding: 80px 14px calc(20px + env(safe-area-inset-bottom));
    overflow-x: hidden;
    overflow-y: auto;
  }
  .nav-menu .nav { flex: 0 0 auto; }
  .menu-scrim { inset: 0; height: 100dvh; }
  .sidebar-profile {
    position: static;
    right: auto;
    bottom: auto;
    left: auto;
    flex: 0 0 auto;
    width: 100%;
    margin-top: 14px;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: none;
  }
  .sidebar-tools,.sidebar-account {
    position: static;
    right: auto;
    bottom: auto;
    left: auto;
    flex: 0 0 auto;
    width: 100%;
    margin-top: 10px;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: none;
  }
  aside.menu-open .sidebar-profile,aside.menu-open .sidebar-tools,aside.menu-open .sidebar-account {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: none;
  }
}

/* SOLARIS visual identity: photovoltaic imagery with readable data surfaces. */
.auth-shell {
  display: grid;
  grid-template-columns: minmax(0,1.2fr) minmax(420px,.8fr);
  align-items: stretch;
  gap: 20px;
  min-height: 100dvh;
  padding: 20px;
  background: #0d1713;
}
.auth-visual {
  position: relative;
  min-height: calc(100dvh - 40px);
  overflow: hidden;
  border-radius: 40px;
  background:
    linear-gradient(115deg,rgba(4,25,18,.62) 0%,rgba(4,25,18,.2) 50%,rgba(4,25,18,.08) 100%),
    url('solar-hero.jpg') center/cover no-repeat;
  box-shadow: inset 0 0 0 1px rgba(220,255,231,.12);
}
.auth-visual::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(rgba(210,247,221,.08) 1px,transparent 1px),
    linear-gradient(90deg,rgba(210,247,221,.08) 1px,transparent 1px);
  background-size: 72px 72px;
  mask-image: linear-gradient(to bottom,rgba(0,0,0,.7),transparent 72%);
}
.auth-visual-badge {
  position: absolute;
  z-index: 1;
  top: 30px;
  left: 30px;
  display: grid;
  grid-template-columns: 16px auto;
  align-items: center;
  gap: 2px 10px;
  color: #f2fff6;
  text-shadow: 0 2px 16px rgba(0,0,0,.32);
}
.auth-visual-badge span {
  grid-row: 1/3;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #f6c75f;
  box-shadow: 0 0 0 7px rgba(246,199,95,.14),0 0 28px rgba(246,199,95,.65);
}
.auth-visual-badge b { font-size: 18px; letter-spacing: 2.4px; }
.auth-visual-badge small { color: rgba(242,255,246,.72); font-size: 9px; letter-spacing: 1.8px; }
.auth-shell .auth-card {
  align-self: center;
  justify-self: center;
  width: min(500px,100%);
  background: var(--m3-surface);
}
.solar-status-hero {
  position: relative;
  display: flex;
  min-height: 184px;
  align-items: flex-end;
  justify-content: space-between;
  overflow: hidden;
  margin: 0 0 18px;
  padding: 28px 30px;
  border-radius: 32px;
  color: #f2fff6;
  background:
    linear-gradient(95deg,rgba(5,34,24,.88) 0%,rgba(5,34,24,.52) 48%,rgba(5,34,24,.14) 100%),
    url('solar-hero.jpg') center 64%/cover no-repeat;
  box-shadow: inset 0 0 0 1px rgba(225,255,233,.12),0 8px 24px rgba(0,0,0,.12);
}
.solar-status-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg,transparent 55%,rgba(250,204,94,.14));
  pointer-events: none;
}
.solar-status-hero>div { position: relative; z-index: 1; display: grid; gap: 6px; }
.solar-status-hero span { color: #bbdfc9; font-size: 10px; font-weight: 750; letter-spacing: 2px; text-transform: uppercase; }
.solar-status-hero strong { font-size: clamp(25px,3vw,38px); line-height: 1.08; letter-spacing: -.8px; }
.solar-status-hero small { color: rgba(242,255,246,.76); font-size: 11px; }
.solar-status-hero i {
  position: absolute;
  z-index: 1;
  top: 28px;
  right: 34px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #f6c75f;
  box-shadow: 0 0 0 12px rgba(246,199,95,.12),0 0 42px rgba(246,199,95,.52);
}
.executive-stats .primary-stat { position: relative; overflow: hidden; isolation: isolate; }
.executive-stats .primary-stat>* { position: relative; z-index: 1; }
.executive-stats .primary-stat::after {
  content: '';
  position: absolute;
  z-index: 0;
  right: -28px;
  bottom: -38px;
  width: 210px;
  height: 132px;
  border: 1px solid color-mix(in srgb,var(--m3-on-primary-container) 18%,transparent);
  border-radius: 18px;
  background:
    linear-gradient(color-mix(in srgb,var(--m3-on-primary-container) 14%,transparent) 1px,transparent 1px),
    linear-gradient(90deg,color-mix(in srgb,var(--m3-on-primary-container) 14%,transparent) 1px,transparent 1px);
  background-size: 28px 28px;
  transform: perspective(240px) rotateX(58deg) rotateZ(-8deg);
  opacity: .7;
}

@media(max-width:600px) {
  .auth-shell {
    display: flex;
    min-height: 100dvh;
    flex-direction: column;
    gap: 0;
    padding: 0;
    background: var(--m3-surface-low);
  }
  .auth-visual {
    flex: 0 0 218px;
    min-height: 218px;
    border-radius: 0 0 34px 34px;
    background-position: 68% 63%;
  }
  .auth-visual-badge { top: max(22px,env(safe-area-inset-top)); left: 22px; }
  .auth-shell .auth-card {
    width: 100%;
    min-height: auto;
    padding: 24px 20px calc(30px + env(safe-area-inset-bottom));
    background: var(--m3-surface-low);
  }
  .auth-card .brand { margin: 0 0 28px; }
  .auth-card>.language-select { top: calc(218px + 18px); }
  .solar-status-hero {
    min-height: 156px;
    margin-bottom: 14px;
    padding: 22px;
    border-radius: 28px;
    background-position: 62% 68%;
  }
  .solar-status-hero strong { font-size: 27px; }
  .solar-status-hero i { top: 22px; right: 22px; width: 38px; height: 38px; }
}

/* Desktop/tablet shell: compact fixed rail plus a separate signed-in account chip. */
@media(min-width:601px) {
  aside { padding-top: 20px; }
  .sidebar-brand {
    position: absolute;
    top: 22px;
    left: 18px;
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    color: var(--m3-on-surface);
  }
  .sidebar-brand>span {
    display: grid;
    flex: 0 0 38px;
    width: 38px;
    height: 38px;
    place-items: center;
    border-radius: 12px;
    color: #594400;
    background: #f6c75f;
    box-shadow: 0 0 22px rgba(246,199,95,.2);
    font-size: 20px;
  }
  .sidebar-brand b,.sidebar-brand small { display: block; white-space: nowrap; }
  .sidebar-brand b { font-size: 15px; letter-spacing: 1.4px; }
  .sidebar-brand small { margin-top: 3px; color: var(--m3-on-surface-variant); font-size: 7px; letter-spacing: 1.1px; }
  .menu-toggle { top: 24px; right: 14px; left: auto; width: 34px; min-width: 34px; min-height: 34px; }
  .nav-menu { margin-top: 88px; }
  main { padding-top: 108px; }
  #session-profile.sidebar-profile,
  aside.is-collapsed #session-profile.sidebar-profile {
    position: fixed;
    z-index: 19;
    top: 18px;
    right: 24px;
    bottom: auto;
    left: auto;
    width: 230px;
    min-height: 56px;
    justify-content: flex-start;
    padding: 7px 12px;
    border: 1px solid var(--m3-outline-variant);
    border-radius: 18px;
    background: var(--m3-surface-container);
    box-shadow: 0 8px 24px var(--m3-shadow);
  }
  aside.is-collapsed #session-profile.sidebar-profile>div { display: block; }
  #session-profile .sidebar-avatar { flex-basis: 38px; width: 38px; height: 38px; }
  aside.is-collapsed .sidebar-brand>div { display: none; }
  aside.is-collapsed .sidebar-brand { left: 17px; }
  aside.is-collapsed .menu-toggle { top: 74px; right: 18px; left: auto; }
  aside.is-collapsed .nav-menu { margin-top: 118px; }
}

@media(min-width:601px) and (max-width:900px) {
  aside { width: 176px; }
  aside+main { margin-left: 176px; padding-right: 20px; padding-left: 20px; }
  .sidebar-brand>span { flex-basis: 34px; width: 34px; height: 34px; }
  .sidebar-brand b { font-size: 13px; }
  .sidebar-brand small { display: none; }
  #session-profile.sidebar-profile,
  aside.is-collapsed #session-profile.sidebar-profile { right: 18px; width: 204px; }
}

@media(max-width:600px) {
  .sidebar-brand {
    position: absolute;
    z-index: 21;
    top: 15px;
    left: 78px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--m3-on-surface);
    pointer-events: none;
  }
  .sidebar-brand>span { color: #d29a18; font-size: 20px; }
  .sidebar-brand b { display: block; font-size: 13px; letter-spacing: 1px; }
  .sidebar-brand small { display: none; }
  #session-profile.sidebar-profile,
  aside.is-collapsed #session-profile.sidebar-profile {
    position: static;
    top: auto;
    right: auto;
    bottom: auto;
    left: auto;
    width: 100%;
    min-height: 64px;
    justify-content: flex-start;
    padding: 11px 12px;
    background: var(--m3-surface-high);
    box-shadow: none;
  }
  aside.is-collapsed #session-profile.sidebar-profile>div { display: block; }
}
