:root {
  --bg: #020617;
  --card: #0f172a;
  --card2: #0b1222;
  --text: #e2e8f0;
  --muted: #94a3b8;
  --ring: rgba(148, 163, 184, 0.18);
  --ringStrong: rgba(56, 189, 248, 0.55);
  --dangerBg: rgba(127, 29, 29, 0.35);
  --dangerText: #fecaca;
  --warnBg: rgba(120, 53, 15, 0.25);
  --warnText: #fde68a;
  --btn: #0b1222;
  --btnText: #e2e8f0;
  --primary: #0284c7;
  --primaryText: #ffffff;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji",
    "Segoe UI Emoji";
  color: var(--text);
  -webkit-tap-highlight-color: transparent;
}

.bg { background: var(--bg); }

.container {
  width: 100%;
  max-width: 28rem;
  margin: 0 auto;
  padding: 1rem 0.75rem 2.5rem;
}

.row { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; }
.stack { display: grid; gap: 0.75rem; }
.stack-lg { display: grid; gap: 1rem; }
.grid { display: grid; gap: 1rem; }

@media (min-width: 640px) {
  .container {
    max-width: 48rem;
    padding: 1.5rem 1rem 3rem;
  }
}

@media (min-width: 1024px) {
  .container {
    max-width: 72rem;
    padding: 2rem 1.25rem 4rem;
  }
  .grid-2 {
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }
  .grid-auto {
    grid-template-columns: repeat(auto-fit, minmax(22rem, 1fr));
    align-items: start;
  }
}

.title { font-size: 1.25rem; font-weight: 700; letter-spacing: -0.01em; }
.muted { color: var(--muted); font-size: 0.875rem; margin: 0.25rem 0 0; }

.pill {
  display: inline-flex;
  width: fit-content;
  padding: 0.25rem 0.5rem;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.12);
  color: var(--text);
  font-size: 0.75rem;
}

.card {
  background: var(--card);
  border-radius: 1rem;
  padding: 1rem;
  box-shadow: 0 0 0 1px var(--ring);
}

.card-flat {
  background: var(--card);
  border-radius: 0.875rem;
  padding: 0.75rem;
  box-shadow: 0 0 0 1px var(--ring);
}

.banner {
  border-radius: 0.875rem;
  padding: 0.625rem 0.75rem;
  box-shadow: 0 0 0 1px var(--ring);
  font-size: 0.875rem;
}

.banner.warn { background: var(--warnBg); color: var(--warnText); box-shadow: 0 0 0 1px rgba(245, 158, 11, 0.18); }
.banner.danger { background: var(--dangerBg); color: var(--dangerText); box-shadow: 0 0 0 1px rgba(244, 63, 94, 0.18); }

.btn {
  appearance: none;
  border: 0;
  cursor: pointer;
  background: var(--btn);
  color: var(--btnText);
  border-radius: 0.875rem;
  padding: 0.75rem 0.85rem;
  box-shadow: 0 0 0 1px var(--ring);
  font-weight: 650;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  user-select: none;
}

.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--primary); color: var(--primaryText); box-shadow: none; }
.btn.full { width: 100%; }
.btn.small { padding: 0.5rem 0.7rem; border-radius: 0.75rem; font-size: 0.875rem; }

.link { color: #7dd3fc; text-decoration: none; }
.link:hover { text-decoration: underline; }

.section-link {
  color: inherit;
  text-decoration: none;
}
.section-link:hover .title {
  text-decoration: underline;
  text-decoration-color: rgba(125, 211, 252, 0.7);
  text-underline-offset: 3px;
}

.tile {
  display: grid;
  gap: 0.75rem;
}

.tile-link {
  display: grid;
  gap: 0.75rem;
  text-decoration: none;
  color: inherit;
}

.tile-card {
  background: var(--card);
  border-radius: 1rem;
  padding: 1rem;
  box-shadow: 0 0 0 1px var(--ring);
  display: grid;
  place-items: center;
  text-align: center;
  gap: 0.85rem;
  min-height: 10.5rem;
}

.tile-title {
  font-size: 1.05rem;
  font-weight: 750;
  letter-spacing: -0.01em;
}

.tile-icon {
  width: 76px;
  height: 76px;
  display: block;
}

.tile-icon .stroke {
  stroke: rgba(226, 232, 240, 0.85);
  stroke-width: 2.5;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.tile-icon .fill {
  fill: rgba(125, 211, 252, 0.12);
  stroke: rgba(125, 211, 252, 0.55);
  stroke-width: 2;
}

.tile-link:hover .tile-card {
  box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.35), 0 0 0 4px rgba(56, 189, 248, 0.08);
}

.list { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.5rem; }
.list-item { text-decoration: none; color: inherit; }

.li-title { font-size: 1rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.li-sub { font-size: 0.875rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

label { display: grid; gap: 0.35rem; }
.field-label { font-size: 0.875rem; color: var(--text); }
.input, .textarea, .select {
  width: 100%;
  background: var(--card2);
  color: var(--text);
  border: 0;
  border-radius: 0.875rem;
  padding: 0.85rem;
  box-shadow: 0 0 0 1px var(--ring);
  outline: none;
  font-size: 1rem;
}

.textarea { resize: none; }

.input:focus, .textarea:focus, .select:focus {
  box-shadow: 0 0 0 2px var(--ringStrong);
}

.hr {
  height: 1px;
  background: rgba(148, 163, 184, 0.16);
  margin: 0.25rem 0;
  border-radius: 999px;
}

.tiny { font-size: 0.75rem; color: var(--muted); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; }

.diagram {
  background: var(--card2);
  border-radius: 1rem;
  padding: 0.75rem;
  box-shadow: 0 0 0 1px var(--ring);
  overflow: hidden;
}
.diagram svg, .diagram img {
  width: 100%;
  height: auto;
  display: block;
}

details > summary::-webkit-details-marker { display: none; }
details > summary { list-style: none; }
details[open] > summary .muted { transform: rotate(45deg); }

.table-wrap {
  width: 100%;
  overflow-x: auto;
  border-radius: 0.875rem;
  box-shadow: 0 0 0 1px var(--ring);
}
.table {
  width: 100%;
  min-width: 36rem;
  border-collapse: collapse;
  background: rgba(2, 6, 23, 0.15);
}
.table th, .table td {
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.16);
  text-align: left;
  vertical-align: top;
  font-size: 0.9rem;
}
.table th {
  color: var(--text);
  font-weight: 700;
  background: rgba(2, 6, 23, 0.22);
}
.table td {
  color: var(--muted);
}
.table tr:last-child td { border-bottom: 0; }

