/* AUTO-COPIED from launchpads/_core — edit there and run `node sync-core.mjs`. */
/* ui.css — shared design system. Each app overrides --accent and --accent-2. */

:root {
  --bg: #08090c;
  --bg-1: #0d0f14;
  --bg-2: #12151c;
  --bg-3: #1a1e27;
  --line: #232833;
  --line-2: #2e3542;
  --text: #e8eaee;
  --text-dim: #9aa3b2;
  --text-faint: #646d7d;
  --accent: #6ea8fe;
  --accent-2: #4d7fd6;
  --accent-fg: #08090c;
  --green: #36d399;
  --red: #f87272;
  --amber: #fbbd23;
  --radius: 10px;
  --radius-lg: 16px;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Inter, sans-serif;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.28);
  --maxw: 1180px;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 { margin: 0 0 .5em; line-height: 1.25; font-weight: 650; letter-spacing: -.015em; }
h1 { font-size: 30px; }
h2 { font-size: 21px; }
h3 { font-size: 17px; }
p { margin: 0 0 1em; }
small { font-size: 12.5px; }

code, .mono, pre { font-family: var(--mono); }
pre {
  background: var(--bg-1); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px; overflow: auto; font-size: 12.5px; line-height: 1.5;
}

/* ---- layout ---- */
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }
.row { display: flex; gap: 12px; align-items: center; }
.row.wrap-r { flex-wrap: wrap; }
.col { display: flex; flex-direction: column; gap: 12px; }
.spacer { flex: 1; }
.grid { display: grid; gap: 14px; }
.grid.c2 { grid-template-columns: repeat(2, 1fr); }
.grid.c3 { grid-template-columns: repeat(3, 1fr); }
.grid.c4 { grid-template-columns: repeat(4, 1fr); }
.split { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }

@media (max-width: 900px) {
  .grid.c3, .grid.c4 { grid-template-columns: repeat(2, 1fr); }
  .split { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 560px) {
  .grid.c2, .grid.c3, .grid.c4 { grid-template-columns: 1fr; }
  .wrap { padding: 0 14px; }
  h1 { font-size: 24px; }
}

/* ---- header ---- */
header.top {
  position: sticky; top: 0; z-index: 50;
  background: rgba(8,9,12,.82); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
header.top .wrap { display: flex; align-items: center; gap: 18px; height: 58px; }
.brand { display: flex; align-items: center; gap: 9px; font-weight: 700; letter-spacing: -.02em; font-size: 16px; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 12px var(--accent); }
nav.main { display: flex; gap: 4px; }
nav.main a {
  color: var(--text-dim); padding: 7px 11px; border-radius: 8px; font-size: 14px; font-weight: 500;
}
nav.main a:hover { background: var(--bg-2); color: var(--text); text-decoration: none; }
nav.main a.active { background: var(--bg-3); color: var(--text); }
@media (max-width: 720px) { nav.main { display: none; } }

/* ---- cards ---- */
.card {
  background: var(--bg-1); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: 18px;
}
.card.pad-sm { padding: 13px; }
.card.hover:hover { border-color: var(--line-2); background: var(--bg-2); }
.card-title { font-size: 12px; text-transform: uppercase; letter-spacing: .09em; color: var(--text-faint); margin-bottom: 10px; font-weight: 600; }

/* ---- buttons ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 9px 15px; border-radius: 9px; border: 1px solid var(--line-2);
  background: var(--bg-2); color: var(--text); font: 500 14px var(--sans);
  cursor: pointer; transition: background .12s, border-color .12s, opacity .12s;
  white-space: nowrap;
}
.btn:hover { background: var(--bg-3); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn[disabled], .btn.disabled { opacity: .45; pointer-events: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); font-weight: 600; }
.btn.primary:hover { background: var(--accent-2); border-color: var(--accent-2); }
.btn.danger { border-color: #5a2a2a; color: var(--red); background: #1a1011; }
.btn.danger:hover { background: #241416; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--text-dim); }
.btn.ghost:hover { background: var(--bg-2); color: var(--text); }
.btn.sm { padding: 5px 10px; font-size: 13px; border-radius: 7px; }
.btn.lg { padding: 12px 22px; font-size: 15px; }
.btn.block { width: 100%; }

/* ---- forms ---- */
label.field { display: block; margin-bottom: 14px; }
label.field > span.lbl {
  display: block; font-size: 12.5px; color: var(--text-dim); margin-bottom: 6px; font-weight: 550;
}
label.field > span.hint { display: block; font-size: 12px; color: var(--text-faint); margin-top: 5px; }
input[type=text], input[type=number], input[type=url], input[type=password], textarea, select {
  width: 100%; padding: 10px 12px; background: var(--bg); color: var(--text);
  border: 1px solid var(--line-2); border-radius: 9px; font: 14px var(--sans); outline: none;
}
input:focus, textarea:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
input::placeholder, textarea::placeholder { color: var(--text-faint); }
textarea { resize: vertical; min-height: 80px; line-height: 1.55; }
input.mono, textarea.mono { font-family: var(--mono); font-size: 13px; }
.checkrow { display: flex; align-items: flex-start; gap: 10px; padding: 9px 0; }
.checkrow input[type=checkbox] { width: 16px; height: 16px; margin-top: 3px; accent-color: var(--accent); flex: none; }

/* ---- pills / badges ---- */
.pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px; border-radius: 99px; font-size: 11.5px; font-weight: 600;
  background: var(--bg-3); color: var(--text-dim); border: 1px solid var(--line);
  letter-spacing: .01em;
}
.pill.green { background: color-mix(in srgb, var(--green) 14%, transparent); color: var(--green); border-color: color-mix(in srgb, var(--green) 30%, transparent); }
.pill.red { background: color-mix(in srgb, var(--red) 14%, transparent); color: var(--red); border-color: color-mix(in srgb, var(--red) 30%, transparent); }
.pill.amber { background: color-mix(in srgb, var(--amber) 14%, transparent); color: var(--amber); border-color: color-mix(in srgb, var(--amber) 30%, transparent); }
.pill.accent { background: color-mix(in srgb, var(--accent) 15%, transparent); color: var(--accent); border-color: color-mix(in srgb, var(--accent) 34%, transparent); }

/* ---- tables ---- */
table.t { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.t th {
  text-align: left; padding: 8px 10px; color: var(--text-faint);
  font-size: 11px; text-transform: uppercase; letter-spacing: .08em; font-weight: 600;
  border-bottom: 1px solid var(--line);
}
table.t td { padding: 9px 10px; border-bottom: 1px solid var(--line); }
table.t tr:last-child td { border-bottom: none; }
table.t tr:hover td { background: var(--bg-2); }
table.t td.num, table.t th.num { text-align: right; font-family: var(--mono); font-size: 12.5px; }

/* ---- stats ---- */
.stat { }
.stat .k { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--text-faint); font-weight: 600; }
.stat .v { font-size: 22px; font-weight: 650; letter-spacing: -.02em; font-family: var(--mono); margin-top: 3px; }
.stat .sub { font-size: 12px; color: var(--text-dim); margin-top: 2px; }

.up { color: var(--green); }
.down { color: var(--red); }
.dim { color: var(--text-dim); }
.faint { color: var(--text-faint); }
.mut { color: var(--text-faint); font-size: 12.5px; }

/* ---- progress ---- */
.bar { height: 6px; border-radius: 99px; background: var(--bg-3); overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--accent); border-radius: 99px; transition: width .4s ease; }
.bar.green > i { background: var(--green); }
.bar.red > i { background: var(--red); }
.bar.amber > i { background: var(--amber); }

/* ---- empty / loading ---- */
.empty { text-align: center; padding: 40px 20px; color: var(--text-faint); }
.empty .big { font-size: 34px; opacity: .3; margin-bottom: 10px; }
.skel { background: linear-gradient(90deg, var(--bg-2) 25%, var(--bg-3) 50%, var(--bg-2) 75%); background-size: 200% 100%; animation: sk 1.2s infinite; border-radius: 6px; }
@keyframes sk { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ---- toast ---- */
#toasts { position: fixed; bottom: 18px; right: 18px; z-index: 999; display: flex; flex-direction: column; gap: 8px; max-width: min(380px, calc(100vw - 36px)); }
.toast {
  background: var(--bg-2); border: 1px solid var(--line-2); border-left: 3px solid var(--accent);
  border-radius: 9px; padding: 11px 14px; font-size: 13.5px; box-shadow: var(--shadow);
  animation: tin .22s ease; word-break: break-word;
}
.toast.err { border-left-color: var(--red); }
.toast.ok { border-left-color: var(--green); }
@keyframes tin { from { opacity: 0; transform: translateX(14px); } }

/* ---- modal ---- */
.modal-bg {
  position: fixed; inset: 0; background: rgba(0,0,0,.66); backdrop-filter: blur(3px);
  display: grid; place-items: center; z-index: 200; padding: 20px;
}
.modal {
  background: var(--bg-1); border: 1px solid var(--line-2); border-radius: var(--radius-lg);
  padding: 22px; width: min(520px, 100%); max-height: 86vh; overflow: auto; box-shadow: var(--shadow);
}

/* ---- misc ---- */
.addr { font-family: var(--mono); font-size: 12.5px; color: var(--text-dim); }
.sep { height: 1px; background: var(--line); margin: 16px 0; border: 0; }
.tag-input { display: flex; flex-wrap: wrap; gap: 6px; }
.avatar {
  width: 34px; height: 34px; border-radius: 9px; flex: none;
  display: grid; place-items: center; font-weight: 700; font-size: 13px;
  color: var(--accent-fg); letter-spacing: -.02em;
}
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); display: inline-block; animation: pulse 2s infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .35; } }
.scroll-y { overflow-y: auto; }
.scroll-y::-webkit-scrollbar { width: 9px; }
.scroll-y::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 9px; }
.scroll-y::-webkit-scrollbar-track { background: transparent; }
.nowrap { white-space: nowrap; }
.trunc { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---- notes: a standing statement about the page, not a transient toast ---- */
.note {
  padding: 11px 14px; border-radius: 10px; font-size: 13px; line-height: 1.5;
  background: var(--bg-3); color: var(--text-dim);
  border: 1px solid var(--line); border-left: 3px solid var(--text-dim);
}
.note b { color: var(--text); font-weight: 640; }
.note.ok { background: color-mix(in srgb, var(--green) 9%, transparent);
  border-color: color-mix(in srgb, var(--green) 26%, transparent); border-left-color: var(--green); }
.note.warn { background: color-mix(in srgb, var(--amber) 10%, transparent);
  border-color: color-mix(in srgb, var(--amber) 28%, transparent); border-left-color: var(--amber); }
