:root {
  color-scheme: light;
  --bg: #0f1420;
  --panel: #ffffff;
  --ink: #161a22;
  --muted: #5b6474;
  --line: #e3e7ee;
  --accent: #2554c7;
  --demo: #b9770e;
  --chip-bg: #eef1f7;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: #f5f6f9;
  color: var(--ink);
}
header.top {
  background: var(--bg);
  color: #fff;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}
header.top a { color: #fff; text-decoration: none; opacity: .85; }
header.top a.active, header.top a:hover { opacity: 1; text-decoration: underline; }
header.top .title { font-weight: 600; margin-right: auto; }
main { max-width: 1100px; margin: 0 auto; padding: 20px 24px 60px; }
.toolbar {
  display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px;
}
.toolbar input, .toolbar select {
  padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; font-size: 14px;
}
.toolbar input { flex: 1 1 240px; }
.shelf-title { font-size: 20px; font-weight: 700; margin: 22px 0 10px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  padding: 14px; text-decoration: none; color: inherit; display: block;
}
.card:hover { border-color: var(--accent); }
.card .name { font-weight: 600; margin-bottom: 4px; }
.card .meta { font-size: 12px; color: var(--muted); }
.chip {
  display: inline-block; background: var(--chip-bg); color: var(--ink);
  border-radius: 999px; padding: 2px 9px; font-size: 11px; margin: 2px 4px 0 0;
}
.chip.demo { background: #fcecd1; color: var(--demo); }
.empty { color: var(--muted); padding: 20px 0; }
.card-detail { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 20px; }
.card-detail h1 { margin-top: 0; }
.section-title { font-weight: 700; margin: 18px 0 8px; }
.linklist { list-style: none; padding: 0; margin: 0; }
.linklist li { padding: 6px 0; border-bottom: 1px dashed var(--line); }
.linklist a { color: var(--accent); text-decoration: none; }
.linklist a:hover { text-decoration: underline; }
.rel { color: var(--muted); font-size: 12px; margin-right: 6px; }
.kv { display: grid; grid-template-columns: 180px 1fr; gap: 6px 14px; font-size: 14px; margin: 10px 0; }
.kv div.k { color: var(--muted); }
pre.raw { background: #0f1420; color: #cfe0ff; padding: 12px; border-radius: 10px; overflow: auto; font-size: 12px; }
.banner {
  background: #fff6e0; border: 1px solid #f0d58c; color: #6b4e00;
  padding: 10px 14px; border-radius: 10px; margin-bottom: 16px; font-size: 13px;
}
.impact-box { border: 1px solid #f3c9c9; background: #fff2f2; border-radius: 10px; padding: 12px; margin-top: 10px; }
.impact-box h3 { margin: 0 0 6px; color: #9c2b2b; font-size: 14px; }
button {
  padding: 8px 12px; border-radius: 8px; border: 1px solid var(--line); background: #fff; cursor: pointer;
}
button:hover { border-color: var(--accent); }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}

.shelf-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.tab {
  padding: 9px 16px; border-radius: 999px; border: 1px solid var(--line); background: #fff;
  font-size: 14px; font-weight: 600; color: var(--muted); cursor: pointer;
}
.tab:hover { border-color: var(--accent); color: var(--ink); }
.tab.active { background: var(--bg); color: #fff; border-color: var(--bg); }

.chips { margin-top: 6px; }
.chip.candidate { background: #e4edff; color: var(--accent); font-weight: 600; }
.chip.ok { background: #e3f5e8; color: #1f7a3d; }

.badge-big {
  display: inline-block; background: #e4edff; color: var(--accent); font-weight: 700;
  padding: 6px 14px; border-radius: 999px; font-size: 13px; margin: 6px 0 10px;
}

.section { margin: 20px 0; padding-top: 14px; border-top: 1px solid var(--line); }
.section:first-of-type { border-top: none; padding-top: 0; }
.section h3 { margin: 0 0 8px; font-size: 15px; }
.section-note { color: var(--muted); font-size: 12px; margin: 2px 0 10px; }

.pillbox { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.pill { background: var(--chip-bg); border-radius: 8px; padding: 4px 10px; font-size: 13px; }

.metric-table { width: 100%; border-collapse: collapse; font-size: 13px; margin: 6px 0; }
.metric-table th, .metric-table td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.metric-table th { color: var(--muted); font-weight: 600; }

.allow-list { color: #1f7a3d; }
.restrict-list { color: #9c2b2b; }

.compat-block { background: #f7f9fd; border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; margin: 6px 0; }
.compat-block h4 { margin: 0 0 6px; font-size: 14px; }

details.raw-details { margin-top: 20px; }
details.raw-details summary { cursor: pointer; color: var(--muted); font-size: 13px; }

/* Process Studio */
.studio-steps { display: flex; flex-direction: column; gap: 14px; margin: 16px 0; }
.studio-step { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 16px; }
.studio-step-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.studio-step-name { font-weight: 700; }
.studio-step-link { margin-left: auto; color: var(--accent); text-decoration: none; font-size: 13px; }
.studio-step-link:hover { text-decoration: underline; }
.step-field { margin: 10px 0; }
.step-field-label { font-size: 12px; color: var(--muted); font-weight: 600; margin-bottom: 4px; }
.role-select { padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; font-size: 14px; min-width: 260px; }
.pillbox-pick { gap: 6px; }
.pill-check { display: inline-flex; align-items: center; gap: 6px; background: var(--chip-bg); border-radius: 8px; padding: 4px 10px; font-size: 13px; cursor: pointer; border: 1px solid transparent; }
.pill-check.checked { background: #e4edff; border-color: var(--accent); color: var(--accent); font-weight: 600; }
.pill-check input { margin: 0; }
.param-input { width: 100%; max-width: 480px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; font-size: 14px; }
.studio-savebar { display: flex; gap: 10px; align-items: center; margin: 18px 0; flex-wrap: wrap; }
.primary-btn { background: var(--accent); color: #fff; border-color: var(--accent); font-weight: 600; }
.primary-btn:hover { background: #1c40a0; }
.save-status { font-size: 13px; color: var(--muted); }
.current-row { background: #f3f7ff; }

/* Реестр */
.registry-entry { margin-bottom: 20px; }
.registry-entry-head { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.registry-entry-head h2 { margin: 0; }
.package-block { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; margin: 10px 0; }
.package-block.demo-block { border-style: dashed; }
.package-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 4px; }
.rights-row { padding: 8px 0; border-bottom: 1px dashed var(--line); }
.rights-role { font-weight: 600; color: var(--accent); text-decoration: none; }
.rights-role:hover { text-decoration: underline; }
.empty.small { font-size: 13px; padding: 4px 0; }

.stage-track { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 10px 0; }
.stage-node { display: flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.stage-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.stage-arrow { color: var(--muted); }
.stage-node.stage-done { background: #e3f5e8; color: #1f7a3d; }
.stage-node.stage-done .stage-dot { background: #1f7a3d; }
.stage-node.stage-current { background: #e4edff; color: var(--accent); }
.stage-node.stage-current .stage-dot { background: var(--accent); }
.stage-node.stage-pending { background: var(--chip-bg); color: var(--muted); }
.stage-node.stage-pending .stage-dot { background: var(--muted); }
.stage-node.stage-legend { background: var(--chip-bg); color: var(--ink); }
.stage-node.stage-legend .stage-dot { background: var(--muted); }

@media (max-width: 640px) {
  .role-select { min-width: 0; width: 100%; }
  .studio-step-link { margin-left: 0; }
  main { padding: 14px 12px 40px; }
  header.top { padding: 12px 14px; }
  .kv { grid-template-columns: 1fr; }
  .kv div.k { font-weight: 600; }
}
