.url-field {
    width: min(420px, 100%);
    border: 1px solid #d0d5dd;
    border-radius: 8px;
    padding: 8px 10px;
    margin-bottom: 7px;
    background: #f8fafc;
    color: #344054;
    font: 11px ui-monospace, SFMono-Regular, monospace;
}
.address {
    min-width: 190px;
    margin-top: 8px;
    padding: 8px 10px;
    border-radius: 8px;
    background: #f8fafc;
    font-size: 12px;
    line-height: 1.55;
}
.order-action { width: 230px; padding-top: 8px; }
.order-table { min-width: 1450px; }
details summary { cursor: pointer; color: #5925dc; font-size: 12px; font-weight: 700; margin-top: 8px; }

.refresh-controls {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}
.refresh-controls form { display: flex; gap: 8px; margin: 0; }
.refresh-controls select { min-width: 210px; }
.refresh-controls .btn { white-space: nowrap; }

.ops-hero {
    border: 1px solid #e1e7ef;
    border-radius: 22px;
    background: #fff;
    box-shadow: 0 22px 55px rgba(16,24,40,.07);
    overflow: hidden;
}
.ops-title {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    padding: 28px 30px 22px;
    border-bottom: 1px solid #e9edf3;
}
.ops-title > div:first-child { position: relative; padding-left: 48px; }
.ops-title h2 { margin: 0 0 7px; font-size: 27px; color: #101828; }
.ops-title p { margin: 0; color: #667085; }
.ops-icon {
    position: absolute;
    left: 0;
    top: 0;
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    color: #2878f0;
    font-size: 27px;
    font-weight: 800;
}
.ops-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0,1fr));
    gap: 16px;
    padding: 24px 30px 10px;
}
.ops-stats.five { grid-template-columns: repeat(5, minmax(0,1fr)); }
.ops-stats article {
    min-height: 112px;
    padding: 20px 22px;
    border: 1px solid #e4e9f0;
    border-left: 4px solid #2367db;
    border-radius: 14px;
    background: linear-gradient(150deg,#fff,#f8faff);
}
.ops-stats article span,.ops-stats article small { display: block; color: #667085; }
.ops-stats article strong { display: block; margin: 8px 0 5px; font-size: 26px; color: #101828; }
.filter-chips {
    margin: 18px 30px;
    padding: 16px 18px;
    border-radius: 13px;
    background: #f8fafc;
}
.filter-chips > div { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.filter-chips > div + div { margin-top: 10px; }
.filter-chips b { min-width: 74px; color: #344054; }
.filter-chips a,.filter-tabs a {
    padding: 8px 13px;
    border: 1px solid #d9e0e9;
    border-radius: 9px;
    color: #667085;
    text-decoration: none;
    background: #fff;
}
.filter-chips a.active,.filter-tabs a.active { border-color: #111827; color: #fff; background: #111827; }
.order-search {
    display: grid;
    grid-template-columns: minmax(240px,2fr) minmax(180px,1fr) 150px 150px auto auto auto;
    gap: 10px;
    padding: 0 30px 20px;
}
.dispute-center .order-search { grid-template-columns: minmax(280px,2fr) minmax(220px,1fr) auto auto; padding-top: 18px; }
.filter-tabs { display: flex; gap: 8px; flex-wrap: wrap; padding: 0 30px 20px; }
.modern-orders { min-width: 1560px; margin: 0; }
.modern-orders thead th { background: #f7f9fc; color: #344054; }
.modern-orders td { vertical-align: top; line-height: 1.5; }
.ops-hero > .table-wrap { border-top: 1px solid #eaecf0; }
.case-link { color: #1d4ed8; text-decoration: none; }
.case-link:hover { text-decoration: underline; }

.dispute-detail { margin-top: 22px; }
.detail-grid {
    display: grid;
    grid-template-columns: repeat(4,minmax(0,1fr));
    gap: 12px;
    padding: 20px 24px;
}
.detail-grid > div {
    min-height: 80px;
    padding: 14px 16px;
    border: 1px solid #e4e9f0;
    border-radius: 12px;
    background: #fafbfc;
}
.detail-grid span,.detail-grid small { display: block; margin-bottom: 7px; color: #667085; }
.dispute-detail > h3,.dispute-detail > .json-summary,.dispute-detail > .message-list { margin-left: 24px; margin-right: 24px; }
.json-summary { max-height: 330px; overflow: auto; padding: 16px; border-radius: 12px; background: #101828; color: #e5edf8; font-size: 12px; }
.message-list { display: grid; gap: 10px; }
.message-list article { padding: 14px 16px; border: 1px solid #e4e9f0; border-radius: 12px; background: #fff; }
.message-list p { margin: 8px 0; }
.message-list small { color: #667085; }
.dispute-actions { display: grid; gap: 14px; padding: 24px; }
.action-card { padding: 18px; border: 1px solid #dce3ed; border-radius: 14px; background: #f8fafc; }
.action-card textarea { min-height: 100px; }
.danger-card { border-color: #fecaca; background: #fff7f7; }
.dispute-delay-note { margin: 18px 30px 0; }
.order-action select { width: 100%; }

@media (max-width: 1180px) {
    .ops-title { flex-direction: column; }
    .refresh-controls { justify-content: flex-start; }
    .ops-stats.five { grid-template-columns: repeat(3,minmax(0,1fr)); }
    .order-search,.dispute-center .order-search { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .detail-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 700px) {
    .ops-title,.ops-stats,.filter-chips,.order-search,.filter-tabs { padding-left: 16px; padding-right: 16px; }
    .ops-stats,.ops-stats.five { grid-template-columns: 1fr; }
    .order-search,.dispute-center .order-search { grid-template-columns: 1fr; }
    .detail-grid { grid-template-columns: 1fr; }
    .refresh-controls,.refresh-controls form { width: 100%; }
    .refresh-controls form { flex-direction: column; }
    .refresh-controls select { min-width: 0; width: 100%; }
}
.human-records{display:grid;gap:16px;margin:12px 0 24px}.human-record{border:1px solid #dfe5ef;border-radius:16px;background:#fff;padding:18px}.human-record h4{margin:0 0 14px;font-size:17px}.human-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(190px,1fr));gap:12px}.human-grid>div{background:#f7f9fc;border-radius:11px;padding:11px 13px;min-width:0}.human-grid span{display:block;color:#718096;font-size:12px;margin-bottom:5px}.human-grid strong{display:block;overflow-wrap:anywhere}.human-table{width:100%;border-collapse:collapse;margin-top:14px}.human-table th,.human-table td{text-align:left;padding:10px;border-bottom:1px solid #e8edf4;font-size:13px}.human-table th{color:#667085;background:#f7f9fc}@media(max-width:700px){.human-grid{grid-template-columns:1fr}.human-table{display:block;overflow:auto}}
.order-center{overflow:visible}.filter-chips.compact{margin-bottom:18px}.compact-search{grid-template-columns:minmax(260px,2fr) minmax(190px,1fr) 150px 150px auto auto auto}.order-card-list{display:grid;gap:18px;padding-top:22px}.order-card{background:#fff;border:1px solid #dfe5ef;border-radius:20px;box-shadow:0 8px 24px rgba(24,39,75,.06);overflow:hidden}.order-card-head{display:flex;align-items:flex-start;justify-content:space-between;gap:22px;padding:22px 24px 18px;border-bottom:1px solid #edf1f6}.order-card-head h3{font-size:20px;margin:9px 0 4px;overflow-wrap:anywhere}.order-card-head>div>span{color:#667085}.order-badges{display:flex;gap:7px;flex-wrap:wrap}.order-total{text-align:right;white-space:nowrap}.order-total small{display:block;color:#7b8798}.order-total strong{display:inline-block;font-size:27px;margin-top:4px}.order-total b{margin-left:6px;color:#344054}.order-card-grid{display:grid;grid-template-columns:1.05fr 1.5fr 1.25fr .9fr 1.15fr 1fr;gap:0}.order-card-grid section{padding:18px 20px;border-right:1px solid #edf1f6;min-width:0}.order-card-grid section:last-child{border-right:0}.order-card-grid h4{font-size:12px;color:#667085;text-transform:uppercase;letter-spacing:.04em;margin:0 0 10px}.order-card-grid strong,.order-card-grid span,.order-card-grid code{display:block;margin:4px 0;overflow-wrap:anywhere}.order-card-grid p{margin:8px 0 0;padding:9px 11px;background:#f7f9fc;border-radius:10px;color:#667085;overflow-wrap:anywhere}.order-card-grid .tracking-error{color:#b42318;background:#fff1f0;font-size:12px}.order-card-actions{display:flex;align-items:flex-start;gap:12px;padding:16px 24px;background:#f8fafc;border-top:1px solid #edf1f6}.order-tools{flex:1;min-width:0}.order-tools summary{cursor:pointer;display:inline-flex;align-items:center;min-height:38px;padding:0 14px;border:1px solid #cfd7e4;border-radius:9px;background:#fff;color:#4f46e5;font-weight:700}.order-tools[open] summary{margin-bottom:14px}.order-tool-grid{display:grid;grid-template-columns:minmax(360px,2fr) minmax(230px,1fr);gap:14px}.order-action{display:grid;grid-template-columns:auto minmax(150px,1fr) auto minmax(170px,1fr) auto;align-items:end;gap:8px;padding:14px;background:#fff;border:1px solid #dfe5ef;border-radius:14px}.order-action label{font-size:12px;color:#667085}.order-action input,.order-action select{min-width:0;width:100%}.refund-action{grid-template-columns:auto minmax(150px,1fr) auto}.order-empty{padding:60px 20px;text-align:center;background:#fff;border-radius:18px}@media(max-width:1450px){.order-card-grid{grid-template-columns:repeat(3,1fr)}.order-card-grid section{border-bottom:1px solid #edf1f6}.compact-search{grid-template-columns:2fr 1fr 150px 150px}.compact-search .btn{justify-content:center}.order-tool-grid{grid-template-columns:1fr}.order-action{grid-template-columns:auto 1fr auto 1fr auto}}@media(max-width:900px){.compact-search{grid-template-columns:1fr 1fr}.order-card-grid{grid-template-columns:1fr 1fr}.order-card-head{padding:18px}.order-card-actions{padding:14px;flex-direction:column}.order-tools{width:100%}.order-action{grid-template-columns:1fr}.order-action label{margin-top:5px}}@media(max-width:620px){.compact-search,.order-card-grid{grid-template-columns:1fr}.order-card-head{flex-direction:column}.order-total{text-align:left}.order-card-grid section{border-right:0}.order-tools summary{width:100%;justify-content:center}}

/* Compact merchant order cards (v1.5.5). */
.order-card-list{gap:12px;padding-top:16px}
.order-card{border-radius:16px;box-shadow:0 5px 18px rgba(24,39,75,.045)}
.order-card-head{align-items:center;padding:15px 18px 13px}
.order-card-head h3{font-size:18px;margin:6px 0 2px}
.order-total strong{font-size:24px;margin-top:1px}
.order-card-grid section{padding:13px 16px;font-size:13px}
.order-card-grid h4{margin-bottom:7px}
.order-card-grid strong,.order-card-grid span,.order-card-grid code{margin:2px 0}
.order-card-grid p{max-height:52px;overflow:auto;margin-top:6px;padding:7px 9px}
.tracking-error-details{margin-top:6px}
.tracking-error-details summary{cursor:pointer;color:#b42318;font-size:12px;font-weight:700}
.tracking-error-details .tracking-error{max-height:110px;margin-top:6px}
.order-card-actions{align-items:center;flex-wrap:wrap;padding:10px 18px;gap:8px}
.order-card-actions form{margin:0}
.order-card-actions .btn,.order-tools summary{min-height:36px;height:36px;padding:0 13px;box-sizing:border-box}
.order-tools{flex:0 1 auto}
.order-tools[open]{flex:1 1 auto;display:flex;align-items:center;gap:8px;min-width:0}
.order-tools[open] summary{flex:none;margin-bottom:0}
.order-tool-grid{flex:1;grid-template-columns:minmax(390px,2fr) minmax(220px,1fr);gap:8px;min-width:0}
.order-action{grid-template-columns:minmax(160px,1fr) minmax(190px,1.25fr) auto;align-items:center;padding:10px;gap:8px}
.order-action label{display:none}
.order-action input,.order-action select,.order-action .btn{height:38px;box-sizing:border-box}
.refund-action{grid-template-columns:minmax(160px,1fr) auto}
@media(min-width:1101px){.order-card-actions{flex-wrap:nowrap}.order-action{padding:6px}.order-tools[open] .order-tool-grid{display:grid}}
@media(max-width:1450px){.order-card-grid{grid-template-columns:repeat(4,1fr)}.order-card-grid section{border-bottom:1px solid #edf1f6}.order-action{grid-template-columns:minmax(130px,1fr) minmax(160px,1fr) auto}.refund-action{grid-template-columns:minmax(130px,1fr) auto}}
@media(max-width:1100px){.order-tools[open]{flex:1 0 100%;display:block}.order-tools[open] summary{margin-bottom:8px}.order-tool-grid{grid-template-columns:1fr}.order-action{grid-template-columns:1fr 1fr auto}}
@media(max-width:980px){.order-card-grid{grid-template-columns:repeat(2,1fr)}.order-card-actions{align-items:stretch}.order-tool-grid{grid-template-columns:1fr}.order-action{grid-template-columns:1fr 1fr auto}}
@media(max-width:620px){.order-card-head{padding:14px}.order-card-grid{grid-template-columns:1fr}.order-card-grid section{padding:12px 14px}.order-card-actions{padding:10px 14px}.order-card-actions>form,.order-card-actions>form .btn,.order-tools{width:100%}.order-action,.refund-action{grid-template-columns:1fr}.order-action .btn{width:100%}}

/* Compact invoice list (v1.5.6). */
.invoice-list-panel{min-width:0}
.invoice-table{table-layout:auto}
.invoice-table th,.invoice-table td{vertical-align:top}
.invoice-table th:nth-child(1){width:18%}
.invoice-table th:nth-child(2){width:20%}
.invoice-table th:nth-child(3){width:12%}
.invoice-table th:nth-child(4){width:27%}
.invoice-table th:nth-child(5){width:15%}
.invoice-table th:nth-child(6){width:8%}
.invoice-table td:nth-child(4){min-width:260px}
.invoice-table td:nth-child(5){min-width:165px}
.invoice-table td:nth-child(6){min-width:104px}
.invoice-table .url-field{width:100%;height:38px;box-sizing:border-box}
.invoice-table td:nth-child(4) .actions{display:flex;align-items:center;flex-wrap:nowrap;gap:6px;margin-top:6px}
.invoice-table td:nth-child(4) .actions .btn{flex:0 0 auto;min-height:36px;padding:0 12px;white-space:nowrap}
.invoice-table td:nth-child(6) .btn{min-width:88px;min-height:38px;padding:0 10px;white-space:nowrap;word-break:keep-all}
@media(max-width:1200px){.invoice-list-panel .table-wrap{overflow-x:auto}.invoice-table{min-width:980px}}

/* Merchant form polish and stable carrier selection. */
select,
.select-control {
    min-height: 42px;
    border: 1px solid #cfd7e4;
    border-radius: 12px;
    padding: 10px 38px 10px 13px;
    color: #101828;
    background-color: #fff;
    background-image: linear-gradient(45deg, transparent 50%, #667085 50%), linear-gradient(135deg, #667085 50%, transparent 50%);
    background-position: calc(100% - 17px) 18px, calc(100% - 12px) 18px;
    background-size: 5px 5px, 5px 5px;
    background-repeat: no-repeat;
    box-shadow: 0 2px 5px rgba(16,24,40,.04);
    transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
    appearance: none;
}
select:hover,
.select-control:hover { border-color: #aab5c7; }
select:focus,
.select-control:focus { border-color: #7f56d9; box-shadow: 0 0 0 4px #7f56d91a; outline: 0; }
.transaction-identifiers .identifier-code {
    margin: 6px 0 10px;
    padding: 7px 9px;
    border: 1px solid #d9e0eb;
    border-radius: 8px;
    background: #f8fafc;
    color: #182230;
    font-size: 14px;
    line-height: 1.45;
    letter-spacing: .01em;
}
.carrier-picker { display: grid; grid-template-columns: minmax(150px, 1fr) minmax(150px, 1fr); gap: 8px; min-width: 0; }
.carrier-picker input[hidden] { display: none; }
.carrier-picker input:not([hidden]) { display: block; }
.shipping-action .carrier-picker select,
.shipping-action .carrier-picker input,
.shipping-action > input[name="tracking_number"] { min-width: 0; width: 100%; }
@media(max-width:1100px){.carrier-picker{grid-template-columns:1fr 1fr}.shipping-action{grid-template-columns:1fr 1fr auto}}
@media(max-width:620px){.carrier-picker{grid-template-columns:1fr}.shipping-action{grid-template-columns:1fr}.shipping-action .btn{width:100%}}

/* Keep the expanded shipping tools from inheriting the legacy 230px width. */
.order-card-actions .order-tools[open] {
    flex: 1 1 100%;
    width: calc(100% - 108px);
    margin-left: 108px;
    display: block;
    min-width: 0;
}
.order-card-actions .order-tools[open] summary { margin-bottom: 10px; }
.order-card-actions .order-tool-grid {
    display: grid;
    width: 100%;
    grid-template-columns: minmax(0, 1fr) minmax(230px, .42fr);
    gap: 12px;
}
.order-card-actions .order-action {
    width: 100%;
    min-width: 0;
}
.order-card-actions .shipping-action {
    grid-template-columns: minmax(300px, 1.4fr) minmax(220px, 1fr) auto;
}
.order-card-actions .shipping-action .btn {
    min-width: 108px;
    white-space: nowrap;
}
@media(max-width:1100px){
    .order-card-actions .order-tools[open] { width: 100%; margin-left: 0; }
    .order-card-actions .order-tool-grid { grid-template-columns: 1fr; }
    .order-card-actions .shipping-action { grid-template-columns: 1fr 1fr auto; }
}
@media(max-width:620px){
    .order-card-actions .shipping-action { grid-template-columns: 1fr; }
    .order-card-actions .shipping-action .btn { width: 100%; }
}
@media(min-width:1101px){
    .order-card-actions { flex-wrap: wrap; }
    .order-card-actions .order-tools[open] { flex: 1 1 calc(100% - 108px); }
}
@media(min-width:1400px){
    .order-card-actions { display: flex; flex-wrap: nowrap; align-items: center; }
    .order-card-actions .order-tools[open] {
        flex: 1 1 auto;
        width: auto;
        margin-left: 0;
        display: grid;
        grid-template-columns: auto minmax(0, 1fr);
        align-items: center;
        gap: 10px;
    }
    .order-card-actions .order-tools[open] summary { margin-bottom: 0; white-space: nowrap; }
    .order-card-actions .order-tool-grid {
        grid-template-columns: minmax(0, 1fr) minmax(240px, .4fr);
        gap: 10px;
    }
    .order-card-actions .shipping-action {
        grid-template-columns: minmax(200px, 1.15fr) minmax(190px, 1fr) auto;
    }
    .order-card-actions .carrier-picker {
        grid-template-columns: minmax(170px, 1fr) minmax(170px, 1fr);
    }
}

/* Show the full shipping address instead of clipping it into a tiny scroller. */
.order-card-grid section:nth-child(2) p {
    min-height: 78px;
    max-height: none;
    overflow: visible;
    white-space: normal;
}

.account-name-form { margin-top: 8px; }
.account-name-form input {
    min-width: 170px;
    height: 36px;
    padding: 7px 10px;
    border: 1px solid #cfd7e4;
    border-radius: 9px;
    background: #fff;
    color: #182230;
}

/* Keep account edits in one calm, vertical control group. */
.merchant-accounts-panel .account-table {
    min-width: 980px;
    table-layout: fixed;
}
.merchant-accounts-panel .account-table th:nth-child(1) { width: 20%; }
.merchant-accounts-panel .account-table th:nth-child(2) { width: 14%; }
.merchant-accounts-panel .account-table th:nth-child(3) { width: 9%; }
.merchant-accounts-panel .account-table th:nth-child(4) { width: 12%; }
.merchant-accounts-panel .account-table th:nth-child(5) { width: 14%; }
.merchant-accounts-panel .account-table th:nth-child(6) { width: 13%; }
.merchant-accounts-panel .account-table th:nth-child(7) { width: 18%; }
.merchant-accounts-panel .account-table td:last-child {
    min-width: 220px;
    background: #fbfcfe;
}
.account-save-form {
    display: grid;
    gap: 9px;
    min-width: 190px;
}
.account-save-form label {
    display: grid;
    gap: 5px;
}
.account-save-form label > span {
    color: #667085;
    font-size: 11px;
    font-weight: 700;
}
.account-save-form select,
.account-save-form input {
    width: 100%;
    min-width: 0;
    min-height: 38px;
    padding: 8px 10px;
    border: 1px solid #cfd7e4;
    border-radius: 9px;
    background: #fff;
    color: #182230;
}
.account-save-form .btn { width: 100%; min-height: 38px; }
.account-save-form small { display: block; margin-top: 1px; }
.account-save-form select:disabled,
.account-save-form input[readonly] {
    background: #f2f4f7;
    color: #667085;
    cursor: not-allowed;
}
@media(max-width:900px) {
    .merchant-accounts-panel .account-table { min-width: 900px; }
}
@media(max-width:620px) {
    .merchant-accounts-panel .table-wrap { overflow: visible; }
    .merchant-accounts-panel .account-table { min-width: 0; display: block; }
    .merchant-accounts-panel .account-table thead { display: none; }
    .merchant-accounts-panel .account-table tbody { display: grid; gap: 10px; padding: 10px; }
    .merchant-accounts-panel .account-table tbody tr { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; padding: 8px 12px; border: 1px solid #e4e7ec; border-radius: 10px; background: #fff; }
    .merchant-accounts-panel .account-table td { min-width: 0; padding: 8px 0; border: 0; }
    .merchant-accounts-panel .account-table td:nth-child(1),
    .merchant-accounts-panel .account-table td:nth-child(2),
    .merchant-accounts-panel .account-table td:last-child { grid-column: 1 / -1; }
    .merchant-accounts-panel .account-table td::before { display: block; margin-bottom: 4px; color: #98a2b3; font-size: 10px; font-weight: 800; }
    .merchant-accounts-panel .account-table td:nth-child(1)::before { content: "账号"; }
    .merchant-accounts-panel .account-table td:nth-child(2)::before { content: "站点"; }
    .merchant-accounts-panel .account-table td:nth-child(3)::before { content: "环境"; }
    .merchant-accounts-panel .account-table td:nth-child(4)::before { content: "收款状态"; }
    .merchant-accounts-panel .account-table td:nth-child(5)::before { content: "本月额度"; }
    .merchant-accounts-panel .account-table td:nth-child(6)::before { content: "最后同步"; }
    .merchant-accounts-panel .account-table td:last-child::before { content: "操作"; }
    .merchant-accounts-panel .account-table td:last-child { min-width: 0; padding-top: 12px; background: transparent; }
}

/* Merchant subaccounts and feature permissions (v1.6.0). */
.permission-summary { margin-top: 18px; padding-top: 16px; border-top: 1px solid #e4e7ec; }
.permission-summary > strong { display: block; margin-bottom: 10px; }
.permission-summary > div { display: flex; flex-wrap: wrap; gap: 7px; }
.permission-summary span { padding: 5px 9px; border: 1px solid #b8d8c7; border-radius: 6px; background: #edf8f2; color: #176b45; font-size: 12px; font-weight: 700; }
.subaccounts-panel { margin-top: 22px; }
.subaccount-count { min-width: 58px; padding: 7px 10px; border-radius: 6px; background: #eef4ff; color: #1849a9; text-align: center; font-weight: 800; }
.subaccount-list { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; }
.subaccount-editor { min-width: 0; border: 1px solid #dfe5ec; border-radius: 8px; background: #fbfcfd; overflow: hidden; }
.subaccount-editor[open] { grid-column: 1/-1; background: #fff; }
.subaccount-title { display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: 12px; min-height: 76px; margin: 0; padding: 14px 18px; list-style: none; cursor: pointer; }
.subaccount-title::-webkit-details-marker { display: none; }
.subaccount-title::before { content: ""; width: 0; height: 0; border-top: 5px solid transparent; border-bottom: 5px solid transparent; border-left: 6px solid #667085; transform-origin: 2px 5px; transition: transform .15s ease; }
.subaccount-editor[open] > .subaccount-title::before { transform: rotate(90deg); }
.subaccount-title:hover { background: #f5f7fa; }
.subaccount-identity { display: grid; gap: 4px; min-width: 0; }
.subaccount-identity strong,.subaccount-identity span { display: block; overflow-wrap: anywhere; }
.subaccount-identity strong { font-size: 17px; }
.subaccount-identity span { color: #667085; font-size: 13px; }
.subaccount-summary-actions { display: flex; align-items: center; justify-content: flex-end; gap: 9px; min-width: 0; }
.subaccount-edit-label { color: #1849a9; font-size: 13px; font-weight: 800; white-space: nowrap; }
.subaccount-editor-body { padding: 18px; border-top: 1px solid #dfe5ec; }
.permission-fieldset { min-width: 0; margin: 18px 0 0; padding: 0; border: 0; }
.permission-fieldset legend { margin-bottom: 10px; color: #344054; font-size: 13px; font-weight: 800; }
.permission-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; }
.permission-grid label { display: flex; align-items: center; gap: 8px; min-width: 0; min-height: 40px; padding: 8px 10px; border: 1px solid #d8dee8; border-radius: 6px; background: #fff; cursor: pointer; }
.permission-grid label:has(input:checked) { border-color: #76b997; background: #edf8f2; color: #176b45; }
.permission-grid input { width: 17px; height: 17px; margin: 0; accent-color: #16815b; }
.permission-grid span { min-width: 0; font-size: 13px; font-weight: 700; overflow-wrap: anywhere; }
.subaccount-delete { display: grid; grid-template-columns: minmax(180px,1fr) auto; align-items: end; gap: 10px; margin-top: 16px; padding-top: 16px; border-top: 1px solid #e4e7ec; }
.subaccount-delete .btn { min-height: 42px; }
.subaccount-empty { grid-column: 1/-1; padding: 26px; border: 1px dashed #b8c2d1; border-radius: 8px; color: #667085; text-align: center; }
.subaccount-create { border-top: 1px solid #e4e7ec; }
.subaccount-create h3 { margin: 0 0 16px; font-size: 18px; }
@media(max-width:1100px){.subaccount-list{grid-template-columns:1fr}.permission-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:620px){.permission-grid{grid-template-columns:1fr}.subaccount-delete{grid-template-columns:1fr}.subaccount-delete .btn{width:100%}.subaccount-title{min-height:68px;padding:12px}.subaccount-summary-actions{align-items:flex-end;flex-direction:column;gap:4px}.subaccount-editor-body{padding:14px}}

/* Ten-item server-side pagination (v1.6.1). */
.pagination{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:16px 20px;border-top:1px solid #e4e7ec;background:#fff}
.pagination-summary{color:#667085;font-size:13px}
.pagination-pages{display:flex;align-items:center;gap:6px;flex-wrap:wrap}
.pagination-pages a,.pagination-pages span{display:inline-flex;align-items:center;justify-content:center;min-width:38px;height:38px;padding:0 11px;border:1px solid #d0d5dd;border-radius:7px;background:#fff;color:#344054;font-size:13px;font-weight:700;text-decoration:none;box-sizing:border-box}
.pagination-pages a:hover{border-color:#7f56d9;color:#6941c6}
.pagination-pages a.active{border-color:#6941c6;background:#6941c6;color:#fff}
.pagination-pages .disabled{background:#f9fafb;color:#98a2b3;cursor:not-allowed}
.pagination-pages .ellipsis{min-width:24px;padding:0;border:0;background:transparent}
@media(max-width:700px){.pagination{align-items:flex-start;flex-direction:column}.pagination-pages{width:100%}}

/* Compact order ledger (v1.6.4). */
.order-ledger{overflow:hidden;border:1px solid #dfe3e8;border-radius:8px;background:#fff;box-shadow:0 4px 14px rgba(16,24,40,.04)}
.order-ledger-head{display:flex;align-items:center;justify-content:space-between;gap:20px;padding:16px 18px;border-bottom:1px solid #e7eaee}
.order-ledger-head h2{margin:0 0 4px;font-size:18px}
.order-ledger-head p{margin:0;color:#667085;font-size:12px}
.order-filters{padding:14px 16px 12px;background:#fafbfc;border-bottom:1px solid #e7eaee}
.order-ledger .filter-chips.compact{margin:0 0 10px;padding:0;background:transparent;border-radius:0}
.order-ledger .filter-chips>div+div{margin-top:6px}
.order-ledger .filter-chips b{min-width:60px;font-size:12px}
.order-ledger .filter-chips a{padding:5px 9px;border-radius:4px;font-size:12px}
.order-ledger .ledger-search{display:flex;flex-wrap:nowrap;align-items:center;gap:12px;padding:14px 16px;grid-template-columns:none}
.order-ledger .ledger-search input[name="q"],.order-ledger .ledger-search input[type="text"]{flex:1 1 auto;min-width:0;width:auto;height:42px;min-height:42px;padding:0 16px;border-radius:12px;box-shadow:0 2px 5px rgba(23,37,59,.08),inset 0 1px 2px rgba(23,37,59,.05)}
.order-ledger .ledger-search select{flex:0 0 220px;width:220px;max-width:220px;height:42px;min-height:42px;padding:0 14px;border-radius:12px;box-shadow:0 2px 5px rgba(23,37,59,.08),inset 0 1px 2px rgba(23,37,59,.05);background-position:right 12px center}
.order-ledger .ledger-search .rp{flex:0 0 auto}
.order-ledger .ledger-search .btn{flex:0 0 auto;min-height:42px;height:42px;padding:0 18px;border-radius:12px}
.ledger-wrap{overflow-x:auto}
.order-ledger-table{min-width:1105px;table-layout:fixed}
.order-ledger-table th{padding:9px 10px;background:#f4f6f8;color:#475467;font-size:11px;letter-spacing:0;text-transform:none;border-right:1px solid #e4e7ec}
.order-ledger-table td{height:52px;padding:6px 10px;vertical-align:middle;border-right:1px solid #edf0f2;font-size:13px}
.order-ledger-table th:last-child,.order-ledger-table td:last-child{border-right:0}
.order-ledger-table th:nth-child(1){width:230px}.order-ledger-table th:nth-child(2){width:135px}.order-ledger-table th:nth-child(3){width:175px}.order-ledger-table th:nth-child(4){width:130px}.order-ledger-table th:nth-child(5){width:190px}.order-ledger-table th:nth-child(6){width:140px}.order-ledger-table th:nth-child(7){width:105px}
.order-ledger-table code{display:block;max-width:100%;margin-top:3px;padding:0;background:transparent;color:#475467;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.order-ledger-table .ledger-paypal-id{margin-top:0;font:800 15px/1.35 ui-monospace,SFMono-Regular,Consolas,monospace;color:#182230;letter-spacing:0}
.ledger-transaction{display:flex;align-items:center;gap:7px;min-width:0}
.ledger-transaction .ledger-paypal-id{min-width:0;flex:1}
.icon-only{display:inline-grid;place-items:center;width:30px;height:30px;padding:0;border:1px solid #d0d5dd;border-radius:6px;background:#fff;color:#475467;cursor:pointer}
.icon-only:hover{background:#f2f4f7;color:#344054}
.icon-only.is-copied{border-color:#abefc6;background:#ecfdf3;color:#067647}
.icon-only.copy-failed{border-color:#fecdca;background:#fef3f2;color:#b42318}
.icon-only svg{width:15px;height:15px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.cell-subtext{display:block;max-width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.cell-subtext{margin-top:1px;color:#667085;font-size:11px;line-height:1.25}
.order-ledger-table .ledger-source strong,.order-ledger-table .ledger-site strong{display:block;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.order-ledger-table .ledger-source .cell-subtext,.order-ledger-table .ledger-site .cell-subtext{line-height:1.25}
.cell-nowrap{white-space:nowrap;color:#475467;font-size:12px!important}
.ledger-amount{font-weight:800;color:#101828;font-variant-numeric:tabular-nums}
.order-ledger-table .badge{padding:4px 7px;border-radius:3px;white-space:nowrap}
.ledger-actions{display:grid;grid-template-columns:repeat(2,max-content);align-items:center;gap:6px;white-space:nowrap}
.ledger-actions form{margin:0}
.ledger-actions .btn,.compact-btn{min-width:44px;min-height:30px;height:30px;padding:0 9px;border-radius:4px;font-size:12px;line-height:1;white-space:nowrap;word-break:keep-all}
.order-dialog{width:min(1040px,calc(100vw - 32px));max-height:calc(100vh - 32px);padding:0;border:0;border-radius:10px;background:#f7f8fb;box-shadow:0 24px 70px rgba(16,24,40,.28);color:#101828}
.order-dialog::backdrop{background:rgba(16,24,40,.48)}
.order-dialog-head{position:sticky;top:0;z-index:2;display:flex;align-items:flex-start;justify-content:space-between;gap:18px;padding:20px 24px;border-bottom:1px solid #e4e7ec;background:#fff}
.order-dialog-title{min-width:0}.order-dialog-kicker{display:flex;align-items:center;gap:8px;color:#667085;font-size:12px;font-weight:800}.order-dialog-icon,.detail-card-icon{display:inline-grid;place-items:center;width:28px;height:28px;border-radius:7px;background:#eef2ff;color:#4f46e5}.order-dialog-icon svg,.detail-card-icon svg{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}.order-dialog-title h3{margin:8px 0 7px;font:800 20px/1.25 ui-monospace,SFMono-Regular,Consolas,monospace;overflow-wrap:anywhere}.order-dialog-status{display:flex;gap:6px;flex-wrap:wrap}.dialog-close{font-size:22px;line-height:1}
.order-dialog-body{padding:20px 24px 24px;overflow:auto}.order-detail-layout{display:grid;grid-template-columns:minmax(0,1.55fr) minmax(260px,.75fr);gap:16px}.order-detail-main,.order-detail-side{display:grid;align-content:start;gap:16px}.detail-card{min-width:0;border:1px solid #e4e7ec;border-radius:8px;background:#fff;box-shadow:0 4px 14px rgba(16,24,40,.04);overflow:hidden}.detail-card>header,.order-action-card>header{display:flex;align-items:center;gap:10px;padding:13px 16px;border-bottom:1px solid #eef0f3}.detail-card>header h4,.order-action-card>header h4{margin:0;font-size:14px}.detail-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr))}.detail-list>div{min-width:0;padding:13px 16px;border-bottom:1px solid #eef0f3}.detail-list>div:nth-last-child(-n+2){border-bottom:0}.detail-list>div.detail-row-wide{grid-column:1/-1}.detail-list span,.detail-list small{display:block;color:#667085;font-size:11px}.detail-list strong,.detail-list code{display:block;margin-top:5px;overflow-wrap:anywhere}.detail-list p{margin:5px 0 0;color:#344054;line-height:1.55;overflow-wrap:anywhere}.detail-value-with-copy{display:flex;align-items:center;gap:8px;min-width:0}.detail-value-with-copy code{min-width:0;flex:1}.detail-value-with-copy .icon-only{width:26px;height:26px;flex:0 0 auto}.amount-card{background:#fff}.amount-breakdown{margin:0;padding:8px 16px 10px}.amount-breakdown>div{display:flex;align-items:center;justify-content:space-between;gap:14px;padding:11px 0;border-bottom:1px solid #eef0f3}.amount-breakdown dt{color:#667085;font-size:12px}.amount-breakdown dd{margin:0;font-size:13px;font-weight:700;text-align:right}.amount-breakdown .amount-refund{color:#b42318}.amount-breakdown .amount-total{margin-top:3px;padding-top:14px;border-bottom:0}.amount-total dt,.amount-total dd{color:#101828;font-size:15px;font-weight:800}.current-tracking{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-top:16px;padding:12px 14px;border:1px solid #b8dfcc;border-radius:8px;background:#f1faf5}.current-tracking span{display:block;color:#667085;font-size:11px}.current-tracking strong{display:block;margin-top:3px;overflow-wrap:anywhere}
.order-dialog .tracking-error{margin:12px 0 0}
.order-dialog-actions{display:grid;grid-template-columns:minmax(0,1.55fr) minmax(260px,.75fr);gap:16px;margin-top:16px;padding-top:16px;border-top:1px solid #e4e7ec}.order-action-card{min-width:0;border:1px solid #e4e7ec;border-radius:8px;background:#fff;overflow:hidden}.order-action-card>header{align-items:flex-start}.order-action-card>header small{display:block;margin-top:3px;color:#667085;font-size:11px}.shipping-action-card .detail-card-icon{background:#ecfdf3;color:#079455}.refund-action-card .detail-card-icon{background:#fff1f0;color:#d92d20}.dialog-shipping-form,.dialog-refund-form{display:block;padding:14px 16px}.action-label{display:block;margin-bottom:9px;color:#344054;font-size:12px;font-weight:800}.carrier-options{display:flex;flex-wrap:wrap;gap:7px;margin-bottom:12px}.carrier-option{display:inline-flex;align-items:center;gap:5px;min-height:30px;padding:5px 9px;border:1px solid #d0d5dd;border-radius:6px;background:#fff;color:#344054;font:700 11px system-ui;cursor:pointer}.carrier-option svg{width:14px;height:14px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}.carrier-option:hover,.carrier-option.active{border-color:#7f56d9;background:#f4f3ff;color:#5925dc}.shipping-fields{display:grid;grid-template-columns:minmax(180px,1fr) minmax(180px,1.15fr) auto;align-items:start;gap:8px}.carrier-picker{display:grid;gap:8px}.shipping-fields input,.shipping-fields select,.refund-fields input{width:100%;height:38px;min-height:38px;border-radius:6px;box-shadow:none}.shipping-fields .btn{height:38px;white-space:nowrap}.refund-fields{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px;align-items:center}.refund-fields .btn{height:38px;white-space:nowrap}
@media(max-width:1200px){.order-ledger .ledger-search{grid-template-columns:1fr 1fr}.order-ledger .ledger-search .btn{justify-content:center}}
@media(max-width:760px){.order-ledger-head{align-items:flex-start;flex-direction:column}.order-ledger .ledger-search{grid-template-columns:1fr 1fr}.order-detail-layout,.order-dialog-actions{grid-template-columns:1fr}.detail-card>header,.order-action-card>header{padding:12px 14px}.detail-list>div{padding:12px 14px}}
@media(max-width:520px){.order-ledger .ledger-search{grid-template-columns:1fr}.order-dialog{width:calc(100vw - 16px);max-height:calc(100vh - 16px)}.order-dialog-head{padding:16px}.order-dialog-title h3{font-size:16px}.order-dialog-body{padding:12px}.detail-list{grid-template-columns:1fr}.detail-list>div:nth-last-child(-n+2){border-bottom:1px solid #eef0f3}.detail-list>div:last-child{border-bottom:0}.shipping-fields,.refund-fields{grid-template-columns:1fr}.shipping-fields .btn,.refund-fields .btn{width:100%}.carrier-options{gap:6px}.carrier-option{flex:1 1 calc(33.333% - 6px);justify-content:center}}

/* Keep the optional Other carrier field in the same grid as the tracking input. */
.order-dialog .shipping-fields{grid-template-columns:minmax(0,1fr) minmax(0,1.15fr) auto}
.order-dialog .shipping-fields .carrier-picker{display:contents}
.order-dialog .shipping-fields .carrier-picker select{grid-column:1}
.order-dialog .shipping-fields .carrier-picker input:not([hidden]){grid-column:2}
.order-dialog .shipping-fields>input[name="tracking_number"],.order-dialog .shipping-fields>input[name="tracking_number_entry"]{grid-column:2}
.order-dialog .shipping-fields>.btn{grid-column:3}
.order-dialog .shipping-fields:has(.carrier-picker input[name="carrier_name_other"]:not([hidden])){grid-template-columns:minmax(0,1fr) minmax(0,1fr) minmax(0,1.15fr) auto}
.order-dialog .shipping-fields:has(.carrier-picker input[name="carrier_name_other"]:not([hidden]))>input[name="tracking_number"],.order-dialog .shipping-fields:has(.carrier-picker input[name="carrier_name_other"]:not([hidden]))>input[name="tracking_number_entry"]{grid-column:3}
.order-dialog .shipping-fields:has(.carrier-picker input[name="carrier_name_other"]:not([hidden]))>.btn{grid-column:4}
@media(max-width:760px){.order-dialog .shipping-fields,.order-dialog .shipping-fields:has(.carrier-picker input[name="carrier_name_other"]:not([hidden])){grid-template-columns:1fr}.order-dialog .shipping-fields .carrier-picker select,.order-dialog .shipping-fields .carrier-picker input:not([hidden]),.order-dialog .shipping-fields>input[name="tracking_number"],.order-dialog .shipping-fields>input[name="tracking_number_entry"],.order-dialog .shipping-fields>.btn{grid-column:auto}}

/* Keep the shipping workflow focused and visually separate from full order details. */
.shipping-dialog{width:min(720px,calc(100vw - 32px));max-height:min(760px,calc(100vh - 32px));border-radius:14px;background:#f8fafc}
.shipping-dialog .shipping-dialog-head{padding:18px 22px 16px;background:#fff}
.shipping-dialog .order-dialog-kicker{color:#067647}
.shipping-dialog .shipping-dialog-icon{background:#ecfdf3;color:#067647}
.shipping-dialog .order-dialog-title h3{margin:7px 0 0;font-family:system-ui,-apple-system,"Segoe UI",sans-serif;font-size:20px;letter-spacing:0}
.shipping-dialog .shipping-dialog-body{display:grid;gap:12px;padding:16px;background:#f8fafc}
.shipping-info-card{min-width:0;border:1px solid #e4e7ec;border-radius:10px;background:#fff;box-shadow:0 3px 12px rgba(16,24,40,.04);overflow:hidden}
.shipping-info-card>header{display:flex;align-items:center;gap:10px;padding:13px 16px;border-bottom:1px solid #eef0f3}
.shipping-info-card>header h4{margin:0;font-size:14px}
.shipping-info-card>header small{display:block;margin-top:3px;color:#667085;font-size:11px}
.shipping-info-card>header .detail-card-icon{background:#eef2ff;color:#4f46e5}
.shipping-info-card:first-child>header .detail-card-icon{background:#eff8ff;color:#1570ef}
.shipping-info-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr))}
.shipping-info-grid>div{min-width:0;padding:13px 16px}
.shipping-info-grid>div+div{border-left:1px solid #eef0f3}
.shipping-info-grid .shipping-info-wide{grid-column:1/-1;border-top:1px solid #eef0f3;border-left:0}
.shipping-info-grid span{display:block;color:#667085;font-size:11px}
.shipping-info-grid strong{display:block;margin-top:5px;overflow-wrap:anywhere;color:#101828;font-size:13px}
.shipping-info-grid p{margin:5px 0 0;color:#344054;font-size:13px;line-height:1.55;overflow-wrap:anywhere}
.shipping-transaction-value{display:flex;align-items:center;gap:10px;padding:14px 16px}
.shipping-transaction-value code{min-width:0;flex:1;padding:10px 12px;border:1px solid #d0d5dd;border-radius:8px;background:#f8fafc;color:#101828;font-size:13px;overflow-wrap:anywhere}
.shipping-transaction-value .icon-only{width:38px;height:38px;flex:0 0 auto;border-radius:8px}
.shipping-dialog-action{border-color:#b7e4c7;box-shadow:0 4px 16px rgba(6,118,71,.06)}
.shipping-dialog-action>header{padding:14px 16px;background:#f1faf5;border-bottom-color:#d1fadf}
.shipping-dialog-action>header .detail-card-icon{background:#dcfae6;color:#067647}
.shipping-dialog-action>header h4{font-size:14px}
.shipping-dialog-action>header small{color:#3b6b54}
.shipping-dialog-action .dialog-shipping-form{padding:16px}
.shipping-dialog-action .action-label{margin-bottom:8px;color:#344054}
.shipping-dialog-action .carrier-options{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:6px;margin-bottom:10px}
.shipping-dialog-action .carrier-option{justify-content:center;min-width:0;padding:6px 7px;border-radius:7px}
.shipping-dialog-action .shipping-fields{grid-template-columns:minmax(0,1fr) minmax(0,1.2fr) auto;gap:10px}
.shipping-dialog-action .shipping-fields input,.shipping-dialog-action .shipping-fields select{height:42px;min-height:42px;border-radius:8px}
.shipping-dialog-action .shipping-fields .btn{height:42px;padding:0 16px;border-radius:8px;white-space:nowrap}
.shipping-dialog-action .btn.primary{border-color:#067647;background:#067647;color:#fff}
.shipping-dialog-action .btn.primary:hover{border-color:#05603a;background:#05603a}
.shipping-current-state{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:14px 16px 0;padding:10px 12px;border:1px solid #b8dfcc;border-radius:8px;background:#f1faf5}
.shipping-current-state span{display:block;color:#667085;font-size:11px}
.shipping-current-state strong{display:block;margin-top:3px;color:#344054;font-size:12px;overflow-wrap:anywhere}
.shipping-dialog-error{margin:12px 16px 0}
@media(max-width:760px){
    .shipping-dialog{width:calc(100vw - 16px);max-height:calc(100vh - 16px)}
    .shipping-dialog .shipping-dialog-head{padding:16px}
    .shipping-dialog .shipping-dialog-body{gap:10px;padding:10px}
    .shipping-info-grid{grid-template-columns:1fr}
    .shipping-info-grid>div+div{border-top:1px solid #eef0f3;border-left:0}
    .shipping-info-grid .shipping-info-wide{grid-column:auto}
    .shipping-dialog-action .carrier-options{grid-template-columns:repeat(2,minmax(0,1fr))}
    .shipping-dialog .shipping-fields,.shipping-dialog .shipping-fields:has(.carrier-picker input[name="carrier_name_other"]:not([hidden])){grid-template-columns:1fr}
    .shipping-dialog .shipping-fields .carrier-picker select,.shipping-dialog .shipping-fields .carrier-picker input:not([hidden]),.shipping-dialog .shipping-fields>input[name="tracking_number"],.shipping-dialog .shipping-fields>input[name="tracking_number_entry"],.shipping-dialog .shipping-fields>.btn{grid-column:auto}
    .shipping-dialog .shipping-fields .btn{width:100%}
}
@media(max-width:420px){
    .shipping-info-card>header,.shipping-info-grid>div,.shipping-transaction-value,.shipping-dialog-action .dialog-shipping-form{padding-left:13px;padding-right:13px}
    .shipping-dialog .order-dialog-title h3{font-size:18px}
    .shipping-dialog-action .carrier-option{font-size:11px}
}
.permission-modules{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:0 24px}
.permission-module{padding:12px 0;border-bottom:1px solid var(--border,#e5e7eb)}
.permission-module>strong{display:block;margin-bottom:8px;font-size:13px}
.permission-module>div{display:flex;flex-wrap:wrap;gap:8px 16px}
.permission-module label,.scope-accounts label{display:flex;align-items:flex-start;gap:7px;font-size:13px;cursor:pointer}
.permission-module input,.resource-scope input{width:16px;height:16px;margin:1px 0 0;flex:0 0 auto}
.ownership-scope-option{display:flex;align-items:flex-start;gap:9px;padding:11px 12px;border:1px solid var(--border,#e5e7eb);border-radius:6px;background:#fafbfc;cursor:pointer}
.ownership-scope-option input{width:16px;height:16px;margin:2px 0 0;flex:0 0 auto}
.ownership-scope-option span{display:grid;gap:3px;min-width:0}
.ownership-scope-option strong{font-size:13px}
.ownership-scope-option small{color:var(--muted,#64748b);line-height:1.5}
.resource-scope{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px 12px}
.scope-site{min-width:0;border:1px solid var(--border,#e5e7eb);border-radius:6px;background:#fff;overflow:hidden}
.scope-site-summary{display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:10px;min-height:58px;margin:0;padding:9px 12px;color:inherit;font-size:13px;list-style:none}
.scope-site-summary::-webkit-details-marker{display:none}
.scope-site-summary::before{content:"";width:0;height:0;border-top:5px solid transparent;border-bottom:5px solid transparent;border-left:6px solid #667085;transform-origin:2px 5px;transition:transform .15s ease}
.scope-site[open]>.scope-site-summary::before{transform:rotate(90deg)}
.scope-site-summary:hover{background:#f8fafc}
.scope-site-copy{display:grid;gap:2px;min-width:0}
.scope-site-copy strong,.scope-site-copy small{overflow-wrap:anywhere}
.scope-site-copy small{color:var(--muted,#64748b);font-weight:400}
.scope-site-count{padding:3px 7px;border-radius:4px;background:#eef2f6;color:#475467;font-size:11px;font-weight:600;white-space:nowrap}
.scope-site-body{padding:12px;border-top:1px solid var(--border,#e5e7eb);background:#fafbfc}
.scope-site-title{display:flex;align-items:flex-start;gap:8px;cursor:pointer}
.scope-site-title span,.scope-accounts label span{display:grid;gap:2px;min-width:0}
.scope-site-title small,.scope-accounts small{color:var(--muted,#64748b);overflow-wrap:anywhere}
.scope-accounts{display:grid;gap:9px;margin:12px 0 0 24px;padding-top:11px;border-top:1px solid var(--border,#e5e7eb)}
.subaccount-editor-body>.subaccount-delete{border-top:1px solid var(--border,#e5e7eb);padding-top:16px}
@media(max-width:900px){.permission-modules,.resource-scope{grid-template-columns:1fr}}
.balance-summary,.balance-currencies{margin-bottom:24px}
.balance-section-head{display:flex;align-items:baseline;justify-content:space-between;gap:16px;margin:0 0 12px;padding:0 2px}
.balance-section-head h2{margin:0;color:#182230;font-size:16px;letter-spacing:0}
.balance-section-head span{color:#98a2b3;font-size:12px}
.balance-summary-grid{grid-template-columns:repeat(2,minmax(0,1fr));margin-bottom:0}
.balance-currency-grid{grid-template-columns:repeat(4,minmax(0,1fr));margin-bottom:0}
.balance-empty{grid-column:1/-1;background:#fff;border:1px dashed #d0d5dd;border-radius:12px}
@media(max-width:1100px){.balance-currency-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:760px){.balance-summary-grid,.balance-currency-grid{grid-template-columns:1fr}.balance-section-head{align-items:flex-start;flex-direction:column;gap:4px}}

/* Payment links: give the creation workflow a full-width, calm first row. */
body:has(nav a[href="/merchant/links"].active) .content > .split {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
}

body:has(nav a[href="/merchant/links"].active) .content > .split > aside {
    order: -1;
    margin-bottom: 0;
    border-color: #dfe3eb;
    box-shadow: 0 8px 24px rgba(16, 24, 40, .05);
}

body:has(nav a[href="/merchant/links"].active) .content > .split > aside .panel-head {
    padding: 18px 22px 16px;
    background: #fbfcfe;
}

body:has(nav a[href="/merchant/links"].active) .content > .split > aside .panel-body {
    padding: 20px 22px 22px;
}

body:has(nav a[href="/merchant/links"].active) .content > .split > aside .form-grid {
    grid-template-columns: minmax(260px, 1.55fr) minmax(220px, 1.25fr) minmax(150px, .75fr) minmax(130px, .65fr) minmax(150px, .75fr);
    align-items: start;
    gap: 16px;
}

body:has(nav a[href="/merchant/links"].active) .content > .split > aside .form-grid .field.full {
    grid-column: auto;
}

body:has(nav a[href="/merchant/links"].active) .content > .split > aside .notice.info {
    margin: 18px 0 0;
    padding: 11px 13px;
    border-radius: 9px;
    font-size: 12px;
    line-height: 1.55;
}

body:has(nav a[href="/merchant/links"].active) .content > .split > aside .form-actions {
    justify-content: flex-end;
    margin-top: 16px;
}

body:has(nav a[href="/merchant/links"].active) .content > .split > aside .form-actions .btn {
    min-width: 142px;
}

body:has(nav a[href="/merchant/links"].active) .content > .split > section {
    margin-bottom: 0;
    box-shadow: 0 8px 24px rgba(16, 24, 40, .045);
}

body:has(nav a[href="/merchant/links"].active) .content > .split > section .panel-head {
    padding: 18px 22px 16px;
}

body:has(nav a[href="/merchant/links"].active) .content > .split > section .table {
    min-width: 1050px;
    table-layout: fixed;
}

body:has(nav a[href="/merchant/links"].active) .content > .split > section .table th,
body:has(nav a[href="/merchant/links"].active) .content > .split > section .table td {
    padding-left: 16px;
    padding-right: 16px;
}

body:has(nav a[href="/merchant/links"].active) .content > .split > section .table th:nth-child(1) { width: 17%; }
body:has(nav a[href="/merchant/links"].active) .content > .split > section .table th:nth-child(2) { width: 18%; }
body:has(nav a[href="/merchant/links"].active) .content > .split > section .table th:nth-child(3) { width: 24%; }
body:has(nav a[href="/merchant/links"].active) .content > .split > section .table th:nth-child(4) { width: 12%; }
body:has(nav a[href="/merchant/links"].active) .content > .split > section .table th:nth-child(5) { width: 10%; }
body:has(nav a[href="/merchant/links"].active) .content > .split > section .table th:nth-child(6) { width: 8%; }
body:has(nav a[href="/merchant/links"].active) .content > .split > section .table th:nth-child(7) { width: 11%; }

body:has(nav a[href="/merchant/links"].active) .content > .split > section .table td {
    vertical-align: middle;
    line-height: 1.45;
}

body:has(nav a[href="/merchant/links"].active) .content > .split > section .table td:first-child strong {
    display: block;
    color: #182230;
    line-height: 1.35;
}

body:has(nav a[href="/merchant/links"].active) .content > .split > section .table td:first-child code {
    display: inline-block;
    margin: 6px 0 2px;
}

body:has(nav a[href="/merchant/links"].active) .content > .split > section .table td:nth-child(2) {
    vertical-align: middle;
}

body:has(nav a[href="/merchant/links"].active) .content > .split > section .table td.link-meta-cell {
    vertical-align: middle;
}

body:has(nav a[href="/merchant/links"].active) .content > .split > section .table td.link-meta-cell .muted {
    display: block;
}

body:has(nav a[href="/merchant/links"].active) .content > .split > section .table td.link-meta-cell .muted + .muted {
    margin-top: 4px;
}

body:has(nav a[href="/merchant/links"].active) .content > .split > section .table td:nth-child(3) code {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.45;
}

body:has(nav a[href="/merchant/links"].active) .content > .split > section .table td:nth-child(3) .btn {
    min-height: 31px;
    margin-top: 8px;
    padding: 7px 10px;
}

body:has(nav a[href="/merchant/links"].active) .content > .split > section .table td:nth-child(4),
body:has(nav a[href="/merchant/links"].active) .content > .split > section .table td:nth-child(5) {
    white-space: nowrap;
}

body:has(nav a[href="/merchant/links"].active) .content > .split > section .table td:nth-child(5) {
    color: #475467;
}

body:has(nav a[href="/merchant/links"].active) .content > .split > section .table td:last-child form {
    margin: 0;
}

body:has(nav a[href="/merchant/links"].active) .content > .split > section .table td:last-child .btn {
    width: 78px;
    min-height: 34px;
    padding: 7px 8px;
    text-align: center;
}

@media(max-width:900px) {
    body:has(nav a[href="/merchant/links"].active) .content > .split > aside .form-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    body:has(nav a[href="/merchant/links"].active) .content > .split > aside .form-grid .field:first-child {
        grid-column: 1 / -1;
    }

}

@media(max-width:760px) {
    body:has(nav a[href="/merchant/links"].active) .content > .split {
        gap: 14px;
    }

    body:has(nav a[href="/merchant/links"].active) .content > .split > aside .panel-head,
    body:has(nav a[href="/merchant/links"].active) .content > .split > section .panel-head {
        padding-left: 16px;
        padding-right: 16px;
    }

    body:has(nav a[href="/merchant/links"].active) .content > .split > aside .panel-body {
        padding: 16px;
    }

    body:has(nav a[href="/merchant/links"].active) .content > .split > aside .form-grid {
        grid-template-columns: 1fr;
        gap: 13px;
    }

    body:has(nav a[href="/merchant/links"].active) .content > .split > aside .form-actions .btn {
        width: 100%;
    }

    body:has(nav a[href="/merchant/links"].active) .content > .split > section .table-wrap {
        overflow: visible;
    }

    body:has(nav a[href="/merchant/links"].active) .content > .split > section .table {
        min-width: 0;
        display: block;
    }

    body:has(nav a[href="/merchant/links"].active) .content > .split > section .table thead {
        display: none;
    }

    body:has(nav a[href="/merchant/links"].active) .content > .split > section .table tbody {
        display: grid;
        gap: 10px;
        padding: 10px;
    }

    body:has(nav a[href="/merchant/links"].active) .content > .split > section .table tbody tr {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0 14px;
        padding: 8px 12px;
        border: 1px solid #e4e7ec;
        border-radius: 10px;
        background: #fff;
        box-shadow: 0 3px 10px rgba(16, 24, 40, .035);
    }

    body:has(nav a[href="/merchant/links"].active) .content > .split > section .table tbody tr:has(td[colspan]) {
        display: block;
    }

    body:has(nav a[href="/merchant/links"].active) .content > .split > section .table td {
        min-width: 0;
        padding: 7px 0;
        border: 0;
    }

    body:has(nav a[href="/merchant/links"].active) .content > .split > section .table td:first-child,
    body:has(nav a[href="/merchant/links"].active) .content > .split > section .table td:nth-child(2),
    body:has(nav a[href="/merchant/links"].active) .content > .split > section .table td:nth-child(3) {
        grid-column: 1 / -1;
    }

    body:has(nav a[href="/merchant/links"].active) .content > .split > section .table td::before {
        display: block;
        margin-bottom: 4px;
        color: #98a2b3;
        font-size: 10px;
        font-weight: 800;
        letter-spacing: .04em;
    }

    body:has(nav a[href="/merchant/links"].active) .content > .split > section .table td:nth-child(1)::before { content: "产品"; }
    body:has(nav a[href="/merchant/links"].active) .content > .split > section .table td:nth-child(2)::before { content: "站点 / 创建人"; }
    body:has(nav a[href="/merchant/links"].active) .content > .split > section .table td:nth-child(3)::before { content: "公开地址"; }
    body:has(nav a[href="/merchant/links"].active) .content > .split > section .table td:nth-child(4)::before { content: "数量 / 金额"; }
    body:has(nav a[href="/merchant/links"].active) .content > .split > section .table td:nth-child(5)::before { content: "统计"; }
    body:has(nav a[href="/merchant/links"].active) .content > .split > section .table td:nth-child(6)::before { content: "支付状态"; }
    body:has(nav a[href="/merchant/links"].active) .content > .split > section .table td:nth-child(7)::before { content: "操作"; }

    body:has(nav a[href="/merchant/links"].active) .content > .split > section .table td:nth-child(4),
    body:has(nav a[href="/merchant/links"].active) .content > .split > section .table td:nth-child(5) {
        white-space: normal;
    }

    body:has(nav a[href="/merchant/links"].active) .content > .split > section .table td:nth-child(3) .btn {
        margin-top: 7px;
    }

    body:has(nav a[href="/merchant/links"].active) .content > .split > section .table td:last-child .btn {
        width: auto;
    }
}

/* ===== PayPal 账号页：可点击域名 + 限额进度 + 限额输入 ===== */
.merchant-accounts-panel .account-domain-link {
    color: #2456E6;
    text-decoration: none;
    font-weight: 600;
}
.merchant-accounts-panel .account-domain-link:hover {
    text-decoration: underline;
}
.merchant-accounts-panel .limit-reached {
    color: #dc2626;
    font-size: 11px;
    font-weight: 700;
    margin-top: 4px;
}
.merchant-accounts-panel .usage-meter {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 120px;
}
.merchant-accounts-panel .usage-track {
    height: 7px;
    border-radius: 999px;
    background: #eef1f6;
    overflow: hidden;
}
.merchant-accounts-panel .usage-track i {
    display: block;
    height: 100%;
    border-radius: 999px;
    background: #22c55e;
    transition: width .25s ease;
}
.merchant-accounts-panel .usage-track i.warn { background: #f59e0b; }
.merchant-accounts-panel .usage-track i.over { background: #dc2626; }
.merchant-accounts-panel .usage-label {
    display: flex;
    align-items: baseline;
    gap: 6px;
    font-size: 13px;
}
.merchant-accounts-panel .usage-label span {
    color: #98a2b3;
    font-size: 11px;
}
.merchant-accounts-panel .usage-pct {
    margin-left: auto;
    color: #667085;
    font-size: 11px;
    font-weight: 700;
}
.merchant-accounts-panel .usage-meter.is-over .usage-pct { color: #dc2626; }
.merchant-accounts-panel .account-save-form input[name="monthly_limit"] {
    width: 140px;
    max-width: 100%;
}

/* ===== 创建成功弹窗 ===== */
.task-success-modal-wrap{position:fixed;inset:0;z-index:1000;display:flex;align-items:center;justify-content:center;background:rgba(16,24,40,.45);backdrop-filter:blur(2px);animation:hpFade .18s ease}
.task-success-modal{width:min(470px,92vw);background:#fff;border-radius:16px;box-shadow:0 24px 60px rgba(16,24,40,.25);padding:28px 28px 20px;position:relative;text-align:center;animation:hpPop .22s ease}
.task-success-modal .t-close{position:absolute;right:14px;top:12px;border:0;background:#f2f4f7;width:30px;height:30px;border-radius:50%;font-size:16px;line-height:1;cursor:pointer;color:#475467;display:grid;place-items:center}
.task-success-modal .t-close:hover{background:#e4e7ec}
.task-success-modal .t-ico{width:56px;height:56px;border-radius:50%;background:#ecfdf3;color:#12b76a;display:grid;place-items:center;font-size:28px;margin:0 auto 14px}
.task-success-modal h3{margin:0 0 6px;font-size:19px;color:#101828;letter-spacing:-.01em}
.task-success-modal p{margin:0 0 16px;color:#667085;font-size:13.5px}
.task-success-modal .t-url{display:flex;align-items:center;gap:8px;background:#f8fafc;border:1px solid #e4e7ec;border-radius:10px;padding:11px 13px;word-break:break-all;text-align:left;font-size:13px;color:#2456E6;text-decoration:none;font-weight:600}
.task-success-modal .t-url:hover{text-decoration:underline}
.task-success-modal .t-url svg{flex:0 0 auto;width:16px;height:16px;stroke:#2456E6}
.task-success-modal .t-copy{margin-top:12px;width:100%;border:1px solid #d0d5dd;background:#fff;color:#344054;border-radius:9px;padding:11px;font:700 13px system-ui;cursor:pointer}
.task-success-modal .t-copy:hover{background:#f9fafb}
.task-success-modal .t-copy.is-copied{background:#ecfdf3;border-color:#abefc6;color:#067647}
.task-success-modal .t-open{margin-top:8px;display:inline-flex;align-items:center;gap:6px;color:#2456E6;font-weight:600;font-size:13px;text-decoration:none}
.task-success-modal .t-open:hover{text-decoration:underline}
.task-success-modal .t-foot{margin-top:14px;font-size:12px;color:#98a2b3}
@keyframes hpFade{from{opacity:0}to{opacity:1}}
@keyframes hpPop{from{opacity:0;transform:scale(.94) translateY(6px)}to{opacity:1;transform:scale(1) translateY(0)}}
