:root {
  color-scheme: light;
  --ink: #182026;
  --muted: #68747d;
  --line: #d8dee2;
  --surface: #ffffff;
  --canvas: #eef1f3;
  --dark: #20282d;
  --dark-soft: #303a40;
  --green: #15955f;
  --green-dark: #087548;
  --green-soft: #e4f5ed;
  --red: #c43b3b;
  --red-soft: #fbeaea;
  --amber: #9a6800;
  --amber-soft: #fff2ce;
  --blue: #176a9b;
  --blue-soft: #e6f2f8;
  --shadow: 0 18px 48px rgba(22, 31, 36, 0.12);
  font-family: "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--canvas); }
body { margin: 0; color: var(--ink); background: var(--canvas); font-size: 14px; letter-spacing: 0; }
button, input, select, textarea { font: inherit; letter-spacing: 0; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: 0.48; }
a { color: inherit; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.mono { font-family: Consolas, "SFMono-Regular", monospace; }

.public-page {
  min-height: 100vh;
  display: grid;
  grid-template-rows: 1fr auto;
  padding: 28px;
}

.auth-workspace {
  width: min(900px, 100%);
  min-height: 570px;
  margin: auto;
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid #cfd6da;
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.auth-identity {
  min-width: 0;
  padding: 44px 36px 32px;
  display: flex;
  flex-direction: column;
  color: #f8fbfc;
  background: var(--dark);
}

.brand-mark {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 2px solid #4cd493;
  border-radius: 50%;
  background: #142a21;
  box-shadow: inset 0 0 0 7px #293c34;
}

.brand-mark.small { width: 42px; height: 42px; box-shadow: inset 0 0 0 5px #293c34; }
.brand-note { color: #4de09b; font-size: 27px; line-height: 1; font-weight: 700; }
.brand-mark.small .brand-note { font-size: 20px; }
.eyebrow, .section-label { margin: 0 0 8px; color: #259766; font-size: 11px; font-weight: 800; text-transform: uppercase; }
.auth-identity .eyebrow { margin-top: 32px; color: #8fa39a; }
.auth-identity h1 { margin: 0; font-size: 32px; line-height: 1.25; font-weight: 720; overflow-wrap: anywhere; }
.auth-steps { margin: 64px 0 0; padding: 0; list-style: none; }
.auth-steps li { position: relative; min-height: 62px; display: grid; grid-template-columns: 30px 1fr; align-items: start; gap: 12px; color: #829089; }
.auth-steps li:not(:last-child)::after { content: ""; position: absolute; left: 14px; top: 30px; bottom: 0; width: 1px; background: #48535a; }
.auth-steps li span { width: 30px; height: 30px; display: grid; place-items: center; border: 1px solid #536068; border-radius: 50%; font-size: 12px; font-weight: 700; }
.auth-steps li strong { padding-top: 5px; font-size: 13px; font-weight: 650; }
.auth-steps li.active { color: #ffffff; }
.auth-steps li.active span { color: #0a3b25; border-color: #4de09b; background: #4de09b; }
.auth-steps li.active:not(:last-child)::after { background: #319969; }
.identity-status { margin-top: auto; display: flex; align-items: center; gap: 8px; color: #a9b5af; font-size: 12px; }
.status-light { width: 8px; height: 8px; border-radius: 50%; background: #49d28e; box-shadow: 0 0 0 3px rgba(73, 210, 142, 0.14); }

.auth-surface { min-width: 0; display: grid; align-items: center; padding: 52px 64px; }
.auth-view { width: min(100%, 410px); margin: auto; }
.view-heading { margin-bottom: 34px; }
.view-heading h1, .view-heading h2 { margin: 0; color: var(--ink); font-size: 27px; line-height: 1.3; font-weight: 720; overflow-wrap: anywhere; }
.compact-heading { margin-bottom: 20px; }
.centered { text-align: center; }
.stack-form { display: grid; gap: 11px; }
label { color: #344047; font-size: 13px; font-weight: 650; }
input, select, textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid #c7d0d5;
  border-radius: 6px;
  color: var(--ink);
  background: #ffffff;
  outline: none;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}
input { padding: 0 13px; }
select { padding: 0 34px 0 12px; }
textarea { padding: 12px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(21, 149, 95, 0.13); }
#cardKey { min-height: 50px; font-family: Consolas, monospace; font-size: 15px; text-transform: uppercase; }
.authorization-notice { margin: -12px 0 24px; padding: 10px 12px; border-left: 3px solid var(--green); color: #245440; background: var(--green-soft); font-size: 12px; line-height: 1.7; white-space: pre-wrap; overflow-wrap: anywhere; }
.invitation-context { margin: -12px 0 20px; padding: 9px 11px; border: 1px solid #bfdde9; border-radius: 6px; color: var(--blue); background: var(--blue-soft); font-size: 12px; font-weight: 700; overflow-wrap: anywhere; }
.invitation-context + .authorization-notice { margin-top: 0; }
.public-cards { margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--line); }
.public-cards-heading { min-height: 28px; display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.public-cards-heading h3 { margin: 0; font-size: 14px; line-height: 1.35; }
.public-cards-heading span { color: var(--muted); font-size: 12px; }
.public-cards-list { margin-top: 9px; display: grid; gap: 7px; counter-reset: public-card; }
.public-card-row { min-height: 43px; padding: 5px 5px 5px 8px; display: grid; grid-template-columns: 24px minmax(0, 1fr) 58px; align-items: center; gap: 8px; border: 1px solid #dfe4e7; border-radius: 6px; background: #fbfcfc; transition: border-color 140ms ease, background-color 140ms ease; }
.public-card-row:hover { border-color: #bdd9cc; background: #f6fbf8; }
.public-card-index { width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; color: var(--green-dark); background: var(--green-soft); font-family: Consolas, "SFMono-Regular", monospace; font-size: 10px; font-weight: 750; }
.public-card-row code { min-width: 0; overflow-wrap: anywhere; color: #263138; font-family: Consolas, "SFMono-Regular", monospace; font-size: 11px; font-weight: 650; }
.public-card-row .button { width: 58px; min-height: 31px; padding: 0 7px; }
.public-cards-empty { min-height: 48px; margin: 0; display: grid; place-items: center; color: var(--muted); font-size: 12px; }
.invite-entry-button { margin-top: 8px; }
.invite-link-result { margin-top: 10px; padding: 10px; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px; border: 1px solid #b8dec9; border-radius: 6px; background: var(--green-soft); }
.invite-link-result > div { min-width: 0; display: grid; gap: 2px; }
.invite-link-result strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.invite-link-result span { color: var(--green-dark); font-size: 11px; }
.invite-link-result input { grid-column: 1 / -1; min-height: 36px; font-size: 11px; }
.self-invite-notice { margin: 20px 0 0; padding: 11px 12px; border-left: 3px solid var(--blue); color: #285269; background: var(--blue-soft); font-size: 12px; line-height: 1.7; white-space: pre-wrap; overflow-wrap: anywhere; }
.self-invite-fields { margin-top: 18px; }
.public-invite-dialog .invite-link-result { margin-top: 18px; }
.field-error { min-height: 20px; margin: 0; color: var(--red); font-size: 12px; }
.button {
  min-height: 38px;
  padding: 0 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid transparent;
  border-radius: 6px;
  font-weight: 680;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease;
}
.button.primary { color: #fff; border-color: var(--green); background: var(--green); }
.button.primary:hover:not(:disabled) { border-color: var(--green-dark); background: var(--green-dark); }
.button.secondary { color: #334047; border-color: #c5cdd2; background: #fff; }
.button.secondary:hover:not(:disabled) { border-color: #9ba8af; background: #f5f7f8; }
.button.quiet { color: var(--blue); border-color: #bfd3de; background: #f2f8fb; }
.button.quiet:hover:not(:disabled) { background: var(--blue-soft); }
.button.danger { color: var(--red); border-color: #ebc3c3; background: #fff7f7; }
.button.danger:hover:not(:disabled) { background: var(--red-soft); }
.button.wide { width: 100%; min-height: 46px; margin-top: 12px; }
.button.small { min-height: 30px; padding: 0 10px; font-size: 12px; }

.qr-frame { width: 282px; height: 282px; margin: 0 auto; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 8px; background: #f8fafb; }
.qr-frame img { width: 260px; height: 260px; display: block; object-fit: contain; background: #fff; }
.qr-loading { color: var(--muted); font-size: 13px; }
.scan-meta { min-height: 54px; margin: 16px auto 4px; display: flex; align-items: center; justify-content: space-between; gap: 14px; color: var(--muted); font-size: 12px; }
.scan-meta strong { color: var(--ink); font-family: Consolas, monospace; font-size: 16px; }
.success-symbol, .failure-symbol { width: 62px; height: 62px; margin: 0 auto 23px; display: grid; place-items: center; border-radius: 50%; font-size: 28px; font-weight: 800; }
.success-symbol { color: var(--green-dark); background: var(--green-soft); }
.failure-symbol { color: var(--red); background: var(--red-soft); }
.danger-text { color: var(--red); }
.view-message { margin: 14px 0 0; color: var(--muted); line-height: 1.7; }
.account-result { min-height: 80px; margin: 28px 0 16px; padding: 12px 14px; display: flex; align-items: center; gap: 13px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.account-result > div:last-child { min-width: 0; display: grid; gap: 5px; }
.account-result strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-result span { color: var(--muted); font-family: Consolas, monospace; font-size: 12px; }
.account-avatar, .avatar-fallback { width: 56px; height: 56px; flex: 0 0 auto; border-radius: 50%; object-fit: cover; }
.avatar-fallback { display: grid; place-items: center; color: #fff; background: var(--dark-soft); font-weight: 800; }
.public-footer { padding: 18px 0 0; text-align: center; color: #879198; font-size: 12px; }
.public-footer a { text-decoration: none; }
.public-footer a:hover { color: var(--ink); }

.admin-page { min-height: 100vh; background: #f1f3f4; }
.admin-login { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-panel { width: min(390px, 100%); padding: 34px; display: grid; gap: 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; box-shadow: var(--shadow); }
.login-panel .view-heading { margin: 13px 0 15px; }
.login-panel .brand-mark { background: var(--dark); }
.admin-shell { min-height: 100vh; }
.admin-header { height: 68px; padding: 0 30px; display: flex; align-items: center; justify-content: space-between; gap: 20px; border-bottom: 1px solid #d7dde1; background: #fff; }
.admin-brand { min-width: 0; display: flex; align-items: center; gap: 12px; }
.admin-brand > div:last-child { min-width: 0; display: grid; gap: 2px; }
.admin-brand strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; }
.admin-brand span { color: var(--muted); font-size: 11px; }
.header-actions { display: flex; align-items: center; gap: 9px; }
.admin-main { width: min(1440px, calc(100% - 48px)); margin: 0 auto; padding: 26px 0 48px; }
.stats-band { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.stat { min-width: 0; min-height: 108px; padding: 19px 23px; display: grid; align-content: center; gap: 4px; }
.stat + .stat { border-left: 1px solid var(--line); }
.stat span, .stat small { color: var(--muted); font-size: 12px; }
.stat strong { font-size: 28px; line-height: 1.2; }
.usage-band { margin-top: 14px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.usage-heading { min-height: 66px; padding: 13px 18px; display: flex; align-items: center; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--line); }
.usage-heading h2 { margin: 0 0 3px; font-size: 16px; }
.usage-heading p { margin: 0; color: var(--muted); font-size: 11px; }
.usage-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); }
.usage-meter { min-width: 0; min-height: 124px; padding: 16px; display: grid; align-content: center; gap: 7px; }
.usage-meter + .usage-meter { border-left: 1px solid #e5e9eb; }
.usage-meter span, .usage-meter small { color: var(--muted); font-size: 11px; }
.usage-meter strong { overflow-wrap: anywhere; font-size: 17px; line-height: 1.25; }
.usage-track { height: 6px; overflow: hidden; border-radius: 999px; background: #e7ebed; }
.usage-track i { width: 0; height: 100%; display: block; border-radius: inherit; background: var(--green); transition: width 220ms ease; }
.usage-track i.warning { background: #d99a14; }
.usage-track i.danger { background: var(--red); }
.usage-error { margin: 0; padding: 16px 18px; color: var(--red); font-size: 12px; }
.view-tabs { margin-top: 22px; display: flex; border-bottom: 1px solid #cfd6da; }
.tab { min-width: 118px; height: 43px; padding: 0 16px; border: 0; border-bottom: 2px solid transparent; color: var(--muted); background: transparent; font-weight: 680; }
.tab.active { color: var(--ink); border-bottom-color: var(--green); }
.data-section { padding-top: 21px; }
.section-toolbar { min-height: 51px; display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; }
.section-toolbar h2 { margin: 0 0 4px; font-size: 20px; }
.section-toolbar p { margin: 0; font-size: 12px; }
.toolbar-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 8px; }
.toolbar-actions input, .toolbar-actions select { min-height: 38px; }
.search-input { width: 240px; }
.toolbar-actions select { width: 130px; }
.public-card-setting { min-height: 62px; margin-top: 15px; padding: 10px 12px; display: flex; align-items: center; gap: 12px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: rgba(255, 255, 255, 0.66); }
.public-card-setting-copy { min-width: 0; margin-right: auto; display: grid; gap: 3px; }
.public-card-setting-copy strong { font-size: 13px; }
.public-card-setting-copy span { color: var(--muted); font-size: 11px; overflow-wrap: anywhere; }
.switch-control { position: relative; width: 42px; height: 24px; flex: 0 0 42px; cursor: pointer; }
.switch-control input { position: absolute; width: 1px; height: 1px; min-height: 1px; opacity: 0; }
.switch-track { width: 42px; height: 24px; padding: 3px; display: block; border: 1px solid #aeb8be; border-radius: 999px; background: #dce1e4; transition: background-color 140ms ease, border-color 140ms ease; }
.switch-track span { width: 16px; height: 16px; display: block; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(20, 30, 35, 0.24); transition: transform 140ms ease; }
.switch-control input:checked + .switch-track { border-color: var(--green); background: var(--green); }
.switch-control input:checked + .switch-track span { transform: translateX(18px); }
.switch-control input:focus-visible + .switch-track { box-shadow: 0 0 0 3px rgba(21, 149, 95, 0.18); }
.switch-control input:disabled + .switch-track { cursor: not-allowed; opacity: 0.5; }
.public-notice-setting { margin-top: 10px; padding: 12px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: rgba(255, 255, 255, 0.66); }
.public-notice-heading { min-height: 34px; margin-bottom: 9px; display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.public-notice-heading > div:first-child { min-width: 0; display: flex; align-items: baseline; gap: 9px; }
.public-notice-heading strong { font-size: 13px; }
.public-notice-heading span { color: var(--muted); font-size: 11px; }
.public-notice-actions { display: flex; align-items: center; gap: 6px; }
#authorizationNoticeInput { min-height: 82px; line-height: 1.55; }
.bulk-bar { min-height: 52px; margin-top: 15px; padding: 7px 12px; display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-bottom: 0; border-radius: 6px 6px 0 0; background: #fff; }
.bulk-bar span { margin-right: auto; color: var(--muted); font-size: 12px; }
.bulk-select { display: inline-flex; align-items: center; gap: 7px; color: #344047; font-size: 12px; font-weight: 680; white-space: nowrap; cursor: pointer; }
.bulk-select input { width: 16px; min-height: 16px; margin: 0; accent-color: var(--green); }
.table-wrap { margin-top: 15px; overflow: hidden; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.bulk-bar + .table-wrap { margin-top: 0; border-radius: 0 0 6px 6px; }
.data-table { width: 100%; border-collapse: collapse; table-layout: auto; }
.data-table th, .data-table td { padding: 12px 14px; border-bottom: 1px solid #e6eaec; text-align: left; vertical-align: middle; }
.data-table th { height: 42px; color: #657078; background: #f7f9fa; font-size: 11px; font-weight: 750; white-space: nowrap; }
.data-table td { min-height: 58px; font-size: 13px; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover { background: #fafcfc; }
.data-table .check-cell { width: 45px; text-align: center; }
.data-table input[type="checkbox"] { width: 16px; min-height: 16px; accent-color: var(--green); }
.account-cell { min-width: 210px; display: flex; align-items: center; gap: 11px; }
.account-cell > div { min-width: 0; display: grid; gap: 4px; }
.account-cell strong { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-cell span { font-size: 11px; }
.table-avatar { width: 36px; height: 36px; flex: 0 0 auto; border-radius: 50%; object-fit: cover; }
.table-avatar.avatar-fallback { display: grid; color: #fff; font-size: 12px; }
.strong-cell { color: #263138; font-weight: 650; white-space: nowrap; }
.row-actions { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.invite-person, .invite-source-cell, .invite-stats { min-width: 0; display: grid; gap: 4px; }
.invite-person-heading { min-width: 0; display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.invite-person strong, .invite-source-cell strong { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.invite-person span, .invite-source-cell span, .invite-stats span { font-size: 11px; }
.invite-stats .reward-ready { color: var(--green-dark); font-weight: 720; }
.invite-uin { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.invite-code-cell { max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.invite-actions { flex-wrap: wrap; white-space: normal; }
.dialog-summary { margin: 10px 0 0; font-size: 12px; }
.members-table-wrap { max-height: min(55vh, 520px); overflow: auto; }
.reward-dialog { width: min(920px, calc(100% - 30px)); max-height: calc(100vh - 30px); overflow: hidden; }
.invite-reward-dialog-body { max-height: calc(100vh - 30px); overflow: auto; }
.invite-reward-summary { margin-top: 18px; padding: 12px 0; display: flex; align-items: center; justify-content: space-between; gap: 14px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.invite-reward-summary strong { font-size: 13px; }
.invite-reward-section { margin-top: 20px; }
.subsection-heading { min-height: 28px; display: flex; align-items: baseline; justify-content: space-between; gap: 14px; }
.subsection-heading h3 { margin: 0; font-size: 14px; }
.subsection-heading span { font-size: 11px; }
.reward-candidate-table { margin-top: 8px; max-height: 270px; overflow: auto; }
.invite-reward-note { margin-top: 14px; display: grid; gap: 7px; font-size: 12px; font-weight: 680; }
.reward-history-section { padding-top: 18px; border-top: 1px solid var(--line); }
.reward-history-table { margin-top: 8px; max-height: 360px; overflow: auto; }
.invite-reward-time, .invite-reward-members { min-width: 0; display: grid; gap: 4px; }
.invite-reward-time strong { white-space: nowrap; font-size: 12px; }
.invite-reward-time span, .invite-reward-members span { font-size: 11px; }
.invite-reward-members span { overflow-wrap: anywhere; }
.invite-reward-status { flex-wrap: wrap; }
.empty-state { padding: 50px 20px; color: var(--muted); text-align: center; }
.badge { min-height: 22px; padding: 2px 8px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid transparent; border-radius: 999px; font-size: 11px; font-weight: 720; white-space: nowrap; }
.badge.success { color: #087548; border-color: #b8e3cf; background: var(--green-soft); }
.badge.info { color: var(--blue); border-color: #bfdde9; background: var(--blue-soft); }
.badge.warning { color: var(--amber); border-color: #ead28d; background: var(--amber-soft); }
.badge.danger { color: var(--red); border-color: #efc3c3; background: var(--red-soft); }
.badge.neutral { color: #667178; border-color: #d5dadd; background: #f0f2f3; }

.modal-dialog { width: min(540px, calc(100% - 30px)); padding: 0; border: 0; border-radius: 8px; box-shadow: 0 22px 70px rgba(15, 22, 26, 0.28); }
.wide-dialog { width: min(670px, calc(100% - 30px)); }
.modal-dialog::backdrop { background: rgba(17, 25, 29, 0.58); }
.dialog-body { padding: 25px; }
.dialog-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.dialog-heading h2 { margin: 0; font-size: 21px; }
.icon-button { width: 34px; height: 34px; padding: 0; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; color: #5c686f; background: #fff; font-size: 22px; line-height: 1; }
.form-grid { margin-top: 25px; display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-grid label { display: grid; gap: 7px; }
.span-two { grid-column: span 2; }
.dialog-actions { margin-top: 22px; display: flex; justify-content: flex-end; gap: 8px; }
.notice { margin: 20px 0 12px; padding: 10px 12px; border-radius: 6px; font-size: 12px; }
.warning-notice { color: #715000; border: 1px solid #ead28d; background: var(--amber-soft); }
.generated-keys { min-height: 260px; font-family: Consolas, monospace; font-size: 13px; line-height: 1.8; }
.toast { position: fixed; right: 24px; bottom: 24px; z-index: 20; max-width: min(380px, calc(100% - 48px)); padding: 12px 16px; border: 1px solid #b9daca; border-radius: 6px; color: #075f3b; background: #ecf8f2; box-shadow: 0 12px 30px rgba(20, 30, 35, 0.18); }
.toast.error { color: #9d2525; border-color: #edbaba; background: #fff1f1; }

@media (max-width: 900px) {
  .public-page { padding: 18px; }
  .auth-workspace { grid-template-columns: 250px minmax(0, 1fr); }
  .auth-identity { padding: 36px 27px 27px; }
  .auth-surface { padding: 45px 38px; }
  .admin-main { width: min(100% - 28px, 1440px); }
  .usage-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .usage-meter:nth-child(4) { border-left: 0; }
  .usage-meter:nth-child(n + 4) { border-top: 1px solid #e5e9eb; }
  .section-toolbar { align-items: stretch; flex-direction: column; gap: 14px; }
  .toolbar-actions { justify-content: flex-start; }
}

@media (max-width: 700px) {
  .public-page { display: block; padding: 0; background: #fff; }
  .auth-workspace { min-height: 100vh; display: block; border: 0; border-radius: 0; box-shadow: none; }
  .auth-identity { min-height: 188px; padding: 25px 22px 20px; display: grid; grid-template-columns: 48px 1fr; align-content: start; gap: 0 13px; }
  .auth-identity .brand-mark { width: 48px; height: 48px; grid-row: span 2; }
  .auth-identity .eyebrow { margin-top: 2px; }
  .auth-identity h1 { font-size: 25px; }
  .auth-steps { grid-column: 1 / -1; margin: 27px 0 0; display: grid; grid-template-columns: repeat(3, 1fr); }
  .auth-steps li { min-height: 38px; display: flex; align-items: center; gap: 6px; }
  .auth-steps li:not(:last-child)::after { left: 30px; top: 14px; right: 0; bottom: auto; width: auto; height: 1px; }
  .auth-steps li span { width: 28px; height: 28px; z-index: 1; background: var(--dark); }
  .auth-steps li strong { display: none; }
  .identity-status { display: none; }
  .auth-surface { min-height: calc(100vh - 188px); padding: 30px 22px 42px; align-items: start; }
  .view-heading { margin-bottom: 23px; }
  .view-heading h1, .view-heading h2 { font-size: 24px; }
  .qr-frame { width: min(282px, 100%); height: auto; aspect-ratio: 1; }
  .qr-frame img { width: calc(100% - 20px); height: calc(100% - 20px); }
  .public-footer { display: none; }

  .admin-header { height: auto; min-height: 66px; padding: 11px 14px; align-items: flex-start; }
  .admin-brand span { display: none; }
  .header-actions { flex-wrap: wrap; justify-content: flex-end; }
  .header-actions .button { min-height: 34px; padding: 0 10px; }
  .stats-band { grid-template-columns: 1fr; }
  .stat { min-height: 82px; padding: 14px 18px; grid-template-columns: 1fr auto; align-items: center; }
  .stat + .stat { border-left: 0; border-top: 1px solid var(--line); }
  .stat strong { grid-column: 2; grid-row: 1 / span 2; font-size: 25px; }
  .usage-heading { align-items: flex-start; }
  .usage-grid { grid-template-columns: 1fr; }
  .usage-meter { min-height: 102px; }
  .usage-meter + .usage-meter { border-left: 0; border-top: 1px solid #e5e9eb; }
  .view-tabs { overflow-x: auto; }
  .tab { min-width: 100px; padding: 0 10px; flex: 1 1 100px; }
  .toolbar-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .toolbar-actions .search-input { width: 100%; grid-column: 1 / -1; }
  .toolbar-actions select { width: 100%; }
  .public-card-setting { align-items: flex-start; flex-wrap: wrap; }
  .public-card-setting-copy { flex: 1 1 calc(100% - 54px); }
  .public-card-setting > .badge { margin-left: 54px; }
  .public-notice-heading { align-items: flex-start; }
  .public-notice-heading > div:first-child { display: grid; gap: 3px; }
  .invite-reward-summary { align-items: flex-start; flex-direction: column; }
  .subsection-heading { align-items: flex-start; flex-direction: column; gap: 3px; }
  .reward-candidate-table, .reward-history-table { max-height: none; overflow: visible; }
  .bulk-bar { align-items: stretch; flex-wrap: wrap; }
  .bulk-bar span { width: 100%; margin: 0; }
  .bulk-bar .button { flex: 1 1 140px; }
  .table-wrap { overflow: visible; border: 0; background: transparent; }
  .data-table, .data-table tbody { display: block; }
  .data-table thead { display: none; }
  .data-table tr { margin-bottom: 10px; display: grid; grid-template-columns: 40px 1fr; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
  .data-table td { min-width: 0; padding: 10px 12px; display: grid; grid-template-columns: 88px minmax(0, 1fr); align-items: center; gap: 8px; border-bottom: 1px solid #e6eaec; overflow-wrap: anywhere; }
  .data-table td::before { content: attr(data-label); color: var(--muted); font-size: 11px; font-weight: 700; }
  .data-table td.check-cell { width: auto; grid-row: 1; grid-column: 1; display: grid; grid-template-columns: 1fr; border-bottom: 0; }
  .data-table td.check-cell::before { display: none; }
  .data-table td:nth-child(2) { grid-row: 1; grid-column: 2; }
  .data-table td:not(.check-cell):not(:nth-child(2)) { grid-column: 1 / -1; }
  .account-cell { min-width: 0; }
  .account-cell strong { max-width: 180px; }
  .row-actions { white-space: normal; }
  .no-check-table tr { grid-template-columns: 1fr; }
  .no-check-table td, .no-check-table td:nth-child(2), .no-check-table td:not(.check-cell):not(:nth-child(2)) { grid-row: auto; grid-column: 1; }
  .invite-code-cell { max-width: none; overflow: visible; text-overflow: clip; white-space: normal; overflow-wrap: anywhere; }
  .form-grid { grid-template-columns: 1fr; }
  .span-two { grid-column: span 1; }
}

@media (max-width: 390px) {
  .auth-surface { padding-left: 17px; padding-right: 17px; }
  .public-card-row { grid-template-columns: 22px minmax(0, 1fr) 54px; gap: 6px; }
  .public-card-row code { font-size: 10px; }
  .public-card-row .button { width: 54px; }
  .admin-brand strong { max-width: 120px; }
  .header-actions .button.quiet { display: none; }
  .toolbar-actions { grid-template-columns: 1fr; }
  .toolbar-actions .search-input { grid-column: 1; }
  .account-cell strong { max-width: 145px; }
}
