/* FreeBeg — one stylesheet, no build step. */
:root {
  --ink: #14202B;
  --muted: #4A5866;
  --line: #DDE3E8;
  --ground: #F4F6F8;
  --card: #FFFFFF;
  --green: #0B7A55;
  --green-dark: #08603F;
  --green-tint: #E3F3EC;
  --mint: #3FD39A;
  --amber-bg: #FDF0E1;
  --amber: #8A4300;
  --red: #A61B1B;
  --red-bg: #FBE7E7;
  --radius: 16px;
  --display: 'Public Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --body: 'Public Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--ground); color: var(--ink); font-family: var(--body); font-size: 16px; line-height: 1.55; }
a { color: var(--green); }
a:hover { color: var(--green-dark); }
img { max-width: 100%; height: auto; display: block; }
h1, h2, h3 { font-family: var(--display); letter-spacing: -0.02em; line-height: 1.15; margin: 0 0 .5em; }
h1 { font-size: clamp(30px, 4vw, 42px); }
h2 { font-size: 24px; }
h3 { font-size: 20px; }
p { margin: 0 0 1em; }
.sr-only, .skip:not(:focus) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip:focus { position: absolute; top: 8px; left: 8px; background: #fff; padding: 8px 12px; z-index: 10; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.wrap { max-width: 1280px; margin: 0 auto; padding: 0 20px; }
.main { padding-top: 28px; padding-bottom: 48px; min-height: 60vh; }
.narrow { max-width: 560px; }
.medium { max-width: 820px; }
.stack > * + * { margin-top: 14px; }
.inline { display: inline; }
.row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.spacer { flex: 1; }

/* Header */
.site-header { background: #fff; border-bottom: 1px solid var(--line); }
.header-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 22px; padding-top: 12px; padding-bottom: 12px; }
.logo { font-family: var(--display); font-weight: 700; font-size: 26px; color: var(--ink); text-decoration: none; letter-spacing: -0.5px; }
.logo span { color: var(--green); }
.main-nav { display: flex; gap: 18px; font-weight: 500; }
.main-nav a { color: var(--ink); text-decoration: none; }
.main-nav a:hover { color: var(--green); }
.search { flex: 1 1 200px; max-width: 360px; display: flex; align-items: center; gap: 8px; background: var(--ground); border: 1px solid var(--line); border-radius: 999px; padding: 0 14px; height: 44px; color: var(--muted); }
.search input { border: 0; background: transparent; font: inherit; font-size: 15px; flex: 1; min-width: 0; outline: none; color: var(--ink); }
.header-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-left: auto; }
.pill-link { display: inline-flex; align-items: center; gap: 6px; height: 44px; padding: 0 14px; border-radius: 999px; color: var(--ink); text-decoration: none; font-weight: 500; }
.pill-link:hover { background: var(--ground); color: var(--ink); }
.as-link { border: 0; background: none; font: inherit; cursor: pointer; }
.badge { display: inline-block; min-width: 20px; padding: 0 6px; border-radius: 999px; background: var(--green); color: #fff; font-size: 12px; font-weight: 700; line-height: 20px; text-align: center; }
.test-banner { background: var(--amber-bg); color: var(--amber); text-align: center; font-size: 14px; font-weight: 700; padding: 6px; }
@media (max-width: 720px) {
  .main-nav { display: none; }
  .search { order: 5; max-width: none; flex-basis: 100%; }
}

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 20px; border-radius: 999px; border: 1px solid var(--line); background: #fff; color: var(--ink); font: inherit; font-weight: 700; text-decoration: none; cursor: pointer; }
.btn:hover { border-color: var(--ink); color: var(--ink); }
.btn-primary { background: var(--green); border-color: var(--green); color: #fff; }
.btn-primary:hover { background: var(--green-dark); border-color: var(--green-dark); color: #fff; }
.btn-dark { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn-dark:hover { background: #000; color: #fff; }
.btn-mint { background: var(--mint); border-color: var(--mint); color: #0A2A1E; }
.btn-ghost-light { background: transparent; border-color: #5A6B7A; color: #fff; font-weight: 500; }
.btn-ghost-light:hover { border-color: #fff; color: #fff; }
.btn-danger { color: var(--red); }
.btn-danger:hover { border-color: var(--red); color: var(--red); }
.btn-block { width: 100%; }
.btn-lg { min-height: 52px; font-size: 17px; }
.btn-sm { min-height: 36px; padding: 0 14px; font-size: 14px; }
.icon-btn { width: 44px; height: 44px; padding: 0; border-radius: 50%; flex-shrink: 0; }

/* Forms */
label { display: block; font-weight: 700; font-size: 14px; }
input[type=text], input[type=email], input[type=password], input[type=search]:not(.search input), input[type=url], input[type=number], select, textarea {
  display: block; width: 100%; margin-top: 6px; min-height: 46px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 12px; font: inherit; font-weight: 400; background: #fff; color: var(--ink);
}
textarea { min-height: 140px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--green); outline-offset: 1px; border-color: var(--green); }
.hint { display: block; font-weight: 400; color: var(--muted); font-size: 13px; margin-top: 4px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 500; }
.check input { margin-top: 4px; width: 18px; height: 18px; }
fieldset { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; margin: 0; }
legend { font-weight: 700; font-size: 14px; padding: 0 6px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }

/* Flash messages */
.flash { padding: 12px 16px; border-radius: 12px; margin-bottom: 16px; font-weight: 500; }
.flash-success { background: var(--green-tint); color: var(--green-dark); }
.flash-info { background: #E6EEF8; color: #1D3F6E; }
.flash-error { background: var(--red-bg); color: var(--red); }

/* Cards & layout */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.card + .card { margin-top: 20px; }
.two-col { display: flex; flex-wrap: wrap; gap: 28px; align-items: flex-start; }
.two-col > .col-main { flex: 999 1 560px; min-width: 0; }
.two-col > .col-side { flex: 1 1 320px; display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.col-side .card + .card { margin-top: 0; }

/* Hero */
.hero { background: var(--ink); color: #fff; border-radius: 20px; padding: 36px 40px; display: flex; flex-wrap: wrap; gap: 28px; align-items: center; margin-bottom: 26px; }
.hero h1 { color: #fff; margin-bottom: 10px; }
.hero p { color: #C9D3DC; font-size: 18px; margin: 0; max-width: 620px; }
.hero .hero-text { flex: 999 1 460px; }
.hero .hero-actions { flex: 1 1 240px; display: flex; flex-direction: column; gap: 10px; }
@media (max-width: 600px) { .hero { padding: 24px 22px; } .hero p { font-size: 16px; } }

/* Tabs and chips */
.tabs, .chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 12px; scrollbar-width: none; }
.tab { flex-shrink: 0; display: inline-flex; align-items: center; height: 40px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line); background: #fff; color: var(--ink); text-decoration: none; font-weight: 500; font-size: 15px; }
.tab[aria-current="page"] { background: var(--ink); border-color: var(--ink); color: #fff; font-weight: 700; }
.chip { flex-shrink: 0; display: inline-flex; align-items: center; height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: #fff; color: var(--ink); text-decoration: none; font-size: 14px; }
.chip[aria-current="page"] { border-color: var(--green); background: var(--green-tint); color: var(--green-dark); font-weight: 700; }
.tag { display: inline-block; font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: var(--green-tint); color: var(--green-dark); }
.tag-amber { background: var(--amber-bg); color: var(--amber); }
.tag-gray { background: #EEF1F4; color: var(--muted); }
.tag-red { background: var(--red-bg); color: var(--red); }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }

/* Request cards */
.grid-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 20px; }
.req-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; display: flex; flex-direction: column; gap: 12px; }
.who { display: flex; align-items: center; gap: 12px; }
.avatar { width: 42px; height: 42px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; flex-shrink: 0; color: var(--ink); }
.avatar-lg { width: 48px; height: 48px; }
.who-name { font-weight: 700; display: flex; align-items: center; gap: 6px; }
.who-meta { font-size: 13px; color: var(--muted); }
.req-card h3 { margin: 0; font-size: 21px; }
.req-card h3 a { color: var(--ink); text-decoration: none; }
.req-card h3 a:hover { color: var(--green); }
.req-card .excerpt { color: var(--muted); font-size: 15px; margin: 0; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.bar { height: 8px; background: #E8ECEF; border-radius: 999px; overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--green); border-radius: 999px; }
.bar-lg { height: 10px; }
.progress-line { display: flex; justify-content: space-between; gap: 8px; margin-top: 6px; font-size: 14px; }
.card-actions { display: flex; gap: 8px; margin-top: auto; }
.card-actions .btn-primary { flex: 1; }
.warning-box { background: var(--red-bg); color: var(--red); border-radius: 12px; padding: 12px 14px; font-weight: 500; font-size: 14px; }

/* Request page */
.req-photo { border-radius: 14px; width: 100%; max-height: 420px; object-fit: cover; margin-bottom: 20px; }
.story { font-size: 17px; }
.big-amount { font-family: var(--display); font-size: 36px; font-weight: 700; line-height: 1; }
.big-amount small { font-size: 18px; font-weight: 600; color: var(--muted); }
.pay-btn { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 52px; padding: 8px 18px; border-radius: 14px; border: 1px solid var(--line); color: var(--ink); text-decoration: none; }
.pay-btn:hover { border-color: var(--green); color: var(--ink); background: var(--green-tint); }
.pay-btn b { white-space: nowrap; }
.pay-btn span { color: var(--muted); font-size: 15px; overflow-wrap: anywhere; text-align: right; }
.amounts { display: flex; flex-wrap: wrap; gap: 8px; }
.amounts label { font-weight: 500; }
.amounts input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.amounts span { display: inline-flex; align-items: center; height: 40px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line); cursor: pointer; }
.amounts input:checked + span { border-color: var(--green); background: var(--green-tint); color: var(--green-dark); font-weight: 700; }
.amounts input:focus-visible + span { outline: 2px solid var(--green); }
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { display: flex; gap: 14px; padding-bottom: 16px; }
.timeline .dot { width: 10px; height: 10px; border-radius: 50%; background: #B9C4CD; margin-top: 8px; flex-shrink: 0; }
.timeline li:first-child .dot { background: var(--green); }
.note { background: var(--ground); border-radius: 14px; padding: 12px 16px; }
.note + .note { margin-top: 10px; }
.note-head { font-size: 14px; font-weight: 700; }
.note-head .muted { font-weight: 400; }
.note p { margin: 4px 0 0; }
.share-row { display: flex; gap: 8px; }
.share-row input { margin-top: 0; background: var(--ground); }
.share-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 8px; margin-top: 10px; }
.share-grid .btn { border-radius: 10px; font-weight: 500; font-size: 14px; padding: 0 8px; }
.facts { list-style: none; padding: 0; margin: 0; }
.facts li { display: flex; gap: 10px; align-items: center; padding: 4px 0; }
.facts svg { color: var(--green); flex-shrink: 0; }
.claim { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; padding: 10px 0; border-top: 1px solid var(--line); }

/* Sidebar widgets */
.stat-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.stat { background: var(--ground); border-radius: 12px; padding: 12px; }
.stat b { display: block; font-family: var(--display); font-size: 28px; }
.stat span { font-size: 13px; color: var(--muted); }
.win { display: flex; gap: 10px; font-size: 14px; }
.win + .win { margin-top: 12px; }
.win .tick { width: 28px; height: 28px; border-radius: 50%; background: var(--green-tint); color: var(--green); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.win q { display: block; color: var(--muted); font-style: italic; }
.mint-card { background: var(--green-tint); border-radius: var(--radius); padding: 20px; }

/* Pages */
.prose { max-width: 760px; }
.prose h2 { margin-top: 1.6em; }
.prose li { margin-bottom: .4em; }
.provider-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin: 16px 0; }
.provider-list .card { padding: 16px; }
.pagination { display: flex; gap: 8px; justify-content: center; margin-top: 24px; }
.empty { text-align: center; padding: 40px 20px; color: var(--muted); }
table.list { width: 100%; border-collapse: collapse; font-size: 15px; }
table.list th, table.list td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table-wrap { overflow-x: auto; }
.ad-slot { margin: 20px 0; text-align: center; min-height: 90px; }

/* Footer */
.site-footer { background: #fff; border-top: 1px solid var(--line); margin-top: 24px; }
.footer-row { display: flex; flex-wrap: wrap; gap: 12px 24px; padding-top: 24px; padding-bottom: 28px; font-size: 14px; color: var(--muted); }
.footer-row p { margin: 0; flex: 1 1 320px; }
.footer-row nav { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.footer-row a { color: var(--muted); }
.plain { background: var(--ground); }

/* Request page on phones: show the give and share boxes right after the story */
@media (max-width: 900px) {
  .req-layout { flex-direction: column; flex-wrap: nowrap; gap: 20px; }
  .req-layout > .col-main, .req-layout > .col-side { display: contents; }
  .req-layout .card + .card { margin-top: 0; }
  .req-layout .card, .req-layout .o-ad { width: 100%; }
  .o-story { order: 1; } .o-give { order: 2; } .o-share { order: 3; } .o-claims { order: 4; }
  .o-updates { order: 5; } .o-encourage { order: 6; } .o-about { order: 7; } .o-ad { order: 8; }
}
