/* ---------------------------------------------------------------------------
   Client Zone (/clientzone) — app header, phone bottom bar, and the amber
   "pending cancellation" marks. Loaded LAST from layout/clientzonemaster.blade.php,
   after the theme, so these rules win without !important.

   Same approach as the reseller portal (public/assets/css/reseller-portal.css),
   under cz-* names so neither portal can restyle the other. The ki-admin theme
   styles bare elements (a <nav> becomes the fixed staff sidebar; <main> is
   padded for the theme's fixed header), so the layout uses classed elements and
   resets what it cannot avoid inheriting. The page card's own brand styles stay
   in clientzone/_shell.blade.php.
--------------------------------------------------------------------------- */

/* Tokens on :root (this file loads only in the Client Zone layout). */
:root {
    --tech5-red: #c40000;
    --tech5-black: #1a1a1a;
    --cz-ink: #1a1a1a;
    --cz-muted: #5f6670;
    --cz-line: #e6e8ec;
    --cz-amber: #9a6200;          /* text on white: 5.3:1 */
    --cz-amber-bg: #fff6dc;
    --cz-amber-line: #f0c36d;
    --cz-amber-badge: #ffc233;
    --cz-bottombar-h: 0px;
}

html.client-zone body {
    background: #f4f5f7;
}

/* The theme's .app-wrapper is a flex ROW (built for sidebar | content). Here the header, the
   content and the footer stack, so it is a plain block. */
html body .app-wrapper {
    display: block;
}

/* --- top bar -------------------------------------------------------------- */

header.cz-topbar {
    position: static;
    width: 100%;
    height: auto;
    margin: 0;
    padding: 0;
    background: #ffffff;
    border-bottom: 1px solid var(--cz-line);
    border-top: 3px solid var(--tech5-red);
    box-shadow: none;
}

.cz-topbar-inner {
    display: flex;
    align-items: center;
    gap: .75rem 2rem;
    min-height: 64px;
    padding: .6rem 1.5rem;
}

.cz-brand {
    display: inline-flex;
    align-items: center;
    gap: .75rem;
    flex: 0 0 auto;
    text-decoration: none;
    color: var(--cz-ink);
}

.cz-brand img {
    height: 30px;
    width: auto;
}

.cz-brand span {
    font-size: 15px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
    padding-left: .75rem;
    border-left: 1px solid var(--cz-line);
    white-space: nowrap;
}

.cz-topbar-nav {
    display: flex;
    align-items: center;
    gap: .25rem 1.5rem;
    flex: 1 1 auto;
}

.cz-topbar-nav__item {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    padding-block: .4rem;
    font-size: 14px;
    font-weight: 500;
    color: var(--cz-muted);
    text-decoration: none;
    white-space: nowrap;
    border-bottom: 2px solid transparent;
}

.cz-topbar-nav__item:hover {
    color: var(--cz-ink);
}

/* "You are here": weight and ink as well as the red underline, so it never rests on colour alone. */
.cz-topbar-nav__item--active {
    color: var(--cz-ink);
    font-weight: 600;
    border-bottom-color: var(--tech5-red);
}

.cz-topbar-nav__icon {
    width: 17px;
    height: 17px;
    flex: 0 0 auto;
}

.cz-topbar-user {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    margin-left: auto;
    flex: 0 0 auto;
}

.cz-whoami {
    text-align: right;
    line-height: 1.3;
    padding-left: 1.25rem;
    border-left: 1px solid var(--cz-line);
}

.cz-whoami strong {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--cz-ink);
}

.cz-whoami span {
    display: block;
    font-size: 12px;
    color: var(--cz-muted);
}

.cz-whoami .cz-switch {
    display: inline-block;
    font-size: 12px;
    font-weight: 600;
    color: var(--tech5-red);
    text-decoration: none;
}

.cz-whoami .cz-switch:hover {
    text-decoration: underline;
}

.cz-signout {
    background: #ffffff;
    border: 1px solid var(--tech5-black);
    border-radius: 4px;
    color: var(--tech5-black);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: .3px;
    padding: 7px 14px;
    white-space: nowrap;
}

.cz-signout:hover,
.cz-signout:focus-visible {
    background: var(--tech5-black);
    color: #ffffff;
}

/* --- page frame ----------------------------------------------------------- */

/* The theme's <main> is narrowed and padded 4rem down for its fixed header; this header is in the
   page flow, so neither applies. The fixed footer needs room under the last card. */
main.cz-main {
    width: 100%;
    margin: 0;
    padding-top: 0;
    padding-bottom: 4.5rem;
}

/* --- phone bottom bar ------------------------------------------------------ */

.cz-bottombar {
    display: none;
}

@media (max-width: 767.98px) {
    :root {
        --cz-bottombar-h: 60px;
    }

    .cz-topbar-inner {
        gap: .5rem;
        padding: .5rem 1rem;
        min-height: 56px;
    }

    .cz-brand img {
        height: 24px;
    }

    .cz-brand span {
        font-size: 12px;
        padding-left: .6rem;
    }

    /* The bottom bar carries the menu and Profile; the top bar keeps Switch account + Sign out. */
    .cz-topbar-nav,
    .cz-topbar-profile,
    .cz-whoami strong,
    .cz-whoami span {
        display: none;
    }

    .cz-topbar-user {
        gap: .75rem;
    }

    .cz-whoami {
        border-left: 0;
        padding-left: 0;
    }

    .cz-signout {
        padding: 6px 10px;
        font-size: 11px;
    }

    .cz-bottombar {
        display: flex;
        align-items: stretch;
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 1002;
        min-height: var(--cz-bottombar-h);
        background: #ffffff;
        border-top: 1px solid var(--cz-line);
        box-shadow: 0 -2px 10px rgba(20, 22, 26, .06);
        padding-bottom: env(safe-area-inset-bottom, 0px);
    }

    .cz-bottombar__item {
        flex: 1 1 0;
        min-width: 0;
        min-height: 44px;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: .15rem;
        padding-block: .35rem;
        font-size: 11px;
        font-weight: 500;
        color: var(--cz-muted);
        text-decoration: none;
        white-space: nowrap;
        border-top: 2px solid transparent;
    }

    .cz-bottombar__item--active {
        color: var(--tech5-red);
        font-weight: 600;
        border-top-color: var(--tech5-red);
    }

    .cz-bottombar__item:focus-visible {
        outline: 2px solid var(--tech5-red);
        outline-offset: -2px;
    }

    .cz-bottombar__icon {
        width: 21px;
        height: 21px;
    }

    /* The theme's fixed footer would sit under the bar: on a phone it joins the page flow
       instead, after the content, and the page reserves the bar's height below it. */
    html body .app-wrapper > footer {
        position: static;
        padding: .75rem 1rem;
        box-shadow: none;
    }

    html body .app-wrapper {
        padding-bottom: calc(var(--cz-bottombar-h) + env(safe-area-inset-bottom, 0px));
    }

    main.cz-main {
        padding-bottom: 1rem;
    }

    /* mobile-fixes.css reserves 42px under .app-content (!important) for the staff layout's
       FIXED footer. Here the footer is in the flow (above), so that reservation was only a gap
       between the last card and the footer. The page now ends: content, footer, bar spacer. */
    html.client-zone body .app-wrapper .app-content {
        padding-bottom: 0 !important;
    }

    html body .go-top {
        bottom: calc(var(--cz-bottombar-h) + 1rem);
    }
}

/* --- pending cancellation (amber) ----------------------------------------- */

.badge.cz-badge-ending {
    background: var(--cz-amber-badge);
    color: #3d2700;
}

.cz-text-ending {
    color: var(--cz-amber) !important;
}

.cz-tile-ending {
    border-color: var(--cz-amber-line) !important;
    background: var(--cz-amber-bg);
}

.alert.cz-alert-ending {
    background: var(--cz-amber-bg);
    border: 1px solid var(--cz-amber-line);
    color: #5c3b00;
}

.alert.cz-alert-ending a {
    color: #5c3b00;
    font-weight: 600;
    text-decoration: underline;
}

/* Dashboard tiles: a label wraps between words, never inside one. */
.cz-card .cz-tile-label {
    word-break: normal;
    overflow-wrap: normal;
    hyphens: none;
}

/* The theme pads .app-content 45px down for its fixed header; this header is in the flow. */
html body .app-wrapper .app-content {
    padding-top: 0;
}

/* The suspended-services alert is the theme's solid red with white text: its links follow it
   rather than the card's red (red on red was unreadable). */
.cz-card .alert-danger a {
    color: #ffffff;
    text-decoration: underline;
}

/* Narrow phones: the logo alone, so Switch account and Sign out always fit beside it. */
@media (max-width: 479.98px) {
    .cz-brand span {
        display: none;
    }
}

/* --- tables become cards on phones (Chris: never a table on mobile) ------- */

/* A table marked .cz-cards keeps its table on desktop. At phone width each row is a card and
   each cell a labelled line, the label coming from the cell's data-label. A row action
   (.cz-card-action) stays its own full-width labelled button inside the card; a long cell
   (.cz-card-block) puts its label above the value instead of beside it. */
@media (max-width: 767.98px) {
    html body table.cz-cards,
    html body table.cz-cards tbody,
    html body table.cz-cards tr,
    html body table.cz-cards td {
        display: block;
        width: 100%;
    }

    html body table.cz-cards thead {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
        white-space: nowrap;
    }

    html body table.cz-cards tbody tr {
        border: 1px solid #dee2e6;
        border-radius: 8px;
        background: #ffffff;
        padding: .35rem 0;
        margin: 0 0 .6rem;
    }

    html body table.cz-cards tbody tr:last-child {
        margin-bottom: 0;
    }

    html body table.cz-cards tbody td {
        display: flex;
        justify-content: space-between;
        align-items: baseline;
        gap: 1rem;
        padding: .3rem .85rem;
        border: 0;
        background: transparent;
        box-shadow: none;
        text-align: right;
        white-space: normal;
    }

    html body table.cz-cards tbody td::before {
        content: attr(data-label);
        flex: 0 0 auto;
        text-align: left;
        font-size: .72rem;
        font-weight: 600;
        letter-spacing: .05em;
        text-transform: uppercase;
        color: #6c757d;
    }

    html body table.cz-cards tbody td.cz-card-block {
        display: block;
        text-align: left;
    }

    html body table.cz-cards tbody td.cz-card-block::before {
        display: block;
        margin-bottom: .2rem;
    }

    html body table.cz-cards tbody td.cz-card-action {
        display: block;
        padding-top: .5rem;
        text-align: left;
    }

    html body table.cz-cards tbody td.cz-card-action::before {
        content: none;
    }

    html body table.cz-cards tbody td.cz-card-action .btn,
    html body table.cz-cards tbody td.cz-card-action .czu-btn {
        display: flex;
        width: 100%;
        justify-content: center;
    }

    /* The selected month: a red edge on the card rather than on its first cell. */
    html body table.cz-cards tbody tr.czu-row-selected {
        border-left: 3px solid var(--tech5-red);
        background: #fdf5f5;
    }

    /* The frame that scrolled the table sideways is not needed for cards. */
    html body .czu-table-frame:has(> table.cz-cards),
    html body .table-responsive:has(> table.cz-cards) {
        border: 0;
        overflow: visible;
    }

    /* The daily list keeps its own short scroll box (a month is ~30 cards). */
    html body .czu-table-frame.czu-scroll-y:has(> table.cz-cards) {
        overflow-y: auto;
        max-height: 420px;
    }

    /* A session's facts: one per line in the card. */
    html body table.cz-cards td.cz-card-block .czu-log-detail {
        flex-direction: column;
        gap: .1rem;
    }
}

/* --- billing (slice 2) ------------------------------------------------------ */

/* An invoice card on a phone: one labelled line per field, label left, value right. */
.cz-billing-card-fields > div {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1rem;
    padding: .2rem 0;
}

.cz-billing-card-fields dt {
    margin: 0;
    font-size: .72rem;
    font-weight: 600;
    letter-spacing: .05em;
    text-transform: uppercase;
    color: #6c757d;
}

.cz-billing-card-fields dd {
    margin: 0;
    text-align: right;
}

/* Summary figures never break inside an amount or date; two tiles share a phone row. */
.cz-card .cz-billing-figure {
    white-space: nowrap;
}

@media (max-width: 575.98px) {
    .cz-card .cz-billing-figure {
        font-size: 1.15rem !important;
    }
}

/* Invoice page: WHMCS line descriptions carry their own line breaks (period, IP address). */
.cz-card .cz-invoice-desc {
    white-space: pre-line;
    overflow-wrap: anywhere;
}

/* Invoice dates sit in a row on wide screens, one per line on phones. */
@media (min-width: 768px) {
    .cz-invoice-facts {
        display: flex;
        flex-wrap: wrap;
        gap: 0 3rem;
    }
    .cz-invoice-facts > div {
        flex-direction: column;
        align-items: flex-start;
        gap: .1rem;
    }
    .cz-invoice-facts dd {
        text-align: left;
    }
}

/* The invoice's totals start under a firmer rule than the lines above them. */
.cz-card .cz-invoice-lines tr.cz-invoice-subtotal > td {
    border-top: 2px solid #adb5bd;
}

/* Phone totals card: a neutral tint (the theme's .bg-light is lilac). */
.cz-card .cz-invoice-totals {
    background: #f8f9fa;
}

/* --- Report a problem (faults, slice 3) ----------------------------------- */

.cz-fault-picker {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: .5rem;
}

.cz-fault-checks {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: .75rem;
    margin-bottom: 1rem;
}

.cz-fault-check {
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: .75rem 1rem;
    background: #f8f9fa;
}

.cz-fault-check--wide {
    grid-column: span 2;
}

.cz-fault-check__label {
    font-size: .75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: #4a4a4a;
    margin-bottom: .25rem;
}

.cz-fault-check__value {
    font-size: 1.1rem;
    font-weight: 600;
}

.cz-fault-rejects li + li {
    margin-top: .25rem;
}

.cz-fault-reset {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem 1rem;
    margin-bottom: 1rem;
}

.cz-fault-subhead {
    font-weight: 700;
    margin: .5rem 0;
}

.cz-fault-tips li + li {
    margin-top: .35rem;
}

.cz-fault-continue {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    border: 1px solid var(--tech5-red, #c40000);
    border-radius: 8px;
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
}

.cz-fault-continue[hidden],
#cz-fault-form[hidden] {
    display: none;
}

.cz-fault-choices {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
}

.cz-fault-choice {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    border: 1px solid #ced4da;
    border-radius: 6px;
    padding: .6rem 1rem;
    cursor: pointer;
    background: #ffffff;
    margin: 0;
}

.cz-fault-choice .form-check-input {
    margin: 0;
    flex-shrink: 0;
}

.cz-fault-choice:has(.form-check-input:checked) {
    border-color: var(--tech5-red, #c40000);
    background: #fff5f5;
}

@media (max-width: 767.98px) {
    .cz-fault-check--wide {
        grid-column: auto;
    }

    .cz-fault-choices {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .cz-fault-picker {
        grid-template-columns: 1fr;
    }

    .cz-fault-continue .btn,
    .cz-fault-reset .btn {
        width: 100%;
    }
}

/* --- Faults list and fault page (faults, slice 3) ------------------------- */

.cz-fault-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: .75rem;
}

.cz-fault-card {
    display: flex;
    flex-direction: column;
    gap: .35rem;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 1rem 1.25rem;
    background: #ffffff;
}

.cz-fault-card:hover,
.cz-fault-card:focus-visible {
    border-color: var(--tech5-red, #c40000);
}

.cz-fault-card__head,
.cz-fault-card__foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
}

.cz-fault-card__ref {
    font-size: 1.05rem;
}

.cz-fault-card__problem {
    font-weight: 600;
}

.cz-fault-card__open {
    font-weight: 600;
    font-size: .85rem;
    color: var(--tech5-red, #c40000);
}

.cz-fault-reported {
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 1rem 1.25rem;
    background: #f8f9fa;
}

.cz-fault-facts {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: .25rem 1rem;
}

.cz-fault-facts dt {
    font-weight: 600;
    color: #4a4a4a;
}

.cz-fault-facts dd {
    margin: 0;
}

/* Client and staff text is stored as plain text: keep its line breaks. */
.cz-fault-text {
    white-space: pre-line;
    overflow-wrap: anywhere;
}

.cz-fault-thread {
    list-style: none;
    padding: 0;
    margin: 0 0 1.25rem;
    display: flex;
    flex-direction: column;
    gap: .75rem;
}

.cz-fault-msg {
    max-width: 85%;
    border-radius: 8px;
    padding: .75rem 1rem;
    border: 1px solid #dee2e6;
}

.cz-fault-msg--tech5 {
    align-self: flex-start;
    background: #f8f9fa;
    border-left: 4px solid var(--tech5-black, #1a1a1a);
}

.cz-fault-msg--mine {
    align-self: flex-end;
    background: #fff5f5;
    border-right: 4px solid var(--tech5-red, #c40000);
}

.cz-fault-msg__meta {
    display: flex;
    flex-wrap: wrap;
    gap: .25rem .75rem;
    align-items: baseline;
    margin-bottom: .25rem;
}

.cz-fault-reopen,
.cz-fault-finished {
    border: 1px solid var(--tech5-red, #c40000);
    border-radius: 8px;
    padding: 1rem 1.25rem;
}

@media (max-width: 767.98px) {
    .cz-fault-list {
        grid-template-columns: 1fr;
    }

    .cz-fault-msg {
        max-width: 100%;
    }

    .cz-fault-new,
    .cz-fault-reply .btn,
    .cz-fault-reopen .btn,
    .cz-fault-finished .btn {
        width: 100%;
    }
}

/* --- contrast (visual QA pass, 2026-11-05) -------------------------------- */

/* Every rule here is scoped to html.client-zone and measured against WCAG AA (4.5:1 body text,
   3:1 large). The theme's alert, badge and text colours are bright mid-tones built for its staff
   pages: white on its green (2.6:1), white on its red (3.9:1), grey on its blue (1.6:1). The
   Client Zone keeps the same hues, darkened, and turns the alerts into tints with dark text — the
   way its amber warning already reads. */
html.client-zone body {
    --cz-green: #0f7b45;          /* white on it 5.3:1; on white 5.3:1 */
    --cz-red-ink: #8a0000;        /* on the red tint 8.8:1 */
}

/* Alerts: tint + dark text of the same hue. */
html.client-zone body .alert-info {
    background: #e8f1fd;
    border: 1px solid #b9d3f6;
    color: #0b3a6e;                /* 10:1 */
}

html.client-zone body .alert-info .czu-hint,
html.client-zone body .alert-info .text-muted {
    color: #33475b !important;     /* 8.4:1 — was grey on solid blue, 1.6:1 */
}

html.client-zone body .alert-success {
    background: #e7f6ee;
    border: 1px solid #b5e2c8;
    color: #0d5c33;                /* 7.3:1 */
}

html.client-zone body .alert-danger {
    background: #fdecec;
    border: 1px solid #f1b5b5;
    color: var(--cz-red-ink);      /* 8.8:1 */
}

/* Links in a red alert (the dashboard's suspended services) follow the alert's ink. */
html.client-zone body .cz-card .alert-danger a {
    color: var(--cz-red-ink);
    font-weight: 600;
    text-decoration: underline;
}

/* Solid badges: the same hue, dark enough for white text. */
html.client-zone body .badge.bg-success {
    background-color: var(--cz-green) !important;   /* 5.3:1 */
}

html.client-zone body .badge.bg-danger {
    background-color: var(--tech5-red) !important;  /* 6.3:1 */
}

/* Coloured text on white or on a light card. The theme's own !important rules load after the
   page's, so these need the extra specificity. */
html.client-zone body .text-success {
    color: var(--cz-green) !important;               /* 5.3:1 on white, 5.1:1 on #f8f9fa */
}

html.client-zone body .text-danger {
    color: var(--tech5-red) !important;              /* 6.3:1 */
}

/* ...except a red section label, which is white on the red (_shell.blade.php). */
html.client-zone body .cz-card legend.text-danger {
    color: #ffffff !important;                       /* 6.3:1 */
}

/* Inline code (router address, PPPoE username): the theme's pink-on-pink is 3.4:1. */
html.client-zone body code {
    color: #a3122a;                                  /* 6.9:1 */
}

/* Muted grey on tinted rows and panels: #6c757d drops under 4.5:1 on the selected-month row and
   the grey cards; the Client Zone's own muted grey holds 5.4:1 or better on all of them. */
html.client-zone body .czu-hint,
html.client-zone body .czu-note,
html.client-zone body .czu-status-line,
html.client-zone body .czu-status-line__key,
html.client-zone body .czu-table thead th,
html.client-zone body .czu-chart__day,
html.client-zone body .cz-billing-card-fields dt,
html.client-zone body table.cz-cards tbody td::before {
    color: var(--cz-muted);
}

/* Cancel journey progress strip: the steps still to come were light grey on white (2.5:1). */
html.client-zone body .cancel-steps .step:not(.done):not(.current) {
    color: var(--cz-muted);
}

/* --- one button system (visual QA pass, 2026-11-05) ----------------------- */

/* Three kinds, one shape. Every button in the page card and the "Confirm it's you" modal has the
   same height, uppercase label and weight; only the colour says what it does:
     primary          .btn-danger                      solid red
     secondary        .btn-outline-dark/-secondary,    white, black outline
                      .btn-secondary
     danger-outline   .btn-outline-danger              white, red outline (Cancel this service)
   .btn-sm is the same at a smaller size (filters, table rows). .btn-link stays a text link.
   These selectors outrank the per-page rules in _shell.blade.php, _stepup_modal.blade.php and the
   pppoe/credentials partials, which set padding on single buttons. */
html.client-zone body .cz-card .btn:not(.btn-link):not(.btn-close),
html.client-zone body .cz-stepup-modal .btn:not(.btn-link):not(.btn-close) {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    min-height: 46px;
    padding: 10px 26px;
    border-width: 1px;
    border-style: solid;
    border-radius: 4px;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.35;
    letter-spacing: .3px;
    text-transform: uppercase;
    transform: none;
}

html.client-zone body .cz-card .btn.btn-sm:not(.btn-link),
html.client-zone body .cz-stepup-modal .btn.btn-sm:not(.btn-link),
html.client-zone body .cz-card .czu-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: .4rem .9rem;
    border-width: 1px;
    border-style: solid;
    border-radius: 4px;
    font-size: 12.5px;
    font-weight: 600;
    line-height: 1.3;
    letter-spacing: .3px;
    text-transform: uppercase;
}

/* A full-width button keeps its label where the page put it (the account chooser's text-start). */
html.client-zone body .cz-card .btn.text-start:not(.btn-link):not(.btn-close) {
    justify-content: flex-start;
}

/* Primary. */
html.client-zone body .cz-card .btn-danger,
html.client-zone body .cz-stepup-modal .btn-danger {
    background-color: var(--tech5-red);
    border-color: var(--tech5-red);
    color: #ffffff;
}

html.client-zone body .cz-card .btn-danger:hover,
html.client-zone body .cz-card .btn-danger:focus-visible,
html.client-zone body .cz-stepup-modal .btn-danger:hover,
html.client-zone body .cz-stepup-modal .btn-danger:focus-visible {
    background-color: #a00000;
    border-color: #a00000;
    color: #ffffff;
}

/* Secondary (the theme's solid grey .btn-secondary joins the outline style). */
html.client-zone body .cz-card .btn-outline-dark,
html.client-zone body .cz-card .btn-outline-secondary,
html.client-zone body .cz-card .btn-secondary,
html.client-zone body .cz-card .czu-btn,
html.client-zone body .cz-stepup-modal .btn-outline-dark,
html.client-zone body .cz-stepup-modal .btn-secondary {
    background-color: #ffffff;
    border-color: var(--tech5-black);
    color: var(--tech5-black) !important;    /* 17.4:1 — beats `.cz-card a.btn-secondary { #fff }` */
}

html.client-zone body .cz-card .btn-outline-dark:hover,
html.client-zone body .cz-card .btn-outline-dark:focus-visible,
html.client-zone body .cz-card .btn-outline-secondary:hover,
html.client-zone body .cz-card .btn-outline-secondary:focus-visible,
html.client-zone body .cz-card .btn-secondary:hover,
html.client-zone body .cz-card .btn-secondary:focus-visible,
html.client-zone body .cz-card .czu-btn:hover,
html.client-zone body .cz-card .czu-btn:focus-visible,
html.client-zone body .cz-stepup-modal .btn-outline-dark:hover,
html.client-zone body .cz-stepup-modal .btn-outline-dark:focus-visible,
html.client-zone body .cz-stepup-modal .btn-secondary:hover,
html.client-zone body .cz-stepup-modal .btn-secondary:focus-visible {
    background-color: var(--tech5-black);
    border-color: var(--tech5-black);
    color: #ffffff !important;
}

/* Danger outline. */
html.client-zone body .cz-card .btn-outline-danger {
    background-color: #ffffff;
    border-color: var(--tech5-red);
    color: var(--tech5-red);                 /* 6.3:1 */
}

html.client-zone body .cz-card .btn-outline-danger:hover,
html.client-zone body .cz-card .btn-outline-danger:focus-visible {
    background-color: var(--tech5-red);
    border-color: var(--tech5-red);
    color: #ffffff;
}

/* --- spacing (visual QA pass, 2026-11-05) --------------------------------- */

/* A button with its one-line explanation (service page, connection details): side by side on a
   wide screen, centred on one line; on a phone the button is full width and the note sits under
   it, flush with its edge (it used to wrap beside the button and indent by .5rem). */
html.client-zone body .cz-action {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem 1rem;
    margin: 0;
}

html.client-zone body .cz-action__hint {
    margin: 0;
    font-size: .875rem;
    color: var(--cz-muted);
}

@media (max-width: 767.98px) {
    html.client-zone body .cz-action {
        flex-direction: column;
        align-items: stretch;
    }

    html.client-zone body .cz-action .btn {
        width: 100%;
    }
}

/* Section labels: the space under a legend was 40px (its 16px margin plus the fieldset's 24px
   padding) against 24px on the other three sides. */
html.client-zone body .cz-card legend {
    margin-bottom: .25rem;
}

/* The last section in the card, or in a column of sections, does not add its 24px under the
   card's own padding (or, on a phone, on top of the column gutter). */
html.client-zone body .cz-card .card-body > fieldset:last-child,
html.client-zone body .cz-card .row > [class*="col"] > fieldset:last-child {
    margin-bottom: 0;
}

/* Two badges side by side (Unpaid + Overdue, Active + Cancellation pending) were ~3px apart. */
html.client-zone body .badge + .badge {
    margin-left: .35rem;
}

/* The chart's caption sat directly on the chart's baseline. */
html.client-zone body .czu-chart + .czu-hint {
    margin-top: .6rem;
}

/* On a phone the usage panel sat 1.25rem inside a card already padded 1.5rem: its cards were
   ~270px wide on a 390px screen. */
@media (max-width: 767.98px) {
    html.client-zone body .czu-card__head,
    html.client-zone body .czu-card__body {
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

/* "Confirm it's you": the footer's buttons line up with the body's edges (they sat 4px wider). */
html.client-zone body .cz-stepup-modal .modal-footer {
    padding-left: 1rem;
    padding-right: 1rem;
}

/* The theme gives a paragraph only 5px underneath, so a paragraph followed by its form's buttons
   (the cancel offer, two-step sign-in) put the button against the text. */
html.client-zone body .cz-card fieldset > p + form {
    margin-top: .75rem;
}
/* Slice 6: package choices (upgrade options, new-service packages) as tappable cards — a radio,
   the name, the price; full width on a phone, a grid from tablet up. */
html.client-zone body .cz-card .cz-options {
    display: grid;
    grid-template-columns: 1fr;
    gap: .75rem;
}
@media (min-width: 768px) {
    html.client-zone body .cz-card .cz-options { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
}
html.client-zone body .cz-card .cz-option {
    display: flex;
    flex-direction: column;
    gap: .25rem;
    border: 1px solid #ced4da;
    border-radius: 8px;
    padding: .75rem 1rem;
    cursor: pointer;
    background: #ffffff;
}
html.client-zone body .cz-card .cz-option:has(input:checked) {
    border-color: var(--tech5-red);
    box-shadow: 0 0 0 2px rgba(196, 0, 0, .25);
}
html.client-zone body .cz-card .cz-option input { margin: 0 0 .25rem; }
html.client-zone body .cz-card .cz-option__name { font-weight: 600; color: #1a1a1a; }
html.client-zone body .cz-card .cz-option__price { color: #1a1a1a; }

/* Slice 6 new-service form: the signature box, full width, a fixed height that suits a thumb. */
html.client-zone body .cz-card .cz-signature {
    border: 2px dashed #6c757d;
    background: #ffffff;
    border-radius: 8px;
}
html.client-zone body .cz-card .cz-signature canvas {
    display: block;
    width: 100%;
    height: 200px;
    touch-action: none;
}
html.client-zone body .cz-card details > summary { cursor: pointer; color: #1a1a1a; }

/* Slice 6 "Orders in progress": a neutral stage badge (dark on light, 4.5:1 or better). */
html.client-zone body .cz-orders .cz-badge-stage {
    background: #e9ecef;
    color: #1a1a1a;
    font-weight: 600;
}

/* --- Support tickets (slice 7). The thread reuses .cz-fault-thread / .cz-fault-msg* ---- */

html.client-zone body .cz-ticket-subject {
    overflow-wrap: anywhere;
}

/* A message from someone who is neither this account nor Tech5 (a CC'd party, an unknown email
   sender): a neutral grey bubble, neither the staff (left, black) nor the "You" (right, red) style. */
html.client-zone body .cz-fault-msg--other {
    align-self: center;
    background: #f1f3f5;
    border: 1px dashed #adb5bd;
}

html.client-zone body .cz-ticket-files {
    list-style: none;
    padding: 0;
    margin: .5rem 0 0;
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
}

html.client-zone body .cz-ticket-files .btn {
    white-space: normal;
    overflow-wrap: anywhere;
    text-align: left;
}

@media (max-width: 767.98px) {
    html.client-zone body .cz-ticket-new,
    html.client-zone body .cz-ticket-submit,
    html.client-zone body .cz-ticket-files li,
    html.client-zone body .cz-ticket-files .btn {
        width: 100%;
    }
}
