:root {
  color-scheme: light;
  --paper: #efe6d4;
  --paper-2: #e7dcc4;
  --ink: #1c1612;
  --muted: #6a5a48;
  --line: #d4c4a8;
  --accent: #8b3a22;
  --ok: #2f6b3a;
  --err: #9b1d1d;
  --light: #f7f1e4;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

html, body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: ui-sans-serif, system-ui, "Segoe UI", sans-serif;
  background: var(--paper);
  color: var(--ink);
  line-height: 1.5;
}

img, svg { display: block; max-width: 100%; }

a { color: inherit; }

.skip {
  position: absolute;
  left: 0.8rem;
  top: -3rem;
  background: var(--ink);
  color: var(--paper);
  padding: 0.4rem 0.7rem;
  z-index: 20;
}
.skip:focus { top: 0.8rem; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: #fff;
  border-bottom: 1px solid var(--line);
}
.site-header.scrolled { border-bottom-color: var(--line); }

.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  max-width: 72rem;
  margin: 0 auto;
  padding: 0.85rem 1.25rem;
}

.wordmark {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
}
.wordmark-name {
  font-size: 1.2rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 700;
}

.stamp {
  display: inline-grid;
  place-items: center;
  min-width: 3.4rem;
  height: 2.2rem;
  padding: 0 0.55rem;
  border: 2px solid var(--accent);
  color: var(--accent);
  font-weight: 700;
  letter-spacing: 0.04em;
  font-size: 0.72rem;
  white-space: nowrap;
}
.stamp-logo {
  border: 0;
  padding: 0;
  background: transparent;
  height: auto;
  min-width: 0;
}
.stamp-logo img {
  display: block;
  height: 3.1rem;
  width: auto;
  max-width: 12rem;
  object-fit: contain;
}
.nav a {
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.82rem;
  font-weight: 650;
}

.nav {
  display: flex;
  align-items: center;
  gap: 1.35rem;
  font-size: 0.95rem;
}
.nav a { text-decoration: none; }
.nav a:hover {
  text-decoration: underline;
  text-underline-offset: 0.25em;
}
.nav a[aria-current="page"],
.drawer a[aria-current="page"] {
  text-decoration: underline;
  text-underline-offset: 0.25em;
  font-weight: 700;
}
.nav-cta {
  border: 1px solid var(--ink);
  padding: 0.35rem 0.75rem;
}

.menu-btn {
  display: none;
  width: 2.4rem;
  height: 2.4rem;
  border: 1px solid var(--ink);
  background: transparent;
  cursor: pointer;
}
.menu-btn span {
  display: block;
  height: 2px;
  margin: 5px 6px;
  background: var(--ink);
}

.drawer {
  flex-direction: column;
  gap: 0.85rem;
  padding: 0 1.25rem 1.1rem;
  border-bottom: 1px solid var(--line);
}
.drawer[hidden] {
  display: none !important;
}
.drawer:not([hidden]) {
  display: flex;
}
.drawer a { text-decoration: none; font-size: 1.05rem; }

.hero {
  position: relative;
  min-height: min(78vh, 38rem);
  display: grid;
  align-items: end;
  color: var(--light);
  overflow: hidden;
}
.hero-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.hero-veil {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(20, 12, 8, 0.15) 0%, rgba(20, 12, 8, 0.72) 100%);
}
.hero-copy {
  position: relative;
  z-index: 1;
  max-width: 72rem;
  width: 100%;
  margin: 0 auto;
  padding: 5rem 1.25rem 3.2rem;
}

.kicker, .eyebrow {
  margin: 0 0 0.85rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-size: 0.72rem;
  font-weight: 700;
}
.kicker { color: #f0c9a0; }
.eyebrow { color: var(--accent); }

.hero h1,
.pigmenti h2,
.mescola h2,
.tavolozze h2,
.contatto h2 {
  margin: 0 0 1rem;
  font-family: Palatino, "Palatino Linotype", "Iowan Old Style", Georgia, serif;
  font-weight: 600;
  line-height: 1.08;
}

.hero h1 {
  font-size: clamp(2.6rem, 8vw, 5.4rem);
  max-width: 12ch;
  margin-bottom: 0.7rem;
}

.lede, .section-lede {
  max-width: 36rem;
  margin: 0 0 1.6rem;
  font-size: 1.12rem;
  color: var(--muted);
}
.lede { color: #eadcc6; }
.lede a {
  color: #fff;
  text-decoration: underline;
  text-underline-offset: 0.14em;
  font-weight: 650;
}
.lede a:hover { color: #fff; opacity: 0.9; }

.btn {
  appearance: none;
  border: 0;
  background: var(--accent);
  color: var(--light);
  font: inherit;
  font-weight: 650;
  letter-spacing: 0.04em;
  padding: 0.85rem 1.5rem;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}
.btn:hover { background: #6e2c18; }
.btn:disabled {
  background: #c4b39a;
  color: #efe6d4;
  cursor: not-allowed;
}
.btn:focus-visible {
  outline: 2px solid var(--light);
  outline-offset: 3px;
}
.btn.ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--ink);
}
.btn.ghost:hover { background: var(--paper-2); }

.pigmenti,
.mescola,
.tavolozze,
.contatto {
  max-width: 72rem;
  margin: 0 auto;
  padding: 3.4rem 1.25rem 1.2rem;
}
.pigmenti h2, .mescola h2, .tavolozze h2, .contatto h2 {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
}

.pigment-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
}

.pigment {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--light);
  color: var(--ink);
  text-align: left;
  padding: 0;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  font: inherit;
  overflow: hidden;
}
.pigment.on {
  outline: 3px solid var(--ink);
  outline-offset: 2px;
}
/* Quadrato stabile anche offline / Safari (file://) */
.pigment-shot {
  position: relative;
  display: block;
  width: 100%;
  height: 0;
  padding-bottom: 100%;
  overflow: hidden;
  background: #c8b8a0;
}
.pigment-swatch {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: block;
  width: 100%;
  height: 100%;
  margin: 0;
  border: 0;
}
.pigment-shot img,
.pigment-fallback {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}
.pigment-meta {
  display: grid;
  gap: 0.12rem;
  padding: 0.7rem 0.8rem 0.85rem;
}
.chip {
  position: absolute;
  top: 0.55rem;
  right: 0.55rem;
  min-width: 1.3rem;
  height: 1.3rem;
  border-radius: 99px;
  display: grid;
  place-items: center;
  font-size: 0.75rem;
  font-weight: 700;
  background: #1c1612;
  color: #f7f1e4;
}
.pigment:not(.on) .chip { background: transparent; color: transparent; }
.pigment-name { font-weight: 700; font-size: 0.95rem; }
.pigment-hex { font-size: 0.82rem; letter-spacing: 0.06em; color: var(--muted); }
.pigment-use { font-size: 0.85rem; color: var(--muted); }

.mix-board {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1.2fr;
  gap: 0.8rem;
  align-items: center;
  margin: 1.4rem 0 1.2rem;
}
.mix-slot, .mix-result {
  background: var(--paper-2);
  border: 1px solid var(--line);
  padding: 0.9rem;
  min-height: 8.5rem;
}
.mix-slot p, .mix-result p { margin: 0.55rem 0 0; }
.mix-plus { margin: 0; font-size: 1.4rem; color: var(--muted); }
.swatch {
  display: block;
  height: 5.2rem;
  border: 1px dashed var(--line);
  background-color: transparent;
  background-image: repeating-linear-gradient(45deg, #ddd 0 6px, #eee 6px 12px);
  background-size: auto;
  background-position: center;
}
.swatch.big { height: 6.2rem; }
.hex { font-family: ui-monospace, monospace; letter-spacing: 0.06em; color: var(--muted); }

.ratio {
  display: grid;
  gap: 0.4rem;
  max-width: 28rem;
  font-size: 0.88rem;
  font-weight: 650;
  margin-bottom: 1rem;
}
.ratio input { width: 100%; }
.ratio-pct {
  font-weight: 650;
  color: var(--muted);
  font-size: 0.9rem;
  min-height: 1.3em;
}

.tavolozze {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.2rem 1.6rem;
}
.tavolozze-copy { grid-column: 1; }
.studio-img {
  grid-column: 2;
  grid-row: 1 / span 2;
  width: 100%;
  height: 100%;
  object-fit: cover;
  min-height: 16rem;
  border: 1px solid var(--line);
}
.palette-list {
  grid-column: 1;
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1rem;
  position: relative;
  z-index: 1;
}
.palette-list > li:not(.historic-row) {
  background: var(--paper-2);
  border: 1px solid var(--line);
  padding: 1.15rem 1.15rem 1.25rem;
  overflow: visible;
}
.palette-list h3 { margin: 0 0 0.3rem; font-size: 1.05rem; line-height: 1.25; }
.palette-list p { margin: 0 0 0.85rem; color: var(--muted); font-size: 0.95rem; }
.palette-list .tipo-acquisto {
  margin: 0 0 1rem;
  max-width: 16rem;
}
.palette-card {
  overflow: visible;
}
.dots {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 0.75rem;
}
.dot {
  width: 1.85rem;
  height: 1.85rem;
  border: 1px solid rgba(0,0,0,0.2);
  flex: 0 0 auto;
  text-decoration: none;
  position: relative;
  z-index: 1;
}
.storiche {
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}
.dot:hover { outline: 2px solid var(--accent); outline-offset: 1px; }
.names {
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--muted);
  font-size: 0.88rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.55rem;
}
.names li {
  display: block;
  margin: 0;
  padding: 0;
}
.names li::before { content: none; }
.names a {
  display: inline-block;
  color: var(--ink);
  text-underline-offset: 0.18em;
  padding: 0.2rem 0.45rem;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 2px;
  line-height: 1.3;
  position: relative;
  z-index: 1;
}
.names a:hover { color: var(--accent); border-color: var(--accent); }

#analizza,
#tavolozze,
#mescola,
#pigmenti,
#contatto {
  scroll-margin-top: 4.5rem;
}
.analizza {
  max-width: 72rem;
  margin: 0 auto;
  padding: 3.4rem 1.25rem 1.2rem;
}
.analizza h2 {
  margin: 0 0 1rem;
  font-family: Palatino, "Palatino Linotype", "Iowan Old Style", Georgia, serif;
  font-weight: 600;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  line-height: 1.08;
}
.drop {
  display: grid;
  justify-items: center;
  text-align: center;
  gap: 0.7rem;
  background: #fffaf1;
  border: 2px dashed var(--accent);
  padding: 1.6rem 1.2rem 1.7rem;
  color: var(--ink);
  min-height: 11rem;
}
.drop.over { background: var(--paper-2); }
.drop-title {
  margin: 0;
  font-weight: 700;
  font-size: 1.15rem;
}
.drop-hint {
  margin: 0;
  color: var(--muted);
  max-width: 28rem;
}
.file-input {
  display: block;
  width: min(100%, 32rem);
  font: inherit;
  font-size: 1.05rem;
  padding: 0.85rem 0.7rem;
  background: #fff;
  color: var(--ink);
  border: 2px solid var(--ink);
}
.drop-file {
  margin: 0;
  font-weight: 650;
  word-break: break-word;
}
.drop-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.65rem;
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
}
.btn.hero-ghost,
.hero .btn.ghost {
  background: transparent;
  color: var(--light);
  border: 1px solid var(--light);
}
.hero .btn.ghost:hover { background: rgba(255,255,255,0.12); }
.analyze-preview {
  margin: 1rem 0 0;
  background: #fff;
  border: 2px solid var(--accent);
  padding: 0.7rem;
}
.analyze-preview img {
  width: 100%;
  max-height: 22rem;
  object-fit: contain;
  background: #f3eee4;
}
.analyze-preview figcaption {
  margin: 0.55rem 0 0;
  font-size: 0.92rem;
  color: var(--muted);
}
#analizza .form-status {
  margin: 0.85rem 0 0;
  font-weight: 650;
}
.analyze-output {
  margin: 1.4rem 0 0;
  padding: 1rem 1rem 1.2rem;
  background: #fffaf1;
  border: 2px solid var(--accent);
}
.analyze-output h3 {
  margin: 0 0 0.5rem;
  font-family: Palatino, "Palatino Linotype", "Iowan Old Style", Georgia, serif;
  font-weight: 600;
  font-size: 1.45rem;
}
#analisi-vuota {
  margin: 0;
  color: var(--muted);
}
.analyze-toolbar {
  margin: 0.75rem 0 0.85rem;
  display: grid;
  gap: 0.55rem;
}
.analyze-toolbar[hidden] {
  display: none !important;
}
.analyze-toolbar .form-status {
  margin: 0;
}
.analyze-tipo-global {
  margin: 0;
  max-width: 28rem;
}
.analyze-links {
  display: grid;
  gap: 0.35rem;
  margin-top: 0.35rem;
}

.analyze-colors {
  list-style: none;
  margin: 0.6rem 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr));
  gap: 0.75rem;
}
.analyze-card {
  background: var(--paper-2);
  border: 1px solid var(--line);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.analyze-sw {
  display: block;
  height: 5.2rem;
}
.analyze-card-body {
  padding: 0.8rem 0.9rem 1rem;
  display: grid;
  gap: 0.25rem;
}
.analyze-card-body strong { font-size: 1rem; }
.analyze-card-body .hex { margin: 0; }
.analyze-card-body .analyze-hint {
  margin: 0.35rem 0 0;
  font-size: 0.86rem;
  line-height: 1.35;
  color: var(--muted);
}
.analyze-card-body a {
  margin-top: 0.45rem;
  color: var(--ink);
  font-weight: 650;
  font-size: 0.88rem;
}
.tipo-acquisto {
  display: grid;
  gap: 0.28rem;
  margin-top: 0.55rem;
  font-size: 0.82rem;
  font-weight: 650;
  color: var(--muted);
}
.tipo-acquisto select {
  font: inherit;
  font-weight: 650;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--ink);
  padding: 0.4rem 0.45rem;
}

.contatto {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem;
  padding-bottom: 3rem;
  align-items: start;
}
.contatto-copy p:last-of-type {
  margin: 0;
  color: var(--muted);
  max-width: 28rem;
}

.form {
  display: grid;
  gap: 0.9rem;
  background: var(--light);
  border: 1px solid var(--line);
  padding: 1.2rem;
}
.form label {
  display: grid;
  gap: 0.35rem;
  font-size: 0.85rem;
  font-weight: 650;
}
.form input,
.form textarea {
  font: inherit;
  font-weight: 400;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  padding: 0.65rem 0.7rem;
}
.form input:focus,
.form textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: 0;
  border-color: transparent;
}
.form .btn { justify-self: start; }
.form-status { margin: 0; min-height: 1.3rem; font-size: 0.95rem; }
.form-status.ok { color: var(--ok); }
.form-status.err { color: var(--err); }

.site-footer {
  max-width: 72rem;
  margin: 0 auto;
  padding: 1.2rem 1.25rem 2.4rem;
  color: var(--muted);
  font-size: 0.9rem;
  border-top: 1px solid var(--line);
}

@media (max-width: 900px) {
  .pigment-grid { grid-template-columns: repeat(2, 1fr); }
  .mix-board {
    grid-template-columns: 1fr;
  }
  .mix-plus { display: none; }
  .tavolozze,
  .contatto {
    grid-template-columns: 1fr;
  }
  .tavolozze-copy,
  .palette-list,
  .studio-img,
  .historic-list {
    grid-column: 1;
    grid-row: auto;
  }
  .studio-img {
    max-height: 14rem;
    min-height: 10rem;
    margin-bottom: 0.5rem;
    order: 0;
  }
  .palette-list {
    gap: 1.15rem;
  }
  .wordmark {
    flex-wrap: wrap;
    max-width: calc(100% - 3rem);
  }
  .wordmark-name {
    font-size: 0.95rem;
  }
  .stamp-logo img {
    height: 2.6rem;
    max-width: 9.5rem;
  }
}

@media (max-width: 1120px) {
  .nav { display: none; }
  .menu-btn { display: inline-block; }
}


/* Tavolozze storiche: box a sinistra, quadro a destra (fuori dal box) */
.historic-list {
  grid-column: 1 / -1;
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1.25rem;
}
.historic-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(10rem, 16rem);
  gap: 1.25rem;
  align-items: start;
  background: transparent !important;
  border: 0 !important;
  padding: 0 !important;
  overflow: visible;
}
.historic-row .palette-card {
  background: var(--paper-2);
  border: 1px solid var(--line);
  padding: 1.15rem 1.15rem 1.35rem;
  min-height: 0;
  height: auto;
  overflow: visible;
}
.historic-ref {
  margin: 0;
  display: flex;
  flex-direction: column;
}
.historic-ref img {
  width: 100%;
  height: auto;
  min-height: 11rem;
  max-height: 16rem;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border: 1px solid var(--line);
  display: block;
  background: var(--paper-2);
}
.historic-ref figcaption {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 0.35rem;
  line-height: 1.3;
}
@media (max-width: 700px) {
  .historic-row {
    grid-template-columns: 1fr;
  }
  .historic-ref img {
    max-height: 12rem;
    min-height: 8rem;
  }
}

/* —— Teoria del colore —— */
.section-hint {
  margin: 1rem 0 0;
  font-size: 0.95rem;
  color: var(--muted);
  max-width: 36rem;
}
.section-hint a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 0.12em;
}
.section-lede a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 0.12em;
}

.teoria-main {
  max-width: 52rem;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 3rem;
}
.teoria-hero {
  margin-bottom: 1.75rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--line);
}
.teoria-hero h1 {
  margin: 0.2rem 0 0.6rem;
  font-size: clamp(1.75rem, 4vw, 2.35rem);
  line-height: 1.15;
}
.teoria-back {
  margin: 1rem 0 0;
  font-size: 0.95rem;
}
.teoria-back a {
  color: var(--accent);
  text-decoration: none;
}
.teoria-back a:hover { text-decoration: underline; }

.teoria-toc {
  background: var(--light);
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  padding: 1rem 1.15rem;
  margin-bottom: 2rem;
}
.teoria-toc-title {
  margin: 0 0 0.5rem;
  font-weight: 700;
  font-size: 0.9rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}
.teoria-toc ol {
  margin: 0;
  padding-left: 1.25rem;
}
.teoria-toc a {
  color: var(--ink);
  text-decoration: none;
}
.teoria-toc a:hover {
  color: var(--accent);
  text-decoration: underline;
}

.teoria-article section {
  margin-bottom: 2rem;
}
.teoria-article h2 {
  margin: 0 0 0.65rem;
  font-size: 1.25rem;
  line-height: 1.25;
}
.teoria-article h2 a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 0.12em;
}
.teoria-article h2 a:hover {
  color: var(--ink);
}
.teoria-article p,
.teoria-article li {
  color: var(--ink);
}
.teoria-article ul,
.teoria-article ol.teoria-steps {
  margin: 0.5rem 0 0.85rem;
  padding-left: 1.25rem;
}
.teoria-article .btn {
  display: inline-block;
  margin-top: 0.35rem;
  margin-right: 0.5rem;
}

.teoria-table-wrap {
  overflow-x: auto;
  margin: 0.85rem 0 1rem;
  border: 1px solid var(--line);
  border-radius: 0.65rem;
  background: var(--light);
}
.teoria-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}
.teoria-table th,
.teoria-table td {
  text-align: left;
  padding: 0.55rem 0.75rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.teoria-table th {
  background: var(--paper-2);
  font-weight: 650;
}
.teoria-table tr:last-child td { border-bottom: 0; }

.teoria-cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

@media (max-width: 1120px) {
  .nav a { font-size: 0.72rem; }
}

.analyze-inline-link {
  color: var(--accent);
  font-weight: 650;
  text-decoration: underline;
  text-underline-offset: 0.12em;
}
.analyze-inline-link.analyze-link-disabled {
  color: inherit;
  text-decoration: none;
  cursor: inherit;
  font-weight: 650;
}
.analyze-links a {
  color: var(--accent);
  font-size: 0.92rem;
  text-decoration: underline;
  text-underline-offset: 0.12em;
}

.popup-help {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(28, 22, 18, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.popup-help[hidden] { display: none !important; }
.popup-help-card {
  position: relative;
  max-width: 28rem;
  width: 100%;
  background: var(--light);
  border: 1px solid var(--line);
  border-radius: 0.85rem;
  padding: 1.25rem 1.35rem 1.4rem;
  box-shadow: 0 12px 40px rgba(0,0,0,0.18);
}
.popup-help-card h3 {
  margin: 0 1.5rem 0.6rem 0;
  font-size: 1.1rem;
}
.popup-help-card p,
.popup-help-card li {
  font-size: 0.95rem;
  color: var(--ink);
}
.popup-help-card ul {
  margin: 0.5rem 0 0.75rem;
  padding-left: 1.15rem;
}
.popup-help-close {
  position: absolute;
  top: 0.45rem;
  right: 0.55rem;
  border: 0;
  background: transparent;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  color: var(--muted);
}
.popup-help-alt { margin-bottom: 0.35rem; color: var(--muted); }

.section-sub {
  margin: 0.35rem 0 0.85rem;
  font-size: 1.12rem;
  color: var(--ink);
  max-width: 40rem;
  line-height: 1.45;
}
.analyze-lede {
  font-size: 0.95rem !important;
  color: var(--muted);
  line-height: 1.5;
}
.analyze-sub-mobile { display: none; }
.analyze-sub-desktop { display: block; }
@media (max-width: 720px) {
  .analyze-sub-mobile { display: block; }
  .analyze-sub-desktop { display: none; }
}

/* Disclaimer calibrazione colori */
.color-disclaimer {
  margin: 1.25rem 0 0;
  padding: 0.85rem 1rem;
  max-width: 40rem;
  font-size: 0.92rem;
  line-height: 1.45;
  color: var(--muted);
  background: var(--light);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 0.45rem;
}
.color-disclaimer a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 0.12em;
}

/* Hint fotocamera solo mobile */
.drop-hint-mobile { display: none; }
@media (max-width: 720px) {
  .drop-hint-mobile { display: inline; }
}

/* Evidenzia scelta tipologia in analisi */
.analyze-tipo-emphasis {
  font-size: 1.05rem !important;
  font-weight: 650;
  color: var(--ink);
  padding: 0.75rem 0.9rem;
  background: var(--light);
  border: 1px solid var(--line);
  border-radius: 0.55rem;
}
.analyze-tipo-emphasis select {
  margin-top: 0.45rem;
  font-weight: 500;
}

/* Tavolozze storiche: layout a prova di collasso */
.tavolozze.storiche {
  display: block;
}
.tavolozze.storiche .tavolozze-copy {
  margin-bottom: 1rem;
}
.tavolozze.storiche .historic-list,
.tavolozze.storiche [data-historic] {
  display: grid !important;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
  width: 100%;
}
.historic-row {
  display: grid !important;
  grid-template-columns: minmax(0, 1.2fr) minmax(12rem, 0.9fr);
  gap: 1.25rem;
  align-items: stretch;
  width: 100%;
}
.historic-ref {
  margin: 0;
  width: 100%;
  min-width: 0;
}
.historic-ref img {
  width: 100% !important;
  height: auto !important;
  min-height: 12rem;
  max-height: none;
  object-fit: cover;
  border: 1px solid var(--line);
  display: block !important;
  background: #ddd;
}
@media (max-width: 700px) {
  .historic-row {
    grid-template-columns: 1fr !important;
  }
}

/* Intro teoria: non usare .lede del hero (troppo chiaro) */
.teoria-intro {
  margin: 0.35rem 0 0;
  max-width: 40rem;
  font-size: 1.08rem;
  line-height: 1.5;
  color: var(--ink);
}

.footer-legal {
  margin: 0.85rem 0 0;
  max-width: 48rem;
  font-size: 0.8rem;
  line-height: 1.45;
  color: var(--muted);
}


.popup-help {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(28, 22, 18, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.popup-help[hidden] { display: none !important; }
.popup-help-card {
  position: relative;
  max-width: 28rem;
  width: 100%;
  background: var(--light, #f7f1e4);
  border: 1px solid var(--line);
  border-radius: 0.85rem;
  padding: 1.25rem 1.35rem 1.4rem;
  box-shadow: 0 12px 40px rgba(0,0,0,0.18);
  color: var(--ink);
}
.popup-help-card h3 { margin: 0 1.5rem 0.6rem 0; font-size: 1.1rem; }
.popup-help-card p, .popup-help-card li { font-size: 0.95rem; }
.popup-help-card ul { margin: 0.5rem 0 0.75rem; padding-left: 1.15rem; }
.popup-help-close {
  position: absolute; top: 0.45rem; right: 0.55rem;
  border: 0; background: transparent; font-size: 1.5rem; cursor: pointer; color: var(--muted);
}
