/* FBF Rilievo Commerciale — Frontend CSS v1.1
   Palette identica al call center */
:root {
    --fbf-navy:  #191970;
    --fbf-sky:   #ADD8E6;
    --fbf-dark:  #1A1A2E;
    --fbf-white: #FFFFFF;
    --fbf-bg:    #f4f6f9;
    --fbf-bg2:   #eef1f6;
    --fbf-border:#dde2ea;
    --fbf-green: #166534;
    --fbf-red:   #8B0000;
    --fbf-muted: #6b7280;
    --fbf-font:  'IBM Plex Sans','Segoe UI',system-ui,sans-serif;
}

#fbf-rilievo-app {
    font-family: var(--fbf-font);
    font-size: 13px;
    color: var(--fbf-dark);
    background: linear-gradient(150deg, #050e1f 0%, #0b1e3d 18%, #0d2a56 36%, #0f3370 52%, #0e2d64 68%, #091c47 84%, #040d22 100%);
    width: 100vw;
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
#fbf-rilievo-app * { box-sizing: border-box; }

/* ── HEADER ──────────────────────────────────────────────────────── */
.fbf-header {
    display: flex; align-items: center; gap: 12px;
    padding: 6px 14px;
    background: rgba(25,25,112,.85);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid rgba(173,216,230,.15);
    position: sticky; top: 0; z-index: 200;
    min-height: 0;
}
.fbf-logo { height: 26px; object-fit: contain; }
.fbf-header-info { display: flex; flex-direction: column; gap: 0; }
.fbf-header-title { font-size: 12px; font-weight: 600; color: var(--fbf-sky); line-height: 1.2; }
.fbf-header-sub   { font-size: 10px; color: rgba(173,216,230,.6); line-height: 1.2; }

.fbf-steps { display: flex; align-items: center; gap: 3px; margin: 0 auto; }
.fbf-step  {
    display: flex; align-items: center; gap: 5px;
    padding: 4px 9px; border-radius: 20px; cursor: pointer;
    border: 1px solid rgba(173,216,230,.2); color: rgba(173,216,230,.5);
    font-size: 11px; font-weight: 500; transition: all .2s; white-space: nowrap;
}
.fbf-step.active { background: var(--fbf-sky); color: var(--fbf-navy); border-color: var(--fbf-sky); }
.fbf-step.done   { background: rgba(173,216,230,.12); color: var(--fbf-sky); border-color: rgba(173,216,230,.3); }
.fbf-step-num    { width: 17px; height: 17px; border-radius: 50%; background: rgba(255,255,255,.15); display: flex; align-items: center; justify-content: center; font-size: 10px; }
.fbf-step.active .fbf-step-num { background: rgba(25,25,112,.3); }
.fbf-step-arrow  { color: rgba(173,216,230,.3); font-size: 14px; }
.fbf-header-right { display: flex; align-items: center; gap: 8px; }
.fbf-hbtn {
    padding: 5px 11px; border-radius: 5px; font-size: 11px; font-weight: 600;
    background: transparent; border: 1px solid var(--fbf-sky); color: var(--fbf-sky);
    cursor: pointer; transition: all .15s; display: flex; align-items: center; gap: 4px;
}
.fbf-hbtn:hover { background: rgba(173,216,230,.1); }
.fbf-user { font-size: 11px; color: rgba(173,216,230,.6); }

/* ── BODY / SCREENS ──────────────────────────────────────────────── */
.fbf-body { flex: 1; position: relative; overflow: hidden; width: 100%; }
.fbf-screen { display: none; height: 100%; overflow-y: auto; width: 100%; box-sizing: border-box; }
.fbf-screen.active { display: block; }

/* ── FOOTER NAV ──────────────────────────────────────────────────── */
.fbf-footer-nav {
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 20px;
    background: rgba(25,25,112,.7);
    border-top: 1px solid rgba(173,216,230,.1);
    position: sticky; bottom: 0; z-index: 200;
}
.fbf-footer-status { font-size: 12px; color: rgba(173,216,230,.7); }
.fbf-nav-btn {
    padding: 9px 20px; border-radius: 8px; font-size: 13px; font-weight: 600;
    cursor: pointer; transition: all .15s; border: 1px solid;
}
.fbf-nav-btn.primary { background: var(--fbf-sky); color: var(--fbf-navy); border-color: var(--fbf-sky); }
.fbf-nav-btn.primary:hover { background: #9bd4e8; }
.fbf-nav-btn.ghost { background: transparent; color: var(--fbf-sky); border-color: rgba(173,216,230,.3); }
.fbf-nav-btn.ghost:hover { background: rgba(173,216,230,.1); }

/* ── CARDS ───────────────────────────────────────────────────────── */
.fbf-card {
    background: rgba(245,247,250,.75); backdrop-filter: blur(6px);
    border: 1px solid rgba(255,255,255,.2);
    border-radius: 12px; padding: 16px; margin-bottom: 14px;
}
.fbf-card-head {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 14px; padding-bottom: 10px;
    border-bottom: 1px solid rgba(25,25,112,.1);
}
.fbf-card-head h3 { margin: 0; font-size: 14px; font-weight: 600; color: var(--fbf-navy); }
.fbf-cards-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

/* ── STEP 1 ANAGRAFICA ───────────────────────────────────────────── */
.fbf-step-content { padding: 20px; }
.fbf-step-heading { font-size: 18px; font-weight: 600; color: var(--fbf-sky); margin-bottom: 18px; }

/* ── FORMS ───────────────────────────────────────────────────────── */
.fbf-fields { display: flex; flex-direction: column; gap: 12px; }
.fbf-fg     { display: flex; flex-direction: column; gap: 3px; }
.fbf-fg label, .fbf-field-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--fbf-navy); }
.fbf-row-2  { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.fbf-row-3  { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
.fbf-input, .fbf-seg-input {
    padding: 7px 10px; border: 1px solid var(--fbf-border); border-radius: 6px;
    font-size: 13px; font-family: var(--fbf-font); background: white; color: var(--fbf-dark);
    transition: border .15s;
}
.fbf-input:focus, .fbf-seg-input:focus { outline: none; border-color: var(--fbf-navy); }
.fbf-select, .fbf-select-sm {
    padding: 7px 10px; border: 1px solid var(--fbf-border); border-radius: 6px;
    font-size: 13px; font-family: var(--fbf-font);
    background: var(--fbf-navy); color: var(--fbf-sky); border-color: var(--fbf-sky);
}
.fbf-select-sm { padding: 4px 8px; font-size: 12px; }
.fbf-textarea {
    padding: 7px 10px; border: 1px solid var(--fbf-border); border-radius: 6px;
    font-size: 13px; font-family: var(--fbf-font); resize: vertical; background: white;
}
.fbf-field-row { display: flex; gap: 6px; align-items: center; }
.fbf-unit { font-size: 12px; color: var(--fbf-muted); white-space: nowrap; }
.fbf-hint { font-size: 10px; color: var(--fbf-muted); font-style: italic; }
.req { color: var(--fbf-navy); font-weight: 900; }

.fbf-check-group { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.fbf-check-pill {
    display: flex; align-items: center; gap: 6px;
    padding: 6px 12px; border-radius: 20px; cursor: pointer; font-size: 12px; font-weight: 500;
    border: 1px solid var(--fbf-border); background: white; color: var(--fbf-dark);
    transition: all .15s;
}
.fbf-check-pill:has(input:checked) { background: var(--fbf-navy); color: var(--fbf-sky); border-color: var(--fbf-navy); }
.fbf-check-pill input { display: none; }

/* ── STEP 2 STANZE LAYOUT ────────────────────────────────────────── */
.fbf-stanze-layout {
    display: flex; height: calc(100vh - 100px); overflow: hidden;
}
.fbf-stanze-sidebar {
    width: 230px; flex-shrink: 0;
    background: rgba(245,247,250,.8); backdrop-filter: blur(8px);
    border-right: 1px solid rgba(25,25,112,.1);
    overflow-y: auto; display: flex; flex-direction: column;
}
.fbf-sb-section { padding: 12px 14px; border-bottom: 1px solid rgba(25,25,112,.08); }
.fbf-sb-label   { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--fbf-navy); margin-bottom: 8px; display: block; }

.fbf-room-list    { display: flex; flex-direction: column; gap: 3px; }
.fbf-room-item    {
    display: flex; align-items: center; justify-content: space-between;
    padding: 7px 10px; border-radius: 8px; cursor: pointer;
    border: 1px solid transparent; font-size: 13px; transition: all .15s;
}
.fbf-room-item:hover { background: rgba(25,25,112,.05); border-color: var(--fbf-border); }
.fbf-room-item.active { background: white; border-color: var(--fbf-navy); }
.fbf-room-item-name { font-weight: 500; }
.fbf-room-item-info { font-size: 11px; color: var(--fbf-muted); }
.fbf-room-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.fbf-add-room-btn {
    display: flex; align-items: center; gap: 6px;
    width: 100%; padding: 7px 10px; margin-top: 6px; border-radius: 8px;
    border: 1px dashed var(--fbf-border); background: transparent;
    color: var(--fbf-navy); font-size: 13px; font-weight: 500; cursor: pointer;
    transition: all .15s;
}
.fbf-add-room-btn:hover { background: rgba(25,25,112,.05); border-color: var(--fbf-navy); }

/* Segmento input */
.fbf-seg-type-row { display: flex; gap: 4px; margin-bottom: 10px; }
.fbf-seg-type {
    flex: 1; padding: 5px 4px; border-radius: 6px; font-size: 11px; font-weight: 600;
    border: 1px solid var(--fbf-border); background: white; color: var(--fbf-muted);
    cursor: pointer; text-align: center; transition: all .15s;
}
.fbf-seg-type.active { background: var(--fbf-navy); color: var(--fbf-sky); border-color: var(--fbf-navy); }
.fbf-field-group { display: flex; flex-direction: column; gap: 3px; margin-bottom: 10px; }
.fbf-field-group label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--fbf-navy); }

.fbf-dir-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; margin-bottom: 8px; }
.fbf-dir-btn {
    padding: 8px 4px; border-radius: 6px; font-size: 18px; cursor: pointer;
    border: 1px solid var(--fbf-border); background: white; color: var(--fbf-dark);
    text-align: center; transition: all .15s; line-height: 1;
}
.fbf-dir-btn:hover { border-color: var(--fbf-navy); background: rgba(25,25,112,.05); }
.fbf-dir-btn.active { background: var(--fbf-navy); color: var(--fbf-sky); border-color: var(--fbf-navy); }
.fbf-dir-center { display: flex; align-items: center; justify-content: center; font-size: 11px; color: var(--fbf-muted); border: 1px solid var(--fbf-border); border-radius: 6px; }

.fbf-arc-box { background: rgba(25,25,112,.05); border: 1px solid rgba(25,25,112,.15); border-radius: 8px; padding: 10px; margin-bottom: 10px; }
.fbf-arc-head { font-size: 11px; font-weight: 700; color: var(--fbf-navy); text-transform: uppercase; margin-bottom: 8px; }

.fbf-seg-actions { display: flex; flex-direction: column; gap: 4px; }
.fbf-seg-action {
    width: 100%; padding: 8px; border-radius: 6px; font-size: 12px; font-weight: 600;
    cursor: pointer; border: 1px solid; text-align: center; transition: all .15s;
    display: flex; align-items: center; justify-content: center; gap: 5px;
}
.fbf-seg-action.primary { background: var(--fbf-navy); color: var(--fbf-sky); border-color: var(--fbf-navy); }
.fbf-seg-action.primary:hover { background: #2d2d8e; }
.fbf-seg-action.success { background: #166534; color: #dcfce7; border-color: #166534; }
.fbf-seg-action.ghost   { background: transparent; color: var(--fbf-dark); border-color: var(--fbf-border); }
.fbf-seg-action.ghost:hover { background: rgba(25,25,112,.05); }

/* Metriche */
.fbf-metrics { display: flex; flex-direction: column; gap: 8px; }
.fbf-metric { display: flex; justify-content: space-between; align-items: center; font-size: 12px; }
.fbf-metric-label { color: var(--fbf-muted); }
.fbf-metric-val   { font-weight: 600; color: var(--fbf-dark); }
.fbf-metric-val.highlight { color: var(--fbf-navy); font-size: 14px; }

/* Aperture */
.fbf-aperture-list { display: flex; flex-direction: column; gap: 4px; }
.fbf-ap-item { display: flex; align-items: center; justify-content: space-between; padding: 5px 8px; background: white; border-radius: 6px; font-size: 12px; border: 1px solid var(--fbf-border); }

/* Canvas area */
.fbf-canvas-area { flex: 1; display: flex; flex-direction: column; position: relative; min-width: 0; }
.fbf-canvas-toolbar {
    display: flex; align-items: center; gap: 6px; padding: 7px 12px;
    background: rgba(245,247,250,.9); border-bottom: 1px solid var(--fbf-border);
}
.fbf-tool-btn {
    padding: 5px 10px; border-radius: 6px; font-size: 12px; cursor: pointer;
    border: 1px solid var(--fbf-border); background: white; color: var(--fbf-dark);
    transition: all .15s; white-space: nowrap;
}
.fbf-tool-btn:hover { border-color: var(--fbf-navy); }
.fbf-tool-btn.active { background: var(--fbf-navy); color: var(--fbf-sky); border-color: var(--fbf-navy); }
.fbf-tool-sep { width: 1px; height: 18px; background: var(--fbf-border); }
.fbf-canvas-coords { margin-left: auto; font-size: 11px; color: var(--fbf-muted); font-family: monospace; }

.fbf-canvas {
    flex: 1; display: block; cursor: crosshair;
    background: white;
    background-image: linear-gradient(rgba(25,25,112,.04) 1px, transparent 1px),
                      linear-gradient(90deg, rgba(25,25,112,.04) 1px, transparent 1px);
    background-size: 20px 20px;
}

/* Pannello alzato */
.fbf-alzato-panel { position: absolute; bottom: 0; left: 0; right: 0; height: 260px; background: rgba(245,247,250,.95); border-top: 2px solid var(--fbf-navy); z-index: 50; }
.fbf-alzato-head  { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-bottom: 1px solid var(--fbf-border); font-size: 12px; font-weight: 600; color: var(--fbf-navy); }
.fbf-canvas-alzato { width: 100%; height: 180px; display: block; background: white; }
.fbf-alzato-tools { padding: 6px 12px; }

/* Pannello 3D */
.fbf-3d-panel { position: absolute; right: 0; top: 0; bottom: 0; width: 320px; background: rgba(245,247,250,.97); border-left: 2px solid var(--fbf-navy); z-index: 50; display: flex; flex-direction: column; }
.fbf-3d-head  { display: flex; align-items: center; justify-content: space-between; padding: 8px 12px; border-bottom: 1px solid var(--fbf-border); font-size: 12px; font-weight: 600; color: var(--fbf-navy); }
.fbf-canvas-3d { flex: 1; display: block; background: #0d1b2a; }

/* ── STEP 3 LAVORAZIONI ──────────────────────────────────────────── */
.fbf-lav-layout { display: flex; height: calc(100vh - 100px); gap: 0; }
.fbf-lav-sidebar { width: 180px; flex-shrink: 0; background: rgba(245,247,250,.8); border-right: 1px solid rgba(25,25,112,.1); padding: 12px; overflow-y: auto; }
.fbf-lav-global-list { display: flex; flex-direction: column; gap: 4px; }
.fbf-global-item { padding: 7px 10px; border-radius: 8px; cursor: pointer; font-size: 12px; border: 1px solid var(--fbf-border); background: white; transition: all .15s; }
.fbf-global-item:hover { border-color: var(--fbf-navy); background: rgba(25,25,112,.03); }

.fbf-lav-main { flex: 1; display: flex; flex-direction: column; overflow: hidden; min-width: 0; }
.fbf-lav-header { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; background: rgba(245,247,250,.9); border-bottom: 1px solid var(--fbf-border); }
.fbf-lav-header h3 { margin: 0; font-size: 15px; font-weight: 600; color: var(--fbf-navy); }
.fbf-lav-room-info { font-size: 12px; color: var(--fbf-muted); margin-left: 8px; }

.fbf-lav-tabs { display: flex; align-items: center; gap: 0; border-bottom: 1px solid var(--fbf-border); background: rgba(245,247,250,.9); }
.fbf-lav-tab {
    padding: 9px 14px; font-size: 12px; font-weight: 500; cursor: pointer; border: none;
    background: transparent; color: var(--fbf-muted); border-bottom: 2px solid transparent;
    transition: all .15s; white-space: nowrap;
}
.fbf-lav-tab:hover { color: var(--fbf-navy); }
.fbf-lav-tab.active { color: var(--fbf-navy); border-bottom-color: var(--fbf-navy); background: rgba(25,25,112,.03); }
.fbf-lav-tab-spacer { flex: 1; }
.fbf-delta-badge { padding: 4px 10px; border-radius: 20px; font-size: 11px; font-weight: 600; background: rgba(25,25,112,.08); color: var(--fbf-navy); margin-right: 12px; }

.fbf-search-panel { padding: 12px 16px; border-bottom: 1px solid var(--fbf-border); }
.fbf-search-row { display: flex; gap: 8px; margin-bottom: 8px; }
.fbf-search-input {
    flex: 1; padding: 7px 10px; border: 1px solid var(--fbf-border); border-radius: 8px;
    font-size: 13px; font-family: var(--fbf-font); background: white;
}
.fbf-search-input:focus { outline: none; border-color: var(--fbf-navy); }
.fbf-prod-results { display: flex; flex-direction: column; gap: 4px; max-height: 200px; overflow-y: auto; }
.fbf-prod-item {
    display: flex; align-items: center; justify-content: space-between;
    padding: 7px 10px; border-radius: 8px; border: 1px solid var(--fbf-border);
    background: white; cursor: pointer; font-size: 12px; transition: all .15s;
}
.fbf-prod-item:hover { border-color: var(--fbf-navy); background: rgba(25,25,112,.03); }
.fbf-prod-item-info { display: flex; flex-direction: column; gap: 2px; }
.fbf-prod-name { font-weight: 500; color: var(--fbf-dark); }
.fbf-prod-meta { font-size: 11px; color: var(--fbf-muted); }
.fbf-prod-price { font-weight: 600; color: var(--fbf-navy); white-space: nowrap; }
.fbf-prod-manual-badge { font-size: 10px; padding: 2px 6px; background: rgba(25,25,112,.1); color: var(--fbf-navy); border-radius: 4px; }

/* Tabella righe */
.fbf-righe-wrap { flex: 1; overflow: auto; }
.fbf-righe-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.fbf-righe-table th { background: var(--fbf-navy); color: var(--fbf-sky); padding: 7px 8px; text-align: left; font-size: 10px; text-transform: uppercase; letter-spacing: .04em; position: sticky; top: 0; white-space: nowrap; }
.fbf-righe-table td { padding: 6px 8px; border-bottom: 1px solid var(--fbf-border); vertical-align: middle; }
.fbf-righe-table tr:hover td { background: rgba(25,25,112,.03); }
.fbf-empty-row td { color: var(--fbf-muted); }
.fbf-righe-totals td { background: rgba(25,25,112,.06) !important; font-weight: 600; border-top: 2px solid rgba(25,25,112,.15); }
.fbf-tot-cell { text-align: right; font-weight: 600; }
.fbf-tot-highlight { color: var(--fbf-navy); font-size: 13px; }
.fbf-tot-muted { color: var(--fbf-muted); }
.fbf-badge-navy { background: var(--fbf-navy); color: var(--fbf-sky); font-size: 11px; padding: 2px 8px; border-radius: 20px; font-weight: 500; }

/* Riga inline editing */
.fbf-riga-input { width: 100%; padding: 3px 5px; border: 1px solid var(--fbf-border); border-radius: 4px; font-size: 12px; text-align: right; background: white; }
.fbf-riga-input:focus { outline: none; border-color: var(--fbf-navy); }
.fbf-delta-pos { color: #166534; }
.fbf-delta-neg { color: var(--fbf-red); }

/* Pannello calcolo */
.fbf-lav-calc { width: 200px; flex-shrink: 0; padding: 14px; background: rgba(245,247,250,.9); border-left: 1px solid rgba(25,25,112,.1); overflow-y: auto; }
.fbf-calc-items { display: flex; flex-direction: column; gap: 8px; }
.fbf-calc-item { display: flex; flex-direction: column; gap: 2px; }
.fbf-calc-label { font-size: 10px; color: var(--fbf-muted); text-transform: uppercase; }
.fbf-calc-val   { font-size: 14px; font-weight: 600; color: var(--fbf-dark); }
.fbf-calc-val.highlight { color: var(--fbf-navy); font-size: 16px; }
.fbf-calc-total .fbf-calc-label { font-size: 11px; }
.fbf-calc-divider { height: 1px; background: var(--fbf-border); margin: 4px 0; }
.fbf-muted { color: var(--fbf-muted); }

/* ── STEP 4 PREVENTIVO ───────────────────────────────────────────── */
.fbf-prev-layout { display: flex; gap: 16px; padding: 16px; align-items: flex-start; }
.fbf-prev-main   { flex: 1; min-width: 0; }
.fbf-prev-side   { width: 300px; flex-shrink: 0; }

.fbf-totale-card { background: rgba(25,25,112,.08) !important; border-color: rgba(25,25,112,.2) !important; }
.fbf-totale-row  { display: flex; justify-content: space-between; align-items: center; padding: 6px 0; font-size: 13px; border-bottom: 1px solid rgba(25,25,112,.06); }
.fbf-totale-val  { font-weight: 600; }
.fbf-totale-finale { font-size: 15px; font-weight: 700; padding: 10px 0; border-bottom: none; }
.fbf-totale-highlight { color: var(--fbf-navy); font-size: 18px; }
.fbf-totale-divider { height: 1px; background: rgba(25,25,112,.1); margin: 8px 0; }

/* Cronoprogramma Gantt */
.fbf-crono-gantt { display: flex; flex-direction: column; gap: 6px; }
.fbf-crono-fase  { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.fbf-crono-label { width: 130px; flex-shrink: 0; font-size: 11px; color: var(--fbf-dark); }
.fbf-crono-bar-wrap { flex: 1; background: rgba(25,25,112,.08); border-radius: 4px; height: 14px; position: relative; overflow: hidden; }
.fbf-crono-bar   { height: 100%; background: var(--fbf-navy); border-radius: 4px; transition: width .4s; }
.fbf-crono-dur   { font-size: 10px; color: var(--fbf-muted); white-space: nowrap; }
.fbf-crono-date  { font-size: 10px; color: var(--fbf-muted); white-space: nowrap; }

/* Firma canvas */
.fbf-firma-canvas { width: 100%; height: 120px; border: 1px solid var(--fbf-border); border-radius: 8px; background: white; cursor: crosshair; touch-action: none; }

/* ── MODALI ───────────────────────────────────────────────────────── */
.fbf-modal-bg {
    position: fixed; inset: 0; background: rgba(0,0,0,.55);
    display: flex; align-items: center; justify-content: center; z-index: 1000;
}
.fbf-modal {
    background: white; border-radius: 14px; padding: 28px;
    max-width: 420px; width: 92%;
    box-shadow: 0 8px 40px rgba(0,0,0,.2);
}
.fbf-modal-sm { max-width: 360px; }
.fbf-modal-logo { text-align: center; margin-bottom: 14px; }
.fbf-modal-title { font-size: 18px; font-weight: 600; color: var(--fbf-navy); margin-bottom: 6px; }
.fbf-modal-sub   { font-size: 13px; color: var(--fbf-muted); margin-bottom: 18px; }
.fbf-modal-opts  { display: flex; flex-direction: column; gap: 10px; }
.fbf-modal-opt   {
    display: flex; align-items: center; gap: 14px;
    padding: 14px 16px; border-radius: 10px; cursor: pointer;
    border: 1px solid var(--fbf-border); background: var(--fbf-bg2);
    transition: all .15s;
}
.fbf-modal-opt:hover { border-color: var(--fbf-navy); background: white; }
.fbf-modal-opt-icon { font-size: 26px; flex-shrink: 0; }
.fbf-modal-opt-name { font-weight: 600; font-size: 14px; color: var(--fbf-dark); }
.fbf-modal-opt-desc { font-size: 12px; color: var(--fbf-muted); margin-top: 2px; }
.fbf-modal-footer { display: flex; gap: 8px; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--fbf-border); }

/* ── CANTIERE MODE ───────────────────────────────────────────────── */
.mode-cantiere .fbf-dir-btn { min-height: 48px; font-size: 22px; }
.mode-cantiere .fbf-seg-action { padding: 14px; font-size: 14px; }
.mode-cantiere .fbf-seg-input { padding: 10px; font-size: 16px; }

/* ── RESPONSIVE ─────────────────────────────────────────────────── */
@media(max-width:900px){
    .fbf-cards-row { grid-template-columns: 1fr; }
    .fbf-lav-calc { display: none; }
    .fbf-prev-layout { flex-direction: column; }
    .fbf-prev-side { width: 100%; }
}

/* ── Fix canvas dimensioni ───────────────────────────────────────── */
.fbf-canvas-area {
    flex: 1 !important;
    min-width: 0 !important;
    min-height: 500px !important;
    position: relative !important;
    display: flex !important;
    flex-direction: column !important;
}
#fbf-canvas-2d {
    flex: 1 !important;
    min-height: 460px !important;
    width: 100% !important;
    display: block !important;
}
.fbf-stanze-layout {
    height: calc(100vh - 140px) !important;
    overflow: hidden !important;
}

/* ── Piano tabs ──────────────────────────────────────────────────── */
.fbf-floor-tabs { display:flex; gap:4px; flex-wrap:wrap; margin-bottom:2px; }
.fbf-floor-tab {
  padding:4px 10px; border-radius:14px; font-size:11px; font-weight:500; cursor:pointer;
  border:0.5px solid var(--fbf-border); background:white; color:var(--fbf-muted);
  transition:all .15s;
}
.fbf-floor-tab:hover { border-color:var(--fbf-navy); color:var(--fbf-navy); }
.fbf-floor-tab.active { background:var(--fbf-navy); color:var(--fbf-sky); border-color:var(--fbf-navy); }
.fbf-floor-add { background:transparent; border-style:dashed; color:var(--fbf-navy); font-size:14px; padding:3px 8px; }

/* ── Radio option ────────────────────────────────────────────────── */
.fbf-radio-opt {
  display:flex; align-items:flex-start; gap:10px;
  padding:10px 12px; border-radius:8px; border:1.5px solid var(--fbf-border);
  background:var(--fbf-bg2); cursor:pointer; margin-bottom:8px;
  transition:all .15s; pointer-events:all; user-select:none;
}
.fbf-radio-opt:hover { border-color:var(--fbf-navy); background:white; }
.fbf-radio-sel { border-color:var(--fbf-navy) !important; background:rgba(25,25,112,.05) !important; }

/* ── Origin box ──────────────────────────────────────────────────── */
.fbf-ob { background:rgba(12,74,110,.07); border:0.5px solid rgba(12,74,110,.2); border-radius:6px; padding:8px; margin-bottom:9px; }
.fbf-ob-t { font-weight:500; color:#0c4a6e; margin-bottom:3px; font-size:11px; }
.fbf-ob-v { color:#185fa5; font-weight:500; padding:2px 6px; background:rgba(12,74,110,.08); border-radius:3px; font-size:11px; display:block; margin-top:2px; }

/* ── Modal footer ────────────────────────────────────────────────── */
.fbf-modal-footer { display:flex; gap:8px; margin-top:16px; padding-top:12px; border-top:0.5px solid var(--fbf-border); }

/* ── Fix modal pointer events ─────────────────────────────────── */
.fbf-modal-bg {
    position: fixed !important;
    inset: 0 !important;
    z-index: 99999 !important;
    pointer-events: all !important;
    background: rgba(0,0,0,.55);
    display: flex;
    align-items: center;
    justify-content: center;
}
.fbf-modal {
    pointer-events: all !important;
    position: relative !important;
    z-index: 100000 !important;
    max-height: 85vh !important;
    overflow-y: auto !important;
    display: flex !important;
    flex-direction: column !important;
}
.fbf-modal-footer {
    position: sticky !important;
    bottom: 0 !important;
    background: white !important;
    padding-top: 12px !important;
    margin-top: auto !important;
    border-top: 0.5px solid var(--fbf-border) !important;
}
.fbf-modal-opt {
    pointer-events: all !important;
    cursor: pointer !important;
}

/* ── Fix layout anagrafica con Elementor Canvas ──────────────────── */
.fbf-step-content { padding: 14px 16px; }
.fbf-step-heading { font-size: 16px; font-weight: 600; color: var(--fbf-sky); margin-bottom: 14px; }
.fbf-cards-row { grid-template-columns: 1fr 1fr; }
@media(max-width:800px){ .fbf-cards-row { grid-template-columns: 1fr; } }

/* Header compatto — altezza fissa */
.fbf-header { height: 44px; }
.fbf-logo { height: 22px !important; }

/* Footer nav compatto */
.fbf-footer-nav { padding: 7px 16px; }

/* Stanze layout — calcola altezza sottraendo header+footer esatti */
.fbf-stanze-layout { height: calc(100vh - 44px - 44px - 2px) !important; }

/* ══ HEADER FIX ══════════════════════════════════════════════════════ */
.fbf-header {
    height: 40px !important;
    padding: 0 12px !important;
    gap: 10px !important;
}
.fbf-logo {
    height: 28px !important;
    width: auto !important;
    object-fit: contain !important;
    opacity: 1 !important;
    filter: brightness(0) invert(1) !important;
    flex-shrink: 0 !important;
}
.fbf-header-info { display: flex; align-items: center; gap: 0; }
.fbf-header-title { font-size: 11px !important; font-weight: 500 !important; color: rgba(173,216,230,.8) !important; white-space: nowrap; }
.fbf-header-sub { display: none !important; }  /* rimosso — info non necessaria nell'header */
.fbf-header-left { display: flex; align-items: center; gap: 8px; min-width: 0; flex-shrink: 0; }

/* Steps compatti */
.fbf-steps { gap: 2px !important; }
.fbf-step { padding: 3px 8px !important; font-size: 10px !important; }
.fbf-step-label { display: none; }  /* solo numero su schermi piccoli */
.fbf-step-num { width: 18px !important; height: 18px !important; font-size: 10px !important; }
@media(min-width: 700px) {
    .fbf-step-label { display: inline !important; }
    .fbf-step { padding: 3px 10px !important; }
}
.fbf-step-arrow { font-size: 12px !important; color: rgba(173,216,230,.25) !important; }
.fbf-hbtn { padding: 4px 10px !important; font-size: 11px !important; }
.fbf-user { font-size: 10px !important; color: rgba(173,216,230,.5) !important; display: none; }
@media(min-width: 900px) { .fbf-user { display: inline !important; } }

/* ══ TOOLBAR STANZE — compatta, colonne ══════════════════════════════ */
.fbf-canvas-toolbar {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    gap: 4px !important;
    padding: 4px 8px !important;
    background: rgba(245,247,250,.95) !important;
    border-bottom: 0.5px solid var(--fbf-border) !important;
    max-height: 36px !important;
    overflow: hidden !important;
}
.fbf-tool-btn {
    padding: 3px 8px !important;
    font-size: 11px !important;
    border-radius: 4px !important;
}
.fbf-canvas-coords { font-size: 10px !important; }

/* ══ FOOTER NAV compatto ══════════════════════════════════════════════ */
.fbf-footer-nav { padding: 6px 14px !important; min-height: 0 !important; }
.fbf-nav-btn { padding: 7px 16px !important; font-size: 12px !important; }

/* ══ STANZE — canvas occupa più spazio ═══════════════════════════════ */
.fbf-stanze-layout {
    height: calc(100vh - 40px - 38px - 1px) !important;
}

/* ══ STEP 0 — TIPO RILIEVO ═══════════════════════════════════════════ */
.fbf-tipo-screen {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 78px);
    padding: 20px;
    overflow: hidden;
}

/* Watermark sfondo — come call center, NON in primo piano */
.fbf-tipo-bg {
    position: absolute;
    inset: 0;
    background-image: url('../img/logo-b-watermark.png');
    background-repeat: no-repeat;
    background-position: center;
    background-size: 55%;
    opacity: 0.07;
    pointer-events: none;
    z-index: 0;
}

.fbf-tipo-wrap {
    position: relative;
    z-index: 1;
    text-align: center;
    max-width: 780px;
    width: 100%;
}

.fbf-tipo-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--fbf-sky);
    margin: 0 0 8px;
    letter-spacing: -.3px;
}
.fbf-tipo-sub {
    font-size: 15px;
    color: rgba(173,216,230,.7);
    margin: 0 0 36px;
}
.fbf-tipo-cards {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}
.fbf-tipo-card {
    background: rgba(245,247,250,.88);
    backdrop-filter: blur(8px);
    border: 2px solid rgba(255,255,255,.25);
    border-radius: 16px;
    padding: 28px 22px;
    width: 210px;
    cursor: pointer;
    transition: all .2s ease;
    text-align: center;
}
.fbf-tipo-card:hover {
    border-color: var(--fbf-sky);
    background: rgba(255,255,255,.96);
    transform: translateY(-4px);
    box-shadow: 0 8px 32px rgba(25,25,112,.2);
}
.fbf-tipo-card.selected {
    border-color: var(--fbf-sky);
    background: white;
    transform: translateY(-4px);
    box-shadow: 0 8px 32px rgba(25,25,112,.25);
}
.fbf-tipo-icon { font-size: 40px; margin-bottom: 12px; }
.fbf-tipo-name { font-size: 15px; font-weight: 600; color: var(--fbf-navy); margin-bottom: 6px; }
.fbf-tipo-desc { font-size: 12px; color: var(--fbf-muted); line-height: 1.5; }


/* ── Allineamento select zona climatica / tipo immobile ─────────── */
.fbf-row-2.align-end { align-items: end; }

/* ── Step 2s: sidebar slim + pulsante aggiungi ──────────────────── */
.fbf-ser-layout {
    display: flex;
    gap: 0;
    height: 100%;
    min-height: 0;
}
.fbf-ser-sidebar-slim {
    width: 60px;
    flex-shrink: 0;
    background: var(--fbf-navy);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 16px 8px;
}
.fbf-ser-add-btn {
    writing-mode: vertical-rl;
    text-orientation: mixed;
    transform: rotate(180deg);
    background: #6b7280 !important;
    color: white !important;
    border: none !important;
    border-radius: 8px !important;
    padding: 14px 8px !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    cursor: pointer;
    letter-spacing: .03em;
    white-space: nowrap;
    transition: background .2s;
}
.fbf-ser-add-btn:hover {
    background: #9ca3af !important;
}

/* ── Tabella vani ───────────────────────────────────────────────── */
.fbf-vani-table {
    background: white;
    border-radius: 10px;
    border: 0.5px solid var(--fbf-border);
    overflow: hidden;
}
.fbf-vani-thead {
    display: grid;
    grid-template-columns: 50px 130px 150px 1fr 70px;
    background: var(--fbf-navy);
    color: var(--fbf-sky);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
}
.fbf-vani-thead > div { padding: 8px 10px; }
.fbf-vano-row {
    display: grid;
    grid-template-columns: 50px 130px 150px 1fr 70px;
    border-bottom: 0.5px solid var(--fbf-border);
    align-items: start;
}
.fbf-vano-row:last-child { border-bottom: none; }
.fbf-vano-pos {
    padding: 10px;
    font-size: 14px;
    font-weight: 700;
    color: var(--fbf-navy);
}
.fbf-vano-locale {
    padding: 10px;
    font-size: 12px;
}
.fbf-vano-locale strong { display: block; font-weight: 600; }
.fbf-vano-rif { font-size: 10px; color: var(--fbf-muted); margin-top: 2px; }
.fbf-vano-dims {
    padding: 10px;
    font-size: 11px;
    color: #374151;
    line-height: 1.6;
}
.fbf-vano-dims span { color: var(--fbf-muted); }
.fbf-vano-prodotti { padding: 4px 0; }
.fbf-vano-azioni {
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: center;
}
.fbf-btn-edit, .fbf-btn-del {
    background: none;
    cursor: pointer;
    font-size: 11px;
    padding: 3px 10px;
    border-radius: 4px;
    width: 100%;
    transition: background .15s;
}
.fbf-btn-edit { border: 0.5px solid var(--fbf-border); color: var(--fbf-navy); }
.fbf-btn-edit:hover { background: rgba(25,25,112,.06); }
.fbf-btn-del { border: 0.5px solid #fca5a5; color: #dc2626; }
.fbf-btn-del:hover { background: #fee2e2; }
.fbf-no-prod { padding: 6px 10px; font-size: 11px; color: var(--fbf-muted); font-style: italic; }
.fbf-foto-count { padding: 4px 8px; font-size: 10px; color: var(--fbf-muted); }

/* ── Scheda tecnica prodotto espandibile ────────────────────────── */
.fbf-prod-row {
    border-bottom: 0.5px solid #f3f4f6;
}
.fbf-prod-row:last-child { border-bottom: none; }
.fbf-prod-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    cursor: pointer;
    user-select: none;
    transition: background .15s;
}
.fbf-prod-header:hover { background: rgba(25,25,112,.04); }
.fbf-prod-name {
    font-size: 12px;
    font-weight: 600;
    color: var(--fbf-navy);
    min-width: 110px;
    flex-shrink: 0;
}
.fbf-prod-brief {
    font-size: 10px;
    color: #6b7280;
    flex: 1;
}
.fbf-interv-badge {
    font-size: 10px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
    flex-shrink: 0;
}
.fbf-prod-arr {
    font-size: 9px;
    color: var(--fbf-muted);
    transition: transform .2s;
    flex-shrink: 0;
}
/* pannello espanso */
.fbf-prod-scheda {
    display: flex;
    gap: 0;
    border-top: 0.5px solid #e5e7eb;
    background: #f9fafb;
}
.fbf-scheda-params {
    flex: 1;
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.fbf-scheda-param {
    display: flex;
    align-items: baseline;
    gap: 8px;
    font-size: 11px;
    line-height: 1.5;
}
.fbf-scheda-key {
    color: #6b7280;
    min-width: 110px;
    flex-shrink: 0;
    font-size: 10px;
}
.fbf-scheda-val {
    color: #111827;
    font-weight: 500;
    text-transform: capitalize;
}
.fbf-scheda-svg {
    width: 180px;
    flex-shrink: 0;
    padding: 12px;
    border-left: 0.5px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
}

/* ── Colonne prodotto allineate all'header ──────────────────────── */
.fbf-prod-cell {
    font-size: 11px;
    color: #374151;
    padding: 0 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.fbf-vani-thead > div:nth-child(4) span {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--fbf-sky);
    padding: 8px 4px;
    display: block;
}

/* ── Scroll orizzontale tabella vani su schermi stretti ─────────── */
#fbf-ser-vani-grid {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.fbf-vani-table {
    min-width: 860px;
}
/* Contenitore principale step 2s scrollabile orizzontalmente */
.fbf-ser-layout > div:last-child {
    overflow-x: auto;
}

/* ── Galleria colori ─────────────────────────────────────────────── */
.fbf-col-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    width: 100%;
    height: 29px; /* stessa altezza dei select */
    padding: 4px 6px;
    background: white;
    border: 0.5px solid #dde2ea;
    border-radius: 4px;
    cursor: pointer;
    font-size: 11px;
    color: #374151;
    text-align: left;
    transition: border-color .15s;
    box-sizing: border-box;
}
.fbf-col-btn:hover { border-color: var(--fbf-navy); }
.fbf-col-btn:disabled { background: #f4f6f9; color: #aaa; cursor: default; pointer-events: none; }
.fbf-col-preview {
    width: 16px;
    height: 16px;
    border-radius: 3px;
    border: 0.5px solid rgba(0,0,0,.15);
    flex-shrink: 0;
    display: inline-block;
}
.fbf-col-label {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 10px;
}

/* Overlay a schermo intero */
.fbf-col-overlay {
    position: fixed;
    inset: 0;
    z-index: 2147483647;
    background: rgba(0,0,0,.55);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

/* Galleria modal centrata */
.fbf-col-gallery {
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0,0,0,.35);
    width: min(420px, 100%);
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.fbf-col-gallery-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    background: var(--fbf-navy);
    color: white;
    flex-shrink: 0;
}
.fbf-col-swatches {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    overflow-y: auto;
    padding: 12px;
    flex: 1;
}
.fbf-col-swatch {
    border-radius: 8px;
    cursor: pointer;
    aspect-ratio: 1;
    position: relative;
    border: 2px solid transparent;
    transition: transform .12s, border-color .12s;
    display: flex;
    align-items: flex-end;
    overflow: hidden;
}
.fbf-col-swatch:hover { transform: scale(1.06); border-color: rgba(255,255,255,.6); }
.fbf-col-swatch--sel { border-color: #f59e0b !important; box-shadow: 0 0 0 2px #f59e0b; }
.fbf-col-swatch-name {
    font-size: 8px;
    font-weight: 600;
    padding: 3px 4px;
    width: 100%;
    background: rgba(0,0,0,.38);
    text-align: center;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── Griglia campi SF/LAV serramento ────────────────────────────── */
.fbf-ser-campi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 4px 6px;
    margin-bottom: 6px;
}
/* Ogni campo: label in cima, controllo in fondo — altezza uniforme */
.fbf-ser-campi-grid .fbf-fg {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    min-height: 48px;
}
.fbf-ser-campi-grid .fbf-fg label {
    font-size: 9px !important;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--fbf-navy);
    margin-bottom: 3px;
    min-height: 14px;
    display: block;
}
/* Riga 1: select normali */
.fbf-ser-row1 .fbf-fg select,
.fbf-ser-row1 .fbf-fg input:not([type="hidden"]):not([type="radio"]):not([type="checkbox"]) {
    height: 28px;
    box-sizing: border-box;
    font-size: 11px;
    width: 100%;
}
/* Riga 2: pulsanti colore e gallerie */
.fbf-ser-row2 .fbf-fg select,
.fbf-ser-row2 .fbf-fg .fbf-col-btn,
.fbf-ser-row2 .fbf-fg button[style*="dashed"] {
    height: 29px;
    box-sizing: border-box;
    font-size: 11px;
    width: 100%;
}

/* ── Bottoni selezione tipo vano (Infissi / Outdoor) ────────────── */
.fbf-tipo-vano-btn {
    flex: 1;
    padding: 10px 16px;
    border: 1.5px solid var(--fbf-border);
    border-radius: 8px;
    background: white;
    color: var(--fbf-navy);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all .15s;
    text-align: center;
}
.fbf-tipo-vano-btn:hover {
    border-color: var(--fbf-navy);
    background: rgba(25,25,112,.04);
}
.fbf-tipo-vano-active {
    background: var(--fbf-navy) !important;
    color: white !important;
    border-color: var(--fbf-navy) !important;
}


/* ── BIM Outdoor v2.0 styles (v32) ── */

*{box-sizing:border-box;margin:0;padding:0}
body{font-family:monospace;background:#e8e8e0;padding:12px;display:flex;justify-content:center}
#app{display:flex;flex-direction:column;height:840px;width:100%;max-width:1140px;background:#fff;border:.5px solid #ccc;border-radius:8px;overflow:hidden}
#tb1{display:flex;align-items:center;gap:4px;padding:5px 10px;background:#1a1a2e;border-bottom:1px solid #000;flex-shrink:0;flex-wrap:wrap}
#tb1 label{font-size:11px;color:#c8c8d0}
.btn{padding:4px 9px;border:1px solid #555;border-radius:4px;font-size:11px;cursor:pointer;background:#2a2a3e;color:#e8e8f0;font-family:monospace;white-space:nowrap}
.btn:hover{background:#3a3a4e}
.btn.p{background:#378ADD;color:#fff;border-color:#185FA5}
.btn.g{background:#166534;color:#fff;border-color:#14532d}
.btn.o{background:#854F0B;color:#fff;border-color:#633806}
.btn.r{border-color:#dc2626;color:#f87171}.btn.r:hover{background:#3d1a1a}
.btn.on{background:#EF9F27;color:#1a1a1a;border-color:#BA7517}
.btn.teal{background:#0F6E56;color:#fff;border-color:#085041}
.btn.blue{background:#185FA5;color:#fff;border-color:#0C447C}
.btn.purple{background:#534AB7;color:#fff;border-color:#3C3489}
.dir{width:26px;height:26px;border:1px solid #555;border-radius:3px;font-size:10px;cursor:pointer;background:#2a2a3e;color:#c8c8d0;display:inline-flex;align-items:center;justify-content:center}
.dir:hover{background:#3a3a4e}.dir.on{background:#378ADD;color:#fff;border-color:#185FA5}
#tb2{display:flex;align-items:center;gap:4px;padding:4px 10px;background:#12122a;border-bottom:1px solid #000;flex-shrink:0;flex-wrap:wrap}
#phase-bar{display:flex;background:#0d0d20;border-bottom:1px solid #1a2a5e;flex-shrink:0}
.ph{flex:1;padding:5px 2px;text-align:center;font-size:10px;color:#444;cursor:pointer;border-right:1px solid #1a2a5e;font-family:monospace}
.ph:hover{background:#1a1a3e}.ph.active{color:#EF9F27;background:#1a1a3e;font-weight:bold}.ph.done{color:#1D9E75}
#act-bar{display:flex;align-items:center;gap:6px;padding:5px 10px;background:#060e20;border-bottom:1px solid #1a2a5e;flex-shrink:0;min-height:34px;flex-wrap:wrap}
#main{display:flex;flex:1;overflow:hidden}
#sb{width:200px;flex-shrink:0;border-right:1px solid #ddd;overflow-y:auto;background:#fafaf8;font-size:11px}
.sec{padding:6px 10px;border-bottom:1px solid #eee}
.sec-t{font-size:10px;font-weight:bold;color:#666;text-transform:uppercase;letter-spacing:.5px;margin-bottom:4px}
.vrow{display:flex;align-items:center;gap:3px;margin-bottom:2px;padding:2px 4px;border-radius:3px;cursor:pointer;border-left:3px solid transparent}
.vrow:hover{background:#f0f0ea}.vrow.sel{background:#E6F1FB;border-left-color:#185FA5}.vrow.last{border-left-color:#854F0B}
.vrow input{width:42px;padding:1px 3px;border:1px solid #bbb;border-radius:2px;font-size:10px;font-family:monospace;background:#fff;color:#222}
.orow{padding:4px 7px;margin-bottom:2px;border-radius:3px;font-size:10px;cursor:pointer;border-left:4px solid #ddd}
.orow:hover{background:#f0f0ea}
#cv-wrap{flex:1;position:relative;overflow:hidden}
canvas{display:block}
#typebox{position:absolute;background:#1a1a2e;border:2px solid #EF9F27;border-radius:6px;padding:5px 12px;font-size:15px;color:#EF9F27;font-family:monospace;pointer-events:none;display:none;z-index:30}
#side-panel{position:absolute;right:0;top:0;bottom:0;width:265px;background:#0d1428;border-left:2px solid #378ADD;display:none;flex-direction:column;z-index:20;font-family:monospace}
#sp-title{padding:8px 12px;background:#060e20;font-size:12px;color:#9FE1CB;font-weight:bold;border-bottom:1px solid #1a2a5e}
#sp-body{flex:1;overflow-y:auto;padding:10px 12px}
#sp-foot{padding:7px 12px;border-top:1px solid #1a2a5e;display:flex;gap:5px;flex-wrap:wrap}
.ol{font-size:10px;color:#9FE1CB;margin-bottom:2px;margin-top:7px;font-weight:bold}
.oi{width:100%;padding:4px 7px;border:1px solid #1a2a5e;border-radius:4px;font-size:13px;background:#060e20;color:#e8e8f0;font-family:monospace}
.oc{display:inline-block;padding:3px 8px;border:1px solid #1a2a5e;border-radius:4px;font-size:10px;cursor:pointer;background:#060e20;color:#9FE1CB;margin:2px;font-family:monospace}
.oc:hover{background:#1a2a4e}.oc.sel{background:#185FA5;color:#fff;border-color:#378ADD}
.ct{font-size:10px;color:#FAC775;font-weight:bold;text-transform:uppercase;border-bottom:1px solid #1a2a5e;padding-bottom:3px;margin-bottom:5px;margin-top:10px}
.cg{display:grid;grid-template-columns:1fr 1fr;gap:4px;margin-bottom:4px}
.ci{padding:5px 7px;border:1px solid #1a2a5e;border-radius:4px;cursor:pointer;background:#060e20}
.ci:hover{background:#1a2a4e;border-color:#9FE1CB}.ci.sel{border-color:#1D9E75;background:#0d2a1e}
#sbar{font-size:10px;padding:3px 10px;background:#f0f0ea;border-top:1px solid #ddd;flex-shrink:0;display:flex;justify-content:space-between;color:#555}

.fbf-btn-sm { padding:5px 12px;font-size:11px;background:var(--fbf-navy);color:white;border:none;border-radius:5px;cursor:pointer;font-family:inherit; }
.fbf-btn-sm:hover { opacity:.85; }
