﻿:root {
    --blue: #4055a7;
    --blue2: #31458e;
    --green: #168052;
    --ink: #24334a;
    --muted: #748097;
    --line: #dbe3ed;
    --bg: #f5f7fb;
    --mint: #eaf6eb;
    --sky: #e7f2fc
}

* {
    box-sizing: border-box
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font: 14px/1.45 Arial,Helvetica,sans-serif
}


.brand {
    font-size: 19px;
    font-weight: 800;
    letter-spacing: 2px;
    color: #426184
}

    .brand small {
        display: block;
        font-size: 9px;
        letter-spacing: 3px;
        color: #7e8ca0
    }

.account {
    font-size: 13px;
    color: #5e6c80
}

main {
    width: min(1120px,calc(100% - 32px));
    margin:5px auto 34px
}

.welcome {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px
}

    .welcome h1 {
        font-size: 23px;
        margin: 0
    }

    .welcome p {
        margin: 4px 0 0;
        color: var(--muted);
        font-size: 13px
    }

.stepper {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #fff;
    border: 1px solid var(--line);
    padding: 12px 16px;
    border-radius: 12px;
    margin: 16px 0 20px;
    overflow-x: auto
}

.step {
    display: flex;
    align-items: center;
    gap: 7px;
    white-space: nowrap;
    color: #8792a4;
    font-size: 13px
}

.circle {
    width: 25px;
    height: 25px;
    border-radius: 50%;
    border: 1px solid #c9d3df;
    display: grid;
    place-items: center;
    background: white;
    font-weight: bold
}

.step.done .circle, .step.current .circle {
    background: var(--green);
    color: white;
    border-color: var(--green)
}

.step.current {
    color: var(--green);
    font-weight: bold
}

.line {
    height: 2px;
    flex: 1;
    min-width: 15px;
    background: #d9e1eb
}

.layout {
    display: grid;
    grid-template-columns: minmax(0,1fr) 270px;
    gap: 20px;
    align-items: start
}

.card {
    background: white;
    border: 1px solid var(--line);
    border-radius: 12px;
    box-shadow: 0 5px 20px #24334a0c;
    overflow: hidden
}

.card-head {
    padding: 18px 22px;
    background: var(--mint);
    border-bottom: 1px solid #d3e8d8
}

.eyebrow {
    font-weight: bold;
    font-size: 11px;
    letter-spacing: .8px;
    color: var(--green);
    text-transform: uppercase
}

.card-head h2 {
    font-size: 21px;
    margin: 5px 0
}

.card-head p {
    margin: 0;
    color: #617469;
    font-size: 13px
}

.pagesteps {
    padding: 6px 20px;
    background: #fbfcfe;
    border-bottom: 1px solid var(--line);
    border-radius: 10px;
}

.pagetop {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    margin-bottom: 10px
}

    .pagetop strong {
        font-size: 13px
    }

.count {
    font-size: 13px;
    color: var(--muted)
}

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

.tab {
    background: #fff;
    border: 1px solid #d5deea;
    border-radius: 8px;
    padding: 9px 10px;
    text-align: left;
    font-size: 13px;
    color: #4a5a72;
    cursor: pointer
}

    .tab.active {
        background: #edf0ff;
        border-color: var(--blue);
        box-shadow: inset 0 0 0 1px var(--blue);
        color: var(--blue2);
        font-weight: bold
    }

.content {
    padding: 22px
}

.page {
    min-height: 380px
}

    .page h3 {
        font-size: 18px;
        margin: 0 0 4px
    }

.help {
    color: var(--muted);
    font-size: 13px;
    margin: 0 0 18px
}

.group-title {
    font-weight: bold;
    font-size: 13px;
    margin: 19px 0 11px;
    border-bottom: 1px solid #e1e7ef;
    padding-bottom: 7px;
    color: #344a65
}

    .group-title:first-of-type {
        margin-top: 0
    }

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

.field label {
    display: block;
    font-size: 11px;
    font-weight: bold;
    color: #53637a;
    margin: 0 0 5px
}

.field input, .field select {
    width: 100%;
    border: 1px solid #d9e1eb;
    border-radius: 7px;
    padding: 10px 11px;
    background: #fff;
    font: 13px Arial;
    color: #27354a;
    min-width: 0
}

    .field input:focus, .field select:focus {
        outline: 2px solid #dfe5ff;
        border-color: var(--blue)
    }

.full {
    grid-column: 1/-1
}

.add-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    border: 1px solid #d8eadc;
    background: #f3faf4;
    border-radius: 8px;
    padding: 12px;
    margin-top: 16px
}

    .add-row span {
        font-size: 13px;
        color: #607466
    }

.mini-btn {
    border: 0;
    background: var(--green);
    color: white;
    border-radius: 6px;
    padding: 9px 12px;
    font-weight: bold;
    font-size: 13px;
    cursor: pointer
}

.page-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 20px;
    border-top: 1px solid var(--line);
    background: #fff
}

.hint {
    font-size: 11px;
    color: var(--muted);
    text-align: center
}

.btn {
    border: 0;
    border-radius: 7px;
    padding: 10px 15px;
    font-weight: bold;
    font-size: 13px;
    cursor: pointer;
    white-space: nowrap
}

.blue {
    background: var(--blue);
    color: white
}

.outline {
    background: #fff;
    color: var(--blue);
    border: 1px solid #cbd5e2
}

.green {
    background: var(--green);
    color: white
}

.btn:disabled {
    opacity: .38;
    cursor: not-allowed
}

.sidecard {
    padding: 18px;
    margin-bottom: 15px
}

    .sidecard h3 {
        font-size: 14px;
        margin: 0 0 12px
    }

.stat {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid #edf0f5;
    font-size: 13px;
    color: var(--muted)
}

    .stat strong {
        color: var(--ink)
    }

    .stat:last-child {
        border-bottom: 0
    }

.progress-label {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: var(--muted);
    margin: 13px 0 7px
}

.progress {
    height: 7px;
    background: #e9edf3;
    border-radius: 8px;
    overflow: hidden
}

    .progress div {
        height: 100%;
        width: 17%;
        background: var(--green);
        transition: width .2s
    }

.legend {
    font-size: 13px;
    color: #66748a;
    line-height: 1.6;
    margin: 0
}

.overall {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    background: white;
    border: 1px solid var(--line);
    border-radius: 12px;
    margin-top: 18px;
    padding: 14px 17px;
    box-shadow: 0 3px 14px #24334a08
}

    .overall strong {
        display: block;
        font-size: 13px
    }

    .overall small {
        display: block;
        color: var(--muted);
        font-size: 11px;
        margin-top: 3px
    }

.actions {
    display: flex;
    gap: 8px
}


.launch-card {
    position: relative;
    display: flex;
    align-items: center;
    gap: 20px;
    isolation: isolate;
    padding: 26px 28px;
    background: linear-gradient(115deg,#fff 0%,#fff 62%,#f4f7ff 100%);
    border: 1px solid #dbe3f2;
    border-radius: 18px;
    box-shadow: 0 12px 30px rgba(35,54,82,.07);
    overflow: hidden;
}

    .launch-card:after {
        content: "";
        position: absolute;
        right: -46px;
        top: -75px;
        width: 220px;
        height: 220px;
        border-radius: 50%;
        background: radial-gradient(circle,rgba(64,85,167,.10),rgba(64,85,167,0) 70%);
        z-index: -1;
    }

.launch-icon {
    flex: 0 0 62px;
    height: 62px;
    display: grid;
    place-items: center;
    border-radius: 18px;
    background: linear-gradient(145deg,#eaf6eb,#dff0e2);
    border: 1px solid #cce6d1;
    color: #147b52;
    font-weight: 800;
    font-size: 27px;
    box-shadow: inset 0 1px 0 #fff;
}

.launch-copy {
    flex: 1;
    min-width: 0
}

    .launch-copy h2 {
        margin: 0 0 7px;
        font-size: 22px;
        letter-spacing: -.35px;
        color: #202f47;
        line-height: 1.2
    }

    .launch-copy p {
        margin: 0;
        color: #617087;
        font-size: 13px;
        line-height: 1.55;
        max-width: 570px
    }

.launch-meta {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-top: 13px;
    background: #f1f4fb;
    border: 1px solid #e2e8f4;
    border-radius: 999px;
    padding: 7px 11px;
    color: #52627c;
    font-size: 11px;
    font-weight: 700;
}

    .launch-meta:before {
        content: "";
        width: 7px;
        height: 7px;
        background: #168052;
        border-radius: 50%;
        display: inline-block
    }

.launch-btn {
    min-width: 210px;
    padding: 14px 18px;
    border-radius: 10px;
    box-shadow: 0 6px 14px rgba(64,85,167,.2);
    transition: transform .15s ease,box-shadow .15s ease,background .15s ease;
}

    .launch-btn:hover {
        transform: translateY(-1px);
        box-shadow: 0 9px 18px rgba(64,85,167,.25);
        background: var(--blue2)
    }

    .launch-btn:focus-visible {
        outline: 3px solid #b7c4ff;
        outline-offset: 3px
    }

.main-step-navigation {
    margin-top: 16px
}

    .main-step-navigation .actions {
        flex-wrap: wrap
    }

@media(max-width:620px) {
    .main-step-navigation {
        align-items: stretch;
        flex-direction: column
    }

        .main-step-navigation .actions {
            width: 100%
        }

            .main-step-navigation .actions .btn {
                flex: 1
            }

            .main-step-navigation .actions .btn {
                padding: 10px 9px
            }
}

.workflow-backdrop {
    position: fixed;
    inset: 0;
    z-index: 900;
    background: rgba(23,34,54,.58);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px
}

#budgetWorkflowModal[hidden] {
    display: none
}

.workflow-window {
    width: min(1280px,98vw);
    max-height: 94vh;
    overflow: auto;
    background: var(--bg);
    border-radius: 16px;
    box-shadow: 0 24px 90px rgba(8,22,42,.30);
    padding: 10px
}

.workflow-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 0px
}

    .workflow-heading h2 {
        margin: 4px 0;
        font-size: 22px
    }

    .workflow-heading p {
        margin: 0;
      
        font-size: 14px
    }

.workflow-kicker {
    font-size: 10px;
    letter-spacing: 1px;
    font-weight: 800;
    color: var(--green)
}

.workflow-window .layout {
    grid-template-columns: minmax(0,1fr) 250px
}

.workflow-window .overall {
    margin-bottom: 2px
}

.section-tabs {
    display: grid;
    grid-template-columns: repeat(6,minmax(0,1fr));
    gap: 8px
}

.section-tab {
    display: flex;
    align-items: center;
    gap: 7px;
    text-align: left;
    min-width: 0;
    border: 1px solid #d6dfeb;
    background: #fff;
    border-radius: 8px;
    padding: 9px 8px;
    color: #4a5b72;
    cursor: pointer;
    font: inherit
}

    .section-tab:hover {
        border-color: #9aa9d8;
        background: #f8f9ff
    }

    .section-tab.active {
        border-color: var(--blue);
        background: #edf0ff;
        box-shadow: inset 0 0 0 1px var(--blue);
        color: var(--blue2);
        font-weight: 800
    }

.tab-number {
    flex: 0 0 24px;
    height: 24px;
    border-radius: 7px;
    background: #e9edf6;
    color: #4358a0;
    display: grid;
    place-items: center;
    font-size: 11px;
    font-weight: 800
}

.section-tab.active .tab-number {
    background: var(--blue);
    color: #fff
}

.tab-name {
    font-size: 13px;
    line-height: 1.25
}

.tab-state {
    margin-left: auto;
    flex: 0 0 auto;
    color: var(--green);
    font-weight: 900;
    font-size: 14px
}

.section-tab.completed .tab-state:before {
    content: "✓"
}

.completion-status {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 7px
}

    .completion-status .hint {
        white-space: nowrap
    }

.section-footer {
    flex-wrap: wrap
}

.step.locked {
    opacity: .58
}

    .step.locked small {
        display: block;
        color: #a15b15;
        font-size: 9px
    }

.step.available small {
    display: block;
    color: var(--green);
    font-size: 9px
}

#stepNext:disabled {
    opacity: .4;
    cursor: not-allowed
}

#stepNext:not(:disabled) {
    box-shadow: 0 0 0 3px #1680521a
}

.completion-banner {
    display: none;
    margin: 14px 20px 0;
    padding: 12px 14px;
    border-radius: 8px;
    background: #eaf7ee;
    border: 1px solid #cce8d4;
    color: #146c45;
    font-weight: 700;
    font-size: 13px
}

    .completion-banner.show {
        display: block
    }

.page-picker-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    background: #fff;
    border: 1px solid #d9e2ed;
    border-radius: 9px;
    padding: 14px 15px
}

.current-page-name {
    font-size: 15px;
    font-weight: 800;
    color: #2c3b53
}

.current-page-help {
    font-size: 11px;
    color: var(--muted);
    margin-top: 4px
}

.picker-open {
    min-width: 125px
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(23,34,54,.48);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px
}

    .modal-backdrop[hidden] {
        display: none
    }

.page-modal {
    width: min(540px,100%);
    max-height: min(88vh,760px);
    overflow: auto;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 24px 80px rgba(10,24,44,.25);
    padding: 22px
}

.modal-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 18px
}

    .modal-head h3 {
        margin: 0;
        font-size: 21px
    }

    .modal-head p {
        margin: 5px 0 0;
        color: var(--muted);
        font-size: 13px
    }

.modal-close {
    width: 34px;
    height: 34px;
    border: 1px solid #dce3ed;
    background: #f8faff;
    border-radius: 50%;
    font-size: 22px;
    line-height: 1;
    color: #536178;
    cursor: pointer
}

.modal-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px
}

.modal-option {
    display: flex;
    align-items: center;
    gap: 10px;
    text-align: left;
    border: 1px solid #dce3ed;
    background: #fff;
    border-radius: 10px;
    padding: 13px 11px;
    min-width: 0;
    cursor: pointer
}

    .modal-option:hover {
        border-color: #8b9bdd;
        background: #f8f9ff
    }

    .modal-option.active {
        border-color: var(--blue);
        background: #eef1ff;
        box-shadow: inset 0 0 0 1px var(--blue)
    }

.option-number {
    flex: 0 0 30px;
    height: 30px;
    display: grid;
    place-items: center;
    border-radius: 9px;
    background: #e9edf8;
    color: var(--blue2);
    font-weight: 800
}

.modal-option.active .option-number {
    background: var(--blue);
    color: #fff
}

.modal-option strong {
    display: block;
    font-size: 13px;
    color: #29384e
}

.modal-option small {
    display: block;
    font-size: 10px;
    line-height: 1.35;
    color: #728097;
    margin-top: 4px
}

.option-check {
    display: none;
    margin-left: auto;
    color: var(--blue);
    font-weight: 900
}

.modal-option.active .option-check {
    display: block
}

.modal-foot {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    border-top: 1px solid #edf0f5;
    padding-top: 14px;
    margin-top: 17px
}

    .modal-foot span {
        font-size: 11px;
        color: var(--muted)
    }

body.modal-open {
    overflow: hidden;
    position: relative
}

@media(max-width:1000px) {
    .section-tabs {
        grid-template-columns: repeat(3,minmax(0,1fr))
    }
}

@media(max-width:800px) {
    .workflow-window {
        width: 100%;
        max-height: 96vh;
        padding: 12px
    }

        .workflow-window .layout {
            grid-template-columns: 1fr
        }

    .launch-card {
        align-items: flex-start;
        flex-wrap: wrap
    }

    .launch-btn {
        width: 100%
    }

    .launch-card {
        gap: 14px;
        padding: 20px
    }

    .launch-icon {
        flex-basis: 50px;
        height: 50px;
        border-radius: 14px
    }

    .launch-copy h2 {
        font-size: 19px
    }

    .layout {
        grid-template-columns: 1fr
    }

    .side {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 12px
    }

    .sidecard {
        margin: 0
    }

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

    .step span:not(.circle) {
        display: none
    }
}

@media(max-width:540px) {
    .section-tabs {
        grid-template-columns: repeat(2,minmax(0,1fr))
    }

    .section-footer {
        align-items: stretch;
        flex-direction: column
    }

    .completion-status {
        order: 3
    }

        .completion-status .hint {
            white-space: normal
        }

    .section-footer .btn {
        width: 100%
    }

    .modal-options {
        grid-template-columns: 1fr
    }

    .modal-foot {
        align-items: stretch;
        flex-direction: column
    }

        .modal-foot .btn {
            width: 100%
        }

    .page-picker-row {
        align-items: stretch;
        flex-direction: column
    }

    .picker-open {
        width: 100%
    }

    header {
        height: auto;
        padding: 14px;
        align-items: flex-start
    }

    .account {
        text-align: right;
        font-size: 10px
    }

    .welcome {
        align-items: flex-start;
        flex-direction: column
    }

    .grid {
        grid-template-columns: 1fr
    }

    .full {
        grid-column: auto
    }

    .side {
        grid-template-columns: 1fr
    }

    .page-nav, .overall {
        align-items: stretch;
        flex-direction: column
    }

    .actions .btn {
        flex: 1
    }

    .actions {
        width: 100%
    }

    .hint {
        order: 3
    }

    .content {
        padding: 17px
    }

    .stepper {
        padding: 10px
    }
}

/* Responsive desktop, tablet and mobile layouts */
html {
    -webkit-text-size-adjust: 100%;
}

body {
    min-width: 320px;
}

button, input, select {
    max-width: 100%;
}

.launch-card, .overall, .workflow-heading, .pagetop, .page-nav {
    min-width: 0;
}

@media (min-width: 1200px) {
    main {
        width: min(1180px, calc(100% - 64px));
    }

    .workflow-window {
        width: min(1360px, 96vw);
    }

        .workflow-window .layout {
            grid-template-columns: minmax(0, 1fr) 290px;
            gap: 22px;
        }

    .section-tabs {
        grid-template-columns: repeat(6, minmax(0, 1fr));
    }
}

@media (min-width: 801px) and (max-width: 1199px) {
    main {
        width: calc(100% - 40px);
    }

    .workflow-window {
        width: 97vw;
        padding: 16px;
    }

        .workflow-window .layout {
            grid-template-columns: minmax(0, 1fr) 230px;
            gap: 14px;
        }

    .section-tabs {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 800px) {
    header {
        padding: 13px 16px;
    }

    main {
        width: calc(100% - 24px);
        margin: 16px auto 24px;
    }

    .stepper {
        gap: 6px;
        margin: 12px 0 16px;
    }

    .workflow-backdrop {
        padding: 8px;
        align-items: stretch;
    }

    .workflow-window {
        width: 100%;
        max-height: 100%;
        height: 100%;
        border-radius: 12px;
        padding: 12px;
    }

        .workflow-window .layout {
            grid-template-columns: minmax(0, 1fr);
            gap: 12px;
        }

        .workflow-window .side {
            display: grid;
            grid-template-columns: repeat(2, minmax(0, 1fr));
            gap: 12px;
        }

        .workflow-window .sidecard {
            margin: 0;
        }

    .section-tabs {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .section-tab {
        min-height: 48px;
        padding: 8px;
    }

    .tab-name {
        font-size: 11px;
        overflow-wrap: anywhere;
    }

    .content {
        padding: 18px;
    }

    .page {
        min-height: auto;
    }

    .overall {
        align-items: flex-start;
    }
}

@media (max-width: 560px) {
    header {
        align-items: flex-start;
        gap: 10px;
    }

    .brand {
        font-size: 17px;
    }

    .account {
        max-width: 55%;
        line-height: 1.45;
    }

    main {
        width: calc(100% - 20px);
        margin: 12px auto 20px;
    }

    .welcome h1 {
        font-size: 21px;
    }

    .stepper {
        padding: 9px 10px;
    }

    .launch-card {
        display: grid;
        grid-template-columns: 46px minmax(0, 1fr);
        gap: 12px;
        padding: 16px;
        border-radius: 14px;
    }

    .launch-icon {
        width: 46px;
        height: 46px;
        min-width: 46px;
        font-size: 22px;
        border-radius: 13px;
    }

    .launch-copy h2 {
        font-size: 18px;
    }

    .launch-copy p {
        font-size: 13px;
    }

    .launch-meta {
        font-size: 10px;
        line-height: 1.4;
        padding: 6px 9px;
    }

    .launch-btn {
        grid-column: 1 / -1;
        width: 100%;
        min-width: 0;
        min-height: 46px;
        margin-top: 2px;
    }

    .main-step-navigation {
        padding: 13px;
        gap: 12px;
    }

        .main-step-navigation .actions {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 8px;
        }

            .main-step-navigation .actions #stepPrev {
                grid-column: 1 / -1;
            }

            .main-step-navigation .actions .btn {
                min-height: 44px;
                padding: 10px 8px;
            }

    .workflow-heading {
        padding: 2px 2px 12px;
    }

        .workflow-heading h2 {
            font-size: 20px;
        }

        .workflow-heading p {
            font-size: 11px;
            line-height: 1.5;
            max-width: 34ch;
        }

    .workflow-window .card-head {
        padding: 15px 16px;
    }

        .workflow-window .card-head h2 {
            font-size: 19px;
        }

    .pagesteps {
        padding: 12px;
    }

    .pagetop {
        align-items: flex-start;
    }

    .section-tabs {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 7px;
    }

    .section-tab {
        min-height: 44px;
        gap: 6px;
    }

    .tab-number {
        flex: 0 0 22px;
        height: 22px;
        font-size: 10px;
    }

    .tab-name {
        font-size: 10px;
    }

    .content {
        padding: 15px 13px;
    }

    .page h3 {
        font-size: 17px;
        line-height: 1.3;
    }

    .help {
        margin-bottom: 15px;
        line-height: 1.5;
    }

    .grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 11px;
    }

    .full {
        grid-column: auto;
    }

    .field input, .field select {
        min-height: 42px;
        font-size: 16px;
    }

    .group-title {
        margin-top: 16px;
    }

    .add-row {
        align-items: flex-start;
        flex-direction: column;
    }

        .add-row .mini-btn {
            min-height: 40px;
            width: 100%;
        }

    .section-footer {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
        padding: 12px;
    }

        .section-footer .btn {
            min-height: 44px;
            white-space: normal;
            padding: 10px 8px;
        }

    .completion-status {
        grid-column: 1 / -1;
        grid-row: 1;
        align-items: stretch;
        text-align: center;
    }

        .completion-status .hint {
            white-space: normal;
            line-height: 1.4;
        }

    .section-footer #pagePrev {
        grid-column: 1;
        grid-row: 2;
    }

    .section-footer #pageNext {
        grid-column: 2;
        grid-row: 2;
    }

    .section-footer #completeSection {
        width: 100%;
    }

    .workflow-window .side {
        grid-template-columns: minmax(0, 1fr);
    }

    .workflow-window .overall {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        padding: 13px;
    }

        .workflow-window .overall .actions {
            display: grid;
            grid-template-columns: 1fr 1fr;
        }

            .workflow-window .overall .actions #stepPrev {
                grid-column: 1 / -1;
            }

            .workflow-window .overall .actions .btn {
                min-height: 44px;
            }
}

@media (max-width: 360px) {
    .section-tabs {
        grid-template-columns: minmax(0, 1fr);
    }

    .section-tab {
        min-height: 40px;
    }

    .main-step-navigation .actions {
        grid-template-columns: minmax(0, 1fr);
    }

        .main-step-navigation .actions #stepPrev {
            grid-column: auto;
        }

    .workflow-window {
        padding: 8px;
    }

        .workflow-window .side .sidecard {
            padding: 14px;
        }
}


/* Mobile popup fixes: safe viewport sizing, touch scrolling and sticky section controls */
@media (max-width: 800px) {
    .workflow-backdrop {
        position: fixed;
        inset: 0;
        width: 100%;
        height: 100vh;
        height: 100dvh;
        padding: 0;
        display: flex;
        align-items: stretch;
        justify-content: stretch;
        overflow: hidden;
        overscroll-behavior: contain;
    }

    .workflow-window {
        width: 100%;
        min-width: 0;
        height: 100vh;
        height: 100dvh;
        max-height: 100vh;
        max-height: 100dvh;
        margin: 0;
        padding: 12px;
        border-radius: 0;
        overflow-x: hidden;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior-y: contain;
        touch-action: pan-y;
    }

    .workflow-heading {
        position: sticky;
        top: -12px;
        z-index: 5;
        background: var(--bg);
        padding: 0px;
        margin: -12px 0 0;
        border-bottom: 1px solid var(--line);
    }

        .workflow-heading .modal-close {
            flex: 0 0 40px;
            width: 40px;
            height: 40px;
        }

    .workflow-window .layout {
        min-width: 0;
        grid-template-columns: minmax(0, 1fr);
    }

    .workflow-window .card,
    .workflow-window .content,
    .workflow-window .page,
    .workflow-window .grid,
    .workflow-window .field {
        min-width: 0;
        max-width: 100%;
    }

    .workflow-window input,
    .workflow-window select {
        min-width: 0;
        width: 100%;
    }
}

@media (max-width: 560px) {
    .workflow-backdrop {
        padding: 0;
    }

    .workflow-window {
        padding: 10px;
        border-radius: 0;
    }

    .workflow-heading {
        top: -10px;
        margin-top: -10px;
        gap: 10px;
    }

        .workflow-heading h2 {
            font-size: 19px;
        }

        .workflow-heading p {
            max-width: 30ch;
        }

    .section-tabs {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 7px;
    }

    .section-tab {
        min-width: 0;
        white-space: normal;
        overflow-wrap: anywhere;
        min-height: 46px;
    }

    .section-footer {
        position: static;
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        align-items: stretch;
        gap: 8px;
    }

        .section-footer .btn {
            min-width: 0;
            min-height: 44px;
            white-space: normal;
            overflow-wrap: anywhere;
        }

        .section-footer .completion-status {
            grid-column: 1 / -1;
            grid-row: 1;
        }

        .section-footer #pagePrev,
        .section-footer #pageNext {
            grid-row: 2;
        }

    .workflow-window .side {
        grid-template-columns: minmax(0, 1fr);
    }
}
.section-tab.done {
    background: #e8f5e9;
    border-color: #2e7d32;
    color: #1b5e20;
}

    .section-tab.done .tab-state::after {
        content: " ✓";
    }
/* active tab keeps its blue highlight, even when done */
.section-tab.active {
    background: #eef0ff;
    border-color: #4b55a8;
    color: #2b2f7a;
}

.sidebar {
    align-self: flex-start;
    position: sticky;
    top: 16px;
}

.summary-card {
    max-height: calc(100vh - 32px);
    overflow-y: auto;
    font-size: 12px;
    padding:10px;
        padding-top: 0px;
}

    .summary-card h3 {
        font-size: 12px;
        line-height: 1.25;
        margin-bottom: 4px;
    }

.summary-note {
    font-size: 12px;
    color: #777;
    margin: 0 0 8px;
}

.summary-card h4 {
    font-size: 12px;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: #6b7b83;
    margin: 18px 0 6px;
    font-weight: 700;
}

.summary-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    padding: 3px 0;
    font-size: 12px;
}

    .summary-line[hidden] {
        display: none;
    }

    .summary-line b {
        font-size: 12px;
    }

.summary-total {
    border-top: 1px dashed #cfd8dc;
    margin-top: 4px;
    padding-top: 9px;
    font-weight: 700;
}

.summary-big {
    font-size: 12px;
    font-weight: 700;
    margin-top: 16px;
}

    .summary-big b {
        font-size: 12px;
    }

    .summary-big .neg {
        color: #a12622;
    }

    .summary-big .pos {
        color: #1e6b3a;
    }

.summary-bar-track {
    display: flex;
    height: 12px;
    border-radius: 999px;
    overflow: hidden;
    background: #e9ecef;
    margin: 12px 0 10px;
}

.summary-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 14px;
    font-size: 12px;
    color: #555;
}

.legend-dot {
    display: inline-block;
    width: 11px;
    height: 11px;
    border-radius: 50%;
    margin-right: 5px;
}

.surplus-badge {
    margin-top: 12px;
    padding: 11px 14px;
    border-radius: 8px;
    background: #f1f3f5;
    font-size: 12px;
    line-height: 1.4;
}

    .surplus-badge.is-positive {
        background: #e6f4ea;
        color: #1e6b3a;
    }

    .surplus-badge.is-negative {
        background: #fdecea;
        color: #a12622;
    }

.pill {
    padding: 3px 11px;
    border-radius: 999px;
    font-size: 12px;
    background: #f1f3f5;
    color: #555;
}

    .pill[data-state="ok"] {
        background: #e6f4ea;
        color: #1e6b3a;
    }

    .pill[data-state="warn"] {
        background: #fff4d6;
        color: #8a6100;
    }

    .pill[data-state="bad"] {
        background: #fdecea;
        color: #a12622;
    }