:root {
  --ink: #1c1915;
  --forest: #1f4d3a;
  --forest-deep: #14352a;
  --gold: #c4963a;
  --sand: #f3eee4;
  --clay: #e6d3bc;
  --paper: #fffcf7;
  --good: #1f7a45;
  --warn: #8a5a00;
  --stop: #8e332c;
  --muted: #6b6258;
  --line: #e4d9c8;
  --shadow: 0 16px 40px rgba(28, 25, 21, 0.06);
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(1200px 400px at 10% -10%, rgba(196, 150, 58, 0.16), transparent 50%),
    var(--sand);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.45;
}

button, input, select {
  font: inherit;
  color: inherit;
}

button { cursor: pointer; }

:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
}

.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-card, .card, .panel {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
}

.login-card {
  width: min(420px, 100%);
  padding: 32px 28px;
}

.mark {
  width: 52px;
  height: 52px;
  border-radius: 12px;
}

.eyebrow {
  margin: 18px 0 0;
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 600;
  letter-spacing: -0.02em;
}

h1 { font-size: 2.1rem; margin: 6px 0 8px; }
h2 { font-size: 1.7rem; margin: 0 0 8px; }
h3 { font-size: 1.15rem; margin: 0 0 8px; }

.lede, .muted { color: var(--muted); }
.lede { margin-top: 0; }

.stack { display: grid; gap: 12px; }
label { display: grid; gap: 6px; font-weight: 600; }

input, select {
  width: 100%;
  border: 1px solid var(--clay);
  background: white;
  border-radius: 12px;
  padding: 12px 14px;
}

.btn {
  border: 0;
  border-radius: 999px;
  padding: 12px 18px;
  background: var(--forest);
  color: white;
  font-weight: 700;
}
a.btn { display: inline-block; text-align: center; text-decoration: none; }

.btn.quiet {
  background: transparent;
  color: var(--forest-deep);
  border: 1px solid var(--clay);
}

.btn.warn { background: var(--stop); }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }

.banner {
  border-radius: 12px;
  padding: 12px 14px;
  background: #f8e7e4;
  color: var(--stop);
}

.banner.info {
  background: #f3ead4;
  color: var(--warn);
}

.shell { min-height: 100vh; }

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 18px 22px;
  background: var(--forest-deep);
  color: #f6f1e8;
}

.brand-lockup { display: flex; gap: 12px; align-items: center; }
.brand-lockup strong { display: block; font-family: var(--serif); font-size: 1.25rem; }
.brand-lockup span { color: #d9c7a4; font-size: 0.92rem; }

.nav { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.nav button {
  background: transparent;
  color: #f6f1e8;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 8px 12px;
}

.nav button.active { border-color: rgba(246, 241, 232, 0.4); background: rgba(255, 255, 255, 0.06); }

main { width: min(1100px, calc(100% - 32px)); margin: 24px auto 48px; }

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

.grid { display: grid; gap: 14px; }
.cards { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }

.device-card, .panel { padding: 18px; text-align: left; }
.device-card { width: 100%; }

.device-card:hover { border-color: var(--gold); }

.row { display: flex; justify-content: space-between; gap: 12px; align-items: center; }

.pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.82rem;
  font-weight: 700;
  background: var(--clay);
  color: var(--ink);
}

.pill.collecting { background: #dcecde; color: var(--good); }
.pill.paused, .pill.awaiting { background: #f3ead4; color: var(--warn); }
.pill.stopped, .pill.offline { background: #ece7df; color: var(--muted); }
.pill.revoked, .pill.recording { background: #f8e7e4; color: var(--stop); }

.summary {
  font-family: var(--serif);
  font-size: 1.25rem;
  line-height: 1.4;
}

.bar { display: grid; grid-template-columns: minmax(120px, 1fr) 2fr auto; gap: 10px; align-items: center; margin: 8px 0; }
.track { height: 10px; background: #efe6d8; border-radius: 999px; overflow: hidden; }
.track span { display: block; height: 100%; background: var(--forest); border-radius: inherit; }

.split { display: grid; grid-template-columns: 1.2fr 0.8fr; gap: 14px; }
.list { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.list li, .file-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

a { color: var(--forest); font-weight: 700; }

.code {
  font-family: "Segoe UI", ui-monospace, monospace;
  font-size: 2rem;
  letter-spacing: 0.12em;
  margin: 8px 0;
}

.key {
  word-break: break-all;
  font-family: ui-monospace, monospace;
  background: #f6f1e8;
  padding: 10px;
  border-radius: 10px;
}

.form-grid { display: grid; gap: 10px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.empty {
  padding: 28px;
  text-align: center;
}

.server {
  font-family: ui-monospace, monospace;
  background: var(--forest-deep);
  color: white;
  padding: 10px 12px;
  border-radius: 10px;
}

@media (max-width: 800px) {
  .split, .two, .bar { grid-template-columns: 1fr; }
  .topbar, .page-head, .row, .list li, .file-row { flex-direction: column; align-items: stretch; }
  h1 { font-size: 1.7rem; }
  main { width: min(1100px, calc(100% - 20px)); }
}
