/* ==========================================================================
   Hlídač webů – vzhled. Barvy jsou tokeny; tmavý režim podle systému nebo
   ručně přes <html data-theme="dark|light">.
   ========================================================================== */
:root {
    --bg: #f1f3f8;
    --surface: #ffffff;
    --surface-2: #f7f8fc;
    --text: #1b1f2a;
    --muted: #667085;
    --line: #e4e7ef;
    --accent: #4f46e5;
    --accent-2: #7c3aed;
    --accent-soft: #eef0ff;
    --ok: #12805c;     --ok-bg: #e3f7ee;
    --bad: #c8312b;    --bad-bg: #fdeceb;
    --warn: #a15c07;   --warn-bg: #fff4dc;
    --info: #2563eb;   --info-bg: #e8f0ff;
    --side-bg: #171528;
    --side-bg-2: #211e38;
    --side-text: #b9b6d3;
    --side-text-hi: #ffffff;
    --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 4px 16px rgba(16, 24, 40, .06);
    --radius: 14px;
    --code-bg: #0f1222;
    --code-text: #e3e6ff;
    color-scheme: light;
}
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg: #0d0f17; --surface: #151824; --surface-2: #1b1f2e; --text: #e7e9f2; --muted: #98a0b5; --line: #262b3c;
        --accent: #8b85ff; --accent-2: #b48cff; --accent-soft: #23234a;
        --ok: #45d39a; --ok-bg: #12301f; --bad: #ff7b72; --bad-bg: #3a1716; --warn: #f5b84a; --warn-bg: #352710; --info: #7aa7ff; --info-bg: #17254a;
        --side-bg: #08090f; --side-bg-2: #131525; --side-text: #9c9bb8;
        --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 20px rgba(0, 0, 0, .25);
        --code-bg: #0a0c14;
        color-scheme: dark;
    }
}
:root[data-theme="dark"] {
    --bg: #0d0f17; --surface: #151824; --surface-2: #1b1f2e; --text: #e7e9f2; --muted: #98a0b5; --line: #262b3c;
    --accent: #8b85ff; --accent-2: #b48cff; --accent-soft: #23234a;
    --ok: #45d39a; --ok-bg: #12301f; --bad: #ff7b72; --bad-bg: #3a1716; --warn: #f5b84a; --warn-bg: #352710; --info: #7aa7ff; --info-bg: #17254a;
    --side-bg: #08090f; --side-bg-2: #131525; --side-text: #9c9bb8;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 20px rgba(0, 0, 0, .25);
    --code-bg: #0a0c14;
    color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { font: 15px/1.55 "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--text); -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 26px; line-height: 1.25; margin: 4px 0 18px; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; letter-spacing: -.02em; }
h2 { font-size: 17px; margin: 30px 0 12px; letter-spacing: -.01em; }
h3 { font-size: 15px; margin: 14px 0 6px; }
.card h2 { margin-top: 0; }
code, pre, textarea.code { font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; }
.ico { width: 18px; height: 18px; flex: none; }

/* ---------- rozvržení: boční menu + obsah ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar {
    width: 250px; flex: none; background: linear-gradient(180deg, var(--side-bg) 0%, var(--side-bg-2) 100%);
    color: var(--side-text); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; z-index: 30;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 20px 20px 18px; color: var(--side-text-hi); font-weight: 800; font-size: 17px; letter-spacing: -.01em; }
.brand:hover { text-decoration: none; }
.brand-logo { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: linear-gradient(135deg, var(--accent), var(--accent-2)); box-shadow: 0 6px 18px rgba(124, 58, 237, .45); }
.brand-logo .ico { width: 19px; height: 19px; color: #fff; }
.menu { display: flex; flex-direction: column; gap: 2px; padding: 4px 12px; }
.menu-label { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--side-text); opacity: .6; padding: 16px 10px 6px; }
.menu a.item { display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 10px; color: var(--side-text); font-weight: 500; position: relative; }
.menu a.item:hover { background: rgba(255, 255, 255, .06); color: var(--side-text-hi); text-decoration: none; }
.menu a.item.active { background: linear-gradient(90deg, var(--accent), var(--accent-2)); color: #fff; box-shadow: 0 4px 14px rgba(99, 102, 241, .35); }
.menu .pill { margin-left: auto; font-size: 11px; font-weight: 700; padding: 1px 8px; border-radius: 99px; background: #f59e0b; color: #1b1f2a; }
.menu .pill:empty { display: none; }
.menu .sub { display: flex; flex-direction: column; margin: 2px 0 6px 20px; padding-left: 12px; border-left: 1px solid rgba(255, 255, 255, .08); }
.menu .sub a { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 8px; color: var(--side-text); font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.menu .sub a:hover { color: var(--side-text-hi); background: rgba(255, 255, 255, .05); text-decoration: none; }
.menu .sub a.active { color: var(--side-text-hi); background: rgba(255, 255, 255, .09); }
.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: #6b7280; }
.dot-passed { background: #34d399; box-shadow: 0 0 0 3px rgba(52, 211, 153, .18); }
.dot-failed, .dot-error { background: #f87171; box-shadow: 0 0 0 3px rgba(248, 113, 113, .2); animation: pulse 1.6s infinite; }
.dot-flaky { background: #fbbf24; }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px rgba(248, 113, 113, 0); } }

.sidebar-foot { margin-top: auto; padding: 14px 16px 18px; display: flex; flex-direction: column; gap: 12px; border-top: 1px solid rgba(255, 255, 255, .06); }
.worker-state { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.theme-switch { display: flex; background: rgba(255, 255, 255, .06); border-radius: 10px; padding: 3px; }
.theme-switch button { flex: 1; background: none; border: 0; color: var(--side-text); padding: 6px; border-radius: 8px; cursor: pointer; display: grid; place-items: center; box-shadow: none; }
.theme-switch button:hover { color: var(--side-text-hi); }
.theme-switch button[aria-pressed="true"] { background: rgba(255, 255, 255, .14); color: var(--side-text-hi); }
.sidebar-foot a.logout { display: flex; align-items: center; gap: 10px; color: var(--side-text); font-size: 13.5px; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; gap: 12px; padding: 12px 28px; background: color-mix(in srgb, var(--surface) 85%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; min-height: 58px; }
.topbar .burger { display: none; background: none; border: 0; color: var(--text); padding: 6px; box-shadow: none; }
.topbar .title { font-weight: 600; color: var(--muted); font-size: 14px; }
.topbar .right { margin-left: auto; display: flex; gap: 10px; align-items: center; }
.live-chip { display: inline-flex; align-items: center; gap: 8px; padding: 5px 12px; border-radius: 99px; background: var(--accent-soft); color: var(--accent); font-weight: 600; font-size: 13px; }
.live-chip[hidden] { display: none; }
.live-chip .spinner { width: 12px; height: 12px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
main { width: 100%; max-width: 1180px; margin: 0 auto; padding: 26px 28px 70px; }

.backdrop { display: none; }
@media (max-width: 900px) {
    .sidebar { position: fixed; left: 0; top: 0; transform: translateX(-100%); transition: transform .25s ease; visibility: hidden; }
    body.nav-open .sidebar { transform: none; visibility: visible; box-shadow: 0 0 40px rgba(0, 0, 0, .35); }
    body.nav-open .backdrop { display: block; position: fixed; inset: 0; background: rgba(0, 0, 0, .4); z-index: 25; }
    .topbar { padding: 10px 16px; }
    .topbar .burger { display: grid; }
    main { padding: 20px 16px 60px; }
}

/* ---------- horní falešný progress bar ---------- */
#toploader { position: fixed; top: 0; left: 0; height: 3px; width: 0; z-index: 100; background: linear-gradient(90deg, var(--accent), var(--accent-2), #ec4899); box-shadow: 0 0 10px var(--accent); transition: width .3s ease, opacity .4s ease; opacity: 0; }
#toploader.on { opacity: 1; }

/* ---------- karty a mřížky ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 22px; margin-bottom: 16px; box-shadow: var(--shadow); overflow-x: auto; }
.card.ai { border-left: 4px solid var(--accent); background: linear-gradient(135deg, var(--accent-soft) 0%, var(--surface) 55%); }
.card.warn { background: var(--warn-bg); color: var(--warn); border-color: transparent; }
.card.flat { box-shadow: none; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
@media (max-width: 700px) { .cols { grid-template-columns: 1fr; } }
.row { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.row h2, .row h3 { margin: 0; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 18px; }
.actions form { margin: 0; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 8px; }
.stat { position: relative; overflow: hidden; display: flex; flex-direction: column; gap: 2px; padding: 16px 18px; margin: 0; }
.stat .label { color: var(--muted); font-size: 13px; font-weight: 500; }
.stat .value { font-size: 26px; font-weight: 800; letter-spacing: -.02em; }
.stat small { color: var(--muted); }
.stat .stat-ico { position: absolute; right: 14px; top: 14px; width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.stat.s-ok .stat-ico { background: var(--ok-bg); color: var(--ok); }
.stat.s-bad .stat-ico { background: var(--bad-bg); color: var(--bad); }
.stat.s-warn .stat-ico { background: var(--warn-bg); color: var(--warn); }

.site-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 16px; }
.site-card { margin: 0; display: flex; flex-direction: column; gap: 10px; border-top: 4px solid var(--line); }
.site-card.h-passed { border-top-color: var(--ok); }
.site-card.h-failed, .site-card.h-error { border-top-color: var(--bad); }
.site-card.h-flaky { border-top-color: var(--warn); }
.site-card h3 { margin: 0; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.site-card .url { font-size: 13px; color: var(--muted); }
.mini-list { display: flex; flex-direction: column; gap: 2px; }
.mini-list a { display: flex; align-items: center; gap: 8px; padding: 5px 8px; margin: 0 -8px; border-radius: 8px; color: var(--text); font-size: 14px; }
.mini-list a:hover { background: var(--surface-2); text-decoration: none; }
.mini-list .meta { margin-left: auto; color: var(--muted); font-size: 12px; }

/* ---------- tabulky ---------- */
table { width: 100%; border-collapse: collapse; }
td, th { padding: 9px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
tr:last-child td { border-bottom: 0; }
th { font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
tbody tr:hover td, table.hover tr:hover td { background: var(--surface-2); }
.steps .step-failed td { background: var(--bad-bg); }
.steps .step-skipped { opacity: .45; }

/* ---------- odznaky ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 10px; border-radius: 99px; font-size: 12px; font-weight: 650; background: var(--surface-2); color: var(--text); border: 1px solid var(--line); white-space: nowrap; }
.badge-passed { background: var(--ok-bg); color: var(--ok); border-color: transparent; }
.badge-failed, .badge-error { background: var(--bad-bg); color: var(--bad); border-color: transparent; }
.badge-flaky { background: var(--warn-bg); color: var(--warn); border-color: transparent; }
.badge-queued, .badge-running { background: var(--info-bg); color: var(--info); border-color: transparent; }
.badge-running::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: .2; } }
.badge.sev { background: var(--bad-bg); color: var(--bad); border-color: transparent; font-weight: 600; }
.badge.platform { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.badge.src-ai { background: linear-gradient(90deg, var(--accent), var(--accent-2)); color: #fff; border: 0; }
h1 .badge { font-size: 13px; }

/* ---------- formuláře a tlačítka ---------- */
label { display: block; margin-bottom: 14px; font-weight: 550; font-size: 14px; }
label.check { display: flex; align-items: center; gap: 8px; }
input:not([type=checkbox]):not([type=radio]), textarea, select {
    display: block; width: 100%; margin-top: 5px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px;
    font: inherit; font-weight: 400; background: var(--surface-2); color: var(--text); transition: border-color .15s, box-shadow .15s;
}
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
button, .button {
    display: inline-flex; align-items: center; gap: 8px; background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; border: 0;
    border-radius: 10px; padding: 9px 16px; font: inherit; font-weight: 650; font-size: 14px; cursor: pointer; text-decoration: none;
    box-shadow: 0 4px 12px rgba(99, 102, 241, .28); transition: transform .12s ease, box-shadow .12s ease, filter .12s;
}
button:hover, .button:hover { transform: translateY(-1px); filter: brightness(1.05); text-decoration: none; box-shadow: 0 6px 16px rgba(99, 102, 241, .35); }
button:active { transform: none; }
button .ico, .button .ico { width: 16px; height: 16px; }
button.secondary, .button.secondary { background: var(--surface); color: var(--text); border: 1px solid var(--line); box-shadow: none; }
button.secondary:hover, .button.secondary:hover { border-color: var(--accent); color: var(--accent); }
button.danger { background: var(--bad); box-shadow: none; }
button.ghost { background: none; color: var(--muted); box-shadow: none; padding: 6px 8px; }
form.inline { display: inline-flex; gap: 8px; margin: 0; }

/* ---------- hlášky ---------- */
.flash { display: flex; gap: 10px; align-items: flex-start; background: var(--info-bg); color: var(--info); padding: 12px 16px; border-radius: 12px; margin-bottom: 18px; font-weight: 500; }
.error { color: var(--bad); }
p.warn { background: var(--warn-bg); color: var(--warn); padding: 10px 14px; border-radius: 10px; }
.muted { color: var(--muted); }
.small, small { font-size: 13px; }
.ok { color: var(--ok); } .bad { color: var(--bad); } .warnc { color: var(--warn); }
.headline { font-size: 18px; font-weight: 700; margin: 4px 0 8px; }
pre { white-space: pre-wrap; word-break: break-word; background: var(--surface-2); padding: 12px; border-radius: 10px; margin: 0; }

/* ---------- progress bar běhu ---------- */
.progress { height: 12px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--line); overflow: hidden; position: relative; }
.progress > span { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, var(--accent), var(--accent-2), #ec4899); background-size: 200% 100%; animation: flow 2s linear infinite; transition: width .6s ease; }
.progress.indeterminate > span { width: 35% !important; position: absolute; animation: slide 1.4s ease-in-out infinite, flow 2s linear infinite; }
.progress.done > span { animation: none; background: var(--ok); }
.progress.fail > span { animation: none; background: var(--bad); }
@keyframes flow { to { background-position: -200% 0; } }
@keyframes slide { 0% { left: -35%; } 100% { left: 100%; } }
.progress-meta { display: flex; justify-content: space-between; gap: 12px; margin-top: 8px; font-size: 13px; color: var(--muted); }
.progress-meta b { color: var(--text); font-weight: 600; white-space: nowrap; }
.progress-meta span { overflow-wrap: anywhere; }
.live-card { border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--line)); }

.active-runs { display: flex; flex-direction: column; gap: 14px; }
.active-run a { color: var(--text); font-weight: 600; }
.active-run .progress { height: 8px; margin-top: 6px; }

/* ---------- log ---------- */
.log { font-family: "JetBrains Mono", ui-monospace, Menlo, monospace; font-size: 12.5px; background: var(--code-bg); color: var(--code-text); border-radius: 12px; padding: 12px 14px; max-height: 520px; overflow-y: auto; }
.log.tall { max-height: 70vh; }
.log .line { display: grid; grid-template-columns: max-content max-content minmax(0, 1fr); gap: 10px; padding: 3px 0; border-bottom: 1px solid rgba(255, 255, 255, .04); animation: fadein .4s ease; }
.log .line .t { color: #7c83a6; }
.log .line .src { color: #a5b4fc; }
.log .lvl-success .msg { color: #6ee7b7; }
.log .lvl-warn .msg { color: #fcd34d; }
.log .lvl-error .msg { color: #fca5a5; }
.log .lvl-debug .msg { color: #8b91ad; }
.log .line a { color: #93c5fd; }
.log .empty { color: #7c83a6; padding: 10px 0; }
@keyframes fadein { from { background: rgba(139, 133, 255, .18); } }
.log-tools { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.log-tools select { width: auto; margin: 0; }

/* ---------- šablony scénářů ---------- */
.tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(235px, 1fr)); gap: 12px; margin-bottom: 8px; }
.tpl { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; color: var(--text); background: var(--surface-2); transition: border-color .15s, transform .15s, box-shadow .15s; }
a.tpl:hover { border-color: var(--accent); text-decoration: none; transform: translateY(-2px); box-shadow: var(--shadow); }
.tpl.active { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.tpl.disabled { opacity: .5; cursor: not-allowed; }
.tpl .tags { margin-top: auto; color: var(--muted); }
.templates h3 { margin-top: 18px; }

/* ---------- audit ---------- */
.score { font-size: 30px; font-weight: 800; letter-spacing: -.03em; }
h1 .score { font-size: 22px; padding: 2px 12px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); }
.checks { margin: 8px 0 0; padding-left: 0; list-style: none; }
.checks li { margin: 6px 0; }
.audit-fail td { background: var(--bad-bg); }
.audit-warn td { background: var(--warn-bg); }

/* ---------- návod ---------- */
.guide-steps { counter-reset: step; list-style: none; padding: 0; margin: 0; }
.guide-steps > li { counter-increment: step; position: relative; padding: 0 0 22px 52px; }
.guide-steps > li::before { content: counter(step); position: absolute; left: 0; top: 0; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; color: #fff; background: linear-gradient(135deg, var(--accent), var(--accent-2)); }
.guide-steps > li::after { content: ""; position: absolute; left: 16px; top: 38px; bottom: 4px; width: 2px; background: var(--line); }
.guide-steps > li:last-child::after { display: none; }
.guide-steps h3 { margin: 5px 0 6px; }
.codeblock { position: relative; margin-top: 10px; }
.codeblock pre { background: var(--code-bg); color: var(--code-text); padding: 14px 16px; padding-right: 90px; }
.codeblock button { position: absolute; top: 8px; right: 8px; padding: 4px 10px; font-size: 12px; box-shadow: none; }
.facts { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }

/* ---------- modální okna ---------- */
dialog { border: 0; border-radius: 18px; padding: 0; width: min(860px, calc(100vw - 32px)); background: var(--surface); color: var(--text); box-shadow: 0 30px 80px rgba(0, 0, 0, .35); }
dialog::backdrop { background: rgba(10, 10, 25, .55); backdrop-filter: blur(3px); }
.dialog-head { display: flex; align-items: center; gap: 10px; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.dialog-head h2 { margin: 0; }
.dialog-head .ghost { margin-left: auto; font-size: 20px; }
.dialog-body { padding: 18px 22px; }
.dialog-body textarea { height: 52vh; resize: vertical; }
.dialog-foot { display: flex; gap: 10px; justify-content: flex-end; align-items: center; padding: 14px 22px; border-top: 1px solid var(--line); }

#overlay { position: fixed; inset: 0; z-index: 90; display: none; place-items: center; background: rgba(10, 10, 25, .55); backdrop-filter: blur(4px); padding: 16px; }
#overlay.on { display: grid; }
#overlay .box { width: min(520px, 100%); background: var(--surface); border-radius: 18px; padding: 26px; box-shadow: 0 30px 80px rgba(0, 0, 0, .35); text-align: center; }
#overlay .box h3 { margin: 0 0 6px; font-size: 18px; }
#overlay .box p { margin: 0 0 16px; color: var(--muted); min-height: 1.5em; }
#overlay .overlay-foot { display: flex; justify-content: space-between; margin-top: 10px; }
#overlay .pct { font-weight: 700; color: var(--accent); }
.overlay-steps { list-style: none; margin: 14px 0 0; padding: 10px 0 0; border-top: 1px solid var(--line); max-height: 220px; overflow-y: auto; text-align: left; font-size: 13.5px; }
.overlay-steps:empty { display: none; }
.overlay-steps li { padding: 4px 0; animation: fadein .4s ease; }
.overlay-steps li .small { color: var(--muted); margin: 2px 0 0 20px; display: flex; flex-wrap: wrap; gap: 4px 12px; }

/* ---------- přihlášení ---------- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 16px; background: radial-gradient(1200px 600px at 10% -10%, rgba(124, 58, 237, .25), transparent), radial-gradient(900px 500px at 110% 110%, rgba(79, 70, 229, .25), transparent), var(--bg); }
.login { width: min(380px, 100%); padding: 30px; }
.login .brand { padding: 0 0 18px; color: var(--text); }

.meta { display: flex; gap: 24px; flex-wrap: wrap; }
.shots { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.shots img { width: 100%; border: 1px solid var(--line); border-radius: 10px; max-height: 360px; object-fit: cover; object-position: top; }
figure { margin: 0; } figcaption { font-size: 13px; color: var(--muted); margin-top: 4px; }
.diff-del li { color: var(--bad); } .diff-add li { color: var(--ok); }
details > summary { cursor: pointer; font-weight: 650; }
details[open] > summary { margin-bottom: 10px; }
.kv td:first-child { color: var(--muted); width: 38%; }

@media print {
    .sidebar, .topbar, .actions, .no-print, #toploader { display: none !important; }
    .card { box-shadow: none; border: 0; }
    main { padding: 0; }
}

details.mail { border-bottom: 1px solid var(--line); padding: 10px 0; }
details.mail:last-child { border-bottom: 0; }
details.mail summary { font-weight: 500; }
details.mail pre { margin-top: 10px; font-size: 13px; }
fieldset[disabled] input, fieldset[disabled] select { cursor: not-allowed; }

/* hromadný výběr šablon */
.tpl-check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 8px; margin-bottom: 6px; }
.tpl-check { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; margin: 0; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); cursor: pointer; font-weight: 500; transition: border-color .15s, box-shadow .15s; }
.tpl-check:hover { border-color: var(--accent); }
.tpl-check:has(input:checked) { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); background: var(--surface); }
.tpl-check.disabled { opacity: .45; cursor: not-allowed; }
.tpl-check input { margin-top: 3px; accent-color: var(--accent); width: 16px; height: 16px; flex: none; }
.tpl-check span { display: flex; flex-direction: column; gap: 2px; line-height: 1.35; }
.bulk-bar { position: sticky; bottom: 0; display: flex; gap: 14px; align-items: center; flex-wrap: wrap; margin: 16px -22px -18px; padding: 14px 22px; background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(8px); border-top: 1px solid var(--line); border-radius: 0 0 var(--radius) var(--radius); }
button:disabled { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }
.batch-list { display: flex; flex-direction: column; gap: 12px; }
.batch-item .progress { height: 8px; margin-top: 6px; }
.batch-item .row a { color: var(--text); font-weight: 600; }

/* kotvové menu sekcí na detailu webu (přilepené pod horní lištou) */
html { scroll-behavior: smooth; }
.section-nav {
    position: sticky; top: 58px; z-index: 15; display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none;
    margin: -6px -28px 20px; padding: 10px 28px; background: color-mix(in srgb, var(--bg) 88%, transparent);
    backdrop-filter: blur(10px); border-bottom: 1px solid var(--line);
}
.section-nav::-webkit-scrollbar { display: none; }
.section-nav a {
    flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 99px;
    color: var(--muted); font-weight: 600; font-size: 14px; white-space: nowrap; transition: background .15s, color .15s;
}
.section-nav a:hover { color: var(--text); background: var(--surface); text-decoration: none; }
.section-nav a.active { color: #fff; background: linear-gradient(135deg, var(--accent), var(--accent-2)); box-shadow: 0 4px 12px rgba(99, 102, 241, .3); }
.section-nav a.active .muted { color: rgba(255, 255, 255, .8); }
.pill-score { font-size: 11px; font-weight: 800; padding: 1px 7px; border-radius: 99px; background: var(--surface-2); }
.pill-score.ok { color: var(--ok); } .pill-score.bad { color: var(--bad); } .pill-score.warnc { color: var(--warn); }
.section-nav a.active .pill-score { background: rgba(255, 255, 255, .22); color: #fff; }
.site-section { scroll-margin-top: 130px; }
.site-section > h2:first-child { margin-top: 26px; }
@media (max-width: 900px) {
    .section-nav { top: 54px; margin: -4px -16px 16px; padding: 8px 16px; }
}

/* klikací dlaždice a filtrovaný seznam */
a.stat-link { color: var(--text); text-decoration: none; transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease; }
a.stat-link:hover { text-decoration: none; transform: translateY(-2px); border-color: var(--accent); box-shadow: 0 8px 22px rgba(99, 102, 241, .14); }
a.stat-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 16px; }
.chip { padding: 5px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); font-size: 13px; font-weight: 500; }
.chip:hover { color: var(--text); text-decoration: none; border-color: var(--accent); }
.chip.active { color: #fff; background: var(--accent); border-color: var(--accent); }
.list-group h2 a { color: var(--text); }
.list-group td { vertical-align: top; }
.worker-explain { margin-top: 14px; padding: 12px 14px; border-radius: 10px; background: var(--surface-2); }
.worker-explain p { margin: 0 0 8px; }
.worker-explain ul { margin: 0 0 8px; padding-left: 18px; }
.worker-explain li { margin-bottom: 4px; }
.worker-explain > :last-child { margin-bottom: 0; }
/* hromadné přidání webů */
.bulk-sites-head, .bulk-site-row { display: grid; grid-template-columns: 1fr 1.3fr 1.2fr 36px; gap: 8px; align-items: center; }
.bulk-sites-head { margin: 8px 0 4px; font-weight: 600; }
.bulk-sites { display: flex; flex-direction: column; gap: 8px; }
.bulk-site-row input { margin: 0; }
.bulk-site-row .bulk-err { grid-column: 1 / -1; margin: -4px 0 0; }
@media (max-width: 720px) {
    .bulk-sites-head { display: none; }
    .bulk-site-row { grid-template-columns: 1fr 36px; padding: 10px; border: 1px solid var(--line); border-radius: 10px; }
    .bulk-site-row input { grid-column: 1; }
    .bulk-site-row [data-bulk-remove] { grid-column: 2; grid-row: 1; }
}
/* vypínače pravidelných akcí */
label.toggle-row { align-items: flex-start; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); margin: 0; }
label.toggle-row input { margin-top: 3px; width: 18px; height: 18px; flex: none; }
.paused-banner { display: flex; gap: 10px; align-items: center; padding: 10px 14px; margin-bottom: 16px; border-radius: 10px; background: var(--warn-bg); color: var(--text); font-size: 14px; }
.paused-banner a { margin-left: auto; white-space: nowrap; }
a.count-link { color: var(--muted); text-decoration: none; border-bottom: 1px dashed currentColor; }
a.count-link.ok { color: var(--ok); } a.count-link.bad { color: var(--bad); } a.count-link.warnc { color: var(--warn); }
a.count-link.ok .muted, a.count-link.bad .muted, a.count-link.warnc .muted { color: inherit; opacity: .75; }
a.count-link:hover { text-decoration: none; border-bottom-style: solid; }
/* správa scénářů na detailu webu */
.pause-bar { padding: 12px 16px; margin-bottom: 12px; }
.pause-bar.is-paused { background: var(--warn-bg); border-color: transparent; }
.bulk-actions { padding-bottom: 10px; margin-bottom: 6px; border-bottom: 1px solid var(--line); flex-wrap: wrap; gap: 8px; }
.bulk-actions button { padding: 6px 10px; font-size: 13px; }
.scenario-table td { vertical-align: middle; }
.scenario-table tr.is-off td:nth-child(2) { opacity: .6; }
.scenario-table tr.is-paused { background: color-mix(in srgb, var(--warn-bg) 55%, transparent); }
.row-actions { white-space: nowrap; text-align: right; width: 1%; }
.row-actions .button.ghost, .row-actions button.ghost { display: inline-flex; align-items: center; gap: 4px; padding: 5px 8px; font-size: 13px; background: none; color: var(--muted); box-shadow: none; border: 0; }
.row-actions .button.ghost:hover, .row-actions button.ghost:hover { color: var(--text); background: var(--surface-2); text-decoration: none; }
.row-actions button.ghost.ok { color: var(--ok); }
.row-menu { display: inline-block; position: relative; }
.row-menu summary { list-style: none; cursor: pointer; }
.row-menu summary::-webkit-details-marker { display: none; }
.row-menu-list { position: absolute; right: 0; top: calc(100% + 4px); z-index: 20; min-width: 200px; display: flex; flex-direction: column; padding: 6px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); }
.row-menu-list button { background: none; color: var(--text); box-shadow: none; text-align: left; padding: 8px 10px; font-size: 13px; border-radius: 8px; justify-content: flex-start; }
.row-menu-list button:hover { background: var(--surface-2); }
.row-menu-list button.bad { color: var(--bad); }
@media (max-width: 720px) {
    .row-actions { white-space: normal; }
    .row-actions .button.ghost { display: none; }
}
