/* App: file manager, cestino, cerca, guida, impostazioni (le altre app aggiungono le proprie regole in fondo) */
.fm { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.fm-main { display: flex; flex: 1; min-height: 0; }
.fm-side { width: 176px; flex: none; border-right: 1px solid var(--line); background: var(--surface); padding: 8px 6px; overflow: auto; display: flex; flex-direction: column; gap: 2px; }
.fm-place { display: flex; align-items: center; gap: 9px; height: 32px; padding: 0 10px; border: 0; border-radius: 6px; background: transparent; cursor: pointer; text-align: left; white-space: nowrap; overflow: hidden; }
.fm-place span:nth-child(2) { flex: 1; overflow: hidden; text-overflow: ellipsis; } .fm-place:hover { background: var(--raise); } .fm-place.on { background: var(--accent-soft); color: var(--accent); }
.fm-sep { border-top: 1px solid var(--line); margin: 6px 4px; }
.fm-crumbs { display: flex; align-items: center; gap: 2px; overflow: hidden; }
.fm-list { flex: 1; outline: none; padding: 4px; }
.fm-head, .fm-row { display: grid; grid-template-columns: minmax(160px, 1fr) 110px 90px 160px; align-items: center; gap: 8px; padding: 0 10px; }
.fm-head { height: 26px; color: var(--muted); font-size: 12px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--surface); z-index: 1; }
.fm-row { min-height: 34px; border-radius: 6px; cursor: default; user-select: none; }
.fm-row:hover { background: var(--surface2); } .fm-row.sel { background: var(--accent-soft); outline: 1px solid var(--accent); outline-offset: -1px; } .fm-row.cut { opacity: .5; }
.fm-row .nm { display: flex; align-items: center; gap: 9px; min-width: 0; color: var(--text); } .fm-row .nm svg { color: var(--accent); flex: none; } .fm-row .t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fm-row .muted { font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fm-list.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 6px; align-content: start; padding: 10px; }
.fm-list.grid .fm-row { display: flex; flex-direction: column; justify-content: center; text-align: center; padding: 10px 6px; min-height: 92px; } .fm-list.grid .nm { flex-direction: column; } .fm-list.grid .t { white-space: normal; word-break: break-word; font-size: 12.5px; line-height: 1.25; max-height: 2.6em; }
.tr-row { grid-template-columns: minmax(140px, 1fr) minmax(110px, 1fr) 80px 150px; }
@media (max-width: 720px) { .fm-side { display: none; } .fm-head, .fm-row { grid-template-columns: 1fr 70px; } .fm-head span:nth-child(2), .fm-head span:nth-child(4), .fm-row > :nth-child(2), .fm-row > :nth-child(4) { display: none; } .tr-row { grid-template-columns: 1fr 70px; } }

.se-res { padding: 6px; display: flex; flex-direction: column; gap: 2px; }
.se-it { display: flex; align-items: center; gap: 12px; text-align: left; border: 0; background: transparent; border-radius: 8px; padding: 8px 10px; cursor: pointer; min-height: 44px; }
.se-it:hover, .se-it:focus-visible { background: var(--accent-soft); outline: none; } .se-it .ic { color: var(--accent); display: grid; } .se-it .t { flex: 1; min-width: 0; display: flex; flex-direction: column; } .se-it .t small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.st { padding: 14px; display: flex; flex-direction: column; gap: 12px; } .st-sec h3 { font-size: 16px; margin-bottom: 4px; }
.st-row { display: flex; align-items: center; gap: 14px; padding: 8px 0; border-top: 1px solid var(--line); } .st-sec h3 + .st-row { border-top: 0; } .st-row small { display: block; max-width: 46ch; }

/* Markdown / formule */
.md { line-height: 1.6; } .md h3, .md h4, .md h5 { margin: 1.2em 0 .4em; } .md h3 { font-size: 1.6em; } .md h4 { font-size: 1.25em; } .md p { margin: .6em 0; max-width: 72ch; } .md ul, .md ol { padding-left: 1.4em; max-width: 72ch; }
.md code { font: .92em var(--mono); background: var(--surface2); border: 1px solid var(--line); border-radius: 4px; padding: 0 4px; } .md pre { background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 12px; overflow: auto; } .md pre code { background: none; border: 0; padding: 0; }
.md blockquote { margin: .6em 0; padding: .1em 1em; border-left: 3px solid var(--accent); color: var(--muted); } .md hr { border: 0; border-top: 1px solid var(--line); margin: 1.2em 0; }
.md-table { overflow: auto; margin: .8em 0; } .md table { border-collapse: collapse; } .md th, .md td { border: 1px solid var(--line); padding: 5px 10px; text-align: left; } .md th { background: var(--surface2); }
.md-display { overflow-x: auto; margin: .6em 0; text-align: center; } .md-math .katex { font-size: 1.05em; }

/* Terminale */
.term { display: flex; flex-direction: column; flex: 1; min-height: 0; background: var(--bg); font-family: var(--mono); font-size: calc(13px * var(--fs)); }
.term-body { flex: 1; min-height: 0; padding: 10px 14px 14px; }
.term-out { overflow: visible !important; flex: none !important; }
.term-l { margin: 0 0 6px; white-space: pre-wrap; word-break: break-word; font: inherit; line-height: 1.45; }
.term-l.in { color: var(--text); } .term-l.out { color: var(--text); } .term-l.val { color: var(--accent); } .term-l.err { color: var(--danger); } .term-l.dim { color: var(--muted); }
.term-l.tex { position: relative; overflow-x: auto; padding: 6px 28px 6px 4px; font-family: inherit; }
.term-l.tex .btn { position: absolute; right: 0; top: 0; opacity: .5; } .term-l.tex:hover .btn { opacity: 1; }
.term-ps { color: var(--accent); user-select: none; white-space: nowrap; }
.term-row { display: flex; align-items: flex-start; gap: 8px; }
.term-in { flex: 1; min-width: 0; background: transparent; border: 0; outline: none; resize: none; font: inherit; color: var(--text); padding: 0; line-height: 1.45; overflow-y: auto; caret-color: var(--accent); }

/* Convertitore, Calcolatrice */
.cv { padding: 14px; display: flex; flex-direction: column; gap: 10px; flex: 1; min-height: 0; } .cv .sel { flex: 1; } .cv-res { font-size: 22px; font-family: var(--serif); padding: 10px 12px; background: var(--accent-soft); border-radius: 8px; } .cv-res.bad { background: transparent; color: var(--danger); font-size: 15px; font-family: var(--ui); }
.cv-all { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 4px 12px; align-content: start; } .cv-it { display: flex; justify-content: space-between; gap: 8px; padding: 6px 4px; border-bottom: 1px solid var(--line); font-size: 13px; }
.calc { padding: 12px; display: flex; flex-direction: column; gap: 8px; flex: 1; min-height: 0; } .calc-top { flex-wrap: wrap; }
.calc-in { width: 100%; height: 48px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); padding: 0 12px; font: 22px var(--mono); text-align: right; } .calc-in:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.calc-out { min-height: 30px; text-align: right; font: 20px var(--serif); color: var(--accent); padding: 0 4px; overflow-x: auto; white-space: nowrap; } .calc-out.bad { color: var(--danger); font: 13px var(--ui); }
.calc-pad { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; } .calc-fn { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; } .calc-pad.p5 { grid-template-columns: repeat(5, 1fr); }
.ck { height: 42px; border-radius: 8px; border: 1px solid var(--line); background: var(--raise); cursor: pointer; font: 16px var(--ui); } .ck:hover { border-color: var(--accent); } .ck:active { transform: translateY(1px); } .ck.op { background: var(--surface2); color: var(--accent); } .ck.eq { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 700; } .ck.fn { font-size: 14px; color: var(--muted); }
.calc-hist { flex: 1; min-height: 60px; display: flex; flex-direction: column; gap: 2px; } .calc-h { display: flex; justify-content: space-between; gap: 10px; border: 0; background: transparent; padding: 4px 6px; border-radius: 6px; cursor: pointer; text-align: left; } .calc-h:hover { background: var(--accent-soft); } .calc-h span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.calc-prog { display: flex; flex-direction: column; gap: 6px; } .calc-base { display: flex; align-items: center; gap: 10px; padding: 6px 10px; background: var(--surface2); border-radius: 8px; } .calc-base .muted { width: 34px; } .calc-base b { flex: 1; word-break: break-all; font-size: 14px; }

/* Editor */
.ed { background: var(--bg); } .ed-name { text-align: right; color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ed-stack { flex: 1; min-height: 0; display: flex; } .ed-code { position: relative; flex: 1; min-width: 0; }
.ed-text { font: calc(13px * var(--fs))/1.55 var(--mono); tab-size: 4; margin: 0; padding: 10px 12px; white-space: pre; letter-spacing: 0; }
.ed-gut { flex: none; text-align: right; color: var(--muted); background: var(--surface); border-right: 1px solid var(--line); overflow: hidden; user-select: none; padding-right: 8px; }
.ed-pre, .ed-ta { position: absolute; inset: 0; width: 100%; height: 100%; box-sizing: border-box; border: 0; }
.ed-pre { overflow: hidden; pointer-events: none; color: var(--text); }
.ed-ta { background: transparent; color: transparent; caret-color: var(--accent); resize: none; outline: none; overflow: auto; } .ed-ta::selection { background: var(--accent-soft); color: transparent; }
.ed-prev { flex: 1; min-width: 0; border-left: 1px solid var(--line); padding: 12px 18px; display: none; } .ed-stack.split .ed-prev { display: block; } .ed-stack.split .ed-code { flex: 1; }
.tk-c { color: var(--muted); font-style: italic; } .tk-s { color: var(--ok); } .tk-n { color: var(--brass); } .tk-k { color: var(--accent); font-weight: 600; } .tk-p { color: var(--brass); font-weight: 600; } .tk-b { color: var(--accent); }

/* Note */
.nt { display: flex; flex: 1; min-height: 0; } .nt-side { width: 260px; flex: none; border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; background: var(--surface); } .nt-side .inp { flex: 1; }
.nt-list { padding: 6px; display: flex; flex-direction: column; gap: 2px; } .nt-it { text-align: left; border: 0; background: transparent; border-radius: 8px; padding: 8px 10px; cursor: pointer; display: flex; flex-direction: column; gap: 2px; min-width: 0; } .nt-it:hover { background: var(--surface2); } .nt-it.on { background: var(--accent-soft); }
.nt-it b, .nt-it small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nt-main { flex: 1; min-width: 0; display: flex; flex-direction: column; } .nt-ta { flex: 1; min-height: 0; resize: none; border: 0; outline: none; background: var(--bg); padding: 18px 22px; font: calc(15px * var(--fs))/1.65 var(--ui); } .nt-prev { flex: 1; padding: 14px 22px; background: var(--bg); }
@media (max-width: 720px) { .nt-side { width: 120px; } }

/* Calendario */
.cal-title { margin: 0 8px; font-size: 20px; white-space: nowrap; } .cal-body { display: flex; flex: 1; min-height: 0; } .cal-main { flex: 1; min-width: 0; display: flex; flex-direction: column; padding: 8px; } .cal-side { width: 260px; flex: none; border-left: 1px solid var(--line); padding: 14px; display: flex; flex-direction: column; gap: 10px; background: var(--surface); }
.cal-wd, .cal-grid { display: grid; grid-template-columns: 26px repeat(7, 1fr); } .cal-wd span { text-align: center; color: var(--muted); font-size: 12px; padding: 4px 0; } .cal-grid { flex: 1; grid-template-rows: repeat(6, 1fr); gap: 3px; min-height: 0; }
.cal-wk { color: var(--muted); font-size: 11px; display: grid; place-items: center; }
.cal-d { position: relative; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); text-align: left; padding: 4px 6px; cursor: pointer; display: flex; flex-direction: column; gap: 2px; overflow: hidden; min-height: 0; min-width: 0; } .cal-d:hover { border-color: var(--accent); } .cal-d.out { opacity: .45; } .cal-d.sel { outline: 2px solid var(--accent); outline-offset: -2px; } .cal-d .n { font-size: 13px; font-weight: 600; } .cal-d.today .n { background: var(--accent); color: var(--accent-ink); border-radius: 10px; padding: 0 7px; align-self: flex-start; } .cal-d.fest .n { color: var(--danger); } .cal-d.today.fest .n { color: var(--accent-ink); }
.cal-d .ev { font-size: 11px; background: var(--accent-soft); color: var(--accent); border-radius: 4px; padding: 0 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .cal-d .hn { font-size: 10px; color: var(--danger); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .cal-d .more { font-size: 10px; }
.cal-e b { display: block; margin-bottom: 4px; } .cal-e p { margin: 0 0 6px; white-space: pre-wrap; }
@media (max-width: 720px) { .cal-side { display: none; } .cal-d .ev, .cal-d .hn { display: none; } }
/* Orologio */
.ck-body { padding: 18px; display: flex; flex-direction: column; gap: 12px; } .ck-big { font: 54px/1.1 var(--serif); text-align: center; letter-spacing: 1px; font-variant-numeric: tabular-nums; } .ck-date { text-align: center; text-transform: capitalize; }
.ck-zones { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 4px 18px; } .ck-z { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; padding: 7px 4px; border-bottom: 1px solid var(--line); align-items: baseline; } .ck-c { justify-content: center; } .ck-laps { display: flex; flex-direction: column; }
.ck-bar { height: 6px; background: var(--surface2); border-radius: 3px; overflow: hidden; } .ck-barf { height: 100%; background: var(--accent); width: 0; }
/* Attività */
.tk-list { padding: 8px; display: flex; flex-direction: column; gap: 4px; } .tk { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); } .tk input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--accent); } .tk.done .tk-t { text-decoration: line-through; color: var(--muted); } .tk-t { cursor: text; }
.tag.urg { color: var(--danger); border-color: var(--danger); } .tag.imp { color: var(--brass); border-color: var(--brass); } .tag.late { color: var(--danger); border-color: var(--danger); }
/* Monitor */
.mon { padding: 14px; display: flex; flex-direction: column; gap: 12px; } .mon-g { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; } .mon-card .mon-cv { width: 100%; height: 56px; display: block; margin-top: 6px; } .mon-r { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--line); } .mon-r > :first-child:not(svg) { min-width: 170px; } .mon-info .mon-r span:last-child { flex: 1; }

/* Fogli */
.sh-wrap { flex: 1; outline: none; background: var(--bg); } .sh-t { border-collapse: separate; border-spacing: 0; font-size: 13px; user-select: none; }
.sh-t th { position: sticky; background: var(--surface2); color: var(--muted); font-weight: 600; z-index: 2; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); text-align: center; padding: 0 6px; height: 24px; } .sh-ch { top: 0; min-width: 96px; } .sh-rh { left: 0; min-width: 44px; z-index: 1 !important; } .sh-corner { top: 0; left: 0; z-index: 3 !important; }
.sh-t td { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); height: 24px; min-width: 96px; max-width: 260px; padding: 0 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; background: var(--bg); position: relative; }
.sh-t td.num { text-align: right; font-variant-numeric: tabular-nums; } .sh-t td.err { color: var(--danger); } .sh-t td.in { background: var(--accent-soft); } .sh-t td.cur { outline: 2px solid var(--accent); outline-offset: -2px; background: var(--bg); }
.sh-edit { position: absolute; inset: 0; width: 100%; border: 2px solid var(--accent); background: var(--surface); padding: 0 4px; font: inherit; outline: none; z-index: 1; }
.sh-ref { min-width: 54px; text-align: center; padding: 4px 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface2); }

/* Grafici */
.gr { display: flex; flex: 1; min-height: 0; } .gr-side { width: 300px; flex: none; border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; background: var(--surface); } .gr-panel { padding: 10px; display: flex; flex-direction: column; gap: 8px; } .gr-main { flex: 1; min-width: 0; display: flex; flex-direction: column; } .gr-cvw { position: relative; flex: 1; min-height: 0; } .gr-cv { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; cursor: crosshair; outline: none; }
.gr-info { position: absolute; left: 8px; bottom: 6px; font-size: 12px; background: color-mix(in srgb, var(--surface) 85%, transparent); padding: 2px 8px; border-radius: 6px; pointer-events: none; } .gr-info:empty { display: none; } .gr-err { padding: 8px 12px; color: var(--danger); border-top: 1px solid var(--line); font-size: 13px; }
.gr-f { display: flex; align-items: center; gap: 6px; } .gr-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; } .gr-f input[type=checkbox] { accent-color: var(--accent); }
@media (max-width: 720px) { .gr { flex-direction: column; } .gr-side { width: auto; max-height: 40%; border-right: 0; border-bottom: 1px solid var(--line); } }

/* Immagini */
.im { display: flex; flex: 1; min-height: 0; position: relative; } .im-gal, .im-view { flex: 1; min-width: 0; display: flex; flex-direction: column; } .im-grid { flex: 1; display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; padding: 10px; align-content: start; }
.im-th { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 6px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--text); cursor: pointer; font-size: 12px; } .im-th:hover, .im-th:focus-visible { border-color: var(--accent); } .im-th > img, .im-ph { width: 100%; height: 100px; object-fit: cover; border-radius: 4px; background: var(--bg); } .im-th span:last-child { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .im-th.dir { justify-content: center; min-height: 128px; }
.im-stage { flex: 1; min-height: 0; overflow: hidden; display: flex; align-items: center; justify-content: center; background: var(--bg); outline: none; touch-action: none; cursor: grab; } .im-img { max-width: 100%; max-height: 100%; user-select: none; transform-origin: center; } .im-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Disegno */
.dg { display: flex; flex-direction: column; flex: 1; min-height: 0; } .dg-wrap { flex: 1; background: var(--bg); padding: 12px; } .dg-board { position: relative; width: 100%; max-width: 1200px; aspect-ratio: 3 / 2; margin: 0 auto; box-shadow: 0 1px 6px #0004; } .dg-cv { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; background: #fff; } .dg-over { background: transparent; cursor: crosshair; }
.dg-col { width: 34px; height: 30px; padding: 0; border: 1px solid var(--line); border-radius: 6px; background: none; } .dg-sw { width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--line); cursor: pointer; padding: 0; } .dg-sw:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; } .tools.wrap { flex-wrap: wrap; }
/* Media */
.md { display: flex; flex: 1; min-height: 0; } .md-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; padding: 10px; } .md-stage { flex: 1; min-height: 120px; background: #000; border-radius: 8px; display: flex; align-items: center; justify-content: center; overflow: hidden; } .md-video { max-width: 100%; max-height: 100%; } .md-an { width: 100%; height: 100%; } .md-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .md-ctl { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; } .md-seek { flex: 1; min-width: 120px; accent-color: var(--accent); } .md-vol { width: 100px; accent-color: var(--accent); }
.md-list { width: 220px; flex: none; border-left: 1px solid var(--line); background: var(--surface); display: flex; flex-direction: column; } .md-it { text-align: left; padding: 8px 10px; border: 0; background: none; color: var(--text); cursor: pointer; border-bottom: 1px solid var(--line); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .md-it.on { background: color-mix(in srgb, var(--accent) 22%, transparent); } .md-it:hover { background: color-mix(in srgb, var(--accent) 12%, transparent); }
@media (max-width: 720px) { .md { flex-direction: column; } .md-list { width: auto; max-height: 30%; border-left: 0; border-top: 1px solid var(--line); } }

/* Sicurezza e comuni */
.pad { padding: 10px; } .row.wrap { flex-wrap: wrap; } p.err { color: var(--danger); } .sec { display: flex; flex-direction: column; flex: 1; min-height: 0; } .sec-body { flex: 1; padding: 12px; display: flex; flex-direction: column; gap: 12px; } .sec-body .card { display: flex; flex-direction: column; gap: 10px; } .sec-body .card h3 { margin: 0; font-size: 15px; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; } .tbl td { padding: 6px 8px; border-bottom: 1px solid var(--line); } .tbl td:last-child { width: 24px; } .hx { display: block; word-break: break-all; padding: 8px; background: var(--bg); border-radius: 6px; margin: 6px 0; user-select: all; }

/* Home Assistant */
.ha { display: flex; flex-direction: column; flex: 1; min-height: 0; } .ha-body { flex: 1; display: flex; flex-direction: column; min-height: 0; } .ha-login { max-width: 460px; margin: 16px auto; display: flex; flex-direction: column; gap: 10px; width: calc(100% - 24px); } .ha-login h3 { margin: 0; }
.ha-list { flex: 1; overflow: auto; } .ha-it { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-bottom: 1px solid var(--line); } .ha-nm { flex: 1; min-width: 0; display: flex; flex-direction: column; } .ha-nm b, .ha-nm small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .ha-st { color: var(--muted); max-width: 40%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Remoto e Browser */
.rm, .br { display: flex; flex-direction: column; flex: 1; min-height: 0; } .rm-stage, .br-stage { flex: 1; min-height: 0; position: relative; background: var(--bg); overflow: auto; } .rm-frame, .br-frame { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #fff; }
.rm-help { max-width: 560px; margin: 18px auto; padding: 0 16px; display: flex; flex-direction: column; gap: 10px; } .rm-help h3 { margin: 0; } .rm-help ol { padding-left: 20px; display: flex; flex-direction: column; gap: 6px; } .br-note { margin: 0; padding: 6px 12px; font-size: 12px; border-top: 1px solid var(--line); }

/* Giochi */
.g { display: flex; flex-direction: column; flex: 1; min-height: 0; } .g-area { flex: 1; padding: 12px; } .g-box { display: flex; flex-direction: column; gap: 10px; align-items: center; outline: none; } .g-box > .tools { width: 100%; } .g-info { min-height: 1.4em; } .g-box > p { text-align: center; max-width: 420px; margin: 0; }
.g-grid { display: grid; gap: 3px; width: min(100%, 420px); } .g-c { aspect-ratio: 1; border: 1px solid var(--line); background: var(--surface2); color: var(--text); border-radius: 4px; font: 600 clamp(14px, 3.4vw, 20px) ui-monospace, monospace; cursor: pointer; padding: 0; display: flex; align-items: center; justify-content: center; } .g-c:hover:not(:disabled) { border-color: var(--accent); } .g-c:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.mines .g-c.o { background: var(--bg); cursor: default; } .mines .g-c.mine { background: var(--danger); color: #fff; } .mines .n1 { color: #3e63dd; } .mines .n2 { color: var(--ok); } .mines .n3 { color: var(--danger); } .mines .n4 { color: #8e4ec6; } .mines .n5, .mines .n6, .mines .n7, .mines .n8 { color: var(--brass); }
.tiles .tile { font-size: clamp(18px, 5vw, 28px); background: color-mix(in srgb, var(--accent) 20%, var(--surface2)); } .tiles .tile.empty { background: transparent; border-color: transparent; } .memory .mem { font-size: clamp(22px, 6vw, 36px); } .memory .mem.o { background: var(--bg); } .tris .tris-c { font-size: clamp(32px, 9vw, 56px); } .tris { gap: 6px; }
.c4 { gap: 4px; background: color-mix(in srgb, var(--accent) 35%, var(--surface)); padding: 6px; border-radius: 8px; } .c4-c { border-radius: 50%; background: var(--bg); } .c4-c.R { background: #e5484d; border-color: #e5484d; } .c4-c.Y { background: #e8c547; border-color: #e8c547; } .c4-c.last { outline: 2px solid var(--text); outline-offset: -3px; }
.g-snake { width: min(100%, 400px); aspect-ratio: 1; border: 1px solid var(--line); border-radius: 6px; touch-action: none; outline: none; } .g-snake:focus-visible { border-color: var(--accent); }

/* Casa virtuale */
.cv { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.cv-bar { gap: 8px; } .cv-clock { font-size: 14px; min-width: 150px; } .cv-info { font-size: 12.5px; white-space: nowrap; }
.cv-tabs { display: flex; gap: 4px; padding: 6px 8px; border-bottom: 1px solid var(--line); background: var(--surface); overflow-x: auto; flex: none; }
.cv-tabs .btn { white-space: nowrap; }
.cv-body { flex: 1; min-height: 0; overflow: auto; }
.cv-sec { padding: 10px 12px 2px; } .cv-sec h3 { font-size: 14px; margin: 0 0 8px; color: var(--muted); font-weight: 600; }
.cv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; }
.cv-tile { background: var(--surface2); border: 1px solid var(--line); border-radius: var(--r); padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.cv-tile.lit { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, var(--surface2)); }
.cv-tn { display: flex; flex-direction: column; min-width: 0; } .cv-tn b, .cv-tn small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cv-ctl { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; } .cv-ctl:empty { display: none; }
.cv-range { flex: 1; min-width: 80px; accent-color: var(--accent); height: 28px; } .cv-tt { min-width: 64px; text-align: center; }
.cv-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; padding: 10px; align-items: start; }
.cv-list { display: flex; flex-direction: column; gap: 2px; } .cv-det { position: sticky; top: 0; display: flex; flex-direction: column; gap: 8px; } .cv-det h3 { margin: 0; }
.cv-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0 10px; text-align: left; border: 0; background: transparent; border-radius: 6px; padding: 6px 10px; cursor: pointer; min-height: 40px; }
.cv-row:hover, .cv-row:focus-visible { background: var(--surface2); outline: none; } .cv-row.sel { background: var(--accent-soft); outline: 1px solid var(--accent); outline-offset: -1px; }
.cv-row .t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .cv-row small { grid-column: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .cv-sv { grid-row: 1 / 3; grid-column: 2; align-self: center; color: var(--muted); font-size: 12px; max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cv-autos, .cv-tools { display: flex; flex-direction: column; gap: 10px; } .cv-auto { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.cv-an { display: flex; flex-direction: column; min-width: 0; flex: 1 1 260px; } .cv-an small { white-space: normal; }
.cv-edit { padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; } .cv-edit h3 { margin: 0; }
.cv-yaml { min-height: 260px; width: 100%; font-size: 13px; line-height: 1.5; tab-size: 2; white-space: pre; overflow: auto; } .cv-ta2 { width: 100%; font-size: 13px; }
.ok-msg { color: var(--ok); } .cv-pre { font: 13px var(--mono); background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; white-space: pre-wrap; margin-top: 8px; min-height: 36px; } .cv-pre.err { color: var(--danger); }
.cv-canvas { display: block; width: 100%; height: 240px; } .cv-log { margin: 0; padding: 3px 0; border-bottom: 1px solid var(--line); font-size: 13px; } .cv-log.bad { color: var(--danger); }
@media (max-width: 640px) { .cv-split { grid-template-columns: 1fr; } .cv-det { position: static; } .cv-clock { min-width: 0; } }
.ha-area { margin: 0; padding: 10px 12px 4px; font-size: 12.5px; font-weight: 600; color: var(--muted); border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--surface); }
.cv-bar .sel { min-width: 130px; } .cv-ctl .sel { min-width: 112px; flex: 1; }

/* Luca P. dentro LucaOS */
.lp { display: flex; flex-direction: column; flex: 1; min-height: 0; } .lp-stage { flex: 1; min-height: 0; position: relative; background: var(--bg); overflow: auto; }
.lp-frame { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #fff; }
.lp-help { max-width: 560px; margin: 18px auto; padding: 0 14px; display: flex; flex-direction: column; gap: 10px; } .lp-help h3 { margin: 0; }

/* App bibliografiche (arXiv, Zenodo, SSRN) */
.sc { display: flex; flex-direction: column; flex: 1; min-height: 0; } .sc-body { flex: 1; min-height: 0; overflow: auto; padding: 10px 12px; display: flex; flex-direction: column; gap: 10px; }
.sc-form { display: flex; flex-direction: column; gap: 8px; } .sc-form input[type=text], .sc-card input[type=text] { flex: 1; min-width: 160px; height: 32px; padding: 0 9px; border-radius: var(--rs); border: 1px solid var(--line); background: var(--bg); }
.sc-form select { height: 30px; padding: 0 6px; border-radius: var(--rs); border: 1px solid var(--line); background: var(--bg); }
.sc-out { display: flex; flex-direction: column; gap: 10px; } .sc-count { font-size: .85em; }
.sc-card { border: 1px solid var(--line); border-radius: var(--r, 10px); background: var(--surface); padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; }
.sc-title { margin: 0; font-size: 1.02em; line-height: 1.3; overflow-wrap: anywhere; } .sc-meta { font-size: .86em; overflow-wrap: anywhere; }
.sc-abs { font-size: .93em; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; } .sc-tags { display: flex; gap: 5px; flex-wrap: wrap; } .sc-tag { font-size: .76em; padding: 1px 8px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); }
.sc-act { gap: 6px; } .sc-act a.btn { text-decoration: none; color: inherit; } .sc-card input[type=text] { width: 100%; }
.sc-note { padding: 8px 10px; border-radius: var(--rs); border: 1px solid var(--line); background: var(--surface2); } .sc-note.bad { border-color: var(--danger); } .sc-link { color: var(--accent); }
.sc-pager { justify-content: center; } .sc-foot { font-size: .8em; margin: 0; } .sc-info { max-width: 62ch; display: flex; flex-direction: column; gap: 4px; } .sc-info p { margin: 4px 0; line-height: 1.5; }
.sc-notes { font-size: .88em; white-space: pre-wrap; overflow-wrap: anywhere; } .sc-notes:empty { display: none; }

/* Quark Frenzy */
.qf { --q-bg: #080b1a; --q-pan: rgba(12, 18, 40, .92); --q-line: #2a3a6e; --q-cy: #7dffe0; --q-ye: #ffe27a; --q-rd: #ff4d6a; --q-tx: #eaf0ff; flex: 1; min-height: 0; display: flex; background: var(--q-bg); color: var(--q-tx); outline: none; position: relative; user-select: none; -webkit-user-select: none; }
.qf-stage { position: relative; flex: 1; min-width: 0; min-height: 0; overflow: hidden; } .qf-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
.qf-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.qf-hud { position: absolute; inset: 0; pointer-events: none; display: flex; flex-direction: column; justify-content: space-between; padding: 8px 10px; } .qf-hud[hidden] { display: none; }
.qf-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; } .qf-tl { display: flex; flex-direction: column; text-shadow: 0 1px 4px #000; } .qf-tl b { font-size: 1.05rem; color: var(--q-cy); } .qf-score { font-size: 1.5rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.qf-tr { display: flex; gap: 6px; pointer-events: auto; } .qf-ib { width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--q-line); background: var(--q-pan); color: var(--q-tx); font-weight: 800; cursor: pointer; } .qf-ib:hover { border-color: var(--q-cy); }
.qf-combo { text-align: center; text-shadow: 0 1px 4px #000; } .qf-combo[hidden] { display: none; } .qf-combo b { font-size: 1.5rem; color: var(--q-ye); display: block; } .qf-cbar { display: block; width: 110px; height: 5px; border-radius: 3px; background: rgba(255,255,255,.15); margin: 2px auto 0; overflow: hidden; } .qf-cbar i { display: block; height: 100%; background: var(--q-ye); }
.qf-boss { position: absolute; left: 50%; top: 58px; transform: translateX(-50%); width: min(380px, 70%); text-align: center; font-weight: 700; color: var(--q-rd); text-shadow: 0 1px 4px #000; } .qf-boss[hidden] { display: none; } .qf-bbar { display: block; height: 9px; border-radius: 5px; background: rgba(255,255,255,.15); overflow: hidden; margin-top: 2px; } .qf-bbar i { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, #ff4d6a, #ffb04d); }
.qf-buffs { position: absolute; left: 10px; top: 66px; font-weight: 700; color: var(--q-ye); text-shadow: 0 1px 4px #000; font-size: .9rem; }
.qf-banner { position: absolute; left: 50%; top: 28%; transform: translate(-50%, -6px); opacity: 0; font-size: clamp(1.2rem, 4vw, 2.2rem); font-weight: 800; text-align: center; text-shadow: 0 2px 10px #000, 0 0 18px var(--q-cy); transition: opacity .25s, transform .25s; width: 90%; } .qf-banner.on { opacity: 1; transform: translate(-50%, 0); } .qf-banner.boss { color: var(--q-rd); text-shadow: 0 2px 10px #000, 0 0 18px var(--q-rd); }
.qf-bot { display: flex; justify-content: space-between; align-items: flex-end; gap: 8px; } .qf-bl { display: flex; flex-direction: column; gap: 6px; min-width: 0; } .qf-hearts { display: flex; gap: 2px; font-size: 1.5rem; line-height: 1; text-shadow: 0 1px 4px #000; flex-wrap: wrap; max-width: 260px; }
.qf-h.full { color: var(--q-rd); } .qf-h.half { color: #ff9aa9; opacity: .75; } .qf-h.empty { color: #3a2a3a; } .qf-h.sh { color: #59a8ff; }
.qf-xp { display: flex; align-items: center; gap: 8px; } .qf-lvl { font-weight: 700; font-size: .9rem; min-width: 52px; text-shadow: 0 1px 3px #000; } .qf-xbar { display: block; width: min(220px, 34vw); height: 8px; border-radius: 4px; background: rgba(255,255,255,.15); overflow: hidden; } .qf-xbar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #6ee7ff, #ffe27a); }
.qf-br { display: flex; gap: 8px; pointer-events: auto; }
.qf-act { position: relative; overflow: hidden; width: 78px; height: 56px; border-radius: 14px; border: 2px solid var(--q-line); background: var(--q-pan); color: var(--q-tx); font-weight: 800; cursor: pointer; touch-action: none; } .qf-act i { position: absolute; left: 0; bottom: 0; height: 5px; width: 0; background: var(--q-cy); } .qf-nova i { background: #fff; }
.qf-act.ready { border-color: var(--q-cy); box-shadow: 0 0 12px rgba(125,255,224,.5); } .qf-nova.ready { border-color: #fff; box-shadow: 0 0 14px rgba(255,255,255,.7); animation: qfp 1s infinite; } @keyframes qfp { 50% { transform: scale(1.06); } } @media (prefers-reduced-motion: reduce) { .qf-nova.ready { animation: none; } .qf-banner { transition: none; } }
.qf:not(.qf-touch) .qf-act { width: 66px; height: 40px; font-size: .78rem; }
.qf-flash { position: absolute; inset: 0; pointer-events: none; opacity: 0; box-shadow: inset 0 0 90px 24px rgba(255, 40, 80, .0); transition: opacity .12s; } .qf-flash.on { opacity: 1; box-shadow: inset 0 0 90px 18px rgba(255, 40, 80, .38); } .qf-flash.hit { opacity: 1; box-shadow: inset 0 0 130px 36px rgba(255, 40, 80, .6); }
.qf-joy { position: absolute; width: 112px; height: 112px; margin: -56px 0 0 -56px; border-radius: 50%; border: 2px solid rgba(125,255,224,.5); background: rgba(125,255,224,.08); pointer-events: none; } .qf-joy[hidden] { display: none; } .qf-joy i { position: absolute; left: 50%; top: 50%; width: 46px; height: 46px; margin: -23px 0 0 -23px; border-radius: 50%; background: rgba(125,255,224,.45); }
.qf-ov { position: absolute; inset: 0; display: flex; align-items: flex-start; justify-content: center; overflow: auto; padding: 14px; background: radial-gradient(ellipse at center, rgba(8,11,26,.55), rgba(8,11,26,.88)); } .qf-ov[hidden] { display: none; }
.qf-card { margin: auto; width: min(560px, 100%); display: flex; flex-direction: column; gap: 12px; padding: 18px; border: 1px solid var(--q-line); border-radius: 16px; background: var(--q-pan); box-shadow: 0 10px 40px rgba(0,0,0,.5); }
.qf-title { margin: 0; font-size: clamp(1.7rem, 6vw, 2.5rem); letter-spacing: .02em; text-align: center; background: linear-gradient(90deg, #7dffe0, #ffe27a 55%, #ff7aa0); -webkit-background-clip: text; background-clip: text; color: transparent; } .qf-sub { margin: 0; text-align: center; color: #b9c6ee; } .qf-err { color: #ff9aa9; } .qf-hint { margin: 0; font-size: .85rem; color: #98a8d8; } .qf-foot { margin: 0; font-size: .78rem; color: #7f8fc0; text-align: center; }
.qf-diffs { display: flex; flex-direction: column; gap: 6px; } .qf-diff { display: grid; grid-template-columns: auto 1fr; column-gap: 10px; align-items: center; padding: 8px 10px; border: 2px solid var(--q-line); border-radius: 12px; cursor: pointer; } .qf-diff.on { border-color: var(--q-cy); background: rgba(125,255,224,.08); } .qf-diff input { grid-row: 1 / 3; } .qf-diff span { font-size: .85rem; color: #b9c6ee; }
.qf-row { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.qf-btn { min-height: 44px; padding: 0 18px; border-radius: 12px; border: 2px solid var(--q-line); background: #16204a; color: var(--q-tx); font-weight: 700; cursor: pointer; font-size: 1rem; } .qf-btn:hover:not(:disabled) { border-color: var(--q-cy); } .qf-btn:disabled { opacity: .5; cursor: wait; } .qf-btn.pri { background: linear-gradient(180deg, #7dffe0, #3cc9b0); color: #04201b; border-color: #7dffe0; } .qf-btn.big { min-width: 160px; min-height: 52px; font-size: 1.2rem; }
.qf-best { display: flex; flex-direction: column; font-size: .9rem; gap: 2px; align-items: center; } .qf-best b { color: var(--q-ye); }
.qf-how { border: 1px solid var(--q-line); border-radius: 10px; padding: 6px 10px; } .qf-how summary { cursor: pointer; font-weight: 700; } .qf-how ul { margin: 8px 0 2px; padding-left: 18px; display: flex; flex-direction: column; gap: 5px; font-size: .9rem; color: #c6d2f5; } .qf-opts { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; } .qf-opt { display: flex; align-items: center; gap: 8px; }
.qf-ups { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); } .qf-up { position: relative; display: flex; flex-direction: column; gap: 4px; text-align: left; padding: 26px 12px 12px; border-radius: 14px; border: 2px solid var(--q-line); background: #131c40; color: var(--q-tx); cursor: pointer; min-height: 120px; } .qf-up:hover, .qf-up:focus-visible { border-color: var(--q-ye); background: #1a2655; } .qf-up b { font-size: 1.05rem; color: var(--q-ye); } .qf-up span { font-size: .88rem; color: #c6d2f5; } .qf-up small { margin-top: auto; color: #8fa0d6; } .qf-up kbd { position: absolute; left: 10px; top: 8px; font: 700 .8rem ui-monospace, monospace; padding: 1px 7px; border-radius: 6px; border: 1px solid var(--q-line); color: #b9c6ee; }
.qf-rec { margin: 0; text-align: center; font-weight: 800; color: var(--q-ye); font-size: 1.2rem; } .qf-big { margin: 0; text-align: center; font-size: 2rem; font-weight: 800; font-variant-numeric: tabular-nums; } .qf-stats { display: grid; grid-template-columns: 1fr auto; gap: 4px 16px; margin: 0; padding: 8px 12px; border: 1px solid var(--q-line); border-radius: 10px; } .qf-stats dt { color: #98a8d8; } .qf-stats dd { margin: 0; font-weight: 700; text-align: right; }
@media (max-width: 520px) { .qf-card { padding: 12px; gap: 8px; } .qf-hearts { font-size: 1.25rem; } .qf-score { font-size: 1.2rem; } }
