/* YouppyCAD: colori (blu tecnico) e interfaccia del CAD. Si carica dopo app.css e office.css, presi da YouppyStudy. */
[data-tema="chiaro"] { --accento: #2563eb; --accento-forte: #1d4ed8; --su-accento: #ffffff; --accento-tenue: #dbe7ff; --scena: #eef1f5; --ombra: 0 2px 14px rgba(20, 40, 90, .09); }
[data-tema="scuro"] { --accento: #4f8ef7; --accento-forte: #8db4ff; --su-accento: #0b1220; --accento-tenue: #1b2a45; --scena: #11141a; }
#app { max-width: none; box-shadow: none !important; }
@media (min-width: 660px) { body { background: var(--sfondo); } }
#vista.pieno { overflow: hidden; display: flex; }
.editor { flex: 1; min-width: 0; display: flex; flex-direction: column; height: 100%; }
.ctesta { display: flex; align-items: center; gap: 6px; padding: calc(8px + env(safe-area-inset-top)) 10px 8px; background: var(--carta); border-bottom: 1px solid var(--linea); min-width: 0; }
.ambPill { display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 10px 0 8px; border-radius: 999px; background: var(--accento-tenue); color: var(--accento-forte); font-weight: 800; font-size: 14px; white-space: nowrap; max-width: 44%; min-width: 0; overflow: hidden; flex: none; }
.ambPill span { overflow: hidden; text-overflow: ellipsis; }
.ambPill .freccia { font-style: normal; font-size: 11px; opacity: .8; }
svg.amb { width: 22px; height: 22px; flex: none; }
.nomeProg { flex: 1; min-width: 0; text-align: left; font-weight: 700; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--tenue); padding: 0 4px; height: 38px; }
.tondo.p { width: 36px; height: 36px; box-shadow: none; background: var(--campo); }
.tondo.p svg { width: 18px; height: 18px; }
.corpo { flex: 1; min-height: 0; display: flex; position: relative; }
.corpo[data-barra="sinistra"] .cbarra { order: -1; }
.corpo[data-barra="destra"] .cbarra { order: 1; }
.corpo[data-barra="sinistra"] .pannello { order: -1; border-left: 0; border-right: 1px solid var(--linea); }
.corpo[data-barra="su"] { flex-direction: column; }
.corpo[data-barra="nessuna"] .cbarra { display: none; }
.area { flex: 1; min-width: 0; min-height: 0; display: flex; position: relative; }
.cbarra { flex: none; display: flex; flex-direction: column; gap: 6px; padding: 8px 6px; background: var(--sfondo); overflow-y: auto; scrollbar-width: none; }
.cbarra::-webkit-scrollbar { display: none; }
.corpo[data-barra="su"] .cbarra { flex-direction: row; overflow-x: auto; overflow-y: hidden; padding: 6px 8px; }
.cbarra .cb { width: 52px; min-height: 52px; flex: none; border-radius: 15px; }
.cbarra .cb.on { background: var(--accento); color: var(--su-accento); }
.cbarra .cb small { font-size: 9.5px; }
.vscena { flex: 1; min-width: 0; min-height: 0; position: relative; overflow: hidden; background: var(--scena); }
.vscena canvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; display: block; }
.vscena canvas[hidden] { display: none; }
.mostraBarra { display: none; position: absolute; top: 8px; left: 8px; width: 40px; height: 40px; border-radius: 12px; background: var(--carta); box-shadow: var(--ombra); color: var(--testo); place-items: center; z-index: 3; }
.mostraBarra svg { width: 20px; height: 20px; }
.corpo[data-barra="nessuna"] .mostraBarra { display: grid; }
.attrezzi { position: absolute; left: 8px; right: 8px; bottom: 8px; display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 2px; z-index: 2; }
.attrezzi::-webkit-scrollbar { display: none; }
.att { flex: none; display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 12px; border-radius: 12px; background: var(--carta); box-shadow: var(--ombra); font-weight: 700; font-size: 13px; color: var(--testo); white-space: nowrap; }
.att svg { width: 16px; height: 16px; }
.att.on { background: var(--accento); color: var(--su-accento); }
.suggerimento { position: absolute; top: 8px; left: 50%; transform: translateX(-50%); background: color-mix(in srgb, var(--testo) 82%, transparent); color: var(--sfondo); padding: 6px 12px; border-radius: 999px; font-size: 12.5px; font-weight: 600; max-width: calc(100% - 64px); text-align: center; z-index: 2; pointer-events: none; }
.pannello { flex: none; width: 340px; background: var(--carta); border-left: 1px solid var(--linea); overflow-y: auto; padding: 10px 14px 20px; display: flex; flex-direction: column; gap: 12px; z-index: 4; }
.pannello[hidden] { display: none; }
@media (max-width: 899px) {
  .pannello { position: absolute; left: 0; right: 0; bottom: 0; width: auto; height: 34%; border-radius: 20px 20px 0 0; box-shadow: 0 -8px 30px rgba(0, 0, 0, .22); border: 0 !important; padding-top: 4px; transition: height .2s; }
  .pannello.alto { height: 78%; }
  .area.conPannello .attrezzi { bottom: calc(34% + 8px); }
  .area.conPannello:has(.pannello.alto) .attrezzi { display: none; }
  .pannello .pManico { display: block; }
}
.pManico { display: none; width: 100%; height: 18px; flex: none; position: sticky; top: -4px; background: var(--carta); z-index: 2; cursor: ns-resize; }
.pManico::before { content: ""; display: block; width: 44px; height: 5px; border-radius: 3px; background: var(--linea); margin: 6px auto 0; }
@media (max-width: 600px) {
  .ctesta { flex-wrap: wrap; row-gap: 2px; padding-bottom: 4px; }
  .ctesta .nomeProg { order: 9; flex: 1 0 100%; height: 20px; font-size: 12.5px; padding: 0 6px; }
  .ambPill { max-width: none; flex: 1 1 auto; justify-content: flex-start; }
  .ctesta .tondo.p { width: 34px; height: 34px; }
  .cbarra { gap: 4px; padding: 6px 4px; }
  .cbarra .cb { width: 46px; min-height: 46px; border-radius: 13px; }
  .cbarra .cb small { font-size: 9px; }
  .corpo[data-barra="su"] .cbarra { justify-content: space-between; padding: 4px 6px; }
}
@media (max-width: 899px) {}
.pTesta { display: flex; align-items: center; gap: 8px; position: sticky; top: -10px; background: var(--carta); padding: 4px 0; z-index: 1; }
.pTesta h3 { flex: 1; font-size: 17px; font-weight: 800; font-family: "Baloo 2", system-ui, sans-serif; }
.psez { display: flex; flex-direction: column; gap: 8px; }
.psez h4 { margin: 0; font-size: 12.5px; font-weight: 800; color: var(--tenue); text-transform: uppercase; letter-spacing: .05em; }
.righe { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; }
.righe.tre { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.fcampo { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.fcampo span { font-size: 11.5px; font-weight: 700; color: var(--tenue); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cmp { width: 100%; min-width: 0; height: 38px; padding: 0 10px; border-radius: 10px; border: 1px solid transparent; background: var(--campo); font-size: 15px; }
.cmp:focus { outline: none; border-color: var(--accento); background: var(--carta); }
input[type="color"] { width: 100%; height: 38px; border: 0; border-radius: 10px; background: var(--campo); padding: 3px; }
.griglia2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; }
.griglia3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.pannello .bottone { min-height: 42px; font-size: 14px; padding: 0 10px; border-radius: 12px; }
.pannello .bottone svg { width: 17px; height: 17px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips .chip { min-height: 32px; padding: 0 11px; font-size: 12.5px; flex: none; display: inline-flex; align-items: center; border-radius: 999px; background: var(--campo); color: var(--tenue); font-weight: 700; }
.chips .chip.on { background: var(--accento-tenue); color: var(--accento-forte); }
.cursore { display: flex; flex-direction: column; gap: 2px; font-size: 12.5px; font-weight: 700; color: var(--tenue); }
.cursore input { width: 100%; accent-color: var(--accento); }
.spunta { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.spunta input { width: 18px; height: 18px; accent-color: var(--accento); }
.iInfo { font-size: 13px; }
.iInfo summary { list-style: none; cursor: pointer; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; color: var(--accento-forte); background: var(--accento-tenue); }
.iInfo summary::-webkit-details-marker { display: none; }
.iInfo summary svg { width: 17px; height: 17px; }
.iInfo[open] p { margin-top: 6px; background: var(--campo); padding: 10px 12px; border-radius: 12px; }
.avviso { background: color-mix(in srgb, #f59e0b 16%, transparent); color: var(--testo); border-radius: 12px; padding: 10px 12px; font-size: 13px; }
.ambLista { display: flex; flex-direction: column; gap: 4px; margin-top: 6px; }
.ambVoce { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 12px; text-align: left; }
.ambVoce:hover { background: var(--campo); }
.ambVoce.on { background: var(--accento-tenue); }
.ambVoce span { display: flex; flex-direction: column; min-width: 0; }
.ambVoce b { font-size: 15px; } .ambVoce small { color: var(--tenue); font-size: 12px; }
.ambVoce.costr { opacity: .5; cursor: default; }
.ambVoce svg.amb { width: 26px; height: 26px; }
.catGr { border-radius: 12px; background: var(--campo); padding: 4px 10px; }
.catGr summary { font-weight: 800; font-size: 14px; padding: 8px 0; cursor: pointer; }
.catLista { display: flex; flex-direction: column; gap: 6px; padding-bottom: 8px; }
.catVoce { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; padding: 8px 10px; border-radius: 10px; background: var(--carta); text-align: left; }
.catVoce.on { outline: 2px solid var(--accento); }
.catVoce b { font-size: 14px; } .catVoce small { color: var(--tenue); font-size: 12px; }
.catVoce.mio { flex-direction: row; align-items: center; }
.aNome { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; text-align: left; gap: 1px; }
.aNome small { color: var(--tenue); font-size: 12px; }
.albero { display: flex; flex-direction: column; gap: 4px; }
.aVoce { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 10px; background: var(--campo); }
.aVoce.on { outline: 2px solid var(--accento); }
.aVoce .aNome { flex-direction: row; align-items: center; gap: 8px; font-weight: 700; font-size: 14px; }
.aVoce .aNome:has(small) { flex-direction: column; align-items: flex-start; }
.aVoce i, .matVoce i { width: 14px; height: 14px; border-radius: 4px; flex: none; }
.listaMat { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 6px; padding-bottom: 6px; }
.matVoce { display: flex; align-items: center; gap: 8px; padding: 8px; border-radius: 10px; background: var(--carta); text-align: left; min-width: 0; }
.pannello > .listaMat .matVoce { background: var(--campo); }
.matVoce.on { outline: 2px solid var(--accento); }
.matVoce span { display: flex; flex-direction: column; min-width: 0; } .matVoce b { font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .matVoce small { color: var(--tenue); font-size: 11px; }
.carta.piccola { padding: 10px 12px; box-shadow: none; background: var(--campo); }
.topoCv { width: 100%; image-rendering: pixelated; border-radius: 10px; background: #fff; border: 1px solid var(--linea); }
.anteprimaTD { width: 100%; border-radius: 10px; border: 1px solid var(--linea); background: #fff; }
.tabRiga { display: flex; flex-direction: column; gap: 6px; padding: 8px; border-radius: 12px; background: var(--campo); }
.tabRiga.on { outline: 2px solid var(--accento); }
.tabRiga .cmp { background: var(--carta); }
.tabNome { text-align: left; font-weight: 800; font-size: 14px; }
.iaLog { display: flex; flex-direction: column; gap: 6px; max-height: 260px; overflow-y: auto; }
.iaLog:empty { display: none; }
.iaMsg { background: var(--campo); border-radius: 14px 14px 14px 4px; padding: 8px 11px; font-size: 14px; line-height: 1.4; white-space: pre-wrap; word-break: break-word; align-self: flex-start; max-width: 92%; }
.iaMsg.io { align-self: flex-end; background: var(--accento); color: var(--su-accento); border-radius: 14px 14px 4px 14px; }
.iaMsg.err { color: var(--rosso); }
.iaMsg small { color: var(--tenue); font-size: 11px; }
.iaTesto { min-height: 70px; }
.chatPag .ycBox { height: calc(100dvh - 260px); min-height: 360px; }
.bottone.voce { justify-content: flex-start; }
#barra { z-index: 6; }
.pannello > * { flex-shrink: 0; }
