:root {
  --bg: #faf6f4;
  --surface: #ffffff;
  --surface-2: #f4eeeb;
  --ink: #1f1a1c;
  --muted: #6e6468;
  --line: #ebe2de;
  --accent: #c8264f;
  --accent-hover: #ad1d42;
  --accent-ink: #ffffff;
  --accent-soft: #fde9ee;
  --ok: #1d7d52;
  --ok-soft: #e3f4ea;
  --warn: #9a6200;
  --warn-soft: #fdf1dc;
  --info-soft: #e9f0fb;
  --shadow: 0 1px 2px rgb(31 26 28 / 6%), 0 4px 16px rgb(31 26 28 / 5%);
  --radius: 14px;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141113;
    --surface: #1e1a1c;
    --surface-2: #272225;
    --ink: #f3edef;
    --muted: #a99ea3;
    --line: #342d31;
    --accent: #ff5a82;
    --accent-hover: #ff7898;
    --accent-ink: #1a0b10;
    --accent-soft: #3a1c26;
    --ok: #5fd39a;
    --ok-soft: #173326;
    --warn: #f0b85a;
    --warn-soft: #3a2c13;
    --info-soft: #1c2638;
    --shadow: 0 1px 2px rgb(0 0 0 / 30%);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.5 var(--font); }
a { color: var(--accent); text-underline-offset: 2px; }
h1, h2, h3 { line-height: 1.2; letter-spacing: -0.01em; margin: 0 0 .6em; }
h1 { font-size: clamp(1.6rem, 3vw, 2.1rem); }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.02rem; }
p { margin: 0 0 .8em; }
code { font: .88em ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--surface-2); padding: .1em .4em; border-radius: 6px; }
img { max-width: 100%; }
.muted { color: var(--muted); }
.small { font-size: .86rem; }
.lead { font-size: 1.12rem; color: var(--muted); max-width: 46ch; }
.eyebrow { text-transform: uppercase; letter-spacing: .08em; font-size: .75rem; font-weight: 700; color: var(--accent); margin-bottom: .4em; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.center { text-align: center; }
.inline { display: inline; }
.empty { padding: 2rem; text-align: center; color: var(--muted); background: var(--surface); border: 1px dashed var(--line); border-radius: var(--radius); }

/* Layout */
.topbar { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.topbar-inner { max-width: 1160px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; gap: 20px; }
.logo { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; font-size: 1.15rem; color: var(--ink); text-decoration: none; }
.logo-mark { width: 26px; height: 26px; color: var(--accent); }
.nav { display: flex; gap: 4px; overflow-x: auto; }
.nav a { padding: 6px 12px; border-radius: 999px; color: var(--muted); text-decoration: none; font-weight: 600; font-size: .94rem; white-space: nowrap; }
.nav a:hover { color: var(--ink); background: var(--surface-2); }
.nav a.active { color: var(--ink); background: var(--surface); box-shadow: var(--shadow); }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.wallet-pill { text-decoration: none; color: var(--ink); background: var(--accent-soft); padding: 5px 12px; border-radius: 999px; font-weight: 700; white-space: nowrap; }
.link-button { background: none; border: 0; padding: 0; cursor: pointer; display: inline-flex; }
.page { max-width: 1160px; margin: 0 auto; padding: 28px 16px 64px; }
.footer { text-align: center; color: var(--muted); font-size: .85rem; padding: 24px 16px 40px; }
.columns { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 28px; align-items: start; }
.columns-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.columns-wide-left { grid-template-columns: minmax(0, 1.6fr) minmax(300px, 1fr); }
.sidebar { display: grid; gap: 16px; }
.narrow { max-width: 480px; margin: 40px auto; }
@media (max-width: 860px) {
  .columns, .columns-3, .columns-wide-left { grid-template-columns: 1fr; }
  .nav { order: 3; width: 100%; }
  .topbar-inner { flex-wrap: wrap; gap: 8px 16px; }
}

/* Components */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid transparent; background: var(--accent); color: var(--accent-ink); font: inherit; font-weight: 650; padding: 10px 18px; border-radius: 10px; cursor: pointer; text-decoration: none; transition: background .15s, transform .05s; }
.btn:hover { background: var(--accent-hover); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-small { padding: 6px 12px; font-size: .88rem; border-radius: 8px; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-slack { background: #fff; color: #1d1c1d; border-color: #ddd; }
.btn-slack:hover { background: #f6f6f6; }
.btn-block { width: 100%; }
.pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .78rem; font-weight: 650; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.pill-pending { background: var(--warn-soft); color: var(--warn); }
.pill-pledged, .pill-ok, .pill-fulfilled { background: var(--ok-soft); color: var(--ok); }
.pill-cancelled { background: var(--surface-2); color: var(--muted); }
.hearts { font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
.avatar { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; flex: none; background: var(--surface-2); }
.avatar-initials { display: inline-grid; place-items: center; font-size: .7rem; font-weight: 700; color: var(--accent); background: var(--accent-soft); }
.person { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.person .avatar { width: 24px; height: 24px; }
.mention { color: var(--accent); background: var(--accent-soft); border-radius: 4px; padding: 0 3px; font-weight: 600; }
.tag { color: var(--accent); font-weight: 600; }
.tags { display: flex; flex-wrap: wrap; gap: 8px 14px; }
.flash { padding: 12px 16px; border-radius: 10px; margin-bottom: 20px; font-weight: 550; }
.flash-success { background: var(--ok-soft); color: var(--ok); }
.flash-error { background: var(--accent-soft); color: var(--accent); }
.flash-info { background: var(--info-soft); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 24px; }
.chips a { padding: 6px 14px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); color: var(--ink); text-decoration: none; font-size: .92rem; font-weight: 600; }
.chips a:hover, .chips a.active { border-color: var(--accent); color: var(--accent); }
.progress { height: 10px; background: var(--surface-2); border-radius: 99px; overflow: hidden; margin: 10px 0 6px; }
.progress span { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), #ff8a6b); border-radius: 99px; }

/* Landing */
.hero { display: grid; grid-template-columns: 1.2fr 1fr; gap: 40px; align-items: center; padding: 32px 0 48px; }
.hero h1 { font-size: clamp(2.3rem, 6vw, 3.6rem); letter-spacing: -0.03em; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 24px 0 12px; }
.hero-card { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 24px; box-shadow: var(--shadow); transform: rotate(1.5deg); }
.demo-msg { display: flex; gap: 12px; }
.demo-avatar { flex: none; width: 40px; height: 40px; border-radius: 10px; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font-weight: 800; }
.demo-msg blockquote { margin: 8px 0; padding-left: 12px; border-left: 3px solid var(--line); color: var(--muted); }
.demo-like { display: inline-block; border: 1px solid var(--accent); background: var(--accent-soft); border-radius: 99px; padding: 1px 10px; font-size: .85rem; font-weight: 700; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.steps article { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.step-icon { font-size: 1.6rem; display: block; margin-bottom: 8px; }
@media (max-width: 760px) { .hero, .steps { grid-template-columns: 1fr; } .hero-card { transform: none; } }

/* Shop */
.wallet { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 20px; align-items: flex-end; padding: 24px; margin-bottom: 24px; border-radius: 20px; background: linear-gradient(135deg, var(--accent-soft), var(--surface)); border: 1px solid var(--line); }
.wallet .muted { margin: 0; }
.wallet-amount { font-size: clamp(2.2rem, 5vw, 3rem); font-weight: 800; letter-spacing: -0.02em; margin: 0; line-height: 1.1; }
.wallet-side { max-width: 340px; }
.wallet-side p { margin: 0 0 4px; }
.shelf { margin-bottom: 36px; scroll-margin-top: 80px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.item { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); transition: transform .15s, box-shadow .15s; }
.item:hover { transform: translateY(-2px); box-shadow: 0 6px 24px rgb(31 26 28 / 10%); }
.item-art { aspect-ratio: 16 / 9; background: var(--surface-2); display: grid; place-items: center; overflow: hidden; }
.item-art img { width: 100%; height: 100%; object-fit: cover; }
.item-emoji { font-size: 3.2rem; }
.item-body { padding: 14px 16px 4px; flex: 1; }
.item-body h3 { margin-bottom: .3em; }
.item-body p { color: var(--muted); font-size: .92rem; }
.item-foot { display: flex; align-items: center; gap: 10px; padding: 12px 16px 16px; flex-wrap: wrap; }
.item-foot form { margin-left: auto; }
.item-collective { grid-column: 1 / -1; flex-direction: row; }
.item-collective .item-art { aspect-ratio: auto; width: 180px; flex: none; }
.item-collective .item-body { padding: 18px 20px; }
.item-collective .item-body p:first-of-type { max-width: 60ch; }
.item-collective .item-foot { justify-content: center; padding: 18px 20px; }
.pledge { display: flex; gap: 8px; }
.pledge input { width: 80px; }
@media (max-width: 620px) { .item-collective { grid-column: auto; flex-direction: column; } .item-collective .item-art { width: 100%; aspect-ratio: 16 / 9; } }

/* Wall & me */
.feed { display: grid; gap: 12px; }
.post { display: flex; gap: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.post .avatar { width: 40px; height: 40px; }
.post-body { min-width: 0; flex: 1; }
.post-head { margin-bottom: 6px; }
.post-text { padding-left: 12px; border-left: 3px solid var(--accent-soft); overflow-wrap: anywhere; }
.post-meta { display: flex; gap: 14px; color: var(--muted); font-size: .84rem; margin: 8px 0 0; }
.ranks { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.ranks li { display: flex; align-items: center; gap: 10px; }
.ranks .person { flex: 1; overflow: hidden; }
.ranks .person span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank { width: 22px; text-align: center; color: var(--muted); font-weight: 700; font-size: .85rem; }
.ranks li:nth-child(1) .rank { color: #d4a017; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 24px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.kpi-value { display: block; font-size: 1.8rem; font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.kpi-label { color: var(--muted); font-size: .86rem; }
.orders, .activity { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.orders li { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.orders li div { display: grid; }
.activity li { display: grid; grid-template-columns: 48px 1fr; gap: 0 8px; font-size: .92rem; }
.activity li .small { grid-column: 2; }
.activity-amount { font-weight: 700; font-variant-numeric: tabular-nums; }
.activity-amount.plus { color: var(--ok); }
.activity-amount.minus { color: var(--muted); }

/* Admin */
.subnav { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 24px; overflow-x: auto; }
.subnav a { padding: 10px 14px; color: var(--muted); text-decoration: none; font-weight: 600; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.subnav a.active { color: var(--ink); border-color: var(--accent); }
.count { background: var(--accent); color: var(--accent-ink); border-radius: 99px; padding: 0 7px; font-size: .75rem; }
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th, .table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
.table thead th { font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); background: var(--surface-2); }
.table tbody tr:last-child td { border-bottom: 0; }
.table tr.inactive { opacity: .55; }
.table .actions { white-space: nowrap; }
.table .actions > * { margin: 0 2px 4px 0; }
.item-emoji-cell { font-size: 1.4rem; }
.row-form { display: flex; flex-wrap: wrap; gap: 6px; min-width: 260px; }
.row-form input { flex: 1 1 100%; }
.bars { display: flex; align-items: flex-end; gap: 6px; height: 160px; }
.bar { flex: 1; max-width: 44px; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 4px; }
.bar span { width: 100%; min-height: 2px; background: var(--accent); border-radius: 4px 4px 0 0; }
.bar small { font-size: .65rem; color: var(--muted); }
.toggle { width: 40px; height: 22px; border-radius: 99px; border: 0; background: var(--line); position: relative; cursor: pointer; padding: 0; }
.toggle span { position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: left .15s; }
.toggle.on { background: var(--accent); }
.toggle.on span { left: 21px; }
.toggle:disabled { opacity: .5; cursor: not-allowed; }
.search { width: 100%; max-width: 320px; }

/* Forms */
label { display: grid; gap: 6px; font-weight: 600; font-size: .9rem; }
label .muted { font-weight: 400; }
input, select, textarea { font: inherit; font-weight: 400; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 9px 11px; width: 100%; }
input:focus, select:focus, textarea:focus, .btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
textarea.code, pre.code { font: .82rem/1.45 ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--surface-2); }
pre.code { padding: 12px 14px; border-radius: 10px; overflow-x: auto; white-space: pre-wrap; }
label.check { display: flex; align-items: center; gap: 10px; font-weight: 500; }
label.check input { width: auto; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 18px; }
.form-grid h3 { margin: 0; }
.span-2, .form-grid label.check { grid-column: 1 / -1; }
.form-inline { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; margin-bottom: 20px; }
.form-inline h3 { flex-basis: 100%; margin: 0; }
.form-inline .grow { flex: 1 1 220px; }
.form-actions { display: flex; align-items: center; gap: 12px; }
.settings { display: grid; gap: 16px; }
@media (max-width: 620px) { .form-grid { grid-template-columns: 1fr; } }

/* Dialog */
.dialog { border: 1px solid var(--line); border-radius: 16px; padding: 24px; width: min(440px, calc(100vw - 32px)); background: var(--surface); color: var(--ink); box-shadow: 0 20px 60px rgb(0 0 0 / 25%); }
.dialog::backdrop { background: rgb(20 10 14 / 45%); }
.dialog label { margin: 12px 0; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; }

/* Setup */
.status-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin-bottom: 20px; }
.status-grid div { display: grid; gap: 2px; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); border-left: 4px solid var(--line); }
.status-grid div.ok { border-color: var(--ok); }
.status-grid div.warn { border-color: var(--warn); }
.status-grid span { font-size: .78rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.status-grid strong { overflow-wrap: anywhere; font-size: .95rem; }
.steps-list { display: grid; gap: 16px; margin-bottom: 16px; }
.step { scroll-margin-top: 80px; }
.step-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.step-head h2 { margin: 0; }
.step-num { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; background: var(--accent-soft); color: var(--accent); flex: none; }
.step.done .step-num { background: var(--ok-soft); color: var(--ok); }
.step-body { padding-left: 44px; }
.step-body details { margin-top: 12px; }
.step-body summary { cursor: pointer; color: var(--muted); font-weight: 600; font-size: .9rem; }
.howto { padding-left: 20px; }
.log { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; font-size: .88rem; }
.log li { display: grid; grid-template-columns: 20px 100px 1fr auto; gap: 8px; }
.log li span:first-child { color: var(--ok); }
.log li.bad span:first-child { color: var(--accent); }
.danger { margin-top: 16px; }
@media (max-width: 620px) { .step-body { padding-left: 0; } .log li { grid-template-columns: 20px 1fr; } }

/* Claude */
.hero-small { grid-template-columns: 1fr; padding: 8px 0 24px; }
.hero-small h1 { font-size: clamp(1.8rem, 4vw, 2.4rem); }
.examples { padding-left: 18px; margin: 0; display: grid; gap: 8px; font-size: .92rem; }
.consent h1 { font-size: 1.4rem; }
.person-line { display: flex; align-items: center; gap: 10px; }
.perms { list-style: none; padding: 0; display: grid; gap: 10px; margin: 18px 0; }
.perms li { background: var(--surface-2); border-radius: 10px; padding: 10px 12px; font-size: .94rem; }
.consent-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; }

/* Stats */
.stats-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 8px; }
.stats-head .chips { margin: 0; }
.columns-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-bottom: 20px; }
.columns-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 20px; }
@media (max-width: 1000px) { .columns-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 860px) { .columns-2, .columns-4 { grid-template-columns: 1fr; } }
.kpi-hint { display: block; color: var(--muted); font-size: .76rem; margin-top: 2px; }
.you { margin-bottom: 20px; background: linear-gradient(135deg, var(--accent-soft), var(--surface)); }
.you-head { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.you-head h2 { margin: 0; }
.you-head .eyebrow { margin: 0 0 2px; }
.you-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.you-grid .kpi { background: var(--surface); }
.fans { margin: 14px 0 0; }
.ranks .grow { flex: 1; }
.mini-post { padding: 10px 0; border-bottom: 1px solid var(--line); }
.mini-post:last-child { border-bottom: 0; }
.mini-post p { margin: 0 0 6px; }
.pot { margin-bottom: 12px; }
.pot p { margin: 0; }

/* How it works */
.how-rules { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 28px; text-align: center; }
.how-rules div { display: grid; gap: 2px; }
.how-rules span:last-child { color: var(--muted); font-size: .86rem; }
.how-big { font-size: 2rem; font-weight: 800; color: var(--accent); letter-spacing: -0.02em; }
.how-section { margin: 28px 0 12px; }
.how-list { display: grid; gap: 12px; }
.how-card { display: flex; gap: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; scroll-margin-top: 80px; }
.how-icon { font-size: 1.8rem; line-height: 1; flex: none; width: 40px; text-align: center; }
.how-body { min-width: 0; }
.how-body h3 { margin-bottom: 6px; }
.how-body ul { margin: 0; padding-left: 18px; display: grid; gap: 4px; }
.how-body p:last-child { margin-bottom: 0; }
.how-cmd { display: inline-block; font-size: .9rem; padding: 4px 10px; overflow-wrap: anywhere; }
.faq { display: grid; gap: 8px; }
.faq details { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 12px 16px; }
.faq summary { cursor: pointer; font-weight: 650; }
.faq details p { margin: 8px 0 0; color: var(--muted); }
.how-cta { display: flex; gap: 10px; margin-top: 28px; }
@media (max-width: 760px) { .how-rules { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
