html, body {
    height: 100%;
}

.nl-help-text {
    line-height: 1.55;
    overflow-wrap: anywhere;
}
.nl-help-text p {
    white-space: pre-line;
    margin: 0 0 0.7rem;
}
.nl-help-text p:last-child {
    margin-bottom: 0;
}

app {
    display: block;
    height: 100%;
}

.header-logo {
    flex-shrink: 0;
    background: url('../images/NeuralLog.svg') left center / contain no-repeat;
    -webkit-mask: none;
    mask: none;
    width: 184px;
    height: 40px;
}

#blazor-error-ui {
    background: inherit;
    bottom: 0;
    display: none;
    position: fixed;
    width: 100%;
    height: 100%;
    z-index: 100001;
}

/* Keep the XAF time editors, but arrange the original seven-day matrix densely.
   Scope by generated member classes so other detail layouts stay independent. */
dxbl-form-layout-tab:has(.xaf-item-monday1from) {
    overflow-x: auto;
}
dxbl-form-layout-tab:has(.xaf-item-monday1from) > .dxbl-row {
    min-width: 1160px;
    margin: 0;
}
dxbl-form-layout-tab:has(.xaf-item-monday1from) > .dxbl-row > dxbl-form-layout-group {
    padding: 0;
    margin: 0;
}
dxbl-form-layout-tab:has(.xaf-item-monday1from) > .dxbl-row > dxbl-form-layout-group > dxbl-group-control {
    display: grid;
    grid-template-columns: 92px minmax(0, 1fr);
    border-radius: 0;
}
dxbl-form-layout-tab:has(.xaf-item-monday1from) .dxbl-group-header {
    padding: 4px 6px;
    align-self: center;
}
dxbl-form-layout-tab:has(.xaf-item-monday1from) .dxbl-group-body-content {
    padding: 2px 4px;
}
dxbl-form-layout-tab:has(.xaf-item-monday1from) .dxbl-group-body-content > .dxbl-row {
    align-items: flex-end;
}
dxbl-form-layout-tab:has(.xaf-item-monday1from) .dxbl-group-body-content > .dxbl-row > dxbl-form-layout-group {
    width: 20%;
    flex: 0 0 20%;
    padding: 0 4px;
}
/* The first pair has no "or" group caption; match the captioned pairs' inset. */
dxbl-form-layout-tab:has(.xaf-item-monday1from) .dxbl-group-body-content > .dxbl-row > dxbl-form-layout-group:first-child {
    padding-bottom: 12px;
}
dxbl-form-layout-tab:has(.xaf-item-monday1from) .dxbl-group-body-content > .dxbl-row > dxbl-form-layout-group > dxbl-group-control {
    border: 0;
    position: relative;
}
dxbl-form-layout-tab:has(.xaf-item-monday1from) .dxbl-group-body-content > .dxbl-row > dxbl-form-layout-group > dxbl-group-control > .dxbl-group-header {
    position: absolute;
    left: -14px;
    top: 23px;
    padding: 0;
    font-size: 10px;
}
dxbl-form-layout-tab:has(.xaf-item-monday1from) dxbl-form-layout-item {
    padding: 0 3px;
    margin: 0;
}
dxbl-form-layout-tab:has(.xaf-item-monday1from) input {
    font-variant-numeric: tabular-nums;
    padding-inline: 3px;
}
.nl-copy-picker { min-width: 0; font-size: 13px; }
.nl-copy-filters { display: grid; grid-template-columns: 1.7fr 1fr 1fr 1fr 1.25fr; gap: 12px; margin-bottom: 12px; }
.nl-copy-picker label { display: flex; flex-direction: column; gap: 5px; }
.nl-copy-picker select, .nl-copy-picker input[type=search], .nl-copy-picker output { min-width: 0; width: 100%; border: 1px solid #aaa; border-radius: 3px; padding: 6px; background: var(--bs-body-bg, white); color: inherit; }
.nl-copy-picker output { font-weight: 600; }
.nl-copy-search { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 12px; }
.nl-copy-search label { width: 230px; }
.nl-copy-body { display: grid; grid-template-columns: minmax(0,1fr) 115px; gap: 14px; }
.nl-copy-table-wrap { overflow: auto; }
.nl-copy-table { width: 100%; border-collapse: collapse; }
.nl-copy-table th, .nl-copy-table td { padding: 6px 7px; border: 1px solid #ccc; text-align: left; vertical-align: top; }
.nl-copy-table th { background: var(--bs-tertiary-bg, #f5f5f5); font-weight: 600; }
.nl-copy-table th:first-child, .nl-copy-table td:first-child { width: 48px; text-align: center; }
.nl-copy-table td:nth-child(3) { min-width: 145px; }
.nl-copy-focused { background: #e5f0fc; color: #172a3f; }
.nl-copy-focus { border: 0; background: none; color: inherit; text-align: left; padding: 0; font: inherit; }
.nl-copy-actions { display: flex; flex-direction: column; gap: 10px; }
.nl-copy-actions button, .nl-copy-pages button, .nl-audio-preview button { border: 1px solid #aaa; border-radius: 3px; padding: 6px 10px; color: inherit; background: var(--bs-body-bg, white); }
.nl-copy-actions button:last-child { margin-top: 32px; }
.nl-copy-picker button:disabled { opacity: .5; }
.nl-copy-pages { display: flex; align-items: center; gap: 12px; margin-top: 10px; }
.nl-copy-picker [role=alert] { padding: 10px; border: 1px solid #b42318; color: #b42318; margin-top: 12px; }
.nl-audio-preview { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 14px; padding: 12px; border: 1px solid #aaa; }
@media(max-width:800px) { .nl-copy-filters { grid-template-columns: 1fr 1fr; } .nl-copy-search { align-items: stretch; flex-direction: column; } }

/* Copy Manager sidebar; the XAF template loads this stylesheet. */
.nl-copy-browser {display:grid;grid-template-columns:230px minmax(0,1fr);gap:12px;height:100%;min-height:400px;}
.nl-copy-browser aside {display:flex;flex-direction:column;gap:10px;min-width:0;overflow:auto;font-size:13px;}
.nl-copy-browser fieldset {border:1px solid #c7cbd0;border-radius:3px;padding:8px;margin:0;min-width:0;}
.nl-copy-browser legend {float:none;width:auto;font-size:13px;font-weight:600;margin:0;padding:0 4px;}
.nl-copy-browser label {display:flex;align-items:center;gap:6px;margin-bottom:6px;}
.nl-copy-browser input,.nl-copy-browser select {min-width:0;flex:1;width:100%;border:1px solid #aeb4ba;background:var(--bs-body-bg,#fff);color:var(--bs-body-color,#222);border-radius:3px;padding:4px;}
.nl-copy-browser button {border:1px solid #adb4bb;border-radius:3px;background:var(--bs-tertiary-bg,#f6f7f8);color:var(--bs-body-color,#222);padding:4px 8px;}
.nl-copy-browser button:disabled {opacity:.5;}
.nl-browser-buttons,.nl-browser-sort {display:flex;gap:5px;}
.nl-browser-buttons {justify-content:flex-end;}
.nl-browser-sort label {flex:1;min-width:0;}
.nl-browser-sort button {white-space:nowrap;margin-bottom:6px;padding:3px;}
.nl-browser-message {display:block;min-height:18px;margin-top:4px;overflow-wrap:anywhere;}
.nl-browser-account-filter {flex:1;display:flex;flex-direction:column;}
.nl-browser-reps {flex:1;min-height:150px;max-height:420px;overflow:auto;display:flex;flex-direction:column;align-items:stretch;border:1px solid #d0d4d9;margin-bottom:8px;padding:4px;}
.nl-browser-reps button {border:0;background:transparent;text-align:left;}
.nl-browser-reps button:not(:first-child) {padding-left:18px;}
.nl-browser-reps button.selected {background:#d8eaff;color:#12395e;}
.nl-copy-browser-grid {min-width:0;min-height:0;height:100%;}
@media(max-width:800px) {.nl-copy-browser {grid-template-columns:1fr;height:auto;}.nl-copy-browser aside {display:grid;grid-template-columns:repeat(auto-fit,minmax(200px,1fr));}.nl-browser-reps {min-height:70px;max-height:120px;}.nl-copy-browser-grid {min-height:400px;}}

.nl-browser-conditions { min-width: 0; width: min(760px, 100%); padding: .5rem; }
.nl-browser-condition-heading, .nl-browser-condition-row { display: grid; grid-template-columns: 72px minmax(120px, 1fr) 110px minmax(150px, 1.4fr); align-items: start; gap: 6px; margin-bottom: 7px; }
.nl-browser-condition-row input, .nl-browser-condition-row select { width: 100%; min-width: 0; padding: 6px; border: 1px solid #9ca6b2; border-radius: 3px; }
.nl-browser-condition-row label { min-width: 0; }
.nl-browser-condition-row small { display: block; font-size: .8rem; }
.nl-browser-condition-help { font-size: .85rem; margin-top: 1rem; }
.nl-browser-condition-buttons { display: flex; justify-content: flex-end; }
.nl-browser-condition-buttons button { padding: .4rem .8rem; }
@media(max-width: 650px) { .nl-browser-condition-row { grid-template-columns: 65px 1fr; } .nl-browser-condition-heading { display: none; } }

.nl-browser-conditions > p:first-child { background: #fffbdc; border: 1px solid #d9d3a6; padding: .7rem; }

.nl-browser-columns { width: min(800px,100%); }
.nl-browser-columns > p { background: #fffbdc; border: 1px solid #d9d3a6; padding: .8rem; }
.nl-browser-column-boxes { display: grid; grid-template-columns: minmax(160px,1fr) 110px minmax(160px,1fr); gap: 12px; }
.nl-browser-column-boxes h3 { font-size: 1rem; margin: .4rem 0; }
.nl-browser-column-list { height: 270px; overflow-y: auto; border: 1px solid #9ca6b2; background: white; padding: 3px; }
.nl-browser-column-list [role=option] { padding: 3px 8px; cursor: grab; }
.nl-browser-column-list .selected { background: #d8eaff; outline: 1px solid #78a5d0; }
.nl-browser-column-list:focus { outline: 2px solid #267bc1; outline-offset: 2px; }
.nl-column-empty { display: block; padding: 8px; color: #666; }
.nl-browser-column-transfer { align-self: center; display: grid; gap: 8px; }
.nl-browser-column-order, .nl-browser-column-footer { display: flex; justify-content: space-between; gap: 8px; margin-top: 10px; }
.nl-browser-columns button { padding: 6px 8px; }
.nl-browser-column-footer span { font-size: .85rem; }
@media(max-width: 600px) { .nl-browser-column-boxes { grid-template-columns: minmax(0,1fr); } .nl-browser-column-transfer { display: flex; } }

.nl-column-status { min-height: 1.4em; margin-top: 6px; font-size: .85rem; }

.nl-browser-sort-design { width:min(760px,100%); }
.nl-browser-sort-design > p { padding:.8rem; background:#fffbdc; border:1px solid #d9d3a6; }
.nl-sort-design-row {display:grid; grid-template-columns:80px minmax(130px,1fr) 170px; gap:10px; align-items:center; margin:12px 0;}
.nl-sort-design-row select,.nl-sort-design-row button,.nl-sort-design-actions button {padding:6px 8px;}
.nl-sort-design-actions {display:flex; justify-content:flex-end; gap:12px; margin-top:20px;}
@media(max-width:600px) {.nl-sort-design-row {grid-template-columns:1fr;} }

.nl-browser-page-setup {width:min(760px,100%);}
.nl-page-settings-columns {display:grid;grid-template-columns:1fr 1fr;gap:16px;}
.nl-browser-page-setup fieldset {border:1px solid #b5bbc2;padding:12px;margin-bottom:14px;}
.nl-browser-page-setup legend {float:none;width:auto;font-size:1rem;padding:0 5px;}
.nl-browser-page-setup label {display:flex;align-items:center;gap:10px;margin-bottom:8px;}
.nl-browser-page-setup label:not(.nl-page-choice)>input,.nl-browser-page-setup select {flex:1;min-width:0;padding:5px;width:100%;}
.nl-browser-page-setup label:not(.nl-page-choice)>input {max-width:130px;margin-left:auto;}
.nl-page-font-row {display:grid;grid-template-columns:minmax(0,1fr) 170px;gap:16px;}
.nl-browser-page-setup p {font-size:.85rem;margin-bottom:0;}
@media(max-width:600px) {.nl-page-settings-columns,.nl-page-font-row {grid-template-columns:1fr;} }

.nl-browser-page-setup .nl-page-choice input {flex:none;width:auto;margin:0;}

.nl-browser-design {width:min(820px,100%);}
.nl-browser-design-actions {display:flex;gap:10px;padding:0 0 12px;margin-bottom:8px;border-bottom:1px solid #b5bbc2;position:sticky;top:0;background:var(--bs-body-bg,#fff);z-index:1;}
.nl-browser-design-actions button {padding:7px 20px;border:1px solid #8e99a5;border-radius:3px;}
.nl-browser-design-actions .nl-design-apply {background:#176dab;color:white;border-color:#176dab;}
.nl-browser-design-tabs {display:flex;border-bottom:1px solid #8e99a5;gap:3px;}
.nl-browser-design-tabs button {padding:8px 16px;border:1px solid #a8afb8;border-bottom:0;border-radius:4px 4px 0 0;background:#edf0f3;}
.nl-browser-design-tabs button[aria-selected=true] {background:white;font-weight:600;}
.nl-browser-design-panel {padding:12px 2px 2px;}
.nl-design-reset-note {font-size:.85rem;line-height:1.35;margin:0 0 10px;padding:8px 10px;background:#eef5fb;border-left:3px solid #176dab;}
.nl-design-error {padding:8px 10px;background:#fff1f0;border:1px solid #bd4b42;}
.dxbl-popup:has(.nl-browser-design) .dxbl-modal-footer {display:none!important;}
@media(max-width:600px) {.nl-browser-design-tabs {flex-wrap:wrap;}.nl-browser-design-tabs button {padding:7px 10px;}}

.nl-browser-design .nl-browser-column-list {height:220px;}
.nl-browser-design .nl-browser-columns > p {font-size:.85rem;padding:.5rem;margin-bottom:.5rem;}

.nl-copy-audio > button {padding:6px 16px;border:1px solid #8e99a5;border-radius:3px;}
.nl-copy-audio [role=alert] {color:#a11717;margin:.5rem 0;}
.nl-copy-audio .nl-audio-preview {margin-top:10px;display:flex;align-items:center;flex-wrap:wrap;gap:10px;}

.nl-daily-quantities{display:grid;grid-template-columns:repeat(7,minmax(45px,1fr)) minmax(65px,1.2fr);gap:6px;overflow-x:auto}.nl-daily-quantities label{display:flex;flex-direction:column;font-size:.85rem}.nl-daily-quantities input{width:100%;min-width:0;padding:6px;border:1px solid #999;border-radius:3px}.nl-daily-error{color:#a4262c}.nl-demand-table{max-height:55vh;overflow:auto}.nl-demand-table table{width:100%;border-collapse:collapse}.nl-demand-table th,.nl-demand-table td{padding:5px 10px;border-bottom:1px solid #ddd;text-align:right}.nl-demand-table th:first-child,.nl-demand-table td:first-child,.nl-demand-table th:nth-child(2),.nl-demand-table td:nth-child(2){text-align:left}.nl-demand-table th{position:sticky;top:0;background:#f2f5f8}

.nl-daily-quantities output{padding:6px;background:#f4f4f4;border:1px solid #ddd;border-radius:3px;min-height:33px}

.nl-commercial-input { display:flex; align-items:flex-end; gap:1rem; margin:1rem 0; }
.nl-commercial-input label { display:flex; flex-direction:column; gap:.35rem; }
.nl-commercial-input input { padding:.5rem; max-width:18rem; border:1px solid #adb5bd; border-radius:4px; }
.nl-commercial-table { width:100%; border-collapse:collapse; }
.nl-commercial-table th,.nl-commercial-table td { padding:.45rem .7rem; border-bottom:1px solid #ddd; }
.nl-commercial-table th { text-align:left; }
.nl-commercial-table td,.nl-commercial-table thead th:last-child { text-align:right; }
.nl-commercial-table thead { background:#eef3f6; }
.nl-order-demand table { margin-bottom:1rem; }
.nl-order-demand summary { cursor:pointer; padding:.6rem 0; font-weight:600; }
.nl-order-demand nav { display:flex; align-items:center; gap:1rem; margin:.5rem 0; }
.nl-order-demand .nl-demand-table td:nth-child(3),.nl-order-demand .nl-demand-table th:nth-child(3) { text-align:left; }

.nl-adjustment-entry { width:100%; }
.nl-adjustment-entry input { width:100%; min-width:0; padding:.4rem; border:1px solid #aaa; border-radius:4px; }
.nl-adjustment-entry p { margin:.3rem 0 0; }

.nl-placement-controls { display: flex; flex-wrap: wrap; align-items: end; gap: 1rem; margin: 1rem 0; }
.nl-placement-controls label { display: grid; gap: .35rem; font-weight: 600; }
.nl-placement-controls label.nl-placement-filler { display:flex; align-items:center; gap:.5rem; padding:.5rem 0; }
.nl-placement-controls .nl-placement-filler input { margin:0; padding:0; }
.nl-placement-controls select, .nl-placement-controls input { font: inherit; font-weight: 400; padding: .4rem .55rem; border: 1px solid #aab6c2; border-radius: 4px; max-width: 100%; }
.nl-placement-preview button { font: inherit; padding: .45rem .8rem; border: 1px solid #226da5; border-radius: 4px; color: #fff; background: #226da5; cursor: pointer; }
.nl-placement-preview button:disabled { opacity: .5; cursor: default; }
.nl-placement-preview h3 { margin: 1rem 0 .5rem; }
.nl-placement-bumps th:last-child, .nl-placement-bumps td:last-child { text-align: left; width: 48%; white-space: normal; }
.nl-station-placement summary { cursor: pointer; padding: .4rem 0; font-weight: 600; }
.nl-station-placement .nl-placement-results { min-width: 54rem; }
.nl-station-placement .nl-placement-bumps { min-width: 56rem; }
.nl-station-placement .nl-station-orders { min-width: 36rem; }
.nl-station-placement td, .nl-station-placement th { white-space: nowrap; }
.nl-station-placement .nl-placement-results td:nth-child(3), .nl-station-placement .nl-placement-results td:nth-child(6), .nl-station-placement .nl-placement-bumps td:nth-child(4) { text-align: left; white-space: normal; min-width: 12rem; }
.nl-station-placement .nl-station-orders td:first-child { text-align: left; }
.nl-station-placement [role=region]:focus-visible { outline: 2px solid #226da5; outline-offset: 2px; }


/* Keep copy advisories readable inside the same bounded preview table. */
.nl-placement-results { table-layout:fixed; }
.nl-placement-results th:last-child,.nl-placement-results td:last-child { text-align:left; white-space:normal; width:31%; overflow-wrap:anywhere; }
.nl-placement-results td:last-child ul { margin:0; padding-left:1.1rem; }
.nl-station-placement .nl-placement-results td:nth-child(3),.nl-station-placement .nl-placement-results td:nth-child(6) { min-width:0; overflow-wrap:anywhere; }
.nl-station-placement .nl-placement-results th:nth-child(1) { width:6%; }
.nl-station-placement .nl-placement-results th:nth-child(2) { width:9%; }
.nl-station-placement .nl-placement-results th:nth-child(3) { width:15%; }
.nl-station-placement .nl-placement-results th:nth-child(4) { width:5%; }
.nl-station-placement .nl-placement-results th:nth-child(5) { width:7%; }
.nl-station-placement .nl-placement-results th:nth-child(6) { width:18%; }
.nl-station-placement .nl-placement-results th:nth-child(7) { width:9%; }

.nl-agency-account-update {max-width:1000px;}
.nl-agency-fields {display:grid;grid-template-columns:repeat(2,minmax(230px,1fr));gap:7px 18px;margin-bottom:12px;}
.nl-agency-account-update fieldset {padding:12px;border:1px solid #b5bbc2;margin-bottom:14px;}
.nl-agency-account-update button {margin-right:8px;}
.nl-agency-blank-policy {display:block;margin:12px 0;}
.nl-agency-preview {max-height:360px;overflow:auto;}
.nl-agency-preview table {border-collapse:collapse;width:100%;}
.nl-agency-preview th,.nl-agency-preview td {border:1px solid #b5bbc2;padding:6px;vertical-align:top;overflow-wrap:anywhere;}
.nl-agency-preview th {position:sticky;top:0;background:var(--bs-body-bg,#fff);}
@media(max-width:600px){.nl-agency-fields {grid-template-columns:1fr;}}

section[aria-label="Saved generation history"] tr[aria-current="true"]:focus { outline: 2px solid #226da5; outline-offset: -2px; }
