:root {
  --bg: #f6f7f9;
  --card: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --line: #e5e7eb;
  --accent: #2563eb;
  --accent-dark: #1d4ed8;
  --ok: #16a34a;
  --off: #cbd5e1;
  --danger: #dc2626;
  --radius: 12px;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, sans-serif; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code { font: 13px/1.4 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; background: #eef2f7; padding: 2px 6px; border-radius: 6px; }
pre { background: #0f172a; color: #e2e8f0; padding: 12px 14px; border-radius: 10px; overflow-x: auto; font: 13px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
pre.config { max-height: 320px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

.top { display: flex; align-items: center; justify-content: space-between; padding: 14px 24px; background: var(--card); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 600; letter-spacing: -0.01em; }
.brand:hover { text-decoration: none; }
.brand-mark { width: 22px; height: 22px; border-radius: 7px; background: linear-gradient(135deg, #2563eb, #7c3aed); display: inline-block; }
.who { display: flex; gap: 16px; align-items: center; font-size: 14px; }

.wrap { max-width: 880px; margin: 0 auto; padding: 32px 20px 48px; }
.foot { max-width: 880px; margin: 0 auto; padding: 0 20px 32px; font-size: 13px; }

.page-head h1 { margin: 0 0 4px; font-size: 26px; letter-spacing: -0.02em; display: flex; align-items: center; gap: 10px; }
.page-head p { margin: 0 0 20px; }
.back { font-size: 14px; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; margin-bottom: 18px; }
.card h2 { margin: 0 0 14px; font-size: 17px; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 18px; }
.form-grid label { display: flex; flex-direction: column; gap: 5px; font-size: 14px; }
.form-grid label > span { font-weight: 500; }
.form-grid input, .form-grid select { font: inherit; padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.form-grid input:focus, .form-grid select:focus { outline: 2px solid #bfdbfe; border-color: var(--accent); }
.form-actions { grid-column: 1 / -1; display: flex; justify-content: flex-end; }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } }

.btn { display: inline-block; font: inherit; font-weight: 500; padding: 9px 16px; border-radius: 8px; border: 1px solid var(--line); background: #fff; color: var(--text); cursor: pointer; }
.btn:hover { text-decoration: none; background: #f8fafc; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); }
.btn-small { padding: 5px 10px; font-size: 13px; }
.btn-danger { color: var(--danger); border-color: #fecaca; }
.btn-danger:hover { background: #fef2f2; }

table.list { width: 100%; border-collapse: collapse; font-size: 14px; }
table.list th { text-align: left; font-weight: 500; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; padding: 0 8px 10px; border-bottom: 1px solid var(--line); }
table.list td { padding: 12px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.list tr:last-child td { border-bottom: 0; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; vertical-align: middle; }
.dot-on { background: var(--ok); box-shadow: 0 0 0 3px #dcfce7; }
.dot-off { background: var(--off); }
.dot-unk { background: #fbbf24; }
.pill { font-size: 12px; font-weight: 500; padding: 2px 9px; border-radius: 999px; vertical-align: middle; }
.pill-on { background: #dcfce7; color: #166534; }
.pill-off { background: #f1f5f9; color: var(--muted); }

.row-actions { text-align: right; width: 48px; }
.menu { position: relative; display: inline-block; }
.menu summary { list-style: none; cursor: pointer; padding: 2px 8px; border-radius: 6px; color: var(--muted); font-weight: 700; letter-spacing: 1px; }
.menu summary::-webkit-details-marker { display: none; }
.menu summary:hover { background: #f1f5f9; color: var(--text); }
.menu-items { position: absolute; right: 0; top: 100%; z-index: 5; min-width: 220px; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 10px 30px rgba(15, 23, 42, 0.12); padding: 6px; text-align: left; }
.menu-items a, .menu-items button { display: block; width: 100%; text-align: left; font: inherit; font-size: 14px; padding: 8px 10px; border: 0; background: none; border-radius: 6px; color: var(--text); cursor: pointer; }
.menu-items a:hover, .menu-items button:hover { background: #f1f5f9; text-decoration: none; }
.menu-items button.danger { color: var(--danger); }

.flash { padding: 10px 14px; border-radius: 10px; margin-bottom: 16px; font-size: 14px; }
.flash-ok { background: #dcfce7; color: #166534; }
.flash-error { background: #fee2e2; color: #991b1b; }
.flash-warn { background: #fef3c7; color: #92400e; }

.hero { text-align: center; padding: 48px 0 24px; }
.hero h1 { font-size: 32px; letter-spacing: -0.03em; margin: 0 0 12px; }
.lead { max-width: 560px; margin: 0 auto 24px; color: var(--muted); font-size: 16px; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 24px; }
.step { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; display: flex; gap: 12px; font-size: 14px; }
.step .n { width: 26px; height: 26px; border-radius: 50%; background: #eef2ff; color: var(--accent); font-weight: 600; display: inline-flex; align-items: center; justify-content: center; flex: none; }
@media (max-width: 640px) { .steps { grid-template-columns: 1fr; } }

.address { font-size: 18px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.address code { font-size: 16px; padding: 6px 10px; }
.howto { padding-left: 20px; }
.howto li { margin-bottom: 12px; }
.howto pre { margin: 8px 0; }
.kv { display: grid; grid-template-columns: 180px 1fr; gap: 8px 12px; font-size: 14px; margin: 0 0 18px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
details > summary { cursor: pointer; color: var(--accent); font-size: 14px; }
