/* Trama 1.8.0 — il Centro di comando come le analytics: quattro numeri-scheda con il grafico, il tempo reale, Persone, Funzioni, Soldi.
   Si adatta alla larghezza del pannello (container query), non dello schermo: con la barra intera, con la colonna di icone, sul telefono. */
.x18 { --up: #3F7A4A; --down: #A8452C; container-type: inline-size; padding-bottom: 1.5rem; }
html[data-theme="dark"] .x18 { --up: #8DBA94; --down: #E39A83; }
html[data-theme="dark"] .x18-strip { box-shadow: inset 0 0 0 1px var(--line); }
@media (prefers-color-scheme: dark) { html:not([data-theme="light"]) .x18 { --up: #8DBA94; --down: #E39A83; } html:not([data-theme="light"]) .x18-strip { box-shadow: inset 0 0 0 1px var(--line); } }
.x18-wait > :not(.x18-head) { opacity: .55; transition: opacity .2s; pointer-events: none; }

/* testa: titolo, in diretta, periodo */
.x18-head { display: flex; align-items: flex-end; gap: 10px 14px; flex-wrap: wrap; margin-bottom: 14px; }
.x18-head .page-head { margin: 0 !important; padding: 0 !important; border: 0 !important; }
.x18-head h1 { margin: 0; }
.x18-head .sp { flex: 1; }
.x18-live { display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 14px 0 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font: 600 13.5px/1 var(--sans); color: var(--ink); white-space: nowrap; text-decoration: none; }
.x18-live small { font-weight: 400; color: var(--ink-3); font-size: 13px; }
.x18-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--t16-lume, #E89B12); box-shadow: 0 0 0 4px rgba(232,155,18,.18), 0 0 12px 2px rgba(232,155,18,.4); flex: none; animation: x18-breathe 2.4s ease-in-out infinite; }
@keyframes x18-breathe { 50% { box-shadow: 0 0 0 6px rgba(232,155,18,.08), 0 0 16px 4px rgba(232,155,18,.25); } }
@media (prefers-reduced-motion: reduce) { .x18-dot { animation: none; } }
.x18-range { display: inline-flex; padding: 2px; border-radius: 10px; background: var(--fill); max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.x18-range::-webkit-scrollbar { display: none; }
.x18-range button { padding: 7px 12px; border: 0; border-radius: 8px; background: none; font: 600 13px/1 var(--sans); color: var(--ink-2); white-space: nowrap; cursor: pointer; }
.x18-range button.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(22,24,30,.12); }
.x18 .cc-tabs { margin-bottom: 14px; max-width: 100%; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
.x18 .cc-tabs::-webkit-scrollbar { display: none; }
.x18 .cc-tabs button { white-space: nowrap; }

/* la striscia scura: lo stato di Sistema, in una riga */
.x18-strip { display: flex; align-items: center; gap: 8px 16px; width: 100%; border: 0; text-align: left; cursor: pointer; background: var(--t11-night, #16181E); color: #F4F1E8; border-radius: 14px; padding: 11px 16px; margin-bottom: 16px; font: 400 14px/1.3 var(--sans); flex-wrap: wrap; }
.x18-strip b { font: 500 17px/1.2 var(--serif); letter-spacing: -.005em; }
.x18-strip .lights { display: flex; gap: 4px 12px; flex-wrap: wrap; font-size: 12.5px; color: rgba(244,241,232,.75); }
.x18-strip .lights span { display: inline-flex; align-items: center; gap: 5px; }
.x18-strip .lights i { width: 7px; height: 7px; border-radius: 50%; background: #6B9271; }
.x18-strip .lights i.wait { background: #E89B12; } .x18-strip .lights i.ko { background: #D9634A; }
.x18-strip .go { margin-left: auto; color: #F0B74A; font-weight: 600; white-space: nowrap; }

/* griglie */
.x18-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
.x18-grid2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.x18-col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.x18-mb { margin-bottom: 16px; } .x18-mt { margin-top: 10px; }
.x18-card { background: var(--surface); border: 1px solid var(--line-2); border-radius: 18px; overflow: hidden; min-width: 0; }
.x18-pad { padding: 18px 20px; }
.x18-pt { padding-bottom: 6px; }
.x18-h2 { display: flex; align-items: baseline; gap: 10px; margin: 0 0 12px; }
.x18-h2 h2 { margin: 0; font: 500 1.12rem/1.2 var(--serif); letter-spacing: -.005em; color: var(--ink); }
.x18-h2 .meta { margin-left: auto; font-size: 12.5px; color: var(--ink-3); text-align: right; }
.x18-h2 .x18-link { margin-left: auto; }
.x18-link { border: 0; background: none; padding: 0; font: 600 13.5px/1.2 var(--sans); color: var(--dawn-ink); cursor: pointer; }
.x18-say { font: 500 1.5rem/1.25 var(--serif); letter-spacing: -.012em; color: var(--ink); margin: 0 0 14px; max-width: 36em; }
.x18-say em { font-style: normal; } .x18-say em.u { color: var(--up); } .x18-say em.d { color: var(--down); }
.x18-empty { margin: 0; color: var(--ink-3); font-size: 14px; }
.x18-note { margin: 8px 0 0; font-size: 13px; line-height: 1.45; color: var(--ink-2); }
.x18-note b { color: var(--ink); }

/* i quattro numeri-scheda */
.x18-kt { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid var(--line-2); border-bottom: 1px solid var(--line-2); }
.x18-kt > * { display: block; padding: 14px 18px 13px; border: 0; border-right: 1px solid var(--line-2); background: var(--fill-2); position: relative; min-width: 0; text-align: left; color: inherit; font: inherit; }
.x18-kt > button { cursor: pointer; }
.x18-kt > :last-child { border-right: 0; }
.x18-kt > .on { background: var(--surface); }
.x18-kt > .on::before { content: ''; position: absolute; left: 0; right: 0; top: -1px; height: 3px; background: var(--ink); }
.x18-kt small { display: block; font: 600 12.5px/1.2 var(--sans); color: var(--ink-2); }
.x18-kt b { display: block; font: 500 2rem/1.15 var(--serif); letter-spacing: -.02em; color: var(--ink); margin: 4px 0 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.x18-kt span { display: block; font: 600 12.5px/1.3 var(--sans); color: var(--ink-3); }
.x18-kt span.u { color: var(--up); } .x18-kt span.d { color: var(--down); }

/* grafici */
.x18-chart { position: relative; padding: 12px 18px 4px; min-height: 120px; }
.x18-chart-in { padding: 0; }
.x18-chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.x18-t { font: 400 12px/1 var(--sans); fill: var(--ink-3); }
.x18-tm { font-weight: 700; font-size: 11.5px; fill: var(--dawn-ink); }
.x18-mk { cursor: pointer; }
.x18-tip { position: absolute; z-index: 3; pointer-events: none; background: var(--hero, #16181E); color: var(--surface); border-radius: 10px; padding: 8px 12px; min-width: 150px; box-shadow: 0 10px 30px -12px rgba(22,24,30,.45); }
.x18-tip span { display: block; font-size: 12px; opacity: .72; }
.x18-tip b { display: block; font: 500 19px/1.25 var(--serif); }
.x18-tip small { display: block; font-size: 12px; opacity: .72; }
.x18-leg { display: flex; gap: 6px 18px; flex-wrap: wrap; align-items: center; padding: 4px 18px 14px; font-size: 12.5px; color: var(--ink-3); }
.x18-leg-in { padding: 8px 0 0; }
.x18-leg span { display: inline-flex; align-items: center; gap: 7px; }
.x18-leg i { width: 16px; height: 0; border-top: 2.5px solid var(--ink); }
.x18-leg i.p { border-top: 2px dashed var(--ink-3); }
.x18-leg i.n { width: 9px; height: 9px; border: 0; border-radius: 50%; background: var(--t16-lume, #E89B12); }
.x18-leg i.b { width: 10px; height: 10px; border: 0; border-radius: 3px; }
.x18-add { margin-left: auto; border: 0; background: none; padding: 4px 0; font: 600 12.5px/1 var(--sans); color: var(--dawn-ink); cursor: pointer; }
.x18-more { display: block; width: 100%; text-align: left; padding: 12px 18px; border: 0; border-top: 1px solid var(--line-2); background: none; font: 600 13.5px/1 var(--sans); color: var(--dawn-ink); cursor: pointer; }

/* tempo reale */
.x18-rt-top { display: flex; align-items: center; gap: 8px; font: 600 13px/1 var(--sans); color: var(--ink-2); }
.x18-rt-top .meta { margin-left: auto; font-weight: 400; color: var(--ink-3); }
.x18-now { display: flex; align-items: flex-end; gap: 12px; margin: 14px 0 2px; }
.x18-now b { font: 500 4rem/.9 var(--serif); letter-spacing: -.03em; color: var(--ink); }
.x18-now span { font-size: 13.5px; color: var(--ink-2); line-height: 1.35; padding-bottom: 6px; max-width: 12em; }
.x18-sub { font-size: 13px; color: var(--ink-3); margin-bottom: 4px; }
.x18-sub b { color: var(--ink); }
.x18 h4 { display: flex; align-items: baseline; margin: 14px 0 6px; font: 600 12.5px/1.2 var(--sans); color: var(--ink-2); }
.x18 h4 em { font-style: normal; margin-left: auto; font: 500 1.05rem/1 var(--serif); color: var(--ink); }
.x18-ax { display: flex; justify-content: space-between; font-size: 11px; color: var(--ink-3); margin-top: 3px; }
.x18-feed { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--line-2); }
.x18-feed li { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 10px 20px; border-bottom: 1px solid var(--line-2); font-size: 13.5px; line-height: 1.3; color: var(--ink); }
.x18-feed li:last-child { border-bottom: 0; }
.x18-feed li small { display: block; color: var(--ink-3); font-size: 12.5px; margin-top: 1px; overflow-wrap: anywhere; }
.x18-feed li time { font-size: 12px; color: var(--ink-3); white-space: nowrap; }
.x18-feed .ic, .x18-list .ic, .x18-tab .fx .ic { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--fill); flex: none; }
.x18-feed .ic svg, .x18-list .ic svg { width: 18px; height: 18px; }
.x18-feed li.w .ic { background: var(--dawn-soft); }
.x18-foot { padding: 11px 20px 13px; border-top: 1px solid var(--line-2); font-size: 12.5px; color: var(--ink-3); line-height: 1.4; }
.x18-rtm { display: none; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--line-2); border-radius: 16px; padding: 10px 14px; margin-bottom: 12px; color: var(--ink); text-decoration: none; }
.x18-rtm b { font: 500 2rem/1 var(--serif); letter-spacing: -.02em; }
.x18-rtm > span:not(.go) { font-size: 13px; color: var(--ink-2); line-height: 1.25; max-width: 7.5em; }
.x18-rtm svg { margin-left: auto; width: 110px; height: 30px; flex: none; }
.x18-rtm .go { font: 600 13px/1 var(--sans); color: var(--dawn-ink); white-space: nowrap; }

/* verso l'obiettivo */
.x18-goal b.big, .x18-bign { font: 500 2.1rem/1 var(--serif); letter-spacing: -.02em; color: var(--ink); }
.x18 .of { font-size: 14px; color: var(--ink-2); margin-left: 6px; }
.x18-bar { height: 10px; border-radius: 6px; background: var(--fill); margin: 12px 0 8px; position: relative; overflow: hidden; }
.x18-bar i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 6px; background: var(--ink); }
.x18-bar i.p { background: repeating-linear-gradient(90deg, color-mix(in srgb, var(--ink) 35%, transparent) 0 2px, transparent 2px 5px); }
.x18-goal p { margin: 8px 0 0; font-size: 13.5px; line-height: 1.45; color: var(--ink-2); }
.x18-goal p b { color: var(--ink); }

/* la tabella delle funzioni */
.x18-tab { width: 100%; border-collapse: collapse; font-size: 14px; }
.x18-tab th { text-align: left; font: 600 12px/1.2 var(--sans); color: var(--ink-3); padding: 0 10px 8px; border-bottom: 1px solid var(--line-2); white-space: nowrap; }
.x18-tab th.r, .x18-tab td.r { text-align: right; }
.x18-tab td { padding: 8px 10px; border-bottom: 1px solid var(--line-2); vertical-align: middle; color: var(--ink); white-space: nowrap; }
.x18-tab th:first-child, .x18-tab td:first-child { padding-left: 0; }
.x18-tab th:last-child, .x18-tab td:last-child { padding-right: 0; }
.x18-tab tr:last-child td { border-bottom: 0; }
.x18-tab td.n { font-weight: 600; }
.x18-tab .fx { display: flex; align-items: center; gap: 10px; font-weight: 600; white-space: normal; }
.x18-tab .fx .ic { width: 28px; height: 28px; border-radius: 8px; background: var(--fill-2); }
.x18-tab .fx .ic svg { width: 18px; height: 18px; }
.x18-tab .pc { display: inline-flex; align-items: center; gap: 8px; justify-content: flex-end; }
.x18-tab .pc i { display: block; width: 84px; height: 6px; border-radius: 4px; background: var(--fill); position: relative; overflow: hidden; }
.x18-tab .pc i b { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 4px; }
.x18-tab td.u { color: var(--up); font-weight: 600; } .x18-tab td.d { color: var(--down); font-weight: 600; }

/* barre orizzontali */
.x18-hb { display: flex; flex-direction: column; gap: 10px; }
.x18-hb > div { display: grid; grid-template-columns: 112px minmax(0, 1fr) 70px; gap: 4px 10px; align-items: center; font-size: 13.5px; }
.x18-hb > div > span:first-child { color: var(--ink); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.x18-hb > div > span:first-child b { font-weight: 600; }
.x18-hb > div > i { display: block; height: 10px; border-radius: 5px; background: var(--fill); position: relative; overflow: hidden; }
.x18-hb > div > i b { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 5px; background: var(--ink); }
.x18-hb > div > em { font-style: normal; text-align: right; color: var(--ink-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.x18-hb small { grid-column: 2 / 4; font-size: 12px; color: var(--ink-3); }

/* il percorso */
.x18-fun { display: flex; flex-direction: column; gap: 6px; }
.x18-fun > div { display: grid; grid-template-columns: 140px minmax(0, 1fr) 64px; gap: 12px; align-items: center; }
.x18-fun > div > span { font-size: 13.5px; font-weight: 600; color: var(--ink); }
.x18-fun > div > i { height: 28px; border-radius: 8px; background: var(--fill-2); position: relative; overflow: hidden; display: block; }
.x18-fun > div > i b { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 8px; }
.x18-fun > div > em { font-style: normal; text-align: right; font: 500 1.25rem/1 var(--serif); color: var(--ink); }
.x18-fun > div.step { display: block; padding-left: 156px; font-size: 12px; color: var(--ink-3); margin: -1px 0 1px; }

/* le ore */
.x18-heat { display: grid; grid-template-columns: 34px repeat(24, minmax(0, 1fr)); gap: 3px; font-size: 11px; color: var(--ink-3); align-items: center; }
.x18-heat i { display: block; height: 18px; border-radius: 4px; }
.x18-heat .hx { text-align: center; }
.x18-sc { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 12px; color: var(--ink-3); margin-top: 10px; }
.x18-sc i { width: 16px; height: 10px; border-radius: 3px; display: block; }
.x18-sc span { margin-left: 8px; } .x18-sc span b { color: var(--ink); }

/* soldi */
.x18-wf > div { display: grid; grid-template-columns: 160px minmax(0, 1fr) 92px; gap: 12px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line-2); font-size: 14px; }
.x18-wf > div:last-child { border-bottom: 0; }
.x18-wf > div > span small { display: block; font-size: 12px; color: var(--ink-3); }
.x18-wf > div > i { position: relative; height: 22px; display: block; }
.x18-wf > div > i b { position: absolute; top: 0; bottom: 0; border-radius: 5px; }
.x18-wf > div > em { font-style: normal; text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
.x18-wf > div.t > em { font: 500 1.3rem/1 var(--serif); }
.x18-list { margin: 0; padding: 0; list-style: none; }
.x18-list li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line-2); font-size: 14px; line-height: 1.35; }
.x18-list li:last-child { border-bottom: 0; }
.x18-list li small { display: block; color: var(--ink-3); font-size: 12.5px; }
.x18-steps { display: flex; gap: 3px; margin: 12px 0 8px; }
.x18-steps i { height: 26px; border-radius: 5px; background: var(--fill); position: relative; overflow: hidden; display: block; }
.x18-steps i b { position: absolute; left: 0; top: 0; bottom: 0; background: var(--ink); }
.x18-steps2 { display: flex; gap: 3px; font-size: 12px; color: var(--ink-3); }
.x18-steps2 > span:last-child { display: flex; justify-content: space-between; gap: 8px; }
.x18-steps2 em { font-style: normal; }

/* la pagina del tempo reale (sul telefono si apre toccando «adesso dentro Trama») */
.x18-livep .s-back { display: inline-block; margin-bottom: 8px; }
.x18-livep > .x18-card { max-width: 560px; }

/* ---- larghezze del pannello ---- */
@container (max-width: 979px) {
  .x18-grid { grid-template-columns: minmax(0, 1fr); }
  .x18-rtcard { display: none; }
  .x18-rtm { display: flex; }
}
@container (max-width: 759px) {
  .x18-grid2 { grid-template-columns: minmax(0, 1fr); }
}
@container (max-width: 639px) {
  .x18-kt { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .x18-kt > :nth-child(2) { border-right: 0; }
  .x18-kt > :nth-child(-n+2) { border-bottom: 1px solid var(--line-2); }
  .x18-kt b { font-size: 1.65rem; }
  .x18-kt > * { padding: 12px 14px; }
  .x18-say { font-size: 1.22rem; margin-bottom: 12px; }
  .x18-pad { padding: 16px; }
  .x18-chart { padding: 10px 12px 2px; }
  .x18-chart-in { padding: 0; }
  .x18-leg { padding: 4px 14px 12px; gap: 6px 12px; }
  .x18-hs { display: none; }
  .x18-tab .pc i { width: 56px; }
  .x18-feed li { padding: 10px 16px; }
  .x18-head { align-items: center; }
  .x18-head .sp { display: none; }
  .x18-live small { display: none; }
  .x18-range { order: 5; flex: 1 1 100%; }
  .x18-strip .lights { display: none; }
  .x18-fun > div { grid-template-columns: 112px minmax(0, 1fr) 54px; gap: 10px; }
  .x18-fun > div.step { padding-left: 122px; }
  .x18-wf > div { grid-template-columns: 116px minmax(0, 1fr) 84px; gap: 10px; }
  .x18-hb > div { grid-template-columns: 96px minmax(0, 1fr) 62px; }
}
@container (max-width: 419px) {
  .x18-heat { grid-template-columns: 28px repeat(24, minmax(0, 1fr)); gap: 2px; }
  .x18-heat i { height: 14px; border-radius: 3px; }
  .x18-heat .hx { font-size: 9px; }
  .x18-rtm svg { width: 70px; }
  .x18-fun > div { grid-template-columns: 96px minmax(0, 1fr) 48px; }
  .x18-fun > div.step { padding-left: 106px; }
  .x18-wf > div { grid-template-columns: 96px minmax(0, 1fr) 78px; }
  .x18-now b { font-size: 3.3rem; }
}
