  :root{
    --paper:#f4f0e6;
    --paper-2:#fbf8f1;
    --ink:#141414;
    --muted:#4b4b4b;
    --line:rgba(20,20,20,.14);
    --stamp:#b63a3a;
    --stamp-ink:#ffffff;
    --clip:#2a2a2a;
    --hud:#0b6b53;
    --hud-soft:rgba(11,107,83,.10);
  }

  /* Base */
  body{ background: radial-gradient(1200px 700px at 20% 0%, #fff 0%, var(--paper) 55%, #efe8da 100%); color:var(--ink); }
  .nj-dossier{ font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Courier New", monospace;margin-top: 50px; }
  .nj-dossier a{ color:var(--hud); text-decoration:none; }
  .nj-dossier a:hover{ text-decoration:underline; }

  /* Grana carta (leggera) */
  .paper-grain{
    position: relative;
    background: linear-gradient(0deg, var(--paper-2), var(--paper));
    border: 1px solid rgba(0,0,0,.12);
    box-shadow: 0 10px 40px rgba(0,0,0,.10);
    border-radius: 18px;
    overflow: hidden;
  }
  .paper-grain:before{
    content:"";
    position:absolute; inset:0;
    background-image:
      radial-gradient(rgba(0,0,0,.05) 1px, transparent 1px);
    background-size: 18px 18px;
    opacity:.10;
    pointer-events:none;
  }

  /* Intestazione fascicolo */
  .dossier-head{
    position: relative;
    padding: 28px 28px 18px;
    border-bottom: 1px solid var(--line);
  }
  .dossier-head:after{
    content:"";
    position:absolute; left:0; right:0; bottom:0;
    height: 10px;
    background: repeating-linear-gradient(90deg, rgba(0,0,0,.07), rgba(0,0,0,.07) 2px, transparent 2px, transparent 10px);
    opacity:.35;
  }
  .stamp{
    display:inline-flex; align-items:center; gap:.5rem;
    padding: .35rem .7rem;
    background: var(--stamp);
    color: var(--stamp-ink);
    border-radius: 999px;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
    box-shadow: 0 6px 14px rgba(182,58,58,.25);
    border: 1px solid rgba(0,0,0,.15);
  }
  .stamp-outline{
    background: transparent;
    color: var(--stamp);
    border: 2px solid var(--stamp);
    box-shadow:none;
  }
  .dossier-title{
    margin: 14px 0 6px;
    font-weight: 800;
    letter-spacing: .02em;
    line-height: 1.1;
  }
  .dossier-meta{
    color: var(--muted);
    font-size: .95rem;
  }

  /* “Graffetta” decorativa */
  .paper-clip{
    position:absolute;
    top: 14px; right: 18px;
    width: 56px; height: 56px;
    border: 3px solid var(--clip);
    border-left-color: transparent;
    border-bottom-color: transparent;
    border-radius: 16px;
    transform: rotate(18deg);
    opacity:.35;
  }

  /* Scheda caso */
  .case-card{
    padding: 18px 18px;
    border-top: 1px solid var(--line);
    background: rgba(255,255,255,.35);
  }
  .case-photo{
    border-radius: 12px;
    border: 1px solid rgba(0,0,0,.18);
    box-shadow: 0 10px 18px rgba(0,0,0,.10);
  }
  .kv-row{
    display:flex; gap:10px; padding: 6px 0;
    border-bottom: 1px dashed rgba(0,0,0,.18);
  }
  .kv-row:last-child{ border-bottom:none; }
  .kv-k{ min-width: 210px; color:var(--muted); }
  .kv-v{ font-weight: 700; }

  /* Sommario sticky */
  .toc{
    position: sticky;
    top: 96px;
    padding: 14px 14px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(255,255,255,.42);
  }
  .toc .small{ color: var(--muted); }
  .toc a{ display:block; padding: 6px 8px; border-radius: 10px; }
  .toc a:hover{ background: var(--hud-soft); text-decoration:none; }

  /* Sezioni come fogli */
  .sheet{
    position: relative;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: rgba(255,255,255,.50);
    padding: 18px 18px;
  }
  .sheet + .sheet{ margin-top: 14px; }
  .sheet h2{
    font-weight: 900;
    letter-spacing:.02em;
    margin: 0 0 10px;
  }
  .sheet .rule{
    height:1px; background: var(--line);
    margin: 12px 0 12px;
  }

  /* Liste */
  .nj-list{ margin:0; padding-left: 18px; }
  .nj-list li{ margin: .35rem 0; }

  /* Blocco “hacker note” */
  .terminal-note{
    border-radius: 14px;
    border: 1px solid rgba(11,107,83,.35);
    background: linear-gradient(180deg, rgba(11,107,83,.10), rgba(11,107,83,.04));
    padding: 14px 14px;
    color: #0a3f33;
  }
  .terminal-note code{
    color: #0a3f33;
    font-weight: 800;
  }

  /* Stampa */
  @media print{
    body{ background:#fff !important; }
    .paper-grain{ box-shadow:none !important; }
    .toc{ display:none !important; }
  }