/* Juno Observatory — elegant dark mission-control theme */
:root {
  --bg: #080b12;
  --bg-glow: radial-gradient(1200px 500px at 50% -10%, rgba(88,166,255,.08), transparent 60%);
  --panel: rgba(22, 27, 38, .72);
  --panel-solid: #121722;
  --panel2: #1a2130;
  --border: rgba(120, 140, 170, .14);
  --border-strong: rgba(120, 140, 170, .28);
  --text: #eef2f8;
  --muted: #8d99ae;
  --green: #3fb950; --red: #f85149; --amber: #d29922; --blue: #6aa8ff;
  --accent-grad: linear-gradient(135deg, #6aa8ff, #a371f7);
  --radius: 14px;
  --shadow: 0 8px 28px rgba(0, 0, 0, .35);
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Code", Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.6 var(--font);
  background-image: var(--bg-glow);
  background-attachment: fixed;
  min-height: 100vh;
}
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
code { background: var(--panel2); padding: 2px 7px; border-radius: 6px;
  font: 0.86em var(--mono); border: 1px solid var(--border); }
.wrap { max-width: 1024px; margin: 0 auto; padding: 28px 20px 40px; }
.muted { color: var(--muted); } .small { font-size: 0.85em; }
.err { color: var(--red); } .good { color: var(--green); } .bad { color: var(--red); }
.ok { color: var(--green); }

/* page headings */
h2 { font-size: 1.55em; font-weight: 650; letter-spacing: -0.01em; margin: 4px 0 6px; }
h2 .muted { font-weight: 400; letter-spacing: 0; }
h3 { font-size: 1.02em; font-weight: 650; letter-spacing: 0.01em; }
h4 { color: var(--muted); font-size: 0.8em; text-transform: uppercase;
  letter-spacing: 0.09em; font-weight: 600; }

/* top bar */
.topbar {
  display: flex; align-items: center; gap: 18px;
  padding: 12px 22px;
  background: rgba(10, 13, 20, .82);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 20; flex-wrap: wrap;
}
.brand { font-weight: 700; font-size: 1.02em; color: var(--text);
  display: flex; align-items: center; gap: 9px; letter-spacing: -0.01em; }
.brand:hover { text-decoration: none; }
.brand .orb {
  width: 11px; height: 11px; border-radius: 50%;
  background: var(--accent-grad);
  box-shadow: 0 0 12px rgba(106, 168, 255, .8);
}
.nav { display: flex; gap: 2px; flex-wrap: wrap; }
.nav a {
  padding: 7px 13px; border-radius: 999px; color: var(--muted);
  font-size: 0.92em; font-weight: 500; transition: all .15s ease;
}
.nav a:hover { background: var(--panel2); color: var(--text); text-decoration: none; }
.nav a.active { background: var(--panel2); color: var(--text);
  box-shadow: inset 0 0 0 1px var(--border-strong); }
.instpick { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.instname { color: var(--muted); font-size: 0.88em;
  border: 1px solid var(--border); border-radius: 999px; padding: 4px 12px; }
.logout { font-size: 0.85em; color: var(--muted); }
.logout:hover { color: var(--text); }

/* inputs & buttons */
select, input[type=text], input[type=password], textarea {
  background: var(--panel-solid); color: var(--text);
  border: 1px solid var(--border-strong);
  border-radius: 9px; padding: 9px 12px; font: 1em var(--font);
  transition: border-color .15s ease, box-shadow .15s ease;
}
select:focus, input:focus, textarea:focus {
  outline: none; border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(106, 168, 255, .18);
}
button {
  background: var(--accent-grad); color: #fff; border: 0; border-radius: 9px;
  padding: 10px 18px; font: 600 0.95em var(--font); cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease, filter .12s ease;
  box-shadow: 0 2px 12px rgba(106, 168, 255, .25);
}
button:hover { filter: brightness(1.08); transform: translateY(-1px); }
button:active { transform: translateY(0); }
.btn-ok { background: linear-gradient(135deg, #3fb950, #2ea043); box-shadow: 0 2px 12px rgba(63,185,80,.25); }
.btn-bad { background: linear-gradient(135deg, #f85149, #da3633); box-shadow: 0 2px 12px rgba(248,81,73,.25); }
button.danger { background: transparent; border: 1px solid rgba(248,81,73,.5);
  color: var(--red); padding: 5px 12px; font-size: 0.85em; box-shadow: none; }
button.danger:hover { background: rgba(248,81,73,.1); transform: none; }

/* cards */
.card {
  background: var(--panel);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px 22px; margin: 16px 0;
  box-shadow: var(--shadow);
}
.card h3 { margin: 0 0 12px; }
.card h4 { margin: 18px 0 10px; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 12px;
  border-radius: 999px; font-size: 0.72em; font-weight: 700;
  letter-spacing: 0.08em; }
.pill.ok { background: rgba(63,185,80,.12); color: var(--green);
  border: 1px solid rgba(63,185,80,.4); }
.pill.bad { background: rgba(248,81,73,.12); color: var(--red);
  border: 1px solid rgba(248,81,73,.4); }
.pill.pending { background: rgba(210,153,34,.12); color: var(--amber);
  border: 1px solid rgba(210,153,34,.4); }

/* overview */
#livebanner { margin: 2px 0 4px; display: flex; align-items: center; gap: 7px; }
#livebanner::before { content: ""; width: 7px; height: 7px; border-radius: 50%;
  background: var(--green); box-shadow: 0 0 8px var(--green);
  animation: pulse 2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .35; } }
.insthead { display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 4px; }
.insthead h3 { margin: 0; font-size: 1.15em; }
.statgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px; margin: 14px 0; }
.stat { background: var(--panel2); border: 1px solid var(--border);
  border-radius: 11px; padding: 11px 14px;
  display: flex; flex-direction: column; gap: 2px; }
.stat .k { font-size: 0.7em; color: var(--muted); text-transform: uppercase;
  letter-spacing: 0.08em; font-weight: 600; }
.stat .v { font-weight: 650; font-size: 1.12em; font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em; }
.checkgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 10px; }
.check { display: flex; align-items: center; gap: 10px; padding: 10px 13px;
  border-radius: 11px; background: var(--panel2); border: 1px solid var(--border); }
.check .dot { width: 9px; height: 9px; border-radius: 50%; flex: none;
  background: var(--muted); }
.check.ok .dot { background: var(--green); box-shadow: 0 0 7px rgba(63,185,80,.9); }
.check.bad .dot { background: var(--red); box-shadow: 0 0 7px rgba(248,81,73,.9); }
.check .cname { font-weight: 600; font-size: 0.93em; }
.check .cdetail { color: var(--muted); font-size: 0.8em; margin-left: auto;
  text-align: right; }

/* chat / messages */
.msg { border: 1px solid var(--border); border-radius: 12px; padding: 12px 15px;
  margin: 10px 0; background: var(--panel-solid); }
.msg .mhead { display: flex; gap: 10px; margin-bottom: 5px; align-items: baseline; }
.msg .role { font-weight: 700; font-size: 0.74em; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--blue); }
.msg.system .role { color: var(--muted); }
.msg.assistant .role { color: var(--green); }
.msg.inbox .role, .msg.ui .role { color: var(--amber); }
.msg .mts { color: var(--muted); font-size: 0.78em; }
.msg .mbody { white-space: pre-wrap; word-break: break-word; }
textarea { width: 100%; margin-bottom: 10px; min-height: 76px; resize: vertical; }
pre.mem, pre.log { background: #070a10; border: 1px solid var(--border);
  border-radius: 11px; padding: 14px 16px; overflow-x: auto;
  white-space: pre-wrap; word-break: break-word;
  font: 0.84em/1.65 var(--mono); color: #c9d4e3; }
pre.log { max-height: 60vh; overflow-y: auto; }

/* tables */
.tbl { width: 100%; border-collapse: collapse; font-size: 0.93em; }
.tbl th, .tbl td { text-align: left; padding: 10px 12px;
  border-bottom: 1px solid var(--border); }
.tbl th { color: var(--muted); font-weight: 600; font-size: 0.76em;
  text-transform: uppercase; letter-spacing: 0.07em; }
.tbl tbody tr { transition: background .12s ease; }
.tbl tbody tr:hover { background: rgba(106, 168, 255, .04); }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl.kv th { width: 190px; }

/* config */
.rowform { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.rowform label { display: flex; flex-direction: column; gap: 6px;
  font-size: 0.82em; color: var(--muted); font-weight: 500; }
.rowform input[type=text] { min-width: 230px; }
.rowform input[type=password] { min-width: 260px; }

/* proposals */
.prophead { display: flex; justify-content: space-between; align-items: center;
  gap: 12px; }
.pdetail { white-space: pre-wrap; }
.decide { display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
  margin-top: 12px; }
.decide input[type=text] { flex: 1; min-width: 150px; }

/* login */
.loginwrap { display: flex; justify-content: center; padding-top: 11vh; }
.login { max-width: 380px; width: 100%; text-align: center;
  background: var(--panel); border: 1px solid var(--border);
  border-radius: 18px; padding: 36px 32px; box-shadow: var(--shadow); }
.login .orb { width: 15px; height: 15px; border-radius: 50%;
  background: var(--accent-grad); margin: 0 auto 14px;
  box-shadow: 0 0 18px rgba(106, 168, 255, .9); }
.login h2 { margin-bottom: 6px; }
.login input { width: 100%; margin: 12px 0; text-align: center; }
.login button { width: 100%; }
.logbar { display: flex; gap: 10px; margin-bottom: 12px; flex-wrap: wrap;
  align-items: center; }

.foot { text-align: center; color: var(--muted); font-size: 0.8em;
  padding: 30px 0 10px; }

@media (max-width: 640px) {
  .topbar { gap: 10px; padding: 10px 14px; }
  .nav a { padding: 6px 9px; font-size: 0.88em; }
  .wrap { padding: 18px 12px 30px; }
  .card { padding: 15px 16px; }
  .tbl { font-size: 0.85em; }
  .rowform input[type=text], .rowform input[type=password] { min-width: 0; width: 100%; }
  .rowform label { width: 100%; }
}
