:root {
  --bg: #0f1115; --panel: #1a1d24; --panel2: #232733; --line: #2e333f;
  --text: #e6e9ef; --muted: #9aa3b2; --accent: #4f8cff; --accent2: #3a6fd8;
  --good: #3ecf8e; --warn: #f1b44c; --bad: #f06a6a; --radius: 12px;
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 24px; border-bottom: 1px solid var(--line); background: var(--panel);
  position: sticky; top: 0; z-index: 10;
}
header .brand { font-weight: 700; font-size: 17px; }
header nav a { margin-left: 18px; color: var(--muted); }
header nav a.active { color: var(--text); }
.container { max-width: 1080px; margin: 0 auto; padding: 24px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin-bottom: 18px; }
h1 { font-size: 22px; margin: 0 0 16px; }
h2 { font-size: 17px; margin: 0 0 12px; }
label { display: block; font-size: 13px; color: var(--muted); margin: 12px 0 6px; }
input[type=text], input[type=number], textarea, select {
  width: 100%; background: var(--panel2); border: 1px solid var(--line); color: var(--text);
  border-radius: 8px; padding: 10px 12px; font: inherit;
}
textarea { resize: vertical; min-height: 90px; }
button {
  background: var(--accent); color: #fff; border: 0; border-radius: 8px;
  padding: 10px 18px; font: inherit; font-weight: 600; cursor: pointer;
}
button:hover { background: var(--accent2); }
button.ghost { background: transparent; border: 1px solid var(--line); color: var(--text); }
button.ghost:hover { background: var(--panel2); }
button:disabled { opacity: .5; cursor: not-allowed; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.tabs { display: flex; gap: 8px; margin-bottom: 14px; }
.tabs button { background: var(--panel2); color: var(--muted); }
.tabs button.active { background: var(--accent); color: #fff; }
.pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.pill.good { background: rgba(62,207,142,.15); color: var(--good); }
.pill.bad { background: rgba(240,106,106,.15); color: var(--bad); }
.pill.warn { background: rgba(241,180,76,.15); color: var(--warn); }
.muted { color: var(--muted); }
.steps { counter-reset: step; padding-left: 0; list-style: none; }
.steps li { counter-increment: step; position: relative; padding: 8px 0 8px 38px; border-bottom: 1px solid var(--line); }
.steps li::before {
  content: counter(step); position: absolute; left: 0; top: 8px;
  width: 26px; height: 26px; border-radius: 50%; background: var(--accent); color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px;
}
kbd { background: var(--panel2); border: 1px solid var(--line); border-radius: 5px; padding: 1px 6px; font-size: 12px; }
.status-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; }
.status-dot.on { background: var(--good); } .status-dot.off { background: var(--bad); }
.banner { padding: 10px 14px; border-radius: 8px; margin-bottom: 14px; font-size: 14px; }
.banner.err { background: rgba(240,106,106,.12); color: var(--bad); border: 1px solid rgba(240,106,106,.3); }
.banner.ok { background: rgba(62,207,142,.12); color: var(--good); border: 1px solid rgba(62,207,142,.3); }
.banner.info { background: rgba(79,140,255,.1); color: var(--accent); border: 1px solid rgba(79,140,255,.3); }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-size: 12px; font-weight: 600; text-transform: uppercase; }
tr.cand { cursor: pointer; }
tr.cand:hover { background: var(--panel2); }
.score { font-weight: 700; font-size: 16px; }
.score.hi { color: var(--good); } .score.mid { color: var(--warn); } .score.lo { color: var(--bad); }
.candcard { border-left: 3px solid var(--accent); }
.candcard h3 { margin: 0 0 4px; }
.taglist { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.tag { background: var(--panel2); border: 1px solid var(--line); border-radius: 6px; padding: 3px 9px; font-size: 13px; }
.section-title { font-size: 13px; color: var(--muted); text-transform: uppercase; margin: 12px 0 4px; }
ul.tight { margin: 4px 0; padding-left: 20px; }
ul.tight li { margin: 3px 0; }
.progress-bar { height: 8px; background: var(--panel2); border-radius: 999px; overflow: hidden; margin: 10px 0; }
.progress-bar > div { height: 100%; background: var(--accent); transition: width .3s; }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 12px 0; padding: 12px; background: var(--panel2); border-radius: 8px; }
.hidden { display: none; }
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.6); display: flex; align-items: flex-start; justify-content: center; padding: 40px 16px; z-index: 100; overflow-y: auto; }
.modal-overlay.hidden { display: none; }  /* перебиваем display:flex выше */
.modal { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; max-width: 720px; width: 100%; position: relative; }
.modal-close { position: absolute; top: 12px; right: 14px; background: transparent; color: var(--muted); font-size: 26px; line-height: 1; padding: 2px 8px; }
.modal-close:hover { background: var(--panel2); color: var(--text); }
.subscores { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
.subscores .tag { display: flex; gap: 6px; }
.subscores .tag b { color: var(--text); }
.modal-tabs { display: flex; gap: 8px; margin: 14px 0; border-bottom: 1px solid var(--line); }
.modal-tabs button { background: transparent; color: var(--muted); border-radius: 0; border-bottom: 2px solid transparent; padding: 8px 12px; font-weight: 600; }
.modal-tabs button.active { color: var(--text); border-bottom-color: var(--accent); }
.tabpane { display: none; }
.tabpane.active { display: block; }
.resume-text { white-space: pre-wrap; font: 13px/1.55 ui-monospace, Menlo, Consolas, monospace; background: var(--panel2); border: 1px solid var(--line); border-radius: 8px; padding: 14px; max-height: 60vh; overflow-y: auto; }
.pdata { display: grid; grid-template-columns: 160px 1fr; gap: 6px 14px; }
.pdata dt { color: var(--muted); }
.pdata dd { margin: 0; }
.pdata a { word-break: break-all; }
.spinner { display:inline-block;width:14px;height:14px;border:2px solid var(--muted);border-top-color:var(--accent);border-radius:50%;animation:spin .8s linear infinite;vertical-align:middle;}
@keyframes spin { to { transform: rotate(360deg); } }
