/*
 * Responsive layout for the Claude Design pages, together with fluid.mjs.
 *
 * fluid.mjs (run by build.sh) already makes sizes fluid and equal-column grids
 * wrap by themselves. This file only handles what cannot be expressed inline,
 * through the data-vt-* attributes fluid.mjs adds:
 *
 *   data-vt-grid="split"  asymmetric grids and table rows (1.6fr 1fr, 80px 1fr 1.2fr…): one column ≤ 820px
 *   data-vt-grid="wide"   4+ equal tracks after a lead one (footer): auto columns ≤ 1100px, 2 on a phone
 *   data-vt-flex          flex rows: wrap ≤ 820px
 *   data-vt-offset        paddings ≥ 200px kept for absolute images: gutter ≤ 820px
 *   data-vt-sticky        sticky bars: static ≤ 820px
 *
 * plus the mobile menu (responsive.js) and page-specific exceptions at the end.
 */

#dc-root { overflow-wrap: break-word; }
#dc-root img, #dc-root video, #dc-root svg { max-width: 100%; }
.vt-menu-btn { display: none; }

/* ---------- Tablet ≤ 1100px ------------------------------------------- */
@media (max-width: 1100px) {
  #dc-root [data-vt-grid="wide"] { grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)) !important; }
  #dc-root [data-vt-grid="wide"] > * { grid-column: auto !important; grid-row: auto !important; }
  #dc-root [data-vt-grid="wide"] > :first-child { grid-column: 1 / -1 !important; }   /* lead column (footer brand) on its own row */
  #dc-root header nav { gap: 22px !important; font-size: 14px !important; }
}

/* ---------- Phone and small tablet ≤ 820px ---------------------------- */
@media (max-width: 820px) {
  #dc-root [data-vt-grid="split"] { grid-template-columns: minmax(0, 1fr) !important; }
  #dc-root [data-vt-grid="wide"] { grid-template-columns: repeat(auto-fill, minmax(min(100%, 150px), 1fr)) !important; }
  #dc-root [data-vt-grid] > * { grid-column: auto !important; grid-row: auto !important; }
  #dc-root [data-vt-grid="wide"] > :first-child { grid-column: 1 / -1 !important; }
  #dc-root [data-vt-flex] { flex-wrap: wrap; }
  #dc-root [data-vt-offset] { --vt-offset: clamp(20px, 5vw, 40px); }
  #dc-root [data-vt-sticky]:not(header) { position: relative !important; top: auto !important; }
  #dc-root h1 { hyphens: auto; }   /* only the biggest titles: on h2/h3 it broke words like "Organiz-ziamo" */

  /* Mobile menu: the button is created by responsive.js outside the React tree. */
  #dc-root header[data-vt-sticky] { padding-right: 72px !important; }
  #dc-root header img { height: 28px !important; }
  #dc-root header nav { display: none !important; }
  #dc-root header > div:last-child > a { display: none !important; }   /* header CTA: "Contatti" is in the menu */
  .vt-menu-btn {
    display: flex; align-items: center; justify-content: center;
    position: fixed; top: 9px; right: 12px; z-index: 1001;
    width: 46px; height: 46px; padding: 0; border: 0; border-radius: 12px;
    background: transparent; color: var(--navy-900, #021d4d); cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }
  .vt-menu-btn:focus-visible { outline: 2px solid var(--sky-500, #36b4e5); outline-offset: 2px; }
  .vt-menu-btn span, .vt-menu-btn span::before, .vt-menu-btn span::after {
    display: block; position: relative; width: 22px; height: 2px; border-radius: 2px; background: currentColor;
    transition: transform .2s ease, background-color .2s ease;
  }
  .vt-menu-btn span::before, .vt-menu-btn span::after { content: ""; position: absolute; left: 0; }
  .vt-menu-btn span::before { top: -7px; }
  .vt-menu-btn span::after { top: 7px; }
  html.vt-menu-open .vt-menu-btn span { background: transparent; }
  html.vt-menu-open .vt-menu-btn span::before { transform: translateY(7px) rotate(45deg); }
  html.vt-menu-open .vt-menu-btn span::after { transform: translateY(-7px) rotate(-45deg); }
  html.vt-menu-open, html.vt-menu-open body { overflow: hidden; }
  /* backdrop-filter would make the header the containing block of the fixed menu */
  html.vt-menu-open #dc-root header { backdrop-filter: none !important; -webkit-backdrop-filter: none !important; background: #fff !important; z-index: 1000 !important; }
  html.vt-menu-open #dc-root header nav {
    display: flex !important; flex-direction: column !important; gap: 0 !important;
    position: fixed; left: 0; right: 0; top: 57px; bottom: 0; z-index: 1000;
    padding: 8px 20px 32px !important; background: #fff; overflow-y: auto;
    font-size: 22px !important; font-weight: 600 !important;
  }
  html.vt-menu-open #dc-root header nav a { padding: 16px 0 !important; border-bottom: 1px solid var(--slate-200, #d7e2ec); color: var(--navy-900, #021d4d) !important; }
}

/* ---------- Page-specific exceptions ---------------------------------- */
/* Page-specific responsive rules: group "azienda" — VT Chi siamo (chi-siamo / en/about) and VT Pagina sub-pages
   (storia, ricerca, lavora, partner, certificazioni, sostenibilita, privacy, cookie), IT + EN. Desktop ≥ 1440px untouched.
   Equal-column grids are matched on data-vt-cols (set by fluid.mjs), e.g. [data-vt-cols="6"] = repeat(6). */

/* ---------- VT Chi siamo ---------------------------------------------- */
@media (max-width: 1100px) {
  /* Approach banner: keep the title on the left half, clear of the portrait on the right */
  html[data-vt-page="chi-siamo"] #dc-root [style*="height: 420px"][style*="overflow: hidden"] > div { max-width: 48% !important; }
  /* …and scale the portrait with the viewport so it stays in the right half */
  html[data-vt-page="chi-siamo"] #dc-root [style*="height: 420px"][style*="overflow: hidden"] > img { height: clamp(460px, 56vw, 620px) !important; right: 0 !important; }
  /* Certification seals: 6 per row instead of a 5 + 1 orphan */
  html[data-vt-page="chi-siamo"] #dc-root [data-vt-cols="6"] { grid-template-columns: repeat(6, minmax(0, 1fr)) !important; gap: 20px !important; }
}
@media (max-width: 820px) {
  /* Key figures: 4 per row (3/3/2 otherwise) */
  html[data-vt-page="chi-siamo"] #dc-root [style*="gap: 8px clamp"][data-vt-cols="4"] { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; column-gap: 20px !important; }
  /* R&D cards: one column instead of 2 + 1 with a tall card next to a short one */
  html[data-vt-page="chi-siamo"] #dc-root [data-vt-cols="3"] { grid-template-columns: minmax(0, 1fr) !important; }
  /* Certification seals: 3 + 3 */
  html[data-vt-page="chi-siamo"] #dc-root [data-vt-cols="6"] { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
}
@media (max-width: 560px) {
  /* Key figures: 2 per row like the old layer, not 8 stacked rows */
  html[data-vt-page="chi-siamo"] #dc-root [style*="gap: 8px clamp"][data-vt-cols="4"] { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  /* Approach banner: full-width title, taller box, portrait moved down-right below the text */
  html[data-vt-page="chi-siamo"] #dc-root [style*="height: 420px"][style*="overflow: hidden"] { height: 500px !important; }
  html[data-vt-page="chi-siamo"] #dc-root [style*="height: 420px"][style*="overflow: hidden"] > div { max-width: none !important; right: 24px; }
  html[data-vt-page="chi-siamo"] #dc-root [style*="height: 420px"][style*="overflow: hidden"] > img { top: auto !important; bottom: -60px; right: -30px !important; height: 360px !important; }
  /* Certification seals: 2 per row */
  html[data-vt-page="chi-siamo"] #dc-root [data-vt-cols="6"] { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
}

/* ---------- VT Pagina sub-pages ---------------------------------------- */
@media (max-width: 820px) {
  /* Text / projects blocks stacked: small gap between the heading and its text */
  html[data-vt-page="pagina"] #dc-root [data-vt-grid="split"][style*="border-top"] { row-gap: 20px !important; }
  /* Bulleted lists (privacy, cookie): bullet stays beside its text, never on its own line */
  html[data-vt-page="pagina"] #dc-root [data-vt-flex]:has(> span[style*="width: 6px"]) { flex-wrap: nowrap; }
  /* Technology cards (partner): icon and name on one line */
  html[data-vt-page="pagina"] #dc-root [data-vt-flex][style*="min-height: 72px"] { flex-wrap: nowrap; }
  /* Certification badges: seal beside the text, as on desktop */
  html[data-vt-page="pagina"] #dc-root [data-vt-grid][style*="grid-template-columns: 120px minmax(0px, 1fr)"] { grid-template-columns: 120px minmax(0, 1fr) !important; }
  /* Cookie table: 2 x 2 cells (head and rows aligned) instead of a 640px-wide strip cut by the box */
  html[data-vt-page="pagina"] #dc-root [style*="min-width: 640px"] { min-width: 0 !important; }
  html[data-vt-page="pagina"] #dc-root [style*="min-width: 640px"] > [data-vt-grid] { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; row-gap: 8px !important; }
}
@media (max-width: 560px) {
  /* Feature cards (storia, lavora, ricerca, sostenibilità): no empty band above the title */
  html[data-vt-page="pagina"] #dc-root [style*="min-height: 200px"][style*="justify-content: flex-end"] { min-height: 0 !important; padding: 24px !important; }
  html[data-vt-page="pagina"] #dc-root [style*="min-height: 200px"][style*="justify-content: flex-end"] > :first-child { margin-bottom: 8px !important; }
  /* Technology cards (partner): 2 per row instead of one long column */
  html[data-vt-page="pagina"] #dc-root [style*="minmax(min(100%, 190px), 1fr)"] { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 10px !important; }
  html[data-vt-page="pagina"] #dc-root [data-vt-flex][style*="min-height: 72px"] { padding: 14px !important; gap: 10px !important; }
  html[data-vt-page="pagina"] #dc-root [data-vt-flex][style*="min-height: 72px"] > img { max-width: 40%; }
  /* Certification badges: smaller seal so the text keeps room */
  html[data-vt-page="pagina"] #dc-root [data-vt-grid][style*="grid-template-columns: 120px minmax(0px, 1fr)"] { grid-template-columns: 72px minmax(0, 1fr) !important; gap: 16px !important; padding: 20px !important; }
  html[data-vt-page="pagina"] #dc-root [data-vt-grid][style*="grid-template-columns: 120px minmax(0px, 1fr)"] > img { width: 72px !important; height: 72px !important; }
}
/* ---- Page-specific: Homepage, News (list), Notizia (detail), Contatti, Candidatura (IT + EN) ---- */

/* Homepage – "Il nostro approccio" card: absolute text + cutout image on the right. */
@media (max-width: 1100px) {
  /* tablet: keep the text clear of the face */
  html[data-vt-page="homepage"] #dc-root div:has(> img[src*="ai-profile-cutout"]) > div { max-width: 48% !important; }
}
@media (max-width: 820px) {
  /* phone: text and button flow statically on top, the image sits below them, cropped by the card */
  html[data-vt-page="homepage"] #dc-root div:has(> img[src*="ai-profile-cutout"]) {
    height: auto !important; display: flex; flex-direction: column; align-items: flex-start; gap: 24px;
    padding: 32px 24px 0;
  }
  html[data-vt-page="homepage"] #dc-root div:has(> img[src*="ai-profile-cutout"]) > * { position: static !important; }
  html[data-vt-page="homepage"] #dc-root div:has(> img[src*="ai-profile-cutout"]) > div { max-width: none !important; }
  html[data-vt-page="homepage"] #dc-root div:has(> img[src*="ai-profile-cutout"]) > a { order: 2; white-space: normal; }
  html[data-vt-page="homepage"] #dc-root div:has(> img[src*="ai-profile-cutout"]) > img {
    order: 3; align-self: center; height: 300px !important; width: auto; margin: -8px 0 -40px;
  }
  /* Homepage – hero key figures: keep 2 columns down to 360px (short numbers, 4 stacked rows were too long) */
  html[data-vt-page="homepage"] #dc-root [style*="repeat(auto-fill"][style*="border-bottom: 1px solid"] { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; column-gap: 20px !important; }
}

/* News list + "Altre news" on a news detail: 3 card columns of ~220px are too narrow on tablets. */
@media (max-width: 900px) {
  html[data-vt-page="news"] #dc-root [style*="repeat(auto-fill"],
  html[data-vt-page="notizia"] #dc-root [style*="repeat(auto-fill"]:has(> a) {
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)) !important;   /* 2 columns on a tablet, 1 on a phone */
    gap: 24px !important;                                                                    /* fluid 12px is too tight between stacked cards */
  }
}

@media (max-width: 820px) {
  /* News detail – bullet lists: the generic flex-wrap pushed the marker onto its own line */
  html[data-vt-page="notizia"] #dc-root [data-vt-flex]:has(> span[style*="min-width: 22px"]) { flex-wrap: nowrap; }

  /* Forms (Contatti, Candidatura): roomier card, full-width fields */
  #vt-contact-form, #vt-job-form { padding: 28px 20px !important; }
  #vt-contact-form input:not([type="checkbox"]):not([type="file"]), #vt-contact-form select, #vt-contact-form textarea,
  #vt-job-form input:not([type="checkbox"]):not([type="file"]), #vt-job-form select, #vt-job-form textarea { width: 100%; box-sizing: border-box; font-size: 16px; }   /* 16px: no iOS zoom on focus */
  #vt-job-form label > span[data-vt-flex] { row-gap: 10px; }   /* file picker: button and file name wrap with some air */

  /* Candidatura – selection steps: keep the small number column next to the text */
  html[data-vt-page="candidatura"] #dc-root [data-vt-grid][style*="grid-template-columns: 40px"] { grid-template-columns: 40px minmax(0, 1fr) !important; }
}
@media (max-width: 560px) {
  /* Forms: full-width submit button on phones */
  #vt-contact-form [data-vt-flex][style*="padding-top: 8px"] button,
  #vt-job-form [data-vt-flex][style*="padding-top: 8px"] button { width: 100%; }
}
/* Page-specific responsive rules: VT Portfolio (progetti/, en/projects/) and VT Caso (progetti/<slug>/, en/projects/<slug>/). */

@media (max-width: 820px) {
  /* Portfolio hero stats: 4 in a row on tablets instead of a tall single column. */
  html[data-vt-page="portfolio"] #dc-root [data-vt-grid="split"][style*="grid-template-columns: 1fr 1fr"] { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; }

  /* Portfolio filters: each chip group on one horizontally scrollable line (as in the old layer). */
  html[data-vt-page="portfolio"] #dc-root [data-vt-sticky]:not(header) [style*="gap: 8px"][style*="flex-wrap: wrap"] {
    --vt-gutter: clamp(20px, 4.444vw, 64px);
    flex: 1 1 100% !important; flex-wrap: nowrap !important; overflow-x: auto; scrollbar-width: none;
    margin: 0 calc(-1 * var(--vt-gutter)); padding: 2px var(--vt-gutter);
  }
  html[data-vt-page="portfolio"] #dc-root [data-vt-sticky]:not(header) [style*="gap: 8px"][style*="flex-wrap: wrap"]::-webkit-scrollbar { display: none; }
  html[data-vt-page="portfolio"] #dc-root [data-vt-sticky]:not(header) [style*="gap: 8px"][style*="flex-wrap: wrap"] > * { flex: none; white-space: nowrap; }

  /* Case cards (portfolio grid, related cases): two columns on tablets instead of one 700px-wide card. */
  html[data-vt-page="portfolio"] #dc-root [style*="minmax(min(100%, 340px), 1fr)"],
  html[data-vt-page="caso"] #dc-root [style*="minmax(min(100%, 340px), 1fr)"] { grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)) !important; }

  /* Case cards: tighter padding, so "Read the case" and the tech icons stay on one row. */
  html[data-vt-page="portfolio"] #dc-root [style*="border-radius: 20px"][style*="padding: 32px;"],
  html[data-vt-page="caso"] #dc-root [style*="border-radius: 20px"][style*="padding: 32px;"] { padding: 24px 20px !important; }

  /* "Show more" button: keep some air below the last card (fluid padding-top drops to 17px). */
  html[data-vt-page="portfolio"] #dc-root [style*="align-items: center"][style*="gap: 12px"][style*="padding-top: clamp("] { padding-top: 32px !important; }
}

/* Case page info strip (client, sector, practice, technologies): three columns with technologies on a full row. */
@media (max-width: 1100px) {
  html[data-vt-page="caso"] #dc-root [data-vt-grid="wide"][style*="border-radius: 20px"] { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; align-items: start !important; }
  html[data-vt-page="caso"] #dc-root [data-vt-grid="wide"][style*="border-radius: 20px"] > * { grid-column: auto !important; }
  html[data-vt-page="caso"] #dc-root [data-vt-grid="wide"][style*="border-radius: 20px"] > :last-child { grid-column: 1 / -1 !important; }
}

@media (max-width: 560px) {
  /* Portfolio hero stats: 2 × 2 on phones. */
  html[data-vt-page="portfolio"] #dc-root [data-vt-grid="split"][style*="grid-template-columns: 1fr 1fr"] { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }

  /* Case info strip: client on its own row, sector + practice side by side, technologies full row; phone padding. */
  html[data-vt-page="caso"] #dc-root [data-vt-grid="wide"][style*="border-radius: 20px"] { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; padding: 24px 20px !important; gap: 20px 16px !important; }
  html[data-vt-page="caso"] #dc-root [data-vt-grid="wide"][style*="border-radius: 20px"] > :first-child { grid-column: 1 / -1 !important; }
}
/* Page-specific responsive rules: VT Servizi (practice/), VT Practice (practice/ai-ml|data|software|cloud|cyber/), VT Modalita (come-lavoriamo/) and their EN versions. */

@media (max-width: 820px) {
  /* "Dal business alla tecnologia" 5 steps (Modalità, Servizi): 4+1 at 768 breaks "Comprendiamo" mid-word; 3 columns on tablet. */
  html:is([data-vt-page="modalita"], [data-vt-page="servizi"]) #dc-root div[style*="display: grid"]:has(> div[style*="padding-right: 32px"]) { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; row-gap: 32px !important; }
  /* Modalità hero cards: 2+1 with an orphan card; one full-width card per row, as before. */
  html[data-vt-page="modalita"] #dc-root [style^="padding: 0px clamp"][style*="display: grid"] { grid-template-columns: minmax(0, 1fr) !important; }
}

@media (min-width: 481px) and (max-width: 820px) {
  /* Modalità "come funziona" (4 steps): 3+1 with an orphan once the section stacks; 2 x 2. */
  html[data-vt-page="modalita"] [style*="scroll-margin-top: 90px"] > div:last-child > div:nth-child(3) > div[style*="grid"] { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  /* Modalità facts box (modello / governance / durata): short values, keep them on one row instead of 2+1. */
  html[data-vt-page="modalita"] [style*="scroll-margin-top: 90px"] [style*="border-radius: 16px"][style*="display: grid"] { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
}

@media (max-width: 600px) {
  /* 5 steps on phones: two ~150px columns still break words; one column, without the desktop right padding. */
  html:is([data-vt-page="modalita"], [data-vt-page="servizi"]) #dc-root div[style*="display: grid"]:has(> div[style*="padding-right: 32px"]) { grid-template-columns: minmax(0, 1fr) !important; row-gap: 28px !important; }
  html:is([data-vt-page="modalita"], [data-vt-page="servizi"]) #dc-root div[style*="display: grid"] > div[style*="padding-right: 32px"] { padding-right: 0 !important; }
  /* Comparison table: one column loses which value belongs to which mode; keep 3 columns and scroll sideways (as the old layer did). */
  html[data-vt-page="modalita"] #confronto > div:last-child { overflow-x: auto; -webkit-overflow-scrolling: touch; padding-left: 20px !important; padding-right: 20px !important; }
  html[data-vt-page="modalita"] #confronto [data-vt-grid] { grid-template-columns: repeat(3, minmax(140px, 1fr)) !important; min-width: 460px; column-gap: 16px !important; }
}

@media (max-width: 480px) {
  /* "Quando sceglierlo" lists (Modalità, Servizi): 2 columns of ~150px wrap every item on 3 lines; one column on phones. */
  html:is([data-vt-page="modalita"], [data-vt-page="servizi"]) #dc-root [style*="gap: 0px clamp"][style*="grid-template-columns"] { grid-template-columns: minmax(0, 1fr) !important; }
}

@media (max-width: 600px) {
  /* Practice tech stack: 180px minimum leaves one column of 14 tall rows on phones; two columns, logo and name side by side. */
  html[data-vt-page="practice"] #dc-root [style*="minmax(min(100%, 180px)"] { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 10px !important; }
  html[data-vt-page="practice"] #dc-root [style*="minmax(min(100%, 180px)"] > div { flex-wrap: nowrap !important; gap: 10px !important; padding: 14px 12px !important; }
  html[data-vt-page="practice"] #dc-root [style*="minmax(min(100%, 180px)"] > div > img { width: 26px !important; height: 26px !important; }
}
/* Page-specific responsive rules: VT Product Suite (product-suite), VT Aria (aria),
   VT Prodotto (prodotto: sophia, thalia, demetria, bid), IT and EN. */

/* ---------- Tablet ≤ 900px ------------------------------------------- */
@media (max-width: 900px) {
  /* Aria: 8 feature cards and 4 flow steps in 2×N instead of 3 + orphans */
  html[data-vt-page="aria"] #dc-root [style*="grid-template-columns"]:has(> [style*="min-height: 200px"]),
  html[data-vt-page="aria"] #dc-root [style*="25% - 0px"] { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; row-gap: 32px; }
  /* Other products of the suite: 2×2 instead of 3 + 1 (long names broke mid-word) */
  html:is([data-vt-page="aria"], [data-vt-page="prodotto"]) #dc-root [style*="grid-template-columns"]:has(> a[style*="min-height: 190px"]) { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  /* Aria tools: the third card takes the whole row instead of sitting alone in half of it */
  html[data-vt-page="aria"] #dc-root [style*="33.3333% - 13.3333px"] > :nth-child(3):last-child { grid-column: 1 / -1 !important; }
}

/* ---------- Phone and small tablet ≤ 820px ---------------------------- */
@media (max-width: 820px) {
  /* Hero pillars (name | description): keep the two short columns instead of stacking */
  html:is([data-vt-page="aria"], [data-vt-page="prodotto"]) #dc-root [style*="grid-template-columns: 140px 1fr"],
  html:is([data-vt-page="aria"], [data-vt-page="prodotto"]) #dc-root [style*="grid-template-columns: 160px 1fr"] { grid-template-columns: 140px minmax(0, 1fr) !important; }
  /* Aria hero photo: fixed 560px height is a tall portrait crop on phones */
  html[data-vt-page="aria"] #dc-root [style*="height: 560px"] { height: clamp(240px, 62vw, 560px) !important; }
  /* Aria control-room screenshot: show the whole image instead of a 440px zoomed crop */
  html[data-vt-page="aria"] #dc-root img[style*="height: 440px"] { height: auto !important; }
  html[data-vt-page="aria"] #dc-root :has(> img[style*="height: 440px"]) > div { padding-bottom: 0 !important; }   /* stacked: no desktop bottom padding before the image */
  /* Aria use cases (name | description): two columns still fit on a tablet */
  html[data-vt-page="aria"] #dc-root [style*="grid-template-columns: minmax(0px, 1fr) minmax(0px, 1.2fr)"] { grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr) !important; }
  /* Three "next steps": one column instead of 2 + 1 */
  html:is([data-vt-page="aria"], [data-vt-page="prodotto"]) #dc-root [style*="220px), 0.333333"] { grid-template-columns: minmax(0, 1fr) !important; }
  /* Product Suite list (name | text | Scopri): three columns on a tablet, the link no longer on its own row */
  html[data-vt-page="product-suite"] #dc-root [style*="minmax(0px, 1.4fr) 160px"] { grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) 80px !important; }
}

/* ---------- Phone ≤ 560px --------------------------------------------- */
@media (max-width: 560px) {
  /* One column on phones; cards lose the desktop min-height (empty space above the title) */
  html[data-vt-page="aria"] #dc-root [style*="grid-template-columns"]:has(> [style*="min-height: 200px"]),
  html[data-vt-page="aria"] #dc-root [style*="25% - 0px"],
  html[data-vt-page="aria"] #dc-root [style*="160px), 50% - 10px"],
  html:is([data-vt-page="aria"], [data-vt-page="prodotto"]) #dc-root [style*="grid-template-columns"]:has(> a[style*="min-height: 190px"]) { grid-template-columns: minmax(0, 1fr) !important; }
  html[data-vt-page="aria"] #dc-root [style*="min-height: 200px"],
  html[data-vt-page="prodotto"] #dc-root [style*="min-height: 220px"],
  html:is([data-vt-page="aria"], [data-vt-page="prodotto"]) #dc-root a[style*="min-height: 190px"] { min-height: 0 !important; gap: 12px !important; }
  /* Pillars: Aria's short names keep a narrower column; product names ("Commesse") stack under each other */
  html[data-vt-page="aria"] #dc-root [style*="grid-template-columns: 140px 1fr"] { grid-template-columns: 120px minmax(0, 1fr) !important; gap: 16px !important; }
  html[data-vt-page="prodotto"] #dc-root [style*="grid-template-columns: 160px 1fr"] { grid-template-columns: minmax(0, 1fr) !important; gap: 6px !important; }
  html[data-vt-page="aria"] #dc-root [style*="grid-template-columns: minmax(0px, 1fr) minmax(0px, 1.2fr)"] { grid-template-columns: minmax(0, 1fr) !important; gap: 6px !important; }
  /* Product Suite list: stacked again on phones */
  html[data-vt-page="product-suite"] #dc-root [style*="minmax(0px, 1.4fr) 160px"] { grid-template-columns: minmax(0, 1fr) !important; }
}
