/* Nell'iframe, navigazione generale, esempi e salvataggio sono nella dashboard. */
:root{--navy:#152f40;--navy2:#214359;--ivory:#f5f3ed;--paper:#f5f3ed;--white:#fffefa;--brass:#9b7635;--line:#d4d9d5;--muted:#52636b;--soft:#eaf0ed;font-family:"Segoe UI",Arial,sans-serif}
body[data-integrated=true] .masthead,body[data-integrated=true] .intro,body[data-integrated=true] .toolbar,body[data-integrated=true] .standalone-export-help,body[data-integrated=true] footer{display:none}
main{padding:1rem;max-width:none}
.section-nav{position:static;margin-top:0}
.panel{margin-bottom:1rem}

.eyebrow,.task .task-state{color:#775b27}
.section-purpose{font-size:.9rem;max-width:85ch;margin-bottom:1.15rem}
.section-purpose span{display:block;color:var(--muted);font-size:.84rem;margin-top:.3rem}
.editor-command-guide{background:#edf1f2;margin:0 0 1rem;padding:.85rem 1rem}
.editor-command-guide>summary{color:var(--navy);font-size:.88rem}
.editor-command-guide h3{margin-top:1rem}
.editor-command-guide p{max-width:85ch}
.editor-command-guide .editor-next-step{color:var(--muted)}
.editor-command-list{display:grid;grid-template-columns:minmax(165px,1fr) minmax(0,3fr);gap:.6rem 1.25rem;font-size:.84rem;line-height:1.55;margin:1rem 0}
.editor-command-list dt{font-weight:600}
.editor-command-list dd{margin:0;color:var(--muted)}
.editor-command-guide button{margin-top:.5rem;font-size:.84rem}
.editor-tour-card{grid-column:1/-1;min-width:0;width:100%;max-width:760px;position:relative;z-index:2;border:2px solid var(--brass);border-radius:10px;background:var(--white);box-shadow:0 8px 28px #132c4021;padding:1rem 1.15rem;margin:.75rem 0 1.2rem}
.editor-tour-card .editor-tour-progress{font-size:.75rem;font-weight:600;letter-spacing:.035em;color:#775b27;margin-bottom:.4rem}
.editor-tour-card h3{font-size:1.1rem;margin-bottom:.4rem}
.editor-tour-card p{font-size:.88rem;margin-bottom:.8rem;max-width:76ch}
.editor-tour-actions{display:flex;flex-wrap:wrap;gap:.5rem}
.editor-tour-actions button{font-size:.82rem;padding:.55rem .75rem}
.editor-tour-actions .primary{margin-left:auto}
.editor-guide-highlight{outline:3px solid var(--brass);outline-offset:4px;border-radius:6px;scroll-margin:1rem}

/* Una sezione alla volta: i dati rimangono nello stesso editor. */
[hidden]{display:none!important}
.section-nav{display:flex;flex-wrap:nowrap;gap:.35rem;overflow-x:auto;padding:.1rem 0 .75rem;margin:0 0 .45rem;border-bottom:1px solid var(--line)}
.section-nav [role=tab]{flex-shrink:0;border-color:transparent;background:transparent;padding:.55rem .8rem;font-size:.88rem;white-space:nowrap}
.section-nav [aria-selected=true]{background:var(--navy);border-color:var(--navy);color:#fff}
.section-nav [aria-selected=false]:hover{background:var(--soft)}
.panel{padding:1.25rem}
.section-head{margin-bottom:1rem}
.section-head h2{font-size:1.35rem;font-family:"Segoe UI",Arial,sans-serif;font-weight:650;line-height:1.35}
.section-help{background:transparent;border:0;border-bottom:1px solid var(--line);border-radius:0;padding:0 0 .75rem;margin:0 0 1rem}
.section-help summary,.task-help summary{font-weight:500;font-size:.82rem;color:var(--muted)}
.section-help p{max-width:72ch}
.compact-notice{padding:.65rem .85rem;font-size:.87rem}
.concise-note{font-size:.86rem;margin-bottom:.8rem}
.task-help{background:transparent;border:0;padding:0;margin:.2rem 0 .7rem}
.task-help p{font-size:.82rem;margin:.5rem 0}
.metrics{margin:.9rem 0;gap:.6rem}
.metric{padding:.7rem .85rem}
.metric strong{font-size:1.5rem}
[role=tabpanel]:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible,button:focus-visible,a:focus-visible,summary:focus-visible{outline:3px solid #154e71;outline-offset:3px}
input,select,textarea{border-color:#7d8e95}
.inventory-list{display:grid;gap:.85rem;min-width:0}
.inventory-card{border:1px solid var(--line);border-radius:10px;background:var(--white);padding:1rem;min-width:0;overflow-wrap:anywhere}
.inventory-card-head{display:flex;align-items:flex-start;justify-content:space-between;gap:1rem}
.inventory-identity{min-width:0;flex:1}
.inventory-identity h3{font-size:1rem;line-height:1.45;margin:0}
.inventory-meta{font-size:.8rem;color:var(--muted);margin:0 0 .3rem;line-height:1.5}
.inventory-reference{font-size:.88rem;color:var(--muted);margin:.5rem 0 0;line-height:1.55;white-space:pre-wrap}
.inventory-states{display:flex;flex-wrap:wrap;align-items:flex-start;justify-content:flex-end;gap:.35rem;max-width:45%}
.inventory-state{display:inline-flex;align-items:center;min-height:28px;padding:.3rem .5rem;border-radius:5px;font-size:.75rem;font-weight:600;line-height:1.4}
.inventory-state.available,.inventory-state.checked{color:#285c47;background:#e8f0e9}
.inventory-state.pending{color:#7c4930;background:#f8eae3}
.inventory-state.review{color:#52636b;background:#edf1f2}
.inventory-details{background:transparent;border:0;border-radius:0;padding:0;margin:.85rem 0 0}
.inventory-details>summary{padding:.6rem 0 .1rem;line-height:1.5;color:var(--navy);font-size:.85rem;font-weight:600;min-height:34px}
.inventory-details[open]>summary{padding-bottom:.85rem;border-bottom:1px solid var(--line);margin-bottom:1rem}
.inventory-fields{gap:.85rem 1rem}
.inventory-fields .field>label{font-size:.8rem}
.inventory-fields textarea{min-height:88px;font-size:.93rem}
.inventory-control-help{font-size:.8rem;line-height:1.55;color:var(--muted);margin:1rem 0}
.inventory-details>.danger{font-size:.8rem;padding:.55rem .75rem}
.inventory-fields select:disabled{opacity:1;color:var(--muted);background:#edf1f2;cursor:not-allowed}
@media(max-width:600px){.inventory-card{padding:.85rem}.inventory-card-head{display:block}.inventory-states{justify-content:flex-start;max-width:none;margin-top:.7rem}.inventory-fields{grid-template-columns:minmax(0,1fr)}.inventory-fields .wide{grid-column:auto}.inventory-reference{font-size:.85rem}.inventory-details>summary{padding-top:.55rem}.inventory-details>.danger{width:100%;min-height:40px}}
@media print{.inventory-card{break-inside:avoid;margin:.5rem 0}.inventory-details> :not(summary){display:block!important}.inventory-details::details-content{display:block;content-visibility:visible}.inventory-details>summary{display:none}.inventory-fields{display:grid}.inventory-state{border:1px solid #777;color:#111!important;background:white!important}}
@media(max-width:800px){main{padding:.6rem}.panel{padding:1rem}.section-head h2{font-size:1.4rem}.section-nav [role=tab]{padding:.5rem .6rem}}
@media(max-width:600px){.section-nav{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));overflow:visible}.section-nav [role=tab]{white-space:normal;text-align:left}.editor-command-list{display:block}.editor-command-list dt{margin-top:.75rem}.editor-command-list dd{margin-top:.2rem}.editor-tour-card{padding:.85rem}.editor-tour-actions button{flex:1}.editor-tour-actions .primary{margin-left:0}}
@media print{[role=tabpanel][hidden]{display:block!important}.section-help,.task-help,.editor-command-guide,.editor-tour-card{display:none!important}.editor-guide-highlight{outline:none}}

/* Ottobre 2026: stessa gerarchia del banco di lavoro, con campi piu leggibili. */
@media screen {
  :root {
    --line:#deded6;
    --muted:#5c6972;
    --radius:9px;
  }
  body {
    font-family:"Segoe UI",Arial,sans-serif;
    font-size:1rem;
    line-height:1.6;
    -webkit-font-smoothing:antialiased;
  }
  button {
    min-height:44px;
    font-size:.9375rem;
    line-height:1.4;
    border-radius:7px;
  }
  input:not([type=checkbox]):not([type=radio]),select,textarea {
    min-height:44px;
    font-size:1rem;
    line-height:1.5;
    padding:.7rem .8rem;
    border-color:#8b969c;
  }
  textarea { min-height:100px; }
  input[type=checkbox] { width:1.15rem;height:1.15rem; }
  input::placeholder,textarea::placeholder { color:var(--muted);opacity:1; }
  .field>label,.task .field>label,.inventory-fields .field>label,
  .documents-table .field>label,.examples>label {
    font-size:.875rem;
    line-height:1.5;
    color:var(--navy);
  }
  .field { gap:.45rem; }
  .field.check { min-height:44px;gap:.7rem; }
  .field.check label { font-size:.9375rem;line-height:1.5; }
  .form-grid { gap:1.15rem 1.5rem; }
  .section-head { gap:1rem;margin-bottom:1.3rem; }
  .section-head h2 { font-size:1.4rem;letter-spacing:-.02em; }
  .section-purpose { font-size:.9375rem;line-height:1.6; }
  .section-purpose span,.concise-note,.compact-notice,
  .inventory-meta,.inventory-reference,.inventory-control-help,
  .inventory-state,.metric span,.task>p,.task .task-state,
  .task-help p,.task-help summary,.section-help summary,
  .timeline .meta,.table-hint,.chip,.eyebrow,
  .editor-command-list,.editor-command-guide p,
  .editor-command-guide>summary,.editor-tour-card .editor-tour-progress,
  .editor-tour-card p,body .editor-final-actions p,
  body .editor-final-actions .editor-final-status {
    font-size:.875rem;
    line-height:1.6;
  }
  .eyebrow,.task .task-state,.editor-tour-card .editor-tour-progress {
    color:#755824;
  }
  .section-nav [role=tab] {
    min-height:44px;
    font-size:.9375rem;
    padding:.6rem .85rem;
  }
  body[data-integrated=true] { background:var(--white); }
  body[data-integrated=true] main { padding:.65rem 1.4rem 1.5rem; }
  body[data-integrated=true] .panel {
    padding:1.1rem 0 0;
    margin-bottom:.5rem;
    border:0;
    border-radius:0;
    box-shadow:none;
  }
  body[data-integrated=true] #editor-sections>summary {
    min-height:44px;
    font-size:.875rem;
    padding:.6rem 0;
    color:var(--muted);
  }
  body[data-integrated=true] .editor-command-guide {
    margin:0 0 .6rem;
    padding:0;
    border:0;
    background:transparent;
    border-radius:0;
  }
  body[data-integrated=true] .editor-command-guide>summary {
    min-height:44px;
    padding:.55rem 0;
    font-weight:500;
    color:var(--muted);
  }
  body[data-integrated=true] .editor-command-guide[open] {
    padding-bottom:1rem;
    border-bottom:1px solid var(--line);
  }
  .section-help>summary,.task-help>summary {
    min-height:44px;
    padding:.55rem 0;
  }
  .inventory-card,.task,.source-card { border-radius:9px; }
  .inventory-card { padding:1.15rem 1.25rem; }
  .inventory-card-head { gap:1.25rem; }
  .inventory-identity h3 { font-size:1.0625rem; }
  .inventory-state { padding:.3rem .6rem;border-radius:5px; }
  .inventory-details>summary {
    min-height:44px;
    padding:.6rem 0;
    font-size:.9375rem;
  }
  .inventory-fields { gap:1.15rem 1.5rem; }
  .inventory-details>.danger,.source-card button,
  .editor-command-guide button,.editor-tour-actions button {
    min-height:44px;
    font-size:.9375rem;
  }
  .inventory-fields textarea,.task textarea { font-size:1rem;min-height:100px; }
  .metric { padding:.85rem 1rem;background:#f5f3ed;border-radius:7px; }
  .metric strong { font-family:"Segoe UI",Arial,sans-serif;font-weight:650; }
  .task { padding:1.15rem; }
  .task-head { gap:.7rem; }
  .task-head label { font-size:1rem;line-height:1.5; }
  .task.done { background:#f2f6f3;border-color:#a9bfb3; }
  .source-card { padding:1.15rem; }
  .source-card .card-top { align-items:flex-start;flex-wrap:wrap; }
  .source-card h3 { font-size:1.0625rem;overflow-wrap:anywhere; }
  .timeline { margin-top:1rem; }
  .timeline li { gap:1.2rem;padding:1.1rem 0; }
  .timeline time { font-family:"Segoe UI",Arial,sans-serif;font-size:.9375rem;color:#755824; }
  .editor-command-list { gap:.8rem 1.25rem; }
  .editor-tour-card { border-radius:9px; }
  .editor-tour-actions { gap:.65rem; }
  body #editor-flow-host .task-flow button {
    min-height:44px;
    font-size:.9375rem;
  }
  body #editor-flow-host .task-flow-counter,
  body #editor-flow-host .task-flow-description,
  body #editor-flow-host .task-flow-note {
    font-size:.875rem;
    line-height:1.6;
  }
}
@media screen and (max-width:800px) {
  body[data-integrated=true] main { padding:.55rem 1rem 1.2rem; }
  .form-grid { gap:1rem; }
  .section-head { margin-bottom:1rem; }
}
@media screen and (max-width:600px) {
  body[data-integrated=true] main { padding:.4rem .85rem 1rem; }
  .section-head h2 { font-size:1.3rem; }
  .section-head>button { width:100%; }
  .section-nav [role=tab] { padding:.65rem .6rem; }
  .inventory-card,.task,.source-card { padding:1rem; }
  .inventory-details>.danger { min-height:44px; }
  .inventory-reference { font-size:.875rem; }
  .inventory-states { max-width:none; }
  .timeline li { grid-template-columns:78px minmax(0,1fr);gap:.8rem; }
  .timeline li>div { min-width:0;overflow-wrap:anywhere; }
  .editor-tour-actions button { flex:1 1 120px; }
}
