/* HydraSlug — application styles. Light and dark themes, fluid from phone to desktop. */
:root {
  --bg: #f2f6f6; --card: #ffffff; --text: #0f1f24; --muted: #566b70; --line: #d8e3e4; --soft: #ecf3f3;
  --brand: #0b7a75; --brand-2: #14b8a6; --accent: #e8890c; --bar: #0b3540; --bar-text: #e6fffb;
  --ok: #0f9d6b; --warn: #c27803; --bad: #d92d20; --ok-bg: #e7f7f0; --warn-bg: #fff6e0; --bad-bg: #fdecea;
  --radius: 12px; --shadow: 0 1px 2px rgba(15, 23, 42, .06), 0 6px 20px rgba(15, 23, 42, .06);
  --nav-w: 264px; --top-h: 54px;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #081417; --card: #0f2025; --text: #e4f1f1; --muted: #93adb0; --line: #1f3a40; --soft: #142a30;
    --brand: #2dd4bf; --brand-2: #14b8a6; --bar: #06191e; --bar-text: #d5f5f0;
    --ok: #34d399; --warn: #fbbf24; --bad: #f87171; --ok-bg: #0e2a22; --warn-bg: #2d2408; --bad-bg: #331616;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .35);
  }
}
:root[data-theme="dark"] {
  --bg: #081417; --card: #0f2025; --text: #e4f1f1; --muted: #93adb0; --line: #1f3a40; --soft: #142a30;
  --brand: #2dd4bf; --brand-2: #14b8a6; --bar: #06191e; --bar-text: #d5f5f0;
  --ok: #34d399; --warn: #fbbf24; --bad: #f87171; --ok-bg: #0e2a22; --warn-bg: #2d2408; --bad-bg: #331616;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .35);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--text); font-size: 15px; line-height: 1.5; overflow-x: hidden; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .4em; text-wrap: balance; }
h1 { font-size: clamp(1.25rem, 1rem + 1.2vw, 1.75rem); } h2 { font-size: 1.1rem; } h3 { font-size: 1rem; }
p { margin: 0 0 .8em; } a { color: var(--brand); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--brand-2); outline-offset: 2px; border-radius: 6px; }
.skip { position: absolute; left: -999px; top: 0; background: var(--card); padding: 8px 12px; z-index: 100; }
.skip:focus { left: 8px; top: 8px; }
.noscript { padding: 24px; }

/* top bar */
.topbar { position: sticky; top: 0; z-index: 40; height: var(--top-h); display: flex; align-items: center; gap: 8px; padding: 0 12px; padding-left: max(12px, env(safe-area-inset-left)); padding-right: max(12px, env(safe-area-inset-right)); background: linear-gradient(90deg, var(--bar), #0f5f63); color: var(--bar-text); box-shadow: 0 2px 10px rgba(0, 0, 0, .18); }
:root[data-theme="dark"] .topbar { background: linear-gradient(90deg, #06191e, #0c3138); }
.brand { display: flex; align-items: center; gap: 8px; color: inherit; text-decoration: none; font-weight: 700; letter-spacing: .2px; }
.brand img { border-radius: 8px; }
.icon-btn, .arrow-btn { background: rgba(255, 255, 255, .1); color: inherit; border: 1px solid rgba(255, 255, 255, .16); border-radius: 10px; min-width: 38px; height: 38px; cursor: pointer; font-size: 18px; display: grid; place-items: center; transition: background .15s, transform .15s; }
.icon-btn:hover, .arrow-btn:hover:not(:disabled) { background: rgba(255, 255, 255, .22); }
.arrows { display: flex; gap: 6px; margin-left: 4px; }
.arrow-btn { font-size: 20px; font-weight: 700; background: linear-gradient(180deg, #2dd4bf, #0b8f86); border: 0; color: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, .25); width: 42px; }
.arrow-btn:hover:not(:disabled) { transform: translateY(-1px); background: linear-gradient(180deg, #5eead4, #0ea39a); }
.arrow-btn:active:not(:disabled) { transform: translateY(1px); }
.arrow-btn:disabled { opacity: .35; cursor: default; box-shadow: none; }
.crumb { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; opacity: .95; padding-left: 4px; }
.case-chip { max-width: 190px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; background: rgba(255, 255, 255, .12); color: inherit; text-decoration: none; padding: 5px 10px; border-radius: 999px; font-size: 12.5px; border: 1px solid rgba(255, 255, 255, .18); }
.case-chip::before { content: "🗂 "; }
.net { font-size: 12px; padding: 4px 9px; border-radius: 999px; font-weight: 600; }
.net.on { background: rgba(52, 211, 153, .2); color: #a7f3d0; } .net.off { background: rgba(251, 191, 36, .22); color: #fde68a; }
.net::before { content: "● "; }
.install-btn { background: var(--accent); color: #fff; border: 0; border-radius: 10px; height: 38px; padding: 0 12px; font-weight: 700; cursor: pointer; white-space: nowrap; box-shadow: 0 2px 6px rgba(0, 0, 0, .25); }
.install-btn.ready { animation: pulse 2.2s ease-in-out 3; }
@keyframes pulse { 50% { box-shadow: 0 0 0 7px rgba(232, 137, 12, .35); } }
#menuBtn { display: none; }

/* layout */
.layout { display: flex; min-height: calc(100vh - var(--top-h)); }
.nav { width: var(--nav-w); flex: none; background: var(--card); border-right: 1px solid var(--line); padding: 10px 8px 24px; position: sticky; top: var(--top-h); height: calc(100vh - var(--top-h)); overflow-y: auto; overscroll-behavior: contain; }
.nav-title { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); padding: 12px 10px 4px; font-weight: 700; }
.nav-link { display: flex; align-items: center; gap: 9px; padding: 8px 10px; border-radius: 9px; color: var(--text); text-decoration: none; font-size: 14px; position: relative; }
.nav-link:hover { background: var(--soft); }
.nav-link.on { background: linear-gradient(90deg, rgba(20, 184, 166, .18), rgba(20, 184, 166, .05)); color: var(--brand); font-weight: 700; box-shadow: inset 3px 0 0 var(--brand-2); }
.nav-ico { width: 22px; text-align: center; } .nav-label { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--line); } .nav-dot.on { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-bg); }
.content { flex: 1; min-width: 0; display: flex; flex-direction: column; }
main { flex: 1; padding: 18px clamp(12px, 2.4vw, 30px) 8px; max-width: 1500px; width: 100%; margin: 0 auto; outline: none; }
.foot { text-align: center; color: var(--muted); font-size: 12px; padding: 10px 12px calc(14px + env(safe-area-inset-bottom)); }
.scrim { display: none; }

/* pager arrows */
.pager { display: flex; align-items: stretch; justify-content: space-between; gap: 10px; padding: 14px clamp(12px, 2.4vw, 30px); max-width: 1500px; width: 100%; margin: 0 auto; }
.pager-btn { flex: 1 1 0; max-width: 360px; display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); color: var(--text); text-decoration: none; box-shadow: var(--shadow); transition: transform .15s, border-color .15s; min-width: 0; }
.pager-btn.next { flex-direction: row-reverse; text-align: right; margin-left: auto; }
.pager-btn:hover { transform: translateY(-2px); border-color: var(--brand-2); }
.pager-btn.disabled { visibility: hidden; }
.pg-arrow { flex: none; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; font-size: 22px; font-weight: 800; color: #fff; background: linear-gradient(135deg, #2dd4bf, #0b7a75); box-shadow: 0 3px 10px rgba(11, 122, 117, .4); transition: transform .2s; }
.pager-btn.prev:hover .pg-arrow { transform: translateX(-4px); } .pager-btn.next:hover .pg-arrow { transform: translateX(4px); }
.pg-text { min-width: 0; display: flex; flex-direction: column; } .pg-text small { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; }
.pg-text b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pager-pos { align-self: center; color: var(--muted); font-size: 12px; white-space: nowrap; }

/* generic blocks */
.card, .group { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); margin: 0 0 16px; min-width: 0; }
fieldset.group { min-inline-size: 0; }
.group > legend { font-weight: 700; padding: 0 8px; font-size: .98rem; display: flex; align-items: center; gap: 6px; float: left; width: 100%; margin: 0 0 10px; }
.group > legend + * { clear: both; }
.group > legend small { font-weight: 500; color: var(--muted); }
.page-head, .suite-head { margin-bottom: 14px; } .page-head p, .suite-title p { color: var(--muted); margin: 0; max-width: 90ch; }
.sect { margin: 22px 0 10px; }
.note { color: var(--muted); font-size: 13px; } .bad { color: var(--bad); } .ok { color: var(--ok); } .warn { color: var(--warn); }
.summary { font-size: 1.02rem; background: var(--soft); border-left: 4px solid var(--brand-2); padding: 10px 14px; border-radius: 8px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 38px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); color: var(--text); cursor: pointer; font-weight: 600; text-decoration: none; transition: background .15s, transform .1s, border-color .15s; white-space: nowrap; }
.btn:hover:not(:disabled) { border-color: var(--brand-2); background: var(--soft); } .btn:active:not(:disabled) { transform: translateY(1px); }
.btn.primary { background: linear-gradient(180deg, #1296d4, #0b7a75); border-color: #0b7a75; color: #fff; } .btn.primary:hover:not(:disabled) { background: linear-gradient(180deg, #23a6e4, #0d7dba); }
.btn.ghost { background: transparent; } .btn.danger { color: var(--bad); border-color: var(--bad); }
.btn:disabled { opacity: .55; cursor: progress; }
.btn.mini, button.mini { min-height: 28px; padding: 0 9px; font-size: 12.5px; border-radius: 8px; border: 1px solid var(--line); background: var(--card); cursor: pointer; font-weight: 600; color: var(--text); }
button.mini.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.linklike { background: none; border: 0; color: var(--brand); cursor: pointer; padding: 4px 0; text-align: left; }
.row-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 8px 0; }
.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; background: var(--soft); color: var(--muted); }
.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); }
.pill { margin-left: 6px; background: var(--brand-2); color: #fff; border-radius: 999px; padding: 0 7px; font-size: 11px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-block; padding: 4px 10px; border-radius: 999px; background: var(--soft); border: 1px solid var(--line); font-size: 12.5px; color: var(--muted); text-decoration: none; }
.chip.on { background: var(--ok-bg); border-color: transparent; color: var(--ok); font-weight: 600; } a.chip:hover { border-color: var(--brand-2); color: var(--brand); }
details.ref { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px; margin-bottom: 10px; }
details.ref summary { cursor: pointer; font-weight: 600; } details.ref p { margin: 8px 0 0; color: var(--muted); }
.steps { padding-left: 1.25em; margin: 8px 0; } .steps li { margin: 5px 0; } .steps li.hl { background: var(--warn-bg); padding: 4px 8px; border-radius: 8px; }
.empty { text-align: center; padding: 46px 16px; color: var(--muted); } .empty-art { font-size: 52px; color: var(--brand-2); line-height: 1; animation: spin 14s linear infinite; display: inline-block; } .empty h3 { color: var(--text); margin-top: 8px; }
.loading { display: flex; align-items: center; gap: 12px; padding: 40px 10px; color: var(--muted); }
.spinner { width: 22px; height: 22px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--brand-2); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* help tooltip */
.help { display: inline-grid; place-items: center; width: 17px; height: 17px; border-radius: 50%; background: var(--soft); border: 1px solid var(--line); color: var(--muted); font-size: 11px; font-weight: 700; cursor: help; position: relative; margin-left: 5px; flex: none; }
.help:hover::after, .help:focus::after { content: attr(data-tip); position: absolute; z-index: 30; left: 50%; bottom: calc(100% + 8px); transform: translateX(-50%); width: max-content; max-width: min(300px, 76vw); background: #0f172a; color: #f1f5f9; padding: 8px 10px; border-radius: 8px; font-size: 12.5px; font-weight: 400; line-height: 1.4; white-space: normal; text-align: left; box-shadow: 0 6px 20px rgba(0, 0, 0, .3); pointer-events: none; }

/* forms */
.groups { display: block; }
.fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px 18px; } .fields.one { grid-template-columns: 1fr 1fr; }
.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; } .field.wide { grid-column: 1 / -1; }
.field > label { font-size: 13px; font-weight: 600; display: flex; align-items: center; flex-wrap: wrap; gap: 2px; }
.ctl { min-width: 0; } .inp { display: flex; align-items: stretch; }
input[type=number], input[type=text], input[type=search], select, textarea { width: 100%; min-height: 38px; padding: 6px 10px; border-radius: 9px; border: 1px solid var(--line); background: var(--card); color: var(--text); min-width: 0; }
input:hover, select:hover, textarea:hover { border-color: var(--brand-2); }
input[aria-invalid=true] { border-color: var(--bad); background: var(--bad-bg); }
.inp input { border-top-right-radius: 0; border-bottom-right-radius: 0; } .inp input:only-child { border-radius: 9px; }
.unit { display: grid; place-items: center; padding: 0 9px; background: var(--soft); border: 1px solid var(--line); border-left: 0; border-radius: 0 9px 9px 0; font-size: 12px; color: var(--muted); white-space: nowrap; }
.field-msg { font-size: 11.5px; min-height: 0; } .field-msg.bad { color: var(--bad); } .field-msg.warn { color: var(--warn); }
.link-chip { margin-left: 6px; font-size: 11px; font-weight: 600; color: var(--brand); background: rgba(20, 184, 166, .12); padding: 1px 7px; border-radius: 999px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.switch { position: relative; display: inline-block; width: 46px; height: 26px; } .switch input { opacity: 0; width: 100%; height: 100%; position: absolute; margin: 0; cursor: pointer; z-index: 1; }
.slider { position: absolute; inset: 0; background: var(--line); border-radius: 999px; transition: .2s; } .slider::before { content: ""; position: absolute; width: 20px; height: 20px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .2s; box-shadow: 0 1px 3px rgba(0, 0, 0, .3); }
.switch input:checked + .slider { background: var(--brand-2); } .switch input:checked + .slider::before { transform: translateX(20px); } .switch input:focus-visible + .slider { outline: 3px solid var(--brand-2); outline-offset: 2px; }
label.inline { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; } label.inline input { width: 80px; }
.ions { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 6px; }
.ion { display: flex; align-items: center; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; background: var(--card); }
.ion span { width: 48px; flex: none; text-align: center; font-size: 12.5px; font-weight: 700; background: var(--soft); align-self: stretch; display: grid; place-items: center; }
.ion input { border: 0; border-radius: 0; min-height: 34px; padding: 4px 6px; }
.ion-sum { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 8px; font-size: 12.5px; color: var(--muted); } .ion-sum b { color: var(--text); }
.linkbar { background: rgba(20, 184, 166, .08); border: 1px dashed var(--brand-2); border-radius: var(--radius); padding: 10px 14px; margin-bottom: 14px; font-size: 13.5px; display: block; }
.linkbar summary { cursor: pointer; font-weight: 600; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; } .linkbar.quiet { border-style: solid; border-color: var(--line); background: var(--soft); color: var(--muted); }
.linkbar .chip { margin: 2px; } .linklist { margin: 8px 0; padding-left: 1.2em; } .linklist small { color: var(--muted); }

/* suite header, tabs */
.suite-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 12px; }
.suite-title { display: flex; gap: 12px; align-items: flex-start; min-width: 0; flex: 1 1 420px; }
.suite-num { flex: none; width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center; font-weight: 800; font-size: 20px; color: #fff; background: linear-gradient(135deg, #14b8a6, #0b3a5b); box-shadow: var(--shadow); }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; } .actions select { width: auto; max-width: 220px; }
.statusline { display: flex; align-items: center; gap: 12px; min-height: 22px; margin-bottom: 6px; } .run-status { font-size: 13px; color: var(--muted); }
.progress { flex: 1; height: 6px; background: var(--line); border-radius: 999px; overflow: hidden; } .progress i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #14b8a6, #22d3ee); transition: width .25s; }
.tabs { display: flex; gap: 4px; overflow-x: auto; border-bottom: 2px solid var(--line); margin-bottom: 14px; scrollbar-width: thin; position: sticky; top: var(--top-h); background: var(--bg); z-index: 20; padding-top: 6px; }
.tab { flex: none; background: none; border: 0; padding: 9px 13px; cursor: pointer; font-weight: 600; color: var(--muted); border-bottom: 3px solid transparent; margin-bottom: -2px; border-radius: 8px 8px 0 0; }
.tab:hover { color: var(--text); background: var(--soft); } .tab.on { color: var(--brand); border-bottom-color: var(--brand-2); }

/* results */
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(158px, 1fr)); gap: 10px; margin: 0 0 14px; }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; border-left: 4px solid var(--brand-2); min-width: 0; }
.kpi.ok { border-left-color: var(--ok); } .kpi.warn { border-left-color: var(--warn); background: var(--warn-bg); } .kpi.bad { border-left-color: var(--bad); background: var(--bad-bg); }
.kpi-l { font-size: 12px; color: var(--muted); } .kpi-v { font-size: 1.22rem; font-weight: 700; overflow-wrap: anywhere; } .kpi-v small { font-size: .72rem; font-weight: 500; color: var(--muted); }
.warns { display: grid; gap: 6px; margin-bottom: 12px; }
.warns > .warn { padding: 8px 12px; border-radius: 9px; font-size: 13.5px; color: var(--text); }
.warns .info { background: var(--ok-bg); } .warns .warn { background: var(--warn-bg); } .warns .bad { background: var(--bad-bg); } .warns b { margin-right: 4px; }
.recs { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px; margin-bottom: 12px; } .recs ul { margin: 4px 0 0; padding-left: 1.2em; }
.plots { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 440px), 1fr)); gap: 14px; margin-bottom: 16px; }
.plot { margin: 0; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 10px 6px; box-shadow: var(--shadow); min-width: 0; }
.plot figcaption { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; font-weight: 600; font-size: 13.5px; margin-bottom: 4px; } .plot-tools { display: flex; gap: 4px; flex: none; }
.plot-wrap { position: relative; } .plot canvas { width: 100%; display: block; touch-action: pan-y; }
.plot-tip { position: absolute; background: #0f172a; color: #f8fafc; padding: 3px 8px; border-radius: 6px; font-size: 12px; pointer-events: none; white-space: nowrap; z-index: 5; }
.tblbox { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; margin-bottom: 14px; box-shadow: var(--shadow); min-width: 0; }
.tbl-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 6px; }
.tbl-scroll { overflow: auto; max-height: 460px; border-radius: 8px; -webkit-overflow-scrolling: touch; } .tbl-scroll.edit { max-height: 340px; border: 1px solid var(--line); }
.tbl { border-collapse: collapse; width: 100%; font-size: 13px; }
.tbl th { position: sticky; top: 0; background: var(--soft); text-align: right; padding: 7px 9px; white-space: nowrap; font-weight: 700; border-bottom: 2px solid var(--line); z-index: 1; } .tbl th:first-child { text-align: left; }
.tbl td { padding: 5px 9px; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; } .tbl td.lead, .tbl td:first-child { text-align: left; } .tbl td.num { font-variant-numeric: tabular-nums; }
.tbl tbody tr:hover { background: var(--soft); } .tbl td input { min-height: 30px; padding: 3px 6px; min-width: 84px; } .tbl td input[type=checkbox] { min-width: 0; width: 18px; min-height: 18px; }
.tbl.chain td.kp { white-space: normal; text-align: left; min-width: 260px; color: var(--muted); font-size: 12.5px; } .tbl.chain td { text-align: left; }

/* home */
.hero { display: grid; grid-template-columns: 1.15fr 1fr; gap: 18px; align-items: center; background: linear-gradient(135deg, rgba(20, 184, 166, .16), rgba(11, 53, 64, .08)); border: 1px solid var(--line); border-radius: 18px; padding: clamp(16px, 3vw, 30px); margin-bottom: 8px; }
.hero h1 { font-size: clamp(1.4rem, 1rem + 1.8vw, 2.1rem); } .hero p { color: var(--muted); max-width: 62ch; } .hero .kpis { margin: 0; }
.suite-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.suite-card { display: flex; flex-direction: column; gap: 4px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px; text-decoration: none; color: var(--text); box-shadow: var(--shadow); transition: transform .15s, border-color .15s; min-width: 0; }
.suite-card:hover { transform: translateY(-3px); border-color: var(--brand-2); } .suite-card.done { border-top: 3px solid var(--ok); }
.sc-top { display: flex; align-items: center; gap: 8px; } .sc-ico { font-size: 24px; } .sc-num { font-weight: 800; color: var(--muted); flex: 1; }
.suite-card h3 { margin: 4px 0 0; font-size: .98rem; } .suite-card p { color: var(--muted); font-size: 13px; margin: 0; }
.sc-kpi { list-style: none; padding: 0; margin: 6px 0 0; font-size: 12.5px; color: var(--muted); } .sc-links { margin-top: auto; padding-top: 8px; font-size: 11.5px; color: var(--muted); }
.flowmap { display: grid; gap: 8px; } .fm-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; } .fm-arrow { color: var(--brand-2); font-weight: 800; }

/* site page */
.site-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px; }
.map { position: relative; height: 380px; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); cursor: crosshair; touch-action: none; user-select: none;
  background: repeating-linear-gradient(0deg, transparent 0 39px, rgba(20, 184, 166, .18) 39px 40px), repeating-linear-gradient(90deg, transparent 0 39px, rgba(20, 184, 166, .18) 39px 40px), #b9d9ea; }
.map-layer img { position: absolute; width: 256px; height: 256px; pointer-events: none; }
.map-pin { position: absolute; font-size: 30px; transform: translate(-50%, -92%); pointer-events: none; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .4)); z-index: 2; }
.map-zoom { position: absolute; right: 10px; top: 10px; display: grid; gap: 4px; z-index: 3; } .map-zoom button { width: 36px; height: 36px; border-radius: 9px; border: 1px solid #94a3b8; background: #fff; color: #0f172a; font-size: 20px; font-weight: 700; cursor: pointer; }
.map-attr { position: absolute; right: 4px; bottom: 2px; font-size: 10px; background: rgba(255, 255, 255, .78); color: #334155; padding: 1px 5px; border-radius: 4px; z-index: 3; }
.search-results { list-style: none; margin: 0 0 6px; padding: 0; }
.sources { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; margin-top: 10px; }
.source { display: grid; gap: 1px; padding: 9px 11px; border-radius: 10px; border: 1px solid var(--line); border-left: 4px solid var(--line); background: var(--card); font-size: 12.5px; min-width: 0; overflow-wrap: anywhere; }
.source small { color: var(--muted); } .source em { font-style: normal; font-weight: 600; color: var(--muted); } .source span { color: var(--muted); }
.source.ok { border-left-color: var(--ok); } .source.ok em { color: var(--ok); } .source.fail { border-left-color: var(--warn); } .source.fail em { color: var(--warn); } .source.loading { border-left-color: var(--brand-2); } .source .btn { justify-self: start; margin-top: 4px; }

/* portal */
.drop { border: 2px dashed var(--brand-2); border-radius: 16px; padding: 34px 16px; text-align: center; cursor: pointer; display: grid; gap: 4px; justify-items: center; background: rgba(20, 184, 166, .05); transition: background .15s; }
.drop:hover, .drop.over { background: rgba(20, 184, 166, .14); } .drop-ico { font-size: 34px; color: var(--brand-2); } .drop span { color: var(--muted); font-size: 13px; }
.formats { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; margin-top: 14px; } .formats div { display: grid; font-size: 13px; } .formats span { color: var(--muted); }

/* process-flow diagram (suite 3) */
.pfd { display: grid; gap: 14px; } .pfd-row { display: flex; flex-wrap: wrap; align-items: stretch; gap: 6px; }
.pfd-unit { background: var(--card); border: 1px solid var(--line); border-top: 4px solid var(--brand-2); border-radius: 10px; padding: 8px 10px; min-width: 120px; max-width: 200px; font-size: 12.5px; box-shadow: var(--shadow); }
.pfd-unit b { display: block; font-size: 13px; } .pfd-arrow { align-self: center; color: var(--brand-2); font-weight: 800; font-size: 18px; } .pfd-stream { align-self: center; font-size: 11.5px; color: var(--muted); max-width: 120px; }

/* toasts and update bar */
.toasts { position: fixed; right: 14px; bottom: calc(14px + env(safe-area-inset-bottom)); display: grid; gap: 8px; z-index: 90; max-width: min(380px, calc(100vw - 28px)); }
.toast { background: #0f172a; color: #f8fafc; padding: 10px 14px; border-radius: 10px; box-shadow: 0 8px 24px rgba(0, 0, 0, .3); border-left: 4px solid var(--brand-2); font-size: 13.5px; animation: rise .25s ease-out; transition: opacity .3s, transform .3s; }
.toast.ok { border-left-color: #34d399; } .toast.warn { border-left-color: #fbbf24; } .toast.bad { border-left-color: #f87171; } .toast.out { opacity: 0; transform: translateY(8px); }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }
.update-bar { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(16px + env(safe-area-inset-bottom)); background: #0f172a; color: #f8fafc; padding: 10px 14px; border-radius: 12px; z-index: 95; display: flex; align-items: center; gap: 8px; box-shadow: 0 8px 24px rgba(0, 0, 0, .35); font-size: 13.5px; max-width: calc(100vw - 24px); }
.update-bar .mini.ghost { color: #cbd5e1; }

/* responsive */
@media (max-width: 1000px) {
  #menuBtn { display: grid; }
  .nav { position: fixed; left: 0; top: var(--top-h); bottom: 0; height: auto; z-index: 60; transform: translateX(-105%); transition: transform .22s ease; box-shadow: 8px 0 30px rgba(0, 0, 0, .25); width: min(84vw, 300px); padding-bottom: calc(24px + env(safe-area-inset-bottom)); }
  body.nav-open .nav { transform: none; } body.nav-open .scrim { display: block; position: fixed; inset: var(--top-h) 0 0 0; background: rgba(15, 23, 42, .45); z-index: 50; }
  .hero, .site-grid { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .crumb, .case-chip { display: none; } .arrows { margin-left: auto; } .install-btn span { display: none; } .brand-name { display: none; }
  .net { font-size: 0; padding: 0; width: 12px; height: 12px; } .net::before { font-size: 14px; content: "●"; }
  .fields { grid-template-columns: 1fr; } .fields.one { grid-template-columns: 1fr 1fr; } .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .card, .group { padding: 12px; } .pager-pos { display: none; } .pg-arrow { width: 38px; height: 38px; } .map { height: 300px; }
  .actions { width: 100%; } .actions .btn.primary { flex: 1; }
  .card .btn, .group .btn { white-space: normal; text-align: center; padding-top: 6px; padding-bottom: 6px; } .source { overflow-wrap: anywhere; word-break: break-word; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }
@media print { .topbar, .nav, .pager, .foot, .tabs, .actions, .row-tools, .toasts { display: none !important; } body { background: #fff; } .card, .group, .plot, .tblbox { box-shadow: none; break-inside: avoid; } }
[hidden] { display: none !important; }
.tbl td.wrap { white-space: normal; min-width: 240px; }

/* decision support */
.advice { margin-top: 18px; } .rec-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); gap: 12px; margin: 10px 0; }
.rec { background: var(--card); border: 1px solid var(--line); border-left: 5px solid var(--brand-2); border-radius: var(--radius); padding: 12px 14px; box-shadow: var(--shadow); min-width: 0; }
.rec.p1 { border-left-color: var(--bad); } .rec.p2 { border-left-color: var(--warn); } .rec.p3 { border-left-color: var(--ok); }
.rec header { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 6px; } .rec header h3 { flex-basis: 100%; margin: 2px 0 0; }
.rec-area { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; font-weight: 700; }
.rec dl { margin: 0; display: grid; grid-template-columns: 1fr; gap: 2px; } .rec dt { font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; margin-top: 6px; } .rec dd { margin: 0; font-size: 13.5px; }
.evidence .linklist { font-size: 13px; } .evidence a { overflow-wrap: anywhere; }
.pillars { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 10px; margin-bottom: 14px; }
.pillar { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; min-width: 0; } .pillar p { margin: 6px 0 0; }
.pillar-top { display: flex; align-items: center; gap: 8px; } .pillar-top b { flex: 1; min-width: 0; } .pillar-score { font-size: 1.3rem; font-weight: 800; }
.meter { height: 9px; background: var(--line); border-radius: 999px; overflow: hidden; margin-top: 6px; } .meter i { display: block; height: 100%; border-radius: 999px; background: var(--muted); }
.pillar.ok .meter i { background: var(--ok); } .pillar.mid .meter i { background: var(--warn); } .pillar.low .meter i { background: var(--bad); } .pillar.na { opacity: .75; }

/* top-bar page arrows: one glass capsule with two round keys */
.arrows { display: inline-flex; align-items: center; gap: 0; margin-left: 6px; padding: 3px; border-radius: 999px; background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .22); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), 0 4px 14px rgba(0, 0, 0, .25); backdrop-filter: blur(6px); }
.arrow-sep { width: 1px; height: 18px; margin: 0 3px; background: rgba(255, 255, 255, .28); }
.arrow-btn { position: relative; width: 40px; min-width: 40px; height: 40px; border-radius: 50%; border: 0; display: grid; place-items: center; color: #fff; cursor: pointer; overflow: hidden;
  background: radial-gradient(120% 120% at 30% 20%, #5eead4 0%, #14b8a6 45%, #0f766e 100%); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .55), inset 0 -3px 6px rgba(3, 60, 100, .45), 0 2px 6px rgba(0, 0, 0, .3); transition: transform .18s cubic-bezier(.3, 1.6, .5, 1), box-shadow .18s, filter .18s; }
.arrow-btn::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: linear-gradient(180deg, rgba(255, 255, 255, .38), rgba(255, 255, 255, 0) 52%); pointer-events: none; }
.arrow-btn svg { position: relative; z-index: 1; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .35)); transition: transform .18s; }
.arrow-btn:hover:not(:disabled) { transform: scale(1.1); background: radial-gradient(120% 120% at 30% 20%, #ccfbf1 0%, #2dd4bf 45%, #0f766e 100%); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .6), 0 0 0 4px rgba(45, 212, 191, .28), 0 4px 12px rgba(20, 184, 166, .55); }
.arrow-btn.prev:hover:not(:disabled) svg { transform: translateX(-2px); } .arrow-btn.next:hover:not(:disabled) svg { transform: translateX(2px); }
.arrow-btn:active:not(:disabled) { transform: scale(.94); }
.arrow-btn:disabled { background: rgba(255, 255, 255, .12); color: rgba(255, 255, 255, .45); box-shadow: none; opacity: 1; cursor: default; } .arrow-btn:disabled::after { display: none; }

/* install button: warm gradient pill with an icon well and a passing shine */
.install-btn { position: relative; display: inline-flex; align-items: center; gap: 9px; height: 38px; padding: 0 16px 0 5px; border: 0; border-radius: 999px; color: #fff; font-weight: 700; letter-spacing: .2px; cursor: pointer; white-space: nowrap; overflow: hidden;
  background: linear-gradient(135deg, #fbbf24 0%, #e8890c 45%, #ea580c 100%); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5), inset 0 -2px 5px rgba(154, 52, 18, .45), 0 4px 14px rgba(249, 115, 22, .45); text-shadow: 0 1px 1px rgba(124, 45, 18, .45); transition: transform .18s cubic-bezier(.3, 1.6, .5, 1), box-shadow .18s, filter .18s; }
.install-ico { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, .24); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .55), inset 0 -1px 3px rgba(154, 52, 18, .35); font-style: normal; }
.install-ico svg { animation: nudge 2.4s ease-in-out infinite; }
.install-btn::before { content: ""; position: absolute; top: 0; bottom: 0; left: -60%; width: 45%; background: linear-gradient(100deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, .45), rgba(255, 255, 255, 0)); transform: skewX(-20deg); animation: shine 4.5s ease-in-out infinite; pointer-events: none; }
.install-btn:hover { transform: translateY(-1px) scale(1.03); filter: saturate(1.1); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .55), 0 0 0 4px rgba(251, 146, 60, .28), 0 8px 20px rgba(249, 115, 22, .55); }
.install-btn:active { transform: scale(.97); }
.install-btn.ready { animation: none; }
@keyframes shine { 0%, 62% { left: -60%; } 100% { left: 130%; } }
@keyframes nudge { 0%, 100% { transform: translateY(-1px); } 50% { transform: translateY(2px); } }
@media (max-width: 720px) { .install-btn { padding: 0 5px; gap: 0; } .install-btn span { display: none; } }
@media (min-width: 721px) { .tabs { flex-wrap: wrap; overflow-x: visible; row-gap: 0; } }
.kpi-v.txt { font-size: .98rem; line-height: 1.3; }

/* site page: one toolbar, full-width map, sources in an even grid */
.site-bar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; margin-bottom: 10px; }
.site-search { display: flex; gap: 8px; flex: 1 1 320px; min-width: 0; } .site-search input { flex: 1; }
.site-coord { display: grid; gap: 2px; font-size: 12px; font-weight: 600; color: var(--muted); width: 140px; }
.map { height: clamp(300px, 46vh, 520px); }
.sources { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
@media (max-width: 720px) { .site-coord { flex: 1 1 120px; width: auto; } .site-bar .btn { flex: 1 1 auto; } }

/* ---- balanced use of space: rows always fill their width, no orphan gaps ---- */
main:focus, main:focus-visible { outline: none; }
.fields, .kpis, .plots, .suite-grid, .rec-grid, .pillars, .sources, .formats { display: flex; flex-wrap: wrap; }
.fields { gap: 12px 18px; } .fields > .field { flex: 1 1 230px; max-width: 100%; } .fields > .field.wide { flex: 1 1 100%; }
.fields.one > .field { flex: 1 1 140px; }
.kpis > .kpi { flex: 1 1 158px; }
.plots > .plot { flex: 1 1 440px; max-width: 100%; }
.suite-grid > .suite-card { flex: 1 1 250px; }
.rec-grid > .rec { flex: 1 1 380px; max-width: 100%; }
.pillars > .pillar { flex: 1 1 300px; max-width: 100%; }
.sources > .source { flex: 1 1 280px; max-width: 100%; }
.formats > div { flex: 1 1 220px; }
.ions { grid-template-columns: repeat(6, minmax(0, 1fr)); }
@media (min-width: 1500px) { .ions { grid-template-columns: repeat(9, minmax(0, 1fr)); } }
@media (max-width: 720px) { .ions { grid-template-columns: repeat(3, minmax(0, 1fr)); } .ion span { width: 40px; } }
@media (max-width: 400px) { .ions { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.row-tools select { width: auto; flex: 1 1 220px; max-width: 380px; }
.row-tools input[type=search] { flex: 1 1 220px; }
/* on/off inputs sit on one line instead of leaving an empty block under the label */
.fields > .field:has(> .ctl > .switch) { flex-direction: row; align-items: center; justify-content: space-between; gap: 12px; border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; background: var(--soft); min-height: 46px; align-self: flex-end; }
/* groups that hold only a few controls share a row instead of each taking a full-width card */
.groups { display: flex; flex-wrap: wrap; gap: 16px; align-items: stretch; } .groups > * { flex: 1 1 100%; margin: 0; min-width: 0; }
.groups > fieldset.group.small { flex: 1 1 340px; }
.card > h2 + .note, .card > p:last-child { margin-bottom: 0; }
.empty { padding: 28px 16px; }

.fields { align-items: flex-end; }
.suite-card.whole { background: linear-gradient(135deg, rgba(20, 184, 166, .12), rgba(20, 184, 166, .03)); border-style: dashed; }
.fm-row { display: grid; grid-template-columns: minmax(130px, 180px) 22px 1fr; align-items: start; gap: 6px; padding: 5px 0; border-bottom: 1px dashed var(--line); } .fm-row:last-child { border-bottom: 0; }
.fm-row > .chip { justify-self: start; } .fm-to { display: flex; flex-wrap: wrap; gap: 6px; } .fm-arrow { padding-top: 3px; text-align: center; }
@media (max-width: 720px) { .fm-row { grid-template-columns: 1fr; } .fm-arrow { display: none; } .fm-to { padding-left: 14px; } }
.kpis > .kpi { flex: 1 1 max(158px, 22%); }

/* page-to-page arrows at the foot of every page */
.pager { align-items: center; gap: 14px; padding-top: 18px; padding-bottom: 6px; }
.pager-btn { position: relative; max-width: 380px; padding: 9px 18px 9px 9px; gap: 14px; border-radius: 999px; border: 1px solid var(--line); background: linear-gradient(180deg, var(--card), var(--soft)); box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, .08); overflow: hidden; transition: transform .2s cubic-bezier(.3, 1.5, .5, 1), border-color .2s, box-shadow .2s; }
.pager-btn.next { padding: 9px 9px 9px 18px; }
.pager-btn::before { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(20, 184, 166, .16), rgba(20, 184, 166, 0) 60%); opacity: 0; transition: opacity .2s; pointer-events: none; }
.pager-btn.next::before { background: linear-gradient(270deg, rgba(20, 184, 166, .16), rgba(20, 184, 166, 0) 60%); }
.pager-btn:hover { transform: translateY(-2px); border-color: var(--brand-2); box-shadow: 0 10px 26px rgba(20, 184, 166, .22), inset 0 1px 0 rgba(255, 255, 255, .1); } .pager-btn:hover::before { opacity: 1; }
.pg-arrow { position: relative; width: 46px; height: 46px; border-radius: 50%; flex: none; display: block; background: radial-gradient(120% 120% at 30% 20%, #5eead4 0%, #14b8a6 45%, #0f766e 100%); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .55), inset 0 -4px 8px rgba(3, 60, 100, .45), 0 0 0 4px rgba(20, 184, 166, .16), 0 4px 12px rgba(2, 62, 104, .45); transition: transform .22s cubic-bezier(.3, 1.6, .5, 1), box-shadow .2s; }
.pg-arrow::before { content: ""; position: absolute; inset: 0; border-radius: 50%; background: linear-gradient(180deg, rgba(255, 255, 255, .4), rgba(255, 255, 255, 0) 52%); }
.pg-arrow::after { content: ""; position: absolute; left: 50%; top: 50%; width: 11px; height: 11px; border: solid #fff; border-width: 0 0 3px 3px; border-radius: 1px; transform: translate(-30%, -50%) rotate(45deg); filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .35)); }
.pager-btn.next .pg-arrow::after { transform: translate(-70%, -50%) rotate(-135deg); }
.pager-btn.prev:hover .pg-arrow { transform: translateX(-3px) scale(1.07); } .pager-btn.next:hover .pg-arrow { transform: translateX(3px) scale(1.07); }
.pager-btn:hover .pg-arrow { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .6), 0 0 0 6px rgba(45, 212, 191, .25), 0 6px 16px rgba(20, 184, 166, .55); }
.pg-text small { color: var(--brand); font-weight: 700; } .pg-text b { font-size: 1.02rem; }
.pager-pos { display: grid; justify-items: center; gap: 5px; font-size: 12px; color: var(--muted); min-width: 84px; } .pager-pos b { color: var(--text); font-size: 13px; display: inline; }
.pager-track { display: block; width: 84px; height: 5px; border-radius: 999px; background: var(--line); overflow: hidden; } .pager-track i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, #2dd4bf, #0b7a75); }
@media (max-width: 720px) { .pager-pos { display: none; } .pg-arrow { width: 40px; height: 40px; } .pager-btn { padding-right: 12px; } .pager-btn.next { padding-left: 12px; } }

/* theory lists: an even grid of equal-width entries instead of a ragged run of pills */
.chips { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); gap: 7px 8px; }
.chips > .chip { display: flex; align-items: center; gap: 6px; border-radius: 10px; padding: 7px 11px; line-height: 1.3; white-space: normal; min-height: 36px; }

/* integrated-run table: every header sits over its own column */
.tbl.chain { table-layout: auto; }
.tbl.chain th, .tbl.chain td { text-align: left; vertical-align: middle; padding: 9px 12px; }
.tbl.chain th:nth-child(1), .tbl.chain td:nth-child(1) { width: 52px; text-align: center; }
.tbl.chain th:nth-child(2), .tbl.chain td:nth-child(2) { width: 56px; text-align: center; color: var(--muted); }
.tbl.chain th:nth-child(3), .tbl.chain td:nth-child(3) { min-width: 250px; }
.tbl.chain th:nth-child(4), .tbl.chain td:nth-child(4) { width: 120px; white-space: nowrap; color: var(--muted); }
.tbl.chain th:nth-child(5), .tbl.chain td:nth-child(5) { width: 170px; white-space: nowrap; }
.tbl.chain td:nth-child(3) a { text-decoration: none; font-weight: 600; } .tbl.chain td:nth-child(3) a:hover { text-decoration: underline; }
.tbl.chain td input[type=checkbox] { width: 20px; height: 20px; min-height: 0; accent-color: var(--brand-2); cursor: pointer; }

.map-base { position: absolute; inset: 0; width: 100%; height: 100%; }
.map { background: #a9d3e8; }

.stamp { margin: -4px 0 10px; } .stamp .linklike { padding: 0; font-size: inherit; }
.changes { display: grid; gap: 10px; } .change { border: 1px solid var(--line); border-left: 4px solid var(--brand-2); border-radius: 10px; padding: 10px 12px; background: var(--card); }
.change dl { margin: 6px 0 0; } .change dt { font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; margin-top: 6px; } .change dd { margin: 0; font-size: 13.5px; }
