.territory-navigation[hidden], .territory-navigation-legacy { display:none !important; }

/* A single compact entry point replaces the rows of country/territory pills. */
.topbar-context:has(.country-navigation) { position:relative; display:grid; grid-template-columns:minmax(142px,188px) minmax(190px,1fr); align-items:center; justify-self:center; gap:8px; width:min(100%,570px); }
.country-navigation { min-width:0; }
.territory-switcher { position:relative; min-width:0; color:#172731; }
.territory-switcher > summary { list-style:none; }
.territory-switcher > summary::-webkit-details-marker { display:none; }
.territory-switcher-trigger { display:flex; align-items:center; justify-content:space-between; gap:10px; min-width:0; height:44px; padding:6px 11px 6px 13px; border:1px solid rgba(183,141,78,.38); border-radius:12px; color:#fffdf8; background:#223641; box-shadow:inset 0 1px 0 rgba(255,255,255,.08); cursor:pointer; }
.territory-switcher-trigger:hover { background:#2d4652; }
.territory-switcher[open] .territory-switcher-trigger { background:#14232d; }
.territory-switcher-trigger:focus-visible { outline:3px solid #39738d; outline-offset:3px; }
.territory-switcher-current { display:block; min-width:0; }
.territory-switcher-current small, .territory-switcher-current strong { display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.territory-switcher-current small { margin-bottom:2px; color:#ead8b6; font-size:8px; font-weight:800; letter-spacing:.14em; line-height:1; text-transform:uppercase; }
.territory-switcher-current strong { font-size:11px; font-weight:750; line-height:1.25; }
.territory-switcher-trigger > i { flex:0 0 auto; width:7px; height:7px; border-right:1.5px solid currentColor; border-bottom:1.5px solid currentColor; transform:translateY(-2px) rotate(45deg); transition:transform .16s ease; }
.territory-switcher[open] .territory-switcher-trigger > i { transform:translateY(2px) rotate(225deg); }
.territory-switcher-menu { position:absolute; z-index:2800; top:calc(100% + 9px); left:0; width:min(360px,calc(100vw - 24px)); max-height:min(520px,calc(100dvh - 100px)); overflow:auto; padding:8px; border:1px solid rgba(183,141,78,.42); border-radius:14px; background:rgba(255,253,248,.99); box-shadow:0 24px 70px rgba(20,35,45,.28); }
.territory-switcher-group + .territory-switcher-group { margin-top:5px; padding-top:9px; border-top:1px solid rgba(20,35,45,.1); }
.territory-switcher-country { display:block; padding:5px 8px 7px; color:#68767b; font-size:9px; font-weight:850; letter-spacing:.15em; text-transform:uppercase; }
.territory-switcher-links { display:grid; gap:2px; }
.territory-switcher-links a { display:flex; align-items:center; justify-content:space-between; gap:12px; min-height:42px; padding:9px 10px; border-radius:8px; color:#172731; text-decoration:none; }
.territory-switcher-links a:hover, .territory-switcher-links a:focus-visible { background:#f1eadf; }
.territory-switcher-links a:focus-visible { outline:3px solid #39738d; outline-offset:-2px; }
.territory-switcher-links a[aria-current="page"] { color:#14232d; background:#ead8b6; font-weight:800; }
.territory-switcher-links a > span { min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:12px; }
.territory-switcher-links a > small { flex:0 0 auto; color:#68767b; font-size:8px; font-weight:700; text-transform:uppercase; }
.topbar-context:has(.country-navigation) .appellation-navigation-controls { min-width:0; }
.topbar-context:has(.country-navigation) .appellation-title select { width:100%; min-width:0; }
.territory-preparation main.workspace[hidden] { display:none; }
.territory-preparation-page { height:auto; min-height:100%; overflow:auto; }
.territory-preparation { background:#f6f1e8; overflow:visible; height:auto; min-height:100vh; }
.territory-preparation-card { max-width:820px; margin:35px auto; padding:30px; color:#14232d; background:#fffdf8; border:1px solid #e0d7c8; border-radius:16px; }
.territory-preparation-card h1 { font-size:clamp(26px,4vw,40px); margin:12px 0; }
.territory-preparation-card p { line-height:1.65; }
.territory-preparation-card h2 { font-size:17px; margin-top:28px; }
.territory-preparation-card li { padding:8px 0; line-height:1.45; }
.territory-preparation .topbar-actions { visibility:hidden; }
@media(max-width:1180px) and (min-width:901px) {
  .topbar-context:has(.country-navigation) { grid-template-columns:minmax(120px,145px) minmax(145px,1fr); gap:6px; }
  .territory-switcher-trigger { padding-inline:10px; }
}
@media(max-width:900px) {
  :root { --utw-header-height:148px; --mapendium-header-height:148px; }
  body[data-role="FREE"] { --utw-header-height:102px; --mapendium-header-height:102px; }
  body > header.topbar { grid-template-areas:"brand language" "context context" "actions actions"; grid-template-columns:minmax(0,1fr) auto; grid-template-rows:40px 46px 42px; gap:4px 8px; height:var(--utw-header-height); padding:6px 10px; }
  body[data-role="FREE"] > header.topbar { grid-template-areas:"brand language" "context context"; grid-template-rows:40px 46px; }
  body[data-role="FREE"] > header.topbar > .topbar-actions { display:none; }
  .topbar > .brand { grid-area:brand; }
  .topbar > .topbar-language { grid-area:language; }
  .topbar > .topbar-context { grid-area:context; }
  body > header.topbar > .topbar-actions { grid-area:actions; }
  .topbar-context:has(.country-navigation) { grid-template-columns:minmax(116px,36%) minmax(0,1fr); gap:6px; width:100%; }
  .territory-switcher-trigger { height:44px; border-radius:9px; }
  .territory-switcher-menu { position:fixed; top:96px; right:10px; left:10px; width:auto; max-height:calc(100dvh - 108px); }
  body > .topbar + .workspace, .workspace { height:calc(100dvh - var(--utw-header-height)); }
}
@media(max-width:700px) { .territory-preparation-card { margin:15px; padding:20px; } }
@media(max-width:620px) {
  .territory-switcher-current small { font-size:7px; }
  .territory-switcher-current strong { font-size:10px; }
  body.territory-preparation > header.topbar { grid-template-rows:40px 46px; height:100px; }
  .territory-preparation .topbar-actions { display:none; }
}

.italian-local-preview .leaflet-control-attribution { margin-bottom:0 !important; }
.italian-local-preview .leaflet-control-layers { max-width:240px; }
.italian-local-preview .leaflet-control-layers label { display:block; margin:3px 0; font-size:12px; letter-spacing:normal; text-transform:none; }
.italian-local-preview .leaflet-control-layers input { display:inline-block; width:14px; height:14px; min-width:0; min-height:0; padding:0; margin:0 5px 0 0; vertical-align:middle; }
.italian-local-preview > button { padding:8px 12px; margin:4px 6px 10px 0; border:1px solid #bcc7c1; border-radius:6px; background:#f0f5f1; color:#243e32; cursor:pointer; }
@media print {
  body.territory-preparation > header,
  .territory-preparation-card > :not(.italian-local-preview),
  .italian-local-preview button,
  .italian-local-preview select,
  .italian-local-preview .leaflet-control-zoom,
  .italian-local-preview .leaflet-control-layers { display:none !important; }
  .territory-preparation-card { margin:0; padding:0; border:0; max-width:none; }
  .italian-local-preview .leaflet-container { break-inside:avoid; }
  .italian-local-preview h3 { break-after:avoid; }
}

.parcel-drawing-trigger { position:absolute; z-index:760; left:78px; bottom:74px; border:1px solid rgba(255,255,255,.42); border-radius:9px; padding:9px 13px; background:#7b1537; color:#fff; box-shadow:0 4px 14px rgba(20,35,45,.22); font:700 12px/1.2 inherit; cursor:pointer; }
.parcel-drawing-trigger:focus-visible { outline:3px solid #e8c879; outline-offset:2px; }
.parcel-drawing-panel { position:absolute; z-index:1200; left:78px; bottom:118px; width:min(390px,calc(100% - 100px)); padding:15px; border:1px solid #d7cab5; border-radius:12px; background:#fffdf8; color:#17232d; box-shadow:0 10px 30px rgba(20,35,45,.28); }
.parcel-drawing-panel[hidden] { display:none; }
.parcel-drawing-panel strong { display:block; margin-bottom:6px; font-size:16px; }
.parcel-drawing-panel p { margin:0 0 8px; font-size:12px; line-height:1.45; }
.parcel-drawing-panel small { display:block; color:#52616a; }
.parcel-drawing-panel div { display:flex; gap:6px; flex-wrap:wrap; margin-top:11px; }
.parcel-drawing-panel button,.parcel-drawing-download { border:1px solid #b8afa1; border-radius:7px; padding:7px 9px; background:#f5efe5; color:#17232d; font:650 11px/1.2 inherit; cursor:pointer; text-decoration:none; }
.parcel-drawing-panel button.is-primary { background:#7b1537; color:#fff; border-color:#7b1537; }
.parcel-drawing-panel button:disabled { opacity:.45; cursor:not-allowed; }
.parcel-drawing-download { display:inline-block; margin-top:10px; }
#map.is-drawing-parcel { cursor:crosshair; }
@media(max-width:700px) {
  .parcel-drawing-trigger { left:62px; bottom:68px; }
  .parcel-drawing-panel { left:62px; bottom:108px; width:calc(100% - 76px); }
}

.territory-switcher-region > summary { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:12px 10px; cursor:pointer; border-radius:8px; }
.territory-switcher-region > summary:hover { background:#f1eadf; }
.territory-switcher-region > summary:focus-visible { outline:3px solid #39738d; outline-offset:-2px; }
.territory-switcher-region > summary strong { font-size:13px; }
.territory-switcher-region > summary small { font-size:8px; color:#68767b; text-transform:uppercase; }
.territory-switcher-region-links { margin:0 0 6px 12px; padding-left:6px; border-left:2px solid #ead8b6; }

/* Give the appellation its entire grid cell; descriptive text must not consume its width. */
.topbar-context:has(.country-navigation) .appellation-navigation-controls > .appellation-title { display:block; width:100%; min-width:0; }
.topbar-context:has(.country-navigation) .appellation-navigation-controls > .appellation-title > span { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip-path:inset(50%); white-space:nowrap; }
.topbar-context:has(.country-navigation) .appellation-navigation-controls > .appellation-title > select { display:block; box-sizing:border-box; width:100%; min-width:0; max-width:100%; }

/* Languedoc et Roussillon: two navigable subdivisions of one regional group. */
.territory-switcher-subregion{grid-column:1/-1;min-width:0;border-left:2px solid #b3a781;padding-left:10px}.territory-switcher-subregion>summary{cursor:pointer;padding:10px 4px;font-weight:650}.territory-switcher-subregion[hidden]{display:none!important}
