:root {
  font-family: Inter, "Segoe UI", "Microsoft YaHei", sans-serif;
  color: #172b3a;
  background: #f4f7fa;
  font-size: 14px;
  --accent: #087f73;
  --line: #e1e8ee;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
a,
input,
select,
textarea {
  outline-offset: 4px;
}
button {
  cursor: pointer;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: white;
  padding: 9px 14px;
  color: #223b49;
}
button:hover {
  border-color: var(--accent);
  color: var(--accent);
}
button.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}
button.danger {
  color: #a53131;
}
button:disabled {
  opacity: 0.5;
  cursor: wait;
}
input,
select,
textarea {
  border: 1px solid #c9d5dd;
  border-radius: 7px;
  padding: 10px 12px;
  background: white;
  color: inherit;
  max-width: 100%;
}
input:focus,
textarea:focus {
  border-color: var(--accent);
}
textarea {
  width: 100%;
  min-height: 100px;
}
label {
  display: grid;
  gap: 7px;
  font-weight: 500;
}
a {
  color: var(--accent);
  text-decoration: none;
}
.shell {
  display: grid;
  grid-template-columns: 228px minmax(0, 1fr);
  min-height: 100vh;
}
.sidebar {
  background: #102e36;
  color: #b4cace;
  padding: 30px 18px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: auto;
}
.brand {
  font-size: 24px;
  letter-spacing: 3px;
  color: white;
  font-weight: 700;
  margin: 0 12px 32px;
}
.brand small {
  display: block;
  font-size: 10px;
  letter-spacing: 2px;
  font-weight: 400;
  color: #94b5b8;
  margin-top: 7px;
}
.navlabel {
  font-size: 11px;
  color: #7f9fa6;
  margin: 26px 14px 10px;
  letter-spacing: 2px;
}
.sidebar a {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #bcd0d3;
  padding: 12px 14px;
  border-radius: 7px;
  margin: 4px 0;
}
.sidebar a:hover,
.sidebar a.active {
  color: white;
  background: #1e4850;
}
.navicon {
  font-size: 17px;
  width: 21px;
}
.content {
  min-width: 0;
}
.topbar {
  background: white;
  min-height: 75px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 34px;
  gap: 12px;
}
.topbar strong {
  font-size: 15px;
  flex-shrink: 0;
}
.topbar .user {
  display: flex;
  min-width: 0;
  gap: 14px;
  align-items: center;
}
.topbar .username {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.topbar .user button {
  flex-shrink: 0;
}
.pagehead > div {
  min-width: 0;
}
.pagehead h1 {
  overflow-wrap: anywhere;
}
.avatar {
  background: #e0f1ee;
  color: var(--accent);
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-weight: 700;
}
.workspace {
  max-width: 1440px;
  padding: 28px 34px 45px;
  margin: auto;
}
.mode {
  display: flex;
  gap: 12px;
  align-items: center;
  background: #fff6e4;
  border: 1px solid #f2dfb9;
  color: #715215;
  border-radius: 8px;
  padding: 12px 16px;
  font-size: 12px;
  margin-bottom: 28px;
}
.dot {
  width: 7px;
  height: 7px;
  display: inline-block;
  border-radius: 50%;
  background: #d49625;
}
.pagehead {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 23px;
  gap: 14px;
}
.eyebrow {
  color: var(--accent);
  font-size: 10px;
  letter-spacing: 2px;
  margin: 0 0 9px;
}
h1 {
  font-size: 28px;
  letter-spacing: -0.6px;
  margin: 0 0 8px;
  font-weight: 650;
}
h2 {
  font-size: 17px;
  margin: 0 0 18px;
}
h3 {
  font-size: 15px;
}
p {
  line-height: 1.75;
}
.muted {
  color: #6b808e;
  font-size: 12px;
}
.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 17px;
  margin: 22px 0;
}
.stat,
.card {
  background: white;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.stat {
  padding: 23px;
}
.stat .number {
  font-size: 29px;
  font-weight: 650;
  margin: 15px 0 5px;
  font-variant-numeric: tabular-nums;
}
.stat:first-child {
  background: #eaf4f1;
  border-color: #c6e1d9;
}
.stat .unit {
  font-size: 11px;
  color: #708780;
}
.card {
  padding: 24px;
  margin-bottom: 20px;
  min-width: 0;
}
.grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 20px;
}
.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.step span {
  display: grid;
  place-items: center;
  background: #edf5f3;
  border-radius: 9px;
  color: var(--accent);
  width: 32px;
  height: 32px;
  margin: 0 0 14px;
}
.toolbar {
  display: flex;
  gap: 12px;
  align-items: flex-end;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.toolbar label {
  min-width: 140px;
}
.toolbar input {
  min-width: 230px;
}
.toolbar .grow {
  flex: 1;
}
.tablewrap {
  overflow-x: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  white-space: nowrap;
}
th {
  font-size: 11px;
  font-weight: 500;
  color: #728390;
  background: #f7f9fb;
  padding: 13px 12px;
}
td {
  font-size: 12px;
  border-bottom: 1px solid #edf1f4;
  padding: 17px 12px;
}
td:first-child {
  font-weight: 550;
}
td.wrap {
  white-space: normal;
  min-width: 180px;
  max-width: 400px;
  overflow-wrap: anywhere;
}
td button {
  font-size: 11px;
  padding: 6px 9px;
  margin: 2px;
}
td small {
  color: #83949f;
  font-size: 10px;
  display: block;
  margin-top: 5px;
}
.tag {
  display: inline-block;
  border-radius: 5px;
  padding: 5px 8px;
  background: #edf4f3;
  color: #117b62;
  font-size: 10px;
}
.tag.warn {
  background: #fff0da;
  color: #996113;
}
.tag.bad {
  background: #fae9e7;
  color: #a9483b;
}
.empty {
  text-align: center;
  color: #7f929f;
  padding: 50px 20px;
}
.empty strong {
  display: block;
  font-weight: 500;
  color: #475f6d;
  margin: 10px;
}
.country {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 26px;
  background: #eef3f6;
  border-radius: 5px;
  font-size: 11px;
  letter-spacing: 1px;
  margin-right: 9px;
}
.price {
  font-variant-numeric: tabular-nums;
  font-weight: 650;
}
.actions {
  display: flex;
  gap: 9px;
  align-items: center;
  flex-wrap: wrap;
}
.note {
  font-size: 12px;
  color: #687d8a;
  background: #f4f8fa;
  padding: 14px;
  border-radius: 6px;
  line-height: 1.8;
}
.preline {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.auth {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
}
.authbrand {
  padding: 12vh 8vw;
  background: #102e36;
  color: white;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.authbrand .brand {
  margin: 0 0 55px;
}
.authbrand h1 {
  font-size: 42px;
  line-height: 1.4;
  max-width: 450px;
}
.authbrand p {
  color: #a2c4c8;
  max-width: 380px;
}
.authform {
  display: grid;
  place-items: center;
  padding: 30px;
}
.authform .card {
  width: 100%;
  max-width: 420px;
  padding: 36px;
}
.formstack {
  display: grid;
  gap: 20px;
}
.formstack button {
  margin-top: 6px;
}
.error {
  color: #a83838;
  font-size: 12px;
  min-height: 18px;
}
.authswitch {
  margin-top: 24px;
  font-size: 12px;
}
.loading {
  padding: 10vh;
  text-align: center;
  color: #66818e;
}
#toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  max-width: min(450px, 90vw);
  background: #153e45;
  color: white;
  padding: 14px 20px;
  border-radius: 8px;
  box-shadow: 0 5px 30px #0002;
  z-index: 20;
  display: none;
}
#toast.show {
  display: block;
}
dialog {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 28px;
  max-width: 620px;
  width: calc(100% - 32px);
  max-height: 85vh;
  overflow: auto;
  color: inherit;
}
dialog::backdrop {
  background: #102b3d70;
}
dialog h2 {
  margin-right: 30px;
}
.close {
  float: right;
  border: 0;
  padding: 0 4px;
  font-size: 22px;
}
.pager {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
  margin-top: 20px;
}
.code {
  padding: 15px;
  background: #f0f5f7;
  border-radius: 7px;
  overflow-wrap: anywhere;
  font-family: monospace;
  white-space: pre-wrap;
}
.footer {
  font-size: 10px;
  letter-spacing: 1px;
  color: #879aa6;
  margin-top: 28px;
}
.caps {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.mobilebrand {
  display: none;
}
@media (max-width: 1000px) {
  .stats {
    grid-template-columns: repeat(2, 1fr);
  }
  .grid {
    grid-template-columns: 1fr;
  }
  .workspace {
    padding: 24px;
  }
  .topbar {
    padding: 18px 24px;
  }
}
@media (max-width: 680px) {
  .shell {
    grid-template-columns: 1fr;
  }
  .sidebar {
    position: relative;
    height: auto;
    padding: 16px;
  }
  .brand {
    margin: 0 8px 15px;
    font-size: 20px;
  }
  .brand small {
    display: none;
  }
  .navlabel {
    margin: 16px 8px 7px;
  }
  .navgroup {
    display: flex;
    overflow: auto;
    gap: 3px;
  }
  .sidebar a {
    white-space: nowrap;
    padding: 9px;
    margin: 0;
    font-size: 12px;
  }
  .navicon {
    display: none;
  }
  .topbar {
    min-height: 60px;
    padding: 12px 18px;
  }
  .topbar .user {
    gap: 8px;
  }
  .user .muted,
  .avatar {
    display: none;
  }
  .workspace {
    padding: 22px 16px;
  }
  .stats {
    gap: 10px;
  }
  .stat {
    padding: 17px;
  }
  .stat .number {
    font-size: 25px;
  }
  .pagehead {
    align-items: flex-start;
    flex-wrap: wrap;
  }
  .pagehead > div {
    flex-basis: 100%;
  }
  h1 {
    font-size: 24px;
  }
  .card {
    padding: 18px;
  }
  .mode {
    font-size: 11px;
    margin-bottom: 22px;
  }
  .steps {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .step {
    display: grid;
    grid-template-columns: 35px 1fr;
    column-gap: 12px;
  }
  .step span {
    grid-row: span 2;
  }
  .step h3 {
    margin: 4px 0;
  }
  .step p {
    margin: 2px 0 16px;
  }
  .auth {
    grid-template-columns: 1fr;
  }
  .authbrand {
    padding: 30px;
  }
  .authbrand .brand {
    margin: 0 0 20px;
  }
  .authbrand h1 {
    font-size: 28px;
  }
  .authbrand p {
    display: none;
  }
  .authform {
    padding: 22px;
  }
  .authform .card {
    padding: 26px;
  }
  .toolbar input {
    min-width: 0;
    width: 100%;
  }
  .toolbar label {
    width: 100%;
  }
  .toolbar button {
    flex: 1;
  }
  .toolbar .grow {
    width: 100%;
  }
  .actions button {
    font-size: 12px;
  }
  .pagehead .muted {
    max-width: 100%;
  }
}
:root {
  scrollbar-color: #a6bdc6 transparent;
}
@media (max-width: 680px) {
  .navgroup {
    scrollbar-width: none;
  }
  .navgroup::-webkit-scrollbar {
    display: none;
  }
  #products .tablewrap {
    overflow: visible;
  }
  #products table,
  #products tbody {
    display: block;
  }
  #products thead {
    display: none;
  }
  #products tr {
    display: grid;
    grid-template-columns: 1fr 1fr;
    padding: 17px 0;
    border-top: 1px solid var(--line);
    gap: 12px;
  }
  #products td {
    display: block;
    padding: 0;
    border: 0;
    white-space: normal;
  }
  #products td:nth-child(1) {
    grid-column: 1/-1;
  }
  #products td:nth-child(2) {
    grid-column: 1/-1;
    font-size: 15px;
  }
  #products td:nth-child(3)::before {
    content: "卡类型 · ";
    color: #718591;
  }
  #products td:nth-child(4)::before {
    content: "库存 · ";
    color: #718591;
  }
  #products td:nth-child(5) {
    align-self: center;
  }
  #products td:nth-child(6) {
    text-align: right;
  }
  #products td button {
    padding: 9px 14px;
  }
}
:root .checkrow {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  margin: 10px 0;
}
:root fieldset {
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 16px;
  max-height: 250px;
  overflow: auto;
}

/* Customer workspace: preserve the existing teal brand and business controls. */
.header-balance { font-weight: 650; font-variant-numeric: tabular-nums; padding: 8px 12px; background: #eaf4f1; border: 1px solid #c6e1d9; border-radius: 7px; white-space: nowrap; }
.mobile-menu, .mobile-primary { display: none; }
.section-title { display: flex; gap: 16px; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.section-title h2 { margin: 0; }
.purchase-workspace { display: grid; grid-template-columns: 256px minmax(0, 1fr); align-items: start; gap: 20px; }
.catalog-filters { position: sticky; top: 24px; }
.catalog-filters #search { display: grid; gap: 16px; }
.catalog-filters #search label, .catalog-filters #search input { width: 100%; min-width: 0; }
.catalog-filters #search .grow { order: 1; }
.catalog-filters #search label:has([name="country"]) { order: 2; }
.catalog-filters #search label:has([name="cardType"]) { order: 3; }
.catalog-advanced { order: 4; }
.catalog-filters #search > button { order: 5; }
summary { cursor: pointer; color: var(--accent); font-weight: 550; padding: 10px 0; }
summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.catalog-advanced label { margin: 8px 0; }
.catalog-wallet { display: grid; gap: 8px; padding-top: 20px; border-top: 1px solid var(--line); font-size: 12px; color: #536d78; }
.catalog-wallet strong { font-size: 22px; color: #172b3a; font-variant-numeric: tabular-nums; }
.catalog-count { margin: 0 0 12px; color: #536d78; font-size: 12px; }
.product-option { display: grid; grid-template-columns: minmax(180px, 1fr) 84px 130px auto; gap: 18px; align-items: center; padding: 18px 0; border-top: 1px solid var(--line); }
.product-identity { display: flex; align-items: center; gap: 12px; min-width: 0; }
.product-identity .country { flex-shrink: 0; min-width: 38px; text-align: center; }
.product-identity h3 { margin: 0 0 6px; font-size: 14px; overflow-wrap: anywhere; }
.product-identity p { margin: 0; font-size: 12px; color: #536d78; }
.product-stock, .product-price { display: grid; gap: 8px; font-variant-numeric: tabular-nums; }
.product-price strong { color: var(--accent); font-size: 16px; }
.product-option button { min-height: 42px; }
.product-option button:disabled { cursor: not-allowed; background: #e8edef; border-color: #e1e8ee; color: #536d78; opacity: 1; }
.purchase-summary { padding: 18px; background: #edf6f3; border: 1px solid #c6e1d9; border-radius: 9px; }
.purchase-summary > span, .purchase-summary small { display: block; color: #536d78; font-size: 12px; }
.purchase-summary h3 { margin: 8px 0; font-size: 20px; }
.purchase-summary p { margin: 0 0 10px; }
.purchase-summary > strong { display: block; font-size: 24px; margin-bottom: 6px; color: var(--accent); }
.order-advanced { flex-basis: 100%; order: 4; border-top: 1px solid var(--line); }
.order-advanced .toolbar { margin: 10px 0; }
.customer-orders #ordersearch > button { min-height: 42px; }
.customer-orders .number-phone { display: block; font-size: 15px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.copy-phone { margin: 8px 0 0; padding: 6px 10px; font-size: 12px; }
.customer-orders .number-actions { max-width: 350px; white-space: normal; }
.customer-orders .number-actions [data-action="messages"] { background: var(--accent); color: white; border-color: var(--accent); }
.customer-orders td { vertical-align: top; }
.wallet-overview { grid-template-columns: 0.85fr 1.3fr; align-items: stretch; }
.wallet-balance { background: #edf6f3; border-color: #c6e1d9; }
.wallet-amount { font-size: clamp(28px, 3vw, 40px); font-weight: 650; margin: 16px 0 18px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.wallet-balance .note { margin-top: 24px; background: #fff9; }
.wallet-recharge #topupform { gap: 12px; }
.sms-number { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 14px 0; }
.sms-number > .muted { flex-basis: 100%; }
.sms-number > strong { font-size: 25px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.verification-code { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; white-space: normal; }
.verification-code strong { font-size: 27px; letter-spacing: 3px; color: var(--accent); font-variant-numeric: tabular-nums; }
.verification-code button, #copyphone, #refreshmessages { min-height: 42px; }
@media (min-width: 681px) and (max-width: 1200px) {
  .purchase-workspace { grid-template-columns: 220px minmax(0, 1fr); gap: 14px; }
  .product-option { grid-template-columns: minmax(0, 1fr) auto; gap: 14px; }
  .product-stock, .product-price { display: flex; justify-content: space-between; grid-row: 2; }
  .product-identity { grid-column: 1 / -1; }
}
@media (max-width: 680px) {
  .customer-shell { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
  .customer-shell .sidebar { padding: 14px 16px; }
  .customer-shell .brand { font-size: 21px; margin: 0; letter-spacing: 2px; }
  .customer-shell .sidebar > .navlabel, .customer-shell .sidebar > .navgroup { display: none; }
  .customer-shell .sidebar.menu-open > .navlabel { display: block; }
  .customer-shell .sidebar.menu-open > .navgroup { display: flex; flex-wrap: wrap; }
  .customer-shell .mobile-menu { display: block; float: right; padding: 7px 10px; background: transparent; color: #deeeeb; border-color: #527078; }
  .customer-shell .topbar { padding: 10px 16px; min-height: 58px; }
  .customer-shell .topbar > strong { font-size: 12px; }
  .customer-shell .topbar .username { display: none; }
  .header-balance { padding: 7px 9px; font-size: 12px; }
  .customer-shell .workspace { padding-top: 16px; }
  .customer-shell .mode { margin-bottom: 18px; gap: 8px; }
  .customer-shell .mode .dot { flex-shrink: 0; }
  .customer-shell .pagehead { margin-bottom: 18px; gap: 10px; }
  .customer-shell .eyebrow { font-size: 9px; }
  .customer-shell .pagehead .eyebrow { display: none; }
  .customer-shell .pagehead h1 { font-size: 23px; }
  .mobile-primary { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); position: fixed; bottom: 0; left: 0; right: 0; padding: 8px 10px calc(8px + env(safe-area-inset-bottom)); background: #fff; border-top: 1px solid var(--line); z-index: 10; box-shadow: 0 -4px 20px #102e3608; }
  .mobile-primary a { display: grid; place-items: center; min-height: 42px; color: #536d78; font-size: 12px; border-radius: 7px; }
  .mobile-primary a[aria-current="page"] { color: var(--accent); background: #eaf4f1; font-weight: 650; }
  .purchase-workspace { display: block; }
  .catalog-filters { position: static; padding: 16px; margin-bottom: 14px; }
  .catalog-filters h2 { display: none; }
  .catalog-filters .eyebrow { margin-bottom: 12px; }
  .catalog-filters #search { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; margin-bottom: 0; }
  .catalog-filters #search .grow, .catalog-advanced { grid-column: 1 / -1; }
  .catalog-filters #search label { font-size: 12px; }
  .catalog-filters #search input, .catalog-filters #search select { width: 100%; min-width: 0; min-height: 42px; }
  .catalog-wallet, .catalog-filters > .muted { display: none; }
  .catalog-advanced summary { padding: 2px 0; font-size: 12px; }
  .catalog-results { padding: 16px; }
  .section-title { gap: 8px; align-items: baseline; flex-wrap: wrap; }
  .section-title h2 { font-size: 16px; }
  .catalog-results .section-title .eyebrow { display: none; }
  .product-option { grid-template-columns: minmax(0,1fr) auto; gap: 12px; padding: 17px 0; }
  .product-identity { grid-column: 1 / -1; }
  .product-stock { grid-row: 2; display: flex; gap: 8px; justify-content: flex-start; }
  .product-price { grid-row: 3; gap: 4px; }
  .product-option > button { grid-column: 2; grid-row: 2 / 4; min-height: 44px; }
  .order-advanced { width: 100%; }
  .customer-orders { padding: 16px; }
  .customer-orders #ordersearch { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
  .customer-orders #ordersearch > .grow, .customer-orders #ordersearch > label:has(select), .order-advanced { grid-column: 1 / -1; }
  .customer-orders #ordersearch label { min-width: 0; }
  .customer-orders #ordersearch input, .customer-orders #ordersearch select { min-height: 42px; width: 100%; }
  .customer-orders .tablewrap, .wallet-history .tablewrap, .wallet-ledger .tablewrap { overflow: visible; }
  .customer-orders table, .customer-orders tbody, .wallet-history table, .wallet-history tbody, .wallet-ledger table, .wallet-ledger tbody { display: block; min-width: 0; }
  .customer-orders thead, .wallet-history thead, .wallet-ledger thead { display: none; }
  .customer-orders tr, .wallet-history tr, .wallet-ledger tr { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; padding: 18px 0; border-top: 1px solid var(--line); }
  .customer-orders td, .wallet-history td, .wallet-ledger td { display: block; border: 0; padding: 0; min-width: 0; white-space: normal; overflow-wrap: anywhere; }
  .customer-orders td::before, .wallet-history td::before, .wallet-ledger td::before { content: attr(data-label); display: block; color: #536d78; font-size: 11px; margin-bottom: 6px; }
  .customer-orders td:first-child, .customer-orders td:nth-child(2), .customer-orders td:nth-child(5), .customer-orders td:last-child, .wallet-history td:nth-child(4), .wallet-history td:nth-child(5), .wallet-history td:last-child, .wallet-ledger td:nth-child(5), .wallet-ledger td:last-child, td.empty { grid-column: 1 / -1; }
  .customer-orders .number-phone { display: inline; font-size: 21px; }
  .customer-orders .copy-phone { float: right; margin: 0; min-height: 40px; }
  .customer-orders .number-actions { max-width: none; }
  .customer-orders .number-actions button { margin: 0 4px 6px 0; min-height: 40px; }
  .customer-orders .number-actions [data-action="messages"] { min-width: 115px; }
  .wallet-overview { display: grid; grid-template-columns: 1fr; gap: 0; }
  .wallet-balance .eyebrow { display: none; }
  .wallet-amount { margin: 8px 0 12px; font-size: 31px; }
  .wallet-balance .note { margin: 14px 0 0; }
  .wallet-history .toolbar, .wallet-ledger .toolbar { gap: 12px; }
  .wallet-history button, .wallet-ledger button { min-height: 40px; }
  .sms-number strong { font-size: 23px; }
  .verification-code { gap: 8px; }
  .verification-code > span { flex-basis: 100%; }
  dialog { padding: 20px; }
  #toast { bottom: calc(80px + env(safe-area-inset-bottom)); }
}
@media (min-width: 900px) {
  #modal:has(#buyform) { max-width: 900px; }
  #modal:has(#buyform) .purchase-summary { float: right; width: 33%; margin-left: 24px; position: sticky; top: 0; }
  #modal:has(#buyform) > p, #buyform { width: 62%; }
}
@media (max-width: 680px) {
  .customer-orders #ordersearch { grid-template-columns: minmax(0,1fr) auto auto; }
  .customer-orders #ordersearch > label:has(select) { grid-column: 1; }
  .customer-orders #ordersearch > button { padding-inline: 10px; }
  .customer-orders .copy-phone { min-height: 44px; }
}
@media (max-width: 680px) {
  .customer-shell .topbar .user > .header-balance { display: inline-block; }
}

/* Business-fit refinements: presentation only; existing handlers and permissions stay intact. */
.product-identity .product-term { margin-top: 7px; color: #405b66; font-size: 12px; }
.product-identity .product-notice { margin-top: 6px; color: #715215; font-size: 12px; }
.product-price small { font-size: 11px; color: #536d78; line-height: 1.5; }
.purchase-summary .product-term { margin: 12px 0; font-size: 12px; line-height: 1.6; }
.purchase-extra { border: 1px solid var(--line); border-radius: 7px; padding: 0 12px; }
.purchase-extra .formstack { margin: 8px 0 16px; }
.number-primary { margin-bottom: 4px; }
.number-primary > button { min-height: 44px; min-width: 112px; }
.order-secondary { min-width: 0; }
.order-secondary summary { font-size: 12px; min-height: 40px; }
.secondary-actions { display: flex; gap: 6px; flex-wrap: wrap; padding: 6px 0; }
.secondary-actions button { margin: 0; }
.sms-state-note { border-left: 3px solid var(--accent); padding: 8px 12px; background: #edf6f3; line-height: 1.7; font-size: 12px; }
#modal:has(.sms-number) .close { width: 44px; height: 44px; margin-top: -10px; margin-right: -8px; }
@media (max-width: 680px) {
  .catalog-filters { padding: 12px; }
  .catalog-filters > .eyebrow { display: none; }
  .catalog-filters #search { gap: 8px; }
  .catalog-filters #search > button { min-height: 42px; }
  .product-option { gap: 10px; }
  .product-option .product-price { grid-row: 2; }
  .product-option .product-stock { grid-row: 3; font-size: 12px; }
  .product-price strong { font-size: 18px; }
  .customer-orders .number-primary > button { width: 100%; font-size: 14px; margin: 0; }
  .customer-orders .order-secondary summary { min-height: 44px; }
  .customer-orders .secondary-actions { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); }
  .customer-orders .secondary-actions button { width: 100%; min-height: 44px; margin: 0; }
  .sms-number > strong { font-size: 25px; }
  .verification-code > strong { font-size: 30px; }
  #buyform .purchase-extra summary { min-height: 44px; }
}
