/* Dense working surfaces, shared headers and bounded record editors. */
html body #stormcoreApp #workspaceModule>.module-heading{min-height:42px!important;height:auto!important;margin:0 20px 10px!important;padding:6px 0!important;border:0!important;border-radius:0!important;box-shadow:none!important;background:transparent!important;gap:8px!important}
html body #stormcoreApp #workspaceModule>.module-heading:after,html body #stormcoreApp #workspaceModule>.module-heading>div:before{display:none!important}
html body #stormcoreApp #workspaceModule>.module-heading h1{font-size:21px!important;line-height:1.25!important;color:#15334e!important;text-shadow:none!important}
html body #stormcoreApp #workspaceModule>.module-heading button{box-shadow:none!important;min-height:32px!important;padding:5px 10px!important}
html body #stormcoreApp #workspaceModule #modal[data-workspace-page]>.card{padding:0!important;margin:0 20px!important;width:auto!important;max-width:none!important;overflow:visible!important}
html body #stormcoreApp #workspaceModule #modal[data-workspace-detail=true]>.card{max-width:860px!important;margin:0 auto 24px!important;background:#fff!important;border:1px solid #cddce7!important;border-radius:8px!important;padding:16px!important}
html body #stormcoreApp #modal .record-form h2,html body #stormcoreApp #modalBody>h2{font-size:18px!important;line-height:1.3!important;margin:0 0 12px!important;padding:10px 42px 10px 12px!important;border-radius:5px!important;box-shadow:none!important}
html body #stormcoreApp #modal .record-form .formgrid{grid-template-columns:repeat(4,minmax(0,1fr))!important;gap:10px 12px!important}
html body #stormcoreApp #modal .record-form label:has(#ad),html body #stormcoreApp #modal .record-form label:has(#adUnit),html body #stormcoreApp #modal .record-form label:has(textarea){grid-column:span 2}
html body #stormcoreApp #modal .record-form :is(input,select){min-height:34px!important;padding:6px 9px!important;border-radius:4px!important;margin-top:3px!important}
html body #stormcoreApp #modal .record-form label{font-size:11px!important;line-height:1.4!important}
html body #stormcoreApp #modal .record-form :is(.form-actions,.customer-file-actions){gap:6px!important;padding:10px 0!important;margin:8px 0 0!important}
html body #stormcoreApp #modal .form-section-title{margin-top:6px!important;padding:7px 0!important;font-size:12px!important}
html body #modal.modal:not([data-workspace-page])>.card{width:min(760px,calc(100vw - 32px))!important;max-height:88dvh!important;padding:20px!important;border-radius:8px!important;overflow:auto!important}
html body :is(.sc-confirm-dialog,.fieldcam-delete){width:min(420px,calc(100vw - 32px))!important;max-height:85dvh!important;padding:20px!important;border-radius:8px!important;overflow:auto!important}
html body .sc-confirm-heading h2{font-size:18px!important;line-height:1.3!important}
html body #modal #closeModal{width:32px!important;height:32px!important;min-height:32px!important;right:8px!important;top:8px!important;z-index:5}
.contact-sheet,.leads-center{min-width:0;max-width:100%;display:block!important}
.sheet-tools,.sheet-footer,.lead-toolbar,.lead-status-bar{display:flex;align-items:center;flex-wrap:wrap;gap:8px;padding:9px 10px;background:#f8fbfe;border:1px solid #d4e1eb;font-size:12px;color:#486078}
.sheet-tools>span:first-child{font-weight:700;color:#173956;margin-right:auto}.sheet-footer{border-top:0}.sheet-footer>span{margin-right:auto}
.sheet-scroll{max-width:100%;overflow:auto;max-height:calc(100dvh - 275px);border:1px solid #cbdbe8;border-top:0;background:white;scrollbar-gutter:stable}
.sc-data-sheet{width:100%;border-collapse:separate;border-spacing:0;font-size:12px;line-height:1.4;color:#213a50;text-align:left;white-space:nowrap}
.sc-data-sheet th{position:sticky;top:0;z-index:2;background:#eaf2f9;color:#36576f;font-size:11px;font-weight:700;border-bottom:2px solid #79b6ea;letter-spacing:.02em}
.sc-data-sheet :is(td,th){padding:6px 10px!important;height:36px;border-right:1px solid #e4ecf2;border-bottom:1px solid #e4ecf2;max-width:280px;overflow:hidden;text-overflow:ellipsis;vertical-align:middle}
.sc-data-sheet td:first-child,.sc-data-sheet th:first-child{position:sticky;left:0;z-index:1;background:#f4f8fc;width:32px}.sc-data-sheet th:first-child{z-index:3}
.sc-data-sheet tbody tr:nth-child(even){background:#f8fbfe}.sc-data-sheet tbody tr:hover{background:#eaf5ff}.sc-data-sheet tbody tr:focus{outline:2px solid #1687f7;outline-offset:-2px}.sc-data-sheet tr:has(input:checked){background:#e2f1ff}
html body #stormcoreApp .sc-data-sheet button{font-size:12px!important;min-height:26px!important;padding:3px 6px!important;box-shadow:none!important;white-space:nowrap}.sc-data-sheet th button{border:0!important;background:transparent!important;font-size:11px!important;color:inherit!important;padding:0!important}.sheet-contact-name{font-weight:650!important;background:transparent!important;border:0!important;color:#075fb7!important;text-align:left;max-width:260px;overflow:hidden;text-overflow:ellipsis}.sheet-row-actions{display:flex;gap:6px;align-items:center}.sheet-row-actions a{font-size:11px;text-decoration:none;color:#0764be}
.sc-data-sheet input[type=checkbox]{width:15px;height:15px;min-height:0!important;margin:0;accent-color:#087de0}.sheet-comfortable td{height:48px!important}
.sheet-tools details{position:relative}.sheet-tools summary{cursor:pointer;padding:5px 9px;border:1px solid #cadce9;border-radius:4px;background:white}.sheet-column-options{position:absolute;right:0;top:30px;z-index:8;display:grid;gap:8px;min-width:180px;padding:12px;background:white;border:1px solid #cbdbe8;border-radius:5px;box-shadow:0 6px 18px #16365420}.sheet-column-options label{display:flex;gap:8px;align-items:center}
.lead-toolbar{border-bottom:0;background:#fff;padding:12px}.lead-toolbar input[type=search]{flex:1;min-width:150px}.lead-status-bar{background:transparent;border:0;padding:0 0 10px}.lead-status-bar button[aria-pressed=true]{background:#e7f3ff!important;color:#075fb7!important;border-color:#65a7e2!important}.lead-detail{display:grid;gap:12px}.lead-detail .lead-fields{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}.lead-detail label{display:grid;gap:4px;font-size:12px}.lead-detail .lead-full{grid-column:1/-1}.lead-notice{font-size:12px;color:#526d83}.lead-badge{display:inline-block;border-radius:4px;background:#e9f4ff;padding:2px 6px;font-size:11px;color:#075fb7}.lead-integrations{display:grid;gap:12px}.lead-connection{border:1px solid #d0e0ed;background:white;padding:14px;border-radius:6px}.lead-connection h3{margin:0 0 7px;font-size:15px}.lead-connection code{overflow-wrap:anywhere;white-space:normal}.lead-connection p{font-size:12px;line-height:1.6}
@media(max-width:1000px){html body #stormcoreApp #modal .record-form .formgrid{grid-template-columns:repeat(2,minmax(0,1fr))!important}}
@media(max-width:800px){html body #stormcoreApp #workspaceModule>.module-heading{margin:0 12px 8px!important;min-height:36px!important}html body #stormcoreApp #workspaceModule #modal[data-workspace-page]>.card{margin:0 12px!important}html body #stormcoreApp #workspaceModule #modal[data-workspace-detail=true]>.card{padding:12px!important}.sheet-scroll{max-height:calc(100dvh - 300px)}.lead-detail .lead-fields{grid-template-columns:repeat(2,minmax(0,1fr))}.lead-toolbar{padding:8px}.lead-toolbar select{max-width:100%}.sheet-tools{gap:6px}.sheet-tools button{font-size:11px!important;padding:5px!important}}
@media(max-width:480px){html body #stormcoreApp #modal .record-form .formgrid,.lead-detail .lead-fields{grid-template-columns:minmax(0,1fr)!important}html body #stormcoreApp #modal .record-form label:has(#ad),html body #stormcoreApp #modal .record-form label:has(#adUnit),html body #stormcoreApp #modal .record-form label:has(textarea){grid-column:auto}html body #modal.modal:not([data-workspace-page])>.card{width:calc(100vw - 16px)!important;padding:14px!important}.lead-toolbar input[type=search]{flex-basis:100%}.sc-data-sheet :is(td,th){padding:6px!important}}

@media(max-width:800px){html body #stormcoreApp .sc-mobile-bottom-nav{display:grid!important;grid-template-columns:repeat(6,minmax(0,1fr))!important}html body #stormcoreApp .sc-mobile-bottom-nav>button{min-width:0!important;font-size:10px!important;padding-left:2px!important;padding-right:2px!important}}
.sheet-import{display:flex;align-items:center;gap:6px;font-size:12px}.sheet-import input{font-size:11px;width:165px;max-width:100%}

html body #stormcoreApp #workspaceModule #modal[data-workspace-detail=true]>.card{box-sizing:border-box!important;width:calc(100% - 40px)!important}

html body #stormcoreApp #workspaceModule #modal[data-workspace-page][data-workspace-detail=true]>.card{position:relative!important}html body #stormcoreApp #workspaceModule #modal[data-workspace-page][data-workspace-detail=true] #closeModal{display:flex!important;align-items:center;justify-content:center;visibility:visible!important}


/* Keep spreadsheet cells legible; narrow screens scroll the sheet, never the page. */
html body #stormcoreApp #workspaceModule #modal .sc-data-sheet{min-width:1050px!important;table-layout:auto!important;white-space:nowrap!important}
html body #stormcoreApp #workspaceModule #modal .sc-data-sheet :is(td,th){min-width:95px!important;white-space:nowrap!important}
html body #stormcoreApp #workspaceModule #modal .contact-sheet .sc-data-sheet :is(td,th):first-child{min-width:32px!important;width:32px!important}
html body #stormcoreApp #workspaceModule #modal .contact-sheet .sc-data-sheet :is(td,th):nth-child(2){position:sticky!important;left:33px;min-width:175px!important;background:#f8fbfe;z-index:1}
html body #stormcoreApp #workspaceModule #modal .contact-sheet .sc-data-sheet th:nth-child(2){z-index:3;background:#eaf2f9}
html body #stormcoreApp #workspaceModule #modal .leads-center .sc-data-sheet :is(td,th):first-child{min-width:180px!important;width:auto!important}
html body #stormcoreApp #workspaceModule #modal .sc-data-sheet th button,html body #stormcoreApp #workspaceModule #modal .sc-data-sheet .sheet-contact-name{border:0!important;background:transparent!important;box-shadow:none!important;border-radius:0!important;text-align:left!important;white-space:nowrap!important;min-width:0!important}
html body #stormcoreApp #workspaceModule #modal .sc-data-sheet th button{padding:0!important;color:#36576f!important;font-size:11px!important}
html body #stormcoreApp #workspaceModule #modal[data-workspace-detail=true] #closeModal{position:sticky!important;float:right!important;top:66px!important;margin-top:0!important;margin-bottom:-32px!important}

/* Grid items need an explicit bounded width, otherwise a wide table expands the page. */
html body #stormcoreApp #workspaceModule #modal[data-workspace-detail=false]>.card{box-sizing:border-box!important;min-width:0!important;width:calc(100% - 40px)!important;max-width:calc(100% - 40px)!important;justify-self:center!important}
html body #stormcoreApp #workspaceModule #modal[data-workspace-detail=true]>.card{min-width:0!important}
@media(max-width:800px){html body #stormcoreApp #workspaceModule #modal[data-workspace-detail=false]>.card{width:calc(100% - 24px)!important;max-width:calc(100% - 24px)!important}}

@layer stormcore-compact {
 html body #stormcoreApp #workspaceModule #modal .sc-data-sheet th button,html body #stormcoreApp #workspaceModule #modal .sc-data-sheet .sheet-contact-name{border:0!important;background:transparent!important;box-shadow:none!important;border-radius:0!important;text-align:left!important;white-space:nowrap!important;min-width:0!important;min-height:26px!important;padding:2px 3px!important}
 html body #stormcoreApp #workspaceModule #modal .sc-data-sheet th button{font-size:11px!important;color:#36576f!important}
 html body #stormcoreApp #workspaceModule #modal .sc-data-sheet .sheet-contact-name{font-size:12px!important;font-weight:650!important;color:#0763b4!important}
 html body #stormcoreApp #workspaceModule #modal .sc-data-sheet :is(td,th){text-align:left!important}
}

.sc-confirm-close{position:absolute;right:8px;top:8px;width:32px;height:32px;padding:2px;background:transparent;border:0;cursor:pointer}.sc-confirm-heading{padding-right:28px}
