/* Opportunity Finder — quiet, Things-style design.
   One accent colour, no boxes around lists, hierarchy from type size and grey,
   details revealed only on demand. Phone layout follows the Things iOS pattern:
   the sidebar is the home screen and lists open full screen. */
:root {
  /* Light design only: stop an OS dark-mode setting from restyling native controls
     (platform build rules: no dark-mode override unless every surface supports it). */
  color-scheme: light;
  --bg: #ffffff;
  --side: #f5f5f3;
  --side-hover: #ebebe8;
  --side-active: #e2e5e7;
  --ink: #1d2227;
  --ink-2: #4a5157;
  --grey: #8b9197;
  --grey-2: #b3b8bc;
  --rule: #ededeb;
  --accent: #012e55;        /* Operation Blessing navy */
  --accent-soft: #e6ecf2;
  --amber: #a86a00;
  --ob-navy: #012e55;   /* Operation Blessing brand navy (from the logo files) */
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--font); color: var(--ink); background: var(--bg); font-size: 15px; line-height: 1.45; -webkit-font-smoothing: antialiased; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
/* Form controls: explicit foreground, background, placeholder, focus and disabled colours. */
input, select, textarea { color: var(--ink); background-color: var(--bg); }
input::placeholder, textarea::placeholder { color: var(--grey); opacity: 1; }
button:disabled, input:disabled, select:disabled, textarea:disabled { color: var(--grey-2); cursor: default; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.icon { display: inline-flex; width: 18px; height: 18px; flex: none; }
.icon svg { width: 100%; height: 100%; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.app { display: grid; grid-template-columns: 260px 1fr; min-height: 100vh; transition: grid-template-columns .18s ease; }

/* ------------------------------------------------------------ sidebar */
.side { background: var(--side); padding: 18px 12px 16px; display: flex; flex-direction: column; gap: 4px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { text-decoration: none; display: flex; align-items: center; gap: 8px; padding: 2px 8px 14px; font-weight: 650; font-size: 14px; color: var(--ink-2); }
.brand { color: var(--ob-navy); font-size: 15px; }
.brand .flame { width: 21px; height: 20px; flex: none; }
.ob-logo { width: 190px; height: auto; margin-bottom: 10px; opacity: .9; }
.find { display: flex; align-items: center; gap: 6px; margin: 0 4px 14px; padding: 0 10px; height: 32px; border-radius: 8px; background: #e9e9e6; color: var(--grey); }
.find input { border: 0; background: transparent; outline: none; font: inherit; font-size: 14px; color: var(--ink); width: 100%; }
.find .icon { width: 15px; height: 15px; }
.side-label { display: flex; align-items: center; gap: 4px; width: 100%; text-align: left; font-size: 11.5px; font-weight: 600; color: var(--grey); padding: 16px 10px 4px; letter-spacing: .01em; border-radius: 6px; }
.side-label:hover { color: var(--ink-2); }
.side-label .chev { display: inline-flex; width: 12px; height: 12px; margin-left: -2px; transition: transform .15s ease; }
.side-label .chev svg { width: 100%; height: 100%; }
.side-label.folded .chev { transform: rotate(-90deg); }
.side-label .side-n { margin-left: auto; font-weight: 400; color: var(--grey-2); }
.nav { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 6px 10px; border-radius: 7px; font-size: 14.5px; color: var(--ink); }
.nav:hover { background: var(--side-hover); }
.nav.on { background: var(--side-active); font-weight: 600; }
.nav .icon { width: 17px; height: 17px; }
.nav .n { margin-left: auto; font-size: 12.5px; color: var(--grey); font-variant-numeric: tabular-nums; font-weight: 400; }
.nav.sub { padding-left: 37px; font-size: 14px; color: var(--ink-2); }
.c-water { color: #2c6fb5; } .c-child { color: #7656b8; } .c-medical { color: #c0405c; }
.c-hunger { color: #b0700e; } .c-disaster { color: #c25a24; } .c-default, .c-place { color: var(--accent); }
.side-foot { margin-top: auto; padding: 18px 10px 0; font-size: 12px; color: var(--grey); display: grid; gap: 4px; }
.side-foot a { color: var(--grey); }
.demo-tag { display: inline-block; font-size: 11px; font-weight: 600; color: #8a6400; background: #fbf1d6; border-radius: 5px; padding: 1px 6px; justify-self: start; }

/* ------------------------------------------------------------ main */
.main { padding: 44px 56px 80px; max-width: 860px; width: 100%; outline: none; }
.back { display: none; align-items: center; gap: 2px; color: var(--accent); font-size: 15px; margin: -8px 0 16px -4px; }
.head { display: flex; align-items: flex-start; gap: 12px; }
.head-icon { margin-top: 5px; }
.head-icon .icon { width: 24px; height: 24px; }
.head h1 { font-size: 27px; font-weight: 700; letter-spacing: -.02em; margin: 0; line-height: 1.2; }
.head-sub { color: var(--grey); font-size: 14px; margin-top: 3px; }
.head-tools { margin-left: auto; position: relative; flex: none; }
.more { width: 32px; height: 32px; border-radius: 7px; color: var(--grey); display: inline-flex; align-items: center; justify-content: center; }
.more:hover, .more[aria-expanded="true"] { background: var(--side); color: var(--ink); }
.menu { position: absolute; right: 0; top: 38px; z-index: 20; width: 250px; background: #fff; border-radius: 10px; padding: 6px; box-shadow: 0 0 0 1px rgba(0,0,0,.06), 0 10px 30px rgba(0,0,0,.14); }
.menu[hidden] { display: none; }
.menu-label { font-size: 11.5px; color: var(--grey); font-weight: 600; padding: 8px 10px 4px; }
.menu-item { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; padding: 7px 10px; border-radius: 6px; font-size: 14px; }
.menu-item:hover { background: var(--side); }
.menu-item .tick { width: 16px; color: var(--accent); font-weight: 700; }
.menu hr { border: 0; border-top: 1px solid var(--rule); margin: 6px 4px; }

.tabs { display: flex; gap: 22px; margin: 26px 0 6px; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--rule); }
.tabs::-webkit-scrollbar { display: none; }
.tab { padding: 0 0 9px; font-size: 14px; color: var(--grey); white-space: nowrap; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tab:hover { color: var(--ink); }
.tab.on { color: var(--ink); font-weight: 600; border-bottom-color: var(--ink); }
.tab .n { color: var(--grey-2); font-weight: 400; margin-left: 3px; font-size: 12.5px; }

.group { margin-top: 36px; }
.group-h { display: flex; align-items: center; gap: 6px; width: 100%; text-align: left; font-size: 18px; font-weight: 700; letter-spacing: -.01em; color: var(--accent); padding: 4px 0 8px; border-bottom: 1px solid var(--rule); }
.group-h .chev { display: inline-flex; width: 15px; height: 15px; margin-left: -21px; color: var(--grey-2); opacity: 0; transition: transform .15s ease, opacity .15s; }
.group-h:hover .chev, .group-h:focus-visible .chev, .group.folded .chev { opacity: 1; }
.group-h .chev svg { width: 100%; height: 100%; }
.group.folded .chev { transform: rotate(-90deg); }
.group.folded { margin-top: 18px; }
.group.folded .group-h { color: var(--ink-2); }
.group-h:hover .gname { text-decoration: underline; text-decoration-color: var(--grey-2); text-underline-offset: 3px; }
.group-h .gsub { color: var(--grey); font-weight: 400; font-size: 13px; }
.group-h .gn { margin-left: auto; color: var(--grey); font-weight: 400; font-size: 13px; letter-spacing: 0; font-variant-numeric: tabular-nums; }

.row { display: grid; grid-template-columns: 22px 1fr auto; gap: 0 12px; align-items: start; width: 100%; text-align: left; padding: 9px 8px; margin: 0 -8px; border-radius: 8px; width: calc(100% + 16px); }
.row:hover { background: #f7f7f5; }
.circ { width: 18px; height: 18px; margin-top: 1px; color: var(--grey-2); }
.circ.partial { color: var(--accent); }
.circ.funded { color: var(--grey-2); }
.r-name { font-size: 15px; color: var(--ink); overflow-wrap: anywhere; }
.r-meta { font-size: 13px; color: var(--grey); display: flex; flex-wrap: wrap; align-items: center; gap: 0 4px; margin-top: 1px; }
/* Same " · " separator between every piece of the grey line, matching "Country A3 · Water project". */
.r-meta > span + span::before { content: "·"; color: var(--grey); margin: 0 4px 0 0; }
.r-meta > .hint + .hint::before, .r-meta > span + .hint::before { margin-right: 1px; }
.r-meta .hint { display: inline-flex; align-items: center; gap: 3px; }
.r-meta .hint .icon { width: 13px; height: 13px; }
.r-meta .hint.open { color: var(--accent); }
.r-meta .hint.soon { color: var(--amber); }
.r-amt { font-size: 15px; font-variant-numeric: tabular-nums; color: var(--ink); text-align: right; white-space: nowrap; }
.r-amt.dim { color: var(--grey); font-size: 13.5px; }

/* expanded row — Things-style open to-do */
.open-card { margin: 6px -14px 14px; padding: 18px 20px 16px; border-radius: 12px; background: #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.05), 0 6px 24px rgba(0,0,0,.08); display: grid; gap: 14px; }
.oc-top { display: grid; grid-template-columns: 22px 1fr auto; gap: 0 12px; }
.oc-name { font-size: 17px; font-weight: 650; }
.oc-where { color: var(--grey); font-size: 13.5px; }
.oc-close { color: var(--grey); width: 28px; height: 28px; border-radius: 6px; display: inline-flex; align-items: center; justify-content: center; }
.oc-close:hover { background: var(--side); }
.oc-body { padding-left: 34px; display: grid; gap: 14px; }
.oc-need { display: flex; align-items: baseline; gap: 8px; }
.oc-need b { font-size: 24px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.oc-need span { color: var(--grey); font-size: 14px; }
.bar { height: 4px; background: var(--rule); border-radius: 4px; overflow: hidden; margin-top: 8px; max-width: 420px; }
.bar i { display: block; height: 100%; background: var(--accent); border-radius: 4px; }
.oc-fig { color: var(--grey); font-size: 13px; margin-top: 6px; }
.oc-line { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; color: var(--ink-2); }
.oc-line .icon { width: 16px; height: 16px; margin-top: 2px; color: var(--grey); }
.oc-line.passed { color: var(--ink-2); }
.oc-line.open .icon, .oc-line.open { color: var(--accent); }
.oc-line.soon .icon, .oc-line.soon { color: var(--amber); }
.oc-desc { color: var(--ink-2); font-size: 14px; max-width: 560px; }
.oc-actions { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; }
.btn { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px; border-radius: 8px; font-size: 14px; font-weight: 600; text-decoration: none; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: #02406f; }
.btn-text { color: var(--accent); font-size: 14px; font-weight: 500; text-decoration: none; }
.btn-text:hover { text-decoration: underline; }
.no-prop { color: var(--grey); font-size: 13.5px; display: inline-flex; gap: 6px; align-items: center; }
.no-prop .icon { width: 15px; height: 15px; }

.foot-links { margin-top: 30px; display: grid; gap: 12px; justify-items: start; }
.quiet-link { color: var(--grey); font-size: 13.5px; }
.quiet-link:hover { color: var(--ink); }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12px; color: var(--grey-2); }
.legend span { display: inline-flex; gap: 5px; align-items: center; }
.legend .icon { width: 13px; height: 13px; }

.empty { margin-top: 70px; text-align: center; color: var(--grey); display: grid; gap: 10px; justify-items: center; }
.empty .icon { width: 40px; height: 40px; color: var(--grey-2); }
.empty p { margin: 0; max-width: 360px; }

/* ------------------------------------------------------------ full detail page */
.back-link { display: inline-flex; align-items: center; gap: 4px; color: var(--accent); font-size: 14.5px; margin: -14px 0 22px -2px; }
.back-link .icon { width: 16px; height: 16px; }
.back-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.detail { display: grid; gap: 22px; max-width: 640px; }
.d-head { display: grid; grid-template-columns: 22px 1fr; gap: 0 12px; }
.d-head .circ { margin-top: 8px; }
.d-head h1 { font-size: 26px; font-weight: 700; letter-spacing: -.02em; margin: 0; line-height: 1.2; overflow-wrap: anywhere; }
.d-where { color: var(--grey); font-size: 14px; margin-top: 4px; }
.d-need, .d-plaque, .d-actions, .d-sec, .detail > .d-note { margin-left: 34px; }
.d-need .oc-need b { font-size: 28px; }
.d-plaque .d-note { margin-top: 2px; }
.d-note { color: var(--grey); font-size: 13px; }
.d-sec { display: grid; gap: 8px; }
.d-label { font-size: 11.5px; font-weight: 600; color: var(--grey); margin: 8px 0 0; letter-spacing: .01em; }
.d-sec p { margin: 0; color: var(--ink-2); font-size: 14.5px; }
.kv { margin: 0; border-top: 1px solid var(--rule); }
.kv > div { display: grid; grid-template-columns: 170px 1fr; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--rule); font-size: 14.5px; }
.kv dt { color: var(--grey); }
.kv dd { margin: 0; color: var(--ink); overflow-wrap: anywhere; white-space: pre-line; }
.d-ref { margin: 6px 0 0 34px; font-size: 12px; color: var(--grey-2); }

/* ------------------------------------------------------------ states, notices, data check */
.side-loading { color: var(--grey); font-size: 13.5px; padding: 6px 10px; margin: 0; }
.muted-line { color: var(--grey); margin: 20px 0; }
.notice { display: flex; gap: 8px; align-items: flex-start; color: var(--amber); font-size: 13.5px; margin: -20px 0 22px; padding: 8px 0; border-bottom: 1px solid var(--rule); }
.notice .icon { width: 16px; height: 16px; margin-top: 2px; }
.notice + .notice { margin-top: -16px; }
.opt-note { font-size: 13px; color: var(--grey); margin-top: 10px; }
.more.has-opts { color: var(--accent); }
.error-block { max-width: 520px; margin: 40px 0; display: grid; gap: 10px; justify-items: start; }
.error-block h1 { font-size: 22px; margin: 0; }
.error-block p { margin: 0; color: var(--ink-2); }
.error-block details { font-size: 12.5px; color: var(--grey); width: 100%; }
.error-block pre { white-space: pre-wrap; background: var(--side); border-radius: 8px; padding: 10px; }
.big-icon { width: 30px; height: 30px; color: var(--amber); }
.d-indent { margin-left: 34px; }
.dc-title { font-size: 26px; font-weight: 700; letter-spacing: -.02em; margin: 0; }
.dc .d-where { max-width: 560px; }
.warn-text { color: var(--amber); }
.dc-map { margin-top: 6px; font-size: 13px; }
.dc-map summary { color: var(--accent); cursor: pointer; }
.kv-sm > div { grid-template-columns: 150px 1fr; padding: 5px 0; font-size: 13px; }
.dc-group { margin-top: 18px; }
.dc-issues { list-style: none; margin: 0; padding: 0; }
.dc-issues li { padding: 9px 0; border-bottom: 1px solid var(--rule); font-size: 14px; display: grid; gap: 2px; }
.noscript { padding: 24px; text-align: center; }

/* ------------------------------------------------------------ slim sidebar (rail), desktop */
button.brand { width: 100%; text-align: left; border-radius: 8px; padding: 6px 8px; margin: -4px 0 10px; }
button.brand:hover { background: var(--side-hover); }
.brand-collapse { display: inline-flex; width: 14px; height: 14px; margin-left: auto; color: var(--grey-2); transform: rotate(90deg); opacity: 0; transition: opacity .15s; }
.brand-collapse svg { width: 100%; height: 100%; }
button.brand:hover .brand-collapse, button.brand:focus-visible .brand-collapse { opacity: 1; }
.app.rail { grid-template-columns: 64px 1fr; }
.app.rail .side { padding: 14px 0 14px; align-items: center; gap: 2px; overflow: visible; }
.rail-btn { position: relative; width: 40px; height: 40px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.rail-btn:hover { background: var(--side-hover); }
.rail-btn.on { background: var(--side-active); }
.rail-btn .icon { width: 19px; height: 19px; }
.rail-btn > span { display: inline-flex; }
.rail-brand { margin-bottom: 8px; }
.rail-brand .flame { width: 23px; height: 22px; }
.c-grey { color: var(--grey); }
.rail-gap { height: 6px; }
.rail-sep { width: 24px; border-top: 1px solid var(--rule-2, #e2e2df); margin: 8px 0; }
.rail-foot { margin-top: auto; display: grid; justify-items: center; gap: 6px; }
.rail-demo { position: relative; font-size: 10px; font-weight: 700; color: #8a6400; background: #fbf1d6; border-radius: 5px; padding: 1px 5px; cursor: default; }
/* Tooltips beside rail icons */
[data-tip] { position: relative; }
.app.rail .side [data-tip]:hover::after, .app.rail .side [data-tip]:focus-visible::after {
  content: attr(data-tip); position: absolute; left: calc(100% + 10px); top: 50%; transform: translateY(-50%);
  background: var(--ink); color: #fff; font-size: 12.5px; font-weight: 500; line-height: 1.3; white-space: nowrap;
  padding: 5px 9px; border-radius: 6px; pointer-events: none; z-index: 40;
}
button.brand[data-tip]:hover::after { content: none; }

/* ------------------------------------------------------------ phone: Things iOS pattern */
@media (max-width: 760px) {
  body { font-size: 16px; }
  .app { display: block; }
  .side { position: static; height: auto; min-height: 100vh; background: #fff; padding: 20px 14px 32px; }
  .app.list .side { display: none; }
  .app:not(.list) .main { display: none; }
  .nav { padding: 10px 10px; font-size: 16px; }
  .nav .icon { width: 20px; height: 20px; }
  .nav.on { background: none; font-weight: 400; }
  .nav.sub { padding-left: 40px; font-size: 15px; }
  .side-label { font-size: 13px; padding: 20px 10px 6px; }
  .place-row { display: flex; align-items: center; }
  .place-row .place-toggle { flex: 1; min-width: 0; }
  .place-go { flex: none; width: 44px; height: 44px; margin-right: -6px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; color: var(--grey); }
  .place-go:active { background: var(--side-hover); }
  .place-go .icon { width: 18px; height: 18px; }
  .side-label .chev { width: 14px; height: 14px; }
  .find { height: 38px; margin-bottom: 8px; }
  .main { padding: 18px 18px 60px; }
  .back { display: inline-flex; }
  .back-link { margin: -6px 0 18px -2px; font-size: 16px; }
  .d-head h1 { font-size: 24px; }
  .d-need, .d-plaque, .d-actions, .d-sec, .detail > .d-note, .d-ref, .d-indent { margin-left: 0; }
  .notice { margin-top: -6px; }
  .kv > div { grid-template-columns: minmax(110px, 42%) 1fr; font-size: 15px; }
  .d-actions > .no-prop, .d-actions > .btn-primary { flex-basis: 100%; }
  .d-actions > .btn-primary { justify-content: center; height: 44px; }
  .head h1 { font-size: 26px; }
  .tabs { gap: 18px; margin-top: 20px; }
  .row { padding: 11px 8px; }
  .r-name { font-size: 16px; }
  .open-card { margin-left: -8px; margin-right: -8px; padding: 16px; }
  .oc-body { padding-left: 0; }
  .menu { right: -4px; }
  .group-h .chev { opacity: 1; margin-left: 0; }
}

.nav > span[class^="c-"], .head-icon { display: inline-flex; }

/* Touch screens: no sticky grey "hover" highlight after a tap. */
@media (hover: none) {
  .nav:hover, .row:hover { background: none; }
  .nav.on:hover { background: var(--side-active); }
}
@media (hover: none) and (max-width: 760px) { .nav.on:hover { background: none; } }
.dc .d-sec { margin-left: 0; }
