:root {
  --bg: #FFFFFF;
  --surface: #FFFFFF;
  --text: #25212B;
  --muted: #68616E;
  --accent: #3B1E54;
  --accent-hover: #4B2869;
  --select: #EEE7F3;
  --border: #DDD7E1;
  --shadow: 0 1px 2px rgba(37, 33, 43, .06), 0 8px 24px rgba(37, 33, 43, .08);
  --radius: 14px;
  --serif: "Fraunces", Georgia, serif;
  --sans: "Instrument Sans", system-ui, -apple-system, sans-serif;
  --gutter: clamp(16px, 4vw, 56px);
  --card-ratio: 63 / 88;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
}
html.locked, html.locked body { overflow: hidden; }
img { display: block; max-width: 100%; }
a { color: var(--accent); }
button, select, input { font: inherit; color: inherit; touch-action: manipulation; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 8px 12px; z-index: 50; }
.skip:focus { left: 8px; }

/* ---------- testata ---------- */
.topbar {
  display: flex; align-items: center; gap: 32px;
  padding: 22px var(--gutter);
}
.brand { display: flex; align-items: center; gap: 18px; text-decoration: none; color: var(--accent); }
.brand-name { font: 500 clamp(26px, 3.4vw, 40px)/1 var(--serif); letter-spacing: -.02em; white-space: nowrap; }
.brand-sub {
  border-left: 1px solid var(--border); padding-left: 16px;
  font-size: 10px; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); line-height: 1.5;
}
.topnav { display: flex; gap: 24px; }
.langswitch { display: flex; gap: 4px; }
.header-search { margin-left: auto; width: min(290px, 30vw); }
.langswitch a {
  font-size: 13px; text-decoration: none; color: var(--muted); padding: 6px 10px; border-radius: 999px;
  min-width: 40px; text-align: center;
}
.langswitch a[aria-current="true"] { background: var(--select); color: var(--accent); font-weight: 600; }
.langswitch a:hover { color: var(--accent); }
.topnav a {
  font-size: 13px; letter-spacing: .14em; text-transform: uppercase; text-decoration: none;
  color: var(--text); padding: 6px 0; border-bottom: 2px solid transparent;
}
.topnav a[aria-current="page"] { color: var(--accent); border-color: var(--accent); font-weight: 600; }

main { padding: 0 var(--gutter) 64px; min-height: 60vh; }
main:focus { outline: none; }

/* ---------- controlli ---------- */
.search {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 999px;
  padding: 0 16px; height: 44px; min-width: 0;
}
.search svg { width: 18px; height: 18px; stroke: var(--text); fill: none; stroke-width: 1.8; flex: none; }
.search input { border: 0; background: transparent; outline: none; width: 100%; min-width: 0; font-size: 15px; }
.search:focus-within { border-color: var(--accent); }
.header-search { position: relative; }
.sugg {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 30; background: var(--surface);
  border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 12px 32px rgba(37,33,43,.14); padding: 6px; display: flex; flex-direction: column;
}
.sugg[hidden] { display: none; }
.sugg-head { margin: 4px 10px 4px; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.sugg a { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 8px 10px; border-radius: 8px; color: var(--text); text-decoration: none; font-size: 15px; }
.sugg a small { color: var(--muted); font-size: 12px; white-space: nowrap; }
.sugg a:hover, .sugg a:focus-visible { background: var(--select); color: var(--accent); outline: none; }
.pokemon-head h1 .alt-names { display: block; font: 400 clamp(16px, 1.6vw, 20px)/1.3 var(--sans); color: var(--muted); letter-spacing: 0; margin-top: 6px; }
a.work-card { display: block; }
.work.spot .work-card img { outline: 3px solid var(--accent); outline-offset: 4px; border-radius: 12px; animation: spot 1.2s ease-in-out 2; }
@keyframes spot { 50% { outline-color: transparent; } }
.select-wrap { display: inline-flex; align-items: center; gap: 10px; font-size: 14px; color: var(--muted); }
.select-wrap select {
  appearance: none; -webkit-appearance: none;
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%2325212B' stroke-width='1.6'/%3E%3C/svg%3E") no-repeat right 14px center;
  border: 1px solid var(--border); border-radius: 10px;
  padding: 0 40px 0 14px; height: 44px; color: var(--text); cursor: pointer; max-width: 100%;
}
.select-wrap.small select { height: 38px; font-size: 14px; }
.v-langrow .select-wrap select { width: 172px; text-overflow: ellipsis; }
.v-langrow .select-wrap { flex: none; }
a.portrait { text-decoration: none; transition: box-shadow .2s; }
a.portrait:hover { box-shadow: 0 0 0 2px var(--accent); }
.select-wrap select:hover { border-color: var(--accent); }
.icon-btn {
  display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface); cursor: pointer; flex: none;
}
.icon-btn svg { width: 20px; height: 20px; stroke: var(--text); fill: none; stroke-width: 1.6; }
.icon-btn:hover:not(:disabled) { border-color: var(--accent); }
.icon-btn:disabled { opacity: .35; cursor: default; }
.btn-primary {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  background: var(--accent); color: #fff; text-decoration: none;
  border-radius: 12px; height: 48px; padding: 0 22px; font: 500 16px var(--serif);
}
.btn-primary:hover { background: var(--accent-hover); }
.btn-text {
  border: 0; background: none; color: var(--accent); cursor: pointer; padding: 6px 0;
  text-decoration: underline; text-underline-offset: 4px;
}
.link-arrow {
  font: 500 16px var(--serif); color: var(--accent); text-decoration: none;
  border-bottom: 1px solid currentColor; padding-bottom: 2px; display: inline-flex; gap: 8px;
}
.link-arrow:hover { color: var(--accent-hover); }

/* ---------- home ---------- */
.home-head {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap;
  margin: 12px 0 36px;
}
.home-head h1 { font: 500 clamp(40px, 5.4vw, 82px)/1.02 var(--serif); letter-spacing: -.02em; margin: 0; text-wrap: balance; }
:lang(ja) .home-head h1 { font-size: clamp(30px, 5vw, 54px); line-height: 1.25; letter-spacing: 0; word-break: keep-all; }
.home-head p { margin: 8px 0 0; color: var(--muted); font-size: clamp(16px, 1.6vw, 19px); }
.home-tools { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }

.artist-grid {
  display: grid; gap: 48px 36px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
@media (max-width: 1150px) { .artist-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.tile { display: flex; flex-direction: column; gap: 10px; }
/* pulsante «Apri galleria» sempre in fondo: allineato anche se il nome va a capo */
.tile-meta { flex: 1; }
.tile-meta > div { display: flex; flex-direction: column; align-items: flex-start; height: 100%; }
.tile-meta .btn-cta { margin-top: auto; }
.more-artists { display: flex; justify-content: center; margin: 40px 0 8px; }
.more-artists .btn-text { font-size: 16px; }
.tile-card {
  position: relative; border: 0; padding: 0; background: none; cursor: pointer;
  aspect-ratio: var(--card-ratio); border-radius: 12px;
}
.tile-card img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain;
  border-radius: 12px; box-shadow: var(--shadow);
  transition: opacity .9s ease, transform .25s ease;
}
.tile-card img.out { opacity: 0; }
.tile-card:hover img:not(.out) { transform: translateY(-3px); }
.tile-card .hint {
  position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%);
  background: rgba(37, 33, 43, .78); color: #fff; font-size: 13px; padding: 6px 12px; border-radius: 999px;
  opacity: 0; transition: opacity .2s; pointer-events: none; white-space: nowrap;
}
.tile-card:hover .hint, .tile-card:focus-visible .hint { opacity: 1; }
.dots { display: flex; gap: 6px; justify-content: center; min-height: 6px; }
.dots span { width: 6px; height: 6px; border-radius: 50%; background: var(--border); }
.dots span.on { background: var(--accent); }
.tile-meta {
  display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 16px; align-items: center;
}
.tile-meta .portrait { width: 76px; height: 76px; font-size: 26px; }
.tile-meta .portrait { box-shadow: 0 0 0 1px var(--border); }
.portrait {
  width: 72px; height: 72px; border-radius: 50%; flex: none; overflow: hidden;
  display: grid; place-items: center; background: #EFECE7; color: var(--accent);
  font: 500 22px var(--serif);
}
.portrait img { width: 100%; height: 100%; object-fit: cover; }
.tile-name {
  font: 500 clamp(22px, 1.75vw, 28px)/1.12 var(--serif); letter-spacing: -.01em; margin: 0;
  text-wrap: balance; overflow-wrap: anywhere;
}
.tile-name a { color: inherit; text-decoration: none; }
.tile-name a:hover { color: var(--accent); }
.tile-count { margin: 4px 0 6px; font-size: 14px; color: var(--muted); }
.tile .link-arrow { font-size: 15px; }
.empty { padding: 48px 0; text-align: center; color: var(--muted); }
.notice {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 45;
  max-width: calc(100vw - 32px); padding: 10px 16px; border-radius: 10px;
  background: var(--accent); color: #fff; box-shadow: var(--shadow); font-size: 14px;
}
.empty .btn-text { margin-top: 8px; }

/* ---------- pagina artista ---------- */
.crumbs { font-size: 15px; color: var(--muted); margin: 0 0 22px; }
.crumbs a { color: var(--muted); }
.profile {
  display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 32px 40px; align-items: center;
  padding-bottom: 32px; border-bottom: 1px solid var(--border);
}
.profile-id { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 32px; align-items: center; }
.profile .portrait { width: 150px; height: 150px; font-size: 52px; box-shadow: 0 0 0 1px var(--border); }
.profile h1 { font: 500 clamp(40px, 5vw, 72px)/1.02 var(--serif); letter-spacing: -.02em; margin: 0; }
.bio-src { margin: -14px 0 18px; font-size: 13px; color: var(--muted); }
.bio-src a, .stats .links a { color: var(--accent); }
.profile .lede { margin: 8px 0 22px; color: var(--muted); font-size: clamp(17px, 1.5vw, 21px); }
.stats { display: flex; flex-wrap: wrap; gap: 12px 0; margin: 0; }   /* va a capo invece di uscire dalla colonna */
.stats div { padding: 0 22px; border-left: 1px solid var(--border); white-space: nowrap; }
.stats div:first-child { padding-left: 0; border-left: 0; }
.stats dt { font-size: 14px; color: var(--muted); }
.stats dd { margin: 4px 0 0; font-size: 18px; }
.subjects { border-left: 1px solid var(--border); padding-left: 32px; align-self: stretch; display: flex; flex-direction: column; justify-content: center; }
.subjects h2 { font: 500 17px var(--sans); margin: 0 0 14px; }
.subj-pills { display: flex; flex-wrap: wrap; gap: 10px; }
.subj-pill {
  display: inline-flex; align-items: center; gap: 12px; cursor: pointer;
  border: 1px solid var(--border); background: var(--surface); border-radius: 999px;
  padding: 5px 14px 5px 5px; font-size: 15px; min-height: 52px; white-space: nowrap;
}
.subj-pill:hover { border-color: var(--accent); }
.subj-pill[aria-pressed="true"] { background: var(--select); border-color: var(--accent); color: var(--accent); }
.subj-pill .arr { margin-left: 4px; }
.subj-thumb {
  width: 40px; height: 40px; border-radius: 50%; flex: none;
  background-size: 260%; background-position: 50% 28%; background-color: #F2EFEA;
}
.subj-thumb.more { display: grid; place-items: center; color: var(--accent); font: 500 22px var(--serif); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid var(--border); background: var(--surface); border-radius: 999px;
  padding: 6px 14px; cursor: pointer; font-size: 14px;
}
.chip:hover { border-color: var(--accent); }

.toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin: 26px 0 12px; }
.filters { display: flex; flex-wrap: wrap; gap: 12px; }
.ctl {
  display: inline-flex; align-items: stretch; height: 46px; border: 1px solid var(--border); border-radius: 10px;
  background: var(--surface); overflow: hidden;
}
.ctl:focus-within { border-color: var(--accent); }
.ctl-label { display: flex; align-items: center; padding: 0 14px; color: var(--muted); font-size: 14px; border-right: 1px solid var(--border); white-space: nowrap; }
.ctl select {
  appearance: none; -webkit-appearance: none; border: 0; outline: none; cursor: pointer; font-size: 15px;
  padding: 0 38px 0 14px; max-width: 220px;
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%2325212B' stroke-width='1.6'/%3E%3C/svg%3E") no-repeat right 14px center;
}
.filters-toggle { display: none; }
.active-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 22px; min-height: 32px; }
.result-count { font-size: 14px; color: var(--muted); margin-right: 8px; }
.active-chip {
  display: inline-flex; align-items: center; gap: 6px; background: var(--select); color: var(--accent);
  border: 0; border-radius: 999px; padding: 5px 12px; cursor: pointer; font-size: 14px;
}
.active-chip span { font-size: 16px; line-height: 1; }

.work-grid {
  display: grid; gap: 36px 28px;
  grid-template-columns: repeat(5, minmax(0, 1fr));
}
@media (max-width: 1150px) { .work-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 900px) { .work-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 1100px) {
  .profile { grid-template-columns: 1fr; }
  .subjects { border-left: 0; padding-left: 0; }
}
.work { display: flex; flex-direction: column; gap: 10px; text-align: center; }
.work-card {
  border: 0; padding: 0; background: none; cursor: pointer; aspect-ratio: var(--card-ratio); position: relative;
}
.work-card img {
  width: 100%; height: 100%; object-fit: contain; border-radius: 10px; box-shadow: var(--shadow);
  background: #F2EFEA; transition: transform .2s ease;
}
.work-card:hover img { transform: translateY(-3px); }
.ph {
  position: absolute; inset: 0; display: grid; place-items: center; padding: 16px; text-align: center;
  border: 1px dashed var(--border); border-radius: 10px; color: var(--muted); font-size: 14px; background: var(--surface);
}
.work-name { font: 500 20px/1.2 var(--serif); margin: 4px 0 0; }
.work-sub { font-size: 13px; color: var(--muted); margin: 0; }
/* didascalia della tessera: nome a sinistra, anno a destra, filo sopra (scelta di Matteo, 28/10) */
.work-grid .work { text-align: left; }
.work-cap { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; border-top: 1px solid var(--border); padding-top: 8px; }
.work-cap .work-name { font: 500 18px/1.25 var(--serif); margin: 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.work-cap span { font-size: 14px; color: var(--muted); flex: none; font-variant-numeric: tabular-nums; }
@media (max-width: 900px) {
  .work-cap { align-items: flex-start; }
  .work-cap .work-name { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; font-size: 16px; }
}
.lang-tag {
  position: absolute; top: 8px; right: 8px; background: rgba(255, 253, 248, .92); color: var(--text);
  font-size: 11px; border-radius: 6px; padding: 2px 6px; box-shadow: 0 1px 3px rgba(0,0,0,.12);
}

/* ---------- popup ---------- */
.viewer { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; padding: 24px; overscroll-behavior: contain; }
.viewer-body { overscroll-behavior: contain; }
.zoom-layer { touch-action: pan-x pan-y pinch-zoom; }
.viewer[hidden] { display: none; }
.viewer-backdrop { position: absolute; inset: 0; background: rgba(36, 22, 48, .48); }
.viewer-panel {
  position: relative; background: var(--surface); border-radius: 18px; box-shadow: 0 30px 80px rgba(20, 10, 30, .35);
  width: min(1000px, 100%);
  height: min(760px, calc(100vh - 48px)); height: min(760px, calc(100dvh - 48px));
  display: flex; flex-direction: column; overflow: hidden;
  touch-action: manipulation;
  animation: pop .22s ease-out;
}
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.985); } }
.viewer-head { display: flex; align-items: center; justify-content: space-between; padding: 28px 30px 8px 44px; }
.viewer-artist { font: 500 clamp(30px, 3.4vw, 44px)/1.05 var(--serif); letter-spacing: -.015em; margin: 0; }
.subj-n { color: var(--muted); font-size: .85em; margin-left: .35em; font-variant-numeric: tabular-nums; }
.viewer-artist a { color: inherit; text-decoration: none; display: inline-flex; align-items: baseline; gap: .3em; border-radius: 6px; }
.viewer-artist a .arr { font-size: .7em; color: var(--accent); transition: transform .15s ease; }
.viewer-artist a:hover, .viewer-artist a:focus-visible { text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: .12em; }
.viewer-artist a:hover .arr { transform: translateX(4px); }
.viewer-close { border: 0; background: none; }
.viewer-close svg { width: 26px; height: 26px; }
.viewer-body {
  display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 0;
  padding: 14px 36px 36px; overflow: hidden; flex: 1; min-height: 0;
}
.viewer-stage { display: flex; align-items: center; gap: 18px; padding-right: 40px; border-right: 1px solid var(--border); }
.viewer-figure { margin: 0; flex: 1; min-width: 0; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; }
.viewer-zoom {
  border: 0; padding: 0; background: none; cursor: zoom-in; position: relative;
  width: min(100%, calc(min(530px, 100vh - 230px) * 63 / 88)); width: min(100%, calc(min(530px, 100dvh - 230px) * 63 / 88));
  height: auto; aspect-ratio: var(--card-ratio);
}
.viewer-zoom img {
  width: 100%; height: 100%; object-fit: contain; border-radius: 12px; box-shadow: var(--shadow);
  transition: opacity .18s ease;
}
.viewer-zoom img.loading { opacity: .35; }
.viewer-pos { font-size: 15px; color: var(--muted); font-variant-numeric: tabular-nums; }
.viewer-info { padding: 12px 4px 0 44px; display: flex; flex-direction: column; min-width: 0; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }

.viewer-info > * { flex-shrink: 0; max-width: 100%; }
.v-title {
  font: 500 clamp(36px, 4.2vw, 54px)/1.1 var(--serif); letter-spacing: -.02em; margin: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.v-langrow { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: nowrap; margin: 4px 0 6px; min-height: 40px; }
.v-lang { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.v-lang { margin: 0; color: var(--muted); font-size: 20px; }
.v-note {
  margin: 6px 0 0; font-size: 14px; color: var(--accent); background: var(--select); border-radius: 8px; padding: 8px 12px;
  height: 54px; display: flex; align-items: center; overflow: hidden; line-height: 1.35;
}
.v-note.empty { display: none; }
.v-facts { display: grid; grid-template-columns: 110px 1fr; gap: 14px 24px; margin: 14px 0 22px; font-size: 16px; }
.v-facts dd { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.v-facts { align-content: start; }
.set-cell { display: flex; align-items: center; gap: 10px; }
.set-cell span { overflow: hidden; text-overflow: ellipsis; }
.set-logo { height: 26px; width: auto; max-width: 110px; object-fit: contain; flex: none; }
.set-badge { height: 18px; width: auto; flex: none; border-radius: 3px; }
.v-facts dt { color: var(--muted); }
.v-facts dd { margin: 0; }
.v-editions { border-top: 1px solid var(--border); padding-top: 22px; margin-bottom: 26px; }
.v-editions h4 { font: 500 22px var(--serif); margin: 0 0 14px; }
.v-editions-row { display: flex; align-items: center; gap: 8px; }
.v-editions-list { display: flex; gap: 12px; overflow-x: auto; scrollbar-width: none; flex: 1; min-width: 0; scroll-snap-type: x mandatory; }
.v-editions-list::-webkit-scrollbar { display: none; }
.ed-arrow { width: 32px; height: 32px; border: 0; background: none; }
.ed-arrow svg { width: 18px; height: 18px; }
.ed-thumb {
  flex: none; width: calc((100% - 24px) / 3); max-width: 116px; border: 2px solid transparent; border-radius: 10px; padding: 2px;
  background: none; cursor: pointer; scroll-snap-align: start;
}
.ed-thumb img { width: 100%; aspect-ratio: var(--card-ratio); object-fit: contain; border-radius: 7px; box-shadow: 0 1px 4px rgba(37,33,43,.12); }
.ed-thumb[aria-current="true"] { border-color: var(--accent); }
.ed-thumb:hover { border-color: var(--border); }
.v-prov { margin: 10px 0 0; font-size: 12px; color: var(--muted); text-align: right; }

.zoom-layer {
  position: absolute; inset: 0; z-index: 3; background: rgba(20, 12, 28, .94); display: grid; place-items: center;
  overflow: auto; cursor: zoom-out; padding: 16px;   /* z-index sopra le frecce (.nav-btn: 2) */
}
.zoom-layer[hidden] { display: none; }
.zoom-layer img { max-height: calc(100vh - 80px); width: auto; border-radius: 14px; }
.zoom-close { position: absolute; top: 14px; right: 14px; }

/* ---------- piè di pagina ---------- */
.footer { border-top: 1px solid var(--border); padding: 24px var(--gutter) 40px; color: var(--muted); font-size: 13px; }
.footer p { margin: 0 0 4px; max-width: 760px; }

/* ---------- schermi stretti ---------- */
@media (max-width: 900px) {
  .viewer-body { grid-template-columns: minmax(0, 1fr); overflow-y: auto; align-content: start; }
  .viewer-zoom { width: min(100%, calc(min(460px, 100dvh - 400px) * 63 / 88)); min-width: 186px; }
  .viewer-stage { border-right: 0; padding-right: 0; }
  .viewer-info { padding: 22px 4px 0; }
}
@media (max-width: 720px) {
  .topbar { padding-top: 16px; padding-bottom: 16px; gap: 10px; flex-wrap: wrap; }
  .topnav { display: none; }
  .header-search { order: 3; width: 100%; margin-left: 0; }
  .langswitch { margin-left: auto; }
  .brand-sub { display: none; }
  .home-tools { width: 100%; }
  .home-tools .select-wrap { width: 100%; justify-content: space-between; }
  .artist-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px 14px; }
  .tile-meta { grid-template-columns: 48px minmax(0, 1fr); gap: 10px; align-items: stretch; }
  .tile-meta .portrait { width: 48px; height: 48px; font-size: 17px; }
  .tile-name { font-size: 19px; }
  .tile .link-arrow { font-size: 14px; }
  .profile-id { grid-template-columns: 84px minmax(0, 1fr); gap: 18px; }
  .profile .portrait { width: 84px; height: 84px; font-size: 30px; }
  .subj-pill { min-height: 48px; font-size: 15px; }
  .subj-thumb { width: 36px; height: 36px; }
  .stats { flex-wrap: wrap; gap: 12px 0; }
  .stats div { padding: 0 16px; white-space: normal; }
  .stats div:nth-child(3) { padding-left: 0; border-left: 0; flex-basis: 100%; }
  .profile-id { align-items: start; }
  .subj-pill { white-space: normal; }

  .filters.open {
    display: flex; flex-direction: column; gap: 12px; width: 100%;
    background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 14px;
  }
  .filters.open .ctl { width: 100%; }
  .filters.open .ctl select { flex: 1; max-width: none; }
  .ctl-label { min-width: 120px; }
  .work-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 14px; }
  .viewer { padding: 0; }
  .viewer-panel { width: 100%; height: 100%; max-height: none; border-radius: 0; }
  .viewer-body { overflow: hidden; }
  .viewer-zoom { height: auto; width: min(100%, calc((100dvh - 400px) * 63 / 88)); min-width: 160px; }
  .viewer-body { padding-bottom: 16px; }

  .v-langrow .select-wrap select { width: 150px; }
  .v-langrow { margin: 2px 0 0; min-height: 36px; }
  .viewer-figure { gap: 6px; }
  .viewer-info { padding-top: 10px; }
  .v-lang { font-size: 16px; }
  /* due colonne e testo che va a capo: Set e Rarità non finiscono più con «…» */
  .v-facts { min-height: 0; margin: 10px 0 12px; gap: 4px 12px; font-size: 14px; grid-template-columns: auto minmax(0, 1fr); }
  .v-facts dd { white-space: normal; overflow: visible; text-overflow: clip; }
  .viewer-body { overflow: auto; }
  .v-note { display: none; }
  .v-prov { display: none; }
  .viewer-head { padding: 14px 12px 4px 20px; }
  .viewer-info { padding: 22px 4px 0; }
  .viewer-body { padding: 4px 14px 24px; }
  .viewer-stage { gap: 6px; }
  .viewer-stage { position: relative; }
  .nav-btn {
    position: absolute; top: calc(50% - 14px); transform: translateY(-50%); z-index: 2;
    width: 40px; height: 40px; background: rgba(255, 255, 255, .88); box-shadow: 0 2px 8px rgba(0,0,0,.15);
  }
  #v-prev { left: 2px; }
  #v-next { right: 2px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- comandi principali ---------- */
.controls { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: -12px 0 32px; }
.controls-label { font-size: 14px; color: var(--muted); }
.seg { display: inline-flex; background: #F3F0F6; border-radius: 999px; padding: 4px; gap: 2px; flex-wrap: wrap; }
.seg button {
  border: 0; background: none; border-radius: 999px; padding: 9px 16px; font-size: 15px; cursor: pointer; color: var(--muted);
  white-space: nowrap;
}
.seg button:hover { color: var(--text); }
.seg button[aria-checked="true"] { background: var(--surface); color: var(--accent); font-weight: 600; box-shadow: 0 1px 3px rgba(37,33,43,.12); }
.mini-select { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.mini-select select { border: 1px solid var(--border); border-radius: 8px; background: var(--surface); padding: 6px 8px; font-size: 13px; cursor: pointer; }
.toolbar { gap: 12px; }
.toggle, .more-btn {
  border: 1px solid var(--border); background: var(--surface); border-radius: 999px; padding: 9px 16px; font-size: 15px; cursor: pointer;
}
.toggle[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
.more-btn { margin-left: auto; color: var(--accent); }
.more-btn[aria-expanded="true"] { background: var(--select); border-color: var(--accent); }
.filters-panel {
  display: flex; flex-wrap: wrap; gap: 12px; padding: 16px; margin: 0 0 12px;
  border: 1px solid var(--border); border-radius: 14px; background: #FBFAFC;
}
.btn-cta {
  display: inline-flex; align-items: center; gap: 8px; margin-top: 4px;
  background: var(--accent); color: #fff; text-decoration: none; border-radius: 999px;
  padding: 9px 16px; font: 500 15px var(--serif);
}
.btn-cta:hover { background: var(--accent-hover); }
/* anno sotto il titolo (parere Codex, revisione 2): il titolo ha tutta la larghezza e due righe
   sempre riservate, così i nomi lunghi non si tagliano e la vista non salta */
.v-titlerow { display: grid; grid-template-rows: 2.5em 32px; gap: 4px; font-size: clamp(34px, 3.4vw, 44px); }
.v-titlerow .v-title {
  font-size: inherit; line-height: 1.25; white-space: normal; overflow: hidden; text-overflow: clip;
  overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; align-self: end;
}
.v-year { font: 600 28px/32px var(--serif); color: var(--accent); }
@media (max-width: 720px) {
  .controls { margin: -8px 0 20px; }
  .seg { width: 100%; overflow-x: auto; flex-wrap: nowrap; }
  .seg button { padding: 8px 12px; font-size: 14px; }
  .more-btn { margin-left: 0; }
  .filters-panel .ctl { width: 100%; }
  .filters-panel .ctl select { flex: 1; max-width: none; }
  .btn-cta { padding: 7px 12px; font-size: 14px; }
  .v-titlerow { font-size: 26px; grid-template-rows: 2.5em 26px; gap: 2px; }
  .v-year { font-size: 22px; line-height: 26px; }
  .v-facts { min-height: 66px; }
}

/* ---------- il nostro approccio ---------- */
.page { max-width: 760px; margin: 24px 0 48px; }
.approach h1 { font: 500 clamp(30px, 3.4vw, 44px)/1.1 var(--serif); margin: 0 0 32px; letter-spacing: -.01em; }
.approach ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 28px; counter-reset: ap; }
.approach li { counter-increment: ap; font-size: 18px; line-height: 1.55; color: var(--text); }
.approach li::before { content: counter(ap, decimal-leading-zero); display: block; font: 600 15px var(--serif); color: var(--accent); margin-bottom: 8px; }
.page-back { margin: 40px 0 0; font-size: 15px; }
.page-back a { color: var(--accent); }
.footer-links { margin-top: 12px; }
.footer-links a { color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }
.footer-links a:hover { color: var(--text); }

/* risultati Pokémon in home, mentre si scrive */
.poke-res { margin: 0 0 36px; padding-bottom: 28px; border-bottom: 1px solid var(--border); }
.poke-res[hidden] { display: none; }
.pr-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.pr-head h2 { font: 500 clamp(26px, 2.6vw, 34px)/1.1 var(--serif); margin: 0; letter-spacing: -.015em; }
.pr-head h2 small { font: 400 15px var(--sans); color: var(--muted); margin-left: 8px; letter-spacing: 0; }
.pr-all { color: var(--accent); font-weight: 500; text-decoration: none; white-space: nowrap; }
.pr-all:hover { text-decoration: underline; }
.pr-row { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(150px, 1fr); gap: 18px; overflow-x: auto; padding-bottom: 6px; scrollbar-width: thin; }
.pr-card { display: flex; flex-direction: column; gap: 8px; text-decoration: none; color: var(--text); }
.pr-card img, .pr-card .ph { width: 100%; aspect-ratio: var(--card-ratio); object-fit: contain; border-radius: 10px; box-shadow: var(--shadow); }
.pr-card span { font-size: 13px; color: var(--muted); }
.pr-card:hover img { transform: translateY(-3px); transition: transform .15s ease; }
.pr-more { margin: 12px 0 0; font-size: 14px; color: var(--muted); }
.pr-more a { color: var(--accent); }
.empty.quiet { padding: 8px 0; text-align: left; }
@media (max-width: 720px) { .pr-row { grid-auto-columns: 42%; gap: 12px; } }

/* ---------- scopri un artista (shuffle) ---------- */
.discover { margin: 8px 0 56px; border-top: 1px solid var(--border); }
.disc-label { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 16px 0 4px; }
.disc-label h2 { font: 600 15px/1.3 var(--sans); margin: 0; }
.disc-label span { font-size: 14px; color: var(--muted); }
.disc-stage { display: grid; grid-template-columns: 1.3fr 1fr; grid-template-areas: "cards artist" "bar bar"; align-items: center; column-gap: 48px; }
.disc-cards { grid-area: cards; display: flex; justify-content: center; align-items: center; height: 380px; perspective: 1000px; padding: 20px 32px; min-width: 0; }
.disc-card { flex: 0 0 180px; aspect-ratio: var(--card-ratio); margin-left: -70px; transform: translateY(var(--y)) rotate(var(--a)); transform-origin: 50% 90%;
  filter: drop-shadow(0 10px 10px rgba(40, 25, 54, .16)); transition: transform .25s ease; }
.disc-card:first-child { margin-left: 0; }
.disc-card:hover { transform: translateY(calc(var(--y) - 10px)) rotate(var(--a)); z-index: 1; }
.disc-card img { width: 100%; height: 100%; object-fit: contain; border-radius: 9px; }
.disc-card .ph { position: static; height: 100%; }
.disc-artist { grid-area: artist; display: flex; align-items: center; gap: 22px; min-width: 0; }
.disc-portrait { width: 96px; height: 96px; font-size: 32px; box-shadow: 0 0 0 1px var(--border); }
.disc-kicker { margin: 0 0 6px; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.disc-name { font: 500 clamp(30px, 3.4vw, 46px)/1.06 var(--serif); margin: 0 0 8px; overflow-wrap: anywhere; }
.disc-name a { color: var(--accent); text-decoration: none; }
.disc-meta { margin: 0 0 16px; font-size: 14px; color: var(--muted); }
.disc-bar { grid-area: bar; display: flex; justify-content: flex-end; border-top: 1px solid var(--border); padding: 18px 0; }
.disc-btn { display: inline-flex; align-items: center; gap: 10px; min-height: 52px; padding: 0 26px; border: 0; border-radius: 999px;
  background: var(--accent); color: #fff; font-size: 16px; font-weight: 600; cursor: pointer; }
.disc-btn:hover { background: var(--accent-hover); }
.disc-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; }
@media (max-width: 720px) {
  .discover { margin-bottom: 36px; }
  .disc-label span { display: none; }
  .disc-stage { grid-template-columns: minmax(0, 1fr); grid-template-areas: "cards" "bar" "artist"; }
  .disc-cards { height: 250px; padding: 20px 8px 0; overflow: hidden; }
  .disc-card { flex-basis: 122px; margin-left: -62px; }
  .disc-bar { border-top: 0; padding: 4px 0 18px; justify-content: stretch; }
  .disc-btn { width: 100%; justify-content: center; }
  .disc-artist { gap: 16px; align-items: flex-start; }
  .disc-portrait { width: 64px; height: 64px; font-size: 22px; }
  .disc-name { font-size: 30px; }
}

/* foto degli artisti: i loghi degli studi interi e centrati, non tagliati */
.portrait img { width: 100%; height: 100%; object-fit: cover; }
.portrait img.fit-logo { object-fit: contain; padding: 12%; background: #fff; }

/* scopri un artista al computer: Shuffle al centro tra carte e artista (proposta Codex, docs/codex/SHUFFLE_DESKTOP_codex.md, 28/10) */
@media (min-width: 1100px) {
  .disc-label { flex-direction: column; align-items: flex-start; gap: 6px; padding: 20px 0 12px; }
  .disc-label h2 { font-size: 28px; }
  .disc-stage { grid-template-columns: minmax(0,1fr) 152px minmax(0,1fr); grid-template-areas: "cards bar artist"; gap: 24px; }
  .disc-cards { height: 320px; padding: 20px 0; } .disc-card { flex-basis: 160px; }
  .disc-bar { border-top: 0; padding: 0; justify-content: center; } .disc-btn { width: 152px; padding: 0 16px; justify-content: center; }
  .disc-artist { align-items: flex-start; gap: 16px; } .disc-artist > div { min-width: 0; } .disc-portrait { width: 64px; height: 64px; font-size: 22px; }
  .disc-kicker { display: none; } .disc-name { font-size: 36px; line-height: 1.12; margin-bottom: 8px; } .disc-meta { margin-bottom: 12px; }
  #disc-go { background: transparent; color: var(--accent); border-radius: 0; padding: 0; margin-top: 0; min-height: 44px; font: 600 15px/1.4 var(--sans); text-decoration: underline; text-underline-offset: 3px; }
}

/* scopri un artista al telefono: Shuffle tondo in alto a destra sopra il ventaglio (prova C scelta da Matteo, 28/10) */
@media (max-width: 720px) {
  .disc-stage { position: relative; grid-template-areas: "cards" "artist"; }
  .disc-bar { position: absolute; top: 6px; right: 0; padding: 0; z-index: 3; }
  .disc-btn { width: 52px; height: 52px; min-height: 52px; padding: 0; border-radius: 50%; justify-content: center; font-size: 0; box-shadow: 0 6px 16px rgba(59, 30, 84, .33); }
  .disc-btn svg { width: 24px; height: 24px; }
  .disc-kicker { text-transform: none; letter-spacing: 0; font-size: 13px; }
}
@media (max-width: 720px) {
  .disc-btn { gap: 0; }   /* niente spazio per la scritta nascosta: icona al centro */
  .disc-cards { overflow: visible; padding-bottom: 18px; }   /* l'ombra delle carte non viene tagliata */
  .discover { overflow-x: clip; }   /* il ventaglio non fa scorrere la pagina di lato */
}
@media (max-width: 720px) {
  .disc-card { flex-basis: 112px; margin-left: -50px; }   /* ventaglio dentro lo schermo: nessuna carta tagliata ai lati */
  .disc-card:first-child { margin-left: 0; }
  .disc-cards { height: 240px; }
}
@media (max-width: 720px) { .disc-card { flex-basis: 104px; margin-left: -46px; } .disc-card:first-child { margin-left: 0; } }

/* scopri un artista al computer, secondo giro (Codex, docs/codex/SHUFFLE_PC2_codex.md): Shuffle tondo come al telefono, breve descrizione */
.disc-bio { display: none; }
@media (min-width: 1100px) {
  .disc-stage { grid-template-columns: minmax(0,1fr) 80px minmax(0,1fr); }
  .disc-btn { width: 64px; height: 64px; min-height: 64px; padding: 0; gap: 0; border-radius: 50%; font-size: 0; box-shadow: 0 6px 16px rgba(59,30,84,.24); }
  .disc-btn svg { width: 28px; height: 28px; }
  .disc-btn:focus-visible { outline: 3px solid var(--accent); outline-offset: 5px; }
  .disc-bio:not(:empty) { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; margin: 0 0 14px; font: 400 15px/1.5 var(--sans); color: var(--muted); max-width: 46ch; }
}

/* ---------- tutti gli artisti ---------- */
.all-link { display: inline-flex; align-items: center; gap: 8px; margin: -24px 0 48px; font: 500 18px/1.3 var(--sans); color: var(--accent); text-decoration: underline; text-underline-offset: 4px; }
.all-link:hover { color: var(--accent-hover); }
.all-controls { margin: 0 0 16px; }
.all-filter { margin-left: auto; min-width: 220px; padding: 10px 14px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); }
.az { display: flex; flex-wrap: wrap; gap: 4px; margin: 0 0 20px; position: sticky; top: 0; z-index: 5; background: var(--bg); padding: 8px 0; }
.az a, .az span { min-width: 32px; height: 32px; display: grid; place-items: center; border-radius: 8px; font-size: 14px; }
.az a { color: var(--accent); text-decoration: none; background: var(--select); font-weight: 600; }
.az a:hover { background: #E2D6EC; }
.az span { color: var(--border); }
.all-list { list-style: none; padding: 0; margin: 0 0 48px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: 32px; }
.all-list li { border-top: 1px solid var(--border); scroll-margin-top: 64px; }
.all-list a { display: grid; grid-template-columns: 40px minmax(0, 1fr); grid-template-rows: auto auto; column-gap: 12px; align-items: center; padding: 10px 0; color: inherit; text-decoration: none; }
.all-list a:hover .all-name { color: var(--accent); }
.all-list .portrait { grid-row: 1 / 3; width: 40px; height: 40px; font-size: 14px; box-shadow: 0 0 0 1px var(--border); }
.all-name { font: 500 17px/1.25 var(--serif); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.all-meta { font-size: 13px; color: var(--muted); }
@media (max-width: 1100px) { .all-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 720px) {
  .all-link { margin: -12px 0 32px; }
  .all-list { grid-template-columns: minmax(0, 1fr); }
  .all-filter { margin-left: 0; width: 100%; }
  .az a, .az span { min-width: 26px; height: 30px; font-size: 13px; }
}

/* freccia indietro dello shuffle: tondo con bordo accanto al pulsante principale */
.disc-bar { gap: 10px; align-items: center; }
.disc-back { width: 44px; height: 44px; border-radius: 50%; border: 1.5px solid var(--accent); background: var(--surface); color: var(--accent);
  display: grid; place-items: center; cursor: pointer; flex: none; padding: 0; }
.disc-back svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.disc-back:hover:not(:disabled) { background: var(--select); }
.disc-back:disabled { opacity: .35; cursor: default; }
@media (max-width: 720px) { .disc-bar { display: flex; } }
@media (min-width: 1100px) { .disc-bar { flex-direction: column-reverse; gap: 12px; } }

/* popup: «Apri galleria →» accanto al nome, perché il solo nome con la freccia non si capiva (Matteo, 28/10) */
.viewer-artist a { align-items: center; flex-wrap: wrap; row-gap: 6px; }
.v-go { font: 600 14px/1 var(--sans); letter-spacing: 0; color: #fff; background: var(--accent); border-radius: 999px; padding: 8px 14px; white-space: nowrap; transition: background .15s; }
.viewer-artist a:hover .v-go, .viewer-artist a:focus-visible .v-go { background: var(--accent-hover); }
.viewer-artist a:hover, .viewer-artist a:focus-visible { text-decoration: none; }
.viewer-artist a:hover #viewer-artist { text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: .12em; }
@media (max-width: 720px) { .v-go { font-size: 13px; padding: 7px 12px; } }

/* artista senza «Soggetti principali» (es. "Big Mama" Tagawa): il profilo occupa tutta la riga, niente vuoto a destra */
.profile:not(:has(.subjects)) { grid-template-columns: minmax(0, 1fr); }
.profile:not(:has(.subjects)) .lede { max-width: 72ch; }

/* tutti gli artisti a tessere grandi: ventaglio (variante A) o carta singola (B per chi ha una sola opera) */
.all-list { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 36px 24px; }
.all-list li.at { border-top: 0; }
.at-fan { position: relative; display: block; height: 250px; border-radius: 12px; background: #F6F3F8; overflow: hidden; isolation: isolate; }
.at-fan img { position: absolute; width: 125px; height: 175px; object-fit: contain; left: calc(50% - 62.5px); top: 37px; border-radius: 6px;
  filter: drop-shadow(0 5px 5px rgba(40, 20, 56, .15));
  transform: translate(calc(var(--o) * 19px), calc(var(--ab) * 7px)) rotate(calc(var(--o) * 9deg)); transition: transform .45s cubic-bezier(.2,.7,.2,1); }
.at:hover .at-fan img, .at:focus-within .at-fan img { transform: translate(calc(var(--o) * 38px), calc(var(--ab) * 12px - 6px)) rotate(calc(var(--o) * 16deg)); }
.at-one .at-fan img { width: 160px; height: 224px; left: calc(50% - 80px); top: 13px; transform: none; }
.at-one:hover .at-fan img { transform: translateY(-4px); }
.at-fan .ph { position: absolute; inset: 0; }
.all-list .at-meta { display: flex; gap: 11px; align-items: center; padding: 14px 0 0; grid-template-columns: none; }
.at-meta .portrait { width: 42px; height: 42px; font-size: 14px; flex: none; box-shadow: 0 0 0 1px var(--border); }
.at-meta .all-name { display: block; font-size: 19px; white-space: normal; }
.at-meta .all-meta { display: block; margin-top: 2px; }
.at-bio { margin: 10px 0 0; font-size: 13px; line-height: 1.5; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
@media (max-width: 1100px) { .all-list { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 720px) {
  .all-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 12px; }
  .at-fan { height: 190px; }
  .at-fan img { width: 90px; height: 126px; left: calc(50% - 45px); top: 29px; transform: translate(calc(var(--o) * 14px), calc(var(--ab) * 6px)) rotate(calc(var(--o) * 11deg)); }
  .at-one .at-fan img { width: 118px; height: 165px; left: calc(50% - 59px); top: 12px; }
  .at-meta .portrait { width: 30px; height: 30px; font-size: 11px; }
  .at-meta .all-name { font-size: 16px; }
  .at-bio { display: none; }
}
@media (prefers-reduced-motion: reduce) { .at-fan img { transition: none; } }

/* salti A–Z: al computer sempre visibili; al telefono dentro «Vai alla lettera» che apre e chiude */
.az { align-items: center; }
.az-letters { display: flex; flex-wrap: wrap; gap: 4px; }
.az-toggle { display: none; }
@media (max-width: 720px) {
  .az { display: block; }
  .az-toggle { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 16px; border: 1px solid var(--border);
    border-radius: 999px; background: var(--surface); color: var(--accent); font-weight: 600; cursor: pointer; }
  .az.open .az-toggle span { display: inline-block; transform: rotate(180deg); }
  .az-letters { display: none; margin-top: 10px; }
  .az.open .az-letters { display: flex; }
}
/* «A–Z +» accanto al filtro, solo al telefono */
.az a.on { background: var(--accent); color: #fff; }
@media (max-width: 720px) {
  .all-controls { flex-wrap: wrap; }
  .all-controls .all-filter { flex: 1; width: auto; min-width: 0; }
  .all-controls .az-toggle { min-height: 44px; min-width: 64px; justify-content: center; font-variant-numeric: tabular-nums; }
  .az:not(.open) { display: none; }
}
/* «Ordina per» lungo quanto la riga del filtro (Matteo: barra troppo lunga rispetto ai tre pulsanti) */
@media (max-width: 720px) {
  .all-controls .seg { width: 100%; }
  .all-controls .seg button { flex: 1 1 0; text-align: center; padding-left: 6px; padding-right: 6px; }
}
@media (min-width: 721px) { .all-controls .all-filter { max-width: 280px; } }

/* ---------- spazio personale: ♥ e collezioni (site/album.js) ---------- */
.space-link { position: relative; display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; color: var(--accent); flex: none; }
.space-link svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linejoin: round; }
.space-link:hover, .space-link[aria-current="page"] { background: var(--select); }
.space-link[aria-current="page"] svg { fill: currentColor; }
.space-n { position: absolute; top: 2px; right: 0; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--accent); color: #fff; font: 600 11px/18px var(--sans); text-align: center; }
.v-quick { display: flex; gap: 8px; margin: 2px 0 10px; }
.qbtn { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--border); background: var(--surface); color: var(--muted); cursor: pointer; }
.qbtn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.qbtn:hover { border-color: var(--accent); color: var(--accent); }
.qbtn[aria-pressed="true"], .qbtn.on { background: var(--select); border-color: transparent; color: var(--accent); }
.qbtn[aria-pressed="true"] svg { fill: currentColor; }
.liked-dot { position: absolute; top: 8px; left: 8px; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: rgba(255,255,255,.95); color: var(--accent); box-shadow: 0 1px 4px rgba(0,0,0,.18); }
.liked-dot svg { width: 15px; height: 15px; fill: currentColor; stroke: none; }
.fav-artist { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; margin: 4px 0 14px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font: 500 14px var(--sans); cursor: pointer; }
.fav-artist svg { width: 18px; height: 18px; fill: none; stroke: var(--accent); stroke-width: 1.7; }
.fav-artist[aria-pressed="true"] { background: var(--select); border-color: transparent; color: var(--accent); font-weight: 600; }
.fav-artist[aria-pressed="true"] svg { fill: var(--accent); }
/* foglio «Aggiungi a collezione»: riquadro al computer, dal basso al telefono */
.csheet { position: absolute; inset: 0; z-index: 5; display: grid; place-items: center; background: rgba(37,33,43,.35); border-radius: inherit; }
.csheet-card { width: min(380px, calc(100% - 32px)); max-height: calc(100% - 32px); overflow: auto; background: var(--surface); border-radius: 16px; box-shadow: var(--shadow); padding: 16px; }
.cs-head { display: flex; gap: 12px; align-items: center; padding-bottom: 12px; border-bottom: 1px solid var(--border); }
.cs-head img { width: 40px; border-radius: 5px; flex: none; }
.cs-head div { flex: 1; min-width: 0; }
.cs-head h3 { margin: 0; font: 500 19px var(--serif); color: var(--accent); }
.cs-head p { margin: 2px 0 0; font-size: 14px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cs-new { display: flex; gap: 8px; margin: 12px 0 4px; }
.cs-new input { flex: 1; min-width: 0; height: 44px; padding: 0 12px; border: 1px solid var(--border); border-radius: 10px; font-size: 16px; }
.cs-new input:focus { border-color: var(--accent); outline: none; }
.cs-new button, .cs-done { height: 44px; padding: 0 16px; border: 0; border-radius: 999px; background: var(--accent); color: #fff; font: 600 15px var(--sans); cursor: pointer; }
.cs-list { list-style: none; margin: 0; padding: 0; }
.cs-list label { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 6px 2px; border-bottom: 1px solid var(--border); cursor: pointer; }
.cs-list input { width: 20px; height: 20px; accent-color: var(--accent); flex: none; order: 3; }
.cs-cover { width: 40px; height: 40px; border-radius: 8px; overflow: hidden; display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--select); flex: none; }
.cs-cover img { width: 100%; height: 100%; object-fit: cover; }
.cs-t { flex: 1; min-width: 0; }
.cs-t small { display: block; color: var(--muted); font-size: 12px; }
.cs-local { font-size: 12px; color: var(--muted); margin: 10px 0 0; }
.cs-done { width: 100%; margin-top: 10px; }
@media (max-width: 720px) {
  .csheet { place-items: end stretch; }
  .csheet-card { width: 100%; border-radius: 18px 18px 0 0; max-height: 80%; }
}
/* pagina «Il mio spazio» */
.space-head h1 { font: 500 clamp(34px, 5vw, 52px)/1.05 var(--serif); color: var(--accent); margin: 0 0 6px; }
.space-local { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; background: var(--select); border-radius: 14px; padding: 10px 14px; margin: 16px 0; font-size: 14px; }
.space-local span { flex: 1; min-width: 200px; }
.btn-ghost { display: inline-flex; align-items: center; min-height: 40px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font: 500 14px var(--sans); cursor: pointer; }
.btn-ghost:hover:not(:disabled) { border-color: var(--accent); }
.btn-ghost:disabled { opacity: .4; cursor: default; }
.btn-ghost.danger, .mini.danger { color: #9b1c1c; }
.space-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin: 8px 0 22px; overflow-x: auto; }
.space-tabs button { border: 0; background: none; padding: 12px 14px; min-height: 44px; font: 500 15px var(--sans); color: var(--muted); border-bottom: 2px solid transparent; cursor: pointer; white-space: nowrap; }
.space-tabs button[aria-selected="true"] { color: var(--accent); border-color: var(--accent); font-weight: 600; }
.space-tabs span { font-variant-numeric: tabular-nums; opacity: .8; }
.space-search { max-width: 360px; margin: 0 0 18px; }
.work-artist { font-size: 14px; color: var(--muted); margin-top: -4px; }
.fav-artists { display: flex; flex-wrap: wrap; gap: 20px; }
.fav-a { width: 120px; text-align: center; text-decoration: none; color: var(--text); }
.fav-av { display: grid; place-items: center; width: 84px; height: 84px; margin: 0 auto 8px; border-radius: 50%; background: var(--select); color: var(--accent); font: 500 28px var(--serif); }
.shelf { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 24px; }
.shelf-new { height: 160px; border: 1.5px dashed var(--border); border-radius: 14px; background: none; color: var(--accent); font: 600 15px var(--sans); cursor: pointer; }
.shelf-c { text-decoration: none; color: var(--text); }
.shelf-c .fan { position: relative; display: block; height: 160px; }
.shelf-c .fan img { position: absolute; top: 8px; width: 88px; border-radius: 7px; box-shadow: var(--shadow); left: calc(var(--i) * 38px); transform: rotate(calc((var(--i) - 1) * 6deg)); }
.shelf-c b { display: block; font: 500 18px var(--serif); margin-top: 6px; }
.shelf-c small { color: var(--muted); }
.empty-note { color: var(--muted); }
.coll-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.coll-head h1 { font: 500 clamp(30px, 4.5vw, 46px)/1.05 var(--serif); color: var(--accent); margin: 0; }
.coll-head .kicker { margin: 0 0 4px; font-size: 13px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.coll-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.binder { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; background: #2b2230; border-radius: 18px; padding: 18px; max-width: 760px; }
.binder .work-cap, .binder .work-artist { color: #e9e2ef; border-color: rgba(255,255,255,.15); }
.binder .work-cap span { color: #bdb3c6; }
.binder-slot { aspect-ratio: var(--card-ratio); border-radius: 10px; background: #3a3040; }
.edit-row { display: flex; gap: 6px; }
.mini { min-height: 36px; padding: 0 10px; border-radius: 999px; border: 0; background: #fff; font: 600 13px var(--sans); cursor: pointer; }
.pager { display: flex; align-items: center; justify-content: center; gap: 14px; max-width: 760px; margin-top: 14px; color: var(--muted); }
@media (max-width: 720px) {
  .binder { gap: 8px; padding: 10px; }
  .binder .work-cap, .binder .work-artist { display: none; }
}
/* revisione UI 28/10 (docs/revisioni/SPAZIO_v1_revisore_ui.md) */
.binder :focus-visible { outline-color: #fff; }
.cs-new input, .inline-form input { border-color: #8f8799; }
.space-tabs { gap: 0; }
.qbtn { position: relative; }
.qn { position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px; background: var(--accent); color: #fff; font: 600 11px/18px var(--sans); text-align: center; }
.btn-ghost.strong { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.inline-form { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 20px; max-width: 520px; }
.inline-form input { flex: 1; min-width: 180px; height: 44px; padding: 0 12px; border: 1px solid #8f8799; border-radius: 10px; font-size: 16px; }
.sp-ask { flex-basis: 100%; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.warn { color: #9b1c1c; margin: 0 0 16px; }
.notice-undo { margin-left: 10px; border: 0; background: none; color: #d9c8ef; font: 600 inherit var(--sans); text-decoration: underline; cursor: pointer; min-height: 32px; }
.coll-head, .binder, .pager { margin-left: auto; margin-right: auto; max-width: 760px; }
@media (max-width: 720px) {
  .space-tabs button { padding: 10px 8px; font-size: 14px; }
  .binder.editing { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .edit-row { flex-wrap: wrap; gap: 4px; }
  .mini { min-height: 32px; padding: 0 8px; font-size: 12px; }
}
/* «Aggiungi ai preferiti» sotto bio e fonti, prima dei dati (Matteo, 28/10) */
.profile .fav-artist { margin: 0 0 16px; padding: 0 12px; }
.fav-artist svg { width: 20px; height: 20px; }
@media (max-width: 420px) { .profile .fav-artist { width: 100%; justify-content: center; } }
/* account Google nello spazio (28/10) */
.space-acc { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin: 0 0 14px; font-size: 14px; color: var(--muted); }
.acc-ask { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 0 0 18px; padding: 12px 14px; border-radius: 12px; background: var(--select); color: var(--text); font-size: 14px; }
.acc-ask span { flex: 1 1 260px; }
/* account: pulsante Google, avatar e menu in testata, scheda profilo nello spazio (28/10) */
.acc-slot { position: relative; flex: none; display: flex; align-items: center; }
.acc-login { min-height: 40px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font: 500 14px var(--sans); cursor: pointer; }
.acc-login:hover { background: var(--select); }
.acc-btn { width: 44px; height: 44px; display: grid; place-items: center; border: 0; border-radius: 50%; background: none; padding: 0; cursor: pointer; }
.acc-btn:hover .avatar, .acc-btn[aria-expanded="true"] .avatar { box-shadow: 0 0 0 3px var(--select); }
.avatar { width: 34px; height: 34px; border-radius: 50%; overflow: hidden; display: grid; place-items: center; background: var(--select); color: var(--accent); font: 600 13px var(--sans); flex: none; }
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar.lg { width: 56px; height: 56px; font-size: 20px; }
.acc-menu { position: absolute; top: calc(100% + 8px); right: 0; z-index: 50; min-width: 300px; max-width: calc(100vw - 32px); padding: 8px; border-radius: 16px; border: 1px solid var(--border); background: var(--surface); box-shadow: 0 12px 32px rgba(30, 10, 50, .14); display: flex; flex-direction: column; }
.acc-menu[hidden] { display: none; }
.acc-menu-who { display: flex; gap: 12px; align-items: center; padding: 8px 8px 12px; margin-bottom: 4px; border-bottom: 1px solid var(--border); }
.acc-menu-who .avatar.lg { width: 44px; height: 44px; }
.acc-menu-who b, .acc-who b { display: block; font-weight: 600; color: var(--text); }
.acc-menu-who > div { min-width: 0; }
.acc-menu-who span { display: block; font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acc-menu [role=menuitem] { display: flex; align-items: center; min-height: 44px; padding: 0 10px; border: 0; border-radius: 10px; background: none; color: var(--text); font: 500 15px var(--sans); text-align: left; text-decoration: none; cursor: pointer; }
.acc-menu [role=menuitem]:hover, .acc-menu [role=menuitem]:focus-visible { background: var(--select); outline: none; }
.acc-card { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; margin: 4px 0 22px; padding: 16px 18px; border-radius: 18px; border: 1px solid var(--border); background: var(--surface); }
.acc-who { flex: 1 1 220px; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.acc-who span { color: var(--muted); font-size: 14px; overflow-wrap: anywhere; }
.acc-who small { color: var(--muted); font-size: 13px; margin-top: 4px; }
.acc-card.out .acc-who b { font: 500 19px var(--serif); }
/* pulsante «Accedi con Google» secondo le indicazioni di Google (bianco, bordo grigio, G a colori) */
.g-btn { display: inline-flex; align-items: center; gap: 10px; height: 44px; padding: 0 16px 0 12px; border-radius: 22px; border: 1px solid #747775; background: #fff; color: #1f1f1f; font: 500 14px/1 "Roboto", var(--sans); letter-spacing: .25px; cursor: pointer; }
.g-btn:hover { background: #f8f8f8; box-shadow: 0 1px 3px rgba(60, 64, 67, .3); }
.g-btn:disabled { opacity: .6; cursor: progress; }
.g-btn .g-logo { width: 20px; height: 20px; }
@media (max-width: 720px) { .acc-login { min-height: 36px; padding: 0 12px; font-size: 13px; } }
.acc-card .danger { color: #a3243b; }
.btn-ghost.danger { border-color: #a3243b; }
.acc-del-ask { flex-basis: 100%; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 0; }
.acc-del-ask[hidden] { display: none; }
/* rifiniture spazio 14-19 (28/10) */
/* 14: con poca altezza (zoom 200%) ♥ e + restano visibili in cima alle informazioni */
@media (max-height: 520px) { .v-quick { position: sticky; top: 0; z-index: 2; background: var(--surface); padding: 6px 0; margin: 0 0 6px; } }
/* 15: foglio collezioni: testa e «Fatto» fissi, scorre solo l'elenco */
.csheet-card { display: flex; flex-direction: column; overflow: hidden; }
.csheet-card > * { flex: none; }
.cs-list { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
/* 17: stato vuoto che invita */
.empty.invite { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 56px 16px; }
.empty.invite p { margin: 0; max-width: 420px; font-size: 17px; color: var(--text); }
.invite-heart { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; background: var(--select); }
.invite-heart svg { width: 30px; height: 30px; fill: none; stroke: var(--accent); stroke-width: 1.7; }
.empty.invite .btn-ghost { text-decoration: none; display: inline-flex; align-items: center; min-height: 44px; }
/* 18: cuoricino piccolo in basso a destra, lontano da titolo e simbolo del set */
.liked-dot { top: auto; left: auto; bottom: 6px; right: 6px; width: 24px; height: 24px; }
.liked-dot svg { width: 13px; height: 13px; }
/* 19: ricerca, filtro artista e ordine sulla stessa riga */
.space-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin: 0 0 18px; }
.space-tools .space-search { margin: 0; flex: 1 1 240px; }
.space-order { font-size: 14px; color: var(--muted); }
.space-local.quiet { background: none; padding-left: 0; }
/* collezione guidata: creazione, scelta a griglia o una alla volta, stati (28/10) */
.v-status { display: inline-flex; gap: 6px; margin-left: 6px; }
.qpill { min-height: 44px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--muted); font: 500 14px var(--sans); cursor: pointer; }
.qpill:hover { border-color: var(--accent); color: var(--accent); }
.qpill[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
#v-miss[aria-pressed="true"] { background: var(--select); color: var(--accent); border-color: var(--accent); }
.v-quick { flex-wrap: wrap; align-items: center; }
.nc { max-width: 560px; margin: 0 auto; padding-bottom: 40px; }
.nc-label { display: block; font: 500 22px var(--serif); color: var(--accent); margin: 18px 0 8px; padding: 0; }
.nc-name { width: 100%; height: 50px; padding: 0 14px; border: 1.5px solid var(--border); border-radius: 12px; font-size: 17px; background: var(--surface); color: var(--text); }
.nc-name:focus { border-color: var(--accent); outline: none; }
.nc-from { border: 0; margin: 0; padding: 0; display: grid; gap: 8px; }
.nc-opt { display: flex; gap: 12px; align-items: center; min-height: 56px; padding: 10px 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); cursor: pointer; }
.nc-opt.on { border-color: var(--accent); background: var(--select); }
.nc-opt input { accent-color: var(--accent); width: 18px; height: 18px; flex: none; }
.nc-opt b { display: block; font-weight: 600; }
.nc-opt small, .nc-chosen small, .nc-hits small { color: var(--muted); font-size: 13px; }
.nc-pick { margin-top: 14px; }
.nc-pick .search { max-width: none; }
.nc-hits { list-style: none; margin: 8px 0 0; padding: 0; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: var(--surface); }
.nc-hits:empty { display: none; }
.nc-hits button { width: 100%; min-height: 44px; padding: 0 14px; border: 0; border-bottom: 1px solid var(--border); background: none; text-align: left; font: 500 15px var(--sans); color: var(--text); cursor: pointer; }
.nc-hits li:last-child button { border-bottom: 0; }
.nc-hits button:hover, .nc-hits button:focus-visible { background: var(--select); }
.nc-chosen { font: 500 18px var(--sans); margin: 0; }
.nc-err { color: #a3243b; min-height: 1.4em; margin: 10px 0 0; font-size: 14px; }
.nc-go, .nc-new { min-height: 48px; display: inline-flex; align-items: center; padding: 0 22px; text-decoration: none; }
.nc-new { margin: 0 0 18px; }
.pick-head h1 { font: 500 clamp(30px, 4vw, 44px)/1.1 var(--serif); color: var(--accent); margin: 0 0 12px; }
.pick-head .seg { display: inline-flex; border: 1px solid var(--border); border-radius: 999px; padding: 3px; gap: 3px; }
.pick-head .seg button { min-height: 40px; padding: 0 16px; border: 0; border-radius: 999px; background: none; font: 500 14px var(--sans); color: var(--muted); cursor: pointer; }
.pick-head .seg button[aria-checked="true"] { background: var(--select); color: var(--accent); font-weight: 600; }
.pick-hint { color: var(--muted); font-size: 14px; margin: 10px 0 18px; }
#pick-body { padding-bottom: 96px; }
.pick-card { position: relative; display: block; width: 100%; padding: 0; border: 0; border-radius: 10px; overflow: hidden; background: var(--select); aspect-ratio: 63 / 88; cursor: pointer; }
.pick-card img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pick-card.s-mi_manca img { filter: grayscale(1) opacity(.45); }
.pick-card.s-ce_lho { box-shadow: 0 0 0 3px var(--accent); }
.pq { position: absolute; left: 6px; right: 6px; bottom: 6px; padding: 4px 0; border-radius: 999px; text-align: center; font: 600 12px var(--sans); box-shadow: 0 1px 4px rgba(0,0,0,.2); }
.pq.own { background: var(--accent); color: #fff; }
.pq.miss { background: #fff; color: var(--accent); border: 1.5px solid var(--accent); }
.work.is-miss .work-card img { filter: grayscale(1) opacity(.45); }
.pick-dock { position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); z-index: 30; width: min(560px, calc(100% - 32px)); display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: 16px; background: var(--accent); color: #fff; box-shadow: 0 10px 30px rgba(30,10,50,.25); }
.pick-dock b { display: block; font-weight: 600; }
.pick-dock span { font-size: 14px; opacity: .9; }
.pick-done { margin-left: auto; min-height: 40px; display: inline-flex; align-items: center; padding: 0 18px; border-radius: 999px; background: #fff; color: var(--accent); font-weight: 600; text-decoration: none; }
.sw-wrap { max-width: 420px; margin: 0 auto; text-align: center; }
.sw-stage { position: relative; }
.sw-card { position: relative; width: min(300px, 78vw); margin: 0 auto; aspect-ratio: 63 / 88; border-radius: 14px; overflow: hidden; box-shadow: 0 12px 30px rgba(30,10,50,.2); touch-action: pan-y; cursor: grab; background: var(--select); user-select: none; }
.sw-card img { width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.sw-card .lab { position: absolute; top: 16px; padding: 4px 10px; border-radius: 8px; font: 700 15px var(--sans); opacity: 0; border: 2px solid var(--accent); }
.sw-card .lab.l { left: 12px; background: #fff; color: var(--accent); transform: rotate(-12deg); }
.sw-card .lab.r { right: 12px; background: var(--accent); color: #fff; transform: rotate(12deg); }
.sw-cap { margin: 12px 0 0; color: var(--muted); font-size: 14px; }
.sw-btns { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 14px; }
.sw-btns button { min-height: 44px; }
.sw-btns button:disabled { opacity: .4; }
.sw-count { color: var(--muted); font-size: 13px; margin: 10px 0 0; }
.coll-prog { margin: 6px 0 4px; color: var(--muted); font-size: 15px; }
.coll-head .bar { height: 6px; max-width: 280px; border-radius: 9px; background: var(--select); overflow: hidden; }
.coll-head .bar i { display: block; height: 100%; background: var(--accent); }
@media (max-width: 420px) { .v-status { margin-left: 0; } .qpill { padding: 0 12px; } }
/* ♥ e + direttamente sulle carte della galleria (28/10) */
.card-wrap { position: relative; }
.cq { position: absolute; display: grid; place-items: center; width: 36px; height: 36px; padding: 0; border: 0; border-radius: 50%; background: rgba(255,255,255,.62); color: var(--accent); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); box-shadow: 0 1px 4px rgba(0,0,0,.15); cursor: pointer; opacity: .78; transition: opacity .15s, background .15s, transform .15s; }
.cq svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.cq-like { right: 8px; bottom: 8px; }
.cq-add { right: 8px; top: 8px; }
.card-wrap:hover .cq, .cq:focus-visible { opacity: 1; background: rgba(255,255,255,.92); }
.cq:hover { transform: scale(1.08); }
.cq-like[aria-pressed="true"] { opacity: 1; background: rgba(255,255,255,.95); }
.cq-like[aria-pressed="true"] svg { fill: currentColor; }
.cq-add.on { opacity: 1; background: var(--accent); color: #fff; }
.card-wrap .lang-tag { right: 52px; top: 14px; }
@media (hover: none) { .cq { opacity: .9; } }
/* foglio collezioni, strada C: elenco prima, «+ Nuova collezione» in fondo (28/10) */
.cs-head { margin-bottom: 4px; }
.cs-newrow { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 56px; padding: 6px 2px; border: 0; border-bottom: 1px solid var(--border); background: none; color: var(--accent); font: 600 15px var(--sans); text-align: left; cursor: pointer; }
.cs-newrow:hover { background: var(--select); }
.cs-cover.plus { display: grid; place-items: center; grid-template-columns: 1fr; font-size: 22px; color: var(--accent); }
.cs-new[hidden], .cs-newrow[hidden] { display: none; }
/* raccoglitore aperto: due pagine affiancate al computer (28/10) */
.spread { max-width: 760px; margin: 0 auto; }
.spread.two { max-width: 1100px; display: grid; grid-template-columns: 1fr 1fr; gap: 0; background: #2b2230; border-radius: 18px; box-shadow: 0 10px 30px rgba(30,10,50,.18); }
.spread.two .binder { max-width: none; border-radius: 0; margin: 0; }
.spread.two .binder:first-child { border-radius: 18px 0 0 18px; box-shadow: inset -14px 0 18px -14px rgba(0,0,0,.55); }
.spread.two .binder:last-child { border-radius: 0 18px 18px 0; box-shadow: inset 14px 0 18px -14px rgba(0,0,0,.55); border-left: 2px solid #1d1622; }
.spread.two .binder.blank { min-height: 100%; }
.spread .binder { touch-action: pan-y; }
/* telefono: lo Shuffle non tocca più il bordo (l'ombra veniva tagliata dal clip del ventaglio) */
@media (max-width: 720px) { .disc-bar { right: 14px; top: 10px; } }
/* testata del telefono su una riga: logo a sinistra, poi lingua, ♥ e account; ricerca sotto (28/10) */
.lang-m { display: none; }
@media (max-width: 720px) {
  .topbar { gap: 6px; row-gap: 12px; }
  .brand-name { font-size: 26px; }
  .brand { margin-right: auto; }
  .langswitch { order: 1; margin-left: 0; }
  .space-link { order: 2; }
  .acc-slot { order: 2; }
  .header-search { order: 3; }
  .langswitch a { display: none; }
  .lang-m { display: block; position: relative; }
  .lang-m select { appearance: none; -webkit-appearance: none; height: 36px; padding: 0 22px 0 10px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%2368616E' stroke-width='1.4'/%3E%3C/svg%3E") no-repeat right 8px center / 9px; color: var(--text); font: 600 13px var(--sans); }
  .acc-login { min-height: 36px; }
  .acc-btn { width: 40px; height: 40px; }
  .space-link { width: 40px; height: 40px; }
}
@media (max-width: 360px) { .brand-name { font-size: 22px; } .topbar { gap: 4px; } .acc-login { padding: 0 10px; } .lang-m select { padding-left: 8px; } }
/* finestre medie: lingue su una riga, sottotitolo del logo nascosto */
@media (min-width: 721px) and (max-width: 1000px) {
  .brand-sub { display: none; }
  .topbar { gap: 16px; }
  .langswitch { flex-wrap: nowrap; white-space: nowrap; }
  .langswitch a { min-width: 0; padding: 6px 8px; }
}
@media (max-width: 360px) { .brand-name { font-size: 20px; } .acc-login { padding: 0 8px; font-size: 12px; } .lang-m select { padding: 0 16px 0 8px; background-position: right 5px center; } .space-link { width: 36px; } }
@media (min-width: 721px) and (max-width: 1100px) { .brand-sub { display: none; } .langswitch { flex-wrap: nowrap; white-space: nowrap; } .langswitch a { min-width: 0; padding: 6px 8px; } }
/* testata: ritocchi dal parere Codex (28/10) — ordine del DOM = ordine visivo al telefono, bersagli da 44 px */
.space-link, .acc-slot { order: 1; }
.langswitch { order: 2; }
@media (max-width: 720px) {
  .langswitch { order: 1; } .space-link, .acc-slot { order: 2; }
  .lang-m select { height: 44px; min-width: 44px; }
  .space-link, .acc-btn { width: 44px; height: 44px; }
  .acc-login { min-height: 44px; }
  .header-search input { font-size: 16px; }
  .space-n { min-width: 18px; height: 18px; padding: 0 4px; top: 0; right: -2px; }
}
@media (max-width: 360px) { .topbar { column-gap: 4px; row-gap: 12px; } .space-link { width: 44px; } .acc-login { min-width: 44px; } }
/* raccoglitore: «‹ 1 di 2 ›» con frecce grandi (parere Codex, 28/10) */
.pager { gap: 12px; margin: 16px auto 0; }
.pager .btn-ghost { width: 52px; height: 52px; min-height: 52px; padding: 0; border-radius: 50%; display: grid; place-items: center; font-size: 28px; line-height: 1; }
.pager .btn-ghost:disabled { opacity: .35; }
.pager span { min-width: 80px; text-align: center; font-size: 16px; color: var(--text); }
/* Mi piacciono: cuore grande, carte tolte attenuate, modalità Seleziona */
.cq.big { width: 48px; height: 48px; top: 8px; right: 8px; bottom: auto; opacity: 1; background: rgba(255,255,255,.95); }
.cq.big svg { width: 26px; height: 26px; }
.work.unliked .work-card img { opacity: .4; filter: grayscale(.6); }
.unliked-note { position: absolute; left: 8px; right: 8px; bottom: 8px; padding: 6px 8px; border-radius: 8px; background: rgba(37,33,43,.85); color: #fff; font: 600 12px var(--sans); text-align: center; }
.liked-grid.selecting .work-card { outline: none; }
.liked-grid.selecting .work-card[aria-pressed="true"] { box-shadow: 0 0 0 3px var(--accent); border-radius: 10px; }
.sel-check { position: absolute; top: 12px; right: 12px; width: 28px; height: 28px; border-radius: 50%; border: 2px solid #fff; background: rgba(37,33,43,.35); color: #fff; display: grid; place-items: center; font: 700 15px var(--sans); box-shadow: 0 1px 4px rgba(0,0,0,.3); }
.sel-check.on { background: var(--accent); border-color: var(--accent); }
.sel-bar { position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); z-index: 40; width: min(560px, calc(100% - 32px)); display: flex; align-items: center; gap: 12px; padding: 10px 10px 10px 18px; border-radius: 16px; background: var(--accent); color: #fff; box-shadow: 0 10px 30px rgba(30,10,50,.25); }
.sel-go { margin-left: auto; min-height: 52px; padding: 0 20px; border: 0; border-radius: 999px; background: #fff; color: var(--accent); font: 600 15px var(--sans); cursor: pointer; }
.sel-go:disabled { opacity: .5; cursor: default; }
.pk-root { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; background: rgba(37,33,43,.4); }
.pk-card { max-height: min(80vh, 560px); }
.pk-c { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 56px; padding: 6px 2px; border: 0; border-bottom: 1px solid var(--border); background: none; text-align: left; font: 500 15px var(--sans); color: var(--text); cursor: pointer; }
.pk-c:hover, .pk-c:focus-visible { background: var(--select); }
@media (max-width: 720px) { .pk-root { place-items: end stretch; } .pk-card { width: 100%; border-radius: 18px 18px 0 0; } }
.fav-av { overflow: hidden; }
.fav-av img { width: 100%; height: 100%; object-fit: cover; display: block; }
.fav-av img.fit-logo { object-fit: contain; background: #fff; }
/* far scoprire ♥, + e lo spazio a chi arriva (28/10) */
.grid-hint { grid-column: 1 / -1; display: flex; align-items: center; gap: 10px; margin: 0; padding: 12px 16px; border-radius: 12px; background: var(--select); color: var(--accent); font-size: 15px; }
.grid-hint svg { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; }
.space-label { display: none; }
@media (min-width: 1101px) {
  .space-link { width: auto; padding: 0 14px 0 10px; gap: 6px; display: inline-flex; border-radius: 999px; }
  .space-label { display: inline; font: 500 14px var(--sans); color: var(--text); }
  .space-link .space-n { position: static; }
}
.space-link { text-decoration: none; }
.langswitch { flex-wrap: nowrap; white-space: nowrap; }
@media (max-width: 1280px) { .langswitch a { min-width: 0; padding: 6px 8px; } }
/* cuore in testata = Mi piacciono; pieno se ne hai almeno una (28/10) */
.space-link { width: 44px; padding: 0; }
.space-link.has svg { fill: currentColor; }
@media (min-width: 1101px) { .space-link { width: 44px; padding: 0; display: inline-grid; } }
/* cuore in testata: niente stato «acceso» permanente; vicino alla foto/Accedi (28/10) */
.space-link.has svg, .space-link[aria-current="page"] svg { fill: none; }
.space-link[aria-current="page"] { background: none; }
.space-link:hover { background: var(--select); }
.acc-slot { margin-left: -24px; }
@media (min-width: 721px) and (max-width: 1100px) { .acc-slot { margin-left: -8px; } }
@media (max-width: 720px) { .acc-slot { margin-left: -4px; } }
/* «Contribuisci con un pack» (Ko-fi) */
.footer-support { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-top: 14px; }
.kofi-btn { min-height: 44px; padding: 0 18px; border: 0; border-radius: 999px; background: var(--accent); color: #fff; font: 600 15px var(--sans); cursor: pointer; }
.kofi-btn:hover { background: var(--accent-hover, #2c1640); }
.kofi-note { color: var(--muted); font-size: 14px; }
.kofi-card { position: relative; width: min(420px, calc(100% - 24px)); background: #fff; border-radius: 18px; box-shadow: var(--shadow); padding: 44px 8px 10px; }
.kofi-card iframe { display: block; width: 100%; height: min(640px, 75vh); border: 0; border-radius: 12px; background: #f9f9f9; }
.kofi-x { position: absolute; top: 4px; right: 6px; }
.kofi-alt { display: block; text-align: center; font-size: 13px; color: var(--muted); padding-top: 8px; }
@media (max-width: 720px) { .kofi-root { place-items: end stretch; } .kofi-card { width: 100%; border-radius: 18px 18px 0 0; } }
/* Sostieni: pokéball in basso a destra + pop-up Ko-fi (parere Codex, 29/10) */
.footer-support { margin-top: 10px; }
.kofi-link { font-size: 14px; color: var(--accent); }
.pball-wrap { position: fixed; right: 24px; bottom: 24px; z-index: 35; opacity: 0; transition: opacity .18s, transform .9s cubic-bezier(.3,.7,.3,1); }
.pball-wrap.in { opacity: 1; }
.pball-wrap[hidden] { display: none; }
.pball-wrap.left { transform: translateX(-24px); }
.pball { width: 48px; height: 48px; padding: 7px; border: 0; border-radius: 50%; background: transparent; cursor: pointer; display: grid; place-items: center; }
.pball svg { width: 34px; height: 34px; display: block; filter: drop-shadow(0 3px 6px rgba(37,33,43,.28)); transition: transform .9s cubic-bezier(.3,.7,.3,1); }
.pball-wrap.left .pball svg { transform: rotate(-360deg); }
.pball:hover svg { transform: scale(1.08); }
.pball-wrap.left .pball:hover svg { transform: rotate(-360deg) scale(1.08); }
.pball:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.pball-hide { position: absolute; top: -4px; right: -4px; width: 20px; height: 20px; padding: 0; border: 1px solid var(--border); border-radius: 50%; background: var(--surface); color: var(--muted); font-size: 13px; line-height: 1; cursor: pointer; opacity: 0; transition: opacity .15s; }
.pball-wrap:hover .pball-hide, .pball-hide:focus-visible { opacity: 1; }
.pball-wrap.still { transition: opacity .18s; }
@media (hover: none) { .pball-hide { opacity: .85; } }
@media (max-width: 720px) { .pball-wrap { right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); } .pball svg { width: 30px; height: 30px; } }
@media (prefers-reduced-motion: reduce) { .pball-wrap, .pball svg { transition: none !important; } }
.kofi-root { place-items: center !important; }
.kofi-card { width: min(420px, calc(100% - 24px)); max-height: calc(100vh - 24px); overflow: auto; border-radius: 18px; padding: 16px; }
.kofi-head { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 12px; }
.kofi-head h2 { margin: 0 0 4px; font: 500 22px var(--serif); color: var(--accent); }
.kofi-head p { margin: 0; color: var(--muted); font-size: 14px; }
.kofi-x { position: static; margin-left: auto; width: 44px; height: 44px; flex: none; }
.kofi-card iframe { height: min(560px, 62vh); }
@media (max-width: 720px) { .kofi-card { width: calc(100% - 24px); border-radius: 18px; } }
/* × della pokéball: bersaglio da 32 px, staccata dalla palla (revisore UI) */
.pball-hide { top: -14px; right: auto; left: -14px; width: 32px; height: 32px; font-size: 16px; display: grid; place-items: center; }
@media (hover: none) { .pball-hide { width: 36px; height: 36px; top: -16px; left: -16px; } }
.pball:focus-visible, .pball-hide:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; opacity: 1; }
