:root {
  color-scheme: dark;
  --bg: #0d1117;
  --panel: #161b22;
  --panel-soft: #10161e;
  --line: #30363d;
  --text: #e6edf3;
  --muted: #8b949e;
  --blue: #58a6ff;
  --blue-deep: #1f6feb;
  --green: #3fb950;
  --red: #f85149;
  --yellow: #d29922;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.45 system-ui, -apple-system, sans-serif; }
.topbar { display: flex; align-items: center; gap: 28px; padding: 12px 24px; border-bottom: 1px solid var(--line); background: #010409; position: sticky; top: 0; z-index: 20; }
.topbar strong { font-size: 18px; margin-right: 9px; }
.topbar span, .muted, small { color: var(--muted); }
nav { display: flex; gap: 16px; margin-left: auto; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
main { max-width: 1280px; margin: auto; padding: 20px; }
h1 { font-size: 28px; }
h2 { font-size: 19px; }
h3 { font-size: 15px; }
p { margin: 7px 0 12px; }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 18px; margin: 0 0 16px; }
.login { max-width: 460px; margin: 8vh auto; }
.title-row, .section-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 18px; }
.title-row h1, .title-row h2, .section-heading h2 { margin: 0 0 4px; }
.page-heading { margin-bottom: 16px; align-items: center; }
.eyebrow { display: block; color: var(--blue); text-transform: uppercase; letter-spacing: .08em; font-size: 11px; font-weight: 750; margin-bottom: 3px; }

.metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 14px 0 16px; }
.metrics > div { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 13px 15px; }
.metrics > div.attention { border-color: #6d4f20; }
.metrics b { font-size: 24px; display: block; }
.metrics span { color: var(--muted); }
.grid { display: grid; gap: 14px; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }

form { display: grid; gap: 10px; }
form.inline { display: block; }
form.compact { border-top: 1px solid var(--line); padding-top: 12px; margin-top: 12px; }
label { display: grid; gap: 5px; color: #c9d1d9; }
label.check { display: flex; align-items: center; gap: 8px; }
label.check input { width: auto; }
input, textarea, select, button, .button { font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; width: 100%; }
textarea { resize: vertical; }
button, .button { display: inline-block; text-align: center; background: var(--blue-deep); border-color: #388bfd; font-weight: 650; cursor: pointer; }
.button { width: auto; }
.button.secondary { background: transparent; }
button.link { background: none; border: 0; color: var(--blue); padding: 0; }
.danger button { background: #8e1519; border-color: var(--red); }

.table-wrap { overflow: auto; }
table { border-collapse: collapse; width: 100%; }
th, td { text-align: left; padding: 9px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-size: 11px; text-transform: uppercase; }
td small { display: block; margin-top: 4px; }
.row-title { font-weight: 700; }
.installations-table td:first-child { min-width: 210px; }

.badge { display: inline-block; padding: 3px 8px; border: 1px solid var(--line); border-radius: 999px; white-space: nowrap; }
.badge.good { color: var(--green); border-color: #2d693a; }
.badge.bad { color: var(--red); border-color: #7c3430; }
.badge.warn { color: var(--yellow); border-color: #715525; }
.badge.info { color: var(--blue); border-color: #315b82; }
.good { color: var(--green); }
.bad, .err { color: var(--red); }
.warn { color: var(--yellow); }
.flash { padding: 11px 13px; border: 1px solid currentColor; border-radius: 7px; margin: 0 0 16px; }
.flash.ok { color: var(--green); }
.flash.info { color: var(--blue); }

.quick-start { border-color: #315b82; background: linear-gradient(135deg, #121d2a, var(--panel) 55%); }
.steps { counter-reset: steps; padding: 0; margin: 14px 0; list-style: none; display: grid; gap: 9px; }
.compact-steps { grid-template-columns: repeat(4, 1fr); }
.steps li { position: relative; min-height: 64px; padding: 10px 10px 10px 40px; background: var(--panel-soft); border: 1px solid var(--line); border-radius: 8px; }
.steps li::before { counter-increment: steps; content: counter(steps); position: absolute; left: 10px; top: 10px; width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; background: var(--blue-deep); font-weight: 800; }
.steps li span { display: block; color: var(--muted); margin-top: 3px; font-size: 12px; }
.steps.detailed li { padding: 13px 14px 13px 48px; }
.steps.detailed li::before { left: 13px; top: 13px; }
.steps.detailed p { color: var(--muted); margin: 3px 0 0; }
.callout, .next-action { border-left: 3px solid var(--blue); background: #101a26; border-radius: 4px; padding: 10px 12px; }

.step-number { display: inline-grid; place-items: center; width: 24px; height: 24px; margin-right: 8px; border-radius: 50%; background: var(--blue-deep); font-weight: 800; float: left; }
.help-card { background: var(--panel-soft); }
.plain-list, .simple-flow { padding-left: 20px; }
.unfinished { border-top: 1px solid var(--line); margin-top: 14px; padding-top: 8px; }

.help-tip { display: inline-grid; place-items: center; position: relative; width: 18px; height: 18px; border: 1px solid #49647e; border-radius: 50%; color: var(--blue); font-size: 11px; cursor: help; vertical-align: middle; }
.help-tip::after { content: attr(data-tip); display: none; position: absolute; z-index: 30; left: 24px; top: -8px; width: 280px; padding: 9px 11px; border: 1px solid #49647e; border-radius: 7px; color: var(--text); background: #0b1118; box-shadow: 0 8px 24px #0008; font-weight: 400; line-height: 1.4; }
.help-tip:hover::after, .help-tip:focus::after { display: block; }

details.advanced, details.technical, details.renew-panel { overflow: visible; }
details > summary { cursor: pointer; }
details.advanced > summary { display: flex; justify-content: space-between; gap: 16px; }
details.advanced > summary span { color: var(--muted); font-size: 12px; }
.advanced-body { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 14px; }
details.technical { margin: 10px 0; }
details.technical > summary { color: var(--muted); }

.workflow-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; padding: 0; list-style: none; }
.workflow-row li { display: flex; align-items: center; gap: 8px; padding: 9px; border: 1px solid var(--line); border-radius: 7px; color: var(--muted); }
.workflow-row li b { width: 24px; height: 24px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; }
.workflow-row li.done { color: var(--green); border-color: #2d693a; }
.workflow-row li.current { color: var(--blue); border-color: #315b82; }
.next-action { margin-top: 12px; }
.status-note { color: var(--muted); }
.action-grid { display: grid; grid-template-columns: .8fr 1.4fr .8fr; gap: 12px; margin: 15px 0; }
.action-card { display: flex; flex-direction: column; gap: 8px; padding: 13px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel-soft); }
.action-card p { color: var(--muted); margin: 0; }
.action-card .button { margin-top: auto; }
.renew-panel { border-top: 1px solid var(--line); padding-top: 12px; margin-top: 12px; }

.glossary { display: grid; grid-template-columns: 190px 1fr; gap: 8px 18px; margin: 0; }
.glossary dt { font-weight: 750; }
.glossary dd { margin: 0; color: var(--muted); }
code, pre { font: 12px/1.5 ui-monospace, SFMono-Regular, monospace; }
pre { overflow: auto; white-space: pre-wrap; }
.break { word-break: break-all; }
.empty { text-align: center; color: var(--muted); }
ul.keys { padding-left: 18px; }

@media (max-width: 980px) {
  .compact-steps, .action-grid { grid-template-columns: repeat(2, 1fr); }
  .workflow-row { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 800px) {
  .grid.two, .metrics, .compact-steps, .action-grid, .workflow-row { grid-template-columns: 1fr; }
  .topbar { flex-wrap: wrap; gap: 12px; }
  nav { margin-left: 0; order: 3; width: 100%; }
  main { padding: 13px; }
  .title-row { align-items: flex-start; }
  .page-heading { flex-direction: column; }
  .glossary { grid-template-columns: 1fr; gap: 2px; }
  .glossary dd { margin-bottom: 9px; }
  .help-tip::after { left: auto; right: 0; top: 24px; width: min(280px, 75vw); }
}
