/* evlinked-map portal + playground. One small stylesheet, no build step. Light by default, dark when
   the OS asks for it. */
:root {
  --bg: #f6f7f9;
  --panel: #ffffff;
  --line: #e3e7ec;
  --text: #16202b;
  --muted: #5d6b79;
  --accent: #1f6feb;
  --accent-text: #ffffff;
  --ok: #1a7f37;
  --ok-bg: #dafbe1;
  --warn: #9a6700;
  --warn-bg: #fff8c5;
  --bad: #cf222e;
  --bad-bg: #ffebe9;
  --code: #eef1f4;
  --radius: 8px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d1117;
    --panel: #151b23;
    --line: #2a313c;
    --text: #e6edf3;
    --muted: #8d96a0;
    --accent: #4493f8;
    --accent-text: #0d1117;
    --ok: #3fb950;
    --ok-bg: #12261a;
    --warn: #d29922;
    --warn-bg: #2b2111;
    --bad: #f85149;
    --bad-bg: #2d1416;
    --code: #1f2630;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
body { margin: 0; font: 14px/1.45 system-ui, -apple-system, "Segoe UI", sans-serif; background: var(--bg); color: var(--text); }
a { color: var(--accent); }
code, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; }
code { background: var(--code); padding: 1px 5px; border-radius: 4px; }
h1 { font-size: 20px; margin: 0; }
h2 { font-size: 15px; margin: 0 0 10px; }
.muted { color: var(--muted); font-size: 12.5px; }
.hidden { display: none !important; }

/* --- top bar + tabs --- */
.topbar { display: flex; align-items: center; gap: 16px; padding: 12px 20px; background: var(--panel); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.topbar .spacer { flex: 1; }
.tabs { display: flex; gap: 2px; padding: 0 20px; background: var(--panel); border-bottom: 1px solid var(--line); overflow-x: auto; }
.tabs button { background: none; border: none; border-bottom: 2px solid transparent; color: var(--muted); padding: 10px 12px; cursor: pointer; font: inherit; }
.tabs button[aria-selected="true"] { color: var(--text); border-bottom-color: var(--accent); }
main { max-width: 1180px; margin: 0 auto; padding: 20px; }

/* --- panels, forms --- */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 16px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 3px; }
input, select, textarea { width: 100%; padding: 7px 9px; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); color: var(--text); font: inherit; }
input[type="checkbox"] { width: auto; }
.checks { display: flex; flex-wrap: wrap; gap: 10px; padding-top: 6px; }
.checks label { display: inline-flex; gap: 5px; align-items: center; color: var(--text); font-size: 13px; margin: 0; }
button { padding: 7px 12px; border-radius: 6px; border: 1px solid var(--line); background: var(--panel); color: var(--text); cursor: pointer; font: inherit; }
button.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
button.danger { color: var(--bad); }
button:disabled { opacity: .5; cursor: default; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.actions { display: flex; gap: 6px; flex-wrap: wrap; }

/* --- tables --- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 500; white-space: nowrap; }
.bar { height: 6px; background: var(--accent); border-radius: 3px; min-width: 2px; }

/* --- pills --- */
.pill { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 11.5px; white-space: nowrap; background: var(--code); color: var(--muted); }
.pill.ok, .pill.active, .pill.up, .pill.closed { background: var(--ok-bg); color: var(--ok); }
.pill.warn, .pill.degraded, .pill.disabled, .pill.half_open, .pill.unknown { background: var(--warn-bg); color: var(--warn); }
.pill.bad, .pill.down, .pill.revoked, .pill.open { background: var(--bad-bg); color: var(--bad); }

/* --- notices --- */
.notice { padding: 10px 12px; border-radius: 6px; margin: 10px 0; border: 1px solid var(--line); }
.notice.error { background: var(--bad-bg); color: var(--bad); border-color: transparent; }
.notice.secret { background: var(--warn-bg); border-color: transparent; }
.notice.secret .mono { display: block; margin: 6px 0; word-break: break-all; font-size: 13px; color: var(--text); }

/* --- provider chain editor --- */
.chain { list-style: none; margin: 0; padding: 0; }
.chain li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.chain li .id { font-weight: 600; min-width: 96px; }
.chain li .detail { flex: 1; min-width: 200px; }

/* --- landing --- */
.landing { max-width: 760px; margin: 8vh auto; padding: 0 20px; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin-top: 24px; }
a.card { display: block; padding: 18px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); color: inherit; text-decoration: none; }
a.card:hover { border-color: var(--accent); }
a.card h2 { margin: 0 0 6px; }

/* --- playground --- */
.pg { position: fixed; inset: 0; }
#map { position: absolute; inset: 0; }
.side { position: absolute; top: 12px; left: 12px; bottom: 12px; width: 340px; max-width: calc(100vw - 24px); z-index: 5; display: flex; flex-direction: column; gap: 10px; pointer-events: none; }
.side > * { pointer-events: auto; }
.side .panel { margin: 0; padding: 12px; box-shadow: 0 2px 12px rgba(0, 0, 0, .15); }
.side .scroll { overflow-y: auto; min-height: 0; }
.results { list-style: none; margin: 6px 0 0; padding: 0; max-height: 260px; overflow-y: auto; }
.results li { padding: 7px 8px; border-radius: 6px; cursor: pointer; }
.results li:hover, .results li[aria-selected="true"] { background: var(--code); }
.results li .name { font-weight: 500; }
.steps { list-style: none; margin: 8px 0 0; padding: 0; font-size: 13px; }
.steps li { padding: 6px 0; border-bottom: 1px solid var(--line); display: flex; gap: 8px; }
.steps li .d { color: var(--muted); white-space: nowrap; margin-left: auto; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.seg button { border: none; border-radius: 0; padding: 6px 9px; }
.seg button[aria-pressed="true"] { background: var(--accent); color: var(--accent-text); }
.stat { font-size: 18px; font-weight: 600; }
@media (max-width: 640px) { .side { top: auto; height: 55vh; width: auto; right: 12px; } }
