:root {
  --bg: #f5f6f8; --panel: #ffffff; --ink: #1b2430; --muted: #66748a; --line: #e2e6ec;
  --accent: #1f5fbf; --accent-ink: #ffffff; --ok: #1d7a46; --ok-bg: #e5f4ea; --warn: #9a6200; --warn-bg: #fdf1d8;
  --bad: #b3261e; --bad-bg: #fbe5e3; --info-bg: #e6eefb; --side: #14202e; --side-ink: #c9d4e3; --side-active: #22344a;
  --radius: 10px; --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f151d; --panel: #18212c; --ink: #e6ecf3; --muted: #93a1b5; --line: #2a3644;
    --accent: #5b9bff; --accent-ink: #08121f; --ok: #5fd08a; --ok-bg: #12301f; --warn: #f0b84d; --warn-bg: #352a10;
    --bad: #ff8b83; --bad-bg: #3a1815; --info-bg: #182a44; --side: #0b1118; --side-ink: #b4c0d0; --side-active: #1b2a3b;
  }
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--ink); }
h1 { font-size: 22px; margin: 0 0 4px; } h2 { font-size: 17px; margin: 0 0 10px; } h3 { font-size: 15px; margin: 0 0 8px; }
.muted { color: var(--muted); } .small { font-size: 13px; } .mono { font-family: var(--mono); font-size: 13px; }
a { color: var(--accent); }

#login { max-width: 430px; margin: 14vh auto; padding: 28px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
#login input { width: 100%; margin: 14px 0 10px; }

#app { display: grid; grid-template-columns: 220px 1fr; min-height: 100vh; }
nav { background: var(--side); color: var(--side-ink); padding: 18px 12px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
nav .brand { font-weight: 650; color: #fff; padding: 4px 10px 16px; font-size: 16px; }
nav a { display: flex; justify-content: space-between; align-items: center; padding: 8px 10px; margin: 2px 0; border-radius: 8px; color: var(--side-ink); text-decoration: none; }
nav a:hover { background: var(--side-active); }
nav a.active { background: var(--side-active); color: #fff; }
nav .count { background: var(--accent); color: var(--accent-ink); border-radius: 10px; padding: 0 7px; font-size: 12px; min-width: 20px; text-align: center; }
nav .foot { margin-top: 20px; padding: 0 10px; font-size: 12px; color: #7f8ea3; }
nav button.link { background: none; border: 0; color: #9db0c9; padding: 0; cursor: pointer; font: inherit; text-decoration: underline; }
main { padding: 24px 28px 60px; max-width: 1100px; width: 100%; }
.head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; margin-bottom: 14px; }
.grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); margin-bottom: 14px; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.stat .n { font-size: 26px; font-weight: 650; line-height: 1.1; } .stat .l { color: var(--muted); font-size: 13px; }

button, .btn { font: inherit; cursor: pointer; border: 1px solid var(--line); background: var(--panel); color: var(--ink); padding: 7px 13px; border-radius: 8px; text-decoration: none; display: inline-block; }
button:hover, .btn:hover { border-color: var(--accent); }
button.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
button.danger { color: var(--bad); } button.good { color: var(--ok); }
button:disabled { opacity: .5; cursor: default; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.row.right { justify-content: flex-end; }
.spacer { flex: 1; }

input, select, textarea { font: inherit; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
textarea { width: 100%; min-height: 110px; resize: vertical; }
input[type=checkbox] { width: auto; margin-right: 6px; }
label.f { display: block; margin: 0 0 12px; }
label.f > span { display: block; font-size: 13px; color: var(--muted); margin-bottom: 3px; }
label.f input:not([type=checkbox]), label.f select { width: 100%; }
label.chk { display: inline-flex; align-items: center; margin-right: 14px; }
.cols { display: grid; gap: 0 16px; grid-template-columns: 1fr 1fr; }
@media (max-width: 700px) { .cols { grid-template-columns: 1fr; } }

.badge { display: inline-block; font-size: 12px; padding: 1px 8px; border-radius: 10px; background: var(--info-bg); color: var(--accent); white-space: nowrap; }
.badge.ok { background: var(--ok-bg); color: var(--ok); } .badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.bad { background: var(--bad-bg); color: var(--bad); } .badge.gray { background: var(--line); color: var(--muted); }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
tr.click { cursor: pointer; } tr.click:hover td { background: var(--bg); }
.tablewrap { overflow-x: auto; }

.item { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; margin-bottom: 10px; background: var(--panel); }
.item .top { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
.item pre { margin: 0 0 10px; white-space: pre-wrap; word-break: break-word; font: inherit; max-height: 11em; overflow: hidden; }
.item pre.open { max-height: none; }
.item img.thumb { max-width: 220px; max-height: 140px; border-radius: 6px; border: 1px solid var(--line); display: block; margin-bottom: 10px; }
.quote { border-left: 3px solid var(--line); padding-left: 10px; color: var(--muted); margin: 0 0 8px; font-size: 14px; }
.issue { padding: 4px 0; font-size: 14px; } .issue.error { color: var(--bad); } .issue.warn { color: var(--warn); }
.check { display: flex; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.check:last-child { border-bottom: 0; } .check b { min-width: 130px; }
.logbox { background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; font: 12.5px/1.5 var(--mono); white-space: pre-wrap; word-break: break-word; max-height: 320px; overflow: auto; }
.result { white-space: pre-wrap; word-break: break-word; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.tabs button.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.empty { text-align: center; padding: 36px 10px; color: var(--muted); }
.chip { cursor: pointer; font-size: 13px; padding: 3px 10px; border: 1px dashed var(--line); border-radius: 14px; color: var(--muted); background: none; }
.listrow { display: grid; grid-template-columns: 150px 1fr 1fr auto; gap: 6px; margin-bottom: 6px; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; background: var(--muted); }
.dot.ok { background: var(--ok); } .dot.bad { background: var(--bad); }

dialog { border: 1px solid var(--line); border-radius: 12px; padding: 20px 22px; background: var(--panel); color: var(--ink); width: min(640px, 94vw); max-height: 90vh; overflow: auto; }
dialog::backdrop { background: rgba(10, 16, 24, .55); }

#toasts { position: fixed; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 50; }
.toast { background: var(--ink); color: var(--bg); padding: 10px 14px; border-radius: 8px; max-width: 380px; box-shadow: 0 4px 14px rgba(0,0,0,.25); }
.toast.err { background: var(--bad); color: #fff; }

@media (max-width: 860px) {
  #app { grid-template-columns: 1fr; }
  nav { position: static; height: auto; display: flex; flex-wrap: wrap; gap: 4px; padding: 10px; }
  nav .brand { width: 100%; padding-bottom: 6px; } nav .foot { display: none; }
  main { padding: 16px 14px 60px; }
  .listrow { grid-template-columns: 1fr 1fr; }
}

/* лицензия */
.col { min-width: 0; }
#licbar:empty { display: none; }
#licbar { padding: 14px 28px 0; max-width: 1100px; }
.licbar { border-radius: var(--radius); padding: 10px 14px; margin-bottom: 8px; font-size: 14px; border: 1px solid var(--line); }
.licbar.bad { background: #fdecec; border-color: #f3c2c2; color: #8a1c1c; }
.licbar.warn { background: #fff4e0; border-color: #f2d6a2; color: #7a4a00; }
.licbar.info { background: #e8f1fa; border-color: #bcd6ee; color: #0b4a7a; }
.licbar a { color: inherit; font-weight: 600; }
@media (max-width: 800px) { #licbar { padding: 10px 14px 0; } }

/* мастер настройки */
[hidden] { display: none !important; }
.wiz-body h3 { margin: 18px 0 8px; }
.wiz { display: grid; grid-template-columns: 240px 1fr; gap: 16px; align-items: start; }
.wiz-steps { display: flex; flex-direction: column; gap: 4px; position: sticky; top: 12px; }
.wiz-step { display: flex; align-items: center; gap: 8px; text-align: left; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; cursor: pointer; font: inherit; color: inherit; }
.wiz-step.on { border-color: var(--accent); box-shadow: 0 0 0 2px var(--info-bg); }
.wiz-step .wiz-t { flex: 1; font-size: 14px; }
.wiz-n { width: 24px; height: 24px; border-radius: 50%; background: var(--line); display: inline-flex; align-items: center; justify-content: center; font-size: 12px; flex: none; }
.wiz-n.ok { background: var(--ok-bg); color: var(--ok); }
.wiz-body h2 { margin-top: 0; }
.wiz-help { background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; margin: 10px 0; }
.wiz-help summary { cursor: pointer; font-weight: 600; color: var(--accent); }
.wiz-help ol, .wiz-list { margin: 8px 0 4px; padding-left: 20px; } .wiz-help li, .wiz-list li { margin: 4px 0; }
.wiz-nav { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line); }
.wiz-result { margin-top: 10px; }
.wiz-found .listrow { display: flex; align-items: center; gap: 6px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.wiz-remind { border-color: var(--accent); background: var(--info-bg); }
@media (max-width: 800px) { .wiz { grid-template-columns: 1fr; } .wiz-steps { position: static; flex-direction: row; overflow-x: auto; } .wiz-step { flex: none; } .wiz-step .badge { display: none; } }
input[type=color] { width: 72px; height: 38px; padding: 3px; cursor: pointer; }

/* вход одной кнопкой (1.5.2) */
.login-way { display: flex; gap: 12px; align-items: flex-start; margin: 18px 0 6px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg); }
.login-way .login-ico { font-size: 22px; line-height: 1; }
.login-way .small { margin: 4px 0; }
.login-pw { margin-top: 14px; }
.login-pw summary { cursor: pointer; color: var(--muted); font-size: 14px; }
.login-pw input { margin: 10px 0 6px; }
#login .issue.error:empty { display: none; }
ul.plain { margin: 0; padding-left: 18px; } ul.plain li { margin: 4px 0; }
button.small { padding: 4px 10px; font-size: 13px; }
