/* Tilely Cockpit shell (redesign 2026-11-01, prototype _previews/cockpit-redesign/menu.html):
   one top bar with mark, venue, the visible sections, language and account. Colours come
   from the tokens in tilely-theme.css, so dark and light follow automatically. */

.tl-body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--text); }
.tl-shell { min-height: 100vh; display: flex; flex-direction: column; }

.tl-top {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 8px;
  height: 60px; padding: 0 18px;
  background: var(--bg); border-bottom: 1px solid var(--border);
}
.tl-brand { display: inline-flex; align-items: center; color: var(--text); text-decoration: none; margin-right: 2px; border-radius: 10px; }
.tl-brand .tilely-mark svg { width: 32px; height: 32px; }
.tl-sp { flex: 1; min-width: 0; }

.tl-ic { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tl-ic-sm { width: 15px; height: 15px; color: var(--text-3); }

/* <details> popovers: no JS needed to open; tilely-shell.js closes the others. */
.tl-pop { position: relative; }
.tl-pop > summary { list-style: none; cursor: pointer; }
/* a closed popover takes no room (it must never widen the page on a narrow phone) */
.tl-pop:not([open]) > .tl-pop-menu { display: none; }
.tl-pop > summary::-webkit-details-marker { display: none; }

.tl-venue-btn {
  display: flex; align-items: center; gap: 8px; min-width: 0; max-width: 260px;
  min-height: 44px; padding: 0 10px; border-radius: 10px;
  font: 700 0.9375rem/1 var(--font-display); letter-spacing: -0.015em; color: var(--text);
}
.tl-venue-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tl-venue-btn:hover, .tl-venue[open] .tl-venue-btn { background: var(--bg-3); }

.tl-nav { display: flex; gap: 4px; margin-left: 6px; min-width: 0; }
.tl-nav-item {
  display: inline-flex; align-items: center; min-height: 40px; padding: 0 12px; border-radius: 10px;
  font: 600 0.875rem/1 var(--font-display); color: var(--text-2); text-decoration: none; white-space: nowrap;
}
.tl-nav-item:hover { color: var(--text); background: var(--bg-3); }
.tl-nav-item.on { color: var(--text); background: var(--bg-3); }

.tl-iconbtn, .tl-langbtn, .tl-avatar {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-width: 44px; min-height: 44px; border: 0; border-radius: 12px;
  background: none; color: var(--text-2); font: 600 0.8125rem/1 var(--font-display);
}
.tl-langbtn { padding: 0 10px; }
.tl-iconbtn:hover, .tl-langbtn:hover, .tl-pop[open] > .tl-iconbtn, .tl-pop[open] > .tl-langbtn { background: var(--bg-3); color: var(--text); }
/* 36px tile drawn inside a 44px touch target */
.tl-avatar { position: relative; z-index: 0; padding: 0; color: var(--text); font-weight: 800; letter-spacing: -0.03em; }
.tl-avatar::before { content: ""; position: absolute; inset: 4px; z-index: -1; border-radius: 22%; background: var(--bg-3); }
.tl-avatar:hover::before, .tl-pop[open] > .tl-avatar::before { background: var(--bg-4); }

/* the old global guide launcher sits in the bar as a quiet icon */
.tl-top .ai-guide-toggle { width: 44px; height: 44px; }
.tl-top .ai-guide-toggle[hidden] { display: none; }

.tl-pop-menu {
  position: absolute; top: calc(100% + 8px); z-index: 50;
  min-width: 200px; max-width: min(320px, calc(100vw - 24px));
  max-height: min(70vh, 560px); overflow: auto;
  padding: 6px; border-radius: 14px;
  background: var(--bg-2); border: 1px solid var(--border); box-shadow: var(--shadow-soft);
}
.tl-pop-left { left: 0; }
.tl-pop-right { right: 0; }
.tl-pop-wide { min-width: 240px; }
.tl-pop-menu hr { border: 0; border-top: 1px solid var(--border); margin: 6px 4px; }
.tl-pop-menu form { margin: 0; }
.tl-pop-label, .tl-pop-group { display: block; padding: 10px 12px 6px; font-size: 0.75rem; color: var(--text-2); }
.tl-pop-group { padding-top: 12px; font-weight: 600; }
.tl-pop-item {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  width: 100%; min-height: 44px; padding: 8px 12px; border: 0; border-radius: 9px;
  background: none; color: var(--text); font: 400 0.875rem/1.3 var(--font-body, inherit);
  text-align: left; text-decoration: none; cursor: pointer;
}
.tl-pop-item:hover { background: var(--bg-3); }
.tl-pop-item.cur { font-weight: 600; }
.tl-pop-item[disabled] { cursor: default; opacity: 1; }
.tl-pop-item span { display: grid; gap: 2px; min-width: 0; }
.tl-pop-item strong { font: 700 0.875rem/1.2 var(--font-display); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tl-pop-item small { color: var(--text-2); font-size: 0.75rem; }
.tl-check { color: var(--text-2); }
.tl-acct-head { display: grid; gap: 3px; padding: 10px 12px 6px; }
.tl-acct-head strong { font: 700 0.875rem/1.2 var(--font-display); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tl-acct-head small { color: var(--text-2); font-size: 0.75rem; }

.tl-top :focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.tl-main { flex: 1; width: 100%; min-width: 0; }
/* app.css gives the old pages html/body height 100%, a striped gradient on html and a
   padded, scrolling .main-content. On the new pages the solid background must cover the
   whole page (no bands below the first screen) and the menu sets its own side margins,
   so the content lines up with the bar instead of sitting twice as far in. */
html:has(body.tl-body), html:has(body.tl-auth) { height: auto; background: var(--bg); }
body.tl-body, body.tl-auth { height: auto; }
.tl-main.main-content { overflow: visible; }
.tl-main:has(> .tm) { padding: 0; }

/* Phone: the bar stays one line; long venue names shorten, the section links scroll. */
/* Side menu (owner 13/11: «un burger menu a sinistra», NAVIGAZIONE.md «CAMBIO del 13/11»).
   Phone: three lines at the top left open it from the left over a dim veil. Computer (56rem+):
   always open on the left, 16rem wide, no burger and no top bar. */
.tl-burger { flex: none; width: 2.75rem; height: 2.75rem; margin-left: -0.375rem; border: 0; background: none; border-radius: 0.75rem;
  display: grid; place-items: center; color: var(--text); cursor: pointer; }
.tl-burger svg { width: 1.5rem; height: 1.5rem; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; }
.tl-burger:hover, .tl-burger:active { background: var(--bg-3); }
.tl-side { position: fixed; z-index: 45; left: 0; top: 0; bottom: 0; width: min(84vw, 19rem); box-sizing: border-box;
  display: flex; flex-direction: column; background: var(--bg-2); border-right: 1px solid var(--border);
  padding: calc(0.75rem + env(safe-area-inset-top, 0px)) 0.75rem calc(0.75rem + env(safe-area-inset-bottom, 0px)) max(0.75rem, env(safe-area-inset-left, 0px));
  transform: translateX(-104%); visibility: hidden; transition: transform 0.3s cubic-bezier(.22, 1, .36, 1), visibility 0s linear 0.3s; overflow-y: auto; }
body.tl-side-open .tl-side { transform: none; visibility: visible; transition: transform 0.3s cubic-bezier(.22, 1, .36, 1); }
.tl-side-scrim { position: fixed; inset: 0; z-index: 44; background: rgba(0, 0, 0, 0.5); }
.tl-side-scrim[hidden] { display: none; }
.tl-side-head { display: flex; align-items: center; gap: 0.625rem; min-height: 2.75rem; padding: 0 0.25rem; }
.tl-side-head .tl-brand .tilely-mark svg { width: 2rem; height: 2rem; }
.tl-side-title { font: 800 1.0625rem var(--font-display); letter-spacing: -0.02em; color: var(--text); }
.tl-side-x { margin-left: auto; width: 2.75rem; height: 2.75rem; margin-right: -0.5rem; border: 0; background: none; border-radius: 0.75rem; color: var(--text-2);
  display: grid; place-items: center; cursor: pointer; }
.tl-side-x svg { width: 1.25rem; height: 1.25rem; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; }
.tl-side-venue { display: flex; align-items: center; gap: 0.5rem; min-height: 3.5rem; margin-top: 0.5rem; padding: 0.5rem 0.75rem; border: 1px solid var(--border);
  border-radius: 1rem; background: var(--bg); color: var(--text); text-decoration: none; }
.tl-side-venue:hover { text-decoration: none; border-color: var(--border-strong); }
.tl-side-venue-tx { flex: 1; min-width: 0; }
.tl-side-venue strong { display: block; font: 700 1rem/1.2 var(--font-display); letter-spacing: -0.015em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tl-side-venue small { display: block; color: var(--text-2); font-size: 0.8125rem; }
.tl-side-nav { display: grid; gap: 0.25rem; margin-top: 0.875rem; }
.tl-side-nav a { display: flex; align-items: center; gap: 0.875rem; min-height: 3.25rem; padding: 0 0.875rem; border-radius: 0.875rem; color: var(--text-2);
  text-decoration: none; font: 700 1.0625rem var(--font-display); letter-spacing: -0.015em; }
.tl-side-nav a:hover { text-decoration: none; color: var(--text); background: var(--bg-3); }
.tl-side-nav a[aria-current="page"] { background: var(--accent); color: var(--accent-fg); }
.tl-side-ic { width: 1.375rem; height: 1.375rem; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.tl-side-foot { margin-top: auto; padding-top: 0.75rem; display: grid; gap: 0.25rem; border-top: 1px solid var(--border); }
.tl-side-foot form { margin: 0; }
.tl-side-foot button, .tl-side-lang > summary { display: flex; align-items: center; gap: 0.875rem; width: 100%; min-height: 3rem; padding: 0 0.875rem; border: 0;
  background: none; border-radius: 0.875rem; color: var(--text-2); font: 600 0.9375rem var(--font-display); text-align: left; cursor: pointer; list-style: none; box-sizing: border-box; }
.tl-side-lang > summary::-webkit-details-marker { display: none; }
.tl-side-foot button .tl-side-ic, .tl-side-lang > summary .tl-side-ic { width: 1.25rem; height: 1.25rem; }
.tl-side-lang > summary small { margin-left: auto; font-weight: 600; }
.tl-side-foot button:hover, .tl-side-lang > summary:hover { background: var(--bg-3); color: var(--text); }
.tl-side-langs { display: grid; gap: 0.125rem; padding: 0.25rem 0 0.25rem 2.25rem; }
.tl-side-langs a { display: flex; align-items: center; min-height: 2.75rem; padding: 0 0.75rem; border-radius: 0.75rem; color: var(--text); text-decoration: none; font-weight: 600; }
.tl-side-langs a small { margin-left: auto; color: var(--text-2); font-size: 0.75rem; }
.tl-side-langs a[aria-current="true"] { background: var(--bg-3); }
.tl-side a:focus-visible, .tl-side button:focus-visible, .tl-side summary:focus-visible, .tl-burger:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
@media (min-width: 56rem) {
  .tl-side { transform: none; visibility: visible; width: 16rem; z-index: 25; transition: none; }
  .tl-side-scrim, .tl-burger, .tl-side-x { display: none; }
  .tl-top:not(.tl-top-keep) { display: none; }
  .tl-top.tl-top-keep { margin-left: 16rem; }
  .tl-main.has-side { margin-left: 16rem; width: auto; }
}
@media (prefers-reduced-motion: reduce) { .tl-side, body.tl-side-open .tl-side { transition: none; } }

@media (max-width: 640px) {
  .tl-top { padding: 0 8px; gap: 2px; }
  .tl-brand .tilely-mark svg { width: 28px; height: 28px; }
  .tl-venue { flex: 0 1 auto; min-width: 0; }
  .tl-venue-btn { max-width: 100%; padding: 0 6px; font-size: 0.875rem; }
  /* the section link is never cut: the venue name shortens instead */
  .tl-nav { flex: none; margin-left: 0; }
  .tl-nav::-webkit-scrollbar { display: none; }
  .tl-nav-item { padding: 0 8px; }
  .tl-langbtn { padding: 0 6px; }
  .tl-langbtn span { display: none; }
  .tl-top .ai-guide-toggle { display: none; }
  .tl-pop-menu { position: fixed; top: 64px; left: 8px; right: 8px; max-width: none; }
}

@media (prefers-reduced-motion: reduce) {
  .tl-top *, .tl-top *::before, .tl-top *::after { transition-duration: .001ms !important; animation-duration: .001ms !important; }
}
