/* =============================================================
   SETTE SEGNALI — Stylesheet
   Validatore Keyword KDP, Edizione Pro
   Direzione: Italian Editorial Bold (cont.)
   ============================================================= */

/* ------------------------------------------------------------
   1. FONTS
   ------------------------------------------------------------ */
@font-face {
  font-family: 'Filson Pro';
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  src: url('fonts/FilsonProRegular.otf') format('opentype');
}
@font-face {
  font-family: 'Filson Pro';
  font-weight: 400;
  font-style: italic;
  font-display: swap;
  src: url('fonts/FilsonProBookItalic.otf') format('opentype');
}
@font-face {
  font-family: 'Filson Pro';
  font-weight: 700;
  font-style: normal;
  font-display: swap;
  src: url('fonts/FilsonProBold.otf') format('opentype');
}
@font-face {
  font-family: 'Filson Pro';
  font-weight: 900;
  font-style: normal;
  font-display: swap;
  src: url('fonts/FilsonProBlack.otf') format('opentype');
}

/* ------------------------------------------------------------
   2. RESET
   ------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }
html, body, h1, h2, h3, h4, p, fieldset, legend, button, input, ul, ol, figure {
  margin: 0; padding: 0;
}
fieldset { border: 0; }
button { font: inherit; cursor: pointer; background: none; border: 0; color: inherit; }
input { font: inherit; }
a { color: inherit; }
img { display: block; max-width: 100%; height: auto; }
ol, ul { list-style: none; }

/* ------------------------------------------------------------
   3. TOKENS
   ------------------------------------------------------------ */
:root {
  --lsp-violet:        #5A2E90;
  --lsp-violet-deep:   #3B1B68;
  --lsp-violet-soft:   #EDE5F7;
  --lsp-yellow:        #FCD627;
  --lsp-yellow-deep:   #E5BF1A;

  --paper:             #FAF8F2;
  --paper-card:        #FFFDF7;
  --paper-edge:        #EAE3D5;
  --ink:               #1A1814;
  --ink-soft:          #574F44;
  --ink-faint:         #9A9285;

  --signal-green:      #2D7A3A;
  --signal-green-soft: #DFEEDC;
  --signal-yellow:     #C28A05;
  --signal-yellow-soft:#FAEFCF;
  --signal-red:        #B91C1C;
  --signal-red-soft:   #F4DAD7;

  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 24px;
  --s-6: 32px;
  --s-7: 48px;
  --s-8: 72px;
  --s-9: 112px;

  --font-display: 'Filson Pro', Georgia, serif;
  --font-body:    'Filson Pro', -apple-system, BlinkMacSystemFont, sans-serif;

  --radius-sm: 6px;
  --radius-md: 12px;
  --shadow-paper: 0 1px 0 var(--paper-edge), 0 12px 24px -16px rgba(58, 30, 96, 0.18);
  --shadow-lift:  0 2px 0 var(--paper-edge), 0 24px 40px -20px rgba(58, 30, 96, 0.32);
}

/* ------------------------------------------------------------
   4. BASE
   ------------------------------------------------------------ */
html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.55;
  color: var(--ink);
  background-color: var(--paper);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.5;
  background-image: url("data:image/svg+xml;utf8,<svg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.1 0 0 0 0 0.1 0 0 0 0 0.08 0 0 0 0.06 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  mix-blend-mode: multiply;
}

main, header, footer { position: relative; z-index: 1; }

::selection { background: var(--lsp-yellow); color: var(--ink); }

a { color: var(--lsp-violet); text-underline-offset: 3px; }

em { font-style: italic; }

/* ------------------------------------------------------------
   5. CONTAINER
   ------------------------------------------------------------ */
.container {
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: 0 var(--s-5);
}

/* ------------------------------------------------------------
   6. MASTHEAD
   ------------------------------------------------------------ */
.masthead {
  border-bottom: 1px solid var(--paper-edge);
  padding: var(--s-4) 0;
  background: var(--paper);
}
.masthead__inner {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 var(--s-5);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-4);
}
.masthead__brand {
  display: inline-flex;
  align-items: center;
  gap: var(--s-3);
  text-decoration: none;
  color: var(--ink);
}
.masthead__logo { width: 36px; height: 36px; display: block; }
.masthead__wordmark {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.masthead__edition {
  font-family: var(--font-body);
  font-style: italic;
  font-size: 13px;
  color: var(--ink-faint);
  letter-spacing: 0.02em;
}

@media (max-width: 480px) {
  .masthead__edition { display: none; }
  .masthead__wordmark { font-size: 12px; }
}

/* ------------------------------------------------------------
   7. HERO
   ------------------------------------------------------------ */
.hero {
  padding: var(--s-8) 0 var(--s-7);
  text-align: center;
  position: relative;
}
.hero::before,
.hero::after {
  content: '';
  display: block;
  width: 64px;
  height: 1px;
  background: var(--ink);
  margin: 0 auto var(--s-5);
}
.hero::after { margin: var(--s-5) auto 0; }

.hero__kicker {
  font-family: var(--font-body);
  font-style: italic;
  font-size: 13px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: var(--s-4);
}

.hero__title {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(64px, 14vw, 144px);
  line-height: 0.88;
  letter-spacing: -0.04em;
  color: var(--ink);
  display: inline-flex;
  align-items: baseline;
  gap: 0.08em;
  flex-wrap: nowrap;
}
.hero__title-word { display: inline-block; }
.hero__title-number {
  display: inline-block;
  color: var(--lsp-violet);
  font-size: 1.5em;
  line-height: 0.8;
  letter-spacing: -0.06em;
  position: relative;
  transform: translateY(0.04em);
  background-image: radial-gradient(circle at 50% 55%, var(--lsp-yellow) 0%, var(--lsp-yellow) 38%, transparent 39%);
  background-repeat: no-repeat;
  padding: 0 0.05em;
}

.hero__lede {
  margin-top: var(--s-5);
  font-size: clamp(16px, 2vw, 19px);
  line-height: 1.5;
  color: var(--ink-soft);
  max-width: 40ch;
  margin-left: auto;
  margin-right: auto;
}
.hero__lede em {
  color: var(--ink);
  font-weight: 700;
  font-style: italic;
}

@media (max-width: 520px) {
  .hero { padding: var(--s-6) 0 var(--s-6); }
  .hero__title {
    font-size: clamp(54px, 18vw, 96px);
    gap: 0.06em;
  }
}

/* ------------------------------------------------------------
   8. KEYWORD BLOCK
   ------------------------------------------------------------ */
.keyword-block {
  margin-bottom: var(--s-7);
  border-top: 1px solid var(--paper-edge);
  border-bottom: 1px solid var(--paper-edge);
  padding: var(--s-5) 0;
}
.keyword-block__label {
  display: flex;
  align-items: baseline;
  gap: var(--s-3);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: var(--s-3);
  flex-wrap: wrap;
}
.keyword-block__num {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--lsp-violet);
  background: var(--lsp-yellow);
  padding: 2px 6px;
  border-radius: 2px;
}
.keyword-block__hint {
  font-weight: 400;
  font-style: italic;
  text-transform: none;
  letter-spacing: 0;
  color: var(--ink-faint);
}
.keyword-block__input {
  display: block;
  width: 100%;
  padding: var(--s-3) 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(20px, 2.6vw, 26px);
  color: var(--ink);
  background: transparent;
  border: 0;
  border-bottom: 2px solid var(--ink);
  border-radius: 0;
  outline: none;
  transition: border-color 200ms ease;
}
.keyword-block__input::placeholder {
  color: var(--ink-faint);
  font-style: italic;
  font-weight: 400;
}
.keyword-block__input:focus { border-bottom-color: var(--lsp-violet); }

/* ------------------------------------------------------------
   9. GATES (segnali)
   ------------------------------------------------------------ */
.segnali {
  display: flex;
  flex-direction: column;
  gap: var(--s-5);
}

.gate {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--s-4) var(--s-5);
  align-items: start;
  background: var(--paper-card);
  border: 1px solid var(--paper-edge);
  border-radius: var(--radius-md);
  padding: var(--s-5);
  box-shadow: var(--shadow-paper);
  transition: opacity 300ms ease, transform 200ms ease;
}

.gate__num {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(56px, 9vw, 80px);
  line-height: 0.9;
  letter-spacing: -0.04em;
  color: transparent;
  -webkit-text-fill-color: transparent;
  -webkit-text-stroke: 1px var(--lsp-violet);
}

.gate__body {
  display: flex;
  flex-direction: column;
  gap: var(--s-4);
  padding-top: var(--s-2);
}

.gate__title {
  display: flex;
  align-items: flex-start;
  gap: var(--s-3);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(17px, 2.2vw, 21px);
  line-height: 1.3;
  color: var(--ink);
}
.gate__title em {
  font-weight: 700;
  font-style: italic;
  color: var(--lsp-violet);
}
.gate__title span:first-child { flex: 1; }

.gate__help {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1.5px solid var(--ink);
  background: transparent;
  color: var(--ink);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 180ms ease;
  margin-top: 2px;
}
.gate__help:hover,
.gate__help:focus-visible {
  background: var(--lsp-yellow);
  border-color: var(--ink);
  color: var(--ink);
  transform: rotate(-6deg);
  outline: none;
}

@media (min-width: 720px) {
  .gate {
    grid-template-columns: 1fr;
    padding-left: 110px;
  }
  .gate__num {
    position: absolute;
    top: var(--s-5);
    left: var(--s-5);
    font-size: 96px;
  }
  .gate__body { padding-top: 0; }
}

/* ------------------------------------------------------------
   10. CHOICE BUTTONS (1, 2, 3 o 4 opzioni)
   ------------------------------------------------------------ */
.choice-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s-3);
}
.choice-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s-3);
}
.choice-stack {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s-3);
}

@media (min-width: 560px) {
  .choice-grid { grid-template-columns: repeat(3, 1fr); }
}

.choice {
  min-height: 56px;
  padding: var(--s-3) var(--s-4);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.02em;
  text-align: left;
  color: var(--ink);
  background: var(--paper);
  border: 1.5px solid var(--ink);
  border-radius: var(--radius-md);
  display: inline-flex;
  align-items: center;
  gap: var(--s-3);
  transition: background 180ms ease, color 180ms ease, border-color 180ms ease, transform 120ms ease, box-shadow 180ms ease;
  position: relative;
  line-height: 1.3;
}
.choice__label {
  display: inline-block;
  flex: 1;
}
.choice__label em {
  font-style: italic;
  font-weight: 700;
}

/* Dot semaforo (signal) — colore inerente per opzione */
.choice__dot {
  flex-shrink: 0;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--ink-faint);
  border: 1.5px solid var(--ink);
  transition: background 180ms ease, transform 180ms ease;
}
.choice[data-color="verde"] .choice__dot { background: var(--signal-green); border-color: var(--signal-green); }
.choice[data-color="giallo"] .choice__dot { background: var(--signal-yellow); border-color: var(--signal-yellow); }
.choice[data-color="rosso"] .choice__dot { background: var(--signal-red); border-color: var(--signal-red); }

/* Hover */
.choice:hover:not([data-selected]) {
  background: var(--lsp-yellow);
  border-color: var(--ink);
  transform: translateY(-1px);
}

/* Selected — sfondo viola con shadow gialla (stile v1) */
.choice[data-selected] {
  background: var(--lsp-violet);
  border-color: var(--lsp-violet);
  color: var(--paper);
  box-shadow: 4px 4px 0 var(--lsp-yellow);
  transform: translate(-1px, -1px);
}
.choice[data-selected] .choice__label em { color: var(--lsp-yellow); }
.choice[data-selected] .choice__dot {
  border-color: var(--paper);
  transform: scale(1.15);
}

.choice:focus-visible {
  outline: 3px solid var(--lsp-yellow);
  outline-offset: 3px;
}

/* Per le opzioni a 4 (alta domanda), testo più piccolo perché lungo */
.choice-stack .choice {
  font-size: 14px;
  min-height: 60px;
}

/* ------------------------------------------------------------
   11. FORM ACTIONS
   ------------------------------------------------------------ */
.form-actions {
  display: flex;
  justify-content: center;
  margin-top: var(--s-3);
}

.reset-btn {
  padding: var(--s-2) var(--s-4);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
  background: transparent;
  border: 1px solid var(--paper-edge);
  border-radius: 999px;
  transition: all 180ms ease;
}
.reset-btn:hover {
  color: var(--ink);
  border-color: var(--ink);
  background: var(--paper-card);
}

/* ------------------------------------------------------------
   12. VERDICT
   ------------------------------------------------------------ */
.verdict {
  margin-top: var(--s-7);
  padding: var(--s-6) var(--s-5);
  background: var(--paper-card);
  border: 1px solid var(--paper-edge);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-paper);
  position: relative;
  transition: all 300ms ease;
}

.verdict--placeholder {
  text-align: center;
  background: transparent;
  border: 1px dashed var(--paper-edge);
  box-shadow: none;
  padding: var(--s-7) var(--s-5);
}
.verdict__placeholder {
  font-family: var(--font-body);
  font-style: italic;
  font-size: 15px;
  color: var(--ink-faint);
}

.verdict__topbar {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: var(--s-4);
}
.verdict__topbar::before,
.verdict__topbar::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--paper-edge);
}

.verdict__heading {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(26px, 4.6vw, 40px);
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin-bottom: var(--s-2);
  text-align: center;
}
.verdict__heading-mark {
  display: inline-block;
  margin-right: var(--s-2);
  font-size: 0.8em;
  vertical-align: 4%;
}
.verdict__score {
  display: block;
  font-family: var(--font-display);
  font-weight: 400;
  font-style: italic;
  font-size: 15px;
  letter-spacing: 0.04em;
  color: var(--ink-faint);
  margin-top: var(--s-3);
  text-align: center;
}
.verdict__main {
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  text-align: center;
  max-width: 56ch;
  margin: var(--s-4) auto var(--s-5);
}
.verdict__main em { font-style: italic; font-weight: 700; }

/* Recap dei 7 punti dentro al verdict */
.verdict__recap {
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
  margin: var(--s-5) 0;
  padding: var(--s-4);
  background: var(--paper);
  border: 1px solid var(--paper-edge);
  border-radius: var(--radius-sm);
}
.verdict__recap-row {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  align-items: center;
  gap: var(--s-3);
  font-size: 14px;
  line-height: 1.4;
}
.verdict__recap-num {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--ink-faint);
}
.verdict__recap-name {
  color: var(--ink);
  font-weight: 700;
}
.verdict__recap-name em { color: var(--ink-soft); font-weight: 400; font-style: italic; }
.verdict__recap-badge {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid currentColor;
}
.verdict__recap-badge--verde  { color: var(--signal-green);  background: var(--signal-green-soft); }
.verdict__recap-badge--giallo { color: var(--signal-yellow); background: var(--signal-yellow-soft); }
.verdict__recap-badge--rosso  { color: var(--signal-red);    background: var(--signal-red-soft); }

/* Colore-codifica del verdict box */
.verdict--verde {
  background: var(--signal-green-soft);
  border-color: var(--signal-green);
}
.verdict--verde .verdict__heading { color: var(--signal-green); }
.verdict--giallo {
  background: var(--signal-yellow-soft);
  border-color: var(--signal-yellow);
}
.verdict--giallo .verdict__heading { color: var(--signal-yellow); }
.verdict--rosso {
  background: var(--signal-red-soft);
  border-color: var(--signal-red);
}
.verdict--rosso .verdict__heading { color: var(--signal-red); }

.verdict__cta {
  margin-top: var(--s-5);
  padding-top: var(--s-5);
  border-top: 1px solid var(--paper-edge);
  text-align: center;
}
.verdict__cta-kicker {
  font-family: var(--font-body);
  font-style: italic;
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: var(--s-3);
}
.verdict__cta-text {
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink);
  max-width: 50ch;
  margin: 0 auto var(--s-5);
}
.cta-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-3) var(--s-6);
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  border-radius: 999px;
  box-shadow: 4px 4px 0 var(--lsp-yellow);
  transition: transform 180ms ease, box-shadow 180ms ease;
}
.cta-btn:hover {
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 var(--lsp-yellow);
}
.cta-btn::after { content: '→'; font-size: 16px; }

.verdict__save {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  margin-top: var(--s-4);
  padding: var(--s-2) var(--s-4);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--lsp-violet);
  background: var(--paper);
  border: 1.5px dashed var(--lsp-violet);
  border-radius: 999px;
  transition: all 180ms ease;
}
.verdict__save:hover {
  background: var(--lsp-violet);
  color: var(--paper);
  border-style: solid;
}
.verdict__save[data-saved="true"] {
  background: var(--signal-green-soft);
  border-color: var(--signal-green);
  color: var(--signal-green);
  border-style: solid;
}

/* ------------------------------------------------------------
   13. TOOLTIP
   ------------------------------------------------------------ */
.tooltip {
  position: absolute;
  z-index: 100;
  max-width: 340px;
  padding: var(--s-4);
  background: var(--ink);
  color: var(--paper);
  border-radius: var(--radius-md);
  box-shadow: 0 12px 32px -8px rgba(26, 24, 20, 0.4);
  font-size: 14px;
  line-height: 1.5;
}
.tooltip[hidden] { display: none; }
.tooltip::before {
  content: '';
  position: absolute;
  top: -7px;
  left: 24px;
  width: 14px;
  height: 14px;
  background: var(--ink);
  transform: rotate(45deg);
  border-radius: 2px;
}
.tooltip__close {
  position: absolute;
  top: 6px;
  right: 8px;
  width: 24px;
  height: 24px;
  font-size: 18px;
  font-weight: 700;
  color: var(--paper);
  opacity: 0.6;
  border-radius: 50%;
  transition: opacity 150ms ease;
}
.tooltip__close:hover { opacity: 1; }
#tooltip-text { margin: 0; padding-right: 18px; }

@media (max-width: 480px) {
  .tooltip { max-width: calc(100vw - 32px); }
}

/* ------------------------------------------------------------
   14. HISTORY
   ------------------------------------------------------------ */
.history {
  margin-top: var(--s-8);
  padding-top: var(--s-7);
  border-top: 1px solid var(--paper-edge);
}
.history__head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--s-4);
  margin-bottom: var(--s-5);
  flex-wrap: wrap;
}
.history__title {
  display: flex;
  flex-direction: column;
  gap: var(--s-1);
  font-family: var(--font-display);
}
.history__title-kicker {
  font-style: italic;
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-faint);
  font-weight: 400;
}
.history__title-text {
  font-weight: 900;
  font-size: clamp(22px, 3.4vw, 28px);
  letter-spacing: -0.02em;
  color: var(--ink);
}
.history__actions {
  display: flex;
  gap: var(--s-2);
  flex-wrap: wrap;
}
.history__btn {
  padding: var(--s-2) var(--s-4);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-soft);
  background: var(--paper-card);
  border: 1px solid var(--paper-edge);
  border-radius: 999px;
  transition: all 180ms ease;
}
.history__btn:hover {
  color: var(--ink);
  border-color: var(--ink);
}
.history__btn--primary {
  background: var(--lsp-violet);
  color: var(--paper);
  border-color: var(--lsp-violet);
  box-shadow: 3px 3px 0 var(--lsp-yellow);
}
.history__btn--primary:hover {
  background: var(--lsp-violet-deep);
  border-color: var(--lsp-violet-deep);
  color: var(--paper);
  transform: translate(-1px, -1px);
  box-shadow: 4px 4px 0 var(--lsp-yellow);
}

.history__list {
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
}
.history__item {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-3) var(--s-4);
  background: var(--paper-card);
  border: 1px solid var(--paper-edge);
  border-radius: var(--radius-sm);
  font-size: 14px;
}
.history__item-date {
  font-family: var(--font-display);
  font-weight: 400;
  font-style: italic;
  font-size: 12px;
  color: var(--ink-faint);
  white-space: nowrap;
}
.history__item-keyword {
  font-weight: 700;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.history__item-keyword--empty {
  font-style: italic;
  font-weight: 400;
  color: var(--ink-faint);
}
.history__item-verdict {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 999px;
}
.history__item-verdict--verde  { color: var(--signal-green);  background: var(--signal-green-soft); }
.history__item-verdict--giallo { color: var(--signal-yellow); background: var(--signal-yellow-soft); }
.history__item-verdict--rosso  { color: var(--signal-red);    background: var(--signal-red-soft); }
.history__item-del {
  width: 28px;
  height: 28px;
  font-size: 18px;
  color: var(--ink-faint);
  border-radius: 50%;
  transition: all 150ms ease;
}
.history__item-del:hover {
  background: var(--signal-red-soft);
  color: var(--signal-red);
}
.history__note {
  margin-top: var(--s-4);
  font-size: 12px;
  font-style: italic;
  color: var(--ink-faint);
  line-height: 1.5;
}
@media (max-width: 520px) {
  .history__item {
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
  }
  .history__item-date {
    grid-column: 1 / 3;
    grid-row: 1;
  }
  .history__item-keyword {
    grid-column: 1;
    grid-row: 2;
  }
  .history__item-verdict {
    grid-column: 2;
    grid-row: 2;
  }
  .history__item-del {
    grid-column: 2;
    grid-row: 1;
    justify-self: end;
  }
}

/* ------------------------------------------------------------
   15. COLOPHON
   ------------------------------------------------------------ */
.colophon {
  margin-top: var(--s-9);
  padding: var(--s-7) 0 var(--s-6);
  border-top: 1px solid var(--paper-edge);
  background: transparent;
}
.colophon__inner {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 var(--s-5);
  display: flex;
  align-items: center;
  gap: var(--s-4);
  flex-wrap: wrap;
  justify-content: center;
  text-align: center;
}
.colophon__mark img { width: 48px; height: 48px; display: block; }
.colophon__text {
  font-size: 13px;
  line-height: 1.55;
  color: var(--ink-soft);
}
.colophon__text strong { color: var(--ink); font-weight: 700; }
.colophon__text a { color: var(--lsp-violet); text-decoration: underline; }

@media (min-width: 600px) {
  .colophon__inner {
    flex-wrap: nowrap;
    text-align: left;
    justify-content: flex-start;
  }
}

/* ------------------------------------------------------------
   16. UTILITIES
   ------------------------------------------------------------ */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

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