:root {
  --bg: #16140f;
  --bg-2: #1e1b14;
  --ink: #f3ead7;
  --muted: #a79b86;
  --line: #3a3428;
  --copper: #c56a32;
  --copper-2: #e08a4c;
  --sage: #c5d2a8;
  --warn: #e0b15a;
  --danger: #c45c4a;
  --radius: 14px;
  --sans: "Segoe UI", "Helvetica Neue", ui-sans-serif, system-ui, sans-serif;
  --mono: "Cascadia Mono", "Consolas", ui-monospace, monospace;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(1200px 500px at 10% -10%, #2a2218 0%, transparent 55%),
    var(--bg);
  font-family: var(--sans);
  line-height: 1.45;
}

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

.shell {
  min-height: 100%;
  display: grid;
  grid-template-columns: 260px 1fr;
}

.rail {
  padding: 28px 22px;
  border-right: 1px solid var(--line);
  background: var(--bg-2);
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-size: 13px;
  font-weight: 700;
}
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 18px;
  height: 18px;
  border: 2px solid var(--copper);
  border-radius: 50%;
  box-shadow: inset 0 0 0 3px var(--bg-2), inset 0 0 0 5px var(--copper-2);
}
.lede {
  color: var(--muted);
  font-size: 14px;
  margin: 0;
}

.nav { display: flex; flex-direction: column; gap: 6px; }
.nav a {
  color: var(--muted);
  text-decoration: none;
  padding: 8px 10px;
  border-radius: 8px;
}
.nav a.is-active,
.nav a:hover {
  color: var(--ink);
  background: #2a261c;
  text-decoration: none;
}

.rail-foot { margin-top: auto; }
.who { display: flex; flex-direction: column; gap: 2px; margin-bottom: 10px; }
.who strong { font-size: 14px; }
.who span { color: var(--muted); font-size: 12px; }

.main {
  padding: 36px 40px 64px;
  max-width: 860px;
}

.kicker {
  margin: 0 0 8px;
  color: var(--copper-2);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-size: 11px;
  font-weight: 650;
}
h1 { margin: 0 0 12px; font-size: 32px; font-weight: 650; letter-spacing: -0.03em; }
h2 { margin: 0 0 12px; font-size: 18px; font-weight: 650; }
.intro, .hint { color: var(--muted); }
.intro { margin: 0 0 20px; }
.hint { font-size: 13px; }

.panel {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  margin-bottom: 18px;
}
.auth-panel { max-width: 460px; }

.stack { display: flex; flex-direction: column; gap: 14px; }
.grid-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 16px;
}
label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
}
input, textarea {
  font: inherit;
  color: var(--ink);
  background: #14120e;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
}
textarea { resize: vertical; min-height: 72px; }
input:focus, textarea:focus {
  outline: 2px solid var(--copper);
  outline-offset: 1px;
}
.check {
  flex-direction: row;
  align-items: center;
  gap: 8px;
  color: var(--ink);
}
.check input { width: auto; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-weight: 600;
  padding: 11px 16px;
  border-radius: 999px;
  cursor: pointer;
}
.btn:hover { background: #2a261c; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-primary {
  background: var(--copper);
  border-color: var(--copper);
  color: #1a120c;
}
.btn-primary:hover { background: var(--copper-2); }
.btn-wake { min-width: 220px; min-height: 52px; font-size: 16px; }
.btn-danger { border-color: var(--danger); color: var(--danger); }
.linkish {
  background: none;
  border: 0;
  color: var(--copper-2);
  font: inherit;
  cursor: pointer;
  padding: 0;
}
.linkish:hover { text-decoration: underline; }

.hero-status {
  border-left: 4px solid var(--muted);
  padding: 8px 0 8px 18px;
  margin-bottom: 28px;
}
.hero-status[data-kind="online"] { border-color: var(--sage); }
.hero-status[data-kind="waking"] { border-color: var(--warn); }
.hero-status[data-kind="offline"] { border-color: var(--muted); }

.state-label {
  margin: 0;
  font-size: 42px;
  letter-spacing: -0.04em;
  font-weight: 650;
}
.hero-status[data-kind="online"] .state-label { color: var(--sage); }
.hero-status[data-kind="waking"] .state-label { color: var(--warn); }

.status-copy {
  margin: 14px 0;
  padding: 14px 16px;
  background: #14120e;
  border: 1px dashed var(--line);
  border-radius: 10px;
  font-size: 18px;
  user-select: text;
  white-space: pre-wrap;
}
.status-meta {
  display: flex;
  gap: 16px;
  align-items: center;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12px;
}

.actions { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; margin: 8px 0 28px; }
.facts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 0;
}
.facts div {
  border-top: 1px solid var(--line);
  padding-top: 10px;
}
.facts dt { color: var(--muted); font-size: 12px; }
.facts dd { margin: 4px 0 0; }

.page-head { margin-bottom: 22px; }
.user-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 12px;
  background: var(--bg-2);
}
.user-card header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
}
.user-card h2 { margin: 0; }
.meta { color: var(--muted); font-size: 13px; }
.invite {
  margin-top: 12px;
  padding: 10px 12px;
  background: #14120e;
  border-radius: 8px;
  font-family: var(--mono);
  font-size: 12px;
  word-break: break-all;
  user-select: text;
}
.row-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 12px; align-items: center; }
.row-actions label.btn { position: relative; overflow: hidden; margin: 0; }
.row-actions label.btn input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}
.passkeys { margin: 10px 0 0; padding: 0; list-style: none; color: var(--muted); font-size: 13px; }
.passkeys li { margin: 6px 0; }

.helper-banner { border-color: var(--copper); }
.helper-steps {
  margin: 0 0 14px;
  padding-left: 1.2rem;
  color: var(--muted);
  font-size: 14px;
}
.helper-steps li { margin: 6px 0; }
.helper-banner[hidden] { display: none; }

.toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: var(--ink);
  color: var(--bg);
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 14px;
}

@media (max-width: 800px) {
  .shell { grid-template-columns: 1fr; }
  .rail {
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 18px;
    gap: 16px;
  }
  .nav { flex-direction: row; flex-wrap: wrap; }
  .rail-foot { margin-top: 0; display: flex; justify-content: space-between; align-items: center; }
  .main { padding: 24px 18px 48px; }
  .grid-form, .facts { grid-template-columns: 1fr; }
  .state-label { font-size: 32px; }
  .lede { display: none; }
}
