/* ============================================================
   Catalogo Peirano Vivai — "Botanico elegante"
   ============================================================ */

:root {
  --verde-bosco: #1f3d2b;
  --verde: #2e5d3a;
  --verde-chiaro: #5a7d52;
  --crema: #f7f4ec;
  --crema-2: #efe9da;
  --card: #fffdf8;
  --terracotta: #b5623c;
  --oro: #a98b4f;
  --testo: #2a2a22;
  --testo-soft: #6b6b5e;
  --bordo: rgba(31, 61, 43, 0.14);
  --ombra: 0 1px 2px rgba(31, 61, 43, .05), 0 8px 24px -12px rgba(31, 61, 43, .18);
  --serif: "Cormorant Garamond", "Iowan Old Style", Georgia, "Times New Roman", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --r: 14px;
  --max: 1180px;
  /* semantici (cambiano col tema) */
  --ink: #1f3d2b;
  --surface: #fff;
  --pill-active: #fff;
  --bg-blur: rgba(247, 244, 236, 0.86);
  --body-glow: #ffffff;
}

/* ============ Tema scuro ============ */
html[data-theme="dark"] {
  --verde-chiaro: #7fa874;
  --crema: #14150f;
  --crema-2: #23241b;
  --card: #1c1d16;
  --terracotta: #d4865f;
  --oro: #cBa968;
  --testo: #e8e5d8;
  --testo-soft: #9d9a8a;
  --bordo: rgba(255, 255, 255, 0.12);
  --ombra: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 26px -14px rgba(0, 0, 0, .6);
  --ink: #d9e8cd;
  --surface: #22231b;
  --pill-active: #34362a;
  --bg-blur: rgba(20, 21, 15, 0.86);
  --body-glow: #20231a;
}
html[data-theme="dark"] body {
  background:
    radial-gradient(1200px 600px at 80% -10%, var(--body-glow) 0%, var(--crema) 55%) no-repeat,
    var(--crema);
}
/* in dark le foto un filo meno abbaglianti */
html[data-theme="dark"] .card-media img,
html[data-theme="dark"] .ptile img,
html[data-theme="dark"] .detail-photo img { filter: brightness(.94); }

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--testo);
  background:
    radial-gradient(1200px 600px at 80% -10%, #ffffff 0%, var(--crema) 55%) no-repeat,
    var(--crema);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--bg-blur);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--bordo);
}
.header-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 14px; flex: 1 1 auto; min-width: 200px; }
.brand-logo { display: inline-flex; text-decoration: none; }
.brand img { height: 46px; width: auto; display: block; transition: opacity .15s; }
.brand-logo:hover img { opacity: .82; }
.brand .titles { display: flex; flex-direction: column; line-height: 1.1; }
.brand h1 { cursor: pointer; transition: color .14s; }
.brand h1:hover { color: var(--verde); }
.brand .kicker {
  font-family: var(--sans);
  font-size: .68rem;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--verde-chiaro);
  font-weight: 600;
}
.brand h1 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.9rem;
  margin: 0;
  color: var(--ink);
  letter-spacing: .01em;
}
.brand .sub { font-size: .8rem; color: var(--testo-soft); margin-top: 2px; }

/* ---------- Search ---------- */
.search {
  position: relative;
  flex: 1 1 200px;
  max-width: 300px;
}
.search input {
  width: 100%;
  font-family: var(--sans);
  font-size: 1rem;
  padding: 12px 42px 12px 44px;
  border: 1px solid var(--bordo);
  border-radius: 999px;
  background: var(--surface);
  color: var(--testo);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.search input:focus {
  border-color: var(--verde-chiaro);
  box-shadow: 0 0 0 4px rgba(90, 125, 82, .15);
}
.search .icon-search {
  position: absolute; left: 15px; top: 50%; transform: translateY(-50%);
  width: 18px; height: 18px; color: var(--verde-chiaro); pointer-events: none;
}
.search .clear {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  border: 0; background: var(--crema-2); color: var(--testo-soft);
  width: 26px; height: 26px; border-radius: 50%; cursor: pointer;
  display: none; align-items: center; justify-content: center; font-size: 16px; line-height: 1;
}
.search.has-value .clear { display: flex; }

/* ---------- Filters bar ---------- */
.filters {
  position: sticky;
  top: 75px;
  z-index: 20;
  background: var(--bg-blur);
  backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--bordo);
}
.filters-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 10px 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
/* ---- Toolbar / switcher viste + tema ---- */
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.viewbar, .themebar {
  display: inline-flex; gap: 2px; padding: 3px;
  background: var(--crema-2); border-radius: 999px;
}
.themebar button {
  display: inline-flex; align-items: center; justify-content: center;
  border: 0; background: transparent; cursor: pointer;
  width: 34px; height: 30px; border-radius: 999px; color: var(--verde);
  transition: background .14s, color .14s, box-shadow .14s;
}
.themebar button svg { width: 17px; height: 17px; }
.themebar button:hover { color: var(--ink); }
.viewbar button {
  display: inline-flex; align-items: center; gap: 6px;
  border: 0; background: transparent; cursor: pointer;
  padding: 6px 13px; border-radius: 999px;
  font-family: var(--sans); font-size: .82rem; font-weight: 600; color: var(--verde);
  transition: background .14s, color .14s, box-shadow .14s;
}
.viewbar button svg { width: 17px; height: 17px; }
.viewbar button:hover { color: var(--ink); }
.viewbar button.active, .themebar button.active {
  background: var(--pill-active); color: var(--ink);
  box-shadow: 0 1px 3px rgba(31,61,43,.22);
}

.alpha {
  display: flex; flex-wrap: wrap; gap: 3px;
}
.alpha button {
  font-family: var(--sans);
  border: 0; background: transparent; cursor: pointer;
  width: 28px; height: 28px; border-radius: 8px;
  font-size: .82rem; font-weight: 600; color: var(--verde);
  transition: background .12s, color .12s;
}
.alpha button:hover { background: var(--crema-2); }
.alpha button.active { background: var(--verde-bosco); color: #fff; }
.alpha button:disabled { color: var(--bordo); cursor: default; }

.shapes { display: flex; flex-wrap: wrap; gap: 7px; align-items: center; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--bordo); background: var(--surface);
  padding: 5px 12px 5px 9px; border-radius: 999px;
  font-size: .8rem; font-weight: 600; color: var(--testo);
  cursor: pointer; transition: all .12s; white-space: nowrap;
}
.chip svg { width: 15px; height: 15px; }
.chip:hover { border-color: var(--verde-chiaro); }
.chip.active { background: var(--verde-bosco); color: #fff; border-color: var(--ink); }
.chip.active svg { color: #fff !important; }
.chip .count { opacity: .6; font-weight: 500; }
.reset {
  border: 0; background: transparent; color: var(--terracotta);
  font-weight: 600; font-size: .8rem; cursor: pointer; padding: 5px 8px;
  text-decoration: underline; text-underline-offset: 3px;
}
.reset[hidden] { display: none; }

/* ---------- Main ---------- */
main { max-width: var(--max); margin: 0 auto; padding: 26px 20px 80px; }

.result-meta { color: var(--testo-soft); font-size: .85rem; margin: 0 0 18px; }
.result-meta b { color: var(--ink); }

.genus {
  margin: 0 0 30px;
  scroll-margin-top: 150px;
}
.genus-head {
  display: flex; align-items: baseline; gap: 12px;
  padding-bottom: 8px; margin-bottom: 14px;
  border-bottom: 2px solid var(--verde-bosco);
}
.genus-head h2 {
  font-family: var(--serif); font-weight: 600;
  font-size: 2rem; line-height: 1; margin: 0; color: var(--ink);
}
.genus-head .count { font-size: .8rem; color: var(--testo-soft); font-weight: 500; }

.species-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 14px;
}

.card {
  display: flex; flex-direction: column;
  background: var(--card);
  border: 1px solid var(--bordo);
  border-radius: var(--r);
  box-shadow: var(--ombra);
  overflow: hidden;
  cursor: pointer;
  transition: transform .14s ease, box-shadow .14s ease, border-color .14s;
}
.card:hover {
  transform: translateY(-3px);
  border-color: var(--verde-chiaro);
  box-shadow: 0 2px 4px rgba(31,61,43,.06), 0 18px 36px -16px rgba(31,61,43,.32);
}
.card-media {
  position: relative;
  height: 175px;
  display: flex; align-items: center; justify-content: center;
  background:
    linear-gradient(135deg, rgba(255,255,255,.4), rgba(255,255,255,0)),
    var(--cat-bg, #e9eee3);
  border-bottom: 1px solid var(--bordo);
  overflow: hidden;
}
.card-media svg { width: 56px; height: 56px; color: var(--cat-fg, var(--verde)); opacity: .85; }
.card-media img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  transition: transform .35s ease;
}
.card:hover .card-media img { transform: scale(1.05); }
.card-media::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  box-shadow: inset 0 -40px 40px -30px rgba(31, 61, 43, .25);
}
.card-body { padding: 13px 15px 15px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card-name { font-family: var(--serif); font-size: 1.42rem; line-height: 1.05; color: var(--ink); }
.card-name .sp { font-style: italic; }
.card-volgare { font-size: .76rem; color: var(--testo-soft); margin-top: -4px; }

.variants { display: flex; flex-direction: column; gap: 4px; margin-top: 2px; }
.variant {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center; gap: 8px;
  font-size: .82rem; padding: 4px 0;
  border-top: 1px dashed var(--bordo);
}
.variant:first-child { border-top: 0; }
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: .7rem; font-weight: 700; letter-spacing: .01em;
  padding: 2px 8px 2px 6px; border-radius: 999px;
  background: var(--cat-bg, #e9eee3); color: var(--cat-fg, var(--verde));
}
.badge svg { width: 12px; height: 12px; }
.variant .dims { color: var(--testo-soft); font-size: .76rem; }
.variant .dims b { color: var(--testo); font-weight: 600; }
.variant .price { font-weight: 700; color: var(--ink); white-space: nowrap; }
.variant .price small { font-weight: 600; color: var(--testo-soft); }
.variant .price.na { color: var(--testo-soft); font-weight: 600; font-size: .76rem; }
.variant-more { font-size: .76rem; color: var(--terracotta); font-weight: 600; padding-top: 4px; }

/* ============ Vista GALLERIA ============ */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: 10px;
}
.ptile {
  position: relative; display: block; padding: 0; border: 0; cursor: pointer;
  aspect-ratio: 1 / 1; border-radius: 12px; overflow: hidden;
  background: var(--cat-bg, #e9eee3);
  box-shadow: var(--ombra);
}
.ptile img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .4s ease; }
.ptile-icon { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.ptile-icon svg { width: 46px; height: 46px; color: var(--cat-fg, var(--verde)); opacity: .85; }
.ptile:hover img { transform: scale(1.08); }
.ptile-name {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 26px 12px 11px; text-align: left; color: #fff;
  font-family: var(--serif); font-size: 1.18rem; line-height: 1.1;
  background: linear-gradient(to top, rgba(20,35,22,.92) 10%, rgba(20,35,22,.55) 55%, rgba(20,35,22,0));
  opacity: 0; transition: opacity .2s ease; pointer-events: none;
}
.ptile-name i { font-style: normal; font-weight: 600; }
.ptile-name small { display: block; font-family: var(--sans); font-size: .68rem; font-weight: 600; opacity: .85; margin-top: 2px; text-transform: uppercase; letter-spacing: .04em; }
.ptile:hover .ptile-name, .ptile:focus-visible .ptile-name { opacity: 1; }
@media (hover: none) {
  .ptile-name { opacity: 1; padding-top: 34px; }  /* mobile: nome sempre visibile */
}

/* ============ Vista ELENCO ============ */
.table-wrap { border: 1px solid var(--bordo); border-radius: 12px; background: var(--card); }
table.elenco { width: 100%; border-collapse: collapse; font-size: .84rem; table-layout: auto; }
table.elenco thead th {
  position: sticky; top: var(--elenco-top, 120px); z-index: 5;
  background: var(--verde-bosco); color: #fff;
  text-align: left; font-weight: 600; font-size: .74rem;
  letter-spacing: .03em; text-transform: uppercase;
  padding: 9px 10px; white-space: nowrap;
}
table.elenco thead th:first-child { border-radius: 11px 0 0 0; }
table.elenco thead th:last-child { border-radius: 0 11px 0 0; }
table.elenco th.sortable { cursor: pointer; user-select: none; }
table.elenco th.sortable:hover { background: var(--verde); }
table.elenco th.sorted { color: #ffe8a8; }
table.elenco th.num { text-align: right; }
table.elenco th.th-img { width: 52px; }
table.elenco td { padding: 6px 10px; border-top: 1px solid var(--bordo); vertical-align: middle; }
table.elenco tbody tr { cursor: pointer; transition: background .1s; }
table.elenco tbody tr:hover { background: #f3efe2; }
table.elenco td.num { text-align: right; white-space: nowrap; }
table.elenco td.mono { font-variant-numeric: tabular-nums; color: var(--testo-soft); }
table.elenco td.c-gen { font-weight: 600; color: var(--ink); }
table.elenco td.c-sp { font-family: var(--serif); font-size: 1rem; font-style: italic; }
table.elenco td.c-vol { color: var(--testo-soft); }
table.elenco td.price { font-weight: 700; color: var(--ink); }
table.elenco td.price .na { font-weight: 600; color: var(--testo-soft); font-size: .78rem; }
.td-img { width: 52px; }
.td-img img { width: 44px; height: 44px; object-fit: cover; border-radius: 7px; display: block; }
.th-icon { width: 44px; height: 44px; border-radius: 7px; display: flex; align-items: center; justify-content: center; }
.th-icon svg { width: 22px; height: 22px; }
.badge.sm { font-size: .66rem; padding: 2px 7px 2px 5px; }
.badge.sm svg { width: 11px; height: 11px; }

/* Responsive: invece dello scroll orizzontale, nascondo colonne secondarie.
   Ordine colonne: 1 img · 2 Cod · 3 Genere · 4 Specie · 5 Volgare · 6 Forma · 7 Vaso · 8 Altezza · 9 Prezzo */
@media (max-width: 880px) {
  table.elenco th:nth-child(2), table.elenco td:nth-child(2),   /* Cod */
  table.elenco th:nth-child(8), table.elenco td:nth-child(8) {  /* Altezza */
    display: none;
  }
}
@media (max-width: 640px) {
  table.elenco th:nth-child(5), table.elenco td:nth-child(5),   /* Volgare */
  table.elenco th:nth-child(7), table.elenco td:nth-child(7) {  /* Vaso */
    display: none;
  }
}

.empty {
  text-align: center; color: var(--testo-soft);
  padding: 70px 20px; font-size: 1.05rem;
}
.empty .big { font-family: var(--serif); font-size: 1.6rem; color: var(--ink); display: block; margin-bottom: 6px; }

/* ---------- Pagina dedicata (detail) ---------- */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 50;
  background: var(--crema);
  display: none; overflow-y: auto;
}
.modal-backdrop.open { display: block; animation: detailIn .22s ease; }
@keyframes detailIn { from { opacity: .3; } to { opacity: 1; } }
.modal { min-height: 100%; }

.detail-bar {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; gap: 16px;
  padding: 12px 20px;
  background: var(--bg-blur);
  backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--bordo);
}
.detail-back {
  display: inline-flex; align-items: center; gap: 7px;
  border: 1px solid var(--bordo); background: var(--surface); cursor: pointer;
  padding: 8px 16px 8px 12px; border-radius: 999px;
  font-family: var(--sans); font-size: .88rem; font-weight: 600; color: var(--ink);
  transition: border-color .14s, background .14s;
}
.detail-back:hover { border-color: var(--verde-chiaro); background: var(--surface); }
.detail-back svg { width: 17px; height: 17px; }
.detail-crumb { color: var(--testo-soft); font-size: .85rem; }
.detail-crumb span { opacity: .6; margin: 0 4px; }

.detail-hero {
  max-width: var(--max); margin: 0 auto;
  padding: 28px 20px 10px;
  display: grid; grid-template-columns: 1fr; gap: 26px;
}
.detail-photo {
  position: relative; border-radius: 18px; overflow: hidden;
  background: var(--cat-bg, #e9eee3);
  aspect-ratio: 4 / 3; box-shadow: var(--ombra);
  display: flex; align-items: center; justify-content: center;
}
.detail-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.detail-icon svg { width: 96px; height: 96px; color: var(--cat-fg, var(--verde)); opacity: .9; }
.detail-side { display: flex; flex-direction: column; }
.detail-kicker {
  font-size: .72rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase;
  margin-bottom: 8px;
}
.detail-title {
  font-family: var(--serif); font-weight: 600; font-size: clamp(2.2rem, 6vw, 3.2rem);
  line-height: 1; margin: 0; color: var(--ink);
}
.detail-title .sp { font-style: italic; }
.detail-volgare { color: var(--testo-soft); margin: 8px 0 0; font-size: 1.02rem; }
.detail-price {
  font-family: var(--serif); font-size: 2.1rem; color: var(--ink);
  margin: 18px 0 18px;
}
.detail-price small { font-family: var(--sans); font-size: .8rem; color: var(--testo-soft); font-weight: 600; vertical-align: middle; margin-right: 2px; }
.detail-price.na { font-size: 1.3rem; color: var(--testo-soft); }
.detail-side .btn-info { width: auto; align-self: flex-start; }
.detail-availability { color: var(--testo-soft); font-size: .82rem; margin: 14px 0 0; }

.detail-specs, .detail-block { max-width: var(--max); margin: 0 auto; padding: 6px 20px; }
.detail-specs { padding-bottom: 80px; }
.detail-specs h2, .detail-block h2 {
  font-family: var(--serif); font-size: 1.7rem; color: var(--ink);
  margin: 22px 0 14px; padding-bottom: 8px; border-bottom: 2px solid var(--verde-bosco);
}
.detail-desc { font-size: 1.06rem; line-height: 1.65; color: var(--testo); margin: 0; max-width: 70ch; }

/* galleria */
.detail-gallery { display: flex; flex-direction: column; gap: 10px; }
.dg-main {
  border-radius: 18px; overflow: hidden; background: var(--crema-2);
  aspect-ratio: 4 / 3; box-shadow: var(--ombra);
}
.dg-main img { width: 100%; height: 100%; object-fit: cover; display: block; }
.dg-thumbs {
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 8px;
  overflow-x: auto; scrollbar-width: thin; padding-bottom: 2px;
}
.dg-thumb {
  border: 2px solid transparent; border-radius: 10px; overflow: hidden; cursor: pointer;
  padding: 0; background: var(--crema-2); aspect-ratio: 1 / 1; min-width: 56px;
  transition: border-color .12s, transform .12s;
}
.dg-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.dg-thumb:hover { transform: translateY(-2px); }
.dg-thumb.active { border-color: var(--verde-chiaro); }

/* scheda pianta — griglia compatta a icone */
.care-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px;
}
.care-item {
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 7px;
  background: var(--card); border: 1px solid var(--bordo); border-radius: 14px; padding: 15px 10px 13px;
}
.care-ic {
  flex: none; width: 44px; height: 44px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--crema-2); color: var(--verde);
}
.care-ic svg { width: 23px; height: 23px; }
.care-txt { display: flex; flex-direction: column; min-width: 0; }
.care-label { font-size: .64rem; text-transform: uppercase; letter-spacing: .08em; color: var(--testo-soft); font-weight: 700; }
.care-val { font-size: .9rem; color: var(--ink); font-weight: 600; line-height: 1.25; margin-top: 3px; }
.care-fact {
  margin-top: 14px; padding: 13px 16px; border-radius: 12px;
  background: var(--crema-2); border-left: 3px solid var(--oro);
  font-size: .92rem; color: var(--testo); line-height: 1.5;
}
.care-fact b { color: var(--ink); }
.modal-table { width: 100%; border-collapse: collapse; margin-bottom: 8px; }
.modal-table th {
  text-align: left; font-size: .68rem; text-transform: uppercase; letter-spacing: .08em;
  color: var(--testo-soft); font-weight: 700; padding: 8px 8px; border-bottom: 2px solid var(--bordo);
}
.modal-table td { padding: 9px 8px; border-bottom: 1px solid var(--bordo); font-size: .88rem; }
.modal-table tr:last-child td { border-bottom: 0; }
.modal-table .price { font-weight: 700; color: var(--ink); }
.modal-note { font-size: .76rem; color: var(--testo-soft); margin: 6px 0 18px; }
.btn-info {
  display: inline-flex; align-items: center; gap: 9px;
  background: var(--verde-bosco); color: #fff; text-decoration: none;
  font-weight: 600; font-size: .95rem;
  padding: 13px 22px; border-radius: 999px; width: 100%; justify-content: center;
  transition: background .15s;
}
.btn-info:hover { background: var(--verde); }
.btn-info svg { width: 18px; height: 18px; }
.btn-info[data-add] { cursor: pointer; border: 0; font-family: var(--sans); }

.detail-cta { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin: 2px 0; }
.detail-side .btn-info, .btn-outline { width: auto; }
.btn-outline {
  display: inline-flex; align-items: center; gap: 9px;
  border: 1px solid var(--bordo); background: var(--surface); color: var(--ink);
  font-weight: 600; font-size: .95rem; padding: 12px 20px; border-radius: 999px;
  text-decoration: none; cursor: pointer; transition: border-color .15s;
}
.btn-outline:hover { border-color: var(--verde-chiaro); }
.btn-outline svg { width: 18px; height: 18px; }

/* ---------- Loader / footer ---------- */
.loader { text-align: center; padding: 80px 20px; color: var(--testo-soft); }
.sentinel { height: 1px; }
.site-footer {
  border-top: 1px solid var(--bordo); margin-top: 40px;
  padding: 26px 20px; text-align: center; color: var(--testo-soft); font-size: .8rem;
}
.site-footer a { color: var(--verde); }

@media (min-width: 760px) {
  .detail-hero {
    grid-template-columns: 1.05fr 1fr;
    align-items: center;
    padding-top: 36px;
  }
  .detail-photo { aspect-ratio: 1 / 1; }
  .detail-side { padding-left: 8px; }
}
@media (max-width: 540px) {
  .brand h1 { font-size: 1.6rem; }
  .brand img { height: 38px; }
  .filters { top: 64px; }
  .genus-head h2 { font-size: 1.7rem; }
}

/* ============ La mia lista delle piante ============ */
/* pulsante in header */
.list-menu { position: relative; flex: none; }
.list-btn {
  position: relative; width: 46px; height: 46px; border-radius: 14px; cursor: pointer;
  border: 1px solid var(--bordo); background: var(--surface); color: var(--verde-bosco);
  display: flex; align-items: center; justify-content: center;
  transition: border-color .14s, background .14s, transform .14s;
}
.list-btn:hover { border-color: var(--verde-chiaro); }
.list-btn svg { width: 25px; height: 25px; }
.list-btn.pulse { animation: fabPulse .4s ease; }
@keyframes fabPulse { 0%{transform:scale(1)} 40%{transform:scale(1.16)} 100%{transform:scale(1)} }
.list-count {
  position: absolute; top: -6px; right: -6px; min-width: 20px; height: 20px; padding: 0 5px;
  border-radius: 999px; background: var(--terracotta); color: #fff;
  font: 700 .7rem/20px var(--sans); text-align: center; box-shadow: 0 0 0 2px var(--crema);
}

/* popover (menu a tendina) */
.list-pop {
  position: absolute; top: calc(100% + 10px); right: 0; z-index: 35; width: 320px; max-width: 92vw;
  background: var(--card); border: 1px solid var(--bordo); border-radius: 16px;
  box-shadow: var(--ombra); padding: 14px; animation: popIn .16s ease;
}
@keyframes popIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.pop-head { font-family: var(--serif); font-size: 1.2rem; color: var(--ink); margin-bottom: 10px; }
.pop-sel { margin-bottom: 10px; }
.pop-sel select {
  width: 100%; font-family: var(--sans); font-size: .9rem; font-weight: 600; color: var(--ink);
  padding: 8px 10px; border: 1px solid var(--bordo); border-radius: 9px; background: var(--surface);
}
.pop-summary { font-size: .9rem; color: var(--testo-soft); margin-bottom: 8px; }
.pop-summary b { color: var(--ink); }
.pop-mini { display: flex; align-items: center; gap: 8px; padding: 5px 0; font-size: .85rem; }
.pop-mini img, .pm-noimg { width: 30px; height: 30px; border-radius: 7px; object-fit: cover; background: var(--crema-2); flex: none; }
.pm-name { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--testo); }
.pm-qty { color: var(--testo-soft); font-weight: 600; }
.pop-more { font-size: .76rem; color: var(--terracotta); font-weight: 600; padding: 4px 0; }
.pop-empty { text-align: center; color: var(--testo-soft); padding: 14px 6px; }
.pop-empty svg { width: 38px; height: 38px; color: var(--bordo); }
.pop-empty p { margin: 6px 0 0; font-size: .86rem; }
.pop-actions { display: flex; flex-direction: column; gap: 7px; margin-top: 12px; }
.pop-actions .btn-info { width: 100%; padding: 11px; }

.lbtn {
  flex: none; width: 34px; height: 34px; border-radius: 9px; cursor: pointer;
  border: 1px solid var(--bordo); background: var(--surface); color: var(--verde);
  display: flex; align-items: center; justify-content: center;
}
.lbtn:hover { border-color: var(--verde-chiaro); }
.lbtn svg { width: 16px; height: 16px; }

/* pagina dedicata "Le mie liste" */
.lists-page { position: fixed; inset: 0; z-index: 48; background: var(--crema); overflow-y: auto; }
.lists-page:not([hidden]) { display: block; animation: detailIn .22s ease; }
.lists-layout {
  max-width: var(--max); margin: 0 auto; padding: 24px 20px 90px;
  display: grid; grid-template-columns: 290px 1fr; gap: 22px; align-items: start;
}
.lists-side { position: sticky; top: 78px; }
.ls-side-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.ls-side-head h3 { font-family: var(--serif); font-size: 1.5rem; color: var(--ink); margin: 0; }
.ls-cards { display: flex; flex-direction: column; gap: 8px; }
.ls-card {
  text-align: left; border: 1px solid var(--bordo); background: var(--card); border-radius: 12px;
  padding: 12px 14px; cursor: pointer; display: flex; flex-direction: column; gap: 2px;
  transition: border-color .12s, transform .12s;
}
.ls-card:hover { border-color: var(--verde-chiaro); transform: translateX(2px); }
.ls-card.active { border-color: var(--verde-bosco); box-shadow: inset 3px 0 0 var(--verde-bosco); }
.ls-card-name { font-family: var(--serif); font-size: 1.18rem; color: var(--ink); line-height: 1.1; }
.ls-card-meta { font-size: .76rem; color: var(--testo-soft); }

.lists-main { background: var(--card); border: 1px solid var(--bordo); border-radius: 16px; overflow: hidden; }
.ls-main-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 18px 20px; border-bottom: 1px solid var(--bordo);
}
.ls-main-head h2 { font-family: var(--serif); font-size: 1.9rem; color: var(--ink); margin: 0; line-height: 1; }
.ls-tools { display: flex; gap: 6px; }
.ls-main-body { padding: 6px 20px; }
.ls-items { }
.ls-empty { text-align: center; color: var(--testo-soft); padding: 50px 20px; }
.ls-empty svg { width: 54px; height: 54px; color: var(--bordo); }
.ls-empty p { margin: 10px 0 18px; }
.ls-foot { border-top: 1px solid var(--bordo); padding: 16px 20px; background: var(--crema-2); }

.li-item { display: flex; gap: 11px; padding: 11px 0; border-bottom: 1px solid var(--bordo); }
.li-thumb { flex: none; width: 56px; height: 56px; border-radius: 9px; object-fit: cover; background: var(--crema-2); }
.li-main { flex: 1; min-width: 0; }
.li-name { font-family: var(--serif); font-size: 1.12rem; color: var(--ink); line-height: 1.05; }
.li-name .sp { font-style: italic; }
.li-meta { font-size: .74rem; color: var(--testo-soft); margin-top: 1px; }
.li-row2 { display: flex; align-items: center; justify-content: space-between; margin-top: 7px; gap: 8px; }
.qty { display: inline-flex; align-items: center; gap: 0; border: 1px solid var(--bordo); border-radius: 999px; background: var(--surface); }
.qty button { width: 26px; height: 26px; border: 0; background: transparent; cursor: pointer; font-size: 16px; color: var(--verde-bosco); line-height: 1; }
.qty span { min-width: 24px; text-align: center; font-weight: 700; font-size: .85rem; }
.li-price { font-weight: 700; color: var(--ink); font-size: .92rem; white-space: nowrap; }
.li-price small { color: var(--testo-soft); font-weight: 600; }
.li-remove { border: 0; background: transparent; color: var(--terracotta); cursor: pointer; font-size: .76rem; text-decoration: underline; text-underline-offset: 2px; }

.drawer-foot { border-top: 1px solid var(--bordo); padding: 14px 16px calc(14px + env(safe-area-inset-bottom)); background: var(--card); }
.foot-total { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 4px; }
.foot-total b { font-family: var(--serif); font-size: 1.7rem; color: var(--ink); }
.foot-total span { font-size: .8rem; color: var(--testo-soft); }
.foot-note { font-size: .72rem; color: var(--testo-soft); margin: 0 0 12px; }
.foot-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.foot-actions .btn-info { width: 100%; grid-column: 1 / -1; padding: 12px; }
.foot-mini {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid var(--bordo); background: var(--surface); color: var(--verde-bosco);
  font-weight: 600; font-size: .82rem; padding: 9px; border-radius: 10px; cursor: pointer;
}
.foot-mini:hover { border-color: var(--verde-chiaro); }
.foot-mini svg { width: 15px; height: 15px; }
.foot-mini.danger { color: var(--terracotta); }

/* aggiunta rapida sulle card */
.card-add {
  position: absolute; top: 8px; right: 8px; z-index: 2;
  width: 34px; height: 34px; border-radius: 50%; border: 0; cursor: pointer;
  background: rgba(255,255,255,.92); color: var(--verde-bosco);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 8px rgba(31,61,43,.25); opacity: 0; transform: scale(.8);
  transition: opacity .14s, transform .14s, background .14s;
}
.card:hover .card-add, .card-add:focus { opacity: 1; transform: scale(1); }
.card-add svg { width: 18px; height: 18px; }
.card-add.done { background: var(--verde-bosco); color: #fff; opacity: 1; transform: scale(1); }
@media (hover: none) { .card-add { opacity: 1; transform: scale(1); } }

/* pulsante aggiungi nella tabella misure + scheda */
.add-btn {
  display: inline-flex; align-items: center; gap: 5px; white-space: nowrap;
  border: 1px solid var(--verde-bosco); background: transparent; color: var(--verde-bosco);
  font-weight: 600; font-size: .78rem; padding: 5px 11px; border-radius: 999px; cursor: pointer;
  transition: background .12s, color .12s;
}
.add-btn:hover { background: var(--verde-bosco); color: #fff; }
.add-btn svg { width: 14px; height: 14px; }
.modal-table td.col-add { text-align: right; width: 1%; }

/* toast */
.toast {
  position: fixed; left: 50%; bottom: 92px; transform: translateX(-50%) translateY(10px);
  z-index: 60; background: var(--verde-bosco); color: #fff; font-weight: 600; font-size: .88rem;
  padding: 11px 18px; border-radius: 999px; box-shadow: 0 8px 24px -6px rgba(0,0,0,.4);
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* stampa */
.print-sheet { display: none; }
@media print {
  body > * { display: none !important; }
  .print-sheet { display: block !important; padding: 0; color: #000; }
  .print-sheet h1 { font-family: var(--serif); }
  .print-sheet table { width: 100%; border-collapse: collapse; margin-top: 12px; }
  .print-sheet th, .print-sheet td { border-bottom: 1px solid #ccc; padding: 7px 6px; text-align: left; font-size: 12px; }
  .print-sheet .pt-total { font-size: 18px; font-weight: 700; margin-top: 14px; text-align: right; }
}

@media (max-width: 720px) {
  .lists-layout { grid-template-columns: 1fr; gap: 16px; }
  .lists-side { position: static; }
  .ls-cards { flex-direction: row; flex-wrap: wrap; }
  .ls-card { flex: 1 1 140px; }
  .list-btn { width: 42px; height: 42px; }
}

/* mini-menù "Aggiungi a…" */
.add-menu {
  position: fixed; z-index: 60; width: 232px; max-width: 80vw;
  background: var(--card); border: 1px solid var(--bordo); border-radius: 14px;
  box-shadow: var(--ombra); padding: 7px; animation: popIn .14s ease;
}
.am-head { font-size: .7rem; text-transform: uppercase; letter-spacing: .07em; color: var(--testo-soft); font-weight: 700; padding: 5px 9px; }
.am-lists { display: flex; flex-direction: column; max-height: 240px; overflow-y: auto; }
.am-list {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  border: 0; background: transparent; cursor: pointer; width: 100%; text-align: left;
  padding: 9px; border-radius: 9px; font-family: var(--sans); font-size: .9rem; font-weight: 600; color: var(--ink);
}
.am-list:hover { background: var(--crema-2); }
.am-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.am-count { flex: none; font-size: .72rem; color: var(--testo-soft); background: var(--crema-2); border-radius: 999px; padding: 1px 8px; }
.am-list:hover .am-count { background: var(--surface); }
.am-new {
  display: flex; align-items: center; gap: 6px; width: 100%; cursor: pointer;
  border: 0; border-top: 1px solid var(--bordo); margin-top: 4px; background: transparent;
  padding: 10px 9px 6px; font-family: var(--sans); font-size: .85rem; font-weight: 600; color: var(--verde);
}
.am-new:hover { color: var(--verde-bosco); }
.am-new svg { width: 15px; height: 15px; }

/* ============ Assistente Vivaista (chat AI) ============ */
.chat-fab {
  position: fixed; right: 20px; bottom: 20px; z-index: 42;
  display: flex; align-items: center; gap: 9px; cursor: pointer;
  border: 0; border-radius: 999px; padding: 11px 18px 11px 14px;
  background: var(--verde-bosco); color: #fff;
  box-shadow: 0 8px 24px -6px rgba(31,61,43,.5);
  transition: transform .15s, background .15s;
}
.chat-fab:hover { transform: translateY(-3px); background: var(--verde); }
.chat-fab svg { width: 26px; height: 26px; flex: none; }
.chat-fab-txt { font-family: var(--sans); font-size: .74rem; font-weight: 700; line-height: 1.05; text-align: left; }
body.chat-on .chat-fab { display: none; }

.chat-panel {
  position: fixed; right: 20px; bottom: 20px; z-index: 47;
  width: 380px; max-width: calc(100vw - 32px); height: 560px; max-height: calc(100vh - 40px);
  background: var(--card); border: 1px solid var(--bordo); border-radius: 18px;
  box-shadow: 0 18px 50px -10px rgba(0,0,0,.4); overflow: hidden;
}
.chat-panel:not([hidden]) { display: flex; flex-direction: column; animation: popIn .18s ease; }
.chat-head {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 12px 14px; background: var(--verde-bosco); color: #fff;
}
.chat-head-t { display: flex; align-items: center; gap: 10px; }
.chat-av { width: 34px; height: 34px; border-radius: 50%; background: rgba(255,255,255,.16); display: flex; align-items: center; justify-content: center; font-size: 18px; }
.chat-head-t b { font-family: var(--serif); font-size: 1.2rem; display: block; line-height: 1; }
.chat-beta { font-size: .62rem; font-weight: 700; letter-spacing: .08em; opacity: .8; text-transform: uppercase; }
.chat-close { border: 0; background: transparent; color: #fff; font-size: 24px; cursor: pointer; line-height: 1; opacity: .85; }
.chat-close:hover { opacity: 1; }

.chat-msgs { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; background: var(--crema); }
.msg { display: flex; }
.msg.user { justify-content: flex-end; }
.bubble {
  max-width: 84%; padding: 10px 13px; border-radius: 15px; font-size: .9rem; line-height: 1.45;
  background: var(--surface); border: 1px solid var(--bordo); color: var(--testo);
}
.msg.bot .bubble { border-bottom-left-radius: 5px; }
.msg.user .bubble { background: var(--verde-bosco); color: #fff; border-color: var(--verde-bosco); border-bottom-right-radius: 5px; }
.bubble strong { font-weight: 700; }
.msg-img { display: block; max-width: 200px; width: 100%; border-radius: 10px; margin-bottom: 6px; }
.chat-sugg { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
.sugg {
  border: 1px solid var(--verde-chiaro); background: var(--surface); color: var(--verde-bosco);
  border-radius: 999px; padding: 6px 12px; font-size: .8rem; font-weight: 600; cursor: pointer;
}
.sugg:hover { background: var(--crema-2); }
.typing { display: inline-flex; gap: 4px; padding: 2px 0; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--verde-chiaro); animation: typed 1s infinite; }
.typing i:nth-child(2) { animation-delay: .15s; }
.typing i:nth-child(3) { animation-delay: .3s; }
@keyframes typed { 0%,60%,100% { opacity: .25; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-3px); } }

.chat-imgbar { display: flex; align-items: center; gap: 8px; padding: 8px 14px; border-top: 1px solid var(--bordo); background: var(--card); }
.chat-imgbar img { width: 38px; height: 38px; border-radius: 7px; object-fit: cover; }
.chat-imgbar span { flex: 1; font-size: .8rem; color: var(--testo-soft); }
.chat-imgbar button { border: 0; background: var(--crema-2); width: 24px; height: 24px; border-radius: 50%; cursor: pointer; color: var(--testo-soft); }

.chat-input { display: flex; align-items: center; gap: 7px; padding: 10px 12px; border-top: 1px solid var(--bordo); background: var(--card); }
.chat-input input[type=text] {
  flex: 1; min-width: 0; border: 1px solid var(--bordo); border-radius: 999px; padding: 10px 14px;
  font-family: var(--sans); font-size: .9rem; background: var(--surface); color: var(--testo); outline: none;
}
.chat-input input[type=text]:focus { border-color: var(--verde-chiaro); }
.chat-imgbtn, .chat-send {
  flex: none; width: 38px; height: 38px; border-radius: 50%; cursor: pointer; border: 0;
  display: flex; align-items: center; justify-content: center;
}
.chat-imgbtn { background: var(--crema-2); color: var(--verde-bosco); }
.chat-imgbtn:hover { background: var(--bordo); }
.chat-send { background: var(--verde-bosco); color: #fff; }
.chat-send:hover { background: var(--verde); }
.chat-send:disabled { opacity: .5; cursor: default; }
.chat-imgbtn svg, .chat-send svg { width: 18px; height: 18px; }
.chat-disc { margin: 0; padding: 7px 14px 10px; font-size: .66rem; color: var(--testo-soft); text-align: center; background: var(--card); }

@media (max-width: 520px) {
  .chat-panel { right: 0; bottom: 0; width: 100vw; height: 100dvh; max-height: 100dvh; border-radius: 0; }
  .chat-fab { right: 14px; bottom: 14px; }
}

/* chat: pulsanti header + link piante + pagina full + split */
.chat-head-btns { display: flex; align-items: center; gap: 2px; }
.chat-exp { border: 0; background: transparent; color: #fff; cursor: pointer; width: 30px; height: 30px; opacity: .85; display: flex; align-items: center; justify-content: center; border-radius: 8px; }
.chat-exp:hover { opacity: 1; background: rgba(255,255,255,.14); }
.chat-exp svg { width: 17px; height: 17px; }
.chat-av.sm { width: 22px; height: 22px; font-size: 13px; display: inline-flex; vertical-align: middle; background: var(--crema-2); }

.plant-link {
  color: var(--verde); font-weight: 700; cursor: pointer;
  text-decoration: underline; text-underline-offset: 2px; text-decoration-thickness: 1.5px;
  text-decoration-color: var(--verde-chiaro);
}
.plant-link:hover { text-decoration-color: var(--verde); }
.msg.user .plant-link { color: #fff; text-decoration-color: rgba(255,255,255,.6); }

.ai-page { position: fixed; inset: 0; z-index: 48; background: var(--crema); }
.ai-page:not([hidden]) { display: flex; flex-direction: column; animation: detailIn .22s ease; }
.ai-layout { flex: 1; min-height: 0; display: grid; grid-template-columns: 1fr; overflow: hidden; }
.ai-chat { display: flex; flex-direction: column; min-height: 0; width: 100%; max-width: 820px; margin: 0 auto; }
.ai-chat .chat-msgs { flex: 1; background: transparent; }
.ai-chat .chat-input, .ai-chat .chat-imgbar { background: var(--crema); }
.ai-detail { display: none; position: relative; overflow-y: auto; background: var(--card); border-left: 1px solid var(--bordo); }
.ai-layout.has-plant { grid-template-columns: minmax(330px, 1fr) 1.25fr; }
.ai-layout.has-plant .ai-chat { max-width: none; margin: 0; }
.ai-layout.has-plant .ai-detail { display: block; }
.ai-detail-close {
  position: absolute; top: 12px; right: 12px; z-index: 3;
  width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--bordo);
  background: var(--surface); cursor: pointer; font-size: 20px; line-height: 1; color: var(--ink);
}
.ai-detail-body .detail-hero { padding-top: 22px; }
.ai-detail-body .detail-specs { padding-bottom: 50px; }

@media (max-width: 760px) {
  .ai-layout.has-plant { grid-template-columns: 1fr; }
  .ai-layout.has-plant .ai-chat { display: none; }
}

/* ============ Riconoscimento pianta ============ */
.scan-btn {
  flex: none; width: 46px; height: 46px; border-radius: 14px; cursor: pointer;
  border: 1px solid var(--bordo); background: var(--surface); color: var(--verde-bosco);
  display: flex; align-items: center; justify-content: center;
  transition: border-color .14s, background .14s;
}
.scan-btn:hover { border-color: var(--verde-chiaro); }
.scan-btn svg { width: 25px; height: 25px; }

.scan-overlay { position: fixed; inset: 0; z-index: 52; background: rgba(31,45,30,.5); backdrop-filter: blur(3px); }
.scan-overlay:not([hidden]) { display: flex; align-items: center; justify-content: center; padding: 16px; animation: detailIn .2s ease; }
.scan-modal {
  background: var(--card); border: 1px solid var(--bordo); border-radius: 18px;
  width: 460px; max-width: 100%; max-height: 92vh; overflow: hidden; display: flex; flex-direction: column;
  box-shadow: 0 20px 60px -12px rgba(0,0,0,.45);
}
.scan-head { display: flex; align-items: center; gap: 8px; padding: 14px 16px; border-bottom: 1px solid var(--bordo); }
.scan-head b { font-family: var(--serif); font-size: 1.35rem; color: var(--ink); }
.scan-head .chat-beta { color: var(--testo-soft); }
.scan-close { margin-left: auto; border: 0; background: transparent; font-size: 24px; cursor: pointer; color: var(--testo-soft); line-height: 1; }
.scan-body { padding: 16px; overflow-y: auto; }

.scan-modes { display: flex; gap: 6px; background: var(--crema-2); padding: 3px; border-radius: 999px; margin-bottom: 14px; }
.scan-mode { flex: 1; border: 0; background: transparent; cursor: pointer; padding: 8px; border-radius: 999px; font-family: var(--sans); font-weight: 600; font-size: .85rem; color: var(--verde); }
.scan-mode.active { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(31,61,43,.2); }

.scan-drop {
  width: 100%; border: 2px dashed var(--verde-chiaro); border-radius: 14px; background: var(--crema);
  padding: 30px 18px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center;
  transition: background .14s, border-color .14s;
}
.scan-drop:hover { background: var(--crema-2); }
.scan-drop svg { width: 46px; height: 46px; color: var(--verde); }
.scan-drop b { font-size: 1.05rem; color: var(--ink); }
.scan-drop span { font-size: .82rem; color: var(--testo-soft); max-width: 36ch; }
.scan-disc { font-size: .72rem; color: var(--testo-soft); text-align: center; margin: 12px 0 0; }

.scan-loading { text-align: center; padding: 40px 16px; color: var(--testo-soft); }
.scan-loading p { margin: 16px 0 0; }
.spinner { display: inline-block; width: 38px; height: 38px; border: 3px solid var(--crema-2); border-top-color: var(--verde); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.scan-result-top { display: flex; gap: 12px; align-items: center; margin-bottom: 14px; }
.scan-thumb { width: 76px; height: 76px; border-radius: 12px; object-fit: cover; flex: none; }
.scan-result-h b { font-family: var(--serif); font-size: 1.3rem; color: var(--ink); display: block; line-height: 1.1; }
.scan-result-h span { font-size: .82rem; color: var(--testo-soft); }
.rc-list { display: flex; flex-direction: column; gap: 8px; }
.rc-item { display: flex; align-items: center; gap: 11px; padding: 9px 11px; border: 1px solid var(--bordo); border-radius: 12px; background: var(--surface); }
.rc-item.in-cat { cursor: pointer; border-color: var(--verde-chiaro); }
.rc-item.in-cat:hover { background: var(--crema-2); }
.rc-item img, .rc-noimg { width: 46px; height: 46px; border-radius: 9px; object-fit: cover; flex: none; background: var(--crema-2); }
.rc-noimg.out { background: repeating-linear-gradient(45deg, var(--crema-2), var(--crema-2) 5px, var(--surface) 5px, var(--surface) 10px); }
.rc-main { flex: 1; min-width: 0; }
.rc-name { font-family: var(--serif); font-size: 1.12rem; color: var(--ink); line-height: 1.05; }
.rc-name i { font-style: italic; }
.rc-sub { font-size: .74rem; color: var(--testo-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rc-conf { font-size: .78rem; font-weight: 700; color: var(--verde); background: var(--crema-2); border-radius: 999px; padding: 2px 9px; flex: none; }
.rc-go { font-size: .78rem; font-weight: 600; color: var(--verde-bosco); flex: none; }
.rc-empty { text-align: center; color: var(--testo-soft); padding: 24px; }
.scan-again { width: 100%; justify-content: center; margin-top: 14px; }

/* input chat auto-espandibile */
.chat-input { align-items: flex-end; }
.chat-input textarea {
  flex: 1; min-width: 0; border: 1px solid var(--bordo); border-radius: 19px;
  padding: 10px 14px; font: 500 .9rem/1.45 var(--sans); background: var(--surface);
  color: var(--testo); outline: none; resize: none; max-height: 110px; overflow-y: auto;
  transition: border-color .15s;
}
.chat-input textarea:focus { border-color: var(--verde-chiaro); }

/* chip conferma "aggiunta in lista" nella chat */
.lista-ok {
  display: inline-flex; align-items: center; gap: 5px; margin-top: 6px;
  background: rgba(46, 125, 50, .12); border: 1px solid rgba(46, 125, 50, .35);
  color: var(--leaf, #2e5d3a); font-weight: 700; font-size: .8rem;
  border-radius: 999px; padding: 5px 12px;
}
html[data-theme="dark"] .lista-ok { background: rgba(159,211,154,.12); border-color: rgba(159,211,154,.35); }

/* modulo "parla con un tecnico" nella chat */
.tec-card {
  display: flex; flex-direction: column; gap: 8px; margin-top: 8px;
  padding: 13px 14px; border-radius: 13px; max-width: 300px;
  background: rgba(127, 188, 110, .1); border: 1px solid rgba(127, 188, 110, .4);
}
.tec-card b { font-size: .88rem; }
.tec-card input {
  border: 1px solid rgba(127,167,116,.45); border-radius: 9px; padding: 8px 11px;
  font: 500 .85rem inherit; background: rgba(255,255,255,.07); color: inherit; outline: none;
}
.tec-card input:focus { border-color: #7fbc6e; }
.tec-card .tec-send {
  border: 0; border-radius: 999px; padding: 9px 14px; cursor: pointer;
  background: #7fbc6e; color: #0d130a; font-weight: 700; font-size: .85rem;
}
.tec-card .tec-send:hover { background: #93d180; }
.tec-card .tec-send:disabled { opacity: .6; cursor: default; }
.tec-card i { font-style: normal; font-size: .7rem; opacity: .65; }
