:root {
  color: #26335f;
  background: #f3f5ff;
  font-family: "Noto Sans SC", "MiSans", "PingFang SC", "Microsoft YaHei UI", system-ui, sans-serif;
  font-synthesis: none;
  line-height: 1.5;
  --brand: #6047f5;
  --brand-strong: #3a2dff;
  --blue: #1396ff;
  --ink: #0b1440;
  --text: #26335f;
  --muted: #65749b;
  --line: #dfe5ff;
  --canvas: #f3f5ff;
  --surface: #ffffff;
  --soft: #f8f9ff;
  --success: #117b59;
  --warning: #b8670d;
  --danger: #b83b48;
  --focus: #2f67d8;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--canvas); }
body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background: linear-gradient(180deg, #eef1ff 0, rgba(238, 241, 255, 0.7) 360px, #f6f8ff 100%);
}
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: 0.5; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--focus) 38%, transparent);
  outline-offset: 2px;
}
h1, h2, h3, p { margin: 0; }

.portal-shell {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 26px;
  width: min(1400px, calc(100% - 48px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 24px 0 40px;
}

.sidebar {
  position: sticky;
  top: 24px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  height: calc(100vh - 48px);
  min-height: 650px;
  padding: 22px 16px 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 8px 24px rgba(37, 49, 107, 0.06);
}

.brand-lockup { padding: 3px 10px 8px; }
.brand-lockup img { display: block; width: 154px; height: 50px; object-fit: contain; object-position: left center; }
.sidebar-foot { display: flex; align-items: center; min-height: 24px; padding: 0 10px 4px; }
.sidebar-foot strong { color: var(--ink); font-size: 16px; font-weight: 750; line-height: 1.4; }
.side-nav { display: grid; gap: 5px; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 44px;
  border: 0;
  border-radius: 10px;
  padding: 10px 13px;
  color: #5e6e96;
  background: transparent;
  font-size: 14px;
  font-weight: 650;
  text-align: left;
  transition: color 180ms ease, background 180ms ease, transform 180ms ease;
}
.nav-item:hover { color: var(--brand-strong); background: #f1f3ff; }
.nav-item:active { transform: translateY(1px); }
.nav-item.active { color: #fff; background: linear-gradient(135deg, var(--brand), var(--blue)); box-shadow: 0 6px 12px rgba(58, 45, 255, 0.2); }
.nav-dot { width: 6px; height: 6px; flex: 0 0 auto; border-radius: 50%; background: #c5cdf4; }
.nav-item.active .nav-dot { background: #fff; }

.portal-main { min-width: 0; padding: 2px 0 32px; }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 24px; min-height: 92px; margin-bottom: 18px; }
.page-heading { min-width: 0; }
.page-heading > p { margin-bottom: 6px; color: #6474a1; font-size: 13px; font-weight: 650; }
.page-heading h1 { color: var(--ink); font-size: 28px; line-height: 1.25; font-weight: 750; text-wrap: balance; }
.page-heading > span { display: block; margin-top: 7px; color: var(--muted); font-size: 14px; }
.channel-identity { display: flex; align-items: center; justify-content: flex-end; gap: 11px; flex: 0 0 auto; }
.channel-identity > div { display: grid; gap: 2px; text-align: right; }
.channel-identity strong { color: var(--ink); font-size: 14px; }
.channel-identity span { color: var(--muted); font-size: 12px; }

.feedback { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; border-radius: 10px; padding: 12px 14px; font-size: 13px; }
.feedback.loading { color: #315f94; background: #edf7ff; }
.feedback.success { color: #0f7657; background: #e9fff6; }
.feedback.error { flex-wrap: wrap; color: #7a2a36; background: #fff0f2; }
.feedback.error span { flex: 1 1 300px; }
.feedback.error button { border: 0; color: #7a2a36; background: transparent; font-weight: 700; text-decoration: underline; }
.loading-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--blue); animation: pulse 1.2s ease-in-out infinite; }
.feedback-check { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; color: #fff; background: var(--success); font-size: 12px; font-weight: 800; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.view-stage { animation: view-in 180ms ease-out; }
.headline-row, .section-title { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; }
.headline-row { margin-bottom: 16px; }
.headline-row h2, .section-title h2 { color: var(--ink); font-size: 18px; }
.headline-row p, .section-title > span, .section-title div > span { margin-top: 5px; color: var(--muted); font-size: 13px; }
.status-cluster { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.status-chip { display: inline-flex; align-items: center; min-height: 30px; border: 1px solid #dbe2ff; border-radius: 999px; padding: 5px 10px; color: #52618d; background: #fff; font-size: 12px; font-weight: 650; white-space: nowrap; }
.status-chip.success { color: #0f7657; border-color: #b9ead6; background: #e9fff6; }
.status-chip.info { color: #2568a8; border-color: #cde6ff; background: #eff8ff; }
.status-chip.warning { color: #95600d; border-color: #f1d7aa; background: #fff8e9; }
.status-chip.danger { color: #9a3440; border-color: #f1c4ca; background: #fff0f2; }

.overview-panel { display: grid; grid-template-columns: minmax(300px, 1.08fr) minmax(420px, 0.92fr); gap: 18px; margin-bottom: 18px; border: 1px solid var(--line); border-radius: 16px; padding: 20px; background: var(--surface); }
.balance-hero { display: grid; align-content: center; min-height: 220px; padding: 26px; border-radius: 14px; color: #fff; background: linear-gradient(135deg, var(--brand), var(--blue)); }
.balance-hero > span { font-size: 14px; font-weight: 650; }
.balance-hero > strong { margin-top: 12px; font-size: 40px; line-height: 1; font-variant-numeric: tabular-nums; }
.balance-hero p { max-width: 52ch; margin-top: 14px; color: rgba(255,255,255,0.88); font-size: 13px; }
.balance-hero button { width: fit-content; min-height: 36px; margin-top: 18px; border: 0; border-radius: 999px; padding: 7px 15px; color: #372ac5; background: #fff; font-weight: 750; }
.metric-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.metric { display: grid; align-content: center; min-width: 0; min-height: 104px; padding: 15px; border: 1px solid #e9edff; border-radius: 12px; background: #fafbff; }
.metric > span { color: var(--muted); font-size: 12px; font-weight: 650; }
.metric > strong { margin-top: 7px; color: var(--ink); font-size: 22px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.metric > small { margin-top: 6px; color: #7180a6; font-size: 11px; }
.metric.risk > strong, .metric.risk > small { color: var(--warning); }
.metric.tone-quiet > strong { color: #4f6187; }
.metric.tone-subtle > strong { color: #7180a6; font-weight: 700; }

.overview-panel--deep-child-glass .balance-hero,
.overview-panel--deep-child-glass .metric {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  -webkit-backdrop-filter: blur(18px) saturate(132%);
  backdrop-filter: blur(18px) saturate(132%);
}
.overview-panel--deep-child-glass .balance-hero {
  border: 1px solid rgba(255,255,255,0.28);
  background: linear-gradient(135deg, rgba(78,55,229,0.97), rgba(10,128,235,0.92));
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.20), inset 0 -1px 0 rgba(18,35,120,0.18);
}
.overview-panel--deep-child-glass .metric {
  border-color: rgba(157,172,230,0.58);
  background: linear-gradient(145deg, rgba(235,238,255,0.95), rgba(214,228,251,0.88));
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.72), inset 0 -1px 0 rgba(89,102,165,0.10);
}
.overview-panel--deep-child-glass .balance-hero::before,
.overview-panel--deep-child-glass .balance-hero::after {
  content: "";
  position: absolute;
  z-index: 0;
  border-radius: 50%;
  pointer-events: none;
}
.overview-panel--deep-child-glass .balance-hero::before { top: -78px; right: 2%; width: 240px; height: 170px; background: rgba(255,255,255,0.14); filter: blur(24px); }
.overview-panel--deep-child-glass .balance-hero::after { bottom: -92px; left: -38px; width: 230px; height: 170px; background: rgba(20,31,113,0.20); filter: blur(28px); }
.overview-panel--deep-child-glass .balance-hero > *,
.overview-panel--deep-child-glass .metric > * { position: relative; z-index: 1; }

.entry-section { margin-bottom: 18px; }
.entry-section .section-title { margin: 0 0 12px; }
.dashboard-quick-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)) minmax(280px, 1.15fr); gap: 12px; align-items: stretch; }
.entry-card { display: flex; flex-direction: column; min-height: 136px; border: 1px solid var(--line); border-radius: 14px; padding: 16px; background: #fff; }
.entry-card h3 { color: var(--ink); font-size: 16px; }
.entry-card p { margin-top: 8px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.entry-card button { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; min-height: 44px; margin-top: auto; border: 0; padding: 12px 0 0; color: var(--brand-strong); background: transparent; font-weight: 700; text-align: left; }
.entry-card.primary-entry { border-color: #cbd3ff; background: #f7f7ff; }
.entry-card.primary-entry button { color: #fff; width: fit-content; min-height: 34px; border-radius: 999px; padding: 7px 13px; background: var(--brand); }
.quiet-status { display: flex; justify-content: space-between; gap: 12px; min-width: 0; border: 1px solid var(--line); border-radius: 12px; padding: 15px; background: rgba(255,255,255,0.8); }
.quiet-status span { color: var(--muted); font-size: 12px; }
.quiet-status strong { color: var(--ink); font-size: 13px; text-align: right; overflow-wrap: anywhere; }
.quiet-status.risk { border-color: #f0d3a8; background: #fff9ef; }
.quiet-status.risk strong { color: var(--warning); }
.dashboard-glance { display: grid; gap: 8px; align-content: stretch; }
.dashboard-glance .quiet-status { min-height: 64px; padding: 12px; }

.content-stack { display: grid; gap: 16px; }
.compact-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.compact-summary .metric { background: #fff; }
.commission-panel { border: 1px solid var(--line); border-radius: 16px; padding: 20px; background: #fff; }
.commission-filter { min-width: 132px; border: 1px solid var(--line); border-radius: 9px; padding: 8px 32px 8px 10px; color: var(--ink); background: #fff; }
.commission-list { margin-top: 10px; }
.commission-row { display: grid; grid-template-columns: minmax(220px, 1fr) 110px 110px 120px; gap: 12px; align-items: center; padding: 14px 0; border-bottom: 1px solid #edf0ff; }
.commission-row:last-child { border-bottom: 0; }
.commission-row > div { display: grid; gap: 4px; min-width: 0; }
.commission-row > div span, .commission-row time { color: var(--muted); font-size: 12px; }
.commission-amount { color: var(--ink); }
.commission-more { display: block; margin: 14px auto 0; }
.inline-resource-error { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 14px; border-radius: 10px; padding: 14px; color: var(--danger); background: #fff6f6; }
.capability-state { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 18px; min-height: 210px; border: 1px solid var(--line); border-radius: 16px; padding: 28px; background: #fff; }
.capability-state.warning { border-color: #efd7af; background: #fffbf3; }
.capability-icon { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; color: #315f94; background: #eaf5ff; font-family: Georgia, serif; font-weight: 700; }
.capability-state.warning .capability-icon { color: #9a640f; background: #fff0d1; }
.capability-state h2 { color: var(--ink); font-size: 18px; }
.capability-state p { max-width: 70ch; margin-top: 8px; color: var(--text); font-size: 14px; }
.capability-state div > span { display: block; margin-top: 8px; color: var(--muted); font-size: 12px; }

.withdraw-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start; }
.form-panel, .process-note, .records-panel, .profile-panel { border: 1px solid var(--line); border-radius: 16px; padding: 22px; background: #fff; }
.form-grid { display: grid; gap: 16px; margin-top: 20px; }
.field { display: grid; gap: 7px; color: #35436d; font-size: 13px; font-weight: 650; }
.field-label-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.field-label-row label { cursor: pointer; }
.field-inline-action { min-height: 28px; border: 0; border-radius: 7px; padding: 4px 9px; color: var(--brand-strong); background: #f0f2ff; font-size: 12px; font-weight: 750; }
.field-inline-action:hover { background: #e5e9ff; }
.field-inline-action:disabled { color: #8a94b2; background: #f3f5fb; cursor: not-allowed; }
.field small { color: var(--muted); font-size: 11px; font-weight: 400; }
input, select, textarea { width: 100%; min-height: 44px; border: 1px solid #cfd7f4; border-radius: 9px; padding: 9px 11px; color: var(--ink); background: #fff; }
textarea { resize: vertical; }
input::placeholder, textarea::placeholder { color: #69779a; }
.field-error { min-height: 20px; color: var(--danger); font-size: 12px; }
[aria-invalid="true"] { border-color: var(--danger); background: #fff8f9; }
.primary-button, .secondary-button { min-height: 40px; border-radius: 9px; padding: 8px 14px; font-weight: 750; }
.primary-button { border: 0; color: #fff; background: var(--brand); }
.primary-button:hover { background: var(--brand-strong); }
.secondary-button { border: 1px solid #cbd3f2; color: #3f50a6; background: #fff; }
.secondary-button:hover { background: #f6f7ff; }
.wide { width: 100%; }
.process-note h2 { color: var(--ink); font-size: 17px; }
.process-note ol { display: grid; gap: 18px; margin: 20px 0; padding-left: 24px; }
.process-note li { padding-left: 4px; color: var(--brand-strong); }
.process-note li strong, .process-note li span { display: block; }
.process-note li strong { color: var(--ink); font-size: 13px; }
.process-note li span { margin-top: 3px; color: var(--muted); font-size: 12px; }
.process-note > p { border-radius: 9px; padding: 11px; color: #75500d; background: #fff7e9; font-size: 12px; }

.confirm-dialog { width: min(460px, calc(100% - 32px)); border: 0; border-radius: 14px; padding: 26px; color: var(--text); box-shadow: 0 18px 48px rgba(20, 28, 77, 0.25); }
.confirm-dialog::backdrop { background: rgba(11, 20, 64, 0.42); }
.dialog-icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; color: #fff; background: var(--brand); }
.confirm-dialog h2 { margin-top: 16px; color: var(--ink); font-size: 20px; }
.confirm-dialog p { margin-top: 10px; color: var(--text); font-size: 14px; line-height: 1.7; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }
.confirm-summary { display: grid; gap: 10px; margin: 18px 0 0; border-radius: 10px; padding: 14px; background: var(--soft); }
.confirm-summary > div { display: grid; grid-template-columns: 84px minmax(0, 1fr); gap: 12px; }
.confirm-summary dt { color: var(--muted); font-size: 12px; }
.confirm-summary dd { min-width: 0; margin: 0; color: var(--ink); font-size: 13px; overflow-wrap: anywhere; }
.confirm-summary strong { font-variant-numeric: tabular-nums; }

.records-heading { align-items: center; padding-bottom: 18px; border-bottom: 1px solid #edf0ff; }
.records-heading > div { min-width: 0; }
.record-list { display: grid; }
.record-row { display: grid; grid-template-columns: minmax(160px, 1.2fr) 110px 140px minmax(170px, 1fr) auto; gap: 12px; align-items: center; padding: 16px 0; border-bottom: 1px solid #edf0ff; }
.record-row:last-child { border-bottom: 0; }
.record-main { display: grid; gap: 4px; min-width: 0; }
.record-main strong { color: var(--ink); overflow-wrap: anywhere; }
.record-main span, .record-payment { color: var(--muted); font-size: 12px; }
.record-amount { color: var(--ink); font-variant-numeric: tabular-nums; }
.record-snapshot-button { min-width: 112px; justify-self: end; white-space: nowrap; }
.record-reason { grid-column: 1 / -1; border-radius: 8px; padding: 9px 11px; color: #8d3440; background: #fff1f3; font-size: 12px; }
.empty-state { display: grid; justify-items: center; padding: 60px 20px 40px; text-align: center; }
.empty-mark { display: grid; place-items: center; width: 54px; height: 54px; border-radius: 50%; color: var(--brand); background: #f0f2ff; font-size: 25px; }
.empty-state h3 { margin-top: 16px; color: var(--ink); font-size: 17px; }
.empty-state p { margin-top: 8px; color: var(--muted); font-size: 13px; }
.empty-state button { margin-top: 20px; }
.state-artwork-image { display: block; width: min(220px, 72vw); height: 150px; object-fit: contain; }
.state-artwork p { max-width: 58ch; }

.auth-state { display: grid; justify-items: center; width: min(620px, 100%); margin: 46px auto 0; border: 1px solid var(--line); border-radius: 16px; padding: 42px 28px; background: #fff; text-align: center; box-shadow: 0 14px 36px rgba(35, 49, 117, 0.07); }
.auth-state-icon { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 14px; color: #fff; background: linear-gradient(135deg, var(--brand-strong), #2398ff); font-size: 22px; font-weight: 800; }
.auth-state-eyebrow { margin-top: 18px; color: var(--brand-strong); font-size: 12px; font-weight: 750; letter-spacing: 0.08em; }
.auth-state h2 { margin-top: 8px; color: var(--ink); font-size: 23px; }
.auth-state-description { max-width: 42ch; margin-top: 10px; color: var(--text); font-size: 14px; line-height: 1.7; }
.auth-state-action { min-width: 136px; margin-top: 24px; }
.auth-state-progress { margin-top: 24px; color: var(--brand-strong); font-size: 13px; font-weight: 700; }
.auth-state-hint { margin-top: 14px; color: var(--muted); font-size: 12px; }
.auth-state--expired .auth-state-icon, .auth-state--cancelled .auth-state-icon { background: linear-gradient(135deg, #7558f4, #5578ff); }
.auth-state--denied .auth-state-icon, .auth-state--network-error .auth-state-icon { background: linear-gradient(135deg, #d88020, #f3aa45); }
.auth-state--unavailable .auth-state-icon { color: #53638e; background: #edf1ff; }

.page-skeleton { display: grid; gap: 16px; }
.skeleton-line, .skeleton-panel, .skeleton-card { overflow: hidden; background: #e9edfb; }
.skeleton-line::after, .skeleton-panel::after, .skeleton-card::after { content: ""; display: block; width: 45%; height: 100%; background: linear-gradient(90deg, transparent, rgba(255,255,255,0.72), transparent); animation: skeleton-shift 1.2s ease-in-out infinite; }
.skeleton-title { width: min(300px, 60%); height: 22px; border-radius: 6px; }
.skeleton-panel { height: 260px; border-radius: 16px; }
.skeleton-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.skeleton-card { height: 116px; border-radius: 12px; }

.profile-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.profile-panel .section-title { margin-bottom: 10px; }
.info-row { display: grid; grid-template-columns: 110px minmax(0, 1fr) auto; gap: 14px; align-items: center; min-height: 54px; border-bottom: 1px solid #edf0ff; }
.info-row > span { color: var(--muted); font-size: 13px; }
.info-row > strong { color: var(--ink); font-size: 13px; overflow-wrap: anywhere; }
.info-row > small { color: var(--muted); font-size: 11px; }
.profile-note { margin-top: 16px; border-radius: 9px; padding: 12px; color: #5e6e96; background: #f5f7ff; font-size: 12px; line-height: 1.65; }
.payment-method-list { display: grid; gap: 10px; margin-top: 16px; }
.payment-method-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 12px; min-height: 86px; border: 1px solid #e1e6ff; border-radius: 11px; padding: 14px; background: #fbfcff; }
.payment-method-row.missing { border-color: #ead9b6; background: #fffdf7; }
.payment-method-copy { display: grid; gap: 6px; min-width: 0; }
.payment-method-copy strong { color: var(--ink); font-size: 14px; }
.payment-method-copy span { color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.payment-method-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.payment-preview-button { min-width: 104px; }
.profile-payment-empty { display: grid; gap: 6px; margin-top: 16px; border-radius: 10px; padding: 24px; color: var(--muted); background: var(--soft); text-align: center; }
.profile-payment-empty strong { color: var(--ink); }
.payment-preview-dialog { width: min(440px, calc(100% - 32px)); }
.payment-preview-dialog h2 { margin-top: 0; }
.payment-preview-meta { color: var(--muted) !important; font-size: 13px !important; }
.payment-preview-visual { display: grid; place-items: center; width: min(260px, 100%); aspect-ratio: 1; margin: 22px auto 0; border: 1px solid #c8ceff; border-radius: 12px; color: var(--brand-strong); background: #f7f7ff; font-size: 18px; font-weight: 750; line-height: 1.7; text-align: center; white-space: pre-line; }
.payment-preview-visual img { display: block; max-width: 100%; max-height: 300px; object-fit: contain; }
.payment-preview-visual.summary { aspect-ratio: auto; min-height: 132px; }
.payment-preview-warning { border-radius: 9px; padding: 11px; color: #75500d !important; background: #fff7e9; font-size: 12px !important; }
.payment-profile-form { display: grid; gap: 16px; margin-top: 16px; }
.payment-profile-intro { color: var(--text); font-size: 13px; line-height: 1.65; }
.payment-profile-method-summary { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 46px; border-radius: 9px; padding: 11px 13px; color: var(--muted); background: var(--soft); font-size: 13px; }
.payment-profile-method-summary strong { color: var(--ink); }
.payment-profile-actions { display: flex; justify-content: flex-end; gap: 10px; }
.payment-profile-actions .wide { width: auto; flex: 1; }
.payment-method-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 0; border: 0; padding: 0; }
.payment-method-options legend { grid-column: 1 / -1; margin-bottom: 7px; padding: 0; color: #35436d; font-size: 13px; font-weight: 650; }
.payment-method-option { display: flex; align-items: center; gap: 9px; min-height: 46px; border: 1px solid #cfd7f4; border-radius: 9px; padding: 10px 12px; color: var(--ink); background: #fff; font-size: 14px; font-weight: 700; cursor: pointer; }
.payment-method-option:has(input:checked) { border-color: var(--brand); background: #f4f3ff; }
.payment-method-option input { width: 18px; min-height: 18px; margin: 0; padding: 0; accent-color: var(--brand); }
input[type="file"] { padding: 6px; }
input[type="file"]::file-selector-button { min-height: 30px; margin-right: 10px; border: 0; border-radius: 7px; padding: 5px 10px; color: #3f50a6; background: #eef0ff; font-weight: 700; cursor: pointer; }
.payment-profile-feedback { min-height: 20px; color: var(--muted); font-size: 12px; }
.payment-profile-feedback.error { color: var(--danger); }
.payment-profile-feedback.success { color: var(--success); }

@keyframes pulse { 50% { opacity: 0.4; transform: scale(0.82); } }
@keyframes view-in { from { opacity: 0; transform: translateY(4px); } }
@keyframes skeleton-shift { from { transform: translateX(-110%); } to { transform: translateX(250%); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

@media (max-width: 1120px) {
  .portal-shell { grid-template-columns: 190px minmax(0, 1fr); gap: 18px; width: min(100% - 32px, 1200px); }
  .dashboard-quick-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-glance { grid-column: 1 / -1; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .overview-panel { grid-template-columns: 1fr; }
  .balance-hero { min-height: 190px; }
}

@media (max-width: 820px) {
  .portal-shell { display: block; width: 100%; padding: 0 14px 28px; }
  .sidebar { position: static; z-index: 10; display: grid; grid-template-columns: auto minmax(0, 1fr); height: auto; min-height: 0; margin: 0 -14px 18px; border-width: 0 0 1px; border-radius: 0; padding: 12px 14px; box-shadow: none; }
  .brand-lockup { padding: 0; }
  .brand-lockup img { width: 124px; height: 38px; }
  .sidebar-foot { display: none; }
  .side-nav { display: flex; align-items: center; gap: 5px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
  .side-nav::-webkit-scrollbar { display: none; }
  .nav-item { flex: 0 0 auto; width: auto; min-height: 38px; padding: 8px 10px; white-space: nowrap; }
  .nav-dot { display: none; }
  .topbar { min-height: 78px; align-items: flex-start; }
  .page-heading h1 { font-size: 24px; }
  .channel-identity { display: none; }
  .withdraw-layout { grid-template-columns: 1fr; }
  .process-note { order: -1; }
  .process-note ol { grid-template-columns: repeat(3, 1fr); padding-left: 18px; }
  .record-row { grid-template-columns: minmax(0, 1fr) auto; }
  .commission-row { grid-template-columns: minmax(0, 1fr) auto; }
  .commission-row time, .commission-row > .status-chip { justify-self: start; }
  .record-row > .status-chip, .record-payment { justify-self: start; }
  .record-snapshot-button { justify-self: end; }
  .profile-grid { grid-template-columns: 1fr; }
  .skeleton-grid { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  .sidebar { grid-template-columns: 1fr; gap: 8px; }
  .brand-lockup img { width: 116px; }
  .topbar { gap: 12px; }
  .page-heading > p { display: none; }
  .page-heading > span { font-size: 12px; }
  .headline-row, .section-title { align-items: flex-start; flex-direction: column; gap: 8px; }
  .status-cluster { justify-content: flex-start; }
  .overview-panel, .form-panel, .process-note, .records-panel, .profile-panel { border-radius: 12px; padding: 14px; }
  .overview-panel { border: 0; padding: 0; background: transparent; }
  .balance-hero { min-height: 180px; padding: 20px; }
  .balance-hero > strong { font-size: 34px; }
  .metric-list, .dashboard-quick-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .compact-summary { grid-template-columns: 1fr; }
  .commission-panel { padding: 16px; }
  .commission-filter { width: 100%; }
  .metric { min-height: 96px; padding: 13px; }
  .metric > strong { font-size: 20px; }
  .dashboard-quick-grid { gap: 8px; }
  .entry-card { min-height: 128px; padding: 12px; }
  .entry-card h3 { font-size: 15px; }
  .entry-card p { font-size: 12px; }
  .quiet-status { align-items: flex-start; flex-direction: column; }
  .dashboard-glance { grid-column: 1 / -1; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .quiet-status strong { text-align: left; }
  .capability-state { grid-template-columns: 1fr; padding: 20px; }
  .capability-state button { width: 100%; }
  .inline-resource-error { align-items: stretch; flex-direction: column; }
  .process-note ol { grid-template-columns: 1fr; }
  .records-heading .secondary-button { width: 100%; }
  .record-row { gap: 8px; }
  .record-main { grid-column: 1 / -1; }
  .record-payment { grid-column: 1 / -1; }
  .record-snapshot-button { grid-column: 1 / -1; justify-self: start; }
  .info-row { grid-template-columns: 90px minmax(0, 1fr); }
  .info-row > small { grid-column: 2; }
  .payment-method-row { grid-template-columns: minmax(0, 1fr) auto; }
  .payment-method-row .payment-method-actions { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; }
  .payment-method-row .payment-preview-button { width: 100%; min-width: 0; }
  .payment-method-row.missing > .payment-preview-button { grid-column: 1 / -1; }
  .payment-method-options { grid-template-columns: 1fr; }
  .dialog-actions { flex-direction: column-reverse; }
  .dialog-actions button { width: 100%; }
  .confirm-summary > div { grid-template-columns: 1fr; gap: 3px; }
  .state-artwork-image { height: 124px; }
  .auth-state { margin-top: 24px; border-radius: 12px; padding: 32px 20px; }
  .auth-state h2 { font-size: 21px; }
  .auth-state-action { width: 100%; }
}

@media (max-width: 350px) {
  .metric-list, .dashboard-quick-grid, .dashboard-glance { grid-template-columns: 1fr; }
}
