.order-panel { padding: 1.25rem; margin: 1.25rem 0; background: #fff; border: 1px solid #cbd5ce; border-radius: .75rem; }
.order-picker { display: flex; align-items: end; flex-wrap: wrap; gap: 1rem; }
.order-panel label { display: grid; gap: .5rem; margin-bottom: 1rem; }
textarea[name="free_items"] { width: 100%; min-height: 9rem; box-sizing: border-box; }
.order-picker label { flex: 1 1 18rem; }
.order-locked-job { flex: 1 1 18rem; display: grid; gap: .35rem; margin-bottom: 1rem; }
.order-locked-job span { font-weight: 600; }
.order-locked-job strong { font-size: 1.05rem; }
.order-locked-job p { margin: 0; color: #405348; }
.order-panel input:not([type=checkbox]), .order-panel select, .order-panel textarea { max-width: 100%; padding: .65rem; border: 1px solid #82998a; border-radius: .3rem; font: inherit; }
.order-items { border-collapse: collapse; width: 100%; min-width: 600px; }
.order-items th, .order-items td { text-align: left; vertical-align: top; border: 1px solid #cbd5ce; padding: .75rem; }
.order-items th { background: #f1f5f2; }
.order-items label { margin: 0; }
.order-items input[type=number] { width: 8rem; }
.order-items input[type=checkbox] { width: 1.25rem; height: 1.25rem; }
.order-preview { white-space: pre-wrap; overflow-wrap: anywhere; background: #f1f5f2; padding: 1rem; font: inherit; }
.order-panel dd { margin-bottom: .65rem; overflow-wrap: anywhere; }
.order-email-hint { margin: -.35rem 0 1rem; color: #405348; font-size: .92rem; }

.order-email-review-meta h2 { margin: 0 0 .35rem; }
.order-email-review-meta p { margin: 0 0 1rem; color: #405348; }
.order-email-preview {
    margin: 0 0 1.25rem;
    overflow: hidden;
    border: 1px solid #d5e2da;
    border-radius: 14px;
    background: #f4f7f5;
    box-shadow: 0 1px 0 rgba(23, 34, 27, .04), 0 14px 32px rgba(23, 34, 27, .07);
}
.order-email-preview::before {
    content: "Email preview";
    display: block;
    padding: .55rem 1.15rem;
    background: #176b42;
    color: #fff;
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}
.order-email-live { position: static; }
.order-email-headers {
    display: grid;
    gap: 0;
    padding: .8rem 1.15rem .7rem;
    background: #fff;
    border-bottom: 1px solid #e6eeea;
}
.order-email-headers p {
    display: grid;
    grid-template-columns: 4.75rem minmax(0, 1fr);
    gap: .65rem;
    margin: 0;
    padding: .22rem 0;
    align-items: baseline;
}
.order-email-headers p:last-child {
    margin-top: .35rem;
    padding-top: .55rem;
    border-top: 1px solid #eef3f0;
}
.order-email-headers span {
    color: #6d8076;
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .07em;
    text-transform: uppercase;
}
.order-email-headers strong {
    color: #24362c;
    font-weight: 650;
    overflow-wrap: anywhere;
}
.order-email-headers p:last-child strong {
    color: #17221b;
    font-size: 1.05rem;
    font-weight: 750;
}
.order-email-body {
    max-height: 22rem;
    margin: .85rem;
    padding: 1rem 1.1rem 1.15rem;
    overflow: auto;
    border: 1px solid #e6eeea;
    border-radius: 10px;
    background: #fff;
}
.order-email-body-label {
    margin: 0 0 .7rem;
    color: #6d8076;
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .07em;
    text-transform: uppercase;
}
.order-email-body-text {
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: #1c2b23;
    font: .98rem/1.65 inherit;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}
.order-email-panel {
    margin: 1rem 0;
    padding: .85rem 1rem 1rem;
    border: 1px solid #9eb5a7;
    border-radius: .75rem;
    background: #f7faf8;
}
.order-email-panel legend {
    padding: 0 .35rem;
    font-weight: 800;
}
.order-email-subject {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem .75rem;
    margin: 0 0 .75rem;
}
.order-email-subject span {
    min-width: 4.5rem;
    color: #405348;
    font-weight: 700;
}
.order-email-choice {
    display: flex;
    align-items: center;
    gap: .65rem;
    min-height: 44px;
    margin: .25rem 0 .75rem;
    font-weight: 700;
}
.order-email-choice input {
    width: 1.25rem;
    height: 1.25rem;
}
.order-message-field {
    display: grid;
    gap: .5rem;
    margin: 1rem 0;
    padding: 1rem;
    border: 1px solid #9eb5a7;
    border-radius: .65rem;
    background: #f4f8f5;
}
.order-message-body {
    display: block;
    width: 100%;
    max-width: none !important;
    min-height: 16rem;
    box-sizing: border-box;
    font: inherit;
    line-height: 1.5;
    white-space: pre-wrap;
    background: #fff;
}
.order-email-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .85rem 1.25rem;
    margin-top: 1rem;
}
.order-email-actions p { margin: 0; color: #405348; }
.order-draft-actions h2 { margin: 0 0 .35rem; }
.order-draft-actions p { margin: 0 0 1rem; color: #405348; }
.order-draft-actions .order-email-actions form { margin: 0; }

.wrap-team-members { display: grid; gap: .35rem; max-height: 18rem; overflow: auto; margin: 0 0 1rem; padding: .75rem 1rem; border: 1px solid #cbd5ce; border-radius: .5rem; background: #fff; }
.wrap-team-members legend { font-weight: 700; padding: 0 .25rem; }
.wrap-team-members label { display: flex; align-items: center; gap: .75rem; width: 100%; min-height: 44px; margin: 0; padding: .25rem .15rem; cursor: pointer; }
.wrap-team-members input { width: 1.35rem; height: 1.35rem; flex: none; }
.wrap-team-members label.is-unavailable { color: #8b948e; }
.wrap-team-members .wrap-team-busy { color: #8b948e; font-size: .85rem; }
.order-picker .order-supplier-settings { flex: 1 0 100%; margin: .35rem 0 0; }
.materials-supplier-settings { display: grid; gap: .75rem; }
.materials-supplier-settings label { display: grid; gap: .35rem; margin: 0; font-weight: 700; }
.materials-supplier-search,
.materials-supplier-settings input[type="search"] { width: min(100%, 28rem); min-height: 44px; margin: 0; padding: 0 .75rem; border: 1px solid #cbd5ce; border-radius: 10px; font: inherit; font-weight: 400; }
.materials-supplier-table-scroll { max-height: 32rem; overflow: auto; border: 1px solid #e5e7eb; border-radius: 10px; background: #fff; }
.materials-supplier-table { width: 100%; border-collapse: collapse; }
.materials-supplier-table th,
.materials-supplier-table td { padding: 8px 12px; border-bottom: 1px solid #e5e7eb; text-align: left; vertical-align: middle; }
.materials-supplier-table th { position: sticky; top: 0; background: #f8fafc; font-size: .85rem; }
.materials-supplier-table th:not(:first-child),
.materials-supplier-table td:not(:first-child) { width: 8.5rem; text-align: center; }
.materials-supplier-table td small { display: block; color: #405348; font-weight: 500; }
.materials-supplier-table input { width: 1.25rem; height: 1.25rem; margin: 0; }

.alupress-layout { display: grid; grid-template-columns: minmax(16rem, 22rem) minmax(0, 1fr); gap: 1.25rem; align-items: start; }
.alupress-diagram {
    position: sticky;
    top: 5rem;
    z-index: 5;
    align-self: start;
    max-height: calc(100dvh - 6.25rem);
    margin: 0;
    padding: .75rem;
    overflow: auto;
    border: 1px solid #cbd5ce;
    border-radius: .75rem;
    background: #e7efe9;
}
.alupress-diagram img { display: block; width: 100%; height: auto; background: #fff; }
.alupress-diagram figcaption { margin: .65rem 0 0; color: #405348; }
.alupress-sill { margin: 0 0 1rem; padding: 1rem; border: 1px solid #cbd5ce; border-radius: .75rem; }
.alupress-sill legend { font-weight: 700; padding: 0 .25rem; }
.alupress-measures { display: grid; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); gap: .75rem 1rem; }
.alupress-measures label, .alupress-actions { margin: 0; }
.alupress-ral { display: flex; align-items: center; gap: .6rem; }
.alupress-ral select { flex: 1 1 auto; min-width: 0; }
.alupress-swatch { width: 1.75rem; height: 1.75rem; border-radius: .3rem; border: 1px solid #24362c; flex: none; }
.alupress-actions { margin: 0 0 1rem; }

@media (max-width: 1240px) {
    .alupress-diagram { top: 8.75rem; max-height: calc(100dvh - 10rem); }
}

@media (max-width: 800px) {
    .alupress-layout { grid-template-columns: 1fr; }
    .alupress-diagram {
        top: var(--alupress-nav-bottom, 0px);
        width: calc(100% + 2 * (1.25rem + 1px + 20px));
        max-width: none;
        max-height: calc(100dvh - var(--alupress-nav-bottom, 0px));
        margin-left: calc(-1 * (1.25rem + 1px + 20px));
        padding: 0 0 .35rem;
        border: 0;
        border-radius: 0;
        box-shadow: 0 8px 16px rgba(23, 34, 27, .12);
    }
    .alupress-diagram figcaption { margin: .35rem .75rem 0; font-size: .85rem; line-height: 1.35; }
}

@media (max-width: 760px) {
    .alupress-diagram {
        width: calc(100% + 2 * (1.25rem + 1px + 12px));
        margin-left: calc(-1 * (1.25rem + 1px + 12px));
    }
}

@media (max-width: 800px) {
    .wrap-action-body .page-heading { gap: .35rem; margin-bottom: .35rem; }
    .wrap-action-body .page-heading .eyebrow { display: none; }
    .wrap-action-body .order-panel {
        margin: .5rem 0 0;
        padding: 0;
        border: 0;
        border-radius: 0;
        background: transparent;
    }
    .wrap-action-body .alupress-layout { display: block; }
    .wrap-action-body .alupress-diagram {
        top: 0;
        width: auto;
        max-height: min(15rem, 36dvh);
        margin-left: -1.25rem;
        margin-right: -1.25rem;
    }
    .wrap-action-body .alupress-measures { grid-template-columns: 1fr; }
    .wrap-action-body .alupress-sill {
        margin: 0 0 .75rem;
        padding: .85rem 0 0;
        border: 0;
        border-top: 1px solid #d5e0d8;
        border-radius: 0;
    }
    .wrap-action-body .order-picker { display: grid; grid-template-columns: 1fr; }
    .wrap-action-body .order-picker label { flex: none; width: auto; min-width: 0; }
    .wrap-action-body .order-message-field { margin: .75rem 0; padding: 0; border: 0; background: transparent; }
}

@media (max-width: 760px) {
    .wrap-action-body .alupress-diagram { margin-left: -1rem; margin-right: -1rem; }
}

.wrap-action-body .page-shell {
    width: auto;
    max-width: none;
    margin: 0;
    padding: 0;
}
.wrap-action-body .page-heading .eyebrow,
.wrap-action-body .page-heading h1,
.wrap-action-body .page-heading a {
    display: none;
}
.wrap-action-body .page-heading {
    margin: 0;
}
.wrap-action-body .page-heading p {
    margin: 0 0 1rem;
}
.wrap-action-body .order-panel,
.wrap-action-body .order-email-panel,
.wrap-action-body .order-message-field,
.wrap-action-body .order-email-preview {
    margin-left: 0;
    margin-right: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}
.wrap-action-body .order-panel {
    padding: 0;
    margin: 0 0 1.25rem;
}
.wrap-action-body .order-email-panel {
    margin: 1.25rem 0 0;
    padding: 0;
}
.wrap-action-body .order-email-panel legend {
    padding: 0;
}
.wrap-action-body .order-message-field {
    margin: .5rem 0 1rem;
    padding: 0;
}
.wrap-action-body .order-email-preview {
    margin: 0 0 1rem;
}
.wrap-action-body .order-email-preview::before {
    display: none;
}
.wrap-action-body .order-email-headers,
.wrap-action-body .order-email-body {
    padding-left: 0;
    padding-right: 0;
    background: transparent;
    border: 0;
}

.order-panel input[type="file"],
.wrap-action-body input[type="file"] {
    display: block;
    width: 100%;
    box-sizing: border-box;
    min-height: 44px;
    padding: .55rem .65rem;
    border: 1px solid #82998a;
    border-radius: .3rem;
    background: #fff;
    font: inherit;
}
@media (max-width: 760px) {
    .wrap-team-members { max-height: none; overflow: visible; }
}
@media (max-width: 640px) {
    .order-email-headers p { grid-template-columns: 1fr; gap: .2rem; }
}
