:root {
    --bg: #f4f6f8;
    --surface: #ffffff;
    --surface-alt: #f7f8fa;
    --text: #20262f;
    --muted: #69717d;
    --line: #dfe3e8;
    --primary: #176b4d;
    --primary-hover: #10563d;
    --accent: #1877d2;
    --success: #138a52;
    --warning-bg: #fff4cf;
    --warning-line: #f1d06c;
    --warning-text: #735500;
    --danger: #b42318;
    --danger-bg: #fff0ee;
    --shadow: 0 10px 30px rgba(29, 39, 51, .08);
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
body { margin: 0; min-height: 100vh; color: var(--text); background: var(--bg); font-family: Inter, "PingFang SC", "Microsoft YaHei", Arial, sans-serif; font-size: 15px; letter-spacing: 0; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; letter-spacing: 0; }
button, .btn { min-height: 42px; }
.site-header { height: 68px; padding: 0 max(24px, calc((100% - 1180px) / 2)); display: flex; align-items: center; justify-content: space-between; background: var(--surface); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 11px; font-weight: 750; font-size: 18px; }
.brand-mark { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; color: #fff; background: var(--primary); font-weight: 800; }
.site-header nav { display: flex; align-items: center; gap: 26px; color: var(--muted); }
.site-header nav a:hover { color: var(--primary); }
.site-nav-form { margin: 0; }
.site-nav-form button { min-height: auto; padding: 0; color: var(--muted); background: transparent; border: 0; cursor: pointer; }
.site-nav-form button:hover { color: var(--primary); }
.site-main { width: min(1180px, calc(100% - 36px)); margin: 0 auto; padding: 42px 0 70px; min-height: calc(100vh - 128px); }
.site-footer { height: 60px; display: grid; place-items: center; color: var(--muted); font-size: 13px; border-top: 1px solid var(--line); background: var(--surface); }
.page-heading { display: flex; align-items: end; justify-content: space-between; margin-bottom: 28px; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 8px; font-size: 30px; line-height: 1.25; }
h2 { font-size: 20px; }
.eyebrow { margin-bottom: 8px; color: var(--primary); font-weight: 700; font-size: 13px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 9px 17px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--text); cursor: pointer; font-weight: 650; white-space: nowrap; }
.btn:hover { border-color: #b9c0c8; }
.btn:disabled { cursor: not-allowed; color: #959ca5; background: #f1f2f4; }
.btn-primary { color: #fff; background: var(--primary); border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn-secondary { color: var(--primary); border-color: #aac7bc; }
.btn-danger { color: var(--danger); border-color: #e3aaa4; background: var(--surface); }
.btn-danger:hover { color: #8f1c14; border-color: #c97870; background: var(--danger-bg); }
.btn-block { width: 100%; }
.product-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.product-card { min-height: 230px; display: flex; flex-direction: column; justify-content: space-between; padding: 22px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; }
.product-card:hover { border-color: #b6c6c0; box-shadow: var(--shadow); }
.product-card h2 { margin: 18px 0 8px; }
.product-card p { color: var(--muted); line-height: 1.75; }
.product-card-bottom { display: flex; align-items: end; justify-content: space-between; gap: 15px; margin-top: 24px; }
.stock { display: inline-flex; padding: 4px 8px; border-radius: 4px; font-size: 12px; font-weight: 700; }
.in-stock { color: var(--success); background: #e9f7ef; }
.out-stock { color: var(--muted); background: #eef0f2; }
.price { display: flex; align-items: baseline; gap: 6px; color: var(--primary); }
.price strong { font-size: 27px; }
.price span { color: var(--muted); font-size: 12px; }
.price-large strong { font-size: 38px; }
.purchase-layout { display: grid; grid-template-columns: minmax(0, 1fr) 350px; gap: 28px; align-items: start; }
.product-detail { padding: 6px 10px 20px 0; }
.back-link { display: inline-block; margin-bottom: 34px; color: var(--muted); }
.detail-title { display: flex; align-items: start; justify-content: space-between; gap: 24px; padding-bottom: 28px; border-bottom: 1px solid var(--line); }
.description { padding: 28px 0; color: #444c56; line-height: 1.9; }
.notice-line { padding: 14px 16px; background: #edf6f2; border-left: 3px solid var(--primary); color: #365d4f; }
.checkout-panel { padding: 24px; }
.checkout-panel h2 { margin-bottom: 22px; }
label { display: block; margin-bottom: 18px; color: #454d57; font-weight: 650; }
input, textarea, select { width: 100%; margin-top: 8px; padding: 11px 12px; color: var(--text); background: #fff; border: 1px solid #cfd5dc; border-radius: 5px; outline: none; }
textarea { min-height: 120px; resize: vertical; }
input:focus, textarea:focus, select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(23, 107, 77, .1); }
.field-help { margin: -9px 0 18px; color: var(--muted); font-size: 12px; }
.checkout-meta { margin-top: 20px; padding-top: 18px; display: flex; justify-content: space-between; border-top: 1px solid var(--line); color: var(--muted); }
.checkout-meta strong { color: var(--success); }
.payment-shell { width: min(720px, 100%); margin: 0 auto; overflow: hidden; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); }
.payment-title { display: flex; align-items: center; gap: 12px; padding: 20px 28px; border-bottom: 1px solid var(--line); }
.payment-title p { margin: 0 0 4px; font-size: 19px; font-weight: 750; }
.payment-title div span { color: var(--muted); font-size: 13px; }
.usdt-badge { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; color: #fff; background: #26a17b; font-size: 22px; font-weight: 800; }
.amount-block { padding: 38px 24px 26px; display: flex; align-items: center; flex-direction: column; }
.amount-block > span { color: var(--muted); }
.amount-block strong { margin: 6px 0 2px; font-size: 48px; line-height: 1.15; }
.amount-block small { color: var(--muted); font-size: 15px; }
.address-block { margin: 0 28px; padding: 18px; display: grid; grid-template-columns: 1fr auto; gap: 9px 18px; background: var(--surface-alt); border: 1px solid #eceff2; border-radius: 7px; }
.address-block > span { grid-column: 1 / -1; color: var(--muted); font-size: 12px; }
.address-block code { align-self: center; overflow-wrap: anywhere; color: #344052; font-size: 15px; }
.payment-warning { margin: 20px 28px 0; padding: 15px 17px; display: flex; flex-direction: column; gap: 5px; color: var(--warning-text); background: var(--warning-bg); border: 1px solid var(--warning-line); border-radius: 7px; }
.payment-warning span { font-size: 13px; line-height: 1.6; }
.payment-meta { margin: 22px 28px 0; }
.payment-meta div { padding: 9px 0; display: flex; justify-content: space-between; gap: 20px; }
.payment-meta dt { color: var(--muted); }
.payment-meta dd { margin: 0; text-align: right; }
.mono { font-family: "Cascadia Mono", Consolas, monospace; overflow-wrap: anywhere; }
.payment-checking { padding: 22px 28px 30px; display: flex; align-items: center; justify-content: center; gap: 10px; color: var(--muted); }
.spinner { width: 19px; height: 19px; border: 3px solid #d9dfe4; border-top-color: var(--primary); border-radius: 50%; animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.payment-state { padding: 60px 28px; text-align: center; }
.payment-state p { color: var(--muted); }
.query-shell { width: min(880px, 100%); margin: 0 auto; }
.center-heading { margin-bottom: 26px; text-align: center; }
.center-heading p:last-child { color: var(--muted); }
.query-form { margin-bottom: 24px; display: grid; grid-template-columns: 1fr auto; gap: 10px; }
.query-form input { margin: 0; min-height: 48px; }
.order-result { padding: 26px; }
.order-result-head { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding-bottom: 22px; border-bottom: 1px solid var(--line); }
.order-result h2 { margin: 12px 0 0; }
.status { display: inline-flex; padding: 4px 8px; border-radius: 4px; font-size: 12px; font-weight: 750; }
.status-pending { color: #7a5900; background: #fff2c3; }
.status-paid { color: var(--success); background: #e7f7ee; }
.status-expired, .status-cancelled { color: var(--muted); background: #edf0f2; }
.detail-list { margin: 10px 0 24px; }
.detail-list div { padding: 12px 0; display: grid; grid-template-columns: 120px 1fr; border-bottom: 1px solid #edf0f2; }
.detail-list dt { color: var(--muted); }
.detail-list dd { margin: 0; }
.delivery-box { padding: 18px; background: #eef8f3; border: 1px solid #c5e5d7; border-radius: 7px; }
.delivery-box h3 { margin-bottom: 14px; color: var(--success); }
.code-row { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid #d4e9df; }
.code-row code { overflow-wrap: anywhere; color: #b42318; font-size: 15px; }
.icon-copy { padding: 5px 8px; color: var(--accent); background: transparent; border: 0; cursor: pointer; }
.alert { padding: 13px 16px; border: 1px solid; border-radius: 6px; line-height: 1.5; }
.alert-danger { color: var(--danger); background: var(--danger-bg); border-color: #f2c2bc; }
.alert-success { color: var(--success); background: #e9f7ef; border-color: #bce0cc; }
.global-alert { width: min(1180px, calc(100% - 36px)); margin: 18px auto -20px; }
.empty-state { padding: 80px 24px; text-align: center; color: var(--muted); background: var(--surface); border: 1px dashed #cbd1d7; border-radius: 8px; }
.empty-state h1, .empty-state h2 { color: var(--text); }
.setup-page { padding: 48px 18px; }
.setup-shell { width: min(760px, 100%); margin: 0 auto; }
.setup-heading { margin-bottom: 22px; display: flex; align-items: center; gap: 14px; }
.setup-heading h1 { margin: 0 0 4px; font-size: 25px; }
.setup-heading p { margin: 0; color: var(--muted); }
.setup-shell > .alert { margin-bottom: 16px; }
.form-grid { padding: 25px; display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.span-2 { grid-column: 1 / -1; }
.storefront-heading > div > p:last-child { max-width: 760px; margin-top: 10px; color: var(--muted); line-height: 1.75; }
.site-nav { flex-wrap: wrap; justify-content: flex-end; }
.site-nav > button { padding: 0; color: var(--muted); background: transparent; border: 0; cursor: pointer; font: inherit; }
.site-nav > button:hover { color: var(--primary); }
.site-dialog { width: min(500px, calc(100% - 32px)); padding: 0; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 22px 70px rgba(23, 31, 38, .22); }
.site-dialog::backdrop { background: rgba(24, 31, 38, .42); }
.site-dialog-head { padding: 20px 22px 14px; display: flex; align-items: center; justify-content: space-between; gap: 20px; border-bottom: 1px solid var(--line); }
.site-dialog-head h2 { margin: 0; font-size: 20px; }
.site-dialog-head button { width: 32px; height: 32px; padding: 0; color: var(--muted); background: transparent; border: 0; font-size: 25px; line-height: 1; cursor: pointer; }
.site-dialog > p { min-height: 70px; margin: 0; padding: 22px; color: #46515c; line-height: 1.8; white-space: pre-line; }
.site-dialog-actions { padding: 0 22px 22px; display: flex; justify-content: flex-end; }
.auth-shell { width: min(520px, 100%); margin: 0 auto; }
.merchant-register-shell { width: min(620px, 100%); }
.auth-form { padding: 26px; }
.auth-form label small { display: block; margin-top: 6px; color: var(--muted); font-size: 12px; font-weight: 400; line-height: 1.6; }
.auth-switch { margin-top: 18px; text-align: center; color: var(--muted); }
.auth-switch a { color: var(--accent); }
.service-list { display: grid; gap: 16px; }
.service-section { padding: 24px; }
.service-section .description { padding: 14px 0 20px; }
.result-actions { margin-top: 18px; display: flex; justify-content: center; }
.upgrade-panel { padding: 26px; }
.upgrade-panel p { margin-bottom: 20px; color: var(--muted); line-height: 1.75; }
.review-actions { margin-top: 24px; padding-top: 20px; display: flex; flex-wrap: wrap; gap: 10px; border-top: 1px solid var(--line); }
.compact-filter { grid-template-columns: minmax(180px, 260px) auto; justify-content: start; }
.nav-editor-grid { display: grid; grid-template-columns: minmax(220px, 1fr) 160px; gap: 0 18px; }
.merchant-sidebar { background: #20383a; }
.field-section-help { margin: -5px 0 18px; color: var(--muted); font-size: 13px; }
.readonly-link-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: end; }
.readonly-link-row input { background: var(--surface-alt); }
.platform-home-hero { min-height: 360px; padding: 58px 0 46px; display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(300px, .8fr); gap: 56px; align-items: center; border-bottom: 1px solid var(--line); }
.platform-home-copy h1 { max-width: 760px; font-size: 42px; }
.platform-home-copy > p:not(.eyebrow) { max-width: 720px; margin: 16px 0 0; color: var(--muted); font-size: 17px; line-height: 1.8; }
.platform-home-actions { margin-top: 28px; display: flex; flex-wrap: wrap; gap: 12px; }
.platform-capabilities { margin: 0; border-top: 1px solid var(--line); }
.platform-capabilities div { padding: 18px 0; display: flex; align-items: baseline; justify-content: space-between; gap: 18px; border-bottom: 1px solid var(--line); }
.platform-capabilities dt { font-size: 18px; font-weight: 750; }
.platform-capabilities dd { margin: 0; color: var(--muted); }
.platform-home-module { padding: 44px 0 0; }
.platform-directory, .platform-services-preview { padding: 44px 0 0; }
.merchant-store-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.merchant-store-card { width: 310px; min-height: 250px; padding: 22px; display: flex; flex: 0 0 310px; flex-direction: column; justify-content: space-between; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; }
.merchant-store-card h3 { margin: 14px 0 8px; }
.merchant-store-card p { min-height: 44px; color: var(--muted); line-height: 1.6; }
.merchant-store-card dl { margin: 16px 0; display: flex; gap: 24px; }
.merchant-store-card dl div { display: flex; align-items: baseline; gap: 7px; }
.merchant-store-card dt { color: var(--muted); font-size: 12px; }
.merchant-store-card dd { margin: 0; font-weight: 750; }
.merchant-card-mark { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.demo-badge, .demo-disclosure { display: inline-flex; padding: 4px 8px; color: #735c00; background: #fff4c2; border: 1px solid #ead98a; border-radius: 4px; font-size: 12px; font-weight: 700; }
.home-carousel { width: 100%; overflow: hidden; }
.home-carousel-track { width: max-content; display: flex; gap: var(--carousel-gap); animation: home-scroll-left var(--scroll-duration, 60s) linear infinite; will-change: transform; }
.home-carousel-group { display: flex; flex: 0 0 auto; gap: var(--carousel-gap); }
.home-carousel:hover .home-carousel-track, .home-carousel:focus-within .home-carousel-track { animation-play-state: paused; }
.merchant-track { --carousel-gap: 16px; --scroll-offset: 8px; }
.activity-carousel { padding: 15px 0; background: var(--surface); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.activity-track { --carousel-gap: 12px; --scroll-offset: 6px; }
.activity-item { min-width: 330px; padding: 12px 16px; display: grid; grid-template-columns: auto auto 1fr; align-items: center; gap: 4px 9px; color: #36404a; background: var(--surface-alt); border: 1px solid var(--line); border-radius: 6px; }
.activity-item strong { font-size: 13px; }
.activity-item span:not(.activity-dot) { color: var(--muted); font-size: 12px; }
.activity-item b { grid-column: 2; color: var(--primary); font-size: 14px; }
.activity-item time { grid-column: 3; color: var(--muted); font-size: 11px; text-align: right; }
.activity-dot { grid-row: 1 / 3; width: 8px; height: 8px; background: #26a17b; border-radius: 50%; }
.compact-empty { padding: 35px 20px; }
.compact-empty h2 { font-size: 17px; }
@keyframes home-scroll-left { from { transform: translateX(0); } to { transform: translateX(calc(-50% - var(--scroll-offset))); } }
.service-preview-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.service-preview-grid article { padding: 4px 0 22px; border-bottom: 2px solid var(--line); }
.service-preview-grid p { color: var(--muted); line-height: 1.7; }

/* Admin */
.admin-body { min-width: 320px; background: #f1f3f5; }
.admin-sidebar { position: fixed; inset: 0 auto 0 0; z-index: 10; width: 218px; display: flex; flex-direction: column; color: #dce4e9; background: #26343a; }
.admin-brand { height: 70px; padding: 0 22px; display: flex; align-items: center; gap: 11px; color: #fff; font-size: 17px; font-weight: 750; border-bottom: 1px solid rgba(255,255,255,.08); }
.admin-sidebar nav { padding: 18px 12px; display: flex; flex-direction: column; gap: 5px; }
.admin-sidebar nav a { padding: 12px 15px; border-radius: 5px; }
.admin-sidebar nav a:hover, .admin-sidebar nav a.active { color: #fff; background: #176b4d; }
.admin-side-bottom { margin-top: auto; padding: 18px 25px; display: flex; align-items: center; justify-content: space-between; border-top: 1px solid rgba(255,255,255,.08); font-size: 13px; }
.admin-side-bottom button { min-height: auto; padding: 0; color: #dce4e9; background: transparent; border: 0; cursor: pointer; }
.admin-content { min-height: 100vh; margin-left: 218px; }
.admin-topbar { height: 70px; padding: 0 28px; display: flex; align-items: center; justify-content: space-between; background: #fff; border-bottom: 1px solid var(--line); }
.admin-topbar h1 { margin: 0; font-size: 21px; }
.admin-topbar span { color: var(--muted); font-size: 13px; }
.admin-main { padding: 26px; }
.admin-main > .alert { margin-bottom: 18px; }
.admin-notice a { margin-left: 8px; text-decoration: underline; }
.stat-grid { margin-bottom: 20px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.stat-grid-five { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.stat-box { min-height: 126px; padding: 20px; display: flex; flex-direction: column; background: #fff; border: 1px solid var(--line); border-radius: 7px; }
.stat-box span { color: var(--muted); }
.stat-box strong { margin-top: 11px; font-size: 31px; }
.stat-box small { margin-top: 4px; color: var(--primary); }
.admin-section, .admin-form { margin-bottom: 20px; padding: 22px; box-shadow: none; }
.section-heading { min-height: 42px; margin-bottom: 18px; display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.section-heading h2 { margin: 0; }
.section-heading p { margin: 5px 0 0; color: var(--muted); font-size: 13px; }
.section-heading > a:not(.btn) { color: var(--accent); }
.table-scroll { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; white-space: nowrap; }
th, td { padding: 13px 12px; text-align: left; border-bottom: 1px solid #e8ebee; }
th { color: var(--muted); background: #f7f8f9; font-size: 12px; font-weight: 650; }
td { font-size: 13px; }
tbody tr:hover { background: #fafbfb; }
.table-link, .actions a { color: var(--accent); }
.table-subtext { color: var(--muted); font-size: 12px; }
.number-success { color: var(--success); font-weight: 750; }
.actions { display: flex; align-items: center; gap: 12px; }
.actions form { margin: 0; }
.actions button, .link-danger { min-height: auto; padding: 0; color: var(--accent); background: transparent; border: 0; cursor: pointer; }
.link-danger { color: var(--danger); }
.admin-empty { padding: 45px 15px; text-align: center; color: var(--muted); }
.admin-form { max-width: 880px; }
.admin-form-wide { max-width: 1180px; }
.admin-form label small { margin-top: 6px; display: block; color: var(--muted); font-size: 12px; font-weight: 400; }
.toggle-label { display: flex; align-items: center; gap: 9px; }
.toggle-label input { width: 17px; height: 17px; margin: 0; }
.form-actions { padding-top: 8px; display: flex; justify-content: flex-end; gap: 10px; }
.form-section-title { margin: 28px 0 17px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.form-section-title:first-child { margin-top: 0; }
.form-section-title h2 { margin: 0; font-size: 17px; }
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.homepage-module-editor { display: grid; gap: 14px; }
.homepage-module-row { padding: 16px; display: grid; grid-template-columns: minmax(190px, .8fr) minmax(190px, 1fr) minmax(220px, 1.2fr) 120px; gap: 14px; align-items: end; background: var(--surface-alt); border: 1px solid var(--line); border-radius: 7px; }
.homepage-module-row label { margin: 0; }
.homepage-module-row-short { grid-template-columns: minmax(190px, 1fr) 120px; justify-content: start; }
.homepage-admin-list { max-height: 520px; overflow-y: auto; }
.inventory-strip { margin-bottom: 20px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.inventory-strip > div { padding: 16px 20px; display: flex; align-items: baseline; justify-content: space-between; background: #fff; border: 1px solid var(--line); border-radius: 7px; }
.inventory-strip span { color: var(--muted); }
.inventory-strip strong { font-size: 25px; }
.code-input { min-height: 180px; font-family: "Cascadia Mono", Consolas, monospace; }
.admin-code { max-width: 480px; display: inline-block; overflow: hidden; text-overflow: ellipsis; color: #374151; }
.filter-bar { margin-bottom: 18px; display: grid; grid-template-columns: 180px minmax(240px, 1fr) auto; gap: 10px; }
.filter-bar input, .filter-bar select { margin: 0; }
.order-filter-bar { grid-template-columns: 150px minmax(240px, 1fr) 165px 165px auto; align-items: end; }
.merchant-order-filter { grid-template-columns: 180px 160px minmax(240px, 1fr) auto; }
.compact-field { margin: 0; color: var(--muted); font-size: 12px; }
.compact-field input { margin-top: 5px; }
.actions button:disabled { color: #a4aab1; cursor: not-allowed; }
.danger-zone { border-color: #ead0cd; }
.cleanup-grid { display: grid; grid-template-columns: 1.2fr .9fr .9fr; gap: 0; border-top: 1px solid var(--line); }
.cleanup-box { min-width: 0; margin: 0; padding: 20px; border-right: 1px solid var(--line); }
.cleanup-box:first-child { padding-left: 0; }
.cleanup-box:last-child { padding-right: 0; border-right: 0; }
.cleanup-box h3 { margin-bottom: 14px; font-size: 16px; }
.cleanup-box p { min-height: 44px; margin-bottom: 18px; color: var(--muted); line-height: 1.55; }
.cleanup-box label { margin-bottom: 14px; }
.cleanup-box label small { margin-top: 6px; display: block; color: var(--muted); font-size: 12px; font-weight: 400; }
.site-entry-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.site-entry { min-width: 0; padding: 20px; display: flex; flex-direction: column; justify-content: space-between; gap: 18px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.site-entry h3 { margin: 10px 0 6px; font-size: 17px; }
.site-entry p { margin: 0; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.site-entry dl { margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.site-entry dl div { padding: 10px 0; border-top: 1px solid var(--line); }
.site-entry dt { color: var(--muted); font-size: 12px; }
.site-entry dd { margin: 4px 0 0; font-weight: 750; }
.site-entry-actions { display: flex; flex-wrap: wrap; gap: 9px; }
.order-number { margin: 10px 0 0; font-family: "Cascadia Mono", Consolas, monospace; }
.admin-detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 24px; }
.admin-detail-grid > div { padding: 14px 0; border-bottom: 1px solid #e9ecef; }
.admin-detail-grid .wide { grid-column: 1 / -1; }
.admin-detail-grid dt { margin-bottom: 6px; color: var(--muted); font-size: 12px; }
.admin-detail-grid dd { margin: 0; overflow-wrap: anywhere; }
.admin-delivery { margin-top: 22px; padding: 18px; background: #f6f8f8; border: 1px solid var(--line); border-radius: 6px; }
.admin-delivery h3 { margin-bottom: 10px; }
.manual-confirm { margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--line); }
.login-page { padding: 8vh 18px; }
.login-panel { width: min(420px, 100%); margin: 0 auto; padding: 28px; }
.login-heading { margin-bottom: 25px; display: flex; align-items: center; gap: 13px; }
.login-heading h1 { margin: 0 0 4px; font-size: 24px; }
.login-heading p { margin: 0; color: var(--muted); }
.login-panel .alert { margin-bottom: 18px; }

@media (max-width: 820px) {
    .product-grid { grid-template-columns: 1fr 1fr; }
    .purchase-layout { grid-template-columns: 1fr; }
    .checkout-panel { width: 100%; }
    .stat-grid { grid-template-columns: 1fr 1fr; }
    .homepage-module-row { grid-template-columns: 1fr 1fr; }
    .order-filter-bar { grid-template-columns: 1fr 1fr; }
    .cleanup-grid { grid-template-columns: 1fr; }
    .cleanup-box, .cleanup-box:first-child, .cleanup-box:last-child { padding: 18px 0; border-right: 0; border-bottom: 1px solid var(--line); }
    .cleanup-box:last-child { border-bottom: 0; }
    .site-entry-grid { grid-template-columns: 1fr; }
    .merchant-order-filter { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 560px) {
    .site-header { height: auto; min-height: 64px; padding: 13px 18px; align-items: flex-start; gap: 14px; }
    .site-header nav { gap: 15px; padding-top: 8px; font-size: 13px; }
    .brand { max-width: 55%; font-size: 15px; }
    .brand-mark { flex: 0 0 30px; width: 30px; height: 30px; }
    .site-main { width: min(100% - 24px, 1180px); padding: 28px 0 50px; }
    h1 { font-size: 25px; }
    .page-heading { align-items: start; gap: 18px; }
    .product-grid { grid-template-columns: 1fr; }
    .detail-title, .order-result-head { flex-direction: column; }
    .price-large strong { font-size: 32px; }
    .payment-title { padding: 18px; }
    .amount-block strong { font-size: 38px; }
    .address-block, .payment-warning, .payment-meta { margin-left: 14px; margin-right: 14px; }
    .address-block { grid-template-columns: 1fr; }
    .address-block .btn { width: 100%; }
    .query-form { grid-template-columns: 1fr; }
    .detail-list div { grid-template-columns: 90px 1fr; }
    .form-grid { grid-template-columns: 1fr; }
    .span-2 { grid-column: auto; }
    .admin-sidebar { position: static; width: 100%; }
    .admin-brand { height: 60px; }
    .admin-sidebar nav { padding: 8px 12px; flex-direction: row; overflow-x: auto; }
    .admin-sidebar nav a { padding: 9px 12px; white-space: nowrap; }
    .admin-side-bottom { display: none; }
    .admin-content { margin-left: 0; }
    .admin-topbar { height: 58px; padding: 0 16px; }
    .admin-main { padding: 14px; }
    .stat-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
    .stat-box { min-height: 104px; padding: 15px; }
    .stat-box strong { font-size: 26px; }
    .admin-section, .admin-form { padding: 15px; }
    .filter-bar { grid-template-columns: 1fr; }
    .order-filter-bar { grid-template-columns: 1fr; }
    .merchant-order-filter { grid-template-columns: 1fr; }
    .cleanup-grid { grid-template-columns: 1fr; }
    .cleanup-box, .cleanup-box:first-child, .cleanup-box:last-child { padding: 18px 0; border-right: 0; border-bottom: 1px solid var(--line); }
    .cleanup-box:last-child { border-bottom: 0; }
    .settings-grid, .admin-detail-grid { grid-template-columns: 1fr; }
    .admin-detail-grid .wide { grid-column: auto; }
    .inventory-strip { grid-template-columns: 1fr; }
    .site-nav { max-width: 55%; }
    .nav-editor-grid { grid-template-columns: 1fr; }
    .review-actions .btn { flex: 1 1 auto; }
    .readonly-link-row { grid-template-columns: 1fr; }
    .platform-home-hero { min-height: auto; padding: 32px 0; grid-template-columns: 1fr; gap: 32px; }
    .platform-home-copy h1 { font-size: 30px; }
    .merchant-store-grid, .service-preview-grid { grid-template-columns: 1fr; }
    .homepage-module-row, .homepage-module-row-short { grid-template-columns: 1fr; }
    .merchant-store-card { width: 270px; flex-basis: 270px; }
    .activity-item { min-width: 280px; }
}

@media (prefers-reduced-motion: reduce) {
    .home-carousel { overflow-x: auto; }
    .home-carousel-track { animation: none; }
}

/* Merchant-selectable storefront themes. Every site stores one theme key. */
.stock-limited { color: #9a5a00; background: #fff3d6; }
.stock-limited-text { color: #9a5a00 !important; }
.stock-ready-text { color: var(--success) !important; }
.out-stock-text { color: var(--muted) !important; }
.theme-picker { margin: 24px 0; padding: 18px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-alt); }
.theme-picker legend { padding: 0 7px; color: var(--text); font-size: 18px; font-weight: 750; }
.theme-picker .field-section-help { margin: 0 0 14px; color: var(--muted); font-size: 13px; }
.theme-picker-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.theme-option { position: relative; min-height: 112px; margin: 0; padding: 11px; display: grid; grid-template-columns: 42px 1fr; grid-template-rows: auto 1fr; gap: 2px 9px; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: 7px; cursor: pointer; }
.theme-option:hover { border-color: var(--primary); }
.theme-option:focus-within { outline: 3px solid color-mix(in srgb, var(--primary) 22%, transparent); outline-offset: 1px; }
.theme-option input { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); border: 0; }
.theme-option input:checked + .theme-swatch { box-shadow: 0 0 0 3px var(--primary); }
.theme-option strong { align-self: center; font-size: 13px; }
.theme-option small { grid-column: 1 / -1; color: var(--muted); font-size: 11px; line-height: 1.45; font-weight: 500; }
.theme-swatch { width: 42px; height: 30px; padding: 5px; display: flex; flex-direction: column; justify-content: space-between; background: var(--swatch-bg); border-radius: 5px; }
.theme-swatch i { display: block; height: 4px; border-radius: 2px; background: var(--swatch-primary); }
.theme-swatch i:nth-child(2) { width: 70%; background: var(--swatch-accent); }
.theme-swatch i:nth-child(3) { width: 45%; background: var(--swatch-secondary); }
.theme-swatch.theme-01 { --swatch-bg:#edf7f1; --swatch-primary:#176b4d; --swatch-accent:#9dd8b7; --swatch-secondary:#d6eadf; }
.theme-swatch.theme-02 { --swatch-bg:#edf4ff; --swatch-primary:#2164a5; --swatch-accent:#8bb9eb; --swatch-secondary:#d8e7f8; }
.theme-swatch.theme-03 { --swatch-bg:#fff8e7; --swatch-primary:#ad6a09; --swatch-accent:#e7bd62; --swatch-secondary:#f3e3b8; }
.theme-swatch.theme-04 { --swatch-bg:#f7f1ff; --swatch-primary:#7043a5; --swatch-accent:#bca0df; --swatch-secondary:#e7dbf4; }
.theme-swatch.theme-05 { --swatch-bg:#fff1ed; --swatch-primary:#c55342; --swatch-accent:#efaa99; --swatch-secondary:#f9d8d0; }
.theme-swatch.theme-06 { --swatch-bg:#202b35; --swatch-primary:#46c49a; --swatch-accent:#9b8cff; --swatch-secondary:#354555; }
.theme-swatch.theme-07 { --swatch-bg:#252525; --swatch-primary:#f1f1f1; --swatch-accent:#9e9e9e; --swatch-secondary:#4b4b4b; }
.theme-swatch.theme-08 { --swatch-bg:#eafaff; --swatch-primary:#087d9d; --swatch-accent:#6bc9df; --swatch-secondary:#c9edf4; }
.theme-swatch.theme-09 { --swatch-bg:#f3f5e9; --swatch-primary:#5f7132; --swatch-accent:#aebd78; --swatch-secondary:#dde3c4; }
.theme-swatch.theme-10 { --swatch-bg:#fff0f3; --swatch-primary:#b62e54; --swatch-accent:#ef87a5; --swatch-secondary:#f7c8d5; }
.theme-swatch.theme-11 { --swatch-bg:#f1f4f8; --swatch-primary:#455f7a; --swatch-accent:#9aaec1; --swatch-secondary:#d8e0e8; }
.theme-swatch.theme-12 { --swatch-bg:#211d19; --swatch-primary:#c99544; --swatch-accent:#ecd293; --swatch-secondary:#4c4132; }
.theme-swatch.theme-13 { --swatch-bg:#edfbf7; --swatch-primary:#198a74; --swatch-accent:#8ddac8; --swatch-secondary:#d4f0e9; }
.theme-swatch.theme-14 { --swatch-bg:#fff0fb; --swatch-primary:#a33d87; --swatch-accent:#dc8ec6; --swatch-secondary:#f2d5ea; }
.theme-swatch.theme-15 { --swatch-bg:#fbf3ed; --swatch-primary:#99552f; --swatch-accent:#d89a74; --swatch-secondary:#ecd9ca; }
.theme-swatch.theme-16 { --swatch-bg:#182d48; --swatch-primary:#5da8e8; --swatch-accent:#9ce4ed; --swatch-secondary:#294666; }
.theme-swatch.theme-17 { --swatch-bg:#fbfbe8; --swatch-primary:#8b8f00; --swatch-accent:#d3d65c; --swatch-secondary:#ececae; }
.theme-swatch.theme-18 { --swatch-bg:#eff8f6; --swatch-primary:#3c817c; --swatch-accent:#91c8c0; --swatch-secondary:#d5eae7; }
.theme-swatch.theme-19 { --swatch-bg:#f7f0e9; --swatch-primary:#956033; --swatch-accent:#d3a77b; --swatch-secondary:#e8d5c0; }
.theme-swatch.theme-20 { --swatch-bg:#17252a; --swatch-primary:#15c7bd; --swatch-accent:#8df2dc; --swatch-secondary:#2c4a4e; }

.storefront-theme.theme-01 { --bg:#f4f6f8; --surface:#fff; --surface-alt:#f7f8fa; --text:#20262f; --muted:#69717d; --line:#dfe3e8; --primary:#176b4d; --primary-hover:#10563d; --accent:#1877d2; --success:#138a52; --shadow:0 10px 30px rgba(29,39,51,.08); }
.storefront-theme.theme-02 { --bg:#f1f6fc; --surface:#fff; --surface-alt:#f5f9ff; --text:#1d2b3a; --muted:#63758a; --line:#d5e1ef; --primary:#2164a5; --primary-hover:#174d80; --accent:#238bc5; --success:#16845f; --shadow:0 12px 30px rgba(34,83,132,.12); }
.storefront-theme.theme-03 { --bg:#fffaf0; --surface:#fff; --surface-alt:#fff8e8; --text:#33291c; --muted:#796b58; --line:#eadfc9; --primary:#ad6a09; --primary-hover:#854f05; --accent:#d79825; --success:#6a8a35; --shadow:0 12px 28px rgba(130,91,28,.11); }
.storefront-theme.theme-04 { --bg:#f8f5fc; --surface:#fff; --surface-alt:#faf7ff; --text:#2d2638; --muted:#756b85; --line:#e4dced; --primary:#7043a5; --primary-hover:#55317f; --accent:#a36ed3; --success:#328566; --shadow:0 12px 30px rgba(92,57,131,.11); }
.storefront-theme.theme-05 { --bg:#fff7f4; --surface:#fff; --surface-alt:#fff5f1; --text:#352522; --muted:#806d68; --line:#eedbd5; --primary:#c55342; --primary-hover:#9e3d31; --accent:#db7c67; --success:#368865; --shadow:0 12px 26px rgba(169,78,60,.12); }
.storefront-theme.theme-06 { --bg:#17212a; --surface:#202c36; --surface-alt:#1c2831; --text:#edf5f2; --muted:#aebdc4; --line:#3b4d59; --primary:#46c49a; --primary-hover:#2e9f7b; --accent:#9b8cff; --success:#65d7ae; --shadow:0 14px 34px rgba(0,0,0,.3); }
.storefront-theme.theme-07 { --bg:#1c1c1c; --surface:#272727; --surface-alt:#222; --text:#f4f4f4; --muted:#b3b3b3; --line:#444; --primary:#f1f1f1; --primary-hover:#d1d1d1; --accent:#c4c4c4; --success:#9be28a; --shadow:0 14px 30px rgba(0,0,0,.35); }
.storefront-theme.theme-08 { --bg:#effbfe; --surface:#fff; --surface-alt:#f4fdff; --text:#18323a; --muted:#64838c; --line:#d5edf1; --primary:#087d9d; --primary-hover:#056278; --accent:#20a9c6; --success:#198b67; --shadow:0 10px 28px rgba(25,112,132,.11); }
.storefront-theme.theme-09 { --bg:#f5f7ee; --surface:#fff; --surface-alt:#f7f8ef; --text:#2b3320; --muted:#718064; --line:#dfe5cf; --primary:#5f7132; --primary-hover:#465621; --accent:#829744; --success:#3d865d; --shadow:0 10px 28px rgba(83,101,44,.11); }
.storefront-theme.theme-10 { --bg:#fff6f7; --surface:#fff; --surface-alt:#fff3f5; --text:#351d26; --muted:#856873; --line:#efd9df; --primary:#b62e54; --primary-hover:#8e2140; --accent:#d25878; --success:#39866e; --shadow:0 12px 28px rgba(161,44,77,.13); }
.storefront-theme.theme-11 { --bg:#f5f7fa; --surface:#fff; --surface-alt:#f8fafc; --text:#263444; --muted:#718092; --line:#dfe5ec; --primary:#455f7a; --primary-hover:#334a61; --accent:#738da8; --success:#277e61; --shadow:0 7px 22px rgba(54,77,103,.07); }
.storefront-theme.theme-12 { --bg:#151311; --surface:#211d19; --surface-alt:#1c1916; --text:#f5efe4; --muted:#b8a995; --line:#4a3d2e; --primary:#c99544; --primary-hover:#a97831; --accent:#ecd293; --success:#86c59a; --shadow:0 14px 34px rgba(0,0,0,.4); }
.storefront-theme.theme-13 { --bg:#f0fbf8; --surface:#fff; --surface-alt:#f4fcfa; --text:#203731; --muted:#6b837b; --line:#d8eee8; --primary:#198a74; --primary-hover:#126b5a; --accent:#35ad96; --success:#2d8d5d; --shadow:0 12px 28px rgba(28,123,104,.1); }
.storefront-theme.theme-14 { --bg:#fff6fd; --surface:#fff; --surface-alt:#fff4fb; --text:#392334; --muted:#876d81; --line:#efdaea; --primary:#a33d87; --primary-hover:#7f2c69; --accent:#c365aa; --success:#438765; --shadow:0 12px 28px rgba(144,49,117,.12); }
.storefront-theme.theme-15 { --bg:#fcf7f2; --surface:#fff; --surface-alt:#fff9f4; --text:#382a22; --muted:#806c5f; --line:#eddfd3; --primary:#99552f; --primary-hover:#753e23; --accent:#bd744c; --success:#4b8766; --shadow:0 10px 26px rgba(125,73,41,.1); }
.storefront-theme.theme-16 { --bg:#14243a; --surface:#1d3550; --surface-alt:#192e47; --text:#ecf5ff; --muted:#abc0d3; --line:#38546d; --primary:#5da8e8; --primary-hover:#3784c4; --accent:#9ce4ed; --success:#78d2a8; --shadow:0 14px 34px rgba(0,0,0,.3); }
.storefront-theme.theme-17 { --bg:#fbfbe9; --surface:#fff; --surface-alt:#fffff1; --text:#353610; --muted:#77783d; --line:#e8e8bb; --primary:#777900; --primary-hover:#5c5e00; --accent:#a3a500; --success:#3c875b; --shadow:0 10px 26px rgba(125,126,28,.12); }
.storefront-theme.theme-18 { --bg:#f2f9f7; --surface:#fff; --surface-alt:#f7fcfb; --text:#243b39; --muted:#6d8783; --line:#d6e9e5; --primary:#3c817c; --primary-hover:#2d655f; --accent:#6ca9a1; --success:#37865d; --shadow:0 8px 24px rgba(55,111,105,.08); }
.storefront-theme.theme-19 { --bg:#faf6f1; --surface:#fff; --surface-alt:#fcf8f3; --text:#342a22; --muted:#806e5e; --line:#e9ded0; --primary:#956033; --primary-hover:#724522; --accent:#be8452; --success:#4d8867; --shadow:0 10px 26px rgba(122,79,41,.1); }
.storefront-theme.theme-20 { --bg:#122024; --surface:#1b2d31; --surface-alt:#17272b; --text:#e8fbf8; --muted:#9dc1bd; --line:#36565a; --primary:#15c7bd; --primary-hover:#0da49c; --accent:#8df2dc; --success:#72d89e; --shadow:0 14px 34px rgba(0,0,0,.35); }

.storefront-theme .site-header, .storefront-theme .site-footer { background: var(--surface); border-color: var(--line); }
.storefront-theme .site-header nav, .storefront-theme .site-nav-form button { color: var(--muted); }
.storefront-theme .site-header nav a:hover, .storefront-theme .site-nav-form button:hover { color: var(--primary); }
.storefront-theme .brand-mark { background: var(--primary); }
.storefront-theme .eyebrow, .storefront-theme .price, .storefront-theme .btn-secondary { color: var(--primary); }
.storefront-theme .panel, .storefront-theme .product-card, .storefront-theme .payment-shell, .storefront-theme .merchant-store-card { background: var(--surface); border-color: var(--line); box-shadow: var(--shadow); }
.storefront-theme .product-card:hover { border-color: var(--primary); }
.storefront-theme .product-card p, .storefront-theme .description, .storefront-theme .field-help, .storefront-theme .payment-title div span { color: var(--muted); }
.storefront-theme .btn-primary { color: #fff; background: var(--primary); border-color: var(--primary); }
.storefront-theme .btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.storefront-theme input, .storefront-theme textarea, .storefront-theme select { color: var(--text); background: var(--surface-alt); border-color: var(--line); }
.storefront-theme .notice-line { color: var(--primary); background: var(--surface-alt); border-left-color: var(--primary); }
.storefront-theme .checkout-meta, .storefront-theme .detail-title, .storefront-theme .payment-meta div { border-color: var(--line); }
.storefront-theme .amount-block strong { color: var(--text); }
.storefront-theme .address-block { background: var(--surface-alt); border-color: var(--line); }
.storefront-theme .payment-warning { color: var(--warning-text); }
.storefront-theme.theme-02 .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
.storefront-theme.theme-02 .product-card { border-top: 4px solid var(--primary); }
.storefront-theme.theme-03 .product-card { border-bottom: 4px solid var(--primary); }
.storefront-theme.theme-04 .site-header { box-shadow: 0 4px 18px rgba(80,48,120,.12); }
.storefront-theme.theme-05 .product-card { border-width: 2px; }
.storefront-theme.theme-06 .site-header, .storefront-theme.theme-07 .site-header, .storefront-theme.theme-12 .site-header, .storefront-theme.theme-16 .site-header, .storefront-theme.theme-20 .site-header { background: var(--surface-alt); }
.storefront-theme.theme-06 .product-card, .storefront-theme.theme-12 .product-card, .storefront-theme.theme-16 .product-card, .storefront-theme.theme-20 .product-card { border-radius: 5px; }
.storefront-theme.theme-07 .product-card { border-radius: 2px; box-shadow: none; }
.storefront-theme.theme-08 .product-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.storefront-theme.theme-08 .product-card { padding: 18px; }
.storefront-theme.theme-09 .product-card-top { padding-left: 14px; border-left: 4px solid var(--primary); }
.storefront-theme.theme-10 .product-card-bottom { padding-top: 14px; border-top: 1px solid var(--line); }
.storefront-theme.theme-11 .product-card { border-radius: 2px; box-shadow: none; }
.storefront-theme.theme-12 .price strong, .storefront-theme.theme-12 h1, .storefront-theme.theme-12 h2 { color: var(--accent); }
.storefront-theme.theme-13 .product-card { border-radius: 8px; }
.storefront-theme.theme-14 .product-grid { gap: 24px; }
.storefront-theme.theme-15 .product-card { border-radius: 3px; }
.storefront-theme.theme-16 .site-header { border-bottom: 2px solid var(--primary); }
.storefront-theme.theme-17 .stock-limited { color: #5c5e00; background: #f4f39a; }
.storefront-theme.theme-18 .product-card { border-top: 3px solid var(--primary); }
.storefront-theme.theme-19 .product-grid { width: min(960px, 100%); margin: 0 auto; }
.storefront-theme.theme-20 .site-header { border-bottom: 2px solid var(--primary); }
.storefront-theme.theme-20 .product-card:hover { box-shadow: 0 0 0 2px var(--primary), var(--shadow); }

@media (max-width: 820px) {
    .theme-picker-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .storefront-theme.theme-02 .product-grid, .storefront-theme.theme-08 .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 560px) {
    .theme-picker-grid { grid-template-columns: 1fr; }
    .storefront-theme.theme-02 .product-grid, .storefront-theme.theme-08 .product-grid { grid-template-columns: 1fr; }
}
