/* xmonitor — x.com-inspired dark theme, dense ops UI */

:root {
  --bg: #000000;
  --bg-1: #0b0d10;
  --bg-2: #16181c;
  --bg-3: #1f2328;
  --line: #2f3336;
  --line-2: #3a4046;
  --text: #e7e9ea;
  --muted: #71767b;
  --accent: #1d9bf0;
  --accent-2: #1a8cd8;
  --danger: #f4212e;
  --warn: #f59e0b;
  --good: #00ba7c;
  --shadow: 0 6px 28px rgba(0,0,0,.55);

  --topbar-h: 52px;
  --status-h: 24px;
  --panel-w-l: 280px;
  --panel-w-r: 360px;
}

.theme-light {
  --bg: #ffffff; --bg-1: #f7f9f9; --bg-2: #eff3f4; --bg-3: #e1e8ed;
  --line: #d6d9db; --line-2: #c4c8cc;
  --text: #0f1419; --muted: #536471;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font: 13px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--text); background: var(--bg);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.muted { color: var(--muted); }
.small { font-size: 11px; }
.hidden { display: none !important; }
.grow { flex: 1 1 auto; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--bg-2); padding: 1px 4px; border-radius: 4px; }

/* ---------- App grid ---------- */
#app {
  display: grid;
  grid-template-columns: var(--panel-w-l) 1fr var(--panel-w-r);
  grid-template-rows: var(--topbar-h) 1fr var(--status-h);
  grid-template-areas:
    "top top top"
    "left map right"
    "status status status";
  height: 100vh;
}

.topbar {
  grid-area: top;
  display: flex; align-items: center; gap: 12px;
  padding: 0 12px;
  background: var(--bg-1);
  border-bottom: 1px solid var(--line);
  z-index: 5;
}
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.brand { display: flex; align-items: center; gap: 8px; min-width: 180px; }
.brand-mark {
  width: 22px; height: 22px; border-radius: 6px;
  background:
    radial-gradient(circle at 30% 30%, #1d9bf0 0 22%, transparent 23%),
    linear-gradient(135deg, #16181c, #2f3336);
  border: 1px solid var(--line-2);
}
.brand-text { font-weight: 700; letter-spacing: .2px; }
.pill {
  font-size: 10px; letter-spacing: .12em; padding: 2px 6px; border-radius: 999px;
  background: var(--danger); color: white;
}
#liveDot { animation: pulse 2.4s ease-in-out infinite; }
@keyframes pulse { 0%,100% {opacity: 1} 50% {opacity: .55} }

/* ---------- Omnibar (unified top search) ---------- */
.omni {
  position: relative; flex: 1 1 auto; max-width: 820px;
  display: flex; align-items: center; gap: 0;
  background: var(--bg-2); border: 1px solid var(--line);
  border-radius: 999px; padding: 2px 4px 2px 2px;
  transition: border-color .15s;
}
.omni:focus-within { border-color: var(--accent); background: var(--bg); }
.omni-mode {
  display: flex; align-items: center; gap: 4px;
  padding: 5px 10px; margin: 0; cursor: pointer; user-select: none;
  font-weight: 600; font-size: 12px;
  background: var(--bg-3); border-radius: 999px; color: var(--text);
  position: relative;
}
.omni-mode:hover { background: var(--line); }
.omni-mode-caret { color: var(--muted); font-size: 9px; }
/* Always belt-and-suspenders hidden so it can never look like a bullet list. */
.omni-menu, .omni-menu li { list-style: none; padding: 0; margin: 0; }
.omni-menu {
  display: none; position: absolute; top: 110%; left: 0; min-width: 240px;
  background: var(--bg-1); border: 1px solid var(--line); border-radius: 10px;
  padding: 4px; box-shadow: var(--shadow); z-index: 60;
}
.omni-mode.open .omni-menu { display: block; }
.omni-menu li {
  display: flex; flex-direction: column; gap: 2px;
  padding: 8px 10px; border-radius: 6px; cursor: pointer;
}
.omni-menu li:hover { background: var(--bg-2); }
.omni-menu li b { font-weight: 600; font-size: 12px; }
.omni-menu li span { color: var(--muted); font-size: 11px; }

.omni input {
  flex: 1 1 auto; min-width: 0;
  padding: 7px 10px;
  background: transparent; color: var(--text);
  border: 0; outline: none;
}
.omni-go {
  background: transparent; border: 0; color: var(--muted);
  padding: 4px 10px; cursor: pointer; font-size: 14px;
}
.omni-go:hover { color: var(--accent); }
.omni-status { margin-left: 6px; padding-right: 8px; min-width: 0; }

/* Segmented controls */
.seg {
  display: inline-flex; background: var(--bg-2); border-radius: 999px; padding: 2px;
  border: 1px solid var(--line);
}
.seg button {
  background: transparent; border: 0; padding: 4px 10px; border-radius: 999px;
  color: var(--muted); cursor: pointer;
}
.seg button.active { background: var(--text); color: var(--bg); font-weight: 600; }
.seg button:not(.active):hover { color: var(--text); }

/* Buttons */
.btn-primary, .btn-ghost, .btn-danger, .btn-icon {
  border: 1px solid var(--line); background: var(--bg-2); color: var(--text);
  padding: 6px 12px; border-radius: 999px; cursor: pointer;
}
.btn-primary { background: var(--text); color: var(--bg); border-color: var(--text); font-weight: 600; }
.btn-primary:hover { background: #d7dbdc; }
.btn-ghost:hover { background: var(--bg-3); }
.btn-danger { background: var(--danger); border-color: var(--danger); color: white; }
.btn-danger:hover { filter: brightness(1.1); }
.btn-icon { padding: 4px 8px; }
button.small, .btn-primary.small, .btn-ghost.small, .btn-danger.small { padding: 3px 8px; font-size: 11px; }

/* ---------- Side panels ---------- */
.panel {
  background: var(--bg-1);
  border-right: 1px solid var(--line);
  overflow: hidden auto;
  display: flex; flex-direction: column;
}
.panel.right { grid-area: right; border-right: 0; border-left: 1px solid var(--line); }
.panel.left { grid-area: left; }
.panel-head {
  position: sticky; top: 0; background: var(--bg-1);
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 12px; border-bottom: 1px solid var(--line);
  font-weight: 700;
  z-index: 1;
}
.panel-section { padding: 12px; border-bottom: 1px solid var(--line); }
.section-title { font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin-bottom: 8px; }

/* (Old `.check-row` / `.check-list` styles removed — replaced by `.select-row`
   and `.select-list` further down. Don't reintroduce the dot-prefixed pill
   look; it was the source of the "bubble filter" feel.) */

/* Section title with optional inline action (e.g. "all / none") */
.section-title {
  display: flex; align-items: center; justify-content: space-between;
}
.link-btn {
  font-size: 11px; color: var(--muted); cursor: pointer; user-select: none;
  text-transform: none; letter-spacing: 0;
}
.link-btn:hover { color: var(--accent); text-decoration: underline; }

/* Collapsible panel section using <details> */
.section-collapsible > summary {
  list-style: none; cursor: pointer;
}
.section-collapsible > summary::-webkit-details-marker { display: none; }
.section-collapsible > summary::before {
  content: '▸'; display: inline-block; width: 10px; color: var(--muted);
  transition: transform .15s ease;
}
.section-collapsible[open] > summary::before { transform: rotate(90deg); }

/* Mini search inside a panel section */
.mini-search {
  width: 100%; padding: 5px 8px; margin: 8px 0 6px;
  background: var(--bg-2); border: 1px solid var(--line);
  border-radius: 6px; color: var(--text); outline: none;
}
.mini-search:focus { border-color: var(--accent); }

/* ---------- Region tree (continent → country → state/city) ---------- */
.region-tree { display: flex; flex-direction: column; }
.tree-node { margin: 0; padding: 0; }
.tree-node > summary {
  list-style: none;
  cursor: pointer;
}
.tree-node > summary::-webkit-details-marker { display: none; }
.tree-row {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 6px; border-radius: 4px;
  font-size: 12.5px; user-select: none;
}
.tree-row:hover { background: var(--bg-2); }
.tree-row .tree-name { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tree-row .tree-count {
  font-size: 10px; color: var(--muted); padding: 1px 6px;
  background: var(--bg-2); border-radius: 999px;
}
.tree-row .ico-btn {
  background: transparent; border: 0; color: var(--muted);
  cursor: pointer; padding: 0 4px; font-size: 13px; line-height: 1;
}
.tree-row .ico-btn:hover { color: var(--accent); }
.tree-row .tree-check { margin: 0; }
.tree-children { padding-left: 14px; }
/* Continent rows: a touch heavier */
.tree-node.continent > summary > .tree-row { font-weight: 600; }
.tree-node.continent > summary::before {
  content: '▸'; display: inline-block; width: 12px; color: var(--muted);
  transition: transform .12s ease;
  position: absolute; margin-left: -12px; line-height: 1.7;
}
.tree-node.continent[open] > summary::before { transform: rotate(90deg); }
.tree-node.continent { padding-left: 12px; }
/* Country rows: open marker */
.tree-node.country > summary::before {
  content: '+'; display: inline-block; width: 10px; color: var(--muted);
  position: absolute; margin-left: -10px; line-height: 1.7;
  font-family: ui-monospace, monospace;
}
.tree-node.country[open] > summary::before { content: '−'; }
.tree-node.country { padding-left: 10px; position: relative; }

.tree-leaf {
  cursor: pointer; padding-left: 10px;
  color: var(--text); font-size: 12px;
}
.tree-leaf:hover { background: var(--bg-2); }
.tree-leaf.city { color: var(--muted); }
.tree-leaf.city:hover { color: var(--text); }
.tree-leaf.state .tree-name::before { content: '◆ '; color: var(--muted); font-size: 9px; vertical-align: 2px; }
.tree-leaf.city .tree-name::before { content: '· '; color: var(--muted); }
.tree-group { padding: 2px 0 4px; }
.tree-group-label {
  font-size: 10px; color: var(--muted); text-transform: uppercase;
  letter-spacing: .08em; padding: 2px 6px;
}
.tree-loading, .tree-empty { padding: 4px 6px; }

/* Live Search panel */
.seg-narrow { width: 100%; margin: 6px 0; }
.seg-narrow button { flex: 1 1 0; padding: 4px 0; font-size: 11.5px; }
.live-actions {
  display: flex; align-items: center; gap: 8px; margin: 6px 0;
}
.live-summary {
  margin-top: 8px; padding: 8px 10px;
  background: var(--bg-2); border: 1px solid var(--line);
  border-radius: 6px; font-size: 12px; line-height: 1.45;
  color: var(--text); white-space: pre-wrap;
}

/* "Live" event marker — pulses to distinguish from polled events */
.live-pulse-anim { animation: live-pulse 1.6s ease-in-out infinite; }
@keyframes live-pulse {
  0%,100% { transform: scale(1); opacity: 1; }
  50%     { transform: scale(1.15); opacity: .75; }
}

input[type="range"] { width: 100%; accent-color: var(--accent); }

/* ---------- Map ---------- */
#map { grid-area: map; position: relative; background: #000; }
.maplibregl-ctrl-attrib { background: rgba(0,0,0,.4) !important; color: var(--muted) !important; font-size: 10px; }
.maplibregl-ctrl-attrib a { color: var(--muted) !important; }
.maplibregl-popup { max-width: 320px; }
.maplibregl-popup-content {
  background: var(--bg-1); color: var(--text);
  border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px;
  box-shadow: var(--shadow);
}
.maplibregl-popup-tip { display: none; }

/* ---------- Event list ---------- */
.event-list { display: flex; flex-direction: column; }
.event {
  display: grid; grid-template-columns: 22px 1fr; gap: 10px;
  padding: 10px 12px; border-bottom: 1px solid var(--line); cursor: pointer;
}
.event:hover { background: var(--bg-2); }
.event .swatch { width: 10px; height: 10px; border-radius: 50%; margin-top: 4px; }
.event .title { font-weight: 600; line-height: 1.3; }
.event .meta { color: var(--muted); font-size: 11px; margin-top: 2px; display: flex; gap: 6px; flex-wrap: wrap; }
.event .sev { display: inline-block; height: 4px; border-radius: 2px; background: var(--accent); margin-top: 4px; }

/* Detail drawer */
.detail {
  position: absolute; right: calc(var(--panel-w-r) + 12px); top: calc(var(--topbar-h) + 12px);
  width: 380px; max-height: calc(100vh - var(--topbar-h) - var(--status-h) - 24px);
  background: var(--bg-1); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: var(--shadow); padding: 14px; z-index: 4; overflow: auto;
}
.detail h2 { margin: 0 0 4px; font-size: 16px; }
.detail .meta { color: var(--muted); font-size: 12px; margin-bottom: 8px; }
.detail .body { white-space: pre-wrap; }
.detail iframe { width: 100%; aspect-ratio: 16/9; border: 0; border-radius: 8px; background: black; }
.detail img { max-width: 100%; border-radius: 8px; }
.detail .close { float: right; }

/* Status bar */
.statusbar {
  grid-area: status;
  display: flex; align-items: center; gap: 16px;
  padding: 0 10px;
  background: var(--bg-1); border-top: 1px solid var(--line);
  color: var(--muted); font-size: 11px;
}

/* ---------- Auth ---------- */
.auth-shell { min-height: 100vh; display: grid; place-items: center; background: radial-gradient(1200px 600px at 30% -10%, #0a1922 0%, #000 60%); }
.auth-card {
  width: 360px; padding: 24px;
  background: var(--bg-1); border: 1px solid var(--line); border-radius: 16px;
  box-shadow: var(--shadow);
}
.auth-card h1 { margin: 8px 0 16px; font-size: 22px; }
.auth-card label { display: block; margin: 8px 0; }
.auth-card input { width: 100%; padding: 10px 12px; background: var(--bg); border: 1px solid var(--line); color: var(--text); border-radius: 10px; }
.auth-card .btn-primary { width: 100%; margin-top: 12px; padding: 10px; }
.alert { padding: 8px 12px; background: rgba(244,33,46,.12); color: var(--danger); border: 1px solid rgba(244,33,46,.4); border-radius: 8px; }

/* ---------- Admin ---------- */
.admin-shell { padding: 24px; max-width: 1080px; margin: 0 auto; }
.admin-tabs { display: flex; gap: 16px; margin-bottom: 16px; border-bottom: 1px solid var(--line); padding-bottom: 8px; }
.admin-tabs a { color: var(--muted); }
.admin-section { padding: 16px 0; border-bottom: 1px solid var(--line); }
.card { background: var(--bg-1); border: 1px solid var(--line); border-radius: 12px; padding: 14px; margin: 10px 0; }
.card-head { display: flex; align-items: center; gap: 8px; }
.card .dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding-top: 8px; }
.grid > div { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 4px; }
.field input, .field select, .field textarea {
  background: var(--bg); border: 1px solid var(--line); color: var(--text);
  padding: 8px 10px; border-radius: 8px;
}
.field textarea { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
form.inline { display: inline-flex; align-items: center; gap: 6px; }
.tbl { width: 100%; border-collapse: collapse; }
.tbl th, .tbl td { padding: 8px; border-bottom: 1px solid var(--line); text-align: left; }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.err { color: var(--danger); }

/* ====================== NEW LAYOUT (omni / accordions / etc) ============== */

/* Accordion sections in the left panel */
.acc { border-bottom: 1px solid var(--line); }
.acc > summary {
  list-style: none; cursor: pointer;
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px;
  font-size: 12px; text-transform: uppercase; letter-spacing: .08em;
  color: var(--muted);
}
.acc > summary::-webkit-details-marker { display: none; }
.acc > summary::before {
  content: '›'; display: inline-block; width: 10px; color: var(--muted);
  transition: transform .15s ease; font-size: 14px;
}
.acc[open] > summary::before { transform: rotate(90deg); color: var(--text); }
.acc[open] > summary { color: var(--text); }
.acc > summary:hover { background: var(--bg-2); }
.acc-title { flex: 1; }
.acc-meta {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--muted); font-weight: 400; text-transform: none; letter-spacing: 0;
  font-size: 11px;
}
.acc-body { padding: 8px 12px 14px; }

.row-actions-mini { display: flex; gap: 10px; padding: 0 0 6px; }

.warn-badge {
  background: var(--warn); color: #000; font-weight: 700;
  padding: 1px 6px; border-radius: 999px; font-size: 10px;
}

/* Selectable list — clean horizontal rows. No dots, no bubbles. */
.select-list { display: flex; flex-direction: column; }
.select-row {
  display: grid; grid-template-columns: 16px 1fr auto;
  align-items: center; gap: 10px;
  padding: 6px 8px;
  cursor: pointer; user-select: none; font-size: 12.5px;
  border-left: 3px solid transparent;
  border-radius: 0 4px 4px 0;
  margin-left: -8px;
}
.select-row:hover { background: var(--bg-2); }
.select-row[data-color] { border-left-color: var(--row-color, transparent); }
.select-row input[type=checkbox] {
  appearance: none; -webkit-appearance: none; margin: 0; cursor: pointer;
  width: 14px; height: 14px;
  border: 1.5px solid var(--line-2); border-radius: 3px;
  background: transparent; position: relative;
}
.select-row input[type=checkbox]:checked {
  background: var(--accent); border-color: var(--accent);
}
.select-row input[type=checkbox]:checked::after {
  content: ''; position: absolute; left: 3px; top: 0px;
  width: 4px; height: 8px;
  border: solid white; border-width: 0 1.7px 1.7px 0;
  transform: rotate(45deg);
}
.select-row .row-label {
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  display: flex; flex-direction: column; gap: 1px;
}
.select-row .row-sub { color: var(--muted); font-size: 10.5px; }
.select-row .row-status {
  font-size: 10px; padding: 1px 6px; border-radius: 999px;
  background: var(--bg-2); color: var(--muted); white-space: nowrap;
}
.select-row .row-status.warn { background: var(--warn); color: #000; }
.select-row .row-status.error { background: var(--danger); color: #fff; }
.select-row .row-status.ok { background: rgba(0,186,124,.15); color: var(--good); }
.select-row .row-status.disabled { background: var(--bg-3); color: var(--muted); }

/* Severity scale */
.sev-scale {
  display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px;
}
.sev-scale button {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 6px 0; cursor: pointer; user-select: none;
  background: var(--bg-2); color: var(--text);
  border: 1px solid var(--line); border-radius: 6px;
}
.sev-scale button:hover { border-color: var(--line-2); }
.sev-scale button.active {
  background: var(--accent); border-color: var(--accent); color: #fff;
}
.sev-scale button b { font-size: 13px; }
.sev-scale button span { font-size: 9.5px; color: inherit; opacity: .8; }
.sev-pill {
  background: var(--bg-2); padding: 2px 8px; border-radius: 999px;
  border: 1px solid var(--line); font-weight: 600;
}
.hint { margin: 8px 0 0; }

/* Narrow segmented control */
.seg-narrow { width: 100%; }
.seg-narrow button { flex: 1 1 0; padding: 4px 0; font-size: 11.5px; }

/* Right-pane tabs */
.rtabs {
  position: sticky; top: 0; z-index: 1;
  display: flex; gap: 0;
  background: var(--bg-1);
  border-bottom: 1px solid var(--line);
}
.rtabs button {
  flex: 1 1 0; display: flex; align-items: center; justify-content: center;
  gap: 6px; padding: 11px 10px;
  background: transparent; color: var(--muted);
  border: 0; border-bottom: 2px solid transparent;
  cursor: pointer; font-weight: 600; font-size: 12px;
}
.rtabs button.active { color: var(--text); border-bottom-color: var(--accent); }
.rtabs button:not(.active):hover { color: var(--text); background: var(--bg-2); }
.rtab-count {
  font-size: 10px; padding: 1px 7px; border-radius: 999px;
  background: var(--bg-2); color: var(--muted); font-weight: 700;
}
.rpane { display: flex; flex-direction: column; }
.rpane.hidden { display: none; }
.rpane-actions {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 12px; border-bottom: 1px solid var(--line);
}

/* Following pane */
.follow-bar { display: flex; gap: 6px; padding: 8px 12px; border-bottom: 1px solid var(--line); }
.follow-bar .mini-search { margin: 0; flex: 1 1 auto; }
.follow-chips {
  display: flex; flex-wrap: wrap; gap: 6px;
  padding: 8px 12px; border-bottom: 1px solid var(--line);
}
.follow-chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 4px 3px 10px; border-radius: 999px;
  background: var(--bg-2); border: 1px solid var(--line);
  font-size: 11.5px;
}
.follow-chip button {
  border: 0; background: transparent; color: var(--muted);
  cursor: pointer; padding: 0 6px; font-size: 13px; line-height: 1;
}
.follow-chip button:hover { color: var(--danger); }

/* Inline event-row "follow" button */
.event .row-actions {
  display: flex; gap: 4px; align-items: center; opacity: 0;
  transition: opacity .12s;
}
.event:hover .row-actions, .event .row-actions:focus-within { opacity: 1; }
.event .row-actions button {
  background: transparent; border: 1px solid var(--line);
  color: var(--muted); padding: 1px 6px; border-radius: 999px;
  font-size: 10px; cursor: pointer;
}
.event .row-actions button:hover { color: var(--accent); border-color: var(--accent); }
.event .row-actions button.followed { color: var(--accent); border-color: var(--accent); }

/* Live results banner inside the right pane */
.live-summary {
  margin: 8px 12px; padding: 10px 12px;
  background: linear-gradient(180deg, rgba(255,212,0,.08), transparent);
  border: 1px solid rgba(255,212,0,.25);
  border-radius: 8px;
  font-size: 12px; line-height: 1.5; white-space: pre-wrap;
}

/* LLM docs viewer */
.docs-shell {
  max-width: 980px; margin: 24px auto; padding: 0 16px;
}
.docs-md {
  white-space: pre-wrap; word-break: break-word;
  background: var(--bg-1); border: 1px solid var(--line);
  border-radius: 12px; padding: 18px 20px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12.5px; line-height: 1.55; color: var(--text);
  max-height: calc(100vh - 120px); overflow: auto;
}

/* Severity dot on the detail drawer */
.detail .sev-pill { font-size: 10px; }
.detail .sev-row {
  display: flex; align-items: center; gap: 6px; margin: 8px 0;
}
.detail .sev-row label { color: var(--muted); }

/* Custom event marker — used by overrides */
.event .sev-tag {
  display: inline-block; font-size: 9.5px; padding: 1px 5px; border-radius: 999px;
  background: var(--bg-3); color: var(--muted); margin-left: 4px;
}
.event .sev-tag.user-set { background: var(--accent); color: #fff; }

/* ====================== Native form chrome — dark theme ================== */
/* Browsers default to OS chrome on <select>, which looks white-on-white in
   dark mode. Force the same palette as the rest of the UI. */
select, input[type=text], input[type=password], input[type=search],
input[type=number], input[type=email], textarea {
  background: var(--bg-2);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 5px 8px;
  outline: none;
  color-scheme: dark;
}
select { padding-right: 22px; appearance: none; -webkit-appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%),
                    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: right 10px top 50%, right 6px top 50%;
  background-size: 4px 4px, 4px 4px; background-repeat: no-repeat;
  cursor: pointer;
}
select:hover, input:hover { border-color: var(--line-2); }
select:focus, input:focus, textarea:focus { border-color: var(--accent); }
select option, select optgroup {
  background: var(--bg-1); color: var(--text);
}
.theme-light { color-scheme: light; }
.theme-light select option { background: #ffffff; color: #0f1419; }
