:root,
html[data-theme="harbor"] {
  color-scheme: light;
  --canvas: #f3f7f6;
  --surface: #ffffff;
  --surface-muted: #edf4f2;
  --ink: #172f35;
  --muted: #60747a;
  --line: #d9e5e2;
  --brand: #174c55;
  --brand-deep: #103841;
  --brand-soft: #e1f0ee;
  --accent: #47a697;
  --focus: #d88932;
  --shadow: 0 10px 32px rgba(23, 76, 85, .08);
  --shadow-raised: 0 17px 42px rgba(23, 76, 85, .14);
  --house: #237888;
  --house-wash: #e8f6f5;
  --director: #665eab;
  --director-wash: #f0effa;
  --grounds: #5b8656;
  --grounds-wash: #eff6ea;
}

html[data-theme="indigo"] {
  --canvas: #f5f5fb;
  --surface: #ffffff;
  --surface-muted: #f0f0fa;
  --ink: #242948;
  --muted: #68708b;
  --line: #e0e1ef;
  --brand: #3e488e;
  --brand-deep: #303973;
  --brand-soft: #e9ebfa;
  --accent: #8f89d7;
  --focus: #bd6d24;
  --shadow: 0 10px 32px rgba(46, 57, 115, .09);
  --shadow-raised: 0 17px 42px rgba(46, 57, 115, .16);
  --house: #4b63a0;
  --house-wash: #eef2fb;
  --director: #7860a9;
  --director-wash: #f3effa;
  --grounds: #488287;
  --grounds-wash: #eaf5f5;
}

html[data-theme="forest"] {
  --canvas: #f4f7f2;
  --surface: #ffffff;
  --surface-muted: #eef3eb;
  --ink: #23392f;
  --muted: #65786a;
  --line: #dae6d8;
  --brand: #295d46;
  --brand-deep: #1d4635;
  --brand-soft: #e1f0e4;
  --accent: #83ad6c;
  --focus: #bd722b;
  --shadow: 0 10px 32px rgba(29, 70, 53, .08);
  --shadow-raised: 0 17px 42px rgba(29, 70, 53, .15);
  --house: #3c806e;
  --house-wash: #eaf6f0;
  --director: #70835a;
  --director-wash: #f2f6e9;
  --grounds: #527b4d;
  --grounds-wash: #ecf5e8;
}

html[data-theme="clay"] {
  --canvas: #faf6f2;
  --surface: #ffffff;
  --surface-muted: #f7eee8;
  --ink: #402e29;
  --muted: #806b63;
  --line: #eaded5;
  --brand: #825442;
  --brand-deep: #633d32;
  --brand-soft: #f7e9df;
  --accent: #c88b65;
  --focus: #8957ab;
  --shadow: 0 10px 32px rgba(99, 61, 50, .09);
  --shadow-raised: 0 17px 42px rgba(99, 61, 50, .16);
  --house: #a36b4c;
  --house-wash: #fbefe5;
  --director: #9a6b86;
  --director-wash: #f9eff4;
  --grounds: #7d8552;
  --grounds-wash: #f4f5e9;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  background: var(--canvas);
  color: var(--ink);
  font: 400 16px/1.5 Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .4; }
a { color: inherit; }
svg { flex: none; }
h1, h2, h3, p { overflow-wrap: anywhere; }
h1, h2, h3 { line-height: 1.2; letter-spacing: -.025em; }
h1, h2, h3, p { margin-top: 0; }
h2 { font-size: 1.3rem; }
h3 { font-size: 1.05rem; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.skip-link {
  position: fixed;
  z-index: 30;
  top: -70px;
  left: 14px;
  padding: 11px 15px;
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow-raised);
}
.skip-link:focus { top: 14px; }

.app-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 68px;
  padding: 10px max(16px, env(safe-area-inset-left)) 10px max(16px, env(safe-area-inset-right));
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  backdrop-filter: blur(16px);
}
.brand {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  gap: 10px;
  text-decoration: none;
}
.brand img {
  width: 43px;
  height: 43px;
  border-radius: 13px;
  box-shadow: 0 4px 12px rgba(0,0,0,.1);
}
.brand strong, .brand small { display: block; line-height: 1.15; }
.brand strong { font-size: 1.02rem; letter-spacing: -.02em; }
.brand small { margin-top: 3px; color: var(--muted); font-size: .72rem; }
.preview-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 32px;
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 100px;
  background: var(--surface-muted);
  color: var(--muted);
  font-size: .72rem;
  font-weight: 700;
  white-space: nowrap;
}
.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
}
.auth-controls { display: flex; align-items: center; justify-content: flex-end; gap: 9px; min-width: 0; }
.signed-in-name { overflow: hidden; color: var(--muted); font-size: .75rem; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.header-action {
  flex: none;
  min-height: 40px;
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface);
  color: var(--brand);
  font-size: .76rem;
  font-weight: 800;
}
.header-action:hover { background: var(--brand-soft); }
main {
  width: min(100% - 32px, 1120px);
  min-height: calc(100dvh - 68px);
  margin: 0 auto;
  padding: 20px 0 calc(106px + env(safe-area-inset-bottom));
}
#view { display: flow-root; }

.eyebrow {
  margin: 0 0 7px;
  color: var(--brand);
  font-size: .71rem;
  font-weight: 800;
  letter-spacing: .13em;
  text-transform: uppercase;
}
.welcome {
  position: relative;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  overflow: hidden;
  padding: 28px 24px;
  border-radius: 25px;
  background: linear-gradient(125deg, var(--brand-deep), var(--brand) 70%, color-mix(in srgb, var(--brand) 75%, var(--accent)));
  color: #fff;
  box-shadow: var(--shadow-raised);
}
.welcome::after {
  content: "";
  position: absolute;
  right: -74px;
  bottom: -134px;
  width: 275px;
  height: 275px;
  border: 45px solid rgba(255,255,255,.08);
  border-radius: 50%;
  pointer-events: none;
}
.welcome > * { position: relative; z-index: 1; }
.welcome .eyebrow { color: #d3e9e8; }
.welcome h1 {
  max-width: 530px;
  margin: 0;
  font-size: clamp(1.8rem, 6vw, 2.7rem);
  line-height: 1.09;
}
.welcome p:last-child {
  max-width: 550px;
  margin: 11px 0 0;
  color: #e3efed;
  font-size: .94rem;
}
.welcome-mark {
  display: grid;
  flex: none;
  place-items: center;
  align-self: flex-start;
  width: 60px;
  height: 60px;
  border: 1px solid rgba(255,255,255,.24);
  border-radius: 20px;
  background: rgba(255,255,255,.12);
}
.demo-notice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--surface-muted);
  color: var(--muted);
  font-size: .81rem;
}
.demo-notice svg { margin-top: 1px; color: var(--brand); }
.demo-notice strong { color: var(--ink); }
.preview-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin: 14px 0 22px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.preview-controls strong, .preview-controls small { display: block; }
.preview-controls strong { font-size: .9rem; }
.preview-controls small { margin-top: 2px; color: var(--muted); font-size: .78rem; }
select {
  min-width: 0;
  min-height: 46px;
  padding: 10px 38px 10px 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--ink);
}
.preview-controls select { width: min(100%, 210px); }

.dashboard-section { margin-top: 26px; }
.section-title {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.section-title h2 { margin: 0; }
.section-title .eyebrow { margin-bottom: 3px; }
.text-action, .back-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 44px;
  padding: 7px 3px;
  border: 0;
  background: transparent;
  color: var(--brand);
  font-size: .83rem;
  font-weight: 750;
  text-decoration: none;
}
.back-link { justify-content: flex-start; margin-bottom: 11px; }
.text-action:hover, .back-link:hover { text-decoration: underline; }
.account-grid { display: grid; gap: 12px; }
.account-card {
  --card-color: var(--house);
  --card-wash: var(--house-wash);
  position: relative;
  display: block;
  width: 100%;
  min-width: 0;
  overflow: hidden;
  padding: 17px 18px 15px;
  border: 1px solid color-mix(in srgb, var(--card-color) 22%, var(--line));
  border-radius: 21px;
  background: linear-gradient(125deg, var(--surface), var(--card-wash));
  color: var(--ink);
  text-align: left;
  box-shadow: var(--shadow);
}
button.account-card { transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease; }
button.account-card:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--card-color) 45%, var(--line));
  box-shadow: var(--shadow-raised);
}
.account-director { --card-color: var(--director); --card-wash: var(--director-wash); }
.account-grounds { --card-color: var(--grounds); --card-wash: var(--grounds-wash); }
.account-top, .account-content, .account-foot {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}
.account-top { align-items: center; }
.account-icon, .row-icon, .tile-icon {
  display: grid;
  flex: none;
  place-items: center;
  width: 43px;
  height: 43px;
  border-radius: 14px;
  background: color-mix(in srgb, var(--card-color) 12%, var(--surface));
  color: var(--card-color);
}
.account-type {
  align-self: flex-start;
  padding: 5px 8px;
  border-radius: 100px;
  background: color-mix(in srgb, var(--card-color) 10%, var(--surface));
  color: var(--card-color);
  font-size: .65rem;
  font-weight: 800;
  letter-spacing: .08em;
}
.account-content {
  align-items: end;
  flex-wrap: wrap;
  margin-top: 18px;
}
.account-content h2 {
  margin: 0;
  font-size: 1.17rem;
}
.account-content p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: .78rem;
}
.account-amount {
  color: var(--card-color);
  font-size: clamp(1.55rem, 5vw, 1.95rem);
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  letter-spacing: -.045em;
  line-height: 1.13;
}
.account-foot {
  align-items: center;
  margin-top: 16px;
  padding-top: 13px;
  border-top: 1px solid color-mix(in srgb, var(--card-color) 16%, var(--line));
  color: var(--muted);
  font-size: .75rem;
}
.account-foot svg { color: var(--card-color); }
.account-card-large { margin-bottom: 16px; padding: 20px; }
.account-card-large .account-amount { font-size: clamp(1.8rem, 6vw, 2.5rem); }
.order-drawer {
  margin-top: 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
}
.order-drawer summary {
  min-height: 46px;
  padding: 11px 15px;
  color: var(--brand);
  font-size: .84rem;
  font-weight: 750;
  cursor: pointer;
}
.order-list { padding: 0 14px 9px; }
.order-list > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 0;
  border-top: 1px solid var(--line);
}
.order-list > div > span:first-child { display: inline-flex; align-items: center; gap: 8px; font-size: .84rem; }
.empty-panel {
  padding: 30px 18px;
  border: 1px dashed var(--line);
  border-radius: 18px;
  background: var(--surface);
  color: var(--muted);
  text-align: center;
}
.move-controls { display: inline-flex; gap: 5px; flex: none; }
.move-controls button {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--brand);
}
.move-controls button:not(:disabled):hover { background: var(--brand-soft); }
.surface, .content-card {
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.area-list { overflow: hidden; }
.area-row, .action-tile {
  display: flex;
  align-items: center;
  gap: 13px;
  width: 100%;
  min-height: 75px;
  padding: 13px 16px;
  border: 0;
  background: transparent;
  color: var(--ink);
  text-align: left;
}
.area-row + .area-row { border-top: 1px solid var(--line); }
.area-row:hover, .action-tile:hover { background: var(--surface-muted); }
.area-row > svg:last-child, .action-tile > svg:last-child {
  margin-left: auto;
  color: var(--muted);
}
.area-row .row-icon, .action-tile .tile-icon {
  --card-color: var(--brand);
  width: 43px;
  height: 43px;
}
.row-copy { min-width: 0; flex: 1; }
.row-copy strong, .row-copy small,
.action-tile strong, .action-tile small { display: block; }
.row-copy strong, .action-tile strong { font-size: .91rem; line-height: 1.25; }
.row-copy small, .action-tile small {
  margin-top: 3px;
  color: var(--muted);
  font-size: .75rem;
  line-height: 1.35;
}
.preview-footnote {
  margin: 21px 0 0;
  color: var(--muted);
  font-size: .75rem;
  text-align: center;
}

.page-head { margin: 5px 0 17px; }
.page-head h1 { margin: 0; font-size: clamp(1.8rem, 6vw, 2.4rem); }
.page-head > p:last-child {
  max-width: 680px;
  margin: 7px 0 0;
  color: var(--muted);
  font-size: .93rem;
}
.page-head + .demo-notice { margin-bottom: 16px; }
.module-settings-link { margin: -5px 0 4px; }
.action-grid { display: grid; gap: 11px; margin: 15px 0; }
.action-tile {
  min-height: 81px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.content-card { margin-top: 15px; padding: 19px; }
.content-card h2 { margin: 0 0 9px; }
.content-card > p { color: var(--muted); font-size: .9rem; }
.content-card > .eyebrow { color: var(--brand); font-size: .71rem; }
.content-card > p:last-child { margin-bottom: 0; }
.muted { color: var(--muted); font-size: .84rem; }
.detail-list { margin-top: 14px; border-top: 1px solid var(--line); }
.detail-list > div {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  font-size: .84rem;
}
.detail-list span { color: var(--muted); }
.detail-list strong { text-align: right; }
.empty-illustration {
  display: grid;
  justify-items: center;
  gap: 6px;
  margin: 19px 0 10px;
  padding: 27px 17px;
  border: 1px dashed color-mix(in srgb, var(--brand) 25%, var(--line));
  border-radius: 18px;
  background: var(--surface-muted);
  color: var(--muted);
  text-align: center;
}
.empty-illustration svg { color: var(--brand); }
.empty-illustration strong { margin-top: 3px; color: var(--ink); }
.empty-illustration span { font-size: .79rem; }

.show-spotlight .section-title { align-items: flex-start; flex-wrap: wrap; }
.show-spotlight .section-title h2 { margin: 0; }
.segmented {
  display: inline-flex;
  flex-wrap: nowrap;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface-muted);
}
.segmented button {
  min-height: 40px;
  padding: 7px 11px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font-size: .78rem;
  font-weight: 750;
}
.segmented button[aria-pressed="true"] {
  background: var(--surface);
  color: var(--brand);
  box-shadow: 0 2px 8px rgba(0,0,0,.08);
}
.show-card {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px 18px;
  margin-top: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-muted);
}
.show-card.current {
  border-color: color-mix(in srgb, var(--director) 25%, var(--line));
  background: linear-gradient(125deg, var(--surface), var(--director-wash));
}
.show-status {
  display: inline-block;
  margin-bottom: 6px;
  color: var(--director);
  font-size: .66rem;
  font-weight: 800;
  letter-spacing: .09em;
}
.show-card h3 { margin: 0 0 4px; }
.show-card p { margin: 0; color: var(--muted); font-size: .77rem; }
.show-card > strong {
  color: var(--director);
  font-size: 1.15rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.show-stack { display: grid; gap: 10px; }
.show-stack .show-card { margin-top: 0; }
.curtain {
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
}
.curtain summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 50px;
  padding: 12px 14px;
  color: var(--brand);
  font-size: .87rem;
  font-weight: 750;
  cursor: pointer;
  list-style: none;
}
.curtain summary::-webkit-details-marker { display: none; }
.curtain summary::after { content: "⌄"; margin-left: 8px; font-size: 1.1rem; }
.curtain[open] summary::after { transform: rotate(180deg); }
.curtain summary span { margin-left: auto; color: var(--muted); }
.curtain > :not(summary) { margin: 0 12px 12px; }
.curtain > p { color: var(--muted); font-size: .84rem; }

.category-grid { display: grid; gap: 10px; margin-top: 16px; }
.category-grid > div {
  display: grid;
  grid-template-columns: 43px 1fr;
  align-items: center;
  gap: 0 11px;
  min-height: 69px;
  padding: 10px 13px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--surface-muted);
}
.category-grid span {
  display: grid;
  grid-row: span 2;
  place-items: center;
  width: 43px;
  height: 43px;
  border-radius: 12px;
  background: var(--brand-soft);
  color: var(--brand);
}
.category-grid strong { font-size: .88rem; }
.category-grid small { color: var(--muted); font-size: .74rem; }
.legacy ul { margin: 12px 0 18px; padding: 0; list-style: none; }
.legacy li {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 4px 12px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
  font-size: .82rem;
}
.legacy li span { color: var(--muted); }
.button-secondary {
  min-height: 46px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--brand);
  font-weight: 750;
}
.button-secondary:hover { background: var(--brand-soft); }
.button-primary {
  min-height: 46px;
  padding: 10px 16px;
  border: 1px solid var(--brand);
  border-radius: 12px;
  background: var(--brand);
  color: #fff;
  font-weight: 750;
}
.button-primary:hover { background: var(--brand-deep); }
.button-primary:disabled, .button-secondary:disabled { opacity: .5; }
.connection-panel {
  max-width: 620px;
  margin: min(14vh, 95px) auto 30px;
  padding: clamp(22px, 6vw, 38px);
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.connection-panel h1 { margin: 0 0 10px; font-size: clamp(1.75rem, 6vw, 2.3rem); }
.connection-panel > p:last-of-type { color: var(--muted); }
.connection-symbol {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  margin-bottom: 22px;
  border-radius: 17px;
  background: var(--brand-soft);
  color: var(--brand);
}
.connection-actions { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 22px; }
.account-feedback {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 15px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: .85rem;
  font-weight: 700;
}
.account-form, .user-update-form { display: grid; gap: 12px; margin-top: 16px; }
.account-form > label, .user-update-form > label { display: grid; gap: 5px; color: var(--ink); font-size: .85rem; font-weight: 700; }
.account-form input:not([type="checkbox"]), .user-update-form input:not([type="checkbox"]) {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface);
  color: var(--ink);
}
.account-form .inline-check, .user-flags label { display: inline-flex; align-items: center; gap: 8px; font-size: .85rem; font-weight: 600; }
.account-form input[type="checkbox"], .user-update-form input[type="checkbox"], .grant-options input { width: 19px; height: 19px; accent-color: var(--brand); }
.account-form .button-primary, .user-update-form .button-primary { justify-self: start; }
.user-list { display: grid; gap: 10px; margin-top: 16px; }
.account-user { overflow: hidden; border: 1px solid var(--line); border-radius: 15px; }
.account-user > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 14px;
  min-height: 65px;
  padding: 12px 14px;
  cursor: pointer;
  list-style: none;
}
.account-user > summary::-webkit-details-marker { display: none; }
.account-user > summary:hover { background: var(--surface-muted); }
.account-user > summary strong, .account-user > summary small { display: block; }
.account-user > summary strong { font-size: .9rem; }
.account-user > summary small { color: var(--muted); font-size: .76rem; }
.user-badges { display: flex; flex-wrap: wrap; gap: 5px; }
.user-badges em { padding: 4px 7px; border-radius: 100px; background: var(--brand-soft); color: var(--brand); font-size: .66rem; font-style: normal; font-weight: 800; }
.account-user > form, .account-user > .user-reset, .account-user > .user-grants { margin: 0 14px 15px; }
.user-update-form { padding-top: 15px; border-top: 1px solid var(--line); }
.user-flags { display: flex; flex-wrap: wrap; gap: 9px 20px; }
.user-reset { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; padding: 14px 0; border-top: 1px solid var(--line); }
.user-reset strong { font-size: .88rem; }
.user-reset p { margin: 3px 0 0; color: var(--muted); font-size: .77rem; }
.user-grants { border-top: 1px solid var(--line); padding-top: 14px; }
.user-grants h3 { margin-bottom: 5px; }
.user-grants > p { margin-bottom: 12px; color: var(--muted); font-size: .78rem; }
.grant-form { display: flex; align-items: center; flex-wrap: wrap; gap: 9px 16px; padding: 13px 0; border-top: 1px solid var(--line); }
.grant-form > strong { min-width: 145px; font-size: .83rem; }
.grant-options { display: flex; flex: 1; align-items: center; flex-wrap: wrap; gap: 7px 16px; }
.grant-check { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; font-size: .79rem; }
.grant-form .button-secondary { min-height: 42px; }
.temporary-reveal { border-color: var(--focus); }
.temporary-reveal .temporary-secret { display: block; width: 100%; margin: 13px 0; padding: 14px; border: 1px dashed var(--focus); border-radius: 12px; background: var(--surface-muted); color: var(--ink); font-size: 1.1rem; font-weight: 800; overflow-wrap: anywhere; user-select: all; }

.storage-years, .storage-alerts { display: grid; gap: 10px; margin-top: 17px; }
.storage-year, .storage-alert {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--surface-muted);
}
.storage-year > div:first-child, .storage-alert > div { display: grid; gap: 3px; }
.storage-year strong { font-size: 1.08rem; }
.storage-year small, .storage-alert small { color: var(--muted); font-size: .77rem; }
.storage-state { font-size: .82rem; font-weight: 750; }
.storage-ok { color: var(--grounds); }
.storage-missing { color: #a84831; }
.storage-status-form { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; }
.storage-status-form select, .storage-status-form button { min-height: 44px; }
.storage-ids { flex-basis: 100%; color: var(--muted); font-size: .75rem; }
.storage-ids summary, .storage-register summary { min-height: 44px; padding: 10px 0; color: var(--brand); font-weight: 750; cursor: pointer; }
.storage-ids code { overflow-wrap: anywhere; color: var(--ink); }
.storage-register { margin-top: 14px; border-top: 1px solid var(--line); }
.storage-alert { border-color: color-mix(in srgb, var(--focus) 30%, var(--line)); background: var(--surface); }
.document-list { margin-top: 14px; }
.document-list h3 { margin: 17px 0 5px; font-size: .91rem; }
.document-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 9px 16px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
}
.document-row:last-child { border-bottom: 0; }
.document-row[hidden] { display: none; }
.document-row > div { display: grid; min-width: 0; gap: 3px; }
.document-row strong { font-size: .87rem; overflow-wrap: anywhere; }
.document-row small { color: var(--muted); font-size: .76rem; }
.document-row .button-secondary { flex: none; }
.document-entry { border-bottom: 1px solid var(--line); }
.document-entry:last-child { border-bottom: 0; }
.document-entry .document-row { border-bottom: 0; }
.document-entry[hidden] { display: none; }
.document-edit { padding: 0 0 14px; }
.document-edit summary { min-height: 44px; padding: 10px 0; color: var(--brand); font-size: .84rem; font-weight: 750; cursor: pointer; }
#receipt-detail { scroll-margin-top: 84px; }
.document-search { display: grid; gap: 5px; margin-top: 15px; color: var(--ink); font-size: .84rem; font-weight: 700; }
.document-search input { width: 100%; min-height: 46px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); color: var(--ink); }

.setting-list { margin-top: 13px; }
.visibility-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 69px;
  margin: 0;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}
.visibility-row:last-child { border-bottom: 0; }
.visibility-row .row-icon { --card-color: var(--brand); }
.switch {
  position: relative;
  flex: none;
  width: 48px;
  height: 44px;
  margin-left: auto;
  border: 0;
  background: transparent;
}
.switch::before {
  content: "";
  position: absolute;
  top: 8px;
  left: 0;
  width: 48px;
  height: 28px;
  border-radius: 100px;
  background: #a9b8bb;
  transition: background .18s ease;
}
.switch::after {
  content: "";
  position: absolute;
  top: 12px;
  left: 4px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,.2);
  transition: transform .18s ease;
}
.switch[aria-checked="true"]::before { background: var(--brand); }
.switch[aria-checked="true"]::after { transform: translateX(20px); }
.theme-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 14px; }
.theme-option {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 60px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--surface);
  color: var(--ink);
  text-align: left;
}
.theme-option:hover { background: var(--surface-muted); }
.theme-option[aria-pressed="true"] { border: 2px solid var(--brand); padding: 9px; }
.theme-option strong { flex: 1; font-size: .85rem; }
.theme-option > svg { color: var(--brand); }
.theme-swatch {
  display: block;
  flex: none;
  width: 37px;
  height: 37px;
  border-radius: 11px;
  background: linear-gradient(135deg, #174c55 50%, #9acfc4 50%);
}
.theme-indigo .theme-swatch { background: linear-gradient(135deg, #3e488e 50%, #b1aee9 50%); }
.theme-forest .theme-swatch { background: linear-gradient(135deg, #295d46 50%, #add39a 50%); }
.theme-clay .theme-swatch { background: linear-gradient(135deg, #825442 50%, #dfb796 50%); }
.icon-setting { padding: 13px 0; border-bottom: 1px solid var(--line); }
.icon-setting:last-child { border-bottom: 0; }
.icon-setting > strong { display: block; margin-bottom: 9px; font-size: .87rem; }
.icon-options { display: flex; flex-wrap: wrap; gap: 8px; }
.icon-options button {
  display: grid;
  place-items: center;
  width: 47px;
  height: 47px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface);
  color: var(--muted);
}
.icon-options button:hover { background: var(--surface-muted); }
.icon-options button[aria-pressed="true"] {
  border: 2px solid var(--brand);
  background: var(--brand-soft);
  color: var(--brand);
}

.bottom-nav {
  position: fixed;
  z-index: 15;
  right: 0;
  bottom: 0;
  left: 0;
  display: flex;
  justify-content: center;
  gap: 5px;
  padding: 7px max(10px, env(safe-area-inset-right)) calc(7px + env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left));
  border-top: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 96%, transparent);
  backdrop-filter: blur(18px);
  box-shadow: 0 -6px 24px rgba(0,0,0,.04);
}
.bottom-nav button {
  display: grid;
  flex: 1;
  justify-items: center;
  align-content: center;
  gap: 3px;
  max-width: 200px;
  min-width: 0;
  min-height: 55px;
  padding: 6px 4px;
  border: 0;
  border-radius: 13px;
  background: transparent;
  color: var(--muted);
}
.bottom-nav button span {
  font-size: .7rem;
  font-weight: 700;
  line-height: 1.16;
  text-align: center;
}
.bottom-nav button[aria-current="page"] {
  background: var(--brand-soft);
  color: var(--brand);
}
.bottom-nav button:hover { color: var(--brand); }
.receipt-filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(145px, 1fr)); gap: 10px; margin: 18px 0; }
.receipt-filters label, .receipt-allocation label, .receipt-file-choice { display: grid; gap: 6px; font-weight: 650; }
.receipt-filters input, .receipt-filters select, .receipt-allocation input, .receipt-allocation select { width: 100%; min-height: 44px; }
.receipt-preview { margin: 15px 0; padding: 10px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface-muted); }
.receipt-preview img { display: block; max-width: 100%; max-height: 580px; margin: auto; object-fit: contain; border-radius: 8px; }
.receipt-allocation { display: grid; gap: 12px; margin: 12px 0; padding: 16px; border: 1px solid var(--line); border-radius: 16px; }
.receipt-allocation .check-row { display: flex; align-items: center; gap: 10px; }
.receipt-allocation .check-row input { width: auto; min-height: 0; }
.show-entry { display: grid; gap: 12px; margin: 12px 0; padding: 16px; border: 1px solid var(--line); border-radius: 16px; }
.show-entry label { display: grid; gap: 6px; font-weight: 650; }
.show-entry input, .show-entry select { width: 100%; min-height: 44px; }
.show-type-choices { display: grid; gap: 8px; min-width: 0; margin: 4px 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; }
.show-type-choices legend { padding: 0 4px; font-weight: 700; }
.show-type-choices p { margin: 0; color: var(--muted); font-size: .85rem; }
.show-type-choices .check-row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; font-weight: 500; }
.show-type-choices .check-row input { width: auto; min-height: 0; }
.show-edit { margin-top: 12px; padding: 12px 16px; border: 1px solid var(--line); border-radius: 16px; }
.show-edit summary { cursor: pointer; font-weight: 700; }
.category-setting { display: grid; gap: 12px; margin-top: 12px; padding: 16px; border: 1px solid var(--line); border-radius: 16px; }
.category-setting label { display: grid; gap: 6px; font-weight: 650; }
.category-setting .inline-check { display: flex; align-items: center; gap: 8px; }
.category-setting input:not([type="checkbox"]), .category-setting select, .category-setting textarea { width: 100%; min-height: 44px; }
.grounds-item { margin-top: 14px; padding: 16px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface-muted); }
.grounds-item.inactive { opacity: .7; }
.grounds-item > div { display: grid; gap: 4px; }
.grounds-item small { color: var(--muted); }
.grounds-item p { margin: 9px 0 0; overflow-wrap: anywhere; }
.grounds-item a { color: var(--brand); font-weight: 700; }
.account-entry { display: grid; gap: 4px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.account-entry:last-child { border-bottom: 0; }
.account-entry small { color: var(--muted); }
.card-holder-row { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.card-holder-row:last-child { border-bottom: 0; }
.card-holder-row > div { display: grid; gap: 4px; }
.card-holder-row small { color: var(--muted); }
.card-holder-row button { min-height: 44px; }
.card-mismatch { margin: 0; padding: 12px 14px; border: 1px solid var(--director); border-radius: 12px; background: var(--director-wash); }
.receipt-file-choice { position: relative; align-content: center; min-height: 52px; padding: 12px 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); cursor: pointer; }
.receipt-file-choice:focus-within { outline: 2px solid var(--brand); outline-offset: 2px; }
.receipt-file-choice input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.receipt-file-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(145px, 1fr)); gap: 12px; }
.receipt-capture-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.ocr-results { margin: 16px 0; padding: 16px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface-muted); }
.ocr-results pre { white-space: pre-wrap; overflow-wrap: anywhere; max-height: 260px; overflow: auto; font: inherit; font-size: .86rem; }
@media (max-width: 360px) {
  .preview-controls { display: grid; }
  .preview-controls select { width: 100%; }
  .signed-in-name { display: none; }
}
@media (max-width: 430px) {
  .app-header { gap: 7px; padding-inline: 11px; }
  .brand { gap: 7px; }
  .brand img { width: 37px; height: 37px; }
  .brand strong { font-size: .9rem; }
  .brand small { font-size: .65rem; }
  .auth-controls { gap: 5px; }
  .signed-in-name { max-width: 95px; font-size: .68rem; }
  .header-action { padding-inline: 8px; font-size: .7rem; }
  .preview-pill { font-size: .65rem; padding-inline: 7px; }
  .welcome { padding: 22px 20px; }
  .welcome-mark { width: 46px; height: 46px; border-radius: 15px; }
  .welcome-mark svg { width: 26px; height: 26px; }
  .account-content { align-items: flex-start; flex-direction: column; gap: 9px; }
  .preview-controls > div { flex: 1; }
  .section-title { align-items: center; }
}
@media (min-width: 680px) {
  main { width: min(100% - 48px, 1120px); padding-top: 27px; }
  .account-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .action-grid, .category-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .theme-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .content-card { padding: 23px; }
}
@media (min-width: 980px) {
  main { padding-top: 34px; }
  .welcome { padding: 36px 38px; }
  .account-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 15px; }
  .account-grid .account-content { align-items: flex-start; flex-direction: column; gap: 10px; }
  .action-grid, .category-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .account-card-large { max-width: 680px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
  }
}

