/* GeoStru Beams & Slabs — layout dell'app sopra il design system GeoStru (css/ds). */

html, body { height: 100%; margin: 0; }
body.gs { background: var(--gs-bg); color: var(--gs-text); font-family: var(--gs-font-sans); font-size: var(--gs-fs-sm); }
* { box-sizing: border-box; }

.bs-app { display: flex; flex-direction: column; height: 100vh; min-height: 0; }
.bs-main { flex: 1; display: flex; min-height: 0; }

/* pulsanti nativi dentro le linguette e le sezioni del design system */
.gs-tabs__tab, .gs-section__head { font-family: inherit; cursor: pointer; border-top: 0; border-left: 0; border-right: 0; }
.gs-segmented__item { font-family: inherit; cursor: pointer; }
.bs-bottom td:first-child { white-space: nowrap; }

/* toolbar */
.bs-brand-mark { width: 22px; height: 22px; color: var(--gs-navy); }
.bs-toolbar .gs-btn { gap: 6px; }
.bs-toolbar .gs-select { height: 30px; font-size: var(--gs-fs-sm); }
.bs-menu-wrap { position: relative; }
.bs-menu-wrap .gs-menu { position: absolute; top: calc(100% + 4px); left: 0; z-index: 50; display: none; }
.bs-menu-wrap.open .gs-menu { display: block; }
.bs-menu-wrap.right .gs-menu { left: auto; right: 0; }

/* sidebar degli elementi */
.bs-sidebar { width: 220px; }
.bs-tree { list-style: none; margin: 0; padding: 6px; }
.bs-tree li { margin: 0; }
.bs-tree .bs-tree__group { padding: 10px 8px 4px; font-size: var(--gs-fs-2xs); font-weight: var(--gs-fw-semibold); text-transform: uppercase; letter-spacing: .06em; color: var(--gs-text-tertiary); }
.bs-tree__item { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: var(--gs-r-sm); cursor: pointer; color: var(--gs-text); user-select: none; }
.bs-tree__item:hover { background: var(--gs-bg-hover); }
.bs-tree__item.is-active { background: var(--gs-accent-soft); color: var(--gs-accent-text); font-weight: var(--gs-fw-medium); }
.bs-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; background: var(--gs-text-disabled); }
.bs-dot--Verde { background: var(--gs-success); }
.bs-dot--Giallo { background: var(--gs-warning); }
.bs-dot--Rosso { background: var(--gs-danger); }
.bs-tree__icon { width: 16px; height: 16px; color: var(--gs-text-secondary); flex: none; }
.bs-tree__name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* pannello di input */
.bs-input { width: 470px; flex: none; background: var(--gs-bg-elev); border-right: 1px solid var(--gs-border); display: flex; flex-direction: column; min-height: 0; }
.bs-input__body { flex: 1; overflow-y: auto; min-height: 0; }
.bs-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px; }
.bs-grid .span-2 { grid-column: span 2; }
.bs-field-ro .gs-input { background: var(--gs-bg-sunken); color: var(--gs-text-secondary); }
.bs-hint { font-size: var(--gs-fs-2xs); color: var(--gs-text-tertiary); line-height: 1.35; }
.bs-check { display: flex; align-items: center; gap: 8px; height: var(--gs-density-input-h); font-size: var(--gs-fs-sm); }
.bs-check input { width: 16px; height: 16px; accent-color: var(--gs-accent); }
.gs-input.is-invalid, .gs-input-group.is-invalid { border-color: var(--gs-danger) !important; box-shadow: 0 0 0 3px var(--gs-danger-soft); }

.bs-table-tools { display: flex; align-items: center; gap: 6px; justify-content: space-between; margin-bottom: 6px; }
.bs-table-tools__title { font-size: var(--gs-fs-xs); font-weight: var(--gs-fw-semibold); color: var(--gs-text-secondary); }
.bs-table-scroll { max-height: 340px; overflow: auto; }
.gs-table td.bs-cell-input { padding: 0 3px; }
.gs-table td.bs-cell-input .gs-input, .gs-table td.bs-cell-input .gs-select { width: 100%; min-width: 52px; height: 26px; padding: 0 6px; font-size: var(--gs-fs-sm); }
.gs-table td.bs-cell-input .gs-select { min-width: 72px; padding-right: 22px; background-position: right 5px center; }
.gs-table td.bs-rowhead { color: var(--gs-text-secondary); white-space: nowrap; font-size: var(--gs-fs-xs); }
.gs-table tr.is-selected td { background: var(--gs-accent-softer); }
.gs-table td.ro { color: var(--gs-text-secondary); }
.bs-notice { padding: 8px 10px; border-radius: var(--gs-r-md); font-size: var(--gs-fs-xs); line-height: 1.4; background: var(--gs-bg-sunken); color: var(--gs-text-secondary); }
.bs-notice--manual { background: var(--gs-warning-soft); color: var(--gs-warning); }

/* area dei risultati */
.bs-results { flex: 1; display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.bs-view { flex: 1; position: relative; min-height: 0; background: var(--gs-bg-elev); }
.bs-view > div { position: absolute; inset: 0; }
.bs-view svg { width: 100%; height: 100%; display: block; }
.bs-drawing { cursor: grab; background: #fff; }
.bs-drawing.dragging { cursor: grabbing; }
.bs-drawing__hint { position: absolute; left: 10px; bottom: 6px; font-size: var(--gs-fs-2xs); color: var(--gs-text-tertiary); pointer-events: none; }
.bs-empty { display: flex; align-items: center; justify-content: center; height: 100%; color: var(--gs-text-tertiary); padding: 24px; text-align: center; white-space: pre-line; }

.bs-bottom { height: 210px; flex: none; display: flex; border-top: 1px solid var(--gs-border); background: var(--gs-bg-elev); min-height: 0; }
.bs-bottom > section { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.bs-bottom > section:first-child { flex: 1.35; border-right: 1px solid var(--gs-border); }
.bs-bottom > section:last-child { flex: 1; }
.bs-bottom h3 { margin: 0; padding: 8px 12px; font-size: var(--gs-fs-xs); font-weight: var(--gs-fw-semibold); color: var(--gs-text-secondary); border-bottom: 1px solid var(--gs-border); }
.bs-bottom .bs-scroll { flex: 1; overflow: auto; min-height: 0; }
.bs-bottom .gs-table tbody td { height: 28px; }
.bs-bottom td.bs-msg { white-space: normal; line-height: 1.3; padding-top: 4px; padding-bottom: 4px; }
tr.bs-row--Verde td:first-child { box-shadow: inset 3px 0 0 var(--gs-success); }
tr.bs-row--Giallo td:first-child { box-shadow: inset 3px 0 0 var(--gs-warning); }
tr.bs-row--Rosso td:first-child { box-shadow: inset 3px 0 0 var(--gs-danger); }
td.bs-pct--over { color: var(--gs-danger); font-weight: var(--gs-fw-semibold); }
td.bs-pct--near { color: var(--gs-warning); font-weight: var(--gs-fw-semibold); }
.bs-av { display: flex; gap: 8px; padding: 6px 12px; border-bottom: 1px solid var(--gs-border-subtle); font-size: var(--gs-fs-xs); line-height: 1.35; }
.bs-av__liv { flex: none; }
.bs-av__camp { color: var(--gs-text-tertiary); flex: none; min-width: 64px; }

/* diagrammi */
.bs-diag text { font-family: var(--gs-font-sans); }
.bs-diag .t-title { font-size: 12px; font-weight: 600; fill: var(--gs-text); }
.bs-diag .t-ax { font-size: 10px; fill: var(--gs-text-tertiary); font-family: var(--gs-font-mono); }
.bs-diag .t-lab { font-size: 11px; fill: var(--gs-text); }
.bs-diag .t-sub { font-size: 10px; fill: var(--gs-text-secondary); }
.bs-tip { position: absolute; pointer-events: none; background: rgba(255,255,250,.96); border: 1px solid var(--gs-border-strong); border-radius: var(--gs-r-sm); padding: 6px 8px; font-size: 11px; font-family: var(--gs-font-mono); line-height: 1.45; white-space: pre; box-shadow: var(--gs-shadow-popover); display: none; color: var(--gs-text); }
.bs-tip.is-ko { border-color: var(--gs-danger); }

/* accesso */
.bs-banner { margin: 10px; }

/* statusbar */
.bs-statusbar { display: flex; align-items: center; gap: 14px; height: 28px; padding: 0 12px; font-size: var(--gs-fs-2xs); color: var(--gs-text-secondary); background: var(--gs-bg-elev); border-top: 1px solid var(--gs-border); flex: none; }
.bs-statusbar .sp { flex: 1; }

@media (max-width: 1100px) {
  .bs-sidebar { width: 170px; }
  .bs-input { width: 400px; }
}
@media (max-width: 860px) {
  .bs-main { flex-direction: column; overflow-y: auto; }
  .bs-sidebar, .bs-input { width: 100%; border-right: 0; border-bottom: 1px solid var(--gs-border); }
  .bs-input__body { max-height: none; }
  .bs-results { min-height: 720px; }
}

/* schizzo della sezione del solaio nell input */
.bs-schizzo { background: #fff; border: 1px solid var(--gs-border); border-radius: var(--gs-r-md); padding: 4px 6px; }
.bs-schizzo svg { display: block; }

/* tabelle di input più compatte: testo più piccolo, colonne numeriche strette, la descrizione prende lo spazio */
.bs-input .gs-table { font-size: 12px; }
.bs-input .gs-table thead th { padding: 6px 6px; font-size: 11px; }
.bs-input .gs-table td.bs-cell-input { padding: 0 2px; }
.bs-input .gs-table td.bs-cell-input .gs-input { font-size: 12px; padding: 0 5px; height: 24px; }
.bs-input .gs-table td.bs-cell-input .gs-input--num { width: 58px; min-width: 0; }
.bs-input .gs-table td.bs-cell-input .gs-select { font-size: 12px; height: 24px; min-width: 64px; }
.bs-input .gs-table td.bs-cell-input:has(.bs-wide) { width: 100%; }
.bs-input .gs-table .bs-wide { width: 100% !important; min-width: 120px !important; }
.bs-input .gs-table td.bs-rowhead { font-size: 11px; padding: 0 6px; }
.bs-input .gs-table td.ro { font-size: 12px; padding: 0 6px; }

/* la riga d'aiuto dei disegni sta in una fascia sua, sotto il disegno: non copre più i testi */
.bs-drawing svg { height: calc(100% - 24px); }
.bs-drawing__hint { left: 0; right: 0; bottom: 0; height: 24px; line-height: 24px; padding: 0 10px; background: var(--gs-bg-sunken); border-top: 1px solid var(--gs-border); }
.bs-input .gs-table td.bs-cell-input { text-align: right; }
/* un po' d'aria fra le righe e fra le caselle delle tabelle di input */
.bs-input .gs-table tbody td { height: 34px; }
.bs-input .gs-table td.bs-cell-input { padding: 4px 4px; }
.bs-input .gs-table td.bs-rowhead { padding: 0 10px; }
.bs-input .gs-table td.bs-cell-input .gs-input--num { width: 72px; }

/* abbonamento: esportazioni con il lucchetto, avviso nella barra di stato */
.gs-menu__item { display: flex; align-items: center; gap: 10px; }
.gs-menu__item > span:first-child { flex: 1; }
.bs-locked { color: var(--gs-text-secondary); }
.bs-lock { display: inline-flex; color: var(--gs-accent); }
.bs-lock svg { width: 14px; height: 14px; }
.bs-free { display: inline-flex; align-items: center; gap: 5px; color: var(--gs-accent-active); text-decoration: none; font-weight: 500; }
.bs-free:hover { text-decoration: underline; }
.bs-free svg { width: 13px; height: 13px; }
.bs-banner { display: flex; align-items: center; gap: 10px; }
.bs-banner .gs-alert__body { flex: 1; }

/* pianta d'insieme */
.bs-pianta-box { padding: 10px 14px; height: 100%; box-sizing: border-box; display: flex; flex-direction: column; min-height: 0; }
/* il disegno sta sempre tutto nel riquadro: si riduce invece di uscire in basso */
.bs-pianta-svg { flex: 1; min-height: 0; }
.bs-pianta-svg svg { width: 100%; height: 100%; display: block; }
.bs-pianta-tit { font-weight: 600; font-size: var(--gs-fs-sm); margin-bottom: 6px; }
.bs-pianta__el:hover rect, .bs-pianta__el:hover line { filter: brightness(.9); }

/* SEO: titolo per i lettori di schermo e contenuto senza JavaScript */
.bs-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; margin: 0; }
.bs-noscript { max-width: 760px; margin: 40px auto; padding: 0 16px; font-family: var(--gs-font-sans); line-height: 1.5; }

/* accesso con il codice */
.bs-acc-riga { display: flex; gap: 8px; align-items: center; margin-top: 6px; flex-wrap: wrap; }
.bs-acc-riga .gs-input { max-width: 280px; }
.bs-acc-codice { max-width: 110px !important; letter-spacing: 3px; font-family: var(--gs-font-mono); }
.bs-acc-msg { margin-top: 4px; font-weight: 500; }
.bs-acc-msg:empty { display: none; }
.bs-acc-azioni { display: flex; gap: 8px; }
.bs-abbonato { color: var(--gs-text-secondary); }
.bs-esci { color: var(--gs-accent-active); }

/* 19/11/2026: spiegazioni richiudibili, proprietà dei materiali, scelta normativa nel pannello */
.bs-details { margin: 8px 0 2px; border: 1px solid var(--gs-border); border-radius: var(--gs-r-md); background: var(--gs-bg-sunken); }
.bs-details > summary { cursor: pointer; padding: 6px 10px; font-size: var(--gs-fs-sm); font-weight: var(--gs-fw-medium); color: var(--gs-text-secondary); list-style: none; }
.bs-details > summary::before { content: "ⓘ"; color: var(--gs-navy); margin-right: 6px; }
.bs-details > summary::-webkit-details-marker { display: none; }
.bs-details[open] > summary { border-bottom: 1px solid var(--gs-border); }
.bs-details > .bs-hint, .bs-details > table { margin: 8px 10px; }
.bs-prop { border-collapse: collapse; font-size: var(--gs-fs-sm); width: calc(100% - 20px); }
.bs-prop th { text-align: left; font-weight: var(--gs-fw-semibold); color: var(--gs-text); padding: 6px 0 2px; }
.bs-prop td { padding: 2px 0; color: var(--gs-text-secondary); border-bottom: 1px dotted var(--gs-border); }
.bs-prop td.num { text-align: right; font-family: var(--gs-font-mono); color: var(--gs-text); padding-right: 6px; }
.bs-prop td.u { width: 40px; color: var(--gs-text-tertiary); }
.bs-norma-scelta { margin-bottom: 6px; }
.bs-field-ro .gs-select:disabled { opacity: 1; background-color: var(--gs-bg-sunken); color: var(--gs-text); }
/* griglie: celle numeriche a larghezza fissa, così la tabella dei ferri entra nel pannello senza scorrere */
.bs-input .gs-table td.bs-cell-input { padding: 0 2px; }
.bs-input .gs-table td.bs-cell-input .gs-input--num:not(.bs-wide) { width: 54px; min-width: 0; padding: 0 4px; }
.bs-input .gs-table td.bs-cell-input .gs-select { width: auto; min-width: 0; padding: 0 18px 0 5px; background-position: right 3px center; }
.bs-input .gs-table th { padding-left: 4px; padding-right: 4px; white-space: nowrap; }
.bs-input .gs-table td.bs-rowhead { padding-right: 4px; }

.bs-input { transition: width .15s; }
@media (min-width: 1280px) { .bs-input.bs-input--larga { width: 640px; } }
