:root {
  color-scheme: light;
  --ink: #1d2736;
  --ink-soft: #344054;
  --muted: #667085;
  --muted-light: #98a2b3;
  --line: #e4e7ec;
  --line-strong: #d0d5dd;
  --paper: #ffffff;
  --canvas: #f4f6f8;
  --surface-soft: #f8fafc;
  --primary: #315f96;
  --primary-dark: #244b79;
  --primary-pale: #eaf1f8;
  --success: #287a5b;
  --success-pale: #eaf6f0;
  --warning: #8a642f;
  --warning-pale: #fbf3e3;
  --danger: #b54747;
  --danger-pale: #fff0f0;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .04);
  --shadow-md: 0 10px 28px rgba(16, 24, 40, .08);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --sidebar-width: 252px;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }
html { min-width: 320px; overflow-x: clip; background: var(--canvas); }
body { margin: 0; overflow-x: clip; color: var(--ink); background: var(--canvas); font-size: 14px; line-height: 1.55; }
button, input, select, textarea { font: inherit; }
button, [role="button"] { cursor: pointer; touch-action: manipulation; }
button, input, select, textarea, a { -webkit-tap-highlight-color: transparent; }
a { color: var(--primary); }
.hidden { display: none !important; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.icon-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.skip-link { position: fixed; z-index: 2000; top: 10px; left: 10px; transform: translateY(-150%); padding: 10px 14px; border-radius: var(--radius-sm); color: #fff; background: var(--primary-dark); }
.skip-link:focus { transform: translateY(0); }
:focus-visible { outline: 3px solid rgba(49, 95, 150, .28); outline-offset: 2px; }

.eyebrow { margin: 0 0 4px; color: var(--primary); font-size: 11px; font-weight: 700; letter-spacing: .15em; }
h1, h2, h3, h4 { color: var(--ink); letter-spacing: -.015em; }

.login-shell { min-height: 100dvh; display: grid; place-items: center; padding: 28px; background: var(--canvas); }
.login-shell::before { position: fixed; inset: 0 50% 0 0; z-index: 0; content: ""; background: #edf2f7; }
.login-card { position: relative; z-index: 1; width: min(440px, 100%); padding: 36px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--paper); box-shadow: var(--shadow-md); }
.brand-lockup { display: flex; align-items: center; gap: 12px; padding-bottom: 24px; border-bottom: 1px solid var(--line); }
.brand-lockup strong { font-size: 15px; }
.brand-mark { width: 48px; height: 48px; display: grid; flex: 0 0 auto; place-items: center; border-radius: 12px; color: #fff; background: var(--primary); font: 700 24px serif; }
.login-intro { margin-top: 28px; }
.login-intro h1 { margin: 0; font-size: 28px; }
.login-intro p { margin: 8px 0 0; }
.login-card form { display: grid; gap: 18px; margin-top: 28px; }
.legal-copy { margin: 18px 0 0; color: var(--muted); font-size: 12px; line-height: 1.75; text-align: center; }
.legal-copy a { color: inherit; }

label { display: grid; align-content: start; gap: 7px; min-width: 0; color: var(--ink-soft); font-size: 13px; font-weight: 600; }
input, select, textarea { width: 100%; min-height: 42px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); padding: 9px 12px; color: var(--ink); background: #fff; outline: none; transition: border-color .16s ease, box-shadow .16s ease, background .16s ease; }
textarea { min-height: 104px; resize: vertical; line-height: 1.6; }
input::placeholder, textarea::placeholder { color: var(--muted-light); }
input:hover, select:hover, textarea:hover { border-color: #aab3c0; }
input:focus, select:focus, textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(49, 95, 150, .12); }
input[readonly] { color: var(--muted); background: var(--surface-soft); }

.primary, .secondary { min-height: 42px; border: 1px solid transparent; border-radius: var(--radius-sm); padding: 9px 16px; font-weight: 650; transition: background .16s ease, border-color .16s ease, color .16s ease, box-shadow .16s ease; }
.primary { color: #fff; background: var(--primary); box-shadow: var(--shadow-sm); }
.primary:hover { background: var(--primary-dark); }
.primary:active { background: #1d406a; }
.secondary { color: var(--ink-soft); border-color: var(--line-strong); background: #fff; }
.secondary:hover { color: var(--primary); border-color: #9db1c9; background: var(--primary-pale); }
.secondary:active { background: #dfeaf5; }
.block { width: 100%; min-height: 46px; }
.error { min-height: 20px; color: var(--danger); font-size: 13px; }

.app-shell { min-height: 100dvh; display: grid; grid-template-columns: var(--sidebar-width) minmax(0, 1fr); }
.sidebar { position: sticky; z-index: 40; top: 0; height: 100dvh; display: flex; flex-direction: column; overflow-y: auto; padding: 24px 16px 18px; color: var(--ink-soft); border-right: 1px solid var(--line); background: #fff; }
.logo { display: flex; align-items: center; gap: 12px; padding: 0 10px 22px; border-bottom: 1px solid var(--line); }
.logo > span { width: 40px; height: 40px; display: grid; flex: 0 0 auto; place-items: center; border-radius: 10px; color: #fff; background: var(--primary); font: 700 21px serif; }
.logo strong, .logo small { display: block; }
.logo strong { font-size: 16px; }
.logo small { margin-top: 2px; color: var(--muted); font-size: 11px; }
nav { display: grid; gap: 3px; padding-top: 14px; }
.nav-section-label { margin: 12px 12px 4px; color: var(--muted-light); font-size: 11px; font-weight: 700; letter-spacing: .08em; }
nav button { position: relative; display: flex; align-items: center; gap: 10px; width: 100%; min-height: 48px; border: 0; border-radius: 10px; padding: 7px 10px; color: #475467; background: transparent; text-align: left; font-weight: 550; transition: color .16s ease, background .16s ease; }
nav button::before { position: absolute; top: 10px; bottom: 10px; left: 0; width: 3px; border-radius: 2px; content: ""; background: transparent; }
nav button:hover { color: var(--ink); background: var(--surface-soft); }
nav button.active { color: var(--primary-dark); background: var(--primary-pale); font-weight: 700; }
nav button.active::before { background: var(--primary); }
.nav-icon { width: 32px; height: 32px; flex: 0 0 auto; padding: 6px; border-radius: 9px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.55; background: #f2f4f7; transition: color .16s ease, background .16s ease; }
nav button:hover .nav-icon { color: var(--primary-dark); background: #e8eef5; }
nav button.active .nav-icon { color: #fff; background: var(--primary); }
.sidebar-foot { margin-top: auto; padding: 18px 10px 0; border-top: 1px solid var(--line); }
.status-dot { color: var(--muted); font-size: 12px; }
.status-dot span { display: inline-block; width: 7px; height: 7px; margin-right: 8px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 4px var(--success-pale); }
.text-button { min-height: 40px; border: 0; padding: 14px 0 0; color: var(--muted); background: transparent; font-size: 12px; }
.text-button:hover { color: var(--danger); }
.sidebar-backdrop { display: none; }

main { min-width: 0; }
.topbar { position: sticky; z-index: 30; top: 0; min-height: 88px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 16px 32px; border-bottom: 1px solid var(--line); background: rgba(255, 255, 255, .94); backdrop-filter: blur(12px); }
.page-heading { min-width: 0; }
.topbar h2 { margin: 0; font-size: 22px; line-height: 1.25; }
#page-subtitle { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.operator { display: flex; align-items: center; gap: 10px; color: var(--ink-soft); font-size: 13px; text-align: right; }
.operator span, .operator small { display: block; }
.operator small { color: var(--muted); font-size: 11px; }
.operator b { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; color: var(--primary-dark); background: var(--primary-pale); }
.menu-toggle { display: none; width: 42px; height: 42px; flex: 0 0 auto; place-items: center; border: 1px solid var(--line); border-radius: var(--radius-sm); color: var(--ink-soft); background: #fff; }
.menu-toggle svg, .icon-button svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-width: 1.8; }
.content { width: 100%; max-width: 1480px; min-height: calc(100dvh - 150px); margin: 0 auto; padding: 20px 24px 44px; }
.content:focus { outline: none; }
.site-footer { padding: 12px 24px 22px; color: var(--muted); font-size: 12px; line-height: 1.8; text-align: center; }
.site-footer a { color: inherit; }

.stats { display: grid; grid-template-columns: repeat(5, minmax(150px, 1fr)); gap: 14px; }
.overview-hero, .settlement-hero { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 10px; padding: 18px 22px; overflow: hidden; border: 1px solid #dbe5ef; border-radius: var(--radius-md); background: linear-gradient(135deg, #fff 0%, #f4f8fc 58%, #eaf1f8 100%); box-shadow: var(--shadow-sm); }
.overview-hero h3, .settlement-hero h3 { margin: 1px 0 4px; font-size: clamp(19px, 1.8vw, 24px); }
.overview-hero p, .settlement-hero p { max-width: 760px; margin: 0; color: var(--muted); }
.overview-health { min-width: 152px; padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--radius-md); background: rgba(255,255,255,.88); text-align: right; }
.overview-health span, .overview-health strong { display: block; }
.overview-health span { color: var(--muted); font-size: 12px; }
.overview-health strong { margin-top: 5px; font-size: 20px; }
.overview-health.is-ready strong { color: var(--success); }
.overview-health.needs-attention strong { color: var(--danger); }
.stat-card, .panel { border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--paper); box-shadow: var(--shadow-sm); }
.stat-card { position: relative; min-height: 144px; overflow: hidden; padding: 22px; }
.stat-card::after { position: absolute; right: 0; bottom: 0; width: 56px; height: 4px; content: ""; background: var(--primary); opacity: .72; }
.stat-card span { color: var(--muted); font-size: 12px; font-weight: 600; }
.stat-card strong { display: block; margin-top: 12px; color: var(--ink); font-size: clamp(24px, 2vw, 30px); font-variant-numeric: tabular-nums; line-height: 1.2; }
.stat-card small { display: block; margin-top: 10px; color: var(--muted); }
.stat-card.primary-stat { border-color: #cbdced; background: linear-gradient(145deg, #fff 0%, var(--primary-pale) 100%); }
.stat-card.primary-stat::after { height: 5px; opacity: 1; }
.stat-card.attention-stat { border-color: #ead9b9; background: linear-gradient(145deg, #fff 0%, var(--warning-pale) 100%); }
.stat-card.attention-stat::after { background: var(--warning); }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(280px, .65fr); gap: 14px; margin-top: 14px; }
.dashboard-layout { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(300px, .55fr); gap: 14px; margin-top: 14px; }
.dashboard-side { display: grid; align-content: start; gap: 14px; }
.readiness-list { display: grid; }
.readiness-item { display: grid; grid-template-columns: 12px minmax(0, 1fr) auto; align-items: start; gap: 12px; padding: 14px 20px; border-bottom: 1px solid #eef0f3; }
.readiness-item:last-child { border-bottom: 0; }
.readiness-item strong { display: block; font-size: 13px; }
.readiness-item p { margin: 3px 0 0; color: var(--muted); font-size: 12px; line-height: 1.55; }
.readiness-dot { width: 9px; height: 9px; margin-top: 5px; border-radius: 50%; background: var(--muted-light); box-shadow: 0 0 0 4px #f2f4f7; }
.readiness-item.pass .readiness-dot { background: var(--success); box-shadow: 0 0 0 4px var(--success-pale); }
.readiness-item.warning .readiness-dot { background: var(--warning); box-shadow: 0 0 0 4px var(--warning-pale); }
.readiness-item.fail .readiness-dot,
.readiness-item.blocker .readiness-dot { background: var(--danger); box-shadow: 0 0 0 4px var(--danger-pale); }
.readiness-label { color: var(--muted); font-size: 11px; font-weight: 700; white-space: nowrap; }
.quick-actions { display: grid; gap: 10px; padding: 14px; }
.quick-action { min-height: 70px; display: grid; gap: 3px; border: 1px solid var(--line); border-radius: 10px; padding: 13px 14px; color: var(--ink); background: var(--surface-soft); text-align: left; transition: border-color .16s ease, background .16s ease, transform .16s ease; }
.quick-action:hover { border-color: #9db1c9; background: var(--primary-pale); transform: translateY(-1px); }
.quick-action span { color: var(--muted); font-size: 12px; }
.pending-list { display: grid; gap: 0; padding: 8px 18px 14px; }
.pending-list div { display: flex; justify-content: space-between; gap: 12px; padding: 11px 2px; border-bottom: 1px solid #eef0f3; }
.pending-list div:last-child { border-bottom: 0; }
.pending-list span { color: var(--muted); }
.pending-list strong { font-variant-numeric: tabular-nums; }
.panel { overflow-x: auto; }
.user-table-panel { max-width: 100%; overflow-x: hidden; }
.order-table-panel { max-width: 100%; overflow-x: hidden; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 18px; min-height: 64px; padding: 14px 20px; border-bottom: 1px solid var(--line); }
.panel-head h3 { margin: 0; font-size: 16px; }
.panel-head p { max-width: 760px; }
.category-workspace { display: grid; gap: 14px; }
.category-view-switch { position: sticky; z-index: 8; top: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; padding: 8px; border: 1px solid var(--line); border-radius: var(--radius-md); background: rgba(246, 247, 249, .94); box-shadow: var(--shadow-sm); backdrop-filter: blur(14px); }
.category-view-tab { min-height: 72px; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; column-gap: 12px; border: 1px solid transparent; border-radius: 10px; padding: 12px 15px; color: var(--ink-soft); background: transparent; text-align: left; }
.category-view-tab:hover { border-color: #c7d3df; background: #fff; }
.category-view-tab.active { border-color: #9db1c9; color: var(--primary-dark); background: #fff; box-shadow: var(--shadow-sm); }
.category-view-tab.reward.active { border-color: #d3b98f; color: #795d35; background: linear-gradient(135deg, #fff 0%, #fbf6ee 100%); }
.category-view-tab span, .category-view-tab small { display: block; }
.category-view-tab span { font-size: 14px; font-weight: 750; }
.category-view-tab strong { grid-row: 1 / span 2; grid-column: 2; font-size: 26px; font-variant-numeric: tabular-nums; }
.category-view-tab small { margin-top: 3px; color: var(--muted); font-size: 11px; }
.category-tab-panel.hidden { display: none; }
.category-panel-toolbar { min-height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 13px 18px; border-bottom: 1px solid var(--line); }
.category-panel-toolbar h3, .category-panel-toolbar p { margin: 0; }
.category-panel-toolbar .eyebrow { margin-bottom: 3px; }
.category-panel-toolbar .muted { margin-top: 3px; font-size: 12px; }
.category-table-scroll { max-height: min(62vh, 640px); overflow: auto; overscroll-behavior: contain; }
.category-table-scroll thead { position: sticky; z-index: 2; top: 0; background: var(--paper); box-shadow: 0 1px 0 var(--line); }
.reward-category-panel { border-color: #d9c6ab; }
.panel-body { padding: 20px; }
.panel-body h4 { margin: 24px 0 8px; }
.panel-body p { line-height: 1.7; }
.toolbar { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 14px; }
.toolbar > .notice { flex: 1; }
.toolbar .filters { display: flex; flex: 1; flex-wrap: wrap; gap: 10px; }
.toolbar select, .toolbar input { width: auto; min-width: 190px; background: #fff; }
.product-toolbar { align-items: center; }
.product-toolbar-main { min-width: 0; display: flex; flex: 1; flex-wrap: wrap; align-items: center; gap: 10px; }
.product-type-filter { display: flex; flex-wrap: wrap; gap: 6px; padding: 4px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-soft); }
.product-type-filter button { min-height: 36px; display: inline-flex; align-items: center; gap: 8px; border: 1px solid transparent; border-radius: 7px; padding: 6px 11px; color: var(--muted); background: transparent; font-size: 12px; font-weight: 650; transition: color .16s ease, border-color .16s ease, background .16s ease, box-shadow .16s ease; }
.product-type-filter button:hover { color: var(--primary-dark); background: #fff; }
.product-type-filter button[aria-pressed="true"] { color: var(--primary-dark); border-color: #b8cbe0; background: #fff; box-shadow: var(--shadow-sm); }
.product-type-filter button span { min-width: 22px; padding: 1px 6px; border-radius: 999px; color: var(--muted); background: #eef1f4; font-size: 10px; font-variant-numeric: tabular-nums; text-align: center; }
.product-type-filter button[aria-pressed="true"] span { color: #fff; background: var(--primary); }
.product-search { flex: 1 1 220px; max-width: 340px; }
.product-search input { width: 100%; min-width: 0; }
.compact-toolbar { align-items: center; margin: 10px 0; }
.compact-toolbar p { margin: 0; }
.filter-surface { margin-bottom: 10px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--paper); box-shadow: var(--shadow-sm); }
.filter-heading { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 8px; }
.filter-heading h3 { margin: 0; font-size: 17px; }
.filter-heading .eyebrow { margin-bottom: 2px; }
.period-filters { display: grid; grid-template-columns: repeat(4, minmax(170px, 1fr)); gap: 12px; }
.compact-field { gap: 5px; }
.compact-field > span { color: var(--muted); font-size: 11px; font-weight: 700; }
.compact-field input, .compact-field select { min-width: 0; }
.period-reset { min-height: 38px; padding: 7px 13px; }
.summary-strip { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 1px; margin-bottom: 10px; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--line); box-shadow: var(--shadow-sm); }
.summary-strip > div { min-width: 0; padding: 9px 12px; background: var(--paper); }
.summary-strip span, .summary-strip strong { display: block; }
.summary-strip span { color: var(--muted); font-size: 11px; font-weight: 650; }
.summary-strip strong { margin-top: 2px; overflow: hidden; font-size: 15px; font-variant-numeric: tabular-nums; text-overflow: ellipsis; white-space: nowrap; }
.settlement-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; }
.settlement-filter .period-filters { grid-template-columns: repeat(3, minmax(170px, 240px)); }
.settlement-view-switch { position: sticky; z-index: 20; top: 96px; display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 10px; padding: 10px 12px; border: 1px solid #d7e1ec; border-radius: var(--radius-md); background: rgba(255, 255, 255, .96); box-shadow: var(--shadow-sm); backdrop-filter: blur(10px); }
.settlement-view-switch h3, .settlement-view-switch p { margin: 0; }
.settlement-view-switch h3 { font-size: 16px; }
.settlement-view-switch p:not(.eyebrow) { margin-top: 2px; color: var(--muted); font-size: 11px; }
.settlement-view-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); flex: 0 1 600px; width: 600px; min-width: 0; margin-left: auto; gap: 8px; }
.settlement-view-switch > div:first-child { flex: 1 1 0; min-width: 0; }
.settlement-view-tabs > :nth-last-child(2):nth-child(3n + 1) { grid-column: 2; }
.settlement-view-tabs > :last-child:nth-child(3n + 1) { grid-column: 3; }
.settlement-view-tab { min-height: 46px; border: 1px solid var(--line-strong); border-radius: 9px; padding: 6px 11px; color: var(--ink-soft); background: var(--surface-soft); text-align: left; transition: border-color .16s ease, background .16s ease, box-shadow .16s ease; }
.settlement-view-tab:hover { border-color: #9db1c9; background: var(--primary-pale); }
.settlement-view-tab span, .settlement-view-tab strong { display: block; }
.settlement-view-tab span { font-weight: 700; }
.settlement-view-tab strong { margin-top: 2px; color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.settlement-view-tab[aria-selected="true"] { color: #fff; border-color: var(--primary); background: var(--primary); box-shadow: 0 5px 14px rgba(49, 95, 150, .2); }
.settlement-view-tab[aria-selected="true"] strong { color: rgba(255, 255, 255, .82); }
.settlement-summary { grid-template-columns: repeat(8, minmax(0, 1fr)); }
.settlement-status-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 10px; }
.settlement-status-grid article { padding: 8px 11px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-soft); }
.settlement-status-grid span, .settlement-status-grid strong, .settlement-status-grid small { display: block; }
.settlement-status-grid span { color: var(--muted); font-size: 11px; font-weight: 700; }
.settlement-status-grid strong { margin-top: 3px; font-size: 15px; }
.settlement-status-grid small { margin-top: 3px; color: var(--muted); font-size: 11px; line-height: 1.45; }
.ledger-stack { display: grid; gap: 14px; }
.settlement-panel { max-width: 100%; }
.settlement-panel .panel-head p { margin: 4px 0 0; }
.direction { display: inline-flex; align-items: center; min-height: 26px; padding: 4px 8px; border-radius: 999px; font-size: 11px; font-weight: 700; white-space: nowrap; }
.direction.consume { color: #1e684c; background: var(--success-pale); }
.direction.refund { color: #9b3535; background: var(--danger-pale); }
.split-ledger-panel { overflow: hidden; }
.split-record-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; padding: 16px; background: var(--surface-soft); }
.split-record-card { overflow: hidden; border: 1px solid var(--line); border-left: 4px solid var(--warning); border-radius: var(--radius-md); background: var(--paper); box-shadow: var(--shadow-sm); }
.split-record-card.is-success { border-left-color: var(--success); }
.split-record-head { min-width: 0; display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding: 16px; border-bottom: 1px solid #eef0f3; }
.split-record-head p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.split-order-line, .split-record-status { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.split-order-line strong { font-size: 15px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.split-record-status { flex: 0 0 auto; justify-content: flex-end; }
.split-record-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 10px; margin: 0; padding: 14px 16px; }
.split-record-facts > div { min-width: 0; }
.split-record-facts dt { color: var(--muted); font-size: 11px; font-weight: 650; }
.split-record-facts dd { display: grid; gap: 3px; min-width: 0; margin: 4px 0 0; overflow-wrap: anywhere; font-size: 13px; }
.split-record-facts dd strong, .split-record-facts dd small, .split-record-facts dd code { min-width: 0; overflow-wrap: anywhere; }
.split-record-facts dd small { color: var(--muted); font-size: 11px; }
.split-record-expanded { display: grid; gap: 1px; background: var(--line); }
.split-record-expanded > section { min-width: 0; padding: 12px 14px; background: var(--paper); }
.split-record-details { border-top: 0; }
.split-record-details > summary { min-height: 38px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 7px 14px; color: var(--primary); background: var(--surface-soft); cursor: pointer; font-size: 12px; font-weight: 700; list-style-position: inside; }
.split-record-details > summary small { min-width: 0; color: var(--muted); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.split-record-details[open] > summary { border-bottom: 1px solid var(--line); background: var(--primary-pale); }
.split-record-grid { display: grid; grid-template-columns: minmax(170px, .85fr) minmax(240px, 1.3fr) minmax(190px, 1fr); gap: 1px; background: var(--line); }
.split-record-grid > section { min-width: 0; display: grid; align-content: start; gap: 4px; padding: 9px 14px; background: var(--paper); }
.split-record-grid strong, .split-record-grid code, .split-record-grid small { overflow-wrap: anywhere; }
.split-record-grid code { color: var(--ink-soft); font-size: 12px; }
.split-record-grid small { color: var(--muted); }
.record-label { color: var(--muted); font-size: 11px; font-weight: 700; }
.split-detail { color: var(--ink-soft); font-size: 12px; line-height: 1.65; overflow-wrap: anywhere; }
.split-record-message { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 10px; padding: 8px 14px; color: #704f22; border-top: 1px solid #ead9b9; background: var(--warning-pale); }
.split-record-message strong { font-size: 12px; }
.split-record-message p { min-width: 0; margin: 0; line-height: 1.65; overflow-wrap: anywhere; }
.split-record-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 14px; border-top: 1px solid #eef0f3; background: #fff; }
.split-record-footer > div:first-child { min-width: 0; display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.split-record-footer small { color: var(--muted); overflow-wrap: anywhere; }
.split-record-footer .secondary, .split-record-footer .mini { min-height: 32px; }
.split-record-footer .actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px; }
.split-control-summary { min-width: 0; display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.split-control-summary small { flex-basis: 100%; font-size: 11px; }
.split-empty { padding: 54px 18px; border: 1px dashed var(--line-strong); border-radius: var(--radius-md); background: var(--paper); text-align: center; }

.distributor-hero { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 8px; padding: 11px 15px; border: 1px solid #dbe5ef; border-radius: var(--radius-md); background: linear-gradient(135deg, #fff 0%, #f4f8fc 62%, #eaf1f8 100%); box-shadow: var(--shadow-sm); }
.distributor-hero h3 { margin: 1px 0 3px; font-size: clamp(19px, 1.7vw, 23px); }
.distributor-hero p:not(.eyebrow) { max-width: 720px; margin: 0; color: var(--muted); }
.distributor-hero .primary { flex: 0 0 auto; }
.distributor-summary { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.member-link-guide { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 10px; padding: 10px 14px; border: 1px solid #ead9b9; border-radius: 10px; color: #704f22; background: var(--warning-pale); }
.member-link-guide strong, .member-link-guide p { margin: 0; }
.member-link-guide p { margin-top: 3px; color: #80643e; font-size: 12px; line-height: 1.6; }
.member-link-guide > span { flex: 0 0 auto; padding: 5px 10px; border-radius: 999px; background: rgba(255,255,255,.72); font-size: 11px; font-weight: 700; }
.distributor-card-list { display: grid; gap: 8px; }
.distributor-card { overflow: hidden; border: 1px solid var(--line); border-left: 4px solid var(--success); border-radius: var(--radius-md); background: var(--paper); box-shadow: var(--shadow-sm); }
.distributor-card.needs-link { border-left-color: var(--warning); }
.distributor-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 8px 12px; border-bottom: 1px solid #eef0f3; }
.distributor-title-line { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; }
.distributor-title-line h3 { margin: 0; font-size: 17px; }
.distributor-card-head p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.invite-code { display: grid; grid-template-columns: auto auto; align-items: center; gap: 2px 8px; text-align: right; }
.invite-code span { grid-column: 1 / -1; color: var(--muted); font-size: 10px; font-weight: 700; }
.invite-code strong { font-variant-numeric: tabular-nums; }
.invite-code .mini { grid-row: 2; grid-column: 2; }
.distributor-card-details > summary { min-height: 38px; padding: 7px 12px; color: var(--primary); background: var(--surface-soft); cursor: pointer; font-size: 12px; font-weight: 700; list-style-position: inside; }
.distributor-card-details[open] > summary { border-bottom: 1px solid var(--line); background: var(--primary-pale); }
.distributor-card-body { display: grid; grid-template-columns: minmax(220px, .62fr) minmax(0, 1.75fr); gap: 8px; padding: 9px 14px; }
.member-link-state { min-width: 0; display: grid; align-content: start; gap: 3px; padding: 9px 10px; border: 1px solid #cae5d8; border-radius: 9px; background: var(--success-pale); }
.member-link-state.unlinked { border-color: #ead9b9; background: var(--warning-pale); }
.member-link-state span { color: var(--muted); font-size: 11px; font-weight: 700; }
.member-link-state strong { font-size: 15px; }
.member-link-state small { color: var(--muted); line-height: 1.6; }
.member-link-state .primary-link { width: fit-content; min-height: 38px; margin-top: 4px; color: #fff; border-color: var(--primary); background: var(--primary); }
.distributor-facts { min-width: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; margin: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 10px; background: var(--line); }
.distributor-facts > div { min-width: 0; padding: 8px 10px; background: var(--paper); }
.distributor-facts dt { color: var(--muted); font-size: 11px; font-weight: 700; }
.distributor-facts dd { min-width: 0; display: grid; gap: 2px; margin: 3px 0 0; overflow-wrap: anywhere; }
.distributor-facts dd code { overflow-wrap: anywhere; }
.distributor-facts dd small { display: block; color: var(--muted); line-height: 1.55; }
.distributor-card-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 6px; padding: 7px 14px; border-top: 1px solid #eef0f3; background: var(--surface-soft); }
.distributor-card-actions .secondary { min-height: 34px; padding: 6px 11px; font-size: 12px; }
.withdraw-now-card { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 14px 16px; border: 1px solid #c9d9ea; border-radius: var(--radius-md); background: linear-gradient(135deg, #f8fbff, #eaf1f8); }
.withdraw-now-card span, .withdraw-now-card small { color: var(--muted); }
.withdraw-now-card span { font-size: 11px; font-weight: 700; }
.withdraw-now-card h4 { margin: 2px 0; font-size: 18px; }
.withdraw-now-card p { margin: 0 0 3px; color: var(--ink-soft); font-size: 12px; }
.withdraw-now-card small { display: block; line-height: 1.5; }
.withdraw-now-card .primary { flex: 0 0 auto; min-width: 120px; min-height: 44px; }
.withdraw-now-card .primary:disabled { cursor: not-allowed; opacity: .52; }
.ledger-footnote { margin: 12px 4px 0; color: var(--muted); font-size: 12px; line-height: 1.7; }

table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
th { padding: 12px 14px; color: #475467; border-bottom: 1px solid var(--line); background: var(--surface-soft); text-align: left; font-size: 12px; font-weight: 700; white-space: nowrap; }
td { padding: 14px; border-bottom: 1px solid #eef0f3; vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: #fbfcfd; }
td strong, td code, .stat-card strong { font-variant-numeric: tabular-nums; }
.product-cell { display: flex; align-items: center; gap: 12px; min-width: 220px; }
.product-cell img { width: 48px; height: 48px; flex: 0 0 auto; border: 1px solid var(--line); border-radius: var(--radius-sm); object-fit: cover; background: var(--surface-soft); }
.product-cell strong, .product-cell small { display: block; }
.product-cell small { max-width: 230px; margin-top: 3px; color: var(--muted); }
.order-product-item + .order-product-item { margin-top: 10px; }
.order-product-item strong, .order-product-item small { display: block; }
.order-product-item small { margin-top: 3px; color: var(--muted); }
.points-note { color: var(--warning); line-height: 1.7; }
.badge { display: inline-flex; align-items: center; min-height: 24px; padding: 3px 8px; border: 1px solid transparent; border-radius: 999px; color: #475467; background: #eef1f4; font-size: 11px; font-weight: 700; white-space: nowrap; }
.badge.green { color: #1e684c; border-color: #cae7d9; background: var(--success-pale); }
.badge.rose { color: #9b3535; border-color: #f2d0d0; background: var(--danger-pale); }
.badge.gold { color: #7b5524; border-color: #ead9b9; background: var(--warning-pale); }
.actions { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.mini { min-height: 34px; border: 1px solid var(--line-strong); border-radius: 7px; padding: 6px 10px; color: var(--ink-soft); background: #fff; font-size: 12px; font-weight: 550; white-space: nowrap; transition: border-color .16s ease, color .16s ease, background .16s ease; }
.mini:hover { color: var(--primary); border-color: #9db1c9; background: var(--primary-pale); }
.mini.danger { color: #9b3535; border-color: #e8bcbc; background: #fffafa; }
.mini.danger:hover { color: #7f1d1d; border-color: #d98f8f; background: var(--danger-pale); }
.mini:disabled { cursor: wait; opacity: .58; }
.empty { padding: 64px 24px; color: var(--muted); text-align: center; }
.empty::before { display: block; width: 34px; height: 34px; margin: 0 auto 12px; border: 1px solid var(--line-strong); border-radius: 50%; content: ""; background: radial-gradient(circle, var(--muted-light) 0 2px, transparent 3px); opacity: .72; }
.progress { height: 8px; overflow: hidden; border-radius: 99px; background: #edf0f3; }
.progress > span { display: block; height: 100%; border-radius: inherit; background: var(--primary); }
.notice { padding: 13px 15px; border: 1px solid #e6d8bc; border-radius: var(--radius-sm); color: #755124; background: var(--warning-pale); font-size: 13px; line-height: 1.65; }
.settings-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; padding: 22px; }
.settings-form .wide { grid-column: 1 / -1; }
.settings-form > button { justify-self: start; min-width: 150px; }

.home-editor-hero { display: flex; align-items: center; justify-content: space-between; gap: 22px; margin-bottom: 12px; padding: 18px 20px; border: 1px solid #dbe5ef; border-radius: var(--radius-lg); background: linear-gradient(135deg, #fff 0%, #f5f8fc 52%, #eaf1f8 100%); box-shadow: var(--shadow-sm); }
.home-editor-hero h3 { margin: 2px 0 7px; font-size: clamp(21px, 2.2vw, 29px); text-wrap: balance; }
.home-editor-hero > div > p:last-child { max-width: 630px; margin: 0; color: var(--muted); }
.home-editor-summary { min-width: 410px; display: grid; grid-template-columns: repeat(4, minmax(88px, 1fr)); overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius-md); background: rgba(255, 255, 255, .88); }
.home-editor-summary > div { min-width: 0; padding: 10px 12px; border-right: 1px solid var(--line); }
.home-editor-summary > div:last-child { border-right: 0; }
.home-editor-summary span, .home-editor-summary strong { display: block; }
.home-editor-summary span { color: var(--muted); font-size: 10px; font-weight: 650; white-space: nowrap; }
.home-editor-summary strong { margin-top: 3px; font-size: 16px; font-variant-numeric: tabular-nums; }
.home-sync-summary strong { color: var(--success); }
.home-editor-layout { display: grid; grid-template-columns: minmax(0, 1fr) 370px; align-items: start; gap: 20px; }
.home-config-panel { min-width: 0; overflow: visible; }
.home-config-panel .panel-head { position: sticky; z-index: 22; top: 88px; min-height: 72px; padding: 12px 16px; background: rgba(255, 255, 255, .97); backdrop-filter: blur(10px); }
.home-config-panel .panel-head p { margin: 5px 0 0; }
.home-workspace-head .eyebrow { margin-bottom: 3px; font-size: 9px; }
.home-workspace-actions { display: flex; align-items: center; gap: 8px; }
.home-workspace-actions .secondary, .home-workspace-actions .primary { min-height: 38px; padding: 8px 13px; white-space: nowrap; }
.home-section-nav { position: sticky; z-index: 21; top: 160px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; padding: 0; border-bottom: 1px solid var(--line); background: rgba(248, 250, 252, .97); backdrop-filter: blur(10px); }
.home-section-nav a { position: relative; min-width: 0; display: grid; grid-template-columns: 26px minmax(0, 1fr); grid-template-rows: auto auto; column-gap: 8px; padding: 9px 10px; color: var(--ink-soft); text-decoration: none; transition: color .16s ease, background .16s ease; }
.home-section-nav a + a { border-left: 1px solid var(--line); }
.home-section-nav a:hover, .home-section-nav a:focus-visible { color: var(--primary-dark); background: var(--primary-pale); }
.home-section-nav a > span { width: 26px; height: 26px; display: grid; grid-row: 1 / 3; place-items: center; border-radius: 8px; color: var(--primary-dark); background: var(--primary-pale); font-size: 9px; font-weight: 750; }
.home-section-nav strong, .home-section-nav small { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.home-section-nav strong { align-self: end; font-size: 12px; }
.home-section-nav small { color: var(--muted); font-size: 10px; font-weight: 500; }
.home-config-form { display: grid; gap: 16px; padding: 14px; }
.home-guidance { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px; padding: 10px 12px; border: 1px solid #d7e3ee; border-radius: var(--radius-md); color: var(--ink-soft); background: #f3f7fb; font-size: 12px; line-height: 1.55; }
.home-guidance strong { color: var(--primary-dark); white-space: nowrap; }
.home-editor-section { display: grid; gap: 12px; padding: 13px; scroll-margin-top: 220px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface-soft); }
.home-editor-section + .home-editor-section { padding-top: 13px; }
.home-editor-section-head { display: flex; align-items: center; gap: 12px; }
.home-editor-section-head > span { width: 32px; height: 32px; display: grid; flex: 0 0 auto; place-items: center; border-radius: 9px; color: #fff; background: var(--primary); font-size: 10px; font-weight: 750; box-shadow: var(--shadow-sm); }
.home-editor-section-head h4 { margin: 0; font-size: 15px; }
.home-editor-section-head p { margin: 2px 0 0; color: var(--muted); font-size: 11px; }
.home-config-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: 10px; }
.home-config-card:not(.is-collapsed) { grid-column: 1 / -1; }
.home-config-card, .home-list-section, .home-list-item { border: 1px solid var(--line); border-radius: var(--radius-md); background: #fff; }
.home-config-card { overflow: hidden; }
.home-card-title, .home-list-head, .home-list-item-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 52px; padding: 9px 12px; border-bottom: 1px solid var(--line); background: #fff; }
.home-card-title h4, .home-list-head h4 { margin: 0; font-size: 14px; }
.home-list-head p { margin: 4px 0 0; }
.home-card-heading { min-width: 0; }
.home-card-heading h4, .home-card-heading strong { display: block; margin: 0; color: var(--ink); font-size: 13px; }
.home-card-summary { max-width: 28ch; margin: 2px 0 0; overflow: hidden; color: var(--muted); font-size: 10px; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.home-card-controls, .home-item-actions { display: flex; flex: 0 0 auto; align-items: center; gap: 7px; }
.home-collapse-toggle { min-height: 32px; display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line-strong); border-radius: 7px; padding: 5px 8px; color: var(--ink-soft); background: #fff; font-size: 11px; font-weight: 650; }
.home-collapse-toggle i { width: 7px; height: 7px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg) translateY(-2px); transition: transform .16s ease; }
.home-collapse-toggle[aria-expanded="true"] i { transform: rotate(225deg) translate(-1px, -1px); }
.home-card-fields { display: grid; gap: 0; }
.home-config-card.is-collapsed .home-card-fields, .home-list-item.is-collapsed .home-card-fields { display: none; }
.home-config-card.is-collapsed .home-card-title, .home-list-item.is-collapsed .home-list-item-head { border-bottom: 0; }
.home-field-group { min-width: 0; padding: 12px; }
.home-field-group + .home-field-group { border-top: 1px solid var(--line); }
.home-field-group-title { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.home-field-group-title strong { color: var(--ink); font-size: 12px; }
.home-field-group-title span { color: var(--muted); font-size: 11px; text-align: right; }
.home-field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.home-field-grid.single { grid-template-columns: minmax(0, 1fr); }
.home-inline-toggle { display: inline-flex; align-items: center; justify-content: start; gap: 7px; min-height: 32px; color: var(--primary-dark); white-space: nowrap; }
.home-inline-toggle input { position: relative; width: 36px; height: 20px; min-height: 20px; appearance: none; border: 0; border-radius: 99px; padding: 0; background: #cfd6de; box-shadow: none; cursor: pointer; transition: background .16s ease; }
.home-inline-toggle input::after { position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; content: ""; background: #fff; box-shadow: 0 1px 3px rgba(16, 24, 40, .25); transition: transform .16s ease; }
.home-inline-toggle input:checked { background: var(--primary); }
.home-inline-toggle input:checked::after { transform: translateX(16px); }
.home-inline-toggle input:focus-visible { outline: 3px solid rgba(49, 95, 150, .28); outline-offset: 2px; }
.field-help { color: var(--muted); font-size: 11px; font-weight: 450; line-height: 1.5; }
.home-image-upload input { min-height: auto; padding: 8px; }
.home-media-layout { display: grid; grid-template-columns: minmax(0, 1fr) 164px; align-items: stretch; gap: 12px; }
.home-media-fields { display: grid; align-content: start; gap: 10px; }
.home-image-preview { min-height: 108px; border-radius: 9px; }
.home-image-preview img { width: 100%; max-height: 130px; object-fit: contain; border-radius: 7px; }
.home-list-section { padding-bottom: 10px; overflow: hidden; box-shadow: var(--shadow-sm); }
.home-item-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: 10px; padding: 10px; }
.home-list-item { overflow: hidden; }
.home-list-item:not(.is-collapsed) { grid-column: 1 / -1; }
.home-tip { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px; padding: 13px 15px; border-radius: var(--radius-sm); color: #755124; background: var(--warning-pale); font-size: 12px; line-height: 1.65; }
.home-tip strong { white-space: nowrap; }
.home-save-button { display: inline-flex; align-items: center; justify-content: center; gap: 12px; justify-self: start; min-width: 210px; }
.home-save-button small { color: rgba(255, 255, 255, .78); font-size: 11px; font-weight: 500; }

.home-preview-sidebar { position: sticky; top: 102px; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: #fff; box-shadow: var(--shadow-sm); }
.home-preview-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.home-preview-heading h3 { margin: 0; font-size: 15px; }
.home-preview-heading .eyebrow { margin-bottom: 1px; font-size: 9px; }
.home-preview-badge { padding: 4px 8px; border-radius: 999px; color: var(--success); background: var(--success-pale); font-size: 10px; font-weight: 700; }
.home-phone-shell { width: min(326px, 100%); margin: 0 auto; padding: 9px; border: 1px solid #cbd2dc; border-radius: 32px; background: #202a38; box-shadow: 0 18px 44px rgba(16, 24, 40, .16); }
.home-phone-speaker { width: 68px; height: 4px; margin: 2px auto 8px; border-radius: 99px; background: #657182; }
.home-phone-screen { height: 625px; display: grid; grid-template-rows: minmax(0, 1fr) 54px; overflow: hidden; border-radius: 23px; background: #fffdf9; }
.preview-page-scroll { min-height: 0; overflow-y: auto; padding: 10px 11px 20px; scrollbar-width: none; }
.preview-page-scroll::-webkit-scrollbar { display: none; }
.preview-status { min-height: 28px; display: flex; align-items: center; justify-content: space-between; padding: 0 3px 5px; color: #222; font-size: 9px; font-weight: 750; }
.preview-capsule { width: 46px; height: 20px; display: flex; align-items: center; justify-content: center; gap: 2px; border: 1px solid #ebe5df; border-radius: 99px; background: rgba(255,255,255,.92); }
.preview-capsule i { width: 2px; height: 2px; border-radius: 50%; background: #2e2b28; }
.preview-capsule b { width: 10px; height: 10px; margin-left: 5px; border: 2px solid #2e2b28; border-radius: 50%; }
.preview-brand { height: 39px; display: flex; align-items: center; justify-content: center; }
.preview-brand img, .preview-brand-fallback { width: 72px; height: 30px; display: grid; place-items: center; object-fit: contain; color: #fff; background: transparent; font: 700 15px serif; }
.preview-brand-fallback { width: 44px; border-radius: 10px; background: var(--primary); }
.preview-search { display: grid; grid-template-columns: 14px minmax(0, 1fr) auto; align-items: center; gap: 6px; min-height: 34px; border: 1px solid #d8cbbb; border-radius: 19px; padding: 3px 4px 3px 10px; color: #8b8177; background: #fff; }
.preview-search > span { width: 9px; height: 9px; border: 1px solid currentColor; border-radius: 50%; }
.preview-search > span::after { display: block; width: 4px; height: 1px; margin: 7px 0 0 7px; content: ""; background: currentColor; transform: rotate(45deg); }
.preview-search em { overflow: hidden; font-size: 8px; font-style: normal; text-overflow: ellipsis; white-space: nowrap; }
.preview-search b { min-width: 43px; padding: 6px 8px; border-radius: 16px; color: #5f5347; background: #eee5d8; font-size: 8px; text-align: center; }
.preview-hero { position: relative; aspect-ratio: 702 / 342; margin-top: 9px; overflow: hidden; border-radius: 7px; background: #f0e8de; }
.preview-hero > img, .preview-image-placeholder { width: 100%; height: 100%; object-fit: cover; background: linear-gradient(135deg, #d6b7a2, #8fa4b9); }
.preview-entry-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; margin: 11px 0 8px; }
.preview-entry-grid > div { display: grid; justify-items: center; gap: 4px; min-width: 0; }
.preview-entry-grid span { width: 38px; height: 38px; display: grid; place-items: center; overflow: hidden; border: 1px solid #e2d7ca; border-radius: 50%; color: var(--primary-dark); background: #f8f1e8; font-size: 8px; font-weight: 700; box-shadow: 0 2px 6px rgba(101, 83, 63, .08); }
.preview-entry-grid img { width: 100%; height: 100%; object-fit: cover; }
.preview-entry-grid b { max-width: 100%; overflow: hidden; color: #49443e; font-size: 7px; text-overflow: ellipsis; white-space: nowrap; }
.preview-empty { grid-column: 1 / -1; margin: 6px; color: var(--muted); font-size: 8px; text-align: center; }
.preview-activity { margin-top: 10px; }
.preview-activity img, .preview-activity > span { width: 100%; height: 88px; display: block; border-radius: 7px; object-fit: cover; }
.preview-activity small { display: block; margin-top: 4px; color: #897e73; font-size: 7px; text-align: center; }
.preview-section { margin-top: 14px; }
.preview-section > div:first-child { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.preview-section > div:first-child strong { font-size: 11px; }
.preview-section span { color: #8b8177; font-size: 7px; }
.preview-products { display: grid; grid-template-columns: repeat(2, 1fr); gap: 7px; }
.preview-recommend-row { display: flex; gap: 7px; overflow: hidden; }
.preview-product-card { min-width: 0; overflow: hidden; border: 1px solid #e8dfd5; border-radius: 7px; background: #fffdf9; }
.preview-product-card.is-compact { flex: 0 0 44%; }
.preview-product-card > img { width: 100%; height: 90px; display: block; object-fit: cover; background: #f3eee8; }
.preview-product-card > div { display: grid; padding: 7px; }
.preview-product-card strong, .preview-product-card span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.preview-product-card strong { color: #332f2b; font-size: 8px; }
.preview-product-card span { margin: 2px 0 4px; color: #9e968e; font-size: 6px; }
.preview-product-card b { color: #806b54; font-size: 9px; }
.preview-points { margin-top: 17px; }
.preview-points-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; color: #302d29; }
.preview-points-heading strong, .preview-points-heading b { display: block; }
.preview-points-heading strong { font-size: 11px; }
.preview-points-heading b { color: #9e968d; font-size: 7px; font-weight: 400; }
.preview-points > img, .preview-points > span { width: 100%; height: 53px; display: block; overflow: hidden; border-radius: 6px; object-fit: cover; }
.preview-tabbar { display: grid; grid-template-columns: repeat(5, 1fr); border-top: 1px solid #eee8e1; padding: 5px 3px 4px; background: rgba(255,255,255,.97); }
.preview-tab { display: grid; justify-items: center; gap: 2px; color: #5f5851; }
.preview-tab img { width: 17px; height: 17px; object-fit: contain; }
.preview-tab b { font-size: 6px; font-weight: 500; }
.preview-tab.is-active { color: #a77645; }
.home-preview-note { margin: 13px 4px 0; color: var(--muted); font-size: 11px; line-height: 1.6; text-align: center; }

code { color: #475467; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 11px; overflow-wrap: anywhere; white-space: pre-wrap; }
dialog { width: min(940px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); border: 0; border-radius: var(--radius-lg); padding: 0; color: var(--ink); background: #fff; box-shadow: 0 28px 90px rgba(16, 24, 40, .28); }
dialog::backdrop { background: rgba(17, 24, 39, .5); backdrop-filter: blur(2px); }
dialog form { display: flex; flex-direction: column; max-height: calc(100dvh - 32px); }
dialog header, dialog footer { display: flex; flex: 0 0 auto; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--line); background: #fff; }
dialog footer { justify-content: flex-end; gap: 10px; border: 0; border-top: 1px solid var(--line); }
dialog h3 { margin: 0; font-size: 18px; }
#modal-body { display: grid; flex: 1; min-height: 0; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: max-content; align-content: start; gap: 18px; max-height: 68vh; overflow: auto; padding: 22px; background: #fbfcfd; }
#modal-body > label { align-self: start; align-content: start; }
#modal-body .wide { grid-column: 1 / -1; }
.product-form-section { overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius-md); background: #fff; }
.product-section-heading { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); background: var(--surface-soft); }
.product-section-heading > span { width: 30px; height: 30px; display: grid; flex: 0 0 auto; place-items: center; border-radius: 9px; color: var(--primary-dark); background: var(--primary-pale); font-size: 11px; font-weight: 750; }
.product-section-heading h4 { margin: 0; font-size: 14px; }
.product-section-heading p { margin: 2px 0 0; color: var(--muted); font-size: 12px; }
.product-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; padding: 16px; }
.product-form-grid .wide { grid-column: 1 / -1; }
.product-form-grid.compact-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.reward-category-field { align-self: start; }
.reward-category-field > label, .reward-category-field > small { display: block; }
.quick-category-trigger { width: 100%; min-height: 38px; margin-top: 8px; border-style: dashed; }
.quick-category-form { display: grid; gap: 11px; margin-top: 10px; padding: 13px; border: 1px solid #d7c6ad; border-radius: 10px; background: #fbf6ee; }
.quick-category-form label { display: grid; gap: 5px; font-size: 12px; }
.quick-category-actions { display: flex; gap: 8px; }
.quick-category-actions button { min-height: 38px; flex: 1; }
.quick-category-status { min-height: 18px; color: var(--danger); font-size: 12px; }
.sku-editor { min-height: 122px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; }
.product-media-row { display: grid; grid-template-columns: minmax(0, 1fr) 180px; align-items: stretch; gap: 16px; }
.product-upload-field { position: relative; display: grid; align-content: start; gap: 8px; min-width: 0; }
.field-label { color: var(--ink-soft); font-size: 13px; font-weight: 600; }
.accessible-file-input { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
.product-file-picker { min-height: 84px; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 5px; border: 1px dashed #9db1c9; border-radius: var(--radius-sm); padding: 12px; color: var(--primary-dark); background: var(--primary-pale); text-align: center; transition: border-color .16s ease, background .16s ease, box-shadow .16s ease; }
.product-file-picker:hover { border-color: var(--primary); background: #dfeaf5; }
.product-file-picker strong { font-size: 13px; }
.product-file-picker span { width: 100%; overflow: hidden; color: var(--muted); font-size: 11px; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.accessible-file-input:focus-visible + .product-file-picker { outline: 3px solid rgba(49, 95, 150, .28); outline-offset: 2px; }
.product-image-preview { min-height: 144px; padding: 10px; }
.product-image-preview img { width: 100%; height: 122px; object-fit: contain; }
.product-description-field { display: grid; gap: 8px; min-width: 0; }
.product-description-field > label { color: var(--ink-soft); font-size: 13px; font-weight: 600; }
.product-description-field textarea { min-height: 180px; font-family: inherit; line-height: 1.65; }
.product-description-tools { display: grid; grid-template-columns: minmax(180px, 240px) minmax(0, 1fr); align-items: center; gap: 12px; }
.product-description-picker { min-height: 56px; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 3px; border: 1px dashed #9db1c9; border-radius: var(--radius-sm); padding: 8px 12px; color: var(--primary-dark); background: var(--primary-pale); text-align: center; cursor: pointer; transition: border-color .16s ease, background .16s ease, box-shadow .16s ease; }
.product-description-picker:hover { border-color: var(--primary); background: #dfeaf5; }
.product-description-picker strong { font-size: 13px; }
.product-description-picker span { color: var(--muted); font-size: 11px; font-weight: 500; }
.accessible-file-input:focus-visible + .product-description-picker { outline: 3px solid rgba(49, 95, 150, .28); outline-offset: 2px; }
.accessible-file-input:disabled + .product-description-picker { cursor: wait; opacity: .55; }
.product-upload-status { color: var(--muted); font-size: 12px; line-height: 1.55; overflow-wrap: anywhere; }
.form-section { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; margin-top: 4px; padding: 12px 14px; border-left: 3px solid var(--primary); border-radius: 6px; color: var(--ink); background: var(--primary-pale); }
.form-section small { color: var(--muted); }
.modal-error { margin: 0 20px 12px; padding: 12px 14px; border: 1px solid #e5a9a9; border-radius: var(--radius-sm); color: #8f3030; background: var(--danger-pale); font-size: 13px; line-height: 1.55; }
.field-error { color: var(--danger); font-size: 12px; font-weight: 600; line-height: 1.5; }
input[aria-invalid="true"], select[aria-invalid="true"], textarea[aria-invalid="true"] { border-color: var(--danger); box-shadow: 0 0 0 3px rgba(181, 71, 71, .12); }
button:disabled { cursor: not-allowed; opacity: .5; }
.image-preview { min-height: 170px; display: grid; place-items: center; padding: 14px; border: 1px dashed var(--line-strong); border-radius: var(--radius-sm); background: #fff; }
.image-preview img { max-width: 100%; max-height: 260px; object-fit: contain; border-radius: var(--radius-sm); }
.icon-button { width: 42px; height: 42px; display: grid; place-items: center; border: 0; border-radius: var(--radius-sm); color: var(--muted); background: transparent; }
.icon-button:hover { color: var(--ink); background: var(--surface-soft); }
.toast { position: fixed; z-index: 1100; right: 24px; bottom: 24px; max-width: min(380px, calc(100vw - 32px)); transform: translateY(16px); opacity: 0; pointer-events: none; padding: 12px 16px; border-radius: var(--radius-sm); color: #fff; background: #253142; box-shadow: var(--shadow-md); transition: transform .2s ease, opacity .2s ease; }
.toast.show { transform: none; opacity: 1; }

.skeleton-panel { min-height: 280px; padding: 22px; }
.skeleton-line, .skeleton-block { overflow: hidden; border-radius: 6px; background: #edf0f3; }
.skeleton-line { width: 38%; height: 16px; }
.skeleton-block { height: 54px; margin-top: 16px; }
.page-error { padding: 38px 22px; text-align: center; }
.page-error h3 { margin: 0; }
.page-error p { margin: 8px auto 18px; color: var(--muted); }

@media (min-width: 901px) {
  .order-table { width: 100%; min-width: 0; table-layout: fixed; font-size: 12px; }
  .order-table th, .order-table td { min-width: 0; padding: 12px 7px; overflow-wrap: anywhere; }
  .order-table th { line-height: 1.35; white-space: normal; }
  .order-table th:first-child, .order-table td:first-child { width: 16%; }
  .order-table th:nth-child(2), .order-table td:nth-child(2) { width: 15%; }
  .order-table th:nth-child(3), .order-table td:nth-child(3) { width: 18%; }
  .order-table th:nth-child(4), .order-table td:nth-child(4) { width: 8%; }
  .order-table th:nth-child(5), .order-table td:nth-child(5) { width: 7%; }
  .order-table th:nth-child(6), .order-table td:nth-child(6) { width: 9%; }
  .order-table th:nth-child(7), .order-table td:nth-child(7) { width: 14%; }
  .order-table th:last-child, .order-table td:last-child { width: 13%; }
  .user-table { width: 100%; min-width: 0; table-layout: fixed; font-size: 12px; }
  .user-table th, .user-table td { min-width: 0; padding: 12px 7px; overflow-wrap: anywhere; }
  .user-table th { line-height: 1.35; text-align: center; white-space: normal; }
  .user-table th:first-child, .user-table td:first-child { width: 12%; text-align: left; }
  .user-table th:nth-child(2), .user-table td:nth-child(2) { width: 9%; }
  .user-table th:nth-child(3), .user-table td:nth-child(3) { width: 10%; }
  .user-table th:nth-child(4), .user-table td:nth-child(4) { width: 7%; }
  .user-table th:nth-child(5), .user-table td:nth-child(5) { width: 9%; }
  .user-table th:nth-child(6), .user-table td:nth-child(6) { width: 7%; }
  .user-table th:nth-child(7), .user-table td:nth-child(7) { width: 9%; }
  .user-table th:nth-child(8), .user-table td:nth-child(8) { width: 11%; }
  .user-table th:nth-child(9), .user-table td:nth-child(9) { width: 7%; }
  .user-table th:last-child, .user-table td:last-child { width: 19%; }
  .user-table td:not(:first-child):not(:last-child) { text-align: center; }
  .user-table td:nth-child(3) code { display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .user-table td:nth-child(3) br { display: none; }
  .user-table .copy-openid { display: block; width: 100%; min-height: 30px; margin-top: 6px; padding-inline: 4px; font-size: 11px; }
  .user-table .user-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: stretch; gap: 6px; }
  .user-table .user-actions .mini { width: 100%; min-width: 0; padding-inline: 4px; font-size: 11px; }
  .settlement-table { min-width: 1120px; }
  .bank-settlement-table { min-width: 850px; }
}

@media (max-width: 1180px) {
  .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid-2 { grid-template-columns: 1fr; }
  .dashboard-layout { grid-template-columns: 1fr; }
  .dashboard-side { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .period-filters { grid-template-columns: repeat(2, minmax(170px, 1fr)); }
  .settlement-summary { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .distributor-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .home-editor-hero { align-items: flex-start; flex-direction: column; }
  .home-editor-summary { width: 100%; min-width: 0; }
  .home-editor-layout { grid-template-columns: 1fr; }
  .home-preview-sidebar { position: static; }
  .home-phone-shell { width: min(340px, 100%); }
}

@media (max-width: 900px) {
  .app-shell { display: block; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: min(var(--sidebar-width), calc(100vw - 56px)); height: 100dvh; transform: translateX(-102%); box-shadow: var(--shadow-md); transition: transform .2s ease; }
  .app-shell.nav-open .sidebar { transform: translateX(0); }
  .sidebar-backdrop { position: fixed; z-index: 35; inset: 0; display: block; visibility: hidden; border: 0; opacity: 0; background: rgba(17, 24, 39, .46); transition: opacity .2s ease, visibility .2s ease; }
  .app-shell.nav-open .sidebar-backdrop { visibility: visible; opacity: 1; }
  .menu-toggle { display: grid; }
  .topbar { min-height: 80px; padding: 14px 22px; }
  .topbar .eyebrow { display: none; }
  .content { padding: 22px 22px 44px; }
  .home-config-panel .panel-head { top: 80px; }
  .home-section-nav { top: 152px; }
  .home-editor-hero { padding: 22px; }
  .table-panel { overflow: visible; border: 0; background: transparent; box-shadow: none; }
  .responsive-table { display: block; min-width: 0; background: transparent; }
  .responsive-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
  .responsive-table tbody { display: grid; gap: 12px; }
  .responsive-table tbody tr { display: block; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius-md); background: #fff; box-shadow: var(--shadow-sm); }
  .responsive-table td { display: grid; grid-template-columns: minmax(120px, 24%) minmax(0, 1fr); align-items: start; gap: 12px; min-width: 0; padding: 11px 14px; border-bottom: 1px solid #eef0f3; overflow-wrap: anywhere; }
  .responsive-table td::before { content: attr(data-label); color: var(--muted); font-size: 12px; font-weight: 650; line-height: 1.7; }
  .responsive-table td:last-child { border-bottom: 0; }
  .responsive-table td[colspan] { display: block; padding: 44px 16px; }
  .responsive-table td[colspan]::before { display: none; }
  .responsive-table .product-cell { min-width: 0; align-items: flex-start; }
  .responsive-table .product-cell > div { min-width: 0; }
  .responsive-table .actions { min-width: 0; }
  .responsive-table .mini { min-height: 44px; }
  .home-config-panel .panel-head .desktop-home-save { display: none; }
  .home-workspace-actions { width: auto; }
  .home-collapse-toggle { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 44px; }
  .home-config-card.is-collapsed .home-card-fields, .home-list-item.is-collapsed .home-card-fields { display: none; }
  .home-config-card.is-collapsed .home-card-title, .home-list-item.is-collapsed .home-list-item-head { border-bottom: 0; }
  .home-item-actions .mini { min-height: 44px; }
  .home-config-form { padding-bottom: 104px; }
  .home-save-button { position: fixed; z-index: 24; right: auto; bottom: max(12px, env(safe-area-inset-bottom)); left: 50%; width: min(520px, calc(100vw - 24px)); min-height: 54px; justify-self: stretch; transform: translateX(-50%); border-color: rgba(255, 255, 255, .45); box-shadow: 0 12px 30px rgba(36, 75, 121, .28); }
  .home-preview-sidebar { display: none; }
  .overview-hero, .settlement-hero { align-items: flex-start; flex-direction: column; padding: 22px; }
  .settlement-view-switch { top: 94px; align-items: stretch; flex-direction: column; }
  .settlement-view-tabs { flex: none; width: 100%; }
  .overview-health { width: 100%; text-align: left; }
  .summary-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .settlement-status-grid { grid-template-columns: 1fr; }
  .settlement-panel { overflow: visible; border: 0; background: transparent; box-shadow: none; }
  .settlement-panel .panel-head { margin-bottom: 10px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--paper); }
  .split-ledger-panel { overflow: hidden; border: 1px solid var(--line); background: var(--paper); box-shadow: var(--shadow-sm); }
  .split-ledger-panel .panel-head { margin-bottom: 0; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; }
  .split-record-list { grid-template-columns: 1fr; }
  .split-record-grid { grid-template-columns: 1fr; }
  .distributor-card-body { grid-template-columns: 1fr; }
}

@media (max-width: 680px) {
  .category-view-switch { position: static; grid-template-columns: 1fr; }
  .category-panel-toolbar { align-items: stretch; flex-direction: column; }
  .category-panel-toolbar .primary { width: 100%; }
  .category-table-scroll { max-height: 62vh; }
  body { font-size: 14px; }
  .login-shell { padding: 16px; }
  .login-shell::before { inset: 0; height: 30%; }
  .login-card { padding: 26px 22px; }
  .topbar { gap: 12px; padding: 12px 14px; }
  .topbar h2 { font-size: 19px; }
  #page-subtitle { display: none; }
  .operator span { display: none; }
  .operator b { width: 36px; height: 36px; }
  .content { padding: 16px 12px 36px; }
  .stats { grid-template-columns: repeat(auto-fit, minmax(min(155px, 100%), 1fr)); gap: 10px; }
  .stat-card { min-height: 126px; padding: 16px; }
  .stat-card strong { font-size: 23px; }
  .toolbar { align-items: stretch; flex-direction: column; }
  .toolbar > .primary { width: 100%; }
  .toolbar .filters { width: 100%; }
  .product-toolbar-main, .product-search { width: 100%; max-width: none; }
  .product-type-filter { width: 100%; }
  .product-type-filter button { min-height: 44px; flex: 1 1 120px; justify-content: center; }
  .toolbar > .actions { width: 100%; justify-content: space-between; }
  .toolbar select, .toolbar input { width: 100%; min-width: 0; }
  .filter-surface { padding: 16px; }
  .filter-heading { align-items: flex-start; flex-direction: column; }
  .period-reset { width: 100%; min-height: 44px; }
  .period-filters, .settlement-filter .period-filters { grid-template-columns: 1fr; }
  .summary-strip, .settlement-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .summary-strip > div { padding: 13px 14px; }
  .summary-strip > div:first-child { grid-column: 1 / -1; }
  .dashboard-side { grid-template-columns: 1fr; }
  .readiness-item { grid-template-columns: 12px minmax(0, 1fr); padding: 13px 16px; }
  .readiness-label { grid-column: 2; }
  .settlement-actions { width: 100%; }
  .settlement-actions button { flex: 1 1 180px; min-height: 44px; }
  .settlement-view-switch { position: static; padding: 14px; }
  .settlement-view-tabs { grid-template-columns: 1fr; }
  .settlement-view-tabs > :nth-last-child(2):nth-child(3n + 1), .settlement-view-tabs > :last-child:nth-child(3n + 1) { grid-column: auto; }
  .split-record-list { gap: 10px; padding: 10px; }
  .split-record-head, .split-record-footer { align-items: stretch; flex-direction: column; padding: 14px; }
  .split-record-status { justify-content: flex-start; }
  .split-record-details > summary { min-height: 44px; align-items: flex-start; flex-direction: column; gap: 2px; }
  .split-record-grid > section { padding: 13px 14px; }
  .split-record-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 14px; }
  .split-record-message { grid-template-columns: 1fr; gap: 4px; padding: 12px 14px; }
  .split-record-footer .actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; }
  .split-record-footer .actions > * { width: 100%; min-height: 44px; }
  .distributor-hero { align-items: stretch; flex-direction: column; padding: 20px 16px; }
  .distributor-hero .primary { width: 100%; min-height: 46px; }
  .distributor-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .member-link-guide { align-items: flex-start; flex-direction: column; }
  .distributor-card-head { align-items: stretch; flex-direction: column; padding: 15px 16px; }
  .invite-code { grid-template-columns: minmax(0, 1fr) auto; text-align: left; }
  .invite-code span { grid-column: 1; }
  .invite-code strong { grid-column: 1; }
  .invite-code .mini { grid-row: 1 / 3; grid-column: 2; min-height: 44px; }
  .distributor-card-body { padding: 14px 16px; }
  .distributor-facts { grid-template-columns: 1fr; }
  .member-link-state .primary-link { width: 100%; min-height: 44px; }
  .distributor-card-actions { display: grid; grid-template-columns: 1fr; padding: 12px 16px; }
  .distributor-card-actions .secondary { width: 100%; min-height: 44px; }
  .distributor-card-details > summary { min-height: 44px; padding: 11px 16px; }
  .withdraw-now-card { align-items: stretch; flex-direction: column; }
  .withdraw-now-card .primary { width: 100%; }
  .panel { max-width: 100%; }
  .panel-head { align-items: flex-start; flex-wrap: wrap; padding: 14px 16px; }
  .panel-body { padding: 16px; }
  .responsive-table td { display: grid; grid-template-columns: minmax(88px, 31%) minmax(0, 1fr); align-items: start; gap: 10px; min-width: 0; padding: 10px 14px; border-bottom: 1px solid #eef0f3; overflow-wrap: anywhere; }
  .settings-form, .home-config-grid, .home-item-list, .home-card-fields { grid-template-columns: 1fr; }
  .settings-form .wide, .home-card-fields .wide, .home-inline-toggle { grid-column: auto; }
  .settings-form { gap: 16px; padding: 16px; }
  .home-config-form { padding: 14px; }
  .home-editor-hero { padding: 18px 16px; }
  .home-editor-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .home-editor-summary > div { border-bottom: 1px solid var(--line); }
  .home-editor-summary > div:nth-child(2n) { border-right: 0; }
  .home-editor-summary > div:nth-last-child(-n + 2) { border-bottom: 0; }
  .home-section-nav { position: static; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .home-section-nav a:nth-child(3) { border-left: 0; border-top: 1px solid var(--line); }
  .home-section-nav a:nth-child(4) { border-top: 1px solid var(--line); }
  .home-guidance, .home-tip { grid-template-columns: 1fr; gap: 4px; }
  .home-editor-section { padding: 14px; scroll-margin-top: 90px; }
  .home-editor-section + .home-editor-section { padding-top: 18px; }
  .home-editor-section-head { align-items: flex-start; }
  .home-config-panel .panel-head { position: static; align-items: flex-start; flex-direction: column; }
  .home-workspace-actions { width: 100%; }
  .home-workspace-actions #home-collapse-all { width: 100%; min-height: 44px; }
  .home-card-title { align-items: flex-start; }
  .home-card-controls { align-items: center; flex-wrap: wrap; justify-content: flex-end; }
  .home-item-actions { gap: 8px; flex-wrap: wrap; }
  .home-field-group-title { align-items: flex-start; flex-direction: column; gap: 3px; }
  .home-field-group-title span { text-align: left; }
  .home-field-grid, .home-media-layout { grid-template-columns: 1fr; }
  .home-image-preview { min-height: 132px; }
  .home-list-head { align-items: flex-start; flex-direction: column; }
  .home-list-head .secondary { width: 100%; }
  .home-list-item-head { flex-wrap: wrap; }
  dialog { width: calc(100vw - 16px); max-height: calc(100dvh - 16px); border-radius: var(--radius-md); }
  dialog form { max-height: calc(100dvh - 16px); }
  dialog header { padding: 12px 14px; }
  dialog footer { padding: 12px 14px max(12px, env(safe-area-inset-bottom)); }
  dialog footer .primary, dialog footer .secondary { flex: 1; }
  #modal-body { grid-template-columns: 1fr; max-height: none; gap: 15px; padding: 16px 14px; }
  #modal-body .wide { grid-column: auto; }
  dialog.product-modal { width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; border-radius: 0; }
  dialog.product-modal form { height: 100dvh; max-height: none; }
  dialog.product-modal header { padding-top: max(12px, env(safe-area-inset-top)); }
  dialog.product-modal input, dialog.product-modal select, dialog.product-modal textarea { min-height: 46px; font-size: 16px; }
  .product-form-section { border-radius: 10px; }
  .product-section-heading { align-items: flex-start; padding: 13px 14px; }
  .product-section-heading p { line-height: 1.55; }
  .product-form-grid, .product-form-grid.compact-grid { grid-template-columns: 1fr; gap: 15px; padding: 14px; }
  .product-form-grid .wide { grid-column: auto; }
  .product-media-row { grid-template-columns: minmax(0, 1fr) 112px; align-items: start; gap: 12px; }
  .product-file-picker { min-height: 82px; padding: 10px 8px; }
  .product-file-picker strong { font-size: 13px; }
  .product-file-picker span { font-size: 11px; }
  .product-image-preview { min-height: 112px; padding: 8px; }
  .product-image-preview img { height: 94px; }
  .product-description-field textarea { min-height: 220px; }
  .product-description-tools { grid-template-columns: 1fr; gap: 8px; }
  .product-description-picker { min-height: 58px; }
  .sku-editor { min-height: 128px; }
  .form-section { align-items: flex-start; flex-direction: column; }
  .modal-error { margin: 0 14px 10px; }
  .toast { right: 16px; bottom: 16px; }
}

@media (max-width: 380px) {
  .topbar { gap: 8px; padding-inline: 10px; }
  .topbar h2 { font-size: 18px; }
  .operator b { display: none; }
  .content { padding-inline: 10px; }
  .responsive-table td { grid-template-columns: minmax(78px, 29%) minmax(0, 1fr); padding-inline: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
.order-query-field { min-width: min(100%, 360px); flex: 1 1 360px; }
.inline-search { display: flex; align-items: stretch; gap: 8px; }
.inline-search input { min-width: 0; flex: 1 1 auto; }
.inline-search .mini { flex: 0 0 auto; }
.referral-reward-chip { display: inline-flex; flex-direction: column; gap: 2px; margin-top: 8px; padding: 7px 10px; border-radius: 10px; color: #285f4c; background: #e9f6f0; }
.referral-reward-chip strong { font-size: 13px; }
.referral-reward-chip small { color: #547568; }
.member-link-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.candidate-result { display: grid; gap: 8px; min-height: 54px; padding: 12px; border: 1px solid #e1e6ed; border-radius: 12px; color: #677286; background: #f7f9fb; }
.candidate-result > small, .candidate-row small { display: block; margin-top: 3px; }
.candidate-row { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 11px 12px; border: 1px solid #dce3eb; border-radius: 10px; color: #1f2a3b; text-align: left; background: #fff; }
.candidate-row em { color: #8a5b1d; font-size: 12px; font-style: normal; }
.candidate-row:not(:disabled) { cursor: pointer; }
.candidate-row.selected { border-color: #2e7b61; box-shadow: 0 0 0 2px rgba(46,123,97,.12); }
.candidate-row:disabled { opacity: .72; }
.withdrawal-summary { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 10px; padding: 14px 18px; border-bottom: 1px solid #e8ebef; }
.withdrawal-summary > div { padding: 12px; border-radius: 12px; background: #f5f7fa; }
.withdrawal-summary span, .withdrawal-summary strong { display: block; }
.withdrawal-summary span { color: #718096; font-size: 12px; }
.withdrawal-summary strong { margin-top: 5px; color: #1f2a3b; font-size: 15px; }
.withdrawal-record-list { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; padding: 16px; }
.withdrawal-record { padding: 16px; border: 1px solid #e2e6eb; border-radius: 14px; background: #fff; }
.withdrawal-record header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.withdrawal-record header strong, .withdrawal-record header small { display: block; }
.withdrawal-record header small { margin-top: 4px; color: #718096; }
.withdrawal-record dl { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 10px; margin: 14px 0 0; }
.withdrawal-record dl div { min-width: 0; }
.withdrawal-record dt { color: #718096; font-size: 11px; }
.withdrawal-record dd { margin: 4px 0 0; overflow-wrap: anywhere; font-size: 13px; }
.withdrawal-error { margin: 12px 0 0; padding: 9px 10px; border-radius: 8px; color: #a23f3f; background: #fff0f0; overflow-wrap: anywhere; }
.withdrawal-empty { display: flex; flex-direction: column; gap: 8px; grid-column: 1 / -1; }
.withdrawal-empty span { color: #718096; }

@media (max-width: 900px) {
  .withdrawal-summary { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .withdrawal-record-list { grid-template-columns: 1fr; }
}
@media (max-width: 680px) {
  .withdrawal-summary, .withdrawal-record dl { grid-template-columns: 1fr 1fr; }
  .inline-search { flex-wrap: wrap; }
}
