/* SAFE TRAVEL, the Analysis page as it was before the «Studio» look (owner, 2026-11-27: «preferivo prima»), inside the
   skeleton every demo shares. First the skeleton's rules (rail, top band), then the page's own earlier rules. */
:root {
    --bg: #eaf4fb;
    --card: #fff;
    --line: #cfe3f1;
    --line-2: #e3eff8;
    --line-3: #eaf2f8;
    --field: #f7fbfe;
    --ink: #0c2233;
    --ink-2: #274155;
    --muted: #4a6478;
    --accent: #0369a1;
    --accent-d: #025d8f;
    --tint: #dff0fb;
    --tint-2: #eef6fc;
    --bar: #0ea5e9;
    --green: #16a34a;
    --amber: #d97706;
    --red: #dc2626;
    --cost: #a16207;
    --sans: 'DM Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    --mono: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
    --pay-progress: #0369a1;
}
:root {
    --paper: #eceff3;
    --card: #fbfcfd;
    --recess: #e1e7ed;
    --rule: #cbd3dc;
    --rule-2: #8f9cab;
    --ink: #11202c;
    --ink-2: #2f414e;
    --muted: #4c5b69;
    --faint: #586775;

    --accent: #0b6e99;
    --accent-d: #085a7e;
    --pay-progress: #0369a1;   /* "In corso" status + the current month's amount (css/demo-stats.css) */
    --accent-hi: #0a7db0;
    --accent-l: rgba(11, 110, 153, .08);
    --signal: #b93a0a;
    --signal-l: rgba(185, 58, 10, .09);
    --green: #2c6a2a;
    --green-l: rgba(44, 106, 42, .10);
    --amber: #84560a;
    --amber-l: rgba(132, 86, 10, .11);
    --red: #b93a0a;
    --red-l: rgba(185, 58, 10, .09);
    --slate: #4c5b69;

    --serif: 'Instrument Serif', 'Iowan Old Style', Georgia, 'Times New Roman', serif;
    --sans: 'DM Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    --mono: 'IBM Plex Mono', ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;

    --radius: 4px;
    --radius-sm: 3px;
    --shadow: 0 1px 0 rgba(17, 32, 44, .04), 0 6px 18px -12px rgba(17, 32, 44, .25);
    --shadow-hover: 0 10px 28px -14px rgba(17, 32, 44, .35);

    --hdr-h: 60px;

    /* Alias storici (markup/inline legacy) */
    --text: var(--ink);
    --text-secondary: var(--ink-2);
    --line: var(--rule);
    --line-strong: var(--rule-2);
    --border: var(--rule);
    --border2: var(--rule-2);
    --panel: var(--recess);
    --surface: var(--card);
    --white: #fff;
    --headings: var(--serif);
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
.mb-2 { margin-bottom: .5rem; }
.mb-3 { margin-bottom: 1rem; }
html { -webkit-text-size-adjust: 100%; }
body {
    background-color: var(--paper);
    /* Graticola: meridiani/paralleli sottili, maglia fine + maglia maggiore. Statica. */
    background-image:
        linear-gradient(rgba(17, 32, 44, .055) 1px, transparent 1px),
        linear-gradient(90deg, rgba(17, 32, 44, .055) 1px, transparent 1px),
        linear-gradient(rgba(11, 110, 153, .06) 1px, transparent 1px),
        linear-gradient(90deg, rgba(11, 110, 153, .06) 1px, transparent 1px);
    background-size: 192px 192px, 192px 192px, 32px 32px, 32px 32px;
    background-position: -1px -1px;
    color: var(--ink);
    font-family: var(--sans);
    font-size: 15px;
    line-height: 1.6;
    min-height: calc(100vh / var(--mv-zoom, 1));
    min-height: calc(100dvh / var(--mv-zoom, 1));
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4, h5 { font-family: var(--serif); font-weight: 400; letter-spacing: 0; color: var(--ink); }
::selection { background: var(--accent); color: #fff; }
:focus-visible { outline: 2px solid var(--accent-d); outline-offset: 2px; }
.badge-st {
    background: var(--signal-l); color: var(--signal);
    border: 1px dashed var(--signal);
    border-radius: 2px; padding: 2px 9px;
    font-family: var(--mono);
    font-size: 0.6875rem; font-weight: 600; letter-spacing: .12em;
    white-space: nowrap;
}
.content {
    flex: 1; display: flex; flex-direction: column;
    max-width: 1040px; width: 100%;
    margin: 0 auto;
    padding: 0 clamp(1rem, 3vw, 2rem) 3rem;
    position: relative; z-index: 1;
}
.sec-title {
    font-family: var(--mono);
    font-size: .72rem; font-weight: 600;
    letter-spacing: .16em; text-transform: uppercase;
    color: var(--ink);
    border-bottom: 1px solid var(--ink);
    padding-bottom: .5rem;
    margin: 2.5rem 0 1.25rem;
}
.st-hero {
    position: relative;
    text-align: center;
    margin: 2.25rem 0 0;
    padding: 1.5rem 0 .5rem;
    animation: heroFadeIn .7s cubic-bezier(.16, 1, .3, 1) both;
}
@keyframes heroFadeIn {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: translateY(0); }
}
.st-hero-inner { position: relative; z-index: 1; padding: 0 1rem; }
.st-hero-inner::before {
    content: "";
    display: block; width: 72px; height: 9px; margin: 0 auto .9rem;
    background:
        linear-gradient(var(--ink), var(--ink)) left center / 28px 1px no-repeat,
        linear-gradient(var(--ink), var(--ink)) right center / 28px 1px no-repeat,
        linear-gradient(var(--signal), var(--signal)) center / 7px 7px no-repeat;
}
.st-hero h1 {
    color: var(--ink);
    font-size: clamp(2rem, 1.35rem + 2.2vw, 3rem);
    line-height: 1.06;
    letter-spacing: -.005em;
    margin-bottom: .75rem;
}
.st-hero .lead {
    color: var(--ink-2);
    font-size: clamp(.9rem, 1.4vw, 1.05rem);
    max-width: 36rem;
    margin: 0 auto;
    line-height: 1.6;
}
.st-search, .form-card, .threat, .stat-card, .chart-box, .info-card, .ticket-bar, .no-ep {
    background: var(--card);
    border: 1px solid var(--rule-2);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.st-search, .form-card {
    position: relative;
    border-top: 3px solid var(--accent);
    padding: clamp(1.4rem, 3vw, 2rem);
    margin-bottom: 1.75rem;
}
.st-search { margin-top: 1.75rem; animation: searchFadeIn .6s .12s cubic-bezier(.16, 1, .3, 1) both; }
.form-card { margin-bottom: 1.5rem; }
@keyframes searchFadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}
.st-search::before, .st-search::after, .form-card::before, .form-card::after {
    content: ""; position: absolute; width: 11px; height: 11px; pointer-events: none;
    border: 0 solid var(--signal);
}
.st-search::before, .form-card::before { left: -6px; bottom: -6px; border-width: 0 0 2px 2px; }
.st-search::after, .form-card::after { right: -6px; bottom: -6px; border-width: 0 2px 2px 0; }
.st-search h2, .form-card h2 {
    font-size: 1.55rem; line-height: 1.15;
    color: var(--ink); margin-bottom: .2rem;
    display: flex; align-items: center; gap: .5rem;
}
.st-search h2 .ico, .form-card h2 .ico { color: var(--signal) !important; font-size: .9em; }
.st-search > p, .form-card > p {
    color: var(--muted); font-size: .86rem;
    margin-bottom: 1.35rem;
}
.form-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 1.25rem;
}
.form-row--2 { grid-template-columns: repeat(2, 1fr); }
.form-row > * { min-width: 0; }
.form-row-full { margin-bottom: 1.25rem; }
.field { min-width: 0; }
.field label {
    display: block;
    font-family: var(--mono);
    font-size: 0.6875rem; font-weight: 600;
    letter-spacing: .12em; text-transform: uppercase;
    color: var(--muted); margin-bottom: .35rem;
}
.field input, .field select, .field textarea {
    width: 100%; min-width: 0; max-width: 100%;
    background: #fff;
    border: 1px solid var(--rule-2);
    border-radius: var(--radius-sm);
    color: var(--ink); font-family: inherit;
    font-weight: 400; font-size: .92rem;
    padding: .65rem .85rem;
    min-height: 44px;
    outline: none;
    transition: border-color .15s, box-shadow .15s;
}
.field input[type="date"] {
    -webkit-appearance: none; appearance: none;
    display: block; box-sizing: border-box;
    width: 100%; min-width: 0; max-width: 100%;
    line-height: 1.2;
}
.field input[type="date"]::-webkit-date-and-time-value { text-align: left; min-height: 1.2em; }
.field textarea {
    resize: vertical; min-height: 110px;
    font-family: var(--mono); font-size: .8rem;
}
.field select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%2311202c' stroke-width='1.6' fill='none'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right .9rem center;
    padding-right: 2.2rem;
}
.field input::placeholder, .field textarea::placeholder { color: #8d99a5; font-style: italic; }
.field input:hover, .field select:hover, .field textarea:hover { border-color: var(--ink-2); }
.field input:focus, .field select:focus, .field textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(11, 110, 153, .18);
}
.field select option { background: #fff; color: var(--ink); }
.btn-go {
    width: 100%; min-height: 48px; padding: .8rem;
    background: var(--accent-d); color: #fff;
    border: 1px solid var(--accent-d);
    border-radius: var(--radius-sm);
    font-family: var(--mono);
    font-size: .78rem; font-weight: 600;
    letter-spacing: .16em; text-transform: uppercase;
    cursor: pointer;
    transition: background .15s, border-color .15s, transform .1s;
}
.btn-go:hover:not(:disabled) { background: var(--ink); border-color: var(--ink); }
.btn-go:active:not(:disabled) { transform: translateY(1px); }
.btn-go:disabled { opacity: .55; cursor: not-allowed; }
.threats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.1rem;
    margin-bottom: 1.5rem;
}
.threat {
    position: relative;
    overflow: hidden;
    transition: box-shadow .2s, border-color .2s;
}
.threat:hover { box-shadow: var(--shadow-hover); border-color: var(--ink-2); }
.threat::before, .threat::after {
    content: ""; position: absolute; width: 12px; height: 12px; pointer-events: none;
}
.threat::before { left: 5px; top: 5px; border-top: 2px solid var(--accent); border-left: 2px solid var(--accent); }
.threat::after { right: 5px; bottom: 5px; border-right: 2px solid var(--signal); border-bottom: 2px solid var(--signal); }
.threat.entering { animation: threatIn .45s cubic-bezier(.16, 1, .3, 1) both; }
@keyframes threatIn {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: translateY(0); }
}
.threat-head {
    display: flex; align-items: center; gap: .75rem;
    padding: 1rem 1.15rem .85rem 1.3rem;
    border-bottom: 1px dashed var(--rule-2);
}
.threat-icon {
    width: 40px; height: 40px;
    border-radius: var(--radius-sm);
    background: var(--accent-l);
    border: 1px solid rgba(11, 110, 153, .35);
    color: var(--accent-d);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    font-size: 1.15rem;
}
.threat-icon .ico { width: 1.15em; height: 1.15em; }
.threat-title {
    font-family: var(--serif);
    font-size: 1.35rem; line-height: 1.1;
    color: var(--ink); flex: 1; min-width: 0;
}
.threat-badge {
    display: inline-block;
    padding: 3px 9px; border-radius: 2px;
    font-family: var(--mono);
    font-size: 0.6875rem; font-weight: 700;
    letter-spacing: .14em; text-transform: uppercase;
    white-space: nowrap;
    border: 2px dashed currentColor;
    transform: rotate(-3deg);
    flex-shrink: 0;
}
.threat.done .threat-badge { animation: stampIn .28s cubic-bezier(.2, .9, .3, 1.2) both; }
@keyframes stampIn {
    from { opacity: 0; transform: rotate(-3deg) scale(1.35); }
    to   { opacity: 1; transform: rotate(-3deg) scale(1); }
}
.threat-score {
    min-width: 38px; height: 38px; padding: 0 6px;
    border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center;
    font-family: var(--mono);
    font-size: 1.05rem; font-weight: 700; color: #fff;
    font-variant-numeric: tabular-nums;
    flex-shrink: 0;
}
.threat-score.lvl-LOW { background: var(--green); }
.threat-score.lvl-MEDIUM { background: var(--amber); }
.threat-score.lvl-HIGH { background: var(--signal); }
.badge-LOW { background: var(--green-l); color: var(--green); }
.badge-MEDIUM { background: var(--amber-l); color: var(--amber); }
.badge-HIGH { background: var(--red-l); color: var(--red); }
.badge-CRITICAL { background: #7f1d1d; color: #fff; }
.badge-CRITICAL { background: var(--red-l); color: var(--red); }
.badge-ERROR { background: rgba(76, 91, 105, .1); color: var(--slate); }
.threat-body { padding: 1rem 1.3rem 1.3rem; }
.score-row { margin-bottom: .9rem; }
.score-summary {
    font-size: .88rem;
    line-height: 1.65; color: var(--ink-2);
    padding-top: .1rem;
}
.articles {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: .6rem;
}
.articles--orphan > :last-child { grid-column: 1 / -1; }
.article {
    background: var(--paper);
    border: 1px solid var(--rule);
    border-left: 3px solid var(--rule-2);
    border-radius: var(--radius-sm);
    padding: .75rem .85rem;
    transition: border-color .15s, background .15s;
}
.article:hover { border-color: var(--accent); border-left-color: var(--accent); background: #fff; }
.article-title {
    font-size: .82rem; font-weight: 600;
    color: var(--ink); margin-bottom: .25rem;
    display: -webkit-box; -webkit-line-clamp: 2;
    -webkit-box-orient: vertical; overflow: hidden;
}
.article-snippet {
    font-size: .76rem;
    color: var(--muted); line-height: 1.5;
    margin-bottom: .3rem;
    display: -webkit-box; -webkit-line-clamp: 3;
    -webkit-box-orient: vertical; overflow: hidden;
}
.article-src {
    position: relative;
    font-family: var(--mono);
    font-size: 0.6875rem; color: var(--accent-d);
    font-weight: 500; word-break: break-all; text-decoration: none;
}
.article-src:hover { text-decoration: underline; }
.article-src::after, .article-toggle::after { content: ""; position: absolute; inset: -14px -6px; }
.article-expand {
    display: none; font-size: .76rem;
    color: var(--muted); line-height: 1.55;
    margin-top: .3rem; padding-top: .3rem;
    border-top: 1px dashed var(--rule-2);
}
.article-expand.open { display: block; }
.article-toggle {
    font-family: var(--mono);
    font-size: 0.6875rem; color: var(--accent-d); font-weight: 600;
    letter-spacing: .04em;
    cursor: pointer; border: none; background: none; padding: 0;
    position: relative;
    text-decoration: underline;
    text-underline-offset: 2px;
}
.article-toggle:hover { color: var(--ink); }
.threat-loading {
    display: flex; align-items: center; justify-content: center;
    gap: .6rem; padding: 1.75rem;
    font-family: var(--mono); letter-spacing: .06em;
    color: var(--muted); font-size: .8rem;
}
.tl-spin {
    width: 18px; height: 18px;
    border: 2px dashed var(--rule-2); border-top: 2px solid var(--signal);
    border-radius: 50%; animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.action-bar {
    display: none; gap: .5rem; flex-wrap: wrap;
    padding-top: 1rem;
    border-top: 1px solid var(--rule-2);
}
.action-bar.show { display: flex; }
.abtn, .btn-reset {
    padding: .5rem 1.1rem;
    border: 1px solid var(--ink);
    background: var(--card);
    color: var(--ink); border-radius: var(--radius-sm);
    font-family: var(--mono); font-size: .72rem; font-weight: 600;
    letter-spacing: .08em; text-transform: uppercase;
    min-height: 44px;
    cursor: pointer; transition: background .15s, color .15s, border-color .15s;
}
.abtn:hover, .btn-reset:hover { background: var(--ink); color: #fff; }
.abtn-red { color: var(--signal); border-color: var(--signal); }
.abtn-red:hover { background: var(--signal); border-color: var(--signal); color: #fff; }
.btn-reset--sm { font-size: 0.6875rem; padding: .3rem .85rem; }
.error-box {
    background: var(--signal-l); border: 1px dashed var(--signal);
    border-radius: var(--radius-sm); padding: .9rem;
    color: var(--signal); font-size: .86rem; font-weight: 500; margin-bottom: 1rem;
    display: none;
}
.no-ep {
    padding: 3rem 2rem; text-align: center;
    color: var(--muted); margin-top: 2rem;
    border-style: dashed;
}
.no-ep .ico { color: var(--accent); }
.stat-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: .9rem; margin-bottom: 2rem;
}
.stat-grid.stat-grid--reduced { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 900px) {
    .stat-grid, .stat-grid.stat-grid--reduced { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.stat-card {
    position: relative;
    padding: 1.2rem .9rem 1.05rem; text-align: left;
    min-width: 0;
    border-top: 3px solid var(--accent);
}
.stat-card:nth-child(3n + 2) { border-top-color: var(--signal); }
.stat-card .ico { color: var(--accent); margin-bottom: .45rem; display: block; width: 1.25rem; height: 1.25rem; }
.stat-val {
    display: block;
    font-family: var(--serif);
    font-size: 2.1rem; line-height: 1.05; font-weight: 400; color: var(--ink);
    white-space: nowrap; font-variant-numeric: tabular-nums;
    overflow: hidden; text-overflow: ellipsis;
}
.stat-label {
    display: block;
    font-family: var(--mono);
    font-size: 0.6875rem; letter-spacing: .1em; text-transform: uppercase;
    color: var(--muted); margin-top: .35rem;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.stat-label .lbl-short { display: none; }
@media (max-width: 600px) {
    .stat-label .lbl-full { display: none; }
    .stat-label .lbl-short { display: inline; }
}
.chart-box {
    padding: clamp(.75rem, 2vw, 1.15rem) clamp(1rem, 2.5vw, 1.4rem);
    margin-bottom: 1.15rem; overflow: hidden;
}
.chart-box canvas { display: block; max-width: 100%; margin: 0 auto; }
.chart-box--hist { margin-bottom: 1.15rem; }
.chart-box--exec { margin-top: 1.15rem; }
.chart-head {
    display: flex; justify-content: space-between; align-items: center;
    flex-wrap: wrap; gap: .5rem; margin-bottom: .6rem;
    padding-bottom: .5rem; border-bottom: 1px solid var(--ink);
}
.chart-head h3 {
    margin: 0; font-family: var(--mono); font-size: .72rem; font-weight: 600;
    text-transform: uppercase; letter-spacing: .14em; color: var(--ink);
}
.chart-head > div { display: flex; align-items: center; gap: .5rem; }
#sync-status { color: var(--muted); font-family: var(--mono); font-size: 0.6875rem; }
.tbl-wrap { overflow-x: auto; }
.chart-box h3 { font-size: 1.1rem; margin: 0 0 .6rem; color: var(--ink); }
.stats-table { width: 100%; border-collapse: collapse; font-size: .8rem; }
.stats-table th {
    text-align: left;
    font-family: var(--mono); font-size: 0.6875rem; font-weight: 600;
    letter-spacing: .12em; text-transform: uppercase;
    color: var(--muted); padding: .5rem .65rem;
    border-bottom: 1px solid var(--rule-2);
}
.stats-table td {
    padding: .55rem .65rem;
    border-bottom: 1px solid var(--rule);
    color: var(--ink);
    vertical-align: middle;
}
.stats-table .c-text { text-align: left; }
.stats-table th.c-num, .stats-table td.c-num {
    text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap;
    font-family: var(--mono); font-size: .76rem;
}
.stats-table .c-nowrap { white-space: nowrap; }
.stats-table .c-strong { font-weight: 600; }
.stats-table .c-small { font-size: .74rem; }
.stats-table .st-progress { color: var(--pay-progress); }
.stats-table--hist th:first-child, .stats-table--hist td:first-child { width: 34%; }
.stats-table--exec th:first-child, .stats-table--exec td:first-child { width: 42%; }
.stats-table--exec th:last-child, .stats-table--exec td:last-child { width: 22%; min-width: 4.5rem; }
.stats-table tr:last-child td { border: none; }
.stats-table tbody tr:hover td { background: var(--accent-l); }
.dl-btn {
    background: var(--card); border: 1px solid var(--ink);
    color: var(--ink); border-radius: var(--radius-sm);
    padding: 2px 8px; font-family: var(--mono); font-size: 0.6875rem; font-weight: 600;
    cursor: pointer;
    transition: background .15s, color .15s; white-space: nowrap;
}
.dl-btn:hover { color: #fff; background: var(--ink); }
.info-grid { display: grid; grid-template-columns: 1fr; gap: .9rem; margin-bottom: 1.15rem; }
@media (min-width: 900px) {
    .info-grid { grid-template-columns: 1fr 1fr; }
    .info-grid > :last-child:nth-child(odd) { grid-column: 1 / -1; }
}
.info-icon {
    width: 40px; height: 40px; border-radius: var(--radius-sm);
    background: var(--accent-l); color: var(--accent-d);
    border: 1px dashed var(--accent);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.1rem; flex-shrink: 0;
}
.info-card {
    padding: 1.3rem 1.35rem 1.15rem;
    position: relative; overflow: hidden;
}
.info-grid .info-card { margin-bottom: 0; }
.info-head { display: flex; align-items: center; gap: .7rem; margin-bottom: .55rem; }
.info-head h3 { margin: 0; }
.info-card::before {
    content: ''; position: absolute;
    left: 1.35rem; top: 0; width: 38px; height: 4px;
    background: var(--signal);
}
.info-card h3 { font-size: 1.35rem; line-height: 1.15; margin-bottom: .5rem; color: var(--ink); }
.info-grid .info-card h3 { font-size: 1.3rem; }
.info-card p { font-size: .88rem; color: var(--ink-2); line-height: 1.65; }
.info-card p + p { margin-top: .4rem; }
body { --info-accent: var(--signal); }
.info-sub { font-size: 1.3rem; line-height: 1.15; color: var(--ink); }
.info-box.info-card { margin-bottom: 0; }
.res-links > a, [data-theme="light"] .ai-notice {
    margin: 1.5rem 0 0;
    border: 1px solid var(--rule-2);
    background: var(--recess); color: var(--ink-2);
    font-weight: 500;
}
[data-theme="light"] .ai-notice .ai-ico { color: var(--signal); }
[data-theme="light"] .ai-notice .ai-notice-link { color: var(--accent-d); }
[data-theme="light"] .ai-notice .ai-notice-link:hover { color: var(--ink); }
[data-theme="light"] .ai-info-card {
    border: 1px solid var(--rule-2); background: var(--card);
    box-shadow: var(--shadow-hover);
}
[data-theme="light"] .ai-info-card h3 { color: var(--ink); }
.ai-info-card h3 .ai-ico, [data-theme="light"] .ai-info-card h3 .ai-ico { color: var(--accent-d); }
[data-theme="light"] .ai-info-card > p { color: var(--ink-2); opacity: 1; }
[data-theme="light"] .ai-info-card .ai-field { background: #fff; border-color: var(--rule); }
[data-theme="light"] .ai-info-card .ai-field-label { color: var(--muted); }
[data-theme="light"] .ai-info-card .ai-field-value { color: var(--ink); }
[data-theme="light"] .ai-info-card .ai-ref-line { color: var(--muted); }
.chat-container { display: none; flex-direction: column; }
.chat-container.show { display: flex; }
#testing-chat { display: none; }
#testing-chat.show { display: flex; }
.ticket-bar {
    padding: .9rem 1.15rem; margin-bottom: .9rem;
    display: flex; align-items: center;
    gap: .9rem; flex-wrap: wrap;
    border-left: 3px solid var(--signal);
}
.ticket-bar .tb-label {
    font-family: var(--mono);
    font-size: 0.6875rem; font-weight: 600;
    letter-spacing: .12em; text-transform: uppercase;
    color: var(--muted);
}
.ticket-bar .tb-val { font-size: .84rem; color: var(--ink); font-weight: 500; }
.ticket-bar .tb-item { display: flex; flex-direction: column; gap: .1rem; }
.tb-divider { width: 1px; height: 26px; background: var(--rule-2); }
.chat-messages {
    display: flex; flex-direction: column; gap: .7rem;
    padding: .9rem 0; min-height: 110px;
    max-height: 60vh; overflow-y: auto;
}
.msg { display: flex; gap: .55rem; max-width: 90%; }
.msg-agent { align-self: flex-start; }
.msg-user { align-self: flex-end; flex-direction: row-reverse; }
.msg-avatar {
    width: 30px; height: 30px; border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center;
    font-size: .8rem; flex-shrink: 0;
    background: var(--accent-l); color: var(--accent-d);
    border: 1px solid rgba(11, 110, 153, .35);
}
.msg-user .msg-avatar { background: var(--ink); color: #fff; border-color: var(--ink); }
.msg-bubble {
    padding: .65rem 1rem; border-radius: var(--radius-sm);
    font-size: .84rem; line-height: 1.6;
    background: var(--card); border: 1px solid var(--rule-2);
    color: var(--ink); box-shadow: var(--shadow);
}
.msg-user .msg-bubble { background: var(--accent-d); border-color: var(--accent-d); color: #fff; }
.msg-bubble pre {
    margin: 0; white-space: pre-wrap; word-break: break-all;
    font-size: .75rem; font-family: var(--mono);
}
.msg-meta { font-family: var(--mono); font-size: 0.6875rem; color: var(--ink); margin-top: .2rem; padding: 0 .35rem; }
.msg-phase {
    display: inline-block;
    font-family: var(--mono); font-size: 0.6875rem; font-weight: 700;
    letter-spacing: .12em; text-transform: uppercase;
    padding: 2px 7px; border-radius: 2px;
    margin-bottom: .4rem;
    background: var(--accent-l); color: var(--accent-d);
    border: 1px dashed currentColor;
}
.phase-retrieve { background: var(--green-l); color: var(--green); }
.phase-escalated { background: var(--red-l); color: var(--red); }
.phase-done { background: var(--green-l); color: var(--green); }
.radio-lbl {
    display: inline-flex; align-items: center; gap: .5rem;
    min-height: 44px; padding-right: .5rem;
    color: var(--ink); font-size: .84rem; cursor: pointer;
}
.radio-lbl input { width: 18px; height: 18px; margin: 0; flex-shrink: 0; accent-color: var(--accent-d); }
.ico { width: 1em; height: 1em; vertical-align: -0.125em; flex-shrink: 0; }
.ico-2x { width: 2em; height: 2em; }
.ico-3x { width: 3em; height: 3em; }
.field input:focus-visible, .field select:focus-visible, .field textarea:focus-visible, .btn-go:focus-visible, .abtn:focus-visible, .btn-reset:focus-visible, .dl-btn:focus-visible, .res-links a:focus-visible, .article-src:focus-visible, .article-toggle:focus-visible, .radio-lbl:focus-within {
    outline: 2px solid var(--accent-d); outline-offset: 2px;
}
@media (max-width: 768px) {
    :root { --hdr-h: 56px; }
    .form-card, .st-search { padding: 1.15rem; }
    .st-hero { margin-top: 1.5rem; }
    .st-hero .lead { font-size: .88rem; }
    .st-search { margin-top: 1.25rem; margin-bottom: 1.25rem; }
    .form-row { grid-template-columns: repeat(2, 1fr); }
    .form-row .field:nth-child(3) { grid-column: 1 / -1; }
    .form-row--2 { grid-template-columns: 1fr; }
    .threats { grid-template-columns: 1fr; }
    .articles { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
    .stat-grid { grid-template-columns: repeat(2, 1fr); }
    .stat-grid.stat-grid--reduced { grid-template-columns: 1fr 1fr; }
    .info-grid { grid-template-columns: 1fr; }
    .content { padding: 0 1rem 2rem; }
    .ticket-bar { flex-direction: column; align-items: flex-start; gap: .5rem; }
    .tb-divider { display: none; }
    .msg { max-width: 95%; }
}
@media (max-width: 480px) {
    :root { --hdr-h: 52px; }
    .badge-st { font-size: 0.6875rem; padding: 2px 6px; letter-spacing: .08em; }
    .content { padding: 0 .75rem 1.5rem; }
    .st-hero { margin-top: 1rem; padding-top: 1rem; }
    .st-hero h1 { font-size: 2rem; }
    .st-hero .lead { font-size: .84rem; }
    .st-search { padding: 1rem; margin-top: 1rem; margin-bottom: 1rem; }
    .st-search h2 { font-size: 1.35rem; }
    .form-card { padding: 1rem; }
    .form-row { grid-template-columns: 1fr; }
    .form-row .field:nth-child(3) { grid-column: auto; }
    .threat-head { padding: .85rem .9rem .75rem 1.1rem; gap: .55rem; }
    .threat-icon { width: 36px; height: 36px; }
    .threat-title { font-size: 1.15rem; }
    .threat-body { padding: .8rem .9rem 1rem 1.1rem; }
    .score-summary { font-size: .84rem; }
    .articles { grid-template-columns: 1fr; }
    .stat-grid { grid-template-columns: 1fr 1fr; gap: .65rem; }
    .stat-card { padding: .9rem .7rem; }
    .stat-val { font-size: 1.7rem; }
    .abtn { font-size: 0.6875rem; }
    .stats-table td, .stats-table th { padding-left: .45rem; padding-right: .45rem; }
    .chart-box { padding: .7rem .75rem; }
}
@media (prefers-reduced-motion: reduce) {
    .st-hero, .st-search, .threat.entering, .threat.done .threat-badge { animation: none; }
    .tl-spin { animation: none; }
    .btn-go, .abtn, .btn-reset, .field input, .field select, .field textarea, .article, .res-links > a, .dl-btn, .threat { transition: none; }
}
.stat-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.stat-grid > .stat-card { grid-column: span 2; }
.stat-grid > .stat-card:nth-child(n+4) { grid-column: span 3; }
.stat-grid.stat-grid--reduced { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.stat-grid.stat-grid--reduced > .stat-card:nth-child(n) { grid-column: auto; }
.stat-grid.stat-grid--reduced > .stat-card:last-child:nth-child(odd) { grid-column: 1 / -1; }
@media (max-width: 900px) {
    .stat-grid, .stat-grid.stat-grid--reduced { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .stat-grid > .stat-card:nth-child(n) { grid-column: auto; }
    .stat-grid > .stat-card:last-child:nth-child(odd) { grid-column: 1 / -1; }
}
.content { margin-top: 16px; }
@media (max-width: 600px) {
    .content { margin-top: 0px; }
}

/* ── the skeleton (last, so the page's old element rules do not reach the rail and the top band) ── */
.st-home {
    position: fixed; left: 16px; top: 8px; z-index: 70;
    width: 44px; height: 44px; border-radius: 12px;
    background: var(--tint); color: var(--accent);
    display: block; overflow: hidden;
}
.st-home .ico { width: 100%; height: 100%; }
.st-home:hover { background: #cfe8f8; }
.st-rail {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
    height: 76px; padding: 6px 12px 18px;
    display: flex; align-items: center; gap: 4px;
    background: var(--card); border-top: 1px solid var(--line);
}
.st-ri {
    height: 52px; min-width: 84px; padding: 0 18px; border-radius: 14px;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
    color: var(--muted); font-size: 12px; font-weight: 500; line-height: 1.3;
    position: relative;
}
.st-ri::after { content: ""; position: absolute; inset: -4px 0; }
.st-ri:hover { color: var(--accent); }
.st-ri.on { background: var(--tint); color: var(--accent); }
.st-ri--ico { min-width: 0; width: 52px; padding: 0; margin-left: auto; }
.st-col { min-width: 0; display: flex; flex-direction: column; min-height: calc(100vh / var(--mv-zoom, 1)); min-height: calc(100dvh / var(--mv-zoom, 1)); }
.st-top {
    position: sticky; top: 0; z-index: 40;
    height: 60px; padding: 0 16px;
    display: flex; align-items: center;
    background: var(--card); border-bottom: 1px solid var(--line);
}
.st-wm {
    margin-left: auto;
    display: inline-flex; align-items: center; gap: 8px;
    font: 800 22px/1 'Plus Jakarta Sans', 'DM Sans', system-ui, sans-serif; letter-spacing: -.02em;
    color: var(--ink); white-space: nowrap; user-select: none;
}
.st-wm b { font-weight: 800; }
.st-wm u { display: block; width: 29px; height: 7px; position: relative; text-decoration: none; }
.st-wm u::before { content: ""; position: absolute; left: 0; right: 5px; top: 2.5px; border-top: 2px dashed var(--accent); }
.st-wm u::after { content: ""; position: absolute; right: 0; top: 0; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.st-main {
    width: 100%; max-width: 1240px; margin: 0 auto; flex: 1;
    padding: 16px 16px 92px;
    display: flex; flex-direction: column; gap: 16px;
}
.st-main > * { flex: none; }
body:has(#actions.show) .st-main { padding-bottom: 148px; }
@media (min-width: 641px) {
    .st-app { display: grid; grid-template-columns: 80px minmax(0, 1fr); }
    .st-home { left: 16px; top: 16px; width: 48px; height: 48px; }
    .st-rail {
        position: sticky; top: 0; bottom: auto; left: auto; right: auto; z-index: 30;
        height: calc(100vh / var(--mv-zoom, 1)); height: calc(100dvh / var(--mv-zoom, 1)); padding: 84px 0 16px;
        flex-direction: column; justify-content: flex-start; align-items: center; gap: 4px;
        border-top: 0; border-right: 1px solid var(--line);
    }
    .st-ri { width: 60px; min-width: 0; height: 56px; padding: 0; border-radius: 12px; gap: 2px; font-size: 11px; line-height: 1.2; }
    .st-ri--ico { width: 60px; margin-left: 0; margin-top: auto; }
    .st-top {
        height: 68px; padding: 0 max(28px, calc((100% - 1240px) / 2 + 28px));
        display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px;
        background: var(--bg); border-bottom: 0;
    }
    .st-wm { margin-left: 0; grid-column: 2; font-size: 26px; }
    .st-wm u { width: 34px; height: 8px; }
    .st-wm u::before { right: 6px; top: 3px; }
    .st-wm u::after { width: 7px; height: 7px; }
    .st-main, body:has(#actions.show) .st-main { padding: 0 28px 28px; }
}
@media (min-width: 641px) and (max-width: 900px) {
    .st-top { padding: 0 20px; }
}

.sr { position: absolute !important; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.st-rail a, .st-home { text-decoration: none; }
.st-ri { text-transform: none; letter-spacing: 0; }
.st-ri .ico { width: 22px; height: 22px; }
/* a sky over the page's ruled paper: soft colour at the corners, so the open space is not blank (owner, 2026-11-27) */
body::after { content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none; background: radial-gradient(60% 50% at 8% 0%, rgba(56, 189, 248, .20), transparent 70%), radial-gradient(50% 46% at 96% 18%, rgba(129, 140, 248, .14), transparent 70%), radial-gradient(70% 52% at 78% 104%, rgba(45, 212, 191, .16), transparent 70%), radial-gradient(46% 40% at 4% 96%, rgba(251, 146, 60, .10), transparent 70%); }
html body .st-top { background: transparent; border-color: transparent; -webkit-backdrop-filter: none; backdrop-filter: none; box-shadow: none; }
@media (max-width: 640px) { html body .st-top { background: rgba(255, 255, 255, .92); } }
/* inside the skeleton */
body { margin: 0; }
.st-main { min-width: 0; }
.st-main > .content.st-classic { max-width: 1100px; margin: 0 auto; padding-top: 12px; }
.st-top .st-wm { color: var(--ink); }
@media (max-width: 640px) { .st-main > .content.st-classic { padding-left: 14px; padding-right: 14px; padding-bottom: 100px; } }

/* The title sits close under the name (owner, 2026-11-27): the ornament line between them and the extra air are gone. */
html body .st-hero { margin-top: 0; padding-top: 0; }
html body .st-hero-inner::before { content: none; }
html body .st-main > .content.st-classic { padding-top: 6px; }
html body .st-hero h1 { font-size: clamp(1.8rem, 1.3rem + 1.6vw, 2.5rem); }

/* the same air under the top band on every page (--mv-top, css/demo-shell.css) */
html body .st-main:not(#mv) { padding-top: 16px; }
@media (max-width: 640px) { html body .st-main:not(#mv) { padding-top: 20px; } }
html body .st-main > .content.st-classic:not(#mv) { margin-top: 0; padding-top: 0; }

/* The hero speaks in the name's own face (owner, 2026-11-27), centred under it. */
html body .st-hero h1:not(#mv) { font-family: 'Plus Jakarta Sans', 'DM Sans', system-ui, sans-serif; font-weight: 800; font-style: normal; letter-spacing: -.025em; font-size: clamp(1.75rem, 1.35rem + 1.5vw, 2.4rem); line-height: 1.15; text-align: center; text-wrap: balance; }

html body .st-main :is(h1, h2, h3, h4):not(#mv) { font-family: 'Plus Jakarta Sans', 'DM Sans', system-ui, sans-serif; font-weight: 800; font-style: normal; letter-spacing: -.02em; }
html body .st-main :is(.form-card, .threat) h2:not(#mv), html body .st-main :is(.form-card, .threat) h3:not(#mv) { font-weight: 700; }
html body .st-main .threat-title:not(#mv) { font-family: 'Plus Jakarta Sans', 'DM Sans', system-ui, sans-serif; font-weight: 700; font-size: 1.15rem; line-height: 1.25; }
