:root {
  --bg: #f4f6f9; --panel: #fff; --text: #1d2433; --muted: #64708a; --line: #e1e5ee;
  --brand: #0b5ed7; --brand-ink: #fff; --ok: #188a42; --warn: #b26a00; --bad: #c62828;
  --ok-bg: #e7f6ec; --warn-bg: #fff4e0; --bad-bg: #fdeaea; --code: #0f172a; --code-ink: #dbe4f3;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #11151c; --panel: #1a2029; --text: #e6eaf2; --muted: #95a0b5; --line: #2b3340;
    --brand: #4c8dff; --ok: #4cc27a; --warn: #f0a640; --bad: #ff6b6b; --ok-bg: #16301f; --warn-bg: #33260f; --bad-bg: #3a1a1a; --code: #0a0d12; }
}
* { box-sizing: border-box; }
body { margin: 0; font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--text); }
a { color: var(--brand); text-decoration: none; }
.top { position: fixed; top: 0; left: 0; right: 0; height: 52px; display: flex; align-items: center; gap: 12px;
  padding: 0 16px; background: var(--brand); color: var(--brand-ink); z-index: 20; }
.brand { font-weight: 700; font-size: 17px; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who { font-size: 13px; opacity: .9; }
.menu-btn { display: none; background: none; border: 0; color: inherit; font-size: 22px; cursor: pointer; }
.side { position: fixed; top: 52px; bottom: 0; left: 0; width: 200px; background: var(--panel); border-right: 1px solid var(--line);
  padding: 10px 0; overflow-y: auto; z-index: 15; }
.side a { display: flex; align-items: center; gap: 10px; padding: 9px 20px; color: var(--text); font-size: 14.5px; }
.side a svg { width: 18px; height: 18px; flex: none; opacity: .7; }
.side a.on svg { opacity: 1; }
.side a:hover { background: var(--bg); }
.side-head { padding: 6px 16px 14px; margin-bottom: 6px; border-bottom: 1px solid var(--line); text-align: center; }
.side-head:empty { display: none; }
.side-head img { display: block; max-width: 100%; max-height: 64px; margin: 4px auto 8px; object-fit: contain; }
.side-head .tn { font-weight: 700; font-size: 14px; line-height: 1.25; }
.side-head .tk { font-size: 12px; color: var(--muted); }
.login-logo { display: block; max-width: 220px; max-height: 90px; margin: 0 auto 14px; object-fit: contain; }
.login .tname { text-align: center; font-weight: 700; font-size: 17px; margin-bottom: 10px; }
.logo-prev { display: flex; align-items: center; justify-content: center; min-height: 90px; border: 1px dashed var(--line); border-radius: 10px; padding: 10px; background: var(--bg); }
.logo-prev img { max-width: 240px; max-height: 80px; object-fit: contain; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; font-size: 14px; }
.kv b { color: var(--muted); font-weight: 600; }
code.big { font-size: 20px; letter-spacing: .06em; padding: 6px 12px; background: var(--bg); border-radius: 8px; border: 1px solid var(--line); }
.side a.on { background: var(--bg); color: var(--brand); font-weight: 600; border-left: 3px solid var(--brand); padding-left: 17px; }
main { margin: 52px 0 0 200px; padding: 20px 24px 60px; max-width: 1200px; }
@media (max-width: 820px) {
  .menu-btn { display: block; }
  .side { transform: translateX(-100%); transition: transform .2s; width: 230px; box-shadow: 0 0 20px rgba(0,0,0,.2); }
  .side.open { transform: none; }
  main { margin-left: 0; padding: 16px 16px 60px; }
  .who { display: none; }
}
h1 { font-size: 22px; margin: 4px 0 16px; }
h2 { font-size: 17px; margin: 22px 0 10px; }
h3 { font-size: 15px; margin: 14px 0 8px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 16px; margin-bottom: 16px; }
.grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 14px; }
.card h3 { margin: 0 0 6px; }
.stat { font-size: 26px; font-weight: 700; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.row.end { justify-content: flex-end; }
.spacer { flex: 1; }
button, .btn { font: inherit; border: 1px solid var(--line); background: var(--panel); color: var(--text); border-radius: 8px;
  padding: 8px 14px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
button.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); font-weight: 600; }
button.danger { color: var(--bad); border-color: var(--bad); }
button.small, .btn.small { padding: 4px 10px; font-size: 13px; }
button:disabled { opacity: .55; cursor: default; }
label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 4px; }
input, select, textarea { font: inherit; width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--panel); color: var(--text); }
textarea { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12.5px; }
.form { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.form .full { grid-column: 1 / -1; }
.check { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text); }
.check input { width: auto; }
table { width: 100%; border-collapse: collapse; background: var(--panel); }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12.5px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
tr.click { cursor: pointer; }
tr.click:hover td { background: var(--bg); }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; }
.table-wrap table { border: 0; }
.pill { display: inline-block; padding: 1px 8px; border-radius: 99px; font-size: 12.5px; font-weight: 600; background: var(--bg); color: var(--muted); }
.pill.ok { background: var(--ok-bg); color: var(--ok); }
.pill.warn { background: var(--warn-bg); color: var(--warn); }
.pill.bad { background: var(--bad-bg); color: var(--bad); }
.alert { padding: 10px 14px; border-radius: 8px; margin: 10px 0; }
.alert.ok { background: var(--ok-bg); color: var(--ok); }
.alert.bad { background: var(--bad-bg); color: var(--bad); }
.alert.warn { background: var(--warn-bg); color: var(--warn); }
pre.cli { background: var(--code); color: var(--code-ink); padding: 12px; border-radius: 8px; overflow-x: auto; font-size: 12.5px; max-height: 360px; margin: 8px 0; white-space: pre; }
details summary { cursor: pointer; color: var(--brand); margin: 8px 0; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 14px; overflow-x: auto; }
.tabs button { border: 0; border-bottom: 2px solid transparent; border-radius: 0; background: none; padding: 10px 14px; white-space: nowrap; }
.tabs button.on { border-bottom-color: var(--brand); color: var(--brand); font-weight: 600; }
.steps { display: flex; gap: 6px; margin-bottom: 16px; flex-wrap: wrap; }
.steps span { padding: 4px 12px; border-radius: 99px; background: var(--panel); border: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.steps span.on { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.steps span.done { color: var(--ok); }
.pick { border: 1px solid var(--line); border-radius: 10px; padding: 12px; cursor: pointer; background: var(--panel); }
.pick:hover { border-color: var(--brand); }
.pick.on { border: 2px solid var(--brand); padding: 11px; }
.pick.off { opacity: .55; cursor: default; }
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.45); display: flex; align-items: flex-start; justify-content: center; z-index: 50; padding: 40px 16px; overflow-y: auto; }
.modal-box { background: var(--panel); border-radius: 12px; padding: 20px; width: 100%; max-width: 720px; box-shadow: 0 10px 40px rgba(0,0,0,.3); }
.hidden { display: none !important; }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--text); color: var(--bg); padding: 10px 18px; border-radius: 8px; z-index: 60; max-width: 90vw; }
.login { max-width: 360px; margin: 10vh auto; }
.gem-row { display: grid; grid-template-columns: 90px 1fr 40px; gap: 8px; margin-bottom: 6px; }
.spin { display: inline-block; width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: s .7s linear infinite; }
@keyframes s { to { transform: rotate(360deg); } }
.rx-good { color: var(--ok); font-weight: 600; } .rx-warn { color: var(--warn); font-weight: 600; } .rx-bad { color: var(--bad); font-weight: 600; }
.ok-t { color: var(--ok); } .bad-t { color: var(--bad); }
.warn-t { color: var(--warn); }
.ports { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; margin-top: 10px; }
.port { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; padding: 8px 10px; }
.port.on { border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand) inset; }
.seg { display: inline-flex; flex-wrap: wrap; gap: 0; }
.seg > * { border-radius: 0; margin-left: -1px; }
.seg > *:first-child { border-radius: 8px 0 0 8px; margin-left: 0; }
.seg > *:last-child { border-radius: 0 8px 8px 0; }
.seg > .on { background: var(--brand); color: #fff; border-color: var(--brand); }

/* ---------- 0.7.x look: professional SaaS shell ---------- */
:root { --bg: #f6f8fc; --text: #0f172a; --muted: #5b6785; --line: #e3e8f1; --brand: #2563eb; --navy: #0b1530;
  --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 1px 3px rgba(15, 23, 42, .06); }
@media (prefers-color-scheme: dark) {
  :root { --bg: #0d1220; --panel: #151c2e; --text: #e6eaf2; --muted: #95a0b5; --line: #26304a; --brand: #5b8cff; --navy: #080d1c; --shadow: none; }
}
body { font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; -webkit-font-smoothing: antialiased; }
.top { background: var(--panel); color: var(--text); height: 56px; padding: 0 18px; border-bottom: 1px solid var(--line); }
.brand-mark { display: flex; }

.brand { font-weight: 700; font-size: 16.5px; letter-spacing: -.01em; }
.who { font-size: 13px; opacity: 1; color: var(--muted); background: var(--bg); padding: 5px 12px; border-radius: 99px; }
.side { top: 56px; width: 220px; padding: 12px 10px; border-right: 1px solid var(--line); }
.side a { padding: 9px 12px; border-radius: 9px; margin-bottom: 2px; font-weight: 500; color: var(--muted); }
.side a:hover { background: var(--bg); color: var(--text); }
.side a.on { background: color-mix(in srgb, var(--brand) 10%, transparent); color: var(--brand); font-weight: 600; border-left: 0; padding-left: 12px; }
.side-head { margin: 0 4px 10px; padding: 8px 8px 14px; }
main { margin: 56px 0 0 220px; padding: 26px 32px 60px; }
h1 { font-size: 24px; letter-spacing: -.015em; font-weight: 750; }
.panel, .card { border-radius: 12px; box-shadow: var(--shadow); }
.card { padding: 16px 18px; }
.stat { font-size: 28px; letter-spacing: -.02em; }
.table-wrap { border-radius: 12px; box-shadow: var(--shadow); }
th { background: color-mix(in srgb, var(--bg) 60%, var(--panel)); }
button, .btn { border-radius: 9px; transition: background .15s, border-color .15s, box-shadow .15s; }
button:hover:not(:disabled) { border-color: color-mix(in srgb, var(--brand) 45%, var(--line)); }
button.primary { box-shadow: 0 1px 2px rgba(37, 99, 235, .3); }
button.primary:hover:not(:disabled) { filter: brightness(1.07); }
input, select, textarea { border-radius: 9px; padding: 9px 11px; transition: border-color .15s, box-shadow .15s; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 20%, transparent); }
.modal-box { border-radius: 14px; }
@media (max-width: 820px) { main { margin-left: 0; padding: 18px 16px 60px; } .side { width: 240px; } }

/* sign-in page */
body.logged-out .top { display: none; }
body.logged-out main { margin: 0 !important; padding: 0; max-width: none; }
.auth { display: grid; grid-template-columns: minmax(340px, 46%) 1fr; min-height: 100vh; }
.auth-side { position: relative; overflow: hidden; display: flex; flex-direction: column; padding: 40px 48px; color: #0f172a; border-right: 1px solid #e3e8f1;
  background: radial-gradient(700px 420px at 100% 0%, rgba(37, 99, 235, .14), transparent 65%), radial-gradient(600px 380px at 0% 100%, rgba(34, 211, 238, .12), transparent 60%), linear-gradient(180deg, #f7faff, #eef4ff); }
.auth-brand, .auth-mob { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 20px; color: #0f172a; letter-spacing: -.01em; }
.auth-mob { display: none; color: var(--text); margin-bottom: 18px; }
.auth .mark { width: 34px; height: 34px; }
.auth-pitch { margin: auto 0; max-width: 440px; }
.auth-pitch h2 { font-size: 34px; line-height: 1.15; letter-spacing: -.02em; margin: 0 0 22px; font-weight: 800; }
.auth-pitch ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; color: #5b6785; font-size: 15.5px; }
.auth-pitch li::before { content: "✓"; color: #2563eb; font-weight: 800; margin-right: 10px; }
.auth-foot { color: #5b6785; font-size: 13.5px; }
.auth-help a { font-weight: 600; }
.auth-main { display: flex; align-items: center; justify-content: center; padding: 40px 24px; background: var(--panel); }
.auth-card { width: 100%; max-width: 380px; }
.auth-card h1 { font-size: 28px; margin: 0 0 12px; }
.auth-card label { font-weight: 600; color: var(--text); font-size: 13.5px; }
.auth-card input { padding: 11px 13px; }
.auth-btn { width: 100%; justify-content: center; margin-top: 22px; padding: 12px; font-size: 15.5px; }
.auth-help { margin-top: 22px; text-align: center; }
.auth .login-logo { margin: 0 0 18px; max-width: 200px; }
.auth .tname { text-align: left; }
@media (max-width: 820px) {
  .auth { grid-template-columns: 1fr; }
  .auth-side { display: none; }
  .auth-mob { display: inline-flex; }
  .auth-main { align-items: flex-start; padding-top: 12vh; }
}
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 46px; }
.pw-eye { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); border: 0; background: none; padding: 7px; color: var(--muted); border-radius: 7px; }
.pw-eye:hover:not(:disabled) { color: var(--brand); background: var(--bg); }
.pw-eye svg { width: 20px; height: 20px; display: block; }
.wm { font-weight: 900; font-style: italic; letter-spacing: .01em; color: #0b2a5b; }
.wm span { color: #1d6fe0; padding-right: .06em; }
@media (prefers-color-scheme: dark) { .wm { color: #e6eaf2; } }
.brand .wm { font-size: 19px; }
.brand .lco { font-weight: 600; color: var(--muted); }
.brand-mark svg { width: 46px; height: 34px; }
.top { gap: 6px; }
.auth-brand, .auth-mob { gap: 6px; font-size: 28px; }
.auth .mark { width: 58px; height: 44px; }
.auth-by { font-size: 13px; color: #5b6785; font-weight: 600; margin: -4px 0 0 64px; letter-spacing: .02em; } .auth-by b { color: #0b2a5b; font-style: italic; }
.auth-tag { color: #0284c7; font-weight: 700; font-size: 13px; text-transform: uppercase; letter-spacing: .08em; margin-bottom: 12px; }
.auth-tag:empty { display: none; }
/* white-label installs (0.7.7) */
.brand-mark img { display: block; height: 34px; max-width: 120px; object-fit: contain; }
.auth .wl-logo { display: block; max-width: 360px; max-height: 110px; object-fit: contain; }
body.wl .auth .login-logo { max-width: 300px; max-height: 90px; margin-bottom: 22px; }
@media (max-width: 820px) { body.wl .auth .login-logo { margin-bottom: 6px; } }
.wl-tag { display: none; color: var(--brand); font-weight: 700; font-size: 13.5px; margin-bottom: 18px; }
@media (max-width: 820px) { .wl-tag { display: block; } }
body.wl .side-head img { max-height: 56px; }
body.wl .auth-side { background: radial-gradient(700px 420px at 100% 0%, color-mix(in srgb, var(--brand) 16%, transparent), transparent 65%), radial-gradient(600px 380px at 0% 100%, color-mix(in srgb, var(--brand) 10%, transparent), transparent 60%), linear-gradient(180deg, #fafbfd, color-mix(in srgb, var(--brand) 7%, #fff)); }
body.wl .auth-pitch li::before { color: var(--brand); }
body.wl .auth-tag { color: var(--brand); font-size: 15px; text-transform: none; letter-spacing: 0; font-weight: 800; }
body.wl .brand { color: var(--text); font-weight: 800; }
.auth-foot .pwr { display: block; margin-top: 4px; font-size: 12px; opacity: .8; }
.pwr-mob { display: none; text-align: center; font-size: 12px; color: var(--muted); margin-top: 28px; }
@media (max-width: 820px) { .pwr-mob { display: block; } }
.side .pwr { font-size: 11.5px; color: var(--muted); text-align: center; padding: 18px 10px 6px; }
.side .pwr:empty { display: none; }
