:root {
    --ink: #17202a;
    --muted: #65717e;
    --line: #e5e9ee;
    --surface: #ffffff;
    --canvas: #f5f7f9;
    --blue: #2563eb;
    --blue-dark: #1d4ed8;
    --green: #15803d;
    --green-bg: #eaf7ee;
    --orange: #b45309;
    --orange-bg: #fff3df;
    --red: #b42318;
    --red-bg: #fff0ee;
    --yellow: #fff7d6;
    --shadow: 0 12px 34px rgba(20, 36, 58, .07);
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--canvas); color: var(--ink); font: 15px/1.5 "Segoe UI", Arial, sans-serif; }
a { color: var(--blue); text-decoration: none; }
button, input, select { font: inherit; }
button { cursor: pointer; }

.topbar { height: 72px; padding: 0 32px; background: rgba(255,255,255,.96); border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 32px; position: sticky; top: 0; z-index: 10; }
.brand { min-width: 260px; color: var(--ink); display: flex; align-items: center; gap: 12px; }
.brand-mark { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 12px; background: linear-gradient(135deg,#2563eb,#7c3aed); color: white; font-weight: 800; font-size: 20px; }
.brand strong, .brand small { display: block; }
.brand small { color: var(--muted); font-size: 11px; letter-spacing: .02em; }
.nav { display: flex; align-items: stretch; align-self: stretch; gap: 4px; flex: 1; }
.nav a { color: #4d5966; padding: 0 13px; display: grid; place-items: center; position: relative; font-weight: 600; font-size: 14px; }
.nav a.active { color: var(--blue); }
.nav a.active:after { content: ""; height: 3px; border-radius: 3px 3px 0 0; background: var(--blue); position: absolute; left: 10px; right: 10px; bottom: 0; }
.link-button { border: 0; background: transparent; color: var(--muted); }

.page { max-width: 1480px; margin: 0 auto; padding: 38px 32px 64px; }
.page-heading { display: flex; justify-content: space-between; gap: 28px; align-items: flex-end; margin-bottom: 28px; }
.page-heading h1, .narrow-page h1 { margin: 2px 0 6px; font-size: clamp(28px,4vw,40px); line-height: 1.12; letter-spacing: -.035em; }
.eyebrow { margin: 0 0 5px; color: var(--blue); font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .12em; }
.lead { margin: 0; color: var(--muted); font-size: 16px; }
.heading-actions, .form-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

.button, .small-button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid transparent; border-radius: 10px; font-weight: 700; transition: .15s ease; }
.button { min-height: 44px; padding: 0 18px; }
.small-button { min-height: 34px; padding: 0 12px; background: #fff; color: var(--blue); border-color: #cdd8ea; }
.button.primary { background: var(--blue); color: white; box-shadow: 0 6px 18px rgba(37,99,235,.2); }
.button.primary:hover { background: var(--blue-dark); }
.button.secondary { background: #fff; color: var(--ink); border-color: var(--line); }
.button.ghost { color: var(--muted); }
.small-button:disabled { opacity: .45; cursor: not-allowed; }

.messages { display: grid; gap: 8px; margin-bottom: 20px; }
.message { padding: 12px 16px; border-radius: 10px; border: 1px solid; background: #fff; }
.message.success { color: var(--green); border-color: #b8e0c4; background: var(--green-bg); }
.message.error { color: var(--red); border-color: #f3c2bd; background: var(--red-bg); }

.metrics { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 16px; margin-bottom: 36px; }
.metrics article { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 20px 22px; box-shadow: var(--shadow); }
.metrics span, .metrics strong { display: block; }
.metrics span { color: var(--muted); font-size: 13px; font-weight: 600; }
.metrics strong { margin-top: 4px; font-size: 30px; line-height: 1; }
.metrics article.attention { border-color: #f4c978; background: #fffaf0; }

.workflow-panel { margin: -14px 0 36px; padding: 20px; border: 1px solid #dbe4f1; border-radius: 16px; background: linear-gradient(135deg,#fff,#f7faff); box-shadow: var(--shadow); }
.workflow-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 18px; margin-bottom: 14px; }
.workflow-heading .eyebrow { margin: 0; }
.workflow-heading > strong { color: #35455b; font-size: 13px; }
.workflow-steps { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 8px; }
.workflow-steps > * { min-width: 0; display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 11px; color: var(--ink); background: #fff; border: 1px solid #e7ebf0; transition: .16s ease; }
.workflow-steps b { width: 28px; height: 28px; display: grid; flex: 0 0 auto; place-items: center; border-radius: 9px; color: #fff; background: #3768d9; font-size: 12px; }
.workflow-steps span, .workflow-steps strong, .workflow-steps small { display: block; }
.workflow-steps strong { font-size: 13px; }
.workflow-steps small { margin-top: 2px; color: var(--muted); font-size: 10px; line-height: 1.35; }
.workflow-steps a:hover { border-color: #b9c9e5; transform: translateY(-1px); }

.section-heading { display: flex; align-items: end; justify-content: space-between; margin: 0 0 15px; }
.section-heading.compact { margin-bottom: 8px; }
.section-heading h2 { margin: 0; font-size: 23px; }
.account-grid { display: grid; grid-template-columns: repeat(5,minmax(210px,1fr)); gap: 14px; margin-bottom: 32px; }
.account-card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 18px; box-shadow: var(--shadow); overflow: hidden; }
.account-card-top, .account-card-top > div, .account-footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.account-card h3 { margin: 0; font-size: 16px; }
.status-dot { width: 9px; height: 9px; border-radius: 50%; background: #a8b1ba; }
.status-success .status-dot { background: #22a447; box-shadow: 0 0 0 4px #e5f6e9; }
.status-error .status-dot { background: #dc3c30; box-shadow: 0 0 0 4px #fde9e7; }
.status-running .status-dot { background: #e6a700; box-shadow: 0 0 0 4px #fff4ce; }
.account-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 20px 0; }
.account-stats div { padding: 11px; border-radius: 10px; background: var(--canvas); }
.account-stats strong, .account-stats span { display: block; }
.account-stats strong { font-size: 21px; }
.account-stats span, .account-footer { color: var(--muted); font-size: 12px; }
.error-text { margin: 12px 0 0; color: var(--red); font-size: 12px; }

.badge { display: inline-flex; align-items: center; white-space: nowrap; border-radius: 999px; padding: 4px 9px; font-size: 11px; font-weight: 800; }
.badge.success, .badge.success { color: var(--green); background: var(--green-bg); }
.badge.warning, .badge.error { color: var(--orange); background: var(--orange-bg); }
.badge.muted, .badge.never { color: #606c78; background: #edf0f3; }
.badge.running { color: #7c5800; background: #fff3c3; }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 20px; box-shadow: var(--shadow); }
.table-panel { padding: 0; overflow: hidden; }
.table-wrap { overflow: auto; }
.wide-table { max-height: calc(100vh - 260px); }
table { width: 100%; border-collapse: separate; border-spacing: 0; }
th { background: #f7f9fb; color: #52606d; font-size: 11px; text-align: left; text-transform: uppercase; letter-spacing: .045em; position: sticky; top: 0; z-index: 2; }
th, td { padding: 13px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background-color: #fafcff; }
td small { display: block; margin-top: 2px; color: var(--muted); }
.item-link { color: var(--ink); font-weight: 700; }
.price { font-weight: 750; white-space: nowrap; font-variant-numeric: tabular-nums; }
.base-price { background: var(--yellow); }
.price-cell { min-width: 130px; text-align: center; font-weight: 700; white-space: nowrap; }
.price-cell.ok { background: var(--green-bg); color: var(--green); }
.price-cell.warning { background: var(--orange-bg); color: var(--orange); }
.price-cell.missing { background: #f1f3f5; color: #9aa3ac; }
.row-actions { white-space: nowrap; }
.row-actions a { margin-right: 12px; }
.row-actions .unlink-form { display: inline; margin-right: 12px; }
.unlink-form button, .rejoin-form button { padding: 0; border: 0; color: #b45309; background: transparent; font-size: 11px; font-weight: 700; }
td > .unlink-form { margin-top: 7px; }
.empty-state { text-align: center; padding: 56px 20px; color: var(--muted); }
.empty-state strong, .empty-state span { display: block; }
.empty-state strong { color: var(--ink); font-size: 18px; }

.filter-bar { background: var(--surface); border: 1px solid var(--line); border-radius: 13px; display: flex; gap: 10px; align-items: center; padding: 10px; margin-bottom: 15px; }
.filter-bar input { flex: 1; }
input, select, textarea { min-height: 42px; width: 100%; padding: 8px 11px; border: 1px solid #ccd4dd; border-radius: 9px; background: #fff; color: var(--ink); }
.filter-bar select { max-width: 220px; }
input:focus, select:focus, textarea:focus { outline: 3px solid rgba(37,99,235,.13); border-color: var(--blue); }

.narrow-page { max-width: 700px; margin: 0 auto; }
.back-link { display: inline-block; margin-bottom: 14px; color: var(--muted); }
.form-card { background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 30px; box-shadow: var(--shadow); }
.stacked-form { margin-top: 24px; }
.stacked-form p { margin: 0 0 16px; }
.stacked-form label { display: block; margin-bottom: 5px; font-weight: 700; }
.stacked-form .helptext { color: var(--muted); font-size: 12px; }
.stacked-form ul.errorlist { color: var(--red); padding-left: 20px; }
.listing-preview { display: flex; justify-content: space-between; align-items: center; margin: 20px 0 0; padding: 14px; border-radius: 10px; background: var(--canvas); }

.settings-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; margin-bottom: 18px; }
.settings-card { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 18px; box-shadow: var(--shadow); }
.settings-card h3 { margin: 0 0 10px; }
.settings-card code { display: block; color: #536170; font-size: 12px; }
.instructions h2 { margin-top: 0; }
.instructions li { margin: 8px 0; }
code { background: #eef2f6; border-radius: 5px; padding: 2px 5px; }

@media (max-width: 1100px) {
    .topbar { height: auto; min-height: 72px; flex-wrap: wrap; padding: 14px 20px; gap: 8px 20px; }
    .brand { flex: 1; }
    .nav { order: 3; width: 100%; overflow-x: auto; }
    .nav a { min-height: 40px; white-space: nowrap; }
    .account-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}

@media (max-width: 720px) {
    .page { padding: 24px 14px 48px; }
    .page-heading { align-items: stretch; flex-direction: column; }
    .heading-actions .button { flex: 1; }
    .metrics { grid-template-columns: 1fr; }
    .account-grid, .settings-grid { grid-template-columns: 1fr; }
    .filter-bar { align-items: stretch; flex-direction: column; }
    .filter-bar select { max-width: none; }
}

/* Modern interface refresh */
body {
    background:
        radial-gradient(circle at 14% -8%, rgba(37,99,235,.08), transparent 28rem),
        radial-gradient(circle at 90% 8%, rgba(124,58,237,.055), transparent 24rem),
        var(--canvas);
}

.topbar {
    background: rgba(255,255,255,.88);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

.brand-mark { box-shadow: 0 8px 22px rgba(78,74,222,.24); }
.nav-icon { display: none; font-size: 19px; line-height: 1; }
.nav-badge { min-width: 18px; height: 18px; display: grid; place-items: center; margin-left: -5px; padding: 0 5px; border-radius: 99px; background: #fff0df; color: #b45309; font-size: 10px; }
.mode-pill { display: inline-flex; align-items: center; gap: 7px; color: #536170; background: #f1f4f7; border: 1px solid #e3e8ed; border-radius: 99px; padding: 6px 10px; font-size: 11px; font-weight: 700; }
.mode-pill i { width: 7px; height: 7px; border-radius: 50%; background: #26a269; box-shadow: 0 0 0 3px rgba(38,162,105,.12); }

.page-heading h1 { text-wrap: balance; }
.button-icon { font-size: 18px; line-height: 1; }
.button.light { background: #fff; color: #24456f; white-space: nowrap; }
.button.loading, .small-button.loading { pointer-events: none; opacity: .72; }
.button.loading .button-icon, .small-button.loading > span:first-child { display: inline-block; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.setup-banner { min-height: 92px; display: grid; grid-template-columns: auto minmax(240px,1fr) minmax(150px,280px) auto; align-items: center; gap: 18px; margin: -3px 0 22px; padding: 18px 20px; color: #fff; border-radius: 17px; background: linear-gradient(120deg,#1d4ed8,#4f46e5 58%,#6d45d8); box-shadow: 0 14px 35px rgba(51,70,190,.2); }
.setup-symbol { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 14px; background: rgba(255,255,255,.16); font-size: 22px; }
.setup-copy { display: grid; gap: 2px; }
.setup-copy strong { font-size: 17px; }
.setup-copy > span:last-child { color: rgba(255,255,255,.78); font-size: 12px; }
.setup-label { color: #dce7ff; font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .11em; }
.setup-progress { height: 8px; overflow: hidden; background: rgba(255,255,255,.2); border-radius: 99px; }
.setup-progress i { display: block; height: 100%; min-width: 3px; border-radius: inherit; background: #fff; }

.metrics article { display: flex; align-items: center; gap: 15px; padding: 19px 20px; }
.metrics article > div:last-child { min-width: 0; }
.metrics strong { font-size: 29px; }
.metrics small { display: block; margin-top: 3px; color: #8a949f; font-size: 11px; }
.metric-icon { width: 45px; height: 45px; display: grid; flex: 0 0 auto; place-items: center; border-radius: 13px; font-size: 18px; font-weight: 900; }
.metric-icon.blue { color: #2563eb; background: #eaf1ff; }
.metric-icon.violet { color: #7048d8; background: #f0ebff; }
.metric-icon.orange { color: #c1660f; background: #fff0de; }

.account-grid { grid-template-columns: repeat(3,minmax(250px,1fr)); }
.account-card { min-height: 210px; padding: 20px; transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease; }
.account-card:hover { transform: translateY(-2px); box-shadow: 0 18px 38px rgba(20,36,58,.1); }
.account-card.not-configured { border-style: dashed; }
.account-card-top > div { justify-content: flex-start; }
.account-footer { margin-top: auto; }

.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 15px; }
.toolbar .filter-bar { flex: 1; margin-bottom: 0; }
.segmented { display: inline-flex; gap: 4px; padding: 4px; border: 1px solid var(--line); border-radius: 12px; background: #fff; white-space: nowrap; }
.segmented a { min-height: 34px; display: inline-flex; align-items: center; gap: 6px; padding: 0 11px; border-radius: 8px; color: #5d6975; font-size: 12px; font-weight: 700; }
.segmented a.active { color: #1d4ed8; background: #edf3ff; }
.segmented b { min-width: 19px; padding: 1px 5px; border-radius: 99px; background: rgba(37,99,235,.1); text-align: center; font-size: 10px; }

.empty-state { height: 260px; }
.empty-state .empty-icon { width: 50px; height: 50px; display: grid; place-items: center; margin: 0 auto 13px; border-radius: 15px; color: #476ebd; background: #edf3ff; font-size: 20px; }
.empty-state .empty-icon.success { color: var(--green); background: var(--green-bg); }
.empty-state .button { width: max-content; margin: 15px auto 0; }

.security-pill { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 99px; color: var(--green); background: var(--green-bg); font-size: 12px; font-weight: 800; }
.settings-card { transition: border-color .18s ease, transform .18s ease; }
.settings-card:hover { border-color: #b8c9e6; transform: translateY(-1px); }
.instructions { display: grid; grid-template-columns: auto 1fr; gap: 8px 15px; padding: 26px; }
.instructions h2 { margin: 0 0 3px; font-size: 16px; }
.instructions p { margin: 0 0 17px; color: var(--muted); }
.instruction-number { width: 31px; height: 31px; display: grid; place-items: center; border-radius: 10px; color: #fff; background: linear-gradient(135deg,#2563eb,#6d45d8); font-weight: 800; }
.security-note { grid-column: 1 / -1; margin-top: 4px; padding: 13px 15px; border-radius: 10px; color: #43604c; background: #eff8f2; border: 1px solid #d7ecdd; font-size: 13px; }

.stock-upload { display: grid; grid-template-columns: minmax(0,1.25fr) minmax(320px,.75fr); gap: 30px; align-items: center; margin: 18px 0; padding: 26px; }
.stock-upload h2 { margin: 0 0 7px; font-size: 23px; }
.stock-upload p { max-width: 720px; margin: 0 0 12px; color: var(--muted); }
.stock-count { color: #536170; font-size: 13px; }
.stock-upload-form { display: grid; gap: 9px; padding: 17px; border-radius: 13px; background: var(--canvas); }
.stock-upload-form label { font-weight: 750; }
.stock-upload-form input[type="file"] { min-height: 46px; padding: 9px; background: #fff; }
.stock-upload-form input[type="file"]::file-selector-button { margin-right: 10px; padding: 7px 10px; border: 0; border-radius: 7px; color: #1d4ed8; background: #edf3ff; font-weight: 700; cursor: pointer; }
.stock-upload-form small { color: var(--muted); }
.stock-upload-form .button { margin-top: 4px; }
.field-error { color: var(--red); font-size: 12px; }
.legacy-upload { border-color: #d9d3f7; background: linear-gradient(135deg,#fff,#faf8ff); }

.matching-guide { display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; margin-bottom: 18px; }
.matching-guide-two { grid-template-columns: repeat(2,1fr); }
.matching-guide > div { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 13px; background: rgba(255,255,255,.74); }
.matching-guide b { width: 30px; height: 30px; display: grid; flex: 0 0 auto; place-items: center; border-radius: 9px; color: #fff; background: linear-gradient(135deg,#2563eb,#6d45d8); }
.matching-guide span, .matching-guide strong, .matching-guide small { display: block; }
.matching-guide small { margin-top: 2px; color: var(--muted); }
.matching-list { display: grid; gap: 12px; }
.matching-card { display: grid; grid-template-columns: minmax(0,1.25fr) minmax(330px,.75fr); gap: 22px; padding: 20px; border: 1px solid var(--line); border-radius: 16px; background: #fff; box-shadow: var(--shadow); }
.card-stage { margin: 0 0 9px; color: #2563eb; font-size: 10px; font-weight: 850; text-transform: uppercase; letter-spacing: .07em; }
.card-stage.primary-stage { color: #15803d; }
.matching-title { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.matching-title h2 { margin: 0; font-size: 17px; line-height: 1.35; }
.source-group { display: block; margin-bottom: 4px; color: #6d45d8; font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.source-group.neutral { color: #728094; }
.source-group.separated { color: #b45309; }
.matching-title > span { flex: 0 0 auto; padding: 4px 8px; border-radius: 99px; color: #536170; background: #eef2f6; font-size: 11px; font-weight: 800; }
.listing-chips { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 13px; }
.listing-chip { display: inline-flex; align-items: stretch; overflow: hidden; border-radius: 8px; color: #445261; background: #f5f7fa; font-size: 12px; }
.listing-chip > span { padding: 7px 9px; }
.listing-chip form { display: flex; border-left: 1px solid #e1e6ec; }
.listing-chip button { padding: 0 8px; border: 0; color: #8a5a32; background: #fff8ef; font-size: 10px; font-weight: 750; }
.listing-chip button:hover { color: #9a3412; background: #ffedd5; }
.listing-chips small { color: #89939e; }
.rejoin-form { margin-top: 10px; }
.rejoin-form button { color: #2563eb; }
.group-match-form { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-content: center; padding: 14px; border-radius: 12px; background: var(--canvas); }
.group-match-form > label, .suggestion-preview { grid-column: 1 / -1; }
.group-match-form > .card-stage { grid-column: 1 / -1; }
.group-match-form > label { color: var(--muted); font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; }
.suggestion-preview { width: 100%; display: flex; gap: 10px; align-items: flex-start; margin-bottom: 2px; padding: 0; border: 0; color: inherit; background: transparent; text-align: left; cursor: pointer; }
.suggestion-preview > strong { padding: 5px 8px; border-radius: 7px; color: #1d4ed8; background: #eaf1ff; font-size: 13px; }
.suggestion-preview span, .suggestion-preview small { display: block; }
.suggestion-preview span { font-size: 13px; font-weight: 700; }
.suggestion-preview small { margin-top: 2px; color: var(--muted); font-weight: 500; }
.suggestion-preview em { margin-left: auto; padding: 5px 8px; border-radius: 7px; color: #1d4ed8; background: #fff; font-size: 11px; font-style: normal; font-weight: 800; }
.group-match-form input { min-width: 0; }
.search-hint { margin-top: -10px !important; color: var(--muted); font-size: 12px; }
.matching-toolbar { align-items: stretch; }
.matching-toolbar .filter-bar { min-width: 330px; }
.matching-filters { flex-wrap: wrap; justify-content: flex-end; }
.filter-explanation { margin: 10px 2px 0; color: var(--muted); font-size: 12px; }

.pagination { min-height: 58px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 0 16px; border-top: 1px solid var(--line); color: var(--muted); }
.pagination a:last-child { justify-self: end; }
.pagination strong { font-size: 12px; }

@media (max-width: 1100px) {
    .mode-pill { display: none; }
    .account-grid { grid-template-columns: repeat(2,minmax(240px,1fr)); }
    .setup-banner { grid-template-columns: auto 1fr auto; }
    .setup-progress { grid-column: 2 / 3; }
    .workflow-steps { grid-template-columns: repeat(2,minmax(0,1fr)); }
}

@media (max-width: 720px) {
    body { padding-bottom: 76px; }
    .topbar { min-height: 66px; padding: 10px 14px; flex-wrap: nowrap; background: #fff; backdrop-filter: none; -webkit-backdrop-filter: none; }
    .brand { min-width: 0; }
    .brand-mark { width: 38px; height: 38px; }
    .brand small { font-size: 10px; }
    .topbar > form, .mode-pill { display: none; }
    .nav { position: fixed; z-index: 30; left: 8px; right: 8px; bottom: 8px; width: auto; height: 64px; order: initial; align-self: auto; display: grid; grid-template-columns: repeat(5,1fr); gap: 0; padding: 4px; overflow: visible; border: 1px solid rgba(214,220,228,.9); border-radius: 18px; background: rgba(255,255,255,.95); box-shadow: 0 12px 38px rgba(20,36,58,.2); backdrop-filter: blur(18px); }
    .nav a { min-width: 0; min-height: 54px; display: flex; flex-direction: column; justify-content: center; gap: 2px; padding: 4px 2px; border-radius: 13px; font-size: 9px; }
    .nav a.active { background: #edf3ff; }
    .nav a.active:after { display: none; }
    .nav-icon { display: block; }
    .nav-badge { position: absolute; top: 4px; left: 56%; margin: 0; }
    .page { padding-top: 24px; }
    .page-heading { gap: 20px; margin-bottom: 22px; }
    .page-heading h1 { font-size: 31px; }
    .heading-actions { display: grid; grid-template-columns: 1fr 1fr; width: 100%; }
    .heading-actions > *, .heading-actions form .button { width: 100%; }
    .setup-banner { grid-template-columns: auto 1fr; gap: 12px; padding: 16px; }
    .setup-progress { grid-column: 1 / -1; }
    .setup-banner .button { grid-column: 1 / -1; width: 100%; }
    .metrics { gap: 12px; }
    .metrics article { min-height: 96px; }
    .workflow-panel { margin-top: -6px; }
    .workflow-heading { align-items: flex-start; flex-direction: column; gap: 4px; }
    .workflow-steps { grid-template-columns: 1fr; }
    .account-grid { grid-template-columns: 1fr; }
    .account-card { min-height: 195px; }
    .section-heading { align-items: flex-start; gap: 10px; }
    .section-heading > a { text-align: right; font-size: 12px; }
    .toolbar { align-items: stretch; flex-direction: column; }
    .segmented { width: 100%; }
    .segmented a { flex: 1; justify-content: center; }
    .settings-grid { gap: 10px; }
    .stock-upload { grid-template-columns: 1fr; gap: 18px; padding: 20px; }
    .matching-guide { grid-template-columns: 1fr; }
    .matching-filters { overflow-x: auto; flex-wrap: nowrap; justify-content: flex-start; }
    .matching-card { grid-template-columns: 1fr; padding: 16px; }
    .group-match-form { grid-template-columns: 1fr; }
    .group-match-form .button { width: 100%; }
    .security-pill { align-self: flex-start; }
    th, td { padding: 12px; }
}
