/* ===== A Place Called Home – Waxahachie · Licensing =====
   Design: warm "editorial home" — cream paper, pine green + terracotta,
   New York serif for display type, calm and uncluttered.                    */
:root {
  --bg: #f3ede2;
  --surface: #fffdf8;
  --surface-2: #efe7d8;
  --surface-3: #e7ddca;
  --text: #2a2621;
  --muted: #82786a;
  --faint: #a99d8a;
  --line: #e7ddca;
  --hair: #efe7d8;
  --brand: #2f6b57;
  --brand-ink: #24503f;
  --brand-soft: rgba(47, 107, 87, .10);
  --accent: #c1663f;
  --accent-soft: rgba(193, 102, 63, .12);
  --blue: #3a6ea5;
  --blue-soft: rgba(58, 110, 165, .12);
  --ok: #3c855a;
  --ok-soft: rgba(60, 133, 90, .13);
  --warn: #b9822a;
  --warn-soft: rgba(185, 130, 42, .15);
  --danger: #bd4d3c;
  --danger-soft: rgba(189, 77, 60, .12);
  --shadow: 0 1px 2px rgba(75, 60, 40, .06), 0 8px 22px rgba(75, 60, 40, .07);
  --shadow-sm: 0 1px 2px rgba(75, 60, 40, .07);
  --shadow-lg: 0 10px 44px rgba(50, 38, 24, .22);
  --radius: 18px;
  --radius-sm: 13px;
  --tabbar-h: 64px;
  --serif: ui-serif, "New York", Georgia, "Iowan Old Style", "Palatino", serif;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, "Segoe UI", Roboto, sans-serif;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}
html[data-theme="dark"] {
  --bg: #17130f;
  --surface: #201b16;
  --surface-2: #29231b;
  --surface-3: #342c22;
  --text: #efe7db;
  --muted: #a99d8b;
  --faint: #776c5c;
  --line: #322a20;
  --hair: #29231b;
  --brand: #58a789;
  --brand-ink: #74c2a3;
  --brand-soft: rgba(88, 167, 137, .14);
  --accent: #dd875c;
  --accent-soft: rgba(221, 135, 92, .16);
  --blue: #6f9fd8;
  --blue-soft: rgba(111, 159, 216, .16);
  --ok: #4fb178;
  --ok-soft: rgba(79, 177, 120, .16);
  --warn: #d69f3e;
  --warn-soft: rgba(214, 159, 62, .18);
  --danger: #dd6e5c;
  --danger-soft: rgba(221, 110, 92, .16);
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.34);
  --shadow-sm: 0 1px 2px rgba(0,0,0,.4);
  --shadow-lg: 0 12px 46px rgba(0,0,0,.55);
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  font-size: 16px; line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; border: none; background: none; }
a { color: var(--brand-ink); text-decoration: none; }
::-webkit-scrollbar { width: 0; height: 0; }
.serif { font-family: var(--serif); }

/* ===== shell ===== */
#app { min-height: 100%; }
.screen { display: flex; flex-direction: column; min-height: 100vh; }
.appbar {
  position: sticky; top: 0; z-index: 20;
  padding: calc(var(--safe-top) + 14px) 20px 12px;
  background: color-mix(in srgb, var(--bg) 84%, transparent);
  backdrop-filter: saturate(160%) blur(16px);
  -webkit-backdrop-filter: saturate(160%) blur(16px);
  border-bottom: 1px solid var(--hair);
}
.appbar-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.appbar h1 { font-family: var(--serif); font-size: 27px; font-weight: 600; letter-spacing: -.01em; line-height: 1.05; }
.appbar .sub { font-size: 12px; color: var(--muted); margin-top: 3px; font-weight: 600; letter-spacing: .01em; }
.content { flex: 1; padding: 18px 18px calc(var(--tabbar-h) + var(--safe-bottom) + 24px); }
.content.narrow { max-width: 640px; margin: 0 auto; width: 100%; }

/* ===== tab bar ===== */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  height: calc(var(--tabbar-h) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  display: flex;
  background: color-mix(in srgb, var(--surface) 90%, transparent);
  backdrop-filter: saturate(160%) blur(20px);
  -webkit-backdrop-filter: saturate(160%) blur(20px);
  border-top: 1px solid var(--line);
}
.tab {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; color: var(--faint); font-size: 10.5px; font-weight: 700; letter-spacing: .02em;
  transition: color .15s;
}
.tab svg { width: 23px; height: 23px; }
.tab.active { color: var(--brand); }

/* ===== cards & sections ===== */
.card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); }
.section-title {
  font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .13em;
  color: var(--faint); margin: 26px 6px 12px; display: flex; align-items: center; gap: 8px;
}
.section-title:first-child { margin-top: 6px; }
.stack > * + * { margin-top: 12px; }

/* ===== buttons ===== */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 18px; border-radius: 13px; font-weight: 650; font-size: 15px;
  background: var(--surface-3); color: var(--text); transition: transform .06s, filter .15s; }
.btn:active { transform: scale(.975); }
.btn-primary { background: var(--brand); color: #fff8; color: #fff; }
.btn-accent { background: var(--accent); color: #fff; }
.btn-block { width: 100%; }
.btn-sm { padding: 8px 13px; font-size: 13px; border-radius: 10px; }
.btn-ghost { background: transparent; color: var(--brand-ink); }
.btn-danger { background: var(--danger-soft); color: var(--danger); }
.btn[disabled] { opacity: .5; pointer-events: none; }

/* ===== chips ===== */
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 6px; margin: 0 -2px; scrollbar-width: none; }
.chip { flex: 0 0 auto; padding: 8px 14px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line);
  font-size: 13.5px; font-weight: 650; color: var(--muted); white-space: nowrap; transition: all .12s; }
.chip.active { background: var(--brand); border-color: var(--brand); color: #fff; }
.chip .n { opacity: .65; margin-left: 4px; font-variant-numeric: tabular-nums; }

/* ===== progress ring / bar ===== */
.ring { position: relative; flex: 0 0 auto; }
.ring svg { transform: rotate(-90deg); }
.ring .ring-label { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ring .ring-pct { font-family: var(--serif); font-size: 26px; font-weight: 600; letter-spacing: -.01em; }
.ring .ring-cap { font-size: 9.5px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .12em; }
.ring-wrap { display: flex; align-items: center; gap: 18px; }
.bar { height: 8px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.bar > span { display: block; height: 100%; border-radius: 999px; background: var(--brand); transition: width .55s cubic-bezier(.4,1.2,.4,1); }
.bar.thin { height: 6px; }

/* ===== hero ===== */
.hero { padding: 22px; }
.hero .hi { font-family: var(--serif); font-size: 21px; font-weight: 600; letter-spacing: -.01em; }
.hero .ring-sub { font-size: 13.5px; color: var(--muted); font-weight: 500; margin-top: 4px; }
.hero .ring-sub b { color: var(--text); font-weight: 700; }
.metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 11px; margin-top: 18px; }
.metric { background: var(--surface-2); border-radius: var(--radius-sm); padding: 13px 10px; text-align: center; }
.metric .v { font-family: var(--serif); font-size: 23px; font-weight: 600; letter-spacing: -.01em; }
.metric .k { font-size: 10.5px; color: var(--muted); font-weight: 700; margin-top: 3px; text-transform: uppercase; letter-spacing: .05em; }

/* ===== task cards ===== */
.task { background: var(--surface); border-radius: var(--radius-sm); box-shadow: var(--shadow-sm); padding: 15px 15px; display: flex; gap: 13px; align-items: flex-start; }
.task:active { background: var(--surface-2); }
.task .check { flex: 0 0 auto; width: 25px; height: 25px; border-radius: 50%; border: 1.5px solid var(--faint); display: flex; align-items: center; justify-content: center; margin-top: 2px; transition: all .15s; }
.task .check svg { width: 14px; height: 14px; color: #fff; opacity: 0; }
.task[data-status="done"] .check { background: var(--ok); border-color: var(--ok); }
.task[data-status="done"] .check svg { opacity: 1; }
.task[data-status="in_progress"] .check { border-color: var(--brand); }
.task[data-status="in_progress"] .check::after { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--brand); }
.task[data-status="blocked"] .check { border-color: var(--danger); }
.task[data-status="blocked"] .check::after { content: "!"; color: var(--danger); font-weight: 800; font-size: 14px; }
.task .body { flex: 1; min-width: 0; }
.task .t-title { font-family: var(--serif); font-size: 16.5px; font-weight: 550; letter-spacing: -.005em; line-height: 1.28; }
.task[data-status="done"] .t-title { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--faint); }
.task .t-sum { font-size: 13px; color: var(--muted); margin-top: 4px; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.task .t-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 11px; align-items: center; }
.task.is-blocked { opacity: .8; }
.task.is-blocked .check { border-style: dashed; }

/* pills — subtle, warm */
.pill { font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 8px; letter-spacing: .01em; display: inline-flex; align-items: center; gap: 4px; }
.pill-trade { background: var(--brand-soft); color: var(--brand-ink); }
.pill-hard { background: var(--accent-soft); color: var(--accent); }
.pill-lead { background: var(--warn-soft); color: var(--warn); }
.pill-verify { background: var(--warn-soft); color: var(--warn); }
.pill-block { background: var(--surface-3); color: var(--muted); }
.pill-ready { background: var(--ok-soft); color: var(--ok); }
.pill-id { background: transparent; color: var(--faint); font-weight: 700; padding-left: 0; padding-right: 4px; }
.pill-tier { background: var(--surface-3); color: var(--muted); }
.pill-due { background: var(--surface-3); color: var(--muted); }
.pill-due.soon { background: var(--warn-soft); color: var(--warn); }
.pill-due.over { background: var(--danger-soft); color: var(--danger); }
.task .t-assignee { flex: 0 0 auto; }

/* avatar */
.avatar { flex: 0 0 auto; width: 31px; height: 31px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 12px; font-weight: 700; letter-spacing: -.01em; }
.avatar.sm { width: 25px; height: 25px; font-size: 10.5px; }
.avatar.lg { width: 46px; height: 46px; font-size: 17px; box-shadow: var(--shadow-sm); }

.empty { text-align: center; color: var(--muted); padding: 46px 24px; }
.empty .big { font-size: 40px; margin-bottom: 10px; }
.empty p { font-size: 14px; line-height: 1.5; }

/* ===== trade cards ===== */
.trade-card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow-sm); overflow: hidden; }
.trade-head { display: flex; gap: 14px; align-items: center; padding: 16px; }
.trade-icon { flex: 0 0 auto; width: 48px; height: 48px; border-radius: 14px; background: var(--brand-soft); display: flex; align-items: center; justify-content: center; font-size: 24px; }
.trade-head .th-title { font-family: var(--serif); font-size: 17px; font-weight: 600; letter-spacing: -.005em; }
.trade-head .th-blurb { font-size: 12.5px; color: var(--muted); margin-top: 3px; line-height: 1.4; }
.trade-head .th-count { font-size: 12px; font-weight: 700; color: var(--muted); text-align: right; flex: 0 0 auto; font-variant-numeric: tabular-nums; }
.trade-head .th-count span { font-family: var(--serif); font-size: 15px; }
.trade-coord { margin: 0 16px 14px; padding: 12px 13px; background: var(--accent-soft); border-radius: 12px; font-size: 12.5px; color: var(--text); line-height: 1.5; display: flex; gap: 9px; }
.trade-progress { padding: 0 16px 14px; }
.trade-assign { padding: 0 16px 14px; }
.seq-group { border-top: 1px solid var(--hair); }
.seq-label { font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .1em; color: var(--faint); padding: 12px 16px 4px; }
.mini-task { padding: 10px 16px; display: flex; gap: 11px; align-items: center; }
.mini-task:active { background: var(--surface-2); }
.mini-task .mt-check { flex: 0 0 auto; width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid var(--faint); display: flex; align-items:center; justify-content:center; }
.mini-task[data-status="done"] .mt-check { background: var(--ok); border-color: var(--ok); }
.mini-task[data-status="done"] .mt-check svg { width: 11px; height: 11px; color: #fff; }
.mini-task[data-status="in_progress"] .mt-check { border-color: var(--brand); }
.mini-task .mt-title { flex: 1; font-size: 14px; font-weight: 500; min-width: 0; }
.mini-task[data-status="done"] .mt-title { color: var(--muted); text-decoration: line-through; }
.mini-task .mt-note { font-size: 11.5px; color: var(--faint); margin-top: 2px; line-height: 1.35; }
.collapse-btn { width: 100%; padding: 13px; text-align: center; font-size: 13px; font-weight: 700; color: var(--brand-ink); border-top: 1px solid var(--hair); }

/* ===== leaderboard / activity ===== */
.leader { display: flex; align-items: center; gap: 13px; padding: 14px 16px; }
.leader + .leader { border-top: 1px solid var(--hair); }
.leader .rank { flex: 0 0 auto; width: 22px; text-align: center; font-family: var(--serif); font-weight: 600; color: var(--faint); font-size: 16px; }
.leader .l-body { flex: 1; min-width: 0; }
.leader .l-name { font-size: 15px; font-weight: 650; }
.leader .l-sub { font-size: 12px; color: var(--muted); margin-top: 3px; }
.leader .l-done { flex: 0 0 auto; text-align: right; }
.leader .l-done .v { font-family: var(--serif); font-size: 21px; font-weight: 600; color: var(--brand); }
.leader .l-done .k { font-size: 9.5px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.medal { font-size: 17px; }
.activity-item { display: flex; gap: 12px; padding: 13px 16px; align-items: flex-start; }
.activity-item + .activity-item { border-top: 1px solid var(--hair); }
.activity-item .a-body { flex: 1; min-width: 0; }
.activity-item .a-text { font-size: 13.5px; line-height: 1.45; }
.activity-item .a-text b { font-weight: 700; }
.activity-item .a-time { font-size: 11.5px; color: var(--faint); margin-top: 3px; }
.kudos-btn { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 4px; padding: 5px 11px; border-radius: 999px; background: var(--surface-2); font-size: 12.5px; font-weight: 700; color: var(--muted); }
.kudos-btn.on { background: var(--accent-soft); color: var(--accent); }

/* ===== bottom sheet ===== */
.sheet-backdrop { position: fixed; inset: 0; z-index: 50; background: rgba(30, 22, 12, .42); opacity: 0; transition: opacity .22s; }
.sheet-backdrop.show { opacity: 1; }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 51; background: var(--bg);
  border-radius: 26px 26px 0 0; box-shadow: var(--shadow-lg); max-height: 93vh; display: flex; flex-direction: column;
  transform: translateY(100%); transition: transform .3s cubic-bezier(.32,.72,0,1); }
.sheet.show { transform: translateY(0); }
.sheet-grip { display: flex; justify-content: center; padding: 10px 0 4px; flex: 0 0 auto; }
.sheet-grip span { width: 40px; height: 5px; border-radius: 999px; background: var(--line); }
.sheet-head { padding: 6px 20px 14px; display: flex; align-items: flex-start; gap: 12px; flex: 0 0 auto; border-bottom: 1px solid var(--hair); }
.sheet-head .sh-title { font-family: var(--serif); font-size: 21px; font-weight: 600; letter-spacing: -.01em; line-height: 1.2; }
.sheet-head .x { flex: 0 0 auto; width: 33px; height: 33px; border-radius: 50%; background: var(--surface-3); display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 17px; }
.sheet-body { overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 18px 20px calc(var(--safe-bottom) + 26px); }
.sheet-body > * + * { margin-top: 16px; }

.info-block { background: var(--surface); border-radius: 15px; padding: 15px; box-shadow: var(--shadow-sm); }
.info-block .ib-label { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); margin-bottom: 8px; display: flex; align-items: center; gap: 6px; }
.info-block p, .info-block .ib-text { font-size: 15px; line-height: 1.6; color: var(--text); white-space: pre-wrap; }
.info-block.verify { background: var(--warn-soft); }
.info-block.verify .ib-label { color: var(--warn); }
.kv { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; }
.kv .kv-item { background: var(--surface); border-radius: 13px; padding: 12px 13px; box-shadow: var(--shadow-sm); }
.kv .kv-k { font-size: 10.5px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.kv .kv-v { font-size: 14.5px; font-weight: 650; margin-top: 4px; }
.source-link { display: flex; gap: 9px; align-items: flex-start; padding: 11px 0; border-bottom: 1px solid var(--hair); font-size: 14px; }
.source-link:last-child { border-bottom: none; }
.source-link .sl-cite { color: var(--muted); font-size: 12px; margin-top: 2px; }

.seg { display: flex; background: var(--surface-3); border-radius: 12px; padding: 3px; gap: 3px; }
.seg button { flex: 1; padding: 10px 6px; border-radius: 10px; font-size: 13px; font-weight: 650; color: var(--muted); }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.seg.status button.on[data-v="in_progress"] { color: var(--brand); }
.seg.status button.on[data-v="blocked"] { color: var(--danger); }
.seg.status button.on[data-v="done"] { color: var(--ok); }

/* assign chips (admin) */
.assign-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.assign-chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px 5px 5px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); font-size: 13px; font-weight: 600; color: var(--muted); }
.assign-chip.plain { padding: 8px 14px; }
.assign-chip.on { background: var(--brand); border-color: var(--brand); color: #fff; }

/* comments */
.comment { display: flex; gap: 11px; padding: 11px 0; }
.comment .c-body { flex: 1; min-width: 0; }
.comment .c-head { display: flex; gap: 7px; align-items: baseline; }
.comment .c-name { font-size: 13px; font-weight: 700; }
.comment .c-time { font-size: 11px; color: var(--faint); }
.comment .c-text { font-size: 14.5px; line-height: 1.5; margin-top: 3px; white-space: pre-wrap; }
.thumbs { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.thumb { width: 76px; height: 76px; border-radius: 11px; object-fit: cover; background: var(--surface-3); border: 1px solid var(--line); }
.thumb.file { display: flex; align-items: center; justify-content: center; flex-direction: column; font-size: 10px; color: var(--muted); font-weight: 700; text-align: center; padding: 6px; }
.composer { display: flex; gap: 8px; align-items: flex-end; }
.composer textarea { flex: 1; resize: none; background: var(--surface); border: 1px solid var(--line); border-radius: 13px; padding: 11px 13px; font-size: 15px; max-height: 110px; }
.icon-btn { flex: 0 0 auto; width: 44px; height: 44px; border-radius: 13px; background: var(--surface-3); display: flex; align-items: center; justify-content: center; color: var(--muted); }
.icon-btn svg { width: 20px; height: 20px; }

/* forms */
.field { margin-bottom: 15px; }
.field label { display: block; font-size: 12.5px; font-weight: 700; color: var(--muted); margin-bottom: 7px; }
.field input, .field select, .field textarea {
  width: 100%; background: var(--surface); border: 1px solid var(--line); border-radius: 13px;
  padding: 14px; font-size: 16px; }
.field input:focus, .field textarea:focus, .field select:focus { outline: none; border-color: var(--brand); }
.field textarea { resize: vertical; min-height: 90px; }

/* login */
.login { min-height: 100vh; display: flex; flex-direction: column; justify-content: center; padding: 34px 26px calc(var(--safe-bottom) + 34px); max-width: 460px; margin: 0 auto; width: 100%; }
.login .logo { width: 76px; height: 76px; border-radius: 22px; background: linear-gradient(155deg, var(--brand), var(--brand-ink)); display: flex; align-items: center; justify-content: center; font-size: 40px; margin: 0 auto 20px; box-shadow: var(--shadow); }
.login h1 { font-family: var(--serif); font-size: 30px; font-weight: 600; text-align: center; letter-spacing: -.015em; line-height: 1.1; }
.login .tag { text-align: center; color: var(--muted); font-size: 14px; margin: 8px 0 28px; font-weight: 500; }
.login .err { background: var(--danger-soft); color: var(--danger); padding: 12px 15px; border-radius: 13px; font-size: 13.5px; font-weight: 600; margin-bottom: 15px; text-align: center; }
.login .hint { text-align: center; color: var(--faint); font-size: 12.5px; margin-top: 22px; line-height: 1.55; }

/* lists */
.list { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow-sm); overflow: hidden; }
.list-row { display: flex; align-items: center; gap: 13px; padding: 15px 16px; }
.list-row + .list-row { border-top: 1px solid var(--hair); }
.list-row:active { background: var(--surface-2); }
.list-row .lr-body { flex: 1; min-width: 0; }
.list-row .lr-title { font-size: 15px; font-weight: 600; }
.list-row .lr-sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.list-row .chev { color: var(--faint); font-size: 19px; }
.role-tag { font-size: 10px; font-weight: 800; padding: 2px 8px; border-radius: 6px; text-transform: uppercase; letter-spacing: .04em; }
.role-tag.admin { background: var(--brand-soft); color: var(--brand-ink); }
.role-tag.manager { background: var(--blue-soft); color: var(--blue); }
.role-tag.member { background: var(--surface-3); color: var(--muted); }

/* banner */
.banner { background: var(--warn-soft); color: var(--warn); border-radius: 15px; padding: 14px 16px; font-size: 13.5px; font-weight: 600; display: flex; gap: 11px; align-items: flex-start; line-height: 1.45; }

/* search */
.search { display: flex; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 13px; padding: 12px 14px; margin-bottom: 12px; box-shadow: var(--shadow-sm); }
.search svg { width: 18px; height: 18px; color: var(--faint); flex: 0 0 auto; }
.search input { flex: 1; background: none; border: none; outline: none; font-size: 15px; }

/* dependency flow */
.flow-banner { border-radius: 15px; padding: 14px 15px; box-shadow: var(--shadow-sm); }
.flow-banner.blocked { background: var(--surface); border-left: 4px solid var(--warn); }
.flow-banner.ready { background: var(--ok-soft); }
.flow-banner .fb-head { font-size: 14.5px; font-weight: 750; }
.flow-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-top: 1px solid var(--hair); }
.flow-row:first-of-type { border-top: none; }
.flow-row .flow-title { flex: 1; min-width: 0; font-size: 13.5px; font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.flow-dot { flex: 0 0 auto; width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid var(--faint); display: flex; align-items: center; justify-content: center; font-size: 11px; color: #fff; font-weight: 900; }
.flow-dot.done { background: var(--ok); border-color: var(--ok); }
.flow-dot.in_progress { border-color: var(--brand); }
.flow-dot.blocked { border-color: var(--danger); }

/* toast / fab / spinner */
#toast-root { position: fixed; left: 0; right: 0; bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 16px); z-index: 60; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; }
.toast { background: #2e2213; color: #fdf6ea; padding: 12px 20px; border-radius: 999px; font-size: 13.5px; font-weight: 600; box-shadow: var(--shadow-lg); animation: toastin .25s; max-width: 90%; }
html[data-theme="dark"] .toast { background: #3a3226; }
@keyframes toastin { from { transform: translateY(14px); opacity: 0; } }
.fab { position: fixed; right: 18px; bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 18px); z-index: 25; width: 56px; height: 56px; border-radius: 50%; background: var(--brand); color: #fff; display: flex; align-items: center; justify-content: center; box-shadow: var(--shadow-lg); }
.fab svg { width: 26px; height: 26px; }
.spin { width: 22px; height: 22px; border: 2.5px solid var(--line); border-top-color: var(--brand); border-radius: 50%; animation: sp .7s linear infinite; }
@keyframes sp { to { transform: rotate(360deg); } }
.center { display: flex; align-items: center; justify-content: center; min-height: 60vh; }

.muted { color: var(--muted); }
.tiny { font-size: 12px; }
.row { display: flex; align-items: center; gap: 10px; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1; }
.mt8 { margin-top: 8px; } .mt16 { margin-top: 16px; }
.hide { display: none !important; }
