:root {
  --bg: #f3f6f8;
  --panel: #ffffff;
  --ink: #14212b;
  --muted: #5d6b76;
  --line: #e2e8ee;
  --sidebar: #102029;
  --sidebar-ink: #d5e2ea;
  --accent: #0f766e;
  --accent-2: #115e59;
  --danger: #9f1239;
  --warn: #92400e;
  --ok: #166534;
  --shadow: 0 10px 30px rgba(16, 32, 41, 0.06);
  --radius: 14px;
  font-family: "Segoe UI", "Avenir Next", "Trebuchet MS", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); }
a { color: var(--accent-2); }
button, .button {
  background: var(--accent); color: white; border: 0; border-radius: 10px;
  padding: 0.7rem 1rem; font: inherit; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: 0.4rem;
}
button.secondary, .button.secondary { background: #e8eef2; color: var(--ink); }
button.danger, .button.danger { background: var(--danger); }
button.small, .button.small { padding: 0.35rem 0.6rem; font-size: 0.85rem; }
input, select, textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 0.7rem 0.8rem; font: inherit; background: white;
}
textarea { min-height: 6rem; }
label { display: grid; gap: 0.35rem; font-size: 0.92rem; }
label.check { display: flex; align-items: center; gap: 0.5rem; }
label.check input { width: auto; }
.app { display: grid; grid-template-columns: 220px minmax(0, 1fr); min-height: 100vh; }
.sidebar { background: var(--sidebar); color: var(--sidebar-ink); padding: 1.25rem 1rem; display: flex; flex-direction: column; gap: 1rem; min-height: 100vh; }
.brand { font-weight: 700; letter-spacing: 0.02em; color: white; text-decoration: none; font-size: 1.15rem; }
.nav { display: flex; flex-direction: column; gap: 0.2rem; }
.nav a { color: var(--sidebar-ink); text-decoration: none; display: block; padding: 0.55rem 0.7rem; border-radius: 8px; }
details.more { margin-top: 1rem; }
details.more summary { cursor: pointer; font-weight: 650; }
details.more .stack, details.more .actions { margin-top: 0.8rem; }
.simple-form { max-width: 40rem; }
fieldset.domain-picks { border: 1px solid var(--line); border-radius: 10px; }
.nav a:hover, .nav a.active { background: rgba(255,255,255,0.08); color: white; }
.sidebar form { margin-top: auto; }
.main { padding: 1.5rem; }
.topbar { display: flex; justify-content: space-between; gap: 1rem; align-items: center; margin-bottom: 1rem; }
h1 { font-size: 1.6rem; margin: 0; }
h2 { font-size: 1.1rem; margin: 0 0 0.8rem; }
.muted, .eyebrow { color: var(--muted); }
.eyebrow { text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.75rem; margin: 0; }
.cards { display: grid; grid-template-columns: repeat(6, 1fr); gap: 0.8rem; margin: 1rem 0; }
.card, .panel { background: var(--panel); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1rem; }
.card span { display: block; color: var(--muted); font-size: 0.8rem; }
.card strong { font-size: 1.4rem; }
.filters, .row, .actions { display: flex; gap: 0.6rem; flex-wrap: wrap; align-items: end; }
.filters input, .filters select { width: auto; min-width: 10rem; }
table { width: 100%; border-collapse: collapse; background: white; border-radius: var(--radius); overflow: hidden; }
th, td { text-align: left; padding: 0.75rem; border-bottom: 1px solid var(--line); vertical-align: top; font-size: 0.92rem; }
th { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
.pill { display: inline-block; border-radius: 999px; padding: 0.15rem 0.55rem; background: #e8eef2; font-size: 0.78rem; }
.pill.ok { background: #dcfce7; color: var(--ok); }
.pill.warn { background: #fef3c7; color: var(--warn); }
.pill.bad { background: #ffe4e6; color: var(--danger); }
.stack { display: grid; gap: 0.8rem; }
.grid-2 { display: grid; grid-template-columns: 1.4fr 0.8fr; gap: 1rem; }
.alert { padding: 0.8rem 1rem; border-radius: 10px; margin: 0.8rem 0; }
.alert.success { background: #dcfce7; }
.alert.error { background: #ffe4e6; }
.auth-body { min-height: 100vh; display: grid; place-items: center; padding: 1rem; }
.auth-card { width: min(520px, 100%); background: white; padding: 1.5rem; border-radius: 18px; box-shadow: var(--shadow); }
.installer { width: min(760px, 100%); }
.check-list { padding-left: 1.1rem; }
.check-list .ok { color: var(--ok); }
.check-list .bad { color: var(--danger); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.85rem; word-break: break-all; }
.preview { background: #f8fafc; border: 1px dashed var(--line); border-radius: 10px; padding: 0.8rem; }
.bars { display: flex; align-items: end; gap: 4px; height: 80px; }
.bars span { flex: 1; background: var(--accent); border-radius: 4px 4px 0 0; min-height: 2px; }
.public-page { min-height: 100vh; display: grid; place-items: center; padding: 1.5rem; background: radial-gradient(circle at top, #e7f3f1, var(--bg) 42%); }
.public-card { width: min(440px, 100%); background: white; padding: 2rem; border-radius: 18px; box-shadow: var(--shadow); text-align: center; }
.download-card h1 { font-size: 1.35rem; margin: 0.4rem 0; word-break: break-word; }
.file-mark { display: inline-block; margin: 0; padding: 0.35rem 0.7rem; border-radius: 8px; background: #ccfbf1; color: var(--accent-2); font-weight: 700; letter-spacing: 0.08em; font-size: 0.78rem; }
.download-button { justify-content: center; width: 100%; margin-top: 0.4rem; padding: 0.9rem 1rem; font-weight: 650; }
.fine { color: var(--muted); font-size: 0.85rem; margin: 1rem 0 0; }
.link-form { max-width: 46rem; }
.preview-label { margin: 0.2rem 0 0; font-weight: 650; }
.preview-lg { padding: 1rem 1.1rem; background: #102029; color: #ecfeff; border: 0; }
.preview-lg .mono { color: #ecfeff; font-size: 1rem; }
.choice-row { border: 0; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 0.7rem; }
.choice-row legend { font-weight: 650; margin-bottom: 0.35rem; }
.choice { border: 1px solid var(--line); border-radius: 12px; padding: 0.85rem 1rem; background: white; }
.choice:has(input:checked) { border-color: var(--accent); background: #f0fdfa; }
.drop { border: 1px dashed #94a3b8; border-radius: 12px; padding: 1rem; background: #f8fafc; }
.drop input { margin-bottom: 0.45rem; }
.logo { max-height: 48px; }
.domain-page { display: grid; gap: 1rem; }
.domain-hero { display: flex; justify-content: space-between; gap: 1rem; align-items: flex-start; }
.domain-pills { display: flex; gap: 0.4rem; flex-wrap: wrap; margin: 0.7rem 0 0; }
.domain-board { display: grid; gap: 1rem; }
.domain-cards { display: grid; gap: 0.9rem; }
.domain-card-head { display: flex; justify-content: space-between; gap: 1rem; align-items: flex-start; }
.domain-card h2 { margin: 0.15rem 0; font-size: 1.45rem; }
.domain-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.7rem; margin: 0.9rem 0; }
.domain-metrics div { background: #f4f7f8; border-radius: 12px; padding: 0.75rem 0.85rem; }
.domain-metrics span { display: block; color: var(--muted); font-size: 0.72rem; letter-spacing: 0.05em; text-transform: uppercase; }
.domain-metrics strong { font-size: 1.05rem; word-break: break-word; }
input[readonly] { background: #f4f7f8; color: var(--ink); }
.group-layout { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: 1rem; align-items: start; }
.group-row { display: flex; justify-content: space-between; gap: 0.8rem; align-items: center; padding: 0.7rem 0; border-bottom: 1px solid var(--line); }
.domain-stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0.8rem; }
.domain-stats .card strong { font-size: 1.15rem; }
.domain-layout { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(16rem, 0.8fr); gap: 1rem; align-items: start; }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.8rem; }
.check-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.55rem 1rem; }
.record-table td { font-size: 0.88rem; vertical-align: top; }
.record-table td.mono { word-break: break-all; }
@media (max-width: 1100px) {
  .domain-layout, .field-grid, .check-row, .domain-stats, .domain-metrics, .group-layout { grid-template-columns: 1fr; }
  .domain-hero, .domain-card-head { flex-direction: column; }
}
@media (max-width: 1100px) {
  .cards { grid-template-columns: repeat(3, 1fr); }
  .grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
  .choice-row { grid-template-columns: 1fr; }
}
@media (max-width: 800px) {
  .app { grid-template-columns: 168px minmax(0, 1fr); }
  .sidebar { padding: 1rem 0.6rem; }
  .cards { grid-template-columns: repeat(2, 1fr); }
  table { display: block; overflow-x: auto; }
}
