/* ==================================================================
   Biblioteca SGI — design system (tema chiaro, stile app)
   ================================================================== */
:root {
  color-scheme: light;
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface2: #eef1f8;
  --text: #1a2233;
  --text-soft: #5f6b85;
  --line: #e6eaf3;
  --line-soft: #eef1f7;
  --accent: #2e5fe0;
  --accent-ink: #2450c0;
  --accent-soft: #eaf0fe;
  --amber-soft: #fdf6e7;
  --amber-ink: #9a6b0f;
  --mark: #fff1b8;
  --shadow-sm: 0 1px 2px rgb(20 35 80 / .06);
  --shadow: 0 1px 2px rgb(20 35 80 / .04), 0 8px 24px rgb(20 35 80 / .07);
  --r-sm: 10px; --r-md: 14px; --r-lg: 18px;
  --serif: ui-serif, "New York", "Charter", "Iowan Old Style", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: var(--sans); font-size: 15px; line-height: 1.55;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { line-height: 1.25; }

/* ---- Icone ---- */
.ic {
  width: 1.2em; height: 1.2em; flex-shrink: 0;
  fill: none; stroke: currentColor; stroke-width: 1.9;
  stroke-linecap: round; stroke-linejoin: round;
  vertical-align: -0.24em;
}
.ic-sm { width: 1em; height: 1em; }

/* ---- Barra superiore ---- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: rgb(255 255 255 / .88); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  max-width: 1280px; margin: 0 auto; padding: 12px 20px;
  display: flex; align-items: center; gap: 16px;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); white-space: nowrap; }
.brand-mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 10px; color: #fff;
  background: linear-gradient(135deg, #3b6ff0 0%, #2748c9 100%);
  box-shadow: 0 2px 8px rgb(46 95 224 / .35);
}
.brand-mark .ic { width: 19px; height: 19px; vertical-align: 0; }
.brand-text { font-family: var(--serif); font-size: 20px; font-weight: 600; letter-spacing: -.01em; }
.brand-text em { font-style: normal; color: var(--accent); font-weight: 700; }
.searchwrap { flex: 1; display: flex; flex-direction: column; gap: 2px; }
#search {
  width: 100%; padding: 9px 16px;
  border: 1px solid var(--line); border-radius: var(--r-md);
  background: var(--surface2); outline: none; transition: all .15s;
}
#search:focus { border-color: var(--accent); background: var(--surface); box-shadow: 0 0 0 3px var(--accent-soft); }
.search-hint { font-size: 12px; color: var(--text-soft); padding-left: 4px; min-height: 15px; }

/* ---- Bottoni ---- */
.btn-ghost {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 999px;
  padding: 8px 16px; cursor: pointer; color: var(--text); font-weight: 500; font-size: 14px;
  box-shadow: var(--shadow-sm); transition: all .15s;
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent-ink); }
.btn-link {
  background: none; border: none; color: var(--accent-ink); cursor: pointer;
  padding: 0; text-decoration: none; font-size: 14px; font-weight: 600;
}
.btn-link:hover { text-decoration: underline; }
.btn-primary {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  background: linear-gradient(180deg, #3568ea, #2b57d6); color: #fff;
  border: none; border-radius: 999px; padding: 10px 22px; cursor: pointer;
  font-weight: 600; font-size: 14.5px;
  box-shadow: 0 3px 10px rgb(46 95 224 / .3), inset 0 1px 0 rgb(255 255 255 / .18);
  transition: filter .15s;
}
.btn-primary:hover { filter: brightness(1.06); }
.btn-primary:disabled { opacity: .6; cursor: default; }
.btn-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--surface2); border: none; cursor: pointer; color: var(--text-soft);
  transition: all .15s;
}
.btn-icon:hover { background: var(--accent-soft); color: var(--accent-ink); }

/* ---- Badge fonte (tinte morbide) ---- */
.badge {
  display: inline-block; font-size: 11px; font-weight: 650; letter-spacing: .01em;
  border-radius: 7px; padding: 2.5px 8px; white-space: nowrap;
}
.badge.rsnd1 { background: #e7eefc; color: #2450c0; }
.badge.rsnd2 { background: #dff4f6; color: #0b6e7a; }
.badge.sutra { background: #fcf0da; color: #96650a; }
.badge.nr    { background: #e2f5e9; color: #157a3f; }
.badge.bes   { background: #efe9fc; color: #6640b8; }

/* ---- Layout ricerca ---- */
.layout {
  max-width: 1280px; margin: 0 auto; padding: 24px 20px 60px;
  display: grid; grid-template-columns: 280px 1fr; gap: 28px; align-items: start;
}
.filters {
  position: sticky; top: 78px; max-height: calc(100vh - 98px); overflow-y: auto;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 18px; box-shadow: var(--shadow);
}
.filters-head { display: flex; align-items: baseline; justify-content: space-between; }
.filters-head h2 { margin: 0 0 4px; font-size: 16px; }
.fgroup { margin-top: 18px; }
.fgroup h3 {
  margin: 0 0 8px; font-size: 11px; text-transform: uppercase;
  letter-spacing: .09em; color: var(--text-soft); font-weight: 650;
}
.fgroup input[type="text"], .fgroup input[list], .fgroup input[type="number"], .fgroup input:not([type]) {
  width: 100%; padding: 8px 12px; border: 1px solid var(--line);
  border-radius: var(--r-sm); background: var(--surface2); outline: none;
}
.fgroup input:focus { border-color: var(--accent); background: var(--surface); }
.checklist label {
  display: flex; align-items: center; gap: 8px; padding: 5px 6px;
  cursor: pointer; border-radius: 8px; font-size: 14px;
}
.checklist label:hover { background: var(--surface2); }
.checklist input[type="checkbox"] { accent-color: var(--accent); }
.checklist .count { margin-left: auto; color: var(--text-soft); font-size: 12px; font-variant-numeric: tabular-nums; }
.chipcloud { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  border: 1px solid var(--line); background: var(--surface);
  border-radius: 999px; padding: 4px 12px; font-size: 13px; cursor: pointer;
  transition: all .12s;
}
.chip:hover { border-color: var(--accent); color: var(--accent-ink); }
.chip.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.chip .count { opacity: .6; font-size: 11px; margin-left: 4px; }
.yearrow { display: flex; align-items: center; gap: 8px; }
.yearrow input { width: 100%; }

/* ---- Risultati ---- */
.active-filters { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.rescard {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 16px 20px; margin-bottom: 12px; cursor: pointer;
  box-shadow: var(--shadow-sm); transition: all .15s;
}
.rescard:hover { border-color: #c8d6f5; box-shadow: var(--shadow); transform: translateY(-1px); }
.rescard-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.doc-type-label { font-size: 12px; color: var(--text-soft); }
.rescard h3 { margin: 7px 0 2px; font-family: var(--serif); font-size: 19px; font-weight: 600; }
.rescard .meta { font-size: 13px; color: var(--text-soft); margin: 0 0 6px; }
.rescard .snip { font-family: var(--serif); font-size: 14.5px; margin: 6px 0; }
.rescard .snip mark, .doc-body mark { background: var(--mark); color: inherit; border-radius: 3px; padding: 0 1px; }
.rescard .tagrow { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 9px; }
.tag-mini {
  font-size: 11.5px; font-weight: 550; color: var(--accent-ink); background: var(--accent-soft);
  padding: 2.5px 9px; border-radius: 999px;
}
.empty { text-align: center; color: var(--text-soft); padding: 60px 0; font-size: 15px; }
.more-wrap { text-align: center; margin-top: 18px; }

/* ---- Lettura documento ---- */
.reader { max-width: 860px; margin: 0 auto; padding: 20px 20px 80px; }
.reader-bar {
  display: flex; justify-content: space-between; align-items: center;
  position: sticky; top: 66px; z-index: 10;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(8px); padding: 10px 0; margin-bottom: 10px;
}
.reader-inner {
  background: var(--surface); border: 1px solid var(--line); border-radius: 22px;
  padding: clamp(24px, 5vw, 56px); box-shadow: var(--shadow);
}
.doc-meta-top { display: flex; align-items: center; gap: 10px; }
.doc-number { color: var(--text-soft); font-size: 13px; }
.reader h1 { font-family: var(--serif); font-size: clamp(26px, 4vw, 34px); font-weight: 600; margin: 12px 0 6px; }
.doc-meta { color: var(--text-soft); margin: 0 0 12px; font-size: 14px; }
.doc-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.doc-summary {
  background: var(--accent-soft); border-radius: var(--r-md); padding: 12px 16px;
  font-size: 14.5px; margin-bottom: 14px;
}
.doc-ai-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.btn-ai { font-size: 13px; padding: 7px 14px; color: var(--accent-ink); }
.doc-ai-result {
  border: 1px solid var(--line); border-left: 3px solid var(--accent);
  border-radius: var(--r-md); padding: 14px 18px; margin-bottom: 18px;
  font-size: 14.5px; line-height: 1.65; background: var(--surface2);
}
.doc-background {
  border: 1px solid var(--line); border-radius: var(--r-md);
  padding: 10px 16px; margin-bottom: 22px; background: var(--surface2);
}
.doc-background summary { cursor: pointer; font-weight: 600; font-size: 14.5px; }
.doc-background div { padding-top: 8px; }
.doc-body, .doc-background, .doc-notes { font-family: var(--serif); font-size: 17.5px; line-height: 1.78; }
.doc-body p { margin: 0 0 1em; }
.doc-body a, .doc-notes a { color: var(--accent-ink); text-decoration: none; }
.doc-body a:hover, .doc-notes a:hover { text-decoration: underline; }
.doc-body img { max-width: 100%; height: auto; border-radius: var(--r-md); }
.doc-body table { border-collapse: collapse; width: 100%; font-size: 15px; font-family: var(--sans); }
.doc-body td, .doc-body th { border: 1px solid var(--line); padding: 6px 10px; }
.doc-notes { border-top: 1px solid var(--line); margin-top: 34px; padding-top: 10px; }
.doc-notes h2 { font-size: 18px; }
.doc-notes > div > div { margin-bottom: .7em; font-size: 15px; }
.doc-notes div[id^="nota"]:target, .doc-body :target { background: var(--mark); border-radius: 4px; }
.doc-credit {
  margin: 34px 0 0; padding-top: 16px; border-top: 1px solid var(--line);
  font-size: 12.5px; line-height: 1.55; color: var(--text-soft);
}
.doc-credit i { font-style: italic; }
.doc-credit a { color: var(--accent-ink); text-decoration: none; white-space: nowrap; }
.doc-credit a:hover { text-decoration: underline; }
.doc-nav { display: flex; margin-top: 24px; }
.doc-nav .spacer { flex: 1; }
.home-credit {
  max-width: 640px; margin: 14px auto 0; text-align: center;
  font-size: 11.5px; line-height: 1.5; color: var(--text-soft);
}
.home-credit a { color: var(--accent-ink); }

/* ---- Pannelli (Glossario / Chiedi) ---- */
.glossario-overlay { position: fixed; inset: 0; z-index: 40; background: rgb(15 25 55 / .35); }
.glossario-panel {
  position: absolute; top: 0; right: 0; bottom: 0; width: min(460px, 94vw);
  background: var(--surface); border-left: 1px solid var(--line);
  padding: 18px 20px; display: flex; flex-direction: column; gap: 12px;
  box-shadow: -12px 0 40px rgb(15 25 55 / .18);
}
.ask-panel { width: min(560px, 96vw); }
.glossario-head { display: flex; justify-content: space-between; align-items: center; }
.glossario-head h2 { margin: 0; font-family: var(--serif); font-weight: 600; font-size: 21px; }
.head-actions { display: flex; gap: 8px; }
#glossario-search {
  padding: 10px 14px; border: 1px solid var(--line); border-radius: var(--r-md);
  background: var(--surface2); outline: none;
}
#glossario-search:focus { border-color: var(--accent); background: var(--surface); }
.glossario-list { overflow-y: auto; flex: 1; -webkit-overflow-scrolling: touch; }
.glossario-list .gterm { padding: 10px 4px; border-bottom: 1px solid var(--line-soft); }
.glossario-list .gterm b { font-family: var(--serif); font-size: 16px; font-weight: 600; }
.glossario-list .gterm p { margin: 4px 0 0; font-size: 14px; color: var(--text-soft); }

/* ---- Chiedi ---- */
.ask-settings {
  background: var(--surface2); border: 1px solid var(--line);
  border-radius: var(--r-md); padding: 12px 14px;
  display: flex; flex-direction: column; gap: 8px;
}
.ask-hint { margin: 0; font-size: 12.5px; color: var(--text-soft); }
.ask-settings input, .ask-settings select {
  width: 100%; padding: 9px 12px; border: 1px solid var(--line);
  border-radius: var(--r-sm); background: var(--surface); outline: none;
}
.ask-settings-row { display: flex; gap: 8px; }
.ask-settings-row select { flex: 1; }
.ask-input-row { display: flex; gap: 8px; align-items: stretch; }
.ask-input-row textarea {
  flex: 1; resize: none; padding: 10px 14px;
  border: 1px solid var(--line); border-radius: var(--r-md);
  background: var(--surface2); outline: none; line-height: 1.4;
}
.ask-input-row textarea:focus { border-color: var(--accent); background: var(--surface); box-shadow: 0 0 0 3px var(--accent-soft); }
.ask-scroll { flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.ask-history h3, .ask-sources h3 {
  font-size: 11px; text-transform: uppercase; letter-spacing: .09em;
  color: var(--text-soft); margin: 12px 0 6px; font-weight: 650;
}
.ask-hrow { display: flex; align-items: center; gap: 4px; }
.ask-hopen {
  flex: 1; min-width: 0; display: flex; align-items: baseline; gap: 8px;
  background: var(--surface2); border: none; border-radius: var(--r-md);
  padding: 11px 13px; margin: 3px 0; cursor: pointer; text-align: left;
  color: var(--text); font-size: 14px; transition: background .15s;
}
.ask-hopen:hover { background: var(--accent-soft); }
.ask-hq { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 550; }
.ask-hopen .count { flex-shrink: 0; color: var(--text-soft); font-size: 12px; }
.ask-hdel {
  background: none; border: none; color: var(--text-soft); cursor: pointer;
  font-size: 13px; padding: 6px; border-radius: 8px;
}
.ask-hdel:hover { color: #c0392b; background: var(--surface2); }
.ask-q {
  font-family: var(--sans); font-weight: 600; font-size: 14.5px;
  background: var(--accent-soft); border-radius: var(--r-md); padding: 10px 14px;
  margin: 4px 0 14px;
}
.ask-answer { font-family: var(--serif); font-size: 16px; line-height: 1.72; padding: 4px 2px 14px; }
.ask-answer p { margin: 0 0 .85em; }
.ask-loading { color: var(--text-soft); font-family: var(--sans); font-size: 14px; }
.cite {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 19px; height: 19px; padding: 0 5px; margin: 0 1px;
  background: var(--accent-soft); color: var(--accent-ink);
  border: none; border-radius: 6px; font-size: 11.5px; font-weight: 650;
  font-family: var(--sans); cursor: pointer; vertical-align: text-top;
}
.cite:hover { background: var(--accent); color: #fff; }
.ask-source {
  display: flex; align-items: center; gap: 8px; width: 100%; text-align: left;
  background: none; border: none; cursor: pointer; padding: 7px 6px;
  border-radius: var(--r-sm); color: var(--text); font-size: 13.5px; line-height: 1.35;
}
.ask-source:hover { background: var(--surface2); }
.ask-source .count { color: var(--text-soft); font-size: 12px; }

/* ---- Home / Dashboard ---- */
.home { max-width: 1100px; margin: 0 auto; padding: 30px 20px 60px; }
.home-hero { text-align: center; margin-bottom: 26px; }
.home-hero h1 { font-family: var(--serif); font-weight: 600; font-size: clamp(27px, 5vw, 36px); margin: 8px 0 2px; }
.home-date { margin: 0 0 18px; color: var(--text-soft); font-size: 14px; text-transform: capitalize; }
.home-ask {
  display: flex; align-items: center; gap: 8px; max-width: 640px; margin: 0 auto;
  background: var(--surface); border: 1px solid var(--line); border-radius: 999px;
  padding: 6px 6px 6px 16px; box-shadow: var(--shadow);
}
.home-ask:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft), var(--shadow); }
.home-ask-ic { color: var(--accent); }
.home-ask input { flex: 1; min-width: 0; border: none; background: none; outline: none; font-size: 15.5px; padding: 8px 0; }
.home-ask .btn-primary { padding: 9px 20px; }
.home-cards {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(430px, 100%), 1fr));
  gap: 16px; align-items: start;
}
.dash-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 16px 18px; box-shadow: var(--shadow-sm);
}
.dash-card h2 {
  margin: 0 0 12px; font-size: 15px; font-weight: 650;
  display: flex; align-items: center; gap: 10px;
}
.dash-card h2 .dash-more { margin-left: auto; font-size: 13px; }
.dash-ic {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 10px; flex-shrink: 0;
}
.dash-ic .ic { width: 17px; height: 17px; vertical-align: 0; }
.dash-ic--amber { background: var(--amber-soft); color: var(--amber-ink); }
.dash-ic--blue { background: var(--accent-soft); color: var(--accent-ink); }
.dash-ic--teal { background: #dff4f6; color: #0b6e7a; }
.dash-ic--violet { background: #efe9fc; color: #6640b8; }
.dash-ic--green { background: #e2f5e9; color: #157a3f; }
.dash-frase {
  margin: 0 0 10px; font-family: var(--serif); font-size: 16.5px; line-height: 1.68;
  border-left: 3px solid #e5b64c; padding: 2px 0 2px 14px;
}
.dash-src { margin: 0; font-size: 12.5px; color: var(--text-soft); }
.dash-excerpt { margin: 0 0 8px; font-size: 14px; color: var(--text-soft); line-height: 1.55; }
.dash-item {
  display: flex; align-items: center; gap: 9px; width: 100%; text-align: left;
  background: none; border: none; cursor: pointer; padding: 8px 6px;
  border-radius: var(--r-sm); color: var(--text); font-size: 14px; line-height: 1.35;
  border-bottom: 1px solid var(--line-soft);
}
.dash-item:last-child { border-bottom: none; }
.dash-item:hover { background: var(--surface2); }
.dash-item .badge { flex-shrink: 0; }
.dash-item-title { flex: 1; min-width: 0; }
.dash-item .count { color: var(--text-soft); font-size: 12px; white-space: nowrap; }
.dash-stat {
  grid-column: 1 / -1; display: flex; align-items: center; gap: 14px;
  text-decoration: none; color: var(--text);
  background: linear-gradient(135deg, #eaf0fe, #f5f8ff);
  border: 1px solid #d3e0fb;
}
.dash-stat:hover { border-color: var(--accent); box-shadow: var(--shadow); }
.dash-stat-txt { flex: 1; display: flex; flex-direction: column; }
.dash-stat-txt b { font-size: 16px; }
.dash-stat-txt small { color: var(--text-soft); font-size: 13px; }
.dash-stat-arrow { font-size: 20px; color: var(--accent); }
.home-stats { text-align: center; color: var(--text-soft); font-size: 13px; margin-top: 24px; }
.home-stats a { color: var(--accent-ink); }

/* ---- Barra di navigazione mobile ---- */
.bottomnav {
  display: none;
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  background: rgb(255 255 255 / .92); backdrop-filter: blur(16px);
  border-top: 1px solid var(--line);
  padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
  justify-content: space-around;
}
.bottomnav button {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  background: none; border: none; cursor: pointer;
  font-size: 10.5px; font-weight: 550; color: var(--text-soft);
  padding: 5px 16px; border-radius: 12px; transition: color .15s;
}
.bottomnav button .ic { width: 21px; height: 21px; vertical-align: 0; }
.bottomnav button.on { color: var(--accent-ink); }
.bottomnav button.on .ic { stroke-width: 2.3; }

/* ---- Login ---- */
.auth-wrap {
  min-height: 100vh; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 4px; padding: 24px;
}
.auth-card {
  width: min(400px, 100%); background: var(--surface);
  border: 1px solid var(--line); border-radius: 22px;
  padding: 34px 30px; box-shadow: var(--shadow); text-align: center;
}
.auth-card .brand-mark { width: 52px; height: 52px; border-radius: 15px; margin: 0 auto 14px; }
.auth-card .brand-mark .ic { width: 28px; height: 28px; }
.auth-card h1 { font-family: var(--serif); font-weight: 600; font-size: 24px; margin: 0 0 4px; }
.auth-sub { color: var(--text-soft); font-size: 14px; margin: 0 0 22px; }
.auth-card form { display: flex; flex-direction: column; gap: 10px; }
.auth-card input {
  padding: 12px 15px; border: 1px solid var(--line); border-radius: var(--r-md);
  background: var(--surface2); outline: none; font-size: 15px;
}
.auth-card input:focus { border-color: var(--accent); background: var(--surface); box-shadow: 0 0 0 3px var(--accent-soft); }
.auth-card .btn-primary { margin-top: 6px; padding: 12px; }
.auth-error {
  background: #fdeaea; color: #a33a2e; border-radius: var(--r-sm);
  padding: 10px 12px; font-size: 13.5px; margin: 0 0 4px;
}
.auth-credit {
  text-align: center; margin: 18px auto 0; max-width: 380px;
  font-size: 11.5px; line-height: 1.5; color: var(--text-soft);
}

/* ---- Utente solo-statistica: home ridotta (saluto, frase del giorno, bottone report) ---- */
body.stats-only .searchwrap,
body.stats-only #btn-ask,
body.stats-only #btn-glossario,
body.stats-only #btn-home,
body.stats-only .home-ask,
body.stats-only .bottomnav { display: none !important; }
body.stats-only { padding-bottom: 12px !important; }

/* ---- Responsive ---- */
.only-mobile { display: none; }
@media (max-width: 900px) {
  /* iOS zooma sui campi con testo < 16px: su mobile tutti i campi a 16px */
  input, select, textarea { font-size: 16px !important; }
  .layout { grid-template-columns: 1fr; padding: 16px 14px 60px; }
  .filters { position: static; max-height: none; display: none; }
  .filters.open { display: block; }
  .topbar-inner { flex-wrap: wrap; gap: 10px; padding: 11px 14px; justify-content: center; }
  .brand { justify-content: center; }
  .searchwrap { order: 3; flex-basis: 100%; display: none; }
  body[data-view="list"] .searchwrap { display: flex; }
  .only-mobile { display: block; }
  .only-desktop { display: none !important; }
  .bottomnav { display: flex; }
  body { padding-bottom: 74px; }
  .reader { padding: 12px 12px 80px; }
  .reader-bar { position: static; padding: 6px 0; }
  .reader-inner { border-radius: var(--r-lg); }
  .home { padding: 16px 14px 40px; }
  .glossario-panel, .ask-panel {
    width: 100vw;
    padding-bottom: calc(82px + env(safe-area-inset-bottom));
  }
}
