/* ==================================================================
   MathiWay design tokens (phase 1: type + navbar).
   One font stack and one nav-link voice site-wide; MDB component CSS
   stays untouched underneath.
   ================================================================== */

:root {
    --mw-font-stack: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --mw-body-color: #4f4f4f;
    --mw-brand-blue: #0d47a1;
    --mw-link-blue: #3b71ca;
}

body {
    font-family: var(--mw-font-stack);
    color: var(--mw-body-color);
}

/* Contrast: MDB's muted gray fails on white and on tinted cards. */
.text-muted {
    color: #5a5a5a !important;
}

/* MDB's danger red (#dc4c64) gives white badge text only 3.99:1 (the home
   page's discount pills, unread counters). A darker red passes 4.5:1. */
.badge.bg-danger {
    background-color: #b02a37 !important;
}

/* Footer links sit on a tinted background where both the default link blue
   and inherited body gray fall just short of 4.5:1. Brand dark blue passes
   comfortably for text links and icon glyphs alike. */
footer {
    color: #404040;
}

footer a {
    color: var(--mw-brand-blue);
}

footer a.text-reset {
    color: var(--mw-brand-blue) !important;
}

/* Info badges (e.g. "tool in developement", availability states) carry white
   text: MDB's light info background fails, this darker cyan passes. */
.badge.bg-info,
.badge.text-bg-info {
    background-color: #087990 !important;
}

/* Premium flag: solid gold on dark text so it reads on the blue-tinted
   cards. MDB's warning badge renders washed out here. */
.badge.premium-flag {
    background-color: #e6a200 !important;
    color: #212529 !important;
    font-weight: 600;
    cursor: pointer;
}

/* Links inside running text must not rely on colour alone. Covers page
   content and the consent modal (which lives outside <main>). */
main p a:not(.btn),
main label a:not(.btn),
main .form-text a:not(.btn),
main li a:not(.btn):not(.nav-link):not(.page-link):not(.dropdown-item),
.modal-body p a:not(.btn) {
    text-decoration: underline;
}

/* Field hints: MDB's #7b7b7b is 4.2:1 on white, below the 4.5:1 minimum. */
.form-text {
    color: #5f6368;
}

/* Top menu: body font, sentence case, link-blue like in-page links so items
   read as clickable; underline marks the active section. */
.navbar .nav-link {
    font-family: var(--mw-font-stack);
    font-size: 1rem;
    font-weight: 400;
    text-transform: none;
    letter-spacing: normal;
    color: var(--mw-link-blue);
    background: none;
    border: 0;
    padding: 0.5rem 1rem;
}

.navbar .nav-link:hover,
.navbar .nav-link:focus-visible {
    color: var(--mw-brand-blue);
    text-decoration: underline;
}

.navbar .nav-link.active {
    color: var(--mw-brand-blue);
    font-weight: 500;
    box-shadow: inset 0 -2px 0 var(--mw-brand-blue);
}

/* Hamburger: three bars morphing into an X when the menu is open
   (MDB toggles aria-expanded automatically, no JS needed). */
.mw-toggler {
    width: 44px;
    height: 44px;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    background: #fff;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 0;
}

.mw-toggler span {
    display: block;
    width: 22px;
    height: 2px;
    border-radius: 2px;
    background: var(--mw-body-color);
    transition: transform 0.25s ease, opacity 0.2s ease;
}

.mw-toggler[aria-expanded="true"] span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.mw-toggler[aria-expanded="true"] span:nth-child(2) {
    opacity: 0;
}

.mw-toggler[aria-expanded="true"] span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* Cookie preferences button: bottom-left; the chat bubble owns bottom-right. */
#preferences-icon {
    left: 0 !important;
    right: auto !important;
}

/* Live chat bubble and panel (static/js/chat.js). */
.mw-chat-toggle {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    width: 56px;
    height: 56px;
    z-index: 1060;
    font-size: 1.35rem;
}
.mw-chat-dot {
    position: absolute;
    right: 4px;
    bottom: 4px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid #fff;
    background: #9fa6b2;
}
.mw-chat-online .mw-chat-dot {
    background: #14a44d;
}
/* Two classes: MDB's `.btn .badge {position: relative}` would otherwise win, put the
   badge back in the button's flow and push the icon off-centre. */
.mw-chat-toggle .mw-chat-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 1.25rem;
    padding: 0.25em 0.4em;
    font-size: 0.7rem;
    line-height: 1;
    border: 2px solid #fff;
}
.mw-chat-panel {
    position: fixed;
    right: 1rem;
    bottom: 5.25rem;
    width: 360px;
    max-width: calc(100vw - 2rem);
    max-height: min(70vh, 560px);
    display: flex;
    flex-direction: column;
    background: var(--mdb-body-bg, #fff);
    border-radius: 0.75rem;
    overflow: hidden;
    z-index: 1060;
}
.mw-chat-panel.d-none {
    display: none !important;
}
.mw-chat-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: var(--mdb-primary, #3b71ca);
    color: #fff;
}
.mw-chat-body {
    padding: 1rem;
    overflow-y: auto;
}
#mw-chat-thread {
    display: flex;
    flex-direction: column;
    min-height: 0;
    flex: 1;
}
#mw-chat-thread.d-none {
    display: none !important;
}
.mw-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 0.75rem 1rem;
    min-height: 220px;
}
.mw-chat-msg {
    display: flex;
    flex-direction: column;
    max-width: 85%;
    margin-bottom: 0.6rem;
}
.mw-chat-text {
    padding: 0.45rem 0.7rem;
    border-radius: 0.75rem;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}
.mw-chat-meta {
    font-size: 0.75rem;
    color: #6c757d;
    margin-bottom: 0.15rem;
}
.mw-chat-visitor {
    margin-left: auto;
    align-items: flex-end;
}
.mw-chat-visitor .mw-chat-text {
    background: var(--mdb-primary, #3b71ca);
    color: #fff;
}
.mw-chat-agent .mw-chat-text {
    background: #eef2f7;
    color: #262626;
}
.mw-chat-system {
    max-width: 100%;
    align-items: center;
    font-size: 0.8rem;
    color: #6c757d;
}
.mw-chat-compose {
    display: flex;
    gap: 0.5rem;
    align-items: flex-end;
    padding: 0.5rem 1rem;
    border-top: 1px solid #e0e0e0;
}
.mw-chat-compose.d-none {
    display: none !important;
}
.mw-chat-hp {
    position: absolute;
    left: -10000px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}
.admin-chat-list {
    max-height: 520px;
    overflow-y: auto;
}
.admin-chat-thread .mw-chat-messages {
    height: 420px;
}
@media (max-width: 575.98px) {
    .mw-chat-toggle {
        width: 48px;
        height: 48px;
        right: 0.75rem;
        bottom: 0.75rem;
    }
    .mw-chat-panel {
        right: 0.5rem;
        left: 0.5rem;
        width: auto;
        max-width: none;
        bottom: 4.25rem;
        max-height: 75vh;
    }
}

/* Footer legal line wraps between links, never mid-link. */
.mw-legal-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.25rem 0.75rem;
}

/* EAA touch targets: minimum ~24px hit area for small icon/button controls. */
.btn-sm,
a[role="button"] {
    min-height: 24px;
    min-width: 24px;
}

/* Hero scales down on phones instead of overflowing. */
@media (max-width: 575.98px) {
    .display-4 {
        font-size: 2.25rem;
    }

    /* Keep the floating cookie button clear of footer content. */
    footer {
        padding-bottom: 3.5rem;
    }

    /* Tuck the floating cookie button bottom-left and shrink it, so it never
       covers the full-width result actions on narrow screens. */
    #preferences-icon {
        left: 0 !important;
        right: auto !important;
        transform: scale(0.85);
        transform-origin: bottom left;
    }
}

/* Domain result rows: layout lives here rather than in Bootstrap utilities,
   whose !important flags would otherwise beat every breakpoint override.
   Stacked below lg, single centered line on desktop. */
.domain-result-line {
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
}

/* Offscreen result and price rows skip layout/paint until scrolled near:
   both lists run into the hundreds of rows while only the viewport matters.
   Picker upgrades only ever target near-viewport rows, and best-price anchor
   jumps still render on demand. Verify visually: dropdowns, sticky cart. */
.domain-result {
    content-visibility: auto;
    contain-intrinsic-size: auto 120px;
}
#priceTableZone tbody tr {
    content-visibility: auto;
    contain-intrinsic-size: auto 41px;
}
.domain-result-main {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    column-gap: 0.75rem;
    row-gap: 0.5rem;
    min-width: 0;
}

.domain-result-identity {
    grid-column: 1 / -1;
    min-width: 0;
}

/* Exact-match hero: the searched domain pinned above "More domains to
   consider". Same row machinery (batching, upgrade, best-price anchor all
   key off #resultRows), dressed up so it reads as a hero, not row one. */
.exact-hero {
    border: 2px solid var(--mdb-primary, #3b71ca) !important;
    box-shadow: 0 0.25rem 0.75rem rgba(59, 113, 202, 0.18);
    background-color: rgba(59, 113, 202, 0.06);
}

/* Long domain names truncate with an ellipsis (full name on hover via the
   title attribute) instead of wrapping: rows keep their single-line shape
   on desktop and never break mid-word on phones. The identity must shrink
   for the ellipsis to trigger, hence min-width above. */
.domain-result-name {
    display: block;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.domain-result-price {
    white-space: nowrap;
    text-align: end;
}

/* Names that cannot be bought: quieter than the buyable rows, and with no
   picker or price the name may use the whole row instead of being cut. */
.domain-result-unavailable {
    border-color: var(--mdb-border-color, #e0e0e0) !important;
}
.domain-result-unavailable .domain-result-name {
    color: var(--mdb-secondary-color, #6c757d);
    font-weight: 500;
}
.domain-result-unavailable .domain-result-main > .domain-result-identity {
    grid-column: 1 / -1;
}

/* Results pager: a window of pages that wraps on small screens instead of
   one long row running out of the card. */
.results-pager .pagination {
    flex-wrap: wrap;
    row-gap: 0.25rem;
}

.domain-result .year-price {
    white-space: nowrap;
}

/* Modern term picker: a native control, dressed up. Native submit, change
   events and the OS picker on phones all keep working. Shared with the
   results sort dropdown, which has no script depending on it. */
.years-select,
.filter-select {
    appearance: none;
    -webkit-appearance: none;
    padding-right: 2rem;
    border-radius: 0.5rem;
    border: 1px solid #dee2e6;
    background-color: #fff;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23333' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.6rem center;
    background-size: 0.9em;
    cursor: pointer;
}

.years-select:focus-visible,
.filter-select:focus-visible {
    outline: 0;
    border-color: #0d6efd;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

/* MDB-enhanced pickers: the generated wrapper sizes like the shrink-to-fit
   native control it replaces, so single-line rows and the filter header keep
   their shape once the custom dropdown initializes. */
.domain-result-period .select-wrapper,
#resultFilters .select-wrapper {
    display: inline-block;
    max-width: 100%;
    vertical-align: middle;
}

/* Desktop: identity, term picker, price and actions share one row. */
@media (min-width: 992px) {
    .domain-result-line {
        flex-wrap: nowrap;
        align-items: center;
    }

    /* Column/row grid with shared fixed tracks: name, picker and price
       start at the same x in every row by construction, at any viewport.
       The name truncates with an ellipsis inside its track. */
    .domain-result-main {
        display: grid;
        grid-template-columns: 15rem 11rem minmax(14ch, auto);
        align-items: center;
        column-gap: 1rem;
    }

    /* Undo the stacked-mobile span: on desktop the identity takes track 1
       so picker and price share its row. */
    .domain-result-main > .domain-result-identity {
        grid-column: auto;
    }

    .domain-result-main > .domain-result-period {
        min-width: 0;
    }

    /* Fixed boxes so every row lines up no matter how long its price is
       ("SEK 149.36" vs "SEK 1,493.64") or which button it shows
       (Select vs the wider Remove): identity absorbs all variance. */
    .domain-result-price {
        min-width: 14ch;
        text-align: end;
    }

    .domain-result-line > .domain-actions {
        flex: 0 0 auto;
        min-width: 6.5rem;
        text-align: end;
    }
}

/* Compact phone cart summary: total on its own row, both CTAs side by side
   so Checkout never orphans onto a row of its own. */
.cart-compact .card-body {
    text-align: center;
}

.cart-compact-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

/* Both CTAs share identical boxes with centered labels, whichever variant
   (outline vs solid, with or without MDB's button shadow) renders. */
.cart-compact-actions .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
}

/* Tactile row actions: gentle lift on hover/focus, motion-safe. Touch screens
   simply never trigger hover; keyboard users get the same cue on focus. */
.domain-actions .btn {
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.domain-actions .btn:hover,
.domain-actions .btn:focus-visible {
    transform: translateY(-1px);
    box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.15);
}

@media (prefers-reduced-motion: reduce) {
    .domain-actions .btn {
        transition: none;
    }

    .domain-actions .btn:hover,
    .domain-actions .btn:focus-visible {
        transform: none;
        box-shadow: none;
    }
}

/* Phones: stack result actions full-width so Select and Remove are
   easy to hit and never squeeze beside a long domain name. */
@media (max-width: 575.98px) {
    .domain-result .domain-actions {
        width: 100%;
    }

    .domain-result .domain-actions form,
    .domain-result .domain-actions .btn {
        width: 100%;
    }

    .domain-result .domain-actions form + form {
        margin-top: 0.5rem;
        margin-left: 0;
    }

    /* Full-size picker avoids iOS auto-zoom when the period is focused. */
    .domain-result .years-select {
        font-size: 1rem;
        min-height: 44px;
    }

    .filter-select {
        font-size: 1rem;
        min-height: 44px;
    }

    /* Filter controls: the sort picker takes its own row, checkbox and
       Apply share the next one instead of scattering across three. */
    #resultFilters .filter-select {
        flex: 1 1 100%;
    }
}

/* Coarse pointers: checkout-path controls get a full touch target. */
@media (pointer: coarse) {
    .domain-result .btn,
    .domain-result .years-select,
    .cart-compact .btn,
    .filter-select {
        min-height: 44px;
    }
}

/* Admin and control-panel rails: see "Dashboard shell" at the end of this file. */

/* ==================================================================
   Account tools (domain settings, saved domains, API & automation).
   ================================================================== */

/* Section cards: icon tile + title, the same quiet card as the panel. */
.mw-card-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 0.75rem;
    background-color: rgba(59, 113, 202, 0.1);
    color: var(--mw-link-blue);
    flex-shrink: 0;
}

.mw-card-icon.mw-card-icon-lg {
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 1rem;
}

.mw-card-icon.mw-icon-warning {
    background-color: rgba(228, 161, 27, 0.15);
    color: #8a5a00;
}

/* Status chips next to card titles: dot + label, readable without colour. */
.mw-status {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.2rem 0.6rem;
    border-radius: 1rem;
    background-color: #f1f3f5;
    color: #4f4f4f;
}

.mw-status::before {
    content: "";
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    background-color: currentColor;
}

.mw-status.mw-status-on {
    background-color: rgba(20, 164, 77, 0.12);
    color: #0b6b31;
}

.mw-status.mw-status-off {
    background-color: rgba(220, 76, 100, 0.1);
    color: #a3243b;
}

/* Secrets shown once (tokens, passwords, transfer codes) and code samples. */
.mw-secret {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 0.75rem;
    border-radius: 0.5rem;
    background-color: #fff;
    border: 1px dashed rgba(0, 0, 0, 0.2);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    word-break: break-all;
}

.mw-code {
    position: relative;
    margin: 0;
    padding: 1rem 3rem 1rem 1rem;
    border-radius: 0.5rem;
    background-color: #1f2937;
    color: #e5e7eb;
    font-size: 0.8rem;
    line-height: 1.6;
    /* Commands stay one per line and scroll sideways rather than wrap mid-flag. */
    white-space: pre;
    overflow-x: auto;
}

.mw-code .mw-copy {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    color: #e5e7eb;
}

.mw-copy.mw-copied {
    color: #14a44d !important;
}

/* Two-factor code entry: wide, spaced digits that are easy to read back. */
.mw-otp-input {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 1.75rem;
    letter-spacing: 0.5rem;
    text-align: center;
}

/* Release dates on the expiring-domains list. */
.mw-countdown {
    min-width: 5.5rem;
    text-align: center;
}

@media (max-width: 575.98px) {
    .mw-code {
        font-size: 0.75rem;
    }

    .mw-otp-input {
        font-size: 1.5rem;
        letter-spacing: 0.35rem;
    }
}

/* Contact form honeypot: off-screen for people, visible to bots. */
.mw-hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* Dark theme (data-mdb-theme="dark", set by the theme switch in the header).
   MDB styles its own components; these cover the light colours written into
   our templates (bg-white cards and navbar, the footer's inline tint, light
   table heads) and site.css. */
[data-mdb-theme=dark] {
    --mw-body-color: #dee2e6;
    --mw-brand-blue: #8ab4f8;
    --mw-link-blue: #8ab4f8;
    --mdb-heading-color: #f5f5f5;
    --mdb-body-color: #dee2e6;
}
[data-mdb-theme=dark] .bg-white,
[data-mdb-theme=dark] .card-header.bg-white,
[data-mdb-theme=dark] .navbar.bg-white {
    background-color: var(--mdb-surface-bg) !important;
    color: var(--mdb-surface-color);
}
[data-mdb-theme=dark] footer[style] {
    background-color: var(--mdb-body-bg) !important;
}
[data-mdb-theme=dark] .bg-light,
[data-mdb-theme=dark] .table-light,
[data-mdb-theme=dark] .table-light > th,
[data-mdb-theme=dark] .table-light th {
    background-color: var(--mdb-tertiary-bg) !important;
    color: var(--mdb-body-color) !important;
    --mdb-table-bg: var(--mdb-tertiary-bg);
    --mdb-table-color: var(--mdb-body-color);
}
[data-mdb-theme=dark] .mw-toggler,
[data-mdb-theme=dark] .years-select,
[data-mdb-theme=dark] .filter-select {
    background-color: var(--mdb-surface-bg);
    border-color: var(--mdb-border-color);
    color: var(--mdb-body-color);
}
[data-mdb-theme=dark] .mw-status {
    background-color: var(--mdb-tertiary-bg);
    color: var(--mdb-body-color);
}
[data-mdb-theme=dark] .navbar-light .navbar-brand img {
    filter: brightness(1.15);
}

/* Dark theme, second pass: the light-theme contrast fixes above pin dark
   greys (muted text, footer, form hints, chat bubbles, status pills), and the
   home hero wave is an SVG with light stops. */
[data-mdb-theme=dark] .text-muted {
    color: #b0b6bf !important;
}
[data-mdb-theme=dark] footer,
[data-mdb-theme=dark] .form-text,
[data-mdb-theme=dark] .mw-chat-meta,
[data-mdb-theme=dark] .mw-chat-system {
    color: #c3c8cf;
}
[data-mdb-theme=dark] footer a {
    color: var(--mw-brand-blue);
}
[data-mdb-theme=dark] .mw-chat-agent .mw-chat-text {
    background: #3a3f47;
    color: #e5e7eb;
}
[data-mdb-theme=dark] .mw-card-icon.mw-icon-warning {
    color: #f3c766;
}
[data-mdb-theme=dark] .mw-status.mw-status-on {
    color: #5fd38d;
}
[data-mdb-theme=dark] .mw-status.mw-status-off {
    color: #f28b9c;
}
[data-mdb-theme=dark] .mw-secret {
    background-color: var(--mdb-tertiary-bg);
    color: var(--mdb-body-color);
}
[data-mdb-theme=dark] .mw-hero-wave stop:first-child {
    stop-color: #2b313b;
}
[data-mdb-theme=dark] .mw-hero-wave stop:last-child {
    stop-color: #34445e;
}
/* 14-day money-back guarantee badge (fragments/guarantee.html). */
.mw-guarantee-badge {
    background-color: #e3f6e8;
    color: #146c2e;
    border: 1px solid #b7e4c4;
}
.mw-guarantee-badge:hover,
.mw-guarantee-badge:focus {
    background-color: #d2f0db;
    color: #0f5524;
}
[data-mdb-theme=dark] .mw-guarantee-badge {
    background-color: #183a24;
    color: #9be3b0;
    border-color: #2a5c3a;
}
/* Header account menu and language popup. */
.mw-account-button {
    text-transform: none;
    font-size: 0.95rem;
    max-width: 14rem;
    color: inherit;
    padding: 0.2rem 0.6rem 0.2rem 0.2rem;
    border-radius: 2rem;
    box-shadow: none !important;
}
.mw-account-button:hover,
.mw-account-button[aria-expanded="true"] {
    background: rgba(var(--mdb-primary-rgb), 0.08);
}
.mw-user-avatar {
    width: 2.1rem;
    height: 2.1rem;
    border-radius: 50%;
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.85rem;
    flex: none;
    letter-spacing: 0.02em;
}
.mw-user-avatar-lg {
    width: 4rem;
    height: 4rem;
    font-size: 1.35rem;
}
img.mw-user-avatar {
    object-fit: cover;
    background: var(--mdb-secondary-bg, #eee);
}
.mw-user-avatar-xl {
    width: 9rem;
    height: 9rem;
    font-size: 3rem;
}
/* Outlook: hovering the large avatar offers "Change your picture". */
.mw-avatar-change {
    position: relative;
    display: inline-flex;
    border-radius: 50%;
    flex: none;
}
.mw-avatar-camera {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    background: rgba(0, 0, 0, 0.45);
    opacity: 0;
    transition: opacity 0.15s;
}
.mw-avatar-change:hover .mw-avatar-camera,
.mw-avatar-change:focus-visible .mw-avatar-camera {
    opacity: 1;
}
.mw-account-button span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.mw-account-dropdown {
    width: 21rem;
    max-width: calc(100vw - 1.5rem);
}
/* Name, company and e-mail stay on one line each (cut with an ellipsis, full text in the title). */
.min-w-0 {
    min-width: 0;
}
.mw-account-dropdown .min-w-0 {
    flex: 1 1 auto;
}
/* AI connector: the robot badge on the panel home's prompt bar and the connector page. */
.mw-ai-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    background: rgba(var(--mdb-primary-rgb), 0.1);
    color: var(--mdb-primary);
    flex: none;
}
/* The one-line setup prompt in that bar: it wraps instead of widening the card. */
.mw-ai-prompt-text {
    flex: 1 1 18rem;
    min-width: 0;
}
.mw-ai-prompt {
    padding: 0.4rem 0.6rem;
    border-radius: 0.375rem;
    background: var(--mdb-tertiary-bg, rgba(0, 0, 0, 0.04));
    color: var(--mdb-body-color);
}
/* The AI connector's public page (ai/connector.html): hero, the example terminal, assistant chips. */
.mw-ai-hero {
    background: linear-gradient(180deg, hsl(217, 88%, 93%) 0%, hsl(217, 100%, 99%) 100%);
}
[data-mdb-theme="dark"] .mw-ai-hero {
    background: linear-gradient(180deg, rgba(var(--mdb-primary-rgb), 0.18) 0%, transparent 100%);
}
.mw-ai-terminal {
    border-radius: 0.75rem;
    overflow: hidden;
    background: #0f172a;
    color: #e2e8f0;
    text-align: start;
}
.mw-ai-terminal-bar {
    display: flex;
    gap: 0.4rem;
    padding: 0.7rem 0.9rem;
    background: #1e293b;
}
.mw-ai-terminal-bar span {
    width: 0.7rem;
    height: 0.7rem;
    border-radius: 50%;
    background: #475569;
}
.mw-ai-terminal-body {
    padding: 1.1rem 1.25rem 1.3rem;
    font-size: 0.85rem;
    line-height: 1.6;
    white-space: pre-wrap;
    color: inherit;
}
.mw-ai-you {
    color: #93c5fd;
    font-weight: 600;
}
.mw-ai-tool {
    color: #c4b5fd;
}
.mw-ai-ok {
    color: #4ade80;
}
.mw-ai-client {
    padding: 0.45rem 0.9rem;
    border-radius: 2rem;
    background: rgba(var(--mdb-primary-rgb), 0.1);
    color: var(--mdb-primary);
    font-weight: 600;
}
.mw-ai-step {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background: var(--mdb-primary);
    color: #fff;
    font-weight: 700;
    flex: none;
}
.mw-account-dropdown .dropdown-item.active,
.mw-account-dropdown .dropdown-item:active {
    background-color: var(--mdb-primary);
    color: #fff;
}
/* Staff apps grid (Google's app launcher): round button, tiles of three. */
.mw-apps-button {
    width: 2.4rem;
    height: 2.4rem;
    padding: 0;
    border-radius: 50%;
    color: inherit;
    font-size: 1.15rem;
    box-shadow: none;
}
.mw-apps-button:hover,
.mw-apps-button[aria-expanded="true"] {
    background: rgba(var(--mdb-primary-rgb), 0.08);
    color: inherit;
}
.mw-apps-dropdown {
    width: 19rem;
    max-width: calc(100vw - 2rem);
    padding: 0.75rem;
    border-radius: 1.25rem;
}
.mw-apps-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.25rem;
    padding: 0.5rem;
    border-radius: 1rem;
    background: var(--mdb-tertiary-bg, rgba(0, 0, 0, 0.03));
}
.mw-app-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    padding: 0.75rem 0.25rem;
    border-radius: 0.9rem;
    color: var(--mdb-body-color);
    font-size: 0.9rem;
    text-align: center;
}
.mw-app-tile:hover,
.mw-app-tile:focus-visible,
.mw-app-tile.active {
    background: rgba(var(--mdb-primary-rgb), 0.1);
    color: var(--mdb-body-color);
}
.mw-app-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3rem;
    height: 3rem;
    border-radius: 0.9rem;
    color: #fff;
    font-size: 1.35rem;
}
.mw-app-work { background: linear-gradient(135deg, #34a853, #188038); }
.mw-app-drive { background: linear-gradient(135deg, #4285f4, #1967d2); }
.mw-app-erp { background: linear-gradient(135deg, #f9ab00, #e37400); }
.mw-app-analytics { background: linear-gradient(135deg, #a142f4, #7627bb); }
.mw-flag {
    border-radius: 2px;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.12);
    object-fit: cover;
    flex-shrink: 0;
}
.mw-language-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border: 1px solid var(--mdb-border-color);
    border-radius: 0.5rem;
    color: var(--mdb-body-color);
    text-decoration: none;
}
.mw-language-option:hover,
.mw-language-option:focus {
    border-color: var(--mdb-primary);
    color: var(--mdb-body-color);
}
.mw-language-option.active {
    border: 2px solid var(--mdb-primary);
    padding: calc(0.75rem - 1px) calc(1rem - 1px);
    font-weight: 600;
}

/* Theme choices fold out under "Select theme"; the chevron turns with them. */
.mw-theme-select .mw-chevron {
    transition: transform 0.2s ease;
}
.mw-theme-select[aria-expanded="true"] .mw-chevron {
    transform: rotate(180deg);
}

/* Below lg the header links live in a drawer from the left. */
@media (max-width: 991.98px) {
    .mw-drawer {
        width: min(20rem, 85vw) !important;
    }
    .mw-drawer .offcanvas-header {
        border-bottom: 1px solid var(--mdb-border-color);
    }
    .mw-drawer .mw-nav-links {
        width: 100%;
    }
    .mw-drawer .nav-link {
        display: flex;
        align-items: center;
        padding: 0.8rem 1rem !important;
        font-size: 1.05rem;
        border-radius: 0.5rem;
        border-bottom: 0 !important;
        text-decoration: none !important;
        text-align: left;
    }
    .mw-drawer .nav-link:hover {
        background-color: var(--mdb-tertiary-bg);
    }
    .mw-drawer .nav-link.active {
        background-color: var(--mdb-primary-bg-subtle);
        color: var(--mdb-primary);
        font-weight: 600;
    }
}

/* No-JavaScript fallbacks (instead of <noscript>): shown until the head script marks <html class="mw-js">. */
.mw-js .mw-nojs { display: none !important; }

/* "Request refund" on the account page: the summary is the button. */
.mw-refund-request > summary { list-style: none; }
.mw-refund-request > summary::-webkit-details-marker { display: none; }

/* Show/hide button on password fields (js/password-toggle.js). */
.mw-pw-holder { position: relative; }
.mw-pw-input.form-control { padding-right: 2.5rem; }
.mw-pw-toggle {
    position: absolute; top: 0; right: 0; bottom: 0; z-index: 3;
    width: 2.5rem; display: flex; align-items: center; justify-content: center;
    border: 0; background: transparent; color: #6c757d; cursor: pointer; padding: 0;
}
.mw-pw-toggle:hover, .mw-pw-toggle:focus-visible { color: #212529; }
.mw-pw-toggle:focus-visible { outline: 2px solid #3b71ca; outline-offset: -2px; border-radius: .25rem; }
.form-control-sm.mw-pw-input + .mw-pw-toggle { width: 2rem; font-size: .8rem; }

/* Currency popup: options look like the language ones, a symbol in place of the flag. */
.mw-currency-symbol {
    display: inline-flex; align-items: center; justify-content: center;
    width: 28px; height: 18px; flex-shrink: 0;
    border-radius: 2px; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.12);
    font-size: 0.75rem; font-weight: 600; color: var(--mdb-primary);
}

/* ==================================================================
   Dashboard shell: /admin/** and the control panel (/panel/**, and the
   /account tools that carry the panel rail). Modelled on the MDB admin
   dashboard templates: a pale page, a gradient band across the top that
   the first cards overlap, sidenav-style rails and icon-tile stat cards.

   Pages opt in by including fragments/admin-nav or fragments/panel-nav;
   main:has(...) picks that up, so no page or controller sets a flag.
   ================================================================== */
:root {
    --mw-dash-bg: #f4f7fb;
    --mw-dash-band: linear-gradient(120deg, #bcd0ee 0%, #d6e2f4 55%, #e9f0fa 100%);
    --mw-dash-card-shadow: 0 2px 15px -3px rgba(0, 0, 0, 0.07), 0 10px 20px -2px rgba(0, 0, 0, 0.04);
    --mw-dash-hover: rgba(59, 113, 202, 0.06);
    --mw-dash-active: rgba(59, 113, 202, 0.12);
}

/* The band is a background layer, not a ::before: a stacking context on <main>
   would trap the sidebar drawer (fixed, inside main) under the test banner. */
main:has(.admin-rail, .panel-rail) {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    padding-top: 2.5rem;
    padding-bottom: 3.5rem;
    background-color: var(--mw-dash-bg);
    background-image: var(--mw-dash-band);
    background-repeat: no-repeat;
    background-size: 100% 14rem;
}

/* Cards on a dashboard: borderless, soft shadow, rounded like the rails. */
main:has(.admin-rail, .panel-rail) .card {
    border: 0;
    border-radius: 1rem;
    box-shadow: var(--mw-dash-card-shadow);
}

main:has(.admin-rail, .panel-rail) .card > .card-header:first-child {
    border-radius: 1rem 1rem 0 0;
}

/* Rails: the MDB sidenav look, a white card with quiet group headings and
   a tinted active item with a bar on its left edge. */
.mw-rail-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 0.75rem 1rem;
    margin-bottom: 0.5rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.admin-rail .text-uppercase,
.panel-rail p.text-uppercase,
.panel-rail label.text-uppercase {
    font-size: 0.7rem;
    letter-spacing: 0.08em;
    padding-left: 0.9rem !important;
}

.admin-rail .nav,
.panel-rail .nav {
    gap: 0.125rem !important;
}

.admin-rail .nav-link,
.panel-rail .nav-link {
    position: relative;
    font-family: var(--mw-font-stack);
    font-size: 0.9rem;
    color: var(--mw-body-color);
    text-decoration: none;
    /* Undo MDB's nav-pills look (uppercase grey pills with a margin). */
    text-transform: none;
    font-weight: 400;
    line-height: 1.4;
    margin: 0;
    background-color: transparent;
    padding: 0.5rem 0.9rem !important;
    border-radius: 0.6rem !important;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.admin-rail .nav-link .fa-fw,
.panel-rail .nav-link .fa-fw {
    color: #7a8494;
    transition: color 0.15s ease;
}

.admin-rail .nav-link:hover,
.admin-rail .nav-link:focus-visible,
.panel-rail .nav-link:hover,
.panel-rail .nav-link:focus-visible {
    color: var(--mw-brand-blue);
    background-color: var(--mw-dash-hover);
}

.admin-rail .nav-link:hover .fa-fw,
.panel-rail .nav-link:hover .fa-fw {
    color: var(--mw-link-blue);
}

.admin-rail .nav-link.active,
.panel-rail .nav-link.active {
    color: var(--mw-brand-blue);
    background-color: var(--mw-dash-active);
    box-shadow: none;
}

.admin-rail .nav-link.active .fa-fw,
.panel-rail .nav-link.active .fa-fw {
    color: var(--mw-link-blue);
}

.admin-rail .nav-link.active::before,
.panel-rail .nav-link.active::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.45rem;
    bottom: 0.45rem;
    width: 3px;
    border-radius: 3px;
    background-color: var(--mw-link-blue);
}

/* Page head: the title card that sits on the band (MDB "Order dashboard"). */
.mw-page-head {
    background-color: #fff;
    border-radius: 1rem;
    box-shadow: var(--mw-dash-card-shadow);
    padding: 1.5rem 1.75rem;
    margin-bottom: 1.5rem;
}

.mw-page-head h1 {
    font-size: calc(1.375rem + 1.2vw);
    letter-spacing: -0.01em;
}

@media (min-width: 1200px) {
    .mw-page-head h1 {
        font-size: 2.25rem;
    }
}

.mw-page-head .breadcrumb {
    font-size: 0.85rem;
}

/* Stat card: icon tile, label, big number, optional footer link. */
.mw-stat .mw-stat-value {
    font-size: 1.6rem;
    font-weight: 700;
    line-height: 1.15;
    color: #262626;
    font-variant-numeric: tabular-nums;
}

.mw-stat .mw-stat-label {
    font-size: 0.85rem;
    color: #5a5a5a;
}

.mw-stat .card-footer {
    background: transparent;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    padding: 0.6rem 1.25rem;
    font-size: 0.85rem;
}

.mw-card-icon.mw-icon-success {
    background-color: rgba(20, 164, 77, 0.12);
    color: #0b6b31;
}

.mw-card-icon.mw-icon-danger {
    background-color: rgba(220, 76, 100, 0.12);
    color: #a3243b;
}

.mw-card-icon.mw-icon-info {
    background-color: rgba(84, 180, 211, 0.15);
    color: #1f6f8b;
}

.mw-card-icon.mw-icon-muted {
    background-color: rgba(0, 0, 0, 0.05);
    color: #5a5a5a;
}

/* Dashboard card head: title left, a link or action right. */
.mw-dash-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.mw-dash-head h2 {
    font-size: 1rem;
    font-weight: 700;
    margin: 0;
}

/* Tables in dashboard cards: quiet uppercase heads, roomy rows. */
.mw-dash-table thead th {
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #5a5a5a;
    background: transparent;
    border-bottom-width: 1px;
    white-space: nowrap;
}

.mw-dash-table td,
.mw-dash-table th {
    padding: 0.85rem 1.25rem;
}

/* Shortcut tile: a whole-card link to a section. */
.mw-shortcut {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    height: 100%;
    padding: 1rem 1.1rem;
    border-radius: 1rem;
    background-color: #fff;
    box-shadow: var(--mw-dash-card-shadow);
    color: var(--mw-body-color);
    text-decoration: none;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.mw-shortcut:hover,
.mw-shortcut:focus-visible {
    color: var(--mw-brand-blue);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px -4px rgba(0, 0, 0, 0.12), 0 12px 24px -6px rgba(0, 0, 0, 0.06);
}

@media (prefers-reduced-motion: reduce) {
    .mw-shortcut,
    .admin-rail .nav-link,
    .panel-rail .nav-link {
        transition: none;
    }

    .mw-shortcut:hover,
    .mw-shortcut:focus-visible {
        transform: none;
    }
}

/* Initials avatar for accounts. */
.mw-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 50%;
    background: linear-gradient(135deg, #3b71ca, #6a93d8);
    color: #fff;
    font-weight: 700;
    font-size: 1rem;
    flex-shrink: 0;
    text-transform: uppercase;
}

/* Attention list: one row per thing waiting, count pill on the right. */
.mw-attention .list-group-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1.25rem;
    border-color: rgba(0, 0, 0, 0.05);
    color: var(--mw-body-color);
}

.mw-attention a.list-group-item:hover {
    background-color: var(--mw-dash-hover);
}

/* Dark theme for the dashboard shell. */
[data-mdb-theme=dark] {
    --mw-dash-bg: #17191d;
    --mw-dash-band: linear-gradient(120deg, #1f3557 0%, #1d2a3f 55%, #1a2130 100%);
    --mw-dash-card-shadow: 0 2px 15px -3px rgba(0, 0, 0, 0.5);
    --mw-dash-hover: rgba(138, 180, 248, 0.08);
    --mw-dash-active: rgba(138, 180, 248, 0.16);
}

[data-mdb-theme=dark] .mw-page-head,
[data-mdb-theme=dark] .mw-shortcut {
    background-color: #24272c;
}

[data-mdb-theme=dark] .mw-stat .mw-stat-value {
    color: #f1f3f5;
}

[data-mdb-theme=dark] .mw-stat .mw-stat-label,
[data-mdb-theme=dark] .mw-dash-table thead th {
    color: #b0b6bf;
}

[data-mdb-theme=dark] .admin-rail .nav-link .fa-fw,
[data-mdb-theme=dark] .panel-rail .nav-link .fa-fw {
    color: #9aa3b0;
}

[data-mdb-theme=dark] .mw-rail-brand,
[data-mdb-theme=dark] .mw-dash-head,
[data-mdb-theme=dark] .mw-stat .card-footer {
    border-color: rgba(255, 255, 255, 0.08);
}

[data-mdb-theme=dark] .mw-card-icon.mw-icon-success { color: #5fd38d; }
[data-mdb-theme=dark] .mw-card-icon.mw-icon-danger { color: #f28b9c; }
[data-mdb-theme=dark] .mw-card-icon.mw-icon-info { color: #7fd0ea; }
[data-mdb-theme=dark] .mw-card-icon.mw-icon-muted { color: #b0b6bf; background-color: rgba(255, 255, 255, 0.06); }

/* Dashboard pages after the MDB app templates (chat, mailbox, user
   management, invoice, user profile). */
.mw-avatar.mw-avatar-sm {
    width: 2.25rem;
    height: 2.25rem;
    font-size: 0.85rem;
}

.mw-avatar.mw-avatar-xl {
    width: 5.5rem;
    height: 5.5rem;
    font-size: 2rem;
    box-shadow: 0 0 0 4px var(--mdb-body-bg, #fff), 0 0 0 5px rgba(59, 113, 202, 0.25);
}

.mw-avatar.mw-avatar-muted {
    background: #9aa3b0;
}

.mw-dash-search {
    flex: 0 1 18rem;
    min-width: 12rem;
}

/* Chat app: one card, conversations left, the thread right. */
.mw-chat-app-side {
    border-right: 1px solid rgba(0, 0, 0, 0.06);
}

.mw-chat-app .admin-chat-list {
    max-height: 560px;
}

.mw-chat-app .admin-chat-list .list-group-item {
    border-left: 0;
    border-right: 0;
}

.mw-chat-app .admin-chat-list .list-group-item.active .text-muted {
    color: rgba(255, 255, 255, 0.85) !important;
}

.mw-chat-app .admin-chat-thread .mw-chat-messages {
    /* flex: 1 would set the basis to 0 in this column and ignore the height. */
    flex: 1 1 auto;
    height: 460px;
    background-color: var(--mw-dash-bg);
}

.mw-chat-app .mw-dash-head {
    justify-content: flex-start;
}

@media (max-width: 767.98px) {
    .mw-chat-app-side {
        border-right: 0;
        border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    }

    .mw-chat-app .admin-chat-list {
        max-height: 260px;
    }
}

/* Mailbox: folders left, rows that open in place. */
.mw-mailbox-side {
    border-right: 1px solid rgba(0, 0, 0, 0.06);
}

.mw-folder {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 0;
    border-radius: 0.6rem;
    background: transparent;
    color: var(--mw-body-color);
    font-size: 0.9rem;
    text-align: left;
}

.mw-folder:hover,
.mw-folder:focus-visible {
    background-color: var(--mw-dash-hover);
    color: var(--mw-brand-blue);
}

.mw-folder.active {
    background-color: var(--mw-dash-active);
    color: var(--mw-brand-blue);
    font-weight: 600;
}

.mw-mail {
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.mw-mail > summary {
    list-style: none;
    cursor: pointer;
    padding: 0.75rem 1rem;
}

.mw-mail > summary::-webkit-details-marker {
    display: none;
}

.mw-mail > summary:hover,
.mw-mail[open] > summary {
    background-color: var(--mw-dash-hover);
}

.mw-mail-unread .mw-mail-from,
.mw-mail-unread .mw-mail-subject {
    font-weight: 700;
}

.mw-mail-unread > summary {
    box-shadow: inset 3px 0 0 var(--mw-link-blue);
}

.mw-mail-body {
    padding: 0.75rem 1rem 1rem 4.25rem;
}

@media (max-width: 767.98px) {
    .mw-mailbox-side {
        border-right: 0;
        border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    }

    .mw-folder {
        width: auto;
    }

    .mw-mail-body {
        padding-left: 1rem;
    }
}

/* Profile: account rows in the side card. */
.mw-account-row {
    border: 1px solid rgba(0, 0, 0, 0.08);
    text-decoration: none;
}

.mw-account-row:hover,
.mw-account-row:focus-visible {
    background-color: var(--mw-dash-hover);
    border-color: rgba(59, 113, 202, 0.3);
}

/* Invoice totals and the printed order. */
.mw-invoice-totals dt,
.mw-invoice-totals dd {
    padding-top: 0.2rem;
}

@media print {
    .admin-rail,
    .panel-rail,
    header.sticky-top,
    body > header,
    footer,
    .mw-chat-toggle {
        display: none !important;
    }

    main:has(.admin-rail, .panel-rail) {
        padding: 0 !important;
        background: #fff !important;
    }

    main:has(.admin-rail, .panel-rail) {
        background-image: none !important;
    }

    main:has(.admin-rail, .panel-rail) .card {
        box-shadow: none !important;
        border: 1px solid #ddd !important;
    }

    main:has(.admin-rail) .col-lg-9 {
        flex: 0 0 100%;
        max-width: 100%;
    }
}

[data-mdb-theme=dark] .mw-chat-app-side,
[data-mdb-theme=dark] .mw-mailbox-side,
[data-mdb-theme=dark] .mw-mail,
[data-mdb-theme=dark] .mw-account-row {
    border-color: rgba(255, 255, 255, 0.08);
}

[data-mdb-theme=dark] .mw-avatar.mw-avatar-muted {
    background: #5b6370;
}

/* ------------------------------------------------------------------
   Logo: the long word mark from lg up, the short MW mark below it.
   ------------------------------------------------------------------ */
.navbar-brand .mw-logo-long {
    display: none;
    height: 30px;
    width: auto;
}

@media (min-width: 992px) {
    .navbar-brand .mw-logo-short {
        display: none;
    }

    .navbar-brand .mw-logo-long {
        display: inline-block;
    }
}

/* ------------------------------------------------------------------
   Dashboard top bar (MDB admin templates): menu button, search,
   area switch, notifications, language and the account menu.
   ------------------------------------------------------------------ */
:root {
    --mw-sidenav-w: 250px;
}

/* The header's menus (account, language, apps) are z-index 1000 inside the navbar; lift
   the navbar to Bootstrap's header level so sticky page content (.sticky-*-top, 1020),
   such as the profile card, cannot paint over them. Stays under the sidenav (1035). */
body > header > .navbar {
    z-index: 1030;
}

.mw-topbar {
    min-height: 64px;
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.06) !important;
}

.mw-topbar-search {
    align-items: center;
    width: min(26rem, 40vw);
    border: 1px solid rgba(0, 0, 0, 0.15);
    border-radius: 0.5rem;
    padding-left: 0.25rem;
    background-color: var(--mdb-body-bg, #fff);
}

/* Control panel header: the domain and account menu (fragments/layout.html, mw-switcher.js). */
.mw-switcher-toggle {
    max-width: min(18rem, 45vw);
    text-transform: none;
    font-weight: 500;
    box-shadow: none;
}

.mw-switcher-menu {
    width: min(28rem, 90vw);
}

.mw-switcher-list {
    max-height: 60vh;
    overflow-y: auto;
}

.mw-switcher-list .dropdown-item-text {
    padding: 0.5rem 1rem;
}

.mw-topbar-search .form-control {
    border: 0;
    box-shadow: none;
    background: transparent;
}

.mw-topbar-search:focus-within {
    border-color: var(--mw-link-blue);
    box-shadow: 0 0 0 1px var(--mw-link-blue);
}

/* Every top-bar control (area switch, bell, flag, cart) is the same 36px target
   with a glyph the size of the 24x16 flag, so the row reads evenly. */
.mw-topbar-icon,
.mw-topbar-link {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.25rem;
    height: 2.25rem;
    padding: 0 0.4rem;
    border-radius: 0.5rem;
    line-height: 1;
    box-shadow: none !important;
}

.mw-topbar-icon {
    color: #6c7686;
}

.mw-topbar-icon > .fas,
.mw-topbar-link > .fas,
.navbar .fa-shopping-cart {
    font-size: 1.15rem;
    width: 1.5rem;
    text-align: center;
}

.mw-topbar-icon > .mw-flag {
    width: 24px;
    height: 16px;
}

.mw-topbar-icon:hover,
.mw-topbar-link:hover {
    background-color: var(--mw-dash-hover);
}

.mw-topbar-icon:hover,
.mw-topbar-icon:focus-visible {
    color: var(--mw-brand-blue);
}

.mw-topbar-icon .badge-notification {
    position: absolute;
    top: 0.05rem;
    right: 0;
    font-size: 0.6rem;
}

.mw-topbar-link {
    color: #6c7686;
    font-size: 0.9rem;
    text-decoration: none;
    white-space: nowrap;
}

.mw-topbar-link:hover,
.mw-topbar-link:focus-visible {
    color: var(--mw-brand-blue);
}

.mw-topbar-menu {
    min-width: 15rem;
}

/* The menu button only shows when the page has a sidebar to open, and only below lg. */
.mw-sidenav-toggle {
    display: none !important;
}

@media (max-width: 991.98px) {
    body:has(#mw-sidenav) .mw-sidenav-toggle {
        display: inline-flex !important;
    }
}

/* ------------------------------------------------------------------
   Sidebar (#mw-sidenav, the admin or control-panel rail).
   Below lg: an MDB offcanvas drawer. From lg: fixed full height on the
   left, the header, page and footer start to its right.
   ------------------------------------------------------------------ */
#mw-sidenav .mw-sidenav-logo {
    align-items: center;
    justify-content: center;
    padding: 1.25rem 1rem 1rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    margin-bottom: 0.5rem;
}

#mw-sidenav .mw-sidenav-logo img {
    height: 30px;
    width: auto;
}

@media (max-width: 991.98px) {
    #mw-sidenav {
        width: min(var(--mw-sidenav-w) + 30px, 85vw);
    }

    /* Logo centred as on the desktop sidebar; the close button sits on the right edge. */
    #mw-sidenav .offcanvas-header {
        position: relative;
        justify-content: center;
        min-height: 4.5rem;
        border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    }

    #mw-sidenav .offcanvas-header .btn-close {
        position: absolute;
        right: 1rem;
        top: 50%;
        transform: translateY(-50%);
        margin: 0;
    }

    #mw-sidenav .mw-sidenav-inner {
        overflow-y: auto;
        padding: 0.5rem;
    }

    #mw-sidenav .offcanvas-header img {
        height: 28px;
        width: auto;
    }
}

@media (min-width: 992px) {
    body:has(#mw-sidenav) {
        padding-left: var(--mw-sidenav-w);
    }

    /* The sidebar carries the logo, so the top bar leaves it out (as in MDB). */
    body:has(#mw-sidenav) .mw-topbar .navbar-brand {
        display: none;
    }

    body #mw-sidenav.offcanvas-lg {
        position: fixed !important;
        top: 0;
        bottom: 0;
        left: 0;
        width: var(--mw-sidenav-w);
        z-index: 1035;
        overflow-y: auto;
        background-color: var(--mdb-surface-bg, #fff) !important;
        border-right: 1px solid rgba(0, 0, 0, 0.06);
        scrollbar-width: thin;
    }

    #mw-sidenav .mw-sidenav-inner {
        padding: 0 0.5rem 1.5rem;
    }

    /* The rail's grid column takes no room; the page column fills the row. */
    .row > .mw-rail-col {
        flex: 0 0 0 !important;
        width: 0 !important;
        max-width: 0 !important;
        padding: 0 !important;
    }

    .row:has(> .mw-rail-col) > :not(.mw-rail-col) {
        flex: 1 0 0;
        width: auto;
        max-width: 100%;
    }

    main:has(#mw-sidenav) > .container {
        max-width: 1400px;
    }
}

/* Inside the sidebar the rail sections are flat, divided by a line (no cards). */
#mw-sidenav .admin-rail-card,
#mw-sidenav.panel-rail .mw-sidenav-inner > div {
    background: transparent !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    padding: 0.25rem 0 !important;
    margin-bottom: 0.5rem !important;
}

#mw-sidenav.panel-rail .mw-sidenav-inner > div + div {
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    padding-top: 0.75rem !important;
}

#mw-sidenav .mw-rail-brand {
    border-bottom: 0;
    margin-bottom: 0;
    padding-top: 0.25rem;
}

/* In the drawer every heading shows (the classes hide them below lg for the old pill row). */
#mw-sidenav p.text-uppercase.d-none {
    display: block !important;
}

#mw-sidenav .mw-rail-brand.d-none {
    display: flex !important;
}

#mw-sidenav .nav {
    flex-direction: column !important;
    flex-wrap: nowrap !important;
}

[data-mdb-theme=dark] .mw-topbar-search {
    border-color: rgba(255, 255, 255, 0.15);
}

[data-mdb-theme=dark] .mw-topbar-icon {
    color: #b0b6bf;
}

[data-mdb-theme=dark] #mw-sidenav,
[data-mdb-theme=dark] #mw-sidenav .mw-sidenav-logo,
[data-mdb-theme=dark] #mw-sidenav .offcanvas-header,
[data-mdb-theme=dark] #mw-sidenav.panel-rail .mw-sidenav-inner > div + div {
    border-color: rgba(255, 255, 255, 0.08);
}

@media print {
    body:has(#mw-sidenav) {
        padding-left: 0 !important;
    }

    #mw-sidenav {
        display: none !important;
    }
}

/* Phones: the header keeps logo, Domains, language, cart and account on one row. */
@media (max-width: 575.98px) {
    .navbar > .container-fluid {
        flex-wrap: nowrap;
    }

    .navbar .navbar-brand + .nav-link {
        padding-left: 0.5rem !important;
        padding-right: 0.5rem !important;
    }

    .navbar .mw-topbar-icon,
    .navbar .mw-topbar-link {
        min-width: 2rem;
        padding-left: 0.2rem;
        padding-right: 0.2rem;
    }
}

/* Admin and control panel footer: one quiet copyright line on the dashboard background. */
footer.mw-dash-footer {
    background-color: var(--mw-dash-bg) !important;
}

footer.mw-dash-footer .mw-copyright {
    background-color: transparent !important;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    padding: 1rem !important;
    font-size: 0.85rem;
    color: #5a5a5a;
}

[data-mdb-theme=dark] footer.mw-dash-footer .mw-copyright {
    border-color: rgba(255, 255, 255, 0.08);
    color: #b0b6bf;
}

/* AI assistant bar (control panel), a compact strip like Simply.com's. */
.mw-ai-bar {
    background-color: var(--mdb-surface-bg, #fff);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 0.75rem;
    padding: 0.6rem 1rem;
}

.mw-ai-bar .mw-ai-icon {
    width: 2rem;
    height: 2rem;
    font-size: 0.95rem;
}

.mw-ai-bar .btn-link {
    text-transform: none;
    font-size: 0.9rem;
}

[data-mdb-theme=dark] .mw-ai-bar {
    border-color: rgba(255, 255, 255, 0.08);
}

/* ------------------------------------------------------------------
   Sidebar groups (Customers, System, Tools, ...): the heading opens and
   closes its list (mw-sidenav.js); without JavaScript all stay open.
   ------------------------------------------------------------------ */
.mw-nav-group {
    display: flex;
    align-items: center;
    width: 100%;
    border: 0;
    background: transparent;
    padding: 0.35rem 0.9rem;
    margin-bottom: 0.25rem;
    font-size: 0.7rem;
    letter-spacing: 0.08em;
    border-radius: 0.5rem;
    text-align: left;
}

.mw-nav-group:hover,
.mw-nav-group:focus-visible {
    color: var(--mw-brand-blue) !important;
    background-color: var(--mw-dash-hover);
}

.mw-nav-group-chevron {
    font-size: 0.65rem;
    transition: transform 0.15s ease;
}

.mw-nav-group[aria-expanded="false"] .mw-nav-group-chevron {
    transform: rotate(-90deg);
}

.mw-nav-group-list.mw-collapsed {
    display: none !important;
}

/* A group that never closes (the control panel's open domain): a label, not a toggle. */
.mw-nav-group.mw-nav-group-static,
.mw-nav-group.mw-nav-group-static:hover {
    cursor: default;
    color: inherit !important;
    background-color: transparent;
}

/* Control panel: the links sit indented under their group heading, like Simply's. */
@media (min-width: 992px) {
    #mw-sidenav.panel-rail .mw-sidenav-inner .mw-nav-group-list {
        padding-left: 1rem;
    }

    html.mw-sidenav-slim #mw-sidenav.panel-rail:not(:hover):not(:has(:focus-visible)) .mw-sidenav-inner .mw-nav-group-list {
        padding-left: 0;
    }
}

.mw-sidenav-logo .mw-sidenav-logo-short {
    display: none;
}

/* Minimize button: pinned to the bottom of the sidebar. */
.mw-sidenav-collapse {
    position: sticky;
    bottom: 0;
    width: 100%;
    align-items: center;
    justify-content: center;
    height: 2.75rem;
    margin-top: auto;
    border: 0;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    background-color: var(--mdb-surface-bg, #fff);
    color: #6c7686;
}

/* Control panel: a fixed top (logo, open account's number) and a fixed bottom (Control panel
   home, What's new, the collapse button); only the links between them scroll. */
#mw-sidenav.panel-rail {
    overflow-y: hidden !important;
}

#mw-sidenav .mw-sidenav-top,
#mw-sidenav .mw-sidenav-foot {
    flex-shrink: 0;
}

#mw-sidenav .mw-sidenav-top {
    padding: 0 0.5rem;
}

#mw-sidenav .mw-sidenav-top .mw-rail-account {
    padding-bottom: 0.5rem;
}

#mw-sidenav.panel-rail .mw-sidenav-inner {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    scrollbar-width: thin;
}

#mw-sidenav .mw-sidenav-foot {
    margin-top: auto;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
}

#mw-sidenav .mw-sidenav-foot > .nav {
    padding: 0.5rem;
}

#mw-sidenav .mw-sidenav-foot > .mw-sidenav-collapse {
    margin-top: 0;
}

[data-mdb-theme=dark] #mw-sidenav .mw-sidenav-foot {
    border-color: rgba(255, 255, 255, 0.08);
}

.mw-sidenav-collapse:hover,
.mw-sidenav-collapse:focus-visible {
    color: var(--mw-brand-blue);
}

.mw-sidenav-collapse .fas {
    transition: transform 0.2s ease;
}

@media (min-width: 992px) {
    body #mw-sidenav.offcanvas-lg {
        display: flex !important;
        flex-direction: column;
        transition: width 0.2s ease, box-shadow 0.2s ease;
        overflow-x: hidden;
    }

    /* ---- Minimized: a 72px icon rail; hovering opens it over the page. ---- */
    html.mw-sidenav-slim body:has(#mw-sidenav) {
        padding-left: 72px;
    }

    html.mw-sidenav-slim body #mw-sidenav.offcanvas-lg {
        width: 72px;
    }

    html.mw-sidenav-slim body #mw-sidenav.offcanvas-lg:hover,
    html.mw-sidenav-slim body #mw-sidenav.offcanvas-lg:has(:focus-visible) {
        width: var(--mw-sidenav-w);
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    }

    html.mw-sidenav-slim .mw-sidenav-collapse .fas {
        transform: rotate(180deg);
    }

    html.mw-sidenav-slim #mw-sidenav:not(:hover):not(:has(:focus-visible)) .mw-sidenav-logo-long {
        display: none;
    }

    html.mw-sidenav-slim #mw-sidenav:not(:hover):not(:has(:focus-visible)) .mw-sidenav-logo-short {
        display: inline-block;
        height: 26px;
        width: auto;
    }

    /* Icons only: labels, group names, the admin brand card and the panel's account switcher go. */
    html.mw-sidenav-slim #mw-sidenav:not(:hover):not(:has(:focus-visible)) .nav-link > span,
    html.mw-sidenav-slim #mw-sidenav:not(:hover):not(:has(:focus-visible)) .mw-nav-group,
    html.mw-sidenav-slim #mw-sidenav:not(:hover):not(:has(:focus-visible)) .mw-rail-brand,
    html.mw-sidenav-slim #mw-sidenav:not(:hover):not(:has(:focus-visible)) .mw-rail-account {
        display: none !important;
    }

    /* Every icon shows while minimized, also those of closed groups. */
    html.mw-sidenav-slim #mw-sidenav:not(:hover):not(:has(:focus-visible)) .mw-nav-group-list.mw-collapsed {
        display: flex !important;
    }

    html.mw-sidenav-slim #mw-sidenav:not(:hover):not(:has(:focus-visible)) .mw-nav-group-list {
        border-top: 1px solid rgba(0, 0, 0, 0.06);
        padding-top: 0.35rem;
        margin-top: 0.35rem;
    }

    html.mw-sidenav-slim #mw-sidenav:not(:hover):not(:has(:focus-visible)) .nav-link {
        justify-content: center;
    }

    html.mw-sidenav-slim #mw-sidenav:not(:hover):not(:has(:focus-visible)) .nav-link > .fa-fw {
        font-size: 1.05rem;
    }

    /* Counters become a dot on the icon. */
    html.mw-sidenav-slim #mw-sidenav:not(:hover):not(:has(:focus-visible)) .nav-link > .badge {
        position: absolute;
        top: 0.3rem;
        right: 0.55rem;
        width: 0.55rem;
        height: 0.55rem;
        padding: 0;
        font-size: 0;
    }
}

[data-mdb-theme=dark] .mw-sidenav-collapse {
    border-color: rgba(255, 255, 255, 0.08);
    color: #b0b6bf;
}

[data-mdb-theme=dark] html.mw-sidenav-slim #mw-sidenav .mw-nav-group-list,
html.mw-sidenav-slim[data-mdb-theme=dark] #mw-sidenav .mw-nav-group-list {
    border-color: rgba(255, 255, 255, 0.08);
}

/* Searchable dropdown (mw-select.js on <select data-mw-search>), like Simply's country field. */
.mw-select {
    position: relative;
}
.mw-select-native {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    opacity: 0;
    pointer-events: none;
    bottom: 0;
    left: 0;
}
.mw-select-button {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}
.mw-select-panel {
    position: absolute;
    z-index: 1060;
    top: calc(100% + 2px);
    left: 0;
    right: 0;
    background: var(--mdb-surface-bg, #fff);
    border: 1px solid var(--mdb-border-color, #e0e0e0);
    border-radius: .5rem;
    padding: .5rem;
}
.mw-select-list {
    list-style: none;
    margin: .5rem 0 0;
    padding: 0;
    max-height: 16rem;
    overflow-y: auto;
}
.mw-select-option,
.mw-select-empty {
    padding: .375rem .75rem;
    border-radius: .375rem;
}
.mw-select-option {
    cursor: pointer;
}
.mw-select-option:hover,
.mw-select-option.active {
    background: var(--mw-dash-active, rgba(59, 113, 202, 0.12));
}
.mw-select-option[aria-selected="true"] {
    font-weight: 600;
}

/* Account overview: the 0-10 rating buttons, like Simply's "would you recommend us". */
.mw-rating-scale {
    display: grid;
    grid-template-columns: repeat(11, minmax(0, 1fr));
    gap: .25rem;
}
.mw-rating-scale .btn {
    padding-left: 0;
    padding-right: 0;
}
.mw-rating-scale .btn-check:checked + .btn {
    background: var(--mw-link-blue);
    color: #fff;
}

/* Account management: the saved card drawn as a card, like Simply's. */
.mw-pay-card {
    max-width: 330px;
    border-radius: 1rem;
    padding: 1.25rem 1.5rem;
    color: #fff;
    background: linear-gradient(135deg, #1f2937 0%, #374151 60%, #4b5563 100%);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.mw-pay-card .mw-pay-card-number {
    font-size: 1.25rem;
    letter-spacing: .12em;
}
.mw-pay-card .mw-pay-card-label {
    font-size: .65rem;
    letter-spacing: .08em;
    opacity: .75;
    text-transform: uppercase;
}

/* Error messages: the MDB alert component's "alert with icon" variant on
   every .alert-danger (server-rendered, flash or built by a script). An alert
   whose markup already brings its own Font Awesome icon keeps just that one.
   The icon sits on the first line of the text, whatever the alert's padding. */
.alert-danger:not(:has(.fas, .far)) {
    padding-left: calc(var(--mdb-alert-padding-x, 1.5rem) + 1.75rem);
}
.alert-danger:not(:has(.fas, .far))::before {
    content: "\f06a"; /* fa-circle-exclamation */
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    position: absolute;
    top: 0;
    left: var(--mdb-alert-padding-x, 1.5rem);
    padding-top: inherit;
}

/* Admin › Contracts: the signed registrar contract texts keep their paragraphs. */
.mw-contract-text {
    white-space: pre-line;
    overflow-wrap: anywhere;
    font-size: 0.875rem;
}

/* Pop-up alerts, top-right, newest on top (js/mw-toast.js). */
.mw-toasts {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 1090;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    width: min(26rem, calc(100vw - 2rem));
    pointer-events: none;
}
.mw-toasts .mw-toast {
    pointer-events: auto;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin: 0;
    padding: 1rem 1rem 1rem 1.25rem;
    box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.12);
}
.mw-toast-text { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.mw-toast-close {
    flex: 0 0 auto;
    border: 0;
    background: transparent;
    color: inherit;
    font-size: 1.5rem;
    line-height: 1;
    padding: 0 0.25rem;
    opacity: 0.7;
    cursor: pointer;
}
.mw-toast-close:hover, .mw-toast-close:focus-visible { opacity: 1; }
.mw-toast-in { animation: mw-toast-in 0.25s ease-out; }
.mw-toast-out { animation: mw-toast-out 0.25s ease-in forwards; }
@keyframes mw-toast-in { from { opacity: 0; transform: translateX(1.5rem); } to { opacity: 1; transform: none; } }
@keyframes mw-toast-out { to { opacity: 0; transform: translateX(1.5rem); } }
@media (prefers-reduced-motion: reduce) {
    .mw-toast-in, .mw-toast-out { animation: none; }
    .mw-toast-out { opacity: 0; }
}

/* Stripe card field on the SSL pay page (no inline style: CSP). */
.mw-card-element {
    min-height: 48px;
}
