/* User-facing pages. Loaded after app.css, whose components are reused only
   inside «Подробности». */
:root {
  --site-bg: #f6f7f9;
  --site-text: #1f2933;
  --site-muted: #616e7c;
  --site-line: #e1e5ea;
  --site-accent: #2b6cb0;
  --site-accent-dark: #245a93;
  --site-ok: #2f7a4f;
  --site-bad: #b4372f;
  --site-warn: #9a6b12;
}
body.site { background: var(--site-bg); color: var(--site-text); font: 15px/1.5 "Segoe UI", system-ui, -apple-system, sans-serif; }
body.site main.site-main { max-width: 760px; margin: 0 auto; padding: 36px 16px 72px; }
.site-head { display: flex; align-items: center; justify-content: space-between; gap: 12px 20px; flex-wrap: wrap; margin-bottom: 28px; }
.site-head h1 { margin: 0; font-size: 26px; font-weight: 600; letter-spacing: -0.01em; }
.site-head h1 a { color: inherit; text-decoration: none; }

.conn { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--site-muted); }
.conn .dot { width: 8px; height: 8px; border-radius: 50%; background: #c3c9d0; flex: none; }
.conn .dot.on { background: var(--site-ok); }
.conn .dot.wait { background: #d4a02a; }
.conn .dot.ready { background: transparent; box-shadow: inset 0 0 0 2px var(--site-ok); }
.conn button.link { color: var(--site-accent); font-size: 14px; padding: 0 0 0 4px; }
.site-head-side { display: flex; align-items: center; gap: 8px 18px; flex-wrap: wrap; }
.account button.link { color: var(--site-muted); font-size: 14px; padding: 0; }
.login { max-width: 380px; }
.login h2 { margin: 0 0 14px; font-size: 20px; font-weight: 600; }
.login form { display: grid; gap: 6px; }
.login label { font-size: 14px; color: var(--site-muted); margin-top: 6px; }
.login input { font: inherit; padding: 8px 10px; border: 1px solid var(--site-line); border-radius: 6px; background: #fff; color: inherit; }
.login input:focus { outline: 2px solid var(--site-accent); outline-offset: 0; border-color: var(--site-accent); }
.login .btn { justify-self: start; margin-top: 12px; }
.login .alert { margin: 0 0 8px; }

.connect:empty { display: none; }
.connect { margin: -6px 0 22px; padding: 16px 18px; background: #fff; border: 1px solid var(--site-line); border-radius: 10px; }
.connect .btn { display: inline-block; width: auto; padding: 10px 22px; }
.connect .buttons { display: flex; gap: 10px; flex-wrap: wrap; }
.connect .hint, .connect .hint.lead { text-align: left; }
.connect .hint:last-child { margin-bottom: 0; }

.catalog { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 600px) { .catalog { grid-template-columns: 1fr; } }
.sc-card { display: flex; align-items: flex-start; gap: 12px; padding: 16px 18px; background: #fff; border: 1px solid var(--site-line);
  border-radius: 10px; color: inherit; cursor: pointer; user-select: none; transition: border-color .15s, background-color .15s; }
.sc-card:hover { border-color: #b9c6d6; }
.sc-card:focus-within { border-color: var(--site-accent); }
.sc-card.selected { border-color: var(--site-accent); background: #f3f7fc; }
.sc-card:has(input:disabled) { cursor: default; }
.sc-card input[type=checkbox] { flex: none; width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--site-accent); cursor: inherit; }
.sc-card .sc-text { display: flex; flex-direction: column; min-width: 0; }
.sc-card .name { font-size: 16px; font-weight: 600; }
.sc-card .note { margin-top: 2px; font-size: 13px; color: var(--site-muted); }
.tests-head { margin: 22px 2px 8px; font-size: 13px; color: var(--site-muted); }

.selbar { display: flex; align-items: baseline; gap: 14px; min-height: 21px; margin: 14px 2px 0; font-size: 14px; color: var(--site-muted); }
.selbar button.link { color: var(--site-accent); font-size: 14px; padding: 0; }
.config { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.config:empty { display: none; }
details.sc-config { background: #fff; border: 1px solid var(--site-line); border-radius: 10px; }
details.sc-config > summary { display: flex; align-items: baseline; gap: 10px; padding: 14px 18px; cursor: pointer; user-select: none; list-style: none; }
details.sc-config > summary::-webkit-details-marker { display: none; }
details.sc-config > summary::before { content: "▸"; width: 10px; color: var(--site-muted); transition: transform .15s; }
details.sc-config[open] > summary::before { transform: rotate(90deg); }
details.sc-config > summary .name { font-weight: 600; }
details.sc-config > summary .note { font-size: 13px; color: var(--site-muted); }
details.sc-config[open] > summary { border-bottom: 1px solid var(--site-line); }
details.sc-config > .sc-body { padding: 16px 18px 4px; }
details.sc-config > .notice { padding: 14px 18px; }
.opt-section { margin: 4px 0 10px; font-size: 13px; font-weight: 600; color: var(--site-muted); }

.panel { margin-top: 16px; padding: 20px 22px; background: #fff; border: 1px solid var(--site-line); border-radius: 10px; }
.panel .field, .sc-config .field { margin: 0 0 14px; }
.panel .field > label, .sc-config .field > label { font-size: 14px; color: var(--site-muted); }
.panel .muted, .sc-config .muted { font-size: 13px; }
.notice { margin: 0; color: var(--site-muted); }
.notice strong { display: block; color: var(--site-text); font-size: 16px; margin-bottom: 2px; }
details.extra { margin: 4px 0 6px; }
details.extra > summary, details.more > summary { cursor: pointer; color: var(--site-accent); font-size: 14px; user-select: none; }
details.extra[open] > summary { margin-bottom: 12px; }

.action { margin-top: 16px; }
.btn { display: block; width: 100%; box-sizing: border-box; padding: 12px 16px; border: none; border-radius: 8px;
  background: var(--site-accent); color: #fff; font: 600 16px/1.3 inherit; text-align: center; text-decoration: none; cursor: pointer; }
.btn:hover { background: var(--site-accent-dark); }
.btn:disabled { opacity: .55; cursor: default; }
.btn.quiet { background: #fff; color: var(--site-accent); border: 1px solid var(--site-line); font-weight: 500; font-size: 15px; }
.hint { margin: 10px 0 0; color: var(--site-muted); font-size: 14px; text-align: center; }
.hint.lead { color: var(--site-text); font-size: 16px; margin: 0 0 12px; }
.hint.warn { color: var(--site-warn); }

.progress-box { margin-top: 16px; }
.progress-box .row { display: flex; justify-content: space-between; gap: 12px; font-size: 15px; }
.bar { height: 6px; margin: 8px 0 6px; border-radius: 3px; background: #e7ebef; overflow: hidden; }
.bar > div { height: 100%; width: 0; background: var(--site-accent); transition: width .3s; }
.result { margin-top: 16px; padding: 14px 16px; border-radius: 8px; background: #fff; border: 1px solid var(--site-line); border-left-width: 4px; }
.result strong { font-size: 16px; }
.result.ok { border-left-color: var(--site-ok); }
.result.ok strong { color: var(--site-ok); }
.result.bad { border-left-color: var(--site-bad); }
.result.bad strong { color: var(--site-bad); }
.result.warn { border-left-color: var(--site-warn); }
.op-items { list-style: none; margin: 12px 0 0; padding: 0; background: #fff; border: 1px solid var(--site-line); border-radius: 10px; }
.op-item { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; align-items: center; gap: 2px 12px; padding: 10px 16px;
  border-top: 1px solid var(--site-line); }
.op-item:first-child { border-top: none; }
.op-item .mark { width: 22px; height: 22px; border-radius: 50%; background: #e3e7ec; color: var(--site-muted); font-size: 12px; font-weight: 600;
  line-height: 22px; text-align: center; }
.op-item.busy .mark { background: var(--site-accent); color: #fff; }
.op-item.ok .mark { background: var(--site-ok); color: #fff; }
.op-item.bad .mark { background: var(--site-bad); color: #fff; }
.op-item.warn .mark { background: #d4a02a; color: #fff; }
.op-item .state { font-size: 13px; color: var(--site-muted); text-align: right; }
.op-item.ok .state { color: var(--site-ok); }
.op-item.bad .state { color: var(--site-bad); }
.op-item.idle .name { color: var(--site-muted); }
.op-item .err { grid-column: 2 / 4; font-size: 13px; color: var(--site-bad); }
details.more { margin-top: 12px; }
details.more .card { margin: 10px 0 0; box-shadow: none; overflow-wrap: anywhere; }
/* The diagnostic view is two columns in the admin page; here it is stacked. */
details.more .cols { grid-template-columns: 1fr; }
details.more .kv > span { min-width: 120px; }
.field-error { margin-top: 2px; }

/* 0.5.0: phase of the active scenario, indeterminate progress, restart prompt */
.bar { position: relative; }
.bar > .pulse { position: absolute; top: 0; height: 100%; background: linear-gradient(90deg, transparent 0, var(--site-accent) 50%, transparent 100%);
  background-size: 60% 100%; background-repeat: no-repeat; opacity: .55; animation: esl-indeterminate 1.6s ease-in-out infinite; transition: none; }
@keyframes esl-indeterminate { from { background-position: -60% 0; } to { background-position: 160% 0; } }
@media (prefers-reduced-motion: reduce) { .bar > .pulse { animation: none; background: var(--site-accent); opacity: .25; } }
.progress-box .phase { margin-top: 4px; font-size: 14px; }
.progress-box .phase-note { font-size: 13px; color: var(--site-muted); }
.progress-box .phase-note { margin-top: 2px; }
.helper-hint { margin: 12px 0 4px; }
.helper-hint .hint { text-align: left; margin: 0 0 10px; }
.helper-hint .buttons { display: flex; gap: 10px; flex-wrap: wrap; }
.reboot:empty, #reboot:empty { display: none; }
.reboot { margin-top: 16px; padding: 14px 16px; background: #fff; border: 1px solid var(--site-line); border-left: 4px solid var(--site-accent); border-radius: 8px; }
.reboot p { margin: 0 0 10px; }
.reboot .buttons { display: flex; gap: 10px; flex-wrap: wrap; }
.reboot .btn { display: inline-block; width: auto; padding: 10px 22px; }
.reboot.compact { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding: 10px 16px; font-size: 14px; }

/* 0.8.0: a question of the running step («POSiFLORA сейчас открыта… Закрыть принудительно?») */
#prompt:empty { display: none; }
.prompt { margin-top: 16px; padding: 14px 16px; background: #fff; border: 1px solid var(--site-line); border-left: 4px solid var(--site-accent); border-radius: 8px; }
.prompt p { margin: 0 0 10px; }
.prompt .muted { margin: -4px 0 10px; font-size: 13px; }
.prompt .buttons { display: flex; gap: 10px; flex-wrap: wrap; }
.prompt .btn { display: inline-block; width: auto; padding: 10px 22px; }
