:root {
  --ink: #121212;
  --orange: #f04a12;
  --orange-dark: #c83100;
  --blue: #0d4d91;
  --paper: #fffdf9;
  --cream: #f5efe5;
  --line: #d8d2c7;
  --muted: #666158;
  --success: #137f4a;
  --danger: #aa2519;
  font-family: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", system-ui, sans-serif;
  color: var(--ink);
  background: var(--paper);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); line-height: 1.65; }
a { color: inherit; }
button, input { font: inherit; }
.skip-link { position: absolute; left: 1rem; top: -4rem; background: var(--ink); color: #fff; padding: .6rem 1rem; z-index: 10; }
.skip-link:focus { top: 1rem; }
.site-header { min-height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .75rem max(5vw, 1.25rem); border-bottom: 1px solid rgba(0,0,0,.09); background: rgba(255,253,249,.95); position: sticky; top: 0; z-index: 4; backdrop-filter: blur(12px); }
.brand { display: inline-flex; align-items: center; gap: .65rem; text-decoration: none; }
.brand-mark { display: inline-grid; place-items: center; background: var(--orange); color: #fff; width: 2.2rem; height: 2.2rem; font-size: 1.5rem; font-weight: 900; line-height: 1; }
.brand strong { display: block; letter-spacing: .08em; }
.brand small { display: block; color: var(--muted); font-size: .75rem; }
nav { display: flex; gap: 1.2rem; align-items: center; }
nav a { text-decoration: none; font-size: .9rem; font-weight: 700; }
.header-cta { color: #fff; background: var(--ink); padding: .55rem .85rem; }
.hero { min-height: min(700px, calc(100vh - 76px)); overflow: hidden; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(360px, .9fr); align-items: stretch; background: linear-gradient(122deg, #cfe6ff 0%, #91bde9 58%, #204d7f 100%); }
.hero-copy { align-self: center; max-width: 750px; padding: clamp(3rem, 7vw, 7rem) max(7vw, 1.25rem); }
.eyebrow { font-size: .77rem; letter-spacing: .14em; font-weight: 900; color: var(--orange); margin: 0 0 .45rem; }
.hero h1 { font-size: clamp(2.9rem, 5vw, 5.6rem); letter-spacing: -.06em; line-height: 1.08; margin: 0 0 1.25rem; }
.hero h1 span { color: var(--orange); }
.hero-lead { max-width: 31rem; font-weight: 700; font-size: 1.1rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin: 2rem 0 1.25rem; }
.button { appearance: none; border: 2px solid var(--ink); cursor: pointer; display: inline-flex; justify-content: center; align-items: center; min-height: 46px; padding: .65rem 1.15rem; text-decoration: none; font-weight: 900; transition: transform .15s, background .15s; }
.button:hover { transform: translateY(-2px); }
.button.primary { background: var(--orange); border-color: var(--orange); color: #fff; }
.button.primary:hover { background: var(--orange-dark); border-color: var(--orange-dark); }
.button.ghost { background: transparent; }
.trust-line { font-size: .9rem; font-weight: 800; }
.trust-line span { color: var(--success); font-size: 1.1rem; }
.hero-image-wrap { position: relative; min-height: 480px; overflow: hidden; }
.hero-image-wrap::after { content: ""; position: absolute; inset: auto 0 0; height: 36%; background: linear-gradient(transparent, rgba(0,0,0,.6)); }
.hero-image-wrap img { width: 100%; height: 100%; object-fit: cover; object-position: 56% center; display: block; }
.account-section { color: #fff; background: #0d243c; padding: clamp(3.5rem, 8vw, 7.5rem) max(7vw, 1.25rem); }
.section-heading { max-width: 630px; margin: 0 auto 2.3rem; text-align: center; }
.section-heading h2 { font-size: clamp(2rem, 4vw, 3.5rem); line-height: 1.1; margin: 0 0 .8rem; letter-spacing: -.04em; }
.section-heading.light .eyebrow { color: #fa9b78; }
.section-heading p:last-child { margin: 0; opacity: .82; }
.account-card { max-width: 950px; margin: 0 auto; background: #fff; color: var(--ink); box-shadow: 10px 10px 0 var(--orange); }
.account-row { display: grid; grid-template-columns: 120px 1fr auto; gap: 1.25rem; padding: 1.15rem 1.35rem; align-items: center; border-bottom: 1px solid var(--line); }
.account-row > span { color: var(--muted); font-weight: 800; }
.account-row strong { overflow-wrap: anywhere; font-size: 1.02rem; }
.account-number-row { background: var(--orange); color: #fff; border: 0; }
.account-number-row > span { color: #fff; opacity: .86; }
.account-number-row strong { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: clamp(1.25rem, 3vw, 2rem); letter-spacing: .08em; }
.copy-button { border: 1px solid var(--ink); background: #fff; padding: .4rem .6rem; cursor: pointer; font-weight: 800; white-space: nowrap; }
.copy-button.inverse { background: #fff; border-color: #fff; }
.account-meta { padding: 1rem 1.35rem; background: #f4f0e9; color: #34302a; font-size: .9rem; }
.account-meta p { margin: .25rem 0; }
.notice { max-width: 950px; margin: 2.7rem auto 0; padding: 1.2rem 1.4rem; border-left: 5px solid #ffc349; background: rgba(255,255,255,.08); }
.notice p { margin: .35rem 0 0; }
.process-section, .legal-section { padding: clamp(3.5rem, 8vw, 7.5rem) max(7vw, 1.25rem); }
.process-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; max-width: 1150px; margin: 0 auto; padding: 0; list-style: none; }
.process-grid li { border-top: 4px solid var(--ink); padding: 1rem 0; display: grid; grid-template-columns: auto 1fr; gap: .75rem; }
.process-grid li > span { color: var(--orange); font-weight: 900; font-size: 1.45rem; }
.process-grid h3 { margin: 0 0 .25rem; }
.process-grid p { margin: 0; color: var(--muted); font-size: .92rem; }
.form-section { padding: clamp(3.5rem, 8vw, 7.5rem) max(7vw, 1.25rem); display: grid; grid-template-columns: minmax(270px, .65fr) minmax(0, 1.15fr); gap: clamp(2rem, 6vw, 7rem); background: var(--cream); }
.form-intro { align-self: start; position: sticky; top: 110px; }
.form-intro h2 { font-size: clamp(2.1rem, 3.9vw, 4rem); line-height: 1.08; margin: .2rem 0 1rem; letter-spacing: -.05em; }
.security-points { display: grid; gap: 1rem; margin-top: 2.2rem; }
.security-points p { padding: 1rem; background: #fff; border-left: 4px solid var(--orange); margin: 0; font-size: .9rem; }
.donation-form { background: #fff; padding: clamp(1.15rem, 4vw, 3rem); box-shadow: 8px 8px 0 rgba(0,0,0,.13); }
fieldset { border: 0; border-top: 1px solid var(--line); padding: 1.55rem 0; margin: 0; }
fieldset:first-of-type { border-top: 0; padding-top: 0; }
legend { font-size: 1.25rem; font-weight: 900; padding: 0; margin-bottom: 1rem; }
legend span { display: inline-grid; place-items: center; margin-right: .45rem; width: 1.55rem; height: 1.55rem; font-size: .82rem; color: #fff; background: var(--orange); }
label { display: block; font-weight: 800; font-size: .93rem; }
input, select, textarea { width: 100%; border: 1px solid #aaa298; background: #fff; padding: .7rem .75rem; color: var(--ink); border-radius: 0; min-height: 45px; }
input:focus, select:focus, textarea:focus { outline: 3px solid rgba(240,74,18,.25); border-color: var(--orange); }
.field-grid { display: grid; gap: 1rem; }
.field-grid.two { grid-template-columns: repeat(2, 1fr); }
.field-grid.three { grid-template-columns: repeat(3, 1fr); }
.field-grid > label + label { margin-top: 0; }
fieldset > label:not(.honeypot) { margin-top: 1rem; }
.required, .conditional { display: inline-block; margin-left: .4rem; font-size: .72rem; vertical-align: middle; }
.required { color: var(--danger); }
.conditional { color: #876117; font-weight: 700; }
small { display: block; font-weight: 500; color: var(--muted); font-size: .78rem; line-height: 1.45; margin-top: .25rem; }
.money-field { display: flex; align-items: stretch; }
.money-field b { display: grid; place-items: center; padding: 0 .55rem; background: var(--ink); color: #fff; font-size: .8rem; }
.money-field input { border-left: 0; }
.donor-type-options, .receipt-options { display: grid; grid-template-columns: repeat(2, 1fr); gap: .75rem; }
.donor-type-options label, .receipt-options label { cursor: pointer; border: 1px solid var(--line); padding: .85rem; display: flex; gap: .55rem; align-items: start; font-size: .88rem; }
.donor-type-options label:has(input:checked), .receipt-options label:has(input:checked) { border-color: var(--orange); box-shadow: inset 0 0 0 1px var(--orange); background: #fff7f2; }
.donor-type-options input, .receipt-options input, .checks input { width: auto; min-height: auto; accent-color: var(--orange); margin-top: .25rem; }
.checks { display: grid; gap: .8rem; }
.checks label { display: flex; align-items: start; gap: .6rem; font-size: .86rem; line-height: 1.55; font-weight: 600; }
.checks label span { flex: 1; }
.business-only[hidden], .individual-only[hidden], [hidden] { display: none !important; }
.honeypot { position: absolute; left: -100vw; opacity: 0; pointer-events: none; }
.submit-area { display: flex; align-items: center; gap: 1rem; border-top: 1px solid var(--line); padding-top: 1.4rem; }
.submit-area p { font-size: .8rem; color: var(--muted); margin: 0; }
.submit-button { min-width: 190px; }
.form-status { padding: .85rem 1rem; margin-bottom: 1.2rem; border-left: 5px solid var(--ink); background: #eeeae3; font-weight: 800; }
.form-status.error { border-color: var(--danger); background: #fff0ee; color: #7c1c13; }
.form-status.success { border-color: var(--success); background: #edfff5; color: #07582e; }
.receipt-note { margin: 0 0 .9rem; padding: .75rem .9rem; background: #f7f3ec; font-size: .84rem; color: #4f493f; }
.legal-section { background: var(--ink); color: #fff; display: grid; grid-template-columns: .55fr 1fr; gap: 3rem; }
.legal-section .eyebrow { color: #fa9b78; }
.legal-section h2 { font-size: clamp(2rem, 4vw, 3.6rem); line-height: 1.1; margin: 0; }
.legal-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; background: #474747; }
.legal-grid article { background: var(--ink); padding: 1.25rem; }
.legal-grid b { color: var(--orange); font-size: 1.2rem; }
.legal-grid h3 { margin: .35rem 0; }
.legal-grid p { color: #d2d2d2; font-size: .87rem; margin: 0; }
.official-link { grid-column: 2; color: #fff; text-decoration: none; font-weight: 800; border-bottom: 2px solid var(--orange); padding-bottom: .35rem; width: fit-content; }
.official-link span { color: var(--orange); }
footer { padding: 2rem max(7vw, 1.25rem); display: flex; align-items: center; justify-content: space-between; gap: 2rem; background: #000; color: #fff; }
footer > div { display: flex; align-items: center; gap: .7rem; }
footer p { margin: 0; font-size: .82rem; color: #cacaca; max-width: 35rem; }
footer nav { gap: 1rem; flex-wrap: wrap; }
footer nav a { color: #fff; font-size: .8rem; }
.legal-page { max-width: 760px; margin: 0 auto; padding: clamp(2rem, 8vw, 6rem) 1.25rem; }
.legal-page h1 { font-size: clamp(2.1rem, 5vw, 4.2rem); line-height: 1.1; margin: 0 0 1.4rem; }

@media (max-width: 850px) {
  .site-header nav a:not(.header-cta) { display: none; }
  .hero, .form-section, .legal-section { grid-template-columns: 1fr; }
  .hero-copy { padding-bottom: 2rem; }
  .hero-image-wrap { min-height: 440px; max-height: 570px; }
  .form-intro { position: static; }
  .process-grid { grid-template-columns: repeat(2, 1fr); }
  .official-link { grid-column: auto; }
}
@media (max-width: 590px) {
  .site-header { padding: .65rem 1rem; }
  .brand small { display: none; }
  .account-row { grid-template-columns: 1fr auto; gap: .35rem .75rem; padding: 1rem; }
  .account-row > span { grid-column: 1 / -1; }
  .account-row strong { font-size: .95rem; }
  .account-number-row strong { font-size: 1.13rem; }
  .field-grid.two, .field-grid.three, .donor-type-options, .receipt-options, .process-grid, .legal-grid { grid-template-columns: 1fr; }
  .submit-area, footer { align-items: stretch; flex-direction: column; }
  .submit-button { width: 100%; }
  .hero-actions .button { flex: 1; }
}

/* Donation back-office */
.admin-body { min-height: 100vh; background: #f1eee8; }
.admin-header { min-height: 72px; display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .8rem max(5vw, 1.25rem); background: var(--ink); color: #fff; }
.admin-header .brand-mark { background: var(--orange); }
.admin-header .brand small { color: #cecece; }
.admin-user { display: flex; gap: .85rem; align-items: center; font-size: .85rem; }
.text-button { border: 0; background: transparent; color: inherit; cursor: pointer; padding: .3rem 0; font-weight: 900; text-decoration: underline; }
.admin-main { max-width: 1500px; margin: 0 auto; padding: clamp(1.25rem, 4vw, 3.5rem) max(4vw, 1rem); }
.auth-card, .request-card { max-width: 520px; margin: 4vh auto; background: #fff; padding: clamp(1.35rem, 4vw, 2.5rem); box-shadow: 8px 8px 0 rgba(0,0,0,.16); }
.auth-card h1, .request-card h1, .workspace-top h1 { line-height: 1.1; margin: .2rem 0 1rem; font-size: clamp(2rem, 4vw, 3.3rem); }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; border-bottom: 1px solid var(--line); margin: 1.7rem 0 1.25rem; }
.auth-tabs button { padding: .7rem; border: 0; cursor: pointer; background: transparent; font-weight: 900; }
.auth-tabs button.active { background: var(--ink); color: #fff; }
.auth-form { display: grid; gap: 1rem; }
.auth-form .button { margin-top: .5rem; }
.hint { color: var(--muted); font-size: .86rem; }
.workspace-top { display: flex; justify-content: space-between; gap: 1rem; align-items: end; margin-bottom: 1.7rem; }
.workspace-top h1 { margin-bottom: .35rem; }
.workspace-top p { margin: 0; }
.workspace-actions { display: flex; gap: .65rem; flex-wrap: wrap; }
.filter-row { display: grid; grid-template-columns: minmax(0, 1fr) 200px; gap: .75rem; margin-bottom: 1rem; }
.admin-grid { display: grid; grid-template-columns: minmax(600px, 1.4fr) minmax(320px, .8fr); gap: 1rem; align-items: start; }
.data-panel, .detail-panel, .accounts-panel { background: #fff; box-shadow: 3px 3px 0 rgba(0,0,0,.12); }
.table-wrap { overflow: auto; max-height: 65vh; }
table { border-collapse: collapse; width: 100%; min-width: 660px; font-size: .87rem; }
th, td { text-align: left; border-bottom: 1px solid var(--line); padding: .8rem .7rem; vertical-align: top; }
th { position: sticky; top: 0; background: #f8f5ef; z-index: 1; font-size: .77rem; letter-spacing: .04em; }
tbody tr[data-id] { cursor: pointer; }
tbody tr[data-id]:hover, tbody tr.selected { background: #fff2ec; }
td small { white-space: nowrap; }
.detail-panel { padding: 1.25rem; position: sticky; top: 90px; min-height: 220px; }
.detail-panel h2, .accounts-panel h2 { margin: 0; font-size: 1.45rem; }
.panel-title { display: flex; justify-content: space-between; align-items: start; gap: .8rem; margin-bottom: 1rem; }
.panel-title .eyebrow { margin-bottom: .15rem; }
.detail-list { margin: 0 0 1rem; }
.detail-list div { padding: .55rem 0; border-bottom: 1px solid var(--line); }
.detail-list dt { font-size: .72rem; font-weight: 900; color: var(--muted); }
.detail-list dd { margin: .1rem 0 0; overflow-wrap: anywhere; font-size: .9rem; }
.backend-form { display: grid; gap: .85rem; border-top: 2px solid var(--ink); padding-top: 1rem; }
.backend-form textarea { resize: vertical; }
.status-pill { display: inline-block; white-space: nowrap; padding: .18rem .42rem; background: #e6e2db; color: #39342d; font-size: .76rem; font-weight: 900; }
.status-eligible, .status-receipt_issued { background: #dff5e7; color: #146838; }
.status-return_required, .status-remit_required, .status-voided { background: #ffe5e1; color: #9b271c; }
.status-verifying, .status-receipt_pending { background: #fff1c9; color: #725209; }
.accounts-panel { margin-top: 1.5rem; padding: 1.25rem; }
.accounts-panel select { width: auto; min-height: 34px; padding: .25rem; margin-right: .4rem; }
@media (max-width: 1000px) { .admin-grid { grid-template-columns: 1fr; } .detail-panel { position: static; } }
@media (max-width: 590px) { .admin-header { align-items: flex-start; } .admin-user { align-items: end; flex-direction: column; } .workspace-top { align-items: stretch; flex-direction: column; } .filter-row { grid-template-columns: 1fr; } }

/* Receipt operations */
.queue-tabs { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: .55rem; margin: 0 0 1rem; }
.queue-tabs button { border: 1px solid #bcb5aa; background: #fff; color: var(--ink); cursor: pointer; padding: .75rem .65rem; text-align: left; }
.queue-tabs button:hover, .queue-tabs button.active { border-color: var(--orange); box-shadow: inset 0 -3px 0 var(--orange); }
.queue-tabs b { display: block; font-size: 1.45rem; line-height: 1; }
.queue-tabs span { display: block; margin-top: .35rem; font-size: .76rem; font-weight: 900; }
.receipt-system-note { display: grid; grid-template-columns: auto 1fr auto; gap: .75rem; align-items: center; padding: .8rem 1rem; margin: 0 0 1rem; background: #171717; color: #fff; font-size: .82rem; }
.receipt-system-note b { color: #ff8c62; }
.receipt-system-note a { color: #fff; font-weight: 900; white-space: nowrap; }
.missing-text { color: #9b271c; white-space: normal; max-width: 18rem; }
.copy-receipt { width: 100%; margin: .2rem 0 1rem; border-color: var(--ink); background: var(--ink); color: #fff; }
.readiness { margin: 0 0 1rem; padding: .8rem .9rem; border-left: 5px solid; }
.readiness b { font-size: .9rem; }
.readiness p { margin: .25rem 0 0; font-size: .78rem; line-height: 1.5; }
.readiness.missing { border-color: #c44535; background: #fff0ee; }
.readiness.ready { border-color: #17824a; background: #edfff5; }
.workflow-step { margin: 0 0 .75rem; padding: .9rem; border: 1px solid #c9c2b8; background: #faf8f4; }
.workflow-step.done { border-color: #75ab8d; background: #f4fff8; }
.workflow-step > header { display: flex; gap: .7rem; align-items: flex-start; margin-bottom: .7rem; }
.workflow-step > header > span { display: grid; place-items: center; width: 1.6rem; height: 1.6rem; flex: 0 0 auto; background: var(--ink); color: #fff; font-weight: 900; font-size: .8rem; }
.workflow-step.done > header > span { background: #17824a; }
.workflow-step header b, .workflow-step header small { display: block; }
.workflow-step header small { margin-top: .12rem; }
.compact-form { gap: .65rem; border-top: 0; padding-top: 0; }
.compact-form label { font-size: .82rem; }
.compact-form input, .compact-form select, .compact-form textarea { min-height: 39px; padding: .55rem .6rem; }
.compact-form .button { padding: .65rem .8rem; }
.workflow-actions { display: flex; align-items: center; flex-wrap: wrap; gap: .55rem; }
.official-workflow-link { display: block; margin: 0 0 .75rem; color: #96300e; font-size: .82rem; font-weight: 900; }
.issued-receipt { display: flex; justify-content: space-between; gap: .75rem; padding: .75rem; background: #e5f7ec; color: #145f37; }
.issued-receipt span { font-size: .8rem; }
.danger-zone, .edit-details { margin: 1rem 0; border: 1px solid #beb6ab; background: #fff; }
.danger-zone summary, .edit-details summary { cursor: pointer; padding: .8rem .9rem; font-weight: 900; }
.danger-zone[open] summary, .edit-details[open] summary { border-bottom: 1px solid var(--line); }
.danger-zone form, .edit-details form { padding: .9rem; }
.danger-zone { border-color: #d38a80; }
.danger-text { color: #9b271c; }
.button.danger { background: #a12e23; border-color: #a12e23; color: #fff; }
.history-section { margin-top: 1.2rem; padding-top: 1rem; border-top: 2px solid var(--ink); }
.history-section h3 { margin: 0 0 .8rem; }
.receipt-history { list-style: none; margin: 0; padding: 0; }
.receipt-history li { display: grid; grid-template-columns: 12px 1fr; gap: .55rem; position: relative; padding: 0 0 .8rem; }
.receipt-history li > span { width: 9px; height: 9px; margin-top: .35rem; border-radius: 50%; background: var(--orange); }
.receipt-history li:not(:last-child)::before { content: ""; position: absolute; left: 4px; top: .7rem; bottom: 0; width: 1px; background: #c9c2b8; }
.receipt-history b, .receipt-history small { display: block; }
.receipt-history p { margin: .2rem 0 0; font-size: .78rem; }

@media (max-width: 1100px) {
  .queue-tabs { grid-template-columns: repeat(3, 1fr); }
  .receipt-system-note { grid-template-columns: 1fr; }
}
@media (max-width: 590px) {
  .queue-tabs { grid-template-columns: repeat(2, 1fr); }
  .queue-tabs button { min-height: 68px; }
  .workflow-actions .button { width: 100%; }
  .detail-panel { padding: .9rem; }
}
