:root {
  --ink: #162133;
  --muted: #667487;
  --line: #dde3ea;
  --line-strong: #c7cfda;
  --surface: #ffffff;
  --canvas: #f5f7fa;
  --indigo: #cc1f26;
  --indigo-dark: #a5161c;
  --indigo-soft: #fff0f1;
  --ui-accent: #2f6fb4;
  --ui-accent-dark: #1f4f88;
  --ui-accent-soft: #edf4ff;
  --green: #0d9760;
  --green-soft: #eaf8f1;
  --danger: #a72b37;
  --shadow: 0 12px 30px rgba(24, 39, 75, 0.07), 0 2px 6px rgba(24, 39, 75, 0.05);
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--canvas); }
body { margin: 0; background: radial-gradient(circle at 82% 4%, rgba(204, 31, 38, 0.045), transparent 24rem), var(--canvas); color: var(--ink); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
button, input, select { font: inherit; }
button, summary, select, input { -webkit-tap-highlight-color: transparent; }
button:focus-visible, summary:focus-visible, select:focus-visible, input:focus-visible { outline: 3px solid rgba(47, 111, 180, 0.22); outline-offset: 2px; }
[hidden] { display: none !important; }
.app-shell { min-height: 100vh; padding-bottom: calc(42px + env(safe-area-inset-bottom)); }
.app-header { display: flex; align-items: center; justify-content: space-between; gap: 24px; width: calc(100% - 24px); min-height: 142px; margin: 12px auto 0; padding: calc(16px + env(safe-area-inset-top)) clamp(20px, 4vw, 42px) 16px; border: 1px solid #d9e1ec; border-radius: 18px; background: rgba(255, 255, 255, 0.98); box-shadow: 0 8px 24px rgba(18, 32, 59, 0.055); }
.brand-block { display: flex; align-items: center; gap: 24px; min-width: 0; }
.brand-logo { display: block; flex: 0 0 auto; width: clamp(205px, 18.5vw, 265px); height: auto; max-width: 40vw; }
.brand-copy { display: grid; min-width: 0; gap: 7px; }
.brand-kicker { margin: 0; color: #25427c; font-size: 15px; font-weight: 700; letter-spacing: 0; line-height: 1.3; }
.brand-copy h1 { margin: 0; color: #14264f; font-size: clamp(32px, 2.95vw, 42px); line-height: 1.12; letter-spacing: -0.035em; font-weight: 760; }
.brand-unit { display: inline-flex; align-items: center; width: fit-content; max-width: 100%; margin: 2px 0 0; padding: 8px 14px; border: 1.5px solid #ed4b50; border-radius: 11px; background: #ffffff; color: #202b3d; font-size: 15px; font-weight: 700; letter-spacing: 0; line-height: 1.35; overflow-wrap: anywhere; }
.brand-unit::before { content: "▥"; margin-right: 8px; color: var(--indigo); font-size: 16px; line-height: 1; }
.brand-subtitle { margin: 1px 0 0; color: #65738a; font-size: 12px; line-height: 1.45; font-weight: 500; }
.dataset-badge { flex: 0 0 auto; padding: 6px 10px; border: 1px solid #ead6d8; border-radius: 10px; background: #fbf8f8; color: #7a5b60; font-size: 11px; font-weight: 700; }
.privacy-banner, .dataset-card, .workspace-grid { width: min(1380px, calc(100% - clamp(32px, 8vw, 112px))); margin-inline: auto; }
.privacy-banner { display: flex; align-items: center; gap: 10px; margin-top: 19px; padding: 11px 14px; border: 1px solid #c8e8d8; border-radius: 12px; background: var(--green-soft); color: #176846; font-size: 13px; }
.privacy-banner > span { display: grid; flex: 0 0 auto; place-items: center; width: 23px; height: 23px; border-radius: 50%; background: #ccefdc; color: #08784a; font-weight: 800; }
.privacy-banner p { margin: 0; line-height: 1.45; }
.dataset-card { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-top: 15px; padding: 18px 20px; border: 1px solid var(--line); border-radius: 16px; background: rgba(255, 255, 255, 0.94); box-shadow: var(--shadow); }
.eyebrow { margin: 0 0 5px; color: var(--ui-accent); font-size: 11px; font-weight: 800; letter-spacing: 0.11em; text-transform: uppercase; }
.dataset-card h2, .results-heading h2, .table-heading h3 { margin: 0; letter-spacing: -0.025em; }
.dataset-card h2 { font-size: 20px; }
.dataset-card p:not(.eyebrow) { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.dataset-actions { display: flex; flex-wrap: wrap; gap: 9px; justify-content: flex-end; }
.primary-button, .secondary-button, .ghost-button { min-height: 43px; padding: 0 16px; border-radius: 9px; font-weight: 700; cursor: pointer; }
.primary-button { border: 1px solid var(--indigo); background: linear-gradient(135deg, #d92a31, #b51c22); box-shadow: 0 7px 15px rgba(204, 31, 38, 0.18); color: white; }
.secondary-button { border: 1px solid #d9c7ca; background: #fcf9f9; color: #7f4049; }
.ghost-button { border: 1px solid transparent; background: transparent; color: var(--ui-accent); }
.tabs { display: flex; gap: 14px; width: min(1380px, calc(100% - clamp(32px, 8vw, 112px))); margin: 18px auto 0; }
.tabs button { display: flex; flex: 1 1 0; align-items: center; justify-content: center; gap: 14px; min-width: 0; min-height: 88px; padding: 15px 22px; border: 1px solid #bfcfe2; border-radius: 16px; background: rgba(255, 255, 255, 0.96); box-shadow: 0 7px 18px rgba(24, 39, 75, 0.07); color: #26344e; text-align: left; cursor: pointer; transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease, background 160ms ease; }
.tabs button:hover { border-color: #87abd2; box-shadow: 0 10px 23px rgba(24, 39, 75, 0.10); transform: translateY(-1px); }
.tabs button.active { border-color: var(--ui-accent); background: linear-gradient(135deg, #367bc1, #235d9a); box-shadow: 0 11px 25px rgba(47, 111, 180, 0.24); color: #ffffff; }
.tabs button.active:hover { border-color: var(--ui-accent); }
.tab-icon { display: grid; flex: 0 0 48px; place-items: center; width: 48px; height: 48px; border-radius: 50%; background: var(--ui-accent-soft); color: var(--ui-accent-dark); font-size: 27px; font-weight: 900; line-height: 1; }
.tabs button.active .tab-icon { background: rgba(255, 255, 255, 0.18); color: #ffffff; }
.tab-copy { display: grid; min-width: 0; gap: 4px; }
.tab-copy strong { font-size: clamp(16px, 1.45vw, 21px); font-weight: 820; line-height: 1.15; letter-spacing: -0.018em; }
.tab-copy small { color: #66758b; font-size: 12px; font-weight: 560; line-height: 1.3; }
.tabs button.active .tab-copy small { color: rgba(255, 255, 255, 0.86); }
.workspace-grid { display: grid; grid-template-columns: minmax(290px, 360px) minmax(0, 1fr); gap: 26px; margin-top: 26px; align-items: start; }
.filter-card, .metric-card, .table-card, .ac-controls { border: 1px solid var(--line); background: rgba(255, 255, 255, 0.95); box-shadow: var(--shadow); }
.filter-card { position: sticky; top: 16px; border-radius: 17px; }
.filter-card > summary { display: flex; align-items: center; justify-content: space-between; min-height: 64px; padding: 0 20px; list-style: none; font-size: 20px; font-weight: 750; cursor: pointer; }
.filter-card > summary::-webkit-details-marker { display: none; }
.filter-card > summary b { display: inline-grid; place-items: center; min-width: 23px; height: 23px; margin-left: 7px; padding: 0 6px; border-radius: 99px; background: var(--ui-accent-soft); color: var(--ui-accent-dark); font-size: 11px; }
.filter-body { display: grid; gap: 14px; padding: 0 20px 20px; }
.field-group { display: grid; gap: 7px; margin: 0; padding: 0; border: 0; color: #31405a; font-size: 13px; font-weight: 650; }
.field-group legend { padding: 0; }
.field-help { margin: -1px 1px 0; color: var(--muted); font-size: 10px; font-weight: 500; line-height: 1.4; }
.field-group select, .field-group input, .multi-select > summary { width: 100%; min-height: 43px; padding: 0 11px; border: 1px solid var(--line-strong); border-radius: 9px; background: white; color: #27344b; }
.date-row { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.date-shortcuts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
.date-shortcuts button { min-height: 32px; padding: 0 10px; border: 1px solid #b8c8dc; border-radius: 8px; background: #ffffff; color: #49627e; font-size: 11px; font-weight: 750; cursor: pointer; }
.date-shortcuts button:hover { border-color: #7fa6d1; background: #f7faff; }
.date-shortcuts button.active { border-color: var(--ui-accent); background: var(--ui-accent-soft); color: var(--ui-accent-dark); box-shadow: inset 0 0 0 1px rgba(47, 111, 180, 0.18); }
.date-row label { display: grid; gap: 5px; color: var(--muted); font-size: 11px; }
.segmented { display: flex; overflow: hidden; border: 1px solid var(--line-strong); border-radius: 9px; background: white; }
.segmented button { flex: 1; min-height: 41px; padding: 0 10px; border: 0; border-right: 1px solid var(--line-strong); background: transparent; color: #566278; font-size: 12px; font-weight: 650; cursor: pointer; }
.segmented button:last-child { border-right: 0; }
.segmented button.active { background: var(--ui-accent-soft); color: var(--ui-accent-dark); box-shadow: inset 0 0 0 1px #72a0d2; }
.multi-select { position: relative; }
.multi-select > summary { display: flex; align-items: center; justify-content: space-between; list-style: none; cursor: pointer; }
.multi-select > summary::-webkit-details-marker { display: none; }
.multi-menu { position: absolute; z-index: 10; top: calc(100% + 7px); right: 0; left: 0; max-height: 310px; overflow: auto; padding: 8px; border: 1px solid var(--line); border-radius: 12px; background: white; box-shadow: 0 18px 38px rgba(28, 39, 69, 0.16); }
.multi-menu-heading { display: flex; align-items: center; justify-content: space-between; padding: 5px 4px 8px; font-size: 12px; }
.multi-menu-heading button { border: 0; background: transparent; color: var(--ui-accent); font-weight: 700; }
.multi-menu > input { margin-bottom: 6px; }
#microorganismOptions label { display: flex; align-items: center; gap: 9px; min-height: 38px; padding: 6px 5px; border-radius: 7px; font-size: 12px; font-weight: 500; }
#microorganismOptions label:active { background: #fff3f4; }
#microorganismOptions input { width: 17px; min-height: 17px; padding: 0; accent-color: var(--ui-accent); }
.sir-profile-card { overflow: hidden; border: 1px solid var(--line-strong); border-radius: 11px; background: #fbfcff; }
.sir-profile-card > summary { display: flex; align-items: center; justify-content: space-between; min-height: 45px; padding: 0 11px; list-style: none; color: #31405a; font-size: 13px; font-weight: 700; cursor: pointer; }
.sir-profile-card > summary::-webkit-details-marker { display: none; }
.sir-profile-card > summary b { display: inline-grid; place-items: center; min-width: 21px; height: 21px; margin-left: 6px; padding: 0 6px; border-radius: 99px; background: var(--ui-accent-soft); color: var(--ui-accent-dark); font-size: 10px; }
.sir-profile-body { display: grid; gap: 11px; padding: 0 10px 11px; border-top: 1px solid var(--line); }
.sir-profile-help { margin: 10px 1px 0; color: var(--muted); font-size: 11px; line-height: 1.45; }
.sir-rule select { width: 100%; min-height: 40px; padding: 0 9px; border: 1px solid var(--line-strong); border-radius: 8px; background: white; color: #27344b; }
.sir-rule-list { display: grid; gap: 9px; }
.sir-rule-empty { padding: 13px 10px; border: 1px dashed #cdd2e2; border-radius: 9px; color: var(--muted); font-size: 11px; text-align: center; }
.sir-rule { display: grid; gap: 8px; padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: white; }
.sir-rule-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.sir-rule-heading strong { color: #33415b; font-size: 12px; }
.sir-remove-button { min-width: 32px; min-height: 30px; border: 0; border-radius: 7px; background: #fff0f1; color: #a52938; font-size: 18px; cursor: pointer; }
.sir-rule-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(105px, 0.8fr); gap: 7px; }
.sir-rule-field { display: grid; gap: 4px; color: var(--muted); font-size: 10px; font-weight: 650; }
.sir-rule-field-wide { grid-column: 1 / -1; }
.sir-value-options { display: flex; flex-wrap: wrap; gap: 6px; min-height: 38px; align-items: center; }
.sir-value-chip { display: inline-flex; align-items: center; gap: 5px; min-height: 34px; padding: 0 9px; border: 1px solid var(--line-strong); border-radius: 8px; background: #fbfcff; color: #394861; font-size: 11px; font-weight: 700; }
.sir-value-chip input { width: 15px; min-height: 15px; margin: 0; accent-color: var(--ui-accent); }
.sir-add-button { min-height: 40px; border: 1px dashed #a8bfdc; border-radius: 9px; background: #f5f9ff; color: var(--ui-accent-dark); font-weight: 750; cursor: pointer; }
.filter-actions { display: grid; grid-template-columns: 1.2fr 1fr; gap: 8px; margin-top: 3px; }
.filter-actions-auto { grid-template-columns: minmax(0, 1fr) auto; align-items: center; min-height: 45px; padding-top: 4px; border-top: 1px solid var(--line); }
.auto-filter-status { display: inline-flex; align-items: center; gap: 7px; min-width: 0; color: var(--ui-accent-dark); font-size: 11px; font-weight: 700; line-height: 1.3; }
.auto-filter-status::before { content: "✓"; display: inline-grid; flex: 0 0 auto; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: var(--ui-accent-soft); color: var(--ui-accent-dark); font-size: 11px; }
.auto-filter-status[data-error="true"] { color: var(--danger); }
.auto-filter-status[data-error="true"]::before { content: "!"; background: #fff0f1; color: var(--danger); }
.reset-filter-button { min-height: 38px; padding-inline: 10px; white-space: nowrap; }
.results-area { min-width: 0; }
.results-heading { display: flex; align-items: end; justify-content: space-between; gap: 18px; min-height: 56px; margin-bottom: 13px; }
.results-heading h2 { font-size: 27px; }
.grouping-field { display: grid; gap: 4px; color: var(--muted); font-size: 11px; }
.grouping-field select { min-height: 38px; padding: 0 30px 0 10px; border: 1px solid var(--line-strong); border-radius: 8px; background: white; color: #29374e; }
.rule-note { margin: 0 0 4px; color: var(--muted); font-size: 12px; }
.metric-grid { display: grid; grid-template-columns: 1.6fr 0.9fr 1fr; gap: 14px; }
.metric-card { display: flex; flex-direction: column; min-height: 160px; padding: 21px; border-radius: 16px; }
.metric-card > span { color: #40506a; font-size: 14px; font-weight: 700; }
.metric-card strong { margin: 12px 0 auto; color: #0f1e38; font-size: clamp(35px, 4vw, 54px); letter-spacing: -0.045em; line-height: 1; }
.metric-card .period-value { font-size: clamp(25px, 3vw, 37px); }
.metric-card small { margin-top: 13px; color: var(--muted); font-size: 11px; }
.metric-primary small { color: var(--green); font-weight: 700; }
.table-card { margin-top: 16px; overflow: hidden; border-radius: 17px; }
.table-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 20px 22px 16px; }
.table-heading h3 { font-size: 20px; }
.table-heading p { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.ranking-table { padding: 0 22px 16px; }
.ranking-row { display: grid; grid-template-columns: minmax(155px, 1.5fr) 55px 58px minmax(90px, 1fr); gap: 12px; align-items: center; min-height: 50px; border-top: 1px solid var(--line); font-size: 13px; }
.ranking-row strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ranking-header-row { min-height: 37px; border-top: 0; color: var(--muted); font-size: 10px; font-weight: 750; letter-spacing: 0.05em; text-transform: uppercase; }
.bar-progress { display: block; width: 100%; height: 9px; overflow: hidden; border: 0; border-radius: 99px; background: #f6e7e8; appearance: none; -webkit-appearance: none; }
.bar-progress::-webkit-progress-bar { border-radius: 99px; background: #f6e7e8; }
.bar-progress::-webkit-progress-value { border-radius: 99px; background: linear-gradient(90deg, #df7176, #bf2c33); }
.bar-progress::-moz-progress-bar { border-radius: 99px; background: linear-gradient(90deg, #df7176, #bf2c33); }
.empty-state { padding: 35px 15px; border-top: 1px solid var(--line); color: var(--muted); text-align: center; }
.ac-controls { display: grid; grid-template-columns: 1.2fr 1fr 0.9fr; gap: 16px; padding: 18px 20px; border-radius: 16px; }
.ac-controls label, .ac-controls fieldset { display: grid; gap: 7px; min-width: 0; margin: 0; padding: 0; border: 0; color: #425069; font-size: 12px; font-weight: 650; }
.ac-controls select, .ac-controls input { width: 100%; min-height: 43px; padding: 0 11px; border: 1px solid var(--line-strong); border-radius: 9px; background: white; color: #29374e; }
.organism-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.organism-tags span { padding: 6px 9px; border-radius: 99px; background: var(--ui-accent-soft); color: var(--ui-accent-dark); font-size: 11px; font-weight: 700; }
.ac-table { padding: 0 22px 16px; }
.ac-row { display: grid; grid-template-columns: minmax(180px, 1.4fr) 70px 60px 60px 58px minmax(120px, 0.9fr); gap: 10px; align-items: center; min-height: 53px; border-top: 1px solid var(--line); font-size: 12px; }
.ac-row b { font-weight: 800; }
.ac-header-row { min-height: 38px; border-top: 0; color: var(--muted); font-size: 10px; font-weight: 750; letter-spacing: 0.04em; text-transform: uppercase; }
.ac-row.low-sample { color: #7d8798; background: linear-gradient(90deg, rgba(244, 245, 248, 0.7), transparent); }
.ac-row.low-sample b { color: #6e7889; }
.ac-row.sensitivity-emerald { background: linear-gradient(90deg, rgba(0, 155, 119, 0.10), transparent 72%); }
.ac-row.sensitivity-emerald b { color: #008a6a; }
.ac-row.sensitivity-light-green { background: linear-gradient(90deg, rgba(123, 201, 111, 0.13), transparent 72%); }
.ac-row.sensitivity-light-green b { color: #4e9b43; }
.ac-row.sensitivity-yellow { background: linear-gradient(90deg, rgba(244, 197, 66, 0.16), transparent 72%); }
.ac-row.sensitivity-yellow b { color: #a97000; }
.ac-row.sensitivity-red { background: linear-gradient(90deg, rgba(229, 57, 53, 0.10), transparent 72%); }
.ac-row.sensitivity-red b { color: #d32f2f; }
.toast { position: fixed; z-index: 50; right: 18px; bottom: calc(18px + env(safe-area-inset-bottom)); max-width: min(420px, calc(100% - 36px)); padding: 13px 16px; border-radius: 11px; background: #172640; box-shadow: 0 12px 30px rgba(10, 20, 40, 0.25); color: white; font-size: 13px; }
.toast[data-error="true"] { background: #8f2631; }

@media (max-width: 930px) {
  .workspace-grid { grid-template-columns: 1fr; }
  .filter-card { position: static; }
  .metric-grid { grid-template-columns: 1.35fr 1fr 1fr; }
}

@media (max-width: 980px) and (min-width: 681px) {
  .brand-logo { width: clamp(185px, 21vw, 230px); max-width: 34vw; }
  .brand-block { gap: 18px; }
  .brand-kicker { font-size: 13px; }
  .brand-copy h1 { font-size: clamp(27px, 2.8vw, 33px); }
  .brand-unit { font-size: 13px; padding: 7px 11px; }
}

@media (max-width: 680px) {
  .app-header { align-items: flex-start; flex-wrap: wrap; width: calc(100% - 16px); min-height: auto; margin-top: 8px; padding: calc(14px + env(safe-area-inset-top)) 14px 13px; border-radius: 15px; }
  .brand-block { align-items: flex-start; flex-direction: column; gap: 12px; width: 100%; }
  .brand-logo { width: min(64vw, 220px); max-width: 220px; }
  .brand-kicker { font-size: 11px; line-height: 1.35; }
  .brand-copy h1 { font-size: 26px; line-height: 1.12; font-weight: 760; }
  .brand-unit { font-size: 13px; padding: 7px 10px; border-radius: 10px; }
  .brand-subtitle { font-size: 10px; line-height: 1.4; }
  .dataset-badge { align-self: flex-start; padding: 6px 8px; font-size: 9px; }
  .privacy-banner, .dataset-card, .workspace-grid { width: calc(100% - 24px); }
  .privacy-banner { align-items: flex-start; margin-top: 12px; font-size: 11px; }
  .dataset-card { align-items: stretch; flex-direction: column; gap: 14px; padding: 16px; }
  .dataset-actions { display: grid; grid-template-columns: 1fr; }
  .tabs { gap: 8px; width: calc(100% - 24px); margin-top: 12px; }
  .tabs button { align-items: center; gap: 8px; min-height: 82px; padding: 11px 9px; border-radius: 13px; }
  .tab-icon { flex-basis: 38px; width: 38px; height: 38px; font-size: 21px; }
  .tab-copy { gap: 3px; }
  .tab-copy strong { font-size: 13px; line-height: 1.15; }
  .tab-copy small { font-size: 9px; line-height: 1.25; }
  .workspace-grid { gap: 18px; margin-top: 16px; }
  .filter-card > summary { min-height: 58px; padding: 0 16px; font-size: 18px; }
  .filter-body { padding: 0 16px 16px; }
  .sir-rule-grid { grid-template-columns: 66px minmax(0, 1fr); }
  .sir-value-options { gap: 5px; }
  .results-heading { align-items: flex-start; flex-direction: column; gap: 8px; }
  .results-heading h2 { font-size: 24px; }
  .metric-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .metric-card { min-height: 132px; padding: 17px; }
  .metric-card:first-child { grid-column: 1 / -1; }
  .metric-card strong { font-size: 40px; }
  .metric-card .period-value { font-size: 27px; }
  .table-heading { padding: 17px 16px 13px; }
  .ranking-table { padding: 0 16px 13px; }
  .ranking-row { grid-template-columns: minmax(125px, 1fr) 42px 48px; gap: 7px; min-height: 48px; }
  .ranking-row .bar-progress, .ranking-header-row span:last-child { display: none; }
  .ac-controls { grid-template-columns: 1fr; padding: 16px; }
  .ac-table { padding: 0 14px 12px; }
  .ac-header-row { display: none; }
  .ac-row { grid-template-columns: 1fr repeat(2, auto); gap: 7px 12px; padding: 12px 2px; }
  .ac-row strong { grid-column: 1 / -1; font-size: 14px; }
  .ac-row span { display: flex; gap: 5px; align-items: baseline; }
  .ac-row span::before { content: attr(data-label); color: var(--muted); font-size: 9px; font-weight: 750; text-transform: uppercase; }
  .organism-tags { justify-content: flex-start; }
}


/* Modalità online-only */
.online-banner { border-color: #c8daef; background: #eef6ff; color: #24527f; }
.online-banner > span { background: #d9eaff; color: var(--ui-accent-dark); }
.primary-button:disabled { cursor: wait; opacity: 0.68; }
.connection-gate { position: fixed; z-index: 1000; inset: 0; display: grid; place-items: center; padding: 24px; background: rgba(245, 247, 250, 0.98); backdrop-filter: blur(8px); }
.connection-gate[hidden] { display: none; }
.connection-gate-card { width: min(460px, 100%); padding: 32px; border: 1px solid #d4dde8; border-radius: 20px; background: white; box-shadow: 0 24px 65px rgba(18, 32, 59, 0.16); text-align: center; }
.connection-gate-icon { display: grid; place-items: center; width: 58px; height: 58px; margin: 0 auto 16px; border-radius: 50%; background: var(--ui-accent-soft); color: var(--ui-accent-dark); font-size: 31px; font-weight: 800; }
.connection-gate h2 { margin: 0; color: var(--ink); font-size: 27px; letter-spacing: -0.025em; }
.connection-gate p { margin: 12px 0 22px; color: var(--muted); font-size: 14px; line-height: 1.55; }
.connection-blocked { overflow: hidden; }


/* Variante grafica 0.6.6 - ispirata alla preview clinico-istituzionale */
:root {
  --canvas: #f3f6fb;
  --ui-accent: #1557d5;
  --ui-accent-dark: #0b2c6f;
  --ui-accent-soft: #eef4ff;
  --shadow: 0 10px 28px rgba(15, 40, 92, 0.06), 0 2px 8px rgba(15, 40, 92, 0.05);
}
body { background: linear-gradient(180deg, #eff4fb 0%, #f7f9fc 34%, #f3f6fb 100%); }
.app-header { width: 100%; margin: 0; padding: calc(18px + env(safe-area-inset-top)) clamp(20px, 4vw, 34px) 18px; border: 0; border-radius: 0 0 20px 20px; background: linear-gradient(135deg, #0a2a6a 0%, #08235a 58%, #061d4b 100%); box-shadow: 0 18px 38px rgba(7, 27, 73, 0.22); }
.brand-block { gap: 18px; }
.brand-logo { width: clamp(180px, 16vw, 232px); max-width: 32vw; padding: 8px 10px; border-radius: 16px; background: rgba(255,255,255,0.98); box-shadow: 0 8px 20px rgba(2, 12, 34, 0.22); }
.brand-kicker, .brand-copy h1, .brand-subtitle { color: #ffffff; }
.brand-kicker { font-size: 14px; letter-spacing: 0; opacity: 0.92; }
.brand-copy h1 { font-size: clamp(32px, 2.8vw, 40px); font-weight: 780; }
.brand-unit { border: 1px solid rgba(255,255,255,0.22); background: rgba(255,255,255,0.12); color: #ffffff; backdrop-filter: blur(6px); }
.brand-unit::before { color: #ffffff; }
.brand-subtitle { font-size: 12px; opacity: 0.78; }
.dataset-badge { border-color: rgba(255,255,255,0.24); background: rgba(255,255,255,0.08); color: #ffffff; font-size: 12px; padding: 8px 14px; border-radius: 12px; }
.privacy-banner, .dataset-card, .workspace-grid, .tabs { width: min(1440px, calc(100% - clamp(24px, 6vw, 84px))); }
.privacy-banner { margin-top: 16px; padding: 10px 14px; border: 1px solid #d9e4f5; border-radius: 14px; background: #f5f9ff; color: #24507c; }
.privacy-banner > span { background: #dbe8ff; color: #154596; }
.dataset-card { margin-top: 12px; padding: 15px 18px; border-radius: 18px; background: rgba(255,255,255,0.98); }
.dataset-card h2 { font-size: 18px; }
.primary-button { border-color: #1557d5; background: linear-gradient(135deg, #1e61e7, #0d4ecb); box-shadow: 0 8px 18px rgba(21,87,213,0.24); }
.secondary-button { border-color: #dbe2ec; color: #324767; }
.tabs { margin-top: 18px; gap: 16px; }
.tabs button { min-height: 108px; padding: 18px 22px; border-color: #c8d7eb; border-radius: 18px; background: #ffffff; box-shadow: 0 10px 24px rgba(26, 52, 102, 0.08); justify-content: flex-start; }
.tabs button.active { background: linear-gradient(135deg, #1658d8 0%, #0f46b1 100%); box-shadow: 0 12px 28px rgba(18, 78, 189, 0.28); }
.tab-icon { width: 58px; height: 58px; flex-basis: 58px; font-size: 31px; background: #eef3fd; color: #113d94; }
.tab-copy strong { font-size: clamp(20px, 1.75vw, 30px); text-transform: uppercase; letter-spacing: -0.02em; }
.tab-copy small { font-size: 14px; }
.workspace-grid { gap: 22px; margin-top: 18px; }
.filter-card, .metric-card, .table-card, .ac-controls { border-color: #dbe4f0; border-radius: 18px; background: rgba(255,255,255,0.98); box-shadow: 0 10px 22px rgba(24, 39, 75, 0.05); }
.filter-card > summary { min-height: 62px; padding: 0 18px; border-bottom: 1px solid #e8eef6; color: #12295d; font-size: 18px; font-weight: 780; text-transform: uppercase; letter-spacing: -0.015em; }
.filter-card > summary b { background: #1658d8; color: #ffffff; }
.filter-body { gap: 12px; padding: 0 16px 16px; }
.field-group { gap: 6px; padding-bottom: 4px; color: #203252; }
.field-group select, .field-group input, .multi-select > summary, .ac-controls select, .ac-controls input { border-color: #d5deea; border-radius: 10px; }
.segmented { border-color: #d5deea; }
.segmented button.active { background: #eef4ff; color: #123c93; box-shadow: inset 0 0 0 1px rgba(21,87,213,0.28); }
.sir-profile-card { border: 1px solid #dbe7fb; border-radius: 14px; background: #fbfdff; }
.sir-profile-card > summary { min-height: 54px; padding: 0 14px; color: #1750c7; font-weight: 760; }
.auto-filter-status { color: #1650bf; }
.auto-filter-status::before { background: #e6f0ff; color: #1650bf; }
.results-heading { min-height: auto; margin-bottom: 14px; }
.results-heading h2 { color: #12295d; font-size: 31px; }
.rule-note { display: inline-flex; align-items: center; padding: 8px 12px; border: 1px solid #d7e4f6; border-radius: 999px; background: #f8fbff; color: #4a5c79; }
.metric-grid { grid-template-columns: 1.35fr 1fr 1fr; gap: 14px; }
.metric-card { min-height: 148px; padding: 20px; }
.metric-card > span { color: #3e5272; font-size: 14px; font-weight: 760; }
.metric-card strong { margin-top: 14px; color: #0d2c6f; font-size: clamp(38px, 4.1vw, 56px); }
.metric-card:nth-child(2) strong { color: #179338; }
.metric-card:nth-child(3) strong { color: #6c41d8; }
.metric-primary { background: linear-gradient(180deg, #fbfdff, #ffffff); }
.table-card { margin-top: 14px; }
.table-heading { padding: 18px 20px 14px; }
.table-heading h3 { color: #12295d; font-size: 18px; font-weight: 780; }
.table-heading p { color: #61718a; font-size: 12px; }
.ranking-table, .ac-table { padding-inline: 18px; }
.ranking-header-row, .ac-header-row { color: #64748b; font-size: 11px; letter-spacing: 0.02em; text-transform: none; }
.ranking-row, .ac-row { border-top-color: #e8eef5; }
.bar-progress, .bar-progress::-webkit-progress-bar { background: #e9f0ff; }
.bar-progress::-webkit-progress-value, .bar-progress::-moz-progress-bar { background: linear-gradient(90deg, #5e8eff, #1557d5); }
.ac-controls { grid-template-columns: 1.15fr 1fr 0.95fr; padding: 16px 18px; }
.ac-controls fieldset legend, .ac-controls label { color: #40516e; font-size: 12px; font-weight: 720; }
.organism-tags span { background: #edf4ff; color: #164795; }
.ac-row.low-sample { background: linear-gradient(90deg, rgba(241, 244, 249, 0.92), transparent); }
.ac-row.sensitivity-emerald { background: linear-gradient(90deg, rgba(18, 151, 98, 0.11), transparent 72%); }
.ac-row.sensitivity-light-green { background: linear-gradient(90deg, rgba(106, 193, 86, 0.14), transparent 72%); }
.ac-row.sensitivity-yellow { background: linear-gradient(90deg, rgba(242, 198, 62, 0.17), transparent 72%); }
.ac-row.sensitivity-red { background: linear-gradient(90deg, rgba(230, 76, 76, 0.12), transparent 72%); }
.toast { background: #0d2b6d; }
.connection-gate { background: rgba(241, 246, 252, 0.97); }
.connection-gate-card { border-color: #dbe3f0; }
.connection-gate-icon { background: #edf4ff; color: #144697; }

@media (max-width: 980px) {
  .app-header { padding-inline: 18px; }
  .brand-logo { width: clamp(160px, 22vw, 200px); max-width: 34vw; }
}

@media (max-width: 680px) {
  .app-header { border-radius: 0 0 18px 18px; }
  .brand-block { gap: 10px; }
  .brand-logo { width: min(58vw, 200px); max-width: 200px; }
  .brand-copy h1 { font-size: 24px; }
  .dataset-badge { font-size: 10px; }
  .privacy-banner, .dataset-card, .workspace-grid, .tabs { width: calc(100% - 16px); }
  .tabs { gap: 10px; }
  .tabs button { min-height: 86px; padding: 12px 10px; border-radius: 14px; gap: 10px; }
  .tab-icon { width: 42px; height: 42px; flex-basis: 42px; font-size: 23px; }
  .tab-copy strong { font-size: 13px; }
  .tab-copy small { font-size: 10px; }
  .metric-grid { grid-template-columns: 1fr 1fr; }
}


/* v0.6.7 - filtri stile pannello clinico compatto */
.filter-card { border-radius: 18px; overflow: hidden; }
.filter-card > summary { min-height: 58px; padding: 0 16px; border-bottom: 1px solid #e7edf6; color: #18366f; font-size: 17px; font-weight: 800; letter-spacing: -0.01em; }
.filter-card > summary > span:first-child { display: inline-flex; align-items: center; gap: 8px; }
.filter-card > summary > span:last-child { color: #7d8ea8; font-size: 18px; }
.filter-card > summary b { min-width: 24px; height: 24px; font-size: 12px; font-weight: 800; }
.filter-body { gap: 10px; padding: 14px 14px 16px; }
.filter-item { padding: 0 0 10px; border-bottom: 1px solid #edf2f8; }
.filter-item:last-of-type { border-bottom: 0; }
.field-group, .field-group legend, .field-group > span { color: #223a68; font-size: 13px; font-weight: 760; }
.field-group select, .field-group input, .multi-select > summary { min-height: 40px; padding: 0 12px; border: 1px solid #dce6f3; border-radius: 11px; background: #ffffff; color: #1b4fd4; font-size: 13px; font-weight: 700; box-shadow: 0 1px 2px rgba(14,43,95,0.03); }
.field-group select { padding-right: 34px; }
.date-row { gap: 8px; }
.date-row label { color: #7485a3; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; }
.date-row input { color: #1b4fd4; }
.date-shortcuts { gap: 5px; margin-top: 4px; }
.date-shortcuts button { min-height: 28px; padding: 0 10px; border: 1px solid #d8e3f1; border-radius: 999px; background: #fff; color: #59739a; font-size: 11px; font-weight: 760; }
.date-shortcuts button.active { background: #edf4ff; border-color: #b8d0fb; color: #1a4fc8; }
.segmented { min-height: 40px; border-radius: 12px; border-color: #dce6f3; background: #fbfdff; }
.segmented button { font-size: 13px; font-weight: 760; }
.segmented button.active { background: #eef4ff; color: #1849bf; box-shadow: inset 0 0 0 1px rgba(21,87,213,0.20); }
.multi-menu { border: 1px solid #d8e4f3; border-radius: 12px; box-shadow: 0 10px 24px rgba(18,42,96,0.12); }
.multi-menu-heading strong { color: #223a68; }
.multi-menu-heading button { color: #1a52cf; }
#microorganismOptions label { color: #243859; font-weight: 600; }
#microorganismOptions input { accent-color: #1b57db; }
.sir-profile-card { margin-top: 4px; border: 1px solid #bfd4fc; border-radius: 14px; background: #ffffff; }
.sir-profile-card > summary { min-height: 50px; padding: 0 14px; color: #1650c9; font-size: 14px; font-weight: 800; text-transform: uppercase; }
.sir-profile-card > summary > span:first-child { display: inline-flex; align-items: center; gap: 8px; }
.sir-profile-card > summary > span:last-child { color: #6e82a6; font-size: 16px; }
.sir-profile-card > summary b { min-width: 22px; height: 22px; background: #1a57dd; color: #fff; font-weight: 800; }
.sir-profile-body { padding: 8px 10px 12px; }
.sir-profile-help { display: none; }
.sir-rule-list { gap: 8px; }
.sir-rule-empty { padding: 12px 10px; border: 1px dashed #d7e2f2; border-radius: 12px; background: #fafcff; color: #70839f; }
.sir-rule.sir-rule-inline { display: grid; grid-template-columns: 34px minmax(0,1.35fr) minmax(98px,0.88fr) 62px 24px; align-items: center; gap: 8px; padding: 8px 6px; border: 0; border-bottom: 1px solid #eef3fa; border-radius: 0; background: transparent; }
.sir-rule.sir-rule-inline:last-child { border-bottom: 0; }
.sir-rule-badge { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; font-size: 14px; font-weight: 800; color: #fff; }
.sir-tone-s { background: #1f9b3d; color: #fff; }
.sir-tone-i { background: #f1b933; color: #fff; }
.sir-tone-r { background: #d82323; color: #fff; }
.sir-inline-antibiotic, .sir-inline-operator, .sir-value-select { min-width: 0; min-height: 36px; padding: 0 10px; border: 1px solid #dce6f3; border-radius: 10px; background: #fff; color: #243859; font-size: 13px; font-weight: 700; }
.sir-inline-antibiotic { color: #223a68; }
.sir-inline-operator { text-align: center; }
.sir-value-select { text-align: center; font-weight: 800; }
.sir-value-select.sir-tone-s { color: #1f9b3d; }
.sir-value-select.sir-tone-i { color: #c28800; }
.sir-value-select.sir-tone-r { color: #d82323; }
.sir-remove-button { width: 24px; height: 24px; border-radius: 50%; background: transparent; color: #8a98ae; font-size: 20px; line-height: 1; }
.sir-remove-button:hover { background: #f2f5fa; color: #5b6981; }
.sir-add-button { min-height: 40px; margin-top: 8px; border: 0; border-radius: 12px; background: #ffffff; color: #223a68; font-size: 13px; font-weight: 780; box-shadow: inset 0 0 0 1px #dbe6f5; }
.filter-actions-auto { grid-template-columns: 1fr; gap: 10px; margin-top: 4px; padding-top: 8px; border-top: 0; }
.reset-filter-button { justify-self: end; min-height: 40px; padding: 0 16px; border: 1px solid #dce6f3; border-radius: 12px; background: #ffffff; color: #2a3f67; font-size: 13px; font-weight: 760; }
.auto-filter-status { align-items: flex-start; gap: 10px; padding: 14px 14px; border: 1px solid #e0ebfb; border-radius: 14px; background: #f6faff; color: #1e56d5; font-size: 12px; font-weight: 720; line-height: 1.45; }
.auto-filter-status::before { content: "⎇"; width: 28px; height: 28px; background: #edf4ff; color: #1b53d0; font-size: 14px; }
@media (max-width: 680px) {
  .filter-body { padding: 12px 12px 14px; }
  .sir-rule.sir-rule-inline { grid-template-columns: 30px minmax(0,1fr) 92px 56px 20px; gap: 6px; padding-inline: 2px; }
  .sir-inline-antibiotic, .sir-inline-operator, .sir-value-select { min-height: 34px; font-size: 12px; padding-inline: 8px; }
}


/* v0.6.8 - pannello filtri ad alta fedeltà */
.filter-card { position: sticky; top: 16px; overflow: visible; border: 1px solid #dfe7f2; border-radius: 18px; background: #fff; box-shadow: 0 10px 28px rgba(20,45,95,.07); }
.filter-card-header { display:flex; align-items:center; justify-content:space-between; gap:12px; min-height:62px; padding:10px 14px 10px 16px; border-bottom:1px solid #e9eef6; }
.filter-card-header h2 { display:flex; align-items:center; gap:9px; margin:0; color:#1b3568; font-size:16px; font-weight:820; letter-spacing:-.01em; text-transform:uppercase; }
.filter-header-icon, .filter-note-icon { display:inline-block; flex:0 0 auto; width:20px; height:20px; background:#1a3a76; -webkit-mask:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCI+PHBhdGggZmlsbD0ibm9uZSIgc3Ryb2tlPSJibGFjayIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIGQ9Ik00IDVoMTZsLTYgN3Y1bC00IDJ2LTdMNCA1eiIvPjwvc3ZnPg==") center/contain no-repeat; mask:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCI+PHBhdGggZmlsbD0ibm9uZSIgc3Ryb2tlPSJibGFjayIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIGQ9Ik00IDVoMTZsLTYgN3Y1bC00IDJ2LTdMNCA1eiIvPjwvc3ZnPg==") center/contain no-repeat; }
.filter-card-header h2 b { display:inline-grid; place-items:center; min-width:25px; height:25px; padding:0 7px; border-radius:999px; background:#1557d5; color:#fff; font-size:12px; font-weight:850; }
.reset-filter-button { display:inline-flex; align-items:center; justify-content:center; gap:7px; min-height:40px; padding:0 13px; border:1px solid #dfe6f0; border-radius:11px; background:#fff; color:#263b62; box-shadow:0 2px 6px rgba(20,45,95,.04); font-size:12px; font-weight:760; cursor:pointer; white-space:nowrap; }
.reset-filter-button span { color:#244479; font-size:18px; line-height:1; }
.filter-body { display:grid; gap:0; padding:8px 12px 14px; }
.filter-item { position:relative; display:grid; grid-template-columns:24px minmax(94px,.78fr) minmax(0,1.22fr); align-items:center; column-gap:9px; min-height:50px; margin:0; padding:6px 4px; border:0; border-bottom:1px solid #edf1f6; }
.filter-item::before { content:""; grid-column:1; grid-row:1; width:20px; height:20px; background:#1f3a6c; -webkit-mask:var(--filter-icon) center/contain no-repeat; mask:var(--filter-icon) center/contain no-repeat; }
.filter-item-period { --filter-icon:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCI+PHJlY3QgeD0iMyIgeT0iNSIgd2lkdGg9IjE4IiBoZWlnaHQ9IjE2IiByeD0iMiIgZmlsbD0ibm9uZSIgc3Ryb2tlPSJibGFjayIgc3Ryb2tlLXdpZHRoPSIyIi8+PHBhdGggZD0iTTcgM3Y0TTE3IDN2NE0zIDEwaDE4IiBmaWxsPSJub25lIiBzdHJva2U9ImJsYWNrIiBzdHJva2Utd2lkdGg9IjIiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIvPjxwYXRoIGQ9Ik03IDE0aDJNMTEgMTRoMk0xNSAxNGgyTTcgMThoMk0xMSAxOGgyIiBmaWxsPSJub25lIiBzdHJva2U9ImJsYWNrIiBzdHJva2Utd2lkdGg9IjIiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIvPjwvc3ZnPg=="); align-items:start; padding-block:8px; }
.filter-item-ward { --filter-icon:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCI+PHBhdGggZD0iTTQgMjFWNWw4LTN2MTlNMTIgOGg4djEzTTIgMjFoMjAiIGZpbGw9Im5vbmUiIHN0cm9rZT0iYmxhY2siIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIi8+PHBhdGggZD0iTTcgN2gyTTcgMTFoMk03IDE1aDJNMTUgMTFoMk0xNSAxNWgyIiBmaWxsPSJub25lIiBzdHJva2U9ImJsYWNrIiBzdHJva2Utd2lkdGg9IjIiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIvPjwvc3ZnPg=="); }
.filter-item-material { --filter-icon:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCI+PHBhdGggZD0iTTkgM2g2TTEwIDN2NmwtNiAxMGEyIDIgMCAwIDAgMiAzaDEyYTIgMiAwIDAgMCAyLTNMMTQgOVYzIiBmaWxsPSJub25lIiBzdHJva2U9ImJsYWNrIiBzdHJva2Utd2lkdGg9IjIiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIvPjxwYXRoIGQ9Ik03IDE3aDEwIiBmaWxsPSJub25lIiBzdHJva2U9ImJsYWNrIiBzdHJva2Utd2lkdGg9IjIiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIvPjwvc3ZnPg=="); }
.filter-item-sex { --filter-icon:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCI+PGNpcmNsZSBjeD0iMTIiIGN5PSI4IiByPSI0IiBmaWxsPSJub25lIiBzdHJva2U9ImJsYWNrIiBzdHJva2Utd2lkdGg9IjIiLz48cGF0aCBkPSJNNCAyMWE4IDggMCAwIDEgMTYgMCIgZmlsbD0ibm9uZSIgc3Ryb2tlPSJibGFjayIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiLz48L3N2Zz4="); }
.filter-item-age { --filter-icon:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCI+PGNpcmNsZSBjeD0iOSIgY3k9IjgiIHI9IjQiIGZpbGw9Im5vbmUiIHN0cm9rZT0iYmxhY2siIHN0cm9rZS13aWR0aD0iMiIvPjxwYXRoIGQ9Ik0yIDIxYTcgNyAwIDAgMSAxNCAwTTE2IDRhNCA0IDAgMCAxIDAgOE0xNyAxNGE3IDcgMCAwIDEgNSA3IiBmaWxsPSJub25lIiBzdHJva2U9ImJsYWNrIiBzdHJva2Utd2lkdGg9IjIiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIvPjwvc3ZnPg=="); }
.filter-item-micro { --filter-icon:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCI+PGNpcmNsZSBjeD0iMTIiIGN5PSIxMiIgcj0iNiIgZmlsbD0ibm9uZSIgc3Ryb2tlPSJibGFjayIgc3Ryb2tlLXdpZHRoPSIyIi8+PHBhdGggZD0iTTEyIDJ2NE0xMiAxOHY0TTIgMTJoNE0xOCAxMmg0TTUgNWwzIDNNMTYgMTZsMyAzTTE5IDVsLTMgM004IDE2bC0zIDMiIGZpbGw9Im5vbmUiIHN0cm9rZT0iYmxhY2siIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIi8+PGNpcmNsZSBjeD0iMTAiIGN5PSIxMCIgcj0iMSIvPjxjaXJjbGUgY3g9IjE0IiBjeT0iMTMiIHI9IjEiLz48L3N2Zz4="); }
.filter-item-gram { --filter-icon:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCI+PGNpcmNsZSBjeD0iMTIiIGN5PSIxMiIgcj0iOSIgZmlsbD0ibm9uZSIgc3Ryb2tlPSJibGFjayIgc3Ryb2tlLXdpZHRoPSIyIi8+PHBhdGggZD0iTTUgMTJoNGwyLTMgMyA2IDItM2gzIiBmaWxsPSJub25lIiBzdHJva2U9ImJsYWNrIiBzdHJva2Utd2lkdGg9IjIiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIvPjwvc3ZnPg=="); }
.filter-item-group { --filter-icon:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCI+PHBhdGggZD0ibTEyIDMgOSA1LTkgNS05LTUgOS01ek0zIDEybDkgNSA5LTVNMyAxNmw5IDUgOS01IiBmaWxsPSJub25lIiBzdHJva2U9ImJsYWNrIiBzdHJva2Utd2lkdGg9IjIiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIvPjwvc3ZnPg=="); border-bottom:0; }
.filter-label { grid-column:2; grid-row:1; min-width:0; color:#263a61; font-size:13px; font-weight:760; line-height:1.25; }
.filter-control { grid-column:3; grid-row:1; min-width:0; }
.period-control { grid-row:1 / span 2; }
.field-group select, .field-group input, .multi-select > summary { width:100%; min-height:36px; border:0; border-radius:9px; background:transparent; color:#1557d5; font-size:12px; font-weight:760; box-shadow:none; }
.filter-control-select { position:relative; display:block; }
.filter-control-select select { appearance:none; -webkit-appearance:none; padding:0 24px 0 6px; text-align:right; text-align-last:right; cursor:pointer; }
.filter-control-select::after { content:"›"; position:absolute; top:50%; right:5px; transform:translateY(-52%); color:#263d68; font-size:23px; font-weight:400; line-height:1; pointer-events:none; }
.date-row { display:grid; grid-template-columns:1fr 1fr; gap:5px; }
.date-row label { display:grid; grid-template-columns:auto 1fr; align-items:center; gap:4px; min-width:0; color:#8a99ae; font-size:8px; font-weight:800; text-transform:uppercase; }
.date-row input { min-width:0; height:32px; padding:0 2px; color:#1557d5; font-size:10px; text-align:center; }
.date-shortcuts { grid-column:2 / -1; margin-top:5px; justify-content:flex-end; }
.date-shortcuts button { min-height:25px; padding:0 8px; border:1px solid #e0e7f1; border-radius:999px; background:#fff; color:#60789f; font-size:9px; font-weight:760; }
.date-shortcuts button.active { border-color:#bfd2fa; background:#eef4ff; color:#1751c7; }
.segmented { min-height:36px; border:0; border-radius:9px; background:transparent; }
.segmented button { min-height:36px; padding:0 6px; border:0; color:#587097; font-size:11px; }
.segmented button.active { border-radius:9px; background:#eef4ff; color:#1557d5; box-shadow:inset 0 0 0 1px #c6d8fb; }
.multi-select > summary { display:flex; align-items:center; justify-content:flex-end; gap:8px; padding:0 4px; color:#1557d5; text-align:right; cursor:pointer; }
.multi-select > summary span:last-child { color:#263d68; font-size:22px; font-weight:400; }
.multi-menu { top:calc(100% + 6px); left:auto; width:min(330px,calc(100vw - 46px)); }
.sir-profile-card { margin-top:12px; overflow:hidden; border:1px solid #bcd2fc; border-radius:13px; background:#fff; box-shadow:0 2px 8px rgba(31,85,190,.04); }
.sir-profile-card > summary { min-height:49px; padding:0 13px; border-bottom:1px solid #e7eef9; color:#1452ce; font-size:14px; font-weight:820; text-transform:uppercase; }
.sir-profile-card > summary b { min-width:23px; height:23px; background:#1557d5; color:#fff; font-size:11px; }
.sir-profile-card > summary > span:last-child { color:#395274; font-size:17px; }
.sir-profile-body { padding:0 8px 10px; }
.sir-rule-list { gap:0; }
.sir-rule-empty { margin:9px 2px 2px; padding:10px; border:1px dashed #d9e3f1; border-radius:10px; background:#fafcff; color:#70839f; font-size:10px; }
.sir-rule.sir-rule-inline { grid-template-columns:30px minmax(0,1.42fr) minmax(86px,.82fr) 54px 22px; gap:7px; min-height:54px; padding:7px 4px; border-bottom:1px solid #edf2f8; }
.sir-rule-badge { width:27px; height:27px; font-size:12px; }
.sir-inline-antibiotic, .sir-inline-operator, .sir-value-select { min-height:35px; padding:0 8px; border:1px solid #dfe7f1; border-radius:9px; background:#fff; color:#263a61; font-size:11px; font-weight:720; }
.sir-inline-antibiotic { text-overflow:ellipsis; }
.sir-inline-operator { text-align:center; }
.sir-value-select { padding-inline:5px; text-align:center; font-weight:850; }
.sir-remove-button { width:22px; height:22px; color:#8a97ab; font-size:18px; }
.sir-add-button { min-height:43px; margin:5px 2px 0; border:0; border-radius:9px; background:#fff; color:#253a62; box-shadow:none; font-size:12px; font-weight:780; }
.sir-add-button:hover { background:#f7faff; }
.filter-logic-note { display:grid; grid-template-columns:30px 1fr; gap:10px; align-items:start; margin-top:18px; padding:17px 16px; border:1px solid #e3ecfb; border-radius:13px; background:linear-gradient(135deg,#f4f8ff,#eef5ff); color:#1852c8; }
.filter-note-icon { width:24px; height:24px; background:#1d5ee1; }
.filter-logic-note p { margin:0; font-size:12px; font-weight:700; line-height:1.55; }
.filter-live-status { margin:8px 4px 0; color:#607390; font-size:10px; font-weight:650; text-align:right; }
.filter-live-status:not([data-error="true"]) { position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); clip-path:inset(50%); white-space:nowrap; }
.filter-live-status[data-error="true"] { display:block; padding:9px 11px; border:1px solid #f0cbd0; border-radius:9px; background:#fff5f6; color:#a52a37; text-align:left; }
@media (max-width:930px) { .filter-card { position:static; } }
@media (max-width:680px) {
  .filter-card-header { padding-inline:12px; }
  .filter-card-header h2 { font-size:14px; }
  .reset-filter-button { padding-inline:10px; font-size:11px; }
  .filter-body { padding-inline:9px; }
  .filter-item { grid-template-columns:22px minmax(86px,.72fr) minmax(0,1.28fr); column-gap:7px; }
  .filter-label { font-size:12px; }
  .sir-rule.sir-rule-inline { grid-template-columns:28px minmax(0,1fr) 78px 50px 20px; gap:5px; }
  .sir-inline-antibiotic, .sir-inline-operator, .sir-value-select { padding-inline:5px; font-size:10px; }
}
