:root {
  --purple: #5a1979; --purple-dk: #2e0056; --purple-lt: #f4eef8; --line: #e3dbe9;
  --green: #2f8f5b; --amber: #c77700; --red: #b3261e; --ink: #1f1a24; --muted: #6b6477; --bg: #faf8fb;
  --radius: 12px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; color: var(--ink); background: var(--bg); }
a { color: var(--purple); }
img { max-width: 100%; }
h1, h2, h3 { line-height: 1.2; color: var(--purple-dk); }
h1 { font-size: 1.8rem; margin: .6rem 0 .8rem; }
h2 { font-size: 1.3rem; margin: 1.8rem 0 .8rem; }
h3 { font-size: 1.05rem; margin: 0 0 .5rem; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.lead { font-size: 1.1rem; }
.hidden, [hidden] { display: none !important; }
.center { text-align: center; }
.danger { color: var(--red) !important; }

/* header */
.top { background: var(--purple-dk); color: #fff; }
.top-in { display: flex; align-items: center; justify-content: space-between; padding-top: 10px; padding-bottom: 10px; }
.brand { display: flex; align-items: center; gap: 12px; color: #fff; text-decoration: none; font-weight: 700; font-size: 1.1rem; }
.brand img { background: #fff; border-radius: 50%; }
.brand small { display: block; font-weight: 400; font-size: .75rem; opacity: .8; }
.menu-btn { display: none; background: none; border: 1px solid rgba(255,255,255,.4); color: #fff; font-size: 1.3rem; border-radius: 8px; padding: 2px 10px; }
.nav { display: flex; flex-wrap: wrap; gap: 4px 2px; align-items: center; padding-bottom: 10px; }
.nav a, .nav .linklike { color: #eadcf3; text-decoration: none; padding: 6px 10px; border-radius: 8px; font-size: .95rem; }
.nav a:hover, .nav a.on { background: rgba(255,255,255,.12); color: #fff; }
.nav-right { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.nav .btn { color: var(--purple-dk); background: #fff; }
@media (max-width: 720px) {
  .menu-btn { display: block; }
  .nav { display: none; flex-direction: column; align-items: stretch; }
  .nav.open { display: flex; }
  .nav-right { margin-left: 0; flex-wrap: wrap; }
  .brand small { display: none; }
}

main { padding-top: 12px; padding-bottom: 40px; min-height: 60vh; }
.foot { border-top: 1px solid var(--line); padding-top: 16px; padding-bottom: 30px; color: var(--muted); font-size: .9rem; }

/* buttons & forms */
.btn { display: inline-block; background: var(--purple); color: #fff; border: 0; border-radius: 10px; padding: 10px 18px; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; line-height: 1.2; }
.btn:hover { background: var(--purple-dk); }
.btn:disabled { opacity: .5; cursor: default; }
.btn-sm { padding: 6px 12px; font-size: .9rem; }
.btn-lg { padding: 13px 24px; font-size: 1.05rem; }
.btn-ghost { background: #fff; color: var(--purple); border: 1.5px solid var(--purple); }
.btn-ghost:hover { background: var(--purple-lt); }
.btn-danger { background: var(--red); }
.linklike { background: none; border: 0; padding: 0; color: var(--purple); cursor: pointer; font: inherit; text-decoration: underline; }
form.inline { display: inline; }
label { display: block; margin: .7rem 0; font-weight: 600; font-size: .95rem; }
label .muted { font-weight: 400; }
input:not([type=checkbox]):not([type=radio]):not([type=range]), select, textarea {
  display: block; width: 100%; margin-top: 4px; padding: 9px 11px; border: 1.5px solid var(--line); border-radius: 9px; font: inherit; font-weight: 400; background: #fff; color: var(--ink);
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--purple); outline-offset: 1px; border-color: var(--purple); }
input[type=range] { width: 100%; accent-color: var(--purple); }
input[type=checkbox], input[type=radio] { accent-color: var(--purple); width: 18px; height: 18px; }
input.short, .short { max-width: 140px; }
select.tiny { display: inline-block; width: auto; padding: 3px 6px; font-size: .85rem; margin: 0; }
.radio, .inline-check { font-weight: 400; display: flex; gap: 8px; align-items: flex-start; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 14px; }
@media (max-width: 640px) { .grid2, .grid3 { grid-template-columns: 1fr; } }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row input:not([type=checkbox]) { flex: 1; width: auto; margin: 0; }
.hp { position: absolute; left: -5000px; }
fieldset { border: 0; padding: 0; margin: 0; }
legend { font-weight: 700; color: var(--purple-dk); margin: .8rem 0 .3rem; font-size: .9rem; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { margin: 0; font-weight: 400; cursor: pointer; }
.chip input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.chip span { display: inline-block; padding: 6px 12px; border: 1.5px solid var(--line); border-radius: 999px; background: #fff; font-size: .9rem; user-select: none; }
.chip input:checked + span { background: var(--purple); border-color: var(--purple); color: #fff; }
.chip input:focus-visible + span { outline: 2px solid var(--purple); outline-offset: 2px; }
.anything { display: flex; gap: 10px; align-items: flex-start; background: var(--purple-lt); padding: 12px; border-radius: 10px; font-weight: 400; }
.consent { display: flex; gap: 10px; font-weight: 400; background: #fffbe8; padding: 10px; border-radius: 10px; }
.form-actions { margin-top: 1.5rem; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.narrow { max-width: 720px; margin: 0 auto; }

/* flash */
.flash { padding: 12px 14px; border-radius: 10px; margin: 10px 0; background: #e8f5ee; border: 1px solid #b6dfc6; }
.flash-err { background: #fdecea; border-color: #f2b8b5; }
.flash-info { background: var(--purple-lt); border-color: var(--line); }
.flash pre { white-space: pre-wrap; font-size: .8rem; }

/* cards */
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); margin: 12px 0; }
.pad { padding: 16px 18px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.task-card { display: flex; flex-direction: column; margin: 0; text-decoration: none; color: inherit; overflow: hidden; transition: transform .1s, box-shadow .1s; }
.task-card:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(46,0,86,.12); }
.thumb { aspect-ratio: 16/10; background: var(--purple-lt); overflow: hidden; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.nophoto { display: flex; align-items: center; justify-content: center; height: 100%; font-size: 2.4rem; opacity: .5; }
.card-body { padding: 12px 14px 14px; }
.card-body h3 { margin: 6px 0 2px; color: var(--ink); }
.card-body p { margin: 2px 0 6px; }
.need { color: var(--amber); font-weight: 600; }
.area-card { display: block; text-decoration: none; color: inherit; margin: 0; }
.area-card:hover { border-color: var(--purple); }

/* badges */
.badges { display: flex; gap: 6px; flex-wrap: wrap; }
.badge { display: inline-block; font-size: .75rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: #eee; color: #444; vertical-align: middle; }
.urg-1 { background: #e7f1ec; color: #256b46; }
.urg-2 { background: #eef0f7; color: #3a4a78; }
.urg-3 { background: #fff1dc; color: #8a5200; }
.urg-4 { background: #fde2e0; color: var(--red); }
.st-draft { background: #eee; }
.st-open { background: var(--purple-lt); color: var(--purple); }
.st-in_progress { background: #e5f0fb; color: #1e5a8a; }
.st-on_hold { background: #f3f3f3; color: #666; }
.st-done { background: #e3f4ea; color: #1f6b41; }
.badge.skill { background: var(--purple-lt); color: var(--purple); font-weight: 600; }

/* progress */
.pbar { position: relative; background: #ece6f1; border-radius: 999px; height: 12px; overflow: hidden; margin: 8px 0; }
.pbar span { display: block; height: 100%; background: linear-gradient(90deg, var(--green), #46b07a); border-radius: 999px; transition: width .4s; }
.pbar em { position: absolute; right: 8px; top: -2px; font-size: .7rem; font-style: normal; font-weight: 700; color: var(--purple-dk); display: none; }
.pbar.big { height: 24px; }
.pbar.big em { display: block; top: 3px; font-size: .8rem; }
.pbar.thin { height: 7px; }
.pbar.money span { background: linear-gradient(90deg, var(--purple), #8a4bb0); }

/* hero & stats */
.hero { display: flex; gap: 24px; align-items: center; background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 24px; margin: 10px 0 16px; }
.hero h1 { font-size: 2rem; margin-top: 0; }
.hero-logo { width: 110px; flex-shrink: 0; }
@media (max-width: 640px) { .hero { flex-direction: column-reverse; text-align: center; } .hero-logo { width: 100px; } }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 14px 0; }
.stats div { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; text-align: center; }
.stats strong { display: block; font-size: 1.6rem; color: var(--purple); }
.stats span { font-size: .85rem; color: var(--muted); }
@media (max-width: 640px) { .stats { grid-template-columns: repeat(2, 1fr); } }
.section-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
@media (max-width: 760px) { .cols { grid-template-columns: 1fr; } }
.list { list-style: none; padding: 0; margin: 0; }
.list li { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin-bottom: 8px; }
.steps-how li { margin-bottom: 8px; }
.how { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 4px 20px 12px; margin-top: 24px; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 16px; }
.filters input, .filters select { width: auto !important; margin: 0 !important; flex: 1 1 160px; }
.crumbs { font-size: .9rem; margin: 4px 0; }

/* task page */
.task-head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: flex-start; }
.task-head h1 { margin: 6px 0 2px; }
.task-actions { display: flex; gap: 8px; align-items: center; }
.coord-bar { background: var(--purple-lt); border-radius: 10px; padding: 10px 12px; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin: 10px 0; }
.coord-bar select { display: inline-block; width: auto; margin: 0 4px; padding: 5px 8px; }
.task-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 24px; margin-top: 12px; }
@media (max-width: 860px) { .task-grid { grid-template-columns: 1fr; } }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin-bottom: 12px; }
.gallery figure { margin: 0; position: relative; }
.gallery img { width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: 10px; display: block; }
.gallery.small-g { grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); margin: 6px 0 0; }
.del-photo { position: absolute; top: 4px; right: 4px; }
.del-photo button { background: rgba(0,0,0,.6); color: #fff; border: 0; border-radius: 50%; width: 26px; height: 26px; cursor: pointer; }
.desc { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.step-list { list-style: none; padding: 0; margin: 0; }
.step { background: #fff; border: 1px solid var(--line); border-left: 5px solid var(--purple); border-radius: var(--radius); padding: 12px 14px; margin-bottom: 12px; scroll-margin-top: 20px; }
.step.st-done { border-left-color: var(--green); }
.step.st-in_progress { border-left-color: #1e5a8a; }
.step.blocked { border-left-color: #bbb; }
.step.mine { box-shadow: 0 0 0 2px var(--purple-lt); }
.step:target { box-shadow: 0 0 0 3px var(--purple); }
.step-head { display: flex; gap: 12px; align-items: flex-start; }
.step-num { flex-shrink: 0; width: 30px; height: 30px; border-radius: 50%; background: var(--purple); color: #fff; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.st-done .step-num { background: var(--green); }
.step-desc { margin: 6px 0 0 42px; font-size: .95rem; }
.waiting { color: var(--amber); margin: 6px 0 0; }
.vols { margin: 6px 0; }
.step-actions { margin-top: 8px; }
.signup-form { display: flex; gap: 8px; flex-wrap: wrap; }
.signup-form input { flex: 1 1 200px; margin: 0 !important; width: auto !important; }
details summary { cursor: pointer; color: var(--purple); font-weight: 600; margin: 6px 0; }
.progress-form form { background: var(--bg); padding: 10px 12px; border-radius: 10px; }
.progress-form output { font-weight: 700; color: var(--purple); }
.hours-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 6px 0; }
.hours-row span { flex: 1; }
.hours-row input { width: 110px !important; margin: 0 !important; }
.feed { list-style: none; padding: 0; }
.feed li { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin-bottom: 8px; }
.feed .kind-progress { border-left: 4px solid #1e5a8a; }
.feed .kind-signup, .feed .kind-pledge { border-left: 4px solid var(--green); }
.feed-body { margin-top: 4px; }
.comment-form textarea { margin-bottom: 8px; }
.comment-form input[type=file] { flex: 1; }
.needs { list-style: none; padding: 0; margin: 0; }
.needs li { border-bottom: 1px solid var(--line); padding: 8px 0; }
.needs li:last-child { border: 0; }
.need-received { opacity: .65; }
.danger-zone { margin-top: 20px; }

/* task edit */
.step-row { background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px; margin-bottom: 12px; }
.step-row-head { display: flex; gap: 12px; align-items: center; }
.step-row-head .step-no { flex: 1; color: var(--purple-dk); }
.grid-need { display: grid; grid-template-columns: 1fr 110px 110px 30px; gap: 8px; align-items: center; margin-bottom: 6px; }
.grid-need input { margin: 0 !important; }
@media (max-width: 560px) { .grid-need { grid-template-columns: 1fr 80px 80px 24px; } }

/* tables */
.table-wrap { overflow-x: auto; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); margin: 12px 0; }
table { border-collapse: collapse; width: 100%; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: var(--purple-lt); font-size: .85rem; color: var(--purple-dk); }
td input, td select { margin: 0 !important; padding: 5px 7px !important; }
tr.unverified { opacity: .6; }
tr.pl-cancelled { opacity: .5; text-decoration: line-through; }
.vol-table td:first-child, .vol-table th:first-child { width: 30px; }

/* photo picker */
.photo-picker { margin: 6px 0 10px; }
.pp-buttons { display: flex; gap: 8px; flex-wrap: wrap; }
.pp-btn { margin: 0; flex: 1 1 150px; text-align: center; padding: 12px 14px; font-weight: 600; }
.pp-thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; margin-top: 10px; }
.pp-thumbs:empty { display: none; }
.pp-thumb { position: relative; margin: 0; aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: var(--purple-lt); }
.pp-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pp-thumb.loading::after { content: '…'; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 1.5rem; color: var(--purple); }
.pp-thumb button { position: absolute; top: 4px; right: 4px; width: 28px; height: 28px; border-radius: 50%; border: 0; background: rgba(0,0,0,.65); color: #fff; font-size: .9rem; cursor: pointer; }
.pp-status { margin: 6px 0 0; }
.add-photos summary { font-size: 1.05rem; }
.btn-block { display: block; width: 100%; }
.row.end { justify-content: flex-end; margin-top: 8px; }
@media (max-width: 720px) {
  .btn, .chip span { min-height: 44px; }
  .btn-sm { min-height: 38px; }
  .nav-right .btn { flex: 1 1 auto; text-align: center; }
}
.step { color: var(--ink); }
.code-input { font-size: 1.6rem !important; letter-spacing: .3em; text-align: center; font-variant-numeric: tabular-nums; }
.install-tip summary { font-size: 1.02rem; }
.install-tip ol { padding-left: 1.2rem; margin: .3rem 0; }
.install-banner { background: #fff; border-bottom: 1px solid var(--line); box-shadow: 0 2px 10px rgba(46,0,86,.08); }
.ib-in { display: flex; align-items: center; gap: 12px; padding-top: 10px; padding-bottom: 10px; }
.ib-in img { border-radius: 10px; flex-shrink: 0; }
.ib-text { flex: 1; line-height: 1.3; min-width: 0; }
.ib-in .btn { white-space: nowrap; }
.ib-text strong { display: block; color: var(--purple-dk); }
.ib-text span { font-size: .85rem; color: var(--muted); }
.ib-close { background: none; border: 0; font-size: 1.1rem; color: var(--muted); cursor: pointer; padding: 6px; }
.ib-ios { padding-bottom: 12px; }
.ib-ios ol { margin: 0; padding-left: 1.3rem; font-size: .92rem; }
.ib-ios li { margin-bottom: 4px; }
.ios-share { display: inline-flex; vertical-align: -3px; color: #0a84ff; }
