/*
  KOLOK customer portal. Built on the KOLOK design system tokens (css/kolok/*.css):
  Kolok Blue is the single action colour, cool steel neutrals, Archivo + IBM Plex Mono,
  squared corners (2/4/6/10px), CMYK process stripe as the only accent, functional motion.

  Themes: <html data-theme="system|light|dark"> (from the user's settings). The design system
  defines light only; dark re-points the same semantic tokens at its navy/steel ramps, so
  components never reference raw colours.
*/

/* Portal-level semantic tokens (light) */
:root {
    color-scheme: light;
    --surface-control: #ffffff;
    --text-brand: var(--kolok-blue-900);
    --text-accent: var(--kolok-blue-600);
    --text-placeholder: var(--steel-400);
    --row-hover: var(--steel-25);
    --badge-neutral-bg: var(--steel-100);
    --badge-neutral-fg: var(--steel-700);
    --badge-brand-bg: var(--kolok-blue-100);
    --badge-brand-fg: var(--kolok-blue-800);
    --badge-solid-bg: var(--kolok-blue-900);
    --control-disabled-bg: var(--steel-100);
    --control-disabled-fg: var(--steel-400);
    --switch-off: var(--steel-300);
    --scrim: rgba(10, 38, 71, 0.48);
}

/* Dark: chosen explicitly… */
:root[data-theme="dark"] {
    color-scheme: dark;
    --surface-page: #0a121c;
    --surface-card: #111b27;
    --surface-sunken: #0d1621;
    --surface-control: #0d1621;
    --surface-brand-tint: rgba(42, 116, 204, 0.18);
    --text-strong: var(--steel-50);
    --text-body: var(--steel-200);
    --text-muted: var(--steel-400);
    --text-link: var(--kolok-blue-300);
    --text-link-hover: var(--kolok-blue-100);
    --text-brand: var(--steel-50);
    --text-accent: var(--kolok-blue-300);
    --text-placeholder: var(--steel-500);
    --border-subtle: var(--steel-800);
    --border-default: var(--steel-700);
    --border-strong: var(--steel-500);
    --border-focus: var(--kolok-blue-300);
    --action-primary: var(--kolok-blue-500);
    --action-primary-hover: var(--kolok-blue-600);
    --action-primary-press: var(--kolok-blue-700);
    --status-success: #4cc38a;
    --status-success-bg: rgba(22, 121, 74, 0.22);
    --status-warning: #f0a93b;
    --status-warning-bg: rgba(163, 95, 0, 0.24);
    --status-danger: #f2777c;
    --status-danger-bg: rgba(196, 38, 46, 0.22);
    --status-info: var(--kolok-blue-300);
    --status-info-bg: rgba(42, 116, 204, 0.16);
    --row-hover: rgba(255, 255, 255, 0.03);
    --badge-neutral-bg: var(--steel-800);
    --badge-neutral-fg: var(--steel-200);
    --badge-brand-bg: rgba(42, 116, 204, 0.24);
    --badge-brand-fg: var(--kolok-blue-100);
    --badge-solid-bg: var(--kolok-blue-700);
    --control-disabled-bg: var(--steel-800);
    --control-disabled-fg: var(--steel-500);
    --switch-off: var(--steel-600);
    --scrim: rgba(0, 0, 0, 0.6);
    --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.45);
    --shadow-2: 0 2px 8px rgba(0, 0, 0, 0.5);
    --shadow-3: 0 12px 32px rgba(0, 0, 0, 0.6);
    --focus-ring: 0 0 0 3px rgba(143, 180, 227, 0.35);
}

/* …or following the device. Keep in step with the block above. */
@media (prefers-color-scheme: dark) {
    :root[data-theme="system"] {
        color-scheme: dark;
        --surface-page: #0a121c;
        --surface-card: #111b27;
        --surface-sunken: #0d1621;
        --surface-control: #0d1621;
        --surface-brand-tint: rgba(42, 116, 204, 0.18);
        --text-strong: var(--steel-50);
        --text-body: var(--steel-200);
        --text-muted: var(--steel-400);
        --text-link: var(--kolok-blue-300);
        --text-link-hover: var(--kolok-blue-100);
        --text-brand: var(--steel-50);
        --text-accent: var(--kolok-blue-300);
        --text-placeholder: var(--steel-500);
        --border-subtle: var(--steel-800);
        --border-default: var(--steel-700);
        --border-strong: var(--steel-500);
        --border-focus: var(--kolok-blue-300);
        --action-primary: var(--kolok-blue-500);
        --action-primary-hover: var(--kolok-blue-600);
        --action-primary-press: var(--kolok-blue-700);
        --status-success: #4cc38a;
        --status-success-bg: rgba(22, 121, 74, 0.22);
        --status-warning: #f0a93b;
        --status-warning-bg: rgba(163, 95, 0, 0.24);
        --status-danger: #f2777c;
        --status-danger-bg: rgba(196, 38, 46, 0.22);
        --status-info: var(--kolok-blue-300);
        --status-info-bg: rgba(42, 116, 204, 0.16);
        --row-hover: rgba(255, 255, 255, 0.03);
        --badge-neutral-bg: var(--steel-800);
        --badge-neutral-fg: var(--steel-200);
        --badge-brand-bg: rgba(42, 116, 204, 0.24);
        --badge-brand-fg: var(--kolok-blue-100);
        --badge-solid-bg: var(--kolok-blue-700);
        --control-disabled-bg: var(--steel-800);
        --control-disabled-fg: var(--steel-500);
        --switch-off: var(--steel-600);
        --scrim: rgba(0, 0, 0, 0.6);
        --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.45);
        --shadow-2: 0 2px 8px rgba(0, 0, 0, 0.5);
        --shadow-3: 0 12px 32px rgba(0, 0, 0, 0.6);
        --focus-ring: 0 0 0 3px rgba(143, 180, 227, 0.35);
    }
}

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

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    font-family: var(--font-sans);
    font-size: var(--fs-body);
    line-height: var(--lh-body);
    color: var(--text-body);
    background: var(--surface-page);
    -webkit-font-smoothing: antialiased;
}

a { color: var(--text-link); text-decoration: none; }
a:hover { color: var(--text-link-hover); text-decoration: underline; }

h1, .h1, h2, .h2, h3, .h3, h4, .h4 { color: var(--text-strong); margin: 0 0 var(--space-2); }
h1, .h1 { font: var(--fw-bold) var(--fs-h2)/var(--lh-snug) var(--font-display); letter-spacing: var(--ls-heading); }
.h2 { font: var(--fw-bold) var(--fs-h3)/var(--lh-snug) var(--font-display); letter-spacing: var(--ls-heading); }
.h4 { font: var(--fw-bold) var(--fs-h4)/var(--lh-snug) var(--font-sans); }
.h5 { font: var(--fw-bold) var(--fs-body)/var(--lh-snug) var(--font-sans); margin: var(--space-2) 0 0; }
p { margin: 0 0 var(--space-3); }

.eyebrow {
    font: var(--fw-bold) var(--fs-micro)/1 var(--font-sans);
    letter-spacing: var(--ls-eyebrow);
    text-transform: uppercase;
    color: var(--text-accent);
    margin-bottom: var(--space-2);
}
.muted { color: var(--text-muted); }
.small { font-size: var(--fs-small); }
.strong { font-weight: var(--fw-semibold); color: var(--text-strong); }
.mono { font-family: var(--font-mono); font-size: 0.93em; }
.nowrap { white-space: nowrap; }
.break { overflow-wrap: anywhere; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.spacer { flex: 1; }
.inline-form { display: inline; margin: 0; }
.stack { display: flex; flex-direction: column; gap: var(--space-4); }
.divider { border: 0; border-top: 1px solid var(--border-subtle); margin: var(--space-6) 0 var(--space-4); }

:focus-visible { outline: 2px solid var(--border-focus); outline-offset: 2px; }

/* ---------- Brand ---------- */

.process-stripe { height: 4px; background: var(--process-stripe); }
.process-stripe-card { border-radius: var(--radius-md) var(--radius-md) 0 0; }

.wordmark {
    font: var(--fw-black) 22px/1 var(--font-display);
    letter-spacing: 0.04em;
    color: var(--text-brand);
}
.wordmark:hover { text-decoration: none; color: var(--text-brand); }

/* ---------- Shell ---------- */

.topbar {
    position: sticky;
    top: 0;
    z-index: 30;
    display: flex;
    align-items: center;
    gap: var(--space-3);
    height: var(--header-h);
    padding: 0 var(--gutter);
    background: var(--surface-card);
    border-bottom: 1px solid var(--border-subtle);
}
.topbar-product {
    padding-left: var(--space-3);
    border-left: 1px solid var(--border-default);
    color: var(--text-muted);
    font-weight: var(--fw-medium);
    font-size: var(--fs-small);
}
.topbar-user { display: inline-flex; align-items: center; gap: 6px; color: var(--text-muted); font-size: var(--fs-small); min-width: 0; }
.topbar-email { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 260px; }

.shell { display: flex; align-items: flex-start; max-width: var(--container-max); margin: 0 auto; }

.sidenav {
    position: sticky;
    top: var(--header-h);
    flex: 0 0 248px;
    height: calc(100vh - var(--header-h) - 4px);
    overflow-y: auto;
    padding: var(--space-5) var(--space-3) var(--space-8);
}
.nav-group { margin-bottom: var(--space-4); }
.nav-group-title {
    padding: 0 var(--space-3) var(--space-2);
    font: var(--fw-bold) var(--fs-micro)/1.2 var(--font-sans);
    letter-spacing: var(--ls-eyebrow);
    text-transform: uppercase;
    color: var(--text-muted);
}
.nav-item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: 8px var(--space-3);
    border-radius: var(--radius-sm);
    color: var(--text-body);
    font-weight: var(--fw-medium);
    font-size: 14px;
    transition: background var(--dur-fast) var(--ease-standard);
}
.nav-item .icon { color: var(--text-muted); }
.nav-item:hover { background: var(--surface-sunken); text-decoration: none; color: var(--text-strong); }
.nav-item.active { background: var(--surface-brand-tint); color: var(--text-accent); }
.nav-item.active .icon { color: var(--text-accent); }
.nav-badge { margin-left: auto; }

.content { flex: 1; min-width: 0; padding: var(--space-6) var(--gutter) var(--space-16); }

.nav-toggle { position: absolute; opacity: 0; pointer-events: none; }
.nav-toggle-btn, .nav-scrim { display: none; }

.page-head { margin-bottom: var(--space-6); }
.page-head p { max-width: 70ch; }
.section { margin-top: var(--space-8); }

/* Signed-out pages */
.topbar-brand { position: static; }
.bare-content { padding: var(--space-10) var(--space-4); min-height: calc(100vh - var(--header-h) - 120px); }
.bare-footer { padding: var(--space-6); text-align: center; color: var(--text-muted); font-size: var(--fs-small); }
.auth-card { max-width: 440px; margin: 0 auto; }
.link-icon { display: inline-flex; align-items: center; gap: 6px; margin-right: var(--space-4); }

/* ---------- Cards and tiles ---------- */

.card {
    background: var(--surface-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-1);
}
.card-body { padding: var(--space-6); }
.card-interactive { transition: box-shadow var(--dur-base), border-color var(--dur-base); }
.card-interactive:hover { box-shadow: var(--shadow-2); border-color: var(--border-strong); text-decoration: none; }

.tile-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: var(--space-4); }
.tile { display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-3); padding: var(--space-5); color: var(--text-strong); }
.tile:hover { color: var(--text-strong); }
.tile-icon {
    display: inline-flex; align-items: center; justify-content: center;
    width: 48px; height: 48px;
    border-radius: var(--radius-md);
    background: var(--surface-brand-tint);
    color: var(--text-accent);
}
.tile-title { font-weight: var(--fw-semibold); }

.empty-state { max-width: 560px; margin: var(--space-10) auto; padding: var(--space-10) var(--space-8); text-align: center; }
.empty-state .tile-icon { width: 64px; height: 64px; margin-bottom: var(--space-4); }

.two-col { display: grid; grid-template-columns: 3fr 2fr; gap: var(--space-6); align-items: start; }

/* ---------- Buttons ---------- */

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    height: var(--control-h-md); padding: 0 16px;
    font: var(--fw-semibold) 14px/1 var(--font-sans); letter-spacing: 0.01em;
    border: 1px solid transparent; border-radius: var(--radius-sm);
    cursor: pointer; white-space: nowrap; text-decoration: none;
    transition: background var(--dur-fast) var(--ease-standard), transform var(--dur-fast);
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-sm { height: var(--control-h-sm); padding: 0 12px; font-size: 13px; }
.btn-lg { height: var(--control-h-lg); padding: 0 22px; font-size: 16px; }
.btn-block { width: 100%; }
.btn-primary { background: var(--action-primary); color: #fff; }
.btn-primary:hover { background: var(--action-primary-hover); color: #fff; }
.btn-primary:active { background: var(--action-primary-press); }
.btn-outline { background: var(--surface-control); color: var(--text-accent); border-color: var(--border-default); }
.btn-outline:hover { background: var(--surface-brand-tint); color: var(--text-accent); }
.btn-ghost { background: transparent; color: var(--text-body); }
.btn-ghost:hover { background: var(--surface-sunken); color: var(--text-strong); }
.btn.disabled { pointer-events: none; background: var(--control-disabled-bg); color: var(--control-disabled-fg); border-color: var(--control-disabled-bg); }

.icon-btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: var(--control-h-md); height: var(--control-h-md);
    border-radius: var(--radius-sm); cursor: pointer; color: var(--text-body);
}
.icon-btn:hover { background: var(--surface-sunken); }

/* ---------- Forms ---------- */

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; border: 0; padding: 0; margin: 0; }
.field-label { font-size: 13px; font-weight: var(--fw-semibold); color: var(--text-strong); padding: 0; }
.field-grow { flex: 1 1 280px; }

.input {
    width: 100%; height: var(--control-h-md); padding: 0 12px;
    font: 400 14px var(--font-sans); color: var(--text-body);
    background: var(--surface-control); border: 1px solid var(--border-default); border-radius: var(--radius-sm);
    transition: box-shadow var(--dur-fast), border-color var(--dur-fast);
}
.input:focus, .input:focus-within { outline: 0; border-color: var(--border-focus); box-shadow: var(--focus-ring); }
.input::placeholder, .input input::placeholder { color: var(--text-placeholder); }
.input.invalid { border-color: var(--status-danger); }
.textarea { height: auto; padding: 10px 12px; resize: vertical; }
.input-code { height: var(--control-h-lg); font-size: 22px; letter-spacing: 0.4em; text-align: center; }

.input-with-icon { display: flex; align-items: center; gap: 8px; color: var(--text-muted); }
.input-with-icon input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: transparent; font: inherit; color: var(--text-body); }

.select-wrap { position: relative; display: flex; }
.select-wrap select { appearance: none; padding-right: 36px; cursor: pointer; }
.select-chevron { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); pointer-events: none; color: var(--text-muted); }

.check { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; cursor: pointer; padding: 4px 0; }
.check input { width: 16px; height: 16px; margin: 2px 0 0; accent-color: var(--action-primary); }

.filter-bar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--space-4); padding: var(--space-4); margin-bottom: var(--space-4); }
.filter-bar .field { flex: 1 1 170px; }
.filter-actions { display: flex; gap: var(--space-2); }

/* Switch (KOLOK Switch component) */
.switch {
    position: relative; width: 36px; height: 20px; padding: 0;
    border: 0; border-radius: var(--radius-pill);
    background: var(--switch-off); cursor: pointer;
    transition: background var(--dur-base) var(--ease-standard);
}
.switch.on { background: var(--action-primary); }
.switch-thumb {
    position: absolute; top: 2px; left: 2px; width: 16px; height: 16px;
    border-radius: 50%; background: #fff; box-shadow: var(--shadow-1);
    transition: left var(--dur-base) var(--ease-standard);
}
.switch.on .switch-thumb { left: 18px; }

/* ---------- Tables ---------- */

.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th {
    text-align: left; padding: 10px var(--space-4);
    font: var(--fw-bold) var(--fs-micro)/1.2 var(--font-sans); letter-spacing: var(--ls-eyebrow); text-transform: uppercase;
    color: var(--text-muted); background: var(--surface-sunken); border-bottom: 1px solid var(--border-subtle);
    white-space: nowrap;
}
.table td { padding: 10px var(--space-4); border-bottom: 1px solid var(--border-subtle); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: var(--row-hover); }
.table .num { text-align: right; white-space: nowrap; }
.table .actions { text-align: right; white-space: nowrap; }
.table .actions .btn + .btn { margin-left: 4px; }

.result-meta { margin: var(--space-2) 0; }
.pager { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); margin-top: var(--space-4); }

/* ---------- Badges, tags, alerts ---------- */

.badge {
    display: inline-flex; align-items: center; gap: 4px; height: 20px; padding: 0 7px;
    border-radius: var(--radius-xs);
    font: var(--fw-bold) 11px/1 var(--font-sans); letter-spacing: 0.04em; text-transform: uppercase; white-space: nowrap;
}
.badge-neutral { background: var(--badge-neutral-bg); color: var(--badge-neutral-fg); }
.badge-brand { background: var(--badge-brand-bg); color: var(--badge-brand-fg); }
.badge-success { background: var(--status-success-bg); color: var(--status-success); }
.badge-warning { background: var(--status-warning-bg); color: var(--status-warning); }
.badge-danger { background: var(--status-danger-bg); color: var(--status-danger); }
.badge-solid { background: var(--badge-solid-bg); color: #fff; }
/* KOLOK in-house AI (InHouseAiBadge.razor): the brand blue, with the shield that says the data stayed with KOLOK. */
.badge-ai { background: var(--status-info-bg); color: var(--status-info); }
.ai-note .badge { margin-right: var(--space-1); vertical-align: 1px; }

.tag {
    display: inline-flex; align-items: center; height: 24px; padding: 0 10px; margin: 2px 4px 2px 0;
    border: 1px solid var(--border-default); border-radius: var(--radius-pill);
    font-size: 12px; color: var(--text-body); background: var(--surface-control); white-space: nowrap;
}

.alert {
    display: flex; gap: 10px; padding: 12px 14px; margin-bottom: var(--space-4);
    border: 1px solid; border-radius: var(--radius-sm); font-size: 14px; color: var(--text-body);
}
.alert .icon { margin-top: 1px; }
.alert-title { font-weight: var(--fw-bold); color: var(--text-strong); }
.alert-info { background: var(--status-info-bg); border-color: var(--status-info); }
.alert-info .icon { color: var(--status-info); }
.alert-success { background: var(--status-success-bg); border-color: var(--status-success); }
.alert-success .icon { color: var(--status-success); }
.alert-warning { background: var(--status-warning-bg); border-color: var(--status-warning); }
.alert-warning .icon { color: var(--status-warning); }
.alert-danger { background: var(--status-danger-bg); border-color: var(--status-danger); }
.alert-danger .icon { color: var(--status-danger); }
.stack > .alert { margin-bottom: 0; }

/* ---------- Responsive: tablets and phones ---------- */

@media (max-width: 960px) {
    .two-col { grid-template-columns: 1fr; }
}

@media (max-width: 860px) {
    :root { --gutter: 16px; }

    .nav-toggle-btn { display: inline-flex; margin-left: -8px; }
    .topbar-product { display: none; }

    .sidenav {
        position: fixed; top: calc(var(--header-h) + 4px); left: 0; bottom: 0; z-index: 25;
        width: 280px; height: auto;
        background: var(--surface-card); box-shadow: var(--shadow-3);
        transform: translateX(-100%);
        transition: transform var(--dur-base) var(--ease-standard);
    }
    .nav-toggle:checked ~ .shell .sidenav { transform: none; }
    .nav-toggle:checked ~ .shell .nav-scrim {
        display: block; position: fixed; inset: calc(var(--header-h) + 4px) 0 0 0; z-index: 20;
        background: var(--scrim);
    }
    .content { padding-top: var(--space-5); }
    h1, .h1 { font-size: var(--fs-h3); }
}

@media (max-width: 600px) {
    .hide-sm { display: none; }
    .topbar-email { max-width: 120px; }
    .topbar .badge { display: none; }
    .card-body { padding: var(--space-5); }
    .filter-bar .field { flex-basis: 100%; }
    .filter-actions { width: 100%; }
    .filter-actions .btn { flex: 1; }
    .table th, .table td { padding: 10px 12px; }
    .empty-state { padding: var(--space-8) var(--space-5); }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition: none !important; }
}

/* ---------- My account ---------- */

.choice-row { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.choice { position: relative; flex: 1 1 110px; cursor: pointer; }
.choice input { position: absolute; opacity: 0; }
.choice-body {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    height: var(--control-h-lg); padding: 0 12px;
    border: 1px solid var(--border-default); border-radius: var(--radius-sm);
    background: var(--surface-control); font-weight: var(--fw-medium); font-size: 14px;
    transition: border-color var(--dur-fast), background var(--dur-fast);
}
.choice:hover .choice-body { border-color: var(--border-strong); }
.choice input:checked + .choice-body { border-color: var(--border-focus); background: var(--surface-brand-tint); color: var(--text-accent); }
.choice input:focus-visible + .choice-body { box-shadow: var(--focus-ring); }

.status-line { display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap; }
.steps { margin: 0; padding-left: 1.2em; }
.steps li + li { margin-top: var(--space-1); }

/* QR codes stay dark-on-white in every theme so phones can scan them. */
.qr { align-self: flex-start; padding: var(--space-3); background: #ffffff; border: 1px solid var(--border-subtle); border-radius: var(--radius-md); line-height: 0; }
.qr svg { width: 200px; height: 200px; }

.recovery-codes {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-2);
    margin: 0; padding: var(--space-4); list-style: none;
    background: var(--surface-sunken); border: 1px dashed var(--border-default); border-radius: var(--radius-sm);
    font-size: 15px; letter-spacing: 0.06em;
}

.section-tight { margin-bottom: var(--space-6); }
.email-frame { width: 100%; height: 70vh; min-height: 420px; padding: 0; background: #ffffff; }

/* ---------- Products ---------- */

.tag-row { display: flex; flex-wrap: wrap; margin-bottom: var(--space-4); }
a.tag { text-decoration: none; }
a.tag:hover { border-color: var(--border-strong); color: var(--text-strong); }
.tag-selected { border-color: var(--border-focus); background: var(--surface-brand-tint); color: var(--text-accent); }

/* Search suggestions (js/typeahead.js) */
.suggest-wrap { position: relative; }
.suggest-list {
    position: absolute; z-index: 20; top: calc(100% + 4px); left: 0; right: 0;
    margin: 0; padding: var(--space-1) 0; list-style: none;
    background: var(--surface-card); border: 1px solid var(--border-default); border-radius: var(--radius-sm);
    box-shadow: var(--shadow-2); max-height: 60vh; overflow-y: auto;
}
.suggest-list a { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; padding: 8px 12px; color: var(--text-body); text-decoration: none; }
.suggest-list a:hover, .suggest-list a[aria-selected="true"] { background: var(--row-hover); color: var(--text-strong); }

/* Relationship review */
.review-card { max-width: 960px; }
.review-pair { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-4); }
.review-product { padding: var(--space-4); border: 1px solid var(--border-subtle); border-radius: var(--radius-sm); background: var(--surface-sunken); }
mark { background: var(--status-warning-bg); color: inherit; padding: 0 2px; border-radius: 2px; }

@media (max-width: 640px) {
    .review-pair { grid-template-columns: 1fr; }
}

/* ---------- Ordering and requests ---------- */

.input-qty { width: 96px; text-align: right; }
.table tr.row-problem td { background: var(--status-warning-bg); }
/* Requests open longer than their threshold. */
.table tr.overdue td, .overdue { color: var(--status-danger); font-weight: var(--fw-bold); }
.order-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; }
.upload-counts { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; }
.check-hint { display: block; }
/* Import template editor (TemplateEdit.razor): fields in a responsive grid; the copy options row under each template. */
.template-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: var(--space-4); }
.table tr.row-sub td { padding-top: 0; border-top: 0; }
.table tr.row-sub summary { cursor: pointer; color: var(--text-muted); }
/* A suggested item for an unknown code (draft order, upload results): clearly not part of the order until chosen. */
.suggestion { margin-top: var(--space-2); padding: var(--space-2) var(--space-3); border: 1px dashed var(--status-info); border-radius: var(--radius-sm); background: var(--status-info-bg); }
.suggestion-title { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); font: var(--fw-bold) var(--fs-micro)/1.4 var(--font-sans); letter-spacing: var(--ls-eyebrow); text-transform: uppercase; color: var(--status-info); }

/* ---------- Testing only: Development sign-in panel (TestSignInPanel.razor) ---------- */

.test-panel {
    max-width: 960px; margin: var(--space-6) auto 0; padding: var(--space-4);
    border: 2px dashed var(--status-warning); border-radius: var(--radius-md); background: var(--surface-card);
}
.test-panel-banner {
    display: flex; gap: var(--space-3); align-items: flex-start; padding: var(--space-3);
    margin-bottom: var(--space-4); border-radius: var(--radius-sm);
    background: var(--status-warning-bg); color: var(--status-warning);
}
.test-panel h2 { margin: var(--space-4) 0 var(--space-2); }
/* Attribute filters on product search (ProductSearch.razor): one block per attribute, wrapping on narrow screens. */
.attr-filters { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: var(--space-2) var(--space-4); margin-bottom: var(--space-4); }
.attr-filters .tag-row { margin-bottom: 0; }
.attr-filters > p { grid-column: 1 / -1; margin: 0; }
