/* =====================================================
   EioPago Tool — tool.css
   Mobile-first. Tre file separati. Zero patch.
   © 2026 Zencode Studio — P.IVA 04167681206
   ===================================================== */

/* ── RESET ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }

/* ── VARIABILI ──────────────────────────────────────── */
:root {
  --bg:      #faf8f4;
  --bg2:     #ffffff;
  --bg3:     #f4f1eb;
  --ink:     #1a1714;
  --ink2:    #3d3a36;
  --ink3:    #6b6760;
  --ink4:    #9a9690;
  --red:     #c0392b;
  --red2:    #a93226;
  --red-bg:  #fdf2f1;
  --green:   #1a6e42;
  --green-bg:#f0faf5;
  --orange:  #c47a10;
  --blue:    #1a5fa0;
  --border:  rgba(26,23,20,0.08);
  --border2: rgba(26,23,20,0.16);
  --nav-h:   56px;
  --sidebar-w: 220px;
  --ai-w:    280px;
  --ff-serif: 'DM Serif Display', Georgia, serif;
  --ff-body:  'DM Sans', system-ui, sans-serif;
  --ff-mono:  'DM Mono', monospace;
}

[data-theme="dark"] {
  --bg:      #0e0e0f;
  --bg2:     #161618;
  --bg3:     #1e1e21;
  --ink:     #f0ede8;
  --ink2:    #c0bdb8;
  --ink3:    #8a8880;
  --ink4:    #5a5855;
  --red:     #e63329;
  --red2:    #ff5a52;
  --red-bg:  rgba(230,51,41,0.08);
  --green:   #22c97a;
  --green-bg:rgba(34,201,122,0.08);
  --orange:  #f5a623;
  --blue:    #4a9eff;
  --border:  rgba(255,255,255,0.07);
  --border2: rgba(255,255,255,0.14);
}

/* ── BASE ───────────────────────────────────────────── */
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--ff-body);
  font-size: 14px;
  line-height: 1.6;
  overflow-x: hidden;
  transition: background 0.2s, color 0.2s;
}
a { color: inherit; text-decoration: none; }

/* ── SKIP LINK ──────────────────────────────────────── */
.skip-link {
  position: absolute; top: -100px; left: 1rem;
  background: var(--red); color: white;
  padding: 8px 16px; border-radius: 0 0 4px 4px;
  font-size: 14px; z-index: 9999; transition: top 0.2s;
}
.skip-link:focus { top: 0; }

/* ── BUTTONS ────────────────────────────────────────── */
.btn-primary {
  display: inline-block; background: var(--red); color: white;
  padding: 8px 18px; border-radius: 4px; font-size: 13px;
  font-weight: 500; border: none; cursor: pointer;
  font-family: var(--ff-body); transition: background 0.2s; white-space: nowrap;
}
.btn-primary:hover { background: var(--red2); }
.btn-outline {
  display: inline-block; background: none; color: var(--ink2);
  border: 1px solid var(--border2); padding: 8px 18px;
  border-radius: 4px; font-size: 13px; cursor: pointer;
  font-family: var(--ff-body); transition: all 0.2s; white-space: nowrap;
}
.btn-outline:hover { border-color: var(--ink); color: var(--ink); }
.btn-sm { padding: 6px 12px; font-size: 12px; }

/* ── THEME TOGGLE ───────────────────────────────────── */
.theme-toggle { position: relative; display: inline-block; width: 34px; height: 18px; cursor: pointer; }
.theme-toggle input { opacity: 0; width: 0; height: 0; }
.theme-knob {
  position: absolute; inset: 0;
  background: var(--border2); border-radius: 18px; transition: 0.2s;
}
.theme-knob::before {
  content: ''; position: absolute;
  height: 12px; width: 12px; left: 3px; bottom: 3px;
  background: white; border-radius: 50%; transition: 0.2s;
}
.theme-toggle input:checked + .theme-knob { background: var(--red); }
.theme-toggle input:checked + .theme-knob::before { transform: translateX(16px); }

/* ── NAVBAR ─────────────────────────────────────────── */
#nav {
  position: fixed; top: 0; left: 0; right: 0;
  height: var(--nav-h); z-index: 100;
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center;
  padding: 0 1.5rem; gap: 1rem;
  transition: background 0.2s;
}
.nav-logo {
  font-family: var(--ff-serif); font-size: 1.2rem;
  color: var(--ink); letter-spacing: -0.01em;
  flex-shrink: 0; white-space: nowrap;
}
.nav-logo span { color: var(--red); }
.nav-logo small {
  font-family: var(--ff-mono); font-size: 0.48rem;
  color: var(--ink4); vertical-align: super; margin-left: 1px;
}

/* Desktop: tabs nella navbar */
.nav-links {
  display: flex; align-items: center; gap: 2px; flex: 1;
}
.nav-tab {
  background: none; border: none; cursor: pointer;
  padding: 6px 12px; border-radius: 4px;
  font-size: 13px; color: var(--ink3);
  font-family: var(--ff-body); transition: all 0.15s;
  white-space: nowrap;
}
.nav-tab:hover { color: var(--ink); background: var(--bg3); }
.nav-tab.active { color: var(--red); background: var(--red-bg); font-weight: 500; }

/* Desktop: azioni */
.nav-actions {
  display: flex; align-items: center; gap: 8px; flex-shrink: 0;
}

/* Hamburger — nascosto desktop */
.hamburger {
  display: none; flex-direction: column; justify-content: center;
  align-items: center; gap: 5px; width: 36px; height: 36px;
  background: none; border: 1px solid var(--border2);
  border-radius: 4px; cursor: pointer; padding: 6px;
}
.hamburger span {
  display: block; width: 18px; height: 1.5px;
  background: var(--ink2); border-radius: 2px; transition: all 0.2s;
}
.hamburger.open span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* ── MOBILE DRAWER ──────────────────────────────────── */
.drawer {
  display: none; position: fixed;
  top: var(--nav-h); left: 0; right: 0;
  background: var(--bg2); border-bottom: 1px solid var(--border);
  z-index: 99; flex-direction: column; padding-bottom: 1rem;
  transition: background 0.2s;
}
.drawer.open { display: flex; }
.drawer-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0.75rem 1.25rem; border-bottom: 1px solid var(--border);
}
.drawer-head span {
  font-family: var(--ff-mono); font-size: 9px;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink4);
}
.drawer-head button {
  background: none; border: none; color: var(--ink4);
  font-size: 16px; cursor: pointer; padding: 4px;
}
.drawer-tab {
  display: block; width: 100%; padding: 13px 1.25rem;
  background: none; border: none; border-bottom: 1px solid var(--border);
  text-align: left; font-size: 15px; color: var(--ink2);
  font-family: var(--ff-body); cursor: pointer; transition: all 0.15s;
}
.drawer-tab:hover { color: var(--red); background: var(--red-bg); }
.drawer-tab.active { color: var(--red); border-left: 3px solid var(--red); }
.drawer-actions {
  display: flex; gap: 8px; padding: 1rem 1.25rem 0; flex-wrap: wrap;
}
.drawer-footer {
  display: flex; gap: 1.5rem; padding: 0.75rem 1.25rem 0;
}
.drawer-footer a {
  font-size: 11px; color: var(--ink4); transition: color 0.15s;
}
.drawer-footer a:hover { color: var(--red); }
.overlay {
  display: none; position: fixed; inset: 0; z-index: 98;
  background: rgba(0,0,0,0.3);
}
.overlay.open { display: block; }

/* ── LAYOUT DESKTOP ─────────────────────────────────── */
.layout {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr var(--ai-w);
  grid-template-rows: calc(100vh - var(--nav-h));
  margin-top: var(--nav-h);
}

/* ── SIDEBAR ────────────────────────────────────────── */
.sidebar {
  background: var(--bg2); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; overflow-y: auto;
  padding: 1.25rem 0; transition: background 0.2s;
}
.sidebar-logo {
  padding: 0 1.25rem 1.25rem;
  border-bottom: 1px solid var(--border);
}
.sidebar-logo a {
  font-family: var(--ff-serif); font-size: 1.25rem;
  color: var(--ink); letter-spacing: -0.01em;
}
.sidebar-logo span { color: var(--red); }
.sidebar-logo small {
  font-family: var(--ff-mono); font-size: 0.48rem;
  color: var(--ink4); vertical-align: super; margin-left: 1px;
}
.sidebar-nav { padding: 1rem 0; }
.sidebar-label {
  font-family: var(--ff-mono); font-size: 9px;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--ink4); padding: 0 1.25rem; margin-bottom: 0.4rem;
}
.sidebar-btn {
  display: flex; align-items: center; gap: 8px;
  width: 100%; padding: 7px 1.25rem;
  background: none; border: none; border-left: 2px solid transparent;
  color: var(--ink3); font-family: var(--ff-body); font-size: 13px;
  cursor: pointer; text-align: left; transition: all 0.15s;
}
.sidebar-btn span { opacity: 0.7; }
.sidebar-btn:hover { color: var(--ink); background: rgba(128,128,128,0.06); }
.sidebar-btn.active {
  color: var(--ink); background: var(--red-bg);
  border-left-color: var(--red);
}
.sidebar-positions { padding: 1rem 1.25rem; flex: 1; }
.sidebar-empty { font-size: 11px; color: var(--ink4); font-style: italic; line-height: 1.6; }
.btn-salva {
  width: 100%; margin-top: 0.5rem; padding: 6px 12px;
  background: none; border: 1px solid var(--border2);
  border-radius: 4px; color: var(--ink3);
  font-family: var(--ff-body); font-size: 12px;
  cursor: pointer; text-align: left; transition: all 0.15s;
}
.btn-salva:hover { border-color: var(--red); color: var(--ink); }
.fascicolo-item {
  padding: 6px 8px; border-radius: 4px; border: 1px solid var(--border);
  font-size: 12px; color: var(--ink3); cursor: pointer; margin-bottom: 4px;
  transition: all 0.15s;
}
.fascicolo-item:hover { color: var(--ink); border-color: var(--border2); }
.fascicolo-item strong { display: block; color: var(--ink); font-size: 12px; }
.sidebar-foot {
  padding: 1rem 1.25rem 0; border-top: 1px solid var(--border);
  font-size: 11px; color: var(--ink4); display: flex;
  flex-direction: column; gap: 0.75rem;
}
.theme-row { display: flex; align-items: center; justify-content: space-between; }

/* ── CONTENT ────────────────────────────────────────── */
.content { overflow-y: auto; display: flex; flex-direction: column; }

/* PDF Banner */
.pdf-banner {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 1.5rem; background: var(--green-bg);
  border-bottom: 1px solid rgba(26,110,66,0.2);
  font-size: 12px; color: var(--green); flex-shrink: 0;
}
.pdf-banner button {
  background: none; border: none; color: var(--ink4); cursor: pointer; font-size: 14px;
}

/* Tab header */
.tab-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.25rem 1.5rem; border-bottom: 1px solid var(--border);
  background: var(--bg2); flex-wrap: wrap; gap: 8px; flex-shrink: 0;
  transition: background 0.2s;
}
.tab-pill {
  font-size: 9px; font-weight: 600; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--red);
  border: 0.5px solid var(--red); border-radius: 3px; padding: 2px 6px;
}
.tab-header h1 {
  font-family: var(--ff-serif); font-size: 1.4rem;
  font-weight: 400; color: var(--ink); letter-spacing: -0.02em;
}

/* Tabs */
.tab { display: none; padding: 1.5rem; overflow-y: auto; }
.tab.active { display: block; }

/* Cards */
.card {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: 8px; padding: 1.25rem; margin-bottom: 1.25rem;
  transition: background 0.2s;
}

/* Step head */
.step-head {
  display: flex; align-items: flex-start; gap: 1rem; margin-bottom: 1.25rem;
}
.step-badge {
  font-family: var(--ff-mono); font-size: 10px; color: var(--red);
  border: 0.5px solid var(--red); border-radius: 3px;
  padding: 2px 5px; flex-shrink: 0; margin-top: 2px;
}
.step-head strong { font-size: 14px; font-weight: 500; display: block; margin-bottom: 2px; }
.step-head small { font-size: 11px; color: var(--ink4); }

/* Grid */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.span-2 { grid-column: span 2; }

/* Fields */
.field { display: flex; flex-direction: column; gap: 5px; }
.field label {
  font-size: 10px; font-weight: 500; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--ink4);
}
.field small { font-size: 11px; color: var(--ink4); line-height: 1.5; }
input[type="text"],
input[type="number"],
select {
  background: var(--bg3); border: 1px solid var(--border2);
  border-radius: 6px; padding: 8px 12px; color: var(--ink);
  font-family: var(--ff-body); font-size: 14px; outline: none;
  transition: border-color 0.15s, background 0.2s; width: 100%;
}
input:focus, select:focus { border-color: var(--red); }
.mono { font-family: var(--ff-mono); letter-spacing: 0.06em; }

/* Coeff big */
.coeff-big {
  font-family: var(--ff-mono); font-size: 2rem;
  font-weight: 500; color: var(--red); letter-spacing: -0.02em; padding: 4px 0;
}

/* Limit bar */
.limit-bar {
  height: 3px; background: var(--bg3); border-radius: 2px;
  overflow: hidden; margin: 6px 0 2px;
}
.limit-fill { height: 100%; background: var(--red); border-radius: 2px; transition: width 0.3s; width: 0; }
#limit-label { font-family: var(--ff-mono); font-size: 10px; color: var(--ink4); }

/* Results */
.results-title {
  font-family: var(--ff-serif); font-size: 1.1rem;
  font-weight: 400; margin-bottom: 1rem; color: var(--ink);
}
.results-grid {
  display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; margin-bottom: 1.25rem;
}
.res-card {
  background: var(--bg3); border-radius: 6px; padding: 0.875rem;
  border: 1px solid var(--border); transition: background 0.2s;
}
.res-label { font-size: 10px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink4); margin-bottom: 4px; }
.res-val { font-family: var(--ff-mono); font-size: 16px; font-weight: 500; color: var(--ink); }
.res-val.big { font-size: 20px; }
.res-sub { font-size: 10px; color: var(--ink4); margin-top: 3px; }
.res-card.red .res-val { color: var(--red); }
.res-card.green .res-val { color: var(--green); }

/* Piano versamenti */
.piano-title {
  font-size: 10px; font-weight: 500; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--ink4);
  margin-bottom: 0.75rem; padding-top: 1rem;
  border-top: 1px solid var(--border);
}
.piano-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 9px 0; border-bottom: 1px solid var(--border); gap: 12px;
}
.piano-row:last-child { border-bottom: none; }
.piano-row-l { flex: 1; }
.piano-row-l strong { font-size: 13px; font-weight: 500; display: block; }
.piano-row-l small { font-size: 11px; color: var(--ink4); }
.piano-row-r { text-align: right; flex-shrink: 0; }
.piano-date { font-size: 11px; margin-bottom: 3px; }
.piano-amt { font-family: var(--ff-mono); font-size: 14px; font-weight: 500; color: var(--ink); }
.date-green { color: var(--green); }
.date-orange { color: var(--orange); }
.date-red { color: var(--red); }
.date-blue { color: var(--blue); }

/* ── DOC CONTENT ────────────────────────────────────── */
.card.doc { padding: 1.5rem; }
.doc-intro { font-size: 13px; color: var(--ink3); margin-bottom: 1.25rem; line-height: 1.7; }
.doc-h3 { font-size: 13px; font-weight: 500; color: var(--ink2); margin: 1.5rem 0 0.75rem; }

/* Timeline scadenze */
.tl-item {
  display: flex; gap: 1rem; padding: 1rem 0;
  border-bottom: 1px solid var(--border);
}
.tl-item:last-of-type { border-bottom: none; }
.tl-date {
  font-family: var(--ff-mono); font-size: 10px; font-weight: 500;
  min-width: 80px; padding-top: 2px; flex-shrink: 0;
}
.tl-date.green { color: var(--green); }
.tl-date.orange { color: var(--orange); }
.tl-date.red { color: var(--red); }
.tl-date.blue { color: var(--blue); }
.tl-item strong { font-size: 13px; font-weight: 500; display: block; margin-bottom: 3px; }
.tl-item p { font-size: 12px; color: var(--ink3); line-height: 1.6; }

/* Info box */
.info-box {
  background: rgba(74,158,255,0.06); border: 1px solid rgba(74,158,255,0.2);
  border-radius: 6px; padding: 10px 14px;
  font-size: 12px; color: var(--ink2); line-height: 1.7; margin-top: 1.25rem;
}

/* Guide steps */
.guide-step {
  display: flex; gap: 1.25rem; padding: 1.25rem 0;
  border-bottom: 1px solid var(--border);
}
.guide-step:last-child { border-bottom: none; }
.gs-n {
  font-family: var(--ff-mono); font-size: 10px; color: var(--red);
  border: 0.5px solid var(--red); border-radius: 3px;
  padding: 2px 5px; height: fit-content; flex-shrink: 0; margin-top: 2px;
}
.guide-step h4 { font-size: 14px; font-weight: 500; margin-bottom: 4px; }
.guide-step p { font-size: 12px; color: var(--ink3); line-height: 1.7; margin-bottom: 6px; }
.guide-step code {
  font-family: var(--ff-mono); font-size: 11px;
  background: var(--bg3); border: 1px solid var(--border2);
  padding: 1px 5px; border-radius: 3px; color: var(--red);
}
.formula {
  font-family: var(--ff-mono); font-size: 11px; background: var(--bg3);
  border: 1px solid var(--border2); border-radius: 6px;
  padding: 10px 14px; color: var(--green); margin-top: 6px;
}

/* F24 boxes */
.f24-box {
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: 6px; padding: 1rem; margin-bottom: 0.75rem;
}
.f24-box h4 {
  font-size: 12px; font-weight: 500; margin-bottom: 8px;
  padding-bottom: 8px; border-bottom: 1px solid var(--border);
}
.f4r { display: flex; justify-content: space-between; font-size: 12px; padding: 3px 0; }
.f4r span:first-child { color: var(--ink4); }
.f4r span:last-child { font-family: var(--ff-mono); font-weight: 500; }

/* Tables */
.ref-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.ref-table th {
  background: var(--bg3); padding: 8px 12px; text-align: left;
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--ink4); font-weight: 500; border-bottom: 1px solid var(--border2);
  font-family: var(--ff-mono);
}
.ref-table td { padding: 10px 12px; border-bottom: 1px solid var(--border); color: var(--ink3); }
.ref-table tr:last-child td { border-bottom: none; }
.ref-table tr:hover td { background: rgba(128,128,128,0.03); }
.ref-table code {
  font-family: var(--ff-mono); font-size: 11px; background: var(--bg3);
  border: 1px solid var(--border2); padding: 1px 5px; border-radius: 3px; color: var(--red);
}
.badge {
  font-family: var(--ff-mono); font-size: 11px; font-weight: 500;
  padding: 2px 8px; border-radius: 3px;
}
.c40 { background: rgba(74,158,255,0.1); color: var(--blue); }
.c62 { background: rgba(196,122,16,0.1); color: var(--orange); }
.c67 { background: rgba(26,110,66,0.1); color: var(--green); }
.c78 { background: rgba(192,57,43,0.1); color: var(--red); }
.c86 { background: rgba(192,57,43,0.15); color: var(--red2); }

/* ── AI PANEL ───────────────────────────────────────── */
.ai-panel {
  background: var(--bg2); border-left: 1px solid var(--border);
  display: flex; flex-direction: column; overflow: hidden;
  transition: background 0.2s;
}
.ai-head {
  padding: 1.25rem; border-bottom: 1px solid var(--border);
  font-size: 12px; font-weight: 500; color: var(--ink2);
  display: flex; align-items: center; gap: 8px; flex-shrink: 0;
}
.ai-dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--green);
  animation: pulse 2s infinite; flex-shrink: 0;
}
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:0.3} }
.ai-chat { flex: 1; overflow-y: auto; padding: 1rem; display: flex; flex-direction: column; gap: 10px; }
.ai-msg {
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: 6px; padding: 10px 12px;
  font-size: 12px; color: var(--ink2); line-height: 1.7;
}
.ai-msg.user {
  background: var(--red-bg); border-color: rgba(192,57,43,0.2);
  color: var(--ink); align-self: flex-end; max-width: 90%;
}
.ai-msg.loading { color: var(--ink4); font-style: italic; }
.ai-chip {
  display: inline-block; font-size: 11px; padding: 2px 8px;
  border: 1px solid var(--border2); border-radius: 3px;
  color: var(--ink3); cursor: pointer; margin: 2px 2px 0 0; transition: all 0.15s;
}
.ai-chip:hover { border-color: var(--red); color: var(--ink); }
.ai-input {
  display: flex; gap: 6px; padding: 0.875rem;
  border-top: 1px solid var(--border); flex-shrink: 0;
}
.ai-input input { flex: 1; padding: 7px 10px; font-size: 12px; }
.ai-input button {
  padding: 7px 12px; background: var(--red); border: none;
  border-radius: 4px; color: white; font-size: 14px; cursor: pointer;
  transition: background 0.15s;
}
.ai-input button:hover { background: var(--red2); }

/* ── FOOTER ─────────────────────────────────────────── */
footer {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 1.5rem; border-top: 1px solid var(--border);
  background: var(--bg2); font-family: var(--ff-mono);
  font-size: 10px; color: var(--ink4); flex-wrap: wrap; gap: 6px;
  flex-shrink: 0; transition: background 0.2s;
}
footer a { color: var(--ink4); transition: color 0.15s; }
footer a:hover { color: var(--red); }

/* ── FOCUS / A11Y ───────────────────────────────────── */
:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; border-radius: 3px; }
:focus:not(:focus-visible) { outline: none; }
@media (prefers-reduced-motion: reduce) {
  *,*::before,*::after { animation-duration:.01ms!important; transition-duration:.01ms!important; }
}

/* ── SCROLLBAR ──────────────────────────────────────── */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 2px; }

/* ═══════════════════════════════════════════════════
   MOBILE — tutto sotto 900px
   ═══════════════════════════════════════════════════ */
@media (max-width: 900px) {

  /* Navbar: mostra hamburger, nascondi links e actions */
  .nav-links  { display: none; }
  .nav-actions { display: none; }
  .hamburger  { display: flex; }

  /* Layout: colonna singola */
  .layout {
    display: flex;
    flex-direction: column;
    height: auto;
    min-height: calc(100vh - var(--nav-h));
  }

  /* Sidebar: nascosta su mobile */
  .sidebar { display: none; }

  /* Content: full width */
  .content { flex: 1; }

  /* AI panel: altezza fissa in fondo */
  .ai-panel {
    height: 280px;
    border-left: none;
    border-top: 1px solid var(--border);
  }

  /* Tabs: padding ridotto */
  .tab { padding: 1rem; }

  /* Grid: colonna singola */
  .grid-2 { grid-template-columns: 1fr; }
  .span-2 { grid-column: span 1; }

  /* Results: 2 colonne */
  .results-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .res-val { font-size: 14px; }
  .res-val.big { font-size: 16px; }

  /* Piano versamenti: verticale */
  .piano-row { flex-direction: column; align-items: flex-start; gap: 4px; }
  .piano-row-r { text-align: left; }

  /* Guide steps */
  .guide-step { flex-direction: column; gap: 8px; }

  /* Tables: scroll orizzontale */
  .ref-table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }

  /* Tab header */
  .tab-header { padding: 0.875rem 1rem; }
  .tab-header h1 { font-size: 1.1rem; }

  /* Footer */
  footer { flex-direction: column; text-align: center; padding: 8px 1rem; }
}

@media (max-width: 480px) {
  .results-grid { grid-template-columns: 1fr; }
}
