:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #17221e;
  background: #f4fbf8;
  font-synthesis: none;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { min-height: 100%; }
body { margin: 0; min-height: 100vh; }
button, input, select, textarea { font: inherit; }
button, select, input, textarea { min-height: 46px; }

.shell {
  width: min(100%, 720px);
  margin: 0 auto;
  padding: max(24px, env(safe-area-inset-top)) 16px max(112px, calc(env(safe-area-inset-bottom) + 96px));
}

.site-filing {
  width: min(100%, 720px);
  margin: -84px auto 0;
  padding: 0 16px max(24px, env(safe-area-inset-bottom));
  color: #71807a;
  font-size: 12px;
  text-align: center;
}
.site-filing a { color: inherit; text-underline-offset: 3px; }
.site-filing a:focus-visible { outline: 3px solid rgba(39, 111, 88, .2); outline-offset: 3px; }

h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 4px; font-size: clamp(28px, 7vw, 40px); letter-spacing: -.04em; }
h2 { margin-bottom: 8px; font-size: 24px; letter-spacing: -.025em; }
.eyebrow { margin-bottom: 6px; color: #517167; font-size: 12px; font-weight: 800; letter-spacing: .12em; }
.muted { color: #687771; line-height: 1.55; }

.page-header, .section-heading, .focus-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.page-header { margin: 4px 2px 24px; }
.page-header > div { min-width: 0; }
.ledger-entry {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px;
  min-height: 44px;
  max-width: 100%;
  padding: 5px 0;
  border: 0;
  background: transparent;
  color: #17221e;
  text-align: left;
  cursor: pointer;
}
.ledger-entry strong {
  overflow: hidden;
  font-size: 15px;
  letter-spacing: -.01em;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ledger-context { color: #71807a; font-size: 12px; font-weight: 700; }
.ledger-entry > span:last-child { color: #517167; font-size: 20px; line-height: 1; transform: rotate(90deg); }
.ledger-entry:focus-visible { outline: 4px solid rgba(39, 111, 88, .18); outline-offset: 4px; border-radius: 6px; }
.screen-intro { margin: 0 4px 18px; }
.screen-intro p:last-child { margin-bottom: 0; }
.screen { animation: screen-in .18s ease-out; }
.focus-screen { padding-top: 4px; }
.focus-header { margin: 0 2px 22px; }

@keyframes screen-in {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

.card, .login-card {
  margin-bottom: 14px;
  padding: 20px;
  border: 1px solid #d9dfd8;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 10px 30px rgba(35, 57, 48, .05);
}
.login-card { margin-top: 15vh; }
.stack, .review-form { display: grid; gap: 15px; }

.action-card {
  position: relative;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 116px;
  margin-bottom: 12px;
  padding: 22px 20px;
  border: 1px solid #ced9d3;
  border-radius: 20px;
  background: #fff;
  color: #19332b;
  text-align: left;
  cursor: pointer;
  box-shadow: 0 8px 26px rgba(35, 57, 48, .045);
}
.action-card.simple-action {
  grid-template-columns: minmax(0, 1fr) auto;
  min-height: 92px;
}
.action-card.primary-action { border-color: #173f35; background: #173f35; color: #fff; }
.action-card:focus-visible { outline: 4px solid rgba(39, 111, 88, .2); outline-offset: 2px; }
.action-index {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: #e7eee9;
  color: #315b4d;
  font-size: 12px;
  font-weight: 900;
}
.primary-action .action-index { background: rgba(255,255,255,.14); color: #fff; }
.action-copy { display: grid; gap: 6px; }
.action-copy strong { font-size: 20px; letter-spacing: -.02em; }
.action-copy small { color: #6b7b75; line-height: 1.4; }
.primary-action .action-copy small { color: #cbd9d4; }
.action-arrow { font-size: 34px; font-weight: 300; opacity: .65; }
.demo-note { margin: -2px 4px 16px; color: #7a8782; font-size: 12px; line-height: 1.5; }

.entry-task-list {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
}
.entry-task-action {
  grid-template-columns: 38px minmax(0, 1fr) auto !important;
  height: 92px;
  min-height: 92px;
  margin: 0;
  border-color: #cfe9df;
  border-radius: 18px;
  box-shadow: 0 8px 24px rgba(8, 122, 91, .07);
}
.entry-task-action .action-index { background: #e2f7ef; color: #087a5b; }
.entry-task-action .action-arrow { color: #0a9270; opacity: 1; }
.entry-task-action .action-copy small {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.entry-recognition-note { margin-top: 10px; }

#app-view.entry-active .page-header {
  margin: calc(-1 * max(24px, env(safe-area-inset-top))) -16px 0;
  padding: max(24px, env(safe-area-inset-top)) 20px 12px;
  background: #0ea875;
}
#app-view.entry-active .ledger-entry {
  width: 100%;
  min-height: 52px;
  padding: 8px 14px;
  border: 1px solid rgba(255, 255, 255, .48);
  border-radius: 15px;
  color: #fff;
}
#app-view.entry-active .ledger-context,
#app-view.entry-active .ledger-entry > span:last-child { color: rgba(255, 255, 255, .82); }
#app-view.entry-active #entry-screen .screen-intro {
  margin: 0 -16px 24px;
  padding: 14px 20px 26px;
  border-radius: 0 0 28px 28px;
  background: #0ea875;
  color: #fff;
}
#app-view.entry-active #entry-screen .screen-intro h2 {
  margin-bottom: 6px;
  color: #fff;
  font-size: 32px;
}
#app-view.entry-active #entry-screen .screen-intro .muted { color: rgba(255, 255, 255, .86); }

.back-button {
  min-height: 44px;
  padding: 8px 2px;
  border: 0;
  background: transparent;
  color: #315b4d;
  font-weight: 800;
  cursor: pointer;
}
.badge { flex: none; padding: 7px 10px; border-radius: 999px; background: #dfeae5; color: #285444; font-size: 12px; font-weight: 800; }
.warning-badge { background: #fff1bf; color: #705b16; }

label { display: grid; gap: 7px; color: #42534d; font-size: 13px; font-weight: 750; }
input, select, textarea {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid #ccd6d0;
  border-radius: 12px;
  background: #fff;
  color: #17221e;
}
input:focus, select:focus, textarea:focus { outline: 3px solid rgba(39, 111, 88, .15); border-color: #276f58; }
textarea { resize: vertical; }

button:not(.action-card, .record-row, .back-button, .nav-button, .tag-button, .image-preview, .ledger-entry, .ledger-option, .dialog-close, .account-option, .supplier-picker),
.export-result a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 16px;
  border: 0;
  border-radius: 12px;
  background: #173f35;
  color: #fff;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}
button:disabled { opacity: .5; cursor: not-allowed; }
button.secondary { border: 1px solid #cbd7d1 !important; background: #fff !important; color: #244a3e !important; }
button.compact { min-height: 44px !important; padding: 9px 12px !important; font-size: 13px; }
.danger-button {
  border: 1px solid #e2b8b0 !important;
  background: #fff !important;
  color: #9b3f31 !important;
}

.image-preview {
  display: grid;
  width: 100%;
  margin-bottom: 14px;
  padding: 0;
  overflow: hidden;
  border: 1px solid #d8dfda;
  border-radius: 18px;
  background: #e7ebe7;
  color: #42534d;
  cursor: pointer;
}
.image-preview img { width: 100%; height: 172px; object-fit: cover; object-position: top; }
.image-preview span { padding: 10px 12px; background: #fff; font-size: 12px; font-weight: 800; }
.image-preview.expanded img { height: auto; max-height: 72vh; object-fit: contain; }

.review-form { padding: 20px; }
.review-alert {
  margin: 0 0 14px;
  padding: 12px 14px;
  border: 1px solid #ead394;
  border-radius: 14px;
  background: #fff4d5;
  color: #765e17;
  font-size: 13px;
  font-weight: 750;
  line-height: 1.5;
}
.amount-field { gap: 5px; }
.money-input {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 6px;
  border-bottom: 1px solid #cbd5cf;
}
.money-input > span { color: #274d41; font-size: 28px; font-weight: 800; }
.money-input input {
  min-height: 64px;
  padding: 4px 0;
  border: 0;
  border-radius: 0;
  font-size: 36px;
  font-weight: 850;
  letter-spacing: -.04em;
}
.money-input input:focus { outline: 0; }
.salary-fields {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid #d8e3dd;
  border-radius: 15px;
  background: #f3f7f5;
}
.salary-fields > header { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.salary-fields > header strong { color: #29483d; font-size: 14px; }
.salary-fields > header small { color: #6c7c76; font-size: 11px; }
.salary-field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.salary-field-grid > label, .salary-field-grid input { min-width: 0; }
.salary-equation { margin: 0; color: #587069; font-size: 12px; line-height: 1.5; }
.salary-equation.error { color: #9b3f31; font-weight: 750; }
.payment-nature-field {
  display: grid;
  gap: 9px;
  padding: 13px;
  border: 1px solid var(--surface-300, #d8e0dc);
  border-radius: 14px;
  background: var(--surface-50, #f8faf8);
}
.payment-nature-field > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--ink-700, #42534d);
  font-size: 13px;
  font-weight: 750;
}
.payment-nature-field > header small {
  padding: 4px 7px;
  border-radius: 999px;
  background: var(--accent-100, #e5eee9);
  color: #315b4d;
  font-size: 10px;
  font-weight: 850;
}
.payment-nature-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.payment-nature-options button {
  min-height: 46px;
  padding: 9px 10px;
  border: 1px solid var(--surface-300, #cbd6d0);
  border-radius: 12px;
  background: #fff;
  color: var(--ink-700, #335247);
  font: inherit;
  font-weight: 750;
  cursor: pointer;
}
.payment-nature-options button.selected {
  border-color: var(--brand-800, #173f35);
  background: var(--brand-800, #173f35);
  color: #fff;
}
.payment-nature-hint { color: var(--ink-500, #71807a); font-size: 11px; line-height: 1.45; }
.choice-disclosure {
  min-width: 0;
  overflow: hidden;
  border: 1px solid #d8e0dc;
  border-radius: 13px;
  background: #fff;
}
.choice-disclosure summary {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-height: 48px;
  padding: 11px 13px;
  color: #42534d;
  font-size: 13px;
  font-weight: 750;
  cursor: pointer;
}
.choice-disclosure summary strong {
  overflow: hidden;
  color: #1f3e34;
  font-size: 14px;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.choice-disclosure[open] summary { border-bottom: 1px solid #e5eae7; }
.classification-disclosure summary {
  grid-template-columns: auto minmax(0, 1fr) auto;
  min-height: 66px;
}
.classification-heading,
.classification-selection {
  display: grid;
  min-width: 0;
  gap: 3px;
}
.classification-heading small {
  width: fit-content;
  padding: 2px 6px;
  border-radius: 999px;
  background: #e5eee9;
  color: #315b4d;
  font-size: 9px;
  font-weight: 850;
}
.classification-selection strong {
  text-align: left;
}
.classification-selection small {
  overflow: hidden;
  color: #71807a;
  font-size: 11px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.classification-edit {
  color: #0b7968;
  font-size: 12px;
  font-weight: 850;
}
.classification-editor {
  display: grid;
  gap: 12px;
  padding: 12px;
}
.classification-editor > p {
  margin: 0;
  color: #71807a;
  font-size: 11px;
  font-weight: 750;
}
.tag-options { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.tag-button {
  min-height: 44px;
  padding: 8px 5px;
  border: 1px solid #cbd6d0;
  border-radius: 12px;
  background: #f8faf8;
  color: #335247;
  font-size: 13px;
  font-weight: 750;
  cursor: pointer;
}
.tag-button.selected { border-color: #173f35; background: #173f35; color: #fff; }
.candidate-field { display: grid; gap: 9px; }
.candidate-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: #42534d; font-size: 13px; font-weight: 750; }
.candidate-heading small { padding: 4px 7px; border-radius: 999px; background: #e5eee9; color: #315b4d; font-size: 10px; font-weight: 850; }
.candidate-value {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 13px 14px;
  border: 1px solid #b9cfc4;
  border-radius: 14px;
  background: #f3f8f5;
}
.candidate-value > span { display: grid; min-width: 0; gap: 4px; }
.candidate-value strong { overflow-wrap: anywhere; color: #193b30; font-size: 14px; line-height: 1.35; }
.candidate-value small { overflow-wrap: anywhere; color: #5e7069; font-size: 12px; line-height: 1.4; }
.candidate-hint { color: #71807a; font-size: 11px; font-weight: 600; line-height: 1.45; }
.field-hint { color: #8a6a19; font-weight: 600; }
.supplier-field { display: grid; gap: 7px; }
.supplier-field-label { color: #42534d; font-size: 13px; font-weight: 750; }
.supplier-picker {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 54px;
  padding: 11px 13px;
  border: 1px solid #cbd6d0;
  border-radius: 12px;
  background: #fff;
  color: #315b4d;
  text-align: left;
  cursor: pointer;
}
.supplier-picker > span:first-child { display: grid; min-width: 0; gap: 3px; }
.supplier-picker strong { overflow-wrap: anywhere; color: #1f342d; font-size: 15px; line-height: 1.4; font-weight: 760; }
.supplier-picker small { color: #586b64; font-size: 12px; line-height: 1.4; font-weight: 650; letter-spacing: .02em; }
.supplier-picker > span:last-child { font-size: 13px; font-weight: 800; white-space: nowrap; }
.more-fields { border-top: 1px solid #e7ebe8; padding-top: 4px; }
.more-fields summary { padding: 8px 0; color: #5f716a; font-size: 13px; font-weight: 800; cursor: pointer; }
.more-fields label { margin-top: 8px; }

.attachment-panel {
  overflow: hidden;
  border: 1px solid #dfe6e2;
  border-radius: 16px;
  background: #f8faf8;
}
.attachment-panel > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 52px;
  padding: 13px 15px;
  color: #42534d;
  font-size: 13px;
  font-weight: 850;
  cursor: pointer;
  list-style-position: inside;
}
.attachment-panel > summary small {
  margin-left: auto;
  color: #71807a;
  font-size: 11px;
  font-weight: 750;
}
.attachment-panel[open] { padding-bottom: 14px; }
.attachment-panel[open] > summary { border-bottom: 1px solid #e2e8e4; }
.attachment-list { display: grid; gap: 0; padding: 0 14px; }
.attachment-empty { margin: 14px 0; color: #71807a; font-size: 12px; text-align: center; }
.attachment-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 12px 0;
  border-bottom: 1px solid #e8edea;
}
.attachment-row:last-child { border-bottom: 0; }
.attachment-file { display: grid; min-width: 0; gap: 3px; }
.attachment-file strong {
  overflow: hidden;
  color: #263c34;
  font-size: 13px;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.attachment-file small { color: #71807a; font-size: 11px; line-height: 1.4; }
.attachment-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.attachment-link,
.attachment-delete {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 7px 9px;
  border: 1px solid #cbd7d1;
  border-radius: 9px;
  background: #fff;
  color: #245c4b;
  font-size: 11px;
  font-weight: 800;
  text-decoration: none;
}
.attachment-delete {
  border-color: #e2b8b0 !important;
  background: #fff !important;
  color: #9a4034 !important;
}
.attachment-panel > #add-attachment { width: calc(100% - 28px); margin: 12px 14px 0; }
.attachment-hint { margin: 9px 14px 0; color: #71807a; font-size: 11px; line-height: 1.5; }
.attachment-panel.locked > summary small { color: #8a5b11; }
.attachment-panel.locked .attachment-hint { color: #8a5b11; }

.record-more-actions { border-top: 1px solid #e7ebe8; }
.record-more-actions summary {
  min-height: 44px;
  padding: 12px 0;
  color: #71807a;
  font-size: 13px;
  font-weight: 750;
  cursor: pointer;
}
.record-more-actions .danger-button { width: 100%; margin-top: 4px; }
.review-actions {
  position: sticky;
  z-index: 4;
  bottom: max(8px, env(safe-area-inset-bottom));
  margin: 2px -8px -8px;
  padding: 8px;
  border: 1px solid rgba(215, 224, 219, .9);
  border-radius: 15px;
  background: rgba(255,255,255,.94);
  box-shadow: 0 10px 26px rgba(25, 49, 41, .12);
  backdrop-filter: blur(14px);
}
.review-actions button { width: 100%; min-height: 48px; }

.voucher-preview {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid #dfe6e2;
  border-radius: 16px;
  background: #f8faf8;
}
.voucher-preview-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.voucher-preview-header > span { color: #42534d; font-size: 13px; font-weight: 850; }
.voucher-preview-header > strong { padding: 4px 8px; border-radius: 999px; background: #e9eeeb; color: #63736d; font-size: 11px; }
.voucher-preview.loading .voucher-preview-header > strong { background: #fff0c6; color: #755d18; }
.voucher-preview.ready { border-color: #a9c7b9; background: #f2f8f5; }
.voucher-preview.ready .voucher-preview-header > strong { background: #dcece4; color: #285444; }
.voucher-preview.error { border-color: #e1b5ac; background: #fff7f5; }
.voucher-preview.error .voucher-preview-header > strong { background: #f5ddd8; color: #8a3e32; }
.voucher-preview-message { margin: 0; color: #74817c; font-size: 12px; line-height: 1.5; }
.voucher-preview.error .voucher-preview-message { color: #8a3e32; font-weight: 700; }
.voucher-preview-content { display: grid; gap: 10px; }
.voucher-summary-row { display: grid; grid-template-columns: 38px 1fr; gap: 8px; padding-bottom: 11px; border-bottom: 1px solid #dfe7e2; }
.voucher-summary-row span { color: #75837e; font-size: 12px; }
.voucher-summary-row input {
  min-width: 0;
  min-height: 38px;
  padding: 7px 9px;
  border: 1px solid #cbd8d1;
  border-radius: 10px;
  background: #fff;
  color: #263c34;
  font-size: 13px;
  line-height: 1.5;
}
.voucher-summary-row input:focus { border-color: #276f58; outline: 2px solid #d8ebe3; }
.voucher-line { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; align-items: center; gap: 10px; }
.voucher-lines { display: grid; gap: 10px; }
.voucher-direction { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; color: #fff; font-size: 13px; font-weight: 900; }
.voucher-direction.debit { background: #276f58; }
.voucher-direction.credit { background: #a06b2b; }
.voucher-account { display: grid; min-width: 0; gap: 3px; }
.voucher-account strong { overflow-wrap: anywhere; color: #263c34; font-size: 13px; line-height: 1.4; }
.voucher-account small { color: #6e7e78; font-size: 11px; line-height: 1.4; }
.voucher-amount { color: #20372f; font-size: 14px; white-space: nowrap; }
.voucher-balanced { margin: 2px 0 0; padding-top: 10px; border-top: 1px solid #dfe7e2; color: #286047; font-size: 12px; font-weight: 850; }

.record-list { gap: 0; padding-top: 6px; padding-bottom: 6px; }
.record-row {
  display: grid;
  justify-items: start;
  width: 100%;
  min-height: 0;
  padding: 15px 0;
  border: 0;
  border-bottom: 1px solid #edf0ed;
  background: transparent;
  color: #1f342d;
  text-align: left;
  cursor: pointer;
}
.record-row:last-child { border-bottom: 0; }
.record-row small { margin-top: 4px; color: #75837e; font-weight: 500; }
.record-date-group { display: grid; }
.record-date-group + .record-date-group { border-top: 1px solid #dfe7e2; }
.record-date-heading {
  margin: 0;
  padding: 14px 2px 5px;
  color: #4f665e;
  font-size: 12px;
  font-weight: 850;
}
.empty { margin: 18px 0; text-align: center; }
.record-filters {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: 10px;
}
.records-count { margin: 18px 4px 8px; color: #60716a; font-size: 13px; font-weight: 800; }
.month-export-card { display: grid; gap: 18px; }
.period-picker input { font-size: 17px; font-weight: 800; }
.month-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  overflow: hidden;
  border: 1px solid #e1e7e2;
  border-radius: 14px;
  background: #f7f9f7;
}
.month-stats div {
  display: grid;
  gap: 3px;
  padding: 13px 8px;
  border-right: 1px solid #e1e7e2;
  text-align: center;
}
.month-stats div:last-child { border-right: 0; }
.month-stats strong { color: #193b30; font-size: 22px; letter-spacing: -.03em; }
.month-stats span { color: #71807a; font-size: 11px; font-weight: 700; }
.period-status {
  margin: -2px 0 0;
  padding: 11px 12px;
  border-radius: 12px;
  background: #edf4f0;
  color: #315b4d;
  font-size: 13px;
  line-height: 1.5;
}
.period-status.warning { background: #fff4d5; color: #765e17; }
.full-width { width: 100%; }
.voucher-range { margin: -4px 0 0; color: #5f716a; font-size: 13px; font-weight: 750; }
.history-heading { margin-top: 30px; }
.export-result { display: grid; gap: 7px; margin-top: 14px; }
.export-result small { color: #65756f; overflow-wrap: anywhere; }
.export-history {
  display: grid;
  gap: 12px;
  padding-top: 18px;
  border-top: 1px solid #e2e8e4;
}
.export-history-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  min-height: 48px;
  cursor: pointer;
}
.export-history-header h3 { margin: 0 0 4px; font-size: 17px; }
.export-history-header p { margin: 0; font-size: 12px; }
.batch-count {
  flex: 0 0 auto;
  padding: 5px 9px;
  border-radius: 999px;
  background: #edf4f0;
  color: #315b4d;
  font-size: 12px;
  font-weight: 800;
}
.export-history-list { display: grid; gap: 10px; margin-top: 12px; }
.export-batch {
  display: grid;
  gap: 11px;
  padding: 14px;
  border: 1px solid #dfe7e2;
  border-radius: 14px;
  background: #f8faf8;
}
.export-batch-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.export-batch-heading strong { color: #1e3d33; font-size: 15px; }
.export-batch-heading time { color: #71807a; font-size: 11px; white-space: nowrap; }
.export-batch-details { display: grid; gap: 3px; color: #5f716a; font-size: 12px; }
.export-download-link {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border: 1px solid #2f6957;
  border-radius: 11px;
  color: #245c4b;
  font-size: 13px;
  font-weight: 850;
  text-decoration: none;
}

.bottom-nav {
  position: fixed;
  z-index: 8;
  left: 50%;
  bottom: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  width: min(100%, 720px);
  padding: 8px 8px max(8px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  border: 0;
  border-top: 1px solid #dcece6;
  border-radius: 18px 18px 0 0;
  background: rgba(255,255,255,.98);
  box-shadow: 0 -8px 28px rgba(8, 95, 72, .08);
  backdrop-filter: blur(12px);
}
.nav-button {
  position: relative;
  display: grid;
  place-items: center;
  gap: 3px;
  min-height: 58px;
  padding: 6px 4px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: #697972;
  font-size: 11px;
  font-weight: 750;
  cursor: pointer;
}
.nav-button.active { background: transparent; color: #0a9270; }
.nav-icon { display: grid; place-items: center; width: 24px; height: 24px; }
.nav-icon svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.nav-label { line-height: 1.2; }
.nav-count {
  position: absolute;
  top: 2px;
  right: calc(50% - 27px);
  min-width: 18px;
  padding: 2px 5px;
  border-radius: 999px;
  background: #087a5b;
  color: #fff;
  font-size: 10px;
}

.toast {
  position: fixed;
  z-index: 20;
  left: 50%;
  bottom: max(86px, calc(env(safe-area-inset-bottom) + 76px));
  width: max-content;
  max-width: calc(100vw - 32px);
  transform: translateX(-50%);
  padding: 12px 16px;
  border-radius: 12px;
  background: #17221e;
  color: #fff;
  box-shadow: 0 12px 30px rgba(0, 0, 0, .2);
}

.ledger-dialog {
  width: min(calc(100% - 24px), 520px);
  max-height: min(82vh, 620px);
  margin: auto auto max(10px, env(safe-area-inset-bottom));
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 24px;
  background: transparent;
  color: #17221e;
}
.ledger-dialog::backdrop { background: rgba(16, 28, 24, .48); backdrop-filter: blur(3px); }
.ledger-sheet { padding: 20px; background: #f8faf8; box-shadow: 0 24px 70px rgba(14, 31, 24, .24); }
.ledger-sheet-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.ledger-sheet-header h2 { margin-bottom: 0; }
.dialog-close {
  min-height: 44px;
  padding: 9px 7px;
  border: 0;
  background: transparent;
  color: #49665c;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}
.ledger-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  width: 100%;
  min-height: 76px;
  margin-top: 10px;
  padding: 15px 16px;
  border: 1px solid #d8dfda;
  border-radius: 16px;
  background: #fff;
  color: #20372f;
  text-align: left;
  cursor: pointer;
}
.ledger-option > span:first-child { display: grid; min-width: 0; gap: 5px; }
.ledger-option strong { font-size: 16px; }
.ledger-option small { color: #71807a; line-height: 1.35; }
.ledger-option.selected { border-color: #7da795; background: #edf5f1; }
.ledger-status { flex: none; padding: 5px 8px; border-radius: 999px; background: #dcebe4; color: #285444; font-size: 11px; font-weight: 850; }
.ledger-plus { flex: none; color: #527268; font-size: 24px; }
.ledger-option.future { border-style: dashed; }
.ledger-note { margin: 15px 2px 0; color: #75837e; font-size: 12px; line-height: 1.5; }
.ledger-security {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid #dfe6e2;
}
.account-dialog { max-height: min(88vh, 760px); }
.account-sheet { display: flex; max-height: min(88vh, 760px); flex-direction: column; }
.account-search-label { flex: none; }
.account-result-count { flex: none; margin: 12px 2px 8px; color: #6d7c76; font-size: 11px; font-weight: 750; }
.account-results { display: grid; gap: 8px; overflow-y: auto; overscroll-behavior: contain; }
.account-option {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 64px;
  padding: 11px 12px;
  border: 1px solid #d8dfda;
  border-radius: 13px;
  background: #fff;
  color: #20372f;
  text-align: left;
  cursor: pointer;
}
.account-option > span:first-child { display: grid; min-width: 0; gap: 3px; }
.account-option strong { font-size: 13px; }
.account-option small { overflow-wrap: anywhere; color: #677872; font-size: 11px; line-height: 1.35; }
.account-option.selected { border-color: #5b927d; background: #edf5f1; }
.account-selected-mark { color: #276f58; font-size: 11px; font-weight: 850; }
.account-results-empty { margin: 22px 4px; color: #71807a; font-size: 13px; text-align: center; }
.confirm-dialog {
  width: min(calc(100% - 32px), 460px);
  margin: auto;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 22px;
  background: transparent;
  color: #17221e;
}
.confirm-dialog::backdrop { background: rgba(16, 28, 24, .5); backdrop-filter: blur(3px); }
.confirm-sheet { padding: 22px; background: #fff; box-shadow: 0 24px 70px rgba(14, 31, 24, .24); }
.danger-text { color: #a54839; }
.delete-record-summary {
  margin: 14px 0;
  padding: 12px 14px;
  border-radius: 13px;
  background: #f4f6f4;
  color: #334840;
  font-weight: 750;
  line-height: 1.45;
}
.confirm-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 20px; }
.danger-confirm { background: #a54233 !important; }
@media (max-width: 480px) {
  .shell { padding-left: 14px; padding-right: 14px; }
  .page-header { margin-bottom: 24px; }
  #app-view.entry-active .page-header {
    margin-right: -14px;
    margin-left: -14px;
    padding-right: 16px;
    padding-left: 16px;
  }
  #app-view.entry-active #entry-screen .screen-intro {
    margin-right: -14px;
    margin-left: -14px;
    padding-right: 16px;
    padding-left: 16px;
  }
  .action-card { min-height: 108px; padding: 18px 16px; }
  .action-card.simple-action { min-height: 88px; }
  .action-copy strong { font-size: 18px; }
  .action-copy small { font-size: 12px; }
  .tag-options { grid-template-columns: repeat(3, 1fr); }
  .month-stats { grid-template-columns: repeat(2, 1fr); }
  .month-stats div:nth-child(2) { border-right: 0; }
  .month-stats div:nth-child(-n+2) { border-bottom: 1px solid #e1e7e2; }
  .card, .login-card { padding: 17px; border-radius: 18px; }
  .review-form { padding: 18px; }
  .ledger-sheet { padding: 18px; }
  .candidate-value { grid-template-columns: 1fr; }
  .candidate-value button { width: 100%; }
  .record-filters { grid-template-columns: 1fr; }
}

/* Finance Pro visual system — v41 */
:root {
  --ink-950: #071426;
  --ink-900: #0d1b2e;
  --ink-800: #17283f;
  --ink-700: #30445f;
  --ink-600: #4e627c;
  --ink-500: #6d7f95;
  --ink-400: #94a3b5;
  --surface-0: #ffffff;
  --surface-50: #f8fafc;
  --surface-100: #f2f5f9;
  --surface-200: #e8edf3;
  --surface-300: #d7e0ea;
  --brand-900: #0b1f3a;
  --brand-800: #102b4e;
  --brand-700: #173b67;
  --accent-500: #159a82;
  --accent-400: #24b49a;
  --accent-100: #dff5ef;
  --gold-500: #b9873d;
  --danger-500: #bc4a48;
  --warning-500: #b7791f;
  --brand-gradient: linear-gradient(135deg, #0b1f3a 0%, #102e51 58%, #124b65 100%);
  --focus-ring: 0 0 0 4px rgba(21, 154, 130, .16);
  --shadow-sm: 0 1px 2px rgba(7, 20, 38, .04), 0 5px 16px rgba(7, 20, 38, .045);
  --shadow-md: 0 14px 38px rgba(7, 20, 38, .09);
  --shadow-lg: 0 28px 70px rgba(7, 20, 38, .18);
  color: var(--ink-900);
  background: var(--surface-100);
  font-family: Inter, "SF Pro Display", "SF Pro Text", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

html { background: var(--surface-100); }
body {
  position: relative;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 12% -8%, rgba(21, 154, 130, .10), transparent 31rem),
    radial-gradient(circle at 96% 4%, rgba(16, 43, 78, .10), transparent 28rem),
    var(--surface-100);
  color: var(--ink-900);
  -webkit-font-smoothing: antialiased;
}
body::before {
  position: fixed;
  z-index: -1;
  inset: 0;
  background-image:
    linear-gradient(rgba(11, 31, 58, .022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(11, 31, 58, .022) 1px, transparent 1px);
  background-size: 28px 28px;
  content: "";
  pointer-events: none;
  mask-image: linear-gradient(to bottom, #000, transparent 72%);
}

::selection { background: rgba(21, 154, 130, .22); color: var(--ink-950); }
button, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button { transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease, background-color .16s ease, color .16s ease; }
button:active:not(:disabled) { transform: translateY(1px); }

.shell {
  width: min(100%, 780px);
  padding-top: max(28px, env(safe-area-inset-top));
}
h1, h2 { color: var(--ink-950); }
h1 { font-weight: 760; letter-spacing: -.045em; }
h2 { font-weight: 760; letter-spacing: -.035em; }
.muted { color: var(--ink-500); }
.eyebrow {
  color: var(--accent-500);
  font-size: 11px;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.page-header { margin-bottom: 26px; }
.ledger-entry { color: var(--ink-900); }
.ledger-entry strong { font-weight: 760; }
.ledger-context { color: var(--ink-500); letter-spacing: .03em; }
.ledger-entry > span:last-child { color: var(--accent-500); }
.ledger-entry:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.screen-intro { margin-bottom: 22px; }
.screen-intro h2 { margin-bottom: 7px; font-size: clamp(25px, 5.8vw, 32px); }
.screen { animation-duration: .24s; }

.card, .login-card {
  border-color: rgba(148, 163, 181, .34);
  border-radius: 18px;
  background: rgba(255, 255, 255, .94);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(16px);
}
.login-card {
  position: relative;
  overflow: hidden;
  margin-top: 12vh;
  padding-top: 28px;
}
.login-card::before {
  display: block;
  width: 42px;
  height: 5px;
  margin-bottom: 22px;
  border-radius: 999px;
  background: var(--accent-500);
  content: "";
}

.action-card {
  min-height: 108px;
  border-color: var(--surface-300);
  border-radius: 17px;
  background: rgba(255, 255, 255, .96);
  color: var(--ink-900);
  box-shadow: var(--shadow-sm);
}
.action-card:hover { border-color: #afbdcc; box-shadow: var(--shadow-md); transform: translateY(-1px); }
.action-card:focus-visible { outline: none; border-color: var(--accent-500); box-shadow: var(--focus-ring), var(--shadow-sm); }
.action-card.primary-action {
  border-color: transparent;
  background: var(--brand-gradient);
  color: #fff;
  box-shadow: 0 14px 30px rgba(11, 31, 58, .18);
}
.action-index {
  border: 1px solid var(--surface-300);
  border-radius: 10px;
  background: var(--surface-100);
  color: var(--brand-700);
  font-variant-numeric: tabular-nums;
}
.primary-action .action-index { border-color: rgba(255, 255, 255, .15); background: rgba(255, 255, 255, .10); }
.action-copy strong { color: inherit; font-weight: 740; }
.action-copy small { color: var(--ink-500); }
.primary-action .action-copy small { color: rgba(255, 255, 255, .70); }
.action-arrow { color: var(--ink-400); font-size: 27px; }

.entry-task-list { gap: 11px; }
.entry-task-action {
  position: relative;
  overflow: hidden;
  border-color: rgba(148, 163, 181, .32);
  border-radius: 16px;
  box-shadow: var(--shadow-sm);
}
.entry-task-action::after {
  position: absolute;
  top: 18px;
  bottom: 18px;
  left: 0;
  width: 3px;
  border-radius: 0 999px 999px 0;
  background: var(--accent-500);
  content: "";
  opacity: 0;
  transition: opacity .16s ease;
}
.entry-task-action:hover::after, .entry-task-action:focus-visible::after { opacity: 1; }
.entry-task-action .action-index { border-color: #c7e9e1; background: var(--accent-100); color: #08725f; }
.entry-task-action .action-arrow { color: var(--accent-500); }
.entry-recognition-note { color: var(--ink-500); }

#app-view.entry-active .page-header {
  margin-top: calc(-1 * max(28px, env(safe-area-inset-top)));
  padding-top: max(24px, env(safe-area-inset-top));
  background: var(--brand-gradient);
}
#app-view.entry-active .ledger-entry {
  border-color: rgba(255, 255, 255, .18);
  background: rgba(255, 255, 255, .07);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08);
}
#app-view.entry-active .ledger-context,
#app-view.entry-active .ledger-entry > span:last-child { color: rgba(255, 255, 255, .68); }
#app-view.entry-active #entry-screen .screen-intro {
  position: relative;
  overflow: hidden;
  padding-bottom: 30px;
  border-radius: 0 0 24px 24px;
  background: var(--brand-gradient);
}
#app-view.entry-active #entry-screen .screen-intro::after {
  position: absolute;
  right: -42px;
  bottom: -62px;
  width: 170px;
  height: 170px;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 50%;
  box-shadow: 0 0 0 28px rgba(255, 255, 255, .025), 0 0 0 58px rgba(255, 255, 255, .018);
  content: "";
}
#app-view.entry-active #entry-screen .screen-intro h2 { font-weight: 720; letter-spacing: -.04em; }
#app-view.entry-active #entry-screen .screen-intro .muted { color: rgba(255, 255, 255, .68); }

.back-button { color: var(--brand-700); }
.back-button:hover { color: var(--accent-500); }
.badge { background: var(--accent-100); color: #08725f; }
.warning-badge { background: #fff4d8; color: #8a5b11; }

label, .supplier-field-label, .candidate-heading { color: var(--ink-700); }
input, select, textarea {
  border-color: var(--surface-300);
  border-radius: 10px;
  background: var(--surface-0);
  color: var(--ink-900);
  box-shadow: inset 0 1px 2px rgba(7, 20, 38, .025);
}
input::placeholder, textarea::placeholder { color: var(--ink-400); }
input:hover, select:hover, textarea:hover { border-color: #b7c3d0; }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent-500);
  box-shadow: var(--focus-ring);
}
button:not(.action-card, .record-row, .back-button, .nav-button, .tag-button, .image-preview, .ledger-entry, .ledger-option, .dialog-close, .account-option, .supplier-picker),
.export-result a {
  border-radius: 10px;
  background: var(--brand-900);
  box-shadow: 0 7px 16px rgba(11, 31, 58, .14);
}
button:not(.action-card, .record-row, .back-button, .nav-button, .tag-button, .image-preview, .ledger-entry, .ledger-option, .dialog-close, .account-option, .supplier-picker):hover,
.export-result a:hover { background: var(--brand-800); box-shadow: 0 9px 20px rgba(11, 31, 58, .18); }
button.secondary { border-color: var(--surface-300) !important; color: var(--brand-700) !important; box-shadow: none !important; }
button.secondary:hover { border-color: #b5c1ce !important; background: var(--surface-50) !important; }
.danger-button { border-color: #ecc8c7 !important; color: var(--danger-500) !important; }

.image-preview { border-color: var(--surface-300); border-radius: 16px; background: var(--surface-200); color: var(--ink-600); }
.review-alert { border-color: #e9d19f; border-radius: 12px; background: #fff8e8; color: #855b16; }
.money-input { border-color: var(--surface-300); }
.money-input > span { color: var(--accent-500); }
.money-input input { color: var(--ink-950); font-variant-numeric: tabular-nums; }
.salary-fields { border-color: var(--surface-300); background: var(--surface-50); }
.salary-fields > header strong { color: var(--ink-800); }
.salary-fields > header small, .salary-equation { color: var(--ink-500); }
.choice-disclosure { border-color: var(--surface-300); }
.choice-disclosure summary { color: var(--ink-700); }
.choice-disclosure summary strong { color: var(--ink-900); }
.choice-disclosure[open] summary { border-color: var(--surface-200); background: var(--surface-50); }
.tag-button { border-color: var(--surface-300); background: var(--surface-50); color: var(--ink-700); }
.tag-button:hover { border-color: #b1c0ce; background: #fff; }
.tag-button.selected { border-color: var(--brand-800); background: var(--brand-800); }

.candidate-heading small { background: var(--accent-100); color: #08725f; }
.candidate-value { border-color: #bedbd4; background: #f3fbf8; }
.candidate-value strong { color: var(--ink-900); }
.candidate-value small, .candidate-hint { color: var(--ink-500); }
.supplier-picker {
  border-color: var(--surface-300);
  border-radius: 10px;
  background: var(--surface-0);
  color: var(--accent-500);
  box-shadow: 0 4px 14px rgba(11, 31, 58, .07);
}
.supplier-picker:hover { border-color: var(--accent-500); }
.supplier-picker strong { color: var(--ink-900); }
.supplier-picker small { color: var(--ink-600); }
.more-fields, .record-more-actions { border-color: var(--surface-200); }
.more-fields summary, .record-more-actions summary { color: var(--ink-500); }

.review-actions {
  border-color: rgba(215, 224, 234, .9);
  border-radius: 13px;
  background: rgba(255, 255, 255, .9);
  box-shadow: 0 14px 34px rgba(7, 20, 38, .14);
}
.voucher-preview { border-color: var(--surface-300); border-radius: 14px; background: var(--surface-50); }
.voucher-preview-header > span { color: var(--ink-700); }
.voucher-preview-header > strong { background: var(--surface-200); color: var(--ink-500); }
.voucher-preview.ready { border-color: #9fd1c5; background: #f0faf7; }
.voucher-preview.ready .voucher-preview-header > strong { background: var(--accent-100); color: #08725f; }
.voucher-preview-message, .voucher-summary-row span { color: var(--ink-500); }
.voucher-summary-row, .voucher-balanced { border-color: var(--surface-300); }
.voucher-direction { border-radius: 8px; }
.voucher-direction.debit { background: var(--accent-500); }
.voucher-direction.credit { background: var(--gold-500); }
.voucher-account strong, .voucher-amount { color: var(--ink-800); }
.voucher-account small { color: var(--ink-500); }
.voucher-balanced { color: #08725f; }

.record-list { overflow: hidden; }
.record-row { padding: 17px 2px; border-color: var(--surface-200); color: var(--ink-900); }
.record-row:hover { padding-right: 8px; padding-left: 8px; background: var(--surface-50); }
.record-row small { color: var(--ink-500); }
.record-date-group + .record-date-group { border-color: var(--surface-300); }
.record-date-heading { color: var(--ink-600); }
.records-count { color: var(--ink-600); }
.month-stats { border-color: var(--surface-300); background: var(--surface-50); }
.month-stats div { border-color: var(--surface-300); }
.month-stats strong { color: var(--brand-800); font-variant-numeric: tabular-nums; }
.month-stats span { color: var(--ink-500); }
.period-status, .batch-count { background: var(--accent-100); color: #08725f; }
.period-status.warning { background: #fff5df; color: #8a5b11; }
.voucher-range, .export-result small, .export-batch-details { color: var(--ink-500); }
.export-history { border-color: var(--surface-200); }
.export-batch { border-color: var(--surface-300); background: var(--surface-50); }
.export-batch-heading strong { color: var(--ink-800); }
.export-batch-heading time { color: var(--ink-500); }
.export-download-link { border-color: var(--accent-500); color: #08725f; }
.export-download-link:hover { background: var(--accent-100); }

.bottom-nav {
  width: min(100%, 780px);
  border-top-color: rgba(215, 224, 234, .92);
  border-radius: 16px 16px 0 0;
  background: rgba(255, 255, 255, .94);
  box-shadow: 0 -12px 32px rgba(7, 20, 38, .09);
  backdrop-filter: blur(20px) saturate(160%);
}
.nav-button { color: var(--ink-500); }
.nav-button:hover { background: var(--surface-100); color: var(--brand-700); }
.nav-button.active { background: #edf8f5; color: var(--accent-500); }
.nav-button.active::after {
  position: absolute;
  bottom: 3px;
  width: 18px;
  height: 2px;
  border-radius: 999px;
  background: var(--accent-500);
  content: "";
}
.nav-count { background: var(--danger-500); box-shadow: 0 0 0 2px #fff; }
.toast { border: 1px solid rgba(255, 255, 255, .10); background: var(--ink-950); box-shadow: var(--shadow-lg); }

.ledger-dialog, .confirm-dialog { color: var(--ink-900); }
.ledger-dialog::backdrop, .confirm-dialog::backdrop { background: rgba(7, 20, 38, .60); backdrop-filter: blur(5px); }
.ledger-sheet, .confirm-sheet { background: var(--surface-50); box-shadow: var(--shadow-lg); }
.dialog-close { color: var(--ink-600); }
.ledger-option, .account-option { border-color: var(--surface-300); border-radius: 14px; color: var(--ink-900); box-shadow: 0 1px 2px rgba(7, 20, 38, .025); }
.ledger-option:hover, .account-option:hover { border-color: #b4c2cf; background: var(--surface-50); }
.ledger-option small, .account-option small, .ledger-note, .account-result-count { color: var(--ink-500); }
.ledger-option.selected, .account-option.selected { border-color: #98cbbf; background: #eff9f6; }
.ledger-status { background: var(--accent-100); color: #08725f; }
.ledger-plus, .account-selected-mark { color: var(--accent-500); }
.ledger-security { border-color: var(--surface-300); }
.delete-record-summary { background: var(--surface-100); color: var(--ink-700); }
.danger-confirm { background: var(--danger-500) !important; }

@media (min-width: 720px) {
  .shell { padding-right: 24px; padding-left: 24px; }
  #app-view.entry-active .page-header {
    margin-right: -24px;
    margin-left: -24px;
    padding-right: 28px;
    padding-left: 28px;
    border-radius: 0 0 0 0;
  }
  #app-view.entry-active #entry-screen .screen-intro {
    margin-right: -24px;
    margin-left: -24px;
    padding-right: 28px;
    padding-left: 28px;
  }
  .entry-task-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .entry-task-action { height: 104px; }
  .entry-task-action:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .record-filters { grid-template-columns: 1.25fr 1fr 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* Shared top treatment and compact ledger selector — v42 */
#app-view.entry-active .ledger-entry {
  width: fit-content;
  max-width: 100%;
  padding-right: 12px;
  padding-left: 12px;
}

#app-view:not(.entry-active) .page-header {
  margin: calc(-1 * max(28px, env(safe-area-inset-top))) -16px 0;
  padding: max(24px, env(safe-area-inset-top)) 20px 12px;
  background: var(--brand-gradient);
}
#app-view:not(.entry-active) .ledger-entry {
  width: fit-content;
  max-width: 100%;
  min-height: 52px;
  padding: 8px 12px;
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 15px;
  background: rgba(255, 255, 255, .07);
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08);
}
#app-view:not(.entry-active) .ledger-context,
#app-view:not(.entry-active) .ledger-entry > span:last-child { color: rgba(255, 255, 255, .68); }

#pending-screen > .screen-intro,
#records-screen > .screen-intro,
#month-screen > .screen-intro {
  position: relative;
  overflow: hidden;
  margin: 0 -16px 24px;
  padding: 14px 20px 30px;
  border-radius: 0 0 24px 24px;
  background: var(--brand-gradient);
  color: #fff;
}
#pending-screen > .screen-intro::after,
#records-screen > .screen-intro::after,
#month-screen > .screen-intro::after {
  position: absolute;
  right: -42px;
  bottom: -62px;
  width: 170px;
  height: 170px;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 50%;
  box-shadow: 0 0 0 28px rgba(255, 255, 255, .025), 0 0 0 58px rgba(255, 255, 255, .018);
  content: "";
}
#pending-screen > .screen-intro h2,
#records-screen > .screen-intro h2,
#month-screen > .screen-intro h2 { color: #fff; }
#pending-screen > .screen-intro .muted,
#records-screen > .screen-intro .muted,
#month-screen > .screen-intro .muted { color: rgba(255, 255, 255, .68); }

@media (max-width: 480px) {
  #app-view:not(.entry-active) .page-header {
    margin-right: -14px;
    margin-left: -14px;
    padding-right: 16px;
    padding-left: 16px;
  }
  #pending-screen > .screen-intro,
  #records-screen > .screen-intro,
  #month-screen > .screen-intro {
    margin-right: -14px;
    margin-left: -14px;
    padding-right: 16px;
    padding-left: 16px;
  }
}

/* Playful finance meme — v46 */
#app-view { position: relative; }
.finance-meme-carousel {
  position: absolute;
  z-index: 3;
  top: 86px;
  right: 12px;
  width: clamp(96px, 18vw, 124px);
  aspect-ratio: 146 / 209;
  margin: 0;
  pointer-events: none;
  isolation: isolate;
}
.finance-meme-carousel::before {
  position: absolute;
  z-index: -1;
  inset: 18% 12% 10%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(36, 180, 154, .16), rgba(36, 180, 154, 0) 70%);
  content: "";
  filter: blur(8px);
}
.finance-meme-animation {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 12px 12px rgba(2, 12, 27, .24));
  will-change: contents;
}

#app-view.entry-active #entry-screen > .screen-intro,
#app-view:not(.entry-active) #pending-screen > .screen-intro,
#app-view:not(.entry-active) #records-screen > .screen-intro,
#app-view:not(.entry-active) #month-screen > .screen-intro {
  min-height: 166px;
  padding-right: clamp(116px, 24vw, 150px);
}

@media (max-width: 420px) {
  .finance-meme-carousel {
    top: 92px;
    right: 4px;
    width: 92px;
  }
  #app-view.entry-active #entry-screen > .screen-intro,
  #app-view:not(.entry-active) #pending-screen > .screen-intro,
  #app-view:not(.entry-active) #records-screen > .screen-intro,
  #app-view:not(.entry-active) #month-screen > .screen-intro {
    min-height: 146px;
    padding-right: 104px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .finance-meme-carousel { display: none; }
  #app-view.entry-active #entry-screen > .screen-intro,
  #app-view:not(.entry-active) #pending-screen > .screen-intro,
  #app-view:not(.entry-active) #records-screen > .screen-intro,
  #app-view:not(.entry-active) #month-screen > .screen-intro {
    min-height: 0;
    padding-right: 0;
  }
}

@media (min-width: 720px) {
  #app-view:not(.entry-active) .page-header {
    margin-right: -24px;
    margin-left: -24px;
    padding-right: 28px;
    padding-left: 28px;
  }
  #pending-screen > .screen-intro,
  #records-screen > .screen-intro,
  #month-screen > .screen-intro {
    margin-right: -24px;
    margin-left: -24px;
    padding-right: 28px;
    padding-left: 28px;
  }
}
