@import url('https://fonts.googleapis.com/css2?family=Source+Code+Pro:ital,wght@0,200..900;1,200..900&display=swap');

:root {
  color-scheme: dark;
  --bg: #403d39;
  --fg: #ececec;
  --muted: #8a8a8a;
  --accent: #e07a5f;
  --danger: #d6484d;
  --console-bg: #252422;
}
* { box-sizing: border-box; }
html, body {
  width: 100%;
  min-height: 100vh;
  margin: 0;
}
body {
  font-family: "Source Code Pro", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  line-height: 1.5;
  display: flex;
  justify-content: center;
  background: var(--bg);
  color: var(--fg);
}
.container {
  width: 100%;
  max-width: 1400px;
  padding: clamp(1rem, 4vw, 3rem);
}
h1 { font-size: clamp(1.5rem, 3vw, 2.1rem); margin-bottom: 0.5rem; }
.notice {
  display: inline-block;
  font-size: 0.85rem;
  padding: 0.3rem 0.7rem;
  border-radius: 6px;
  background: color-mix(in srgb, var(--accent) 15%, transparent);
  color: var(--accent);
}

.sysinfo {
  display: flex;
  flex-wrap: wrap;
  gap: 1.2rem;
  margin-top: 1.5rem;
  padding: 0.6rem 1rem;
  border: 1px solid color-mix(in srgb, var(--muted) 50%, transparent);
  border-radius: 8px;
  background: color-mix(in srgb, var(--muted) 8%, transparent);
  font-size: 0.8rem;
}
.sysinfo-item { display: flex; gap: 0.5rem; align-items: baseline; }
.sysinfo-item .k { text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
.sysinfo-item .v { font-weight: 600; }
.sysinfo-note {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent);
  padding: 0.15rem 0.5rem;
  border-radius: 5px;
  background: color-mix(in srgb, var(--accent) 15%, transparent);
}

.layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 1.5rem;
  margin-top: 1.5rem;
  align-items: start;
}
@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; }
  .panel-stack { order: -1; }
}

/* --- console: brighter than the page background so it pops --- */
.console {
  background: var(--console-bg);
  color: #81b29a;
  border-radius: 8px;
  border: 1px solid color-mix(in srgb, var(--muted) 35%, transparent);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.2);
  /* A grid item otherwise refuses to shrink below its content's intrinsic
     width — a long unwrapped JSON line would blow out the whole page layout
     instead of scrolling inside the console. */
  min-width: 0;
}
.console-inner {
  height: min(72vh, 640px);
  overflow-y: auto;
  overflow-x: hidden;
  padding: 1rem 1.2rem;
  font-size: 0.85rem;
}
.console .line { white-space: pre-wrap; word-break: break-word; margin: 0 0 0.3rem; }
.console .line.boot { color: inherit; opacity: 0.75; }
.console .prompt { color: var(--accent); font-weight: 600; }
.console .line.pending { color: var(--muted); }
.console .out { padding-left: 1.4rem; }
.console .out .pct { opacity: 0.85; }
.console .out.conflict { color: var(--danger); }
.console .out.corroborated { color: var(--muted); }
.console .out.rejected { color: var(--muted); }
.console .out.error { color: var(--danger); }
.console .tag { font-weight: 600; }
.console pre.json-output {
  margin: 0;
  padding-left: 1.4rem;
  font-family: inherit;
  font-size: inherit;
  white-space: pre;
  overflow-x: auto;
}
.console .json-key { color: inherit; }
.console .json-val { color: #f2cc8f; }

/* --- right-hand action panels --- */
.panel-stack { display: flex; flex-direction: column; gap: 1rem; }
.side-tabs {
  display: flex; gap: 0.4rem; margin-bottom: 0.3rem;
  border-bottom: 1px solid color-mix(in srgb, var(--muted) 50%, transparent);
}
.side-tab-btn {
  background: none; border: none; cursor: pointer;
  padding: 0.5rem 0.8rem; font-size: 0.85rem; font-family: inherit; color: inherit; opacity: 0.6;
  border-bottom: 2px solid transparent;
}
.side-tab-btn.active { opacity: 1; border-bottom-color: var(--accent); font-weight: 600; }
.side-tab-panel { display: none; flex-direction: column; gap: 1rem; }
.side-tab-panel.active { display: flex; }
.panel {
  border: 1px solid color-mix(in srgb, var(--muted) 50%, transparent);
  border-radius: 8px;
  padding: 1rem 1.1rem;
}
.panel h2 {
  font-size: 0.8rem;
  margin: 0 0 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

form { display: flex; flex-direction: column; gap: 0.9rem; margin: 0; }
label { display: flex; flex-direction: column; gap: 0.35rem; font-size: 0.85rem; }
input, textarea {
  font: inherit; padding: 0.5rem 0.6rem; border-radius: 6px;
  border: 1px solid color-mix(in srgb, var(--muted) 70%, transparent); background: transparent; color: inherit;
  width: 100%;
}
button {
  align-self: flex-start; font: inherit; font-weight: 600; cursor: pointer;
  padding: 0.55rem 1.1rem; border-radius: 6px; border: none;
  background: var(--accent); color: var(--bg);
}
button:disabled { opacity: 0.5; cursor: default; }
.hint { font-size: 0.8rem; opacity: 0.8; margin: 0; }
.hint-list { font-size: 0.8rem; opacity: 0.8; margin: 0; padding-left: 1.2rem; }
code { background: color-mix(in srgb, var(--muted) 25%, transparent); padding: 0.1rem 0.35rem; border-radius: 4px; }
.code-block {
  background: color-mix(in srgb, var(--muted) 25%, transparent);
  padding: 0.6rem 0.8rem;
  border-radius: 6px;
  font-size: 0.85rem;
  overflow-x: auto;
}
