/* App interface. Tokens match the Complete Guide to SDP Spending Plan Tool. */
:root {
  --bg: #f4f7f4; --surface: #ffffff; --surface-2: #f8faf8;
  --ink: #2f3b40; --heading: #0f172a; --muted: #5d6a70;
  --line: #e1e7e2; --line-strong: #c8d2ca;
  --brand: #2ec469; --brand-dark: #0e2713; --brand-dark-hover: #1d4426;
  --accent: #15803d; --accent-hover: #0e2713; --accent-soft: #e7f8ee; --accent-line: #a6e3bd;
  --ok: #1d7344; --ok-soft: #e6f4eb; --warn: #8a5300; --warn-soft: #fdf3e1; --danger: #b0261d; --danger-soft: #fcebea; --info-soft: #eef2f7;
  --radius: 12px; --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(14, 39, 19, .05), 0 2px 8px rgba(14, 39, 19, .04);
  --font: "Poppins", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "DM Serif Display", Georgia, "Times New Roman", serif;
  --ui-scale: 1;
}
* { box-sizing: border-box; }
html { font-size: calc(16px * var(--ui-scale)); }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); line-height: 1.55; }
a { color: var(--accent); }
h1, h2, h3 { color: var(--heading); margin: 0; }
h1 { font-family: var(--font-display); font-weight: 400; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid #1d64d8; outline-offset: 2px; border-radius: 4px; }
.skip { position: absolute; left: -999px; top: 8px; background: #fff; padding: 8px 14px; z-index: 100; border-radius: 8px; }
.skip:focus { left: 8px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.ico { flex: none; }

/* Header */
.site-header { background: #fff; border-top: 4.67px solid var(--brand); border-bottom: 1px solid var(--line); position: sticky; top: env(safe-area-inset-top, 0px); z-index: 30; }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 31; background: #fff; }
.site-header .bar { max-width: 1320px; margin: 0 auto; padding: 10px 20px; display: flex; align-items: center; gap: 16px; }
.brand { display: flex; align-items: center; gap: 14px; }
.brand a { display: flex; text-decoration: none; color: inherit; }
.brand .brand-name { flex-direction: column; }
.brand img { width: 56px; height: 56px; }
.brand .t1 { font-family: var(--font-display); font-size: 1.35rem; color: var(--heading); line-height: 1.1; }
.brand .t2 { font-size: .78rem; color: var(--muted); }
.brand .sep { width: 1px; height: 40px; background: var(--line); }
.hdr-right { margin-left: auto; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.lang-pick { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 20px; padding: 0 4px 0 10px; background: #fff; color: var(--accent); }
.lang-pick select { border: 0; min-height: 34px; padding: 4px 6px; width: auto; background: transparent; color: var(--heading); font-size: .88rem; cursor: pointer; }
.lang-pick select:focus { outline: none; }
.lang-pick:focus-within { outline: 3px solid #1d64d8; outline-offset: 2px; }
.save-status { font-size: .85rem; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 20px; background: var(--surface-2); }
.save-status.saved { color: var(--ok); background: var(--ok-soft); }
.save-status.saving { color: var(--warn); background: var(--warn-soft); }
.save-status.error { color: var(--danger); background: var(--danger-soft); }
.textsize { display: inline-flex; border: 1px solid var(--line); border-radius: 20px; overflow: hidden; }
.textsize button { border: 0; background: #fff; padding: 4px 10px; cursor: pointer; min-height: 34px; }
.textsize button + button { border-left: 1px solid var(--line); }

/* Step tabs */
.steps { background: #fff; border-bottom: 1px solid var(--line); }
.steps ol { max-width: 1320px; margin: 0 auto; padding: 0 20px; list-style: none; display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.steps a { display: flex; align-items: center; gap: 10px; padding: 12px 6px; text-decoration: none; color: var(--muted); border-bottom: 3px solid var(--line); font-size: .92rem; }
.steps a .n { width: 26px; height: 26px; border-radius: 50%; border: 1.5px solid var(--line-strong); display: grid; place-items: center; font-size: .8rem; flex: none; }
.steps a[aria-current="page"] { color: var(--heading); border-bottom-color: var(--brand); font-weight: 600; }
.steps a[aria-current="page"] .n { background: var(--brand); border-color: var(--brand); color: #fff; }

/* Layout */
main { max-width: 1320px; margin: 0 auto; padding: 28px 20px 80px; }
.narrow { max-width: 860px; margin: 0 auto; }
.page-title { font-size: 2.6rem; margin-bottom: 6px; }
.lead { color: var(--muted); font-size: 1.08rem; margin: 0 0 22px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px 22px; margin-bottom: 16px; }
.card h2 { font-size: 1.1rem; font-weight: 600; margin-bottom: 10px; }
.card h3 { font-size: 1rem; font-weight: 600; }
.muted { color: var(--muted); }
.small { font-size: .86rem; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 18px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.spacer { flex: 1; }
hr { border: 0; border-top: 1px solid var(--line); margin: 18px 0; }

/* Hero (home) */
.hero-home { text-align: center; padding: 10px 0 18px; }
.hero-home img { width: 100px; }
.hero-home h1 { font-size: 3.4rem; margin: 8px 0 4px; }
.choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; margin: 20px 0 30px; }
.choice { text-align: left; background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 22px; box-shadow: var(--shadow); cursor: pointer; transition: border-color .15s, transform .15s; }
.choice:hover { border-color: var(--accent-line); transform: translateY(-1px); }
.choice .choice-icon { width: 46px; height: 46px; border-radius: 14px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; margin-bottom: 14px; }
.choice h2 { font-family: var(--font-display); font-weight: 400; font-size: 1.45rem; margin-bottom: 6px; }
.choice p { margin: 0; color: var(--muted); font-size: .92rem; }
.choice.selected { border: 2px solid var(--brand); background: var(--accent-soft); }

/* Forms */
label.f { display: block; font-weight: 500; font-size: .92rem; margin-bottom: 4px; color: var(--heading); }
.hint { font-size: .82rem; color: var(--muted); margin: -2px 0 6px; }
input[type=text], input[type=date], input[type=search], input[type=time], input[type=email], select, textarea {
  width: 100%; border: 1px solid var(--line-strong); border-radius: 10px; padding: 10px 12px; background: #fff; min-height: 44px;
}
textarea { min-height: 96px; resize: vertical; line-height: 1.5; }
textarea.short { min-height: 64px; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); outline: 2px solid var(--accent-line); outline-offset: 0; }
input[type=color] { width: 44px; height: 36px; border: 1px solid var(--line-strong); border-radius: 8px; padding: 2px; background: #fff; cursor: pointer; }
.check { display: flex; gap: 10px; align-items: flex-start; padding: 6px 0; cursor: pointer; }
.check input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--accent); flex: none; }
.radios { display: flex; flex-wrap: wrap; gap: 8px; }
.radios label { display: inline-flex; gap: 8px; align-items: center; border: 1px solid var(--line-strong); border-radius: 30px; padding: 8px 14px; cursor: pointer; background: #fff; min-height: 44px; }
.radios input { accent-color: var(--accent); width: 18px; height: 18px; }
.radios label:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); font-weight: 500; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--line-strong); background: #fff; color: var(--heading); padding: 9px 16px; border-radius: 10px; cursor: pointer; font-weight: 500; min-height: 44px; text-decoration: none; font-size: .95rem; }
.btn:hover { border-color: var(--accent); }
.btn.primary { background: var(--brand-dark); border-color: var(--brand-dark); color: #fff; }
.btn.primary:hover { background: var(--brand-dark-hover); }
.btn.green { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.ghost { border-color: transparent; background: transparent; color: var(--accent); }
.btn.ghost:hover { background: var(--accent-soft); }
.btn.danger { color: var(--danger); }
.btn.danger:hover { border-color: var(--danger); background: var(--danger-soft); }
.btn.sm { padding: 5px 11px; min-height: 36px; font-size: .86rem; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.icon-btn { border: 1px solid transparent; background: transparent; border-radius: 8px; width: 36px; height: 36px; display: inline-grid; place-items: center; cursor: pointer; color: var(--muted); }
.icon-btn:hover { background: var(--surface-2); border-color: var(--line); color: var(--heading); }

/* Plans list */
.plan-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; }
.plan-card { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 16px; box-shadow: var(--shadow); display: flex; gap: 14px; }
.plan-card .thumb { width: 64px; height: 64px; border-radius: 50%; background: var(--accent-soft); overflow: hidden; flex: none; display: grid; place-items: center; color: var(--accent); }
.plan-card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.plan-card h3 { font-size: 1.05rem; }
.home-note { margin-top: 18px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 18px; font-size: .9rem; max-width: 70ch; }
.home-note h3 { font-size: .98rem; font-weight: 600; margin-bottom: 6px; }
.home-note p { margin: 0 0 6px; color: var(--ink); }
.home-note p:last-child { margin-bottom: 0; color: var(--muted); }
.privacy-note { display: flex; align-items: center; gap: 8px; margin-top: 18px; font-size: .86rem; color: var(--muted); }
.privacy-note .ico { color: var(--accent); }
.badge { display: inline-block; font-size: .74rem; padding: 2px 9px; border-radius: 20px; background: var(--info-soft); color: var(--heading); font-weight: 500; }
.badge.draft { background: var(--warn-soft); color: var(--warn); }
.badge.final { background: var(--ok-soft); color: var(--ok); }
table.list { width: 100%; border-collapse: collapse; background: #fff; border-radius: 12px; overflow: hidden; }
table.list th, table.list td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); font-size: .92rem; }
table.list th { background: var(--surface-2); font-weight: 600; }
table.list th button { border: 0; background: none; font-weight: 600; cursor: pointer; padding: 0; }

/* Builder */
.builder { display: grid; grid-template-columns: 280px 1fr; gap: 24px; align-items: start; }
.side { position: sticky; top: 150px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; max-height: calc(100vh - 170px); overflow: auto; }
.side h2 { font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 6px 8px 8px; font-weight: 600; }
.sec-link { display: flex; align-items: center; gap: 10px; padding: 8px 8px; border-radius: 10px; text-decoration: none; color: var(--ink); font-size: .92rem; }
.sec-link:hover { background: var(--surface-2); }
.sec-link[aria-current="page"] { background: var(--accent-soft); color: var(--heading); font-weight: 600; }
.sec-link .ico { color: var(--accent); }
.sec-link.off { opacity: .55; }
.sec-link .prog { margin-left: auto; font-size: .72rem; color: var(--muted); white-space: nowrap; }
.sec-link .prog.has { color: var(--ok); }
.sec-tools { display: flex; gap: 2px; margin-left: auto; }
.side-actions { border-top: 1px solid var(--line); margin-top: 10px; padding-top: 10px; display: grid; gap: 6px; }

.sec-header { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 8px; }
.sec-header .big-ico { width: 54px; height: 54px; border-radius: 16px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; flex: none; }
.sec-header h1 { font-size: 2.1rem; }
.title-input { font-family: var(--font-display); font-size: 2rem; border: 1px dashed transparent !important; background: transparent !important; padding: 0 6px !important; min-height: 0 !important; color: var(--heading); }
.title-input:hover, .title-input:focus { border-color: var(--line-strong) !important; background: #fff !important; }
.q-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 14px; box-shadow: var(--shadow); }
.q-card.answered { border-left: 4px solid var(--brand); }
.q-card h3 { font-size: 1.05rem; font-weight: 600; margin-bottom: 4px; }
.q-head { display: flex; align-items: flex-start; gap: 12px; justify-content: space-between; }
.q-head > label:first-child { flex: 1; min-width: 0; }
.inc-toggle { display: inline-flex; align-items: center; gap: 6px; font-size: .82rem; font-weight: 500; color: var(--muted); white-space: nowrap; cursor: pointer; padding: 4px 8px; border-radius: 8px; }
.inc-toggle:hover { background: var(--surface-2); }
.inc-toggle input { width: 18px; height: 18px; accent-color: var(--accent); margin: 0; }
.q-card.excluded { background: var(--surface-2); border-style: dashed; box-shadow: none; padding-block: 12px; }
.q-card.excluded h3 { color: var(--muted); font-weight: 500; }
.blk.excluded { opacity: .6; border-style: dashed; }
.q-card .doc-label { font-size: .78rem; color: var(--muted); margin-bottom: 8px; }
.q-card details { margin: 2px 0 8px; font-size: .88rem; }
.q-card details summary { cursor: pointer; color: var(--accent); }
.q-card details .ex { background: var(--surface-2); border-radius: 8px; padding: 8px 12px; margin-top: 6px; white-space: pre-line; }
.q-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.attached { margin-top: 12px; display: grid; gap: 10px; }
.blk { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; background: var(--surface-2); }
.blk-top { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-size: .85rem; color: var(--muted); font-weight: 500; }
.blk-top .tools { margin-left: auto; display: flex; gap: 2px; }
.add-bar { display: flex; flex-wrap: wrap; gap: 6px; padding: 14px; border: 2px dashed var(--line-strong); border-radius: var(--radius); background: #fff; align-items: center; }
.add-bar .lbl { font-weight: 600; margin-right: 6px; font-size: .9rem; }
.photo-strip { display: flex; flex-wrap: wrap; gap: 10px; }
.photo-tile { width: 128px; }
.photo-tile .im { width: 128px; height: 96px; border-radius: 8px; overflow: hidden; background: #ddd; position: relative; }
.photo-tile img { width: 100%; height: 100%; object-fit: cover; }
.photo-tile input { font-size: .78rem; padding: 4px 6px; min-height: 30px; margin-top: 4px; border-radius: 6px; }
.photo-tile .ptools { position: absolute; top: 4px; right: 4px; display: flex; gap: 3px; }
.photo-tile .ptools button { width: 26px; height: 26px; border-radius: 6px; border: 0; background: rgba(255,255,255,.92); cursor: pointer; display: grid; place-items: center; }
.list-edit .li { display: flex; gap: 6px; margin-bottom: 6px; align-items: center; }
.list-edit .li input[type=text] { min-height: 38px; padding: 7px 10px; }
.table-edit { overflow-x: auto; }
.table-edit table { border-collapse: collapse; width: 100%; }
.table-edit td { padding: 2px; }
.table-edit input { min-height: 36px; padding: 6px 8px; border-radius: 6px; }
.table-edit tr:first-child input { font-weight: 600; background: var(--accent-soft); }
.sec-nav { display: flex; justify-content: space-between; margin-top: 24px; }

/* Goals / supports / schedule editors */
.goal-ed { border-left: 4px solid var(--brand); }
.goal-ed .gh { display: flex; align-items: center; gap: 10px; }
.goal-ed .gnum { width: 32px; height: 32px; border-radius: 50%; background: var(--brand-dark); color: #fff; display: grid; place-items: center; font-weight: 600; flex: none; }
.goal-ed .gh input { font-weight: 600; font-size: 1.05rem; }
.chipset { display: flex; flex-wrap: wrap; gap: 6px; }
.chipset label { display: inline-flex; gap: 6px; align-items: center; border: 1px solid var(--line-strong); border-radius: 20px; padding: 4px 12px; cursor: pointer; font-size: .88rem; background: #fff; }
.chipset label:has(input:checked) { background: var(--accent-soft); border-color: var(--accent); }
.chipset input { accent-color: var(--accent); }
.circle-ed { display: grid; grid-template-columns: minmax(300px, 1fr) 1fr; gap: 20px; align-items: start; }
.circle-ed .diagram { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; --primary: #1f7a46; }
.circle-ed .person { cursor: grab; outline: none; }
.circle-ed .person:focus rect, .circle-ed .person:focus circle { stroke: #1d64d8 !important; stroke-width: 4 !important; }
.circle-ed .person.dragging { cursor: grabbing; opacity: .8; }
.person-row { display: grid; grid-template-columns: 1fr 1fr 1fr auto; gap: 6px; align-items: center; margin-bottom: 6px; }
.person-row input, .person-row select { min-height: 38px; padding: 6px 9px; font-size: .9rem; }
.ring-row { display: flex; gap: 8px; align-items: center; margin-bottom: 6px; }
.sched-grid { overflow-x: auto; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; --primary: #1f7a46; }
.sched-grid .cal { min-width: 720px; font-size: 11px; }
.sched-grid { max-height: 620px; overflow: auto; padding-top: 0; }
.sched-grid .cal-head { position: sticky; top: 0; z-index: 4; }
.sched-grid .cal-head div:first-child { background: #fff; }
.sched-grid .cal-act { cursor: grab; touch-action: none; user-select: none; }
.sched-grid .cal-act:focus-visible { outline: 3px solid #1d64d8; outline-offset: 1px; z-index: 3; }
.sched-grid .cal-act .rs { position: absolute; left: 0; right: 0; height: 7px; cursor: ns-resize; }
.sched-grid .cal-act .rs-top { top: -1px; }
.sched-grid .cal-act .rs-bot { bottom: -1px; }
.sched-grid .cal-act:hover .rs-bot::after, .sched-grid .cal-act:focus .rs-bot::after { content: ''; position: absolute; left: 35%; right: 35%; bottom: 2px; height: 3px; border-radius: 2px; background: rgba(255,255,255,.85); }
.sched-grid .cal-act:hover .rs-top::after, .sched-grid .cal-act:focus .rs-top::after { content: ''; position: absolute; left: 35%; right: 35%; top: 2px; height: 3px; border-radius: 2px; background: rgba(255,255,255,.85); }
.sched-grid .cal-act.resizing { opacity: .9; z-index: 5; box-shadow: 0 4px 12px rgba(0,0,0,.25); }
.sched-grid .cal-act.dragging { cursor: grabbing; opacity: .85; z-index: 5; box-shadow: 0 6px 16px rgba(0,0,0,.3); }
.ctx-menu { position: fixed; z-index: 90; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.18); padding: 6px; min-width: 200px; display: grid; }
.ctx-menu .ctx-title { font-size: .78rem; color: var(--muted); padding: 4px 10px 6px; border-bottom: 1px solid var(--line); margin-bottom: 4px; font-weight: 600; }
.ctx-menu button { border: 0; background: transparent; text-align: left; padding: 8px 10px; border-radius: 6px; cursor: pointer; font-size: .9rem; }
.ctx-menu button:hover, .ctx-menu button:focus { background: var(--surface-2); outline: none; }
.ctx-menu button.danger { color: var(--danger); }
.ctx-menu button.danger:hover, .ctx-menu button.danger:focus { background: var(--danger-soft); }
.sched-grid .cal-day { cursor: copy; }
.totals { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; }
.total-box { background: var(--accent-soft); border-radius: 12px; padding: 12px 14px; }
.total-box .v { font-size: 1.5rem; font-weight: 600; color: var(--heading); }
.total-box.warn { background: var(--danger-soft); }
.act-row { display: grid; grid-template-columns: 18px 1.4fr 1fr 1.6fr .8fr .8fr auto; gap: 8px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: .9rem; }
.swatch { width: 18px; height: 18px; border-radius: 5px; }
.days { display: flex; gap: 3px; flex-wrap: wrap; }
.days label { width: 34px; text-align: center; border: 1px solid var(--line-strong); border-radius: 6px; font-size: .75rem; padding: 3px 0; cursor: pointer; }
.days label:has(input:checked) { background: var(--brand-dark); color: #fff; border-color: var(--brand-dark); }
.days input { position: absolute; opacity: 0; width: 1px; height: 1px; }

/* Design + preview */
.designer { display: grid; grid-template-columns: 390px 1fr; gap: 22px; align-items: start; }
.panel { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; position: sticky; top: 150px; max-height: calc(100vh - 170px); overflow: auto; }
.panel details { border-bottom: 1px solid var(--line); padding: 10px 0; }
.panel details:last-child { border-bottom: 0; }
.panel summary { cursor: pointer; font-weight: 600; color: var(--heading); list-style: none; display: flex; align-items: center; gap: 8px; }
.panel summary::-webkit-details-marker { display: none; }
.panel summary::after { content: '▸'; margin-left: auto; color: var(--muted); transition: transform .15s; }
.panel details[open] summary::after { transform: rotate(90deg); }
.panel .body { padding-top: 10px; display: grid; gap: 12px; }
.mode-toggle { display: grid; grid-template-columns: 1fr 1fr; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 4px; margin-bottom: 12px; }
.mode-toggle button { border: 0; background: transparent; border-radius: 9px; padding: 9px; cursor: pointer; font-weight: 500; }
.mode-toggle button[aria-pressed="true"] { background: #fff; box-shadow: var(--shadow); color: var(--accent); font-weight: 600; }
.tpl-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tpl-btn { border: 2px solid var(--line); border-radius: 10px; background: #fff; padding: 8px; cursor: pointer; text-align: left; font-size: .82rem; display: flex; flex-direction: column; }
.tpl-btn .sw { height: 46px; border-radius: 6px; margin-top: auto; flex: none; display: flex; overflow: hidden; }
.tpl-btn .about { margin-bottom: 8px; }
.tpl-btn .sw span { flex: 1; }
.tpl-btn[aria-pressed="true"] { border-color: var(--brand); background: var(--accent-soft); }
.tpl-btn strong { display: block; font-size: .95rem; font-weight: 700; color: var(--heading); margin-bottom: 2px; }
.tpl-btn .about { display: block; font-weight: 500; color: var(--ink); line-height: 1.35; }
.pal-row { display: flex; flex-wrap: wrap; gap: 8px; }
.pal-btn { border: 2px solid var(--line); border-radius: 10px; padding: 4px; background: #fff; cursor: pointer; display: flex; gap: 2px; }
.pal-btn span { width: 16px; height: 26px; border-radius: 4px; }
.pal-btn[aria-pressed="true"] { border-color: var(--heading); }
.preview-area { background: #dfe5e0; border-radius: var(--radius); padding: 20px; min-height: 600px; }
.pages { display: flex; flex-direction: column; align-items: center; gap: 18px; }
.page-wrap { position: relative; box-shadow: 0 4px 18px rgba(0,0,0,.18); background: #fff; flex: none; }
.page-wrap .page { transform-origin: top left; position: absolute; top: 0; left: 0; }
.pv-edit { position: absolute; z-index: 3; display: inline-flex; align-items: center; gap: 5px; background: var(--brand-dark); color: #fff; text-decoration: none; font-size: .78rem; font-weight: 600; padding: 5px 11px; border-radius: 20px; box-shadow: 0 2px 8px rgba(0,0,0,.2); opacity: .9; max-width: 70%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pv-edit:hover, .pv-edit:focus-visible { opacity: 1; background: var(--accent); }
.pv-edit-cont { background: rgba(14,39,19,.75); font-weight: 500; }
.page-num-tag { position: absolute; left: -46px; top: 0; font-size: .75rem; color: var(--muted); }
.pages.grid { flex-direction: row; flex-wrap: wrap; justify-content: center; }
.preview-toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.notice { border-radius: 10px; padding: 10px 14px; font-size: .9rem; margin-bottom: 12px; }
.notice.warn { background: var(--warn-soft); color: var(--warn); }
.notice.info { background: var(--info-soft); }
.notice.ok { background: var(--ok-soft); color: var(--ok); }
.adv-sec { border: 1px solid var(--line); border-radius: 10px; padding: 10px; margin-bottom: 8px; }
.adv-sec h4 { margin: 0 0 8px; font-size: .9rem; display: flex; align-items: center; gap: 6px; }
.adv-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; font-size: .85rem; }
.adv-grid select, .adv-grid input[type=text] { min-height: 36px; padding: 5px 8px; font-size: .85rem; }

/* Modal */
.modal-back { position: fixed; inset: 0; background: rgba(15, 23, 42, .45); z-index: 60; display: grid; place-items: center; padding: 20px; }
.modal { background: #fff; border-radius: 16px; width: min(860px, 100%); max-height: calc(100vh - 40px); overflow: auto; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.modal header { display: flex; align-items: center; padding: 18px 22px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: #fff; z-index: 2; }
.modal header h2 { font-family: var(--font-display); font-weight: 400; font-size: 1.6rem; }
.modal .mbody { padding: 18px 22px; }
.modal footer { padding: 14px 22px; border-top: 1px solid var(--line); display: flex; gap: 8px; justify-content: flex-end; position: sticky; bottom: 0; background: #fff; }
.lib-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
.lib-item { border: 2px solid var(--line); border-radius: 10px; padding: 4px; background: #fff; cursor: pointer; text-align: left; }
.lib-item img { width: 100%; height: 96px; object-fit: cover; border-radius: 6px; display: block; }
.lib-item span { font-size: .75rem; display: block; padding: 3px 2px 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lib-item[aria-pressed="true"] { border-color: var(--brand); background: var(--accent-soft); }
.dropzone { border: 2px dashed var(--line-strong); border-radius: 12px; padding: 18px; text-align: center; display: block; cursor: pointer; background: var(--surface-2); }
.dropzone input { position: absolute; opacity: 0; width: 1px; }
.dropzone.over { border-color: var(--accent); background: var(--accent-soft); }
kbd { font: inherit; font-size: .85em; border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: 4px; padding: 0 4px; background: #fff; }
.crop-stage { width: 100%; max-width: 420px; margin: 0 auto; border-radius: 10px; overflow: hidden; background: #eee; }
.crop-stage img { width: 100%; height: 100%; object-fit: cover; display: block; }
.diff { display: grid; grid-template-columns: 26px 1fr 1fr; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: .9rem; }
.diff .was { color: var(--muted); }
.diff .now { background: var(--ok-soft); border-radius: 8px; padding: 4px 8px; }
.diff mark { background: #c5f0d4; }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--brand-dark); color: #fff; padding: 12px 20px; border-radius: 12px; z-index: 80; box-shadow: 0 8px 28px rgba(0,0,0,.25); max-width: 90vw; }
.share-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.share-card { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 18px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 8px; }
.share-card .choice-icon { width: 42px; height: 42px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; }
.share-card h3 { font-size: 1.05rem; font-weight: 600; }
.share-card p { margin: 0; color: var(--muted); font-size: .9rem; flex: 1; }
.wizard-steps { display: flex; gap: 6px; margin-bottom: 18px; }
.wizard-steps span { flex: 1; height: 6px; border-radius: 4px; background: var(--line); }
.wizard-steps span.on { background: var(--brand); }
.example-box { background: var(--surface-2); border-left: 3px solid var(--brand); padding: 10px 14px; border-radius: 0 8px 8px 0; font-style: italic; margin-top: 10px; font-size: .92rem; }
pre.json { background: #0f172a; color: #d6f5e1; padding: 14px; border-radius: 10px; font-size: .78rem; overflow: auto; max-height: 300px; }

@media (max-width: 1000px) {
  .builder, .designer, .circle-ed { grid-template-columns: 1fr; }
  .side, .panel { position: static; max-height: none; }
  .steps ol { grid-template-columns: repeat(2, 1fr); }
  .act-row { grid-template-columns: 18px 1fr 1fr auto; }
  .act-row .hide-sm { display: none; }
}
@media (max-width: 640px) {
  .grid2, .grid3 { grid-template-columns: 1fr; }
  .brand .sep, .brand .t2, .textsize { display: none; }
  .page-title, .hero-home h1 { font-size: 2.1rem; }
  main { padding: 18px 16px 60px; }
  .person-row { grid-template-columns: 1fr 1fr; }
}

/* Save and Share: file names, then feedback and donations (the same as the Spending Plan Tool's last page) */
.file-name-card { margin: 0 0 18px; max-width: 640px; }
.file-name-card input { max-width: 260px; }
.file-name-card p { margin: 10px 0 0; }
.file-name-card .file-name { margin-top: 2px; font-weight: 600; color: var(--heading); word-break: break-word; }
.optional { color: var(--muted); font-weight: 400; }
.alert { display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; margin: 12px 0; }
.alert.ok { background: var(--ok-soft); border-color: #bfe0cb; }
.alert.ok > .ico { color: var(--ok); flex: none; margin-top: 2px; }
.alert.warn { background: var(--warn-soft); border-color: #f0d9ae; display: block; }
.alert a { color: var(--accent); font-weight: 600; }
.community { margin-top: 36px; padding: 24px 28px; border-radius: var(--radius); background: var(--accent-soft); border: 1px solid var(--accent-line); text-align: center; }
.community h2 { font-size: 1.3rem; margin: 0 0 8px; }
.community > p { margin: 0 auto 16px; max-width: 60ch; }
.community-actions { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; }
.community-actions .btn { min-width: 180px; }
.feedback-form { text-align: left; max-width: 640px; margin: 0 auto; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 20px; }
.feedback-form .hint { margin: 4px 0 0; }
.fb-field { margin: 16px 0 0; border: 0; padding: 0; min-width: 0; }
.fb-field legend { padding: 0; font-weight: 500; font-size: .92rem; color: var(--heading); margin-bottom: 6px; }
.feedback-form .community-actions { justify-content: flex-start; margin-top: 12px; }
.segmented { display: inline-flex; flex-wrap: wrap; border: 1.5px solid var(--line-strong); border-radius: 12px; overflow: hidden; }
.seg { position: relative; }
.seg input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.seg span { display: block; padding: 10px 20px; font-weight: 600; cursor: pointer; }
.seg + .seg span { border-left: 1.5px solid var(--line-strong); }
.seg input:checked + span { background: var(--brand-dark); color: #fff; }
.seg input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: -3px; }
.fb-alt { margin: 12px 0 0; }
.fb-donate { margin-top: 16px; }
.feedback-thanks { max-width: 640px; margin: 0 auto 16px; text-align: left; }
.fb-trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
@media (max-width: 720px) { .community { padding: 20px 16px; } .feedback-form .grid2 { grid-template-columns: 1fr; } }

/* Save Final, at the top and bottom of Preview and Proof */
.final-slot { display: inline-flex; align-items: center; gap: 6px; }
.final-badge { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: var(--ok-soft); color: var(--ok); font-weight: 600; font-size: .9rem; border: 1px solid #bfe0cb; }
.final-bottom { display: flex; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; gap: 14px; margin-top: 22px; }
.final-ask { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.final-bottom p { margin: 0; }
.final-bottom .btn.green { min-height: 44px; padding: 9px 22px; font-size: .95rem; }
.pv-next { display: inline-flex; align-items: center; gap: 8px; margin-left: auto; }
.design-bottom { display: flex; justify-content: flex-end; margin-top: 22px; }
