:root {
  color-scheme: light;
  --bg: #f3f5f4;
  --surface: #ffffff;
  --surface-2: #eef1ef;
  --ink: #1c2430;
  --muted: #5c6b73;
  --line: #e2e8e4;
  --line-strong: #c9d5cf;
  --accent: #2f5d62;
  --accent-ink: #ffffff;
  --danger: #b4234a;
  --warn: #a16207;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 8px 24px rgba(28, 36, 48, 0.06);
  font-family: "Segoe UI", ui-sans-serif, -apple-system, BlinkMacSystemFont, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(900px 420px at 100% -10%, rgba(47, 93, 98, 0.08), transparent 55%),
    var(--bg);
  color: var(--ink);
}

.page {
  width: min(1100px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 64px;
}

h1, h2, h3, .brand { font-weight: 640; letter-spacing: -0.03em; }
h1 { font-size: clamp(2rem, 4vw, 2.8rem); line-height: 1.08; margin: 0 0 8px; }
h2 { font-size: 1.25rem; margin: 0; }
p { line-height: 1.5; }

a { color: var(--accent); }
a:hover { color: #1e3f42; }

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 0.74rem;
  font-weight: 650;
}

.lede, .hint, .empty, .item-meta { color: var(--muted); }
.hint { margin-top: -6px; }

.top {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 28px;
}

.brand {
  color: var(--ink);
  text-decoration: none;
  font-size: 1.25rem;
}

nav { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
nav form { margin: 0; }

.as-link, .ghost {
  background: transparent;
  color: var(--accent);
  border: 0;
  padding: 0;
  font: inherit;
  cursor: pointer;
}

button, .danger { font: inherit; }

button[type="submit"], .page > main a.button {
  background: var(--accent);
  color: var(--accent-ink);
  border: 0;
  border-radius: 999px;
  padding: 12px 18px;
  cursor: pointer;
  font-weight: 650;
}

button.danger {
  background: transparent;
  color: var(--danger);
  border: 1px solid #efc3d0;
}

button.ghost {
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 8px 12px;
  background: var(--surface);
}

.auth {
  width: min(460px, 100%);
  margin: 8vh auto 0;
  padding: 32px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
}

.stack { display: grid; gap: 14px; }
label, .field-label { color: var(--muted); font-size: 0.92rem; }
label { display: grid; gap: 6px; }
.inline { display: flex; gap: 8px; align-items: center; }
.inline input { flex: 1; }

input, textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
}

textarea { min-height: 96px; resize: vertical; }
textarea.code {
  min-height: 220px;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 0.92rem;
}
.notes { white-space: pre-wrap; }

input:focus, textarea:focus, button:focus-visible, a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.banner {
  margin: 0 0 16px;
  padding: 12px 14px;
  border-radius: 12px;
  background: #e7f0ee;
  color: #1e3f42;
}
.banner.danger { background: #fde8ee; color: #8d1736; }
.banner.warn { background: #f8f1de; color: var(--warn); }

.filter { margin: 20px 0 8px; }
section { margin-top: 28px; }
.plane { margin-top: 36px; }
.parent-label {
  margin: 22px 0 8px;
  color: var(--muted);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 0.75rem;
  font-weight: 650;
}
.cluster {
  margin-top: 12px;
  padding: 16px 16px 8px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.cluster h3 { margin: 0 0 12px; font-size: 1.25rem; }
.cluster h4 { margin: 0; font-size: 1rem; }
.cluster-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; }

.items { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.item a {
  display: grid;
  gap: 4px;
  padding: 14px 16px;
  text-decoration: none;
  color: inherit;
  background: var(--surface-2);
  border: 1px solid transparent;
  border-radius: 14px;
}
.item a:hover { border-color: var(--accent); background: #fff; }
.item-title { font-size: 1.02rem; font-weight: 640; }
.pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  background: #e7f0ee;
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 650;
}

.types {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 0;
  padding: 0;
  border: 0;
}
.types legend {
  grid-column: 1 / -1;
  padding: 0;
  color: var(--ink);
  font-weight: 650;
}
.type-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: start;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  color: var(--ink);
}
.type-card:has(input:checked) {
  border-color: var(--accent);
  background: #f4faf8;
}
.type-card strong, .type-card small { display: block; }
.type-card small { color: var(--muted); font-size: 0.82rem; line-height: 1.35; }
.type-card input { width: auto; margin-top: 3px; }

.facts { margin: 20px 0; display: grid; gap: 14px; }
.facts div {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
}
dt { color: var(--muted); font-size: 0.8rem; letter-spacing: 0.04em; text-transform: uppercase; }
dd { margin: 0; }
.secret {
  display: inline;
  white-space: pre-wrap;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  background: var(--surface-2);
  padding: 8px 10px;
  border-radius: 10px;
}

.actions { margin-top: 22px; }
.danger-zone {
  margin-top: 36px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.narrow { max-width: 720px; }

@media (max-width: 680px) {
  .top { align-items: flex-start; flex-direction: column; }
  .cluster-grid, .types { grid-template-columns: 1fr; }
  .auth { margin-top: 24px; padding: 22px; }
  .inline { flex-direction: column; align-items: stretch; }
}
