/* Faventia AI Coder — simple, in the style of dataelisir.com:
   Sora for headings, Inter for text (IBM Plex Mono only for hashes, paths, code, logs),
   purple/blue/gold on light blue-grey. */
:root {
  --primary: #8A55FF;
  --secondary: #4F7DFF;
  --accent: #E8B53E;
  --text: #0A0C14;
  --muted: #7D85A8;
  --line: #B6BDD6;
  --soft: #EEF1F8;
  --bg: #F3F5FC;
  --card: #FFFFFF;
  --ok: #1E8E5A;
  --err: #C23B3B;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; font-size: 15px;
  line-height: 1.55;
}
a { color: var(--secondary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { font-family: "Sora", system-ui, sans-serif; line-height: 1.15; margin: 0 0 .6em; }
h1 { font-size: 2rem; font-weight: 700; }
h2 { font-size: 1.25rem; font-weight: 600; }
h3 { font-size: 1rem; font-weight: 600; margin-top: 1.4em; }
.wrap { max-width: 1100px; margin: 0 auto; padding: 0 16px; }
main.wrap { padding-top: 28px; padding-bottom: 40px; }

.top { background: var(--text); color: #fff; }
.top-in { display: flex; align-items: center; justify-content: space-between; gap: 16px;
          min-height: 60px; flex-wrap: wrap; }
.brand { color: #fff; font-family: "Sora", sans-serif; font-weight: 700; font-size: 1.1rem;
         display: flex; align-items: center; gap: 10px; }
.brand:hover { text-decoration: none; }
.brand .thin { font-weight: 600; color: var(--accent); }
.dot { width: 12px; height: 12px; border-radius: 50%;
       background: linear-gradient(135deg, var(--primary), var(--secondary)); }
.top nav { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.top nav a, .top nav .link { color: #fff; font-size: .85rem; text-transform: uppercase;
                             letter-spacing: .08em; }

.eyebrow { font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--primary);
           margin: 0 0 .4em; font-weight: 500; }
.eyebrow a { color: var(--primary); }
.lead { max-width: 70ch; color: #2b3045; }
.muted { color: var(--muted); }
.small { font-size: .82rem; }
.mono, code, pre, .hash, td.path { font-family: "IBM Plex Mono", ui-monospace, monospace; }
.foot { color: var(--muted); font-size: .75rem; padding-bottom: 24px; }

.card { background: var(--card); border: 1px solid var(--soft); border-radius: 14px; padding: 22px;
        margin: 22px 0; box-shadow: 0 1px 2px rgba(10, 12, 20, .04); }
.card.narrow { max-width: 460px; margin: 40px auto; }

form.stack { display: flex; flex-direction: column; gap: 14px; }
form.row { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
form.inline { display: inline; }
label { display: flex; flex-direction: column; gap: 6px; font-size: .8rem; text-transform: uppercase;
        letter-spacing: .06em; color: #3a405a; }
label.grow { flex: 1 1 260px; }
input { font: inherit; text-transform: none; letter-spacing: 0; padding: 10px 12px; border: 1px solid var(--line);
        border-radius: 8px; background: #fff; color: var(--text); min-width: 0; }
input:focus { outline: 2px solid var(--secondary); outline-offset: 1px; }
.btn { display: inline-block; font: inherit; font-weight: 600; font-size: .85rem; text-transform: uppercase;
       letter-spacing: .08em; padding: 11px 18px; border: 0; border-radius: 999px; cursor: pointer;
       background: var(--primary); color: #fff; }
.btn:hover { background: #7440f0; text-decoration: none; }
button.link { background: none; border: 0; padding: 0; font: inherit; color: var(--secondary); cursor: pointer; }
.top button.link { color: #fff; }

.err { color: var(--err); font-weight: 500; }
.ok { color: var(--ok); font-weight: 500; }
.note { background: #FFF6DF; border-left: 3px solid var(--accent); padding: 8px 12px; border-radius: 4px; }
.secret { font-size: 1.5rem; background: var(--soft); padding: 12px 16px; border-radius: 8px;
          letter-spacing: .05em; user-select: all; overflow-wrap: anywhere; }

table.list { width: 100%; border-collapse: collapse; }
table.list th { text-align: left; font-size: .75rem; text-transform: uppercase; letter-spacing: .08em;
                color: var(--muted); font-weight: 500; border-bottom: 1px solid var(--line); padding: 8px 6px; }
table.list td { border-bottom: 1px solid var(--soft); padding: 8px 6px; vertical-align: top; }
td.actions { white-space: nowrap; }
td.actions form + form::before { content: " · "; color: var(--muted); }

.round-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.round-head h2 { margin: 0; }
.badge { font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; padding: 3px 10px;
         border-radius: 999px; background: var(--soft); color: #3a405a; }
.s-running, .s-queued { background: #E9E0FF; color: var(--primary); }
.s-done { background: #DFF3E9; color: var(--ok); }
.s-checks_failed { background: #FFF1D2; color: #9A6A00; }
.s-failed { background: #FBE2E2; color: var(--err); }
.summary { color: #2b3045; }
pre.progress, pre.box { background: var(--text); color: #E6E8F2; padding: 14px; border-radius: 10px;
                        white-space: pre-wrap; overflow-wrap: anywhere; font-size: .8rem; max-height: 480px;
                        overflow: auto; }
details summary { cursor: pointer; color: var(--secondary); margin: 6px 0; }
ul.tight { margin: .4em 0; padding-left: 1.2em; }

ol.rilievi { padding-left: 1.4em; }
ol.rilievi li { margin-bottom: 14px; padding-bottom: 12px; border-bottom: 1px solid var(--soft); }
ol.rilievi p { margin: .3em 0; }
.sev { font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; padding: 2px 8px; border-radius: 999px; }
.sev-alta { background: #FBE2E2; color: var(--err); }
.sev-media { background: #FFF1D2; color: #9A6A00; }
.sev-bassa { background: var(--soft); color: #3a405a; }
.kind { font-size: .75rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.lbl { font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: var(--primary); margin-right: 6px; }
ul.files { padding-left: 1.2em; }

nav.tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0; }
nav.tabs a { background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px; font-size: .8rem; }
.sheet { margin: 26px 0; }
.scroll { overflow-x: auto; background: #fff; border-radius: 10px; border: 1px solid var(--soft); }
table.grid { border-collapse: collapse; font-size: .78rem; }
table.grid td { border: 1px solid var(--soft); padding: 4px 8px; vertical-align: top; min-width: 60px; max-width: 420px; }
table.grid tr:first-child td { background: var(--soft); font-weight: 600; }

@media (max-width: 600px) {
  h1 { font-size: 1.5rem; }
  .card { padding: 16px; }
  table.list { font-size: .8rem; }
}

/* ---- machine workspace: machines | history | main | files ---- */
main.app { padding: 0; max-width: none; }
.cols { display: grid; grid-template-columns: 250px 310px minmax(0, 1fr) 290px;
        height: calc(100vh - 60px); }
.cols.no-files { grid-template-columns: 250px 310px minmax(0, 1fr); }
.col { overflow-y: auto; padding: 18px 16px; min-width: 0; }
.col-machines { background: #fff; border-right: 1px solid var(--soft); }
.col-history { background: #F8F9FD; border-right: 1px solid var(--soft); }
.col-main { padding: 22px 28px 40px; }
.col-files { background: #fff; border-left: 1px solid var(--soft); }
.col-title { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted);
             margin: 0 0 10px; font-weight: 500; }
ul.nav { list-style: none; margin: 0 0 12px; padding: 0; }
ul.nav li a { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; border-radius: 8px;
              color: var(--text); font-size: .85rem; }
ul.nav li a:hover { background: var(--soft); text-decoration: none; }
ul.nav li a.sel { background: #EDE5FF; box-shadow: inset 3px 0 0 var(--primary); }
.col-machines ul.nav li a { display: block; }
.code { font-weight: 600; color: var(--primary); margin-right: 4px; }
.h-top { display: flex; align-items: center; gap: 8px; }
a.add { display: block; font-size: .8rem; padding: 6px 10px; border-radius: 8px; }
a.add.sel { background: #EDE5FF; }
form.upload { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; padding-bottom: 14px;
              border-bottom: 1px solid var(--soft); }
form.upload label.file { font-size: .7rem; }
form.upload input[type=file] { font-size: .75rem; padding: 6px; }
.small-btn { padding: 8px 14px; font-size: .75rem; }
nav.tabs a.sel { background: var(--primary); color: #fff; border-color: var(--primary); }
nav.tabs.sheets a { font-size: .75rem; }
ul.files { list-style: none; padding: 0; margin: 0 0 14px; }
ul.files li { margin-bottom: 10px; font-size: .8rem; overflow-wrap: anywhere; }
.hash { display: block; color: var(--muted); font-size: .7rem; }
.col-main h1 { font-size: 1.7rem; }

@media (max-width: 1350px) {
  .cols, .cols.no-files { grid-template-columns: 230px 280px minmax(0, 1fr); height: auto; }
  .col { overflow: visible; }
  .col-files { grid-column: 3; border-left: 0; border-top: 1px solid var(--soft); }
}
@media (max-width: 800px) {
  .cols, .cols.no-files { grid-template-columns: 1fr; }
  .col-files { grid-column: auto; }
  .col-machines, .col-history { border-right: 0; border-bottom: 1px solid var(--soft); }
  .col-main { padding: 18px 16px; }
}
main.app + .foot { display: none; }
form.archive { margin-top: 18px; padding-top: 12px; border-top: 1px solid var(--soft); }
button.danger { color: var(--err); font-size: .8rem; }
.note form { margin-top: 8px; }
/* header across the full width, aligned with the columns below */
.top .wrap { max-width: none; padding: 0 20px; }
details.upload { margin-bottom: 10px; }
details.upload summary { font-size: .8rem; font-weight: 600; color: var(--primary); padding: 6px 0; }
details.upload form { display: flex; flex-direction: column; gap: 8px; padding: 6px 0 12px; }
details.upload select, details.upload textarea { font: inherit; font-size: .8rem; padding: 6px; border: 1px solid var(--line);
                                                 border-radius: 6px; text-transform: none; letter-spacing: 0; }
.ref { font-size: .65rem; text-transform: uppercase; letter-spacing: .08em; color: #8A6400;
       background: #FFF1D2; padding: 2px 8px; border-radius: 999px; }
.nowrap { white-space: nowrap; }
table.diff td { vertical-align: top; }
table.diff del { background: #FFF1D2; text-decoration: line-through; color: #6b5200; padding: 0 3px; }
table.diff ins { background: #DFF3E9; text-decoration: none; color: #155c3b; padding: 0 3px; }
.chg { font-size: .68rem; text-transform: uppercase; letter-spacing: .06em; padding: 1px 6px; border-radius: 999px; }
.chg-aggiunta { background: #DFF3E9; color: var(--ok); }
.chg-rimossa { background: #FBE2E2; color: var(--err); }
.chg-modificata { background: var(--soft); color: #3a405a; }
li.k-build > a { border-left: 2px dashed var(--accent); }
table.kv th { width: 230px; text-transform: none; letter-spacing: 0; font-size: .8rem; color: #3a405a; }
td.path { overflow-wrap: anywhere; }
.round-head form.inline { margin-left: 6px; }
ul.plain { padding-left: 1.1em; }
ul.plain li { margin-bottom: 8px; font-size: .85rem; }
.where { display: inline-block; font-size: .7rem; text-transform: uppercase; letter-spacing: .06em;
         color: var(--primary); background: #EDE5FF; border-radius: 4px; padding: 0 6px; margin-right: 6px; }
p.answer { background: #F8F9FD; border-left: 3px solid var(--secondary); padding: 6px 10px; border-radius: 4px; }
.ans { font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; padding: 1px 8px; border-radius: 999px; margin-right: 4px; }
.ans-correggo_word { background: #FFF1D2; color: #8A6400; }
.ans-proposta_ok { background: #DFF3E9; color: var(--ok); }
.ans-non_applicabile { background: var(--soft); color: #3a405a; }
.ans-risposta { background: #E3EBFF; color: var(--secondary); }
details.reply summary { font-size: .78rem; color: var(--secondary); }
details.reply form { display: flex; flex-direction: column; gap: 6px; max-width: 560px; padding: 6px 0; }
details.reply select, details.reply textarea { font: inherit; font-size: .8rem; padding: 6px; border: 1px solid var(--line); border-radius: 6px; }
.chat { display: flex; flex-direction: column; gap: 12px; margin: 14px 0; max-width: 860px; }
.msg { padding: 10px 14px; border-radius: 12px; max-width: 92%; }
.msg-user { align-self: flex-end; background: #EDE5FF; }
.msg-assistant { align-self: flex-start; background: #fff; border: 1px solid var(--soft); }
.msg-failed { border-color: var(--err); }
.msg .who { font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; color: var(--primary); margin-bottom: 4px; }
.msg .body { white-space: pre-wrap; font-size: .85rem; }
form.chat-form { display: flex; gap: 10px; align-items: flex-end; max-width: 860px; }
form.chat-form textarea { flex: 1; font: inherit; font-size: .85rem; padding: 8px; border: 1px solid var(--line); border-radius: 8px; }
button[disabled], textarea[disabled] { opacity: .5; cursor: not-allowed; }

/* browser-like tabs for the version's views; the panel below holds the active tab */
nav.tabs.chrome { display: flex; gap: 2px; margin: 18px 0 0; padding: 0 0 0 8px; flex-wrap: wrap;
                  border-bottom: 1px solid var(--line); }
nav.tabs.chrome a { position: relative; margin-bottom: -1px; padding: 9px 18px 8px; font-size: .82rem;
                    background: #E3E7F3; color: #3a405a; border: 1px solid var(--line); border-bottom: 0;
                    border-radius: 10px 10px 0 0; text-decoration: none; }
nav.tabs.chrome a:hover { background: #EDEFF8; }
nav.tabs.chrome a.sel { background: #fff; color: var(--text); font-weight: 600; padding-top: 11px;
                        margin-top: -2px; border-bottom: 1px solid #fff; z-index: 1;
                        box-shadow: inset 0 3px 0 var(--primary); }
.tabpanel { background: #fff; border: 1px solid var(--line); border-top: 0; border-radius: 0 0 12px 12px;
            padding: 18px 22px 24px; }
.tabpanel .scroll { border-color: var(--soft); }
.msg .body.md { white-space: normal; }
.md p { margin: 0 0 .6em; }
.md p:last-child { margin-bottom: 0; }
.md ul, .md ol { margin: .2em 0 .7em; padding-left: 1.3em; }
.md li { margin: .15em 0; }
.md h4 { font-family: "Sora", sans-serif; font-size: .9rem; margin: .8em 0 .3em; }
.md code { background: var(--soft); padding: 0 4px; border-radius: 4px; font-size: .92em; }
.md strong { font-weight: 600; }
.prev-answers { background: #F8F9FD; border: 1px solid var(--soft); border-radius: 10px; padding: 10px 16px; margin: 12px 0 18px; }
.prev-answers h3 { margin-top: .2em; }
.prev-answers ul { padding-left: 1.1em; margin: 0; }
.prev-answers li { margin: 6px 0; font-size: .88rem; }
.es { font-size: .7rem; text-transform: uppercase; letter-spacing: .05em; padding: 1px 8px; border-radius: 999px; }
.es-applicata { background: #DFF3E9; color: var(--ok); }
.es-ancora_aperta { background: #FFF1D2; color: #8A6400; }
.es-superata_dal_word { background: #E3EBFF; color: var(--secondary); }
.es-non_pertinente { background: var(--soft); color: #3a405a; }
