/* professional/ - community advocates directory. Tokens follow ../styles.css and b2b/. */
:root {
  --navy: #10224f; --navy-dark: #0a1636;
  --text: #10224f; --muted: #5b6b8c; --bg: #f4f8fd; --card: #fff; --border: #e2e8f4; --hover: #eef3fc;
  --primary: #2f6fed; --primary-h: #2358c8; --on-primary: #fff;
  --ok: #1f8a4c; --ok-bg: #e7f5ec; --warn: #8a5a00; --warn-bg: #fff4dc; --danger: #c8323c; --danger-bg: #fdecee;
  --like: #d6336c; --mark: #fff0a8;
  --shadow: 0 1px 2px rgba(16,34,79,.06), 0 6px 18px rgba(16,34,79,.06);
  --shadow-lg: 0 10px 40px rgba(16,34,79,.22);
  --radius: 14px; --gutter: 16px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --text: #eef2fb; --muted: #a7b2cc; --bg: #0b1226; --card: #131b36; --border: #24304f; --hover: #1a2444;
    --primary: #3f74ee; --primary-h: #5b8cf5;
    --ok: #4cc38a; --ok-bg: #12301f; --warn: #e0a94a; --warn-bg: #33270c; --danger: #ef6b73; --danger-bg: #3a1419;
    --like: #f06595; --mark: #5c4a00;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 6px 18px rgba(0,0,0,.3);
    --shadow-lg: 0 10px 40px rgba(0,0,0,.55);
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; color: var(--text); background: var(--bg);
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
body.no-scroll { overflow: hidden; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; }
mark { background: var(--mark); color: inherit; border-radius: 3px; padding: 0 1px; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.muted { color: var(--muted); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 40px; padding: 8px 16px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--card); color: var(--text); font-weight: 600; font-size: 14px; text-decoration: none; white-space: nowrap;
}
.btn:hover { background: var(--hover); text-decoration: none; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.btn-primary:hover { background: var(--primary-h); }
.btn-quiet { border-color: transparent; background: transparent; }
.btn-danger { color: var(--danger); border-color: var(--danger); }
.btn-ok { color: var(--ok); border-color: var(--ok); }
.btn-light { background: #fff; color: var(--navy); border-color: #fff; }
.btn-light:hover { background: #e9f0ff; }
.btn-outline-light { background: transparent; color: #fff; border-color: rgba(255,255,255,.55); }
.btn-outline-light:hover { background: rgba(255,255,255,.12); }
.btn-block { width: 100%; }
.btn-sm { min-height: 32px; padding: 5px 11px; font-size: 13px; border-radius: 8px; }
.icon-btn {
  display: inline-grid; place-items: center; width: 36px; height: 36px; border: 0; border-radius: 9px;
  background: transparent; color: var(--muted);
}
.icon-btn:hover { background: var(--hover); color: var(--text); }
.linkbtn { border: 0; background: none; padding: 0; color: var(--primary); font-weight: 600; }
.linkbtn:hover { text-decoration: underline; }

/* ---------- hero (motivational banner) ---------- */
.hero {
  position: relative; overflow: hidden; color: #fff;
  background:
    radial-gradient(900px 380px at 85% -10%, rgba(95,145,255,.45), transparent 60%),
    radial-gradient(700px 300px at 0% 120%, rgba(47,111,237,.35), transparent 60%),
    linear-gradient(135deg, #0a1636 0%, #10224f 55%, #173070 100%);
}
.hero::after { /* fine dotted texture */
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .14;
  background-image: radial-gradient(rgba(255,255,255,.9) 1px, transparent 1.2px); background-size: 22px 22px;
  mask-image: linear-gradient(90deg, transparent 0%, #000 70%);
}
.hero-inner { position: relative; z-index: 1; max-width: 1320px; margin: 0 auto; padding: 56px var(--gutter) 44px; }
.hero-kicker { margin: 0 0 10px; font-size: 13px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: #9fbcff; }
.hero h1 { max-width: 760px; font-size: clamp(28px, 4.4vw, 46px); font-weight: 800; letter-spacing: -.02em; }
.hero-lead { max-width: 700px; margin: 16px 0 0; font-size: clamp(15px, 1.6vw, 18px); line-height: 1.6; color: #d7e2ff; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; }
.hero-actions .btn { min-height: 46px; padding: 10px 20px; font-size: 15px; }
.hero-stats { display: flex; flex-wrap: wrap; gap: 10px 36px; margin: 34px 0 0; padding: 0; list-style: none; }
.hero-stats li { display: flex; align-items: baseline; gap: 8px; color: #b9c9ef; font-size: 14px; }
.hero-stats b { font-size: 24px; color: #fff; font-weight: 800; }

/* ---------- notice bars ---------- */
.notice-bar { max-width: 1320px; margin: 16px auto 0; padding: 0 var(--gutter); }
.notice-bar .inner {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; padding: 12px 16px;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
}
.notice-bar .grow { flex: 1 1 260px; }
.status-pill { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 700; }
.status-pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.status-draft { background: var(--hover); color: var(--muted); }
.status-pending { background: var(--warn-bg); color: var(--warn); }
.status-approved { background: var(--ok-bg); color: var(--ok); }
.status-rejected { background: var(--danger-bg); color: var(--danger); }

/* ---------- moderation queue (?moderate=1) ---------- */
.moderation { max-width: 1320px; margin: 16px auto 0; padding: 0 var(--gutter); }
.moderation .inner { padding: 16px; border: 2px dashed var(--warn); border-radius: var(--radius); background: var(--card); }
.moderation h2 { font-size: 17px; margin-bottom: 4px; }
.mod-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 10px 0; border-top: 1px solid var(--border); }
.mod-row:first-of-type { border-top: 0; }
.mod-row .grow { flex: 1 1 260px; min-width: 0; }

/* ---------- directory layout ---------- */
.directory {
  max-width: 1320px; margin: 0 auto; padding: 24px var(--gutter) 40px;
  display: grid; gap: 22px; grid-template-columns: 250px minmax(0, 1fr) 280px; align-items: start;
}
.panel {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 16px;
}
.panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.panel-head h2 { font-size: 15px; letter-spacing: .02em; }
.tree-panel, .news-panel { position: sticky; top: calc(var(--ac-bar, 0px) + 16px); max-height: calc(100vh - var(--ac-bar, 0px) - 32px); overflow: auto; }
.tree-close, .tree-open { display: none; }
.scrim { display: none; }

/* ---------- search ---------- */
.search {
  display: flex; align-items: center; gap: 8px; padding: 0 14px; min-height: 48px;
  background: var(--card); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow); color: var(--muted);
}
.search:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(47,111,237,.18); }
.search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; padding: 10px 0; font-size: 15px; color: var(--text); }
.small-search { min-height: 40px; box-shadow: none; border-radius: 10px; margin-bottom: 10px; }
.small-search input { font-size: 14px; padding: 7px 0; }

/* ---------- tree ---------- */
.tree { font-size: 14px; }
.tree ul { list-style: none; margin: 0; padding: 0; }
.tree ul ul { padding-left: 14px; margin-left: 9px; border-left: 1px solid var(--border); }
.tree-row {
  display: flex; align-items: center; gap: 2px; min-height: 34px; border-radius: 8px; padding-right: 6px; cursor: pointer; user-select: none;
}
.tree-row:hover { background: var(--hover); }
.tree-row[aria-selected="true"] { background: var(--primary); color: var(--on-primary); }
.tree-row[aria-selected="true"] .count { color: inherit; opacity: .85; }
.tree [role="treeitem"]:focus-visible > .tree-row { outline: 2px solid var(--primary); outline-offset: -2px; }
.tree [role="treeitem"]:focus { outline: none; }
.twisty {
  flex: none; display: grid; place-items: center; width: 24px; height: 24px; border: 0; padding: 0; border-radius: 6px;
  background: transparent; color: inherit; opacity: .7;
}
.twisty svg { transition: transform .15s; }
[aria-expanded="true"] > .tree-row .twisty svg { transform: rotate(90deg); }
.twisty.leaf { visibility: hidden; }
.tree-label { flex: 1; min-width: 0; overflow-wrap: anywhere; padding: 4px 0; }
.count { flex: none; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.tree-row.dim { opacity: .55; }
.tree-empty { color: var(--muted); font-size: 13px; padding: 8px 4px; }
.tree-foot { margin: 12px 0 0; padding-top: 10px; border-top: 1px solid var(--border); font-size: 13px; }

/* ---------- results ---------- */
.toolbar { display: grid; gap: 12px; margin-bottom: 14px; }
.toolbar-row { display: flex; align-items: center; gap: 10px; }
.results-title { flex: 1; min-width: 0; overflow-wrap: anywhere; font-size: 15px; font-weight: 600; color: var(--muted); }
.sort select {
  min-height: 38px; padding: 6px 30px 6px 10px; border: 1px solid var(--border); border-radius: 9px; background: var(--card);
}
.active-filter { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 13.5px; color: var(--muted); }
.crumb { color: var(--text); font-weight: 600; }
.crumb-sep { opacity: .5; }
.clear-chip {
  display: inline-flex; align-items: center; gap: 5px; margin-left: 4px; padding: 3px 10px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--card); font-size: 12.5px;
}
.clear-chip:hover { background: var(--hover); }
.demo-note { margin: 0 0 14px; padding: 8px 12px; font-size: 13px; color: var(--warn); background: var(--warn-bg); border-radius: 10px; }

.cards { display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); }
.empty { padding: 40px 20px; text-align: center; background: var(--card); border: 1px dashed var(--border); border-radius: var(--radius); }
.empty p { color: var(--muted); }

/* ---------- advocate card ---------- */
.card {
  display: flex; flex-direction: column; overflow: hidden; min-width: 0;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
  transition: box-shadow .15s, transform .15s;
}
.card:hover { box-shadow: var(--shadow-lg); }
.card-body { display: flex; flex-direction: column; gap: 9px; padding: 14px 16px 16px; flex: 1; }
.card-head { display: flex; align-items: center; gap: 12px; min-width: 0; }
.card-title { display: grid; gap: 3px; min-width: 0; flex: 1; }
.card-name { font-size: 17px; font-weight: 750; line-height: 1.25; }

/* rectangular logo avatar leading every listing (uploaded logo, or initials on the advocate's palette) */
.logo {
  flex: none; display: grid; place-items: center; width: 72px; height: 48px; border-radius: 9px; overflow: hidden;
  color: #fff; font-weight: 800; font-size: 17px; letter-spacing: .03em; border: 1px solid var(--border);
}
.logo.has-img { background: #fff; padding: 4px; }
.logo img { width: 100%; height: 100%; object-fit: contain; display: block; }
.logo-sm { width: 54px; height: 36px; font-size: 13px; border-radius: 7px; }
.logo-lg { width: 150px; height: 100px; font-size: 32px; border-radius: 12px; }
.logo-edit { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.logo-actions { display: grid; gap: 8px; flex: 1; min-width: 200px; }
.logo-buttons { display: flex; gap: 8px; flex-wrap: wrap; }
.card-name button { border: 0; background: none; padding: 0; text-align: left; font: inherit; color: inherit; }
.card-name button:hover { color: var(--primary); }
.card-headline { margin: 0; font-size: 14px; color: var(--text); }
.card-bio { margin: 0; font-size: 13.5px; line-height: 1.5; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.card-org { margin: 0; font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 6px; min-width: 0; }
.card-org a { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chips { display: flex; flex-wrap: wrap; gap: 5px; }
.chip {
  display: inline-flex; align-items: center; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600;
  background: var(--hover); color: var(--primary); border: 0;
}
button.chip:hover { background: var(--primary); color: var(--on-primary); }
.tag { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 12px; color: var(--muted); border: 1px solid var(--border); background: transparent; }
button.tag:hover { color: var(--text); border-color: var(--muted); }
.links { list-style: none; margin: 0; padding: 0; display: grid; gap: 5px; }
.links li { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 13.5px; }
.links a { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kind {
  flex: none; font-size: 10.5px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase;
  padding: 1px 6px; border-radius: 5px;
}
.kind-service { background: var(--ok-bg); color: var(--ok); }
.kind-campaign { background: var(--warn-bg); color: var(--warn); }
.more { font-size: 12.5px; color: var(--muted); }
.card-foot { display: flex; align-items: center; gap: 8px; margin-top: auto; padding-top: 10px; border-top: 1px solid var(--border); }
.card-foot .grow { flex: 1; }
.like {
  display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 5px 11px; border-radius: 999px;
  border: 1px solid var(--border); background: transparent; font-weight: 700; font-size: 13.5px; color: var(--muted);
}
.like:hover { color: var(--like); border-color: var(--like); }
.like[aria-pressed="true"] { color: var(--like); border-color: var(--like); background: color-mix(in srgb, var(--like) 10%, transparent); }
.like[aria-pressed="true"] svg { fill: currentColor; }
.like.pop svg { animation: pop .35s ease; }
@keyframes pop { 50% { transform: scale(1.35); } }

/* ---------- carousel ---------- */
.carousel { position: relative; background: var(--hover); }
.carousel-track {
  display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; aspect-ratio: 16 / 10;
  -webkit-overflow-scrolling: touch;
}
.carousel-track::-webkit-scrollbar { display: none; }
.carousel-slide { flex: 0 0 100%; scroll-snap-align: start; position: relative; margin: 0; }
.carousel-slide img { display: block; width: 100%; height: 100%; object-fit: cover; }
.carousel-slide figcaption {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 18px 12px 8px; font-size: 12.5px; color: #fff;
  background: linear-gradient(transparent, rgba(0,0,0,.6));
}
.carousel-nav {
  position: absolute; top: 50%; transform: translateY(-50%); width: 34px; height: 34px; border-radius: 50%; border: 0;
  display: grid; place-items: center; background: rgba(255,255,255,.92); color: #10224f; box-shadow: 0 2px 8px rgba(0,0,0,.2);
  opacity: 0; transition: opacity .15s;
}
.carousel:hover .carousel-nav, .carousel-nav:focus-visible { opacity: 1; }
@media (hover: none) { .carousel-nav { display: none; } }
.carousel-nav.prev { left: 8px; }
.carousel-nav.next { right: 8px; }
.carousel-nav:disabled { opacity: 0 !important; pointer-events: none; }
.carousel-dots { position: absolute; left: 0; right: 0; bottom: 8px; display: flex; justify-content: center; gap: 5px; pointer-events: none; }
.carousel-dots span { width: 6px; height: 6px; border-radius: 50%; background: rgba(255,255,255,.55); transition: width .15s; }
.carousel-dots span.on { background: #fff; width: 16px; border-radius: 3px; }
.carousel.has-caption .carousel-dots { bottom: auto; top: 10px; }

/* ---------- news ---------- */
.news { display: grid; gap: 14px; }
.news article { padding-bottom: 14px; border-bottom: 1px solid var(--border); }
.news article:last-child { border-bottom: 0; padding-bottom: 0; }
.news time { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.news h3 { margin: 3px 0 4px; font-size: 14.5px; }
.news p { margin: 0; font-size: 13.5px; color: var(--muted); }
.join-card { margin-top: 18px; padding: 16px; border-radius: 12px; background: linear-gradient(135deg, #10224f, #1d3a85); color: #fff; }
.join-card h3 { font-size: 15.5px; }
.join-card p { margin: 6px 0 12px; font-size: 13.5px; color: #cfdcff; }

/* ---------- trust (professional-content banner) ---------- */
.trust { padding: 0 var(--gutter) 40px; }
.trust-inner {
  max-width: 1320px; margin: 0 auto; display: flex; gap: 22px; align-items: flex-start;
  padding: 28px; border-radius: 18px; color: #e8eeff;
  background: linear-gradient(135deg, #0a1636, #10224f 60%, #1b3577);
  box-shadow: var(--shadow-lg);
}
.trust-icon { flex: none; color: #8fb0ff; }
.trust h2 { font-size: clamp(19px, 2.4vw, 24px); color: #fff; }
.trust-points { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 10px 26px; margin: 16px 0 0; padding: 0; list-style: none; }
.trust-points li { font-size: 14px; line-height: 1.55; color: #c8d5f5; }
.trust-points b { display: block; color: #fff; margin-bottom: 2px; }
.trust-links { margin: 18px 0 0; font-size: 13.5px; color: #8fa3d4; }
.trust-links a { color: #fff; text-decoration: underline; text-underline-offset: 2px; }

.site-footer { text-align: center; padding: 10px var(--gutter) 40px; font-size: 13px; color: var(--muted); }
.site-footer p { margin: 0 0 6px; }
.site-footer a { color: var(--muted); }

/* ---------- dialogs ---------- */
.overlay {
  position: fixed; inset: 0; z-index: 600; display: flex; align-items: center; justify-content: center; padding: 20px; padding-top: var(--ac-dlg-top,70px);
  background: rgba(8, 14, 34, .55); backdrop-filter: blur(2px); animation: fade .15s;
}
@keyframes fade { from { opacity: 0; } }
.dialog {
  position: relative; display: flex; flex-direction: column; width: 100%; max-width: 560px; max-height: calc(100vh - var(--ac-dlg-top,70px) - 20px);
  background: var(--card); color: var(--text); border-radius: 18px; box-shadow: var(--shadow-lg); overflow: hidden;
}
.dialog.wide { max-width: 760px; }
.dialog.xwide { max-width: 1100px; }
.dialog-head { display: flex; align-items: center; gap: 10px; padding: 14px 14px 14px 22px; border-bottom: 1px solid var(--border); }
.dialog-head h2 { flex: 1; font-size: 17px; }
.dialog-body { padding: 20px 22px 24px; overflow: auto; }
.dialog-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 12px 22px; border-top: 1px solid var(--border); background: var(--bg); }
.dialog-foot .grow { flex: 1; }

/* advocate detail */
.detail .carousel { border-radius: 12px; overflow: hidden; margin-bottom: 16px; }
.detail .carousel-track { aspect-ratio: 16 / 8; }
.detail-headline { margin: 4px 0 10px; font-size: 15.5px; }
.detail-bio { margin: 12px 0; white-space: pre-line; line-height: 1.6; }
.detail-section { margin-top: 18px; }
.detail-section h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); margin-bottom: 8px; }
.detail-meta { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 14px; margin: 0; }
.detail-meta dt { color: var(--muted); }
.detail-meta dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }

/* ---------- forms ---------- */
.form { display: grid; gap: 16px; }
.field { display: grid; gap: 6px; min-width: 0; }
.field > label, .field-label { font-weight: 650; font-size: 14px; }
.opt { font-weight: 400; color: var(--muted); font-size: 13px; }
.input, .field input[type="text"], .field input[type="email"], .field input[type="url"], .field input[type="tel"], .field textarea, .field select {
  width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--card); font-size: 15px;
}
.field textarea { resize: vertical; min-height: 110px; line-height: 1.5; }
.field input:focus, .field textarea:focus, .field select:focus, .input:focus { outline: 0; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(47,111,237,.18); }
.field input[readonly] { background: var(--hover); color: var(--muted); }
.help { margin: 0; font-size: 12.5px; color: var(--muted); }
.err { margin: 0; font-size: 13px; color: var(--danger); font-weight: 600; }
.field.invalid input, .field.invalid textarea { border-color: var(--danger); }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; line-height: 1.45; cursor: pointer; }
.check input { flex: none; width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--primary); }
.form-msg { margin: 0; padding: 10px 12px; border-radius: 10px; font-size: 14px; }
.form-msg.error { background: var(--danger-bg); color: var(--danger); }
.form-msg.ok { background: var(--ok-bg); color: var(--ok); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.row-2 { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; }
.counter { justify-self: end; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.reveal { animation: reveal .25s ease; }
@keyframes reveal { from { opacity: 0; transform: translateY(6px); } }

/* register */
.register-lead { margin: 0 0 4px; color: var(--muted); }
.steps { display: flex; gap: 6px; margin: 0 0 18px; padding: 0; list-style: none; font-size: 12.5px; color: var(--muted); }
.steps li { flex: 1; padding-top: 8px; border-top: 3px solid var(--border); }
.steps li.on { border-color: var(--primary); color: var(--text); font-weight: 650; }
.steps li.done { border-color: var(--ok); }
.gate-hint { margin: 0; font-size: 13px; color: var(--muted); text-align: center; }

/* contact form inside detail */
.contact-box { margin-top: 22px; padding: 16px; border: 1px solid var(--border); border-radius: 12px; background: var(--bg); }
.contact-box h3 { font-size: 16px; margin-bottom: 4px; text-transform: none; letter-spacing: 0; color: var(--text); }
.from-line { font-size: 13.5px; color: var(--muted); margin: 0; }

/* ---------- listing editor ---------- */
.editor { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 0; min-height: 0; flex: 1; }
.editor-form { overflow: auto; padding: 20px 22px 28px; }
.editor-preview { overflow: auto; padding: 20px; background: var(--bg); border-left: 1px solid var(--border); }
.editor-preview .preview-label { margin: 0 0 10px; font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.editor-tabs { display: none; }
.section { padding: 18px 0; border-top: 1px solid var(--border); display: grid; gap: 14px; }
.section:first-child { border-top: 0; padding-top: 0; }
.section-title { display: flex; align-items: baseline; gap: 8px; }
.section-title h3 { font-size: 15px; }
.section-title .num { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--primary); color: #fff; font-size: 12px; font-weight: 800; flex: none; }
.section-title .step-count { margin-left: auto; font-size: 12px; color: var(--muted); font-weight: 600; }
.step-panel { border-top: 0; padding-top: 4px; }
.check-help { display: block; margin-top: 2px; }

/* listing editor steps: each one is saved on its own */
.wiz-steps { display: flex; gap: 6px; margin: 0 0 18px; padding: 0 0 4px; list-style: none; overflow-x: auto; scrollbar-width: thin; }
.wiz-steps li { flex: 1 0 auto; }
.wiz-step {
  display: flex; align-items: center; gap: 7px; width: 100%; min-height: 40px; padding: 6px 10px 6px 6px; text-align: left;
  border: 1px solid var(--border); border-radius: 10px; background: var(--card); color: var(--muted); font-size: 12.5px; font-weight: 600;
}
.wiz-step:hover { border-color: var(--primary); color: var(--text); }
.wiz-step .n {
  display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; flex: none;
  background: var(--hover); color: var(--muted); font-size: 11.5px; font-weight: 800;
}
.wiz-step .t { white-space: nowrap; }
.wiz-step.done .n { background: var(--ok); color: #fff; }
.wiz-step.warn .n { background: var(--warn-bg); color: var(--warn); box-shadow: inset 0 0 0 1.5px var(--warn); }
.wiz-step.on { border-color: var(--primary); color: var(--text); box-shadow: 0 0 0 2px rgba(47,111,237,.18); }
.wiz-step.on .n { background: var(--primary); color: #fff; }
.review-list { display: grid; gap: 8px; }
.review-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; }
.review-row .grow { flex: 1; min-width: 0; }
.review-row .n {
  display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; flex: none;
  background: var(--hover); color: var(--muted); font-size: 12px; font-weight: 800;
}
.review-row.done .n { background: var(--ok); color: #fff; }
.review-row.warn { border-color: var(--warn); background: var(--warn-bg); }
.review-row.warn .help { color: var(--warn); }
.review-row.bad .help { color: var(--danger); }

.verify-note { margin: 0 0 16px; padding: 10px 12px; border-radius: 10px; font-size: 13.5px; background: var(--hover); }

.chip-input {
  display: flex; flex-wrap: wrap; gap: 6px; align-items: center; min-height: 44px; padding: 6px 8px;
  border: 1px solid var(--border); border-radius: 10px; background: var(--card); cursor: text;
}
.chip-input:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(47,111,237,.18); }
.chip-input input { flex: 1; min-width: 120px; border: 0; outline: 0; background: transparent; padding: 4px; font-size: 15px; }
.chip-x { display: inline-flex; align-items: center; gap: 4px; padding: 3px 4px 3px 10px; border-radius: 999px; background: var(--hover); font-size: 13px; font-weight: 600; }
.chip-x button { display: grid; place-items: center; width: 20px; height: 20px; border: 0; border-radius: 50%; background: transparent; color: var(--muted); padding: 0; }
.chip-x button:hover { background: var(--border); color: var(--text); }

.domain-picker { border: 1px solid var(--border); border-radius: 10px; padding: 8px; max-height: 260px; overflow: auto; }
.domain-picker .tree-row { min-height: 32px; }
.domain-picker .tree-row[aria-selected="true"] { background: transparent; color: inherit; }
.domain-picker input[type="checkbox"] { width: 18px; height: 18px; margin: 0 6px 0 0; accent-color: var(--primary); flex: none; }

.link-rows { display: grid; gap: 10px; }
.link-row { display: grid; grid-template-columns: 120px minmax(0, 1fr) minmax(0, 1.2fr) auto; gap: 8px; align-items: center; }
.link-row select, .link-row input { min-height: 42px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 10px; background: var(--card); width: 100%; min-width: 0; }

.image-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.image-tile { position: relative; border-radius: 10px; overflow: hidden; border: 1px solid var(--border); background: var(--hover); display: flex; flex-direction: column; }
.image-tile img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; display: block; }
.image-tile input { border: 0; border-top: 1px solid var(--border); padding: 6px 8px; font-size: 12.5px; background: var(--card); min-width: 0; }
.image-tools { position: absolute; top: 4px; right: 4px; display: flex; gap: 3px; }
.image-tools button { width: 26px; height: 26px; border: 0; border-radius: 7px; background: rgba(0,0,0,.55); color: #fff; display: grid; place-items: center; padding: 0; }
.image-tools button:hover { background: rgba(0,0,0,.8); }
.image-add {
  display: grid; place-items: center; gap: 4px; aspect-ratio: 16 / 10; border: 2px dashed var(--border); border-radius: 10px;
  color: var(--muted); font-size: 13px; font-weight: 600; text-align: center; cursor: pointer; background: transparent;
}
.image-add:hover { border-color: var(--primary); color: var(--primary); }
.preview-card { max-width: 380px; margin: 0 auto; }
.preview-card .card { pointer-events: none; }
.preview-status { margin-top: 14px; font-size: 13px; color: var(--muted); text-align: center; }

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 700; max-width: calc(100% - 32px);
  padding: 11px 18px; border-radius: 12px; background: #10224f; color: #fff; font-size: 14px; box-shadow: var(--shadow-lg);
  animation: reveal .2s ease;
}

/* ---------- responsive ---------- */
@media (max-width: 1179px) {
  .directory { grid-template-columns: 240px minmax(0, 1fr); }
  .news-panel { grid-column: 2; position: static; max-height: none; }
}
@media (max-width: 959px) {
  .editor { grid-template-columns: 1fr; }
  .editor-tabs {
    display: flex; gap: 4px; padding: 8px 14px; border-bottom: 1px solid var(--border); background: var(--card);
  }
  .editor-tabs button { flex: 1; min-height: 38px; border: 0; border-radius: 9px; background: transparent; font-weight: 650; color: var(--muted); }
  .editor-tabs button[aria-selected="true"] { background: var(--hover); color: var(--text); }
  .editor[data-tab="edit"] .editor-preview { display: none; }
  .editor[data-tab="preview"] .editor-form { display: none; }
  .editor-preview { border-left: 0; }
}
@media (max-width: 859px) {
  .directory { grid-template-columns: minmax(0, 1fr); padding-top: 18px; }
  .news-panel { grid-column: auto; }
  .tree-open, .tree-close { display: inline-flex; }
  .tree-panel {
    position: fixed; z-index: 550; top: 0; bottom: 0; left: 0; width: min(340px, 88vw); max-height: none;
    border-radius: 0 16px 16px 0; padding-top: calc(var(--ac-bar, 0px) + 14px);
    transform: translateX(-105%); transition: transform .22s ease; visibility: hidden;
  }
  .tree-panel.open { transform: none; visibility: visible; }
  .scrim { display: block; position: fixed; inset: 0; z-index: 540; background: rgba(8,14,34,.45); }
  .scrim[hidden] { display: none !important; }
  .hero-inner { padding-top: 40px; padding-bottom: 32px; }
}
@media (max-width: 640px) {
  .overlay { padding: var(--ac-dlg-top,70px) 0 0; align-items: stretch; }
  .dialog, .dialog.wide, .dialog.xwide { max-width: none; max-height: none; height: 100%; border-radius: 16px 16px 0 0; }
  .dialog-head { padding-left: 16px; }
  .dialog-body, .editor-form { padding: 16px; }
  .dialog-foot { padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); }
  .row-2 { grid-template-columns: 1fr; }
  .link-row { grid-template-columns: 1fr auto; }
  .link-row select { grid-column: 1 / -1; }
  .link-row .link-title { grid-column: 1 / -1; }
  .trust-inner { flex-direction: column; padding: 22px 18px; }
  .hero-actions .btn { flex: 1 1 100%; }
  .detail .carousel-track { aspect-ratio: 16 / 10; }
  /* steps: numbers only, except the current one */
  .wiz-steps li { flex: 0 0 auto; }
  .wiz-step:not(.on) .t { display: none; }
  .wiz-step:not(.on) { padding-right: 6px; }
  .logo-lg { width: 120px; height: 80px; font-size: 26px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
