/* Save Image capture card (rendered off-screen, captured by html2canvas) */
.capture-card {
    position: fixed;
    left: -10000px;
    top: 0;
    z-index: 0;
    width: 800px;
    height: 1000px;
    display: flex;
    flex-direction: column;
    --ticket-hole-top: 22px;
    --ticket-hole-size: 24px;
    --ticket-hole-shadow-y: -2px;
    --ticket-hole-shadow-blur: 4px;
    --ticket-hole-shadow-alpha: .18;
    --ticket-hole-bg: #fdfaf0;
    background: #fbf6e8;
    font-family: var(--font-app);
    color: var(--ink);
    padding: 58px 48px 42px;
    box-sizing: border-box;
    pointer-events: none;
    overflow: hidden;
    filter: drop-shadow(0 2px 1px rgba(60,42,30,.06)) drop-shadow(0 12px 22px rgba(60,42,30,.13));
    animation: none;
}
.capture-card::before {
    content: "";
    position: absolute;
    top: var(--ticket-hole-top);
    left: 50%;
    width: var(--ticket-hole-size);
    height: var(--ticket-hole-size);
    border-radius: 50%;
    background: var(--ticket-hole-bg);
    box-shadow: 0 var(--ticket-hole-shadow-y) var(--ticket-hole-shadow-blur) rgba(60,42,30,var(--ticket-hole-shadow-alpha));
    transform: translateX(-50%);
    pointer-events: none;
}
.capture-card.capture-card--canvas-hole::before {
    display: none;
}
.capture-card::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 18px;
    pointer-events: none;
    background:
        linear-gradient(135deg, var(--cream) 25%, transparent 25%) 0 0 / 15px 18px repeat-x,
        linear-gradient(225deg, var(--cream) 25%, transparent 25%) 7.5px 0 / 15px 18px repeat-x;
}
.capture-card .cap-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
}
.capture-card .cap-order-no {
    margin: 0 0 22px;
    color: var(--stone);
    font-family: ui-monospace, "SFMono-Regular", Consolas, "Liberation Mono", monospace;
    font-size: 14px;
    font-weight: 400;
    letter-spacing: 1.3px;
    line-height: 1.15;
    text-align: center;
}
.capture-card .cap-order-main,
.capture-card .cap-order-date {
    display: block;
}
.capture-card .cap-order-main {
    text-transform: uppercase;
}
.capture-card .cap-order-date {
    margin-top: 4px;
    color: rgba(125,114,104,.78);
    font-size: inherit;
    letter-spacing: 0;
    text-transform: none;
}
.capture-card .cap-source-card,
.capture-card .cap-empty-card {
    display: grid;
    grid-template-columns: 76px minmax(0, 1fr);
    column-gap: 20px;
    align-items: center;
    margin-bottom: 12px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
}
.capture-card .cap-empty-card {
    display: block;
}
.capture-card .cap-source-card:not(.has-thumb) {
    grid-template-columns: 1fr;
}
.capture-card .cap-thumb {
    width: 76px;
    height: 76px;
    border-radius: 50%;
    border: 1px solid rgba(160,82,45,.18);
    background-color: var(--sand);
    background-size: cover;
    background-position: center;
    flex-shrink: 0;
    overflow: hidden;
}
.capture-card .cap-name {
    margin: 0;
    font-family: var(--font-display);
    font-size: 46px;
    font-weight: 400;
    line-height: 1.04;
    color: var(--rust);
}
.capture-card .cap-tagline {
    margin: 10px 0 20px;
    color: var(--stone);
    font-family: var(--font-app);
    font-size: var(--cap-tagline-size, 18px);
    font-style: italic;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: clip;
    white-space: nowrap;
}
.capture-card .cap-divider {
    border: 0;
    border-top: 1px dashed rgba(160,82,45,.35);
    margin: 0 0 24px;
}
.capture-card .cap-section {
    padding: 0;
    margin: 0 0 22px;
}
.capture-card .cap-section-label {
    font-family: var(--font-app);
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--rust);
    margin: 0 0 10px;
}
.capture-card .cap-items {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    min-height: 34px;
}
/* Save-image chip styling mirrors the live browser ticket:
   filled backgrounds, no borders, same text color for both
   standard and added. Fill color is the only differentiator. */
.capture-card .cap-chip {
    display: inline-flex;
    position: relative;
    align-items: center;
    gap: 6px;
    padding: 7px 15px 7px 17px;
    border: 0;
    font-family: var(--font-app);
    font-size: 16px;
    font-weight: 500;
    line-height: 1.1;
    border-radius: 999px;
    background: var(--sand);
    color: var(--ink);
}
.capture-card .cap-chip.added {
    background: rgba(160,82,45,.14);
    color: var(--ink);
}
/* Save-image card mirrors the live ticket: customs render in the
   regular sand color with italic text, no separate background. */
.capture-card .cap-chip.unknown {
    font-style: italic;
    color: var(--ink);
}
.capture-card .cap-chip.removed {
    background: rgba(0,0,0,.04);
    color: var(--stone-light);
    opacity: 1;
}
.capture-card .cap-chip-strike {
    position: absolute;
    left: 13px;
    right: 13px;
    top: 50%;
    height: 0;
    border-top: 1.5px solid currentColor;
    opacity: .72;
    transform: translateY(-50%);
    pointer-events: none;
}
.capture-card .cap-empty {
    font-family: var(--font-prose);
    font-size: 16px;
    color: var(--stone-light);
    font-style: italic;
}
.capture-card .cap-warn {
    font-family: var(--font-app);
    font-size: 15px;
    color: var(--rust-muted);
    margin: -12px 0 18px;
}
.capture-card .cap-balance-title {
    margin: 0 0 14px;
    padding-top: 16px;
    border-top: 3px double rgba(160,82,45,.30);
    font-family: var(--font-app);
    font-size: 15px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--rust);
}
.capture-card .cap-meter-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 9px;
}
.capture-card .cap-meter-label {
    font-family: var(--font-app);
    font-size: 14px;
    font-weight: 400;
    color: var(--text-secondary);
    width: 92px;
    text-align: right;
    flex-shrink: 0;
}
.capture-card .cap-meter-value {
    width: 42px;
    flex: 0 0 auto;
    font-size: 14px;
    font-weight: 800;
    color: var(--rust);
    text-align: right;
}
.capture-card .cap-meter-ticks {
    display: flex;
    gap: 4px;
    flex: 1;
}
.capture-card .cap-meter-tick {
    height: 10px;
    flex: 1;
    border-radius: 2px;
    background: rgba(160, 82, 45, .13);
}
.capture-card .cap-meter-tick.filled {
    background: #8b4726;
}
.capture-card .cap-meter-tick.high {
    background: var(--rust);
}
.capture-card .cap-suggestion {
    margin-top: 6px;
    padding: 5px 10px;
    background: var(--section-bg);
    border: 1px solid #e8e2d9;
    border-radius: 6px;
    font-size: 11px;
    color: #6b5e53;
}
.capture-card .cap-suggestion-text {
    font-weight: 600;
}
/* Footer logo mark */
.capture-card .cap-footer-mark {
    text-align: center;
    margin-top: auto;
    padding-top: 0;
    padding-bottom: 0;
    border-top: 0;
}
.capture-card .cap-footer-mark img {
    display: block;
    width: auto;
    height: 38px;
    opacity: 0.88;
    margin: 0 auto;
}
.capture-card .cap-footer {
    margin-top: 5px;
    padding-top: 0;
    border-top: none;
    font-size: 17px;
    font-weight: 600;
    color: rgba(160,82,45,.66);
    text-align: center;
    letter-spacing: .35px;
}
/* When logo mark is hidden, footer gets its own top border */
.capture-card .cap-footer.no-mark {
    margin-top: 16px;
    padding-top: 10px;
    border-top: 1px solid #e8e2d9;
}

/* Image preview overlay (mobile save-to-photos) */
.image-preview-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1100;
    background: rgba(0,0,0,.85);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.image-preview-overlay.open {
    display: flex;
}
.image-preview-overlay img {
    max-width: 100%;
    max-height: calc(100vh - 120px);
    max-height: calc(100dvh - 120px);
    border-radius: 8px;
    box-shadow: 0 4px 24px rgba(0,0,0,.4);
}
.image-preview-hint {
    margin-top: 16px;
    font-family: var(--font-app);
    font-size: 14px;
    color: rgba(255,255,255,.8);
    text-align: center;
}
.image-preview-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255,255,255,.15);
    border: none;
    color: #fff;
    font-size: 22px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    touch-action: manipulation;
}
