/* Portal styles. Colors: the logo's Okabe-Ito palette, the same tokens as the public site
   (web/src/style.css; docs/product/brand.md, "Logo"). Text and buttons use the dark shades, which pass
   WCAG AA on white. Inside an organization's pages, /orgs/<ein>/theme.css overrides --blue (links and
   buttons) and sets --org, --org-accent and --org-tint (portal/portal/theme.py). */
:root {
  --bg: #fbf8f3; --surface: #ffffff; --ink: #1d1b18; --muted: #5c574f; --line: #e4ddd2; --panel: #f6f2ea;
  --sky: #56b4e9;      --sky-dark: #1d6796;
  --orange: #e69f00;   --orange-dark: #8f5a00;
  --green: #009e73;    --green-dark: #00563f;
  --purple: #cc79a7;   --purple-dark: #86406a;
  --yellow: #f0e442;   --yellow-dark: #857a00;
  --blue: var(--sky-dark); --red: #b42318;
  --header-h: 56px;
  --org: var(--sky-dark); --org-accent: var(--orange); --org-tint: #eaf5fc;
  color-scheme: light;
}
* { box-sizing: border-box; }
body { margin: 0; font: 16px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif; color: var(--ink); background: var(--bg); }
.top { position: sticky; top: 0; z-index: 40; display: flex; gap: 12px; align-items: center; justify-content: space-between;
  min-height: var(--header-h); padding: 6px 16px; background: var(--surface); box-shadow: 0 2px 8px rgb(0 0 0 / 0.06);
  /* A stripe in the logo's five colors, in the logo's order, as on the public site. */
  border-bottom: 4px solid;
  border-image: linear-gradient(90deg, var(--sky) 0 20%, var(--orange) 20% 40%, var(--green) 40% 60%, var(--purple) 60% 80%, var(--yellow) 80%) 1; }
.top > nav { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--ink); text-decoration: none; }
.brand img { display: block; }
.brand .sub { font-weight: 400; color: var(--muted); }
main { max-width: 760px; margin: 0 auto; padding: 16px; }
footer { max-width: 760px; margin: 32px auto; padding: 0 16px; color: var(--muted); font-size: 14px; }
a { color: var(--blue); }
h1 { font-size: 1.6rem; line-height: 1.25; }
.muted, .hint { color: var(--muted); }
.hint { font-size: 0.93rem; }
.flash { background: #e6f5f0; border-left: 4px solid var(--green-dark); padding: 8px 12px; }
.error { background: #fbeee8; border-left: 4px solid var(--red); padding: 8px 12px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 12px 16px; margin: 16px 0; }
label { display: block; font-weight: 600; margin-top: 8px; }
fieldset label { font-weight: 400; }
input, textarea { font: inherit; width: 100%; max-width: 420px; padding: 8px; border: 1px solid #8a8a8a; border-radius: 6px; }
input[type=radio], input[type=checkbox] { width: auto; }
button, .button { display: inline-block; font: inherit; margin-top: 8px; padding: 8px 14px; border-radius: 6px; border: 1px solid var(--blue); background: var(--blue); color: #fff; text-decoration: none; cursor: pointer; }
button.secondary { background: #fff; color: var(--blue); }
button.danger { background: var(--red); border-color: var(--red); }
button.link { background: none; border: none; color: var(--blue); padding: 0; margin: 0; text-decoration: underline; }
form.inline { display: inline; }
.cards { list-style: none; padding: 0; }
.cards li { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; margin: 8px 0; }
.members { padding-left: 18px; }
.role { font-size: 0.8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin-left: 4px; }
table { border-collapse: collapse; width: 100%; font-size: 0.95rem; }
th, td { text-align: left; border-bottom: 1px solid var(--line); padding: 6px; vertical-align: top; }
:focus-visible { outline: 3px solid var(--orange-dark); outline-offset: 2px; }
.soon { display: inline-block; font-size: 0.75rem; font-weight: 600; background: #fff3d6; color: #6b4a00; border-radius: 999px; padding: 1px 8px; }
select { font: inherit; padding: 6px; }
textarea[readonly] { background: #fff; }
.state { display: inline-block; font-size: 0.75rem; font-weight: 600; border-radius: 999px; padding: 1px 8px; background: #e8eef2; color: #003a55; }
.state.ok { background: #dff2ea; color: #00452f; }
.state.bad { background: #f8e3da; color: #6a1f00; }
.state.warn { background: #fff3d6; color: #6b4a00; }
.deliveries { list-style: none; padding-left: 0; margin: 6px 0 0; font-size: 0.95rem; }
.pre { white-space: pre-wrap; }
fieldset label { display: block; font-weight: 400; }
/* An organization's band: its logo, name and colors at the top of its pages, so someone who helps several
   organizations can tell at a glance which one they're in. */
.org-band { display: flex; align-items: center; gap: 12px; margin: 8px 0 12px; padding: 12px 14px; background: var(--org-tint);
  border-left: 8px solid var(--org); border-radius: 8px; box-shadow: inset 0 -4px 0 var(--org-accent); }
.org-band img { width: 56px; height: 56px; border-radius: 10px; object-fit: contain; background: var(--surface); flex: none; }
.org-band .org-name { margin: 0; font-size: 1.15rem; font-weight: 700; line-height: 1.25; }
.org-band .role { margin-left: 0; }
.swatches { display: flex; gap: 16px; flex-wrap: wrap; align-items: flex-end; }
.swatch { display: inline-block; width: 24px; height: 24px; border-radius: 6px; border: 1px solid var(--line); vertical-align: middle; }
input[type=color] { width: 64px; height: 40px; padding: 2px; }
.sample { background: var(--org); display: inline-block; padding: 8px 14px; border-radius: 6px; color: #fff; font-weight: 600; }
.moc { white-space: nowrap; }
.moc img { vertical-align: -0.15em; margin-right: 0.25em; }
/* Menus built from <details> (menus.js closes them on an outside tap or Escape). */
summary { cursor: pointer; }
details[data-menu] > summary { list-style: none; }
details[data-menu] > summary::-webkit-details-marker { display: none; }
details[data-menu][open] .chevron { transform: rotate(180deg); }
.chevron { flex: none; transition: transform .15s; }

/* The header's hamburger. */
.menu { position: relative; }
.menu > summary { display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 8px; color: var(--ink); }
.menu > summary:hover, .menu[open] > summary { background: var(--panel); }
.menu-panel { position: absolute; right: 0; top: calc(100% + 6px); z-index: 50; min-width: 240px; display: flex; flex-direction: column;
  padding: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 6px 24px rgb(0 0 0 / 0.16); }
.menu-panel a, .menu-panel button.link { display: block; padding: 10px 12px; border-radius: 6px; text-decoration: none; color: var(--ink); text-align: left; width: 100%; font: inherit; }
.menu-panel a:hover, .menu-panel button.link:hover { background: var(--panel); }
.menu-panel form { margin: 0; }

/* Organization pages: the band (also the organization switcher) and the organization's menu. Wide screens: a
   column beside the page. Phones, portrait or landscape: the band and a one-line menu stick below the header. */
main.with-side { max-width: 1080px; }
.org-switch { position: relative; }
.org-switch > summary.org-band { margin: 0; cursor: pointer; }
.org-switch > summary.org-band:hover { filter: brightness(0.98); }
.band-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.org-band .org-name { overflow-wrap: anywhere; }
.switch-menu { position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 35; display: flex; flex-direction: column; padding: 6px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 6px 24px rgb(0 0 0 / 0.16); min-width: 260px; }
.switch-menu p { margin: 4px 10px; font-size: 0.85rem; }
.switch-menu a { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 6px; text-decoration: none; color: var(--ink); }
.switch-menu a:hover { background: var(--panel); }
.switch-menu a[aria-current] { font-weight: 700; background: var(--org-tint); }
.switch-menu a img { width: 24px; height: 24px; border-radius: 5px; object-fit: contain; background: var(--surface); flex: none; }
.switch-menu .claim { border-top: 1px solid var(--line); margin-top: 4px; padding-top: 10px; color: var(--blue); }
.side-nav a, .page-menu nav a { text-decoration: none; padding: 8px 12px; border-radius: 6px; display: block; }
.side-nav a:hover, .page-menu nav a:hover { background: var(--org-tint); }
.side-nav a[aria-current="page"], .page-menu nav a[aria-current="page"] { font-weight: 700; color: var(--ink); background: var(--org-tint); box-shadow: inset 4px 0 0 var(--org); }
[id] { scroll-margin-top: calc(var(--header-h) + 16px); }

@media (min-width: 860px) {
  main.with-side { display: grid; grid-template-columns: 240px minmax(0, 1fr); column-gap: 32px; align-items: start; }
  main.with-side > * { grid-column: 2; }
  main.with-side > .org-side { grid-column: 1; grid-row: 1 / span 200; position: sticky; top: calc(var(--header-h) + 16px); }
  .org-side .org-band { flex-direction: column; align-items: flex-start; margin-top: 16px; position: relative; padding-right: 32px; }
  .org-side .org-band img { width: 72px; height: 72px; }
  .org-side .org-band .chevron { position: absolute; right: 10px; top: 14px; }
  .side-nav { display: flex; flex-direction: column; margin-top: 12px; }
  .page-menu { display: none; }
}
@media (max-width: 859.98px) {
  main.with-side > .org-side { position: sticky; top: var(--header-h); z-index: 30; margin: -16px -16px 12px; padding: 8px 16px 0;
    background: var(--bg); border-bottom: 1px solid var(--line); }
  .org-side .org-band { margin: 0; padding: 8px 10px; gap: 10px; box-shadow: none; }
  .org-side .org-band img { width: 40px; height: 40px; border-radius: 8px; }
  .org-band .org-name { font-size: 1rem; }
  .band-meta { font-size: 0.8rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .side-nav { display: none; }
  .page-menu { position: relative; }
  .page-menu > summary { display: flex; align-items: center; justify-content: space-between; min-height: 44px; padding: 0 4px; font-weight: 700; }
  .page-menu > nav { position: absolute; left: -16px; right: -16px; top: 100%; z-index: 31; padding: 6px 16px 10px; background: var(--bg);
    border-bottom: 1px solid var(--line); box-shadow: 0 10px 16px rgb(0 0 0 / 0.08); max-height: 60vh; overflow-y: auto; }
  [id] { scroll-margin-top: calc(var(--header-h) + 120px); }
}
}
.links { list-style: none; padding: 0; margin: 0; }
.links li { margin: 4px 0; overflow-wrap: anywhere; }
.source { display: inline-block; font-size: 0.75rem; font-weight: 600; color: var(--muted); background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 0 8px; }
.found-links td { overflow-wrap: anywhere; }
.found-links .actions { white-space: nowrap; }
.levels label { margin: 8px 0; }
.levels input[disabled] + strong { color: var(--muted); }
.cards li.org-card { display: flex; gap: 12px; align-items: center; }
.org-card img { width: 40px; height: 40px; border-radius: 8px; object-fit: contain; flex: none; }
@media (max-width: 520px) { .brand .sub { display: none; } }
/* Phones held sideways: a shorter band so the sticky part leaves room for the page. */
@media (max-width: 859.98px) and (max-height: 500px) {
  :root { --header-h: 48px; }
  .top { padding-top: 2px; padding-bottom: 2px; }
  .org-side .org-band { padding: 4px 8px; }
  .org-side .org-band img { width: 28px; height: 28px; border-radius: 6px; }
  .band-meta { display: none; }
  .page-menu > summary { min-height: 36px; }
}

/* Lists without bullets (the users audit, the review page). */
ul.plain { list-style: none; padding: 0; margin: 0; }

/* Scraper review (admin_review.html). */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 12px 0; }
.tabs a { padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; text-decoration: none; }
.tabs a[aria-current="page"] { font-weight: 700; background: var(--org-tint); }
.controls { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 8px; }
.find.card { border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; margin: 6px 0; }
.find .find-title { font-size: 0.98rem; line-height: 1.3; margin: 0 0 2px; }
.find-meta { font-size: 0.85rem; color: var(--muted, #555); margin: 0 0 2px; }
.find-meta .flag { font-size: 0.8rem; font-weight: 600; margin-left: 4px; }
.badge { display: inline-block; font-size: 0.7rem; font-weight: 700; letter-spacing: 0.02em; border-radius: 4px; padding: 1px 6px; vertical-align: 2px; }
.badge-social { background: #1d63c9; color: #fff; }
.badge-web { background: var(--panel); color: var(--ink); border: 1px solid var(--muted); }
.find form.choice { display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: center; margin: 2px 0; font-size: 0.88rem; }
.find form.choice .checks, .find form.choice .radios { display: inline-flex; gap: 10px; flex-wrap: wrap; }
.find form.choice .checks { color: var(--muted, #555); }
.find form.choice .radio-reject { color: #8a1c1c; }
.find details.more { font-size: 0.88rem; }
.find details.more summary { cursor: pointer; color: var(--muted, #555); }
.find-title { font-size: 1.05rem; margin: 0 0 4px; }
.find fieldset { border: 0; padding: 0; margin: 8px 0; }
.find form { margin: 6px 0; }
.warn { background: #fff3d6; color: #6b4a00; border-radius: 6px; padding: 4px 8px; }
.reminder { border-left: 4px solid var(--org); padding: 4px 10px; }
.help-button { font-size: 0.9rem; width: 1.8em; height: 1.8em; padding: 0; border-radius: 50%; vertical-align: middle; }
#help { max-width: 40rem; border: 1px solid var(--line); border-radius: 8px; padding: 16px 20px; }
#help::backdrop { background: rgba(0, 0, 0, 0.35); }
.loads { margin: 8px 0 12px; }
.keys kbd { border: 1px solid var(--line); border-radius: 4px; padding: 0 4px; font-size: 0.8rem; }
.chips .chip { display: inline-block; font-size: 0.75rem; border: 1px solid var(--line); border-radius: 999px; padding: 1px 8px; }
.chips .flag { font-size: 0.8rem; font-weight: 600; }
.find.current { outline: 3px solid var(--org); }
.find .correct summary { cursor: pointer; }
.find .correct label { display: inline-block; margin: 4px 8px 4px 0; }

/* The preview of the original beside the review list (wide screens only; press o elsewhere). */
.review-layout { display: block; }
.review-preview { display: none; }
/* The toolbar stays put (the user, 2026-11-29: "it needs to stay at the top and not disappear when we scroll - only
   the list should scroll - and probably the preview pane"). Narrow screens: it sticks under the header and the
   page scrolls. Wide screens: the page doesn't scroll; the list and the preview fill the rest of the height and
   scroll on their own (review.js measures where they start: --review-top). */
.review-top { position: sticky; top: var(--header-h); z-index: 30; background: var(--bg); padding-top: 4px; }
.find.card { scroll-margin-top: calc(var(--header-h) + 110px); }
@media (min-width: 1100px) {
  main:has(.review-layout) { max-width: 1400px; padding-bottom: 0; }
  body:has(.review-layout) > footer { display: none; }
  .review-top { position: static; }
  .review-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px;
    height: calc(100dvh - var(--review-top, 150px) - 8px); }
  .find.card { scroll-margin-top: 4px; }
  .review-list { overflow-y: auto; min-height: 0; padding: 2px 6px 2px 2px; overscroll-behavior: contain; }
  .review-preview:not([hidden]) { display: flex; flex-direction: column; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
  .review-preview #preview-frame { flex: 1 1 auto; min-height: 0; display: flex; }
  .review-preview #preview-frame:empty { display: none; }
  .review-preview iframe { width: 100%; flex: 1 1 auto; min-height: 300px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
}

/* The review page's slim toolbar (admin_review.html): the list and the preview get the screen. */
.review-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 0 0 4px; position: relative; }
.review-bar h1 { font-size: 1.15rem; margin: 0; }
.review-bar .tabs { margin: 0; gap: 4px; }
.review-bar .tabs a { padding: 3px 10px; font-size: 0.88rem; }
.review-bar .refresh { font-size: 0.85rem; white-space: nowrap; text-decoration: none; padding: 2px 8px; border: 1px solid var(--line); border-radius: 6px; }
.review-bar .pager-short { margin-left: auto; font-size: 0.88rem; white-space: nowrap; }
.review-bar .pager-short a { display: inline-block; padding: 0 8px; text-decoration: none; font-size: 1.1rem; border: 1px solid var(--line); border-radius: 6px; }
.filters-pop > summary { list-style: none; cursor: pointer; font-size: 0.88rem; padding: 3px 10px; border: 1px solid var(--line); border-radius: 999px; }
.filters-pop > summary::-webkit-details-marker { display: none; }
.filters-pop > summary::after { content: " ▾"; }
.filters-pop[open] > summary { background: var(--org-tint); }
.filters-pop .count { display: inline-block; min-width: 1.3em; text-align: center; font-size: 0.75rem; font-weight: 700; background: var(--org); color: #fff; border-radius: 999px; padding: 0 5px; }
.filters-panel { position: absolute; z-index: 20; top: 100%; left: 0; margin-top: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; box-shadow: 0 6px 24px rgba(0, 0, 0, 0.15); max-width: min(720px, 100%); }
.filters-panel .controls { margin: 0; }
.review-status { font-size: 0.8rem; color: var(--muted); margin: 0 0 6px; }
.review-status .load-running { color: #6b4a00; font-weight: 600; }
.review-status form.load-form { display: inline; margin: 0 0 0 4px; }
.link-button { background: none; border: 0; padding: 0; color: var(--org); text-decoration: underline; cursor: pointer; font: inherit; }
.link-button:disabled { color: var(--muted); text-decoration: none; cursor: default; }

/* Phones (the user, 2026-11-29: "for mobile ... keep the toolbar and filters fixed to the top - the content is a
   header for the content on display (our list card) and then the main content on display is an embed"): one find
   at a time under the toolbar, its original filling the rest; swipe on the card or tap its buttons (review.js). */
.phone-acts, .decision-slot, .open-original { display: none; }
@media (max-width: 699px) {
  main:has(.review-layout) { padding: 8px 10px 0; }
  body:has(.review-layout) > footer { display: none; }
  .review-status { display: none; }
  .review-bar { gap: 4px 6px; }
  .review-bar .tabs a { padding: 2px 8px; font-size: 0.8rem; }
  .review-bar .refresh, .review-bar .pager-short { display: none; }
  .review-bar .tabs { flex-wrap: nowrap; overflow-x: auto; width: 100%; scrollbar-width: none; }
  .review-bar .tabs a { white-space: nowrap; }
  .review-layout.one { display: flex; flex-direction: column; height: calc(100dvh - var(--review-top, 120px) - 4px); }
  .review-layout.one .review-list { flex: 0 0 auto; }
  .review-layout.one .find.card:not(.current), .review-layout.one .pager { display: none; }
  .review-layout.one .find.card { margin: 0 0 6px; touch-action: none; user-select: none; transition: transform 0.18s ease-out, opacity 0.18s, background-color 0.18s; }
  .review-layout.one .find.current { outline-width: 2px; outline-offset: -2px; }   /* inside the card: nothing above paints over it */
  .review-layout.one form.choice, .review-layout.one details.more { display: none; }
  .review-layout.one .phone-acts { display: flex; gap: 6px; margin-top: 6px; }
  .phone-acts button { flex: 1 1 auto; padding: 8px 4px; font-size: 0.95rem; }
  .phone-acts button[data-go] { flex: 0 0 2.6em; }
  .phone-acts .act-map { background: #1f7a3a; color: #fff; }
  .phone-acts .act-both { background: #1d63c9; color: #fff; }
  .phone-acts .act-reject { background: #8a1c1c; color: #fff; }
  .review-layout.one .review-preview:not([hidden]) { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; overflow-y: auto; }
  .review-layout.one #preview-frame { flex: 1 1 auto; min-height: 0; display: flex; }
  .review-layout.one #preview-frame:empty { display: none; }
  .review-layout.one .review-preview iframe { width: 100%; flex: 1 1 auto; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
  .review-layout.one #preview-note { font-size: 0.8rem; margin: 0 0 4px; }
  .review-layout.one .open-original { display: block; text-align: center; padding: 6px; font-size: 0.85rem; }
  .review-layout.one .open-original.big { margin: 16px 0; padding: 18px; font-size: 1.1rem; font-weight: 700; border: 2px solid var(--org); border-radius: 10px; text-decoration: none; }
  body.swiping .review-preview iframe { pointer-events: none; }    /* a swipe in progress: the embed doesn't take it */
  .find.fly-right { transform: translateX(110%); background: #d8f3df; opacity: 0.4; }
  .find.fly-left { transform: translateX(-110%); background: #f6d8d8; opacity: 0.4; }
  .find.fly-up { transform: translateY(-40px); opacity: 0.2; }
  .find.fly-down { transform: translateY(40px); opacity: 0.2; }
  main:has(.review-layout) > .flash { display: none; }       /* its message goes in the slot below */
  /* A reserved space in the flow, not an overlay: fixed height, and a gap before the card (whose focus outline
     draws outside it). Gray when empty or a plain message; green after an approval, red after a reject
     (the user, 2026-11-29). Text contrast: #0f3d1c on #d3efdb and #5c1010 on #f7d6d6 are above 10:1. */
  .review-top { padding-bottom: 8px; }
  .decision-slot { display: flex; align-items: center; height: 48px; box-sizing: border-box; margin: 4px 0 0; padding: 0 4px 0 10px;
    background: #e9e6e0; color: var(--ink); border-radius: 8px; font-size: 0.85rem; overflow: hidden; }
  .decision-slot.slot-approve { background: #d3efdb; color: #0f3d1c; }
  .decision-slot.slot-reject { background: #f7d6d6; color: #5c1010; }
  .decision-slot .slot-message { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.25; }
  .undo-bar { display: flex; align-items: center; gap: 8px; width: 100%; }
  .undo-bar .undo-what { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .undo-bar form { flex: 0 0 auto; margin: 0; }
  .undo-bar .undo-button { min-height: 40px; min-width: 72px; padding: 6px 14px; font-weight: 700; font-size: 0.95rem; background: var(--org); color: #fff; border: 0; border-radius: 6px; }
}

/* A social post's full text on its review card: the words the map publishes (the user, 2026-11-29). */
.find-text { font-size: 0.88rem; margin: 2px 0 4px; white-space: pre-line; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
