:root {
    color-scheme: light;
    --theme-dark: #1e293b;
    --theme-dark-light: #334155;
    --theme-dark-lighter: #475569;
    --theme-contrast: #ffffff;
    --canvas-bg: #e8edf3;
    --panel-bg: rgba(255, 255, 255, 0.98);
    --panel-border: #d8e1ea;
    --text-color: #1f2933;
    --muted-text: #66788a;
    --grid-line: rgba(31, 41, 55, 0.10);
    --active-row-bg: #edf4fb;
    --confirmed-row-bg: #f0fdf4;
    --page: var(--canvas-bg);
    --ink: var(--text-color);
    --muted: var(--muted-text);
    --line: var(--panel-border);
    --panel: var(--panel-bg);
    --panel-soft: var(--active-row-bg);
    --steel: var(--theme-dark);
    --safety: var(--theme-dark-light);
    --safety-rgb: 51, 65, 85;
    --forest: #2f6f4e;
    --clay: #b94a5b;
    --danger: #b94a5b;
    --danger-rgb: 185, 74, 91;
    --charcoal: var(--theme-dark);
    --hero: var(--theme-dark);
    --hero-rgb: 30, 41, 59;
    --button: var(--theme-dark-light);
    --card-accent: var(--theme-dark-light);
    --shadow: 0 18px 45px rgba(31, 42, 37, 0.11);
    --radius: 8px;
    font-family: "Segoe UI", Roboto, Arial, sans-serif;
}

body.theme-ExactTake,
body.theme-Default {
    --theme-dark: #1e293b;
    --theme-dark-light: #334155;
    --theme-dark-lighter: #475569;
    --theme-contrast: #ffffff;
    --canvas-bg: #e8edf3;
    --panel-bg: rgba(255, 255, 255, 0.98);
    --panel-border: #d8e1ea;
    --text-color: #1f2933;
    --muted-text: #66788a;
    --grid-line: rgba(31, 41, 55, 0.10);
    --active-row-bg: #edf4fb;
    --confirmed-row-bg: #f0fdf4;
    --hero-rgb: 30, 41, 59;
    --safety-rgb: 51, 65, 85;
}

body.theme-Sunrise {
    --theme-dark: #9a5a31;
    --theme-dark-light: #b97447;
    --theme-dark-lighter: #c9895a;
    --theme-contrast: #ffffff;
    --canvas-bg: #f7efe7;
    --panel-bg: rgba(255, 253, 251, 0.98);
    --panel-border: #e6d2c4;
    --text-color: #382516;
    --muted-text: #7a5e4a;
    --grid-line: rgba(154, 90, 49, 0.10);
    --active-row-bg: #fbeee4;
    --confirmed-row-bg: #f2fbef;
    --hero-rgb: 154, 90, 49;
    --safety-rgb: 185, 116, 71;
}

body.theme-Sunset {
    --theme-dark: #5a3b72;
    --theme-dark-light: #6f4c8b;
    --theme-dark-lighter: #8363a0;
    --theme-contrast: #ffffff;
    --canvas-bg: #f3eef8;
    --panel-bg: rgba(255, 255, 255, 0.98);
    --panel-border: #ddcee9;
    --text-color: #2f2140;
    --muted-text: #6a5a7b;
    --grid-line: rgba(90, 59, 114, 0.11);
    --active-row-bg: #efe7f7;
    --confirmed-row-bg: #eef9f0;
    --hero-rgb: 90, 59, 114;
    --safety-rgb: 111, 76, 139;
}

body.theme-Harbor {
    --theme-dark: #2f6170;
    --theme-dark-light: #3d7687;
    --theme-dark-lighter: #5290a3;
    --theme-contrast: #ffffff;
    --canvas-bg: #eaf3f5;
    --panel-bg: rgba(255, 255, 255, 0.98);
    --panel-border: #cfe0e4;
    --text-color: #1f3740;
    --muted-text: #5d7580;
    --grid-line: rgba(47, 97, 112, 0.11);
    --active-row-bg: #e8f3f6;
    --confirmed-row-bg: #edf8ee;
    --hero-rgb: 47, 97, 112;
    --safety-rgb: 61, 118, 135;
}

body.theme-Sage {
    --theme-dark: #5a6f57;
    --theme-dark-light: #6e866b;
    --theme-dark-lighter: #849b80;
    --theme-contrast: #ffffff;
    --canvas-bg: #eef3ed;
    --panel-bg: rgba(255, 255, 255, 0.98);
    --panel-border: #d6dfd4;
    --text-color: #2e3b2c;
    --muted-text: #687566;
    --grid-line: rgba(90, 111, 87, 0.11);
    --active-row-bg: #edf4eb;
    --confirmed-row-bg: #edf8ee;
    --hero-rgb: 90, 111, 87;
    --safety-rgb: 110, 134, 107;
}

body.theme-Appletini {
    --theme-dark: #9fc236;
    --theme-dark-light: #b7d529;
    --theme-dark-lighter: #c8df70;
    --theme-contrast: #ffffff;
    --canvas-bg: #edf7dc;
    --panel-bg: rgba(255, 255, 250, 0.98);
    --panel-border: #cadf9d;
    --text-color: #263719;
    --muted-text: #66734f;
    --grid-line: rgba(79, 118, 0, 0.13);
    --active-row-bg: #e7f3cf;
    --confirmed-row-bg: #f0fbef;
    --hero-rgb: 159, 194, 54;
    --safety-rgb: 183, 213, 41;
}

body.theme-Caribbean {
    --theme-dark: #4768bf;
    --theme-dark-light: #6f8ad0;
    --theme-dark-lighter: #9fd7f2;
    --theme-contrast: #ffffff;
    --canvas-bg: #e8f1fb;
    --panel-bg: rgba(250, 253, 255, 0.98);
    --panel-border: #bfd4ef;
    --text-color: #15233c;
    --muted-text: #5a6f8c;
    --grid-line: rgba(0, 47, 141, 0.12);
    --active-row-bg: #e0edfb;
    --confirmed-row-bg: #edf8ee;
    --hero-rgb: 71, 104, 191;
    --safety-rgb: 111, 138, 208;
}

body.theme-Nautilus {
    --theme-dark: #456287;
    --theme-dark-light: #5f7ea2;
    --theme-dark-lighter: #f36f21;
    --theme-contrast: #ffffff;
    --canvas-bg: #e9f1f7;
    --panel-bg: rgba(250, 253, 255, 0.98);
    --panel-border: #c0d4e5;
    --text-color: #1c2d3e;
    --muted-text: #617688;
    --grid-line: rgba(34, 62, 110, 0.12);
    --active-row-bg: #e2edf6;
    --confirmed-row-bg: #edf8ee;
    --hero-rgb: 69, 98, 135;
    --safety-rgb: 95, 126, 162;
}

body.theme-ElectricBlue {
    --theme-dark: #052684;
    --theme-dark-light: #1c3e74;
    --theme-dark-lighter: #2f69b3;
    --theme-contrast: #ffffff;
    --canvas-bg: #e9f6fd;
    --panel-bg: rgba(250, 253, 255, 0.98);
    --panel-border: #b7ddf2;
    --text-color: #152438;
    --muted-text: #5a7390;
    --grid-line: rgba(28, 62, 116, 0.12);
    --active-row-bg: #e0f1fb;
    --confirmed-row-bg: #edf8ee;
    --hero-rgb: 5, 38, 132;
    --safety-rgb: 28, 62, 116;
}

body.theme-Harvest {
    --theme-dark: #bd6307;
    --theme-dark-light: #d58218;
    --theme-dark-lighter: #b18e65;
    --theme-contrast: #ffffff;
    --canvas-bg: #fff5e8;
    --panel-bg: rgba(255, 253, 249, 0.98);
    --panel-border: #e7cba9;
    --text-color: #352414;
    --muted-text: #7a5f43;
    --grid-line: rgba(151, 70, 44, 0.12);
    --active-row-bg: #faead8;
    --confirmed-row-bg: #f0f8ed;
    --hero-rgb: 189, 99, 7;
    --safety-rgb: 213, 130, 24;
}

body.theme-LucidDream {
    --theme-dark: #86bfe5;
    --theme-dark-light: #a9d3ef;
    --theme-dark-lighter: #c8e3f5;
    --theme-contrast: #ffffff;
    --canvas-bg: #eef8ff;
    --panel-bg: rgba(252, 254, 255, 0.98);
    --panel-border: #c8e2f2;
    --text-color: #1f3445;
    --muted-text: #5f7890;
    --grid-line: rgba(105, 155, 201, 0.13);
    --active-row-bg: #e6f4fc;
    --confirmed-row-bg: #edf8ee;
    --hero-rgb: 134, 191, 229;
    --safety-rgb: 169, 211, 239;
}

body.theme-Pear {
    --theme-dark: #4f7600;
    --theme-dark-light: #636a4c;
    --theme-dark-lighter: #9bb740;
    --theme-contrast: #ffffff;
    --canvas-bg: #f0f5df;
    --panel-bg: rgba(255, 255, 250, 0.98);
    --panel-border: #d1df9e;
    --text-color: #283415;
    --muted-text: #687253;
    --grid-line: rgba(79, 118, 0, 0.12);
    --active-row-bg: #eaf2d6;
    --confirmed-row-bg: #f0fbef;
    --hero-rgb: 79, 118, 0;
    --safety-rgb: 99, 106, 76;
}

body.theme-RedPlanet {
    --theme-dark: #9b141c;
    --theme-dark-light: #b01818;
    --theme-dark-lighter: #cf6760;
    --theme-contrast: #ffffff;
    --canvas-bg: #fbebe9;
    --panel-bg: rgba(255, 252, 252, 0.98);
    --panel-border: #e8c5c5;
    --text-color: #381516;
    --muted-text: #7d5d5d;
    --grid-line: rgba(176, 0, 0, 0.12);
    --active-row-bg: #fae5e4;
    --confirmed-row-bg: #f0f8ed;
    --hero-rgb: 155, 20, 28;
    --safety-rgb: 176, 24, 24;
}

body.theme-RubberBlack {
    --theme-dark: #000000;
    --theme-dark-light: #7d7d7d;
    --theme-dark-lighter: #a0a0a0;
    --theme-contrast: #ffffff;
    --canvas-bg: #e5e7eb;
    --panel-bg: rgba(252, 252, 252, 0.98);
    --panel-border: #c7c7c7;
    --text-color: #191919;
    --muted-text: #646464;
    --grid-line: rgba(0, 0, 0, 0.11);
    --active-row-bg: #e8edf4;
    --confirmed-row-bg: #f0f7ef;
    --hero-rgb: 0, 0, 0;
    --safety-rgb: 125, 125, 125;
}

body.theme-Trendy {
    --theme-dark: #2f9547;
    --theme-dark-light: #43a456;
    --theme-dark-lighter: #65b7f0;
    --theme-contrast: #ffffff;
    --canvas-bg: #eaf7f1;
    --panel-bg: rgba(250, 255, 252, 0.98);
    --panel-border: #bedfc9;
    --text-color: #1c3325;
    --muted-text: #5c7868;
    --grid-line: rgba(36, 162, 68, 0.12);
    --active-row-bg: #dff3e7;
    --confirmed-row-bg: #edf8ee;
    --hero-rgb: 47, 149, 71;
    --safety-rgb: 67, 164, 86;
}

body.theme-Claymation {
    --theme-dark: #6a6a6a;
    --theme-dark-light: #8a8a8a;
    --theme-dark-lighter: #a4a4a4;
    --theme-contrast: #ffffff;
    --canvas-bg: #eeeeee;
    --panel-bg: rgba(255, 255, 255, 0.98);
    --panel-border: #d3d3d3;
    --text-color: #252525;
    --muted-text: #686868;
    --grid-line: rgba(68, 68, 68, 0.10);
    --active-row-bg: #e9edf1;
    --confirmed-row-bg: #f0f7ef;
    --hero-rgb: 106, 106, 106;
    --safety-rgb: 138, 138, 138;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
    background: var(--page);
    color: var(--ink);
}

body {
    min-width: 320px;
}

.app-user-bar {
    width: min(1760px, calc(100% - 36px));
    min-height: 42px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin: 10px auto 0;
    padding: 8px 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--panel);
    box-shadow: 0 8px 20px rgba(31, 42, 37, 0.06);
}

.app-user-bar strong,
.app-user-bar span {
    display: inline-block;
}

.app-user-bar strong {
    margin-right: 8px;
}

.app-user-bar span {
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 800;
    text-transform: uppercase;
}

.app-user-links {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.app-user-links a,
.app-user-links button {
    min-height: 30px;
    min-width: 112px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 10px;
    border: 1px solid var(--line);
    border-radius: 6px;
    color: var(--theme-dark);
    background: var(--panel);
    font: inherit;
    font-size: 0.86rem;
    font-weight: 800;
    text-decoration: none;
    cursor: pointer;
}

.app-user-links a:hover,
.app-user-links button:hover {
    color: var(--theme-contrast);
    border-color: var(--theme-dark-light);
    background: var(--theme-dark-light);
}

.app-user-links form {
    margin: 0;
}

button,
canvas {
    font: inherit;
}

input[type="checkbox"] {
    width: 17px;
    height: 17px;
    min-height: 17px;
    display: inline-grid;
    place-content: center;
    flex: 0 0 17px;
    margin: 0;
    border: 1.5px solid var(--theme-dark-light);
    border-radius: 4px;
    appearance: none;
    background: var(--panel);
    cursor: pointer;
}

input[type="checkbox"]::before {
    content: "";
    width: 8px;
    height: 4px;
    border-bottom: 2px solid var(--theme-contrast);
    border-left: 2px solid var(--theme-contrast);
    opacity: 0;
    transform: rotate(-45deg) translateY(-1px) scale(0.8);
}

input[type="checkbox"]:checked {
    border-color: var(--theme-dark-light);
    background: var(--theme-dark-light);
}

input[type="checkbox"]:checked::before {
    opacity: 1;
}

input[type="checkbox"]:focus-visible {
    outline: 3px solid rgba(var(--safety-rgb), 0.28);
    outline-offset: 2px;
}

.dashboard-shell {
    width: min(1760px, 100%);
    margin: 0 auto;
    padding: 22px;
}

.command-band {
    min-height: 118px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 24px 28px;
    color: #ffffff;
    background:
        linear-gradient(90deg, rgba(var(--hero-rgb), 0.98), rgba(var(--hero-rgb), 0.88)),
        repeating-linear-gradient(135deg, rgba(var(--safety-rgb), 0.22) 0 14px, rgba(var(--safety-rgb), 0) 14px 28px);
    border-bottom: 5px solid var(--safety);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.command-band h1 {
    margin: 4px 0 0;
    font-size: clamp(2rem, 4vw, 4.6rem);
    line-height: 0.95;
    font-weight: 800;
    letter-spacing: 0;
}

.header-range {
    margin: 10px 0 0;
    color: rgba(255, 255, 255, 0.84);
    font-size: 0.96rem;
    font-weight: 800;
}

.app-version {
    margin: 8px 0 0;
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0;
}

.eyebrow {
    margin: 0;
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}

.brand-wordmark {
    text-transform: none;
}

.brand-wordmark span:last-child {
    color: #F79646;
}

.public-job-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    color: rgba(255, 255, 255, 0.88);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

.public-job-eyebrow a {
    color: inherit;
    text-decoration: none;
}

.public-job-eyebrow a:hover {
    text-decoration: underline;
}

.public-job-eyebrow a:first-child {
    text-transform: none;
}

.public-job-eyebrow a:first-child span {
    color: #F79646;
}

.command-band .eyebrow {
    color: rgba(255, 255, 255, 0.82);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

.status-strip {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 42px;
    max-width: 420px;
    padding: 8px 10px 8px 14px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.08);
    color: #f7fbfb;
    font-size: 0.92rem;
}

.command-tools {
    display: flex;
    align-items: flex-end;
    flex-direction: column;
    gap: 10px;
}

.command-tools-compact {
    gap: 8px;
}

.window-selector {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 4px;
    padding: 4px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.08);
}

.window-selector button {
    min-width: 52px;
    min-height: 38px;
    display: grid;
    align-content: center;
    gap: 1px;
    border: 0;
    border-radius: 6px;
    color: #eef4f1;
    background: transparent;
    font-weight: 800;
    cursor: pointer;
}

.window-selector button small {
    display: block;
    max-width: 130px;
    overflow: hidden;
    color: currentColor;
    font-size: 0.62rem;
    font-weight: 700;
    line-height: 1.05;
    opacity: 0.82;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.window-selector button[aria-pressed="true"] {
    color: var(--theme-contrast);
    background: var(--theme-dark-light);
    box-shadow: inset 0 -2px 0 rgba(255, 255, 255, 0.22);
}

.window-selector button:disabled {
    cursor: wait;
    opacity: 0.65;
}

.status-strip span:nth-child(2) {
    overflow-wrap: anywhere;
}

.custom-window {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 6px;
}

.custom-window input,
.preferences-body select {
    min-height: 34px;
    border: 1px solid rgba(255, 255, 255, 0.24);
    border-radius: 6px;
    color: var(--ink);
    background: #ffffff;
    font: inherit;
}

.custom-window input {
    width: 132px;
    padding: 4px 8px;
    font-size: 0.82rem;
}

.preferences-panel {
    width: min(460px, 100%);
    color: #f7fbfb;
}

.preferences-panel summary {
    min-height: 34px;
    display: inline-flex;
    align-items: center;
    padding: 0 10px;
    border: 1px solid rgba(255, 255, 255, 0.24);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.08);
    font-weight: 800;
    cursor: pointer;
}

.preferences-body {
    display: grid;
    gap: 10px;
    margin-top: 8px;
    padding: 12px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: var(--radius);
    background: rgba(20, 30, 28, 0.88);
    box-shadow: var(--shadow);
}

.preferences-body label {
    display: grid;
    gap: 5px;
    font-size: 0.78rem;
    font-weight: 800;
}

.preference-label {
    display: block;
    margin-bottom: 6px;
    color: #f7fbfb;
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
}

.preference-card-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
}

.preference-card-grid label {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #f7fbfb;
    text-transform: none;
}

.preference-card-grid input {
    flex: 0 0 auto;
}

.preference-status {
    min-height: 18px;
    color: #f7fbfb;
    font-size: 0.78rem;
    font-weight: 800;
}

.preference-status[data-mode="error"] {
    color: #ffb5b5;
}

.preference-status[data-mode="saved"] {
    color: #7ff0aa;
}

.status-dot {
    width: 10px;
    height: 10px;
    flex: 0 0 10px;
    border-radius: 50%;
    background: var(--safety);
}

.status-dot[data-mode="live"] {
    background: #57d48a;
}

.status-dot[data-mode="error"] {
    background: var(--danger);
}

.icon-button {
    width: 36px;
    height: 36px;
    display: inline-grid;
    place-items: center;
    flex: 0 0 36px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 6px;
    color: var(--theme-contrast);
    background: rgba(var(--safety-rgb), 0.42);
    cursor: pointer;
}

.icon-button:hover {
    background: var(--theme-dark-light);
}

.button-icon {
    width: 20px;
    height: 20px;
    display: block;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2;
}

.icon-button:disabled {
    cursor: wait;
    opacity: 0.65;
}

.settings-modal[hidden] {
    display: none;
}

.settings-modal {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: grid;
    place-items: center;
    padding: 18px;
}

.settings-backdrop {
    position: absolute;
    inset: 0;
    border: 0;
    background: rgba(12, 22, 25, 0.48);
}

.settings-panel {
    position: relative;
    width: min(860px, 100%);
    max-height: min(760px, calc(100vh - 36px));
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--panel);
    box-shadow: var(--shadow);
}

.settings-panel .preference-label,
.settings-panel .preference-card-grid label,
.settings-panel .preference-status {
    color: var(--ink);
}

.settings-panel .preference-card-grid label {
    font-size: 0.86rem;
}

.settings-panel .text-button {
    color: #ffffff;
    border-color: var(--steel);
    background: var(--steel);
}

.settings-panel .text-button:disabled {
    opacity: 0.65;
}

.panel-action-button,
.inline-action {
    min-height: 30px;
    padding: 5px 10px;
    border: 1px solid var(--steel);
    border-radius: 6px;
    color: var(--steel);
    background: #ffffff;
    font: inherit;
    font-size: 0.78rem;
    font-weight: 800;
    cursor: pointer;
}

.panel-action-button:hover,
.inline-action:hover {
    color: #ffffff;
    background: var(--steel);
}

.settings-panel .preference-status[data-mode="error"] {
    color: var(--danger);
}

.settings-panel .preference-status[data-mode="saved"] {
    color: var(--forest);
}

.settings-head,
.settings-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--line);
}

.settings-head {
    color: var(--theme-contrast);
    background:
        linear-gradient(135deg, rgba(var(--hero-rgb), 0.96), rgba(var(--safety-rgb), 0.88));
}

.settings-head .eyebrow,
.settings-head h2 {
    color: var(--theme-contrast);
}

.settings-head h2 {
    margin: 0;
    font-size: 1.3rem;
}

.settings-head .icon-button {
    color: var(--theme-contrast);
    border-color: rgba(255, 255, 255, 0.28);
    background: rgba(255, 255, 255, 0.12);
}

.excel-head-title {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 24px;
    min-height: 72px;
    width: 100%;
}

.excel-head-title img {
    width: 340px;
    max-height: 68px;
    height: auto;
    display: block;
    object-fit: contain;
    object-position: left center;
}

.excel-brand-word {
    color: var(--steel);
    font-size: clamp(2.6rem, 5vw, 4.1rem);
    font-weight: 900;
    letter-spacing: 0;
    line-height: 0.95;
    white-space: nowrap;
}

.excel-brand-word span {
    color: #f79646;
}

.excel-widget-list {
    align-items: start;
}

.excel-runtime-note {
    margin-top: -8px;
}

.excel-option-row {
    margin-top: 8px;
}

.gantt-export-panel {
    width: min(1120px, 100%);
}

.gantt-export-body {
    min-height: min(610px, calc(100vh - 190px));
}

.gantt-format-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.gantt-format-options label {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    padding: 11px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: #ffffff;
    cursor: pointer;
}

.gantt-format-options label:has(input:checked) {
    border-color: var(--steel);
    box-shadow: inset 4px 0 0 var(--steel);
    background: var(--panel-soft);
}

.gantt-format-options span,
.gantt-format-options strong,
.gantt-format-options small {
    display: block;
}

.gantt-format-options small {
    margin-top: 3px;
    color: var(--muted);
}

.gantt-export-selection-grid {
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(250px, 0.8fr) minmax(420px, 1.6fr);
    gap: 14px;
}

.gantt-export-jobs,
.gantt-export-tasks {
    min-height: 0;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: #fbfcfc;
}

.gantt-export-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.gantt-export-list,
.gantt-export-task-list {
    max-height: 390px;
    display: grid;
    align-content: start;
    gap: 7px;
    overflow: auto;
}

.gantt-export-list label,
.gantt-export-task-option {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: start;
    gap: 8px;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #ffffff;
}

.gantt-export-list strong,
.gantt-export-list small,
.gantt-export-task-option strong,
.gantt-export-task-option small {
    display: block;
}

.gantt-export-list small,
.gantt-export-task-option small {
    margin-top: 2px;
    color: var(--muted);
}

.gantt-export-task-group {
    display: grid;
    gap: 6px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--line);
}

.gantt-export-task-group:last-child {
    border-bottom: 0;
}

.gantt-export-task-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.gantt-export-date-controls {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) repeat(2, minmax(125px, 0.55fr));
    gap: 7px;
}

.gantt-export-date-controls select,
.gantt-export-date-controls input {
    min-height: 34px;
    width: 100%;
    padding: 6px 8px;
    border: 1px solid var(--line);
    border-radius: 6px;
    color: var(--ink);
    background: #ffffff;
    font: inherit;
    font-size: 0.78rem;
}

.settings-body {
    display: grid;
    gap: 14px;
    padding: 16px;
    overflow: auto;
}

.settings-section {
    display: grid;
    gap: 8px;
}

.settings-section select {
    min-height: 38px;
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #ffffff;
    font: inherit;
}

.password-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 10px;
}

.password-grid input {
    min-height: 34px;
    width: 100%;
    padding: 7px 9px;
    border: 1px solid var(--line);
    border-radius: 6px;
    color: var(--ink);
    background: rgba(255, 255, 255, 0.88);
    font: inherit;
}

.settings-window-selector {
    border-color: rgba(var(--safety-rgb), 0.26);
    background: rgba(var(--safety-rgb), 0.10);
}

.settings-window-selector button {
    color: var(--ink);
    border: 1px solid transparent;
}

.settings-window-selector button[aria-pressed="true"] {
    color: var(--theme-contrast);
    border-color: var(--theme-dark);
    background: var(--theme-dark-light);
}

.settings-window-selector button[aria-pressed="true"] small {
    opacity: 0.94;
}

.settings-actions {
    border-top: 1px solid var(--line);
    border-bottom: 0;
}

.drag-handle {
    width: 24px;
    height: 24px;
    display: inline-block;
    position: absolute;
    top: 8px;
    left: 8px;
    opacity: 0.68;
    cursor: grab;
    color: var(--muted);
    touch-action: none;
    z-index: 3;
}

.drag-handle::before {
    content: "";
    display: block;
    width: 14px;
    height: 10px;
    margin: 4px 0 0 2px;
    border-top: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    box-shadow: 0 4px 0 currentColor;
}

.drag-handle:hover {
    opacity: 0.95;
    color: var(--theme-dark);
}

.drag-handle:active {
    cursor: grabbing;
}

.metric-card,
.panel {
    position: relative;
}

.metric-card .drag-handle + .metric-label,
.panel > .drag-handle + .panel-heading {
    margin-left: 12px;
}

.is-dragging {
    opacity: 0.72;
    outline: 2px dashed var(--safety);
    transform: scale(0.985);
}

.dashboard-layout-grid.is-drop-zone {
    outline: 2px dashed var(--safety);
    outline-offset: 7px;
}

.dashboard-layout-grid .is-drop-target:not(.is-dragging) {
    outline: 3px solid var(--safety);
    outline-offset: 3px;
}

body.is-sorting {
    user-select: none;
}

body.is-sorting canvas,
body.is-sorting a,
body.is-sorting button,
body.is-sorting input,
body.is-sorting select {
    pointer-events: none;
}

body.is-sorting .drag-handle {
    pointer-events: auto;
}

.text-button {
    min-height: 34px;
    display: inline-flex;
    align-items: center;
    padding: 0 12px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 6px;
    color: var(--theme-contrast);
    text-decoration: none;
    font-weight: 800;
    background: rgba(var(--safety-rgb), 0.36);
}

.command-band .text-button {
    min-width: 112px;
    justify-content: center;
    border-color: rgba(255, 255, 255, 0.24);
    background: rgba(var(--safety-rgb), 0.48);
}

.text-button:hover,
.command-band .text-button:hover {
    background: var(--theme-dark-light);
}

.metric-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin: 18px 0;
}

.map-shell {
    --map-height: clamp(560px, calc(100vh - 280px), 820px);
    width: min(1800px, calc(100% - 24px));
    margin: 16px auto 28px;
}

.map-command {
    margin-bottom: 16px;
}

.map-metrics {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 16px;
}

.map-status-text {
    color: #eef4f1;
    font-size: 0.9rem;
    font-weight: 800;
}

.jobs-map-layout {
    display: grid;
    grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
    align-items: start;
    gap: 16px;
    min-height: 0;
}

.map-sidebar,
.map-panel,
.weather-panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: 0 10px 25px rgba(31, 42, 37, 0.07);
}

.map-sidebar {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    height: var(--map-height);
    overflow: hidden;
}

.map-filter {
    display: grid;
    gap: 10px;
    padding: 14px;
    border-bottom: 1px solid var(--line);
}

.map-filter input[type="search"] {
    width: 100%;
    min-height: 38px;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: 6px;
    font: inherit;
}

.map-filter label {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    font-size: 0.88rem;
    font-weight: 700;
}

.map-list {
    overflow: auto;
}

.map-list-item {
    width: 100%;
    display: grid;
    gap: 4px;
    padding: 12px 14px;
    border: 0;
    border-bottom: 1px solid var(--line);
    color: var(--ink);
    text-align: left;
    background: transparent;
    cursor: pointer;
}

.map-list-item:hover,
.map-list-item:focus {
    background: #f5f8f7;
    outline: none;
}

.map-list-item strong {
    line-height: 1.2;
}

.map-list-title {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.map-weather-icon {
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #eaf6fb;
}

.map-weather-icon svg {
    width: 23px;
    height: 23px;
    display: block;
}

.map-weather-icon .weather-cloud {
    fill: #dfeaf1;
    stroke: #1f6685;
    stroke-width: 2.1;
    stroke-linejoin: round;
}

.map-weather-icon .weather-rain {
    fill: none;
    stroke: #2e9ec8;
    stroke-width: 3.2;
    stroke-linecap: round;
}

.map-weather-icon .weather-bolt {
    fill: #f6b938;
    stroke: #c88400;
    stroke-width: 1.4;
    stroke-linejoin: round;
}

.map-list-item span {
    color: var(--muted);
    font-size: 0.78rem;
}

.map-list-item[data-risk="true"] {
    border-left: 4px solid #2e9ec8;
}

.map-panel {
    display: grid;
    grid-template-rows: var(--map-height) auto;
    align-self: start;
    overflow: hidden;
}

.jobs-map {
    height: var(--map-height);
    min-height: var(--map-height);
    z-index: 1;
}

.public-job-shell {
    width: min(1760px, calc(100% - 24px));
    margin: 16px auto 28px;
}

.public-job-command {
    margin-bottom: 16px;
}

.public-job-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(340px, 0.85fr);
    gap: 16px;
    align-items: stretch;
}

.public-job-map,
.public-job-weather {
    min-height: calc(100vh - 260px);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--panel);
    box-shadow: 0 10px 25px rgba(31, 42, 37, 0.07);
}

.public-job-map {
    z-index: 1;
}

.public-job-weather {
    display: grid;
    align-content: start;
    gap: 10px;
    padding: 16px;
    overflow: auto;
}

.public-job-weather h2 {
    margin: 0;
    font-size: 1.35rem;
}

.public-forecast-grid {
    display: grid;
    gap: 10px;
    margin-top: 6px;
}

.public-forecast-card {
    display: grid;
    gap: 8px;
    padding: 10px;
    border: 1px solid var(--line);
    border-left: 5px solid var(--theme-dark-light);
    border-radius: var(--radius);
    background: #fbfcfc;
}

.public-forecast-card[data-rain="true"] {
    border-left-color: var(--safety);
    background: var(--panel-soft);
}

.public-forecast-card div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.public-forecast-card strong {
    color: var(--ink);
}

.public-forecast-card em {
    color: var(--theme-dark);
    font-size: 0.8rem;
    font-style: normal;
    font-weight: 900;
    white-space: nowrap;
}

.public-forecast-card p {
    margin: 0;
    color: var(--muted);
    font-size: 0.86rem;
    line-height: 1.3;
}

.jobs-map .leaflet-control-attribution {
    font-size: 9px;
    opacity: 0.72;
}

.weather-panel {
    display: grid;
    align-content: start;
    gap: 8px;
    padding: 14px;
    border-width: 1px 0 0;
    border-radius: 0;
    box-shadow: none;
}

.weather-panel h2 {
    margin: 0;
    font-size: 1.1rem;
}

.weather-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(110px, 1fr));
    gap: 8px;
    overflow-x: auto;
}

.weather-card {
    min-width: 110px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #fbfcfc;
}

.weather-card[data-rain="true"] {
    border-color: rgba(37, 105, 133, 0.55);
    background: #eef6f8;
}

.weather-card strong,
.weather-card span {
    display: block;
}

.weather-card span {
    color: var(--muted);
    font-size: 0.78rem;
}

.weather-work-timeline {
    display: grid;
    grid-template-columns: repeat(2, minmax(280px, 1fr));
    align-items: start;
    grid-auto-rows: max-content;
    gap: 10px;
}

.timeline-day-card {
    display: grid;
    align-self: start;
    gap: 10px;
    align-content: start;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #ffffff;
}

.timeline-day-card[data-rain="true"] {
    border-color: rgba(37, 105, 133, 0.5);
    background: #f7fbfc;
}

.timeline-day-card[data-has-work="true"] {
    box-shadow: inset 3px 0 0 var(--forest);
}

.timeline-date-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
}

.timeline-date-head strong {
    font-size: 1.02rem;
}

.timeline-date-head span {
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 700;
}

.timeline-forecast-list {
    display: grid;
    gap: 6px;
}

.weather-period {
    display: grid;
    grid-template-columns: minmax(100px, 0.8fr) minmax(0, 1.2fr);
    gap: 8px;
    align-items: start;
    padding: 7px 8px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #fbfcfc;
}

.weather-period[data-rain="true"] {
    border-color: rgba(37, 105, 133, 0.45);
    background: #eef6f8;
}

.weather-period-muted {
    display: block;
    color: var(--muted);
    font-size: 0.82rem;
}

.weather-period strong,
.weather-period span {
    display: block;
    font-size: 0.78rem;
    line-height: 1.25;
}

.weather-period span {
    color: var(--muted);
}

.timeline-work-empty {
    color: var(--muted);
    font-size: 0.78rem;
}

.no-work-summary {
    padding: 8px 10px;
    border-left: 3px solid var(--safety);
    background: rgba(var(--safety-rgb), 0.1);
    color: var(--muted);
    font-size: 0.84rem;
}

.compact-forecast-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: 6px;
}

.compact-forecast-row {
    display: grid;
    grid-template-columns: 82px minmax(0, 1fr) minmax(64px, auto);
    gap: 8px;
    align-items: start;
    padding: 7px 8px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #fbfcfc;
}

.compact-forecast-row[data-rain="true"] {
    border-color: rgba(37, 105, 133, 0.45);
    background: #eef6f8;
}

.compact-forecast-row strong,
.compact-forecast-row span,
.compact-forecast-row em {
    font-size: 0.78rem;
    line-height: 1.25;
}

.compact-forecast-row span {
    color: var(--muted);
}

.compact-forecast-row em {
    color: var(--ink);
    font-style: normal;
    font-weight: 800;
    text-align: right;
}

.work-window-list {
    display: grid;
    gap: 7px;
}

.work-window-row {
    display: grid;
    grid-template-columns: 136px minmax(0, 1fr) minmax(70px, auto);
    gap: 8px;
    align-items: start;
    padding-top: 7px;
    border-top: 1px solid var(--line);
}

.work-window-row strong,
.work-window-row span,
.work-window-row em {
    font-size: 0.78rem;
    line-height: 1.35;
}

.work-window-row span {
    color: var(--muted);
}

.work-window-row em {
    color: var(--ink);
    font-style: normal;
    font-weight: 800;
    text-align: right;
}

.job-location-line {
    color: var(--muted);
    line-height: 1.45;
}

.field-activity-panel {
    margin: 2px 0 4px;
    color: var(--muted);
    font-size: 0.86rem;
}

.field-activity-panel p {
    margin: 0;
}

.field-activity-panel strong {
    color: var(--ink);
}

.activity-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
}

.activity-summary span {
    min-height: 58px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #fbfcfc;
    color: var(--muted);
    font-size: 0.78rem;
}

.activity-summary strong {
    display: block;
    color: var(--ink);
    font-size: 1.25rem;
}

.activity-days {
    display: grid;
    gap: 10px;
}

.activity-day {
    display: grid;
    gap: 8px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #ffffff;
}

.activity-day-head {
    display: flex;
    justify-content: space-between;
    gap: 10px;
}

.activity-day-head span,
.activity-time-row span,
.activity-time-row small {
    display: block;
    color: var(--muted);
    font-size: 0.78rem;
}

.activity-hours {
    flex: 0 0 auto;
    color: var(--ink);
    font-size: 0.82rem;
    font-weight: 800;
    text-align: right;
}

.forecast-align {
    padding: 8px 10px;
    border-left: 3px solid var(--steel);
    background: #eef6f8;
    color: var(--muted);
    font-size: 0.8rem;
    line-height: 1.35;
}

.task-chip-row,
.activity-time-row small {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.task-chip {
    display: inline-flex;
    align-items: center;
    min-height: 22px;
    padding: 3px 7px;
    border-radius: 999px;
    background: var(--panel-soft);
    color: var(--ink);
    font-size: 0.72rem;
    font-weight: 700;
}

.task-chip.muted {
    color: var(--muted);
}

.activity-time-list {
    display: grid;
    gap: 7px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.activity-time-row {
    display: grid;
    grid-template-columns: minmax(150px, 1.2fr) minmax(110px, 0.8fr) minmax(100px, 0.8fr) minmax(130px, 1fr);
    gap: 8px;
    padding: 8px 0;
    border-top: 1px solid var(--line);
}

.job-map-marker {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    color: #ffffff;
    background: var(--steel);
    box-shadow: 0 4px 12px rgba(31, 42, 37, 0.28);
    font-size: 15px;
    font-weight: 900;
}

.job-map-marker.marker-active {
    background: var(--forest);
}

.job-map-marker.marker-closed {
    background: var(--danger);
}

.job-map-marker.marker-rain {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #256985;
}

.rain-cloud-mark {
    position: relative;
    width: 20px;
    height: 9px;
    margin-top: 1px;
    border-radius: 10px;
    background: #ffffff;
}

.rain-cloud-mark::before {
    position: absolute;
    top: -6px;
    left: 3px;
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: #ffffff;
    box-shadow: 8px 2px 0 #ffffff;
    content: "";
}

.rain-cloud-mark::after {
    position: absolute;
    top: 11px;
    left: 4px;
    width: 3px;
    height: 7px;
    border-radius: 3px;
    background: #bdeaf6;
    box-shadow: 6px -1px 0 #bdeaf6, 12px 0 0 #bdeaf6;
    content: "";
}

.job-popup {
    display: grid;
    gap: 4px;
    min-width: 240px;
}

.job-popup strong {
    font-size: 1rem;
}

.job-popup span {
    color: var(--muted);
}

.job-popup .risk-text {
    color: var(--danger);
    font-weight: 800;
}

.metric-card,
.panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: 0 10px 25px rgba(31, 42, 37, 0.07);
}

.metric-card {
    min-height: 138px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 16px;
    border-top: 5px solid var(--steel);
}

.metric-card-clickable {
    cursor: pointer;
}

.metric-card-clickable:hover,
.metric-card-clickable:focus {
    transform: translateY(-1px);
    border-color: rgba(37, 105, 133, 0.45);
    box-shadow: 0 12px 28px rgba(31, 42, 37, 0.12);
    outline: none;
}

.metric-card.tone-good {
    border-top-color: var(--forest);
}

.metric-card.tone-warn {
    border-top-color: var(--safety);
}

.metric-card.tone-risk {
    border-top-color: var(--clay);
}

.metric-label {
    color: var(--muted);
    font-size: 0.8rem;
    font-weight: 800;
    text-transform: uppercase;
}

.manual-help-link {
    width: 18px;
    height: 18px;
    display: inline-grid;
    place-items: center;
    margin-left: 6px;
    border: 1px solid var(--line);
    border-radius: 50%;
    color: var(--theme-contrast);
    background: var(--theme-dark-light);
    font-size: 0.7rem;
    font-weight: 900;
    line-height: 1;
    text-decoration: none;
    vertical-align: middle;
}

.manual-help-link:hover,
.manual-help-link:focus {
    color: var(--theme-contrast);
    background: var(--theme-dark);
    outline: none;
}

.metric-value {
    margin: 10px 0 8px;
    color: var(--ink);
    font-size: clamp(1.45rem, 2.5vw, 2.35rem);
    line-height: 1;
    letter-spacing: 0;
}

.metric-value-hidden {
    color: var(--muted);
    font-size: 1.35rem;
}

.metric-note {
    color: var(--muted);
    font-size: 0.86rem;
    line-height: 1.35;
}

.dashboard-grid,
.table-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.table-grid {
    margin-top: 14px;
}

.panel {
    min-width: 0;
    padding: 16px;
}

.panel-wide {
    grid-column: span 2;
}

.office-rollup-panel {
    grid-column: 1 / -1;
}

.period-task-panel {
    grid-column: 1 / -1;
}

.job-cost-panel {
    grid-column: 1 / -1;
}

.job-cost-heading {
    align-items: end;
}

.job-cost-heading .chart-note {
    margin-top: 5px;
}

.job-cost-filters {
    display: grid;
    grid-template-columns: minmax(150px, 0.75fr) minmax(120px, 0.55fr) minmax(280px, 1.35fr);
    gap: 10px;
    align-items: end;
    width: min(760px, 62vw);
}

.job-cost-picker-label {
    display: grid;
    gap: 5px;
    min-width: min(360px, 42vw);
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 900;
    text-transform: uppercase;
}

.job-cost-filters .job-cost-picker-label {
    min-width: 0;
}

.job-cost-performance-summary {
    display: grid;
    grid-template-columns: repeat(5, minmax(130px, 1fr));
    gap: 8px;
    margin-bottom: 12px;
}

.job-cost-performance-summary > div {
    display: grid;
    gap: 3px;
    min-width: 0;
    padding: 9px 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: color-mix(in srgb, var(--panel) 86%, var(--theme-light) 14%);
}

.job-cost-performance-summary span {
    color: var(--muted);
    font-size: 0.66rem;
    font-weight: 900;
    letter-spacing: 0.035em;
    text-transform: uppercase;
}

.job-cost-performance-summary strong {
    overflow: hidden;
    color: var(--ink);
    font-size: 0.84rem;
    font-variant-numeric: tabular-nums;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.job-cost-performance-summary strong.negative {
    color: var(--danger, #a52b2b);
}

.job-cost-picker-label select {
    width: 100%;
    min-height: 38px;
    padding: 8px 34px 8px 10px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: var(--panel);
    color: var(--ink);
    font: inherit;
    font-size: 0.86rem;
    text-transform: none;
}

.job-cost-job-picker {
    display: grid;
    gap: 5px;
}

.job-cost-job-picker input[type="search"] {
    width: 100%;
    min-height: 38px;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: 7px;
    outline: none;
    background: var(--panel);
    color: var(--ink);
    font: inherit;
    font-size: 0.86rem;
    text-transform: none;
}

.job-cost-job-picker input[type="search"]:focus {
    border-color: var(--theme-dark-light);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--theme-dark-light) 18%, transparent);
}

.job-cost-job-picker small {
    min-height: 1em;
    color: var(--muted);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: none;
}

.job-cost-layout {
    display: grid;
    grid-template-columns: minmax(270px, 0.95fr) minmax(250px, 0.8fr) minmax(440px, 1.45fr);
    gap: 12px;
    align-items: stretch;
}

.job-cost-card,
.job-cost-gauge-card,
.job-cost-profit-chart-card {
    min-width: 0;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--panel-soft);
    overflow: hidden;
}

.job-cost-card h3,
.job-cost-gauge-card h3,
.job-cost-profit-chart-card h3 {
    margin: 0;
    padding: 10px 12px;
    border-bottom: 1px solid var(--line);
    color: var(--ink);
    font-size: 0.92rem;
    line-height: 1.2;
}

.job-cost-value-list {
    display: grid;
}

.job-cost-value-list > div {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(88px, auto);
    align-items: center;
    gap: 8px;
    min-height: 29px;
    padding: 5px 10px;
    border-bottom: 1px solid color-mix(in srgb, var(--line) 72%, transparent);
    color: var(--ink);
    font-size: 0.8rem;
}

.job-cost-value-list > div:nth-child(even) {
    background: color-mix(in srgb, var(--panel) 76%, var(--theme-light) 24%);
}

.job-cost-value-list > div:last-child {
    border-bottom: 0;
}

.job-cost-value-list small {
    color: var(--theme-dark-light);
    font-size: 0.73rem;
    font-weight: 900;
}

.job-cost-value-list output {
    color: var(--ink);
    font-variant-numeric: tabular-nums;
    font-weight: 800;
    text-align: right;
}

.job-cost-value-list output.negative,
.job-cost-gauge-card strong.negative {
    color: var(--danger, #a52b2b);
}

.job-cost-total,
.job-cost-cash-flow {
    font-weight: 900;
}

.job-cost-cash-flow {
    margin-top: 8px;
    background: color-mix(in srgb, var(--theme-light) 36%, var(--panel) 64%) !important;
    font-size: 0.9rem !important;
}

.job-cost-visuals {
    display: grid;
    grid-template-columns: repeat(3, minmax(120px, 1fr));
    gap: 10px;
}

.job-cost-gauge-card,
.job-cost-profit-chart-card {
    position: relative;
    text-align: center;
}

.job-cost-gauge-frame {
    position: relative;
    height: 132px;
    padding: 8px 8px 0;
}

.job-cost-gauge-card strong {
    display: block;
    margin: 6px 8px 10px;
    color: var(--ink);
    font-size: 0.88rem;
    font-variant-numeric: tabular-nums;
}

.job-cost-profit-chart-card {
    grid-column: 1 / -1;
}

.job-cost-profit-frame {
    position: relative;
    height: 170px;
    padding: 8px;
}

.job-cost-trend-card {
    margin-top: 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--panel-soft);
    overflow: hidden;
}

.job-cost-trend-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--line);
}

.job-cost-trend-heading h3 {
    margin: 0;
    color: var(--ink);
    font-size: 0.92rem;
}

.job-cost-trend-heading .chart-note {
    margin: 3px 0 0;
}

.job-cost-trend-controls {
    display: flex;
    gap: 8px;
}

.job-cost-trend-controls label {
    display: grid;
    gap: 4px;
    color: var(--muted);
    font-size: 0.66rem;
    font-weight: 900;
    text-transform: uppercase;
}

.job-cost-trend-controls select {
    min-height: 34px;
    padding: 6px 30px 6px 8px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: var(--panel);
    color: var(--ink);
    font: inherit;
    font-size: 0.78rem;
    text-transform: none;
}

.job-cost-trend-frame {
    position: relative;
    height: 240px;
    padding: 10px 12px 4px;
}

.job-cost-trend-card > .chart-note {
    margin: 0;
    padding: 0 12px 10px;
}

.office-rollup-cards {
    display: grid;
    grid-template-columns: repeat(3, minmax(220px, 1fr));
    gap: 10px;
}

.office-rollup-card {
    display: grid;
    gap: 10px;
    padding: 12px;
    border: 1px solid var(--line);
    border-top: 5px solid var(--office-color, var(--theme-dark-light));
    border-radius: var(--radius);
    background: color-mix(in srgb, var(--panel) 92%, var(--office-color, var(--theme-dark-light)) 8%);
    cursor: pointer;
}

.office-rollup-card:hover,
.office-rollup-card:focus {
    border-color: var(--office-color, var(--theme-dark-light));
    outline: none;
}

.office-rollup-card-head {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 12px;
}

.office-rollup-card-head strong {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--ink);
    font-size: 1rem;
    line-height: 1.15;
}

.office-rollup-card-head span {
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 800;
    text-align: right;
}

.office-color-chip {
    width: 13px;
    height: 13px;
    flex: 0 0 13px;
    border-radius: 3px;
    background: var(--office-color, var(--theme-dark-light));
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35);
}

.office-rollup-metrics {
    display: grid;
    grid-template-columns: repeat(6, minmax(70px, 1fr));
    gap: 8px;
}

.office-rollup-metrics span {
    min-width: 0;
    padding: 6px 7px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.68);
}

.office-rollup-metrics small {
    display: block;
    color: var(--muted);
    font-size: 0.66rem;
    font-weight: 900;
    text-transform: uppercase;
}

.office-rollup-metrics strong {
    display: block;
    margin-top: 3px;
    color: var(--ink);
    font-size: 0.95rem;
    line-height: 1.1;
}

.panel-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    min-height: 54px;
    margin-bottom: 10px;
}

.panel-heading h2 {
    margin: 4px 0 0;
    font-size: 1.05rem;
    line-height: 1.2;
    letter-spacing: 0;
}

.panel-heading > span {
    flex: 0 0 auto;
    padding: 6px 9px;
    border-radius: var(--radius);
    background: var(--panel-soft);
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 800;
}

.chart-frame {
    position: relative;
    height: 292px;
    min-height: 292px;
}

.chart-note {
    margin: 10px 0 0;
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 700;
}

.chart-frame-md {
    height: 330px;
}

.chart-frame-lg {
    height: 360px;
}

.table-wrap {
    overflow-x: auto;
}

.period-task-filter {
    display: grid;
    grid-template-columns: minmax(160px, 1fr) minmax(170px, 1fr) minmax(220px, 1.4fr);
    gap: 10px;
    margin: 0 0 12px;
}

.period-task-filter label {
    display: grid;
    gap: 5px;
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 900;
    text-transform: uppercase;
}

.period-task-filter select,
.period-task-filter input {
    min-width: 0;
    width: 100%;
    min-height: 36px;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--panel);
    color: var(--ink);
    font: inherit;
    text-transform: none;
}

.period-task-table-wrap {
    max-height: 430px;
    overflow: auto;
}

.period-task-table-wrap table {
    min-width: 1120px;
}

.period-task-table {
    /* Keep Completed Qty beside Task on wide dashboards instead of allowing
       the table's final column to stretch to the panel's far edge. */
    width: min(1280px, 100%);
    max-width: 1280px;
    table-layout: fixed;
}

.period-task-table .period-task-period,
.period-task-table .period-task-office,
.period-task-table .period-task-customer,
.period-task-table .period-task-manager {
    width: 10%;
}

.period-task-table .period-task-job {
    width: 25%;
}

.period-task-table .period-task-task {
    width: 27%;
}

.period-task-table .period-task-completed {
    width: 8%;
}

.period-task-table th:nth-child(7),
.period-task-table td:nth-child(7) {
    padding-right: 10px;
    text-align: right;
    white-space: nowrap;
}

.period-task-row td:first-child {
    box-shadow: inset 5px 0 0 var(--office-color, var(--theme-accent));
}

.period-task-job-cell strong,
.job-name-nowrap {
    white-space: nowrap;
}

table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

th,
td {
    padding: 11px 9px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
}

th {
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
}

td {
    color: var(--ink);
    font-size: 0.9rem;
}

td strong {
    display: block;
    font-size: 0.92rem;
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.subtext {
    display: block;
    margin-top: 3px;
    color: var(--muted);
    font-size: 0.78rem;
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.numeric {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.positive {
    color: var(--forest);
    font-weight: 800;
}

.negative {
    color: var(--clay);
    font-weight: 800;
}

.empty-cell {
    color: var(--muted);
    text-align: center;
}

.drilldown-row {
    cursor: pointer;
    transition: background-color 0.15s ease, box-shadow 0.15s ease;
}

.drilldown-row:hover,
.drilldown-row:focus-visible {
    background: #f7faf9;
    box-shadow: inset 3px 0 0 var(--steel);
    outline: 0;
}

.detail-drawer[hidden] {
    display: none;
}

body.detail-drawer-open {
    overflow: hidden;
}

.detail-drawer {
    position: fixed;
    inset: 0;
    z-index: 20;
    display: flex;
    justify-content: flex-end;
    background: rgba(31, 42, 37, 0.38);
    overflow: hidden;
    overscroll-behavior: contain;
}

.detail-drawer-panel {
    width: min(1080px, 100%);
    max-height: 100dvh;
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 22px;
    overflow-y: auto;
    overscroll-behavior: contain;
    background: var(--panel);
    border-left: 1px solid var(--line);
    box-shadow: -18px 0 42px rgba(31, 42, 37, 0.18);
}

.detail-drawer-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--line);
}

.detail-drawer-header h2 {
    margin: 4px 0 4px;
    font-size: 1.45rem;
    line-height: 1.15;
    letter-spacing: 0;
    overflow-wrap: anywhere;
}

.detail-drawer-header span {
    color: var(--muted);
    font-size: 0.9rem;
}

.detail-close {
    color: var(--ink);
    background: var(--panel-soft);
    font-weight: 800;
}

.detail-header-actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.detail-back {
    color: #ffffff;
    background: var(--steel);
    border-color: var(--steel);
}

.detail-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
}

.detail-metric {
    min-height: 78px;
    padding: 12px;
    border: 1px solid var(--line);
    border-top: 4px solid var(--steel);
    border-radius: var(--radius);
    background: #fbfcfc;
}

.detail-metric.tone-good {
    border-top-color: var(--forest);
}

.detail-metric.tone-warn {
    border-top-color: var(--safety);
}

.detail-metric.tone-risk {
    border-top-color: var(--clay);
}

.detail-metric span {
    display: block;
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
}

.detail-metric strong {
    display: block;
    margin-top: 8px;
    color: var(--ink);
    font-size: 1.35rem;
    line-height: 1;
}

.detail-metric-total {
    grid-column: span 2;
}

.detail-metric-total strong {
    font-size: 2rem;
}

.detail-metric small {
    display: block;
    margin-top: 8px;
    color: var(--muted);
    font-size: 0.72rem;
    line-height: 1.25;
}

.detail-table-wrap {
    flex: 1 1 auto;
    min-height: 0;
    max-height: 62dvh;
    overflow: auto;
    overscroll-behavior: contain;
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.detail-table {
    min-width: 1640px;
}

.weather-risk-table {
    min-width: 1680px;
    table-layout: fixed;
}

.weather-risk-table th:nth-child(1),
.weather-risk-table td:nth-child(1) {
    width: 140px;
}

.weather-risk-table th:nth-child(2),
.weather-risk-table td:nth-child(2) {
    width: 340px;
}

.weather-risk-table th:nth-child(3),
.weather-risk-table td:nth-child(3) {
    width: 155px;
}

.weather-risk-table th:nth-child(4),
.weather-risk-table td:nth-child(4) {
    width: 190px;
}

.weather-risk-table th:nth-child(5),
.weather-risk-table td:nth-child(5) {
    width: 170px;
}

.weather-risk-table th:nth-child(6),
.weather-risk-table td:nth-child(6),
.weather-risk-table th:nth-child(7),
.weather-risk-table td:nth-child(7),
.weather-risk-table th:nth-child(8),
.weather-risk-table td:nth-child(8) {
    width: 120px;
}

.weather-risk-table th:nth-child(9),
.weather-risk-table td:nth-child(9) {
    width: 170px;
}

.weather-risk-table th:nth-child(10),
.weather-risk-table td:nth-child(10) {
    width: 120px;
}

.weather-risk-table td:nth-child(2),
.weather-risk-table td:nth-child(3),
.weather-risk-table td:nth-child(4),
.weather-risk-table td:nth-child(5) {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.weather-icon-button,
.copy-button {
    min-height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 2px 10px 2px 7px;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--theme-dark);
    background: var(--panel-soft);
    font: inherit;
    font-size: 0.76rem;
    font-weight: 800;
    cursor: pointer;
    white-space: nowrap;
}

.weather-icon-button svg {
    width: 26px;
    height: 26px;
    flex: 0 0 auto;
}

.weather-icon-button .weather-cloud {
    fill: #dfeaf1;
    stroke: var(--theme-dark);
    stroke-width: 2.1;
    stroke-linejoin: round;
}

.weather-icon-button .weather-rain {
    fill: none;
    stroke: #2e9ec8;
    stroke-width: 3.2;
    stroke-linecap: round;
}

.weather-icon-button .weather-bolt {
    fill: #f6b938;
    stroke: #c88400;
    stroke-width: 1.4;
    stroke-linejoin: round;
}

.weather-icon-button .weather-sun {
    fill: #f6b938;
}

.weather-icon-button.weather-rain {
    color: #1f6685;
    background: #eaf6fb;
}

.weather-icon-button.weather-storm {
    color: #263b70;
    background: #eef1ff;
}

.weather-icon-button.weather-forecast {
    color: var(--theme-dark);
}

.weather-icon-button:hover,
.copy-button:hover {
    color: var(--theme-contrast);
    background: var(--steel);
}

.detail-message-stack {
    display: grid;
    justify-items: start;
    gap: 10px;
    padding: 18px;
}

.detail-table th,
.detail-table td {
    padding: 8px 10px;
    font-size: 0.78rem;
    line-height: 1.25;
    color: var(--ink);
}

.detail-table th {
    position: sticky;
    top: 0;
    z-index: 1;
    color: var(--theme-dark);
    background: var(--panel-soft);
    font-size: 0.75rem;
    font-weight: 900;
    text-transform: uppercase;
}

.detail-filter-panel {
    position: sticky;
    top: 0;
    z-index: 4;
    display: grid;
    grid-template-columns: minmax(140px, 220px) minmax(180px, 280px) auto;
    gap: 8px;
    align-items: center;
    padding: 8px;
    border-bottom: 1px solid var(--line);
    background: #fbfcfc;
}

.detail-filter-panel input {
    min-height: 32px;
    padding: 6px 9px;
    border: 1px solid var(--line);
    border-radius: 6px;
    color: var(--ink);
    background: #ffffff;
    font: inherit;
    font-size: 0.82rem;
}

.detail-filter-count {
    color: var(--muted);
    font-size: 0.8rem;
    font-weight: 800;
}

.detail-message {
    padding: 18px;
    color: var(--muted);
}

.gantt-panel {
    min-width: 0;
    padding: 14px;
    border-bottom: 1px solid var(--line);
    background: #fbfcfc;
}

.gantt-sticky {
    position: sticky;
    top: 0;
    z-index: 3;
    padding-bottom: 6px;
    background: #fbfcfc;
}

.gantt-header {
    display: grid;
    grid-template-columns: minmax(120px, 1fr) auto minmax(340px, 1fr);
    align-items: center;
    gap: 16px;
    margin-bottom: 12px;
}

.gantt-header strong {
    font-size: 1rem;
}

.gantt-header > span {
    justify-self: center;
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 700;
    white-space: nowrap;
}

.gantt-legend {
    display: inline-flex;
    align-items: center;
    justify-self: end;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 10px;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 700;
}

.gantt-legend span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.gantt-legend span::before {
    content: "";
    width: 14px;
    height: 7px;
    border-radius: 999px;
}

.gantt-legend-rail::before {
    background: #e8edef;
    border: 1px solid #d4dcdf;
}

.gantt-legend-planned::before {
    background: #dcebf3;
    border: 1px solid #8fb4c6;
}

.gantt-legend-actual::before {
    background: #2d3f59;
}

.gantt-legend-projected::before {
    background: #f2b632;
}

.gantt-rows {
    display: grid;
    gap: 8px;
}

.gantt-axis {
    display: grid;
    grid-template-columns: minmax(240px, 320px) minmax(360px, 1fr) 100px;
    align-items: end;
    gap: 10px;
    margin-bottom: 8px;
    color: var(--muted);
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
}

.gantt-axis-track {
    position: relative;
    min-height: 24px;
    border-bottom: 1px solid var(--line);
}

.gantt-axis-tick {
    position: absolute;
    bottom: 4px;
    transform: translateX(-50%);
    color: var(--muted);
    font-variant-numeric: tabular-nums;
    text-transform: none;
    white-space: nowrap;
}

.gantt-axis-tick::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: -6px;
    width: 1px;
    height: 6px;
    background: var(--line);
}

.gantt-axis-tick-start {
    transform: none;
}

.gantt-axis-tick-end {
    transform: translateX(-100%);
}

.gantt-axis-tick-minor {
    bottom: 0;
    width: 1px;
    height: 5px;
    overflow: hidden;
    color: transparent;
}

.gantt-axis-tick-minor::after {
    bottom: 0;
    height: 5px;
}

.gantt-row {
    display: grid;
    grid-template-columns: minmax(240px, 320px) minmax(360px, 1fr) 100px;
    align-items: center;
    gap: 10px;
}

.gantt-label {
    min-width: 0;
}

.gantt-label strong,
.gantt-label span {
    display: block;
    overflow-wrap: anywhere;
}

.gantt-label strong {
    font-size: 0.82rem;
    line-height: 1.2;
}

.gantt-label span,
.gantt-finish {
    color: var(--muted);
    font-size: 0.75rem;
    font-variant-numeric: tabular-nums;
}

.gantt-label .gantt-task-dates {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 2px;
    font-size: 0.72rem;
    font-weight: 700;
}

.gantt-label .gantt-task-date {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    padding: 2px 6px;
    border-radius: 999px;
    line-height: 1.2;
    overflow-wrap: normal;
}

.gantt-label .gantt-task-date-planned {
    color: #2d3f59;
    background: #dcebf3;
    border: 1px solid #8fb4c6;
}

.gantt-label .gantt-task-date-actual {
    color: #ffffff;
    background: #2d3f59;
}

.gantt-label .gantt-task-date-projected {
    color: #1f2933;
    background: #f2b632;
}

.gantt-label .gantt-task-date-empty {
    color: var(--muted);
    background: #eef2f4;
}

.gantt-track {
    position: relative;
    height: 26px;
    overflow: hidden;
    border-radius: 999px;
    background: #e8edef;
}

.gantt-track-gridline {
    position: absolute;
    inset-block: 0;
    z-index: 0;
    width: 1px;
    background: rgba(95, 113, 133, 0.28);
}

.gantt-track-gridline-minor {
    background: rgba(95, 113, 133, 0.14);
}

.gantt-bar {
    position: absolute;
    z-index: 1;
    height: 8px;
    min-width: 3px;
    border-radius: 999px;
}

.gantt-bar-actual {
    top: 3px;
    background: #2d3f59;
}

.gantt-bar-projected {
    bottom: 3px;
    background: #f2b632;
}

.gantt-bar-planned {
    top: 9px;
    height: 8px;
    background: #dcebf3;
    border: 1px solid #8fb4c6;
}

.gantt-finish:not(:empty) {
    display: inline-flex;
    justify-self: start;
    align-items: center;
    justify-content: center;
    min-height: 22px;
    padding: 3px 7px;
    border-radius: 999px;
    color: #1f2933;
    background: #f2b632;
    font-weight: 800;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 800;
    white-space: nowrap;
}

.status-good {
    color: #ffffff;
    background: var(--forest);
}

.status-warn {
    color: var(--ink);
    background: var(--safety);
}

.status-risk {
    color: #ffffff;
    background: var(--clay);
}

.status-neutral {
    color: #ffffff;
    background: #59636e;
}

.status-below-average {
    color: #ffffff;
    background: #9a7200;
}

@media (max-width: 1240px) {
    .metric-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .dashboard-grid,
    .table-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .panel-wide {
        grid-column: span 2;
    }

    .office-rollup-cards {
        grid-template-columns: repeat(2, minmax(220px, 1fr));
    }

    .job-cost-layout {
        grid-template-columns: repeat(2, minmax(250px, 1fr));
    }

    .job-cost-performance-summary {
        grid-template-columns: repeat(3, minmax(130px, 1fr));
    }

    .job-cost-visuals {
        grid-column: 1 / -1;
    }
}

@media (max-width: 820px) {
    .dashboard-shell {
        padding: 12px;
    }

    .command-band {
        align-items: stretch;
        flex-direction: column;
        padding: 20px;
    }

    .command-tools {
        align-items: stretch;
    }

    .window-selector {
        justify-content: space-between;
    }

    .window-selector button {
        flex: 1 1 84px;
    }

    .custom-window {
        justify-content: stretch;
    }

    .custom-window input,
    .custom-window button {
        flex: 1 1 120px;
    }

    .preferences-panel,
    .preferences-panel summary {
        width: 100%;
    }

    .status-strip {
        max-width: none;
    }

    .metric-grid,
    .dashboard-grid,
    .table-grid {
        grid-template-columns: 1fr;
    }

    .panel-wide {
        grid-column: span 1;
    }

    .office-rollup-cards {
        grid-template-columns: 1fr;
    }

    .office-rollup-metrics {
        grid-template-columns: repeat(3, minmax(70px, 1fr));
    }

    .period-task-filter {
        grid-template-columns: 1fr;
    }

    .job-cost-heading {
        align-items: stretch;
        flex-direction: column;
    }

    .job-cost-filters {
        grid-template-columns: 1fr;
        width: 100%;
    }

    .job-cost-picker-label {
        min-width: 0;
        width: 100%;
    }

    .job-cost-layout {
        grid-template-columns: 1fr;
    }

    .job-cost-performance-summary {
        grid-template-columns: repeat(2, minmax(120px, 1fr));
    }

    .job-cost-trend-heading,
    .job-cost-trend-controls {
        align-items: stretch;
        flex-direction: column;
    }

    .job-cost-visuals {
        grid-column: auto;
    }

    .chart-frame,
    .chart-frame-md,
    .chart-frame-lg {
        height: 280px;
        min-height: 280px;
    }

    .detail-drawer-panel {
        width: 100%;
        padding: 16px;
    }

    .detail-metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .map-metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .jobs-map-layout {
        grid-template-columns: 1fr;
        min-height: auto;
    }

    .map-sidebar {
        height: 360px;
        max-height: 360px;
    }

    .map-panel {
        grid-template-rows: 430px auto;
    }

    .jobs-map {
        height: 430px;
        min-height: 430px;
    }

    .weather-grid {
        grid-template-columns: repeat(3, minmax(120px, 1fr));
    }

    .weather-work-timeline {
        grid-template-columns: 1fr;
    }

    .activity-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .activity-time-row {
        grid-template-columns: 1fr 1fr;
    }

    .public-job-layout {
        grid-template-columns: 1fr;
    }

    .public-job-map,
    .public-job-weather {
        min-height: 430px;
    }
}

@media (max-width: 540px) {
    .metric-card {
        min-height: 118px;
    }

    th,
    td {
        padding: 9px 7px;
        font-size: 0.82rem;
    }

    .panel {
        padding: 13px;
    }

    .detail-metrics {
        grid-template-columns: 1fr;
    }

    .preference-card-grid {
        grid-template-columns: 1fr;
    }

.detail-drawer-header h2 {
        font-size: 1.2rem;
    }

    .map-shell {
        width: min(100% - 20px, 1500px);
    }

    .map-metrics {
        grid-template-columns: 1fr;
    }

    .weather-grid {
        grid-template-columns: repeat(2, minmax(120px, 1fr));
    }

    .weather-period {
        grid-template-columns: 1fr;
    }

    .compact-forecast-row {
        grid-template-columns: 1fr;
    }

    .timeline-date-head {
        display: grid;
    }

    .activity-summary,
    .activity-time-row {
        grid-template-columns: 1fr;
    }

    .activity-day-head {
        display: grid;
    }

    .activity-hours {
        text-align: left;
    }
}

.login-shell,
.admin-shell {
    width: min(1500px, calc(100% - 36px));
    margin: 16px auto 32px;
}

.login-shell {
    min-height: calc(100vh - 40px);
    display: grid;
    place-items: center;
}

.login-panel {
    width: min(460px, 100%);
    display: grid;
    gap: 18px;
    position: relative;
    overflow: hidden;
    padding: 28px;
    border: 1px solid var(--line);
    border-top: 5px solid var(--safety);
    border-radius: var(--radius);
    background: #dbe6ee;
    box-shadow: var(--shadow);
    isolation: isolate;
}

.login-panel > * {
    position: relative;
    z-index: 1;
}

.login-brand-icon {
    width: min(430px, 120%);
    height: auto;
    display: block;
    position: absolute;
    top: 42px;
    left: 50%;
    z-index: 0;
    margin: 0;
    opacity: 0.22;
    pointer-events: none;
    transform: translateX(-50%);
    filter: drop-shadow(0 18px 24px rgba(31, 42, 37, 0.12));
}

.login-panel h1 {
    margin: 0;
    color: var(--ink);
    font-size: 2.4rem;
    letter-spacing: 0;
}

.login-brand-accent {
    color: #F79646;
}

.login-form,
.admin-form {
    display: grid;
    gap: 12px;
}

.login-copyright {
    margin: 0;
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 700;
    text-align: center;
}

.login-version {
    color: var(--muted);
    text-align: center;
}

.login-copyright a {
    color: var(--steel);
    font-weight: 800;
}

.login-form label,
.admin-form label,
.admin-user-row label {
    display: grid;
    gap: 5px;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
}

.login-form input,
.admin-form input,
.admin-form select,
.admin-user-row input,
.admin-user-row select {
    min-height: 38px;
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: 6px;
    color: var(--ink);
    background: rgba(255, 255, 255, 0.74);
    font: inherit;
    font-size: 0.92rem;
    text-transform: none;
}

.login-form button,
.admin-form button,
.profile-card button,
.admin-user-row button {
    min-height: 38px;
    border: 0;
    border-radius: 6px;
    color: #ffffff;
    background: var(--button);
    font: inherit;
    font-weight: 800;
    cursor: pointer;
}

.form-alert,
.form-success {
    margin: 0 0 14px;
    padding: 12px 14px;
    border: 1px solid rgba(var(--danger-rgb), 0.35);
    border-radius: var(--radius);
    color: var(--ink);
    background: rgba(var(--danger-rgb), 0.08);
    font-weight: 700;
}

.form-success {
    border-color: rgba(47, 111, 78, 0.35);
    background: #f0fbf4;
}

.admin-command {
    margin-bottom: 16px;
}

.admin-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 14px;
}

.admin-panel {
    margin-bottom: 14px;
}

.admin-fieldset {
    display: grid;
    gap: 8px;
    margin: 0;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.admin-fieldset legend {
    padding: 0 6px;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
}

.admin-card-fieldset {
    grid-column: 1 / -1;
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.check-row {
    display: flex !important;
    grid-template-columns: none !important;
    align-items: center;
    gap: 8px !important;
    color: var(--ink) !important;
    text-transform: none !important;
}

.check-row input[type="checkbox"] {
    min-height: 18px;
    width: 18px;
    accent-color: var(--accent);
}

.profile-permission-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.profile-card {
    display: grid;
    align-content: start;
    gap: 9px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fbfcfc;
}

.profile-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--line);
}

.profile-card-head button {
    min-height: 30px;
    padding: 0 10px;
}

.profile-card-actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.profile-office-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 6px 14px;
    padding: 8px 0 10px;
    margin-bottom: 8px;
    border-bottom: 1px solid var(--line);
}

.profile-card button.button-danger,
.admin-form button.button-danger {
    background: var(--danger);
}

.check-row:has(input:disabled) {
    opacity: 0.55;
}

.admin-user-list {
    display: grid;
    gap: 10px;
}

.admin-activity-wrap {
    overflow-x: auto;
}

.admin-filter-form {
    display: grid;
    grid-template-columns: repeat(3, minmax(160px, 1fr)) auto auto;
    gap: 10px;
    align-items: end;
    margin-bottom: 12px;
}

.admin-filter-form label {
    display: grid;
    gap: 5px;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
}

.admin-filter-form input {
    min-height: 38px;
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: 6px;
    color: var(--ink);
    background: rgba(255, 255, 255, 0.74);
    font: inherit;
    font-size: 0.92rem;
    text-transform: none;
}

.admin-filter-form button,
.help-text-row button {
    min-height: 38px;
    border: 0;
    border-radius: 6px;
    color: #ffffff;
    background: var(--button);
    font: inherit;
    font-weight: 800;
    cursor: pointer;
}

.help-text-grid {
    display: grid;
    gap: 8px;
}

.help-text-row {
    display: grid;
    grid-template-columns: minmax(180px, 260px) minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fbfcfc;
}

.help-text-row strong,
.help-text-row span {
    display: block;
}

.help-text-row span {
    color: var(--muted);
    font-size: 0.78rem;
}

.help-text-row textarea {
    width: 100%;
    min-height: 46px;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: 6px;
    color: var(--ink);
    background: rgba(255, 255, 255, 0.8);
    font: inherit;
    resize: vertical;
}

.admin-activity-table {
    width: 100%;
    min-width: 860px;
    border-collapse: collapse;
    table-layout: fixed;
}

.admin-activity-table th,
.admin-activity-table td {
    padding: 10px 8px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
}

.admin-activity-table th {
    color: var(--muted);
    font-size: 0.76rem;
    font-weight: 900;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.admin-activity-table td {
    color: var(--ink);
    font-size: 0.86rem;
}

.admin-activity-table td span {
    display: block;
    color: var(--muted);
    font-size: 0.78rem;
}

.admin-activity-table td:last-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.status-pill {
    display: inline-grid !important;
    place-items: center;
    min-width: 72px;
    min-height: 24px;
    padding: 3px 8px;
    border-radius: 999px;
    color: #ffffff !important;
    font-size: 0.76rem !important;
    font-weight: 900;
}

.status-good {
    background: #2f7d55;
}

.status-bad {
    background: var(--danger);
}

.status-neutral {
    background: #59636e;
}

.status-below-average {
    background: #9a7200;
}

.job-performance-table {
    width: 100%;
    table-layout: fixed;
}

.job-performance-table .job-performance-job {
    width: 27%;
}

.job-performance-table .job-performance-type {
    width: 16%;
}

.job-performance-table .job-performance-manager {
    width: 16%;
}

.job-performance-table .job-performance-open {
    width: 8%;
}

.job-performance-table .job-performance-man-days {
    width: 12%;
}

.job-performance-table .job-performance-productivity {
    width: 14%;
}

.job-performance-table .job-performance-performance {
    width: 7%;
}

.job-performance-table th:nth-child(4),
.job-performance-table th:nth-child(5),
.job-performance-table th:nth-child(7),
.job-performance-table td:nth-child(4),
.job-performance-table td:nth-child(5),
.job-performance-table td:nth-child(7) {
    text-align: right;
}

.job-performance-table th:nth-child(6),
.job-performance-table td:nth-child(6) {
    text-align: center;
}

.contract-detail-metrics {
    grid-template-columns: minmax(0, 2fr) minmax(150px, 0.75fr);
}

.contract-detail-metrics .detail-metric:first-child strong {
    font-size: 2rem;
}

.contract-detail-table-wrap {
    max-height: 58dvh;
}

.contract-summary-table {
    width: 100%;
    min-width: 880px;
    table-layout: fixed;
}

.contract-summary-table th:nth-child(1),
.contract-summary-table td:nth-child(1) {
    width: 22%;
}

.contract-summary-table th:nth-child(2),
.contract-summary-table td:nth-child(2) {
    width: 14%;
}

.contract-summary-table th:nth-child(3),
.contract-summary-table td:nth-child(3) {
    width: 14%;
}

.contract-summary-table th:nth-child(4),
.contract-summary-table td:nth-child(4) {
    width: 14%;
    text-align: right;
}

.contract-summary-table th:nth-child(5),
.contract-summary-table td:nth-child(5) {
    width: 11%;
    text-align: right;
}

.contract-summary-table th:nth-child(6),
.contract-summary-table td:nth-child(6) {
    width: 25%;
}

.contract-public-url {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 6px;
    align-items: center;
}

.contract-public-url a {
    min-width: 0;
    color: var(--theme-dark);
    font-weight: 700;
    overflow-wrap: anywhere;
}

.contract-public-url .copy-button {
    min-height: 26px;
    padding: 2px 8px;
}

@media (max-width: 620px) {
    .contract-detail-metrics {
        grid-template-columns: 1fr;
    }
}

.admin-user-row {
    display: grid;
    grid-template-columns: repeat(6, minmax(120px, 1fr));
    gap: 8px;
    align-items: end;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fbfcfc;
}

.compact-check {
    min-height: 38px;
    align-content: center;
}

@media (max-width: 1100px) {
    .admin-grid,
    .profile-permission-grid,
    .admin-user-row,
    .admin-filter-form,
    .help-text-row,
    .password-grid,
    .detail-filter-panel {
        grid-template-columns: 1fr;
    }

    .admin-card-fieldset {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .app-user-bar {
        align-items: flex-start;
        flex-direction: column;
    }
}

@media (max-width: 620px) {
    .admin-card-fieldset {
        grid-template-columns: 1fr;
    }
}

.status-copy {
    min-width: 0;
    display: grid;
    gap: 3px;
}

.status-copy > span:first-child {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    min-width: 0;
}

.status-version {
    color: rgba(255, 255, 255, 0.78);
    font-size: 0.76rem;
    font-weight: 800;
}

.status-actions {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
}

.dashboard-layout-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    grid-auto-flow: dense;
    grid-auto-rows: 8px;
    gap: 14px;
    align-items: start;
    margin-top: 18px;
}

.dashboard-layout-grid .metric-card {
    min-height: 136px;
}

.dashboard-layout-grid > .panel {
    min-width: 0;
    grid-column: span 2;
}

.dashboard-layout-grid > .panel-wide,
.dashboard-layout-grid > .period-task-panel,
.dashboard-layout-grid > .office-rollup-panel {
    grid-column: 1 / -1;
}

.dashboard-grid:empty,
.table-grid:empty {
    display: none;
}

.estimator-gantt-filter {
    margin: 8px 0 12px;
}

.gantt-heading-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

.gantt-heading-actions .panel-action-button {
    min-height: 32px;
    padding: 5px 15px;
    border-radius: 999px;
}

.estimator-gantt-filter label {
    display: grid;
    gap: 5px;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
}

.estimator-gantt-filter input {
    min-height: 38px;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: 6px;
    color: var(--ink);
    background: #ffffff;
    font: inherit;
}

.estimator-gantt-layout {
    display: grid;
    grid-template-columns: minmax(240px, 0.36fr) minmax(0, 1fr);
    gap: 12px;
}

.estimator-gantt-list {
    max-height: 520px;
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.estimator-gantt-job {
    width: 100%;
    display: grid;
    gap: 3px;
    padding: 10px;
    border: 0;
    border-bottom: 1px solid var(--line);
    color: var(--ink);
    background: #ffffff;
    text-align: left;
    cursor: pointer;
}

.estimator-gantt-job:hover,
.estimator-gantt-job[aria-pressed="true"] {
    background: rgba(var(--safety-rgb), 0.12);
}

.estimator-gantt-job strong {
    font-weight: 900;
}

.estimator-gantt-job span {
    color: var(--muted);
    font-size: 0.78rem;
}

.estimator-gantt-panel {
    min-width: 0;
    max-height: 560px;
    overflow: auto;
}

.estimator-gantt-title {
    display: grid;
    gap: 3px;
    padding: 4px 10px 10px;
}

.estimator-gantt-title span {
    color: var(--muted);
    font-size: 0.8rem;
}

.admin-command {
    display: grid;
    grid-template-columns: minmax(280px, 1fr) minmax(0, 760px);
    align-items: stretch;
}

.admin-command > div:first-child {
    align-self: center;
}

.admin-brand-wordmark {
    display: inline-flex;
    gap: 0;
    font-size: 1.35rem;
    font-weight: 900;
    letter-spacing: 0.02em;
}

.admin-tab-nav {
    display: grid;
    grid-template-columns: repeat(3, minmax(130px, 1fr));
    gap: 8px;
    align-content: center;
    width: min(760px, 100%);
}

.admin-tab-button {
    min-height: 38px;
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 6px;
    color: #ffffff;
    background: rgba(255, 255, 255, 0.08);
    font: inherit;
    font-weight: 900;
    cursor: pointer;
}

.admin-tab-button[aria-pressed="true"],
.admin-tab-button:hover {
    border-color: var(--theme-dark-light);
    color: var(--theme-contrast);
    background: var(--theme-dark-light);
}

.admin-tab-panel[hidden],
.admin-user-form[hidden] {
    display: none !important;
}

.profile-create-form {
    grid-template-columns: minmax(260px, 1fr) auto;
    align-items: end;
}

.admin-user-management {
    grid-column: 1 / -1;
}

.admin-user-editor-layout {
    display: grid;
    grid-template-columns: minmax(220px, 0.24fr) minmax(0, 1fr);
    gap: 14px;
}

.admin-user-picker {
    max-height: 720px;
    display: grid;
    align-content: start;
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.admin-user-picker button {
    display: grid;
    gap: 3px;
    padding: 10px;
    border: 0;
    border-bottom: 1px solid var(--line);
    color: var(--ink);
    background: #ffffff;
    text-align: left;
    cursor: pointer;
}

.admin-user-picker button[aria-pressed="true"],
.admin-user-picker button:hover {
    background: rgba(var(--safety-rgb), 0.12);
}

.admin-user-picker span {
    color: var(--muted);
    font-size: 0.76rem;
}

.admin-user-form-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(160px, 1fr));
    gap: 10px;
}

.admin-form-actions {
    display: grid;
    grid-template-columns: minmax(160px, 240px) minmax(180px, 260px) minmax(160px, 220px);
    gap: 10px;
    align-items: end;
}

.health-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.health-grid span {
    display: grid;
    gap: 6px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fbfcfc;
}

.health-grid small {
    color: var(--muted);
    font-weight: 900;
    text-transform: uppercase;
}

.health-grid strong {
    font-size: 1rem;
}

.profile-behavior-json {
    grid-column: 1 / -1;
    display: grid;
    gap: 6px;
}

.profile-behavior-json textarea {
    min-height: 220px;
    resize: vertical;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    color: var(--ink);
    background: #fbfcfc;
    font: 0.86rem/1.45 Consolas, "Courier New", monospace;
}

.profile-json-actions {
    grid-column: 1 / -1;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.profile-json-actions button {
    min-height: 32px;
    padding: 0 12px;
    width: auto;
}

.weather-profile-mode {
    width: 100%;
    max-width: none;
    min-height: 100vh;
    padding: 10px;
}

.weather-profile-topbar {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) minmax(280px, auto) minmax(260px, 1fr);
    align-items: center;
    gap: 18px;
    margin-bottom: 10px;
    padding: 10px 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    color: #ffffff;
    background: linear-gradient(135deg, var(--theme-dark), var(--theme-primary));
    box-shadow: var(--shadow);
}

.weather-profile-topbar h1 {
    margin: 0;
    font-size: clamp(1.25rem, 2vw, 2rem);
    line-height: 1;
}

.weather-profile-brand {
    margin: 0 0 4px;
    font-size: 1.35rem;
    font-weight: 900;
}

.weather-profile-brand .brand-job {
    color: #ffffff;
}

.jobordo-wordmark .brand-job,
.admin-brand-wordmark .brand-job {
    color: var(--ink);
}

.weather-profile-brand .brand-ordo,
.jobordo-wordmark .brand-ordo,
.admin-brand-wordmark .brand-ordo {
    color: #f79646;
}

.weather-profile-brand span:last-child {
    margin-left: 8px;
    color: #ffffff;
}

.weather-profile-clock {
    justify-self: center;
    color: #ffffff;
    font-size: var(--weather-clock-font-size, clamp(1.35rem, 2.2vw, 2.35rem));
    font-weight: 900;
    line-height: 1.15;
    text-align: center;
    text-shadow: 0 1px 2px rgba(15, 23, 42, 0.35);
    white-space: nowrap;
}

.weather-profile-user {
    margin: 2px 0 0;
    color: rgba(255, 255, 255, 0.92);
    font-size: var(--weather-user-font-size, 1.08rem);
    font-weight: 900;
}

.weather-profile-version {
    margin: 0;
    color: rgba(255, 255, 255, 0.9);
    font-size: var(--weather-version-font-size, 0.82rem);
    font-weight: 900;
}

.weather-profile-actions {
    display: grid;
    justify-items: end;
    gap: 10px;
    min-width: 0;
}

.weather-profile-action-row {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 10px;
    min-width: 0;
}

.weather-profile-actions a {
    color: #ffffff;
    font-weight: 900;
}

.weather-profile-actions form {
    margin: 0;
}

.weather-map-watermark {
    position: absolute;
    right: 22px;
    bottom: 126px;
    z-index: 645;
    opacity: 0.2;
    color: #ffffff;
    font-size: clamp(3rem, 8vw, 8rem);
    font-weight: 950;
    line-height: 1;
    letter-spacing: 0;
    pointer-events: none;
    text-shadow: 0 8px 22px rgba(15, 23, 42, 0.32);
}

.weather-map-watermark .brand-ordo {
    color: #f79646;
}

.weather-kiosk-layout {
    display: block;
}

.weather-profile-map-panel {
    position: relative;
    min-height: calc(100vh - 116px);
    overflow: hidden;
}

.weather-profile-map-panel .jobs-map {
    min-height: calc(100vh - 116px);
    border-radius: var(--radius);
}

.weather-profile-hidden-panel {
    display: none;
}

.weather-profile-mode:fullscreen {
    background: var(--bg);
}

.weather-profile-fullpage {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: var(--bg);
}

.weather-profile-ticker {
    position: absolute;
    left: 16px;
    right: 16px;
    z-index: 650;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.36);
    border-radius: 6px;
    color: #ffffff;
    background: rgba(15, 23, 42, 0.78);
    box-shadow: var(--shadow);
    pointer-events: none;
}

.weather-profile-rain-ticker {
    bottom: 76px;
}

.weather-profile-task-ticker {
    bottom: 36px;
}

.weather-profile-ticker [data-weather-ticker-content] {
    display: inline-flex;
    gap: 42px;
    width: max-content;
    padding: 8px 18px;
    animation: weatherTicker var(--ticker-duration, 46s) linear infinite;
}

.weather-profile-ticker span {
    white-space: nowrap;
    font-weight: 900;
}

@keyframes weatherTicker {
    from {
        transform: translateX(0);
    }
    to {
        transform: translateX(-50%);
    }
}

.weather-profile-forecast {
    position: absolute;
    top: 18px;
    left: 18px;
    z-index: 640;
    display: grid;
    gap: 10px;
    width: min(560px, 40vw);
    inline-size: min(560px, 40vw);
    max-width: min(560px, calc(100vw - 48px));
    max-inline-size: min(560px, calc(100vw - 48px));
    min-width: 0;
    overflow: hidden;
    contain: layout paint;
    font-size: var(--forecast-card-font-size, 15px);
    pointer-events: none;
    transition: opacity var(--forecast-card-fade-duration, 320ms) ease;
}

.weather-profile-forecast.weather-forecast-fading {
    opacity: 0.16;
}

.weather-profile-card {
    display: grid;
    gap: 6px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    overflow: hidden;
    contain: layout paint;
    padding: 12px 14px;
    border: 1px solid var(--job-weather-color, rgba(255, 255, 255, 0.42));
    border-left: 7px solid var(--job-weather-color, var(--theme-accent));
    border-radius: 6px;
    color: #ffffff;
    background:
        linear-gradient(135deg, var(--job-weather-rgba, rgba(117, 214, 255, 0.22)), rgba(15, 23, 42, 0) 42%),
        rgba(15, 23, 42, var(--forecast-card-opacity, 0.9));
    box-shadow: var(--shadow);
    animation: weatherForecastCardRise var(--forecast-card-rise-duration, 900ms) ease-out both;
}

.weather-profile-card * {
    min-width: 0;
    max-width: 100%;
}

.weather-profile-card h2 {
    display: flex;
    align-items: center;
    gap: 7px;
    margin: 0;
    font-size: 1.05em;
    line-height: 1.15;
}

.weather-profile-card p,
.weather-profile-card div {
    margin: 0;
}

.weather-profile-card div {
    display: grid;
    grid-template-columns: 74px 100px 24px minmax(150px, 1fr) 104px;
    gap: 8px;
    align-items: center;
    font-size: 0.86em;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
}

.weather-profile-card .weather-card-current {
    display: grid;
    grid-template-columns: minmax(0, 0.72fr) minmax(0, 1.28fr);
    gap: 10px;
    align-items: center;
    color: rgba(255, 255, 255, 0.88);
    font-size: 0.82em;
    font-weight: 800;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
}

.weather-card-task-ticker {
    display: block;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    padding-top: 3px;
    border-top: 1px solid rgba(255, 255, 255, 0.18);
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.82em;
    font-weight: 900;
}

.weather-profile-card small {
    color: rgba(255, 255, 255, 0.82);
    font-size: 0.92em;
    font-weight: 900;
    white-space: nowrap;
}

.weather-profile-card span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

.weather-condition-icon {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 1.25em;
    height: 1.25em;
    overflow: visible;
    color: #ffffff;
    text-overflow: clip;
    vertical-align: -0.16em;
}

.weather-condition-icon svg {
    width: 100%;
    height: 100%;
    overflow: visible;
}

.weather-condition-icon .weather-icon-cloud {
    fill: #e8f4ff;
    stroke: #ffffff;
    stroke-width: 2;
}

.weather-condition-icon .weather-icon-sun {
    fill: #fbbf24;
    stroke: #fff7cc;
    stroke-width: 2;
}

.weather-condition-icon .weather-icon-rain,
.weather-condition-icon .weather-icon-line {
    fill: none;
    stroke: #75d6ff;
    stroke-width: 3;
    stroke-linecap: round;
}

.weather-condition-icon .weather-icon-bolt,
.weather-condition-icon .weather-icon-ice {
    fill: #f79646;
    stroke: #fff7cc;
    stroke-width: 1.5;
}

.weather-condition-icon .weather-icon-unknown {
    fill: #ffffff;
    font-size: 15px;
    font-weight: 900;
}

.weather-profile-ticker .weather-condition-icon,
.weather-profile-card h2 .weather-condition-icon {
    width: 1.35em;
    height: 1.35em;
    margin-right: 2px;
    overflow: visible;
    text-overflow: clip;
}

.weather-job-title-temp,
.weather-job-label-temp {
    color: #f79646;
}

.weather-profile-card .weather-job-title-temp,
.weather-job-label-active .weather-job-label-temp {
    color: var(--job-weather-color, #f79646);
}

.weather-job-title-name {
    white-space: nowrap;
}

@keyframes weatherForecastCardRise {
    from {
        opacity: 0;
        transform: translateY(18px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.forecast-scroll {
    display: block;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    white-space: nowrap;
}

.forecast-scroll-inner {
    display: inline-flex;
    gap: 34px;
    min-width: 100%;
}

.forecast-scroll-inner > span {
    flex: 0 0 auto;
    overflow: visible;
    text-overflow: clip;
}

.forecast-scroll[data-scroll="true"] .forecast-scroll-inner {
    width: max-content;
    animation: weatherForecastTextTicker var(--forecast-scroll-duration, 16s) linear infinite;
}

@keyframes weatherForecastTextTicker {
    from {
        transform: translateX(0);
    }
    to {
        transform: translateX(-50%);
    }
}

.weather-job-label {
    display: inline-block;
    max-width: 280px;
    padding: 4px 9px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.54);
    border-left: 5px solid rgba(255, 255, 255, 0.54);
    border-radius: 999px;
    color: #ffffff;
    background: rgba(15, 23, 42, 0.88);
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.26);
    font-weight: 900;
    text-overflow: ellipsis;
    white-space: nowrap;
    cursor: pointer;
    pointer-events: auto;
}

.weather-hide-zoom-controls .leaflet-control-zoom {
    display: none;
}

.weather-job-label-active {
    border-color: var(--job-weather-color, rgba(255, 255, 255, 0.8));
    border-left-width: var(--weather-label-active-strip-width, 8px);
    border-left-color: var(--job-weather-color, var(--theme-accent));
    background:
        linear-gradient(90deg, var(--job-weather-rgba, rgba(117, 214, 255, 0.2)), rgba(15, 23, 42, 0) 58%),
        rgba(15, 23, 42, 0.94);
    box-shadow:
        0 0 0 var(--weather-label-outline-width, 1px) rgba(0, 0, 0, 0.86),
        0 7px 20px rgba(15, 23, 42, 0.34);
}

.weather-job-label-focused {
    border-color: var(--job-weather-color, #75d6ff);
    background: rgba(15, 23, 42, 0.96);
    box-shadow: 0 0 0 3px var(--job-weather-rgba, rgba(117, 214, 255, 0.25)), 0 10px 24px rgba(15, 23, 42, 0.36);
}

.weather-job-label-line {
    pointer-events: none;
    stroke-linecap: round;
    stroke-dasharray: 4 4;
}

.weather-job-label-line-focused {
    stroke-dasharray: none;
}

.weather-profile-card-focused {
    border-color: var(--job-weather-color, rgba(117, 214, 255, 0.85));
    box-shadow: inset 5px 0 0 var(--job-weather-color, #75d6ff), 0 0 0 2px var(--job-weather-rgba, rgba(117, 214, 255, 0.16)), var(--shadow);
}

@media (max-width: 1180px) {
    .dashboard-layout-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .admin-command,
    .admin-user-editor-layout,
    .estimator-gantt-layout {
        grid-template-columns: 1fr;
    }

    .admin-tab-nav,
    .health-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .profile-permission-grid,
    .admin-user-form-grid,
    .gantt-export-selection-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 720px) {
    .dashboard-layout-grid,
    .admin-tab-nav,
    .health-grid,
    .profile-create-form,
    .admin-form-actions {
        grid-template-columns: 1fr;
    }

    .dashboard-layout-grid > .panel {
        grid-column: 1 / -1;
    }

    .gantt-format-options {
        grid-template-columns: 1fr;
    }

    .gantt-export-date-controls {
        grid-template-columns: 1fr;
    }

    .weather-profile-topbar,
    .weather-profile-actions {
        align-items: flex-start;
        flex-direction: column;
    }

    .weather-profile-topbar {
        display: flex;
    }

    .weather-profile-clock {
        justify-self: start;
        text-align: left;
        white-space: normal;
    }

    .weather-profile-forecast {
        max-width: calc(100vw - 50px);
    }
}
