:root {
  --sage-950: #173421;
  --sage-900: #24462f;
  --sage-800: #2f5238;
  --sage-700: #476a4f;
  --sage-500: #82977f;
  --sage-300: #bac5b3;
  --sage-100: #e8ece4;
  --brick-700: #8f3225;
  --brick-600: #a6402f;
  --brick-100: #f5e5df;
  --cream: #f8f3e8;
  --paper: #fffdf8;
  --ink: #203027;
  --muted: #667169;
  --line: #dfe4dc;
  --shadow: 0 18px 50px rgba(35, 65, 45, 0.1);
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 10px;
  --max: 1180px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background: var(--paper);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.55;
}
body.dialog-open { overflow: hidden; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
img { max-width: 100%; display: block; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.skip-link {
  position: fixed;
  left: 16px;
  top: -80px;
  z-index: 1000;
  background: var(--sage-950);
  color: white;
  padding: 10px 14px;
  border-radius: 8px;
}
.skip-link:focus { top: 12px; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 78px;
  padding: 8px max(24px, calc((100vw - var(--max)) / 2));
  border-bottom: 1px solid rgba(36, 70, 47, 0.1);
  background: rgba(255, 253, 248, 0.94);
  backdrop-filter: blur(16px);
}
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; }
.brand img { width: 58px; height: 58px; border-radius: 50%; object-fit: cover; }
.brand span { display: grid; line-height: 1.15; }
.brand strong { font-size: 1.08rem; color: var(--sage-950); letter-spacing: .055em; }
.brand em { color: var(--sage-800); font-style: normal; font-size: .76rem; letter-spacing: .1em; }
.brand small { margin-top: 3px; color: var(--brick-700); text-transform: uppercase; letter-spacing: 0.19em; font-size: 0.6rem; }
.main-nav { display: flex; align-items: center; gap: 6px; }
.main-nav a {
  padding: 11px 15px;
  border-radius: 999px;
  color: var(--sage-900);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.92rem;
}
.main-nav a:hover, .main-nav a.active { background: var(--sage-100); }
.main-nav .nav-manage { color: var(--brick-700); }
.menu-toggle { display: none; border: 0; background: transparent; padding: 12px; }
.menu-toggle > span:not(.sr-only) { display: block; width: 24px; height: 2px; background: var(--sage-900); margin: 5px 0; }

main { min-height: 70vh; }
.shell { width: min(var(--max), calc(100% - 48px)); margin: 0 auto; }
.section { padding: 72px 0; }
.section-compact { padding: 42px 0 72px; }
.eyebrow {
  display: inline-block;
  color: var(--brick-700);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}
h1, h2, h3 { margin: 0; color: var(--sage-950); font-family: Georgia, "Times New Roman", serif; line-height: 1.06; font-weight: 500; }
h1 { font-size: clamp(2.7rem, 6vw, 5.5rem); letter-spacing: -0.045em; }
h2 { font-size: clamp(2rem, 3.5vw, 3.35rem); letter-spacing: -0.03em; }
h3 { font-size: 1.35rem; }
p { margin: 0; }
.lead { max-width: 640px; margin-top: 22px; color: #4e5b52; font-size: clamp(1.05rem, 1.6vw, 1.25rem); }

.hero {
  position: relative;
  overflow: hidden;
  min-height: auto;
  display: grid;
  align-items: center;
  background:
    radial-gradient(circle at 82% 20%, rgba(166, 64, 47, 0.1), transparent 22%),
    linear-gradient(135deg, #fbf7ee 0%, #f5f2e8 56%, #e7eee5 100%);
}
.hero::after {
  content: none;
}
.hero-grid { position: relative; z-index: 2; display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 56px; align-items: center; padding: 48px 0 0; }
.hero h1 em { color: var(--brick-700); font-style: normal; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 32px; }
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 12px 19px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.18s ease, background 0.18s ease, color 0.18s ease;
}
.button:hover { transform: translateY(-1px); }
.button-primary { color: #fff; background: var(--brick-600); box-shadow: 0 10px 26px rgba(143, 50, 37, 0.2); }
.button-primary:hover { background: var(--brick-700); }
.button-secondary { color: var(--sage-900); background: transparent; border-color: var(--sage-300); }
.button-secondary:hover { background: var(--sage-100); }
.button-small { min-height: 40px; padding: 8px 14px; font-size: 0.9rem; }
.button-danger { color: #8a2d26; border-color: #e3b8b0; background: #fff8f5; }
.button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid rgba(166, 64, 47, 0.34);
  outline-offset: 2px;
}

.hero-card {
  position: relative;
  min-height: 380px;
  display: grid;
  align-content: stretch;
  grid-template-rows: auto 1fr auto auto;
  overflow: hidden;
  padding: 26px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 32px;
  color: var(--sage-950);
  background: rgba(255, 253, 248, .9);
  box-shadow: var(--shadow);
}
.hero-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 84% 16%, rgba(166, 64, 47, .1), transparent 24%);
}
.hero-card > * { position: relative; z-index: 1; }
.hero-card-logo { align-self: start; justify-self: end; width: 112px; height: 112px; border-radius: 50%; box-shadow: 0 10px 24px rgba(35,65,45,.12); }
.hero-card h2 { margin-top: 8px; color: var(--sage-950); font-size: clamp(2.2rem, 4vw, 3.65rem); font-family: "Segoe Script", "Bradley Hand", cursive; font-style: italic; }
.hero-card p { margin-top: 9px; color: var(--sage-700); }
.hero-chip { align-self: end; justify-self: start; padding: 7px 11px; border-radius: 999px; color: var(--brick-700); background: var(--brick-100); font-size: .78rem; font-weight: 800; }
.hero-landscape-wrap { position: relative; z-index: 1; display: grid; place-items: center; width: min(900px, calc(100% - 32px)); margin: -4px auto 0; }
.hero-landscape-wrap img { width: 100%; height: auto; object-fit: contain; }

.section-heading { display: flex; justify-content: space-between; gap: 24px; align-items: end; margin-bottom: 30px; }
.section-heading p { max-width: 520px; color: var(--muted); }
.listings-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.listing-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: #fff;
  box-shadow: 0 12px 32px rgba(35, 65, 45, 0.06);
  transition: transform .2s ease, box-shadow .2s ease;
}
.listing-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.listing-card a { text-decoration: none; }
.listing-visual {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 75% 20%, rgba(166,64,47,.24), transparent 21%),
    linear-gradient(145deg, #e8ece4 0%, #bdcbb9 48%, #6f876f 100%);
}
.listing-visual img { grid-area: 1 / 1; width: 100%; height: 100%; min-width: 0; min-height: 0; object-fit: cover; }
.listing-visual img[hidden] { display: none !important; }
.listing-visual-full { background: #eef1eb; }
.listing-visual-full > img:first-child { object-fit: contain; }
.listing-visual .placeholder-mark { width: 56%; height: auto; max-height: 70%; object-fit: contain; opacity: .56; filter: saturate(.7); }
.listing-badge { position: absolute; left: 16px; top: 16px; padding: 7px 10px; border-radius: 999px; color: white; background: var(--brick-600); font-weight: 800; font-size: .74rem; text-transform: uppercase; letter-spacing: .07em; }
.listing-badge[data-operation="Affitto"] { background: #f1cf5b; color: #26392b; }
.listing-badge[data-operation="Vendita"] { background: #36573e; color: #fff; }
.listing-content { padding: 20px; }
.listing-place { color: var(--brick-700); font-size: .78rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.listing-card h3 { margin-top: 8px; min-height: 2.65em; }
.listing-price { margin-top: 16px; color: var(--sage-950); font-size: 1.28rem; font-weight: 900; }
.listing-meta { display: flex; flex-wrap: wrap; gap: 7px 13px; margin-top: 14px; color: var(--muted); font-size: .88rem; }
.listing-link { display: inline-flex; margin-top: 18px; color: var(--sage-800); font-weight: 800; }

.trust-strip { background: var(--sage-950); color: white; }
.trust-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: rgba(255,255,255,.16); }
.trust-item { padding: 42px; background: var(--sage-950); }
.trust-number { display: block; color: #e8c5b8; font-family: Georgia, serif; font-size: 2.7rem; }
.trust-item h3 { margin-top: 11px; color: white; }
.trust-item p { margin-top: 10px; color: rgba(255,255,255,.68); }

.services-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.service-card { padding: 30px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: #fff; }
.service-icon { display: grid; place-items: center; width: 44px; height: 44px; margin-bottom: 22px; border-radius: 50%; color: var(--brick-700); background: var(--brick-100); font-weight: 900; }
.service-card p { margin-top: 11px; color: var(--muted); }
.home-agency-link { margin-top: 28px; }

.page-hero { padding: 68px 0 34px; background: linear-gradient(180deg, var(--cream), var(--paper)); }
.page-hero h1 { max-width: 850px; font-size: clamp(2.5rem, 5vw, 4.8rem); }
.page-hero p { margin-top: 18px; max-width: 690px; color: var(--muted); font-size: 1.08rem; }
.filters {
  position: sticky;
  top: 94px;
  z-index: 20;
  display: grid;
  grid-template-columns: 1.25fr 1fr 1fr auto;
  gap: 12px;
  margin: 8px 0 30px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255,253,248,.96);
  box-shadow: 0 10px 30px rgba(35,65,45,.07);
  backdrop-filter: blur(12px);
}
.field { display: grid; gap: 7px; }
.field label, .form-field label { color: var(--sage-900); font-size: .78rem; font-weight: 800; }
input, select, textarea {
  width: 100%;
  border: 1px solid #cfd7cc;
  border-radius: 10px;
  color: var(--ink);
  background: #fff;
  padding: 11px 12px;
}
textarea { resize: vertical; }
.filter-count { align-self: end; min-height: 46px; display: grid; place-items: center; padding: 0 12px; color: var(--muted); font-weight: 700; white-space: nowrap; }
.empty-state { grid-column: 1 / -1; padding: 70px 24px; border: 1px dashed var(--sage-300); border-radius: var(--radius-lg); text-align: center; color: var(--muted); background: var(--sage-100); }

.detail-back { display: inline-flex; margin: 30px 0 20px; color: var(--sage-800); font-weight: 800; text-decoration: none; }
.preview-banner { margin: 24px 0 -12px; padding: 12px 16px; border: 1px solid #d8cba9; border-radius: 12px; color: #61552e; background: #fff8dd; font-weight: 750; }
.detail-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(300px, .7fr); gap: 34px; align-items: start; padding-bottom: 76px; }
.detail-main { min-width: 0; }
.detail-visual { aspect-ratio: 16 / 9; border-radius: 28px; }
.detail-visual .placeholder-mark { width: 34%; }
.detail-gallery { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.detail-gallery-item { position: relative; display: block; overflow: hidden; aspect-ratio: 4 / 3; border-radius: 18px; background: var(--sage-100); }
.detail-gallery-main { grid-column: 1 / -1; aspect-ratio: 16 / 9; border-radius: 28px; }
.detail-gallery-item img { width: 100%; height: 100%; object-fit: cover; transition: transform .25s ease; }
.detail-gallery-item:hover img { transform: scale(1.015); }
.detail-title-row { display: flex; justify-content: space-between; gap: 24px; align-items: start; margin-top: 28px; }
.detail-title-row h1 { font-size: clamp(2.25rem, 4vw, 4.2rem); }
.detail-price { flex: 0 0 auto; color: var(--brick-700); font-size: 1.55rem; font-weight: 900; white-space: nowrap; }
.detail-location { margin-top: 12px; color: var(--muted); }
.facts-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 28px; }
.fact { padding: 16px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fff; }
.fact strong { display: block; color: var(--sage-950); font-size: 1.05rem; }
.fact span { display: block; margin-top: 4px; color: var(--muted); font-size: .78rem; }
.detail-copy { margin-top: 34px; }
.detail-copy h2 { font-size: 2rem; }
.detail-copy p { margin-top: 15px; color: #4f5d53; font-size: 1.02rem; white-space: pre-line; }
.feature-list { display: flex; flex-wrap: wrap; gap: 9px; padding: 0; margin: 18px 0 0; list-style: none; }
.feature-list li { padding: 9px 12px; border-radius: 999px; background: var(--sage-100); color: var(--sage-900); font-weight: 700; font-size: .85rem; }
.document-section > p { margin-top: 10px; }
.ape-viewer { margin-top: 18px; border: 1px solid var(--line); border-radius: var(--radius-md); background: #fff; overflow: hidden; }
.ape-viewer summary { cursor: pointer; padding: 17px; color: var(--sage-950); font-weight: 700; }
.ape-viewer summary:focus-visible { outline: 3px solid var(--brick-600); outline-offset: -3px; }
.ape-viewer iframe { display: block; width: 100%; height: min(75vh, 780px); min-height: 420px; border: 0; }
.document-list { display: grid; gap: 12px; margin-top: 18px; }
.document-link { display: flex; align-items: center; gap: 14px; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius-md); color: var(--sage-950); background: #fff; text-decoration: none; transition: border-color .2s ease, transform .2s ease; }
.document-link:hover { border-color: var(--sage-500); transform: translateY(-2px); }
.document-link strong, .document-link small { display: block; }
.document-link small { margin-top: 3px; color: var(--muted); }
.document-icon { display: grid; place-items: center; width: 48px; height: 48px; flex: 0 0 48px; border-radius: 12px; color: #fff; background: var(--brick-600); font-size: .75rem; font-weight: 900; letter-spacing: .05em; }
.ical-box { margin-top: 28px; padding: 20px; border-left: 4px solid var(--brick-600); border-radius: 0 var(--radius-md) var(--radius-md) 0; background: var(--brick-100); }
.ical-box h3 { font-size: 1.08rem; }
.ical-box p { margin-top: 6px; color: #69514c; font-size: .9rem; }
.contact-card { position: sticky; top: 106px; padding: 26px; border-radius: var(--radius-lg); background: var(--sage-950); color: white; box-shadow: var(--shadow); }
.contact-card h2 { color: white; font-size: 2rem; }
.contact-card p { margin-top: 12px; color: rgba(255,255,255,.72); }
.contact-card .button { width: 100%; margin-top: 22px; }
.contact-card .contact-mini { display: grid; gap: 7px; margin-top: 18px; padding-top: 18px; border-top: 1px solid rgba(255,255,255,.16); }
.contact-card .contact-mini a { color: white; text-decoration: none; font-weight: 700; }

.agency-intro { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: center; }
.agency-intro-copy p { margin-top: 18px; color: #4f5d53; font-size: 1.04rem; }
.agency-visual { position: relative; min-height: 480px; }
.agency-visual img { position: absolute; object-fit: cover; border-radius: 22px; box-shadow: var(--shadow); }
.agency-visual img:nth-child(1) { left: 0; top: 0; width: 76%; height: 72%; }
.agency-visual img:nth-child(2) { right: 0; bottom: 0; width: 58%; height: 48%; border: 8px solid var(--paper); }
.agency-values { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.agency-value { padding: 28px; border-radius: var(--radius-lg); background: var(--sage-100); }
.agency-value h3 { color: var(--sage-950); }
.agency-value p { margin-top: 10px; color: var(--muted); }
.office-section { background: var(--cream); }
.office-gallery { display: grid; grid-template-columns: 1.25fr .75fr .75fr; grid-template-rows: 190px 190px; gap: 14px; margin: 30px 0 0; }
.office-gallery img { width: 100%; height: 100%; object-fit: cover; border-radius: 18px; }
.office-gallery img:first-child { grid-row: 1 / 3; }
.office-gallery figcaption { grid-column: 2 / 4; color: var(--muted); font-size: .85rem; }
.office-gallery + .agency-values { margin-top: 32px; }

.contact-layout { display: grid; grid-template-columns: 1.05fr .95fr; gap: 28px; padding: 38px 0 74px; }
.contact-panel { padding: 30px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: #fff; box-shadow: 0 12px 32px rgba(35,65,45,.06); }
.contact-panel.green { color: white; background: var(--sage-950); border-color: var(--sage-950); }
.contact-panel.green h2, .contact-panel.green h3 { color: white; }
.contact-panel.green p { color: rgba(255,255,255,.72); }
.contact-lines { display: grid; gap: 14px; margin-top: 24px; }
.contact-line { display: grid; grid-template-columns: 42px 1fr; gap: 12px; align-items: start; }
.contact-line-icon { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; color: var(--brick-700); background: var(--brick-100); font-weight: 900; }
.contact-line strong, .contact-line a { display: block; color: inherit; text-decoration: none; }
.contact-line small { display: block; color: var(--muted); }
.contact-panel.green .contact-line small { color: rgba(255,255,255,.62); }
.contact-cta-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }
.legal-box { margin-top: 24px; padding-top: 22px; border-top: 1px solid var(--line); color: var(--muted); font-size: .86rem; }
.location-photo { width: 100%; aspect-ratio: 16 / 10; margin-top: 22px; object-fit: cover; border-radius: 18px; }

.admin-shell { width: min(1280px, calc(100% - 48px)); margin: 0 auto; }
.admin-note { display: flex; gap: 14px; align-items: start; margin-top: 24px; padding: 17px 18px; border: 1px solid #dbcfc0; border-radius: var(--radius-md); background: #fffaf0; color: #5e584e; }
.admin-note strong { color: var(--brick-700); }
.admin-toolbar { display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between; align-items: center; margin: 32px 0 18px; }
.admin-toolbar-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.admin-views { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 18px; }
.admin-view { display: inline-flex; align-items: center; gap: 9px; padding: 10px 16px; border: 1px solid var(--line); border-radius: 999px; color: var(--sage-950); background: #fff; font: inherit; font-weight: 750; cursor: pointer; }
.admin-view:hover, .admin-view.selected { border-color: var(--sage-950); background: var(--sage-100); }
.admin-view:focus-visible, .admin-list-item:focus-visible { outline: 3px solid var(--brick-700); outline-offset: 2px; }
.admin-view span { display: inline-grid; place-items: center; min-width: 24px; height: 24px; padding: 0 5px; border-radius: 999px; background: #fff; font-size: .88rem; }
.admin-layout { display: grid; grid-template-columns: minmax(270px, .72fr) minmax(0, 1.5fr); gap: 24px; padding-bottom: 76px; align-items: start; }
.admin-list, .editor-card { border: 1px solid var(--line); border-radius: var(--radius-lg); background: #fff; box-shadow: 0 12px 32px rgba(35,65,45,.05); }
.admin-list { overflow: hidden; }
.admin-list-head { padding: 18px 20px; border-bottom: 1px solid var(--line); font-weight: 900; color: var(--sage-950); }
.admin-list-item { display: grid; grid-template-columns: 1fr auto; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--line); cursor: pointer; }
.admin-list-item:last-child { border-bottom: 0; }
.admin-list-item:hover, .admin-list-item.selected { background: var(--sage-100); }
.admin-list-item strong { display: block; }
.admin-list-item small { color: var(--muted); }
.admin-list-status { display: flex; gap: 8px; align-items: start; }
.admin-home-badge { padding: 3px 7px; border-radius: 999px; color: var(--brick-700); background: var(--brick-100); font-size: .68rem; font-weight: 900; text-transform: uppercase; letter-spacing: .04em; }
.status-label { color: var(--muted); font-size: .85rem; white-space: nowrap; }
.homepage-feature-field input:disabled + label { color: var(--muted); }
.status-dot { width: 10px; height: 10px; margin-top: 6px; border-radius: 50%; background: #c6a85d; }
.status-dot.published { background: #43814f; }
.editor-card { padding: 26px; }
.editor-head { display: flex; justify-content: space-between; gap: 18px; align-items: center; margin-bottom: 22px; }
.editor-head h2 { font-size: 2rem; }
.form-section { padding: 22px 0; border-top: 1px solid var(--line); }
.form-section:first-of-type { border-top: 0; padding-top: 0; }
.form-section h3 { margin-bottom: 15px; font-size: 1.14rem; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
.form-field { display: grid; gap: 6px; }
.form-field.full { grid-column: 1 / -1; }
.check-field { display: flex; align-items: center; gap: 9px; min-height: 45px; }
.check-field input { width: 18px; height: 18px; }
.check-field label { font-weight: 750; }
.field-help { color: var(--muted); font-size: .77rem; }
.energy-panel { padding: 18px; border: 1px solid var(--line); border-radius: 12px; background: var(--sage-100); gap: 14px; }
.energy-panel h4, .energy-progress { margin: 0; }
.energy-panel .field-help { font-size: .875rem; line-height: 1.5; }
.energy-progress { font-size: .875rem; line-height: 1.5; }
.energy-panel summary { cursor: pointer; font-size: 1rem; font-weight: 750; padding: 10px 0; }
.energy-panel summary:focus-visible { outline: 2px solid var(--brick-600); outline-offset: 3px; }
.energy-panel details > .form-field, .energy-panel details > .form-grid { margin-top: 12px; }
.homepage-feature-field { padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--sage-100); }
.editor-gallery-preview { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 10px; margin-top: 10px; }
.editor-photo-preview { position: relative; overflow: hidden; aspect-ratio: 4 / 3; margin: 0; border: 2px solid transparent; border-radius: 12px; background: var(--sage-100); }
.editor-photo-preview.cover { border-color: var(--brick-600); }
.editor-photo-preview img { width: 100%; height: 100%; object-fit: cover; }
.editor-photo-preview figcaption { position: absolute; left: 6px; bottom: 6px; padding: 3px 7px; border-radius: 999px; color: #fff; background: rgba(35,65,45,.82); font-size: .68rem; font-weight: 900; }
.editor-photo-preview.cover figcaption { background: var(--brick-700); }
.editor-photo-preview.broken::after { content: "Immagine non disponibile"; position: absolute; inset: 0; display: grid; place-items: center; padding: 10px; color: var(--muted); background: var(--sage-100); text-align: center; font-size: .72rem; font-weight: 800; }
.editor-gallery-empty { grid-column: 1 / -1; padding: 14px; border: 1px dashed var(--sage-300); border-radius: 10px; color: var(--muted); background: var(--sage-100); font-size: .85rem; }
.form-actions { position: sticky; bottom: 12px; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius-md); background: rgba(255,253,248,.96); box-shadow: 0 10px 30px rgba(35,65,45,.1); backdrop-filter: blur(12px); }
.import-input { display: none; }

.contact-dialog { width: min(540px, calc(100% - 28px)); border: 0; border-radius: 24px; padding: 30px; color: var(--ink); background: var(--paper); box-shadow: 0 28px 90px rgba(20,43,28,.28); }
.contact-dialog::backdrop { background: rgba(18, 36, 24, .6); backdrop-filter: blur(4px); }
.contact-dialog h2 { margin-top: 7px; font-size: 2.25rem; }
.contact-dialog p { margin: 10px 0 18px; color: var(--muted); }
.contact-dialog label { display: block; margin: 13px 0 6px; color: var(--sage-900); font-weight: 800; font-size: .82rem; }
.dialog-close { position: absolute; right: 14px; top: 12px; border: 0; background: transparent; color: var(--sage-900); font-size: 2rem; cursor: pointer; }
.dialog-actions { display: flex; gap: 9px; flex-wrap: wrap; margin-top: 18px; }
.phone-link { display: inline-flex; margin-top: 18px; color: var(--sage-800); font-weight: 800; }
.email-link { display: block; margin-top: 6px; color: var(--sage-800); font-weight: 800; }
.form-feedback { min-height: 1.5em; font-size: .83rem; color: var(--sage-700) !important; }
.privacy-note { margin-top: 10px; color: var(--muted); font-size: .78rem; line-height: 1.5; }
.privacy-note a { color: var(--sage-800); font-weight: 800; }
.toast { position: fixed; right: 18px; bottom: 18px; z-index: 100; max-width: 380px; padding: 13px 17px; border-radius: 12px; color: #fff; background: var(--sage-950); box-shadow: var(--shadow); transform: translateY(140%); transition: transform .25s ease; }
.toast.show { transform: translateY(0); }

.site-footer { overflow: hidden; padding-top: 26px; background: var(--cream); border-top: 1px solid #e4dfd4; }
.site-footer > img { width: 100%; height: auto; object-fit: contain; }
.footer-content { display: flex; justify-content: space-between; gap: 30px; width: min(var(--max), calc(100% - 48px)); margin: 0 auto; padding: 28px 0 36px; }
.footer-content strong { color: var(--sage-950); }
.footer-content p { margin-top: 5px; color: var(--muted); }
.footer-content small { display: block; margin-top: 4px; color: var(--muted); }
.footer-legal-links { display: flex; gap: 14px; margin-top: 15px; }
.footer-legal-links a { color: var(--sage-900); font-weight: 800; font-size: .84rem; }
.footer-contacts { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 16px; }
.footer-contacts a { color: var(--sage-900); font-weight: 800; text-decoration: none; }

.legal-hero { padding-bottom: 42px; }
.legal-shell { max-width: 900px; }
.draft-notice { margin-top: 24px; padding: 14px 17px; border: 1px solid rgba(157,64,43,.28); border-left: 4px solid var(--brick-600); border-radius: 12px; color: var(--sage-950); background: rgba(157,64,43,.06); line-height: 1.55; }
.legal-section { padding-bottom: 76px; }
.legal-document { color: var(--ink); }
.legal-document h2 { margin: 34px 0 12px; color: var(--sage-950); font-size: clamp(1.25rem, 2.4vw, 1.65rem); }
.legal-document p, .legal-document li { color: #37443b; line-height: 1.75; }
.legal-document p + p { margin-top: 12px; }
.legal-document ul { display: grid; gap: 8px; margin: 10px 0 0 22px; }
.legal-document a { color: var(--sage-800); font-weight: 700; }
.legal-updated { padding-bottom: 18px; border-bottom: 1px solid var(--line); color: var(--muted) !important; font-size: .9rem; }
.legal-table-wrap { overflow-x: auto; margin-top: 14px; border: 1px solid var(--line); border-radius: 14px; }
.legal-table { width: 100%; min-width: 620px; border-collapse: collapse; }
.legal-table th, .legal-table td { padding: 14px 16px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; line-height: 1.55; }
.legal-table th { color: var(--sage-950); background: var(--cream); }
.legal-table tr:last-child td { border-bottom: 0; }
.legal-table code { font-size: .86em; overflow-wrap: anywhere; }
.legal-related { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 42px; padding-top: 24px; border-top: 1px solid var(--line); }

@media (max-width: 920px) {
  .hero-grid, .detail-grid, .admin-layout, .agency-intro, .contact-layout { grid-template-columns: 1fr; }
  .hero { min-height: auto; }
  .hero-card { min-height: 330px; }
  .listings-grid { grid-template-columns: repeat(2, 1fr); }
  .facts-grid { grid-template-columns: repeat(2, 1fr); }
  .contact-card { position: static; }
  .admin-list { max-height: 350px; overflow: auto; }
  .filters { grid-template-columns: repeat(2, 1fr); }
  .filter-count { grid-column: 1 / -1; }
  .agency-visual { min-height: 430px; }
}

@media (max-width: 860px) {
  .site-header { min-height: 68px; padding: 6px 16px; }
  .brand img { width: 50px; height: 50px; }
  .brand strong { font-size: 1.02rem; }
  .menu-toggle { display: block; }
  .main-nav {
    position: absolute;
    top: calc(100% + 1px);
    left: 0;
    right: 0;
    display: none;
    padding: 10px 16px 18px;
    border-bottom: 1px solid var(--line);
    background: var(--paper);
    box-shadow: 0 18px 32px rgba(35,65,45,.1);
  }
  .main-nav.open { display: grid; }
  .main-nav a { border-radius: 10px; }
}

@media (max-width: 700px) {
  .shell, .admin-shell { width: min(100% - 30px, var(--max)); }
  .section { padding: 54px 0; }
  .hero-grid { padding: 50px 0 18px; gap: 38px; }
  .hero-actions .button { width: 100%; }
  .hero-card { min-height: 300px; }
  .section-heading { display: grid; align-items: start; }
  .listings-grid, .trust-grid, .services-grid, .agency-values { grid-template-columns: 1fr; }
  .trust-grid { gap: 0; }
  .trust-item { padding: 30px; border-bottom: 1px solid rgba(255,255,255,.12); }
  .filters { position: static; grid-template-columns: 1fr; }
  .filter-count { grid-column: auto; justify-items: start; }
  .page-hero { padding: 48px 0 24px; }
  .detail-title-row { display: grid; }
  .detail-price { white-space: normal; }
  .detail-gallery { grid-template-columns: 1fr; }
  .detail-gallery-main { grid-column: auto; }
  .facts-grid { grid-template-columns: repeat(2, 1fr); }
  .form-grid { grid-template-columns: 1fr; }
  .form-field.full { grid-column: auto; }
  .editor-gallery-preview { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .editor-card { padding: 19px; }
  .admin-toolbar { align-items: stretch; }
  .admin-toolbar-actions { width: 100%; }
  .admin-toolbar-actions .button { flex: 1; }
  .form-actions { justify-content: stretch; }
  .form-actions .button { flex: 1; }
  .footer-content { display: grid; width: calc(100% - 32px); }
  .footer-contacts { justify-content: flex-start; }
  .site-footer > img { min-height: 0; object-fit: contain; }
  .agency-visual { min-height: 340px; }
  .agency-visual img:nth-child(1) { width: 84%; height: 70%; }
  .agency-visual img:nth-child(2) { width: 62%; height: 46%; }
  .office-gallery { grid-template-columns: 1fr 1fr; grid-template-rows: 220px 160px; }
  .office-gallery img:first-child { grid-column: 1 / 3; grid-row: auto; }
  .office-gallery figcaption { grid-column: 1 / 3; }
  .legal-related .button { width: 100%; }
}

.listing-share { display: none; }
.share-feedback { margin: 10px 0 0; font-size: 0.875rem; }
.share-feedback:empty { display: none; }
.share-link { width: 100%; margin-top: 10px; }
@media (max-width: 760px), (pointer: coarse) {
  .listing-share { display: block; margin: 0 0 24px; }
  .listing-share .button { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
.language-nav { display: inline-flex; gap: 4px; align-items: center; padding: 4px; border: 1px solid #bcc9b9; border-radius: 24px; }
.language-nav a { padding: 7px 10px; min-width: 38px; text-align: center; font-size: .875rem; }
.language-nav a[aria-current="true"] { background: #36573e; color: white; border-radius: 20px; }
.english-editor { padding: 16px; border: 1px solid #bcc9b9; border-radius: 12px; }
.statistics-metrics { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:16px; margin:24px 0; }
.statistics-metric { padding:20px; border:1px solid #bcc9b9; border-radius:14px; background:#f1f4ee; }
.statistics-metric span { display:block; font-size:.9rem; }
.statistics-metric strong { display:block; margin-top:8px; font-size:1.8rem; }
.statistics-section { margin:32px 0; }
.statistics-table th:not(:first-child),.statistics-table td:not(:first-child) { text-align:right; }
.statistics-table td:first-child { min-width:200px; }
.statistics-days { display:grid; gap:8px; }
.statistics-day { display:grid; grid-template-columns:55px minmax(0,1fr) 55px; gap:12px; align-items:center; font-size:.85rem; }
.statistics-day strong { text-align:right; }
.statistics-bar { height:14px; background:#edf1e9; border-radius:5px; overflow:hidden; }
.statistics-bar span { display:block; height:100%; background:#516e46; }
@media(max-width:760px) { .statistics-metrics { grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media(max-width:420px) { .statistics-metric { padding:12px; } .statistics-metric strong { font-size:1.4rem; } }
.english-editor summary { font-weight: 700; cursor: pointer; }
.english-editor label { display:block; margin-top: 12px; }
.english-editor input[type="checkbox"] { width: auto; }
@media(max-width:760px) { .site-header { padding-right: 12px; } .language-nav { margin: 8px; } }
@media(max-width:480px) {
  .site-header { padding-left:8px; padding-right:8px; gap:4px; }
  .brand { gap:6px; min-width:0; }
  .brand img { width:36px; height:36px; }
  .brand strong { font-size:.72rem; letter-spacing:.02em; }
  .brand em { font-size:.65rem; letter-spacing:.02em; }
  .brand small { font-size:.5rem; letter-spacing:.1em; }
  .language-nav { margin:0; padding:2px; gap:0; }
  .language-nav a { min-width:30px; padding:7px 6px; }
  .menu-toggle { padding:6px; }
}
