:root {
  --ink: #111318;
  --muted: #6f7889;
  --page: #f3f5f7;
  --surface: #fff;
  --line: #e3e7ed;
  --yellow: #ffd91c;
  --yellow-soft: #fff9d8;
  --green: #087c40;
  --green-soft: #edf8f1;
  --red: #a95353;
  --radius: 7px;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--page);
}
* { box-sizing: border-box; }
body { min-width: 320px; margin: 0; background: var(--page); color: var(--ink); }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid rgba(255,217,28,.55); outline-offset: 2px; }
[hidden] { display: none !important; }
.topbar { position: sticky; top: 0; z-index: 20; min-height: 66px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.97); backdrop-filter: blur(10px); }
.topbar-shell { width: min(1760px, calc(100% - 40px)); min-height: 66px; margin: 0 auto; display: grid; grid-template-columns: 280px 1fr auto; align-items: center; }
.brand { width: fit-content; display: inline-flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; }
.brand-mark { width: 32px; height: 32px; display: grid; place-items: center; border: 1.5px solid var(--ink); border-radius: 50%; background: var(--yellow); font-weight: 800; box-shadow: 2px 2px 0 var(--ink); }
.brand > span:last-child { display: grid; gap: 2px; }
.brand strong { font-size: 15px; }
.current-area { justify-self: center; color: var(--ink); font-size: 14px; font-weight: 700; text-decoration: none; }
.top-menu { position: relative; justify-self: end; }
.top-menu summary { width: 40px; height: 40px; display: grid; place-content: center; gap: 4px; border: 1px solid var(--line); border-radius: 50%; background: #fff; cursor: pointer; list-style: none; }
.top-menu summary::-webkit-details-marker { display: none; }
.top-menu summary span { width: 17px; height: 2px; border-radius: 2px; background: var(--ink); }
.top-menu[open] summary { border-color: #d2b100; background: var(--yellow); }
.top-menu nav { position: absolute; top: calc(100% + 10px); right: 0; width: 290px; overflow: hidden; border: 1px solid var(--line); border-radius: 10px; background: #fff; box-shadow: 0 18px 50px rgba(17,19,24,.16); }
.top-menu nav a { display: grid; gap: 4px; padding: 15px 17px; color: var(--ink); text-decoration: none; }
.top-menu nav a + a { border-top: 1px solid var(--line); }
.top-menu nav a:hover { background: #f6f7f8; }
.top-menu nav strong { font-size: 13px; }
.top-menu nav small { color: var(--muted); font-size: 10px; line-height: 1.4; }
.workspace-nav { position: sticky; top: 74px; z-index: 15; width: min(1500px, calc(100% - 48px)); min-height: 50px; margin: 16px auto 0; padding: 5px; display: flex; align-items: center; gap: 3px; overflow-x: auto; border: 1px solid var(--line); border-radius: 999px; background: rgba(255,255,255,.97); backdrop-filter: blur(10px); }
.workspace-nav a { min-height: 38px; flex: 0 0 auto; padding: 0 13px; display: grid; place-items: center; border-radius: 999px; color: var(--muted); font-size: 10px; font-weight: 700; text-decoration: none; white-space: nowrap; }
.workspace-nav a:hover { color: var(--ink); background: #fff; }
.workspace-nav a.active { color: var(--ink); background: var(--yellow); }
.persona-picker { display: grid; gap: 2px; }
.persona-picker span { color: var(--muted); font-size: 8px; font-weight: 700; text-transform: uppercase; }
.persona-picker select { max-width: 180px; padding: 6px 26px 6px 9px; border: 1px solid var(--line); border-radius: 5px; background: #fafbfc; color: var(--ink); font-size: 11px; font-weight: 700; }
main { width: min(1500px, calc(100% - 48px)); margin: 0 auto; padding-bottom: 60px; }
.page-head { min-height: 188px; display: flex; align-items: center; justify-content: space-between; gap: 40px; border-bottom: 1px solid var(--line); }
.eyebrow, .ledger-head small, .plan-panel header small, .form-heading small { margin: 0 0 8px; color: var(--green); font-size: 9px; font-weight: 800; text-transform: uppercase; }
.page-head h1 { margin: 0; font-size: 36px; line-height: 1.1; letter-spacing: 0; }
.page-head p:not(.eyebrow) { max-width: 720px; margin: 12px 0 0; color: var(--muted); font-size: 13px; line-height: 1.6; }
.head-total { min-width: 240px; padding-left: 25px; border-left: 3px solid var(--yellow); display: grid; gap: 5px; }
.page-head-side { display: flex; align-items: center; gap: 26px; }
.head-total span, .head-total small { color: var(--muted); font-size: 10px; }
.head-total strong { font-size: 28px; }
.notice { margin-top: 18px; padding: 12px 14px; border: 1px solid #e8d16d; border-radius: var(--radius); background: var(--yellow-soft); font-size: 12px; }
.notice.error { border-color: #e2b8b8; background: #fff2f2; color: #793b3b; }
.workspace { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 28px; padding-top: 28px; }
.plan-panel, .ledger { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.plan-panel { align-self: start; overflow: hidden; }
.plan-panel > header, .ledger-head, .form-heading { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.plan-panel > header { padding: 20px; border-bottom: 1px solid var(--line); }
h2, h3 { margin: 0; letter-spacing: 0; }
.plan-panel h2, .ledger h2 { font-size: 20px; }
.plan-panel header a { color: var(--green); font-size: 10px; font-weight: 700; }
.plan-summary { display: grid; grid-template-columns: 1fr 1fr; border-bottom: 1px solid var(--line); background: #fafbfc; }
.plan-summary div { min-width: 0; padding: 16px 20px; display: grid; gap: 5px; }
.plan-summary div + div { border-left: 1px solid var(--line); }
.plan-summary span { color: var(--muted); font-size: 9px; }
.plan-summary strong { font-size: 12px; line-height: 1.35; }
.plan-dates { margin: 0; padding: 8px 20px; list-style: none; }
.plan-dates li { min-height: 41px; display: grid; grid-template-columns: 38px 1fr auto; align-items: center; gap: 10px; border-bottom: 1px solid #eef0f3; font-size: 11px; }
.plan-dates li:last-child { border-bottom: 0; }
.plan-dates b { color: var(--muted); font-size: 9px; }
.plan-dates span { font-weight: 700; }
.plan-dates em { padding: 4px 6px; border-radius: 3px; background: var(--yellow-soft); color: #6f5d00; font-size: 8px; font-style: normal; }
.plan-note { margin: 0; padding: 14px 20px; border-top: 1px solid var(--line); color: var(--muted); font-size: 9px; line-height: 1.5; }
.ledger { min-width: 0; overflow: hidden; }
.ledger-head { min-height: 76px; padding: 17px 20px; border-bottom: 1px solid var(--line); }
.primary-button { min-height: 37px; padding: 8px 13px; border: 1px solid #d2b100; border-radius: 5px; background: var(--yellow); color: var(--ink); font-size: 11px; font-weight: 800; cursor: pointer; }
.primary-button:hover { background: #ffe252; }
.contribution-form { padding: 20px; border-bottom: 1px solid var(--line); background: #fafbfc; }
.form-heading { margin-bottom: 18px; }
.form-heading h3 { font-size: 16px; }
.icon-button { width: 32px; height: 32px; border: 1px solid var(--line); border-radius: 50%; background: #fff; color: var(--muted); font-size: 19px; cursor: pointer; }
.form-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px; }
.form-grid label { min-width: 0; display: grid; gap: 6px; }
.form-grid label > span { color: var(--muted); font-size: 9px; font-weight: 700; }
.form-grid input, .form-grid select { width: 100%; min-height: 42px; padding: 9px 10px; border: 1px solid #d5dae1; border-radius: 5px; background: #fff; color: var(--ink); font-size: 12px; }
.form-grid .wide { grid-column: span 4; }
.input-suffix { display: grid; grid-template-columns: 1fr auto; align-items: center; border: 1px solid #d5dae1; border-radius: 5px; background: #fff; }
.input-suffix input { border: 0; }
.input-suffix b { padding-right: 10px; color: var(--green); font-size: 10px; }
.form-footer { margin-top: 17px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.form-footer p { margin: 0; color: var(--muted); font-size: 9px; }
.ledger-table { overflow-x: auto; }
.ledger-row { min-width: 850px; min-height: 64px; display: grid; grid-template-columns: 94px 120px 100px 135px minmax(210px, 1fr) 76px; align-items: center; gap: 12px; padding: 0 20px; border-bottom: 1px solid var(--line); font-size: 11px; }
.ledger-header { min-height: 38px; background: #fafbfc; color: var(--muted); font-size: 8px; font-weight: 800; text-transform: uppercase; }
.ledger-row strong { display: block; font-size: 13px; }
.ledger-row small { display: block; margin-top: 3px; color: var(--muted); font-size: 8px; }
.ledger-row .route { display: flex; align-items: center; gap: 8px; }
.route-mark { width: 28px; height: 28px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 50%; background: var(--green-soft); color: var(--green); font-size: 9px; font-weight: 800; }
.row-actions { display: flex; justify-content: flex-end; gap: 5px; }
.row-actions button { width: 30px; height: 30px; border: 1px solid var(--line); border-radius: 5px; background: #fff; color: var(--muted); cursor: pointer; }
.row-actions button:hover { color: var(--ink); border-color: #bfc5ce; }
.empty { padding: 55px 24px; text-align: center; }
.empty b { display: block; margin-bottom: 6px; font-size: 15px; }
.empty span { color: var(--muted); font-size: 11px; }
dialog { max-width: 440px; padding: 0; border: 0; border-radius: var(--radius); box-shadow: 0 20px 70px rgba(20,25,35,.22); }
dialog::backdrop { background: rgba(17,19,24,.48); }
dialog form { padding: 25px; }
dialog small { color: var(--red); font-size: 9px; font-weight: 800; text-transform: uppercase; }
dialog h2 { margin-top: 8px; font-size: 21px; }
dialog p { color: var(--muted); font-size: 11px; line-height: 1.6; }
dialog form > div { margin-top: 20px; display: flex; justify-content: flex-end; gap: 8px; }
dialog button { padding: 9px 13px; border: 1px solid var(--line); border-radius: 5px; background: #fff; cursor: pointer; }
.danger-button { border-color: #d8a7a7; background: #fff1f1; color: var(--red); font-weight: 700; }
@media (max-width: 1050px) {
  .topbar-shell { grid-template-columns: 220px 1fr auto; }
  .workspace { grid-template-columns: 1fr; }
  .plan-panel { position: static; }
  .plan-dates { display: grid; grid-template-columns: 1fr 1fr; column-gap: 20px; }
}
@media (max-width: 700px) {
  .topbar-shell, main { width: min(100% - 24px, 1500px); }
  .topbar-shell { grid-template-columns: 1fr auto; }
  .brand strong { font-size: 13px; }
  .current-area { display: none; }
  .workspace-nav { top: 74px; width: calc(100% - 24px); margin-top: 10px; }
  .page-head { min-height: auto; padding: 30px 0; display: grid; }
  .page-head h1 { font-size: 28px; }
  .head-total { padding-left: 15px; }
  .page-head-side { justify-content: space-between; }
  .plan-dates { grid-template-columns: 1fr; }
  .ledger-head { align-items: flex-start; }
  .form-grid { grid-template-columns: 1fr 1fr; }
  .form-grid .wide { grid-column: span 2; }
  .form-footer { align-items: stretch; flex-direction: column; }
}
@media (max-width: 430px) {
  .page-head-side { align-items: stretch; flex-direction: column; }
  .head-total { min-width: 0; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .wide { grid-column: auto; }
  .ledger-head { display: grid; }
}
