/* ===== tokens ===== */
:root {
  --bg: #f4f6f9;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --text: #17202b;
  --muted: #637083;
  --line: #e3e8ee;
  --brand: #0f766e;
  --brand-ink: #ffffff;
  --brand-soft: #e6f3f1;
  --danger: #b42318;
  --danger-soft: #fdecea;
  --warn-soft: #fff4dc;
  --warn: #8a5a00;
  --ok-soft: #e4f6ea;
  --ok: #17663a;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .05);
  --radius: 12px;

  --map-0: #e9edf2; --map-1: #cfe8e4; --map-2: #9fd3cb; --map-3: #5fb5aa; --map-4: #2c9285; --map-5: #0d6b63;
  --map-stroke: #ffffff;
  --map-hover: #f59e0b;

  --c1: #0f766e; --c2: #d97706; --c3: #4f46e5; --c4: #db2777; --c5: #0284c7; --c6: #65a30d; --c7: #9333ea; --c8: #64748b;
  --ph-answered: #16a34a; --ph-no_answer: #f59e0b; --ph-later: #0284c7; --ph-unreachable: #ef4444;
  --ph-off: #8b5cf6; --ph-declined: #be123c; --ph-wrong: #64748b; --ph-other: #a8b3c2;
  --font: "Vazirmatn", "Segoe UI", Tahoma, "Noto Sans Arabic", system-ui, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e1319; --surface: #161d26; --surface-2: #1a232d; --text: #e7ecf3; --muted: #93a1b4; --line: #263140;
    --brand: #2dd4bf; --brand-ink: #06201d; --brand-soft: #123530;
    --danger: #ff8f84; --danger-soft: #3a1b19; --warn-soft: #3a2d10; --warn: #f5c15c; --ok-soft: #12301f; --ok: #6fdc9a;
    --shadow: none;
    --map-0: #222c38; --map-1: #15403c; --map-2: #1b5b55; --map-3: #23807a; --map-4: #31ae9f; --map-5: #5fe0d0;
    --map-stroke: #161d26; --map-hover: #fbbf24;
    --c1: #2dd4bf; --c2: #fbbf24; --c3: #818cf8; --c4: #f472b6; --c5: #38bdf8; --c6: #a3e635; --c7: #c084fc; --c8: #94a3b8;
  }
}

/* ===== base ===== */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.7 var(--font); }
h1, h2, h3 { margin: 0; line-height: 1.4; }
h1 { font-size: 22px; font-weight: 700; }
h2 { font-size: 15px; font-weight: 700; }
p { margin: 0; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 4px; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.num { font-variant-numeric: tabular-nums; }
[hidden] { display: none !important; }

/* ===== top bar ===== */
.topbar { position: sticky; top: 0; z-index: 20; background: var(--surface); border-bottom: 1px solid var(--line); }
.topbar-in { max-width: 1360px; margin: 0 auto; padding: 0 20px; height: 58px; display: flex; align-items: center; gap: 24px; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--brand); white-space: nowrap; }
.brand:hover { text-decoration: none; }
.topnav { display: flex; gap: 4px; flex: 1; overflow-x: auto; }
.topnav a { padding: 6px 12px; border-radius: 8px; color: var(--muted); white-space: nowrap; }
.topnav a:hover { background: var(--surface-2); text-decoration: none; color: var(--text); }
.topnav a[aria-current="page"] { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.topbar-user { display: flex; align-items: center; gap: 12px; }
.who { display: flex; flex-direction: column; line-height: 1.3; text-align: start; }
.who small { color: var(--muted); font-size: 11.5px; }

/* ===== layout ===== */
.page { max-width: 1360px; margin: 0 auto; padding: 22px 20px 48px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.page-actions { display: flex; align-items: center; gap: 12px; }
.crumbs { display: flex; gap: 8px; font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.scope-chip { display: inline-block; margin-inline-start: 10px; padding: 1px 10px; border-radius: 999px; background: var(--brand-soft); color: var(--brand); font-size: 13px; font-weight: 600; vertical-align: middle; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; min-height: 28px; }
.card + .card { margin-top: 16px; }
.admin-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(300px, 1fr); gap: 16px; margin-top: 16px; }
.admin-grid .card + .card { margin-top: 0; }
.province-layout { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 16px; align-items: start; }
.side { display: flex; flex-direction: column; gap: 16px; position: sticky; top: 74px; }
.side .card + .card { margin-top: 0; }
.main { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid-2 > .card { margin: 0; }
.span-2 { grid-column: 1 / -1; }

/* ===== KPI ===== */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); }
.kpi .k-label { color: var(--muted); font-size: 12.5px; }
.kpi .k-value { font-size: 26px; font-weight: 700; line-height: 1.3; margin-top: 2px; font-variant-numeric: tabular-nums; }
.kpi .k-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.delta-up { color: var(--ok); } .delta-down { color: var(--danger); }

/* ===== map ===== */
.map-box { position: relative; }
.map-box svg { display: block; width: 100%; height: auto; max-height: 70vh; }
.map-small svg { max-height: 300px; }
.region { stroke: var(--map-stroke); stroke-width: .9; stroke-linejoin: round; cursor: default; transition: fill .15s; vector-effect: non-scaling-stroke; }
.region.clickable { cursor: pointer; }
.region.lvl-0 { fill: var(--map-0); } .region.lvl-1 { fill: var(--map-1); } .region.lvl-2 { fill: var(--map-2); }
.region.lvl-3 { fill: var(--map-3); } .region.lvl-4 { fill: var(--map-4); } .region.lvl-5 { fill: var(--map-5); }
.region:hover, .region:focus-visible { fill: var(--map-hover); outline: none; }
.region.selected { stroke: var(--text); stroke-width: 2; }
.legend { display: flex; align-items: center; gap: 4px; font-size: 11.5px; color: var(--muted); margin-top: 8px; }
.legend i { display: inline-block; width: 22px; height: 10px; border-radius: 2px; }
.legend .l0 { background: var(--map-0); } .legend .l1 { background: var(--map-1); } .legend .l2 { background: var(--map-2); }
.legend .l3 { background: var(--map-3); } .legend .l4 { background: var(--map-4); } .legend .l5 { background: var(--map-5); }
.tooltip { position: fixed; z-index: 50; pointer-events: none; background: #101828; color: #fff; padding: 6px 10px; border-radius: 8px; font-size: 12.5px; line-height: 1.5; box-shadow: 0 4px 14px rgba(0,0,0,.25); max-width: 260px; }

/* ===== lists & bars ===== */
.rank-list { display: flex; flex-direction: column; gap: 6px; max-height: 560px; overflow: auto; padding-inline-end: 4px; }
.rank-compact { max-height: 320px; }
.rank-row { display: grid; grid-template-columns: 22px minmax(70px, 38%) 1fr auto; align-items: center; gap: 8px; padding: 5px 6px; border-radius: 8px; color: var(--text); font-size: 13px; }
.rank-compact .rank-row { grid-template-columns: minmax(70px, 40%) 1fr auto; }
a.rank-row:hover, button.rank-row:hover { background: var(--surface-2); text-decoration: none; }
button.rank-row { border: 0; background: none; font: inherit; width: 100%; text-align: start; cursor: pointer; }
.rank-row.selected { background: var(--brand-soft); }
.rank-idx { color: var(--muted); font-size: 12px; text-align: center; }
.rank-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.track { height: 9px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.fill { height: 100%; background: var(--c1); border-radius: 999px; min-width: 2px; }
.rank-val { font-variant-numeric: tabular-nums; font-size: 12.5px; color: var(--muted); min-width: 52px; text-align: end; }
.bar-row { display: grid; grid-template-columns: minmax(80px, 36%) 1fr auto; align-items: center; gap: 10px; padding: 4px 0; font-size: 13px; }
.bar-row .rank-val { color: var(--text); }
.bar-row .pc { color: var(--muted); font-size: 11.5px; margin-inline-start: 6px; }
.note { margin-top: 10px; }
.foot-note { margin-top: 10px; color: var(--muted); font-size: 12px; }
.empty { color: var(--muted); padding: 24px 0; text-align: center; }

/* ===== charts ===== */
.donut-wrap { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.donut-wrap svg { flex: none; }
.donut-center { font-weight: 700; font-size: 18px; }
.donut-legend { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; flex: 1; min-width: 150px; font-size: 13px; }
.donut-legend li { display: flex; align-items: center; gap: 8px; }
.donut-legend .sw { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.donut-legend .v { margin-inline-start: auto; font-variant-numeric: tabular-nums; color: var(--muted); }
.cols { display: flex; align-items: flex-end; gap: 10px; height: 170px; padding-top: 8px; }
.col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 4px; min-width: 0; }
.col .bar { width: 100%; max-width: 54px; background: var(--c3); border-radius: 6px 6px 2px 2px; min-height: 2px; }
.col .cv { font-size: 12px; font-variant-numeric: tabular-nums; }
.col .cl { font-size: 12px; color: var(--muted); text-align: center; line-height: 1.3; }
.cols-24 { gap: 3px; height: 150px; }
.cols-24 .bar { max-width: none; }
.cols-24 .cl { font-size: 11px; min-height: 16px; }
.bar-split { position: relative; background: color-mix(in srgb, var(--c3) 35%, transparent); display: flex; align-items: flex-end; overflow: hidden; }
.bar-split .ok { width: 100%; background: var(--ph-answered); }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; }
.seg button { border: 0; background: var(--surface); color: var(--muted); font: inherit; padding: 4px 12px; cursor: pointer; }
.seg button + button { border-inline-start: 1px solid var(--line); }
.seg button[aria-pressed="true"] { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.section-title { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-top: 8px; }
.section-title h2 { font-size: 17px; }
.chart-svg text { font-family: var(--font); fill: var(--muted); font-size: 11px; }
.chart-svg .grid { stroke: var(--line); stroke-width: 1; }
.chart-svg .area { fill: var(--c1); opacity: .14; }
.chart-svg .line { fill: none; stroke: var(--c1); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart-svg .dot { fill: var(--surface); stroke: var(--c1); stroke-width: 2; }
.chart-svg .hit { fill: transparent; }
.phase { margin-bottom: 14px; }
.phase-head { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 4px; }
.stack { display: flex; height: 18px; border-radius: 6px; overflow: hidden; background: var(--surface-2); border: 1px solid var(--line); }
.stack span { display: block; height: 100%; min-width: 1px; }
.ph-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 6px; font-size: 12.5px; }
.ph-legend span { display: inline-flex; align-items: center; gap: 6px; }
.ph-legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }

/* ===== forms / buttons ===== */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 7px 14px; border-radius: 9px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font: inherit; cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); font-weight: 600; }
.btn-primary:hover { background: var(--brand); filter: brightness(.93); }
.btn-ghost { background: transparent; }
.btn-sm { padding: 3px 10px; font-size: 12.5px; }
.btn-danger { color: var(--danger); }
.btn-block { width: 100%; }
.field { display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.field > span { color: var(--muted); }
.field-inline { flex-direction: row; align-items: center; gap: 10px; }
input, select { font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: 9px; padding: 8px 10px; min-width: 0; }
input:focus, select:focus { outline: 2px solid var(--brand); outline-offset: 0; border-color: var(--brand); }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; align-items: end; }
.form-foot { margin-top: 14px; }
.toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; padding: 12px 16px; }
.alert { padding: 10px 14px; border-radius: 10px; margin-bottom: 14px; font-size: 13.5px; border: 1px solid transparent; }
.alert-error { background: var(--danger-soft); color: var(--danger); }
.alert-warn { background: var(--warn-soft); color: var(--warn); }
.alert-ok { background: var(--ok-soft); color: var(--ok); }

/* ===== tables ===== */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th { text-align: start; color: var(--muted); font-weight: 600; font-size: 12px; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.row-off { opacity: .6; }
.ltr-cell { text-align: end; font-family: ui-monospace, Consolas, monospace; }
.actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.inline-form { display: inline-flex; gap: 6px; align-items: center; }
.inline-form input { width: 120px; padding: 4px 8px; font-size: 12.5px; }
.inline-form select { padding: 4px 8px; font-size: 12.5px; }
.badge { display: inline-block; padding: 1px 9px; border-radius: 999px; font-size: 11.5px; background: var(--surface-2); border: 1px solid var(--line); color: var(--muted); }
.badge-ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.badge-off { background: var(--danger-soft); color: var(--danger); border-color: transparent; }

/* ===== login / plain ===== */
body.plain { display: grid; min-height: 100vh; place-items: center; }
.login-wrap { width: 100%; padding: 20px; display: grid; place-items: center; }
.login-card { width: min(100%, 400px); display: flex; flex-direction: column; gap: 14px; padding: 28px; }
.login-card + .login-card { margin: 0; }
.login-logo { color: var(--brand); display: grid; place-items: center; }
.login-card h1 { text-align: center; font-size: 20px; }
.login-card .muted { text-align: center; margin-top: -8px; }
.login-card .alert { margin: 0; }
.center-card { text-align: center; padding: 40px 20px; display: flex; flex-direction: column; gap: 12px; align-items: center; }

/* ===== footer ===== */
.site-foot { max-width: 1360px; margin: 0 auto; padding: 18px 20px 28px; display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; color: var(--muted); font-size: 12.5px; border-top: 1px solid var(--line); }
.site-foot a { color: var(--brand); font-weight: 600; }
body.plain { grid-template-rows: 1fr auto; }
body.plain .site-foot { width: 100%; border-top: 0; }

/* ===== skeleton ===== */
.skeleton { border-radius: var(--radius); background: linear-gradient(90deg, var(--surface-2) 25%, var(--line) 37%, var(--surface-2) 63%); background-size: 400% 100%; animation: sk 1.3s ease infinite; }
@keyframes sk { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }
@media (prefers-reduced-motion: reduce) { .skeleton { animation: none; } .region { transition: none; } }

/* ===== responsive ===== */
@media (max-width: 1100px) {
  .admin-grid { grid-template-columns: 1fr; }
  .province-layout { grid-template-columns: 1fr; }
  .side { position: static; flex-direction: row; flex-wrap: wrap; }
  .side > .card { flex: 1 1 320px; }
}
@media (max-width: 720px) {
  .page { padding: 16px 14px 40px; }
  .grid-2 { grid-template-columns: 1fr; }
  .topbar-in { padding: 0 14px; gap: 12px; }
  .who small { display: none; }
  .brand span { display: none; }
  h1 { font-size: 19px; }
  .side { flex-direction: column; }
}

/* ===== PWA / mobile ===== */
html { -webkit-tap-highlight-color: transparent; }
a, button, summary, select, input { touch-action: manipulation; }
.only-mobile { display: none; }
.head-actions { display: flex; gap: 8px; align-items: center; }
.btn-install { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); font-weight: 600; }
.net-banner { background: var(--warn-soft); color: var(--warn); text-align: center; font-size: 12.5px; padding: 6px 12px; }
.ios-tip { position: fixed; z-index: 40; inset-inline: 12px; bottom: calc(76px + env(safe-area-inset-bottom)); background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; display: flex; align-items: center; gap: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.18); font-size: 13px; }
.bottomnav { display: none; }
.chips { display: none; }
.chip { flex: none; display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--surface); color: var(--text); border-radius: 999px; padding: 6px 14px; font: inherit; font-size: 13px; cursor: pointer; white-space: nowrap; scroll-snap-align: center; }
.chip .chip-n { color: var(--muted); font-size: 11.5px; font-variant-numeric: tabular-nums; }
.chip.on { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); font-weight: 600; }
.chip.on .chip-n { color: inherit; opacity: .85; }

@media (display-mode: standalone) { .site-foot .credit { display: none; } }

@media (max-width: 720px) {
  body { font-size: 14.5px; padding-left: env(safe-area-inset-left); padding-right: env(safe-area-inset-right); }
  body.has-bottomnav { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
  .only-mobile { display: inline-flex; }

  .topbar { padding-top: env(safe-area-inset-top); }
  .topbar-in { height: 52px; padding: 0 12px; gap: 8px; }
  .topnav { display: none; }
  .brand { flex: 1; min-width: 0; }
  .brand span { display: inline; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; }
  .who { display: none; }
  .topbar-user { gap: 6px; }

  .bottomnav { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; position: fixed; z-index: 30; inset-inline: 0; bottom: 0; background: var(--surface); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
  .bottomnav a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 56px; color: var(--muted); font-size: 11.5px; text-decoration: none; }
  .bottomnav svg { width: 24px; height: 24px; }
  .bottomnav a[aria-current="page"] { color: var(--brand); font-weight: 700; }

  .page { padding: 14px 12px 28px; }
  .page-head { gap: 8px; margin-bottom: 12px; }
  .page-head > div:first-child { min-width: 0; }
  .page-actions { width: 100%; justify-content: space-between; }
  h1 { font-size: 18px; }
  .scope-chip { display: block; width: fit-content; margin: 6px 0 0; }
  .card { padding: 14px; border-radius: 12px; }
  .card + .card { margin-top: 12px; }
  .card-head { margin-bottom: 10px; }

  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .kpi { padding: 10px 12px; }
  .kpi .k-value { font-size: 21px; }
  .kpi .k-label, .kpi .k-sub { font-size: 12px; }

  .btn { min-height: 40px; }
  .btn-sm { min-height: 34px; }
  input, select { font-size: 16px; min-height: 42px; }
  .seg button { min-height: 36px; padding: 4px 14px; }
  .rank-row { padding: 9px 6px; }
  .rank-list { max-height: none; }

  /* county picking: scrollable chips bar; the map is collapsed until asked for */
  .chips { display: flex; gap: 8px; overflow-x: auto; scroll-snap-type: x proximity; position: sticky; top: calc(52px + env(safe-area-inset-top)); z-index: 15; background: var(--bg); margin: 0 -12px 12px; padding: 8px 12px; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .chips::-webkit-scrollbar { display: none; }
  .chips[hidden] { display: none !important; }
  #county-card { display: none; }
  .map-card #map-body { display: none; }
  .map-card.map-open #map-body { display: block; }
  .map-small svg { max-height: 280px; }
  .side { position: static; gap: 12px; }
  .province-layout { gap: 12px; }

  .donut-wrap { justify-content: center; }
  .bar-row { grid-template-columns: minmax(70px, 34%) 1fr auto; gap: 8px; }
  .cols { height: 150px; gap: 6px; }
  .cols-24 { gap: 2px; height: 120px; }
  .ph-legend { gap: 4px 12px; font-size: 12px; }
  .tooltip { max-width: 70vw; }

  /* tables turn into cards */
  .table.stack thead { display: none; }
  .table.stack, .table.stack tbody, .table.stack tr, .table.stack td { display: block; width: 100%; }
  .table.stack tr { border: 1px solid var(--line); border-radius: 12px; padding: 6px 12px; margin-bottom: 10px; background: var(--surface); }
  .table.stack td { display: flex; justify-content: space-between; align-items: center; gap: 12px; border: 0; padding: 7px 0; text-align: end; }
  .table.stack td::before { content: attr(data-label); color: var(--muted); font-size: 12px; text-align: start; flex: none; }
  .table.stack td.actions { flex-wrap: wrap; justify-content: flex-start; }
  .table.stack td.actions::before { width: 100%; }
  .inline-form input { width: 100%; }
  .toolbar { padding: 10px 12px; }
  .site-foot { padding: 14px 12px calc(20px + env(safe-area-inset-bottom)); font-size: 12px; text-align: center; }
  body.has-bottomnav .site-foot { padding-bottom: 14px; }
  .login-card { padding: 22px 18px; }
}
@media (max-width: 380px) {
  .kpi .k-value { font-size: 19px; }
  .brand span { font-size: 14px; }
}

/* ===== list-source picker ===== */
.span-all { grid-column: 1 / -1; }
.narrow-form { max-width: 720px; display: flex; flex-direction: column; gap: 16px; }
.srcpick { border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px 14px; margin: 0; min-width: 0; }
.srcpick legend { padding: 0 8px; color: var(--muted); font-size: 13px; }
.check { display: flex; align-items: flex-start; gap: 8px; padding: 5px 0; font-size: 13.5px; cursor: pointer; line-height: 1.6; }
.check input { width: 18px; height: 18px; min-height: 0; margin-top: 3px; flex: none; accent-color: var(--brand); }
.check small { margin-inline-start: auto; color: var(--muted); font-variant-numeric: tabular-nums; flex: none; padding-inline-start: 8px; }
.srcbox { margin-top: 8px; }
.srcq { width: 100%; margin-bottom: 8px; }
.srclist { max-height: 240px; overflow: auto; border: 1px solid var(--line); border-radius: 10px; padding: 4px 10px; background: var(--surface-2); }
.srclist .check[hidden] { display: none; }
.filterbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.filterbar select { max-width: min(100%, 420px); }
.filterbar .field-inline > span { white-space: nowrap; }
@media (max-width: 720px) {
  .filterbar { width: 100%; }
  .filterbar .field-inline { width: 100%; flex-direction: column; align-items: stretch; gap: 4px; }
  .filterbar select { max-width: none; width: 100%; }
}
