:root {
    color-scheme: light;
    --ink: #172033;
    --muted: #5e6978;
    --line: #d7deea;
    --page: #f4f6f9;
    --surface: #ffffff;
    --surface-soft: #eef3f8;
    --blue: #0a4f8f;
    --blue-dark: #06386b;
    --blue-soft: #dcecfb;
    --nav: #074f8c;
    --nav-hover: #063f70;
    --nav-active: #0c67ac;
    --nav-drop: #dcecff;
    --nav-drop-alt: #edf6ff;
    --nav-drop-hover: #bcdcff;
    --nav-drop-ink: #12395f;
    --red: #b42318;
    --green: #157347;
    --gold: #b88716;
    --shadow: 0 14px 32px rgba(23, 32, 51, 0.08);
}

* {
    box-sizing: border-box;
}

html {
    background: var(--page);
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--ink);
    font-family: "Segoe UI", Arial, Helvetica, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    background: var(--page);
}

a {
    color: var(--blue);
}

a:hover,
a:focus {
    color: var(--blue-dark);
}

img {
    max-width: 100%;
    height: auto;
}

.site-header {
    position: relative;
    z-index: 1000;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
}

.masthead {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 14px 0;
}

.brand {
    display: inline-flex;
    align-items: center;
    min-width: 0;
}

.brand img {
    display: block;
    width: min(390px, 100%);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 0 0 auto;
}

.header-actions a,
.cart-link,
.account-link,
.search-row button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 8px 14px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--surface);
    color: var(--ink);
    font-weight: 700;
    text-decoration: none;
}

.header-actions a:hover,
.cart-link:hover,
.account-link:hover,
.search-row button:hover {
    border-color: var(--blue);
    color: var(--blue-dark);
}

.site-nav {
    position: relative;
    z-index: 1001;
    background: var(--nav);
    box-shadow: 0 2px 0 rgba(6, 56, 107, 0.22);
}

.nav-toggle {
    display: none;
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    min-height: 44px;
    border: 0;
    background: transparent;
    color: #ffffff;
    font: inherit;
    font-weight: 700;
    text-align: left;
}

.primary-menu,
.primary-menu ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.primary-menu {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    display: flex;
    align-items: stretch;
    gap: 0;
}

.primary-menu li {
    position: relative;
}

.primary-menu a {
    display: flex;
    align-items: center;
    min-height: 46px;
    padding: 10px 15px;
    color: #ffffff;
    font-family: "Segoe UI", Arial, Helvetica, sans-serif;
    font-size: 0.9rem;
    font-weight: 700;
    line-height: 1.2;
    text-decoration: none;
    white-space: nowrap;
}

.primary-menu > li > a {
    border-left: 1px solid rgba(255, 255, 255, 0.16);
    border-bottom: 3px solid transparent;
}

.primary-menu > li:last-child > a {
    border-right: 1px solid rgba(255, 255, 255, 0.18);
}

.primary-menu li:hover > a,
.primary-menu li:focus-within > a {
    background: var(--nav-hover);
}

.primary-menu > li:hover > a,
.primary-menu > li:focus-within > a {
    border-bottom-color: #8ec9ff;
}

.primary-menu .has-children > a::after {
    content: "";
    display: inline-block;
    width: 6px;
    height: 6px;
    margin-left: 8px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg) translateY(-2px);
    opacity: 0.72;
}

.primary-menu ul {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 1002;
    display: none;
    min-width: 250px;
    padding: 6px 0;
    background: var(--nav-drop);
    border: 1px solid #a9caed;
    border-top: 0;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 18px 34px rgba(10, 39, 72, 0.16);
}

.primary-menu ul ul {
    top: -1px;
    left: 100%;
    border-top: 1px solid #a9caed;
    border-radius: 8px;
    background: var(--nav-drop-alt);
}

.primary-menu li:hover > ul,
.primary-menu li:focus-within > ul {
    display: block;
}

.primary-menu ul a {
    min-height: 40px;
    padding: 9px 16px;
    color: var(--nav-drop-ink);
    border-left: 3px solid transparent;
    font-size: 0.91rem;
    font-weight: 650;
    white-space: normal;
}

.primary-menu ul a:hover,
.primary-menu ul a:focus {
    color: #083b6c;
    background: var(--nav-drop-hover);
    border-left-color: var(--nav-active);
}

.primary-menu ul li:hover > a,
.primary-menu ul li:focus-within > a {
    color: #ffffff;
    background: var(--nav-active);
    border-left-color: #8ec9ff;
}

.primary-menu ul li + li > a {
    border-top: 1px solid rgba(10, 79, 143, 0.12);
}

.primary-menu ul .has-children > a::after {
    margin-left: auto;
    transform: rotate(-45deg);
    color: currentColor;
}

.site-main {
    position: relative;
    z-index: 1;
    width: min(1180px, calc(100% - 32px));
    margin: 22px auto;
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    grid-template-areas: "left content";
    gap: 20px;
    align-items: start;
}

.left-column {
    grid-area: left;
    display: grid;
    gap: 14px;
    align-content: start;
    align-self: start;
    min-width: 0;
    overflow: hidden;
}

.content-region {
    grid-area: content;
    min-width: 0;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.utility-region,
.side-panel {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    overflow: hidden;
}

.utility-region {
    padding: 14px;
}

.search-box label {
    display: block;
    margin-bottom: 8px;
    color: var(--muted);
    font-weight: 700;
}

.search-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
}

.search-row input {
    min-width: 0;
    min-height: 38px;
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 8px 10px;
    font: inherit;
}

.search-row button {
    background: var(--blue);
    color: #ffffff;
    border-color: var(--blue);
    cursor: pointer;
}

.cart-box {
    display: grid;
    gap: 8px;
    margin-top: 14px;
}

.panel-region {
    display: grid;
    gap: 14px;
    min-width: 0;
}

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

.side-panel h2 {
    margin: 0 0 10px;
    color: var(--blue-dark);
    font-size: 1rem;
    line-height: 1.25;
}

.content-shell {
    padding: 22px;
    min-height: 520px;
}

.content-header {
    margin-bottom: 20px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--line);
}

.eyebrow {
    margin: 0 0 6px;
    color: var(--gold);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: uppercase;
}

.content-header h1,
.notice h1 {
    margin: 0;
    color: var(--blue-dark);
    font-size: 1.8rem;
    line-height: 1.2;
}

.legacy-html {
    min-width: 0;
    overflow-x: auto;
}

.left-column .legacy-html {
    overflow-x: hidden;
}

.legacy-html table {
    max-width: 100%;
}

.legacy-html iframe,
.legacy-html embed,
.legacy-html object,
.legacy-html video {
    max-width: 100%;
}

.legacy-html p:first-child,
.legacy-html h1:first-child,
.legacy-html h2:first-child,
.legacy-html h3:first-child {
    margin-top: 0;
}

.secondary-content {
    margin-top: 22px;
    padding-top: 18px;
    border-top: 1px solid var(--line);
}

.notice {
    padding: 16px;
    border: 1px solid var(--line);
    border-left: 4px solid var(--blue);
    border-radius: 6px;
    background: var(--surface-soft);
}

.notice p {
    margin: 0 0 8px;
}

.notice p:last-child {
    margin-bottom: 0;
}

.notice-error {
    border-left-color: var(--red);
    background: #fff1f0;
}

.notice-info {
    border-left-color: var(--blue);
}

.notice-success {
    border-left-color: var(--green);
    background: #edf9f2;
}

.account-shell {
    display: grid;
    gap: 18px;
}

.account-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: -4px;
}

.account-nav a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 8px 14px;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--blue-dark);
    background: var(--surface-soft);
    font-weight: 700;
    text-decoration: none;
}

.account-nav a:hover,
.account-nav a:focus {
    border-color: var(--blue);
    background: var(--blue-soft);
}

.account-nav a[aria-current="page"] {
    color: #ffffff;
    border-color: var(--blue);
    background: var(--blue);
}

.account-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(240px, 0.72fr);
    gap: 18px;
    align-items: start;
}

.account-card,
.form-section {
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
}

.account-card h2,
.form-section h2 {
    margin: 0 0 14px;
    color: var(--blue-dark);
    font-size: 1.15rem;
}

.account-card p {
    margin: 0 0 16px;
}

.account-card-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 12px;
    align-items: baseline;
}

.account-card-header h2,
.account-card-header p {
    margin: 0;
}

.account-card-narrow {
    max-width: 420px;
}

.account-form {
    display: grid;
    gap: 14px;
}

.account-form-wide {
    gap: 18px;
}

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

.account-grid-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px 16px;
}

.account-form label,
.radio-field {
    display: grid;
    gap: 6px;
    min-width: 0;
    color: var(--ink);
    font-weight: 700;
}

.account-form label span,
.radio-field legend {
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 700;
}

.account-form input,
.account-form select {
    width: 100%;
    min-height: 40px;
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 8px 10px;
    color: var(--ink);
    font: inherit;
    background: #ffffff;
}

.account-form input:focus,
.account-form select:focus {
    outline: 3px solid var(--blue-soft);
    border-color: var(--blue);
}

.radio-field {
    margin: 0;
    padding: 0;
    border: 0;
}

.radio-field label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-right: 18px;
    font-weight: 600;
}

.radio-field input {
    width: auto;
    min-height: auto;
}

.account-inline-field {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 16px;
    align-items: end;
}

.account-inline-field > * {
    flex: 1 1 180px;
}

.subtle-copy {
    margin: 0;
    color: var(--muted);
    font-size: 0.95rem;
}

.button-primary,
.button-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: fit-content;
    min-height: 40px;
    padding: 9px 16px;
    border-radius: 6px;
    border: 1px solid var(--blue);
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
}

.button-primary {
    color: #ffffff;
    background: var(--blue);
}

.button-secondary {
    color: var(--blue-dark);
    background: var(--surface);
}

.button-primary:hover,
.button-primary:focus {
    color: #ffffff;
    background: var(--blue-dark);
}

.button-secondary:hover,
.button-secondary:focus {
    background: var(--blue-soft);
}

.account-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.account-actions-footer {
    justify-content: flex-end;
}

.account-form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.search-form-inline {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
}

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

.account-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.94rem;
}

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

.account-table th {
    color: #ffffff;
    background: var(--blue);
}

.account-table td.numeric,
.account-table th.numeric {
    text-align: right;
}

.account-summary-grid,
.account-address-grid,
.account-totals-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.account-definition-list {
    display: grid;
    grid-template-columns: minmax(140px, auto) minmax(0, 1fr);
    gap: 8px 14px;
    margin: 0;
}

.account-definition-list dt {
    color: var(--muted);
    font-weight: 700;
}

.account-definition-list dd {
    margin: 0;
}

.account-subcard {
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-soft);
}

.account-subcard h3 {
    margin: 0 0 12px;
    color: var(--blue-dark);
    font-size: 1rem;
}

.ticket-thread {
    display: grid;
    gap: 14px;
}

.ticket-entry {
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-soft);
}

.ticket-entry header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 8px 12px;
    margin-bottom: 10px;
}

.ticket-entry h3,
.ticket-entry p {
    margin: 0;
}

.ticket-body {
    color: var(--ink);
    line-height: 1.6;
}

.link-section {
    margin-top: 22px;
}

.link-section h2 {
    margin: 0 0 12px;
    color: var(--blue-dark);
    font-size: 1.2rem;
}

.link-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 10px;
}

.link-tile,
.result-item {
    display: block;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--surface);
    color: var(--ink);
    text-decoration: none;
}

.link-tile {
    min-height: 72px;
    padding: 14px;
    font-weight: 700;
}

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

.result-item {
    padding: 14px 16px;
}

.result-item strong,
.result-item span {
    display: block;
}

.result-item span {
    margin-top: 5px;
    color: var(--muted);
    font-size: 0.92rem;
}

.link-tile:hover,
.link-tile:focus,
.result-item:hover,
.result-item:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 3px var(--blue-soft);
}

.site-footer {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto 28px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--line);
}

.site-footer div {
    padding: 18px;
    background: var(--blue-dark);
    color: #ffffff;
}

.site-footer h2 {
    margin: 0 0 8px;
    font-size: 1rem;
}

.site-footer p {
    margin: 0;
    color: rgba(255, 255, 255, 0.88);
    font-size: 0.92rem;
}

.site-footer a {
    color: #ffffff;
}

@media (max-width: 980px) {
    .masthead {
        align-items: flex-start;
        flex-direction: column;
    }

    .header-actions {
        width: 100%;
        flex-wrap: wrap;
    }

    .nav-toggle {
        display: block;
        font-family: "Segoe UI", Arial, Helvetica, sans-serif;
    }

    .primary-menu {
        display: none;
        width: min(100% - 32px, 1180px);
        padding-bottom: 12px;
        flex-direction: column;
    }

    .primary-menu.is-open {
        display: flex;
    }

    .primary-menu > li > a,
    .primary-menu > li:last-child > a {
        border: 0;
        border-top: 1px solid rgba(255, 255, 255, 0.18);
    }

    .primary-menu ul,
    .primary-menu ul ul {
        position: static;
        display: block;
        min-width: 0;
        padding: 0;
        border: 0;
        border-radius: 0;
        box-shadow: none;
        background: rgba(255, 255, 255, 0.08);
    }

    .primary-menu ul a {
        min-height: 34px;
        padding-left: 28px;
        color: #ffffff;
        border-left: 0;
    }

    .primary-menu ul ul a {
        padding-left: 42px;
    }

    .primary-menu ul a:hover,
    .primary-menu ul a:focus {
        color: #ffffff;
        background: rgba(255, 255, 255, 0.12);
        border-left-color: transparent;
    }

    .site-main {
        display: flex;
        flex-direction: column;
    }

    .account-grid,
    .form-grid,
    .account-grid-form,
    .search-form-inline {
        grid-template-columns: 1fr;
    }

    .account-summary-grid,
    .account-address-grid,
    .account-totals-grid {
        grid-template-columns: 1fr;
    }

    .left-column {
        display: contents;
    }

    .utility-region,
    .content-region,
    .panel-region {
        width: 100%;
    }

    .utility-region {
        order: 1;
    }

    .content-region {
        order: 2;
    }

    .panel-region {
        order: 3;
    }

    .site-footer {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 560px) {
    .masthead,
    .site-main,
    .site-footer {
        width: min(100% - 20px, 1180px);
    }

    .content-shell {
        padding: 16px;
    }

    .account-definition-list {
        grid-template-columns: 1fr;
        gap: 4px 0;
    }

    .header-actions {
        display: grid;
    }

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

    .header-actions a,
    .search-row button,
    .cart-link,
    .account-link {
        width: 100%;
    }
}
