/* Espacios independientes de servicios, con el sistema visual de TICmail. */
.commerce-service-tabs{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin:0 0 26px;min-width:0}
.commerce-service-tabs>button{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;min-width:0;min-height:108px;padding:12px;border:1px solid var(--line);border-radius:8px;background:var(--surface);color:var(--ink);font:600 16px/1.4 'Segoe UI',sans-serif;cursor:pointer;touch-action:manipulation}
.commerce-service-tabs>button:hover{background:var(--soft)}
.commerce-service-tabs>button[aria-selected=true]{background:var(--soft);border-color:var(--primary);box-shadow:inset 0 -3px var(--primary)}
.commerce-service-tabs>button:focus-visible{outline:2px solid var(--primary);outline-offset:3px}
.commerce-brand{display:flex;align-items:center;justify-content:center;gap:4px;min-width:0;height:64px}
.commerce-brand img{object-fit:contain;flex-shrink:0}
.commerce-brand img.commerce-openai{width:64px;height:64px;background:#fff;border-radius:6px}
.commerce-brand-amazon{width:144px;max-width:100%;padding:8px;background:#fff;border-radius:6px}
.commerce-brand-amazon img{width:128px;max-width:100%;height:auto}
.commerce-symbol{display:grid;place-items:center;width:64px;height:64px;background:#fff;border-radius:6px;flex-shrink:0}
.commerce-symbol img{width:30px;height:30px}.commerce-symbol svg{width:28px;height:28px;stroke:var(--primary);fill:none;stroke-width:1.6}
.commerce-tab-caption{font-size:12px;color:var(--muted);font-weight:400}
.commerce-workspace,.commerce-space{min-width:0;max-width:100%}
.commerce-service-heading{margin:0 0 20px}.commerce-service-heading h2{font-size:24px;margin:0 0 5px}.commerce-service-heading p{margin:0;color:var(--muted);font-size:13px}
.commerce-overview{display:grid;grid-template-columns:repeat(auto-fit,minmax(200px,1fr));gap:0;border:1px solid var(--line);border-radius:8px;background:var(--surface);margin-bottom:20px;overflow:hidden}
.commerce-overview>div{min-width:0;padding:18px 20px;border-right:1px solid var(--line)}.commerce-overview>div:last-child{border-right:0}
.commerce-overview span,.commerce-overview small{display:block;color:var(--muted);font-size:12px;line-height:1.5}
.commerce-overview strong{display:block;margin:8px 0;font-size:22px;font-weight:650;line-height:1.3;font-variant-numeric:tabular-nums;overflow-wrap:anywhere}
.commerce-overview small{font-size:11px}
.commerce-chart{margin:0 0 24px;padding:18px 20px 6px;border:1px solid var(--line);border-radius:8px;background:var(--surface)}
.commerce-chart figcaption{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:8px;font-size:13px}
.commerce-chart figcaption>span{font-size:11px;color:var(--muted)}.commerce-chart svg{display:block;width:100%;height:auto;max-height:130px;margin-top:10px;overflow:visible}
.commerce-chart polyline{fill:none;stroke:var(--primary);stroke-width:2.5;stroke-linejoin:round;stroke-linecap:round}.commerce-chart circle{fill:var(--primary);stroke:var(--surface);stroke-width:2}
.commerce-chart .commerce-chart-guide{stroke:var(--line);stroke-width:1;fill:none}.commerce-chart text{fill:var(--muted);font:11px 'Segoe UI',sans-serif}
.commerce-chart-range{display:none}
.commerce-history,.commerce-orders{min-width:0;margin:0 0 20px}.commerce-history h3,.commerce-orders>h3{font-size:18px;margin:0}.commerce-history .section-heading{margin-bottom:10px}
.commerce-history-help{margin:0 0 20px;font-size:12px}
.commerce-history-head,.commerce-invoice>summary{display:grid;grid-template-columns:88px minmax(0,1.6fr) minmax(0,1.3fr) 100px 112px 16px;gap:12px;align-items:center}
.commerce-history-head{padding:10px 12px;border-bottom:1px solid var(--line);font-size:11px;color:var(--muted)}
.commerce-invoice{border-bottom:1px solid var(--line)}.commerce-invoice:last-child{border-bottom:0}
.commerce-invoice>summary{min-height:64px;padding:14px 12px;list-style:none;font-size:12px;font-weight:400;color:var(--ink);cursor:pointer;border-radius:5px}
.commerce-invoice>summary::-webkit-details-marker{display:none}.commerce-invoice>summary:hover{background:var(--soft)}
.commerce-invoice>summary:focus-visible,.commerce-order>summary:focus-visible{outline:2px solid var(--primary);outline-offset:-2px}
.commerce-invoice>summary>*{min-width:0;overflow-wrap:anywhere}.commerce-invoice>summary strong{font-size:14px;white-space:nowrap;font-variant-numeric:tabular-nums}
.commerce-invoice>summary>span{margin-left:0}
.commerce-invoice-ref{font-weight:600}.commerce-invoice-change{color:var(--muted);font-size:11px}
.commerce-invoice-chevron svg{width:16px;height:16px;fill:none;stroke:var(--muted);stroke-width:1.5;transform:rotate(-90deg)}
.commerce-invoice[open]>.commerce-invoice-chevron svg,.commerce-invoice[open]>summary .commerce-invoice-chevron svg{transform:rotate(90deg)}
.commerce-invoice-details{padding:0 12px 16px}.commerce-invoice-details .invoice-record{padding:18px 0 0}.commerce-invoice-details .invoice-bottom{flex-wrap:wrap}.commerce-invoice-details .invoice-sources{margin:16px 0}
.commerce-background{margin-bottom:20px;padding-top:12px;padding-bottom:12px}.commerce-background>summary{font-size:13px}.commerce-background .ledger-update-list{margin-bottom:0}
.commerce-space>.renewal-strip{margin-top:0}.commerce-space>.panel:has(>.case-row){margin-bottom:20px}
.commerce-order{border-top:1px solid var(--line);margin-top:16px}.commerce-order>summary{display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:56px;font-size:14px;overflow-wrap:anywhere;cursor:pointer}.commerce-order>summary>span:first-child{min-width:0}.commerce-order>summary .hint{white-space:nowrap;font-size:12px}
.commerce-order-actions{margin:0 0 12px}.commerce-order .ledger-product:first-of-type{border-top:0}.commerce-orders .empty{line-height:1.7;padding:24px 0 8px}

.amazon-history-heading{display:flex;justify-content:space-between;align-items:baseline;gap:12px;margin-bottom:14px}
.amazon-history-heading h3{margin:0;font-size:16px;line-height:1.4}.amazon-history-heading .hint{white-space:nowrap}
.amazon-order-tabs{display:flex;gap:4px;width:fit-content;max-width:100%;padding:3px;margin-bottom:14px;border:1px solid var(--line);border-radius:9px;background:var(--soft)}
.amazon-order-tabs button{min-height:44px;min-width:0;padding:5px 12px;border:1px solid transparent;border-radius:7px;background:none;color:var(--ink);font-weight:600;line-height:1.25;text-wrap:balance;cursor:pointer}
.amazon-order-tabs button[aria-selected=true]{border-color:var(--line);background:var(--surface);box-shadow:inset 0 -2px var(--primary)}
.amazon-order-tabs button:focus-visible{outline:2px solid var(--primary);outline-offset:-2px}
@media(max-width:420px){.amazon-order-tabs button{padding-inline:6px;font-size:12px}}
.amazon-order-groups{display:grid;gap:16px;min-width:0}
.amazon-order-group{min-width:0;border:1px solid var(--line);border-radius:14px;padding:10px;background:var(--surface)}
.amazon-order-group-head{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:6px 14px;padding:9px 12px;margin-bottom:10px;border-radius:8px;background:var(--soft)}
.amazon-order-group-head h4{margin:0;min-width:0;font-size:15px;font-weight:600;line-height:1.4;overflow-wrap:anywhere}
.amazon-order-count{font-size:12px;font-weight:700;white-space:nowrap}
.amazon-order-states{display:flex;flex:1 0 100%;flex-wrap:wrap;gap:5px}
.amazon-products{display:grid;gap:10px;container:amazon-history/inline-size;min-width:0}
.ledger-product.amazon-product{display:block;padding:0;border:1px solid var(--line);border-radius:14px;background:var(--surface);min-width:0}
.amazon-product:hover,.amazon-product:has(.amazon-product-toggle[aria-expanded=true]){border-color:color-mix(in srgb,var(--primary) 38%,var(--line))}
.amazon-product-heading{position:relative;display:grid;grid-template-columns:76px minmax(0,1fr) auto;align-items:center;gap:16px;padding:14px 51px 14px 14px;min-width:0}
.amazon-product-media{width:76px;height:76px;display:grid;place-items:center;border:1px solid var(--line);border-radius:10px;background:#fff;overflow:hidden}
.amazon-thumbnail{display:block;width:100%;height:100%;padding:5px;object-fit:contain}
.amazon-placeholder{display:grid;width:100%;height:100%;place-items:center;background:var(--soft);color:var(--muted)}
.amazon-placeholder svg{width:25px;height:25px;fill:none;stroke:currentColor;stroke-width:1.5}
.amazon-product-copy,.amazon-product-amount{min-width:0}
.amazon-product-copy h5{margin:0;font-size:15px;line-height:1.35;overflow-wrap:anywhere}
.amazon-product-link{position:relative;z-index:2;color:var(--ink);text-decoration:underline;text-underline-offset:3px;text-decoration-color:var(--muted)}
.amazon-product-link:hover{color:var(--primary);text-decoration-color:currentColor}.amazon-product-link span{font-weight:400;font-size:.92em;white-space:nowrap}
.amazon-product-meta{display:flex;align-items:center;flex-wrap:wrap;gap:6px 9px;margin-top:8px;font-size:12px;color:var(--muted);line-height:1.35}
.amazon-status{display:inline-block;border:1px solid var(--line);border-radius:6px;padding:2px 6px;font-size:11px;font-weight:650;line-height:1.4;color:var(--ink);background:var(--soft)}
.amazon-status:is([data-state=ordered],[data-state=shipped],[data-state=delivered]){background:color-mix(in srgb,var(--primary) 11%,var(--surface));border-color:color-mix(in srgb,var(--primary) 27%,var(--line))}
.amazon-status[data-state=cancelled]{color:var(--bad);background:var(--badbg);border-color:color-mix(in srgb,var(--bad) 35%,var(--line))}
.amazon-status:is([data-state=return_requested],[data-state=returned],[data-state=refund_requested],[data-state=refunded]){color:var(--wait);background:var(--waitbg);border-color:color-mix(in srgb,var(--wait) 35%,var(--line))}
.amazon-status[data-state=approval_requested]{color:var(--warn);background:var(--warnbg);border-color:color-mix(in srgb,var(--warn) 35%,var(--line))}
.amazon-product-amount{text-align:right;font-variant-numeric:tabular-nums;overflow-wrap:anywhere}
.amazon-product-amount strong{display:block;font-size:18px;line-height:1.2}.amazon-product-amount>span{display:block;margin-top:4px;font-size:11px;color:var(--muted)}
.amazon-product-toggle{position:absolute;inset:0;z-index:1;width:100%;height:100%;padding:0;border:0;border-radius:13px;background:transparent;color:var(--primary);cursor:pointer}
.amazon-product-toggle:focus-visible,.amazon-product-link:focus-visible{outline:2px solid var(--primary);outline-offset:-2px}
.amazon-chevron{position:absolute;right:15px;top:50%;display:grid;place-items:center;width:26px;height:26px;border-radius:50%;background:var(--soft);transform:translateY(-50%)}
.amazon-chevron::before{content:'';width:8px;height:8px;margin-top:-3px;border:solid currentColor;border-width:0 2px 2px 0;transform:rotate(45deg)}
.amazon-product-toggle[aria-expanded=true] .amazon-chevron::before{transform:rotate(225deg);margin-top:3px}
.amazon-product-details{border-top:1px solid var(--line);padding:0 16px}.amazon-product-details[hidden]{display:none}
.amazon-order-detail{padding:16px 0}.amazon-order-detail+.amazon-order-detail{border-top:1px solid var(--line)}
.amazon-order-head{display:flex;flex-wrap:wrap;align-items:center;gap:6px 10px}.amazon-order-head h6{margin:0;font-size:14px;overflow-wrap:anywhere}.amazon-order-head button{min-height:44px;margin-left:auto}
.amazon-order-detail .ledger-dates{margin:8px 0;gap:12px 20px}.amazon-order-detail .purchase-timeline{margin-bottom:0}
.amazon-order-detail .purchase-timeline li:last-child{padding-bottom:0}
@container amazon-history (max-width:510px){
 .amazon-product-heading{grid-template-columns:60px minmax(0,1fr);gap:6px 10px;padding:12px 39px 12px 10px}
 .amazon-product-media{width:60px;height:60px;grid-row:1/3;align-self:start}.amazon-product-copy,.amazon-product-amount{grid-column:2}
 .amazon-product-amount{display:flex;flex-wrap:wrap;align-items:baseline;gap:4px 8px;text-align:left}.amazon-product-amount strong{font-size:15px}.amazon-product-amount>span{margin:0}
 .amazon-chevron{right:9px;width:23px;height:23px}.amazon-product-meta{margin-top:5px}
}
@media(forced-colors:active){.amazon-product-toggle:focus-visible,.amazon-product-link:focus-visible{outline-color:Highlight}}
@media(max-width:420px){.amazon-order-group{padding:6px}.amazon-order-group-head{padding:8px 9px}.amazon-history-heading .hint{white-space:normal;text-align:right}}
.commerce-add{margin-top:24px;padding-top:12px;padding-bottom:12px}.commerce-add>summary{font-size:13px}.commerce-add .check{display:flex;align-items:center;gap:10px;min-height:44px;line-height:1.5}.commerce-add .check input{width:18px;height:18px;min-height:18px;padding:0;margin:0;flex-shrink:0}
@media(max-width:1100px){
 .commerce-history-head{display:none}.commerce-invoice>summary{grid-template-columns:repeat(2,minmax(0,1fr)) 18px;gap:12px;padding:16px 0}
 .commerce-invoice>summary>[data-label]::before{content:attr(data-label);display:block;margin-bottom:4px;font-size:11px;color:var(--muted);font-weight:400}
 .commerce-invoice>summary strong{font-size:16px;white-space:normal}.commerce-invoice-chevron{grid-column:3;grid-row:1/4;align-self:center}
 .commerce-invoice-details{padding-left:0;padding-right:0}
}
@media(max-width:600px){
 .commerce-service-tabs{grid-template-columns:minmax(0,1fr);gap:8px;margin-bottom:24px}
 .commerce-service-tabs>button{flex-direction:row;justify-content:space-between;min-height:64px;padding:7px 12px;gap:12px;font-size:15px;text-align:left}
 .commerce-brand{height:48px;justify-content:flex-start;flex-shrink:0}.commerce-brand-amazon{width:132px;justify-content:center}.commerce-brand-amazon img{width:116px}
 .commerce-brand img.commerce-openai,.commerce-symbol{width:48px;height:48px}.commerce-symbol img{width:26px;height:26px}
 .commerce-tab-caption{font-size:11px;text-align:right;max-width:110px}
 .commerce-service-heading h2{font-size:21px}.commerce-overview{grid-template-columns:repeat(2,minmax(0,1fr))}
 .commerce-overview>div:only-child,.commerce-overview:has(>div:nth-child(3))>div:first-child{grid-column:1/-1}
 .commerce-overview>div{padding:14px 16px;border-right:0;border-bottom:1px solid var(--line)}.commerce-overview>div:last-child{border-bottom:0}
 .commerce-overview strong{font-size:21px;margin:5px 0}.commerce-chart{padding:16px 14px 4px}.commerce-chart svg{min-height:100px}
 .commerce-overview>div:not(:first-child) strong{font-size:18px}
 .commerce-chart text{display:none}.commerce-chart-range{display:flex;justify-content:space-between;gap:16px;color:var(--muted);font-size:11px;padding-bottom:10px}.commerce-chart-range>span{max-width:48%;overflow-wrap:anywhere}.commerce-chart-range>span:last-child{text-align:right}
 .commerce-history .section-heading{align-items:flex-start;gap:8px}.commerce-history h3{font-size:17px}
 .commerce-invoice>summary{grid-template-columns:minmax(0,1fr) minmax(80px,1fr) 16px;gap:10px}
 .commerce-invoice>summary>[data-label="Emisión"]{display:none}
 .commerce-invoice>summary>.commerce-invoice-ref{grid-column:1;grid-row:1;font-size:12px}
 .commerce-invoice>summary>strong{grid-column:2;grid-row:1;text-align:right}
 .commerce-invoice>summary>[data-label="Período"]{grid-column:1/3;grid-row:2}
 .commerce-invoice>summary>.commerce-invoice-change{grid-column:1/3;grid-row:3}
 .commerce-invoice>summary>.commerce-invoice-change[data-has-change=false]{display:none}
 .commerce-invoice>summary>.commerce-invoice-ref::before,.commerce-invoice>summary>strong::before{display:none}
 .commerce-invoice>summary>.commerce-invoice-change::before{content:'Variación · ';display:inline}
 .commerce-invoice-chevron{grid-row:1/3}
}
