.finance-metrics { max-width: 1440px; color: #172d49; min-width: 0; }
.finance-metrics *, .finance-metrics *::before, .finance-metrics *::after { box-sizing: border-box; }
.finance-header { display: flex; justify-content: space-between; align-items: end; flex-wrap: wrap; gap: 18px; margin-bottom: 20px; }
.finance-header h2 { font-size: 23px; margin: 0; line-height: 1.3; }
.finance-header p { color: #667891; font-size: 13px; margin: 5px 0 0; }
.finance-period-controls { display: flex; align-items: end; flex-wrap: wrap; gap: 12px; }
.finance-period-controls label, .finance-fields label { display: grid; gap: 7px; color: #53657f; font-size: 13px; font-weight: 600; min-width: 0; }
.finance-metrics input, .finance-metrics select { color: #172d49; background: #fff; font: inherit; border: 1px solid #d7e2f0; border-radius: 8px; min-width: 0; width: 100%; padding: 11px 13px; line-height: 1.4; }
.finance-metrics input:disabled { color: #53657f; background: #f4f7fa; opacity: 1; }
.finance-metrics input::placeholder { color: #8793a5; font-weight: 400; }
.finance-period-controls input, .finance-period-controls select { padding: 8px 10px; min-height: 38px; }
.finance-month-picker { position: relative; width: 280px; max-width: 100%; min-width: 0; }
.finance-period-label { display: block; margin: 0 38px 7px; color: #53657f; font-size: 13px; font-weight: 600; }
.finance-period-navigation { display: grid; grid-template-columns: 32px minmax(0, 1fr) 32px; gap: 6px; align-items: center; }
.finance-period-toggle, .finance-period-arrow { min-height: 40px; padding: 8px 10px; font: inherit; font-size: 14px; font-weight: 600; border: 1px solid #d7e2f0; border-radius: 8px; background: #fff; color: #172d49; cursor: pointer; }
.finance-period-toggle { display: flex; align-items: center; justify-content: space-between; gap: 12px; text-align: left; white-space: nowrap; }
.finance-period-arrow { border-color: transparent; background: transparent; padding: 0; font-size: 26px; font-weight: 400; line-height: 1; }
.finance-period-toggle:hover:not(:disabled), .finance-period-arrow:hover:not(:disabled) { background: #edf6f2; border-color: #b4d9ca; }
.finance-period-toggle[aria-expanded=true] { border-color: #0a9969; }
.finance-period-popup { position: absolute; top: calc(100% + 7px); right: 32px; z-index: 30; width: 264px; max-width: calc(100vw - 32px); max-height: min(460px, calc(100dvh - 160px)); overflow-y: auto; border: 1px solid #d7e2f0; border-radius: 10px; background: #fff; box-shadow: 0 10px 28px #172d4926; }
.finance-period-popup > strong { display: block; padding: 12px 14px 9px; font-size: 12px; font-weight: 600; color: #667891; }
.finance-period-popup[data-side=above] { top: auto; bottom: calc(100% + 7px); }
.finance-period-list { max-height: min(264px, 35dvh); overflow-y: auto; overscroll-behavior: contain; padding: 3px 6px 6px; scrollbar-width: thin; }
.finance-period-list button { display: flex; justify-content: space-between; gap: 12px; width: 100%; min-height: 38px; padding: 9px 10px; border: 0; border-radius: 5px; background: #fff; color: #172d49; font: inherit; font-size: 13px; text-align: left; cursor: pointer; }
.finance-period-list button:hover { background: #f2f7fa; }
.finance-period-list button[aria-selected=true] { color: #087652; background: #eaf8f1; font-weight: 700; }
.finance-period-list button:focus-visible { outline-offset: -2px; }
.finance-period-list p { margin: 4px 8px 10px; color: #667891; font-size: 13px; }
.finance-period-new { padding: 12px; border-top: 1px solid #e0e7ef; }
.finance-period-new-button { border: 0; background: transparent; color: #087c68; padding: 3px 2px; font: inherit; font-size: 13px; cursor: pointer; }
.finance-period-new label { margin-bottom: 10px; }
@media (max-width: 480px) { .finance-period-popup { right: 0; max-width: 100%; } }
.finance-button { display: inline-flex; justify-content: center; align-items: center; gap: 8px; color: #354966; background: #fff; border: 1px solid #d7e2f0; border-radius: 8px; padding: 9px 14px; font: inherit; font-size: 13px; font-weight: 600; min-height: 38px; cursor: pointer; }
.finance-button:hover { background: #f2f7fa; border-color: #aebecd; }
.finance-button:disabled, .finance-metrics button:disabled { opacity: .6; cursor: default; }
.finance-metrics :focus-visible { outline: 2px solid #098473; outline-offset: 3px; }
.finance-primary { color: #fff; background: #0a9969; border-color: #0a9969; min-width: 106px; }
.finance-primary:hover { color: #fff; background: #078359; border-color: #078359; }
.finance-layout { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(260px, 1fr); gap: 20px; align-items: start; }
.finance-entry-card, .finance-source-card, .finance-derived-card, .finance-log { min-width: 0; background: #fff; border: 1px solid #dce5ef; border-radius: 11px; }
.finance-entry-card { padding: 24px; }
.finance-entry-card > header { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.finance-entry-card h3 { font-size: 18px; line-height: 1.4; margin: 0; }
.finance-entry-card > header > span { color: #667891; font-size: 13px; }
.finance-help { color: #667891; font-size: 13px; line-height: 1.65; margin: 0 0 22px; max-width: 58em; }
.finance-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 20px 18px; }
.finance-fields label:last-child { max-width: 290px; }
.finance-fields input { font-size: 17px; min-height: 48px; font-weight: 500; }
.finance-health-group { border: 0; border-top: 1px solid #e0e7ef; min-width: 0; margin: 24px 0 0; padding: 20px 0 0; }
.finance-health-group legend { padding: 0 10px 0 0; font-size: 16px; font-weight: 700; line-height: 1.4; color: #172d49; }
.finance-group-description { margin: 0 0 16px; color: #667891; font-size: 12px; line-height: 1.6; }
.finance-health-group .finance-fields label { align-content: start; max-width: none; }
.finance-fields label small { font-weight: 400; font-size: 11px; color: #6d7e94; line-height: 1.6; }
.finance-account-state, .finance-account-row label, .finance-account-actions label { display: grid; gap: 7px; min-width: 0; color: #53657f; font-size: 13px; font-weight: 600; }
.finance-account-state { max-width: 340px; }
.finance-account-rows { display: grid; gap: 14px; margin-top: 18px; }
.finance-account-row { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) auto; gap: 10px; align-items: end; padding: 14px; border: 1px solid #e1e9f2; border-radius: 8px; background: #f9fbfd; }
.finance-account-row input { min-height: 42px; }
.finance-account-remove { font-size: 11px; padding: 8px; min-height: 42px; }
.finance-account-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; margin-top: 14px; }
.finance-account-actions label { flex: 1 1 200px; }
.finance-account-actions > button { flex: 0 1 auto; }
.finance-metrics select:disabled { color: #53657f; background: #f4f7fa; opacity: 1; }
.finance-conflict td, .finance-log-list li { overflow-wrap: anywhere; }
.finance-caption { color: #6d7e94; font-size: 12px; line-height: 1.6; margin: 12px 0 0; }
.finance-savebar { border-top: 1px solid #e0e7ef; margin-top: 26px; padding-top: 18px; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 14px; }
.finance-savebar span { color: #53657f; font-size: 12px; }
.finance-savebar small { display: block; margin-top: 4px; color: #6d7e94; font-size: 11px; }
.finance-summary { display: grid; gap: 13px; }
.finance-source-card { padding: 21px; border-top: 3px solid #10a879; background: #fafffd; }
.finance-source-card > span, .finance-derived-card > span { display: block; font-weight: 600; font-size: 13px; color: #53657f; }
.finance-source-card > strong, .finance-derived-card > strong { display: block; font-size: clamp(22px, 2.1vw, 29px); line-height: 1.3; margin: 7px 0; overflow-wrap: anywhere; }
.finance-source-card p, .finance-derived-card p { color: #6d7e94; font-size: 12px; line-height: 1.6; margin: 0; }
.finance-source-link { padding: 0; margin-top: 13px; border: 0; background: transparent; color: #087c68; font: inherit; font-size: 12px; font-weight: 600; text-align: left; cursor: pointer; }
.finance-derived-card { padding: 18px 21px; }
.finance-summary > .finance-caption { margin-top: 0; }
.finance-notice, .finance-error, .finance-conflict, .finance-drafts, .finance-readonly { border: 1px solid #d6e7e0; padding: 13px 16px; border-radius: 8px; margin: 0 0 18px; font-size: 13px; line-height: 1.6; }
.finance-notice { background: #f0fcf6; color: #12684b; }
.finance-error { background: #fff7f8; color: #a52843; border-color: #f0ced5; }
.finance-error p { margin: 0 0 9px; }
.finance-drafts, .finance-conflict { background: #fffcf1; color: #6a541d; border-color: #eedca9; }
.finance-drafts button { color: inherit; padding: 0; background: none; border: none; text-decoration: underline; text-underline-offset: 3px; font: inherit; cursor: pointer; }
.finance-readonly { background: #f5f8fc; color: #53657f; border-color: #dce5ef; margin-top: 18px; }
.finance-conflict { margin: 20px 0 0; }
.finance-conflict h3 { font-size: 15px; }
.finance-conflict p { margin: 8px 0; }
.finance-table-scroll { overflow-x: auto; margin: 12px 0; }
.finance-conflict table { width: 100%; font-size: 12px; border-collapse: collapse; }
.finance-conflict th, .finance-conflict td { padding: 8px 7px; border-bottom: 1px solid #ecdcb5; background: transparent; color: inherit; text-align: left; text-transform: none; }
.finance-conflict .finance-button { text-align: left; }
.finance-log { margin-top: 20px; overflow: hidden; }
.finance-log-toggle { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; padding: 16px 20px; background: transparent; border: 0; color: #354966; font: inherit; font-size: 13px; font-weight: 600; text-align: left; cursor: pointer; }
.finance-log-toggle:hover { background: #f8fafc; }
.finance-log-body { padding: 0 20px 20px; font-size: 13px; line-height: 1.6; }
.finance-log-body.finance-error { margin: 0 20px 20px; padding: 12px; }
.finance-log-list { list-style: none; margin: 0; padding: 0; }
.finance-log-list > li { border-top: 1px solid #e4eaf2; padding: 14px 0; }
.finance-log-list > li > div { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 5px 12px; }
.finance-log-list time { color: #6d7e94; font-size: 12px; }
.finance-log-list ul { list-style: none; margin: 7px 0 0; padding: 0; color: #53657f; }
.finance-empty { padding: 40px 18px; color: #6d7e94; text-align: center; }
.finance-sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
@media (max-width: 900px) {
  .finance-layout { grid-template-columns: minmax(0, 1fr); }
  .finance-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .finance-source-card, .finance-summary > .finance-caption { grid-column: 1 / -1; }
}
@media (min-width: 901px) and (max-width: 1180px) {
  .finance-account-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .finance-account-remove { grid-column: 1 / -1; justify-self: start; }
}
@media (max-width: 480px) {
  .finance-header { align-items: stretch; }
  .finance-period-controls { width: 100%; }
  .finance-period-controls label { flex: 1; min-width: 135px; }
  .finance-entry-card { padding: 17px; }
  .finance-fields { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .finance-fields label:last-child { max-width: none; }
  .finance-summary { grid-template-columns: minmax(0, 1fr); }
  .finance-savebar .finance-primary { width: 100%; }
  .finance-entry-card > header > span { width: 100%; }
  .finance-account-row { grid-template-columns: minmax(0, 1fr); padding: 12px; }
  .finance-account-remove { justify-self: start; }
  .finance-account-actions { align-items: stretch; }
  .finance-account-actions > button, .finance-account-actions > label { width: 100%; }
}

/* Monthly entry workspace; the existing picker, notices and audit log remain shared. */
.finance-entry-workspace {
  --finance-ink: #142b46;
  --finance-muted: #6b7c91;
  --finance-line: #e0e8ee;
  --finance-accent: #008e74;
  width: 100%;
  max-width: 1440px;
  padding-bottom: max(126px, calc(var(--finance-save-height, 100px) + 24px));
}
.finance-entry-workspace [hidden] { display: none !important; }
.finance-entry-workspace .finance-header { align-items: center; gap: 20px; margin-bottom: 24px; }
.finance-entry-workspace .finance-header h2 { color: var(--finance-ink); font-size: clamp(23px, 2.2vw, 29px); letter-spacing: -.035em; }
.finance-entry-workspace .finance-header p { margin-top: 7px; line-height: 1.6; }
.finance-entry-workspace .finance-layout { display: block; }
.finance-entry-workspace .finance-entry-card { padding: 0; border: 0; border-radius: 0; background: transparent; }
.finance-entry-workspace .finance-entry-card > header { margin: 0 0 14px; }
.finance-entry-workspace .finance-entry-card > header h3 { font-size: 16px; }
.finance-entry-workspace .finance-jumpnav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 20px;
  padding: 9px 12px;
  border: 1px solid var(--finance-line);
  border-radius: 12px;
  background: #fff;
}
.finance-entry-workspace .finance-jumpnav > span,
.finance-entry-workspace .finance-jumpnav > strong { color: var(--finance-muted); font-size: 12px; font-weight: 500; margin-right: 9px; }
.finance-entry-workspace .finance-jumpnav button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 8px 13px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #364b62;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.finance-entry-workspace .finance-jumpnav button:hover { color: #006d5a; background: #eef8f4; }
.finance-entry-workspace .finance-jumpnav button[aria-current=true] { color: #006d5a; background: #e9f6f1; }
.finance-entry-workspace .finance-intro { display: flex; align-items: center; justify-content: space-between; gap: 28px; margin-bottom: 22px; }
.finance-entry-workspace .finance-intro .finance-help { flex: 1; margin: 0; max-width: 51em; line-height: 1.75; }
.finance-entry-workspace .finance-intro .finance-help strong { color: #354a62; font-weight: 600; }
.finance-entry-workspace .finance-source-card {
  flex: 0 1 342px;
  min-width: 240px;
  padding: 14px 18px;
  border: 1px solid #142b46;
  border-radius: 13px;
  background: #142b46;
  color: #fff;
}
.finance-entry-workspace .finance-source-card > span { color: #d0dce8; font-size: 11px; font-weight: 500; }
.finance-entry-workspace .finance-source-card > strong { margin: 4px 0; color: #fff; font-size: clamp(22px, 2vw, 27px); line-height: 1.25; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.finance-entry-workspace .finance-source-card p { color: #bccddd; font-size: 11px; line-height: 1.7; }
.finance-entry-workspace .finance-source-card .finance-source-link { margin-top: 8px; color: #9be6cc; font-size: 11px; }
.finance-entry-workspace .finance-source-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.finance-entry-workspace .finance-source-card .finance-source-link:hover { color: #fff; }
.finance-entry-workspace .finance-groups { display: grid; gap: 20px; }
.finance-entry-workspace .finance-input-group {
  margin: 0;
  padding: 22px 24px 17px;
  border: 1px solid var(--finance-line);
  border-radius: 14px;
  background: #fff;
  scroll-margin-top: 116px;
  scroll-margin-bottom: calc(var(--finance-save-height, 100px) + 24px);
  min-width: 0;
}
.finance-entry-workspace .finance-input-group .finance-fields { display: block; gap: 0; }
.finance-entry-workspace .finance-input-group .finance-fields label { max-width: none; }
.finance-entry-workspace .finance-input-group :is(input, select, button) { scroll-margin-top: 116px; scroll-margin-bottom: calc(var(--finance-save-height, 100px) + 24px); }
.finance-entry-workspace .finance-input-group legend { float: left; width: 100%; margin: 0 0 6px; padding: 0; color: var(--finance-ink); font-size: 18px; font-weight: 700; letter-spacing: -.02em; }
.finance-entry-workspace .finance-group-description { clear: both; margin: 0 0 20px; max-width: 72em; color: var(--finance-muted); font-size: 12px; line-height: 1.65; }
.finance-entry-workspace .finance-entry-table-head,
.finance-entry-workspace .finance-entry-row {
  display: grid;
  grid-template-columns: minmax(150px, 1.15fr) minmax(140px, 1fr) minmax(115px, .75fr);
  align-items: center;
  gap: 14px 24px;
}
.finance-entry-workspace .finance-entry-table-head {
  min-height: 33px;
  padding: 0 0 9px;
  border-bottom: 1px solid var(--finance-line);
  color: var(--finance-muted);
  font-size: 11px;
  font-weight: 500;
}
.finance-entry-workspace .finance-entry-table-head > :nth-child(2),
.finance-entry-workspace .finance-account-table-head > :nth-child(2) { color: #314a61; font-weight: 600; }
.finance-entry-workspace .finance-entry-row { min-height: 66px; padding: 11px 0; border-bottom: 1px solid #edf1f5; }
.finance-entry-workspace .finance-entry-row > label { min-width: 0; color: #354b62; font-size: 13px; font-weight: 500; line-height: 1.5; }
.finance-entry-workspace .finance-entry-row > label small { display: block; margin-top: 3px; color: var(--finance-muted); font-size: 11px; font-weight: 400; line-height: 1.5; }
.finance-entry-workspace .finance-current-value { min-width: 0; }
.finance-entry-workspace .finance-entry-row input,
.finance-entry-workspace .finance-account-row input { min-height: 42px; padding: 9px 12px; border-color: #d2dfe9; border-radius: 8px; font-size: 14px; font-weight: 500; font-variant-numeric: tabular-nums; scroll-margin-bottom: calc(var(--finance-save-height, 100px) + 24px); }
.finance-entry-workspace .finance-entry-row input:hover:not(:disabled),
.finance-entry-workspace .finance-account-row input:hover:not(:disabled) { border-color: #a9c5bc; }
.finance-entry-workspace input:focus-visible,
.finance-entry-workspace select:focus-visible { border-color: var(--finance-accent); outline: 2px solid #bde5d9; outline-offset: 1px; }
.finance-entry-workspace input::placeholder { color: #96a2af; font-size: 12px; }
.finance-entry-workspace .finance-reference-value { min-width: 0; color: #667b8f; font-size: 13px; font-weight: 400; line-height: 1.5; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.finance-entry-workspace .finance-reference-value strong { font-size: inherit; font-weight: 500; }
.finance-entry-workspace .finance-reference-mobile-label { display: none; }
.finance-entry-workspace .finance-reference-notice { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 14px; margin: 0 0 16px; padding: 10px 13px; border: 1px solid #dbe6ee; border-radius: 8px; background: #f6f9fc; color: #667b8f; font-size: 12px; line-height: 1.6; }
.finance-entry-workspace .finance-reference-notice p { margin: 0; }
.finance-entry-workspace .finance-reference-notice button { flex: 0 0 auto; }
.finance-entry-workspace .finance-group-footer { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 14px 22px; margin-top: 16px; }
.finance-entry-workspace .finance-calculations { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 28px; }
.finance-entry-workspace .finance-calculations-label { color: #7e8d9d; font-size: 11px; line-height: 1.6; }
.finance-entry-workspace .finance-calculation { display: flex; align-items: baseline; flex-wrap: wrap; gap: 5px 9px; font-size: 12px; color: var(--finance-muted); line-height: 1.6; }
.finance-entry-workspace .finance-calculation strong { color: #213d55; font-size: 15px; font-weight: 650; font-variant-numeric: tabular-nums; }
.finance-entry-workspace [data-finance-help-toggle] { min-height: 32px; margin: 0; padding: 5px 0; border: 0; border-radius: 3px; background: transparent; color: #087b68; font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; }
.finance-entry-workspace [data-finance-help-toggle] > span { margin-left: 7px; }
.finance-entry-workspace [data-finance-help-toggle]:hover { text-decoration: underline; text-underline-offset: 3px; }
.finance-entry-workspace .finance-group-help { margin-top: 14px; padding: 15px 17px; border: 1px solid #e3eaf0; border-radius: 8px; background: #f7fafc; color: #5c7085; font-size: 12px; line-height: 1.7; }
.finance-entry-workspace .finance-group-help dl { display: grid; grid-template-columns: minmax(130px, .8fr) minmax(0, 2fr); gap: 8px 20px; margin: 0; }
.finance-entry-workspace .finance-group-help dt { color: #364f65; font-weight: 600; }
.finance-entry-workspace .finance-group-help dd { margin: 0; }
.finance-entry-workspace .finance-group-help p { margin: 0; }
.finance-entry-workspace .finance-group-help dl + p { margin-top: 12px; }
.finance-entry-workspace .finance-account-state { max-width: 400px; font-size: 12px; }
.finance-entry-workspace .finance-account-state select { min-height: 42px; padding: 9px 12px; font-size: 13px; }
.finance-entry-workspace .finance-account-rows { gap: 0; margin-top: 17px; }
.finance-entry-workspace .finance-account-table-head,
.finance-entry-workspace .finance-account-row { display: grid; grid-template-columns: minmax(170px, 1.15fr) minmax(125px, .85fr) minmax(110px, .65fr) 42px; gap: 14px; align-items: center; }
.finance-entry-workspace .finance-account-table-head { margin-top: 20px; padding-bottom: 9px; border-bottom: 1px solid var(--finance-line); color: var(--finance-muted); font-size: 11px; }
.finance-entry-workspace .finance-account-table-head + .finance-account-rows { margin-top: 0; }
.finance-entry-workspace .finance-account-row { margin: 0; padding: 11px 0; border: 0; border-bottom: 1px solid #edf1f5; border-radius: 0; background: #fff; }
.finance-entry-workspace .finance-account-row label { gap: 5px; color: #526980; font-size: 11px; font-weight: 500; }
.finance-entry-workspace .finance-account-row label > span { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.finance-entry-workspace .finance-account-remove { grid-column: auto; width: 100%; min-height: 36px; padding: 7px 8px; border-color: transparent; background: transparent; color: #7f5360; font-size: 11px; }
.finance-entry-workspace .finance-account-remove:hover { border-color: #eddae0; background: #fff6f7; color: #9b3c51; }
.finance-entry-workspace .finance-account-actions { gap: 10px; margin-top: 14px; }
.finance-entry-workspace .finance-account-actions label { flex: 0 1 340px; font-size: 11px; }
.finance-entry-workspace .finance-account-actions select { min-height: 38px; padding: 8px 11px; font-size: 12px; }
.finance-entry-workspace .finance-account-actions .finance-button { min-height: 38px; color: #176e60; background: #f5faf8; border-color: #d4e5df; font-size: 12px; }
.finance-entry-workspace .finance-account-actions .finance-button:hover { background: #eaf5ef; border-color: #b0d2c4; }
.finance-entry-workspace .finance-savebar {
  position: fixed;
  z-index: 20;
  left: var(--finance-save-left, 16px);
  bottom: 0;
  width: min(var(--finance-save-width, calc(100% - 32px)), calc(100vw - 24px));
  margin: 0;
  padding: 15px 24px max(15px, env(safe-area-inset-bottom));
  border: 1px solid #dce6ed;
  border-bottom: 0;
  border-radius: 13px 13px 0 0;
  background: #fff;
  box-shadow: 0 -6px 24px #142b460a;
  flex-wrap: nowrap;
  gap: 20px;
}
.finance-entry-workspace .finance-savebar > div:first-child { min-width: 0; }
.finance-entry-workspace .finance-savebar [data-finance-dirty] { color: #344e62; font-size: 12px; font-weight: 600; }
.finance-entry-workspace .finance-savebar small { margin-top: 5px; font-size: 11px; line-height: 1.5; }
.finance-entry-workspace .finance-save-actions { display: flex; align-items: center; justify-content: flex-end; gap: 15px; flex: 0 0 auto; }
.finance-entry-workspace .finance-keyboard-hint { color: #718395; font-size: 11px; white-space: nowrap; }
.finance-entry-workspace .finance-savebar kbd { display: inline-block; margin-left: 5px; padding: 2px 4px; border: 1px solid #dbe4eb; border-radius: 4px; background: #f5f8fa; color: #597185; font: inherit; font-size: 10px; line-height: 1.3; }
.finance-entry-workspace .finance-savebar .finance-primary { min-width: 134px; width: auto; min-height: 44px; border-radius: 8px; background: #008e74; border-color: #008e74; font-size: 13px; }
.finance-entry-workspace .finance-savebar .finance-primary:hover:not(:disabled) { background: #007861; border-color: #007861; }
.finance-entry-workspace .finance-primary kbd { margin-left: 4px; border-color: #ffffff40; background: #ffffff15; color: #e5fff4; font-size: 10px; }
.finance-entry-workspace .finance-log { margin-top: 20px; border-color: var(--finance-line); border-radius: 12px; }
.finance-entry-workspace .finance-log-toggle { min-height: 54px; font-size: 12px; }
.finance-entry-workspace .finance-readonly { margin-top: 0; }
.finance-entry-workspace .finance-conflict { scroll-margin-bottom: 120px; }
@media (max-width: 1020px) {
  .finance-entry-workspace .finance-entry-table-head,
  .finance-entry-workspace .finance-entry-row { grid-template-columns: minmax(145px, 1.05fr) minmax(120px, 1fr) minmax(100px, .75fr); gap: 12px 17px; }
  .finance-entry-workspace .finance-account-table-head,
  .finance-entry-workspace .finance-account-row { grid-template-columns: minmax(140px, 1.1fr) minmax(115px, .9fr) minmax(90px, .7fr) 40px; gap: 10px; }
  .finance-entry-workspace .finance-input-group { padding: 20px; }
  .finance-entry-workspace .finance-intro { gap: 20px; }
  .finance-entry-workspace .finance-source-card { flex-basis: 310px; }
}
@media (max-width: 760px) {
  .finance-entry-workspace .finance-header { align-items: flex-start; }
  .finance-entry-workspace .finance-intro { flex-direction: column; align-items: stretch; gap: 16px; }
  .finance-entry-workspace .finance-source-card { flex: auto; min-width: 0; }
  .finance-entry-workspace .finance-jumpnav { gap: 4px; padding: 7px; }
  .finance-entry-workspace .finance-jumpnav > span,
  .finance-entry-workspace .finance-jumpnav > strong { width: 100%; padding: 4px 7px; }
  .finance-entry-workspace .finance-jumpnav button { padding-inline: 10px; }
  .finance-entry-workspace .finance-entry-table-head,
  .finance-entry-workspace .finance-entry-row { grid-template-columns: minmax(130px, 1.15fr) minmax(110px, 1fr) minmax(88px, .75fr); gap: 10px 13px; }
  .finance-entry-workspace .finance-account-table-head { display: none; }
  .finance-entry-workspace .finance-account-rows { gap: 12px; }
  .finance-entry-workspace .finance-account-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px 14px; padding: 13px; border: 1px solid var(--finance-line); border-radius: 8px; background: #fafcfd; }
  .finance-entry-workspace .finance-account-row label > span { position: static; width: auto; height: auto; margin: 0; overflow: visible; clip: auto; white-space: normal; }
  .finance-entry-workspace .finance-account-row .finance-reference-value { grid-column: 1; font-size: 12px; align-self: center; }
  .finance-entry-workspace .finance-account-row .finance-reference-mobile-label { display: inline; margin-right: 4px; color: #78899a; font-size: 11px; }
  .finance-entry-workspace .finance-account-remove { grid-column: 2; justify-self: end; width: auto; }
  .finance-entry-workspace .finance-group-help dl { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .finance-entry-workspace .finance-group-help dd + dt { margin-top: 9px; }
  .finance-entry-workspace .finance-savebar { padding-inline: 17px; gap: 12px; }
  .finance-entry-workspace .finance-keyboard-hint { display: none; }
}
@media (max-width: 540px) {
  /* Leave room between the stacked Flow header and the fixed savebar on narrow screens. */
  .main:has(.finance-entry-workspace) > .mobile-nav { position: static; }
  .finance-entry-workspace { padding-bottom: max(154px, calc(var(--finance-save-height, 130px) + 24px)); }
  .finance-entry-workspace .finance-header { gap: 17px; margin-bottom: 18px; }
  .finance-entry-workspace .finance-period-controls { width: 100%; justify-content: space-between; gap: 8px; }
  .finance-entry-workspace .finance-month-picker { flex: 1; width: auto; max-width: 290px; }
  .finance-entry-workspace .finance-period-controls > .finance-button { padding-inline: 10px; min-height: 44px; }
  .finance-entry-workspace .finance-period-toggle,
  .finance-entry-workspace .finance-period-arrow { min-height: 44px; font-size: 12px; }
  .finance-entry-workspace .finance-period-arrow { font-size: 24px; }
  .finance-entry-workspace .finance-period-navigation { grid-template-columns: 24px minmax(0, 1fr) 24px; gap: 3px; }
  .finance-entry-workspace .finance-period-label { margin-left: 27px; }
  .finance-entry-workspace .finance-period-toggle { gap: 7px; padding-inline: 9px; }
  .finance-entry-workspace .finance-period-popup { right: 0; }
  .finance-entry-workspace .finance-jumpnav { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .finance-entry-workspace .finance-jumpnav > span,
  .finance-entry-workspace .finance-jumpnav > strong { grid-column: 1 / -1; }
  .finance-entry-workspace .finance-jumpnav button { min-height: 42px; padding: 9px 6px; justify-content: flex-start; font-size: 11px; }
  .finance-entry-workspace .finance-intro { margin-bottom: 17px; }
  .finance-entry-workspace .finance-intro .finance-help { font-size: 12px; }
  .finance-entry-workspace .finance-source-card { padding: 17px 18px; }
  .finance-entry-workspace .finance-source-card > strong { font-size: 27px; }
  .finance-entry-workspace .finance-groups { gap: 16px; }
  .finance-entry-workspace .finance-input-group { padding: 18px 16px 15px; border-radius: 12px; }
  .finance-entry-workspace .finance-input-group legend { font-size: 17px; }
  .finance-entry-workspace .finance-group-description { margin-bottom: 10px; font-size: 11px; }
  .finance-entry-workspace .finance-entry-table-head { display: none; }
  .finance-entry-workspace .finance-entry-row { grid-template-columns: minmax(0, 1fr); gap: 7px; padding: 13px 0; }
  .finance-entry-workspace .finance-entry-row > label { font-size: 12px; font-weight: 600; }
  .finance-entry-workspace .finance-entry-row input,
  .finance-entry-workspace .finance-account-row input { min-height: 44px; font-size: 16px; }
  .finance-entry-workspace .finance-reference-value { display: flex; flex-wrap: wrap; gap: 4px; align-items: baseline; color: #6e8193; font-size: 11px; }
  .finance-entry-workspace .finance-reference-mobile-label { display: inline; color: #78899a; font-size: 11px; }
  .finance-entry-workspace .finance-group-footer { align-items: flex-start; gap: 11px; }
  .finance-entry-workspace .finance-calculations { width: 100%; flex-wrap: wrap; gap: 9px 20px; }
  .finance-entry-workspace .finance-calculation { font-size: 11px; }
  .finance-entry-workspace .finance-calculation strong { font-size: 14px; }
  .finance-entry-workspace [data-finance-help-toggle] { min-height: 38px; }
  .finance-entry-workspace .finance-account-row { grid-template-columns: minmax(0, 1fr); }
  .finance-entry-workspace .finance-account-remove { grid-column: 1; justify-self: start; padding-left: 0; }
  .finance-entry-workspace .finance-account-state select,
  .finance-entry-workspace .finance-account-actions select { min-height: 44px; font-size: 14px; }
  .finance-entry-workspace .finance-account-actions { align-items: stretch; }
  .finance-entry-workspace .finance-account-actions label { flex: auto; }
  .finance-entry-workspace .finance-account-actions .finance-button { width: 100%; min-height: 44px; }
  .finance-entry-workspace .finance-group-help { padding: 12px; font-size: 11px; }
  .finance-entry-workspace .finance-savebar { padding: 13px 14px max(13px, env(safe-area-inset-bottom)); gap: 10px; }
  .finance-entry-workspace .finance-savebar [data-finance-dirty] { font-size: 11px; }
  .finance-entry-workspace .finance-savebar small { font-size: 10px; }
  .finance-entry-workspace .finance-savebar .finance-primary { min-width: 96px; padding-inline: 13px; }
  .finance-entry-workspace .finance-savebar .finance-primary kbd { display: none; }
  .finance-entry-workspace .finance-log-toggle { padding: 15px 16px; font-size: 11px; }
  .finance-entry-workspace .finance-log-body { padding-inline: 16px; font-size: 12px; }
}
