/* ==========================================================================
   editorial-hub — design system
   Redazione su carta calda: serif per ciò che si legge (titoli, prosa),
   sans per ciò che si usa (comandi, etichette, dati). Un solo accento,
   terracotta, riservato ad azioni, selezione e stato corrente.
   Tema chiaro e scuro dagli stessi token.
   ========================================================================== */

:root {
  color-scheme: light;

  /* Superfici */
  --paper: #fbf8f2;          /* fondo pagina */
  --surface: #ffffff;        /* pannelli, righe, campi */
  --sunken: #f3eee4;         /* secondo livello: barre, intestazioni tabella */
  --hover: #f6f1e8;

  /* Inchiostri */
  --ink: #1d1a15;
  --ink-soft: #4a443a;
  --muted: #776f62;          /* ≥4.5:1 su paper e surface */
  --line: #e7e0d3;
  --line-strong: #d6cdbc;

  /* Accento */
  --accent: #b5400f;
  --accent-ink: #ffffff;
  --accent-soft: #f8e6dc;

  /* Semantici: fondo tenue + inchiostro */
  --ok-bg: #e6f1e9;   --ok-fg: #1e6b45;
  --warn-bg: #f8eed6; --warn-fg: #85580a;
  --err-bg: #f9e4e1;  --err-fg: #a8281b;
  --info-bg: #e7edf5; --info-fg: #2d4f7c;
  --neutral-bg: #eee9df; --neutral-fg: #5e574b;

  /* Tipografia */
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --serif: "Source Serif 4", Charter, Georgia, "Times New Roman", serif;
  --mono: ui-monospace, "SFMono-Regular", Menlo, monospace;

  /* Forma */
  --radius: 12px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 2px rgba(29, 26, 21, 0.06);
  --shadow: 0 8px 28px -6px rgba(29, 26, 21, 0.16);
  --ring: 0 0 0 3px color-mix(in srgb, var(--accent) 28%, transparent);

  /* Larghezze */
  --measure: 42rem;   /* colonna di lettura/scrittura */
  --wide: 74rem;      /* pagine operative */
  --aside: 19rem;     /* pannello laterale del dettaglio */
  --gutter: clamp(1rem, 3vw, 2rem);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --paper: #16130f;
    --surface: #1e1a15;
    --sunken: #241f19;
    --hover: #2a241d;
    --ink: #eee7da;
    --ink-soft: #cfc6b6;
    --muted: #a59b8a;
    --line: #322b23;
    --line-strong: #463d32;
    --accent: #ec8452;
    --accent-ink: #1a120c;
    --accent-soft: #3a2418;
    --ok-bg: #16301f;   --ok-fg: #7fd1a1;
    --warn-bg: #352812; --warn-fg: #e8bd66;
    --err-bg: #3a1a16;  --err-fg: #f09484;
    --info-bg: #1b2738; --info-fg: #9dbbe6;
    --neutral-bg: #2a251e; --neutral-fg: #bdb3a2;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow: 0 10px 30px -8px rgba(0, 0, 0, 0.6);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #16130f; --surface: #1e1a15; --sunken: #241f19; --hover: #2a241d;
  --ink: #eee7da; --ink-soft: #cfc6b6; --muted: #a59b8a;
  --line: #322b23; --line-strong: #463d32;
  --accent: #ec8452; --accent-ink: #1a120c; --accent-soft: #3a2418;
  --ok-bg: #16301f; --ok-fg: #7fd1a1; --warn-bg: #352812; --warn-fg: #e8bd66;
  --err-bg: #3a1a16; --err-fg: #f09484; --info-bg: #1b2738; --info-fg: #9dbbe6;
  --neutral-bg: #2a251e; --neutral-fg: #bdb3a2;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4); --shadow: 0 10px 30px -8px rgba(0, 0, 0, 0.6);
}

/* --- Base --------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scrollbar-color: var(--line-strong) transparent; }
body {
  margin: 0;
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-wrap: break-word;
  caret-color: var(--accent);
}
::selection { background: color-mix(in srgb, var(--accent) 24%, transparent); }
a { color: var(--accent); text-decoration: none; text-underline-offset: 3px; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3 { text-wrap: balance; }
.eh-muted { color: var(--muted); }
.eh-num { font-variant-numeric: tabular-nums; }
.eh-visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}
.eh-icon { width: 1rem; height: 1rem; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

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

/* --- Header ------------------------------------------------------------- */
.eh-header {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 1.5rem;
  min-height: 3.5rem;
  padding: 0 var(--gutter);
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: saturate(1.3) blur(12px);
  border-bottom: 1px solid var(--line);
}
.eh-brand {
  display: inline-flex; align-items: center; gap: 0.55rem;
  font-family: var(--serif); font-weight: 600; font-size: 1.12rem;
  letter-spacing: -0.01em; color: var(--ink); white-space: nowrap;
}
.eh-brand:hover { text-decoration: none; }
.eh-brand__mark {
  width: 1.55rem; height: 1.55rem; display: grid; place-items: center;
  background: var(--ink); color: var(--paper); border-radius: 6px;
  font-size: 0.9rem; font-weight: 700;
}
.eh-nav { display: flex; align-items: center; gap: 0.25rem; flex: 1; min-width: 0; }
.eh-nav__link {
  position: relative;
  padding: 0.4rem 0.7rem; border-radius: var(--radius-sm);
  color: var(--ink-soft); font-weight: 500; font-size: 0.93rem; white-space: nowrap;
}
.eh-nav__link:hover { color: var(--ink); background: var(--hover); text-decoration: none; }
.eh-nav__link.is-active { color: var(--ink); }
.eh-nav__link.is-active::after {
  content: ""; position: absolute; left: 0.7rem; right: 0.7rem; bottom: -0.62rem;
  height: 2px; border-radius: 2px; background: var(--accent);
}
.eh-nav__end { margin-left: auto; display: flex; align-items: center; gap: 0.5rem; }

/* Menu a tendina (Nuovo, Account) su <details>: nativo, accessibile da tastiera. */
.eh-menu { position: relative; }
.eh-menu > summary { list-style: none; cursor: pointer; }
.eh-menu > summary::-webkit-details-marker { display: none; }
.eh-menu__panel {
  position: absolute; right: 0; top: calc(100% + 0.4rem); z-index: 40;
  min-width: 15rem; padding: 0.35rem;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
  display: grid; gap: 0.1rem;
}
.eh-menu__item {
  display: grid; gap: 0.05rem; padding: 0.55rem 0.7rem; border-radius: var(--radius-sm);
  color: var(--ink); font-size: 0.92rem; font-weight: 500;
  background: none; border: 0; text-align: left; font-family: inherit; cursor: pointer; width: 100%;
}
.eh-menu__item small { color: var(--muted); font-weight: 400; font-size: 0.8rem; }
.eh-menu__item:hover { background: var(--hover); text-decoration: none; }
.eh-menu__sep { height: 1px; background: var(--line); margin: 0.3rem 0.2rem; }
.eh-menu__row { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; padding: 0.45rem 0.7rem; font-size: 0.88rem; color: var(--ink-soft); }
.eh-menu__row form { margin: 0; }
.eh-avatar {
  width: 2rem; height: 2rem; border-radius: 50%; display: grid; place-items: center;
  background: var(--sunken); color: var(--ink-soft); font-weight: 600; font-size: 0.85rem;
  border: 1px solid var(--line);
}
.eh-menu[open] .eh-avatar, .eh-avatar:hover { border-color: var(--line-strong); color: var(--ink); }

.eh-nav-toggle {
  display: none; margin-left: auto;
  width: 2.5rem; height: 2.5rem; place-items: center;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--ink); cursor: pointer;
}
.eh-header--slim { justify-content: center; }

/* --- Layout ------------------------------------------------------------- */
.eh-main { max-width: var(--wide); margin: 0 auto; padding: 2rem var(--gutter) 4rem; }
.eh-main--reading { max-width: calc(var(--measure) + 2 * var(--gutter)); }
.eh-main--detail { max-width: calc(var(--measure) + var(--aside) + 4rem + 2 * var(--gutter)); }
.eh-main--auth { max-width: 26rem; padding-top: 3.5rem; }

.eh-page-head {
  display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between;
  gap: 1rem 1.5rem; margin-bottom: 1.5rem;
}
.eh-page-head h1 {
  margin: 0; font-family: var(--serif); font-weight: 600;
  font-size: 1.9rem; line-height: 1.15; letter-spacing: -0.02em;
}
.eh-page-head p { margin: 0.3rem 0 0; color: var(--muted); }
.eh-page-head__actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.eh-back { display: inline-flex; align-items: center; gap: 0.35rem; margin-bottom: 0.75rem; color: var(--muted); font-size: 0.88rem; }
.eh-back:hover { color: var(--ink); text-decoration: none; }

.eh-section { margin-top: 2.5rem; }
.eh-section__head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0.5rem 1rem; margin-bottom: 0.85rem; }
.eh-section__head h2 { margin: 0; font-family: var(--serif); font-weight: 600; font-size: 1.3rem; letter-spacing: -0.01em; }
.eh-section__head p { margin: 0; color: var(--muted); font-size: 0.88rem; }

/* --- Bottoni ------------------------------------------------------------ */
.eh-button {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.45rem;
  min-height: 2.4rem; padding: 0 1rem;
  background: var(--ink); color: var(--paper);
  border: 1px solid var(--ink); border-radius: 999px;
  font: inherit; font-size: 0.9rem; font-weight: 550; white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.08s ease;
}
.eh-button:hover { text-decoration: none; background: color-mix(in srgb, var(--ink) 86%, var(--paper)); }
.eh-button:active { transform: translateY(1px); }
.eh-button:disabled, .eh-button[aria-disabled="true"] { opacity: 0.45; cursor: not-allowed; transform: none; }
.eh-button--accent { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.eh-button--accent:hover { background: color-mix(in srgb, var(--accent) 88%, var(--ink)); }
.eh-button--ghost { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.eh-button--ghost:hover { background: var(--hover); border-color: var(--muted); }
.eh-button--quiet { background: transparent; color: var(--ink-soft); border-color: transparent; }
.eh-button--quiet:hover { background: var(--hover); color: var(--ink); }
.eh-button--warn { background: var(--warn-fg); border-color: var(--warn-fg); color: var(--surface); }
.eh-button--sm { min-height: 2rem; padding: 0 0.8rem; font-size: 0.84rem; }
.eh-button--icon { width: 2rem; min-height: 2rem; padding: 0; }
.eh-button--block { width: 100%; }

/* --- Badge di stato ----------------------------------------------------- */
.eh-badge {
  display: inline-flex; align-items: center; gap: 0.35rem;
  padding: 0.12rem 0.55rem; border-radius: 999px;
  font-size: 0.74rem; font-weight: 600; white-space: nowrap;
  background: var(--neutral-bg); color: var(--neutral-fg);
}
.eh-badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.eh-badge--ready { background: var(--info-bg); color: var(--info-fg); }
.eh-badge--published, .eh-badge--human { background: var(--ok-bg); color: var(--ok-fg); }
.eh-badge--scheduled, .eh-badge--mixed { background: var(--warn-bg); color: var(--warn-fg); }
.eh-badge--failed, .eh-badge--ai { background: var(--err-bg); color: var(--err-fg); }
.eh-badge--plain::before { display: none; }
a.eh-badge:hover { text-decoration: none; filter: brightness(0.97); }

/* Pallino canale (lista articoli): stato su LinkedIn/Substack a colpo d'occhio. */
.eh-chan {
  display: inline-flex; align-items: center; gap: 0.3rem;
  font-size: 0.78rem; color: var(--muted); white-space: nowrap;
}
.eh-chan__dot { width: 8px; height: 8px; border-radius: 50%; border: 1.5px solid var(--line-strong); }
.eh-chan--published .eh-chan__dot { background: var(--ok-fg); border-color: var(--ok-fg); }
.eh-chan--scheduled .eh-chan__dot { background: var(--warn-fg); border-color: var(--warn-fg); }
.eh-chan--failed .eh-chan__dot { background: var(--err-fg); border-color: var(--err-fg); }
.eh-chan--published, .eh-chan--scheduled { color: var(--ink-soft); }

/* --- Messaggi ----------------------------------------------------------- */
.eh-messages { max-width: var(--wide); margin: 1rem auto 0; padding: 0 var(--gutter); list-style: none; display: grid; gap: 0.5rem; }
.eh-message {
  padding: 0.65rem 0.95rem; border-radius: var(--radius-sm);
  background: var(--ok-bg); color: var(--ok-fg); font-size: 0.9rem;
}
.eh-message--info { background: var(--info-bg); color: var(--info-fg); }
.eh-message--warning { background: var(--warn-bg); color: var(--warn-fg); }
.eh-message--error { background: var(--err-bg); color: var(--err-fg); }

/* --- Stato vuoto -------------------------------------------------------- */
.eh-empty {
  padding: 3rem 1.5rem; text-align: center;
  border: 1px dashed var(--line-strong); border-radius: var(--radius);
}
.eh-empty h2 { margin: 0 0 0.4rem; font-family: var(--serif); font-weight: 600; font-size: 1.3rem; }
.eh-empty p { margin: 0 0 1.25rem; color: var(--muted); }

/* --- Form --------------------------------------------------------------- */
.eh-field { display: grid; gap: 0.35rem; }
.eh-field__label { font-weight: 600; font-size: 0.86rem; color: var(--ink-soft); }
.eh-field__help { margin: 0; color: var(--muted); font-size: 0.8rem; }
.eh-field__error { margin: 0; color: var(--err-fg); font-size: 0.82rem; }
.eh-field--invalid .eh-control { border-color: var(--err-fg); }
.eh-field--check { display: flex; align-items: center; gap: 0.55rem; }
.eh-field--check .eh-field__label { margin: 0; }
.eh-control {
  width: 100%; min-height: 2.4rem; padding: 0.5rem 0.7rem;
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  font: inherit; font-size: 0.93rem; color: var(--ink); background: var(--surface);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.eh-control::placeholder { color: var(--muted); }
.eh-control:focus { outline: none; border-color: var(--accent); box-shadow: var(--ring); }
.eh-control--select {
  appearance: none; padding-right: 2rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23887f71' d='M6 8.5 1.5 4h9z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 0.7rem center;
}
.eh-control--slug { font-family: var(--mono); font-size: 0.86rem; }
.eh-control--sm { width: auto; min-height: 2rem; padding: 0.3rem 0.6rem; font-size: 0.85rem; }
.eh-control--select.eh-control--sm { padding-right: 1.8rem; }
.eh-control--textarea { resize: vertical; line-height: 1.5; min-height: 6rem; }
input[type="checkbox"] { accent-color: var(--accent); width: 1rem; height: 1rem; }
.eh-form__errors {
  list-style: none; margin: 0 0 1.25rem; padding: 0.75rem 1rem;
  background: var(--err-bg); color: var(--err-fg); border-radius: var(--radius-sm);
}
.eh-form__actions { display: flex; flex-wrap: wrap; gap: 0.5rem; justify-content: flex-end; }
.eh-inline-form { display: grid; gap: 1rem; }
.eh-daypick { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0; padding: 0; list-style: none; }
.eh-daypick > div, .eh-daypick li { display: contents; }
.eh-daypick label {
  display: inline-flex; align-items: center; gap: 0.35rem; cursor: pointer;
  padding: 0.3rem 0.65rem; border: 1px solid var(--line-strong); border-radius: 999px;
  font-size: 0.85rem; color: var(--ink-soft); background: var(--surface);
}
.eh-daypick label:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); color: var(--ink); }

/* Pannello di impostazioni (form autonomi, sezioni dell'editor). */
.eh-panel {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden;
}
.eh-panel__head { padding: 0.85rem 1.15rem; border-bottom: 1px solid var(--line); font-weight: 600; font-size: 0.92rem; }
.eh-panel__body { padding: 1.15rem; display: grid; gap: 1.1rem; }
.eh-panel + .eh-panel { margin-top: 1rem; }
.eh-settings { max-width: var(--measure); margin: 2rem auto 0; }
.eh-settings--standalone { max-width: var(--measure); margin: 0 auto; }
.eh-disclosure > summary {
  cursor: pointer; list-style: none; padding: 0.85rem 1.15rem;
  font-weight: 600; font-size: 0.92rem; display: flex; align-items: center; justify-content: space-between;
}
.eh-disclosure > summary::-webkit-details-marker { display: none; }
.eh-disclosure > summary::after { content: "+"; color: var(--muted); font-weight: 400; font-size: 1.1rem; }
.eh-disclosure[open] > summary { border-bottom: 1px solid var(--line); }
.eh-disclosure[open] > summary::after { content: "−"; }

/* --- Tabelle ------------------------------------------------------------ */
.eh-table-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.eh-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.eh-table th, .eh-table td { text-align: left; padding: 0.6rem 0.85rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.eh-table thead th {
  font-size: 0.74rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--muted); background: var(--sunken); white-space: nowrap;
}
.eh-table tbody tr:last-child td { border-bottom: none; }
.eh-table tbody tr:hover { background: var(--hover); }
.eh-table td a.eh-table__title { color: var(--ink); font-weight: 500; }
.eh-table td a.eh-table__title:hover { color: var(--accent); }
.eh-table .eh-table__num { width: 1%; white-space: nowrap; color: var(--muted); font-variant-numeric: tabular-nums; }
.eh-table .eh-table__actions { width: 1%; white-space: nowrap; text-align: right; }
.eh-table .eh-table__actions form { display: inline; margin: 0; }

/* ==========================================================================
   Lista articoli
   ========================================================================== */
.eh-filters {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem 0.75rem;
  margin-bottom: 1rem;
}
.eh-search { position: relative; flex: 1 1 16rem; max-width: 24rem; }
.eh-search .eh-icon { position: absolute; left: 0.7rem; top: 50%; transform: translateY(-50%); color: var(--muted); }
.eh-search .eh-control { padding-left: 2.1rem; }
.eh-seg-ctrl {
  display: inline-flex; padding: 0.2rem; gap: 0.15rem;
  background: var(--sunken); border-radius: 999px; overflow-x: auto; max-width: 100%;
}
.eh-seg-ctrl a {
  padding: 0.3rem 0.75rem; border-radius: 999px; white-space: nowrap;
  color: var(--ink-soft); font-size: 0.84rem; font-weight: 500;
}
.eh-seg-ctrl a:hover { color: var(--ink); text-decoration: none; }
.eh-seg-ctrl a.is-active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }
.eh-seg-ctrl .eh-count { color: var(--muted); font-variant-numeric: tabular-nums; margin-left: 0.25rem; font-size: 0.78rem; }
.eh-filters__count { margin-left: auto; color: var(--muted); font-size: 0.85rem; }

.eh-rows { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.eh-row {
  display: grid; grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.35rem 1.5rem; padding: 0.95rem 1.15rem;
  border-bottom: 1px solid var(--line); position: relative;
}
.eh-row:last-child { border-bottom: 0; }
.eh-row:hover { background: var(--hover); }
.eh-row__title {
  margin: 0; font-family: var(--serif); font-weight: 600; font-size: 1.12rem;
  line-height: 1.3; letter-spacing: -0.01em;
}
.eh-row__title a { color: var(--ink); }
.eh-row__title a::after { content: ""; position: absolute; inset: 0; }
.eh-row__title a:hover { text-decoration: none; }
.eh-row:hover .eh-row__title a { color: var(--accent); }
.eh-row__excerpt {
  margin: 0; grid-column: 1; color: var(--ink-soft); font-size: 0.9rem;
  display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden;
}
.eh-row__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem 0.9rem; grid-column: 1; font-size: 0.8rem; color: var(--muted); }
.eh-row__side { grid-column: 2; grid-row: 1 / span 3; display: flex; align-items: center; gap: 0.75rem; }
.eh-row__side .eh-badge, .eh-row__side a { position: relative; z-index: 1; }

.eh-pagination { display: flex; gap: 1rem; align-items: center; justify-content: center; margin-top: 1.5rem; color: var(--muted); font-size: 0.88rem; }

/* ==========================================================================
   Dashboard
   ========================================================================== */
.eh-summary {
  display: flex; flex-wrap: wrap; gap: 0.5rem 1.75rem; margin: 0 0 0.5rem; padding: 0; list-style: none;
  color: var(--ink-soft); font-size: 0.93rem;
}
.eh-summary strong { font-family: var(--serif); font-size: 1.35rem; font-weight: 600; color: var(--ink); margin-right: 0.3rem; font-variant-numeric: tabular-nums; }
.eh-summary .is-alert strong { color: var(--err-fg); }

.eh-grid-2 { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 1.5rem; }

.eh-agenda { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.eh-agenda li { display: grid; grid-template-columns: 4.2rem minmax(0, 1fr) auto; align-items: center; gap: 0.85rem; padding: 0.65rem 1rem; border-bottom: 1px solid var(--line); }
.eh-agenda li:last-child { border-bottom: 0; }
.eh-agenda__date { display: grid; line-height: 1.15; font-variant-numeric: tabular-nums; }
.eh-agenda__date b { font-family: var(--serif); font-size: 1.15rem; font-weight: 600; }
.eh-agenda__date span { font-size: 0.74rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.eh-agenda__title { min-width: 0; }
.eh-agenda__title a { color: var(--ink); font-weight: 500; }
.eh-agenda__title a:hover { color: var(--accent); text-decoration: none; }
.eh-agenda__title small { display: block; color: var(--muted); font-size: 0.78rem; }
.eh-agenda li.is-late .eh-agenda__date b { color: var(--err-fg); }

.eh-todo { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5rem; }
.eh-todo li {
  display: flex; align-items: center; justify-content: space-between; gap: 0.75rem;
  padding: 0.7rem 0.9rem; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface);
}
.eh-todo li a { color: var(--ink); font-weight: 500; min-width: 0; }
.eh-todo li a:hover { color: var(--accent); text-decoration: none; }
.eh-todo__form { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; }
.eh-todo li.is-feed { display: grid; gap: 0.5rem; }

.eh-matrix td:not(:first-child), .eh-matrix th:not(:first-child) { width: 1%; white-space: nowrap; }

/* ==========================================================================
   Editor (stile Substack)
   ========================================================================== */
.eh-editor { max-width: var(--measure); margin: 0 auto; }
.eh-editor__field { margin: 0; }
.editor-title, .editor-subtitle {
  display: block; width: 100%; padding: 0; border: 0; outline: none; resize: none; overflow: hidden;
  background: transparent; font-family: var(--serif); color: var(--ink);
  white-space: pre-wrap; word-wrap: break-word;
}
.editor-title { margin-top: 0.5rem; font-size: 2.5rem; font-weight: 600; line-height: 1.15; letter-spacing: -0.025em; }
.editor-subtitle { margin-top: 0.75rem; font-size: 1.3rem; line-height: 1.4; color: var(--ink-soft); }
.editor-title::placeholder, .editor-subtitle::placeholder { color: color-mix(in srgb, var(--muted) 70%, transparent); }
.editor-rule { border: 0; border-top: 1px solid var(--line); margin: 1.5rem 0; }
.editor-body-input { display: none; }

#editor { font-family: var(--serif); }
#editor .ql-editor { padding: 0; min-height: 45vh; font-size: 1.18rem; line-height: 1.75; color: var(--ink); }
#editor .ql-editor.ql-blank::before { left: 0; right: 0; font-style: normal; color: color-mix(in srgb, var(--muted) 75%, transparent); font-size: 1.18rem; }
#editor .ql-editor p { margin: 0 0 1.25rem; }
#editor .ql-editor h2 { font-weight: 600; font-size: 1.65rem; letter-spacing: -0.02em; margin: 1.8rem 0 0.6rem; }
#editor .ql-editor h3 { font-weight: 600; font-size: 1.3rem; margin: 1.5rem 0 0.5rem; }
#editor .ql-editor blockquote { margin: 1.4rem 0; padding: 0 0 0 1.25rem; border-left: 1px solid var(--line-strong); color: var(--ink-soft); font-style: italic; }
#editor .ql-editor pre.ql-syntax, #editor .ql-editor pre { background: var(--sunken); color: var(--ink); border-radius: var(--radius-sm); font-family: var(--mono); font-size: 0.88rem; }
#editor .ql-editor a { color: var(--accent); }

.eh-editorbar {
  position: sticky; top: 3.5rem; z-index: 20;
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1rem;
  padding: 0.5rem var(--gutter);
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: saturate(1.2) blur(10px);
  border-bottom: 1px solid var(--line);
}
.eh-editorbar__actions { margin-left: auto; display: flex; gap: 0.5rem; align-items: center; }
.eh-editorbar .ql-toolbar.ql-snow { border: 0; padding: 0; }
.eh-toolbar.ql-snow .ql-formats { margin-right: 0.6rem; }
.eh-editor .ql-container.ql-snow { border: 0; font-family: var(--serif); }
.ql-snow .ql-stroke { stroke: var(--ink-soft); }
.ql-snow .ql-fill { fill: var(--ink-soft); }
.ql-snow .ql-picker { color: var(--ink-soft); }
.ql-snow .ql-picker-options { background: var(--surface); border-color: var(--line) !important; box-shadow: var(--shadow); }
.ql-snow .ql-toolbar button:hover .ql-stroke, .ql-snow.ql-toolbar button:hover .ql-stroke,
.ql-snow .ql-toolbar .ql-picker-label:hover .ql-stroke,
.ql-snow .ql-toolbar button.ql-active .ql-stroke, .ql-snow.ql-toolbar button.ql-active .ql-stroke { stroke: var(--accent); }
.ql-snow .ql-toolbar button.ql-active .ql-fill, .ql-snow.ql-toolbar button.ql-active .ql-fill { fill: var(--accent); }
.ql-snow.ql-toolbar button:hover, .ql-snow.ql-toolbar button.ql-active { color: var(--accent); }
.ql-snow .ql-tooltip { z-index: 30; background: var(--surface); color: var(--ink); border-color: var(--line); box-shadow: var(--shadow); }
.ql-snow .ql-tooltip input[type=text] { background: var(--paper); color: var(--ink); border-color: var(--line-strong); }
.ql-bubble .ql-tooltip { border-radius: 999px; background: var(--ink); box-shadow: var(--shadow); }

/* ==========================================================================
   Dettaglio articolo: testo + pannello laterale
   ========================================================================== */
.eh-detail { display: grid; grid-template-columns: minmax(0, var(--measure)) var(--aside); gap: 4rem; justify-content: center; align-items: start; }
.eh-article { min-width: 0; }
.eh-article__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.75rem; margin-bottom: 0.9rem; color: var(--muted); font-size: 0.85rem; }
.eh-article__title {
  margin: 0 0 0.7rem; font-family: var(--serif); font-weight: 600;
  font-size: 2.6rem; line-height: 1.12; letter-spacing: -0.025em;
}
.eh-article__subtitle { margin: 0 0 1.75rem; font-family: var(--serif); font-size: 1.32rem; line-height: 1.4; color: var(--ink-soft); }
.eh-article__hint { margin: 0 0 1.25rem; padding-bottom: 1.25rem; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 0.82rem; }

.eh-prose { font-family: var(--serif); font-size: 1.18rem; line-height: 1.78; color: var(--ink); overflow-wrap: break-word; }
.eh-prose > * { margin: 0; }
.eh-prose > * + * { margin-top: 1.25rem; }
.eh-prose h2 { font-weight: 600; font-size: 1.7rem; letter-spacing: -0.02em; margin-top: 2.4rem; }
.eh-prose h3 { font-weight: 600; font-size: 1.35rem; margin-top: 2rem; }
.eh-prose blockquote { padding-left: 1.25rem; border-left: 1px solid var(--line-strong); color: var(--ink-soft); font-style: italic; }
.eh-prose a { text-decoration: underline; text-decoration-thickness: 1px; overflow-wrap: anywhere; }
.eh-prose img { max-width: 100%; height: auto; border-radius: var(--radius-sm); }
.eh-prose pre { background: var(--sunken); padding: 1rem; border-radius: var(--radius-sm); overflow: auto; font-size: 0.88rem; }
.eh-prose code { font-family: var(--mono); font-size: 0.88em; }
.eh-prose ul, .eh-prose ol { padding-left: 1.4rem; }
.eh-prose[contenteditable="true"] { cursor: text; border-radius: var(--radius-sm); outline: 2px solid transparent; outline-offset: 10px; transition: outline-color 0.15s ease, background-color 0.15s ease; }
.eh-prose[contenteditable="true"]:hover { background: color-mix(in srgb, var(--accent) 4%, transparent); }
.eh-prose[contenteditable="true"]:focus { outline-color: color-mix(in srgb, var(--accent) 60%, transparent); background: transparent; }

.eh-prose-status {
  position: fixed; right: 1.5rem; bottom: 1.5rem; z-index: 50;
  padding: 0.6rem 1rem; border-radius: var(--radius-sm);
  background: var(--ink); color: var(--paper); font-size: 0.85rem; line-height: 1;
  opacity: 0; transform: translateY(6px); pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.eh-prose-status--visible { opacity: 1; transform: translateY(0); }
.eh-prose-status--error { background: var(--err-fg); color: var(--surface); }

.eh-aside { position: sticky; top: 4.75rem; display: grid; gap: 1rem; max-height: calc(100vh - 6rem); overflow-y: auto; scrollbar-width: thin; }
.eh-aside__block { padding: 1rem 1.05rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); display: grid; gap: 0.75rem; }
.eh-aside__block h2 { margin: 0; font-size: 0.78rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
.eh-aside__actions { display: grid; gap: 0.45rem; }
.eh-aside__actions .eh-button { width: 100%; }
.eh-aside__note { margin: 0; font-size: 0.8rem; color: var(--muted); }

.eh-chanrow { display: grid; gap: 0.4rem; padding-bottom: 0.75rem; border-bottom: 1px solid var(--line); }
.eh-chanrow:last-child { padding-bottom: 0; border-bottom: 0; }
.eh-chanrow__head { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.eh-chanrow__name { font-weight: 600; font-size: 0.92rem; }
.eh-chanrow__info { margin: 0; font-size: 0.82rem; color: var(--ink-soft); }
.eh-chanrow__info a { font-weight: 500; }
.eh-chanrow form { display: flex; gap: 0.35rem; }
.eh-chanrow form .eh-control { flex: 1; min-width: 0; }

.eh-verdict { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.eh-verdict__label { font-family: var(--serif); font-weight: 600; font-size: 1.15rem; }
.eh-ai-bar { display: flex; height: 8px; border-radius: 999px; overflow: hidden; background: var(--neutral-bg); }
.eh-ai-bar__seg { height: 100%; }
.eh-ai-bar__seg--ai { background: var(--err-fg); }
.eh-ai-bar__seg--assisted { background: var(--warn-fg); }
.eh-ai-bar__seg--human { background: var(--ok-fg); }
.eh-ai-legend { display: flex; flex-wrap: wrap; gap: 0.3rem 0.9rem; margin: 0; padding: 0; list-style: none; font-size: 0.78rem; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.eh-ai-legend li { display: flex; align-items: center; gap: 0.35rem; }
.eh-ai-swatch { width: 8px; height: 8px; border-radius: 2px; }
.eh-ai-swatch--ai { background: var(--err-fg); }
.eh-ai-swatch--assisted { background: var(--warn-fg); }
.eh-ai-swatch--human { background: var(--ok-fg); }
.eh-ai__pending { margin: 0; padding: 0.6rem 0.85rem; background: var(--warn-bg); color: var(--warn-fg); border-radius: var(--radius-sm); font-size: 0.86rem; }

.eh-history { font-size: 0.82rem; }
.eh-history summary { cursor: pointer; color: var(--muted); }
.eh-history ol { margin: 0.5rem 0 0; padding: 0; list-style: none; display: grid; gap: 0.25rem; font-variant-numeric: tabular-nums; }
.eh-history li { display: flex; justify-content: space-between; gap: 0.5rem; color: var(--ink-soft); }

/* Evidenziazione AI sui paragrafi reali (toggle) */
.eh-prose--highlight .eh-hl { border-radius: 4px; padding: 0.1rem 0.35rem; box-decoration-break: clone; -webkit-box-decoration-break: clone; }
.eh-prose--highlight .eh-hl--ai { background: var(--err-bg); }
.eh-prose--highlight .eh-hl--mixed { background: var(--warn-bg); }
.eh-prose--highlight .eh-hl--human { background: var(--ok-bg); }
.eh-prose--highlight .eh-hl[data-aipct]::after {
  content: "AI " attr(data-aipct); display: inline-block; margin-left: 0.45rem; vertical-align: middle;
  padding: 0 0.45rem; border-radius: 999px; font-family: var(--sans); font-size: 0.68rem; font-weight: 700; line-height: 1.5;
  background: color-mix(in srgb, var(--ink) 8%, transparent); color: var(--ink-soft);
}
.eh-prose--highlight .eh-hl--ai[data-aipct]::after { background: color-mix(in srgb, var(--err-fg) 16%, transparent); color: var(--err-fg); }
.eh-prose--highlight .eh-hl--human[data-aipct]::after { background: color-mix(in srgb, var(--ok-fg) 16%, transparent); color: var(--ok-fg); }

/* Barra di formattazione fluttuante (anteprima ed editor) */
.eh-fmtbar {
  position: fixed; z-index: 60; display: flex; align-items: center; gap: 0.15rem; padding: 0.25rem;
  background: #1d1a15; color: #fff; border-radius: var(--radius-sm); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}
.eh-fmtbar[hidden] { display: none; }
.eh-fmtbar__sep { width: 1px; align-self: stretch; margin: 0.25rem 0.2rem; background: rgba(255, 255, 255, 0.22); }
.eh-fmtbar__btn {
  min-width: 1.9rem; height: 1.9rem; padding: 0 0.4rem;
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent; border: 0; border-radius: 5px; color: inherit;
  font-family: var(--sans); font-size: 0.85rem; line-height: 1; cursor: pointer;
}
.eh-fmtbar__btn:hover { background: rgba(255, 255, 255, 0.14); }
.eh-fmtbar__btn.is-active { background: #b5400f; color: #fff; }
.eh-fmtbar__btn--bold { font-weight: 700; }
.eh-fmtbar__btn--italic { font-style: italic; font-family: var(--serif); }
.eh-fmtbar__btn--underline { text-decoration: underline; }
.eh-fmtbar__btn--strike { text-decoration: line-through; }
.eh-fmtbar__link { display: flex; align-items: center; gap: 0.15rem; margin-left: 0.25rem; }
.eh-fmtbar__link[hidden] { display: none; }
.eh-fmtbar__input {
  width: 15rem; height: 1.9rem; padding: 0 0.5rem; font-size: 0.85rem;
  background: rgba(255, 255, 255, 0.12); color: #fff; border: 1px solid rgba(255, 255, 255, 0.25); border-radius: 5px;
}
.eh-fmtbar__input::placeholder { color: rgba(255, 255, 255, 0.55); }
.eh-fmtbar__input:focus { outline: none; border-color: #ec8452; }

/* ==========================================================================
   Banco di revisione anti-AI
   ========================================================================== */
.eh-rev { display: grid; gap: 1.5rem; }
.eh-rev__lead { margin: 0.4rem 0 0; color: var(--muted); max-width: 40rem; }
.eh-rev-panel { display: grid; gap: 0.9rem; padding: 1.1rem 1.2rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.eh-rev-panel__verdict { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.75rem; }
.eh-rev-panel__split { font-size: 0.86rem; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.eh-rev-panel__stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.5rem; margin: 0; }
.eh-rev-panel__stats div { display: grid; gap: 0.1rem; }
.eh-rev-panel__stats dt { font-size: 0.72rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.eh-rev-panel__stats dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; }
.eh-rev-panel__actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.eh-rev-panel__actions form { margin: 0; }
.eh-rev-panel__note { margin: 0; font-size: 0.86rem; color: var(--warn-fg); }
.eh-rev-panel__summary { margin: 0; font-size: 0.88rem; color: var(--ink-soft); }
.eh-rev-legend { display: flex; flex-wrap: wrap; gap: 1rem; margin: 0; padding: 0; list-style: none; font-size: 0.78rem; color: var(--muted); }
.eh-rev-legend li { display: inline-flex; align-items: center; gap: 0.35rem; }
.eh-rev-dot { width: 0.6rem; height: 0.6rem; border-radius: 50%; display: inline-block; flex: none; }
.eh-rev-dot--high { background: var(--err-fg); }
.eh-rev-dot--medium { background: var(--warn-fg); }
.eh-rev-dot--low { background: var(--ok-fg); }

.eh-rev-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.75rem; }
.eh-rev-row { display: grid; gap: 0.6rem; padding: 0.95rem 1.1rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); scroll-margin-top: 5rem; }
.eh-rev-row--high { background: color-mix(in srgb, var(--err-bg) 55%, var(--surface)); border-color: color-mix(in srgb, var(--err-fg) 28%, var(--line)); }
.eh-rev-row--medium { background: color-mix(in srgb, var(--warn-bg) 45%, var(--surface)); border-color: color-mix(in srgb, var(--warn-fg) 22%, var(--line)); }
.eh-rev-row--static { border-color: transparent; background: transparent; padding-top: 0.25rem; padding-bottom: 0.25rem; }
.eh-rev-row__signals { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem; }
.eh-chip { font-size: 0.74rem; font-weight: 600; padding: 0.1rem 0.5rem; border-radius: 999px; background: var(--neutral-bg); color: var(--neutral-fg); font-variant-numeric: tabular-nums; }
.eh-chip--pangram { background: var(--ink); color: var(--paper); }
.eh-chip--quiet { background: transparent; border: 1px solid var(--line-strong); }
.eh-rev-row__text { font-family: var(--serif); font-size: 1.06rem; line-height: 1.7; }
.eh-rev-row__text a { text-decoration: underline; }
.eh-rev-row__text--h2, .eh-rev-row__text--h3 { font-weight: 600; font-size: 1.28rem; }
.eh-rev-row__text--blockquote { font-style: italic; color: var(--ink-soft); }
.eh-rev-row__text--blockquote p { margin: 0; }
.eh-rev-row__reasons { margin: 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 0.3rem 0.9rem; font-size: 0.8rem; color: var(--ink-soft); }
.eh-rev-row__reasons li::before { content: "· "; color: var(--muted); }
.eh-rev-row__pending { margin: 0; font-size: 0.86rem; color: var(--warn-fg); }
.eh-rev-row__error { margin: 0; font-size: 0.86rem; color: var(--err-fg); }

/* ==========================================================================
   Autenticazione
   ========================================================================== */
.eh-auth-card { padding: 2rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.eh-auth-card__head { margin-bottom: 1.5rem; text-align: center; }
.eh-auth-card__head h1 { margin: 0; font-family: var(--serif); font-weight: 600; font-size: 1.65rem; letter-spacing: -0.02em; }
.eh-auth-card__sub { margin: 0.4rem 0 0; color: var(--muted); }
.eh-auth-form { display: grid; gap: 1.05rem; }
.eh-auth-form .eh-button--block { min-height: 2.6rem; margin-top: 0.25rem; }
.eh-auth-alt { text-align: center; margin: 1.25rem 0 0; color: var(--muted); font-size: 0.9rem; }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1100px) {
  .eh-detail { grid-template-columns: minmax(0, 1fr); gap: 2.5rem; }
  .eh-main--detail { max-width: calc(var(--measure) + 2 * var(--gutter)); }
  .eh-aside { position: static; max-height: none; overflow: visible; }
  .eh-grid-2 { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 760px) {
  body { font-size: 15px; }
  .eh-header { gap: 0.75rem; flex-wrap: wrap; padding-top: 0.45rem; padding-bottom: 0.45rem; }
  .eh-nav-toggle { display: grid; }
  .eh-nav {
    display: none; order: 10; flex-basis: 100%; flex-direction: column; align-items: stretch; gap: 0.1rem;
    padding: 0.4rem 0 0.6rem; border-top: 1px solid var(--line);
  }
  .eh-nav.is-open { display: flex; }
  .eh-nav__link { padding: 0.75rem 0.6rem; font-size: 1rem; }
  .eh-nav__link.is-active { background: var(--hover); }
  .eh-nav__link.is-active::after { display: none; }
  .eh-nav__end { margin: 0.4rem 0 0; padding-top: 0.6rem; border-top: 1px solid var(--line); justify-content: space-between; }
  .eh-menu__panel { right: auto; left: 0; }
  .eh-nav__end .eh-menu:last-child .eh-menu__panel { left: auto; right: 0; }

  .eh-page-head h1 { font-size: 1.6rem; }
  .eh-article__title, .editor-title { font-size: 2rem; }
  .eh-article__subtitle, .editor-subtitle { font-size: 1.15rem; }
  .eh-prose, #editor .ql-editor { font-size: 1.08rem; }

  .eh-row { grid-template-columns: minmax(0, 1fr); padding: 0.85rem 1rem; }
  .eh-row__side { grid-column: 1; grid-row: auto; flex-wrap: wrap; gap: 0.5rem 0.75rem; }
  .eh-filters__count { margin-left: 0; }
  .eh-search { max-width: none; }

  .eh-agenda li { grid-template-columns: 3.6rem minmax(0, 1fr); }
  .eh-agenda li > :last-child { grid-column: 2; justify-self: start; }
  .eh-rev-panel__stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .eh-chanrow form { flex-direction: column; }
  .eh-editorbar { top: 3.4rem; }
  .eh-fmtbar__input { width: 11rem; }
  .eh-table th, .eh-table td { padding: 0.55rem 0.65rem; }
}

/* Passi del banco di revisione */
.eh-steps { counter-reset: step; list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.75rem; }
.eh-steps li { counter-increment: step; display: grid; gap: 0.15rem; padding: 0.7rem 0.8rem; border-radius: var(--radius-sm); background: var(--sunken); color: var(--muted); font-size: 0.84rem; }
.eh-steps li b { display: flex; align-items: center; gap: 0.45rem; color: var(--ink-soft); font-size: 0.9rem; }
.eh-steps li b::before {
  content: counter(step); width: 1.3rem; height: 1.3rem; border-radius: 50%; display: inline-grid; place-items: center;
  font-size: 0.72rem; background: var(--surface); color: var(--muted); border: 1px solid var(--line-strong);
}
.eh-steps li.is-current { background: var(--accent-soft); color: var(--ink-soft); }
.eh-steps li.is-current b { color: var(--ink); }
.eh-steps li.is-current b::before { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.eh-steps li.is-done b::before { content: "✓"; background: var(--ok-bg); border-color: var(--ok-fg); color: var(--ok-fg); }
.eh-linkbtn { background: none; border: 0; padding: 0; font: inherit; color: var(--accent); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.eh-linkbtn:disabled { color: var(--muted); cursor: default; text-decoration: none; }
@media (max-width: 760px) { .eh-steps { grid-template-columns: minmax(0, 1fr); } }

/* Pannelli di impostazioni (editor, form autonomi): stesso aspetto di .eh-panel */
.eh-settings { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.eh-settings__head { padding: 0.85rem 1.15rem; border-bottom: 1px solid var(--line); font-weight: 600; font-size: 0.92rem; }
.eh-settings__body { padding: 1.15rem; display: grid; gap: 1.1rem; }
.eh-settings + .eh-settings { margin-top: 1rem; }
.eh-copy { display: flex; flex-wrap: wrap; align-items: center; gap: 0.15rem 0.25rem; padding-top: 0.6rem; border-top: 1px solid var(--line); }
.eh-copy__label { width: 100%; font-size: 0.78rem; color: var(--muted); }
.eh-late { color: var(--err-fg); }
.eh-grid-2 > * { min-width: 0; }
.eh-todo li.is-feed { grid-template-columns: minmax(0, 1fr); }
.eh-todo__form select { min-width: 0; max-width: 100%; flex: 1 1 12rem; }
.eh-seg-ctrl { scrollbar-width: none; }
.eh-seg-ctrl::-webkit-scrollbar { display: none; }
.eh-only-mobile { display: none; }
@media (max-width: 760px) {
  .eh-hide-mobile { display: none; }
  .eh-only-mobile { display: block; }
}

/* Feedback live mentre Claude/Pangram lavorano in background */
.eh-live {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.7rem 0.9rem; border-radius: var(--radius-sm);
  background: var(--accent-soft); color: var(--ink);
}
.eh-live__body { display: grid; gap: 0.1rem; min-width: 0; }
.eh-live__text { font-weight: 550; font-size: 0.92rem; }
.eh-live__meta { font-size: 0.8rem; color: var(--ink-soft); }
.eh-spinner {
  flex: none; width: 1.1rem; height: 1.1rem; border-radius: 50%;
  border: 2px solid color-mix(in srgb, var(--accent) 25%, transparent);
  border-top-color: var(--accent);
  animation: eh-spin 0.9s linear infinite;
}
@keyframes eh-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .eh-spinner { animation: eh-pulse 1.6s ease-in-out infinite; border-top-color: color-mix(in srgb, var(--accent) 25%, transparent); background: var(--accent); }
  @keyframes eh-pulse { 50% { opacity: 0.35; } }
}

/* Riscrittura a mano nel banco di revisione */
.eh-rev-row__text--edit { border-radius: var(--radius-sm); padding: 0.2rem 0.4rem; margin: 0 -0.4rem; outline: none; cursor: text; transition: background-color 0.15s ease, box-shadow 0.15s ease; }
.eh-rev-row__text--edit:hover { background: color-mix(in srgb, var(--surface) 60%, transparent); }
.eh-rev-row__text--edit:focus { background: var(--surface); box-shadow: var(--ring); }
.eh-rev-row__save { margin-left: auto; font-size: 0.76rem; color: var(--muted); }
.eh-rev-row__save.is-error { color: var(--err-fg); }
.eh-guide { display: grid; gap: 0.6rem; padding: 0.75rem 0.9rem; border-radius: var(--radius-sm); background: var(--paper); border: 1px solid var(--line); font-size: 0.87rem; color: var(--ink-soft); }
.eh-guide b { color: var(--ink); font-size: 0.8rem; }
.eh-guide ul { margin: 0.2rem 0 0; padding-left: 1.1rem; display: grid; gap: 0.15rem; }
.eh-guide__question { margin: 0; padding: 0.5rem 0.7rem; border-radius: var(--radius-sm); background: var(--accent-soft); color: var(--ink); }
.eh-guide form { margin: 0; justify-self: start; }
.eh-rev-row__save { display: inline-flex; align-items: center; gap: 0.35rem; }
