/* Modelo 2 — histórico de pedidos. Escopo exclusivo da listagem. */
.form-container.ref-history-page {
    --ref-history-primary:#006d57;
    --ref-history-primary-dark:#0a4b3d;
    --ref-history-primary-darker:#08382f;
    --ref-history-soft:#eaf6f1;
    --ref-history-text:#18332d;
    --ref-history-muted:#7f948b;
    --ref-history-line:#dbe7e1;
    --ref-history-line-2:#e3ece7;
    --ref-history-panel:#fff;
    --ref-history-card:#fbfdfc;
    --ref-history-status-color:#147a5f;
    display:grid;
    grid-template-columns:300px minmax(0,1fr);
    width:100%; max-width:none; min-width:0; min-height:760px;
    margin:0; padding:0;
    background:#f8fbf9; color:var(--ref-history-text);
    border:1px solid var(--ref-history-line); border-radius:28px;
    box-shadow:0 18px 45px rgba(14,48,39,.08); overflow:hidden;
    font:14px/normal Inter,system-ui,-apple-system,"Segoe UI",Arial,sans-serif;
    -webkit-font-smoothing:antialiased;
}
#adianti_content:has(.ref-history-page) {width:100%; max-width:none; min-width:0; margin:0; padding:0; align-self:stretch;}
.ref-history-page *, .ref-history-page *::before, .ref-history-page *::after {box-sizing:border-box;}
.ref-history-page button {font-family:inherit;}
.ref-history-page button:focus-visible {outline:3px solid var(--ref-focus, #50af92); outline-offset:3px;}
/* =========================
   SIDEBAR
========================= */
.ref-history-page .ref-history-sidebar{
    background:linear-gradient(160deg,var(--ref-history-primary-dark) 0%, var(--ref-history-primary-darker) 100%);
    color:#fff;
    padding:28px 24px;
    position:relative;
    overflow:hidden;
}

.ref-history-page .ref-history-sidebar::before{
    content:"";
    position:absolute;
    width:280px;
    height:280px;
    border-radius:50%;
    border:1px solid rgba(180,236,214,.15);
    left:-130px;
    bottom:80px;
}

.ref-history-page .ref-history-sidebar::after{
    content:"";
    position:absolute;
    width:220px;
    height:220px;
    border-radius:50%;
    border:1px solid rgba(180,236,214,.12);
    right:-110px;
    top:-80px;
}

.ref-history-page .ref-history-sidebar > *{
    position:relative;
    z-index:1;
}

.ref-history-page .ref-history-logo{
    display:flex;
    align-items:center;
    gap:8px;
    font-size:12px;
    font-weight:800;
    letter-spacing:1.4px;
    color:#e3f7ee;
}

.ref-history-page .ref-history-logo-box{
    width:36px;
    height:36px;
    border-radius:9px;
    display:grid;
    place-items:center;
    background:#e9f8f0;
    color:#0c5e4a;
    font-family:Georgia,serif;
    font-size:24px;
    font-weight:700;
    flex-shrink:0;
}


.ref-history-page .ref-history-logo-text{
    white-space:nowrap;
}

.ref-history-page .ref-history-sidebar h1{
    margin:28px 0 10px;
    font-size:42px;
    line-height:.95;
    letter-spacing:-1.5px;
}

.ref-history-page .ref-history-sidebar p{
    margin:0;
    color:#b2d6c8;
    line-height:1.8;
    font-size:13px;
}

.ref-history-page .ref-history-summary{
    margin-top:26px;
    display:grid;
    gap:12px;
}

.ref-history-page .ref-history-box{
    background:rgba(255,255,255,.07);
    border:1px solid rgba(209,239,226,.14);
    border-radius:16px;
    padding:14px;
}

.ref-history-page .ref-history-box span{
    display:block;
    color:#b7dacd;
    font-size:11px;
    margin-bottom:7px;
}

.ref-history-page .ref-history-box strong{
    font-size:24px;
    letter-spacing:-.5px;
}

.ref-history-page .ref-history-box strong.ref-history-box-small{
    font-size:18px;
}

/* =========================
   MAIN
========================= */
.ref-history-page .ref-history-main{
    background:var(--ref-history-panel);
    border-left:1px solid var(--ref-history-line);
    padding:26px;
    display:flex;
    flex-direction:column;
    min-width:0;
}

.ref-history-page .ref-history-main-top{
    display:flex;
    justify-content:space-between;
    align-items:flex-end;
    gap:12px;
    margin-bottom:22px;
}

.ref-history-page .ref-history-main-top h2{
    margin:8px 0 0;
    font-size:32px;
    letter-spacing:-.9px;
}

.ref-history-page .ref-history-main-top p{
    margin:0;
    color:var(--ref-history-muted);
    font-size:14px;
}

.ref-history-page .ref-history-badge{
    display:inline-flex;
    align-items:center;
    gap:8px;
    padding:7px 12px;
    border-radius:999px;
    background:#edf8f3;
    border:1px solid #d7ece2;
    color:#0f735b;
    font-size:11px;
    font-weight:800;
    letter-spacing:.5px;
}

.ref-history-page .ref-history-badge::before{
    content:"";
    width:7px;
    height:7px;
    border-radius:50%;
    background:#0fa175;
}

.ref-history-page .ref-history-list{
    display:grid;
    gap:14px;
}

.ref-history-page .ref-history-item{
    display:grid;
    grid-template-columns:auto 1fr auto;
    gap:16px;
    align-items:center;
    background:var(--ref-history-card);
    border:1px solid var(--ref-history-line-2);
    border-radius:20px;
    padding:14px;
}

.ref-history-page .ref-history-thumb{
    width:88px;
    height:88px;
    border-radius:18px;
    overflow:hidden;
    flex-shrink:0;
    background:#dfe8e3;
    border:1px solid rgba(0,0,0,.05);
}

.ref-history-page .ref-history-thumb img{
    width:100%;
    height:100%;
    object-fit:cover;
    display:block;
}

.ref-history-page .ref-history-item-info{
    min-width:0;
}

.ref-history-page .ref-history-title-row{
    display:flex;
    align-items:center;
    gap:10px;
    flex-wrap:wrap;
    margin-bottom:7px;
}

.ref-history-page .ref-history-item-info h3{
    margin:0;
    font-size:22px;
    letter-spacing:-.4px;
    line-height:1.1;
}

.ref-history-page .ref-history-id{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    padding:6px 10px;
    border-radius:999px;
    background:#f4f8f6;
    border:1px solid #dce9e3;
    color:#6c8279;
    font-size:11px;
    font-weight:800;
    letter-spacing:.2px;
}

.ref-history-page .ref-history-item-info p{
    margin:0 0 10px;
    color:var(--ref-history-muted);
    font-size:15px;
}

.ref-history-page .ref-history-meta{
    display:flex;
    align-items:center;
    gap:14px;
    flex-wrap:wrap;
}

.ref-history-page .ref-history-status{
    display:inline-flex;
    align-items:center;
    gap:8px;
    padding:8px 12px;
    border-radius:999px;
    background:color-mix(in srgb, var(--ref-history-status-color) 8%, var(--ref-history-panel));
    color:var(--ref-history-status-color);
    font-size:11px;
    font-weight:800;
    border:1px solid color-mix(in srgb, var(--ref-history-status-color) 20%, var(--ref-history-panel));
}

.ref-history-page .ref-history-status::before{
    content:"";
    width:7px;
    height:7px;
    border-radius:50%;
    background:var(--ref-history-status-color);
}

.ref-history-page .ref-history-date{
    color:var(--ref-history-muted);
    font-size:13px;
    display:flex;
    align-items:center;
    gap:7px;
    flex-wrap:wrap;
}

.ref-history-page .ref-history-open{
    width:46px;
    height:46px;
    border-radius:14px;
    border:1px solid #dce7e1;
    background:var(--ref-history-panel);
    color:#39584e;
    display:grid;
    place-items:center;
    cursor:pointer;
    transition:.2s ease;
}

.ref-history-page .ref-history-open:hover{
    background:var(--ref-history-primary);
    color:#fff;
    border-color:var(--ref-history-primary);
}

/* =========================
   PAGINAÇÃO
========================= */
.ref-history-page .ref-history-footer{
    margin-top:18px;
    padding-top:18px;
    border-top:1px solid #e7efeb;
    display:flex;
    justify-content:space-between;
    align-items:center;
    gap:16px;
    flex-wrap:wrap;
}

.ref-history-page .ref-history-footer-left{
    display:flex;
    align-items:center;
    gap:10px;
    color:#7f938b;
    font-size:13px;
    flex-wrap:wrap;
}

.ref-history-page .ref-history-per-page{
    display:inline-flex;
    align-items:center;
    gap:8px;
    background:#f4f8f6;
    border:1px solid #dce8e2;
    padding:9px 12px;
    border-radius:999px;
    color:#4d6d63;
    font-size:12px;
    font-weight:700;
}

.ref-history-page .ref-history-pagination{
    display:flex;
    align-items:center;
    gap:8px;
    flex-wrap:wrap;
}

.ref-history-page .ref-history-page-button{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    margin:0;
    line-height:1;
    min-width:42px;
    height:42px;
    padding:0 14px;
    border-radius:12px;
    border:1px solid #dce7e1;
    background:var(--ref-history-panel);
    color:#39584e;
    font-size:13px;
    font-weight:800;
    cursor:pointer;
    transition:.2s ease;
}

.ref-history-page .ref-history-page-button:hover:not(:disabled){
    background:var(--ref-history-hover, #f1f7f4);
}

.ref-history-page .ref-history-page-button.is-current{
    background:var(--ref-history-primary);
    border-color:var(--ref-history-primary);
    color:#fff;
}

.ref-history-page .ref-history-page-button:disabled{
    opacity:.45;
    cursor:not-allowed;
}

/* =========================
   RESPONSIVO
========================= */
@media (max-width:980px){
    .form-container.ref-history-page{
        grid-template-columns:1fr;
        min-height:0;
    }

    .ref-history-page .ref-history-main{
        border-left:0;
        border-top:1px solid #dce8e2;
    }
}

@media (max-width:760px){
    .form-container.ref-history-page {border-radius:20px;}
    .ref-history-page .ref-history-pagination {gap:6px; width:100%;}
    .ref-history-page .ref-history-page-button {min-width:36px; height:40px; padding:0 10px;}


    .ref-history-page .ref-history-sidebar{
        padding:22px 18px;
    }

    .ref-history-page .ref-history-sidebar h1{
        font-size:36px;
    }

    .ref-history-page .ref-history-main{
        padding:18px;
    }

    .ref-history-page .ref-history-main-top h2{
        font-size:28px;
    }

    .ref-history-page .ref-history-item{
        grid-template-columns:1fr;
        gap:14px;
    }

    .ref-history-page .ref-history-open{
        width:100%;
        height:46px;
        border-radius:12px;
    }

    .ref-history-page .ref-history-footer{
        flex-direction:column;
        align-items:flex-start;
    }
}

.ref-history-page .ref-history-status--collected {--ref-history-status-color:var(--ref-history-collected, #347ca5);}
.ref-history-page .ref-history-status--cancelled {--ref-history-status-color:var(--ref-history-cancelled, #b74545);}
.ref-history-page .ref-history-status--late {--ref-history-status-color:var(--ref-history-late, #9b6a13);}
.ref-history-page .ref-history-status--assigned {--ref-history-status-color:var(--ref-history-assigned, #5866b6);}
.ref-history-page .ref-history-status--neutral {--ref-history-status-color:var(--ref-history-neutral, #687b74);}
.ref-history-page .ref-history-empty {padding:55px 20px; text-align:center; color:var(--ref-history-muted); border:1px dashed var(--ref-history-line); border-radius:20px;}
.ref-history-page .ref-history-empty > i {font-size:36px; color:var(--ref-history-primary);}
.ref-history-page .ref-history-empty h3 {margin:18px 0 8px; color:var(--ref-history-text); font-size:20px;}
.ref-history-page .ref-history-empty p {margin:0; line-height:1.6;}
.ref-history-page .ref-history-page-button.is-current:hover:not(:disabled) {background:var(--ref-history-primary-dark);}
.ref-history-page .ref-history-page-gap {color:var(--ref-history-muted); padding:0 2px;}
.ref-history-page .ref-history-title-row h3, .ref-history-page .ref-history-box strong {overflow-wrap:anywhere;}
@media(prefers-reduced-motion:reduce) {.ref-history-page button {transition:none;}}
:is(.dark,.theme-dark,[data-theme="dark"],.ref-theme-dark) .ref-history-page,
.form-container.ref-history-page:is(.dark,.theme-dark,[data-theme="dark"],.ref-theme-dark) {
    --ref-history-text:#e7f3ed; --ref-history-muted:#a5bdb2; --ref-history-line:#315447;
    --ref-history-line-2:#315447; --ref-history-panel:#17362b; --ref-history-card:#1c3b30;
    --ref-history-status-color:#7ac6a7; --ref-history-hover:#214b3b;
    --ref-history-collected:#8ebee0; --ref-history-cancelled:#efa7a7; --ref-history-late:#e6c27c;
    --ref-history-assigned:#b3bdf5; --ref-history-neutral:#bdcdc5;
}
:is(.dark,.theme-dark,[data-theme="dark"],.ref-theme-dark) .ref-history-page :is(.ref-history-badge,.ref-history-id,.ref-history-per-page),
.ref-history-page:is(.dark,.theme-dark,[data-theme="dark"],.ref-theme-dark) :is(.ref-history-badge,.ref-history-id,.ref-history-per-page) {background:var(--ref-history-card); color:var(--ref-history-muted); border-color:var(--ref-history-line);}
:is(.dark,.theme-dark,[data-theme="dark"],.ref-theme-dark) .ref-history-page :is(.ref-history-open,.ref-history-page-button),
.ref-history-page:is(.dark,.theme-dark,[data-theme="dark"],.ref-theme-dark) :is(.ref-history-open,.ref-history-page-button) {color:var(--ref-history-text); border-color:var(--ref-history-line);}
:is(.dark,.theme-dark,[data-theme="dark"],.ref-theme-dark) .ref-history-page .ref-history-page-button.is-current,
.ref-history-page:is(.dark,.theme-dark,[data-theme="dark"],.ref-theme-dark) .ref-history-page-button.is-current {color:#fff; background:var(--ref-history-primary);}
/* Modelo 2 — detalhes do pedido. Não interfere na listagem. */
.form-container.ref-history-details {
    --ref-detail-green:#006e57; --ref-detail-ink:#193b31; --ref-detail-muted:#82978c;
    --ref-detail-line:#e0eae3; --ref-detail-panel:#fff; --ref-detail-soft:#f7faf8;
    --ref-detail-status:#23876b;
    display:grid; grid-template-columns:290px minmax(0,1fr); min-height:700px;
    width:100%; max-width:none; min-width:0; margin:0; padding:0;
    color:var(--ref-detail-ink); background:var(--ref-detail-panel);
    border:1px solid #d8e5de; border-radius:24px; overflow:hidden;
    box-shadow:0 20px 55px rgba(23,73,53,.07);
    font:14px/normal Inter,system-ui,-apple-system,"Segoe UI",Arial,sans-serif;
    -webkit-font-smoothing:antialiased;
}
#adianti_content:has(.ref-history-details) {width:100%; max-width:none; min-width:0; margin:0; padding:0; align-self:stretch;}
.ref-history-details *, .ref-history-details *::before, .ref-history-details *::after {box-sizing:border-box;}
.ref-history-details button {font-family:inherit; cursor:pointer;}
.ref-history-details button:focus-visible {outline:3px solid #65b69c; outline-offset:3px;}
.ref-history-details .ref-detail-sidebar {position:relative; display:flex; flex-direction:column; min-width:0; padding:28px 23px; color:#fff; overflow:hidden; background:linear-gradient(152deg,#105144,#06372e);}
.ref-history-details .ref-detail-sidebar::before, .ref-history-details .ref-detail-sidebar::after {content:""; position:absolute; width:255px; height:255px; border:1px solid rgba(152,223,186,.15); border-radius:50%; pointer-events:none;}
.ref-history-details .ref-detail-sidebar::before {bottom:60px; left:-150px;}
.ref-history-details .ref-detail-sidebar::after {top:-100px; right:-160px;}
.ref-history-details .ref-detail-sidebar > * {position:relative; z-index:1; min-width:0;}
.ref-history-details .ref-detail-brand {display:flex; align-items:center; gap:7px; color:#dff5e8; font-size:11px; letter-spacing:1px; font-weight:900;}
.ref-history-details .ref-detail-brand-r {width:36px; height:36px; border-radius:9px; background:#e8f7eb; color:#075b49; font:800 24px Georgia,serif; display:grid; place-items:center; letter-spacing:0; flex-shrink:0;}
.ref-history-details .ref-detail-label {margin:43px 0 10px; font-size:10px; color:#9bd6b9; letter-spacing:2px; font-weight:850;}
.ref-history-details .ref-detail-sidebar h2 {font-size:40px; line-height:1.02; letter-spacing:-1.3px; margin:0 0 15px; color:inherit;}
.ref-history-details .ref-detail-description {font-size:12px; color:#b4d7c6; line-height:1.75; margin:0 0 22px;}
.ref-history-details .ref-detail-image {width:100%; height:180px; margin:0; border-radius:13px; border:4px solid rgba(255,255,255,.24); position:relative; overflow:hidden; box-shadow:0 4px 12px rgba(63,55,32,.15); flex-shrink:0;}
.ref-history-details .ref-detail-image img {width:100%; height:100%; display:block; object-fit:cover;}
.ref-history-details .ref-detail-image figcaption {position:absolute; bottom:0; left:0; right:0; padding:13px; background:rgba(19,59,46,.75); color:#fff; text-align:center; font:23px Georgia,serif; overflow-wrap:anywhere;}
.ref-history-details .ref-detail-fact {padding:14px; border:1px solid rgba(215,255,226,.12); border-radius:13px; background:rgba(255,255,255,.07); margin-top:10px;}
.ref-history-details .ref-detail-fact span {display:block; margin-bottom:7px; color:#b5d9c7; font-size:11px;}
.ref-history-details .ref-detail-fact strong {font-size:16px; overflow-wrap:anywhere;}
.ref-history-details .ref-detail-sidebar-footer {margin-top:auto; padding-top:21px; border-top:1px solid rgba(255,255,255,.18); color:#aad6c0; font-size:10px;}
.ref-history-details .ref-detail-main {min-width:0; display:flex; flex-direction:column; padding:clamp(20px,3vw,40px);}
.ref-history-details .ref-detail-top {display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap; margin-bottom:28px;}
.ref-history-details .ref-detail-breadcrumb {display:flex; align-items:center; gap:11px; min-width:0; color:#728d81; font-weight:850; font-size:11px; letter-spacing:1px;}
.ref-history-details .ref-detail-button {display:inline-flex; align-items:center; justify-content:center; gap:8px; padding:12px 16px; min-height:42px; border:1px solid var(--ref-detail-line); border-radius:11px; background:var(--ref-detail-panel); color:#315b4d; font-weight:800; font-size:12px; line-height:normal; transition:background .2s,border-color .2s;}
.ref-history-details .ref-detail-button:hover {background:#f0f8f3;}
.ref-history-details .ref-detail-button > i {font-size:16px; flex-shrink:0;}
.ref-history-details .ref-detail-button--cancel {color:#b14a3d; background:#fffafa; border-color:#f0d7d1;}
.ref-history-details .ref-detail-button--cancel:hover {background:#fff0ed;}
.ref-history-details .ref-detail-button--primary {background:var(--ref-detail-green); border-color:var(--ref-detail-green); color:#fff;}
.ref-history-details .ref-detail-button--primary:hover {background:#005440; border-color:#005440;}
.ref-history-details .ref-detail-heading {display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap; margin-bottom:23px;}
.ref-history-details .ref-detail-overline {color:#23876b; font-size:10px; letter-spacing:1.4px; font-weight:900;}
.ref-history-details .ref-detail-heading h1 {font-size:32px; margin:5px 0; letter-spacing:-1px; line-height:1.2; color:var(--ref-detail-ink);}
.ref-history-details .ref-detail-heading p {margin:0; font-size:13px; color:var(--ref-detail-muted);}
.ref-history-details .ref-detail-mobile-date {display:none; color:var(--ref-detail-muted); font-size:11px; margin-top:7px;}
.ref-history-details--collected {--ref-detail-status:#347ca5;}
.ref-history-details--cancelled {--ref-detail-status:#b74545;}
.ref-history-details--late {--ref-detail-status:#ab6420;}
.ref-history-details--assigned {--ref-detail-status:#5866b6;}
.ref-history-details--neutral {--ref-detail-status:#687b74;}
.ref-history-details .ref-detail-status {display:inline-flex; align-items:center; gap:7px; border-radius:30px; font-weight:850; font-size:11px; padding:8px 12px; color:var(--ref-detail-status); background:color-mix(in srgb,var(--ref-detail-status)8%,var(--ref-detail-panel)); border:1px solid color-mix(in srgb,var(--ref-detail-status)23%,var(--ref-detail-panel));}
.ref-history-details .ref-detail-status::before {content:""; width:7px; height:7px; background:var(--ref-detail-status); border-radius:50%;}
.ref-history-details .ref-detail-alert {display:flex; align-items:center; gap:12px; padding:15px 17px; border-radius:14px; background:color-mix(in srgb,var(--ref-detail-status)6%,var(--ref-detail-panel)); border:1px solid color-mix(in srgb,var(--ref-detail-status)22%,var(--ref-detail-panel)); color:var(--ref-detail-status); margin-bottom:22px;}
.ref-history-details .ref-detail-alert > i {font-size:24px; flex-shrink:0;}
.ref-history-details .ref-detail-alert strong {display:block; font-size:13px;}
.ref-history-details .ref-detail-alert small {display:block; margin-top:5px; color:color-mix(in srgb,var(--ref-detail-status)65%,var(--ref-detail-muted)); font-size:11px; line-height:1.5;}
.ref-history-details .ref-detail-advance {display:flex; align-items:center; gap:10px; padding:12px 16px; margin:0 0 18px; border:1px solid #f0d7d1; border-radius:12px; background:#fff0ed; color:#a43c32; font-size:12px;}
.ref-history-details .ref-detail-items {border:1px solid var(--ref-detail-line); border-radius:17px; overflow:hidden; background:var(--ref-detail-panel);}
.ref-history-details .ref-detail-items-header {display:flex; justify-content:space-between; align-items:center; gap:12px; padding:16px 19px; background:var(--ref-detail-soft); border-bottom:1px solid var(--ref-detail-line);}
.ref-history-details .ref-detail-items-header h2 {font-size:13px; font-weight:700; color:inherit; margin:0; line-height:1.4;}
.ref-history-details .ref-detail-items-header small {color:var(--ref-detail-muted); font-size:11px;}
.ref-history-details .ref-detail-items ol {margin:0; padding:0; list-style:none;}
.ref-history-details .ref-detail-item {display:flex; align-items:center; gap:13px; padding:12px 17px; border-bottom:1px solid var(--ref-detail-line);}
.ref-history-details .ref-detail-item:last-child {border-bottom:0;}
.ref-history-details .ref-detail-index {width:30px; height:30px; border-radius:9px; display:grid; place-items:center; background:#eaf7ed; color:#3c846b; font-size:11px; font-weight:800; flex-shrink:0;}
.ref-history-details .ref-detail-item-name {flex:1; min-width:0; font-weight:650; font-size:13px; overflow-wrap:anywhere;}
.ref-history-details .ref-detail-quantity {font-size:12px; font-weight:850; color:#13664e; background:#eaf6ef; border-radius:8px; min-width:33px; padding:7px 9px; text-align:center; flex-shrink:0;}
.ref-history-details .ref-detail-empty {padding:20px; font-size:13px; color:var(--ref-detail-muted);}
.ref-history-details .ref-detail-payment h2 {display:block; font-size:12px; font-weight:700; color:inherit; margin:0;}
.ref-history-details .ref-detail-payment {display:flex; align-items:center; gap:13px; background:var(--ref-detail-soft); border:1px solid var(--ref-detail-line); border-radius:14px; padding:16px; margin-top:18px;}
.ref-history-details .ref-detail-payment-icon {display:grid; place-items:center; width:38px; height:38px; background:#e6f4eb; color:#178363; border-radius:11px; flex-shrink:0; font-size:18px;}
.ref-history-details .ref-detail-payment p {display:block; margin:5px 0 0; color:var(--ref-detail-muted); font-size:11px; line-height:1.5;}
.ref-history-details .ref-detail-actions {margin-top:auto; padding-top:20px; display:flex; justify-content:flex-end;}
@media(max-width:900px) {
    .form-container.ref-history-details {grid-template-columns:245px minmax(0,1fr);}
    .ref-history-details .ref-detail-sidebar {padding:23px 18px;}
}
@media(max-width:680px) {
    .form-container.ref-history-details {grid-template-columns:1fr; min-height:0;}
    .ref-history-details .ref-detail-sidebar {display:grid; grid-template-columns:minmax(0,1fr) 120px; gap:8px 15px; padding:19px;}
    .ref-history-details .ref-detail-brand {grid-column:1/-1;}
    .ref-history-details .ref-detail-label {margin:13px 0 3px;}
    .ref-history-details .ref-detail-sidebar h2 {font-size:31px;}
    .ref-history-details .ref-detail-description {margin:0;}
    .ref-history-details .ref-detail-image {grid-column:2; grid-row:2/span 3; width:120px; height:120px;}
    .ref-history-details .ref-detail-image figcaption {font-size:17px; padding:9px;}
    .ref-history-details .ref-detail-fact, .ref-history-details .ref-detail-sidebar-footer {display:none;}
    .ref-history-details .ref-detail-main {padding:20px 14px;}
    .ref-history-details .ref-detail-top {margin-bottom:19px;}
    .ref-history-details .ref-detail-heading h1 {font-size:27px;}
    .ref-history-details .ref-detail-mobile-date {display:block;}
}
@media(max-width:420px) {
    .ref-history-details .ref-detail-sidebar {grid-template-columns:minmax(0,1fr) 100px;}
    .ref-history-details .ref-detail-image {width:100px; height:100px;}
    .ref-history-details .ref-detail-item {gap:8px; padding:12px;}
    .ref-history-details .ref-detail-breadcrumb {font-size:10px;}
    .ref-history-details .ref-detail-actions .ref-detail-button {width:100%;}
}
:is(.dark,.theme-dark,[data-theme="dark"],.ref-theme-dark) .ref-history-details,
.form-container.ref-history-details:is(.dark,.theme-dark,[data-theme="dark"],.ref-theme-dark) {--ref-detail-ink:#e7f3ed; --ref-detail-muted:#a5bdb2; --ref-detail-line:#315447; --ref-detail-panel:#17362b; --ref-detail-soft:#1c3b30; border-color:var(--ref-detail-line);}
:is(.dark,.theme-dark,[data-theme="dark"],.ref-theme-dark) .ref-history-details :is(.ref-detail-status,.ref-detail-alert,.ref-detail-alert small),
.ref-history-details:is(.dark,.theme-dark,[data-theme="dark"],.ref-theme-dark) :is(.ref-detail-status,.ref-detail-alert,.ref-detail-alert small) {color:color-mix(in srgb,var(--ref-detail-status)45%,#fff);}
:is(.dark,.theme-dark,[data-theme="dark"],.ref-theme-dark) .ref-history-details :is(.ref-detail-button:not(.ref-detail-button--primary),.ref-detail-index,.ref-detail-quantity,.ref-detail-payment-icon,.ref-detail-advance),
.ref-history-details:is(.dark,.theme-dark,[data-theme="dark"],.ref-theme-dark) :is(.ref-detail-button:not(.ref-detail-button--primary),.ref-detail-index,.ref-detail-quantity,.ref-detail-payment-icon,.ref-detail-advance) {background:var(--ref-detail-soft); color:var(--ref-detail-ink); border-color:var(--ref-detail-line);}
@media(prefers-reduced-motion:reduce) {.ref-history-details .ref-detail-button {transition:none;}}
