/* Ecomic Digital Library — app styles */
/* Generated from index.html — do not edit inline */

.skip-link {
      position: absolute; top: -9999px; left: -9999px;
      background: #6546F3; color: #fff; padding: 10px 16px;
      font-family: 'Manrope', sans-serif; font-size: 14px; font-weight: 600;
      z-index: 9999; border-radius: 0 0 4px 0; text-decoration: none;
    }
    .skip-link:focus { top: 0; left: 0; }

/* ─── TOKENS ──────────────────────────────────────────────────── */
    :root {
      /* Alias sui token di assets/css/theme.css — non ridefinire i colori
         qui: per cambiare palette/tema modifica solo theme.css. */
      --viola:        var(--theme-primary);
      --viola-dark:   var(--theme-primary-dark);
      --ossidiana:    var(--theme-secondary);
      --ossidiana-lt: var(--theme-secondary-light);
      --viola-lt:     var(--theme-primary-light);
      --off-black:    var(--theme-ink);
      --gray-70:      var(--theme-gray-70);
      --gray-40:      var(--theme-gray-40);
      --gray-10:      var(--theme-gray-10);
      --gray-05:      var(--theme-gray-05);
      --white:        var(--theme-white);
      --focus-ring:   0 0 0 3px var(--theme-primary), 0 0 0 5px var(--theme-white);

      /* Layout (non colori) */
      --header-h:     84px;
      --nav-h:        44px;
      --sidebar-w:    300px;
      --panel-w:      280px;
      --toolbar-h:    48px;
      --bottom-nav-h: 56px;
      --container-w:  1280px;
    }

    *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
    html { font-size: 16px; -webkit-text-size-adjust: 100%; height: 100%; }
    body {
      font-family: 'Manrope', sans-serif;
      font-size: 1rem; line-height: 1.5;
      background: var(--gray-05); color: var(--off-black);
      min-height: 100dvh;
      display: flex; flex-direction: column;
      overflow-x: hidden;
    }

    :focus-visible { outline: none; box-shadow: var(--focus-ring); border-radius: 3px; }

/* ─── HEADER ──────────────────────────────────────────────────────── */
    .site-header {
      height: var(--header-h);
      background: var(--white);
      border-bottom: 1px solid var(--gray-10);
      flex-shrink: 0; z-index: 200;
      box-shadow: 0 1px 4px rgba(0,0,0,0.06);
      padding: 0 24px;
    }
    .header-inner {
      max-width: var(--container-w); margin: 0 auto; height: 100%;
      display: flex; align-items: center; gap: 16px;
    }
    .header-logo { display: flex; align-items: center; text-decoration: none; flex-shrink: 0; }
    .header-logo-img { display: block; height: 40px; width: auto; }
    .header-app-divider { width: 1px; height: 40px; background: var(--gray-10); flex-shrink: 0; }
    .header-app-info { display: flex; flex-direction: column; justify-content: center; gap: 3px; min-width: 0; flex: 1 1 auto; overflow: hidden; }
    .header-app-name { font-size: 15px; font-weight: 700; color: var(--ossidiana); letter-spacing: -0.01em; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .header-app-subtitle { font-size: 11px; font-weight: 400; color: var(--gray-40); letter-spacing: 0.01em; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

    /* Main nav */
    .header-nav { display: flex; align-items: center; gap: 4px; margin-left: 20px; }
    .header-nav-link {
      font-family: 'Manrope', sans-serif; font-size: 13px; font-weight: 600;
      color: var(--gray-70); background: transparent; border: none;
      padding: 8px 12px; border-radius: 4px; cursor: pointer;
      white-space: nowrap; transition: color 0.15s, background 0.15s;
    }
    .header-nav-link:hover { color: var(--viola); background: rgba(101,70,243,0.06); }
    .header-nav-link.active { color: var(--viola); font-weight: 700; }
    .header-nav-link:focus-visible { box-shadow: var(--focus-ring); outline: none; }

    .header-right { margin-left: auto; display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

    .header-nav-toggle {
      display: none; align-items: center; justify-content: center;
      width: 36px; height: 36px; border-radius: 4px; border: 1px solid var(--gray-10);
      background: transparent; color: var(--off-black); cursor: pointer; flex-shrink: 0;
    }
    .header-nav-toggle:hover { border-color: var(--viola); color: var(--viola); }
    .header-nav-toggle:focus-visible { box-shadow: var(--focus-ring); outline: none; }

    .header-nav-mobile {
      display: none; flex-direction: column;
      background: var(--white); border-bottom: 1px solid var(--gray-10);
      padding: 6px 12px; flex-shrink: 0; z-index: 199;
    }
    .header-nav-mobile:not([hidden]) { display: flex; }
    .header-nav-mobile .header-nav-link { text-align: left; padding: 12px; }

    /* ─── PREFOOTER ───────────────────────────────────────────────────── */
    .prefooter {
      display: flex; align-items: center; justify-content: center;
      padding: 20px 24px; background: var(--gray-05);
      border-top: 1px solid var(--gray-10); flex-shrink: 0;
    }
    .prefooter-logo { height: 36px; width: auto; display: block; }

    /* ─── FOOTER ──────────────────────────────────────────────────────── */
    .site-footer {
      background: var(--white);
      color: var(--off-black);
      border-top: 1px solid var(--gray-10);
      flex-shrink: 0; z-index: 100;
      padding: 28px 24px 20px;
    }
    .footer-inner { max-width: var(--container-w); margin: 0 auto; }
    .footer-top {
      display: flex; flex-wrap: wrap; align-items: center;
      justify-content: space-between; gap: 20px 40px;
    }
    .footer-brand-title { font-size: 15px; font-weight: 700; color: var(--ossidiana); }
    .footer-brand-subtitle { font-size: 12px; color: var(--gray-40); margin-top: 2px; }
    .footer-logos { display: flex; flex-wrap: wrap; align-items: center; gap: 22px; }
    .footer-logo-img { height: 34px; width: auto; max-width: 140px; object-fit: contain; display: block; }
    .footer-logo-img--ecomic { height: 30px; }

    .footer-sep { height: 1px; background: var(--gray-10); margin: 22px 0 16px; }

    .footer-bottom {
      display: flex; flex-wrap: wrap; align-items: center;
      justify-content: space-between; gap: 10px 24px;
    }
    .footer-version { font-size: 11px; color: var(--gray-40); }
    .footer-menu { display: flex; flex-wrap: wrap; gap: 4px 18px; }
    .footer-menu-link {
      font-family: 'Manrope', sans-serif; font-size: 12px; font-weight: 600;
      color: var(--gray-70); background: none; border: none;
      padding: 4px 0; cursor: pointer; transition: color 0.15s;
    }
    .footer-menu-link:hover { color: var(--viola); text-decoration: underline; }
    .footer-menu-link:focus-visible { box-shadow: var(--focus-ring); outline: none; border-radius: 2px; }

    /* ─── LAYOUT ──────────────────────────────────────────────────── */
    /* Generic app "page" — Home / Catalogo / Placeholder toggle between
       these; only one is visible (not [hidden]) at a time. Sized to its own
       content (not clipped) so the page — and the footer below it — scroll
       naturally instead of being pinned to the viewport. */
    .app-view { flex: 1 0 auto; display: flex; flex-direction: column; overflow-x: hidden; }
    .app-view[hidden] { display: none; }

    /* The Catalogo view is the one exception: it's a fixed-viewport 3D tool
       (sidebar + viewer + panels each scroll internally), so it keeps a
       floor of one full viewport (minus header) — it still grows past that
       if its own content ever needs more. */
    .view-catalog { min-height: calc(100dvh - var(--header-h)); }

    .app-body { flex: 1; display: flex; overflow: hidden; position: relative; }

    /* ─── SIDEBAR ─────────────────────────────────────────────────── */
    .sidebar {
      width: var(--sidebar-w); background: var(--white);
      border-right: 1px solid var(--gray-10);
      display: flex; flex-direction: column;
      flex-shrink: 0; overflow: hidden;
      transition: transform 0.3s ease; z-index: 150;
    }
    .sidebar-header {
      padding: 16px 20px; border-bottom: 1px solid var(--gray-10);
      display: flex; flex-direction: column; gap: 8px;
    }
    .sidebar-search {
      display: flex; align-items: center; gap: 8px;
      border: 1.5px solid var(--gray-10); border-radius: 4px;
      padding: 8px 10px; background: var(--white); color: var(--gray-40);
      transition: border-color 0.15s;
    }
    .sidebar-search:focus-within { border-color: var(--viola); }
    .sidebar-search-input {
      flex: 1; min-width: 0; border: none; outline: none; background: none;
      font-family: 'Manrope', sans-serif; font-size: 12.5px; color: var(--off-black);
    }
    .sidebar-search-input::placeholder { color: var(--gray-40); }
    .sidebar-search-input::-webkit-search-cancel-button { cursor: pointer; }
    .sidebar-filter-select {
      width: 100%; border: 1.5px solid var(--gray-10); border-radius: 4px;
      padding: 7px 10px; background: var(--white); color: var(--off-black);
      font-family: 'Manrope', sans-serif; font-size: 12px; font-weight: 600;
      cursor: pointer; transition: border-color 0.15s;
    }
    .sidebar-filter-select:hover, .sidebar-filter-select:focus-visible { border-color: var(--viola); outline: none; }

    .catalog-list { overflow-y: auto; flex: 1; padding: 6px 0; }

    /* API error / loading state inside sidebar */
    .api-status {
      padding: 16px 20px; font-size: 12px; color: var(--gray-40); line-height: 1.6;
      display: flex; flex-direction: column; gap: 8px;
    }
    .api-status .spinner {
      width: 20px; height: 20px; border: 2px solid var(--gray-10);
      border-top-color: var(--viola); border-radius: 50%;
      animation: spin 0.8s linear infinite; flex-shrink: 0;
    }
    .api-status.error { color: #c0392b; }
    .api-retry-btn {
      padding: 6px 12px; border-radius: 3px; border: 1.5px solid var(--viola);
      background: transparent; color: var(--viola); font-family: 'Manrope', sans-serif;
      font-size: 11px; font-weight: 700; cursor: pointer;
      transition: all 0.15s; width: fit-content;
    }
    .api-retry-btn:hover { background: var(--viola); color: var(--white); }

    .catalog-item {
      display: flex; align-items: center; gap: 12px;
      padding: 12px 20px; min-height: 64px;
      cursor: pointer; border: none; background: transparent;
      width: 100%; text-align: left;
      border-left: 3px solid transparent;
      transition: background 0.15s, border-color 0.15s;
    }
    .catalog-item:hover { background: var(--gray-05); }
    .catalog-item.active { border-left-color: var(--viola); background: rgba(101,70,243,0.06); }
    .catalog-item:focus-visible { box-shadow: inset var(--focus-ring); outline: none; }

    .catalog-thumb {
      width: 44px; height: 44px; background: var(--ossidiana);
      border-radius: 4px; display: flex; align-items: center;
      justify-content: center; flex-shrink: 0; overflow: hidden;
    }
    .catalog-thumb img { width: 100%; height: 100%; object-fit: cover; }
    .catalog-info { min-width: 0; }
    .catalog-label { font-size: 13px; font-weight: 700; color: var(--off-black); }
    .catalog-meta { font-size: 11px; color: var(--gray-40); margin-top: 1px; line-height: 1.4; }
    .catalog-tag {
      display: inline-block; font-size: 9px; font-weight: 700;
      text-transform: uppercase; letter-spacing: 0.06em;
      padding: 1px 5px; background: rgba(101,70,243,0.1);
      color: var(--viola); border-radius: 2px; margin-top: 4px;
    }

    .sidebar-overlay {
      display: none; position: fixed; inset: 0;
      background: rgba(0,0,0,0.45); z-index: 140;
    }
    .sidebar-overlay.visible { display: block; }

    /* ─── VIEWER ──────────────────────────────────────────────────── */
    .viewer-area { flex: 1; display: flex; flex-direction: column; overflow: hidden; min-width: 0; }

    .viewer-toolbar {
      height: var(--toolbar-h); background: var(--white);
      border-bottom: 1px solid var(--gray-10);
      display: flex; align-items: center;
      padding: 0 12px; gap: 6px; flex-shrink: 0;
      overflow-x: auto; -webkit-overflow-scrolling: touch;
      scrollbar-width: none;
    }
    .viewer-toolbar::-webkit-scrollbar { display: none; }

    .toolbar-label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: var(--gray-40); white-space: nowrap; flex-shrink: 0; }
    /* Reperti sidebar toggle — only shown on mobile (see RESPONSIVE) */
    .menu-toggle {
      display: none; align-items: center; justify-content: center;
      width: 32px; height: 32px; background: transparent; border: none;
      border-radius: 4px; cursor: pointer; color: var(--off-black); flex-shrink: 0;
    }
    .menu-toggle:focus-visible { box-shadow: var(--focus-ring); }
    .layer-toggle {
      display: flex; align-items: center; gap: 5px;
      padding: 6px 10px; min-height: 36px; border-radius: 3px;
      border: 1.5px solid var(--gray-10); cursor: pointer;
      font-size: 11px; font-weight: 600; color: var(--gray-70);
      background: var(--white); white-space: nowrap; flex-shrink: 0;
      font-family: 'Manrope', sans-serif; transition: all 0.15s;
    }
    .layer-toggle:hover { border-color: var(--viola-lt); }
    .layer-toggle.active { background: var(--ossidiana); border-color: var(--ossidiana); color: var(--white); }
    .layer-toggle:focus-visible { box-shadow: var(--focus-ring); outline: none; }
    .layer-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
    .toolbar-sep { width: 1px; height: 22px; background: var(--gray-10); margin: 0 2px; flex-shrink: 0; }

    .viewer-btn {
      padding: 6px 10px; min-height: 36px; border-radius: 3px;
      border: 1.5px solid var(--gray-10); cursor: pointer;
      font-size: 11px; font-weight: 700; color: var(--gray-70);
      background: var(--white); font-family: 'Manrope', sans-serif;
      white-space: nowrap; flex-shrink: 0; transition: border-color 0.15s, color 0.15s;
    }
    .viewer-btn:hover { border-color: var(--viola); color: var(--viola); }
    .viewer-btn.on { border-color: var(--viola); color: var(--viola); background: rgba(101,70,243,0.06); }
    .viewer-btn:focus-visible { box-shadow: var(--focus-ring); outline: none; }

    #canvas-container {
      flex: 1; position: relative; background: var(--theme-viewer-bg);
      overflow: hidden; cursor: grab; touch-action: none;
    }
    #canvas-container:active { cursor: grabbing; }
    #three-canvas { display: block; width: 100%; height: 100%; }

    /* ─── LOADING ─────────────────────────────────────────────────── */
    .loading-overlay {
      position: absolute; inset: 0; background: rgba(26,22,48,0.96);
      display: flex; flex-direction: column;
      align-items: center; justify-content: center;
      gap: 14px; z-index: 10;
    }
    .loading-overlay.hidden { display: none; }
    .loader-ring {
      width: 40px; height: 40px; border: 3px solid rgba(165,145,250,0.2);
      border-top-color: var(--viola-lt); border-radius: 50%;
      animation: spin 0.8s linear infinite;
    }
    @keyframes spin { to { transform: rotate(360deg); } }
    .loading-text { font-size: 12px; font-weight: 600; color: var(--viola-lt); letter-spacing: 0.06em; }
    .loading-detail { font-size: 11px; color: rgba(164,145,250,0.5); text-align: center; padding: 0 16px; }
    .loading-progress { width: 180px; height: 2px; background: rgba(255,255,255,0.1); border-radius: 1px; overflow: hidden; }
    .loading-progress-bar { height: 100%; background: var(--viola); border-radius: 1px; width: 0%; transition: width 0.2s ease; }

    /* ─── EMPTY & ERROR ───────────────────────────────────────────── */
    .empty-state {
      position: absolute; inset: 0; display: flex; flex-direction: column;
      align-items: center; justify-content: center;
      gap: 16px; color: rgba(255,255,255,0.2); pointer-events: none;
    }
    .empty-state.hidden { display: none; }
    .empty-state p { font-size: 13px; font-weight: 500; text-align: center; padding: 0 24px; }
    .empty-state.is-error { color: rgba(255,120,100,0.7); }

    /* ─── HUD ─────────────────────────────────────────────────────── */
    .model-hud {
      position: absolute; top: 12px; right: 12px;
      background: rgba(39,30,82,0.9); backdrop-filter: blur(8px);
      border: 1px solid rgba(255,255,255,0.08); border-radius: 4px;
      padding: 8px 12px; pointer-events: none;
      min-width: 130px; max-width: calc(100% - 24px);
    }
    .model-hud.hidden { display: none; }
    .model-hud-title { font-size: 13px; font-weight: 700; color: var(--white); margin-bottom: 3px; }
    .model-hud-sub { font-size: 10px; color: rgba(164,145,250,0.7); }
    .model-hud-layers { margin-top: 8px; display: flex; flex-direction: column; gap: 3px; }
    .hud-layer-row { display: flex; align-items: center; gap: 6px; font-size: 10px; color: rgba(255,255,255,0.5); }
    .hud-layer-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
    .hud-layer-row.inactive { opacity: 0.3; }
    .camera-info { position: absolute; bottom: 10px; left: 10px; font-size: 10px; color: rgba(255,255,255,0.2); pointer-events: none; font-variant-numeric: tabular-nums; }
    .ecomic-watermark { position: absolute; bottom: 8px; right: 10px; opacity: 0.06; pointer-events: none; }

    /* ─── RIGHT PANEL ─────────────────────────────────────────────── */
    .right-panel {
      width: var(--panel-w); background: var(--white);
      border-left: 1px solid var(--gray-10);
      display: flex; flex-direction: column; flex-shrink: 0; overflow: hidden;
    }
    .panel-tabs { display: flex; border-bottom: 1px solid var(--gray-10); }
    .panel-tab {
      flex: 1; padding: 12px 8px; min-height: 44px;
      font-size: 11px; font-weight: 700; text-transform: uppercase;
      letter-spacing: 0.08em; text-align: center; cursor: pointer;
      color: var(--gray-40); border-bottom: 2px solid transparent;
      border: none; background: transparent; font-family: 'Manrope', sans-serif;
      transition: color 0.15s, border-color 0.15s;
    }
    .panel-tab[aria-selected="true"] { color: var(--viola); border-bottom: 2px solid var(--viola); }
    .panel-tab:focus-visible { box-shadow: inset var(--focus-ring); outline: none; }
    .panel-content { flex: 1; overflow-y: auto; }
    .panel-content[hidden] { display: none; }

    /* ─── METADATA ────────────────────────────────────────────────── */
    .meta-section { padding: 14px 14px 6px; }
    .meta-section-title { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: var(--viola); margin-bottom: 8px; display: flex; align-items: center; gap: 6px; }
    .meta-section-title::after { content: ''; flex: 1; height: 1px; background: rgba(101,70,243,0.15); }
    .meta-row { display: flex; gap: 8px; padding: 5px 0; border-bottom: 1px solid var(--gray-05); align-items: flex-start; }
    .meta-row:last-child { border-bottom: none; }
    .meta-key { font-size: 11px; font-weight: 600; color: var(--gray-40); width: 100px; flex-shrink: 0; padding-top: 1px; line-height: 1.4; }
    .meta-val { font-size: 11px; color: var(--off-black); flex: 1; line-height: 1.4; word-break: break-word; }
    .meta-val.hi { color: var(--viola); font-weight: 700; }

    /* ─── DXF PANEL ───────────────────────────────────────────────── */
    .dxf-panel { padding: 10px; display: flex; flex-direction: column; gap: 8px; }
    .dxf-info-box { padding: 10px 12px; background: rgba(101,70,243,0.06); border-left: 3px solid var(--viola-lt); font-size: 11px; color: var(--gray-70); line-height: 1.6; border-radius: 0 2px 2px 0; }
    .dxf-item { border: 1px solid var(--gray-10); border-radius: 4px; overflow: hidden; }
    .dxf-item-header { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px; background: var(--white); gap: 8px; }
    .dxf-item-label { font-size: 12px; font-weight: 700; color: var(--off-black); }
    .dxf-item-sub { font-size: 10px; color: var(--gray-40); margin-top: 1px; }
    .dxf-actions { display: flex; gap: 5px; flex-shrink: 0; }
    .dxf-btn {
      font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em;
      padding: 6px 8px; min-height: 32px; border-radius: 2px;
      border: 1.5px solid var(--viola); color: var(--viola); background: transparent;
      cursor: pointer; font-family: 'Manrope', sans-serif; transition: all 0.15s;
      text-decoration: none; display: inline-flex; align-items: center;
    }
    .dxf-btn:hover { background: var(--viola); color: var(--white); }
    .dxf-btn:focus-visible { box-shadow: var(--focus-ring); outline: none; }
    .dxf-viewer-wrap { border-top: 1px solid var(--gray-10); background: #0f0e1a; position: relative; }
    .dxf-viewer-wrap[hidden] { display: none; }
    .dxf-canvas { display: block; width: 100%; height: 180px; }
    .dxf-viewer-label { position: absolute; bottom: 5px; left: 8px; font-size: 9px; color: rgba(255,255,255,0.25); letter-spacing: 0.06em; text-transform: uppercase; pointer-events: none; }

    /* ─── BOTTOM NAV (mobile) ─────────────────────────────────────── */
    .bottom-nav { display: none; height: var(--bottom-nav-h); background: var(--white); border-top: 1px solid var(--gray-10); flex-shrink: 0; z-index: 100; }
    .bottom-nav-inner { display: flex; height: 100%; }
    .bottom-nav-btn {
      flex: 1; display: flex; flex-direction: column; align-items: center;
      justify-content: center; gap: 3px; border: none; background: transparent;
      cursor: pointer; font-family: 'Manrope', sans-serif;
      color: var(--gray-40); font-size: 9px; font-weight: 600;
      text-transform: uppercase; letter-spacing: 0.06em;
      border-top: 2px solid transparent; transition: color 0.15s, border-color 0.15s; min-height: 44px;
    }
    .bottom-nav-btn[aria-selected="true"] { color: var(--viola); border-top-color: var(--viola); }
    .bottom-nav-btn:focus-visible { box-shadow: inset var(--focus-ring); outline: none; }

    .mobile-sheet {
      position: fixed; bottom: var(--bottom-nav-h); left: 0; right: 0;
      height: 52dvh; background: var(--white);
      border-top: 1px solid var(--gray-10); border-radius: 12px 12px 0 0;
      z-index: 120; flex-direction: column; overflow: hidden;
      box-shadow: 0 -4px 24px rgba(0,0,0,0.12); display: none;
    }
    .mobile-sheet.visible { display: flex; }
    .mobile-sheet-handle { width: 36px; height: 4px; border-radius: 2px; background: var(--gray-10); margin: 10px auto 4px; flex-shrink: 0; }
    .mobile-sheet-title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--gray-40); padding: 0 16px 10px; flex-shrink: 0; }
    .mobile-sheet-content { flex: 1; overflow-y: auto; }

    /* ─── SCROLLBAR ───────────────────────────────────────────────── */
    ::-webkit-scrollbar { width: 4px; }
    ::-webkit-scrollbar-track { background: transparent; }
    ::-webkit-scrollbar-thumb { background: var(--gray-10); border-radius: 2px; }
    ::-webkit-scrollbar-thumb:hover { background: var(--gray-40); }
    .placeholder-msg { padding: 20px 16px; color: var(--gray-40); font-size: 12px; line-height: 1.7; }

    /* ─── RESPONSIVE ──────────────────────────────────────────────── */
    @media (max-width: 1023px) {
      .right-panel { display: none; }
      .header-nav { display: none; }
      .header-nav-toggle { display: inline-flex; }
    }
    @media (max-width: 767px) {
      /* Keeps the .view-catalog min-height calc (100dvh - var(--header-h))
         accurate at the mobile header height too. */
      :root { --header-h: 64px; }
      .menu-toggle { display: flex; }
      .site-header { padding: 0 16px; gap: 10px; }
      .header-app-divider { height: 32px; }
      .header-logo-img { height: 32px; }
      .header-app-subtitle { display: none; }
      .header-app-name { font-size: 13px; }
    }
    @media (max-width: 480px) {
      /* Not enough room for logo + app name + lang switch + icons — the
         logo alone still carries the brand. */
      .header-app-divider, .header-app-info { display: none; }
      .sidebar {
        position: fixed;
        top: var(--header-mobile-h, 64px);
        left: 0; bottom: 0;
        width: min(var(--sidebar-w), 85vw); transform: translateX(-100%);
        box-shadow: 4px 0 24px rgba(0,0,0,0.18);
      }
      .sidebar.open { transform: translateX(0); }
      .layer-toggle-label { display: none; }
      .layer-toggle { padding: 6px 8px; }
      .bottom-nav { display: flex; }
      .footer-top { flex-direction: column; align-items: flex-start; }
      .footer-logos { gap: 16px; }
      .footer-logo-img { height: 26px; }
      .prefooter-logo { height: 28px; }
    }
    @media (forced-colors: active) {
      .layer-toggle.active { border: 2px solid ButtonText; }
      .catalog-item.active { border-left-color: Highlight; }
    }
    @media (prefers-reduced-motion: reduce) {
      *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
      .loader-ring { animation: none; border-color: var(--viola-lt); }
      .api-status .spinner { animation: none; }
    }

/* ─── LANGUAGE SWITCHER ──────────────────────────────────────────── */
.lang-switcher {
  display: flex;
  gap: 2px;
  margin-right: 4px;
}
.lang-btn {
  font-family: 'Manrope', sans-serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 3px 7px;
  border-radius: 2px;
  border: 1px solid var(--gray-10);
  background: transparent;
  color: var(--gray-40);
  cursor: pointer;
  transition: all 0.15s;
  min-height: 24px;
}
.lang-btn:hover { border-color: var(--viola); color: var(--viola); }
.lang-btn.active { background: var(--viola); border-color: var(--viola); color: var(--white); }
.lang-btn:focus-visible { box-shadow: var(--focus-ring); outline: none; }

/* ─── SETTINGS BUTTON (viewer toolbar only) ────────────────────────── */
.settings-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; min-height: 36px; border-radius: 3px; border: 1.5px solid var(--gray-10);
  background: var(--white); color: var(--gray-70); cursor: pointer; transition: all 0.15s;
  flex-shrink: 0; margin-left: auto;
}
.settings-toggle:hover { border-color: var(--viola); color: var(--viola); }
.settings-toggle.active { background: var(--viola); border-color: var(--viola); color: var(--white); }
.settings-toggle:focus-visible { box-shadow: var(--focus-ring); outline: none; }

/* ─── SETTINGS PANEL ─────────────────────────────────────────────────
   Scoped to #canvas-container (position:relative) — the overlay/panel
   only cover the 3D viewer, never the sidebar, header or footer. */
.settings-overlay {
  position: absolute; inset: 0; background: rgba(30,30,30,0.45);
  z-index: 20;
}
.settings-panel {
  position: absolute; top: 0; right: 0; bottom: 0;
  width: 320px; max-width: 92%;
  background: var(--white);
  box-shadow: -4px 0 24px rgba(0,0,0,0.15);
  z-index: 21;
  display: flex; flex-direction: column;
  transform: translateX(0);
}
.settings-panel[hidden], .settings-overlay[hidden] { display: none; }

.settings-panel-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 20px; border-bottom: 1px solid var(--gray-10); flex-shrink: 0;
}
.settings-panel-title { font-size: 16px; font-weight: 700; color: var(--ossidiana); }
.settings-close {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 4px; border: none;
  background: transparent; color: var(--gray-40); cursor: pointer;
}
.settings-close:hover { color: var(--viola); }
.settings-close:focus-visible { box-shadow: var(--focus-ring); outline: none; }

.settings-panel-body { flex: 1; overflow-y: auto; padding: 20px; }

.settings-section { margin-bottom: 28px; }
.settings-section:last-child { margin-bottom: 0; }
.settings-section-title-row {
  display: flex; align-items: baseline; justify-content: space-between; gap: 8px;
}
.settings-section-title {
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--gray-40); margin-bottom: 10px;
}
.settings-section-hint { font-size: 12px; color: var(--gray-40); margin: -4px 0 12px; }
.settings-reset-all {
  font-size: 11px; font-weight: 600; color: var(--viola); background: none; border: none;
  cursor: pointer; padding: 0; text-decoration: underline;
}
.settings-reset-all:hover { color: var(--viola-dark); }
.settings-reset-all:focus-visible { box-shadow: var(--focus-ring); outline: none; border-radius: 2px; }

.settings-layer-colors { display: flex; flex-direction: column; gap: 10px; }
.settings-layer-color-row {
  display: flex; align-items: center; gap: 10px;
}
.settings-layer-color-label {
  flex: 1; font-size: 13px; font-weight: 600; color: var(--off-black);
}
.settings-layer-color-input {
  -webkit-appearance: none; appearance: none;
  width: 30px; height: 30px; border: 1.5px solid var(--gray-10); border-radius: 6px;
  padding: 0; cursor: pointer; background: none;
}
.settings-layer-color-input::-webkit-color-swatch-wrapper { padding: 2px; }
.settings-layer-color-input::-webkit-color-swatch { border: none; border-radius: 4px; }
.settings-layer-color-reset {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: 4px; border: none;
  background: transparent; color: var(--gray-40); cursor: pointer;
}
.settings-layer-color-reset:hover { color: var(--viola); }
.settings-layer-color-reset:focus-visible { box-shadow: var(--focus-ring); outline: none; }

.settings-apply-colors {
  margin-top: 12px; width: 100%;
  font-family: 'Manrope', sans-serif; font-size: 12.5px; font-weight: 700;
  color: var(--white); background: var(--viola); border: none; border-radius: 5px;
  padding: 9px 0; cursor: pointer; transition: background 0.15s;
}
.settings-apply-colors:hover { background: var(--viola-dark); }
.settings-apply-colors:focus-visible { box-shadow: var(--focus-ring); outline: none; }

/* ═══════════════════════════════════════════════════════════════════════
   HOME — hero banner + "come funziona"
   ═══════════════════════════════════════════════════════════════════ */
.view-home { background: var(--white); }

.hero-banner { background: var(--ossidiana); padding: 48px 24px 40px; }
.hero-banner-grid {
  max-width: var(--container-w); margin: 0 auto;
  display: grid; grid-template-columns: repeat(12, 1fr);
  gap: 32px; align-items: center;
}
.hero-text { grid-column: span 8; }
.hero-title {
  font-size: clamp(22px, 3vw, 34px); font-weight: 800; color: var(--white);
  line-height: 1.25; letter-spacing: -0.01em; margin-bottom: 14px;
}
.hero-subtitle { font-size: 14px; color: rgba(255,255,255,0.7); line-height: 1.7; max-width: 62ch; }
.hero-cover { grid-column: span 4; }
.hero-cover-img {
  display: block; width: 100%; height: auto; border-radius: 8px;
  box-shadow: 0 12px 32px rgba(0,0,0,0.35);
}
.hero-cta-row { display: flex; justify-content: center; margin-top: 36px; }
.hero-cta-btn {
  font-family: 'Manrope', sans-serif; font-size: 14px; font-weight: 700;
  color: var(--white); background: var(--viola); border: none;
  padding: 13px 30px; border-radius: 6px; cursor: pointer;
  transition: background 0.15s, transform 0.15s;
}
.hero-cta-btn:hover { background: var(--viola-dark); }
.hero-cta-btn:active { transform: translateY(1px); }
.hero-cta-btn:focus-visible { box-shadow: var(--focus-ring); outline: none; }

.how-it-works { max-width: var(--container-w); margin: 0 auto; padding: 44px 24px 56px; width: 100%; }
.how-it-works-title {
  font-size: 20px; font-weight: 800; color: var(--ossidiana);
  text-align: center; margin-bottom: 32px;
}
.how-it-works-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px;
}
.how-card { text-align: center; padding: 0 12px; }
.how-icon {
  width: 56px; height: 56px; margin: 0 auto 16px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%; background: rgba(101,70,243,0.08); color: var(--viola);
}
.how-card-title { font-size: 14.5px; font-weight: 700; color: var(--off-black); margin-bottom: 6px; }
.how-card-sub { font-size: 12.5px; color: var(--gray-40); line-height: 1.6; }

@media (max-width: 900px) {
  .hero-text, .hero-cover { grid-column: span 12; }
  .hero-cover { order: -1; max-width: 280px; margin: 0 auto; }
  .how-it-works-grid { grid-template-columns: 1fr; gap: 32px; }
}

/* ═══════════════════════════════════════════════════════════════════════
   VIEW PLACEHOLDER — Termini e condizioni / Policy (non ancora redatti)
   ═══════════════════════════════════════════════════════════════════ */
.view-placeholder {
  align-items: center; justify-content: center; text-align: center;
  gap: 8px; padding: 40px 24px; background: var(--white);
}
.view-placeholder-title { font-size: 20px; font-weight: 800; color: var(--ossidiana); }
.view-placeholder-text { font-size: 13px; color: var(--gray-40); max-width: 42ch; }

/* ═══════════════════════════════════════════════════════════════════════
   CONTENT PAGES — Progetto / Tutorial / Crediti
   ═══════════════════════════════════════════════════════════════════ */
.content-view { background: var(--white); }
.content-page { max-width: var(--container-w); margin: 0 auto; padding: 48px 24px 64px; width: 100%; }
.content-eyebrow { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: var(--viola); margin-bottom: 8px; }
.content-title { font-size: 26px; font-weight: 800; color: var(--ossidiana); letter-spacing: -0.01em; margin-bottom: 6px; }
.content-meta { font-size: 12px; color: var(--gray-40); margin-bottom: 20px; }
.content-intro { font-size: 15px; color: var(--gray-70); line-height: 1.7; margin: 14px 0 8px; }
.content-note { font-size: 12px; color: var(--gray-40); margin-top: 28px; padding-top: 16px; border-top: 1px solid var(--gray-10); }

.content-section { margin-top: 32px; }
.content-section h2 { font-size: 16px; font-weight: 700; color: var(--ossidiana); margin-bottom: 10px; }
.content-section h3 { font-size: 13.5px; font-weight: 700; color: var(--off-black); margin-bottom: 4px; }
.content-section p { font-size: 13.5px; color: var(--gray-70); line-height: 1.75; margin-bottom: 12px; }
.content-section p:last-child { margin-bottom: 0; }

.content-arch-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 16px; }
.content-arch-card { padding: 16px; border: 1px solid var(--gray-10); border-radius: 6px; background: var(--gray-05); }
.content-arch-card p { margin-bottom: 0; }

.content-steps-title { font-size: 16px; font-weight: 700; color: var(--ossidiana); margin: 8px 0 18px; }
.content-steps { list-style: none; display: flex; flex-direction: column; }
.content-step { display: flex; gap: 16px; padding: 18px 0; border-top: 1px solid var(--gray-10); }
.content-step:first-child { border-top: none; }
.content-step-num {
  flex-shrink: 0; width: 28px; height: 28px; border-radius: 50%;
  background: rgba(101,70,243,0.1); color: var(--viola);
  display: flex; align-items: center; justify-content: center;
  font-size: 12.5px; font-weight: 800;
}
.content-step h3 { font-size: 14px; font-weight: 700; color: var(--off-black); margin-bottom: 4px; }
.content-step p { font-size: 13px; color: var(--gray-70); line-height: 1.65; margin: 0; }

@media (max-width: 640px) {
  .content-arch-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .settings-panel { width: 100%; max-width: 100%; }
}
