/* Seller Portal — self-contained, system-font dark admin theme */
:root {
  color-scheme: dark;
  --bg: #090d13;
  --sidebar: #0c1119;
  --surface: #101721;
  --surface-raised: #141d29;
  --surface-hover: #182332;
  --border: #222d3c;
  --border-strong: #304056;
  --text: #edf2f8;
  --text-soft: #c1ccda;
  --muted: #8290a3;
  --faint: #5d6b7e;
  --accent: #f5a524;
  --accent-hover: #ffb83e;
  --accent-ink: #211608;
  --blue: #6ea8fe;
  --green: #4fd1a5;
  --red: #ff7a86;
  --purple: #b69cff;
  --shadow: 0 18px 50px rgba(0, 0, 0, .3);
  --radius: 12px;
  --radius-small: 8px;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--bg); scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; min-height: 100vh; background: var(--bg); color: var(--text); font-size: 13px; line-height: 1.5; }
button, input, select, textarea { font: inherit; }
button, select { cursor: pointer; }
button { color: inherit; }
a { color: var(--blue); }
h1, h2, h3, p { margin: 0; }
h1 { font-size: 24px; line-height: 1.2; letter-spacing: -.035em; }
h2 { font-size: 15px; line-height: 1.35; letter-spacing: -.015em; }
h3 { font-size: 14px; }
[hidden] { display: none !important; }
::selection { background: rgba(245, 165, 36, .28); color: #fff; }

.icon-sprite { position: absolute; width: 0; height: 0; overflow: hidden; pointer-events: none; }
.icon { width: 18px; height: 18px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.mono, code, .key-value { font-family: "Cascadia Code", "SFMono-Regular", Consolas, "Liberation Mono", monospace; }
.visually-hidden { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important; }
.skip-link { position: fixed; z-index: 100; top: 10px; left: 10px; padding: 9px 14px; border-radius: 7px; background: var(--accent); color: var(--accent-ink); font-weight: 700; transform: translateY(-150%); }
.skip-link:focus { transform: translateY(0); }

:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
input:focus, select:focus, textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(110, 168, 254, .12); outline: none; }
input[readonly] { color: var(--text-soft); background: #0d131c; }
input:disabled, select:disabled, textarea:disabled, button:disabled { cursor: not-allowed; opacity: .55; }

.center-screen { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.boot-card, .gate-card { width: min(100%, 420px); text-align: center; }
.boot-card { display: flex; flex-direction: column; align-items: center; gap: 14px; color: var(--muted); }
.boot-card h1 { color: var(--text); font-size: 20px; }
.boot-card p { font-size: 13px; }
.gate-card { padding: 36px; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); box-shadow: var(--shadow); }
.gate-card h1 { margin: 8px 0 12px; }
.gate-card > p:not(.eyebrow) { margin: 0 auto 24px; color: var(--muted); max-width: 330px; }
.gate-icon { width: 52px; height: 52px; display: grid; place-items: center; margin: 0 auto 18px; border-radius: 14px; color: var(--red); background: rgba(255, 122, 134, .09); border: 1px solid rgba(255, 122, 134, .2); }
.gate-icon .icon { width: 25px; height: 25px; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 238px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 22px 16px 16px; border-right: 1px solid var(--border); background: var(--sidebar); z-index: 5; }
.brand { display: flex; align-items: center; gap: 11px; padding: 0 7px 24px; }
.brand-mark { width: 36px; height: 36px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 10px; background: var(--accent); color: var(--accent-ink); box-shadow: 0 5px 18px rgba(245, 165, 36, .12); }
.brand-mark .icon { width: 20px; height: 20px; stroke-width: 2; }
.brand-mark-large { width: 50px; height: 50px; border-radius: 14px; margin-bottom: 8px; }
.brand-mark-large .icon { width: 25px; height: 25px; }
.brand strong { display: block; font-size: 14px; letter-spacing: -.01em; }
.brand span { display: block; margin-top: 1px; color: var(--muted); font-size: 11px; }
.nav-label, .eyebrow { color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .11em; text-transform: uppercase; }
.nav-label { padding: 0 10px; margin-bottom: 8px; }
.nav-tabs { display: flex; flex-direction: column; gap: 4px; }
.nav-tab { width: 100%; min-height: 40px; display: flex; align-items: center; gap: 10px; padding: 9px 11px; border: 1px solid transparent; border-radius: 8px; background: transparent; color: var(--muted); text-align: left; font-weight: 600; transition: color .15s, background .15s, border-color .15s; }
.nav-tab:hover { color: var(--text-soft); background: var(--surface); }
.nav-tab.is-active { color: var(--text); border-color: #2b3543; background: var(--surface-raised); }
.nav-tab.is-active .icon { color: var(--accent); }
.nav-tab .icon { width: 17px; height: 17px; }
.nav-badge { margin-left: auto; padding: 1px 6px; border: 1px solid var(--border); border-radius: 4px; color: var(--faint); font-size: 9px; font-weight: 700; text-transform: uppercase; }
.account-card { margin-top: auto; padding: 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.account-heading { display: flex; align-items: center; gap: 9px; padding-bottom: 14px; margin-bottom: 12px; border-bottom: 1px solid var(--border); }
.avatar { width: 32px; height: 32px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 9px; background: rgba(110, 168, 254, .12); color: var(--blue); font-size: 12px; font-weight: 800; text-transform: uppercase; }
.account-identity { min-width: 0; }
.account-identity strong { display: block; overflow: hidden; color: var(--text-soft); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.account-identity > span { display: block; margin-top: 2px; color: var(--muted); font-size: 10px; }
#account-role { text-transform: capitalize; }
.dot { padding: 0 4px; color: var(--faint); }
.quota-heading, .quota-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.quota-heading { color: var(--muted); font-size: 10px; }
.quota-heading strong { color: var(--text-soft); font-size: 11px; }
.quota-meta { margin-top: 6px; color: var(--faint); font-size: 9px; }
progress { width: 100%; height: 5px; display: block; margin-top: 8px; overflow: hidden; border: 0; border-radius: 10px; background: #242e3b; appearance: none; }
progress::-webkit-progress-bar { border-radius: 10px; background: #242e3b; }
progress::-webkit-progress-value { border-radius: 10px; background: var(--accent); }
progress::-moz-progress-bar { border-radius: 10px; background: var(--accent); }
progress.is-exhausted::-webkit-progress-value { background: var(--red); }
progress.is-exhausted::-moz-progress-bar { background: var(--red); }
.sidebar-footer { display: flex; align-items: flex-start; gap: 8px; padding: 14px 7px 0; color: var(--faint); font-size: 9px; line-height: 1.5; }
.sidebar-footer .icon { width: 13px; height: 13px; margin-top: 1px; }

.main-content { min-width: 0; width: 100%; max-width: 1580px; margin: 0 auto; padding: 24px 28px 40px; }
.topbar { min-height: 62px; display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.topbar .eyebrow { margin-bottom: 4px; }
.page-description { margin-top: 5px; color: var(--muted); font-size: 12px; }
.page-panel { display: flex; flex-direction: column; gap: 18px; }
.card, .stat-card { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.card { min-width: 0; }
.card-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 18px 20px; border-bottom: 1px solid var(--border); }
.card-heading p { margin-top: 4px; color: var(--muted); font-size: 11px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.compact-heading { margin-bottom: 10px; }
.compact-heading .eyebrow { margin-bottom: 2px; }
.section-status { color: var(--muted); font-size: 10px; }
.section-status.is-error { color: var(--red); }
.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.stat-card { min-width: 0; display: flex; align-items: center; gap: 12px; padding: 15px; }
.stat-icon { width: 36px; height: 36px; display: grid; place-items: center; flex: 0 0 auto; border: 1px solid; border-radius: 9px; }
.stat-icon-blue { color: var(--blue); border-color: rgba(110, 168, 254, .18); background: rgba(110, 168, 254, .08); }
.stat-icon-green { color: var(--green); border-color: rgba(79, 209, 165, .18); background: rgba(79, 209, 165, .08); }
.stat-icon-orange { color: var(--accent); border-color: rgba(245, 165, 36, .18); background: rgba(245, 165, 36, .08); }
.stat-icon-purple { color: var(--purple); border-color: rgba(182, 156, 255, .18); background: rgba(182, 156, 255, .08); }
.stat-card > div:last-child { min-width: 0; display: grid; grid-template-columns: 1fr auto; align-items: baseline; flex: 1; column-gap: 8px; }
.stat-card span { color: var(--muted); font-size: 10px; font-weight: 600; }
.stat-card strong { grid-row: span 2; color: var(--text); font-size: 23px; line-height: 1; letter-spacing: -.04em; }
.stat-card small { overflow: hidden; margin-top: 3px; color: var(--faint); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }

.generate-layout { display: grid; grid-template-columns: minmax(340px, .85fr) minmax(390px, 1.15fr); gap: 18px; align-items: start; }
.form-card form { padding: 20px; }
.form-grid { display: grid; gap: 14px; }
.two-columns { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.field { min-width: 0; margin-bottom: 15px; }
.field label, .label-row > label { display: block; margin-bottom: 6px; color: var(--text-soft); font-size: 11px; font-weight: 600; }
.field label > span[aria-hidden] { color: var(--accent); }
.label-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.label-row > span { margin-bottom: 6px; color: var(--faint); font-size: 9px; }
.field small { display: block; margin-top: 6px; color: var(--faint); font-size: 9px; line-height: 1.45; }
input, select, textarea { width: 100%; min-height: 37px; padding: 8px 10px; border: 1px solid var(--border-strong); border-radius: 7px; background: #0c121b; color: var(--text); transition: border-color .15s, box-shadow .15s; }
input::placeholder, textarea::placeholder { color: #566477; opacity: 1; }
textarea { min-height: 74px; resize: vertical; line-height: 1.5; }
select { padding-right: 28px; }
.input-suffix, .input-action { display: flex; align-items: stretch; }
.input-suffix input { border-radius: 7px 0 0 7px; }
.input-suffix > span { display: flex; align-items: center; padding: 0 11px; border: 1px solid var(--border-strong); border-left: 0; border-radius: 0 7px 7px 0; background: var(--surface-raised); color: var(--muted); font-size: 10px; }
.input-action input { min-width: 0; border-radius: 7px 0 0 7px; font-size: 10px; }
.input-action .icon-button { width: 39px; height: auto; min-height: 37px; border-left: 0; border-radius: 0 7px 7px 0; }
.form-actions { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 2px; }
.form-actions p { max-width: 250px; color: var(--faint); font-size: 9px; }

.button { min-height: 36px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 8px 13px; border: 1px solid transparent; border-radius: 7px; font-size: 11px; font-weight: 700; line-height: 1.2; white-space: nowrap; transition: background .15s, border-color .15s, color .15s, transform .1s; }
.button:active:not(:disabled) { transform: translateY(1px); }
.button .icon { width: 15px; height: 15px; }
.button-primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.button-primary:hover:not(:disabled) { background: var(--accent-hover); border-color: var(--accent-hover); }
.button-secondary { background: var(--surface-raised); color: var(--text-soft); border-color: var(--border-strong); }
.button-secondary:hover:not(:disabled), .button-ghost:hover:not(:disabled) { background: var(--surface-hover); color: var(--text); border-color: #40516a; }
.button-ghost { background: transparent; color: var(--muted); border-color: var(--border); }
.button-danger { background: rgba(255, 122, 134, .12); color: #ff9aa4; border-color: rgba(255, 122, 134, .32); }
.button-danger:hover:not(:disabled) { background: rgba(255, 122, 134, .2); }
.button-small { min-height: 30px; padding: 6px 9px; font-size: 10px; }
.button-group, .heading-actions { display: flex; align-items: center; gap: 7px; }
.icon-button { width: 32px; height: 32px; display: inline-grid; place-items: center; flex: 0 0 auto; padding: 0; border: 1px solid var(--border-strong); border-radius: 7px; background: var(--surface-raised); color: var(--muted); transition: color .15s, border-color .15s, background .15s; }
.icon-button:hover:not(:disabled) { color: var(--text); border-color: #40516a; background: var(--surface-hover); }
.icon-button .icon { width: 15px; height: 15px; }
.button.is-loading .icon, .icon-button.is-loading .icon { animation: spin .8s linear infinite; }

.alert { margin-bottom: 15px; padding: 10px 12px; border: 1px solid; border-radius: 7px; font-size: 11px; overflow-wrap: anywhere; }
.alert-error { color: #ffb0b7; border-color: rgba(255, 122, 134, .24); background: rgba(255, 122, 134, .07); }
.alert-warning { color: #f7cc85; border-color: rgba(245, 165, 36, .25); background: rgba(245, 165, 36, .07); }
#global-alert { margin: -6px 0 18px; }

.results-card { min-height: 390px; }
.results-heading { align-items: center; }
.compact-empty { min-height: 285px; border: 0; }
.empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 36px 20px; color: var(--muted); text-align: center; }
.empty-state h3 { margin: 12px 0 5px; color: var(--text-soft); }
.empty-state p { max-width: 350px; font-size: 11px; }
.empty-icon { width: 40px; height: 40px; display: grid; place-items: center; border: 1px solid var(--border); border-radius: 11px; background: var(--surface-raised); color: var(--faint); }
.generated-output { padding: 16px 20px 20px; }
.success-banner { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; padding: 9px 11px; border: 1px solid rgba(79, 209, 165, .2); border-radius: 7px; background: rgba(79, 209, 165, .07); color: var(--green); font-size: 10px; }
.success-banner .icon { width: 15px; height: 15px; }
.key-list { max-height: 390px; display: flex; flex-direction: column; gap: 7px; margin: 0; padding: 0; overflow: auto; list-style: none; counter-reset: generated-key; }
.key-item { display: flex; align-items: center; gap: 10px; padding: 10px; border: 1px solid var(--border); border-radius: 7px; background: #0c121b; counter-increment: generated-key; }
.key-item::before { content: counter(generated-key, decimal-leading-zero); color: var(--faint); font-family: "Cascadia Code", Consolas, monospace; font-size: 9px; }
.key-item code { min-width: 0; flex: 1; color: var(--text-soft); font-size: 11px; overflow-wrap: anywhere; }
.key-item .icon-button { width: 28px; height: 28px; background: transparent; }

.table-card { overflow: hidden; }
.table-heading { align-items: center; }
.count-label { color: var(--muted); font-size: 10px; white-space: nowrap; }
.table-scroll { width: 100%; overflow: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; }
th { height: 37px; padding: 8px 14px; border-bottom: 1px solid var(--border); background: #0e141d; color: var(--muted); font-size: 9px; font-weight: 700; letter-spacing: .045em; text-transform: uppercase; white-space: nowrap; }
td { max-width: 300px; padding: 11px 14px; border-bottom: 1px solid rgba(34, 45, 60, .7); color: var(--text-soft); font-size: 11px; vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr[data-row]:hover { background: rgba(24, 35, 50, .5); }
#history-table { min-width: 840px; }
#sellers-table { min-width: 850px; }
#audit-table { min-width: 900px; }
.cell-primary { display: block; color: var(--text); font-weight: 600; }
.cell-secondary { display: block; margin-top: 2px; color: var(--faint); font-size: 9px; }
.key-cell { min-width: 190px; max-width: 330px; }
.key-value { color: #dce8f7; font-size: 10px; overflow-wrap: anywhere; }
.note-cell { min-width: 120px; max-width: 230px; overflow-wrap: anywhere; color: var(--muted); }
.date-cell { min-width: 135px; color: var(--muted); white-space: nowrap; }
.actions-column { width: 1%; text-align: right; }
.row-actions { display: flex; align-items: center; justify-content: flex-end; gap: 5px; }
.row-actions .button { min-height: 28px; }
.row-actions .icon-button { width: 28px; height: 28px; }
.status-pill, .role-pill { display: inline-flex; align-items: center; gap: 5px; padding: 2px 7px; border: 1px solid var(--border); border-radius: 999px; color: var(--muted); background: rgba(130, 144, 163, .05); font-size: 9px; font-weight: 700; text-transform: capitalize; white-space: nowrap; }
.status-pill::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.status-active { color: var(--green); border-color: rgba(79, 209, 165, .2); background: rgba(79, 209, 165, .06); }
.status-inactive { color: var(--red); border-color: rgba(255, 122, 134, .2); background: rgba(255, 122, 134, .06); }
.role-pill { text-transform: uppercase; letter-spacing: .04em; }
.role-owner { color: var(--purple); border-color: rgba(182, 156, 255, .2); }
.role-admin { color: var(--blue); border-color: rgba(110, 168, 254, .2); }
.table-state { height: 180px; padding: 28px; text-align: center; color: var(--muted); }
.table-state-content { display: inline-flex; flex-direction: column; align-items: center; gap: 8px; max-width: 380px; }
.table-state-content strong { color: var(--text-soft); font-size: 12px; }
.table-state-content p { font-size: 10px; }
.table-state-content .button { margin-top: 4px; }
.loading-line { display: inline-flex; align-items: center; justify-content: center; gap: 9px; }
.spinner { width: 19px; height: 19px; display: inline-block; flex: 0 0 auto; border: 2px solid var(--border-strong); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
.spinner-small { width: 13px; height: 13px; }

.seller-form-card form { padding-bottom: 16px; }
.seller-form-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr .8fr .8fr; gap: 12px; }
.seller-form-grid .field { margin-bottom: 16px; }
.checkbox-field > label { margin-bottom: 6px; }
.checkbox-control { min-height: 37px; display: flex !important; align-items: center; gap: 8px; margin: 0 !important; padding: 8px 10px; border: 1px solid var(--border-strong); border-radius: 7px; background: #0c121b; cursor: pointer; }
.checkbox-control input { width: 14px; min-height: 14px; height: 14px; margin: 0; padding: 0; accent-color: var(--accent); }
.checkbox-control span { color: var(--text-soft); font-size: 10px; }

dialog { width: min(calc(100% - 32px), 480px); max-height: calc(100vh - 40px); padding: 0; overflow: auto; border: 1px solid var(--border-strong); border-radius: 13px; background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
dialog::backdrop { background: rgba(3, 6, 10, .75); backdrop-filter: blur(3px); }
.dialog-form { padding: 20px; }
.dialog-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding-bottom: 17px; margin-bottom: 17px; border-bottom: 1px solid var(--border); }
.dialog-heading .eyebrow { margin-bottom: 4px; }
.dialog-heading h2 { font-size: 17px; }
.dialog-close { margin: -5px -5px 0 0; border-color: transparent; background: transparent; }
.dialog-description { margin-bottom: 15px; color: var(--muted); font-size: 11px; }
.selected-record { margin-bottom: 16px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 7px; background: #0c121b; }
.selected-record > span { display: block; margin-bottom: 4px; color: var(--faint); font-size: 9px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.selected-record code, .selected-record strong { display: block; color: var(--text-soft); font-size: 11px; overflow-wrap: anywhere; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; padding-top: 3px; }

.toast { position: fixed; z-index: 50; right: 22px; bottom: 22px; max-width: min(420px, calc(100vw - 32px)); display: flex; align-items: center; gap: 9px; padding: 10px 10px 10px 13px; border: 1px solid rgba(79, 209, 165, .25); border-radius: 9px; background: #121d20; color: #a4e9d2; box-shadow: var(--shadow); font-size: 11px; animation: toast-in .18s ease-out; }
.toast > .icon { width: 16px; height: 16px; }
.toast > span { min-width: 0; overflow-wrap: anywhere; }
.toast .icon-button { width: 26px; height: 26px; margin-left: 5px; border-color: transparent; background: transparent; color: inherit; }
.toast-error { color: #ffb0b7; border-color: rgba(255, 122, 134, .28); background: #24171c; }
.clipboard-helper { position: fixed; top: 0; left: 0; width: 1px; height: 1px; min-height: 0; padding: 0; border: 0; opacity: 0; pointer-events: none; }
.key-cell .row-actions { justify-content: flex-start; }
.key-cell .key-value { flex: 1; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

@media (max-width: 1200px) {
  .app-shell { grid-template-columns: 215px minmax(0, 1fr); }
  .main-content { padding-inline: 20px; }
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .seller-form-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .seller-email-field { grid-column: span 2; }
}

@media (max-width: 900px) {
  .generate-layout { grid-template-columns: 1fr; }
  .results-card { min-height: 0; }
  .compact-empty { min-height: 220px; }
  .key-list { max-height: 330px; }
}

@media (max-width: 760px) {
  .app-shell { display: block; }
  .sidebar { position: static; width: 100%; height: auto; display: grid; grid-template-columns: 1fr auto; gap: 14px; padding: 14px 16px; border-right: 0; border-bottom: 1px solid var(--border); }
  .brand { padding: 0; }
  .primary-nav { grid-column: 1 / -1; grid-row: 2; }
  .nav-label { display: none; }
  .nav-tabs { flex-direction: row; gap: 5px; overflow-x: auto; padding-bottom: 1px; }
  .nav-tab { width: auto; min-width: max-content; min-height: 36px; padding: 7px 10px; }
  .nav-badge { margin-left: 2px; }
  .account-card { min-width: 205px; margin: 0; padding: 8px 10px; }
  .account-heading { padding-bottom: 8px; margin-bottom: 8px; }
  .account-card .quota-meta { display: none; }
  .avatar { width: 30px; height: 30px; }
  .sidebar-footer { display: none; }
  .main-content { padding: 20px 16px 32px; }
  .topbar { margin-bottom: 18px; }
  .seller-form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 520px) {
  h1 { font-size: 21px; }
  .sidebar { grid-template-columns: 1fr; gap: 12px; padding: 12px; }
  .account-card { grid-row: 2; min-width: 0; }
  .account-identity strong { white-space: normal; overflow-wrap: anywhere; }
  .primary-nav { grid-row: 3; }
  .nav-tab { flex: 1; justify-content: center; }
  .nav-tab .icon { width: 16px; height: 16px; }
  .nav-badge { display: none; }
  .main-content { padding: 17px 12px 28px; }
  .topbar { align-items: flex-end; gap: 10px; }
  .topbar .button { width: 36px; padding: 0; }
  .topbar .button span { display: none; }
  .page-description { max-width: 260px; font-size: 11px; }
  .stats-grid { gap: 8px; }
  .stat-card { gap: 9px; padding: 12px 10px; }
  .stat-icon { width: 30px; height: 30px; }
  .stat-icon .icon { width: 15px; height: 15px; }
  .stat-card strong { font-size: 20px; }
  .stat-card small { display: none; }
  .stat-card > div:last-child { display: block; }
  .stat-card span { display: block; margin-bottom: 4px; }
  .card-heading { padding: 15px; }
  .form-card form { padding: 15px; }
  .two-columns, .seller-form-grid { grid-template-columns: 1fr; gap: 0; }
  .seller-email-field { grid-column: auto; }
  .form-actions { align-items: stretch; flex-direction: column; gap: 10px; }
  .form-actions p { max-width: none; }
  .form-actions .button { width: 100%; }
  .results-heading { align-items: flex-start; flex-direction: column; }
  .generated-output { padding: 13px 15px 15px; }
  .button-group { width: 100%; }
  .button-group .button { flex: 1; }
  .toast { right: 12px; bottom: 12px; left: 12px; max-width: none; }
  .dialog-form { padding: 16px; }
}

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