html, body { height: 100%; overflow: hidden; margin: 0; }
body { background: #F2F2F4; }

.lw-nav { background: #2A2A2A; padding: 6px 14px; font-size: 12px; flex-shrink: 0; }
.lw-nav a { color: #B6D4FF; text-decoration: none; margin-right: 16px; }
.lw-nav a:hover { text-decoration: underline; }

.page-shell {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    display: flex; flex-direction: column;
    overflow: hidden;
    padding-bottom: env(safe-area-inset-bottom);
}

.az-header {
    background: #3C3C3C; color: #fff;
    padding: 8px 14px; flex-shrink: 0;
    display: flex; align-items: center; gap: 8px;
    flex-wrap: wrap;
}
.az-header h1 { margin: 0; font-size: 14pt; font-weight: 600; flex: 1; }
.az-header .count { font-size: 11px; color: #B6D4FF; font-weight: 500; }
.az-header select {
    background: #2A2A2A; color: #fff; border: 1px solid #6A6A6A;
    border-radius: 3px; padding: 3px 6px; font-size: 12px;
}
.hdr-btn {
    background: transparent; color: #fff;
    border: 1px solid #6A6A6A; border-radius: 3px;
    padding: 4px 11px; cursor: pointer;
    font: 12px "Segoe UI", system-ui, sans-serif;
    white-space: nowrap;
}
.hdr-btn:hover { background: #5A5A5A; }
.hdr-btn.primary { background: #1A7A3C; border-color: #155F30; }
.hdr-btn.primary:hover { background: #1F8C46; }
.hdr-btn[disabled] { opacity: 0.5; cursor: default; }

.az-status {
    background: #F0F0F2; border-top: 1px solid #E6E6E8;
    padding: 4px 12px; font-size: 11px; color: #666; flex-shrink: 0;
}

/* ---- Two-pane layout ------------------------------------------------- */
.az-panes { flex: 1; display: flex; flex-direction: column; min-height: 0; }
@media (min-width: 920px) {
    .az-panes { flex-direction: row; }
    .az-list { flex: 0 0 42%; max-width: 540px; border-right: 1px solid #E0E0E2; }
    .az-detail { flex: 1; }
}

.az-list { overflow-y: auto; background: #fff; min-height: 0; }
.az-empty { text-align: center; color: #888; padding: 40px 20px; font-size: 13px; font-style: italic; }

.az-row {
    padding: 10px 14px; border-bottom: 1px solid #E6E6E8; cursor: pointer;
    display: grid; grid-template-columns: 1fr auto; column-gap: 10px; row-gap: 2px;
    background: #fff;
}
.az-row:hover { background: #F5F8FD; }
.az-row.active { background: #ECF4FD; }
.az-row .summary { font-size: 13px; color: #222; grid-column: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.az-row .total   { font-size: 13px; color: #1A7A3C; font-weight: 600; grid-column: 2; white-space: nowrap; }
.az-row .meta    { font-size: 11px; color: #888; grid-column: 1; }
.az-row .pill    { grid-column: 2; }

.pill {
    display: inline-block; padding: 1px 7px; border-radius: 10px;
    font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.4px;
    background: #E6E6E8; color: #555;
}
.pill.s-Ordered   { background: #FFF4D6; color: #87651A; }
.pill.s-Shipped   { background: #DEEBFB; color: #0A4FA6; }
.pill.s-Delivered { background: #DDF1E2; color: #1A7A3C; }
.pill.s-Cancelled { background: #FBE9E7; color: #B0382B; }
.pill.s-Refunded  { background: #EFE0F7; color: #5B2585; }

/* ---- Detail pane ----------------------------------------------------- */
.az-detail { background: #FAF8F4; display: flex; flex-direction: column; min-height: 0; overflow-y: auto; }
.az-detail.empty { align-items: center; justify-content: center; color: #888; font-style: italic; padding: 40px; text-align: center; }

.az-detail-hdr { background: #fff; border-bottom: 1px solid #E0E0E2; padding: 14px 18px; }
.az-detail-hdr h2 { margin: 0 0 6px 0; font-size: 14pt; color: #111; word-break: break-word; }
.az-detail-hdr .meta {
    font-size: 12px; color: #444;
    display: grid; grid-template-columns: 110px 1fr; gap: 3px 8px;
}
.az-detail-hdr .meta .lbl { color: #888; text-transform: uppercase; font-size: 10px; letter-spacing: 0.5px; }
.az-detail-hdr .meta .val { color: #222; word-break: break-word; }

.az-actions {
    background: #F0F0F2; border-bottom: 1px solid #E0E0E2;
    padding: 8px 14px; display: flex; gap: 6px; flex-wrap: wrap;
}
.az-actions button {
    background: #fff; border: 1px solid #C9C9CC; border-radius: 4px;
    padding: 5px 12px; font: 12px "Segoe UI", system-ui, sans-serif;
    cursor: pointer; color: #333;
}
.az-actions button:hover { background: #ECF4FD; border-color: #0A66C2; color: #0A66C2; }
.az-actions button.danger:hover { background: #FBE9E7; border-color: #C00000; color: #C00000; }
.az-actions .spacer { flex: 1; }
.az-actions input.cat {
    border: 1px solid #C9C9CC; border-radius: 4px;
    padding: 4px 8px; font-size: 12px; width: 160px;
}
.az-actions a.amzn-link {
    display: inline-block; background: #FF9900; color: #111;
    border: 1px solid #E68A00; border-radius: 4px;
    padding: 5px 12px; font: 600 12px "Segoe UI", system-ui, sans-serif;
    text-decoration: none;
}
.az-actions a.amzn-link:hover { background: #FFAB1A; }

.az-section { padding: 14px 18px; }
.az-section h3 {
    margin: 0 0 8px 0;
    font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px;
    color: #888; font-weight: 600;
}
.az-section .empty-note { color: #999; font-style: italic; font-size: 12px; padding: 6px 0; }

.az-shipments .ship-row {
    background: #fff; border: 1px solid #E2DED5; border-radius: 6px;
    padding: 10px 12px; margin-bottom: 8px;
    display: grid; grid-template-columns: auto 1fr auto; gap: 8px;
    font-size: 12px;
}
.az-shipments .ship-row .carrier { font-weight: 600; color: #333; }
.az-shipments .ship-row .tracking { color: #555; word-break: break-all; }
.az-shipments .ship-row .tracking a { color: #0A66C2; text-decoration: none; }
.az-shipments .ship-row .tracking a:hover { text-decoration: underline; }
.az-shipments .ship-row .when { font-size: 11px; color: #888; }

.az-lines table { width: 100%; border-collapse: collapse; font-size: 12px; }
.az-lines th { text-align: left; padding: 4px 8px; background: #ECECEE; color: #555; border-bottom: 1px solid #DDD; font-weight: 600; }
.az-lines td { padding: 6px 8px; border-bottom: 1px solid #EAEAEC; vertical-align: top; }
.az-lines td.qty { text-align: right; width: 50px; color: #555; }
.az-lines td.asin { font-family: Consolas, "Courier New", monospace; font-size: 11px; color: #888; width: 110px; }

/* Phone collapse */
@media (max-width: 919px) {
    .az-list.hidden-mobile { display: none; }
    .az-detail.hidden-mobile { display: none; }
}

/* ---- folds (Story 5757): each section folds at its heading ---------- */
.az-foldhead { cursor: pointer; user-select: none; }
.az-chev { display: inline-block; width: 14px; color: #888; font-size: 11px; transition: transform .15s; }
.az-fold:not(.folded) > .az-foldhead .az-chev { transform: rotate(90deg); }
.az-fold.folded > .az-foldbody { display: none; }
.az-fold.folded > .az-foldhead { margin-bottom: 0; }
