/* Design notes
   VOICE   everyday charity: calm, warm and trustworthy, nothing loud.
   IDEA    the shared poster: its deep green, its red, its pale grey ground and its heart-and-tree mark run through the site.
   PICTURE each need card: a progress ring like the poster's, the real payment app icons, and the amount still missing in red.
   COLOUR  ground #f3f5f4 (the poster's), white cards, deep green band #065a31, brand green #0a7a44, red #c81e27 for what is missing.
   TYPE    Alexandria for headings and figures, IBM Plex Sans Arabic for text. Cairo stays for the poster only.
   LAYOUT  green band (brand, headline, totals), sticky tabs, then content: cards two or three across on a laptop, one on a phone. */

:root {
  color-scheme: light;
  --bg: #f3f5f4;
  --surface: #ffffff;
  --surface-2: #f6f8f7;
  --ink: #14201a;
  --muted: #56655d;
  --line: #e0e7e3;
  --line-strong: #c8d4cd;
  --green: #0a7a44;
  --green-hover: #086536;
  --green-ink: #08693a;
  --green-soft: #e3f2ea;
  --on-green: #ffffff;
  --track: #d3e8db;
  --red: #c81e27;
  --red-soft: #fcebeb;
  --red-line: #f3c4c6;
  --amber: #855800;
  --amber-soft: #fbf0d3;
  --band: #065a31;
  --band-ink: #ffffff;
  --band-muted: #c2e4d1;
  --band-glass: rgb(255 255 255 / 0.09);
  --band-edge: rgb(255 255 255 / 0.14);
  --toast: #14201a;
  --toast-ink: #ffffff;
  --focus: #0a7a4466;
  --shadow: 0 1px 2px rgb(16 40 28 / 0.05), 0 2px 10px rgb(16 40 28 / 0.04);
  --radius: 18px;
  --font: "IBM Plex Sans Arabic", Tahoma, Arial, sans-serif;
  --display: "Alexandria", "IBM Plex Sans Arabic", Tahoma, Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #0b1310;
    --surface: #121c17;
    --surface-2: #17231d;
    --ink: #e4ede8;
    --muted: #9cada4;
    --line: #22322a;
    --line-strong: #30453a;
    --green: #34b574;
    --green-hover: #48c585;
    --green-ink: #62d29a;
    --green-soft: #13301f;
    --on-green: #04170d;
    --track: #1e3a2b;
    --red: #ff7a7e;
    --red-soft: #351618;
    --red-line: #5c2427;
    --amber: #f0c459;
    --amber-soft: #30260c;
    --band: #0a3523;
    --band-ink: #eef7f2;
    --band-muted: #9fcbb3;
    --toast: #e4ede8;
    --toast-ink: #0b1310;
    --focus: #34b57488;
    --shadow: none;
  }
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.6 var(--font);
  overflow-x: clip;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  font-family: var(--display);
  line-height: 1.3;
}

p {
  margin: 0;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

img {
  max-width: 100%;
}

[hidden] {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.wrap {
  width: 100%;
  max-width: 1220px;
  margin-inline: auto;
  padding-inline: 16px;
}

@media (min-width: 720px) {
  .wrap {
    padding-inline: 28px;
  }
}

.ltr {
  direction: ltr;
  unicode-bidi: isolate;
}

.num {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.icon {
  width: 1.2em;
  height: 1.2em;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

[data-icon] {
  display: inline-flex;
}

.logo-mark {
  fill: none;
  stroke: currentColor;
  stroke-width: 8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 18px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: none;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}

.btn:active {
  transform: translateY(1px);
}

.btn[disabled] {
  cursor: default;
}

.btn-primary {
  background: var(--green);
  color: var(--on-green);
}

.btn-primary:hover {
  background: var(--green-hover);
}

.btn-secondary {
  border-color: var(--line-strong);
  background: var(--surface);
  color: var(--green-ink);
}

.btn-secondary:hover {
  background: var(--green-soft);
}

.btn-danger {
  border-color: var(--red-line);
  background: var(--surface);
  color: var(--red);
}

.btn-danger:hover {
  background: var(--red-soft);
}

.btn-band {
  background: #ffffff;
  color: #065a31;
}

.btn-band:hover {
  background: #e3f2ea;
}

.btn-band-ghost {
  border-color: rgb(255 255 255 / 0.32);
  color: var(--band-ink);
}

.btn-band-ghost:hover {
  background: rgb(255 255 255 / 0.1);
}

.btn-sm {
  min-height: 38px;
  padding: 7px 13px;
  border-radius: 10px;
  font-size: 14px;
}

.btn-block {
  width: 100%;
}

.btn.busy {
  opacity: 0.8;
}

.btn.busy::after {
  content: "";
  width: 15px;
  height: 15px;
  border: 2px solid currentColor;
  border-inline-start-color: transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(1turn);
  }
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 10px;
  background: none;
  color: var(--muted);
}

.icon-btn:hover {
  background: var(--surface-2);
  color: var(--ink);
}

.icon-btn.danger:hover {
  background: var(--red-soft);
  color: var(--red);
}

.link-btn {
  align-self: flex-start;
  min-height: 32px;
  padding: 2px 0;
  border: 0;
  background: none;
  color: var(--green-ink);
  font-size: 15px;
  font-weight: 600;
}

.link-btn:hover {
  text-decoration: underline;
}

/* ---------- green band ---------- */

.band {
  background: var(--band);
  color: var(--band-ink);
  padding-bottom: 28px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-block: 14px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-mark {
  display: grid;
  place-items: center;
  flex: none;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: var(--band-glass);
  border: 1px solid var(--band-edge);
  color: #ffffff;
}

.brand-mark svg {
  width: 30px;
  height: 30px;
}

.brand-text {
  min-width: 0;
}

.brand-name {
  display: block;
  font: 800 22px/1.2 var(--display);
}

.brand-tagline {
  display: block;
  margin-top: 2px;
  color: var(--band-muted);
  font-size: 13px;
  line-height: 1.5;
}

.topbar-actions {
  display: flex;
  flex: none;
  gap: 8px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  align-items: end;
  gap: 24px 48px;
  padding-top: 22px;
}

.hero-copy h1 {
  max-width: 13em;
  font-size: clamp(28px, 4.4vw, 46px);
  font-weight: 800;
  line-height: 1.2;
  text-wrap: balance;
}

.hero-copy p {
  max-width: 32em;
  margin-top: 12px;
  color: var(--band-muted);
  font-size: 17px;
}

.hero-copy .hero-note {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 18px;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--band-glass);
  color: var(--band-ink);
  font-size: 14px;
}

.stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.stat {
  padding: 14px 16px;
  border: 1px solid var(--band-edge);
  border-radius: 16px;
  background: var(--band-glass);
}

.stat-label {
  display: block;
  color: var(--band-muted);
  font-size: 14px;
}

.stat-value {
  display: block;
  margin-top: 4px;
  font: 700 clamp(22px, 2.6vw, 30px)/1.2 var(--display);
}

.stat-value small {
  color: var(--band-muted);
  font: 500 14px var(--font);
}

.stat.is-loading .stat-value {
  opacity: 0.5;
}

.stat-progress {
  grid-column: 1 / -1;
  padding-top: 6px;
}

.stat-progress p {
  margin-bottom: 8px;
  color: var(--band-muted);
  font-size: 14px;
}

.stat-progress b {
  color: var(--band-ink);
}

.stat-progress .bar {
  height: 8px;
  border-radius: 999px;
  background: rgb(255 255 255 / 0.16);
  overflow: hidden;
}

.stat-progress .bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #ffffff;
}

/* Admin pages: no headline, the totals in one row. */
body:not([data-tab="needs"]):not([data-tab="completed"]) .hero-copy {
  display: none;
}

body:not([data-tab="needs"]):not([data-tab="completed"]) .hero {
  grid-template-columns: minmax(0, 1fr);
  padding-top: 6px;
}

body:not([data-tab="needs"]):not([data-tab="completed"]) .band {
  padding-bottom: 22px;
}

@media (min-width: 720px) {
  body:not([data-tab="needs"]):not([data-tab="completed"]) .stats {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* ---------- tabs ---------- */

.tabs {
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}

@supports (backdrop-filter: blur(1px)) {
  .tabs {
    background: color-mix(in srgb, var(--bg) 86%, transparent);
    backdrop-filter: blur(12px);
  }
}

.tabs-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding-block: 10px;
  overflow-x: auto;
  scrollbar-width: none;
}

.tabs-row::-webkit-scrollbar {
  display: none;
}

.tab {
  display: inline-flex;
  align-items: center;
  flex: none;
  gap: 8px;
  min-height: 42px;
  padding: 8px 16px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: none;
  color: var(--muted);
  font-size: 15px;
  font-weight: 600;
}

.tab:hover {
  background: var(--surface);
  color: var(--ink);
}

.tab[aria-current="page"] {
  background: var(--green);
  color: var(--on-green);
}

.tab-count {
  min-width: 24px;
  padding: 0 7px;
  border-radius: 999px;
  background: var(--line);
  color: var(--ink);
  font-size: 13px;
  line-height: 22px;
  text-align: center;
}

.tab[aria-current="page"] .tab-count {
  background: rgb(255 255 255 / 0.24);
  color: inherit;
}

.tab-sep {
  flex: none;
  width: 1px;
  height: 24px;
  margin-inline: 6px;
  background: var(--line-strong);
}

/* ---------- page content ---------- */

.content {
  min-height: 50vh;
  padding-block: 26px 48px;
}

.page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px 20px;
  margin-bottom: 20px;
}

.page-head h2 {
  font-size: clamp(24px, 3vw, 32px);
  font-weight: 700;
}

.page-head p {
  margin-top: 4px;
  color: var(--muted);
}

.card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.empty {
  display: grid;
  justify-items: center;
  gap: 12px;
  padding: 56px 20px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--muted);
  text-align: center;
}

.empty .logo-mark {
  width: 56px;
  height: 56px;
  color: var(--green);
}

.empty p {
  font-size: 17px;
}

.skeleton {
  min-height: 440px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(90deg, var(--surface) 30%, var(--surface-2) 50%, var(--surface) 70%) 0 0 / 300% 100%;
  animation: shimmer 1.6s linear infinite;
}

@keyframes shimmer {
  to {
    background-position: -150% 0;
  }
}

/* ---------- need cards ---------- */

.need-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 350px), 1fr));
  gap: 18px;
}

/* A single need shouldn't stretch across the whole page. */
.need-grid:has(> :only-child) {
  grid-template-columns: minmax(0, 640px);
}

.need {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 20px;
}

.need-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.need-num {
  padding: 3px 10px;
  border-radius: 8px;
  background: var(--green-soft);
  color: var(--green-ink);
  font: 700 15px/1.6 var(--display);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 11px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

.badge .icon {
  width: 15px;
  height: 15px;
}

.badge-pending {
  background: var(--amber-soft);
  color: var(--amber);
}

.badge-verified {
  background: var(--green-soft);
  color: var(--green-ink);
}

.badge-done {
  background: var(--green);
  color: var(--on-green);
}

.need-title {
  font-size: 21px;
  font-weight: 700;
  line-height: 1.4;
}

.need-tag {
  margin-top: 4px;
  color: var(--red);
  font-size: 14px;
  font-weight: 600;
}

.need-desc {
  display: -webkit-box;
  color: var(--muted);
  line-height: 1.8;
  white-space: pre-line;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
}

.need-desc.open {
  display: block;
}

.need-desc + .link-btn {
  margin-top: -10px;
}

.need-progress {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 16px;
  border-radius: 14px;
  background: var(--surface-2);
}

.ring {
  --p: 0;
  display: grid;
  place-items: center;
  flex: none;
  width: 78px;
  height: 78px;
  border-radius: 50%;
  background: conic-gradient(var(--green) calc(var(--p) * 1%), var(--track) 0);
}

.ring::before {
  content: "";
  grid-area: 1 / 1;
  width: 62px;
  height: 62px;
  border-radius: 50%;
  background: var(--surface-2);
}

.ring span {
  grid-area: 1 / 1;
  position: relative;
  font: 700 18px var(--display);
}

.figures {
  display: grid;
  flex: 1;
  gap: 6px;
  margin: 0;
}

.figures div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.figures dt {
  color: var(--muted);
  font-size: 14px;
}

.figures dd {
  margin: 0;
  font: 700 16px var(--display);
  white-space: nowrap;
}

.figures dd small {
  color: var(--muted);
  font: 500 13px var(--font);
}

.figures .remaining dd {
  color: var(--red);
}

.section-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
  font: 700 15px var(--display);
}

.rows {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.pay-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
}

.pay-row.missing {
  border-style: dashed;
  color: var(--red);
  font-size: 14px;
}

.pay-text {
  display: grid;
  flex: 1;
  min-width: 0;
  line-height: 1.45;
}

.pay-label {
  color: var(--muted);
  font-size: 13px;
}

.pay-owner {
  font-size: 15px;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.pay-number {
  direction: ltr;
  unicode-bidi: isolate;
  text-align: right;
  font-size: 15px;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.pay-note {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 14px;
}

.app-icon {
  display: block;
  flex: none;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #ffffff;
  overflow: hidden;
}

.app-icon img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Same zoom as the poster: crop Bankak's white edge, keep InstaPay's wide logo whole. */
.app-icon-bankak img {
  transform: scale(1.12);
}

.app-icon-instapay img {
  transform: scale(0.85);
}

.copy-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  gap: 6px;
  min-width: 88px;
  min-height: 38px;
  padding: 6px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--surface);
  color: var(--green-ink);
  font-size: 14px;
  font-weight: 600;
  transition: background-color 0.15s, color 0.15s;
}

.copy-btn:hover {
  background: var(--green-soft);
}

.copy-btn.copied {
  border-color: var(--green);
  background: var(--green);
  color: var(--on-green);
}

.need-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
  padding-top: 4px;
}

.need-actions .btn-primary {
  flex: 1;
}

/* ---------- forms ---------- */

.field {
  display: grid;
  align-content: start;
  gap: 6px;
}

.field-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
}

.field-label .app-icon {
  width: 24px;
  height: 24px;
}

.hint {
  color: var(--muted);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.6;
}

input,
select,
textarea {
  width: 100%;
  min-height: 46px;
  padding: 10px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--surface);
  color: var(--ink);
  font-size: 16px;
  transition: border-color 0.15s, box-shadow 0.15s;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--green);
  outline: none;
  box-shadow: 0 0 0 3px var(--focus);
}

textarea {
  min-height: 130px;
  line-height: 1.8;
  resize: vertical;
}

select {
  appearance: none;
  padding-inline-end: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237d8c84' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-position: left 14px center;
  background-repeat: no-repeat;
  background-size: 16px;
  text-overflow: ellipsis;
}

input[dir="ltr"] {
  text-align: left;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.span-2 {
  grid-column: 1 / -1;
}

.form-card {
  padding: 20px;
}

.form-card + .form-card {
  margin-top: 16px;
}

.card-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  font-size: 17px;
  font-weight: 700;
}

.card-title .icon {
  color: var(--green-ink);
}

.stack-form {
  display: grid;
  gap: 14px;
}

.inline-field {
  display: flex;
  gap: 8px;
}

.inline-field input {
  flex: 1;
  min-width: 0;
}

.switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  font-weight: 600;
  cursor: pointer;
}

.switch input {
  position: absolute;
  width: 1px;
  height: 1px;
  min-height: 0;
  opacity: 0;
}

.switch-track {
  position: relative;
  flex: none;
  width: 46px;
  height: 28px;
  border-radius: 999px;
  background: var(--line-strong);
  transition: background-color 0.15s;
}

.switch-track::after {
  content: "";
  position: absolute;
  top: 3px;
  right: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 1px 3px rgb(0 0 0 / 0.25);
  transition: transform 0.15s;
}

.switch input:checked + .switch-track {
  background: var(--green);
}

.switch input:checked + .switch-track::after {
  transform: translateX(-18px);
}

.switch input:focus-visible + .switch-track {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.note {
  display: flex;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--amber-soft);
  color: var(--amber);
  font-size: 14px;
  line-height: 1.7;
}

.note .icon {
  margin-top: 3px;
}

/* ---------- admin: needs list ---------- */

.admin-layout,
.accounts-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  align-items: start;
  gap: 24px;
}

.side {
  position: sticky;
  top: 82px;
  display: grid;
  gap: 16px;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.search {
  position: relative;
  flex: 1;
  min-width: 220px;
}

.search .icon {
  position: absolute;
  top: 50%;
  right: 14px;
  color: var(--muted);
  transform: translateY(-50%);
}

.search input {
  padding-inline-start: 44px;
}

.seg {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface);
}

.seg button {
  min-height: 38px;
  padding: 6px 14px;
  border: 0;
  border-radius: 10px;
  background: none;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
}

.seg button[aria-pressed="true"] {
  background: var(--green-soft);
  color: var(--green-ink);
}

.editor {
  margin-bottom: 12px;
  overflow: hidden;
  scroll-margin-top: 80px;
}

.editor summary {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  list-style: none;
  cursor: pointer;
}

.editor summary::-webkit-details-marker {
  display: none;
}

.editor summary:hover {
  background: var(--surface-2);
}

.editor-main {
  display: grid;
  flex: 1;
  gap: 6px;
  min-width: 0;
}

.editor-title {
  overflow: hidden;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mini {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
}

.mini .bar {
  flex: 1;
  max-width: 200px;
  height: 6px;
  border-radius: 999px;
  background: var(--track);
  overflow: hidden;
}

.mini .bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--green);
}

.chev {
  color: var(--muted);
  transition: transform 0.2s;
}

.editor[open] .chev {
  transform: rotate(180deg);
}

.editor-body {
  display: grid;
  gap: 24px;
  padding: 20px 18px;
  border-top: 1px solid var(--line);
}

.editor-section h4 {
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.editor-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.editor-actions .btn-danger {
  margin-inline-start: auto;
}

.no-results {
  padding: 28px;
  color: var(--muted);
  text-align: center;
}

.list-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
  font-size: 15px;
}

.list-row:first-child {
  border-top: 0;
}

.list-text {
  display: grid;
  flex: 1;
  min-width: 0;
  line-height: 1.5;
}

.list-text .ltr {
  overflow-wrap: anywhere;
}

.list-text small {
  color: var(--muted);
  font-size: 13px;
}

.chip {
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.chip-free {
  background: var(--green-soft);
  color: var(--green-ink);
}

.chip-used {
  background: var(--red-soft);
  color: var(--red);
}

/* ---------- accounts page ---------- */

.groups {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  align-items: start;
  gap: 16px;
}

.group {
  padding: 16px 18px 6px;
}

.group-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 12px;
}

.group-head h3 {
  flex: 1;
  font-size: 17px;
}

.group .list-row:nth-child(2) {
  border-top: 1px solid var(--line);
}

.group-empty {
  padding: 14px 0;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
}

/* ---------- add need and design pages ---------- */

.add-layout {
  display: grid;
  grid-template-areas: "form preview" "submit preview";
  grid-template-columns: minmax(0, 1fr) 380px;
  grid-template-rows: auto 1fr;
  align-items: start;
  gap: 16px 24px;
}

.add-layout > form {
  grid-area: form;
}

.add-layout > .preview {
  grid-area: preview;
}

.submit-bar {
  grid-area: submit;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
}

.preview {
  position: sticky;
  top: 82px;
  display: grid;
  gap: 12px;
  padding: 16px;
}

.preview .card-title {
  margin-bottom: 0;
}

.poster-canvas {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  border-radius: 12px;
  background: #f3f5f4;
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.08), 0 10px 30px rgb(16 40 28 / 0.1);
}

.design-layout {
  display: grid;
  grid-template-areas: "panel poster";
  grid-template-columns: 340px minmax(0, 1fr);
  align-items: start;
  gap: 24px;
}

.design-panel {
  grid-area: panel;
  position: sticky;
  top: 82px;
  display: grid;
  gap: 16px;
  padding: 20px;
}

.design-panel .btn {
  width: 100%;
}

.panel-foot {
  display: grid;
  gap: 8px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.poster-stage {
  grid-area: poster;
  display: grid;
  place-items: center;
  padding: clamp(12px, 3vw, 32px);
  border-radius: var(--radius);
  background: var(--surface-2);
  border: 1px solid var(--line);
}

.poster-stage .poster-canvas {
  max-width: 720px;
}

/* ---------- login dialog and toast ---------- */

.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
  place-items: center;
  padding: 16px;
  background: rgb(4 20 12 / 0.55);
}

.modal.open {
  display: grid;
}

.modal-box {
  width: min(420px, 100%);
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--surface);
  box-shadow: 0 24px 60px rgb(0 0 0 / 0.25);
}

.modal-head {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 20px;
}

.modal-head h2 {
  font-size: 20px;
}

.modal-head p {
  margin-top: 2px;
  color: var(--muted);
  font-size: 14px;
}

.modal-icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--green-soft);
  color: var(--green-ink);
}

.modal-close {
  margin-inline-start: auto;
  margin-top: -6px;
}

.toast {
  position: fixed;
  right: 16px;
  bottom: max(16px, env(safe-area-inset-bottom));
  left: 16px;
  z-index: 60;
  width: fit-content;
  max-width: min(480px, calc(100% - 32px));
  margin-inline: auto;
  padding: 12px 18px;
  border-radius: 14px;
  background: var(--toast);
  color: var(--toast-ink);
  font-weight: 500;
  line-height: 1.6;
  text-align: center;
  box-shadow: 0 10px 30px rgb(0 0 0 / 0.2);
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.2s, transform 0.2s;
  pointer-events: none;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding-block: 24px 36px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
}

.footer-mark {
  display: inline-flex;
  color: var(--green);
}

.footer-mark svg {
  width: 22px;
  height: 22px;
}

.footer-tag {
  color: var(--red);
  font-weight: 600;
}

/* ---------- narrower screens ---------- */

@media (max-width: 1020px) {
  .add-layout {
    grid-template-areas: "form" "preview" "submit";
    grid-template-columns: minmax(0, 1fr);
  }

  .preview {
    position: static;
  }

  .preview .poster-canvas {
    max-width: 520px;
    margin-inline: auto;
  }
}

@media (max-width: 960px) {
  .admin-layout,
  .accounts-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .side {
    position: static;
  }

  .design-layout {
    grid-template-areas: "poster" "panel";
    grid-template-columns: minmax(0, 1fr);
  }

  .design-panel {
    position: static;
  }
}

@media (max-width: 820px) {
  .hero {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 620px) {
  .band {
    padding-bottom: 20px;
  }

  .hero {
    gap: 18px;
    padding-top: 8px;
  }

  .hero-copy p {
    font-size: 16px;
  }

  /* Every card already says this on a phone. */
  .hero-copy .hero-note {
    display: none;
  }

  .stat-value {
    font-size: 21px;
  }

  .form-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .span-2 {
    grid-column: auto;
  }

  .need {
    padding: 16px;
  }

  .need-progress {
    gap: 14px;
    padding: 14px;
  }

  .stat {
    padding: 12px 14px;
  }

  .editor summary {
    padding: 12px 14px;
  }

  .editor-body {
    padding: 16px 14px;
  }

  .editor-actions .btn,
  .submit-bar .btn {
    flex: 1;
  }

  .editor-actions .btn-danger {
    margin-inline-start: 0;
  }
}

@media (max-width: 520px) {
  .hide-narrow {
    display: none;
  }

  .btn-band-ghost {
    padding-inline: 11px;
  }

  .brand-mark {
    width: 42px;
    height: 42px;
  }

  .brand-mark svg {
    width: 26px;
    height: 26px;
  }

  .brand-name {
    font-size: 20px;
  }

  .brand-tagline {
    font-size: 12px;
  }

  .topbar-actions .btn {
    min-height: 40px;
    padding-block: 8px;
    font-size: 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
