/* History follows the compact live queue; state colours are shared with its filter. */
.orders-panel{container-type:inline-size}
.history-order-groups{display:grid;gap:19px;padding:0 15px 16px}
.history-order-group{min-width:0}
.history-order-group-heading{display:flex;align-items:center;gap:7px;margin:0 0 9px;padding:0 2px;min-width:0}
.history-order-group-heading h3{margin:0;font-size:12px;line-height:1.5;font-weight:500;color:var(--muted)}
.history-order-group-heading>span{font-size:10px;line-height:1.5;color:var(--faint);font-variant-numeric:tabular-nums}
.history-order-group-heading>i{height:1px;flex:1;background:var(--line);margin-left:5px;opacity:.65}
.history-order-list{display:grid;gap:7px;min-width:0}
.history-order{--order-state:var(--muted);display:grid;grid-template-columns:minmax(0,1fr) minmax(175px,.48fr) 28px;align-items:center;gap:12px;padding:11px 13px;border:1px solid color-mix(in srgb,var(--order-state) 42%,var(--line));border-radius:10px;background:linear-gradient(105deg,color-mix(in srgb,var(--order-state) 4%,var(--surface)),var(--surface) 72%);box-shadow:inset 1px 0 color-mix(in srgb,var(--order-state) 65%,transparent),0 0 10px color-mix(in srgb,var(--order-state) 5%,transparent);min-width:0;transition:border-color .15s,background .15s}
.history-order:hover,.history-order:focus-within{border-color:color-mix(in srgb,var(--order-state) 65%,var(--line))}
.history-order-success{box-shadow:inset 1px 0 var(--order-state),0 0 12px color-mix(in srgb,var(--order-state) 10%,transparent)}
.history-order-cancelled{background:var(--surface);box-shadow:none}
.history-order-identity{display:grid;gap:3px;min-width:0}
.history-order-topline{display:flex;align-items:center;flex-wrap:wrap;gap:3px 10px;min-width:0}
.history-order-symbol{display:grid;place-items:center;flex-shrink:0;width:18px;height:22px;min-height:22px;padding:0;border:0;border-radius:4px;background:none;color:var(--order-state);cursor:pointer;box-shadow:none}
.history-order-symbol>svg{display:block;width:13px;height:13px}
.history-order-recipient{display:block;max-width:100%;overflow-wrap:anywhere;color:var(--purple-light);font-size:15px;font-weight:600;line-height:1.5;min-width:0}
.history-order-status{font-size:12px;line-height:1.5;font-weight:500;color:var(--order-state);text-shadow:0 0 10px color-mix(in srgb,var(--order-state) 16%,transparent)}
.history-order-meta{display:flex;align-items:center;flex-wrap:wrap;gap:2px 12px;padding-left:28px;min-width:0;color:var(--faint);font-size:11px;line-height:1.5}
.history-order-numberline{display:inline-flex;align-items:center;gap:3px;max-width:100%;min-width:0}
.history-order-number{padding:0;border:0;background:none;color:var(--muted);font:inherit;font-size:11px;font-weight:500;line-height:1.5;white-space:nowrap;text-align:left;cursor:pointer;min-width:0}
.history-order-number:hover{color:var(--purple-light)}
.history-order .copy-button{flex-shrink:0;width:22px;height:22px;min-height:22px;border-radius:5px;padding:5px;color:var(--faint)}
.history-order .copy-button:hover{background:var(--surface-2);color:var(--text)}
.history-order .copy-button>svg{width:11px;height:11px}
.history-order-reference{display:inline-flex;gap:3px;align-items:center;max-width:100%;min-width:0;font-size:11px;line-height:1.5;color:var(--faint)}
.history-order-reference>span{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.history-order-reference b{color:var(--muted);font-weight:400}
.history-order-meta time{font-variant-numeric:tabular-nums;white-space:nowrap}
.history-order-metrics{display:grid;grid-template-columns:1fr 1fr;gap:15px;align-items:center;min-width:0}
.history-order-volume,.history-order-amount{display:grid;gap:3px;min-width:0;font-variant-numeric:tabular-nums}
.history-order-volume>strong,.history-order-amount>strong{font-size:14px;line-height:1.5;font-weight:500;color:var(--text);overflow-wrap:anywhere}
.history-order-delivery,.history-order-charge{font-size:10px;line-height:1.5;color:var(--faint);overflow-wrap:anywhere;max-width:100%}
.history-order-delivery.is-complete,.history-order-charge.is-charged{color:#48f59b}
.history-order-open{display:grid;place-items:center;width:28px;height:30px;min-height:30px;border:0;border-radius:7px;background:none;color:var(--faint);cursor:pointer;flex-shrink:0;padding:6px}
.history-order-open>svg{display:block;width:14px;height:14px}
.history-order-open:hover{color:var(--text);background:var(--surface-2)}
.history-order button:focus-visible{outline:2px solid var(--purple-light);outline-offset:3px;border-radius:5px}
/* Compact summary filters and toolbar. */
body[data-view=orders] .orders-summary{gap:10px;margin-bottom:17px}
body[data-view=orders] .orders-summary-item{--summary-color:var(--purple-light);min-height:62px;flex-direction:row;align-items:center;justify-content:space-between;gap:12px;padding:14px 16px;border-radius:10px;transform:none;background:var(--surface)}
body[data-view=orders] .orders-summary-item[data-status=active]{--summary-color:#72b9df}
body[data-view=orders] .orders-summary-item[data-status=completed]{--summary-color:#48f59b}
body[data-view=orders] .orders-summary-item[data-status=attention]{--summary-color:#e4b64a}
body[data-view=orders] .orders-summary-item.is-selected{border-color:color-mix(in srgb,var(--summary-color) 55%,var(--line));background:color-mix(in srgb,var(--summary-color) 4%,var(--surface));box-shadow:0 0 10px color-mix(in srgb,var(--summary-color) 6%,transparent)}
body[data-view=orders] .orders-summary-item:hover{border-color:color-mix(in srgb,var(--summary-color) 50%,var(--line))}
body[data-view=orders] .orders-summary-label{font-size:12px;gap:7px;line-height:1.5}
body[data-view=orders] .orders-summary-label>svg{display:block;width:14px;height:14px;color:var(--summary-color);stroke-width:1.35}
body[data-view=orders] .orders-summary-item strong{font-size:24px;line-height:1;color:var(--summary-color)}
body[data-view=orders] .orders-summary-indicator{display:none}
body[data-view=orders] .orders-toolbar{gap:10px;padding:14px 15px}
body[data-view=orders] .orders-list-heading{padding:15px 17px 13px}
body[data-view=orders] .orders-list-heading h2{font-size:14px;font-weight:500}
body[data-view=orders] .orders-toolbar .search-field,body[data-view=orders] .orders-toolbar .orders-export,.orders-select-wrap .order-status-trigger{height:40px;min-height:40px;border-radius:8px}
body[data-view=orders] .orders-toolbar .search-field input{font-size:13px!important;height:38px}
body[data-view=orders] .orders-toolbar .search-field>svg{width:16px;height:16px}
body[data-view=orders] .orders-toolbar .orders-export{font-size:12px;padding:0 12px;gap:7px}
body[data-view=orders] .orders-toolbar .orders-export>svg{width:14px;height:14px}
/* A scrollable, keyboard-friendly status menu uses the exact card colours. */
.orders-select-wrap .order-status-trigger{font-size:12px;padding:0 12px}
.order-status-trigger .status-trigger-label{display:flex;align-items:center;gap:8px;min-width:0;color:var(--status-color)}
.status-trigger-label>span:last-child{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.status-trigger-symbol,.status-menu-symbol{display:grid;place-items:center;flex-shrink:0;color:var(--status-color)}
.status-trigger-symbol>svg,.status-menu-symbol>svg{display:block;width:14px;height:14px;fill:none;stroke:currentColor;stroke-width:1.35}
.orders-select-wrap .order-status-trigger[aria-expanded=true]{border-color:color-mix(in srgb,var(--status-color) 50%,var(--line));background:var(--surface)}
.order-status-menu{padding:10px;display:none;border-radius:11px;border-color:var(--line);background:#060606;overflow:hidden;font-family:inherit;transition:none!important;opacity:1;transform:none}
.order-status-menu:popover-open{display:block;opacity:1;transform:none}
.status-menu-heading{margin:0;padding:2px 3px 5px;gap:12px}
.status-menu-heading h3{font-family:inherit;font-size:14px;font-weight:500;line-height:1.5;letter-spacing:0}
.status-menu-close{width:25px;height:25px;min-height:25px;margin:0}
.status-menu-close>svg{width:14px;height:14px;stroke-width:1.35!important}
.status-menu-options{max-height:min(330px,calc(100dvh - 130px));overflow:auto;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:#49404f transparent;padding:0 3px 0 0;min-height:0}
.status-menu-option{grid-template-columns:16px minmax(0,1fr) 13px;gap:9px;min-height:37px;padding:8px 8px;border:0;border-radius:7px;font-family:inherit;font-size:12px;line-height:1.5}
.status-menu-option .status-option-label{color:var(--status-color)}
.status-menu-option:hover,.status-menu-option[aria-checked=true]{border-radius:7px;background:color-mix(in srgb,var(--status-color) 8%,var(--surface))}
.status-menu-option:focus-visible{border-radius:7px;background:color-mix(in srgb,var(--status-color) 8%,var(--surface));box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--status-color) 40%,transparent)}
.status-menu-option>svg{width:13px;height:13px;stroke:var(--status-color);stroke-width:1.35!important}
/* The open order uses the same state accent and recipient treatment. */
body .status-pill.order-status-badge{display:inline-flex;align-items:center;gap:6px;color:var(--order-state);border-color:color-mix(in srgb,var(--order-state) 28%,var(--line));background:color-mix(in srgb,var(--order-state) 7%,var(--surface));font-size:12px;font-weight:500;padding:4px 8px;border-radius:7px}
.order-status-badge>svg{width:13px;height:13px;stroke-width:1.35;fill:none}
.detail-grid strong.history-detail-recipient{color:var(--purple-light)}
@container(max-width:720px){
 .history-order-groups{padding:0 12px 14px;gap:17px}
 .history-order{grid-template-columns:minmax(0,1fr) 27px;gap:7px;padding:11px 12px}
 .history-order-identity{grid-column:1;grid-row:1}
 .history-order-open{grid-column:2;grid-row:1;align-self:start}
 .history-order-meta{gap:2px 9px;padding-left:28px;font-size:10px}
 .history-order-topline{gap:3px 8px}
 .history-order-recipient{font-size:14px}
 .history-order-status{font-size:11px}
 .history-order-metrics{grid-column:1/-1;grid-row:2;grid-template-columns:1fr 1fr;gap:12px;margin-left:28px;padding-top:2px}
 .history-order-number,.history-order-reference{font-size:10px}
 .history-order-volume>strong,.history-order-amount>strong{font-size:13px}
 .history-order-delivery,.history-order-charge{font-size:10px}
}
@media(max-width:700px){
 body[data-view=orders] .orders-summary{grid-template-columns:1fr 1fr;gap:8px}
 body[data-view=orders] .orders-summary-item{min-height:58px;padding:12px;gap:8px}
 body[data-view=orders] .orders-summary-label{font-size:11px}
 body[data-view=orders] .orders-summary-label>svg{width:13px;height:13px}
 body[data-view=orders] .orders-summary-item strong{font-size:22px}
 body[data-view=orders] .orders-toolbar{padding:12px;gap:8px}
 body[data-view=orders] .orders-toolbar .orders-export{font-size:11px;padding:0 10px}
}
@media(prefers-reduced-motion:reduce){.history-order{transition:none}}
body.reduce-motion .history-order{transition:none}
.history-pagination{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:13px 16px;border-top:1px solid var(--line);font-size:11px;color:var(--muted)}
.history-page-range{font-variant-numeric:tabular-nums;white-space:nowrap}
.history-page-range>span,.history-page-current>span{color:var(--faint)}
.history-page-actions{display:flex;align-items:center;gap:7px;min-width:0}
.history-page-step{display:grid;place-items:center;width:29px;height:29px;min-height:29px;padding:6px;border:1px solid var(--line);border-radius:7px;background:var(--surface);color:var(--muted);cursor:pointer}
.history-page-step>svg{width:13px;height:13px}
.history-page-step.is-previous>svg{transform:rotate(180deg)}
.history-page-step:hover:not(:disabled){border-color:var(--purple-light);color:var(--purple-light)}
.history-page-step:disabled{opacity:.3;cursor:default}
.history-page-current{font-size:11px;min-width:36px;text-align:center;font-variant-numeric:tabular-nums}
.history-page-mode{border:0;background:none;color:var(--purple-light);font:inherit;font-size:11px;padding:5px;margin-right:3px;cursor:pointer}
.history-page-mode:hover{text-decoration:underline}
.history-pagination button:focus-visible{outline:2px solid var(--purple-light);outline-offset:3px}
@media(max-width:500px){.history-pagination{padding:12px;gap:8px}.history-page-actions{gap:4px}.history-page-mode{font-size:10px;margin-right:0}.history-page-current{min-width:30px}}
