/* ── BookedUp Shipping Log ─────────────────────────────
   Colours are CSS variables so the log can be re-themed from the page
   without editing this file. */
.busl-log {
    --busl-ink:      #2a241e;
    --busl-muted:    #7d7168;
    --busl-line:     #ece5dc;
    --busl-card:     #ffffff;
    --busl-accent:   #c98aa0;
    --busl-accent-2: #a8bcd4;
    --busl-chip:     #dbe6f0;
    --busl-radius:   14px;

    display: flex;
    flex-direction: column;
    /* Stated outright rather than relied on as the default. A theme setting
       align-items:center on a container makes every card shrink to fit its own
       contents, so a batch with a long ETA renders wider than one with a short
       ETA — cards that should be identical end up ragged. */
    align-items: stretch;
    gap: 18px;
    width: 100%;
    box-sizing: border-box;
}

.busl-batch {
    background: var(--busl-card);
    border: 1px solid var(--busl-line);
    border-radius: var(--busl-radius);
    overflow: hidden;
    /* Same reason: pin every card to the full width of the column whatever the
       theme does, and keep padding inside that width. */
    width: 100%;
    max-width: 100%;
    align-self: stretch;
    flex: 0 0 auto;
    margin: 0;
    box-sizing: border-box;
}
.busl-log *, .busl-log *::before, .busl-log *::after { box-sizing: border-box; }

/* ── Header (always visible, whole thing is the toggle) ── */
.busl-head {
    display: flex;
    align-items: center;
    gap: 18px;
    width: 100%;
    max-width: 100%;
    padding: 20px 22px;
    background: none;
    border: 0;
    text-align: left;
    cursor: pointer;
    font: inherit;
    color: var(--busl-ink);
}
.busl-head:hover { background: #fcfaf8; }
.busl-head:focus-visible { outline: 2px solid var(--busl-accent); outline-offset: -3px; }

.busl-chip {
    flex: 0 0 auto;
    width: 74px; height: 74px;
    display: flex; align-items: center; justify-content: center;
    background: var(--busl-chip);
    border-radius: 10px;
    font-size: 24px; font-weight: 500;
    color: #3d4a57;
}

.busl-main { flex: 1 1 auto; min-width: 0; display: block; }

.busl-title {
    display: block;
    font-size: 24px;
    line-height: 1.2;
    margin-bottom: 4px;
}
.busl-update {
    display: block;
    font-size: 15px;
    color: #554c45;
    margin-bottom: 12px;
    line-height: 1.45;
}

.busl-bar {
    display: block;
    height: 5px;
    background: var(--busl-line);
    border-radius: 99px;
    overflow: hidden;
    margin-bottom: 8px;
}
.busl-bar-fill {
    display: block; height: 100%;
    border-radius: 99px;
    background: linear-gradient(90deg, var(--busl-accent-2), var(--busl-accent));
    transition: width .5s ease;
}
/* An unrecognised status shows an empty, muted track rather than a filled bar
   that would imply progress nobody has confirmed. */
.busl-bar-unknown { background: #f2eee9; }

.busl-status {
    display: block;
    font-size: 12px;
    letter-spacing: .09em;
    text-transform: uppercase;
    color: var(--busl-accent);
    font-weight: 600;
}

.busl-eta { flex: 0 0 auto; text-align: right; }
.busl-eta-label {
    display: block;
    font-size: 10px; letter-spacing: .14em;
    text-transform: uppercase; color: var(--busl-muted);
    margin-bottom: 2px;
}
.busl-eta-value { display: block; font-size: 19px; font-style: italic; }

.busl-caret {
    flex: 0 0 auto;
    width: 34px; height: 34px;
    border: 1px solid var(--busl-line);
    border-radius: 50%;
    position: relative;
}
.busl-caret::before {
    content: ""; position: absolute;
    top: 50%; left: 50%;
    width: 7px; height: 7px;
    border-right: 1.5px solid var(--busl-muted);
    border-bottom: 1.5px solid var(--busl-muted);
    transform: translate(-50%, -70%) rotate(45deg);
    transition: transform .25s ease;
}
.busl-batch.is-open .busl-caret::before {
    transform: translate(-50%, -30%) rotate(225deg);
}

/* ── Expanded body ── */
.busl-body { padding: 0 22px 22px; }

.busl-titles-caption {
    font-size: 13px;
    color: var(--busl-muted);
    margin: 0 0 8px;
}
.busl-titles {
    list-style: none;
    margin: 0 0 22px;
    padding: 14px 16px;
    background: #faf7f2;
    border-radius: 10px;
    display: flex; flex-wrap: wrap; gap: 8px 10px;
}
.busl-titles li {
    margin: 0;
    font-size: 13.5px;
    line-height: 1.35;
    background: #fff;
    border: 1px solid var(--busl-line);
    border-radius: 99px;
    padding: 5px 13px;
}

/* ── Stage rail ── */
.busl-rail {
    list-style: none;
    display: flex;
    margin: 0; padding: 0;
    gap: 4px;
}
.busl-step {
    flex: 1 1 0;
    min-width: 0;
    text-align: center;
    position: relative;
}
.busl-dot {
    display: block;
    width: 9px; height: 9px;
    border-radius: 50%;
    background: #dcd6cf;
    margin: 0 auto 8px;
}
.busl-step.is-done .busl-dot    { background: #3b332c; }
.busl-step.is-current .busl-dot {
    background: var(--busl-accent);
    box-shadow: 0 0 0 4px rgba(201, 138, 160, .22);
}
.busl-step-label {
    display: block;
    font-size: 9.5px;
    letter-spacing: .05em;
    text-transform: uppercase;
    color: #b3aaa2;
    line-height: 1.35;
    white-space: pre-line;   /* the "|" in a short label became a newline */
}
.busl-step.is-done .busl-step-label    { color: #6a6058; }
.busl-step.is-current .busl-step-label { color: var(--busl-ink); font-weight: 600; }

/* ── Notes ── */
.busl-note {
    padding: 16px 18px;
    background: #faf7f2;
    border: 1px solid var(--busl-line);
    border-radius: 10px;
    color: #6a6058;
    font-size: 14px;
}
.busl-note.busl-inline { margin-top: 16px; padding: 10px 14px; font-size: 13px; }
.busl-note.busl-error  { background: #fcf3f3; border-color: #e8c9c9; color: #7a2224; }

/* ── Bookshelf ── */
.busl-shelf {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;       /* spines of different heights sit on one shelf line */
    gap: 4px;
    margin: 0 0 22px;
    padding: 18px 16px 14px;
    background: linear-gradient(180deg, #faf7f2 0%, #f3ece1 100%);
    border-radius: 10px;
    border-bottom: 3px solid #e0d5c4;
}
.busl-book { margin: 0; line-height: 0; }
.busl-spine {
    display: block;
    border-radius: 2px 3px 3px 2px;
    box-shadow: 1px 1px 3px rgba(60,45,30,.16);
    transition: transform .18s ease;
}
.busl-book-spine:hover .busl-spine { transform: translateY(-5px); }

/* Covers mode: fixed-height images so a shelf of mixed artwork still lines up. */
.busl-shelf-covers { align-items: flex-end; gap: 14px; }
.busl-book-cover { width: 104px; text-align: center; }
.busl-book-cover img {
    display: block;
    width: 100%;
    height: 156px;
    object-fit: cover;
    border-radius: 3px;
    box-shadow: 1px 2px 5px rgba(60,45,30,.2);
    transition: transform .18s ease;
}
.busl-book-cover:hover img { transform: translateY(-5px); }
.busl-book-cover figcaption {
    margin-top: 7px;
    font-size: 11px;
    line-height: 1.3;
    color: #6a6058;
    /* Long box titles would otherwise push the shelf apart. */
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ── Narrow screens ──
   The nine-step rail can't stay readable across a phone, so it becomes a
   vertical list where each step has room for its full label. */
@media (max-width: 782px) {
    .busl-head { flex-wrap: wrap; gap: 12px; padding: 16px; }
    .busl-chip { width: 52px; height: 52px; font-size: 18px; }
    .busl-main { flex: 1 1 100%; order: 3; }
    .busl-title { font-size: 20px; }
    .busl-eta { text-align: left; }
    .busl-body { padding: 0 16px 18px; }

    .busl-shelf { padding: 14px 12px 10px; gap: 3px; }
    .busl-book-cover { width: 84px; }
    .busl-book-cover img { height: 126px; }

    .busl-rail { flex-direction: column; gap: 0; }
    .busl-step {
        display: flex; align-items: center; gap: 10px;
        text-align: left; padding: 7px 0;
    }
    .busl-dot { margin: 0; flex: 0 0 auto; }
    .busl-step-label { font-size: 11px; white-space: normal; }
}
