:root {
  --bg: #f3f4f8;
  --surface: #ffffff;
  --surface-2: #f3f4f8;
  --border: #e3e6ee;
  --text: #101423;
  --muted: #5b6275;
  --faint: #9aa0b2;
  --accent: #3d3bf3;
  --accent-ink: #2a28c9;
  --accent-soft: #ecebfe;
  --accent-line: #c9c8fb;
  --ink: #101423;
  --on-ink: #ffffff;
  --danger: #b42318;
  --danger-soft: #fff5f5;
  --ok: #12a150;
  --warn-bg: #fff4d6;
  --warn-ink: #5c4400;
  --radius: 18px;
  --shadow-card: 0 1px 2px rgba(16, 20, 35, .05), 0 4px 16px rgba(16, 20, 35, .04);
  --shadow-pop: 0 16px 40px rgba(16, 20, 35, .22);
  --font-display: "Bricolage Grotesque", "Figtree", system-ui, sans-serif;
  --font-body: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0c0f1a;
    --surface: #151a2b;
    --surface-2: #1c2236;
    --border: #2a3149;
    --text: #eef0f7;
    --muted: #a3aac0;
    --faint: #6f7791;
    --accent: #8b8aff;
    --accent-ink: #b4b3ff;
    --accent-soft: #23264a;
    --accent-line: #3a3d78;
    --ink: #eef0f7;
    --on-ink: #0c0f1a;
    --danger: #ff8a80;
    --danger-soft: #2c1719;
    --warn-bg: #3a2f10;
    --warn-ink: #f3dc9b;
    --shadow-card: 0 1px 2px rgba(0, 0, 0, .3);
    --shadow-pop: 0 16px 40px rgba(0, 0, 0, .5);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 500 15px/1.4 var(--font-body);
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

button, .button, input, select { font: inherit; color: inherit; }

button, .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}

button:hover, .button:hover { border-color: var(--accent-line); }
button:disabled { opacity: .5; cursor: default; }

button.primary, .button.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 6px 16px rgba(61, 59, 243, .28);
}

button.block { width: 100%; min-height: 54px; border-radius: 16px; font-size: 17px; }
.button-ghost { background: transparent; }
.button-link { border: 0; background: transparent; color: var(--accent); padding: 0 6px; min-height: 36px; }
.button-link:hover { color: var(--accent-ink); }
.icon-btn { width: 44px; height: 44px; min-height: 44px; padding: 0; border-radius: 14px; flex: none; }
.icon-btn.danger { color: var(--danger); background: var(--danger-soft); border-color: transparent; }

input[type=search], input[type=text], input[type=email], input[type=number] {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0 12px;
  min-height: 44px;
  min-width: 0;
  font-size: 16px;
}

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
a { color: var(--accent); }
.muted { color: var(--muted); }

.eyebrow { font-size: 13px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }

.icon {
  width: 22px;
  height: 22px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-spec { width: 26px; height: 26px; color: var(--accent); }

.count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 11px;
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}

.badge {
  display: inline-block;
  padding: 0 6px;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 700;
  line-height: 19px;
  letter-spacing: .02em;
  white-space: nowrap;
  color: #fff;
  background: var(--badge-bg, #667085);
}

.badge-md { --badge-bg: #2459d6; }
.badge-ms { --badge-bg: #0f8a5f; }
.badge-dnb { --badge-bg: #8a4bd6; }
.badge-dnb6 { --badge-bg: #b0357d; }
.badge-dnbdip { --badge-bg: #c26a10; }
.badge-dip { --badge-bg: #7a6a00; }
.badge-region-south { --badge-bg: #0f766e; }
.badge-region-west { --badge-bg: #b45309; }
.badge-region-north { --badge-bg: #1d4ed8; }
.badge-region-central { --badge-bg: #7c3aed; }
.badge-region-east { --badge-bg: #be123c; }
.badge-region-northeast { --badge-bg: #15803d; }

#planner { display: flex; flex-direction: column; flex: 1; min-height: 0; }

.topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.brand { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.brand-name { font: 700 22px/1.1 var(--font-display); letter-spacing: -.02em; }
.brand-sub { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); min-width: 0; }
.brand-sub #save-status { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sync-dot { width: 8px; height: 8px; border-radius: 4px; background: var(--ok); flex: none; }
.busy .sync-dot { background: var(--accent); animation: pulse 1s ease-in-out infinite; }
.sync-error .sync-dot { background: var(--danger); }
@keyframes pulse { 50% { transform: scale(1.6); opacity: .45; } }

.sk { display: block; border-radius: 8px; background: linear-gradient(90deg, var(--surface-2) 0%, var(--border) 50%, var(--surface-2) 100%); background-size: 200% 100%; animation: shimmer 1.2s linear infinite; }
.sk-title { height: 18px; width: 78%; }
.sk-line { height: 13px; width: 55%; }
.sk-short { width: 38%; }
.sk-round { width: 46px; height: 46px; border-radius: 23px; flex: none; }
.skeleton .r-main, .skeleton .p-main { gap: 10px; }
.pick.skeleton .p-main { padding: 16px 14px; }
.pick.skeleton .p-rank { color: var(--border); }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .sk, .busy .sync-dot { animation: none; } }
.topbar-actions { display: flex; align-items: center; gap: 8px; }

.menu { position: relative; }
.menu summary { list-style: none; cursor: pointer; }
.menu summary::-webkit-details-marker { display: none; }

.avatar {
  width: 44px;
  height: 44px;
  border-radius: 22px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
}

.menu-pop {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 30;
  min-width: 240px;
  padding: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow-pop);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.menu-pop form { margin: 0; }
.menu-email { padding: 8px 10px 10px; font-size: 13px; color: var(--muted); border-bottom: 1px solid var(--border); margin-bottom: 4px; overflow-wrap: anywhere; }

.menu-item {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  width: 100%;
  min-height: 44px;
  padding: 0 10px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  font-weight: 600;
  text-decoration: none;
}

.menu-item:hover { background: var(--surface-2); }

.banner {
  margin: 0;
  padding: 10px 24px;
  background: var(--accent-soft);
  color: var(--text);
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  font-size: 14px;
}

.banner.warn { background: var(--warn-bg); color: var(--warn-ink); }

.flash { margin: 0; padding: 10px 24px; background: var(--accent-soft); }
.flash-alert { color: var(--danger); }

.panes {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 460px;
  min-height: 0;
}

.pane { display: flex; flex-direction: column; min-height: 0; overflow: auto; padding: 20px 28px 32px; gap: 14px; }
.pane.order { background: var(--surface); border-left: 1px solid var(--border); padding: 20px 24px 32px; }

.searchbar { display: flex; gap: 10px; flex: none; }

.search {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 50px;
  padding: 0 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow-card);
  color: var(--muted);
}

.search input { border: 0; background: transparent; outline: 0; flex: 1; min-height: 46px; padding: 0; color: var(--text); }
.search:focus-within { border-color: var(--accent); }
.search-small { flex: none; min-height: 44px; box-shadow: none; background: var(--surface-2); border-color: transparent; }
.search-small input { min-height: 42px; }

.filters-btn {
  position: relative;
  min-height: 50px;
  border-radius: 16px;
  border: 0;
  background: var(--ink);
  color: var(--on-ink);
  padding: 0 18px;
}

.filters-btn:hover { border: 0; opacity: .92; }

.chips { flex: none; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 38px;
  padding: 0 8px 0 10px;
  border-radius: 19px;
  border: 1px solid var(--accent-line);
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-size: 14px;
  font-weight: 600;
  max-width: 100%;
}

.chip .chip-x { font-size: 18px; line-height: 1; opacity: .7; padding: 0 2px; }
.chip .icon { width: 20px; height: 20px; }
.chip-label { overflow: hidden; text-overflow: ellipsis; }

.result-bar { flex: none; display: flex; justify-content: space-between; align-items: center; gap: 8px; min-height: 36px; }

.results, .picks, .snapshots { list-style: none; margin: 0; padding: 0; }
.results { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 380px), 1fr)); gap: 12px; align-content: start; }

.result {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 16px;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  border: 1px solid transparent;
}

.r-main { display: flex; flex-direction: column; gap: 8px; flex: 1; min-width: 0; }
.r-inst { font-weight: 700; font-size: 16px; line-height: 1.3; }
.r-addr, .p-addr { font-size: 12.5px; line-height: 1.35; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-top: -4px; }
.r-addr:empty, .p-addr:empty { display: none; }
.pick.open .p-addr { -webkit-line-clamp: unset; }
.r-prog { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 14px; }
.r-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }

.r-add {
  flex: none;
  width: 46px;
  height: 46px;
  min-height: 46px;
  padding: 0;
  border-radius: 23px;
  border: 0;
  background: var(--accent);
  color: #fff;
  font-size: 26px;
  font-weight: 500;
  line-height: 1;
  box-shadow: 0 4px 12px rgba(61, 59, 243, .32);
}

.result.added .r-add {
  width: auto;
  min-width: 54px;
  padding: 0 12px;
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-size: 15px;
  font-weight: 700;
  box-shadow: none;
}

.more { align-self: center; }

.contact-btn {
  align-self: flex-start;
  min-height: 32px;
  padding: 0 10px;
  gap: 6px;
  border-radius: 16px;
  border: 1px solid var(--accent-line);
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-size: 13px;
}

.contact-btn .icon { width: 16px; height: 16px; }
.contact-btn.icon-only { width: 40px; height: 40px; min-height: 40px; padding: 0; border-radius: 20px; align-self: center; flex: none; }
.contact-btn.icon-only .icon { width: 20px; height: 20px; }
.contact-head { display: flex; flex-direction: column; gap: 4px; }
.contact-head strong { font: 700 20px/1.2 var(--font-display); }
.contact-head .muted { font-size: 13px; }
.confidence { margin: 0; padding: 8px 12px; border-radius: 12px; font-size: 13px; font-weight: 600; }
.confidence-high { background: #e3f6ea; color: #0b6b34; }
@media (prefers-color-scheme: dark) { .confidence-high { background: #10301f; color: #7fe0a6; } }
.confidence-medium { background: var(--accent-soft); color: var(--accent-ink); }
.confidence-low { background: var(--warn-bg); color: var(--warn-ink); }
.contact-row { display: flex; flex-direction: column; gap: 4px; padding-bottom: 12px; border-bottom: 1px solid var(--border); font-size: 15px; }
.contact-row:last-child { border-bottom: 0; }
.contact-label { font-size: 12px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.contact-link { display: inline-flex; align-items: flex-start; gap: 8px; min-height: 32px; text-decoration: none; overflow-wrap: anywhere; }
.contact-link .icon { width: 18px; height: 18px; margin-top: 2px; }
.contact-sources { display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
#contact-body { gap: 14px; }

.order-head { display: flex; align-items: flex-end; gap: 8px; }
.order-title { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.order-title h2 { margin: 0; font: 700 30px/1 var(--font-display); letter-spacing: -.02em; }
.order-sub { font-size: 13px; color: var(--muted); }

.picks { display: flex; flex-direction: column; gap: 10px; }
.pick { display: flex; gap: 10px; align-items: flex-start; }
.pick.dim { display: none; }
.p-rank { width: 34px; flex: none; padding-top: 14px; text-align: right; font: 700 24px/1 var(--font-display); color: var(--accent); }

.p-card {
  flex: 1;
  min-width: 0;
  background: var(--surface-2);
  border-radius: 16px;
  border: 1px solid transparent;
}

.pane.order .p-card { background: var(--bg); }
.pick.open .p-card { background: var(--surface); border-color: var(--accent); box-shadow: 0 8px 24px rgba(61, 59, 243, .16); }
.pick.flash .p-card { animation: flash 1s ease-out; }
@keyframes flash { from { box-shadow: 0 0 0 3px var(--accent-line); } to { box-shadow: none; } }

.p-head { display: flex; align-items: center; }

.p-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  padding: 12px 6px 12px 14px;
  min-height: 0;
  border: 0;
  background: transparent;
  text-align: left;
  white-space: normal;
  font-weight: 500;
}

.p-main:hover { border: 0; }
.p-inst { font-weight: 700; font-size: 15px; line-height: 1.3; }
.p-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); }
.p-meta .icon { width: 20px; height: 20px; color: var(--accent); }
.p-note-preview { font-size: 13px; color: var(--muted); font-style: italic; }
.p-note-preview:empty { display: none; }

.handle {
  width: 40px;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--faint);
  cursor: grab;
  touch-action: none;
  user-select: none;
  flex: none;
}

.p-tools { display: none; flex-direction: column; gap: 10px; padding: 0 14px 14px; }
.pick.open .p-tools { display: flex; }
.pick.open .p-note-preview { display: none; }
.p-note-label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 600; color: var(--muted); }
.p-note-label input { width: 100%; }
.p-ctl { display: flex; gap: 8px; align-items: center; min-width: 0; }

.p-pos-label {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
}

.p-pos-label span { white-space: nowrap; }
.p-pos { flex: 1; min-width: 0; border: 0; min-height: 40px; width: 48px; padding: 0 4px; font-weight: 700; color: var(--text); }
.sortable-ghost .p-card { opacity: .35; }

.empty { text-align: center; color: var(--muted); padding: 48px 0; }

.tabs { display: none; }

.backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(16, 20, 35, .5);
  animation: fade .18s ease-out;
}

@keyframes fade { from { opacity: 0; } }

.sheet {
  position: fixed;
  z-index: 41;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(440px, 100%);
  display: flex;
  flex-direction: column;
  background: var(--surface);
  box-shadow: var(--shadow-pop);
  animation: slide-in .22s cubic-bezier(.2, .8, .2, 1);
}

@keyframes slide-in { from { transform: translateX(40px); opacity: 0; } }

.sheet-grip { display: none; }
.sheet-head { display: flex; align-items: center; gap: 8px; padding: 18px 20px 10px; }
.sheet-head h2 { margin: 0; flex: 1; font: 700 26px/1 var(--font-display); letter-spacing: -.02em; }
.sheet-body { flex: 1; overflow: auto; padding: 4px 20px 20px; display: flex; flex-direction: column; gap: 24px; overscroll-behavior: contain; }
.sheet-foot { padding: 14px 20px 20px; border-top: 1px solid var(--border); }

#facets { display: flex; flex-direction: column; gap: 24px; }
.facet { display: flex; flex-direction: column; gap: 10px; }
.facet-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.facet-head h3 { margin: 0; font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.facet-selected { font-size: 13px; font-weight: 600; color: var(--accent); }

.facet-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 14px;
  max-height: 320px;
  overflow: auto;
  overscroll-behavior: contain;
}

.facet-option {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  padding: 0 14px;
  border-top: 1px solid var(--border);
  cursor: pointer;
}

.facet-option:first-child { border-top: 0; }
.facet-option.on { background: var(--accent-soft); }
.facet-option.zero:not(.on) { opacity: .45; }
.facet-option input { width: 20px; height: 20px; margin: 0; accent-color: var(--accent); flex: none; }
.facet-option .opt-label { flex: 1; min-width: 0; }
.facet-option.on .opt-label { font-weight: 700; }
.opt-count { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }

.facet-chips { display: flex; flex-wrap: wrap; gap: 8px; }

.toggle-chip {
  min-height: 42px;
  border-radius: 21px;
  padding: 0 14px;
  gap: 8px;
  font-size: 14px;
}

.toggle-chip[aria-pressed=true] { border: 2px solid var(--accent); background: var(--accent-soft); color: var(--accent-ink); }
.toggle-chip.zero[aria-pressed=false] { opacity: .45; }
.toggle-chip .opt-count { font-size: 12px; }

.switch { display: flex; align-items: center; gap: 12px; min-height: 48px; font-weight: 600; }
.switch input { width: 22px; height: 22px; accent-color: var(--accent); }

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 42;
  width: min(420px, 100%);
  background: var(--surface);
  border-left: 1px solid var(--border);
  padding: 20px;
  overflow: auto;
  box-shadow: var(--shadow-pop);
}

.drawer-head { display: flex; justify-content: space-between; align-items: center; }
.drawer-head h2 { margin: 0; font: 700 24px/1 var(--font-display); }
.snapshots li { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 10px 0; border-bottom: 1px solid var(--border); }

.login { align-items: center; justify-content: center; padding: 16px; min-height: 100%; }

.login-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: min(380px, calc(100% - 32px));
  padding: 28px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: var(--shadow-card);
}

.login-card h1 { margin: 0; font: 700 26px/1.1 var(--font-display); letter-spacing: -.02em; }
.login-card p { margin: 0; }
.login-card input { width: 100%; }
.error { color: var(--danger); }

.admin { padding: 24px 20px 48px; max-width: 880px; margin: 0 auto; width: 100%; overflow: auto; display: flex; flex-direction: column; gap: 20px; }
.admin-head { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.admin-head h1 { margin: 6px 0 0; font: 700 34px/1 var(--font-display); letter-spacing: -.02em; }
.admin-head .back { padding-left: 8px; }
.people { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.person { display: flex; align-items: center; gap: 14px; padding: 16px; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow-card); }
.person-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.person-name { font-weight: 700; font-size: 16px; overflow-wrap: anywhere; }
.person-email { font-size: 13px; overflow-wrap: anywhere; }
.person-meta { font-size: 13px; display: flex; flex-wrap: wrap; gap: 4px; }
.person form { margin: 0; flex: none; }
.admin-card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow-card); padding: 20px; display: flex; flex-direction: column; gap: 12px; }
.admin-card h2 { margin: 0; font: 700 22px/1.1 var(--font-display); }
.admin-form { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; align-items: end; }
.admin-form label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; color: var(--muted); }
.admin-form label input:not([type=checkbox]) { width: 100%; }
.admin-form .switch { flex-direction: row; grid-column: 1 / -1; color: var(--text); font-size: 15px; }
.admin-form button, .admin-form .error { grid-column: 1 / -1; }
.login-brand { font: 700 15px/1 var(--font-display); color: var(--accent); letter-spacing: .02em; text-transform: uppercase; }
.login-card label { font-size: 13px; font-weight: 600; color: var(--muted); }
.login-card button { min-height: 52px; border-radius: 14px; font-size: 16px; }

@media (max-width: 900px) {
  body { font-size: 15px; }
  .topbar { padding: 14px 16px 10px; border-bottom: 0; background: var(--bg); }
  .brand-name { font-size: 22px; }
  .topbar-actions .button-ghost span { display: none; }
  .topbar-actions .button-ghost { width: 44px; padding: 0; border-radius: 22px; }
  .banner { display: block; padding: 10px 16px; font-size: 13px; }
  .banner.warn { display: flex; }
  .panes { grid-template-columns: 1fr; }
  .pane { display: none; padding: 4px 16px calc(120px + env(safe-area-inset-bottom)); }
  .pane.active { display: flex; }
  .pane.order { border-left: 0; background: var(--bg); padding: 8px 16px calc(120px + env(safe-area-inset-bottom)); }
  .pane.order .p-card { background: var(--surface); box-shadow: var(--shadow-card); }
  .filters-btn { width: 50px; padding: 0; }
  .filters-label { display: none; }
  .filters-btn .count-badge { position: absolute; top: -6px; right: -6px; border: 2px solid var(--bg); }
  .chips { flex-wrap: nowrap; overflow-x: auto; margin: 0 -16px; padding: 0 16px 2px; scrollbar-width: none; }
  .chips::-webkit-scrollbar { display: none; }
  .chip { flex: none; }
  .results { grid-template-columns: 1fr; gap: 10px; }
  .order-title h2 { font-size: 30px; }

  .tabs {
    display: flex;
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: calc(12px + env(safe-area-inset-bottom));
    z-index: 20;
    gap: 6px;
    padding: 6px;
    border-radius: 22px;
    background: var(--ink);
    box-shadow: 0 12px 32px rgba(16, 20, 35, .28);
  }

  .tabs button {
    flex: 1;
    min-height: 52px;
    border: 0;
    border-radius: 16px;
    background: transparent;
    color: var(--on-ink);
    font-size: 15px;
  }

  .tabs button.active { background: var(--surface); color: var(--text); }
  .tabs .icon { width: 20px; height: 20px; }

  .sheet {
    top: auto;
    left: 0;
    width: 100%;
    max-height: 90vh;
    border-radius: 26px 26px 0 0;
    animation: slide-up .26s cubic-bezier(.2, .8, .2, 1);
    padding-bottom: env(safe-area-inset-bottom);
  }

  @keyframes slide-up { from { transform: translateY(40%); opacity: 0; } }
  .sheet-grip { display: block; width: 44px; height: 5px; border-radius: 3px; background: var(--border); margin: 10px auto 0; }
  .sheet-head { padding: 12px 20px 8px; }
  .facet-list { max-height: 260px; }
  .drawer { width: 100%; }
  .admin { padding: 16px 16px 40px; }
  .admin-head h1 { font-size: 30px; }
  .person { flex-direction: column; align-items: stretch; }
  .person form, .person .person-action { width: 100%; }
  .admin-form { grid-template-columns: 1fr; }
  .login-card { padding: 22px; }
}

.results.grouped { grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr)); }

.group {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  align-self: start;
}

.g-head { display: flex; align-items: flex-start; gap: 12px; padding: 16px 16px 12px; }
.g-icon { width: 44px; height: 44px; border-radius: 14px; background: var(--accent-soft); display: flex; align-items: center; justify-content: center; flex: none; }
.g-text { display: flex; flex-direction: column; gap: 6px; min-width: 0; flex: 1; }
.g-title { font: 700 17px/1.3 var(--font-body); }
.g-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.g-rows { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--border); }

.g-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 56px;
  padding: 8px 12px 8px 16px;
  border-top: 1px solid var(--border);
}

.g-row:first-child { border-top: 0; }
.g-row.added { background: var(--accent-soft); }
.g-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.g-row-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-weight: 600; font-size: 15px; }
.g-row-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); }
.g-row .r-add { width: 38px; height: 38px; min-height: 38px; font-size: 22px; box-shadow: none; }
.g-row.added .r-add { min-width: 50px; height: 36px; min-height: 36px; }
.g-row .contact-btn.icon-only { width: 36px; height: 36px; min-height: 36px; }
.g-foot { display: flex; justify-content: space-between; gap: 8px; padding: 6px 10px; border-top: 1px solid var(--border); }
.chip-group { background: var(--surface); }

.segmented { display: flex; gap: 4px; padding: 4px; border-radius: 14px; background: var(--surface-2); flex: none; }
.pane.order .segmented { background: var(--bg); }
.segmented button { flex: 1; min-height: 38px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); font-size: 14px; }
.segmented button[aria-checked=true] { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(16, 20, 35, .14); }
.review { grid-template-columns: 1fr; }
.best-rank { flex: none; padding: 4px 10px; border-radius: 12px; background: var(--accent-soft); color: var(--accent-ink); font-size: 13px; font-weight: 700; }
.rank-chip { flex: none; min-width: 40px; padding: 2px 6px; border-radius: 10px; background: var(--accent); color: #fff; text-align: center; font-size: 13px; font-weight: 700; }
.review .g-row { cursor: pointer; }

.pick.run-open { margin-bottom: -10px; }
.pick.run-open .p-card { border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
.pick.run-cont .p-card { border-top-left-radius: 0; border-top-right-radius: 0; border-top: 1px dashed var(--border); }
.pick.run-cont .p-inst, .pick.run-cont .p-addr, .pick.run-cont .contact-btn { display: none; }
.pick.run-cont .p-rank { padding-top: 12px; font-size: 20px; }

.p-also {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 0 12px 12px 14px;
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--warn-bg);
  color: var(--warn-ink);
  font-size: 13px;
}

.p-also-text { flex: 1; min-width: 0; }
.p-also .button-link { color: var(--warn-ink); font-weight: 700; min-height: 32px; text-decoration: underline; }

.review .g-row.open { background: var(--accent-soft); align-items: flex-start; }
.r-tools { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; cursor: default; }
.r-tools .p-note-preview { margin: 0; display: block; }
.r-tools .button-link { align-self: flex-start; padding: 0; }

button.primary, .button.primary, .r-add {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  box-shadow: none;
}

.result.added .r-add, .g-row.added .r-add { background: transparent; border-color: var(--border); color: var(--text); }
.rank-chip, .best-rank { background: transparent; border: 0; color: var(--text); }
.count-badge { background: transparent; color: inherit; border: 1px solid currentColor; }
.filters-btn .count-badge { background: var(--ink); color: var(--on-ink); border-color: var(--on-ink); }
.g-row.added, .review .g-row.open, .facet-option.on { background: var(--surface-2); }
.toggle-chip[aria-pressed=true] { background: transparent; border-color: var(--text); color: var(--text); }

@media (hover: hover) {
  button.primary:hover, .button.primary:hover,
  .result:hover .r-add, .g-row:hover .r-add {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
  }

  .result.added:hover .r-add, .g-row.added:hover .r-add { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent-ink); }
  .review .g-row:hover .rank-chip { background: var(--accent); color: #fff; }
  .result:hover { border-color: var(--accent-line); }
  .g-row:hover { background: var(--surface-2); }
  .pick:hover .p-card { border-color: var(--accent-line); }
}

.g-row-title.one-line { flex-wrap: nowrap; }
.g-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.g-row-title.one-line .badge { flex: none; margin-left: auto; }

.extension-page { display: flex; flex-direction: column; gap: 12px; width: min(440px, calc(100% - 32px)); }
.extension-page .login-card { width: 100%; }
.page-back { align-self: flex-start; display: inline-flex; align-items: center; gap: 4px; padding: 4px 2px; font-size: 13px; font-weight: 600; color: var(--muted); text-decoration: none; }
.page-back:hover { color: var(--text); }
.page-back .icon { width: 16px; height: 16px; }
.extension-actions { display: grid; grid-template-columns: 2fr 1fr; gap: 10px; }
.extension-card .button.block { display: flex; justify-content: center; align-items: center; gap: 8px; width: 100%; min-height: 54px; border-radius: 16px; font-size: 17px; }
.install-steps { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; font-size: 14px; }
.install-steps .icon { width: 15px; height: 15px; vertical-align: -2px; }
.install-steps code { font-size: 13px; padding: 1px 5px; border-radius: 6px; background: var(--surface-2); }
.login-card .copy-btn { display: inline-flex; align-items: center; min-height: 0; height: auto; padding: 0 4px; line-height: 1; vertical-align: -3px; color: var(--muted); border: 0; }
.copy-btn:hover { color: var(--accent); }
.copy-btn .icon { width: 16px; height: 16px; }
.copy-btn .icon:last-child, .copy-btn[data-copied] .icon:first-child { display: none; }
.copy-btn[data-copied] .icon:last-child { display: inline-block; color: var(--accent); }

body.landing { display: block; height: auto; min-height: 100%; }
.lp-nav { position: sticky; top: 0; z-index: 5; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px max(20px, calc((100% - 1080px) / 2)); background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); }
.lp-brand { font: 700 20px/1 var(--font-display); letter-spacing: -.02em; }
.lp-nav nav { display: flex; align-items: center; gap: 14px; }
.lp-nav nav > a:not(.button) { color: var(--muted); font-weight: 600; text-decoration: none; display: inline-flex; }
.lp-nav nav > a:not(.button):hover { color: var(--text); }
.lp-nav .button { min-height: 40px; }
.lp { max-width: 1080px; margin: 0 auto; padding: 0 20px; display: flex; flex-direction: column; gap: 88px; }
.lp-hero { padding-top: 72px; display: flex; flex-direction: column; align-items: flex-start; gap: 20px; }
.lp-kicker { font: 700 13px/1 var(--font-display); letter-spacing: .06em; text-transform: uppercase; color: var(--accent); }
.lp h1 { margin: 0; font: 700 clamp(36px, 6vw, 64px)/1.02 var(--font-display); letter-spacing: -.035em; max-width: 18ch; }
.lp h2 { margin: 0; font: 700 clamp(26px, 3.6vw, 38px)/1.1 var(--font-display); letter-spacing: -.025em; }
.lp h3 { margin: 0; font: 700 18px/1.2 var(--font-display); }
.lp p { margin: 0; }
.lp-lede { font-size: clamp(17px, 2vw, 20px); line-height: 1.5; color: var(--muted); max-width: 60ch; }
.lp-cta { display: flex; flex-wrap: wrap; gap: 12px; }
.lp-big { min-height: 54px; padding: 0 22px; border-radius: 16px; font-size: 17px; gap: 10px; }
.lp-note { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 14px; }
.lp-note .icon { color: var(--ok); }
.lp-section { display: flex; flex-direction: column; gap: 28px; }
.lp-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.lp-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; display: flex; flex-direction: column; gap: 10px; box-shadow: var(--shadow-card); }
.lp-card p { color: var(--muted); line-height: 1.5; }
.lp-icon { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.lp-icon .icon { width: 22px; height: 22px; }
.lp-split { display: grid; grid-template-columns: 1.1fr 1fr; gap: 40px; align-items: center; }
.lp-split > div { display: flex; flex-direction: column; align-items: flex-start; gap: 18px; }
.lp-split > div > p { color: var(--muted); font-size: 17px; line-height: 1.5; }
.lp-steps { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 10px; line-height: 1.5; }
.lp-panel { margin: 0; border: 1px solid #2a2f4a; background: #101423; color: #fff; border-radius: 20px; padding: 20px; display: flex; flex-direction: column; gap: 14px; box-shadow: var(--shadow-pop); font-size: 14px; }
.lp-panel-sub { color: #aab0c6; }
.lp-panel-group h4 { margin: 0 0 6px; font-size: 12px; letter-spacing: .05em; text-transform: uppercase; }
.lp-panel-group p { display: flex; gap: 10px; line-height: 1.45; }
.lp-panel-group span { flex: none; min-width: 48px; color: #aab0c6; font-variant-numeric: tabular-nums; }
.lp-panel-group.missing h4 { color: #ffd27a; }
.lp-panel-group.moved h4 { color: #9ec5ff; }
.lp-panel-state { color: #ffd27a; font-size: 16px; font-weight: 700; }
.lp-panel-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.lp-panel-btn { border: 1px solid #3d3bf3; background: #3d3bf3; border-radius: 10px; padding: 8px 12px; font-weight: 600; }
.lp-panel-btn.ghost { background: transparent; border-color: #3a3d78; }
.lp-trust .lp-card { box-shadow: none; }
.lp-final { display: flex; flex-direction: column; align-items: center; gap: 22px; text-align: center; padding: 56px 20px; border-radius: 28px; background: var(--ink); color: var(--on-ink); }
.lp-final h2 { max-width: 20ch; }
.lp-final .button { color: var(--on-ink); background: transparent; border-color: color-mix(in srgb, var(--on-ink) 45%, transparent); }
.lp-final .button:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.lp-foot { max-width: 1080px; margin: 72px auto 0; padding: 28px 20px 40px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 8px; color: var(--muted); font-size: 13px; line-height: 1.5; }

@media (max-width: 900px) {
  .lp-grid, .lp-grid.three { grid-template-columns: 1fr; }
  .lp-split { grid-template-columns: 1fr; }
  .lp { gap: 64px; }
  .lp-hero { padding-top: 40px; }
  .lp-nav nav > a:first-child { display: none; }
}
