:root {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: #202b3d;
  background: #f5f7fb;
  font-size: 16px;
  line-height: 1.5;
  font-synthesis: none;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
  --blue: #3269eb;
  --blue-hover: #2557cb;
  --ink: #202b3d;
  --muted: #64748b;
  --line: #e4e9f1;
  --soft: #eef3ff;
  --surface: #fff;
  --canvas: #f5f7fb;
  --sidebar-width: 232px;
  --header-height: 72px;
  --radius: 14px;
  --shadow: 0 2px 4px #22335203, 0 6px 18px #22335203;
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 0; }
button, input, select, textarea { font: inherit; }
button, a, input, select, textarea, summary { -webkit-tap-highlight-color: transparent; }
button, a { touch-action: manipulation; }
button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 10px 16px;
  border: 1px solid #dce3ee;
  border-radius: 9px;
  background: #fff;
  color: #3a4860;
  font-size: .875rem;
  font-weight: 500;
  line-height: 1.45;
  cursor: pointer;
}
button:hover { background: #f7f9fd; border-color: #c8d4e5; }
button:disabled { opacity: .5; cursor: not-allowed; }
:focus-visible { outline: 3px solid #88aafc; outline-offset: 3px; }
button:focus:not(:focus-visible) { outline: none; }
.primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 10px 16px;
  border: 1px solid var(--blue);
  border-radius: 9px;
  color: #fff;
  background: var(--blue);
  font-size: .875rem;
  font-weight: 600;
  line-height: 1.45;
  text-decoration: none;
  box-shadow: 0 2px 3px #3269eb10;
}
.primary:hover { color: #fff; background: var(--blue-hover); border-color: var(--blue-hover); text-decoration: none; }
.quiet { background: transparent; border-color: transparent; box-shadow: none; }
.quiet:hover { background: #edf2f9; border-color: transparent; }
.link { color: var(--blue); text-decoration: none; }
.danger { color: #bc424e; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: 1.75rem; line-height: 1.4; font-weight: 650; letter-spacing: -.035em; }
h2 { font-size: 1.0625rem; line-height: 1.5; font-weight: 650; letter-spacing: -.01em; }
h3 { font-size: .9375rem; font-weight: 600; line-height: 1.55; }
strong { font-weight: 600; }
.muted { color: var(--muted); font-size: .875rem; line-height: 1.75; }
.small { font-size: .75rem; }
.grow { flex: 1; min-width: 0; }
.icon { display: inline-block; width: 24px; height: 24px; flex: 0 0 auto; vertical-align: middle; color: inherit; }
.icon-xs { width: 14px; height: 14px; }
.icon-sm { width: 18px; height: 18px; }
.icon-md { width: 22px; height: 22px; }
.icon-lg { width: 28px; height: 28px; }
.icon-xl { width: 36px; height: 36px; }
.icon-muted, .muted-icon { color: #64748b; }
.icon.spin, .icon-spin, .spin { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* A single navigation system keeps the workspace recognisable on every screen. */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 28px;
  height: var(--header-height);
  padding: 0 28px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}
.brand { display: flex; align-items: center; gap: 11px; color: #1d2e48; font-size: 1rem; font-weight: 650; white-space: nowrap; line-height: 1.4; }
.brand > div { display: flex; flex-direction: column; gap: 3px; }
.brand-icon { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; width: 38px; height: 40px; color: #fff; background: var(--blue); border-radius: 11px; }
.brand-subtitle { display: block; color: #64748b; font-size: .75rem; font-weight: 500; letter-spacing: .1em; }
.topbar-context { display: flex; align-items: center; gap: 9px; min-height: 24px; padding-left: 26px; border-left: 1px solid var(--line); color: #7e8a9d; font-size: .8125rem; }
.topbar-context .icon { color: #64748b; }
.identity { display: flex; align-items: center; gap: 10px; margin-left: auto; font-size: .8125rem; white-space: nowrap; }
.identity .user-name { min-width: 0; max-width: 160px; overflow: hidden; color: #415069; text-overflow: ellipsis; }
.identity .quiet { min-width: 40px; padding: 8px 10px; color: #7d899b; }
.avatar { display: grid; place-items: center; width: 33px; height: 33px; border: 1px solid #dfe8fa; border-radius: 50%; background: #eef3ff; color: var(--blue); font-size: .8125rem; font-weight: 600; }
.pilot { display: inline-flex; align-items: center; gap: 5px; min-height: 25px; padding: 4px 8px; border: 1px solid #e8edf5; border-radius: 5px; background: #f6f8fc; color: #7b879c; font-size: .75rem; font-weight: 500; }
.topbar .primary { min-height: 36px; padding: 8px 12px; font-size: .8125rem; }
.topnav { display: flex; align-self: stretch; gap: 20px; }
.topnav button { position: relative; border: 0; border-radius: 0; background: transparent; padding: 0 3px; }
.topnav button.active { color: var(--blue); }
.topnav button.active::after { position: absolute; bottom: 0; right: 0; left: 0; height: 3px; background: var(--blue); content: ""; }
.workspace { display: flex; min-height: calc(100vh - var(--header-height)); min-height: calc(100dvh - var(--header-height)); }
.sidebar {
  position: sticky;
  top: var(--header-height);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  align-self: flex-start;
  width: var(--sidebar-width);
  height: calc(100vh - var(--header-height));
  height: calc(100dvh - var(--header-height));
  padding: 28px 16px 18px;
  border-right: 1px solid var(--line);
  background: #fff;
}
.sidebar-top { display: flex; flex-direction: column; gap: 6px; }
.sidebar .group-label { padding: 0 13px 13px; color: #64748b; font-size: .75rem; font-weight: 600; letter-spacing: .07em; }
.side-link { position: relative; display: flex; justify-content: flex-start; align-items: center; gap: 11px; width: 100%; min-height: 47px; margin: 3px 0; padding: 12px 14px; border: 1px solid transparent; border-radius: 9px; background: transparent; color: #66738a; font-size: .875rem; font-weight: 500; text-align: left; }
.side-link > .icon, .side-icon { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; width: 20px; height: 20px; color: #8a97ac; }
.side-link .icon { width: 20px; height: 20px; }
.side-link:hover { background: #f4f7fc; border-color: transparent; }
.side-link.active { color: #2b5cd0; background: #edf3ff; border-color: transparent; font-weight: 600; }
.side-link.active > .icon, .side-link.active .side-icon { color: #3269eb; }
.nav-label { min-width: 0; }
.count { display: inline-flex; align-items: center; justify-content: center; min-width: 21px; height: 20px; margin-left: auto; padding: 0 6px; border-radius: 6px; background: #edf1f7; color: #7c899e; font-size: .75rem; font-weight: 600; line-height: 20px; }
.side-link.active .count { background: #dce7fe; color: #3466d6; }
.sidebar-bottom { display: flex; align-items: flex-start; gap: 8px; margin-top: auto; padding: 15px 10px 2px; border-top: 1px solid #edf0f5; color: #64748b; font-size: .75rem; line-height: 1.8; }
.sidebar-bottom .icon { width: 16px; height: 16px; margin-top: 3px; }
.sidebar-bottom strong { display: block; margin-bottom: 2px; color: #74829a; font-size: .75rem; font-weight: 500; }
.content { flex: 1; min-width: 0; padding: 34px 36px 40px; }
.page-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 27px; }
.page-heading > div:first-child { min-width: 0; }
.eyebrow { display: block; margin-bottom: 6px; color: #8895ab; font-size: .75rem; font-weight: 600; letter-spacing: .09em; line-height: 1.5; }
.page-heading h1 + .eyebrow { margin-top: 7px; margin-bottom: 0; color: var(--muted); font-size: .8125rem; font-weight: 400; letter-spacing: 0; }
.page-heading .subtitle { margin-top: 8px; color: #64748b; font-size: .8125rem; line-height: 1.7; }
.heading-actions { display: flex; align-items: center; justify-content: flex-end; gap: 12px; }
.date-stamp { display: inline-flex; align-items: center; gap: 7px; color: #8793a6; font-size: .75rem; white-space: nowrap; }
.date-stamp .icon { width: 15px; height: 15px; }
.section-label { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin: 28px 0 15px; }
.section-label:first-child { margin-top: 0; }

/* Dashboard: useful actions first, private working material below. */
.quick-actions { display: grid; grid-template-columns: 1.35fr 1fr 1fr; gap: 18px; margin-bottom: 24px; }
.quick-primary, .quick-card { position: relative; display: flex; flex-direction: column; align-items: flex-start; justify-content: space-between; gap: 15px; min-width: 0; min-height: 178px; padding: 24px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow); text-align: left; }
.quick-primary { border-color: #3269eb; background: #3269eb; color: #fff; }
button.quick-primary:hover { background: #2d61da; border-color: #2d61da; }
button.quick-card:hover { background: #fff; border-color: #becff5; box-shadow: 0 4px 16px #3269eb0b; }
.quick-primary > .icon, .quick-card > .icon, .quick-icon { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; background: #eef3ff; color: var(--blue); }
.quick-icon .icon { width: 22px; height: 22px; }
.quick-primary > .icon, .quick-primary .quick-icon { color: #fff; background: #ffffff20; }
.quick-primary h2, .quick-primary h3, .quick-card h2, .quick-card h3 { margin-bottom: 6px; font-size: 1rem; font-weight: 600; }
.quick-primary p { max-width: 340px; color: #e2ebff; font-size: .75rem; line-height: 1.8; }
.quick-card p { color: #8995a8; font-size: .75rem; line-height: 1.8; }
.quick-primary strong, .quick-card strong { display: block; font-size: 1rem; font-weight: 600; }
.quick-primary .action-label, .quick-card .action-label { display: inline-flex; align-items: center; gap: 7px; margin-top: 5px; font-size: .75rem; font-weight: 500; }
.quick-primary .action-label { color: #fff; }
.quick-card .action-label { color: var(--blue); }
.quick-primary button, .quick-primary .primary { min-height: 36px; padding: 7px 13px; border-color: #fff; background: #fff; color: #2e61d4; box-shadow: none; }
.quick-primary button:hover { background: #edf3ff; }
.quick-card button { min-height: 36px; padding: 7px 12px; }
.quick-card .quiet { padding-right: 0; padding-left: 0; color: var(--blue); }
.quick-card .quiet:hover { background: transparent; }
.quick-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; width: 100%; }
.quick-top .icon:last-child { width: 18px; height: 18px; color: #abb6c8; }
.quick-primary .quick-top .icon:last-child { color: #d7e3ff; }
.quick-bottom { display: flex; align-items: center; justify-content: space-between; gap: 14px; width: 100%; }
.metric-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin-bottom: 26px; }
.metric-card { display: grid; grid-template-columns: 42px minmax(0, 1fr) auto; align-items: center; justify-content: initial; gap: 0 14px; min-width: 0; min-height: 104px; padding: 19px 22px; border: 1px solid var(--line); border-radius: 12px; background: #fff; box-shadow: var(--shadow); text-align: left; }
.metric-card:hover { background: #fff; border-color: #c0d1f2; }
.metric-icon { display: flex; align-items: center; justify-content: center; grid-row: 1 / span 2; width: 42px; height: 42px; border: 1px solid #edf1f8; border-radius: 11px; background: #f6f8fc; color: #8293b2; }
.metric-icon .icon { width: 21px; height: 21px; }
.metric-label { color: #64728a; font-size: .8125rem; font-weight: 500; }
.metric-value { grid-column: 3; grid-row: 1 / span 2; color: #273b5b; font-size: 1.625rem; font-weight: 600; line-height: 1.2; letter-spacing: -.025em; }
.metric-note { grid-column: 2; margin-top: 4px; color: #a0a9b9; font-size: .75rem; font-weight: 400; }
.metric-card .metric-text { min-width: 0; }
.metric-text .metric-label, .metric-text .metric-note { display: block; }
.home-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); align-items: stretch; gap: 22px; }
.surface-panel, .panel { overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow); }
.surface-panel { min-width: 0; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 66px; padding: 17px 22px; border-bottom: 1px solid #edf0f5; }
.panel-heading h2 { display: flex; align-items: center; gap: 9px; font-size: .9375rem; }
.panel-heading .count { margin-left: 0; }
.panel-heading .quiet, .panel-heading .link { min-height: 32px; padding: 5px 0 5px 8px; color: #8190a7; font-size: .75rem; }
.panel-heading .quiet:hover, .panel-heading .link:hover { color: var(--blue); background: transparent; }
.panel-heading .icon { width: 16px; height: 16px; }
.panel-body { padding: 20px 22px; }
.home-grid .cards { grid-template-columns: 1fr; gap: 10px; padding: 16px; }
.home-grid .template-card { padding: 15px 16px; box-shadow: none; }
.home-grid .panel { border: 0; border-radius: 0; box-shadow: none; }
.home-grid .empty { border: 0; border-radius: 0; min-height: 245px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 18px; }
.template-card { display: block; min-width: 0; padding: 22px; border: 1px solid var(--line); border-radius: 12px; background: #fff; text-align: left; box-shadow: var(--shadow); }
.template-card:hover { background: #fcfdff; border-color: #bfcfed; }
.template-card h3 { display: block; min-width: 0; margin-bottom: 11px; color: #3b4f6b; overflow-wrap: anywhere; }
.template-card h3 .icon { width: 20px; height: 20px; color: #6f8ab8; }
.template-card .muted { font-size: .75rem; }
.template-card .muted + .muted { margin-top: 7px; color: #98a2b4; }
.application-card { display: flex; align-items: center; justify-content: initial; gap: 18px; width: 100%; max-width: 420px; padding: 24px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; text-align: left; }
.application-card .tile { display: grid; place-items: center; width: 48px; height: 48px; flex: 0 0 auto; border-radius: 12px; background: #edf3ff; color: var(--blue); font-size: 26px; }
.application-card strong { display: block; margin-bottom: 6px; font-size: 1rem; }
.application-card p { color: var(--muted); font-size: .75rem; }
.arrow { display: inline-flex; align-items: center; margin-left: auto; color: #a6b1c3; }
.draft-row { display: flex; align-items: center; justify-content: flex-start; gap: 18px; width: 100%; min-width: 0; padding: 20px 22px; border: 0; border-bottom: 1px solid #edf0f6; border-radius: 0; background: #fff; text-align: left; }
.draft-row:last-child { border-bottom: 0; }
.draft-row:hover { background: #f8faff; }
.draft-row strong { display: block; overflow: hidden; max-width: 560px; margin-bottom: 6px; color: #3b4b64; font-size: .875rem; text-overflow: ellipsis; white-space: nowrap; }
.draft-row .small { color: #8e99ab; }
.draft-row .arrow .icon { width: 16px; height: 16px; }
.money { color: #2c3f5c; font-size: 1rem; font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }
.badge { display: inline-flex; align-items: center; justify-content: center; gap: 4px; flex: 0 0 auto; min-height: 24px; padding: 3px 8px; border: 1px solid transparent; border-radius: 5px; background: #f0f3f8; color: #7c8799; font-size: .75rem; font-weight: 500; line-height: 1.5; white-space: nowrap; }
.badge .icon { width: 12px; height: 12px; }
.badge.review { background: #fff5df; color: #a2731f; border-color: #f7ebcd; }
.badge.good { background: #edf8f3; color: #2b8b62; border-color: #dff1e9; }
.badge.danger { background: #fdf0f1; color: #bc4c5a; border-color: #f9e2e6; }
.badge.neutral { background: #f1f3f7; color: #818c9e; border-color: #e9edf2; }
.empty { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 40px 24px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; text-align: center; }
.empty-icon { display: flex; align-items: center; justify-content: center; width: 48px; height: 48px; margin: 0 auto 17px; border: 1px solid #e8edf5; border-radius: 13px; background: #f6f8fc; color: #a2b0c7; }
.empty-icon .icon { width: 24px; height: 24px; }
.empty h2, .empty h3 { margin-bottom: 8px; color: #55667f; font-size: .9375rem; font-weight: 600; }
.empty .muted { max-width: 355px; margin: 0 auto 18px; color: #96a1b3; font-size: .75rem; line-height: 1.85; }
.empty .muted:last-child { margin-bottom: 0; }
.empty > button { min-height: 36px; padding: 7px 12px; font-size: .75rem; }
.empty.compact { min-height: 220px; padding: 30px 25px; }
.empty.compact .empty-icon { width: 42px; height: 42px; margin-bottom: 13px; border-radius: 11px; }
.empty.compact .empty-icon .icon { width: 22px; height: 22px; }
.empty.compact .muted { max-width: 280px; }

/* Native approvals retain a visible list while showing the selected record. */
.native-page { padding-top: 30px; }
.native-page .page-heading { margin-bottom: 22px; }
.native-toolbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px 22px; padding: 17px 20px; border: 1px solid var(--line); border-radius: 12px; background: #fff; box-shadow: var(--shadow); }
.range-shortcuts, .filter-chips { display: flex; align-items: center; gap: 5px; }
.range-shortcuts { padding: 4px; border-radius: 9px; background: #f5f7fb; }
.chip { min-height: 34px; padding: 7px 12px; border: 1px solid transparent; border-radius: 7px; background: transparent; color: #7a879b; font-size: .75rem; font-weight: 500; white-space: nowrap; }
.chip:hover { border-color: transparent; background: #edf2fa; color: #567097; }
.chip.active { border-color: #e1e8f5; background: #fff; color: #3269df; box-shadow: 0 1px 4px #29456b06; }
.filter-chips .chip.active { border-color: #dbe6ff; background: #edf3ff; color: #3269df; box-shadow: none; }
.date-range { display: flex; align-items: flex-end; gap: 10px; }
.date-range .field { margin: 0; }
.date-range .field > span:first-child { margin-bottom: 5px; color: #8b96a8; font-size: .75rem; }
.date-range input { min-width: 145px; max-width: 175px; height: 39px; min-height: 39px; padding: 7px 10px; font-size: .75rem; }
.date-range .primary { min-height: 39px; padding: 8px 15px; font-size: .75rem; }
.date-separator { align-self: flex-end; margin: 0 0 10px; color: #a7b2c3; font-size: .75rem; }
.native-filterbar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin: 20px 0 14px; }
.native-filterbar input.search { width: min(260px, 100%); min-height: 38px; padding: 8px 12px; border-color: #e4e9f1; background: #fff; font-size: .75rem; }
.search-wrap { position: relative; display: flex; align-items: center; min-width: 0; }
.search-wrap > .icon { position: absolute; left: 12px; width: 17px; height: 17px; color: #9aa6b9; pointer-events: none; }
.native-filterbar .search-wrap input.search { padding-left: 38px; }
.native-filterbar .filter-chips { flex-wrap: wrap; gap: 4px; }
.result-count { margin-left: auto; color: #8a97ac; font-size: .75rem; white-space: nowrap; }
.result-count strong { color: #5b6d86; font-weight: 600; }
.native-results { display: grid; grid-template-columns: 340px minmax(0, 1fr); min-height: 570px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; overflow: hidden; box-shadow: var(--shadow); }
.native-results .list-column { width: auto; min-width: 0; padding: 0; border-right: 1px solid var(--line); background: #fff; }
.list-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 56px; padding: 17px 20px; border-bottom: 1px solid #ebeff5; color: #8592a7; font-size: .75rem; }
.list-header h2 { padding: 0; color: #6c7c93; font-size: .8125rem; font-weight: 600; }
.list-header .count { margin-left: 0; }
.native-list { display: flex; flex-direction: column; }
.native-row { position: relative; display: flex; flex-direction: column; align-items: stretch; justify-content: center; gap: 13px; width: 100%; min-height: 103px; padding: 19px 20px; border: 0; border-bottom: 1px solid #eef1f6; border-radius: 0; background: #fff; text-align: left; }
.native-row:hover { background: #f7faff; }
.native-row.selected { background: #f0f5ff; }
.native-row.selected::before { position: absolute; top: 0; bottom: 0; left: 0; width: 3px; background: var(--blue); content: ""; }
.native-row-top, .native-row-bottom { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-width: 0; }
.native-row-top strong { display: -webkit-box; flex: 1; min-width: 0; overflow-wrap: anywhere; overflow: hidden; color: #445672; font-size: .8125rem; font-weight: 600; line-height: 1.65; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.native-row.selected .native-row-top strong { color: #315cad; }
.native-row-bottom { color: #96a1b3; font-size: .75rem; font-weight: 400; }
.native-row-bottom .icon { width: 14px; height: 14px; color: #a9b4c6; }
.native-row.selected .native-row-bottom .icon { color: #6090e9; }
.native-row .badge { font-size: .75rem; padding: 3px 6px; }
.native-results .detail-column { padding: 29px 30px; background: #fff; }
.detail-column { flex: 1; min-width: 0; padding: 30px; }
.native-results .detail-column > .empty { min-height: 390px; padding: 35px; border: 0; }
.native-results .list-column > .empty { min-height: 285px; padding: 25px 20px; border: 0; border-radius: 0; }
.detail-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.detail-heading h1 { max-width: 700px; color: #2e4160; font-size: 1.375rem; font-weight: 600; line-height: 1.6; letter-spacing: -.02em; overflow-wrap: anywhere; }
.detail-heading .badge { margin-top: 7px; }
.kind-label { display: block; margin-bottom: 8px; color: #99a5b7; font-size: .75rem; font-weight: 600; letter-spacing: .08em; }
.amount-panel { margin: 22px 0 26px; padding: 21px 24px; border: 1px solid #e8eef7; border-radius: 11px; background: #f8faff; }
.amount-panel > small, .amount-panel > .muted { color: #8a99b0; font-size: .75rem; }
.detail-amount { margin: 14px 0 10px; color: #294878; font-size: 2rem; font-weight: 600; line-height: 1.4; letter-spacing: -.025em; font-variant-numeric: tabular-nums; }
.amount-panel .detail-amount { display: flex; align-items: baseline; gap: 8px; margin: 4px 0 0; }
.detail-amount .currency, .detail-amount small { color: #8698b3; font-size: .8125rem; font-weight: 400; letter-spacing: 0; }
.detail-meta { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 19px 26px; margin: 20px 0 28px; }
.detail-meta > div, .detail-meta > dl { min-width: 0; margin: 0; }
.detail-meta dt, .detail-meta .label { margin-bottom: 6px; color: #64748b; font-size: .75rem; }
.detail-meta dd, .detail-meta .value { margin: 0; color: #526680; font-size: .8125rem; line-height: 1.75; overflow-wrap: anywhere; }
.detail-section { margin-top: 24px; padding-top: 22px; border-top: 1px solid #edf1f6; }
.detail-section > h2 { margin-bottom: 16px; color: #455b78; font-size: .875rem; }
.detail-section > h2 .icon { width: 18px; height: 18px; margin-right: 7px; color: #91a2bd; }
.detail-grid { display: grid; grid-template-columns: 104px minmax(0, 1fr); gap: 16px 20px; margin: 22px 0; font-size: .8125rem; line-height: 1.85; }
.detail-grid dt { color: #95a0b2; }
.detail-grid dd { margin: 0; color: #546781; overflow-wrap: anywhere; }
.detail-grid section { grid-column: 1 / -1; }
.native-field-row { margin: 14px 0; padding: 18px 20px; border-color: #e8edf5; border-radius: 10px; background: #fafbfe; box-shadow: none; }
.native-field-row h3 { color: #6b7e99; font-size: .75rem; }
.native-field-row .detail-grid { margin: 15px 0 2px; gap: 12px 18px; font-size: .75rem; }
.native-results.loading { display: flex; min-height: 400px; padding: 0; }
.loading-panel { display: flex; flex: 1; flex-direction: column; align-items: center; justify-content: center; gap: 13px; width: 100%; min-height: 250px; padding: 40px 24px; color: #8c9aaf; font-size: .8125rem; text-align: center; }
.loading-panel > .icon { width: 26px; height: 26px; color: #5c85df; }
.loading-panel p { max-width: 330px; color: #9ca7b8; font-size: .75rem; }
.results-caption { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-top: 14px; color: #9aa5b6; font-size: .75rem; line-height: 1.75; }
.results-caption .icon { width: 13px; height: 13px; margin-right: 5px; }
.list-column > button[data-action="native-more"] { display: flex; width: calc(100% - 32px); min-height: 38px; margin: 14px 16px; color: #6883ad; font-size: .75rem; }
.center-layout { display: flex; flex: 1; min-width: 0; background: #fff; }
.center-layout .list-column { width: 340px; padding: 24px 0; border-right: 1px solid var(--line); }
.center-layout .list-column h2 { padding: 0 20px 22px; }
.center-layout .list-column input.search { width: calc(100% - 40px); margin: 0 20px 20px; }
.center-layout .list-column .draft-row { display: block; padding: 18px 20px; }
.center-layout .list-column .draft-row.selected { border-left: 3px solid var(--blue); background: #f0f5ff; }
.center-layout .list-column .money { display: block; margin-top: 10px; }
.native-controls { display: grid; gap: 16px; margin: 16px 20px; }
.native-controls .field { margin: 0; }
.native-controls input { width: 100%; min-width: 0; }
.list-column > p, .list-column > .notice { margin: 12px 20px; }
.notice { display: block; margin-bottom: 18px; padding: 13px 16px; border: 1px solid #e1e9f7; border-radius: 9px; background: #f3f7fe; color: #7087a9; font-size: .75rem; line-height: 1.85; overflow-wrap: anywhere; }
.notice.warn { border-color: #f2e7cd; background: #fffaed; color: #977c3e; }
.notice .icon { width: 16px; height: 16px; margin-right: 6px; vertical-align: -3px; }
.native-error { margin-top: 15px; margin-bottom: 0; }
.system-notice { margin: 12px 22px; }
.detail-column > .notice:last-child { margin-top: 24px; margin-bottom: 0; }
.mobile-back { display: none; }

/* Forms and receipts share the same spacing and control vocabulary. */
.form-shell { flex: 1; min-width: 0; min-height: calc(100vh - var(--header-height)); padding: 28px 30px 120px; background: var(--canvas); }
.form-heading { display: flex; align-items: center; gap: 12px; max-width: 900px; margin: 0 auto 23px; }
.form-heading h1 { font-size: 1.375rem; }
.form-heading > .quiet { min-width: 40px; padding: 8px; color: #7b8ba3; }
.form-heading .badge { margin-left: auto; }
.form-card { max-width: 900px; margin: auto; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow); }
.form-section { padding: 30px 38px; border-bottom: 1px solid var(--line); }
.form-section:last-child { border-bottom: 0; }
.form-section h2 { display: flex; align-items: center; gap: 10px; margin-bottom: 24px; color: #405572; font-size: .9375rem; }
.step { display: grid; place-items: center; flex: 0 0 auto; width: 24px; height: 24px; border-radius: 7px; background: #edf3ff; color: #5b80c8; font-size: .75rem; font-weight: 500; }
.field { display: block; min-width: 0; margin: 20px 0; }
.field > span:first-child { display: block; margin-bottom: 8px; color: #5e6d83; font-size: .8125rem; font-weight: 500; }
.required::after { content: " *"; color: #d76a71; }
.field input:not([type="checkbox"]), .field select, .field textarea, input.search { display: block; width: 100%; min-width: 0; max-width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid #dce3ed; border-radius: 8px; background: #fff; color: #394d6b; font-size: .875rem; line-height: 1.5; }
.field input::placeholder, .field textarea::placeholder, input.search::placeholder { color: #a2adbe; opacity: 1; }
.field select { cursor: pointer; }
.field input:hover:not(:disabled), .field textarea:hover:not(:disabled), .field select:hover:not(:disabled), input.search:hover { border-color: #bfcde1; }
.field textarea { min-height: 100px; resize: vertical; line-height: 1.8; }
.field input:focus, .field textarea:focus, .field select:focus, input.search:focus { outline: 3px solid #3269eb12; outline-offset: 0; border-color: #7097ec; }
.field input:disabled, .field select:disabled, .field textarea:disabled { background: #f5f7fb; color: #9ca6b7; cursor: not-allowed; }
.field input[aria-invalid="true"], .field textarea[aria-invalid="true"], .field select[aria-invalid="true"] { border-color: #d77981; background: #fffdfd; }
.field-error { margin-top: 6px; color: #b95360; font-size: .75rem; line-height: 1.7; }
.field > .muted { margin-top: 6px; font-size: .75rem; }
.two-col { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; }
.check-options { display: flex; flex-wrap: wrap; gap: 10px 22px; font-size: .8125rem; }
.check-options label { display: inline-flex; align-items: center; gap: 8px; min-height: 34px; color: #62718a; line-height: 1.7; cursor: pointer; }
.check-options input, .receipt-row input[type="checkbox"] { width: 17px; height: 17px; margin: 0; accent-color: var(--blue); cursor: pointer; }
.line-card { margin-bottom: 18px; padding: 20px 24px; border: 1px solid #e5eaf3; border-radius: 11px; background: #fafcff; }
.line-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 36px; margin-bottom: 2px; color: #7890b1; font-size: .75rem; font-weight: 600; }
.line-header button { min-height: 36px; padding: 7px 8px; color: #a2838b; font-size: .75rem; }
.line-card .field { margin-bottom: 8px; }
.form-total { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; margin-top: 22px; padding-top: 21px; border-top: 1px solid var(--line); color: #8190a6; font-size: .8125rem; }
.form-total strong { color: #3c5c8e; font-size: 1.625rem; font-variant-numeric: tabular-nums; }
.source-label { margin-top: 7px; color: #738f72; font-size: .75rem; line-height: 1.7; }
.upload { padding: 24px; margin: 20px 0; border: 1px dashed #cbd7ea; border-radius: 11px; background: #f9fbff; text-align: center; }
.upload input { max-width: 100%; color: #7d8da5; font-size: .8125rem; }
.upload input::file-selector-button { min-height: 38px; margin-right: 14px; padding: 8px 13px; border: 1px solid #d2def1; border-radius: 7px; background: #fff; color: #5679b6; font-family: inherit; font-size: .8125rem; cursor: pointer; }
.upload p { margin-top: 12px; color: #98a3b5; font-size: .75rem; }
.receipt-row { display: flex; align-items: center; gap: 13px; min-width: 0; padding: 16px 0; border-bottom: 1px solid #ebeff5; }
.receipt-row:last-child { border-bottom: 0; }
.receipt-row > .icon { width: 26px; height: 26px; color: #819bc3; }
.receipt-row strong { display: block; margin-bottom: 5px; color: #596d88; font-size: .8125rem; font-weight: 500; overflow-wrap: anywhere; }
.receipt-row .muted { color: #97a2b4; }
.receipt-actions { display: flex; align-items: center; gap: 4px; }
.receipt-actions button { min-height: 38px; padding: 8px 10px; font-size: .75rem; }
.inbox .receipt-row { padding: 21px 23px; }
.inbox-tools { display: flex; align-items: center; gap: 12px; }
.flow { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin: 4px 0 14px; font-size: .8125rem; }
.flow-node { padding: 10px 14px; border: 1px solid #e3eaf5; border-radius: 8px; background: #f6f8fd; color: #6f83a1; }
.flow > .icon { width: 16px; height: 16px; color: #a9b6c9; }
.form-footer { position: fixed; right: 0; bottom: 0; left: 0; z-index: 35; padding: 16px 26px max(16px, env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: #fff; box-shadow: 0 -4px 18px #263b6305; }
.footer-inner { display: flex; align-items: center; gap: 10px; max-width: 900px; margin: auto; }
.footer-inner .muted { margin-right: auto; color: #8798b2; font-size: .75rem; }
.footer-inner button { white-space: nowrap; }
.editor-fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
.editor-fieldset:disabled { opacity: .72; }
.editor-fieldset:disabled .receipt-actions { opacity: 1; }

/* Authentication, feedback and dialogs. */
.auth-wrap { display: grid; place-items: center; min-height: calc(100vh - var(--header-height)); min-height: calc(100dvh - var(--header-height)); padding: 40px 24px; }
.auth-panel { width: 100%; max-width: 470px; padding: 42px; border: 1px solid var(--line); border-radius: 16px; background: #fff; box-shadow: 0 8px 35px #28426906; }
.auth-panel .brand-icon { width: 48px; height: 50px; margin-bottom: 27px; border-radius: 13px; }
.auth-panel h1 { margin-bottom: 13px; color: #304666; font-size: 1.5rem; }
.auth-panel p { margin-bottom: 26px; color: #8694a9; font-size: .8125rem; line-height: 1.9; }
.auth-panel .primary { width: 100%; min-height: 45px; padding: 12px; }
.loading { padding: 60px; color: var(--muted); text-align: center; }
#toast { display: none; }
dialog { width: calc(100% - 32px); max-width: 660px; max-height: 86vh; max-height: 86dvh; padding: 0; border: 1px solid var(--line); border-radius: 15px; background: #fff; color: var(--ink); box-shadow: 0 20px 80px #2037542e; }
dialog::backdrop { background: #172c4954; }
.modal-heading { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 25px; border-bottom: 1px solid var(--line); background: #fff; }
.modal-heading h2 { min-width: 0; overflow-wrap: anywhere; color: #3b5272; font-size: 1rem; }
.modal-heading .quiet { flex: 0 0 auto; min-width: 40px; padding: 8px; color: #99a6ba; }
.modal-body { padding: 26px; }
.modal-body > .muted { margin: 10px 0 18px; }
.modal-body > h3 { overflow-wrap: anywhere; }
.modal-footer { display: flex; justify-content: flex-end; gap: 10px; padding: 18px 25px; border-top: 1px solid var(--line); background: #fbfcfe; }
.candidate { margin: 15px 0; padding: 18px; border: 1px solid #e2e9f4; border-radius: 10px; background: #fcfdff; }
.candidate-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 7px; color: #8392a9; font-size: .75rem; }
.candidate strong { overflow-wrap: anywhere; color: #46658e; font-size: 1rem; }
.candidate .muted { margin-top: 10px; color: #94a0b4; font-size: .75rem; overflow-wrap: anywhere; }
.candidate button { margin-top: 12px; font-size: .75rem; }
.raw-text { max-height: 240px; overflow: auto; padding: 16px; border: 1px solid #e9eef5; border-radius: 8px; background: #f8fafd; color: #8290a5; font-size: .75rem; line-height: 1.8; white-space: pre-wrap; overflow-wrap: anywhere; }
.error-panel { margin: 16px 0; padding: 14px 18px; border: 1px solid #f1dce0; border-radius: 9px; background: #fdf3f4; color: #ab5b67; font-size: .8125rem; line-height: 1.8; overflow-wrap: anywhere; }
details summary { min-height: 38px; margin: 14px 0; padding: 8px 0; color: #8392a8; font-size: .8125rem; cursor: pointer; }
details[open] summary { margin-bottom: 18px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }

@media (min-width: 1700px) {
  .content { padding-right: 48px; padding-left: 48px; }
  .quick-actions { gap: 22px; }
  .quick-primary, .quick-card { min-height: 196px; padding: 26px; }
  .native-results { grid-template-columns: 365px minmax(0, 1fr); }
  .native-results .detail-column { padding: 34px 40px; }
  .detail-meta { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 1200px) {
  :root { --sidebar-width: 215px; }
  .topbar { gap: 20px; padding: 0 22px; }
  .topbar-context { padding-left: 20px; font-size: .75rem; }
  .content { padding: 30px 26px; }
  .quick-actions { gap: 14px; }
  .quick-primary, .quick-card { padding: 20px; }
  .metric-grid { gap: 14px; }
  .metric-card { grid-template-columns: 36px minmax(0, 1fr) auto; gap: 0 11px; padding: 17px; }
  .metric-icon { width: 36px; height: 36px; }
  .metric-note { font-size: .75rem; }
  .home-grid { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 18px; }
  .native-results { grid-template-columns: 300px minmax(0, 1fr); }
  .native-results .detail-column { padding: 25px; }
  .native-row { padding: 18px; }
  .native-toolbar { gap: 14px; padding: 16px; }
  .date-range input { min-width: 135px; }
  .date-range { gap: 8px; }
  .draft-row { gap: 12px; }
  .draft-row strong { max-width: 420px; }
}
@media (max-width: 1000px) and (min-width: 721px) {
  :root { --sidebar-width: 188px; }
  .sidebar { padding: 25px 11px 16px; }
  .side-link { gap: 9px; padding: 12px; font-size: .8125rem; }
  .topbar-context { display: none; }
  .topbar { gap: 16px; padding: 0 20px; }
  .identity { gap: 7px; }
  .identity .pilot { font-size: .75rem; }
  .content { padding: 25px 22px; }
  .quick-actions { grid-template-columns: 1fr 1fr; }
  .quick-primary { grid-column: 1 / -1; flex-direction: row; align-items: center; min-height: 140px; }
  .quick-card { min-height: 155px; }
  .metric-grid { gap: 10px; }
  .metric-card { grid-template-columns: 1fr auto; gap: 5px 8px; min-height: 106px; padding: 16px 14px; }
  .metric-icon { display: none; }
  .metric-label { grid-column: 1; font-size: .75rem; }
  .metric-value { grid-column: 2; font-size: 1.5rem; }
  .metric-note { grid-column: 1; }
  .home-grid { grid-template-columns: 1fr; }
  .native-results { grid-template-columns: 245px minmax(0, 1fr); }
  .native-row { min-height: 110px; padding: 17px 14px; }
  .native-row-top { gap: 8px; align-items: flex-start; }
  .native-row-top strong { font-size: .75rem; }
  .native-row .badge { font-size: .75rem; }
  .native-results .detail-column { padding: 22px 19px; }
  .detail-heading { gap: 10px; }
  .detail-heading h1 { font-size: 1.125rem; }
  .detail-meta { gap: 15px; }
  .detail-grid { grid-template-columns: 75px minmax(0, 1fr); gap: 14px; font-size: .75rem; }
  .native-field-row { padding: 15px; }
  .native-toolbar { flex-direction: column; align-items: stretch; }
  .range-shortcuts { align-self: flex-start; }
  .date-range { justify-content: flex-start; }
  .date-range .field { flex: 1; }
  .date-range input { width: 100%; max-width: none; }
  .date-stamp { display: none; }
  .native-filterbar { gap: 10px; }
  .native-filterbar input.search { width: 220px; }
  .filter-chips { gap: 2px; }
  .chip { padding: 7px 9px; }
  .result-count { font-size: .75rem; }
}
@media (max-width: 720px) {
  :root { --header-height: 65px; --sidebar-width: 0px; --radius: 12px; }
  body { padding-bottom: calc(74px + env(safe-area-inset-bottom)); }
  h1 { font-size: 1.375rem; }
  h2 { font-size: 1rem; }
  button, .primary { min-height: 44px; }
  .topbar { height: var(--header-height); gap: 10px; padding: 0 16px; }
  .brand { gap: 8px; font-size: .875rem; }
  .brand-icon { width: 32px; height: 34px; border-radius: 9px; }
  .brand-icon .icon { width: 20px; height: 20px; }
  .brand-subtitle { font-size: .5rem; letter-spacing: .06em; }
  .topbar-context, .topnav { display: none; }
  .identity { gap: 5px; font-size: .75rem; }
  .identity .pilot { display: none; }
  .identity .avatar { width: 28px; height: 28px; font-size: .75rem; }
  .identity .user-name { font-size: .75rem; }
  .identity .quiet { min-width: 32px; min-height: 40px; padding: 6px; font-size: .75rem; }
  .identity .quiet .icon { width: 16px; height: 16px; }
  .topbar .primary { gap: 4px; min-height: 36px; padding: 8px 10px; font-size: .75rem; }
  .topbar .primary .icon { width: 14px; height: 14px; }
  .workspace { display: flex; flex-direction: column; min-height: calc(100dvh - var(--header-height) - 74px); }
  .sidebar { position: fixed; top: auto; right: 0; bottom: 0; left: 0; z-index: 40; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); align-items: stretch; width: auto; height: calc(69px + env(safe-area-inset-bottom)); padding: 5px 7px calc(5px + env(safe-area-inset-bottom)); border-top: 1px solid #e4eaf4; border-right: 0; background: #fff; box-shadow: 0 -3px 18px #233b6405; }
  .sidebar-top { display: contents; }
  .sidebar .group-label, .sidebar-bottom { display: none; }
  .side-link { display: flex; flex-direction: column; justify-content: center; gap: 5px; width: 100%; min-width: 0; min-height: 58px; margin: 0; padding: 6px 2px; border: 0; border-radius: 9px; color: #97a2b4; font-size: .75rem; line-height: 1.3; text-align: center; }
  .side-link.active { color: #3269d9; background: #f1f5ff; }
  .side-link > .icon, .side-icon, .side-link .icon { display: inline-flex; width: 21px; height: 21px; color: #94a2ba; }
  .side-link.active .icon { color: #3269eb; }
  .side-link .nav-label { display: block; overflow: hidden; max-width: 100%; font-size: .75rem; white-space: nowrap; }
  .side-link .count { position: absolute; top: 3px; left: calc(50% + 6px); min-width: 15px; height: 15px; margin: 0; padding: 0 4px; border: 1px solid #fff; border-radius: 5px; background: #dfe8f7; color: #6985b1; font-size: .5rem; line-height: 13px; }
  .content { width: 100%; padding: 25px 17px 28px; }
  .page-heading { align-items: flex-start; gap: 12px; margin-bottom: 21px; }
  .eyebrow { margin-bottom: 5px; font-size: .75rem; }
  .page-heading h1 { font-size: 1.375rem; }
  .page-heading .subtitle { margin-top: 6px; font-size: .75rem; }
  .page-heading h1 + .eyebrow { font-size: .75rem; }
  .heading-actions { gap: 6px; }
  .heading-actions .date-stamp { display: none; }
  .heading-actions .primary, .page-heading > .primary { min-height: 38px; padding: 8px 10px; font-size: .75rem; }
  .section-label { gap: 10px; margin: 25px 0 13px; }
  .section-label button { padding: 6px 8px; font-size: .75rem; }
  .quick-actions { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; margin-bottom: 16px; }
  .quick-primary { grid-column: 1 / -1; min-height: 174px; padding: 22px; }
  .quick-card { min-height: 162px; padding: 17px; gap: 12px; }
  .quick-primary h2, .quick-primary h3 { font-size: 1.0625rem; }
  .quick-card h2, .quick-card h3 { font-size: .8125rem; }
  .quick-primary p { font-size: .75rem; }
  .quick-card p { font-size: .75rem; }
  .quick-primary > .icon, .quick-card > .icon, .quick-icon { width: 34px; height: 34px; border-radius: 9px; }
  .quick-icon .icon { width: 20px; height: 20px; }
  .quick-primary button, .quick-card button { min-height: 36px; font-size: .75rem; }
  .quick-card button { padding-right: 0; padding-left: 0; }
  .quick-primary .action-label, .quick-card .action-label { font-size: .75rem; }
  .metric-grid { gap: 9px; margin-bottom: 20px; }
  .metric-card { display: flex; flex-direction: column; align-items: flex-start; gap: 5px; min-height: 110px; padding: 15px 12px; border-radius: 10px; }
  .metric-icon { display: none; }
  .metric-label { font-size: .75rem; }
  .metric-value { order: 2; font-size: 1.5rem; line-height: 1.35; }
  .metric-note { order: 3; margin: 0; color: #a2adbd; font-size: .75rem; line-height: 1.5; }
  .metric-card .metric-text { display: contents; }
  .home-grid { grid-template-columns: minmax(0, 1fr); gap: 17px; }
  .panel-heading { min-height: 59px; padding: 14px 18px; }
  .panel-heading h2 { font-size: .8125rem; }
  .panel-heading .quiet { min-height: 32px; font-size: .75rem; }
  .panel-body { padding: 17px; }
  .home-grid .empty, .empty.compact { min-height: 206px; padding: 26px 24px; }
  .empty { padding: 35px 22px; }
  .empty h2 { font-size: .875rem; }
  .empty .muted { font-size: .75rem; }
  .cards { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .template-card { padding: 20px; }
  .application-card { width: 100%; max-width: none; padding: 20px; }
  .draft-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 9px 12px; padding: 18px; }
  .draft-row .grow { min-width: 0; }
  .draft-row strong { max-width: 100%; margin-bottom: 5px; font-size: .75rem; }
  .draft-row .small { font-size: .75rem; }
  .draft-row .money { font-size: .875rem; }
  .draft-row > .badge { grid-column: 1; justify-self: start; }
  .draft-row > .arrow { grid-column: 2; grid-row: 2; }
  .badge { min-height: 22px; padding: 3px 6px; font-size: .75rem; }
  .native-page { padding-top: 25px; }
  .native-page .page-heading { margin-bottom: 18px; }
  .native-toolbar { flex-direction: column; align-items: stretch; gap: 14px; padding: 14px; border-radius: 11px; }
  .range-shortcuts { align-self: stretch; }
  .range-shortcuts .chip { flex: 1; min-height: 36px; }
  .date-range { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; align-items: stretch; }
  .date-range .field { min-width: 0; }
  .date-range .field > span:first-child { margin-bottom: 6px; font-size: .75rem; }
  .date-range .field input { width: 100%; min-width: 0; max-width: none; min-height: 40px; padding: 8px; font-size: .75rem; }
  .date-range .primary { grid-column: 1 / -1; min-height: 40px; font-size: .75rem; }
  .date-separator { display: none; }
  .native-filterbar { gap: 10px; margin: 16px 0 12px; }
  .native-filterbar input.search, .native-filterbar .search-wrap { width: 100%; }
  .native-filterbar input.search { min-height: 40px; font-size: .75rem; }
  .native-filterbar .filter-chips { gap: 2px; flex-wrap: nowrap; }
  .chip { min-height: 36px; padding: 7px 9px; font-size: .75rem; }
  .result-count { font-size: .75rem; }
  .native-results { display: block; min-height: 370px; border-radius: 11px; }
  .native-results .list-column { width: 100%; min-height: 350px; border-right: 0; }
  .list-header { min-height: 52px; padding: 15px 17px; font-size: .75rem; }
  .native-row { min-height: 97px; padding: 18px; gap: 12px; }
  .native-row-top { align-items: center; }
  .native-row-top strong { font-size: .8125rem; }
  .native-row-bottom { font-size: .75rem; }
  .native-row .badge { min-height: 23px; padding: 3px 7px; font-size: .75rem; }
  .native-results .detail-column { padding: 20px 18px 24px; }
  .native-results.show-detail .list-column { display: none; }
  .native-results:not(.show-detail) .detail-column { display: none; }
  .mobile-back { display: inline-flex; align-items: center; gap: 6px; min-height: 38px; margin: 0 0 16px -8px; padding: 7px 8px; color: #7b91b0; font-size: .75rem; }
  .mobile-back .icon { width: 16px; height: 16px; }
  .detail-heading { gap: 12px; margin-bottom: 18px; }
  .detail-heading h1 { font-size: 1.125rem; }
  .kind-label { margin-bottom: 6px; font-size: .75rem; }
  .detail-heading .badge { margin-top: 7px; }
  .amount-panel { margin: 17px 0 22px; padding: 18px; }
  .detail-amount { font-size: 1.875rem; }
  .detail-meta { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px 20px; margin-bottom: 22px; }
  .detail-meta dt, .detail-meta .label { font-size: .75rem; }
  .detail-meta dd, .detail-meta .value { font-size: .75rem; }
  .detail-grid { grid-template-columns: 80px minmax(0, 1fr); gap: 14px 13px; margin: 19px 0; font-size: .75rem; }
  .native-field-row { padding: 15px; }
  .native-field-row .detail-grid { grid-template-columns: 70px minmax(0, 1fr); gap: 11px; font-size: .75rem; }
  .detail-section { margin-top: 20px; padding-top: 20px; }
  .notice { padding: 12px 14px; border-radius: 8px; font-size: .75rem; }
  .results-caption { display: block; margin-top: 12px; font-size: .75rem; }
  .results-caption > span { display: block; }
  .results-caption > span + span { margin-top: 4px; }
  .native-results.loading { min-height: 300px; }
  .loading-panel { min-height: 240px; }
  .center-layout { flex-direction: column; }
  .center-layout .list-column { width: 100%; min-height: 360px; border: 0; }
  .center-layout.show-detail .list-column { display: none; }
  .center-layout:not(.show-detail) .detail-column { display: none; }
  .center-layout .detail-column { padding: 25px 18px; }
  .form-shell { width: 100%; padding: 21px 12px 160px; }
  .form-heading { gap: 8px; margin-bottom: 17px; }
  .form-heading h1 { font-size: 1.1875rem; }
  .form-card { border-radius: 11px; }
  .form-section { padding: 23px 19px; }
  .form-section h2 { margin-bottom: 20px; font-size: .875rem; }
  .field { margin: 19px 0; }
  .field > span:first-child { font-size: .75rem; }
  .field input:not([type="checkbox"]), .field select, .field textarea { font-size: 1rem; }
  .two-col { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .line-card { padding: 15px; border-radius: 9px; }
  .line-header { font-size: .75rem; }
  .check-options { flex-direction: column; gap: 8px; }
  .check-options label { min-height: 37px; font-size: .75rem; }
  .form-total strong { font-size: 1.375rem; }
  .upload { padding: 20px 14px; }
  .upload input { font-size: .75rem; }
  .upload input::file-selector-button { margin-right: 8px; padding: 8px 10px; font-size: .75rem; }
  .upload p { font-size: .75rem; }
  .receipt-row { flex-wrap: wrap; gap: 10px; align-items: center; }
  .receipt-row > .grow { min-width: calc(100% - 45px); }
  .receipt-row > .badge { margin-left: 0; }
  .receipt-row .receipt-actions { margin-left: auto; }
  .receipt-row strong { font-size: .75rem; }
  .receipt-row .muted { font-size: .75rem; }
  .receipt-actions button { min-height: 38px; padding: 7px; font-size: .75rem; }
  .inbox .receipt-row { padding: 18px; }
  .inbox-tools { flex-wrap: wrap; }
  .flow { gap: 8px; }
  .flow-node { padding: 9px 11px; font-size: .75rem; }
  .form-footer { bottom: calc(69px + env(safe-area-inset-bottom)); padding: 12px 14px; }
  .footer-inner { flex-wrap: wrap; gap: 8px; }
  .footer-inner .muted { width: 100%; margin: 0 0 1px; font-size: .75rem; }
  .footer-inner button { flex: 1; min-height: 42px; padding: 10px 7px; font-size: .75rem; }
  .auth-wrap { min-height: calc(100dvh - var(--header-height) - 74px); padding: 28px 20px; }
  .auth-panel { padding: 31px 27px; border-radius: 14px; }
  .auth-panel h1 { font-size: 1.375rem; }
  .auth-panel p { font-size: .75rem; }
  dialog { max-height: 88dvh; border-radius: 13px; }
  .modal-heading { padding: 15px 18px; }
  .modal-heading h2 { font-size: .9375rem; }
  .modal-body { padding: 21px 18px; }
  .modal-footer { flex-wrap: wrap; padding: 15px 18px; }
  .modal-footer button { flex: 1; font-size: .75rem; }
  .candidate { padding: 15px; }
  .candidate strong { font-size: .9375rem; }
  .system-notice { margin: 10px 15px; }
}
@media (max-width: 385px) {
  .topbar { gap: 7px; padding: 0 12px; }
  .brand { font-size: .8125rem; }
  .brand-icon { width: 29px; height: 31px; }
  .brand-subtitle { letter-spacing: .02em; }
  .identity .avatar { display: none; }
  .identity .user-name { font-size: .75rem; }
  .identity .quiet { padding: 5px; }
  .content { padding-right: 14px; padding-left: 14px; }
  .quick-card { padding: 16px 14px; }
  .metric-card { padding: 13px 10px; }
  .native-filterbar .filter-chips { gap: 0; }
  .native-filterbar .chip { padding: 7px 8px; }
  .result-count { font-size: .75rem; }
}
@media (prefers-reduced-motion: no-preference) {
  button, a.primary { transition: background-color .15s ease, border-color .15s ease, box-shadow .15s ease, color .15s ease; }
  dialog[open] { animation: appear .16s ease-out; }
  @keyframes appear { from { opacity: .2; transform: translateY(5px); } to { opacity: 1; transform: none; } }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
  .icon.spin, .icon-spin, .spin { animation: none; }
}

/* View contracts shared with the browser module. */
[hidden], #busy-indicator[hidden] { display: none !important; }
.icon-button { width: 40px; min-width: 40px; padding: 8px; }
.topbar-create { min-height: 38px; padding: 8px 12px; border-color: #dce6fc; background: #f3f7ff; color: #4872c7; font-size: .75rem; }
.topbar-create:hover { border-color: #c1d3f5; background: #eaf1ff; }
.page-subtitle { margin-top: 8px; color: #64748b; font-size: .8125rem; line-height: 1.7; }
.quick-actions .quick-primary { gap: 13px; }
.quick-primary .overline { display: block; margin-bottom: 6px; color: #d7e4ff; font-size: .75rem; letter-spacing: .08em; }
.quick-card { gap: 7px; }
.quick-card .quick-icon { margin-bottom: 8px; }
.quick-card h2 { margin-bottom: 0; }
.quick-link { display: inline-flex; align-items: center; gap: 7px; margin-top: auto; padding-top: 10px; color: #5c7eb8; font-size: .75rem; font-weight: 500; }
.quick-link .icon { width: 15px; height: 15px; }
.metric-value { display: flex; align-items: baseline; gap: 7px; }
.metric-value small { color: #64748b; font-size: .75rem; font-weight: 400; letter-spacing: 0; }
.row-icon, .template-icon { display: flex; align-items: center; justify-content: center; flex: 0 0 auto; width: 36px; height: 38px; border: 1px solid #e9eef7; border-radius: 9px; background: #f7f9fd; color: #899dbc; }
.row-icon .icon, .template-icon .icon { width: 19px; height: 19px; }
.draft-row > .icon { width: 16px; height: 16px; color: #a6b1c3; }
.template-icon { margin-bottom: 13px; }
.template-action { display: flex; align-items: center; gap: 5px; margin-top: 13px; color: #8298b9; font-size: .75rem; }
.template-action .icon { width: 14px; height: 14px; }
.compact .empty { min-height: 226px; padding: 28px 24px; border: 0; border-radius: 0; }
.compact .empty .muted { max-width: 285px; }
.panel-heading .muted { margin-top: 3px; color: #64748b; font-size: .75rem; }
.workspace-note { display: flex; align-items: flex-start; justify-content: center; gap: 7px; margin-top: 24px; color: #64748b; font-size: .75rem; line-height: 1.8; }
.workspace-note .icon { flex: 0 0 auto; width: 15px; height: 15px; margin-top: 2px; }
.sidebar-bottom { display: grid; grid-template-columns: 17px minmax(0, 1fr); align-items: start; gap: 3px 8px; }
.sidebar-bottom > .icon { grid-row: 1 / span 3; }
.sidebar-bottom > strong, .sidebar-bottom > p, .sidebar-bottom > .connection-state { grid-column: 2; }
.sidebar-bottom > strong { margin-bottom: 0; white-space: nowrap; }
.connection-state { display: inline-flex; align-items: center; gap: 6px; color: #a2885d; font-size: .75rem; font-weight: 500; white-space: nowrap; }
.connection-state .icon { width: 15px; height: 15px; }
.connection-state.connected { color: #6e9580; }
.sidebar-bottom .connection-state { margin-top: 6px; font-size: .75rem; }
.native-toolbar .range-shortcuts > span { padding: 0 7px; font-size: .75rem; color: #64748b; }
.range-separator { align-self: flex-end; margin-bottom: 12px; color: #9ba6b8; font-size: .75rem; }
.range-help { flex: 0 0 100%; margin: -6px 0 -1px; color: #64748b; font-size: .75rem; }
.native-filterbar .search-wrap { margin-left: auto; }
.native-page > .results-caption { margin: 0 0 12px; }
.native-row-bottom > span { display: inline-flex; align-items: center; gap: 6px; }
.list-footer { display: flex; flex-direction: column; align-items: stretch; gap: 8px; padding: 16px; }
.list-footer button { min-height: 38px; color: #7088ae; font-size: .75rem; }
.list-footer p { text-align: center; font-size: .75rem; }
.detail-heading h2 { max-width: 700px; color: #2e4160; font-size: 1.375rem; font-weight: 600; line-height: 1.6; letter-spacing: -.02em; overflow-wrap: anywhere; }
.detail-amount > span { color: #8698b3; font-size: .8125rem; font-weight: 400; letter-spacing: 0; }
.detail-section > h3 { color: #526c91; font-size: .8125rem; }
.detail-column > section > h2 { margin-top: 22px; margin-bottom: 15px; color: #526c91; font-size: .8125rem; }
.attachment-summary { display: flex; align-items: center; gap: 11px; margin: 23px 0 16px; padding: 15px 17px; border: 1px solid #e7edf6; border-radius: 9px; background: #fafbfe; }
.attachment-summary > .icon { width: 19px; height: 19px; color: #91a2bf; }
.attachment-summary strong { color: #7185a1; font-size: .75rem; font-weight: 500; }
.attachment-summary .muted { margin-top: 3px; color: #64748b; font-size: .75rem; }
.detail-footnote { color: #64748b; font-size: .75rem; line-height: 1.9; }
.native-error { display: flex; align-items: flex-start; gap: 4px; }
.native-error > .icon { flex: 0 0 auto; margin-top: 3px; }
.native-error p { margin-top: 3px; font-size: .75rem; }
.native-results.loading { display: grid; }
.native-results.loading .list-column { width: auto; }
.upload { position: relative; }
.upload-icon { display: flex; align-items: center; justify-content: center; width: 47px; height: 47px; margin: 0 auto 13px; border: 1px solid #e3eaf7; border-radius: 12px; background: #fff; color: #8da4c9; }
.upload-icon .icon { width: 24px; height: 24px; }
.upload h3 { color: #657d9e; font-size: .875rem; }
.upload h3 + p { margin-top: 5px; font-size: .75rem; }
.upload-label { display: inline-flex; align-items: center; justify-content: center; min-height: 40px; margin: 16px 0 0; padding: 8px 18px; border: 1px solid #cedcf3; border-radius: 8px; background: #fff; color: #6285bd; font-size: .75rem; font-weight: 500; cursor: pointer; }
.upload-label:hover { background: #edf3ff; border-color: #b8cdef; }
.upload-file { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
.upload:has(.upload-file:focus-visible) .upload-label { outline: 3px solid #88aafc; outline-offset: 3px; }
.form-footer { left: var(--sidebar-width); }
@media (max-width: 1200px) {
  .metric-value { flex-direction: column; gap: 3px; align-items: flex-end; }
}
@media (max-width: 1000px) and (min-width: 721px) {
  .detail-heading h2 { font-size: 1.125rem; }
  .range-help { flex-basis: auto; margin-top: 0; }
}
@media (max-width: 720px) {
  .sidebar-top > nav { display: contents; }
  .sidebar-bottom { display: none; }
  .topbar-create { min-height: 36px; gap: 4px; padding: 7px 8px; font-size: .75rem; }
  .topbar-create .icon { width: 13px; height: 13px; }
  .page-subtitle { margin-top: 6px; font-size: .75rem; }
  .page-heading > .date-stamp { display: none; }
  .quick-primary { position: relative; min-height: 203px; }
  .quick-primary .quick-icon { position: absolute; top: 22px; right: 22px; }
  .quick-primary .overline { margin-bottom: 11px; font-size: .75rem; }
  .quick-primary > div { padding-right: 24px; }
  .quick-primary h2 { font-size: .9375rem; }
  .quick-primary button { margin-top: 8px; }
  .quick-card { min-height: 177px; gap: 6px; }
  .quick-card .quick-icon { margin-bottom: 7px; }
  .quick-link { padding-top: 7px; font-size: .75rem; }
  .metric-value { flex-direction: row; align-items: baseline; gap: 4px; }
  .metric-value small { display: none; }
  .row-icon { width: 30px; height: 33px; border-radius: 8px; }
  .row-icon .icon { width: 17px; height: 17px; }
  .draft-row { grid-template-columns: 30px minmax(0, 1fr) auto; gap: 8px 10px; }
  .draft-row .grow { grid-column: 2; }
  .draft-row > .money { grid-column: 3; }
  .draft-row > .badge { grid-column: 2; }
  .draft-row > .icon { grid-column: 3; justify-self: end; width: 14px; height: 14px; }
  .compact .empty { min-height: 200px; padding: 26px 22px; }
  .panel-heading .muted { margin-top: 3px; font-size: .75rem; }
  .workspace-note { justify-content: flex-start; margin-top: 20px; font-size: .75rem; }
  .workspace-note .icon { width: 13px; height: 13px; margin-top: 3px; }
  .heading-actions { flex-direction: column-reverse; align-items: flex-end; gap: 5px; }
  .heading-actions > .quiet { min-height: 30px; padding: 5px 0; font-size: .75rem; }
  .connection-state { gap: 4px; font-size: .75rem; }
  .connection-state .icon { width: 13px; height: 13px; }
  .native-toolbar .range-shortcuts > span { padding: 0 4px; font-size: .75rem; }
  .range-separator { display: none; }
  .range-help { margin: -3px 0 0; font-size: .75rem; }
  .native-filterbar { flex-direction: column-reverse; align-items: stretch; }
  .native-filterbar .filter-chips { justify-content: space-between; }
  .native-filterbar .chip { padding-right: 10px; padding-left: 10px; }
  .native-filterbar .search-wrap { margin-left: 0; }
  .native-page > .results-caption { margin-bottom: 10px; font-size: .75rem; }
  .detail-heading h2 { font-size: 1.125rem; }
  .native-results.loading { display: block; }
  .attachment-summary { gap: 10px; margin-top: 20px; padding: 14px; }
  .attachment-summary strong { font-size: .75rem; }
  .attachment-summary .muted, .detail-footnote { font-size: .75rem; }
  .receipt-row > .grow { min-width: calc(100% - 42px); }
  .upload h3 { font-size: .8125rem; }
  .upload h3 + p { font-size: .75rem; }
  .upload-label { min-height: 42px; }
  .form-footer { left: 0; }
}

/* Readable metadata and stable headers on compact screens. */
@media (max-width: 1000px) {
  .identity .user-name { display: none; }
}
@media (max-width: 720px) {
  .brand-subtitle { display: none; }
  .identity .avatar { display: grid; width: 28px; height: 28px; }
  .topbar-create { font-size: .75rem; }
  .page-subtitle, .quick-card p, .quick-primary p, .empty .muted,
  .field > span:first-child, .native-row-title, .native-error p,
  .auth-panel p, .notice, .upload h3 + p { font-size: .8125rem; }
  .side-link .nav-label { font-size: .75rem; }
  .metric-label, .metric-note { font-size: .75rem; }
  .metric-note { line-height: 1.6; }
  .quick-primary h2 { font-size: 1.125rem; }
  .quick-card h2 { font-size: .9375rem; }
  .footer-inner button, .receipt-actions button { font-size: .8125rem; }
  .mobile-back { min-height: 44px; font-size: .8125rem; }
  .native-filterbar .chip { min-height: 40px; }
  .range-shortcuts button { min-height: 40px; }
}
@media (max-width: 720px) {
  .native-page:has(.native-results.show-detail) > .page-heading,
  .native-page:has(.native-results.show-detail) > .native-toolbar,
  .native-page:has(.native-results.show-detail) > .native-filterbar,
  .native-page:has(.native-results.show-detail) > .results-caption { display: none; }
}
.metric-note, .template-card .muted + .muted, .empty .muted,
.native-row-bottom, .kind-label, .detail-grid dt, .loading-panel p,
.results-caption, .upload p, .receipt-row .muted, .candidate .muted,
.draft-row .small, .mobile-back { color: #64748b; }
.badge { color: #526177; }
.badge.good { color: #216e4d; }
.badge.review { color: #855b13; }
.badge.danger { color: #a43346; }
.badge.neutral { color: #5e6c80; }
.notice.warn { color: #7b5e22; }
@media (max-width: 720px) {
  .side-link { color: #64748b; }
  .side-link.active { color: #2b5cd0; }
  .side-link .count { min-width: 18px; height: 18px; font-size: .625rem; line-height: 16px; }
}


/* Controls remain readable without pushing their grid or flex container wider. */
.date-range, .detail-heading > div, .form-heading > div { min-width: 0; }
.date-range .field input[type="date"] { width: 100%; min-width: 0; max-width: 100%; height: 44px; min-height: 44px; padding: 9px 10px; font-size: .875rem; }
input[type="date"]::-webkit-datetime-edit { min-width: 0; padding: 0; }
input[type="date"]::-webkit-calendar-picker-indicator { flex-shrink: 0; margin-left: 4px; }
.detail-heading > div { flex: 1; }
.form-heading h1, .field-error, .expense-help, #toast { overflow-wrap: anywhere; }
.field { scroll-margin-top: calc(var(--header-height) + 20px); scroll-margin-bottom: 160px; }
@media (min-width: 721px) {
  .sidebar { overflow-y: auto; overscroll-behavior: contain; }
  .sidebar-top, .sidebar-bottom { flex-shrink: 0; }
}

/* Progress lives beside the action it describes, and always includes readable text. */
.operation-panel { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; min-width: 0; min-height: 180px; padding: 28px 24px; border: 1px solid #dfe8fa; border-radius: 12px; background: #f8faff; color: #395c98; text-align: center; overflow-wrap: anywhere; }
.operation-panel strong { color: #294d87; font-size: 1rem; }
.operation-panel p { max-width: 440px; color: #607593; font-size: .8125rem; line-height: 1.8; }
.operation-panel > .icon { width: 30px; height: 30px; color: var(--blue); }
.operation-inline { display: flex; align-items: center; gap: 12px; width: 100%; min-width: 0; max-width: 100%; margin: 0 0 20px; padding: 16px 18px; border: 1px solid #c9dafb; border-radius: 10px; background: #edf4ff; color: #31568c; font-size: .875rem; line-height: 1.65; overflow-wrap: anywhere; }
.form-shell > .operation-inline { max-width: 900px; margin-right: auto; margin-left: auto; }
.operation-inline > .icon { width: 22px; height: 22px; color: var(--blue); }
.operation-inline > div, .operation-inline > span:not(.icon):not(.spinner) { min-width: 0; }
.operation-inline strong { display: block; color: #294d87; }
.operation-inline p { margin-top: 3px; color: #607593; font-size: .8125rem; }
.spinner, .button-progress { display: inline-block; flex: 0 0 auto; width: 22px; height: 22px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; vertical-align: middle; animation: spin .85s linear infinite; }
.operation-panel > .spinner { width: 30px; height: 30px; border-width: 3px; color: var(--blue); }
.button-progress { width: 15px; height: 15px; }
button[aria-busy="true"] { cursor: progress; }

/* Personal input shortcuts never compete with the form's primary controls. */
.habit-panel { min-width: 0; margin: 20px 0; padding: 20px; border: 1px solid #dfe7f3; border-radius: 11px; background: #f8faff; }
.habit-panel .panel-heading { align-items: flex-start; flex-wrap: wrap; gap: 10px 16px; min-width: 0; min-height: 0; padding: 0; border-bottom: 0; }
.habit-panel .panel-heading > div { flex: 1 1 180px; min-width: 0; }
.habit-panel .panel-heading > button { flex: 0 0 auto; margin-left: auto; padding: 5px 0; white-space: nowrap; }
.habit-panel h2, .habit-panel h3 { margin: 0 0 8px; color: #3a5275; font-size: .9375rem; }
.habit-panel p { color: #60718c; font-size: .8125rem; line-height: 1.8; overflow-wrap: anywhere; }
.habit-notice { display: flex; align-items: flex-start; gap: 9px; min-width: 0; margin: 12px 0; padding: 12px 14px; border: 1px solid #dce8fc; border-radius: 9px; background: #f0f6ff; color: #4d6b98; font-size: .8125rem; line-height: 1.75; overflow-wrap: anywhere; }
.habit-notice .icon { width: 17px; height: 17px; margin-top: 3px; }
.habit-notice > div, .habit-notice > span:not(.icon) { min-width: 0; }
.habit-chips, .field-suggestions { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; min-width: 0; max-width: 100%; margin-top: 9px; }
.habit-chip, .field-suggestions button { display: inline-flex; min-width: 0; max-width: 100%; min-height: 34px; padding: 6px 10px; border: 1px solid #dbe5f5; border-radius: 7px; background: #fff; color: #47668f; font-size: .75rem; line-height: 1.6; text-align: left; white-space: normal; overflow-wrap: anywhere; }
.habit-chip:hover, .field-suggestions button:hover { border-color: #9fbae9; background: #edf4ff; }
.habit-chip > span, .field-suggestions button > span { min-width: 0; overflow-wrap: anywhere; }
.habit-chip[aria-pressed="true"] { border-color: #adc6f7; background: #eaf2ff; color: #2856a7; }
.habit-switches { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 12px 24px; margin: 15px 0; }
.habit-switches label { display: flex; align-items: flex-start; gap: 9px; min-width: 0; max-width: 100%; color: #435b7d; font-size: .8125rem; line-height: 1.7; overflow-wrap: anywhere; cursor: pointer; }
.habit-switches input[type="checkbox"] { flex: 0 0 auto; width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--blue); }
.habit-switches label > span { min-width: 0; }
.expense-help { display: block; margin-top: 7px; color: #64748b; font-size: .75rem; line-height: 1.75; }

/* Action results stay above navigation and footer controls, including on 320px screens. */
.action-result { position: fixed; bottom: max(24px, env(safe-area-inset-bottom)); left: calc(50% + var(--sidebar-width) / 2); z-index: 120; display: flex; align-items: flex-start; gap: 12px; width: max-content; min-width: 0; max-width: min(560px, calc(100% - var(--sidebar-width) - 48px)); padding: 16px 20px; border: 1px solid #b8decf; border-radius: 12px; background: #edf9f3; color: #225f46; box-shadow: 0 8px 32px #253d6724; font-size: .875rem; line-height: 1.7; text-align: left; white-space: normal; overflow-wrap: anywhere; transform: translateX(-50%); }
#toast.action-result { top: auto; right: auto; height: auto; min-height: 0; margin: 0; transform: translateX(-50%); }
.action-result.success, .action-result[data-kind="success"] { border-color: #a6d6c2; background: #edf9f3; color: #225f46; }
.action-result.error, .action-result[data-kind="error"] { border-color: #efb7c0; background: #fff1f3; color: #922f43; }
.action-result > .icon { width: 23px; height: 23px; margin-top: 1px; }
.action-result > div, .action-result > span:not(.icon) { min-width: 0; }
.action-result strong { display: block; }
.action-result p { margin-top: 3px; font-size: .8125rem; }
.action-result button { flex: 0 0 auto; min-width: 32px; min-height: 32px; padding: 4px; border-color: transparent; background: transparent; color: inherit; }
body:has(.form-footer) .action-result { bottom: 112px; }
@media (max-width: 720px) {
  .date-range .field input[type="date"], .native-filterbar input.search, input.search { min-height: 44px; font-size: 1rem; }
  .native-filterbar .filter-chips { flex-wrap: wrap; }
  .operation-panel { padding: 24px 18px; }
  .operation-inline { gap: 10px; padding: 14px; font-size: .8125rem; }
  .habit-panel { margin: 16px 0; padding: 16px; }
  .habit-notice { flex-wrap: wrap; }
  .habit-notice > button { flex: 0 0 auto; padding: 5px 0; white-space: nowrap; }
  .habit-switches { flex-direction: column; gap: 12px; }
  .habit-chip, .field-suggestions button { min-height: 40px; }
  .action-result { bottom: calc(85px + env(safe-area-inset-bottom)); left: 50%; max-width: calc(100% - 28px); padding: 14px 16px; }
  body:has(.form-footer) .action-result { bottom: calc(184px + env(safe-area-inset-bottom)); }
  .field { scroll-margin-bottom: 205px; }
}
@media (max-width: 480px) {
  .date-range { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  .spinner, .button-progress { animation: none; }
}
