/* ===================== The Intersect ===================== */
:root {
  --bg: #0a0e15;
  --surface: rgba(22, 29, 41, 0.72);
  --surface-solid: #161d29;
  --surface-2: rgba(255, 255, 255, 0.05);
  --surface-3: rgba(255, 255, 255, 0.09);
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: #e8eef6;
  --muted: #8a97aa;
  --accent: #5b93ff;
  --accent-2: #2ad4a8;
  --accent-soft: rgba(91, 147, 255, 0.16);
  --grad: linear-gradient(120deg, #5b93ff 0%, #7cc8ff 45%, #2ad4a8 100%);
  --portal: #2ad4a8;
  --danger: #f47272;
  --shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset, 0 12px 40px rgba(0, 0, 0, 0.35);
  --shadow-lift: 0 1px 0 rgba(255, 255, 255, 0.06) inset, 0 18px 50px rgba(0, 0, 0, 0.5);
  --blob-a: rgba(70, 120, 255, 0.28);
  --blob-b: rgba(30, 210, 165, 0.18);
  --dots: rgba(255, 255, 255, 0.045);
  --fav-l: 32%;
  --radius: 16px;
  --mono: ui-monospace, "Cascadia Code", "SF Mono", Menlo, Consolas, monospace;
  --sans: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  --display: "Segoe UI Variable Display", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #f3f6fb;
  --surface: rgba(255, 255, 255, 0.78);
  --surface-solid: #ffffff;
  --surface-2: rgba(20, 40, 80, 0.045);
  --surface-3: rgba(20, 40, 80, 0.08);
  --border: rgba(20, 40, 80, 0.09);
  --border-strong: rgba(20, 40, 80, 0.18);
  --text: #142033;
  --muted: #5a6880;
  --accent: #2f6fec;
  --accent-2: #0ea888;
  --accent-soft: rgba(47, 111, 236, 0.11);
  --grad: linear-gradient(120deg, #2f6fec 0%, #3aa0e8 45%, #0ea888 100%);
  --portal: #0a9474;
  --shadow: 0 1px 2px rgba(20, 40, 80, 0.05), 0 10px 30px rgba(20, 40, 80, 0.08);
  --shadow-lift: 0 2px 4px rgba(20, 40, 80, 0.06), 0 18px 44px rgba(20, 40, 80, 0.16);
  --blob-a: rgba(80, 130, 255, 0.22);
  --blob-b: rgba(20, 200, 160, 0.16);
  --dots: rgba(20, 40, 80, 0.06);
  --fav-l: 46%;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
/* Ambient background: two soft color fields + a faint dot grid. */
body::before, body::after {
  content: ""; position: fixed; z-index: -1; pointer-events: none;
}
body::before {
  inset: 0;
  background:
    radial-gradient(700px 420px at 22% -8%, var(--blob-a), transparent 70%),
    radial-gradient(640px 420px at 82% 4%, var(--blob-b), transparent 70%);
}
body::after {
  inset: 0;
  background-image: radial-gradient(var(--dots) 1px, transparent 1px);
  background-size: 22px 22px;
  mask-image: linear-gradient(to bottom, #000 0%, transparent 70%);
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, transparent 70%);
}
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.spacer { flex: 1; }
.muted { color: var(--muted); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- Top bar ---------- */
.topbar {
  display: flex; align-items: center; justify-content: flex-end;
  padding: 14px 20px;
}
.topbar-actions { display: flex; align-items: center; gap: 4px; }
.sync-state {
  display: inline-grid; place-items: center; width: 22px; height: 22px; margin-right: 6px;
  border-radius: 50%; font-size: 11px; font-weight: 700; cursor: default;
  color: var(--accent-2); background: color-mix(in srgb, var(--accent-2) 14%, transparent);
}
.sync-state[hidden] { display: none; }
.sync-state[data-state="saving"] { color: var(--accent); background: var(--accent-soft); }
.sync-state[data-state="error"], .sync-state[data-state="signedout"] { color: #f0b23e; background: rgba(240, 178, 62, .15); }

.icon-btn {
  display: inline-grid; place-items: center;
  width: 34px; height: 34px; border: 0; border-radius: 10px;
  background: transparent; color: var(--muted); cursor: pointer;
  transition: background .15s, color .15s;
}
.icon-btn:hover:not(:disabled) { background: var(--surface-3); color: var(--text); }
.icon-btn:disabled { opacity: .3; cursor: default; }
.icon-btn.sm { width: 26px; height: 26px; font-size: 13px; border-radius: 7px; }

/* ---------- Layout ---------- */
.main { width: min(1120px, 100%); margin: 0 auto; padding: 2vh 16px 56px; }

/* ---------- Hero ---------- */
.hero { text-align: center; margin-bottom: 22px; }
.hero-logo { display: block; margin: 0 auto 4px; filter: drop-shadow(0 6px 18px rgba(91, 147, 255, .35)); }
.wordmark {
  margin: 0; font: 650 clamp(28px, 4.4vw, 40px)/1.1 var(--display); letter-spacing: -0.02em;
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* ---------- Search ---------- */
.search { position: relative; width: min(700px, 100%); margin: 0 auto 44px; }

.engine-tabs {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 4px;
  margin-bottom: 12px;
}
.engine-tab {
  display: inline-flex; align-items: center; gap: 6px; flex: none;
  border: 1px solid transparent; background: transparent; cursor: pointer;
  padding: 5px 12px; border-radius: 999px;
  color: var(--muted); font-size: 12.5px; font-weight: 500; white-space: nowrap;
  transition: background .15s, color .15s, border-color .15s;
}
.engine-tab:hover { color: var(--text); background: var(--surface-2); }
.engine-tab.active {
  color: var(--text); background: var(--surface-solid); border-color: var(--border-strong);
  box-shadow: 0 2px 10px rgba(0, 0, 0, .15);
}
.engine-tab.is-portal::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--portal);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--portal) 20%, transparent);
}
.web-tab .caret { margin-right: -4px; opacity: .6; transition: transform .15s; }
.web-tab.active .caret { opacity: 1; }

/* Brand-ish dots for the web engines */
.web-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--accent); }
.web-dot[data-engine="google"] { background: conic-gradient(#ea4335 0 25%, #fbbc05 0 50%, #34a853 0 75%, #4285f4 0); }
.web-dot[data-engine="brave"] { background: #fb542b; }
.web-dot[data-engine="duckduckgo"] { background: #de5833; box-shadow: inset 0 0 0 2px #fff6; }
.web-dot[data-engine="bing"] { background: linear-gradient(135deg, #2ad4a8, #1b74e4); }

.menu {
  position: absolute; z-index: 5; min-width: 190px; padding: 6px;
  background: var(--surface-solid); border: 1px solid var(--border-strong); border-radius: 12px;
  box-shadow: var(--shadow-lift);
  animation: pop .12s ease-out;
}
@keyframes pop { from { opacity: 0; transform: translateY(-4px) scale(.98); } }
.menu-item {
  display: flex; align-items: center; gap: 10px; width: 100%;
  border: 0; background: none; cursor: pointer; text-align: left;
  padding: 7px 10px; border-radius: 8px; font-size: 13px;
}
.menu-item:hover, .menu-item:focus-visible { background: var(--surface-3); outline: 0; }
.menu-item.on { color: var(--accent); font-weight: 600; }
.menu-item kbd { margin-left: auto; font-family: var(--mono); font-size: 11px; color: var(--muted); font-weight: 400; }

.search-bar {
  display: flex; align-items: center; gap: 12px;
  height: 56px; padding: 0 14px 0 20px;
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: 18px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  transition: border-color .2s, box-shadow .2s;
}
.search-bar:focus-within {
  border-color: var(--accent);
  box-shadow: var(--shadow), 0 0 0 4px var(--accent-soft), 0 0 40px -6px var(--accent-soft);
}
.prompt {
  font-family: var(--mono); font-size: 13px; white-space: nowrap; font-weight: 600;
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.search-input {
  flex: 1; min-width: 0; height: 100%;
  border: 0; outline: 0; background: transparent;
  font-family: var(--mono); font-size: 15.5px;
}
.search-input:focus-visible { outline: 0; }
.search-input::placeholder { color: var(--muted); opacity: .75; }
.hint-key {
  font-family: var(--mono); font-size: 11px; color: var(--muted);
  border: 1px solid var(--border-strong); border-bottom-width: 2px; border-radius: 6px; padding: 1px 7px;
}
.search-hint { min-height: 18px; margin: 10px 4px 0; font-size: 12px; color: var(--muted); text-align: center; }

/* ---------- Dashboard ---------- */
.dash-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.dash-toggle {
  display: inline-flex; align-items: center; gap: 6px;
  border: 0; background: none; cursor: pointer; padding: 4px 8px 4px 4px; border-radius: 8px;
  font-size: 12px; font-weight: 650; letter-spacing: .1em; text-transform: uppercase; color: var(--muted);
}
.dash-toggle:hover { color: var(--text); background: var(--surface-2); }
.dash-hint { font-size: 12px; color: var(--muted); opacity: .7; }
.chev { display: block; transition: transform .2s; }
.dashboard.collapsed .chev { transform: rotate(-90deg); }
.dashboard.collapsed .tiles, .dashboard.collapsed .dash-hint { display: none; }

.tiles {
  display: grid; gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  align-items: start;
}
.tile {
  position: relative;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 10px 14px 14px; min-width: 0;
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  transition: transform .18s, box-shadow .18s, border-color .18s, opacity .18s;
}
.tile:hover { border-color: var(--border-strong); }
.tile.wide { grid-column: span 2; }
@media (max-width: 600px) { .tile.wide { grid-column: auto; } }
.tile.dragging { opacity: .35; transform: scale(.98); border-style: dashed; border-color: var(--accent); }

.tile-head {
  display: flex; align-items: center; gap: 8px; min-height: 30px; margin: 0 -6px 8px;
  padding: 0 4px 0 2px; border-radius: 8px; cursor: grab; user-select: none;
}
.tile-head:active { cursor: grabbing; }
.grip { display: grid; color: var(--muted); opacity: 0; transition: opacity .15s; margin-right: -4px; }
.tile:hover .grip { opacity: .6; }
.tile-icon {
  display: grid; place-items: center; width: 24px; height: 24px; border-radius: 7px;
  color: var(--accent); background: var(--accent-soft);
}
.tile[data-type="notes"] .tile-icon { color: #f0b23e; background: rgba(240, 178, 62, .15); }
.tile[data-type="embed"] .tile-icon { color: var(--accent-2); background: color-mix(in srgb, var(--accent-2) 15%, transparent); }
.tile-head h3 { flex: 1; margin: 0; font-size: 13.5px; font-weight: 600; letter-spacing: -.005em; }
.tile-edit { opacity: 0; }
.tile:hover .tile-edit, .tile-edit:focus-visible { opacity: 1; }
@media (hover: none) { .tile-edit, .grip { opacity: .6; } }
.empty { grid-column: 1 / -1; text-align: center; padding: 28px; }

.link-list { list-style: none; margin: 0 -6px; padding: 0; display: grid; gap: 2px; min-height: 36px; border-radius: 10px; }
.is-dragging-link .link-list { outline: 1px dashed var(--border-strong); outline-offset: 2px; }
.link-list li[data-link] { border-radius: 9px; cursor: grab; }
.link-list li.dragging { opacity: .4; background: var(--accent-soft); }
.link-list a {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 8px; border-radius: 9px;
  color: var(--text); text-decoration: none;
  transition: background .12s;
}
.link-list a:hover { background: var(--surface-3); }
.link-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.link-host {
  margin-left: auto; padding-left: 8px; font-size: 11.5px; color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 45%;
  opacity: 0; transition: opacity .12s;
}
.link-list a:hover .link-host { opacity: 1; }
.empty-links { padding: 10px 8px; font-size: 12.5px; }

/* ---------- Shortcuts tile ---------- */
.tile[data-type="shortcuts"] .tile-icon { color: #b48cff; background: rgba(180, 140, 255, .15); }
.shortcut-grid {
  grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 6px; margin: 0; padding-top: 2px;
}
.link-list .shortcut {
  display: grid; justify-items: center; gap: 7px; width: 100%; padding: 12px 6px 10px;
  border: 1px solid transparent; border-radius: 14px; background: none; cursor: pointer;
  color: var(--text); text-decoration: none; font: inherit;
  transition: background .15s, border-color .15s, transform .15s;
}
.link-list .shortcut:hover { background: var(--surface-3); border-color: var(--border); transform: translateY(-2px); }
.shortcut .fav {
  width: 44px; height: 44px; border-radius: 13px; font-size: 19px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .22);
}
.shortcut .fav img { inset: 10px; width: 24px; height: 24px; }
.shortcut .fav.has-img { background: var(--surface-solid, #fff); }
.shortcut-name {
  max-width: 100%; font-size: 11.5px; line-height: 1.25; text-align: center;
  overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.shortcut-add { color: var(--muted); }
.shortcut-add .shortcut-plus {
  --h: 0; background: none; box-shadow: none; color: var(--muted); font-size: 24px; font-weight: 400;
  border: 1.5px dashed var(--border-strong);
}
.shortcut-add:hover .shortcut-plus { border-color: var(--accent); color: var(--accent); }
.shortcut-add-cell { display: flex; align-items: center; }
.shortcut-input {
  width: 100%; min-width: 150px; padding: 8px 10px; border-radius: 10px; font-size: 12.5px;
  border: 1px solid var(--accent); background: var(--surface-2); color: var(--text); outline: 0;
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.shortcut-input.bad { border-color: #f0606e; box-shadow: 0 0 0 3px rgba(240, 96, 110, .18); }
.shortcut-grid li[data-link].dragging { background: var(--accent-soft); border-radius: 14px; }

/* ---------- Health tile ---------- */
.tile[data-type="health"] .tile-icon { color: #ff6b81; background: rgba(255, 107, 129, .15); }
.tile[data-type="health"] .tile-icon svg { animation: beat 1.6s ease-in-out infinite; transform-origin: center; }
@keyframes beat { 0%, 40%, 100% { transform: scale(1); } 12% { transform: scale(1.18); } 24% { transform: scale(1.04); } 32% { transform: scale(1.12); } }

.health { display: grid; gap: 10px; }
.ecg {
  display: block; width: 100%; height: 36px; border-radius: 10px;
  background:
    linear-gradient(var(--border) 1px, transparent 1px) 0 0 / 12px 12px,
    linear-gradient(90deg, var(--border) 1px, transparent 1px) 0 0 / 12px 12px,
    color-mix(in srgb, var(--accent-2) 6%, transparent);
}
.ecg-base { stroke: color-mix(in srgb, var(--accent-2) 30%, transparent); stroke-width: 1.5; stroke-linejoin: round; fill: none; vector-effect: non-scaling-stroke; }
.ecg-line {
  fill: none; stroke: var(--accent-2); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round;
  vector-effect: non-scaling-stroke; filter: drop-shadow(0 0 3px color-mix(in srgb, var(--accent-2) 70%, transparent));
  stroke-dasharray: 22 100; animation: trace 2.4s linear infinite;
}
@keyframes trace { from { stroke-dashoffset: 22; } to { stroke-dashoffset: -100; } }

.health-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.health-row {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px;
  border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2);
  color: var(--text); text-decoration: none;
  transition: border-color .15s, background .15s, transform .15s;
}
.health-row:hover {
  border-color: color-mix(in srgb, var(--accent-2) 55%, transparent);
  background: color-mix(in srgb, var(--accent-2) 8%, var(--surface-2)); transform: translateY(-1px);
}
.health-row { --dot: var(--accent-2); }
.health-row[data-state="warn"] { --dot: #f0b23e; }
.health-row[data-state="down"] { --dot: #f0506e; }
.health-row[data-state="info"] { --dot: var(--accent); }
.health-row[data-state="unknown"], .health-row[data-state="off"], .health-row[data-state="nolive"],
.health-row[data-state="pending"] { --dot: var(--muted); }
.health-row[data-state="warn"] { border-color: rgba(240, 178, 62, .35); }
.health-row[data-state="down"] { border-color: rgba(240, 80, 110, .5); background: rgba(240, 80, 110, .08); }
.health-row[data-state="down"] .health-note { color: #f58a9e; }
.health-row[data-state="warn"] .health-note { color: #e9b860; }
.health-row:is([data-state="down"], [data-state="warn"]) .health-note { white-space: normal; }
:root[data-theme="light"] .health-row[data-state="down"] { --dot: #e0284f; }
:root[data-theme="light"] .health-row[data-state="down"] .health-note { color: #c0203f; }
:root[data-theme="light"] .health-row[data-state="warn"] { --dot: #d98a00; }
:root[data-theme="light"] .health-row[data-state="warn"] .health-note { color: #9a6200; }
.pulse { position: relative; flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--dot); transition: background .3s; }
.pulse::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--dot);
  animation: ping 2.4s cubic-bezier(0, 0, .2, 1) infinite; animation-delay: calc(var(--i, 0) * .4s);
}
.health-row[data-state="down"] .pulse::after { animation-duration: 1.1s; }
.health-row:is([data-state="unknown"], [data-state="off"], [data-state="nolive"]) .pulse::after { animation: none; opacity: 0; }
.health-row[data-state="pending"] .pulse { animation: blink 1.2s ease-in-out infinite; }
@keyframes blink { 50% { opacity: .35; } }
.health[data-worst="down"] .ecg-line { stroke: #f0506e; filter: drop-shadow(0 0 3px rgba(240, 80, 110, .7)); animation-duration: 1.2s; }
.health[data-worst="warn"] .ecg-line { stroke: #f0b23e; filter: drop-shadow(0 0 3px rgba(240, 178, 62, .6)); }
@keyframes ping { 0% { transform: scale(1); opacity: .6; } 70%, 100% { transform: scale(2.8); opacity: 0; } }
.health-text { display: grid; min-width: 0; gap: 1px; }
.health-name { font-size: 13.5px; font-weight: 600; }
.health-note { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.health-go { margin-left: auto; color: var(--muted); font-size: 14px; transition: color .15s, transform .15s; }
.health-row:hover .health-go { color: var(--accent-2); transform: translate(1px, -1px); }
@media (prefers-reduced-motion: reduce) {
  .ecg-line, .pulse::after, .tile[data-type="health"] .tile-icon svg { animation: none; }
  .ecg-line { stroke-dasharray: none; }
}

.fav {
  position: relative; flex: none; display: grid; place-items: center;
  width: 26px; height: 26px; border-radius: 8px; overflow: hidden;
  font-size: 12px; font-weight: 700; color: #fff;
  background: hsl(var(--h) 55% var(--fav-l));
}
.fav img { position: absolute; inset: 5px; width: 16px; height: 16px; opacity: 0; }
.fav.has-img { background: var(--surface-3); color: transparent; }
.fav.has-img img { opacity: 1; }

.notes {
  width: 100%; min-height: 160px; resize: vertical; display: block;
  border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px;
  background: var(--surface-2); outline: 0; font-family: var(--mono); font-size: 12.5px; line-height: 1.6;
}
.notes:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.embed { width: 100%; border: 0; border-radius: 10px; background: var(--surface-2); display: block; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid transparent; border-radius: 10px;
  padding: 7px 14px; cursor: pointer; font-size: 13px; font-weight: 500;
  transition: background .15s, color .15s, border-color .15s, filter .15s;
}
.btn-sm { padding: 5px 11px; font-size: 12.5px; }
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 4px 14px -4px var(--accent); }
.btn-primary:hover { filter: brightness(1.08); }
.btn-ghost { background: var(--surface); border-color: var(--border-strong); color: var(--muted); }
.btn-ghost:hover { color: var(--text); background: var(--surface-3); }
.btn-danger { color: var(--danger); }

/* ---------- Modals ---------- */
.overlay {
  position: fixed; inset: 0; z-index: 10;
  display: grid; place-items: center; padding: 16px;
  background: rgba(5, 8, 14, 0.5); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  animation: fade .15s ease-out;
}
@keyframes fade { from { opacity: 0; } }
.modal {
  width: min(460px, 100%); max-height: 90vh; overflow: auto;
  background: var(--surface-solid); border: 1px solid var(--border-strong); border-radius: 18px;
  padding: 22px; box-shadow: var(--shadow-lift);
  animation: pop .15s ease-out;
}
.modal-wide { width: min(640px, 100%); }
.modal-title { margin: 0 0 18px; font: 650 17px/1.2 var(--display); }
.modal-actions, .form-actions { display: flex; align-items: center; gap: 8px; margin-top: 18px; }
.form-actions { margin-top: 8px; flex-wrap: wrap; }
.modal-error { color: var(--danger); font-size: 12.5px; margin: 8px 0 0; }

.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field-label { font-size: 11px; font-weight: 650; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.field-input {
  width: 100%; padding: 9px 11px; border-radius: 10px;
  border: 1px solid var(--border-strong); background: var(--surface-2); outline: 0;
}
.field-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
select.field-input option { background: var(--surface-solid); }
textarea.field-input { font-family: var(--mono); font-size: 12.5px; resize: vertical; }

.settings-section { padding: 16px 0; border-top: 1px solid var(--border); }
.settings-section:first-of-type { border-top: 0; padding-top: 0; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.section-hint { font-size: 11.5px; color: var(--muted); }
.toggle-row { display: flex; align-items: center; gap: 8px; margin-top: 8px; font-size: 13px; }

.web-picker { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; margin-top: 10px; }
.web-choice {
  display: flex; align-items: center; gap: 9px; justify-content: center;
  padding: 10px; border-radius: 12px; cursor: pointer; font-size: 13px; font-weight: 500;
  border: 1px solid var(--border-strong); background: var(--surface-2);
}
.web-choice:hover { background: var(--surface-3); }
.web-choice.on { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 1px var(--accent) inset; }

.engine-manager { display: grid; gap: 1px; max-height: 300px; overflow: auto; margin-bottom: 10px; }
.engine-row { display: flex; align-items: center; gap: 8px; padding: 3px 6px; border-radius: 8px; }
.engine-row:hover { background: var(--surface-2); }
.engine-name { font-size: 13px; }
.engine-meta { font-family: var(--mono); font-size: 11px; color: var(--muted); }
.engine-meta em { font-style: normal; opacity: .7; }
.star { border: 0; background: none; cursor: pointer; color: var(--border-strong); font-size: 15px; padding: 0 2px; }
.star.on, .star:hover { color: #f5b942; }

.add-engine summary { list-style: none; display: inline-flex; }
.add-engine summary::-webkit-details-marker { display: none; }
.add-engine-form { display: grid; gap: 8px; margin-top: 10px; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 20;
  padding: 10px 18px; border-radius: 12px; font-size: 13px;
  background: var(--surface-solid); border: 1px solid var(--border-strong); box-shadow: var(--shadow-lift);
  animation: pop .15s ease-out;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- Jump (search-bar results) ---------- */
.jump {
  position: absolute; z-index: 6; left: 0; right: 0; margin-top: 8px;
  padding: 6px; max-height: min(460px, 62vh); overflow: auto;
  background: var(--surface-solid); border: 1px solid var(--border-strong); border-radius: 16px;
  box-shadow: var(--shadow-lift);
  animation: pop .12s ease-out;
}
.jump-row {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 10px; border-radius: 10px; cursor: pointer; min-width: 0;
}
.jump-row.sel { background: var(--accent-soft); }
.jump-row .fav { width: 24px; height: 24px; border-radius: 7px; font-size: 11px; }
.jump-ico {
  display: grid; place-items: center; width: 24px; height: 24px; flex: none;
  border-radius: 7px; background: var(--surface-3); color: var(--muted); font-size: 15px;
}
.jump-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.search-row .jump-name { color: var(--muted); flex: 1; }
.search-row .jump-name b { color: var(--text); font-weight: 600; }
.jump-group {
  flex: none; font-size: 11px; padding: 1px 7px; border-radius: 999px;
  color: var(--muted); background: var(--surface-3);
}
.jump kbd, .jump-foot kbd {
  font-family: var(--mono); font-size: 11px; color: var(--muted);
  border: 1px solid var(--border-strong); border-bottom-width: 2px; border-radius: 6px; padding: 0 6px;
}
.jump-alias { flex: none; color: var(--accent) !important; }
.jump-enter { flex: none; visibility: hidden; }
.jump-row.sel .jump-enter { visibility: visible; }
.jump-foot {
  display: flex; flex-wrap: wrap; gap: 14px; padding: 8px 10px 4px; margin-top: 4px;
  border-top: 1px solid var(--border); font-size: 11.5px; color: var(--muted);
}
.jump-foot kbd { margin-right: 3px; }
@media (max-width: 560px) { .jump-group { display: none; } .jump-foot { display: none; } }
.field-note { font-size: 12px; margin: -6px 0 12px; }
.jump-head {
  position: sticky; top: -6px; z-index: 1; margin: 0 -6px; padding: 8px 16px 4px;
  background: var(--surface-solid);
  font-size: 10.5px; font-weight: 650; letter-spacing: .1em; text-transform: uppercase; color: var(--muted);
}
