:root {
  --portal-ink: #151514;
  --portal-paper: #f4f2eb;
  --portal-card: #ffffff;
  --portal-line: #d9d5ca;
  --portal-muted: #706e68;
  --portal-accent: #c9ff39;
  --portal-orange: #f39800;
}

/* Policy document */
.policy-body { background: #f4f2eb; }
.policy-shell { width: min(1120px, calc(100% - 48px)); margin: 0 auto; padding: 46px 0 100px; }
.policy-back { display: inline-block; margin-bottom: 30px; color: #66645e; font-size: 11px; font-weight: 800; letter-spacing: .08em; }
.policy-document { border-top: 1px solid #c9c7bf; }
.policy-heading { padding: 58px 0 70px; }
.policy-heading > span { color: #77746c; font-size: 10px; font-weight: 800; letter-spacing: .18em; }
.policy-heading h1 { max-width: 930px; margin: 22px 0 26px; font-family: var(--font-display); font-size: clamp(48px, 7.2vw, 96px); font-weight: 900; line-height: .88; letter-spacing: -.055em; }
html[lang="zh-CN"] .policy-heading h1 { line-height: 1.02; letter-spacing: -.04em; }
.policy-heading p { margin: 0; color: #6d6a63; font-size: 15px; }
.policy-document > section { display: grid; grid-template-columns: 90px minmax(0, 1fr); gap: 26px; padding: 52px 0; border-top: 1px solid #d5d2c9; }
.policy-number { color: #8b887f; font-family: Consolas, monospace; font-size: 13px; font-weight: 700; }
.policy-document h2 { margin: -8px 0 26px; font-family: var(--font-display); font-size: clamp(27px, 3.2vw, 43px); line-height: 1.05; letter-spacing: -.035em; }
.policy-document h3 { margin: 30px 0 13px; font-size: 13px; text-transform: uppercase; letter-spacing: .08em; }
.policy-document p, .policy-document li { color: #55534d; font-size: 15px; line-height: 1.9; }
.policy-document p { margin: 0 0 18px; }
.policy-document ul { margin: 12px 0 24px; padding-left: 21px; }
.policy-document li { padding-left: 5px; margin-bottom: 7px; }
.policy-markets { margin: 0 0 28px; padding: 20px 22px; border-left: 4px solid #bfff2b; background: #111; color: #fff; }
.policy-markets strong { font-size: 10px; letter-spacing: .13em; }
.policy-markets p { margin: 9px 0 0; color: #fff; font-size: 14px; line-height: 1.65; }
.policy-times { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; margin: 0 0 28px; padding: 1px; background: #d7d4ca; }
.policy-times > div { min-height: 116px; padding: 22px; background: #fff; }
.policy-times dt { color: #77746c; font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.policy-times dd { margin: 17px 0 0; color: #111; font-size: 18px; font-weight: 800; }
@media (max-width: 720px) {
  .policy-shell { width: min(100% - 28px, 1120px); padding: 28px 0 72px; }
  .policy-heading { padding: 38px 0 48px; }
  .policy-heading h1 { font-size: clamp(43px, 13vw, 64px); }
  .policy-document > section { grid-template-columns: 1fr; gap: 17px; padding: 38px 0; }
  .policy-document h2 { margin: 0 0 22px; }
  .policy-times { grid-template-columns: 1fr; }
  .policy-times > div { min-height: 0; }
  .policy-document p, .policy-document li { font-size: 14px; line-height: 1.82; }
}

.portal-body { min-height: 100vh; background: var(--portal-paper); }
.portal-shell { width: min(1220px, calc(100% - 48px)); margin: 0 auto; padding: 48px 0 90px; }
.portal-topbar { min-height: 74px; position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; padding: 12px 28px; border-bottom: 1px solid var(--portal-line); background: rgba(244,242,235,.94); backdrop-filter: blur(14px); }
.portal-logo { width: min(225px, 48vw); display: block; line-height: 0; }
.portal-logo img { width: 100%; }
.portal-nav { display: flex; align-items: center; gap: 8px; }
.portal-nav a { padding: 10px 13px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.portal-nav a:hover, .portal-nav a.is-active { background: #171716; color: #fff; }
.portal-back { display: inline-flex; align-items: center; gap: 8px; color: var(--portal-muted); font-size: 12px; font-weight: 700; }
.portal-back:hover { color: var(--portal-ink); }

.portal-heading { display: flex; align-items: end; justify-content: space-between; gap: 28px; margin-bottom: 34px; }
.portal-heading h1 { margin: 7px 0 0; font-size: clamp(36px, 6vw, 68px); line-height: .95; letter-spacing: -.065em; }
.portal-heading p { max-width: 470px; margin: 0; color: var(--portal-muted); line-height: 1.7; }
.portal-eyebrow { color: #7d7a72; font-size: 10px; font-weight: 900; letter-spacing: .18em; text-transform: uppercase; }

.portal-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(330px, .65fr); gap: 28px; align-items: start; }
.portal-card { padding: 28px; border: 1px solid var(--portal-line); background: var(--portal-card); box-shadow: 0 18px 55px rgba(24,23,19,.05); }
.portal-card + .portal-card { margin-top: 20px; }
.portal-grid > .portal-card { margin-top: 0; }
.portal-card h2, .portal-card h3 { margin: 0; }
.portal-card-head { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.portal-card-head p { margin: 4px 0 0; color: var(--portal-muted); font-size: 12px; }
.portal-step { width: auto; min-width: 31px; height: 31px; display: grid; place-items: center; padding: 0 10px; border-radius: 999px; background: var(--portal-ink); color: #fff; font-size: 10px; font-weight: 900; line-height: 1; white-space: nowrap; }

.portal-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 17px; }
.portal-field { display: flex; flex-direction: column; gap: 7px; }
.portal-field.is-wide { grid-column: 1 / -1; }
.portal-field span { font-size: 11px; font-weight: 800; }
.portal-field input, .portal-field select, .portal-field textarea, .portal-input { width: 100%; min-height: 48px; padding: 12px 14px; border: 1px solid #cbc7bb; border-radius: 0; outline: none; background: #fbfaf7; color: var(--portal-ink); font: inherit; }
.portal-field textarea { min-height: 92px; resize: vertical; }
.portal-field input:focus, .portal-field select:focus, .portal-field textarea:focus, .portal-input:focus { border-color: #111; box-shadow: 0 0 0 2px rgba(201,255,57,.65); }
.portal-help { margin: 8px 0 0; color: var(--portal-muted); font-size: 11px; line-height: 1.6; }

.attribution-box { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px; padding: 16px 18px; border: 1px solid #b7de4c; background: #efffc7; }
.attribution-box strong { display: block; margin-bottom: 4px; }
.attribution-box span { color: #5a604b; font-size: 11px; }
.attribution-box.is-direct { border-color: var(--portal-line); background: #f4f2eb; }
.attribution-code { padding: 7px 10px; background: #111; color: #fff !important; font-family: Consolas, monospace; }

.checkout-items { display: flex; flex-direction: column; gap: 15px; }
.checkout-item { display: grid; grid-template-columns: 74px 1fr auto; gap: 14px; align-items: center; padding-bottom: 15px; border-bottom: 1px solid #ece9e0; }
.checkout-item img { width: 74px; height: 74px; object-fit: contain; background: #f0eee7; }
.checkout-item strong { display: block; font-size: 13px; }
.checkout-item small { display: block; margin-top: 5px; color: var(--portal-muted); }
.checkout-item > span { font-weight: 900; }
.checkout-empty { padding: 55px 20px; text-align: center; color: var(--portal-muted); }

.summary-lines { display: flex; flex-direction: column; gap: 13px; padding: 19px 0; border-block: 1px solid var(--portal-line); }
.summary-line { display: flex; justify-content: space-between; gap: 20px; color: var(--portal-muted); font-size: 12px; }
.summary-line strong { color: var(--portal-ink); }
.summary-total { display: flex; justify-content: space-between; align-items: end; margin: 20px 0; }
.summary-total span { font-size: 12px; font-weight: 800; }
.summary-total strong { font-size: 32px; letter-spacing: -.04em; }
.coupon-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin-top: 18px; }

.portal-button { min-height: 50px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 22px; border: 1px solid var(--portal-ink); background: var(--portal-ink); color: #fff; cursor: pointer; font: inherit; font-size: 12px; font-weight: 900; }
.portal-button:hover { background: #343431; }
.portal-button.is-accent { border-color: var(--portal-accent); background: var(--portal-accent); color: #111; }
.portal-button.is-accent:hover { background: #d8ff70; }
.portal-button.is-light { border-color: var(--portal-line); background: #fff; color: var(--portal-ink); }
.portal-button.is-danger { border-color: #c43b32; background: #c43b32; }
.portal-button:disabled { opacity: .45; cursor: not-allowed; }
.portal-button[hidden] { display: none; }
.portal-button.is-full { width: 100%; }
.portal-link-button { border: 0; background: none; color: var(--portal-ink); cursor: pointer; font-weight: 800; text-decoration: underline; }

.payment-layout { display: grid; grid-template-columns: minmax(320px, .8fr) minmax(0, 1.2fr); gap: 28px; align-items: start; }
.bill-sheet { padding: 30px; border: 1px solid var(--portal-line); background: #fff; box-shadow: 0 18px 55px rgba(24,23,19,.06); }
.bill-head { display: flex; align-items: start; justify-content: space-between; gap: 20px; margin-bottom: 22px; padding-bottom: 20px; border-bottom: 1px solid var(--portal-line); }
.bill-head h2 { margin: 7px 0 0; font-family: Consolas, monospace; font-size: 22px; }
.service-card { padding: 36px; position: sticky; top: 100px; border: 1px solid #a9d737; background: #efffc8; text-align: center; }
.service-card h2 { margin: 14px 0 9px; font-size: 28px; }
.service-card > p { color: #5e654e; line-height: 1.75; }
.service-card .portal-button + .portal-button { margin-top: 10px; }
.service-avatar { width: 78px; height: 78px; display: grid; place-items: center; margin: 18px auto 0; border-radius: 50%; background: #111; color: var(--portal-accent); font-size: 23px; font-weight: 950; }
.service-avatar.is-small { width: 45px; height: 45px; margin: 0; font-size: 13px; }
.service-bill-code { margin: 22px 0; padding: 17px; border: 1px dashed #8faa46; background: #fff; }
.service-bill-code small { display: block; margin-bottom: 6px; color: var(--portal-muted); }
.service-bill-code strong { font-family: Consolas, monospace; font-size: 20px; }
.payment-qr-wrap { padding: 36px; background: #10100f; color: #fff; text-align: center; }
.payment-qr { width: min(285px, 100%); margin: 24px auto; padding: 18px; background: #fff; }
.payment-qr img { width: 100%; }
.payment-amount { font-size: 44px; font-weight: 950; letter-spacing: -.05em; }
.payment-order { color: #aaa; font-family: Consolas, monospace; font-size: 12px; }
.payment-warning { margin-top: 20px; padding: 14px; border: 1px solid #4c4c48; color: #d3d3cf; font-size: 11px; line-height: 1.7; }
.payment-qr-demo { width: min(230px, 100%); margin: 18px 0; padding: 12px; border: 1px solid #d3d0c5; background: #fff; text-align: center; }
.payment-qr-demo img { display: block; width: 100%; height: auto; }
.payment-qr-demo span { display: block; margin-top: 8px; color: #555; font-size: 9px; font-weight: 800; letter-spacing: .08em; }

.service-workspace { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(330px, .75fr); gap: 28px; align-items: start; }
.service-chat { padding: 0; overflow: hidden; }
.service-chat-head { display: flex; align-items: center; gap: 13px; padding: 20px 24px; border-bottom: 1px solid var(--portal-line); background: #faf9f5; }
.service-chat-head > div:nth-child(2) { flex: 1; }
.service-chat-head strong, .service-chat-head span { display: block; }
.service-chat-head span { margin-top: 3px; color: var(--portal-muted); font-size: 10px; }
.service-chat-head i { width: 7px; height: 7px; display: inline-block; margin-right: 4px; border-radius: 50%; background: #53a91f; }
.chat-messages { min-height: 400px; display: flex; flex-direction: column; gap: 15px; padding: 28px; background: #f3f1ea; }
.live-chat-messages { height: min(460px, 54vh); min-height: 330px; overflow-y: auto; scroll-behavior: smooth; }
.chat-message { max-width: 78%; padding: 14px 16px; border: 1px solid #dedad0; background: #fff; }
.chat-message.is-customer { align-self: flex-end; border-color: #acd544; background: #efffc8; }
.chat-message.is-system { max-width: 92%; align-self: center; padding: 8px 12px; border: 0; border-radius: 999px; background: #dedbd2; color: #66635d; text-align: center; }
.chat-message small { color: var(--portal-muted); font-size: 9px; }
.chat-message p { margin: 6px 0 0; font-size: 12px; line-height: 1.65; }
.chat-message.is-system p { margin: 0; font-size: 10px; }
.chat-image { display: block; width: min(260px, 100%); max-height: 340px; margin-top: 9px; object-fit: contain; background: #fff; }
.chat-composer { padding: 20px 28px; border-top: 1px solid var(--portal-line); background: #fff; }
.chat-composer textarea { width: 100%; min-height: 74px; padding: 12px 14px; border: 1px solid #cbc7bb; outline: none; resize: vertical; font: inherit; }
.chat-composer textarea:focus { border-color: #111; box-shadow: 0 0 0 2px rgba(201,255,57,.65); }
.chat-composer-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 10px; }
.chat-composer-actions .portal-button { min-height: 42px; }
.chat-attach { position: relative; overflow: hidden; }
.chat-attach input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.service-chat > .portal-button { margin: 0 28px 28px; }
.service-proof { margin: 0 28px 28px; padding-top: 24px; border-top: 1px solid var(--portal-line); }
.bill-mini { position: sticky; top: 100px; }
.bill-mini .checkout-item { grid-template-columns: 54px 1fr; }
.bill-mini .checkout-item img { width: 54px; height: 54px; }
.bill-mini .checkout-item > span { grid-column: 2; }
.upload-box { display: grid; place-items: center; min-height: 190px; padding: 24px; border: 2px dashed #bdb8aa; background: #faf9f5; text-align: center; cursor: pointer; }
.upload-box input { position: absolute; width: 1px; height: 1px; overflow: hidden; opacity: 0; }
.upload-box strong { display: block; margin-bottom: 6px; }
.upload-box span { color: var(--portal-muted); font-size: 11px; }
.upload-box.has-file { border-color: #68a616; background: #f0ffd8; }
.upload-box + .portal-link-button { display: inline-block; margin-top: 14px; }
.portal-card > label.portal-help { display: block; margin: 14px 0; }

.status-pill { display: inline-flex; align-items: center; gap: 7px; padding: 7px 10px; border-radius: 999px; background: #eee; font-size: 10px; font-weight: 900; }
.status-pill::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: #888; }
.status-pill[data-tone="warning"] { background: #fff1bd; }
.status-pill[data-tone="warning"]::before { background: #d58a00; }
.status-pill[data-tone="success"] { background: #dff5cd; }
.status-pill[data-tone="success"]::before { background: #3e921d; }
.status-pill[data-tone="info"] { background: #dcecff; }
.status-pill[data-tone="info"]::before { background: #3379cb; }
.status-pill[data-tone="danger"] { background: #ffe0dc; }
.status-pill[data-tone="danger"]::before { background: #c33b30; }

/* Order-connected customer service workspace */
.support-center-card { margin-bottom: 28px; padding: 0; overflow: hidden; }
.support-center-card > .portal-card-head { margin: 0; padding: 26px 28px; border-bottom: 1px solid var(--portal-line); }
.support-admin-workspace { min-height: 610px; display: grid; grid-template-columns: minmax(270px, 340px) minmax(0, 1fr); }
.support-conversation-list { max-height: 690px; overflow-y: auto; border-right: 1px solid var(--portal-line); background: #f7f5ef; }
.support-conversation { width: 100%; display: grid; grid-template-columns: 1fr auto; gap: 7px 12px; padding: 17px 18px; border: 0; border-bottom: 1px solid var(--portal-line); background: transparent; color: inherit; cursor: pointer; text-align: left; font: inherit; }
.support-conversation:hover, .support-conversation.is-active { background: #fff; }
.support-conversation.is-active { box-shadow: inset 4px 0 0 var(--portal-accent); }
.support-conversation strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.support-conversation time { color: #8b887f; font-size: 9px; }
.support-conversation p { grid-column: 1 / -1; min-width: 0; margin: 0; overflow: hidden; color: var(--portal-muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.support-conversation-meta { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 8px; color: #77746d; font-size: 9px; }
.support-unread { min-width: 20px; height: 20px; display: inline-grid; place-items: center; padding: 0 6px; border-radius: 999px; background: #111; color: var(--portal-accent); font-size: 9px; font-weight: 900; }
.support-empty, .support-panel-empty { min-height: 240px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 28px; color: var(--portal-muted); text-align: center; }
.support-panel-empty strong { color: var(--portal-ink); font-size: 17px; }
.support-panel-empty span { max-width: 380px; font-size: 11px; line-height: 1.6; }
.support-active-head { min-height: 74px; display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 13px 20px; border-bottom: 1px solid var(--portal-line); }
.support-active-head strong, .support-active-head span { display: block; }
.support-active-head span { margin-top: 4px; color: var(--portal-muted); font-size: 10px; }
.support-head-actions { display: flex; gap: 7px; }
.support-head-actions .portal-button { min-height: 38px; padding: 0 13px; font-size: 9px; }
.support-chat-messages { height: 410px; min-height: 330px; overflow-y: auto; }
.support-chat-messages .chat-message.is-staff { align-self: flex-end; border-color: #acd544; background: #efffc8; }
.support-chat-messages .chat-message.is-customer { align-self: flex-start; border-color: #dedad0; background: #fff; }
.support-composer { padding: 16px 20px; }
.support-composer textarea { min-height: 64px; }

.lookup-form { display: grid; grid-template-columns: 1fr 1fr auto; gap: 10px; margin-bottom: 28px; }
.order-result[hidden] { display: none; }
.order-header { display: flex; align-items: start; justify-content: space-between; gap: 18px; padding-bottom: 22px; border-bottom: 1px solid var(--portal-line); }
.order-header h2 { margin: 5px 0 0; font-family: Consolas, monospace; }
.order-meta { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; margin: 22px 0; background: var(--portal-line); border: 1px solid var(--portal-line); }
.order-meta div { padding: 16px; background: #fff; }
.order-meta small, .metric-card small { display: block; margin-bottom: 7px; color: var(--portal-muted); font-size: 10px; }
.order-meta strong { font-size: 12px; }
.timeline { position: relative; display: flex; flex-direction: column; gap: 0; }
.timeline-item { position: relative; display: grid; grid-template-columns: 18px 1fr auto; gap: 12px; padding: 0 0 22px; }
.timeline-item::before { content: ''; position: absolute; left: 8px; top: 15px; bottom: 0; width: 1px; background: #d5d1c6; }
.timeline-item:last-child::before { display: none; }
.timeline-dot { width: 17px; height: 17px; position: relative; z-index: 1; border: 4px solid #fff; border-radius: 50%; background: #111; box-shadow: 0 0 0 1px #111; }
.timeline-item strong { display: block; font-size: 12px; }
.timeline-item p { margin: 5px 0 0; color: var(--portal-muted); font-size: 11px; }
.timeline-item time { color: #999; font-size: 9px; }

.metric-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 26px; }
.metric-card { min-height: 124px; padding: 20px; border: 1px solid var(--portal-line); background: #fff; }
.metric-card strong { display: block; font-size: 29px; letter-spacing: -.04em; }
.metric-card span { display: block; margin-top: 10px; color: var(--portal-muted); font-size: 10px; }

.portal-tabs { display: flex; gap: 8px; margin-bottom: 20px; overflow-x: auto; }
.portal-tabs button { white-space: nowrap; padding: 10px 14px; border: 1px solid var(--portal-line); background: #fff; cursor: pointer; font-size: 11px; font-weight: 800; }
.portal-tabs button.is-active { border-color: #111; background: #111; color: #fff; }
.order-list { display: flex; flex-direction: column; gap: 14px; }
.manage-order { padding: 22px; border: 1px solid var(--portal-line); background: #fff; }
.manage-order-head { display: flex; justify-content: space-between; gap: 20px; }
.manage-order-head h3 { margin: 5px 0 0; font-family: Consolas, monospace; font-size: 17px; }
.manage-order-summary { display: grid; grid-template-columns: 1.1fr 1fr 1fr 1fr; gap: 16px; margin: 19px 0; padding: 15px 0; border-block: 1px solid #e4e1d8; font-size: 11px; }
.manage-order-summary span { display: block; margin-bottom: 5px; color: var(--portal-muted); }
.manage-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.manage-actions .portal-button { min-height: 38px; padding: 0 13px; font-size: 10px; }
.manage-actions select, .manage-actions input { min-height: 38px; padding: 0 10px; border: 1px solid var(--portal-line); background: #fff; }
.empty-state { padding: 70px 24px; border: 1px dashed #bbb6aa; text-align: center; color: var(--portal-muted); }

.ref-card { padding: 25px; border: 1px solid #a9d737; background: #efffc8; }
.ref-link { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin: 15px 0; }
.ref-link input { min-width: 0; padding: 12px; border: 1px solid #a4bd67; background: #fff; font-family: Consolas, monospace; font-size: 11px; }
.demo-qr { width: 180px; height: 180px; display: grid; place-items: center; margin: 18px auto 0; padding: 14px; background: #fff; }
.demo-qr img { width: 100%; height: 100%; }
.dealer-selector { display: flex; align-items: center; gap: 12px; }
.dealer-selector select { padding: 10px 12px; border: 1px solid var(--portal-line); background: #fff; }
.notice { padding: 14px 16px; border-left: 4px solid var(--portal-orange); background: #fff4dd; color: #695a3c; font-size: 11px; line-height: 1.7; }

.auth-shell { max-width: 1100px; }
.auth-card { width: min(780px, 100%); margin-inline: auto; }
.auth-success { text-align: center; }
.auth-success h2 { margin: 12px 0; font-size: 36px; }
.success-mark { width: 78px; height: 78px; display: grid; place-items: center; margin: 0 auto 20px; border-radius: 50%; background: var(--portal-accent); font-size: 36px; font-weight: 950; }
.auth-actions { display: flex; justify-content: center; gap: 10px; margin-top: 24px; }
.auth-layout { min-height: 610px; display: grid; grid-template-columns: 1fr minmax(360px, .72fr); gap: 45px; align-items: center; }
.auth-intro h1 { margin: 10px 0 20px; font-size: clamp(52px, 7vw, 88px); line-height: .9; letter-spacing: -.07em; }
.auth-intro > p { max-width: 560px; color: var(--portal-muted); font-size: 15px; line-height: 1.8; }
.demo-credentials { width: min(410px, 100%); display: flex; flex-direction: column; gap: 7px; margin-top: 30px; padding: 20px; border: 1px solid #a8d63c; background: #efffc8; }
.demo-credentials code { padding: 8px 10px; background: #fff; font-size: 12px; }
.auth-login-card { display: flex; flex-direction: column; gap: 16px; text-align: left; }
.auth-login-card .service-avatar { margin-top: 0; }
.auth-login-card h2 { margin: 0 0 6px; text-align: center; }
.auth-login-card .portal-button + .portal-button { margin-top: -6px; }
.account-shell { max-width: 1180px; }
.account-auth-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: start; }
.account-auth-grid .auth-login-card { width: 100%; margin: 0; }
.account-message { min-height: 18px; margin: 0; color: #a22f25; }
.account-profile { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 30px; }
.account-profile h2 { margin: 5px 0; font-size: 32px; }
.account-profile p { margin: 0; color: var(--portal-muted); }
.account-orders-head { align-items: end; margin-bottom: 18px; }
.account-order-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.account-order-card .manage-order-summary { grid-template-columns: 1fr 1fr 1fr; }
@media (max-width: 760px) {
  .account-auth-grid, .account-order-list { grid-template-columns: 1fr; }
  .account-profile, .account-orders-head { align-items: stretch; flex-direction: column; }
}
.dealer-account { display: flex; align-items: center; gap: 12px; }
.dealer-account > div { display: flex; flex-direction: column; }
.dealer-account small { color: var(--portal-muted); font-size: 9px; }
.dealer-account strong { font-size: 13px; }
.application-list, .dealer-account-list { display: flex; flex-direction: column; gap: 12px; }
.application-card { padding: 18px; border: 1px solid var(--portal-line); background: #fff; }
.application-card-head { display: flex; align-items: start; justify-content: space-between; gap: 16px; }
.application-card h3 { margin: 5px 0 0; }
.application-meta { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 16px 0; font-size: 11px; }
.application-meta span { display: block; margin-bottom: 4px; color: var(--portal-muted); font-size: 9px; }

@media (max-width: 900px) {
  .portal-grid, .payment-layout, .service-workspace, .support-admin-workspace { grid-template-columns: 1fr; }
  .service-card, .bill-mini { position: static; }
  .support-conversation-list { max-height: 280px; border-right: 0; border-bottom: 1px solid var(--portal-line); }
  .metric-grid { grid-template-columns: 1fr 1fr; }
  .portal-heading { align-items: start; flex-direction: column; }
  .manage-order-summary { grid-template-columns: 1fr 1fr; }
  .auth-layout { min-height: auto; grid-template-columns: 1fr; }
  .application-meta { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 620px) {
  .portal-shell { width: min(100% - 24px, 1220px); padding-top: 28px; }
  .portal-topbar { min-height: 64px; gap: 6px; padding: 10px 12px; overflow: hidden; }
  .portal-logo { width: 126px; min-width: 112px; flex: 0 1 126px; }
  .portal-nav { min-width: 0; flex: 1; justify-content: flex-end; gap: 2px; }
  .portal-nav a { display: none; padding: 8px; font-size: 10px; }
  .portal-nav a:first-child, .portal-nav a.is-active { display: block; }
  .portal-nav .portal-button { min-width: 0; min-height: 40px; flex: 0 1 auto; padding: 0 10px; font-size: 10px; }
  .portal-fields, .lookup-form { grid-template-columns: 1fr; }
  .portal-field.is-wide { grid-column: auto; }
  .portal-card { padding: 20px; }
  .metric-grid, .order-meta { grid-template-columns: 1fr 1fr; }
  .manage-order-summary { grid-template-columns: 1fr; }
  .checkout-item { grid-template-columns: 62px 1fr; }
  .checkout-item img { width: 62px; height: 62px; }
  .checkout-item > span { grid-column: 2; }
  .order-header { align-items: start; flex-direction: column; }
  .payment-qr-wrap { padding: 24px 18px; }
  .bill-sheet { padding: 20px; }
  .bill-head { align-items: start; flex-direction: column; }
  .chat-messages { min-height: 300px; padding: 18px; }
  .chat-message { max-width: 90%; }
  .chat-composer { padding: 16px 18px; }
  .chat-composer-actions, .support-active-head, .support-head-actions { align-items: stretch; flex-direction: column; }
  .chat-composer-actions .portal-button, .support-head-actions .portal-button { width: 100%; }
  .service-chat > .portal-button, .service-proof { margin-left: 18px; margin-right: 18px; }
  .timeline-item { grid-template-columns: 18px 1fr; }
  .timeline-item time { grid-column: 2; }
  .auth-actions { align-items: stretch; flex-direction: column; }
  .dealer-account { gap: 7px; }
  .dealer-account .portal-button { min-height: 36px; padding-inline: 10px; }
  .application-meta { grid-template-columns: 1fr; }
}

.dealer-pricing { margin-top: 14px; border-top: 1px solid rgba(17,17,17,.12); padding-top: 12px; }
.dealer-pricing > summary { cursor: pointer; font-size: 12px; font-weight: 900; letter-spacing: .08em; }
.pricing-list { display: grid; gap: 8px; margin-top: 12px; max-height: 440px; overflow: auto; padding-right: 4px; }
.pricing-row { display: grid; grid-template-columns: minmax(150px,1.4fr) repeat(3,minmax(125px,1fr)) auto; gap: 8px; align-items: end; padding: 10px; background: #f6f6f3; border: 1px solid rgba(17,17,17,.08); }
.pricing-row > strong { align-self: center; font-size: 13px; }
.pricing-row label { display: grid; gap: 4px; font-size: 10px; font-weight: 800; color: #666; }
.pricing-row input,.pricing-row select { width: 100%; min-width: 0; height: 36px; border: 1px solid #d5d5d0; background: #fff; padding: 0 8px; }
.pricing-row label:nth-of-type(3) { grid-template-columns: 72px 1fr; }
.pricing-row label:nth-of-type(3) select,.pricing-row label:nth-of-type(3) input { grid-row: 2; }
@media (max-width: 900px) { .pricing-row { grid-template-columns: 1fr 1fr; } .pricing-row > strong { grid-column: 1/-1; } }
@media (max-width: 520px) {
  .pricing-list { padding-right: 0; }
  .pricing-row { width: 100%; min-width: 0; grid-template-columns: minmax(0, 1fr); }
  .pricing-row > * { min-width: 0; max-width: 100%; }
  .pricing-row > strong { grid-column: auto; }
  .pricing-row label:nth-of-type(3) { grid-template-columns: minmax(0, 72px) minmax(0, 1fr); }
  .pricing-row .portal-button { width: 100%; }
}

.product-manager-card { margin-bottom: 24px; }
.product-manager-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.product-manager-tools { min-width: 0; flex: 1; display: grid; grid-template-columns: minmax(220px, 1fr) minmax(180px, .42fr); gap: 10px; }
.product-manager-toolbar .portal-input { max-width: none; }
.product-manager-toolbar > span { white-space: nowrap; font-size: 11px; font-weight: 900; letter-spacing: .08em; }
.admin-brand-tabs { display: grid; grid-template-columns: repeat(6, minmax(110px, 1fr)); gap: 8px; margin-bottom: 22px; }
.admin-brand-tabs button { min-width: 0; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 13px 14px; border: 1px solid #d9d8d2; background: #f7f6f2; color: #161615; cursor: pointer; text-align: left; }
.admin-brand-tabs button:hover, .admin-brand-tabs button.is-active { border-color: #171716; background: #171716; color: #fff; }
.admin-brand-tabs strong { overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.admin-brand-tabs small { color: #777; font-size: 9px; }
.admin-brand-tabs button.is-active small { color: #c9ff39; }
.admin-product-list { display: grid; gap: 10px; }
.admin-brand-heading { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-top: 18px; padding: 16px 2px 5px; border-bottom: 2px solid #171716; }
.admin-brand-heading:first-child { margin-top: 0; }
.admin-brand-heading span { display: block; color: #777; font-size: 9px; font-weight: 900; letter-spacing: .15em; }
.admin-brand-heading h3 { margin: 4px 0 0; font-size: 24px; letter-spacing: -.035em; }
.admin-brand-heading button { border: 0; background: transparent; cursor: pointer; font-size: 10px; font-weight: 900; text-decoration: underline; }
.admin-product-card { border: 1px solid #d9d8d2; background: #fff; }
.admin-product-card > summary { list-style: none; display: grid; grid-template-columns: 82px minmax(0,1fr) auto auto; gap: 16px; align-items: center; cursor: pointer; padding: 12px; }
.admin-product-card > summary::-webkit-details-marker { display: none; }
.admin-product-card > summary::after { content: '+'; grid-column: 4; font-size: 22px; font-weight: 900; }
.admin-product-card[open] > summary::after { content: '−'; }
.admin-product-card > summary > img { width: 82px; height: 68px; object-fit: contain; background: #f2f1ed; }
.admin-product-card > summary h3 { margin: 7px 0 3px; font-size: 17px; line-height: 1.25; overflow-wrap: anywhere; }
.admin-product-card > summary p { margin: 0; color: #777; font-size: 11px; line-height: 1.45; overflow-wrap: anywhere; }
.admin-product-card > summary > strong { font-size: 18px; }
.admin-product-form { border-top: 1px solid #e2e1dc; padding: 18px; background: #f8f8f5; }
.admin-product-form textarea { min-height: 88px; }
.product-image-upload { display: grid; grid-template-columns: 110px minmax(180px,1fr) auto; gap: 12px; align-items: center; margin: 16px 0; padding: 12px; border: 1px dashed #c9c8c2; background: #fff; }
.product-image-upload img { width: 110px; height: 90px; object-fit: contain; background: #f3f3ef; }
.product-image-upload small { grid-column: 2/-1; color: #777; }
@media (max-width: 700px) {
  .product-manager-card { overflow-x: hidden; }
  .product-manager-toolbar { align-items: stretch; flex-direction: column; }
  .product-manager-tools { grid-template-columns: 1fr; }
  .admin-brand-tabs { display: flex; width: 100%; overflow-x: auto; padding-bottom: 5px; scrollbar-width: thin; }
  .admin-brand-tabs button { min-width: 116px; flex: 0 0 auto; }
  .admin-brand-heading { align-items: start; flex-direction: column; gap: 7px; }
  .admin-product-card > summary { grid-template-columns: 64px minmax(0,1fr) auto; gap: 10px; }
  .admin-product-card > summary::after { grid-column: 3; grid-row: 1; }
  .admin-product-card > summary > img { width: 64px; height: 60px; }
  .admin-product-card > summary > strong { grid-column: 2; grid-row: 2; font-size: 16px; }
  .product-image-upload { width: 100%; min-width: 0; grid-template-columns: 80px minmax(0, 1fr); }
  .product-image-upload img { width: 80px; height: 72px; }
  .product-image-upload input[type="file"] { width: 100%; min-width: 0; max-width: 100%; }
  .product-image-upload .portal-button { grid-column: 1/-1; }
  .product-image-upload small { grid-column: 1/-1; }
}
