:root {
  --bg: #f4f6fb;
  --ink: #1b1f2a;
  --muted: #5c6578;
  --line: #d8deea;
  --card: #ffffff;
  --accent: #3e56aa;
  --accent-2: #2a3d86;
  --who-bg: #0e1218;
  --who-ink: #d7e0ea;
  --who-dim: #7d8b9a;
  --who-card: #161c24;
  --ok: #3dcf8e;
  --warn: #e0b34a;
  --err: #e06b6b;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Segoe UI", system-ui, sans-serif;
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
}

.wrap { width: min(1080px, calc(100% - 40px)); margin: 0 auto; }
.top {
  background: #fff;
  border-bottom: 1px solid var(--line);
}
.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 76px;
}
.brand img { height: 42px; width: auto; display: block; }
nav { display: flex; gap: 18px; flex-wrap: wrap; }
nav a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
}
nav a.on, nav a:hover { color: var(--accent); }

.hero { padding: 48px 0 28px; }
.kicker {
  text-transform: uppercase;
  letter-spacing: .12em;
  font-size: 12px;
  color: var(--accent);
  margin: 0 0 8px;
  font-weight: 700;
}
h1 { font-size: clamp(32px, 4vw, 46px); margin: 0 0 12px; letter-spacing: -0.03em; }
h2 { margin: 0 0 8px; font-size: 24px; }
.lead { max-width: 62ch; color: var(--muted); font-size: 18px; line-height: 1.5; }

.cloud-card, .empty {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
}
.cloud-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
  padding: 28px;
  margin-bottom: 40px;
  background:
    linear-gradient(135deg, #eef2fb 0%, #fff 55%),
    var(--card);
}
.cloud-meta { display: flex; flex-direction: column; gap: 8px; justify-content: center; }
.cloud-meta span, .pill, .meta span {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  color: var(--muted);
  width: fit-content;
}
.btn {
  display: inline-block;
  margin-top: 16px;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  padding: 11px 18px;
  border-radius: 10px;
}
.btn:hover { background: var(--accent-2); }
.btn.ghost {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
  margin-top: 0;
  align-self: center;
}

.section-head { margin-bottom: 10px; }
.section-head p { margin: 0; color: var(--muted); font-size: 14px; }

.table-wrap {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: auto;
  margin-bottom: 8px;
}
table.files {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  line-height: 1.25;
}
table.files th,
table.files td {
  padding: 5px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
  vertical-align: middle;
}
table.files th {
  background: #eef1f8;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  position: sticky;
  top: 0;
}
table.files tbody tr:nth-child(even) { background: #f7f8fc; }
table.files tbody tr:hover { background: #eef2fb; }
table.files tbody tr:last-child td { border-bottom: 0; }
table.files td.name {
  width: 100%;
  max-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 600;
}
table.files td.num {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
table.files td.act { text-align: right; width: 1%; padding: 4px 8px; }
table.files td.act a.dl {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  box-shadow: 0 1px 2px rgba(62, 86, 170, .25);
  transition: background .12s ease, transform .12s ease;
}
table.files td.act a.dl svg {
  width: 16px;
  height: 16px;
  display: block;
}
table.files td.act a.dl:hover {
  background: var(--accent-2);
  transform: translateY(-1px);
}
table.files td.act a.dl:active { transform: translateY(0); }

.empty { padding: 28px; color: var(--muted); }
.foot {
  display: flex; justify-content: space-between; gap: 12px;
  padding: 40px 0 28px; color: var(--muted); font-size: 13px;
}
.foot a { color: var(--muted); }

body.who {
  background: var(--who-bg);
  color: var(--who-ink);
  padding: 24px;
}
.who-top, .who-tools { display: flex; gap: 16px; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; }
.who h1 { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 28px; }
.who .kicker { color: #8aa4ff; }
.who-note { color: var(--who-dim); font-size: 13px; }
.who-note code { color: #c9d4ff; }
.who-tools input {
  background: #11161d;
  border: 1px solid #2a3441;
  color: var(--who-ink);
  border-radius: 8px;
  padding: 8px 12px;
  min-width: min(360px, 100%);
  font: 13px ui-monospace, Menlo, Consolas, monospace;
}
.who .pill { border-color: #2a3441; color: var(--who-ink); background: #11161d; text-decoration: none; }
.who a.pill:hover { border-color: #8aa4ff; color: #8aa4ff; }
.who .pill.live { color: var(--ok); border-color: #245c42; }
.log { display: grid; gap: 12px; margin-top: 18px; }
.trace {
  background: var(--who-card);
  border: 1px solid #232c37;
  border-radius: 12px;
  padding: 14px 16px;
}
.trace header { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13px; }
.trace strong { color: #fff; font-size: 15px; }
.trace time, .dim { color: var(--who-dim); }
.trace .ua { color: var(--who-dim); font-size: 12px; margin: 8px 0; word-break: break-all; }
.trace pre {
  margin: 0;
  overflow: auto;
  background: #0b0f14;
  padding: 12px;
  border-radius: 8px;
  color: #b6f0c8;
  font: 12.5px/1.45 ui-monospace, Menlo, Consolas, monospace;
}
details.hostinfo {
  margin: 8px 0;
  border: 1px solid #232c37;
  border-radius: 8px;
  background: #11161d;
}
details.hostinfo summary {
  cursor: pointer;
  padding: 7px 10px;
  color: #8aa4ff;
  font-size: 12px;
  font-weight: 700;
}
details.hostinfo table {
  width: 100%;
  border-collapse: collapse;
  font: 12px/1.35 ui-monospace, Menlo, Consolas, monospace;
}
details.hostinfo th {
  text-align: left;
  color: var(--who-dim);
  font-weight: 500;
  padding: 3px 10px;
  width: 34%;
  vertical-align: top;
}
details.hostinfo td {
  color: #d7e0ea;
  padding: 3px 10px 3px 0;
  word-break: break-word;
}
details.hostinfo tr:nth-child(even) td,
details.hostinfo tr:nth-child(even) th { background: #0e1319; }
.status-cached .pill, .status-ignored .pill, .status-busy .pill { color: var(--warn); }
.status-error .pill, .status-empty .pill { color: var(--err); }
.status-ok .pill { color: var(--ok); }

@media (max-width: 720px) {
  .bar, .cloud-card { grid-template-columns: 1fr; display: grid; }
  nav { padding-bottom: 14px; }
  table.files th:nth-child(3),
  table.files td.num:nth-child(3) { display: none; }
  table.files td.name { max-width: 180px; white-space: nowrap; }
}
