:root {
    --ink-950: #102727;
    --ink-900: #173434;
    --ink-800: #214443;
    --ink-700: #315654;
    --paper: #f3efe6;
    --paper-deep: #e9e3d7;
    --surface: #fffdf8;
    --surface-soft: #f8f5ed;
    --amber: #edae49;
    --amber-deep: #c98018;
    --coral: #c7684d;
    --sage: #6e8d7e;
    --sage-pale: #e4eee6;
    --rose-pale: #f6e7e2;
    --amber-pale: #f9edcf;
    --line: #d9d2c4;
    --line-strong: #c9c0b0;
    --text: #233230;
    --muted: #68726e;
    --shadow: 0 18px 45px rgba(31, 44, 40, .08);
    --shadow-small: 0 8px 24px rgba(31, 44, 40, .07);
    --radius: 18px;
    --radius-small: 10px;
    color-scheme: light;
    font-family: "Avenir Next", "Nunito Sans", "Helvetica Neue", Arial, sans-serif;
    font-synthesis: none;
}

*, *::before, *::after {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    scroll-behavior: smooth;
}

body {
    background: var(--paper);
    color: var(--text);
    margin: 0;
    min-height: 100vh;
    text-rendering: optimizeLegibility;
}

button, input, select {
    font: inherit;
}

a {
    color: inherit;
}

h1, h2, h3, p {
    margin-top: 0;
}

h1, h2, h3, strong {
    letter-spacing: -.025em;
}

h1:focus {
    outline: none;
}

:focus-visible {
    outline: 3px solid rgba(237, 174, 73, .6);
    outline-offset: 3px;
}

.sr-only {
    clip: rect(0, 0, 0, 0);
    clip-path: inset(50%);
    height: 1px;
    overflow: hidden;
    position: absolute;
    white-space: nowrap;
    width: 1px;
}

.muted {
    color: var(--muted);
}

.eyebrow {
    color: var(--coral);
    font-size: .72rem;
    font-weight: 850;
    letter-spacing: .13em;
    margin-bottom: .65rem;
    text-transform: uppercase;
}

.button {
    align-items: center;
    border: 1px solid transparent;
    border-radius: 999px;
    cursor: pointer;
    display: inline-flex;
    font-size: .88rem;
    font-weight: 800;
    gap: .65rem;
    justify-content: center;
    min-height: 2.9rem;
    padding: .72rem 1.2rem;
    text-decoration: none;
    transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.button:hover:not(:disabled) {
    transform: translateY(-1px);
}

.button:disabled {
    cursor: not-allowed;
    opacity: .52;
}

.button-primary {
    background: var(--ink-900);
    box-shadow: 0 8px 20px rgba(23, 52, 52, .18);
    color: #fffdf7;
}

.button-primary:hover:not(:disabled) {
    background: var(--ink-800);
    box-shadow: 0 12px 26px rgba(23, 52, 52, .22);
}

.button-accent {
    background: var(--amber);
    box-shadow: 0 8px 20px rgba(201, 128, 24, .17);
    color: var(--ink-950);
}

.button-accent:hover {
    background: #f3ba60;
}

.button-secondary {
    background: var(--surface);
    border-color: var(--line);
    color: var(--ink-900);
}

.button-secondary:hover {
    border-color: var(--ink-700);
}

.button-wide {
    width: 100%;
}

.spinner {
    animation: spin 800ms linear infinite;
    border: 2px solid rgba(23, 52, 52, .2);
    border-radius: 50%;
    border-top-color: var(--ink-900);
    display: inline-block;
    height: 1rem;
    width: 1rem;
}

.spinner-light {
    border-color: rgba(255, 255, 255, .3);
    border-top-color: white;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Authenticated shell */
.app-shell {
    display: grid;
    grid-template-columns: 17.5rem minmax(0, 1fr);
    min-height: 100vh;
}

.sidebar {
    background:
        radial-gradient(circle at 10% 8%, rgba(237, 174, 73, .12), transparent 23rem),
        var(--ink-900);
    color: #f8f2e7;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    padding: 1.5rem 1.15rem 1.1rem;
    position: sticky;
    top: 0;
}

.brand {
    align-items: center;
    display: flex;
    gap: .85rem;
    padding: .15rem .45rem 2rem;
    text-decoration: none;
}

.brand-mark {
    align-items: center;
    background: var(--amber);
    border-radius: 11px 11px 11px 3px;
    color: var(--ink-950);
    display: inline-flex;
    font-size: .8rem;
    font-weight: 950;
    height: 2.45rem;
    justify-content: center;
    letter-spacing: -.03em;
    width: 2.45rem;
}

.brand-copy {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}

.brand-copy strong {
    font-size: 1rem;
}

.brand-copy small {
    color: #a9bbb5;
    font-size: .7rem;
    letter-spacing: .05em;
    margin-top: .2rem;
    text-transform: uppercase;
}

.nav-label {
    color: #7f9b93;
    font-size: .64rem;
    font-weight: 900;
    letter-spacing: .14em;
    margin: 0 .65rem .7rem;
    text-transform: uppercase;
}

.primary-nav {
    display: flex;
    flex-direction: column;
    gap: .35rem;
}

.primary-nav a {
    align-items: center;
    border: 1px solid transparent;
    border-radius: 13px;
    color: #c8d5d0;
    display: grid;
    gap: .8rem;
    grid-template-columns: 2.1rem 1fr;
    min-height: 4.35rem;
    padding: .7rem .75rem;
    position: relative;
    text-decoration: none;
    transition: background 160ms ease, border-color 160ms ease, color 160ms ease;
}

.primary-nav a:hover {
    background: rgba(255, 255, 255, .05);
    color: #fff;
}

.primary-nav a.active {
    background: rgba(237, 174, 73, .12);
    border-color: rgba(237, 174, 73, .28);
    color: #fff9ed;
}

.primary-nav a.active::after {
    background: var(--amber);
    border-radius: 10px;
    content: "";
    height: 1.7rem;
    position: absolute;
    right: -.76rem;
    width: 3px;
}

.nav-icon {
    align-items: center;
    background: rgba(255, 255, 255, .07);
    border-radius: 8px;
    color: #91aea5;
    display: flex;
    font-size: .72rem;
    font-weight: 950;
    height: 2.1rem;
    justify-content: center;
    width: 2.1rem;
}

.active .nav-icon {
    background: var(--amber);
    color: var(--ink-950);
}

.primary-nav strong, .primary-nav small {
    display: block;
}

.primary-nav strong {
    font-size: .82rem;
    letter-spacing: 0;
}

.primary-nav small {
    color: #829c94;
    font-size: .67rem;
    margin-top: .18rem;
}

.primary-nav .active small {
    color: #c9d7d1;
}

.sidebar-user {
    align-items: center;
    border-top: 1px solid rgba(255, 255, 255, .09);
    display: grid;
    gap: .65rem;
    grid-template-columns: 2.2rem 1fr 1.5rem;
    margin-top: auto;
    padding: 1.1rem .45rem .2rem;
}

.user-avatar {
    align-items: center;
    background: #315957;
    border: 1px solid #47706c;
    border-radius: 50%;
    color: var(--amber);
    display: flex;
    font-size: .78rem;
    font-weight: 900;
    height: 2.2rem;
    justify-content: center;
    width: 2.2rem;
}

.user-copy {
    min-width: 0;
}

.account-link {
    color: inherit;
    text-decoration: none;
}

.account-link:hover strong { color: #fff; }
.account-link:hover small { color: var(--amber); }

.user-copy strong, .user-copy small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-copy strong {
    font-size: .76rem;
    letter-spacing: 0;
}

.user-copy small {
    color: #88a29a;
    font-size: .63rem;
    margin-top: .18rem;
}

.logout-link {
    color: #91a8a1;
    font-size: 1rem;
    text-decoration: none;
}

.workspace {
    min-width: 0;
}

.topbar {
    align-items: center;
    border-bottom: 1px solid rgba(201, 192, 176, .65);
    display: flex;
    height: 4.25rem;
    justify-content: flex-end;
    padding: 0 clamp(1.25rem, 3vw, 3rem);
}

.environment-pill {
    align-items: center;
    color: var(--muted);
    display: flex;
    font-size: .7rem;
    font-weight: 800;
    gap: .45rem;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.environment-pill > span {
    background: var(--sage);
    border-radius: 50%;
    box-shadow: 0 0 0 4px rgba(110, 141, 126, .13);
    height: .45rem;
    width: .45rem;
}

.mobile-brand, .mobile-password, .mobile-logout {
    display: none;
}

.content-area {
    margin: 0 auto;
    max-width: 96rem;
    padding: clamp(1.6rem, 3.5vw, 3.4rem);
}

.page-header {
    align-items: flex-end;
    display: flex;
    gap: 2rem;
    justify-content: space-between;
    margin-bottom: 2rem;
}

.page-header h1 {
    color: var(--ink-950);
    font-size: clamp(2.15rem, 4vw, 3.55rem);
    font-weight: 780;
    letter-spacing: -.055em;
    line-height: .98;
    margin-bottom: .85rem;
}

.page-intro {
    color: var(--muted);
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 0;
    max-width: 43rem;
}

.page-header-home {
    align-items: center;
}

.fresh-data-callout {
    align-items: center;
    background: rgba(255, 253, 248, .65);
    border: 1px solid var(--line);
    border-radius: var(--radius-small);
    display: flex;
    gap: .75rem;
    min-width: 17rem;
    padding: .85rem 1rem;
}

.fresh-icon {
    align-items: center;
    background: var(--amber-pale);
    border-radius: 50%;
    color: var(--amber-deep);
    display: flex;
    font-size: 1.1rem;
    height: 2.4rem;
    justify-content: center;
    width: 2.4rem;
}

.fresh-data-callout strong, .fresh-data-callout small {
    display: block;
}

.fresh-data-callout strong {
    color: var(--ink-900);
    font-size: .79rem;
    letter-spacing: 0;
}

.fresh-data-callout small {
    color: var(--muted);
    font-size: .66rem;
    margin-top: .16rem;
}

.page-card {
    background: var(--surface);
    border: 1px solid rgba(217, 210, 196, .9);
    border-radius: var(--radius);
    box-shadow: var(--shadow-small);
}

.route-loading {
    align-items: center;
    color: var(--muted);
    display: flex;
    gap: .7rem;
    justify-content: center;
    min-height: 12rem;
}

/* Dashboard */
.workflow-grid {
    display: grid;
    gap: 1.1rem;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.workflow-card {
    background: rgba(255, 253, 248, .78);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    display: flex;
    flex-direction: column;
    min-height: 24rem;
    overflow: hidden;
    padding: 1.35rem;
    position: relative;
}

.workflow-card::before {
    background: var(--line);
    content: "";
    height: 1px;
    left: 4rem;
    position: absolute;
    right: 1.2rem;
    top: 2.1rem;
}

.workflow-card-featured {
    background: var(--ink-900);
    border-color: var(--ink-900);
    color: #f9f5eb;
}

.workflow-card-featured::before {
    background: rgba(255, 255, 255, .14);
}

.step-number {
    background: var(--paper);
    border-radius: 999px;
    color: var(--muted);
    font-size: .62rem;
    font-weight: 900;
    letter-spacing: .08em;
    padding: .25rem .5rem;
    position: relative;
    width: max-content;
    z-index: 1;
}

.workflow-card-featured .step-number {
    background: #294846;
    color: #b9ccc5;
}

.workflow-icon {
    align-items: center;
    border-radius: 14px 14px 14px 5px;
    display: flex;
    font-size: 1.1rem;
    font-weight: 950;
    height: 3.5rem;
    justify-content: center;
    margin: 2rem 0 1.2rem;
    width: 3.5rem;
}

.amazon-icon { background: var(--amber-pale); color: var(--amber-deep); }
.orders-icon { background: var(--sage-pale); color: #46705d; }
.reconcile-icon { background: var(--amber); color: var(--ink-950); }

.workflow-card h2 {
    color: var(--ink-950);
    font-size: 1.35rem;
    margin-bottom: .8rem;
}

.workflow-card-featured h2 {
    color: #fffaf0;
}

.data-state {
    align-items: center;
    display: flex;
    font-size: .73rem;
    font-weight: 850;
    gap: .45rem;
    margin-bottom: .65rem;
    text-transform: uppercase;
}

.data-state > span {
    border-radius: 50%;
    height: .45rem;
    width: .45rem;
}

.data-state.ready { color: #4d7664; }
.data-state.ready > span { background: #6f9d84; }
.data-state.waiting { color: #9b7850; }
.data-state.waiting > span { background: var(--amber); }
.workflow-card-featured .data-state { color: #dbc08f; }

.workflow-card .file-name {
    font-size: .84rem;
    font-weight: 800;
    margin: 0 0 .2rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.workflow-card > small {
    color: var(--muted);
    font-size: .67rem;
}

.workflow-card-featured > small,
.workflow-card-featured .muted {
    color: #9db0aa;
}

.text-link {
    align-items: center;
    color: var(--ink-800);
    display: flex;
    font-size: .78rem;
    font-weight: 850;
    justify-content: space-between;
    margin-top: auto;
    padding-top: 1.5rem;
    text-decoration: none;
}

.text-link span { color: var(--coral); font-size: 1.1rem; }
.workflow-card > .button { margin-top: auto; }

.mini-metrics {
    display: grid;
    gap: .6rem;
    grid-template-columns: 1fr 1fr;
    margin-bottom: 1rem;
}

.mini-metrics span {
    background: rgba(255, 255, 255, .06);
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 10px;
    padding: .75rem;
}

.mini-metrics strong, .mini-metrics small { display: block; }
.mini-metrics strong { color: var(--amber); font-size: 1.25rem; }
.mini-metrics small { color: #a2b5ae; font-size: .62rem; margin-top: .15rem; }

/* Notices */
.notice {
    border: 1px solid;
    border-radius: var(--radius-small);
    margin-top: 1.25rem;
    padding: 1rem 1.15rem;
}

.notice-success { background: var(--sage-pale); border-color: #bdd1c4; }
.notice-error { background: var(--rose-pale); border-color: #e6beb3; }
.notice-warning { background: var(--amber-pale); border-color: #e9d095; }

.notice-heading {
    align-items: flex-start;
    display: flex;
    gap: .75rem;
}

.notice-icon {
    align-items: center;
    background: rgba(255, 255, 255, .65);
    border-radius: 50%;
    display: flex;
    flex: 0 0 auto;
    font-weight: 950;
    height: 2rem;
    justify-content: center;
    width: 2rem;
}

.notice strong { color: var(--ink-900); }
.notice p { color: var(--muted); font-size: .82rem; margin: .2rem 0 0; }
.notice-actions { display: flex; gap: .6rem; margin-top: 1rem; }

.notice-metrics {
    display: flex;
    gap: 2rem;
    margin: 1rem 0 0 2.75rem;
}

.notice-metrics strong, .notice-metrics small { display: block; }
.notice-metrics strong { color: var(--ink-900); font-size: 1.25rem; }
.notice-metrics small { color: var(--muted); font-size: .65rem; }

.warning-list {
    color: #725f3e;
    font-size: .78rem;
    margin: 1rem 0 0 2.75rem;
    padding-left: 1rem;
}

.validation-table-wrap {
    margin-top: 1rem;
    max-height: 24rem;
    overflow: auto;
}

.validation-table {
    border-collapse: collapse;
    font-size: .75rem;
    width: 100%;
}

.validation-table th, .validation-table td {
    border-bottom: 1px solid rgba(166, 69, 52, .15);
    padding: .55rem;
    text-align: left;
}

/* Uploads */
.upload-layout {
    display: grid;
    gap: 1.2rem;
    grid-template-columns: minmax(0, 1.65fr) minmax(17rem, .85fr);
}

.upload-card {
    padding: clamp(1.25rem, 3vw, 2rem);
}

.card-heading {
    margin-bottom: 1.4rem;
}

.card-heading h2 {
    color: var(--ink-950);
    font-size: 1.35rem;
    margin: .35rem 0 .55rem;
}

.card-heading p {
    color: var(--muted);
    font-size: .82rem;
    line-height: 1.5;
    margin-bottom: 0;
}

.card-kicker {
    color: var(--coral);
    font-size: .64rem;
    font-weight: 900;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.file-drop {
    align-items: center;
    background:
        linear-gradient(135deg, rgba(237, 174, 73, .06), rgba(110, 141, 126, .04)),
        var(--surface-soft);
    border: 1.5px dashed var(--line-strong);
    border-radius: 14px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    min-height: 13rem;
    justify-content: center;
    overflow: hidden;
    padding: 2rem;
    position: relative;
    text-align: center;
    transition: border-color 160ms ease, background 160ms ease;
}

.file-drop:hover, .file-drop.has-file {
    background: var(--amber-pale);
    border-color: var(--amber-deep);
}

.file-drop input[type="file"] {
    cursor: pointer;
    height: 100%;
    inset: 0;
    opacity: 0;
    position: absolute;
    width: 100%;
}

.file-drop-icon {
    align-items: center;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 50%;
    color: var(--coral);
    display: flex;
    font-size: 1.25rem;
    height: 3.5rem;
    justify-content: center;
    margin-bottom: .8rem;
    width: 3.5rem;
}

.file-drop strong {
    color: var(--ink-900);
    font-size: .95rem;
    max-width: 90%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-drop small {
    color: var(--muted);
    font-size: .68rem;
    margin-top: .35rem;
}

.replacement-warning {
    align-items: flex-start;
    background: var(--surface-soft);
    border-left: 3px solid var(--coral);
    display: flex;
    gap: .7rem;
    margin: 1rem 0;
    padding: .8rem .9rem;
}

.replacement-warning > span { color: var(--coral); font-size: 1.05rem; }
.replacement-warning strong { color: var(--ink-900); font-size: .76rem; }
.replacement-warning p { color: var(--muted); font-size: .7rem; line-height: 1.45; margin: .15rem 0 0; }

.schema-strip {
    display: grid;
    gap: .5rem;
    grid-template-columns: repeat(3, 1fr);
    margin-top: .8rem;
}

.schema-strip span {
    align-items: center;
    background: var(--surface-soft);
    border: 1px solid var(--line);
    border-radius: 9px;
    display: flex;
    gap: .55rem;
    padding: .55rem .7rem;
}

.schema-strip strong {
    align-items: center;
    background: var(--ink-900);
    border-radius: 5px;
    color: white;
    display: flex;
    font-size: .65rem;
    height: 1.4rem;
    justify-content: center;
    width: 1.4rem;
}

.schema-strip small { color: var(--muted); font-size: .66rem; }

.current-data-card {
    min-height: 25rem;
    padding: 1.35rem;
}

.current-data-card > h2 {
    color: var(--ink-950);
    font-size: 1.05rem;
    margin: 1rem 0;
    overflow-wrap: anywhere;
}

.current-empty {
    align-items: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 18rem;
    text-align: center;
}

.current-empty > span {
    align-items: center;
    background: var(--paper);
    border-radius: 14px;
    color: var(--line-strong);
    display: flex;
    font-size: 1.3rem;
    font-weight: 950;
    height: 4rem;
    justify-content: center;
    margin-bottom: 1rem;
    width: 4rem;
}

.current-empty h2 { color: var(--ink-900); font-size: 1rem; margin-bottom: .45rem; }
.current-empty p { color: var(--muted); font-size: .75rem; line-height: 1.5; max-width: 14rem; }

.status-chip {
    align-items: center;
    border-radius: 999px;
    display: inline-flex;
    font-size: .62rem;
    font-weight: 900;
    gap: .4rem;
    letter-spacing: .07em;
    padding: .35rem .65rem;
    text-transform: uppercase;
}

.status-ready { background: var(--sage-pale); color: #4c715f; }
.status-chip i { background: currentColor; border-radius: 50%; height: .35rem; width: .35rem; }

.data-definition-list {
    border-bottom: 1px solid var(--line);
    border-top: 1px solid var(--line);
    margin: 0;
    padding: .4rem 0;
}

.data-definition-list div {
    align-items: center;
    display: flex;
    justify-content: space-between;
    padding: .6rem 0;
}

.data-definition-list dt { color: var(--muted); font-size: .69rem; }
.data-definition-list dd { color: var(--ink-900); font-size: .76rem; font-weight: 850; margin: 0; }
.hash-line { color: var(--muted); font-size: .63rem; margin-top: .9rem; }
.hash-line code { color: var(--ink-700); }

/* Reconciliation */
.source-bar {
    align-items: center;
    background: rgba(255, 253, 248, .7);
    border: 1px solid var(--line);
    border-radius: var(--radius-small);
    display: grid;
    gap: .8rem;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto;
    margin-bottom: 1rem;
    padding: .85rem 1rem;
}

.source-bar > div {
    align-items: center;
    display: grid;
    gap: .55rem;
    grid-template-columns: .6rem minmax(0, 1fr) auto;
    min-width: 0;
}

.source-bar small, .source-bar strong { display: block; }
.source-bar small { color: var(--muted); font-size: .59rem; text-transform: uppercase; }
.source-bar strong { font-size: .73rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.source-bar em { color: var(--muted); font-size: .63rem; font-style: normal; }
.source-bar > p { color: var(--muted); font-size: .62rem; margin: 0; white-space: nowrap; }
.source-dot { border-radius: 50%; height: .5rem; width: .5rem; }
.amazon-dot { background: var(--amber); }
.orders-dot { background: var(--sage); }
.source-join { color: var(--line-strong); font-size: 1.1rem; }

.summary-grid {
    display: grid;
    gap: .7rem;
    grid-template-columns: repeat(6, minmax(0, 1fr));
}

.summary-card {
    align-items: flex-start;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 12px;
    display: flex;
    gap: .65rem;
    min-height: 7.2rem;
    padding: .85rem;
}

.summary-mark {
    align-items: center;
    background: var(--paper);
    border-radius: 7px;
    display: flex;
    flex: 0 0 auto;
    font-size: .7rem;
    font-weight: 950;
    height: 1.65rem;
    justify-content: center;
    width: 1.65rem;
}

.summary-card small, .summary-card strong, .summary-card em { display: block; }
.summary-card small { color: var(--muted); font-size: .61rem; line-height: 1.25; min-height: 1.55rem; }
.summary-card strong { color: var(--ink-950); font-size: 1.45rem; margin-top: .25rem; }
.summary-card em { color: var(--muted); font-size: .57rem; font-style: normal; margin-top: .15rem; }
.summary-check .summary-mark { background: var(--sage-pale); color: #4c7b63; }
.summary-mismatch .summary-mark, .summary-missing .summary-mark { background: var(--rose-pale); color: var(--coral); }
.summary-pending .summary-mark { background: var(--amber-pale); color: var(--amber-deep); }
.summary-refund .summary-mark { background: #ece8f4; color: #76668e; }

.totals-strip {
    background: var(--ink-900);
    border-radius: 12px;
    color: white;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    margin: .8rem 0 1rem;
    overflow: hidden;
}

.totals-strip div {
    border-right: 1px solid rgba(255, 255, 255, .1);
    padding: .8rem 1rem;
}

.totals-strip div:last-child { border-right: 0; }
.totals-strip small, .totals-strip strong { display: block; }
.totals-strip small { color: #91aaa2; font-size: .59rem; letter-spacing: .05em; text-transform: uppercase; }
.totals-strip strong { font-size: .94rem; margin-top: .25rem; }
.totals-strip .difference-total strong { color: var(--amber); }

.results-card {
    overflow: hidden;
}

.results-toolbar {
    align-items: center;
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    padding: 1.15rem 1.25rem;
}

.results-toolbar .eyebrow { margin-bottom: .25rem; }
.results-toolbar h2 { color: var(--ink-950); font-size: 1.05rem; margin: 0; }

.filter-controls {
    display: flex;
    gap: .55rem;
}

.search-input, .filter-controls select {
    background: var(--surface-soft);
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--text);
    font-size: .72rem;
    height: 2.5rem;
    padding: 0 .85rem;
}

.search-input { min-width: 14rem; }
.filter-controls select { min-width: 10rem; }

.data-table-wrap {
    overflow: auto;
}

.data-table {
    border-collapse: collapse;
    font-size: .7rem;
    min-width: 68rem;
    width: 100%;
}

.data-table th {
    background: var(--surface-soft);
    border-bottom: 1px solid var(--line);
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: .58rem;
    letter-spacing: .055em;
    padding: .65rem .75rem;
    text-align: left;
    text-transform: uppercase;
    white-space: nowrap;
}

.table-sort {
    align-items: center;
    background: transparent;
    border: 0;
    color: inherit;
    cursor: pointer;
    display: inline-flex;
    font: inherit;
    font-weight: 800;
    gap: .35rem;
    letter-spacing: inherit;
    padding: 0;
    text-transform: inherit;
}

.numeric .table-sort {
    justify-content: flex-end;
    width: 100%;
}

.table-sort span { color: var(--amber-dark); font-size: .68rem; }
.table-sort:hover { color: var(--ink-800); }
.table-sort:focus-visible { outline: 2px solid var(--amber-dark); outline-offset: 3px; }

.data-table td {
    border-bottom: 1px solid #ece7dc;
    padding: .7rem .75rem;
    vertical-align: middle;
}

.data-table tbody tr:hover, .data-table .selected-row {
    background: #faf6eb;
}

.numeric { font-variant-numeric: tabular-nums; text-align: right !important; }
.reference-code { color: var(--ink-800); font-size: .68rem; white-space: nowrap; }
.difference-cell { color: #9d4838; font-weight: 850; }
.difference-cell.zero { color: #4e795f; }

.status-badge {
    border-radius: 999px;
    display: inline-block;
    font-size: .57rem;
    font-weight: 850;
    padding: .3rem .52rem;
    white-space: nowrap;
}

.status-matched { background: var(--sage-pale); color: #416b55; }
.status-amountmismatch, .status-missinginamazon, .status-missinginorders { background: var(--rose-pale); color: #984c3c; }
.status-pendingreference { background: var(--amber-pale); color: #8c631f; }
.status-refundexception { background: #ece8f4; color: #66547d; }

.detail-button {
    background: transparent;
    border: 0;
    color: var(--coral);
    cursor: pointer;
    font-size: .65rem;
    font-weight: 850;
    padding: .35rem;
}

.table-empty {
    color: var(--muted);
    padding: 2.5rem !important;
    text-align: center;
}

.pagination {
    align-items: center;
    display: flex;
    font-size: .66rem;
    justify-content: flex-end;
    padding: .85rem 1.1rem;
}

.pagination button {
    background: transparent;
    border: 0;
    color: var(--ink-800);
    cursor: pointer;
    font-size: .66rem;
    font-weight: 850;
    padding: .4rem .7rem;
}

.pagination button:disabled { color: var(--line-strong); cursor: not-allowed; }
.pagination span { border-left: 1px solid var(--line); border-right: 1px solid var(--line); color: var(--muted); padding: 0 .85rem; }

.detail-drawer {
    margin-top: 1rem;
    padding: 1.25rem;
}

.detail-heading {
    align-items: center;
    border-bottom: 1px solid var(--line);
    display: flex;
    justify-content: space-between;
    padding-bottom: .85rem;
}

.detail-heading .eyebrow { margin-bottom: .2rem; }
.detail-heading h2 { color: var(--ink-950); font-family: Consolas, monospace; font-size: 1.05rem; margin: 0; }
.close-button { background: var(--paper); border: 0; border-radius: 50%; color: var(--muted); cursor: pointer; font-size: 1.2rem; height: 2rem; width: 2rem; }

.detail-columns {
    display: grid;
    gap: 1rem;
    grid-template-columns: 1fr 1.35fr;
    padding-top: 1rem;
}

.detail-columns h3 { color: var(--ink-900); font-size: .8rem; }
.detail-columns h3 span { background: var(--paper); border-radius: 999px; color: var(--muted); font-size: .6rem; margin-left: .35rem; padding: .2rem .4rem; }
.mini-table { border-collapse: collapse; font-size: .65rem; width: 100%; }
.mini-table th, .mini-table td { border-bottom: 1px solid #ebe6db; padding: .5rem; text-align: left; }
.mini-table th { color: var(--muted); font-size: .55rem; text-transform: uppercase; }

.source-detail-sections { display: grid; gap: 1.5rem; }
.source-detail-sections h3 { color: var(--ink-900); font-size: .8rem; margin-bottom: .65rem; }
.source-detail-sections h3 span { background: var(--paper); border-radius: 999px; color: var(--muted); font-size: .6rem; margin-left: .35rem; padding: .2rem .4rem; }
.source-record-list { display: grid; gap: .75rem; }
.source-record { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 1rem; }
.source-record > strong { color: var(--ink-800); display: block; font-size: .68rem; margin-bottom: .8rem; text-transform: uppercase; }
.source-field-grid { display: grid; gap: .7rem 1rem; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); margin: 0; }
.source-field-grid div { min-width: 0; }
.source-field-grid dt { color: var(--muted); font-size: .55rem; font-weight: 800; letter-spacing: .04em; margin-bottom: .2rem; text-transform: uppercase; }
.source-field-grid dd { color: var(--ink-900); font-size: .7rem; margin: 0; overflow-wrap: anywhere; }
.orders-field-grid { grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); }

/* Remarks */
.export-action {
    align-items: flex-end;
    display: flex;
    flex-direction: column;
    gap: .4rem;
    max-width: 21rem;
}

.export-action small {
    color: #8d4032;
    font-size: .66rem;
    line-height: 1.4;
    text-align: right;
}

.remark-progress-card {
    align-items: center;
    display: flex;
    gap: 1.5rem;
    justify-content: space-between;
    margin-bottom: 1rem;
    padding: 1.1rem 1.25rem;
}

.remark-progress-card .eyebrow { margin-bottom: .25rem; }
.remark-progress-card h2 { color: var(--ink-950); font-size: 1rem; margin-bottom: .25rem; }
.remark-progress-card p { color: var(--muted); font-size: .72rem; margin: 0; }
.remark-progress-card p strong { color: #8d4032; }

.remark-progress-actions {
    align-items: flex-end;
    display: flex;
    flex-direction: column;
    gap: .65rem;
}

.remark-progress-actions progress {
    accent-color: var(--sage);
    height: .65rem;
    min-width: 16rem;
}

.active-filter-chip {
    align-items: center;
    background: var(--amber-pale);
    border: 1px solid #e9d095;
    border-radius: 999px;
    color: #725f3e;
    display: inline-flex;
    font-size: .62rem;
    font-weight: 800;
    padding: 0 .75rem;
}

.amazon-source-record {
    transition: border-color 160ms ease, box-shadow 160ms ease;
}

.amazon-source-record.remark-missing {
    border: 2px solid #c7684d;
    box-shadow: inset .3rem 0 0 #c7684d;
}

.amazon-record-heading {
    align-items: center;
    display: flex;
    gap: .6rem;
    justify-content: space-between;
    margin-bottom: .8rem;
}

.bulk-row-check {
    align-items: center;
    color: var(--ink-800);
    display: inline-flex;
    font-size: .68rem;
    font-weight: 850;
    gap: .5rem;
    text-transform: uppercase;
}

.bulk-row-check input { accent-color: var(--ink-900); height: 1rem; width: 1rem; }

.remark-required-badge,
.remark-automatic-badge,
.remark-saved-badge {
    border-radius: 999px;
    font-size: .58rem;
    font-weight: 850;
    padding: .35rem .55rem;
    white-space: nowrap;
}

.remark-required-badge { background: var(--rose-pale); color: #984c3c; }
.remark-automatic-badge { background: var(--amber-pale); color: #7c5b21; }
.remark-saved-badge { background: var(--sage-pale); color: #416b55; }

.remark-editor {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 10px;
    margin-bottom: 1rem;
    padding: .85rem;
}

.remark-selector-grid {
    display: grid;
    gap: .75rem;
    grid-template-columns: minmax(12rem, .75fr) minmax(16rem, 1.25fr);
}

.remark-selector-grid label,
.bulk-remark-controls label {
    color: var(--ink-800);
    display: grid;
    font-size: .6rem;
    font-weight: 850;
    gap: .3rem;
    text-transform: uppercase;
}

.remark-selector-grid input,
.remark-selector-grid select,
.bulk-remark-controls input,
.bulk-remark-controls select,
.inline-remark-create input,
.remark-create-card input,
.table-input {
    background: var(--surface-soft);
    border: 1px solid var(--line-strong);
    border-radius: 9px;
    color: var(--ink-950);
    font-size: .72rem;
    min-height: 2.5rem;
    padding: .55rem .7rem;
    text-transform: none;
    width: 100%;
}

.remark-selector-grid input:focus,
.remark-selector-grid select:focus,
.bulk-remark-controls input:focus,
.bulk-remark-controls select:focus,
.inline-remark-create input:focus,
.remark-create-card input:focus,
.table-input:focus {
    border-color: var(--amber-deep);
    box-shadow: 0 0 0 3px rgba(237, 174, 73, .14);
    outline: none;
}

.remark-snapshot-note {
    color: var(--muted);
    font-size: .65rem;
    margin: .65rem 0 .2rem;
}

.remark-snapshot-note strong { color: var(--ink-800); }
.inline-create-toggle { margin-top: .35rem; }

.inline-remark-create {
    border-top: 1px solid var(--line);
    margin-top: .75rem;
    padding-top: .75rem;
}

.inline-remark-create > label {
    color: var(--ink-800);
    display: block;
    font-size: .6rem;
    font-weight: 850;
    margin-bottom: .35rem;
    text-transform: uppercase;
}

.inline-remark-create > div {
    align-items: center;
    display: grid;
    gap: .5rem;
    grid-template-columns: minmax(12rem, 1fr) auto auto;
}

.inline-remark-create .button,
.bulk-remark-panel .button {
    font-size: .68rem;
    min-height: 2.5rem;
    padding: .55rem .8rem;
}

.remark-row-message {
    border-left: 3px solid;
    font-size: .68rem;
    margin: .65rem 0 0;
    padding: .5rem .65rem;
}

.remark-row-message.error { background: var(--rose-pale); border-color: var(--coral); color: #8d4032; }
.remark-row-message.success { background: var(--sage-pale); border-color: var(--sage); color: #416b55; }

.bulk-remark-panel {
    background: var(--surface-soft);
    border: 1px solid var(--line);
    border-radius: 12px;
    margin-bottom: .85rem;
    padding: .9rem;
}

.bulk-remark-heading {
    align-items: center;
    display: flex;
    justify-content: space-between;
    margin-bottom: .7rem;
}

.bulk-remark-heading strong,
.bulk-remark-heading small { display: block; }
.bulk-remark-heading strong { color: var(--ink-900); font-size: .75rem; }
.bulk-remark-heading small { color: var(--muted); font-size: .62rem; margin-top: .15rem; }

.bulk-remark-controls {
    align-items: end;
    display: grid;
    gap: .65rem;
    grid-template-columns: minmax(11rem, .75fr) minmax(15rem, 1.25fr) auto;
}

.bulk-confirmation {
    background: var(--amber-pale);
    border: 1px solid #e9d095;
    border-radius: 9px;
    margin-top: .75rem;
    padding: .8rem;
}

.bulk-confirmation p { color: #725f3e; font-size: .7rem; margin-bottom: .6rem; }
.bulk-confirmation > div { display: flex; gap: .5rem; }

.category-status-card { margin-bottom: 1rem; overflow: hidden; }
.category-status-card .bulk-confirmation { margin: 0 1.25rem 1rem; }
.category-status-table { min-width: 32rem; }

.remark-management-grid {
    align-items: start;
    display: grid;
    gap: 1rem;
    grid-template-columns: minmax(17rem, 21rem) minmax(0, 1fr);
}

.remark-create-card { padding: 1.25rem; }
.remark-create-card label { color: var(--ink-800); display: block; font-size: .65rem; font-weight: 850; margin: .8rem 0 .35rem; text-transform: uppercase; }
.remark-create-card .button { margin-top: 1rem; }
.remark-list-card { overflow: hidden; }
.remark-filter-controls { flex-wrap: wrap; }
.remark-table { min-width: 48rem; }
.remark-table td:first-child { min-width: 17rem; }
.remark-table code { color: var(--ink-700); font-size: .68rem; }
.status-inactive { background: var(--paper-deep); color: var(--muted); }
.remark-actions { text-align: right; white-space: nowrap; }
.remark-actions .secondary-action { color: var(--muted); }
.remark-actions .danger-action { color: #984c3c; }

/* Login */
.login-page {
    background: var(--paper);
    min-height: 100vh;
}

.login-shell {
    display: grid;
    grid-template-columns: minmax(20rem, .95fr) minmax(26rem, 1.05fr);
    min-height: 100vh;
}

.login-story {
    background:
        radial-gradient(circle at 18% 15%, rgba(237, 174, 73, .18), transparent 23rem),
        linear-gradient(145deg, #102727, #214442);
    color: #fff8eb;
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow: hidden;
    padding: clamp(2.5rem, 7vw, 7rem);
    position: relative;
}

.login-story::after {
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 50%;
    bottom: -11rem;
    content: "";
    height: 27rem;
    position: absolute;
    right: -8rem;
    width: 27rem;
}

.login-story .brand-mark {
    margin-bottom: clamp(3rem, 10vh, 7rem);
}

.login-story .eyebrow { color: var(--amber); }

.login-story h1 {
    font-size: clamp(3rem, 6vw, 5.8rem);
    font-weight: 720;
    letter-spacing: -.07em;
    line-height: .89;
    margin-bottom: 1.6rem;
}

.login-story-copy {
    color: #a9bdb5;
    font-size: 1rem;
    line-height: 1.7;
    max-width: 29rem;
}

.login-proof {
    align-items: center;
    color: #8da69e;
    display: flex;
    font-size: .65rem;
    font-weight: 800;
    gap: .8rem;
    letter-spacing: .09em;
    margin-top: clamp(2rem, 8vh, 5rem);
    text-transform: uppercase;
}

.proof-line { background: var(--amber); height: 1px; width: 2rem; }

.login-panel {
    align-items: center;
    display: flex;
    justify-content: center;
    padding: 2rem;
}

.login-card {
    max-width: 26rem;
    width: 100%;
}

.login-card h2 {
    color: var(--ink-950);
    font-size: clamp(2rem, 4vw, 3rem);
    letter-spacing: -.055em;
    line-height: 1;
    margin-bottom: .75rem;
}

.login-card > .muted {
    font-size: .82rem;
    line-height: 1.55;
    margin-bottom: 2rem;
}

.login-form label {
    color: var(--ink-800);
    display: block;
    font-size: .68rem;
    font-weight: 850;
    margin-bottom: .45rem;
    margin-top: .7rem;
    text-transform: uppercase;
}

.login-form input {
    background: var(--surface);
    border: 1px solid var(--line-strong);
    border-radius: 12px;
    color: var(--ink-950);
    font: inherit;
    font-size: .9rem;
    font-weight: 650;
    letter-spacing: normal;
    margin-bottom: .45rem;
    padding: .85rem 1rem;
    text-align: left;
    width: 100%;
}

.login-form input:focus {
    border-color: var(--amber-deep);
    box-shadow: 0 0 0 4px rgba(237, 174, 73, .16);
    outline: none;
}

.login-form .code-input {
    font-family: Consolas, "Courier New", monospace;
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: .28em;
    text-align: center;
}

.login-form .button { margin-top: 1.2rem; }
.field-error { color: #a54838; display: block; font-size: .68rem; min-height: 1rem; }
.form-alert { background: var(--rose-pale); border-left: 3px solid var(--coral); color: #8d4032; font-size: .72rem; margin-bottom: 1rem; padding: .7rem; }
.form-alert:empty { display: none; }
.form-alert ul { margin: 0; padding-left: 1rem; }
.form-success { background: var(--teal-pale); border-left: 3px solid var(--teal); color: var(--teal-deep); font-size: .72rem; margin-bottom: 1rem; padding: .7rem; }
.form-grid { display: grid; gap: 0 1rem; grid-template-columns: 1fr 1fr; }
.optional { color: var(--muted); font-size: .58rem; font-weight: 600; text-transform: none; }
.setup-card { max-width: 34rem; }

.qr-frame { background: #fff; border: 1px solid var(--line); border-radius: 16px; margin: 1rem auto; padding: .75rem; width: min(15rem, 100%); }
.qr-frame img { display: block; height: auto; width: 100%; }
.manual-key { border-bottom: 1px solid var(--line); border-top: 1px solid var(--line); font-size: .72rem; margin: 1rem 0; padding: .8rem 0; }
.manual-key summary { color: var(--ink-800); cursor: pointer; font-weight: 750; }
.manual-key p { color: var(--muted); margin: .7rem 0 .35rem; }
.manual-key code { display: block; font-size: .72rem; overflow-wrap: anywhere; }
.recovery-code-grid { display: grid; gap: .55rem; grid-template-columns: 1fr 1fr; list-style: none; margin: 1.25rem 0; padding: 0; }
.recovery-code-grid li { background: var(--paper); border: 1px solid var(--line); border-radius: 9px; padding: .65rem; text-align: center; }
.recovery-code-grid code { color: var(--ink-900); font-size: .8rem; font-weight: 800; letter-spacing: .05em; }

.security-note {
    color: var(--muted);
    font-size: .65rem;
    line-height: 1.5;
    margin: 1.35rem auto 0;
    max-width: 20rem;
    text-align: center;
}

.logout-shell {
    align-items: center;
    display: flex;
    justify-content: center;
    min-height: 100vh;
    padding: 2rem;
}

.logout-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    max-width: 33rem;
    padding: 2.5rem;
    text-align: center;
    width: 100%;
}

.logout-card .brand-mark { margin-bottom: 1.5rem; }
.logout-card h1 { color: var(--ink-950); font-size: 2.2rem; margin-bottom: .7rem; }
.logout-card form { display: flex; gap: .6rem; justify-content: center; margin-top: 1.5rem; }

/* Empty and errors */
.empty-state {
    margin: 5vh auto;
    max-width: 40rem;
    padding: 3rem;
    text-align: center;
}

.empty-code {
    align-items: center;
    background: var(--amber-pale);
    border-radius: 50%;
    color: var(--amber-deep);
    display: flex;
    font-size: 1rem;
    font-weight: 950;
    height: 4rem;
    justify-content: center;
    margin: 0 auto 1.25rem;
    width: 4rem;
}

.empty-state h1 { color: var(--ink-950); font-size: 2rem; }
.empty-state .button { margin-top: 1rem; }
.correlation-id { color: var(--muted); font-size: .68rem; }

.status-page {
    background:
        radial-gradient(circle at 12% 10%, rgba(237, 174, 73, .2), transparent 24rem),
        linear-gradient(145deg, var(--paper), #ece6da);
}

.status-shell {
    align-items: center;
    display: flex;
    justify-content: center;
    min-height: 100vh;
    padding: clamp(1.25rem, 5vw, 4rem);
}

.status-card {
    max-width: 42rem;
    padding: clamp(2rem, 6vw, 4rem);
    text-align: center;
    width: 100%;
}

.status-code {
    align-items: center;
    background: var(--amber-pale);
    border: 1px solid #e9d095;
    border-radius: 50%;
    color: var(--amber-deep);
    display: flex;
    font-size: .9rem;
    font-weight: 950;
    height: 4.5rem;
    justify-content: center;
    letter-spacing: .08em;
    margin: 0 auto 1.5rem;
    width: 4.5rem;
}

.status-card h1 {
    color: var(--ink-950);
    font-size: clamp(2rem, 6vw, 3.4rem);
    letter-spacing: -.055em;
    line-height: 1;
    margin-bottom: 1rem;
}

.status-message {
    color: var(--muted);
    font-size: 1rem;
    line-height: 1.65;
    margin: 0 auto;
    max-width: 32rem;
}

.status-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .7rem;
    justify-content: center;
    margin-top: 2rem;
}

.valid.modified:not([type="checkbox"]) { border-color: var(--sage) !important; }
.invalid { border-color: var(--coral) !important; }
.validation-message { color: #a54838; }

@media (max-width: 1180px) {
    .summary-grid { grid-template-columns: repeat(3, 1fr); }
    .workflow-grid { grid-template-columns: 1fr 1fr; }
    .workflow-card-featured { grid-column: 1 / -1; min-height: 19rem; }
    .remark-management-grid { grid-template-columns: 1fr; }
    .remark-create-card { max-width: 32rem; }
}

@media (max-width: 860px) {
    .app-shell { display: block; }
    .sidebar {
        min-height: auto;
        padding: .8rem 1rem;
        position: static;
    }
    .sidebar .brand, .nav-label, .sidebar-user { display: none; }
    .primary-nav { flex-direction: row; }
    .primary-nav a {
        flex: 1;
        grid-template-columns: 1.8rem 1fr;
        min-height: 3.6rem;
        padding: .55rem;
    }
    .primary-nav a.active::after { bottom: -.8rem; height: 3px; left: 20%; right: 20%; top: auto; width: auto; }
    .nav-icon { height: 1.8rem; width: 1.8rem; }
    .primary-nav small { display: none; }
    .topbar { height: 3.5rem; justify-content: space-between; }
    .mobile-brand, .mobile-password, .mobile-logout { display: block; text-decoration: none; }
    .mobile-brand { color: var(--ink-900); font-weight: 950; }
    .mobile-password { color: var(--ink-800); font-size: .7rem; font-weight: 850; margin-left: auto; }
    .mobile-logout { color: var(--coral); font-size: .7rem; font-weight: 850; }
    .upload-layout { grid-template-columns: 1fr; }
    .current-data-card { min-height: auto; }
    .source-bar { grid-template-columns: 1fr; }
    .source-join { display: none; }
    .source-bar > p { border-top: 1px solid var(--line); padding-top: .55rem; }
    .detail-columns { grid-template-columns: 1fr; }
    .remark-progress-card { align-items: stretch; flex-direction: column; }
    .remark-progress-actions { align-items: stretch; }
    .remark-progress-actions progress { min-width: 0; width: 100%; }
    .remark-selector-grid, .bulk-remark-controls { grid-template-columns: 1fr; }
    .inline-remark-create > div { grid-template-columns: 1fr; }
    .login-shell { grid-template-columns: 1fr; }
    .login-story { min-height: 41vh; padding: 2.5rem; }
    .login-story .brand-mark { margin-bottom: 2rem; }
    .login-story h1 { font-size: 3.3rem; }
    .login-story-copy, .login-proof { display: none; }
    .login-panel { min-height: 59vh; }
}

@media (max-width: 640px) {
    .content-area { padding: 1.35rem 1rem 2rem; }
    .page-header { align-items: flex-start; flex-direction: column; margin-bottom: 1.4rem; }
    .page-header h1 { font-size: 2.35rem; }
    .page-header .button { width: 100%; }
    .export-action { align-items: stretch; max-width: none; width: 100%; }
    .export-action small { text-align: left; }
    .fresh-data-callout { min-width: 0; width: 100%; }
    .workflow-grid { grid-template-columns: 1fr; }
    .workflow-card-featured { grid-column: auto; }
    .summary-grid { grid-template-columns: 1fr 1fr; }
    .totals-strip { grid-template-columns: 1fr 1fr; }
    .totals-strip div:nth-child(2) { border-right: 0; }
    .totals-strip div:nth-child(-n+2) { border-bottom: 1px solid rgba(255, 255, 255, .1); }
    .results-toolbar { align-items: stretch; flex-direction: column; }
    .filter-controls { flex-direction: column; }
    .search-input, .filter-controls select { min-width: 0; width: 100%; }
    .primary-nav strong { font-size: .65rem; }
    .primary-nav a { display: flex; flex-direction: column; gap: .25rem; text-align: center; }
    .environment-pill { font-size: .58rem; }
    .schema-strip { grid-template-columns: 1fr; }
    .notice-actions, .logout-card form { flex-direction: column; }
    .notice-metrics { margin-left: 0; }
    .amazon-record-heading { align-items: flex-start; flex-direction: column; }
    .bulk-confirmation > div { flex-direction: column; }
    .login-story { min-height: 32vh; }
    .login-story h1 { font-size: 2.7rem; }
    .login-panel { min-height: 68vh; padding: 1.5rem; }
    .status-actions { align-items: stretch; flex-direction: column; }
    .status-actions .button { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
    }
}
