:root {
  --background: #f6f8f7;
  --surface: #ffffff;
  --ink: #20312b;
  --muted: #53635b;
  --green: #246649;
  --green-hover: #194e37;
  --link: #245a48;
  --line: #d8e1db;
  --soft-green: #ecf5ee;
  --soft-blue: #edf4f8;
}
* { box-sizing: border-box; }
html { background: var(--background); scroll-behavior: smooth; }
body { max-width: 1040px; margin: 0 auto; padding: 0 28px; color: var(--ink); font: 16px/1.5 "Segoe UI", Aptos, Arial, sans-serif; }
header { padding: 24px 0 18px; }
.brand { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; }
.brand-mark { display: grid; place-items: center; width: 40px; height: 40px; background: var(--soft-blue); border-radius: 11px; font-size: 1.4rem; }
h1, h2, h3, h4 { line-height: 1.25; text-wrap: balance; }
h1 { margin: 0; font-size: 1.6rem; letter-spacing: -.025em; }
h2 { margin: 0 0 10px; font-size: 1.55rem; letter-spacing: -.02em; }
h3 { margin: 0 0 12px; font-size: 1.18rem; }
h4 { margin: 0 0 5px; font-size: 1rem; }
p { margin: 9px 0 14px; }
a { color: var(--link); text-underline-offset: 3px; }
a:hover { color: var(--green-hover); }
nav { display: flex; gap: 5px; flex-wrap: wrap; border-bottom: 1px solid var(--line); }
nav a { display: inline-block; padding: 10px 14px 12px; color: var(--muted); text-decoration: none; font-weight: 600; border-bottom: 3px solid transparent; }
nav a:hover { color: var(--green); background: #edf3ef; }
nav a.active { color: var(--green); border-bottom-color: var(--green); }
main { min-height: 62vh; padding: 28px 34px 40px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.example-banner { display: flex; justify-content: space-between; align-items: center; gap: 12px 24px; flex-wrap: wrap; padding: 14px 18px; margin-bottom: 22px; background: var(--soft-blue); border-radius: 9px; }
.example-banner p { margin: 3px 0 0; color: var(--muted); }
#message:empty { display: none; }
#message:not(:empty) { margin: 0 0 20px; padding: 10px 14px; color: #1b5138; background: var(--soft-green); border-radius: 8px; }
section { padding: 28px 0; border-top: 1px solid var(--line); }
section:first-child { border-top: 0; }
.page-heading, .section-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px 24px; flex-wrap: wrap; }
.page-heading p { color: var(--muted); margin: 0 0 17px; }
.section-heading a { font-size: .94rem; font-weight: 600; white-space: nowrap; }
.getting-started { padding: 16px 18px; margin: 0 0 18px; background: var(--soft-blue); border-radius: 10px; }
.getting-started a { font-weight: 700; }
.balance-panel { background: var(--soft-green); border-radius: 12px; padding: 20px 24px 12px; margin-bottom: 4px; }
.balance-label { margin: 0; font-weight: 700; color: #325743; }
.big-number { color: var(--green); font-size: 2.6rem; line-height: 1.15; font-weight: 750; letter-spacing: -.04em; margin: 4px 0; font-variant-numeric: tabular-nums; }
.totals-row { display: flex; gap: 18px 34px; flex-wrap: wrap; border-top: 1px solid #cfdfd2; padding-top: 12px; }
.totals-row p { margin: 0 0 8px; color: #3f5949; font-size: .92rem; }
.totals-row strong { display: block; color: var(--ink); font-size: 1.1rem; font-variant-numeric: tabular-nums; }
label { display: block; margin: 0 0 14px; font-weight: 600; }
input:not([type="checkbox"]), select, textarea { display: block; width: 100%; max-width: 380px; min-height: 43px; padding: 9px 11px; margin-top: 5px; color: var(--ink); background: white; border: 1px solid #aebeb3; border-radius: 7px; font: inherit; font-weight: 400; }
input::placeholder, textarea::placeholder { color: #5b6b62; }
input[type="checkbox"] { accent-color: var(--green); }
textarea { max-width: none; min-height: 80px; }
button { min-height: 40px; padding: 8px 15px; font: inherit; font-weight: 650; color: white; background: var(--green); border: 1px solid var(--green); border-radius: 7px; cursor: pointer; transition: background-color .16s, border-color .16s; }
button:hover { background: var(--green-hover); border-color: var(--green-hover); }
button:disabled { opacity: .48; cursor: not-allowed; }
.button-quiet, #dismiss-suggestion, #chat-close { color: var(--green); background: white; border-color: #b5c8ba; }
.button-quiet:hover, #dismiss-suggestion:hover, #chat-close:hover { color: var(--green-hover); background: var(--soft-green); border-color: var(--green); }
.form-actions { display: flex; gap: 8px; flex-wrap: wrap; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible { outline: 3px solid #2168a4; outline-offset: 2px; }
details { margin: 8px 0 16px; }
summary { width: fit-content; color: var(--link); cursor: pointer; font-weight: 600; }
fieldset { margin: 18px 0; padding: 16px; border: 1px solid var(--line); border-radius: 8px; }
legend { font-weight: 700; padding: 0 6px; }
.notice, .benefit { background: var(--soft-green); padding: 14px 16px; border-radius: 8px; }
.notice { margin-top: 15px; }
#dismiss-suggestion { margin-left: 12px; }
.tip-card { margin: 10px 0; padding: 13px 16px; border-radius: 8px; background: var(--soft-blue); }
.tip-card p { margin: 0 0 6px; }
.tip-warning { background: #fff6e6; }
.tip-urgent { background: #fff0ee; }
.jump-links { display: flex; flex-wrap: wrap; gap: 8px; margin: 20px 0 8px; }
.jump-links button { min-height: 0; color: var(--green); background: #f0f5f1; border: 1px solid #d7e3d9; font-size: .9rem; }
.jump-links button:hover { color: white; background: var(--green); }
.field-hint { color: var(--muted); font-size: .92rem; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 9px; margin: 16px 0; }
table { width: 100%; min-width: 630px; border-collapse: collapse; font-size: .93rem; }
th, td { padding: 11px 13px; text-align: left; border-bottom: 1px solid #e7ece8; vertical-align: middle; }
th { color: #3e5848; background: #f2f6f3; font-size: .82rem; font-weight: 700; }
tbody tr:nth-child(even) { background: #fafcfb; }
tbody tr:hover { background: #f2f8f3; }
tbody tr:last-child td { border-bottom: 0; }
.amount-cell { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.empty-cell { text-align: center; color: var(--muted); padding: 22px; }
.table-action { min-height: 30px; padding: 4px 8px; color: var(--green); background: transparent; border-color: transparent; font-size: .87rem; }
.table-action:hover { color: var(--green-hover); background: #e7f1e9; border-color: transparent; }
.status-tag { display: inline-block; padding: 3px 8px; border-radius: 5px; white-space: nowrap; font-size: .78rem; font-weight: 700; }
.status-neutral { color: #516157; background: #edf0ed; }
.status-ok { color: #286245; background: #e5f2e8; }
.status-over { color: #915b12; background: #fff0d4; }
#plan-categories { display: flex; flex-wrap: wrap; gap: 0 20px; }
#plan-categories label { font-weight: 400; }
#plan-result { padding: 20px; margin: 22px 0; background: #f6f9f7; border-radius: 9px; }
#plan-cut-fields { display: flex; flex-wrap: wrap; gap: 0 20px; }
#chat-toggle { position: fixed; right: 20px; bottom: 18px; z-index: 2; border-radius: 24px; }
#chat-panel { position: fixed; right: 20px; bottom: 74px; z-index: 2; box-sizing: border-box; width: min(380px, calc(100vw - 32px)); max-height: 76vh; overflow-y: auto; padding: 17px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 5px 22px #142b1c20; }
.chat-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.chat-heading h2 { margin: 0; }
#chat-messages { max-height: 230px; overflow-y: auto; }
#chat-messages p { padding: 9px 12px; border-radius: 7px; background: #f2f5f3; white-space: pre-wrap; }
#chat-messages .bear-reply { background: var(--soft-green); }
.chat-setup { color: var(--muted); font-size: .85rem; }
[hidden] { display: none !important; }
@media (max-width: 700px) {
  body { padding: 0 14px; }
  header { padding-top: 15px; }
  nav { flex-wrap: wrap; }
  nav a { padding: 8px 10px; white-space: nowrap; }
  main { padding: 21px 18px 34px; }
  .big-number { font-size: 2.25rem; }
  .balance-panel { padding: 18px 18px 10px; }
  #chat-toggle { right: 12px; bottom: 12px; }
  #chat-panel { right: 12px; bottom: 67px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  button { transition: none; }
}
