/* aurora hub - internal registry. platform.openai.com-inspired:
   left icon sidebar, breadcrumb bar, dark zinc surfaces, split-pane
   playground with a config column. */

:root {
  --background: hsl(240 10% 3.9%);
  --foreground: hsl(0 0% 98%);
  --card: hsl(240 6% 7.5%);
  --muted: hsl(240 3.7% 15.9%);
  --muted-foreground: hsl(240 5% 64.9%);
  --border: hsl(240 3.7% 15.9%);
  --input: hsl(240 3.7% 15.9%);
  --primary: hsl(0 0% 98%);
  --primary-foreground: hsl(240 5.9% 10%);
  --accent: hsl(240 3.7% 15.9%);
  --radius: 0.5rem;
  --page: hsl(240 8% 5.5%);
  --bubble: hsl(240 4% 19%);
  --sidebar: hsl(240 9% 4.8%);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }

body {
  background: var(--page);
  color: var(--foreground);
  font: 14px/1.55 Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* --- sidebar ------------------------------------------------------------ */

.sidebar {
  width: 232px; flex: none;
  height: 100vh;
  background: var(--sidebar);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  padding: 14px 12px;
}

.side-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 2px 8px 12px;
  font-size: 13.5px; font-weight: 500;
}
.side-ico { width: 17px; height: 17px; color: var(--muted-foreground); }

.side-nav { display: flex; flex-direction: column; gap: 1px; flex: 1; }

.side-nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 10px;
  font-size: 13.5px; font-weight: 450;
  color: var(--muted-foreground);
  text-decoration: none;
  border-radius: 7px;
  cursor: pointer;
}
.side-nav svg { width: 16px; height: 16px; flex: none; }
.side-nav a:hover { color: var(--foreground); background: var(--accent); }
.side-nav a.on { color: var(--foreground); background: var(--accent); }

.side-foot {
  display: flex; align-items: center; gap: 9px;
  border-top: 1px solid var(--border);
  padding: 12px 8px 2px;
}
.mark {
  width: 22px; height: 22px; border-radius: 6px;
  background: var(--primary);
  position: relative; flex: none;
}
.mark::after {
  content: ""; position: absolute; inset: 5px 5px 5px 10px;
  border-radius: 2px; background: var(--sidebar); opacity: .9;
}
.org-name { font-size: 13px; font-weight: 500; }
.org-sub { font-size: 11.5px; color: var(--muted-foreground); }

/* --- shell / crumbs ------------------------------------------------------ */

.shell { flex: 1; min-width: 0; height: 100vh; overflow-y: auto; }

.crumbs {
  display: flex; align-items: center; gap: 10px;
  height: 52px;
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  font-size: 13.5px;
  position: sticky; top: 0; z-index: 10;
  background: var(--page);
}
.crumb-strong { font-weight: 600; }

main { margin: 0; padding: 20px 24px 48px; }

/* --- page head ---------------------------------------------------------- */

.page-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 18px; flex-wrap: wrap; margin-bottom: 20px;
}

h1 { margin: 0; font-size: 22px; font-weight: 650; letter-spacing: -0.02em; }
.sub { margin: 4px 0 0; color: var(--muted-foreground); font-size: 13.5px; }
.toolbar { display: flex; align-items: center; gap: 10px; }

.pill {
  font-size: 12px; font-weight: 500;
  color: var(--muted-foreground);
  background: var(--card); border: 1px solid var(--border);
  padding: 4px 11px; border-radius: 999px;
}

/* --- cards --------------------------------------------------------------- */

.panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 4px);
  margin-bottom: 16px;
  overflow: hidden;
}
.panel .panel-head { padding: 15px 20px 0; }
.panel h2 { margin: 0; font-size: 14.5px; font-weight: 600; letter-spacing: -0.01em; }
.panel .panel-sub { margin: 3px 0 0; font-size: 12.5px; color: var(--muted-foreground); }
.panel .panel-body { padding: 12px 20px 18px; }

/* --- home ---------------------------------------------------------------- */

.hero {
  background:
    radial-gradient(120% 160% at 85% -20%, hsl(255 45% 22% / .55), transparent 55%),
    radial-gradient(90% 120% at 10% 110%, hsl(200 45% 18% / .4), transparent 55%),
    var(--card);
}
.hero-body { padding: 30px 26px; max-width: 560px; }
.hero h2 { margin: 0 0 8px; font-size: 21px; font-weight: 650; letter-spacing: -0.02em; }
.hero p { margin: 0 0 18px; color: var(--muted-foreground); font-size: 13.5px; }

.statgrid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}
.stat { padding: 15px 20px 16px; }
.stat-label { font-size: 12.5px; color: var(--muted-foreground); margin-bottom: 5px; }
.stat-num { font-size: 21px; font-weight: 650; letter-spacing: -0.02em; }
.stat-num.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 17px; padding-top: 3px; }
.spark { height: 22px; margin-top: 8px; border-bottom: 1px solid var(--border); }

.homegrid {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 16px;
}
.sect { font-size: 15px; font-weight: 600; margin: 8px 0 12px; }

a.mcard { display: block; padding: 16px 20px; text-decoration: none; }
a.mcard:hover { border-color: hsl(240 5% 28%); text-decoration: none; }
.mcard-top { display: flex; align-items: center; gap: 10px; }
.micon {
  width: 30px; height: 30px; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--muted); border: 1px solid var(--border);
  border-radius: 8px;
  font-weight: 650; font-size: 14px; text-transform: uppercase;
}
.mname { font-weight: 600; font-size: 14.5px; }
.mblurb { display: block; margin: 10px 0 8px; color: var(--muted-foreground); font-size: 13px; }
.mmeta { display: block; }

.feed { padding: 8px 0; }
.fitem {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 11px 20px;
  font-size: 13px;
}
.fitem b { font-weight: 550; }
.fdot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--muted-foreground);
  margin-top: 6px; flex: none;
}

/* --- file browser (hf "files and versions") ------------------------------- */

.filecard { padding: 0; }

.fc-head {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 20px;
  background: hsl(240 6% 8.5%);
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.fc-head svg { width: 15px; height: 15px; color: var(--muted-foreground); }
.fc-title { font-weight: 600; }
.fc-branch {
  font-size: 11px; font-weight: 500;
  color: var(--muted-foreground);
  border: 1px solid var(--border); border-radius: 999px;
  padding: 1px 8px;
}
.fc-total { margin-left: auto; color: var(--muted-foreground); font-size: 12px; font-variant-numeric: tabular-nums; }

.frow {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 20px;
  border-top: 1px solid var(--border);
  font-size: 13.5px;
}
.frow:first-of-type { border-top: none; }
.frow:hover { background: hsl(240 5% 9%); }

.frow .fglyph {
  width: 15px; height: 15px; flex: none;
  color: var(--muted-foreground);
}
.frow .fname {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12.5px; font-weight: 500;
  color: var(--foreground);
}
.frow .fname:hover { text-decoration: underline; text-underline-offset: 3px; }
.frow .fmtime { margin-left: auto; color: var(--muted-foreground); font-size: 12px; width: 56px; text-align: right; }
.frow .fsize { color: var(--muted-foreground); font-variant-numeric: tabular-nums; font-size: 12.5px; width: 88px; text-align: right; }

.dl {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px;
  color: var(--muted-foreground);
  border: 1px solid var(--input);
  border-radius: var(--radius);
}
.dl svg { width: 14px; height: 14px; }
.dl:hover { background: var(--accent); color: var(--foreground); text-decoration: none; }

.clirow {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 20px;
  border-top: 1px solid var(--border);
  background: hsl(240 6% 8%);
}
.cli-label {
  font-size: 10.5px; font-weight: 650; letter-spacing: .06em;
  color: var(--muted-foreground);
}
.cli {
  flex: 1;
  background: none; border: none; padding: 0;
  font-size: 12px; color: var(--muted-foreground);
  overflow-x: auto; white-space: nowrap;
}

/* --- release notes (post) ------------------------------------------------ */

.post-body { max-width: 720px; }
.post-body h3 { margin: 4px 0 2px; font-size: 16px; font-weight: 650; letter-spacing: -0.01em; }
.post-meta { font-size: 12px; color: var(--muted-foreground); margin-bottom: 14px; }
.post-body p { margin: 0 0 12px; font-size: 13.5px; color: hsl(240 6% 82%); line-height: 1.7; }

/* --- badges & meta ------------------------------------------------------ */

.tag {
  display: inline-flex; align-items: center;
  font-size: 11.5px; font-weight: 600;
  border-radius: 999px; padding: 2px 10px;
  border: 1px solid transparent;
}
.tag-stable { color: hsl(142 60% 70%); background: hsl(142 40% 14%); border-color: hsl(142 35% 25%); }
.tag-internal { color: hsl(40 80% 70%); background: hsl(40 45% 14%); border-color: hsl(38 45% 27%); }

.notes { margin: 0; padding-left: 18px; }
.notes li { margin: 4px 0; }
.notes li::marker { color: var(--muted-foreground); }

.fine { color: var(--muted-foreground); font-size: 12.5px; }

a { color: var(--foreground); font-weight: 500; }
code {
  background: var(--muted);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 6px;
  font: 12.5px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

/* --- buttons ------------------------------------------------------------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--primary); color: var(--primary-foreground);
  border: none; border-radius: var(--radius);
  padding: 8px 16px;
  font: inherit; font-size: 13.5px; font-weight: 550;
  cursor: pointer;
  text-decoration: none;
}
.btn:hover { background: hsl(0 0% 88%); text-decoration: none; }
.btn:disabled { opacity: .4; cursor: default; }

/* --- playground: split pane --------------------------------------------- */

.pgwrap {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 16px;
  align-items: stretch;
  height: calc(100vh - 52px - 40px);
}
.pgcfg { overflow-y: auto; margin-bottom: 0; }

.cfgsec + .cfgsec { border-top: 1px solid var(--border); }

.cfgsec-h {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px;
  font-size: 14px; font-weight: 600;
}
.cfgsec-h .chev { color: var(--muted-foreground); font-size: 11px; }

.cfgsec-b { padding: 2px 18px 16px; }

.addmsg {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 12px;
  font-size: 13px; color: var(--muted-foreground);
}

.flabel {
  display: block;
  font-size: 12.5px; font-weight: 500;
  color: var(--muted-foreground);
  margin: 12px 0 6px;
}
.flabel:first-child { margin-top: 0; }

.cfgta {
  width: 100%; resize: vertical;
  background: var(--background);
  border: 1px solid var(--input);
  border-radius: var(--radius);
  color: var(--foreground);
  font: inherit; font-size: 13px;
  padding: 9px 11px;
}
.cfgta:focus { outline: none; border-color: hsl(240 5% 32%); }

.cfgsel {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--background);
  border: 1px solid var(--input);
  border-radius: var(--radius);
  padding: 8px 11px;
  font-size: 13px;
}
.cfgsel .chev { color: var(--muted-foreground); font-size: 10px; }

/* chat column - fills the pane, composer pinned to the bottom */
.pgchat { display: flex; flex-direction: column; margin-bottom: 0; }

.pgchat .log {
  flex: 1; min-height: 0; overflow-y: auto;
  padding: 24px 22px;
  display: flex; flex-direction: column; gap: 18px;
}

.empty-state {
  flex: 1; margin: auto;
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  color: var(--muted-foreground);
  padding: 60px 0;
}
.empty-state svg { width: 30px; height: 30px; opacity: .7; }
.empty-state p { margin: 0; font-size: 13.5px; }

.turn { display: flex; flex-direction: column; gap: 5px; }
.turn .who {
  font-size: 11.5px; font-weight: 600;
  color: var(--muted-foreground);
  letter-spacing: .02em;
}
.msg {
  max-width: 82%;
  white-space: pre-wrap; word-break: break-word;
  font-size: 14px; line-height: 1.6;
}
.msg.them { align-self: flex-start; color: var(--foreground); }
.msg.me {
  align-self: flex-end;
  background: var(--bubble);
  border-radius: 18px;
  padding: 8px 15px;
  max-width: 78%;
}
.msg.pending { color: var(--muted-foreground); }

/* composer - boxed like platform.openai.com */
.composer {
  display: flex; align-items: center; gap: 10px;
  margin: 0 auto 16px;
  width: min(760px, calc(100% - 32px));
  background: var(--muted);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 8px 8px 8px 14px;
}
.composer:focus-within { border-color: hsl(240 5% 30%); }
.composer .plus {
  font-size: 17px; color: var(--muted-foreground);
  width: 26px; height: 26px; flex: none;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
}
.composer input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--foreground);
  font: inherit; font-size: 14px;
  padding: 5px 0;
}
.composer input:focus { outline: none; }
.composer input::placeholder { color: var(--muted-foreground); }

.send {
  width: 32px; height: 32px; flex: none;
  border: none; border-radius: 50%;
  background: var(--primary); color: var(--primary-foreground);
  font-size: 15px; font-weight: 600;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.send:hover { background: hsl(0 0% 86%); }
.send:disabled { background: var(--accent); color: var(--muted-foreground); cursor: default; }

@media (max-width: 900px) {
  .pgwrap, .homegrid, .statgrid { grid-template-columns: 1fr; height: auto; }
  .sidebar { width: 64px; }
  .side-nav a { font-size: 0; gap: 0; justify-content: center; }
  .side-nav svg { width: 18px; height: 18px; }
  .org-name, .org-sub { display: none; }
}
