:root {
  --bg: #0e1418;
  --bg-2: #131c22;
  --bg-3: #19242c;
  --line: #1f2c34;
  --line-strong: #2a3a44;
  --line-bright: #3d5363;
  --text: #e9eef2;
  --text-dim: #95a6b3;
  --text-mute: #5a6f7d;
  --accent: #5d7fb0;
  --accent-soft: #5d7fb022;
  --accent-2: #c97e4e;
  --accent-2-soft: #c97e4e22;
  --green: #6f8f5e;
  --green-soft: #6f8f5e22;
  --red: #c46159;
  --amber: #d8a64b;
  --maint: #4a8aa8;

  --radius: 10px;
  --radius-sm: 6px;
  --radius-lg: 14px;

  --gap-block: 56px;
  --gap-tight: 32px;
  --pad-card: 24px;
  --pad-main: 56px;
  --pad-row: 14px;
  --gap-grid: 14px;

  --display: 'Fraunces', 'Iowan Old Style', Georgia, serif;
  --sans: 'IBM Plex Sans', system-ui, -apple-system, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 14.5px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

/* ── App shell ──────────────────────────────────────────────── */
.app {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 280px 1fr;
}

.sidebar {
  background: var(--bg);
  border-right: 1px solid var(--line);
  padding: 24px 18px 18px;
  display: flex;
  flex-direction: column;
  gap: 26px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  background-image: linear-gradient(180deg, rgba(255,255,255,.012) 0%, transparent 100%);
}
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-thumb { background: var(--line-strong); }

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 12px 14px;
  color: inherit;
  text-decoration: none;
  border-bottom: 1px dashed var(--line);
  margin-bottom: 4px;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-name {
  font-family: var(--display);
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -.4px;
}
.brand-host {
  font-size: 10px;
  color: var(--text-mute);
  font-family: var(--mono);
  letter-spacing: 1.4px;
  text-transform: lowercase;
  margin-top: 4px;
}

.nav-group { display: flex; flex-direction: column; gap: 1px; }
.nav-label {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 2.2px;
  color: var(--text-mute);
  padding: 0 12px 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-weight: 500;
}
.nav-tick {
  width: 6px; height: 6px;
  background: var(--accent);
  transform: rotate(45deg);
  display: inline-block;
  flex-shrink: 0;
}

.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-dim);
  text-decoration: none;
  cursor: pointer;
  border: none;
  background: none;
  text-align: left;
  width: 100%;
  transition: background .15s ease, color .15s ease;
  font-family: var(--sans);
  font-size: inherit;
}
.nav-item:hover { background: var(--bg-2); color: var(--text); }
.nav-item.active { background: var(--bg-3); color: var(--text); }
.nav-active-bar {
  position: absolute;
  left: -18px;
  top: 14px; bottom: 14px;
  width: 2px;
  background: var(--accent);
}
.nav-icon {
  width: 26px; height: 26px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--bg);
  display: grid; place-items: center;
  color: var(--text-dim);
  flex-shrink: 0;
  transition: color .15s, border-color .15s;
}
.nav-item:hover .nav-icon { color: var(--text); border-color: var(--line-strong); }
.nav-item.active .nav-icon { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
.nav-text { display: flex; flex-direction: column; line-height: 1.15; flex: 1; min-width: 0; }
.nav-label-main { font-size: 13.5px; font-weight: 500; }
.nav-label-sub {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text-mute);
  text-transform: lowercase;
  letter-spacing: .4px;
  margin-top: 2px;
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px dashed var(--line);
}
.user-chip {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
}
.avatar {
  width: 34px; height: 34px;
  border-radius: 7px;
  background: linear-gradient(135deg, var(--accent), #8c5a37);
  display: grid; place-items: center;
  font-weight: 600;
  font-size: 14px;
  color: #fff;
  flex-shrink: 0;
  font-family: var(--display);
}
.user-chip-text { font-size: 13px; line-height: 1.2; flex: 1; min-width: 0; }
.user-chip-text .name { font-weight: 500; color: var(--text); }
.user-chip-text .role {
  color: var(--text-mute); font-size: 10px;
  font-family: var(--mono); text-transform: lowercase; letter-spacing: .5px;
  margin-top: 2px;
}
.signout {
  background: none; border: 1px solid var(--line); color: var(--text-mute);
  cursor: pointer; padding: 6px;
  display: grid; place-items: center;
  border-radius: 6px;
  flex-shrink: 0;
}
.signout:hover { color: var(--accent); border-color: var(--accent); }

/* ── Main content ────────────────────────────────────────────── */
.main {
  background: var(--bg);
  min-width: 0;
  overflow-x: hidden;
  position: relative;
}
.main::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(transparent 0 calc(100% - 1px), rgba(255,255,255,.012) 100%);
  background-size: 100% 64px;
  pointer-events: none;
}
.main-inner {
  padding: var(--gap-tight) clamp(20px, 4vw, var(--pad-main)) 80px;
  max-width: 1240px;
  position: relative;
}

/* ── Page head ───────────────────────────────────────────────── */
.page-head {
  margin-bottom: 36px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--line);
  position: relative;
}
.page-head::after {
  content: "";
  position: absolute;
  left: 0; bottom: -1px;
  width: 80px; height: 2px;
  background: var(--accent);
}
.ticker {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 5px 12px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 18px;
}
.ticker .t-dot {
  width: 6px; height: 6px;
  background: var(--accent-2);
  border-radius: 50%;
  box-shadow: 0 0 0 3px var(--accent-2-soft);
  animation: tickerPulse 2.4s ease-out infinite;
  flex-shrink: 0;
}
@keyframes tickerPulse {
  0%, 100% { box-shadow: 0 0 0 3px var(--accent-2-soft); }
  50% { box-shadow: 0 0 0 5px transparent; }
}
.ticker .t-sep { color: var(--text-mute); }

.page-title {
  font-family: var(--display);
  font-size: clamp(40px, 5.5vw, 64px);
  font-weight: 500;
  line-height: 1.0;
  letter-spacing: -1.2px;
  margin: 0 0 14px;
}
.page-title .hl {
  font-style: normal;
  font-weight: 600;
  color: var(--accent);
}
.page-sub {
  color: var(--text-dim);
  font-size: 16px;
  max-width: 60ch;
  margin: 0;
  line-height: 1.5;
}
.page-sub a { color: var(--accent); text-decoration: none; border-bottom: 1px dotted var(--accent); }

/* ── Section headings ────────────────────────────────────────── */
.heading { margin-bottom: 18px; }
.heading-row {
  display: flex;
  align-items: baseline;
  gap: 16px;
}
.stamp {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid var(--accent);
  padding: 3px 8px;
  border-radius: 4px;
  letter-spacing: 1px;
  flex-shrink: 0;
}
.heading h2, .heading.simple h2 {
  font-family: var(--display);
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -.3px;
  margin: 0;
  flex-shrink: 0;
}
.heading-rule {
  flex: 1;
  height: 1px;
  background: var(--line);
  margin: 0 4px;
  align-self: center;
}
.heading-kicker {
  font-family: var(--mono);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--text-mute);
  flex-shrink: 0;
}
.head-link {
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1.4px;
  color: var(--accent);
  text-decoration: none;
  flex-shrink: 0;
}
.head-link:hover { text-decoration: underline; }

section.block { margin-bottom: var(--gap-block); }

/* ── Bento (storage + health) ───────────────────────────────── */
.bento {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: var(--gap-grid);
}
.bento-card {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: var(--pad-card) calc(var(--pad-card) + 2px);
  position: relative;
}
.bento-card::before {
  content: "";
  position: absolute;
  top: 0; left: 24px; right: 24px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: .35;
}
.bento-label {
  font-family: var(--mono);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-mute);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.bento-label::before {
  content: "";
  width: 5px; height: 5px;
  background: var(--accent);
  border-radius: 50%;
  flex-shrink: 0;
}
.storage-num {
  display: flex;
  align-items: baseline;
  gap: 10px;
  line-height: 1;
}
.storage-num .big {
  font-family: var(--display);
  font-size: 76px;
  font-weight: 500;
  letter-spacing: -2.5px;
}
.storage-num .unit {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--text-mute);
  text-transform: uppercase;
  letter-spacing: 1.5px;
}
.storage-bar {
  height: 6px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 22px;
  position: relative;
}
.storage-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--green) 0%, var(--accent) 60%, var(--accent-2) 100%);
  border-radius: 999px;
  transition: width .6s ease;
}
.storage-meta {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  font-size: 11px;
  font-family: var(--mono);
  color: var(--text-mute);
  letter-spacing: .8px;
}

.health-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px 5px 10px;
  background: var(--green-soft);
  border: 1px solid var(--green);
  border-radius: 999px;
  color: var(--green);
  font-size: 12px;
  font-weight: 500;
  font-family: var(--mono);
  letter-spacing: .3px;
}
.health-pill.warn {
  background: rgba(216,166,75,.12);
  border-color: var(--amber);
  color: var(--amber);
}
.health-pill.warn .dot { background: var(--amber); }
.health-pill.warn .dot::after { border-color: var(--amber); }
.health-pill .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--green); position: relative;
  flex-shrink: 0;
}
.health-pill .dot::after {
  content: ""; position: absolute; inset: -3px; border-radius: 50%;
  border: 1.5px solid var(--green); opacity: .6;
  animation: pulse 2.4s ease-out infinite;
}
@keyframes pulse { 0% { transform: scale(.6); opacity: .6; } 100% { transform: scale(2); opacity: 0; } }

.micro-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px dashed var(--line);
}
.micro-stats .ms-num {
  font-family: var(--display);
  font-size: 28px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: -.6px;
}
.micro-stats .ms-num .ms-unit { font-family: var(--mono); font-size: 13px; color: var(--text-mute); margin-left: 2px; }
.micro-stats .ms-lbl {
  font-family: var(--mono);
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 1.4px;
  color: var(--text-mute);
  margin-top: 6px;
}

/* ── Buttons ─────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 20px;
  background: var(--accent);
  color: #fff;
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  font-family: var(--sans);
  transition: filter .15s, transform .08s;
  text-decoration: none;
}
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: translateY(1px); }
.btn.ghost {
  background: transparent;
  border: 1px solid var(--line-strong);
  color: var(--text);
}
.btn.ghost:hover { background: var(--bg-3); border-color: var(--line-bright); }
.btn.full { width: 100%; justify-content: center; margin-top: 22px; }

/* ── Service tiles ───────────────────────────────────────────── */
.tile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
}
.tile {
  position: relative;
  display: flex; flex-direction: column;
  gap: 6px;
  padding: var(--pad-card);
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: inherit;
  text-decoration: none;
  cursor: pointer;
  transition: transform .12s ease, border-color .12s ease;
  overflow: hidden;
}
.tile::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 2px;
  background: var(--accent);
  transform: scaleY(0);
  transform-origin: top;
  transition: transform .18s ease;
}
.tile:hover { border-color: var(--line-strong); transform: translateY(-1px); }
.tile:hover::before { transform: scaleY(1); }
.tile-head { display: flex; align-items: center; gap: 10px; }
.tile-icon {
  width: 30px; height: 30px;
  border-radius: 7px;
  background: var(--bg);
  display: grid; place-items: center;
  color: var(--accent);
  flex-shrink: 0;
  border: 1px solid var(--line);
}
.tile-name { font-weight: 500; font-size: 14.5px; }
.tile-desc { color: var(--text-dim); font-size: 12.5px; line-height: 1.45; margin-top: 2px; }
.tile-arrow {
  position: absolute;
  top: 16px; right: 16px;
  color: var(--text-mute);
  opacity: 0;
  transition: opacity .15s, transform .15s;
}
.tile:hover .tile-arrow { opacity: 1; transform: translate(2px, -2px); color: var(--accent); }
.tile.admin .tile-icon { color: #8b8fb0; }
.tile-tags { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
.tag {
  font-size: 9.5px;
  padding: 2px 7px;
  border-radius: 3px;
  background: var(--bg-3);
  color: var(--text-mute);
  border: 1px solid var(--line);
  font-family: var(--mono);
  letter-spacing: 1px;
  text-transform: uppercase;
  font-weight: 500;
}
.tag.admin { color: #9a96c2; border-color: #3a3550; background: #1f1c2c; }
.tag.vpn   { color: var(--amber); border-color: #4a3d24; background: #2a2114; }

/* ── Poster rows ─────────────────────────────────────────────── */
.poster-row {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 8px;
  scroll-snap-type: x proximity;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}
.poster-row::-webkit-scrollbar { height: 6px; }
.poster-row::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 3px; }
.poster {
  flex: 0 0 auto;
  width: 150px;
  text-decoration: none;
  color: inherit;
  scroll-snap-align: start;
  cursor: pointer;
}
.poster-art {
  width: 150px;
  height: 220px;
  border-radius: 7px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  overflow: hidden;
  position: relative;
  transition: transform .15s ease, border-color .15s ease;
}
.poster-art img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
.poster:hover .poster-art { transform: translateY(-3px); border-color: var(--accent); }
.poster-art .placeholder {
  width: 100%; height: 100%;
  background:
    repeating-linear-gradient(135deg, rgba(255,255,255,.02) 0 8px, transparent 8px 16px),
    linear-gradient(160deg, var(--bg-3), var(--bg-2));
  display: grid;
  place-items: end center;
  padding: 12px;
  font-family: var(--mono);
  font-size: 9px;
  color: var(--text-mute);
  text-transform: uppercase;
  letter-spacing: .8px;
  text-align: center;
}
.poster-progress {
  position: absolute; left: 0; right: 0; bottom: 0;
  height: 3px; background: rgba(0,0,0,.5);
}
.poster-progress .fill { height: 100%; background: var(--accent-2); }
.poster-title { font-size: 13px; margin-top: 8px; line-height: 1.3; color: var(--text); font-weight: 500; }
.poster-meta {
  font-size: 10.5px;
  color: var(--text-mute);
  margin-top: 3px;
  font-family: var(--mono);
  letter-spacing: .3px;
}

/* ── Status page ─────────────────────────────────────────────── */
.status-summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 36px;
}
.stat-card {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  position: relative;
  overflow: hidden;
}
.stat-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0;
  width: 30px; height: 2px;
  background: var(--text-mute);
}
.stat-card.up::before   { background: var(--green); }
.stat-card.warn::before { background: var(--amber); }
.stat-card .label {
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1.4px;
  color: var(--text-mute);
  margin-bottom: 10px;
}
.stat-card .num {
  font-family: var(--display);
  font-size: 38px;
  line-height: 1;
  font-weight: 500;
  letter-spacing: -.8px;
}
.stat-card .num-sub { font-family: var(--mono); font-size: 14px; color: var(--text-mute); margin-left: 2px; font-weight: 400; }
.stat-card .delta { font-size: 11.5px; color: var(--text-dim); margin-top: 8px; font-family: var(--mono); letter-spacing: .3px; }
.stat-card.up .num   { color: var(--green); }
.stat-card.down .num { color: var(--red); }

.status-group { margin-bottom: 28px; }
.status-list {
  list-style: none;
  margin: 0;
  padding: 0;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.status-item {
  display: grid;
  grid-template-columns: 16px 1.4fr 1fr 90px 110px;
  align-items: center;
  gap: 16px;
  padding: var(--pad-row) 20px;
  border-bottom: 1px solid var(--line);
}
.status-item:last-child { border-bottom: none; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-mute); position: relative; flex-shrink: 0; }
.status-dot.up          { background: var(--green); }
.status-dot.down        { background: var(--red); }
.status-dot.pending     { background: var(--amber); }
.status-dot.maintenance { background: var(--maint); }
.status-dot.unknown     { background: var(--text-mute); }
.status-dot.up::after {
  content: ""; position: absolute; inset: -4px; border-radius: 50%;
  border: 1.5px solid var(--green); opacity: .5;
  animation: pulse 2.4s ease-out infinite;
}
.status-dot.refreshed { animation: statusFlash .6s ease-out; }
@keyframes statusFlash {
  0%   { box-shadow: 0 0 0 0 rgba(93,127,176,.7); }
  100% { box-shadow: 0 0 0 8px rgba(93,127,176,0); }
}
.status-name { font-weight: 500; font-size: 14px; font-family: var(--mono); letter-spacing: -.2px; }
.status-name small {
  display: block; color: var(--text-mute); font-weight: 400; font-size: 10px;
  margin-top: 2px; font-family: var(--mono); text-transform: uppercase; letter-spacing: 1px;
}
.hb-strip { display: flex; gap: 2px; height: 22px; }
.hb { flex: 1; min-width: 3px; max-width: 6px; border-radius: 1.5px; background: var(--text-mute); opacity: .25; }
.hb.up          { background: var(--green); opacity: .85; }
.hb.down        { background: var(--red); opacity: 1; box-shadow: 0 0 0 1px rgba(196,97,89,.45); }
.hb.pending     { background: var(--amber); opacity: .85; }
.hb.maintenance { background: var(--maint); opacity: .85; }
.hb.unknown     { background: var(--text-mute); opacity: .4; }
.hb.empty       { background: transparent; border: 1px dashed var(--line); opacity: .4; }
.uptime-pct {
  font-variant-numeric: tabular-nums;
  font-family: var(--mono);
  color: var(--text);
  font-size: 13px;
  text-align: right;
}
.uptime-pct small { color: var(--text-mute); display: block; font-size: 9.5px; margin-top: 2px; text-transform: uppercase; letter-spacing: 1px; }
.ping {
  text-align: right;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
}
.ping small { color: var(--text-mute); display: block; font-size: 9.5px; margin-top: 2px; text-transform: uppercase; letter-spacing: 1px; }

/* ── Forms ───────────────────────────────────────────────────── */
.form-card {
  max-width: 540px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 30px 34px;
  position: relative;
}
.form-card::before {
  content: "";
  position: absolute;
  top: -1px; left: 24px;
  width: 60px; height: 2px;
  background: var(--accent);
}
.form-row { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.form-row label {
  font-size: 10.5px;
  font-weight: 500;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 1.2px;
  font-family: var(--mono);
}
.input, .select, .textarea {
  background: var(--bg);
  border: 1px solid var(--line);
  color: var(--text);
  padding: 11px 14px;
  border-radius: 7px;
  font-size: 14px;
  font-family: var(--sans);
  width: 100%;
  transition: border-color .15s, background .15s;
  appearance: auto;
}
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--bg-3);
}
.textarea { resize: vertical; min-height: 96px; font-family: var(--sans); }

/* ── FAQ accordion ───────────────────────────────────────────── */
.faq-list { display: flex; flex-direction: column; gap: 0; border-top: 1px solid var(--line); }
details.faq {
  border-bottom: 1px solid var(--line);
  padding: 0;
  transition: background .15s;
}
details.faq[open] { background: var(--bg-2); }
details.faq summary {
  list-style: none;
  cursor: pointer;
  padding: 18px 4px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 16px;
}
details.faq summary::-webkit-details-marker { display: none; }
details.faq .faq-num {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-mute);
  letter-spacing: 1px;
  width: 28px;
}
details.faq[open] .faq-num { color: var(--accent); }
details.faq .faq-q { font-weight: 500; font-size: 15px; }
details.faq .chev { color: var(--text-mute); transition: transform .2s ease; display: grid; place-items: center; }
details.faq[open] .chev { transform: rotate(90deg); color: var(--accent); }
details.faq .answer {
  padding: 0 4px 22px 48px;
  color: var(--text-dim);
  font-size: 14px;
  line-height: 1.65;
}
details.faq .answer a { color: var(--accent); text-decoration: none; border-bottom: 1px dotted var(--accent); }
details.faq .answer a:hover { border-bottom-style: solid; }
details.faq .answer p { margin: 0 0 10px; }
details.faq .answer p:last-child { margin: 0; }

/* ── Tutorial / doc pages ────────────────────────────────────── */
.doc { max-width: 760px; }
.doc h2 {
  font-family: var(--display);
  font-size: 26px;
  font-weight: 500;
  letter-spacing: -.4px;
  margin: 44px 0 12px;
  padding-top: 8px;
  border-top: 1px dashed var(--line);
  position: relative;
}
.doc h2::before {
  content: "";
  position: absolute;
  top: -1px; left: 0;
  width: 28px; height: 1px;
  background: var(--accent);
}
.doc p { color: var(--text-dim); font-size: 15px; line-height: 1.65; margin: 0 0 14px; }
.doc a { color: var(--accent); text-decoration: none; border-bottom: 1px dotted var(--accent); }
.doc a:hover { border-bottom-style: solid; }
.doc ul, .doc ol { padding-left: 20px; color: var(--text-dim); margin: 0 0 14px; }
.doc li { margin-bottom: 8px; line-height: 1.6; }
.doc strong { color: var(--text); font-weight: 500; }
.doc code, .doc kbd {
  background: var(--bg-3);
  border: 1px solid var(--line);
  padding: 2px 7px;
  border-radius: 5px;
  font-family: var(--mono);
  font-size: .85em;
  color: var(--accent);
}
.doc kbd { color: var(--text); }

.steps { counter-reset: step; padding: 0; list-style: none; margin: 18px 0; }
.steps li {
  counter-increment: step;
  position: relative;
  padding-left: 50px;
  margin-bottom: 16px;
  color: var(--text-dim);
}
.steps li::before {
  content: counter(step, decimal-leading-zero);
  position: absolute;
  left: 0; top: 0;
  color: var(--accent);
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 1px;
  border-bottom: 1px solid var(--accent);
  padding-bottom: 2px;
  width: 32px;
}
.steps li strong { color: var(--text); }

/* App download cards */
.app-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
}
.app-card {
  padding: var(--pad-card);
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  position: relative;
}
.app-card .platform {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: var(--text-mute);
  margin-bottom: 8px;
}
.app-card h4 {
  font-family: var(--display);
  font-size: 22px;
  font-weight: 500;
  margin: 0 0 14px;
  letter-spacing: -.3px;
}
.app-card .links { display: flex; flex-wrap: wrap; gap: 6px; }
.app-link {
  padding: 5px 11px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 4px;
  font-size: 12px;
  color: var(--text-dim);
  text-decoration: none;
  font-family: var(--mono);
  transition: border-color .15s, color .15s;
  letter-spacing: .3px;
}
.app-link:hover { color: var(--accent); border-color: var(--accent); }
.app-card .app-note { font-size: 13px; color: var(--text-mute); margin: 12px 0 0; }

.callout {
  margin-top: 18px;
  padding: 14px 18px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  border-left: 2px solid var(--accent);
  display: flex;
  gap: 12px;
  align-items: center;
  font-size: 13.5px;
  color: var(--text-dim);
}
.callout-warn {
  border-color: rgba(216,166,75,.35);
  border-left-color: var(--amber);
  background: rgba(216,166,75,.06);
}
.callout code {
  background: var(--bg-3);
  border: 1px solid var(--line);
  padding: 2px 7px;
  border-radius: 4px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--accent);
  margin-left: 4px;
}

/* ── Sign-in ─────────────────────────────────────────────────── */
.signin-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  background: var(--bg);
}
.signin-art {
  background: var(--bg);
  display: grid;
  place-items: center;
  padding: 40px;
  border-right: 1px solid var(--line);
  position: relative;
  overflow: hidden;
}
.signin-art::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 50% 100%, transparent 30%, rgba(201,126,78,.08) 30.5%, transparent 31%),
    radial-gradient(circle at 50% 100%, transparent 45%, rgba(201,126,78,.06) 45.5%, transparent 46%),
    radial-gradient(circle at 50% 100%, transparent 60%, rgba(201,126,78,.04) 60.5%, transparent 61%),
    radial-gradient(circle at 50% 100%, transparent 75%, rgba(201,126,78,.03) 75.5%, transparent 76%);
  background-size: 1200px 1200px;
  background-position: center bottom;
  background-repeat: no-repeat;
}
.signin-art::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.02) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse at center, #000 30%, transparent 75%);
}
.signin-quote {
  max-width: 420px;
  position: relative;
  z-index: 1;
}
.signin-quote h2 {
  font-family: var(--display);
  font-weight: 500;
  font-size: 48px;
  line-height: 1.05;
  letter-spacing: -1.2px;
  margin: 22px 0 16px;
}
.signin-quote h2 .muted { color: var(--text-dim); }
.signin-quote p { color: var(--text-dim); font-size: 15px; line-height: 1.6; margin: 0; }

.signin-form { display: grid; place-items: center; padding: 40px; }
.signin-form .form-card { width: 100%; max-width: 400px; margin: 0; }
.signin-title {
  font-family: var(--display);
  font-size: 40px;
  font-weight: 500;
  margin: 6px 0 6px;
  letter-spacing: -.8px;
}
.signin-lede { color: var(--text-dim); font-size: 14px; margin: 0 0 22px; }
.signin-foot {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px dashed var(--line);
  font-size: 12.5px;
  color: var(--text-mute);
  text-align: center;
}
.signin-foot a { color: var(--accent); text-decoration: none; font-weight: 500; }

/* ── Alerts ──────────────────────────────────────────────────── */
.alert {
  padding: 11px 14px;
  border-radius: 7px;
  font-size: 13px;
  margin-bottom: 16px;
  border: 1px solid;
  border-left-width: 3px;
  font-family: var(--mono);
  letter-spacing: .2px;
}
.alert.error { background: #2a1c1c; border-color: #5a2c2a; color: #e89a93; }
.alert.ok    { background: #1c2a1f; border-color: #2c5a35; color: #9adba6; }
.alert.warn  { background: #2a241c; border-color: #5a4a2c; color: #e8c279; }

/* ── Page transition ─────────────────────────────────────────── */
.page { animation: pageIn .3s ease-out; }
@keyframes pageIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Error page ──────────────────────────────────────────────── */
.error-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 40px;
}
.error-card {
  text-align: center;
  max-width: 400px;
}
.error-code {
  font-family: var(--display);
  font-size: 96px;
  font-weight: 500;
  color: var(--accent);
  line-height: 1;
  letter-spacing: -3px;
  margin: 0 0 16px;
}
.error-msg { color: var(--text-dim); font-size: 16px; margin: 0 0 24px; }

/* ── Admin stub ──────────────────────────────────────────────── */
.admin-stub {
  max-width: 600px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 30px 34px;
  color: var(--text-dim);
  font-size: 14px;
  line-height: 1.65;
}
.admin-stub a { color: var(--accent); }

/* ── Admin pages ─────────────────────────────────────────────── */
.admin-section { margin-bottom: 44px; }
.section-title {
  font-family: var(--display);
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -.3px;
  margin: 0 0 18px;
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}
.table-wrap {
  overflow-x: auto;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
.admin-table thead th {
  text-align: left;
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1.4px;
  color: var(--text-mute);
  padding: 14px 22px 12px;
  border-bottom: 1px solid var(--line);
  font-weight: 500;
  white-space: nowrap;
}
.admin-table tbody td {
  padding: 15px 22px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
  line-height: 1.45;
}
.admin-table tbody tr:last-child td { border-bottom: none; }
.admin-table tbody tr:hover td { background: var(--bg-3); }
.admin-table td.ts {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-dim);
  white-space: nowrap;
}
.admin-table td.reason-cell {
  max-width: 280px;
  color: var(--text-dim);
  font-size: 13px;
  white-space: pre-line;
  word-break: break-word;
}
.admin-table td.action-cell {
  width: 40px;
  padding: 10px 16px;
  text-align: right;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 3px 9px;
  border-radius: 4px;
  font-weight: 500;
  white-space: nowrap;
  border: 1px solid;
}
.badge-active  { background: var(--green-soft);           border-color: var(--green);          color: var(--green); }
.badge-used    { background: rgba(93,127,176,.10);        border-color: rgba(93,127,176,.35);  color: var(--accent); }
.badge-pending { background: rgba(216,166,75,.10);        border-color: var(--amber);          color: var(--amber); }
.badge-admin   { background: rgba(147,145,194,.10);       border-color: #4a4870;               color: #9a96c2; }
.badge-member  { background: rgba(201,126,78,.08);        border-color: rgba(201,126,78,.35);  color: var(--accent-2); }

/* Code chips */
.code-chip {
  display: inline-block;
  font-family: var(--mono);
  font-size: 12.5px;
  background: var(--bg);
  border: 1px solid var(--line);
  padding: 3px 9px;
  border-radius: 5px;
  color: var(--accent);
  letter-spacing: .5px;
  user-select: all;
}

/* Icon / delete button */
.btn-icon {
  display: inline-grid;
  place-items: center;
  width: 30px; height: 30px;
  background: none;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text-mute);
  cursor: pointer;
  transition: color .15s, border-color .15s, background .15s;
  flex-shrink: 0;
}
.btn-delete:hover {
  color: var(--red);
  border-color: rgba(196,97,89,.5);
  background: rgba(196,97,89,.08);
}

/* Action group (multiple buttons in one cell) */
.action-group {
  display: flex;
  align-items: center;
  gap: 5px;
  justify-content: flex-end;
}

/* Coloured action icon buttons */
.btn-action {
  display: inline-grid;
  place-items: center;
  width: 30px; height: 30px;
  background: none;
  border: 1px solid;
  border-radius: 6px;
  cursor: pointer;
  transition: filter .15s, background .15s;
  flex-shrink: 0;
}
.btn-approve {
  color: var(--green);
  border-color: rgba(111,143,94,.4);
  background: rgba(111,143,94,.08);
}
.btn-approve:hover { filter: brightness(1.2); background: rgba(111,143,94,.16); }

.btn-warn {
  color: var(--amber);
  border-color: rgba(216,166,75,.4);
  background: rgba(216,166,75,.08);
}
.btn-warn:hover { filter: brightness(1.15); background: rgba(216,166,75,.16); }

.btn-resolve {
  color: var(--accent);
  border-color: rgba(93,127,176,.4);
  background: rgba(93,127,176,.08);
}
.btn-resolve:hover { filter: brightness(1.15); background: rgba(93,127,176,.16); }

/* Approval result banner */
.approval-banner {
  background: var(--bg-2);
  border: 1px solid var(--green);
  border-left-width: 3px;
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-bottom: 32px;
  animation: pageIn .3s ease-out;
}
.approval-banner-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.approval-creds {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px 18px;
  margin-bottom: 12px;
}
.cred-row {
  display: flex;
  align-items: center;
  gap: 14px;
}
.cred-label {
  font-family: var(--mono);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--text-mute);
  width: 72px;
  flex-shrink: 0;
}
.cred-pw {
  font-size: 15px;
  letter-spacing: 1px;
  color: var(--text);
  user-select: all;
}
.approval-note {
  font-size: 12px;
  color: var(--text-mute);
  margin: 0;
  font-family: var(--mono);
  letter-spacing: .2px;
}

/* Empty state */
.empty-state {
  padding: 40px 20px;
  text-align: center;
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1.4px;
  color: var(--text-mute);
  background: var(--bg-2);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
}

/* Inline form row (admin_invites generate form) */
.form-row-inline {
  display: flex;
  gap: 14px;
  align-items: flex-end;
  flex-wrap: wrap;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 22px;
}
.form-row-inline .form-row { margin-bottom: 0; }

/* ── Mobile header (hidden on desktop) ───────────────────────── */
.mobile-header { display: none; }
.sidebar-backdrop { display: none; }
.hamburger { display: none; }

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 880px) {
  .app { grid-template-columns: 1fr; }

  .mobile-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    height: 58px;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 200;
    grid-column: 1 / -1;
  }
  .mobile-header .brand {
    padding: 0;
    border-bottom: none;
    margin-bottom: 0;
  }
  .hamburger {
    display: grid;
    place-items: center;
    background: none;
    border: 1px solid var(--line);
    color: var(--text-dim);
    cursor: pointer;
    padding: 7px;
    border-radius: 6px;
    flex-shrink: 0;
  }
  .hamburger:hover { color: var(--text); border-color: var(--line-strong); }

  .sidebar {
    position: fixed;
    top: 0; left: 0;
    height: 100vh;
    width: 280px;
    z-index: 300;
    transform: translateX(-100%);
    transition: transform .25s ease;
  }
  .sidebar.is-open { transform: translateX(0); }

  .sidebar-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.55);
    z-index: 250;
  }
  .sidebar-backdrop.is-open { display: block; }

  .bento { grid-template-columns: 1fr; }
  .status-summary { grid-template-columns: repeat(2, 1fr); }
  .status-item { grid-template-columns: 12px 1fr auto; gap: 10px; }
  .status-item .hb-strip, .status-item .ping { display: none; }
  .signin-shell { grid-template-columns: 1fr; }
  .signin-art { display: none; }
}
