/* Photo Tickets -- secondary photo-only ticket system, warm palette shared
   with gallery.css's long-press sheet so it feels like the same app. */

.pt-main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px 20px 80px;
}

.pt-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

.pt-title {
    font-size: 1.6rem;
    color: var(--primary-dark);
    margin: 0;
}

.pt-header-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    margin-top: 14px;
}

.pt-archived-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9rem;
    color: var(--primary-color);
    cursor: pointer;
    user-select: none;
}

/* Header action buttons -- soft earth tones so the four actions read as
   distinct at a glance, plus tighter padding/font so they fit alongside
   the abbreviated labels on a phone screen. Targeted by id, not by the
   shared .cancel-btn/.primary-btn/.storyify-toggle-btn classes those
   buttons also carry, since those classes are reused elsewhere in the app
   (e.g. collage.html's Story-ify toggle) and shouldn't be affected here. */
#ptSelectBtn,
#ptGalleryToggleBtn,
#ptStoryifyToggleBtn,
#ptBulkUploadBtn,
#ptNewTicketBtn {
    padding: 0.5rem 0.85rem;
    font-size: 0.85rem;
    white-space: nowrap;
    border: none;
    color: #fff;
}
#ptSelectBtn { background: #b98b76; }
#ptSelectBtn:hover { background: #a2735e; }
#ptGalleryToggleBtn { background: #7d8fa3; }
#ptGalleryToggleBtn:hover { background: #67788b; }
#ptGalleryToggleBtn.pt-gallery-toggle--on { background: #4f6072; }
#ptStoryifyToggleBtn { background: #94997c; color: #fff; }
#ptStoryifyToggleBtn:hover { background: #7e8368; color: #fff; }
#ptBulkUploadBtn { background: #c2a06a; }
#ptBulkUploadBtn:hover { background: #ab8952; }
#ptNewTicketBtn { background: #8a6f56; }
#ptNewTicketBtn:hover { background: #73593f; }
@media (max-width: 480px) {
    .pt-header-actions { gap: 8px; }
    #ptSelectBtn,
    #ptGalleryToggleBtn,
    #ptStoryifyToggleBtn,
    #ptBulkUploadBtn,
    #ptNewTicketBtn {
        padding: 0.42rem 0.6rem;
        font-size: 0.78rem;
    }
}

.pt-search-row {
    position: relative;
    margin-top: 14px;
    display: flex;
    gap: 10px;
    align-items: stretch;
}
.pt-search-row .pt-search-input { flex: 1; }
.pt-retailer-filter {
    flex: 0 0 auto;
    max-width: 180px;
    box-sizing: border-box;
    padding: 0.55rem 1.9rem 0.55rem 0.7rem;
    border: 1px solid #ddd0c0;
    border-radius: 8px;
    background: #fff;
    font-size: 0.88rem;
    font-family: inherit;
    color: var(--primary-dark);
}
.pt-retailer-filter:focus { outline: none; border-color: var(--primary-color); }
@media (max-width: 480px) {
    .pt-search-row { flex-wrap: wrap; }
    .pt-retailer-filter { max-width: none; flex: 1 1 100%; }
}

/* ── Color / fire-border filter row ─────────────────────────────────── */
.pt-color-filter-row {
    margin-top: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.pt-filter-label {
    font-size: 0.82rem;
    color: #9a8a76;
}
.pt-color-filter-swatches {
    display: flex;
    gap: 8px;
}
.pt-color-filter-swatch {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 1px solid #d8cabb;
    cursor: pointer;
    padding: 0;
    box-sizing: border-box;
    opacity: 0.55;
}
/* Hover and the actively-selected state now swap in a slightly darker
   shade of each swatch's own color (previously just raised opacity, which
   blended toward a flat grey regardless of hue) -- one darker shade per
   color so each stays visibly itself, just deeper. */
.pt-color-filter-swatch:hover,
.pt-color-filter-swatch--selected { opacity: 1; }
.pt-color-filter-swatch--white { background: #ffffff; }
.pt-color-filter-swatch--white:hover,
.pt-color-filter-swatch--white.pt-color-filter-swatch--selected { background: #dedede; }
.pt-color-filter-swatch--pink  { background: #e8a9b3; border-color: #d98f9c; }
.pt-color-filter-swatch--pink:hover,
.pt-color-filter-swatch--pink.pt-color-filter-swatch--selected { background: #ca939c; }
.pt-color-filter-swatch--blue  { background: #a7c0d9; border-color: #8fa9c4; }
.pt-color-filter-swatch--blue:hover,
.pt-color-filter-swatch--blue.pt-color-filter-swatch--selected { background: #91a7bd; }
.pt-color-filter-swatch--grey  { background: #8e8e8e; border-color: #737373; }
.pt-color-filter-swatch--grey:hover,
.pt-color-filter-swatch--grey.pt-color-filter-swatch--selected { background: #7c7c7c; }
.pt-color-filter-swatch--gold  { background: #d4af6a; border-color: #b8944f; }
.pt-color-filter-swatch--gold:hover,
.pt-color-filter-swatch--gold.pt-color-filter-swatch--selected { background: #b8985c; }
.pt-color-filter-swatch--lilac { background: #b39ddb; border-color: #9575cd; }
.pt-color-filter-swatch--lilac:hover,
.pt-color-filter-swatch--lilac.pt-color-filter-swatch--selected { background: #9e86cc; }
.pt-color-filter-swatch--selected {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}
.pt-fire-filter-btn {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    border: 1px solid #d8cabb;
    background: #fff;
    cursor: pointer;
    padding: 0;
    font-size: 13px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.55;
}
.pt-fire-filter-btn:hover { opacity: 0.85; }
.pt-fire-filter-btn--on {
    opacity: 1;
    background: linear-gradient(135deg, #ffb347, #ff5f1f, #d90000);
    border-color: transparent;
    box-shadow: 0 0 0 2px rgba(217, 0, 0, 0.25);
}

/* ── Ticket gallery (replaces the ticket-strip list when Gallery mode is
   toggled on) -- true thumbnail-sized tiles. Columns are capped at a fixed
   pixel size (not 1fr) so tiles can never balloon to fill a wide desktop
   container; 8 across on desktop, 6 across on mobile, just smaller tiles
   on narrow screens rather than fewer columns. Thumbnail pulled from the
   first photo on each ticket. ─────────────────────────────────────────── */
.pt-ticket-gallery {
    display: grid;
    grid-template-columns: repeat(8, minmax(0, 108px));
    gap: 8px;
}
@media (max-width: 620px) {
    .pt-ticket-gallery { grid-template-columns: repeat(6, minmax(0, 50px)); gap: 6px; }
}
.pt-gallery-tile {
    display: flex;
    flex-direction: column;
    gap: 6px;
    cursor: pointer;
    max-width: 108px;
    min-width: 0;
    position: relative;
}
@media (max-width: 620px) {
    .pt-gallery-tile { max-width: 50px; }
}
.pt-gallery-tile .pt-ticket-select-check {
    position: absolute;
    top: 4px;
    left: 4px;
    z-index: 2;
}
/* Colored border matching the ticket's dot color, plus (if fire-flagged) a
   second outer fire-gradient ring wrapped around it -- an actual second
   border, not a replacement, per explicit request. */
.pt-gallery-tile-img-wrap {
    border-radius: 10px;
}
.pt-gallery-tile-img-wrap--fire {
    padding: 3px;
    border-radius: 13px;
    background: linear-gradient(135deg, #ffb347, #ff5f1f, #d90000, #ff5f1f, #ffb347);
}
.pt-gallery-tile-img {
    aspect-ratio: 1 / 1;
    border-radius: 10px;
    overflow: hidden;
    background: #f0e6d4;
    border: 3px solid #d8cabb;
    box-sizing: border-box;
    -webkit-touch-callout: none;
    user-select: none;
    transition: box-shadow 0.15s ease;
}
.pt-gallery-tile-img--white { border-color: #d8cabb; }
.pt-gallery-tile-img--pink  { border-color: #d98f9c; }
.pt-gallery-tile-img--blue  { border-color: #8fa9c4; }
.pt-gallery-tile-img--grey  { border-color: #737373; }
.pt-gallery-tile-img--gold  { border-color: #b8944f; }
.pt-gallery-tile-img--lilac { border-color: #9575cd; }
.pt-gallery-tile:hover .pt-gallery-tile-img {
    box-shadow: 0 0 0 2px var(--primary-color, #bb5d4c);
}
.pt-gallery-tile-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pt-gallery-tile-empty {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #b3a693;
    font-size: 0.78rem;
    text-align: center;
    padding: 6px;
    box-sizing: border-box;
}
.pt-gallery-tile-caption {
    font-size: 0.78rem;
    color: #9a8a76;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.pt-gallery-tile--archived { opacity: 0.55; }
.pt-search-input {
    width: 100%;
    box-sizing: border-box;
    padding: 0.55rem 2.2rem 0.55rem 0.85rem;
    border: 1px solid #ddd0c0;
    border-radius: 8px;
    background: #fff;
    font-size: 0.92rem;
    font-family: inherit;
    color: var(--primary-dark);
}
.pt-search-input:focus {
    outline: none;
    border-color: var(--primary-color);
}
.pt-search-input::placeholder { color: #b3a693; }
.pt-search-clear {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    border: none;
    background: none;
    color: #a8988a;
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
    border-radius: 50%;
}
.pt-search-clear:hover { background: #f0e6d4; color: var(--primary-color); }

.pt-subtitle {
    color: #8a7a68;
    font-size: 0.92rem;
    margin: 6px 0 24px;
    max-width: 760px;
}

.pt-empty {
    text-align: center;
    color: #a8988400;
    color: #9a8a76;
    padding: 40px 0;
    font-size: 0.95rem;
}

/* ── Floating quick actions (Go to top / Gallery view) -- ticket-strip
   view only, right margin, deliberately understated (low resting opacity,
   full on hover) so they don't compete with the actual content. ──────── */
.pt-float-actions {
    position: fixed;
    right: 18px;
    bottom: 100px;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
    z-index: 900;
}
.pt-float-btn {
    padding: 9px 14px;
    border-radius: 999px;
    border: 1px solid #e5ded5;
    background: rgba(253, 248, 242, 0.88);
    backdrop-filter: blur(3px);
    color: #6b5842;
    font-size: 0.78rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    white-space: nowrap;
    box-shadow: 0 2px 10px rgba(90, 70, 45, 0.15);
    opacity: 0.55;
    transition: opacity 0.15s ease, box-shadow 0.15s ease;
}
.pt-float-btn:hover { opacity: 1; box-shadow: 0 4px 14px rgba(90, 70, 45, 0.22); }
@media (max-width: 620px) {
    .pt-float-actions { right: 12px; bottom: 84px; }
    .pt-float-btn { padding: 8px 12px; font-size: 0.74rem; }
}

.pt-list {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

/* ── Strip (ticket) ─────────────────────────────────────────────────── */
.pt-strip {
    position: relative;
    background: #fdf8f2;
    border: 1px solid #e5ded5;
    border-radius: 14px;
    padding: 14px 16px 26px;
    box-shadow: 0 2px 6px rgba(90, 70, 45, 0.06);
}

.pt-strip-created {
    position: absolute;
    left: 16px;
    bottom: 6px;
    font-size: 0.68rem;
    color: #b3a693;
    pointer-events: none;
    user-select: none;
}

.pt-strip--archived {
    opacity: 0.55;
}

/* Brief pulse on the ticket you land back on after Via-Vision sends you
   here, so it's clear at a glance which one that was. */
.pt-strip-highlight {
    animation: ptStripHighlightPulse 1.6s ease;
}
@keyframes ptStripHighlightPulse {
    0%   { box-shadow: 0 0 0 3px rgba(187, 93, 76, 0.55); }
    100% { box-shadow: 0 2px 6px rgba(90, 70, 45, 0.06); }
}

/* Each color variant also sets --strip-bg, a plain custom property (not
   painted by itself) that .pt-strip--fire below reads to keep the ticket's
   own fill exactly as-is while it draws the gradient in the border ring --
   see that rule's comment for why. */
.pt-strip--white { background: #ffffff; --strip-bg: #ffffff; }
.pt-strip--pink  { background: #fbe6ea; border-color: #f0c7d0; --strip-bg: #fbe6ea; }
.pt-strip--blue  { background: #e7eff8; border-color: #c7d6e8; --strip-bg: #e7eff8; }
.pt-strip--grey  { background: #8e8e8e; border-color: #737373; --strip-bg: #8e8e8e; }
.pt-strip--gold  { background: #faf1d9; border-color: #e8d3a0; --strip-bg: #faf1d9; }
.pt-strip--lilac { background: #ece7f6; border-color: #d1c4e9; --strip-bg: #ece7f6; }

/* Thick orange/red gradient outline for a flagged ("fire") ticket -- an
   outline only, never a fill. Standard two-background-layers trick: a
   transparent 4px border, with one background layer painted only inside
   the padding box (the ticket's own --strip-bg color, unchanged) and a
   second painted out to the border box (the gradient), so the gradient can
   only ever show through the transparent border ring itself. This must
   come after the .pt-strip--{color} rules above so its border/background
   win over theirs for whichever color a fire ticket happens to be. */
.pt-strip--fire {
    border: 4px solid transparent;
    background:
        linear-gradient(var(--strip-bg, #fdf8f2), var(--strip-bg, #fdf8f2)) padding-box,
        linear-gradient(135deg, #ffb347, #ff5f1f, #d90000, #ff5f1f, #ffb347) border-box;
}

.pt-strip-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.pt-strip-top-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Drag handle shown on each strip's header only while Rearrange mode is
   on -- Sortable's `handle` option scopes dragging to this element so the
   rest of the strip (inputs, buttons) keeps working normally underneath. */
.pt-strip-drag-handle {
    cursor: grab;
    color: #9a8a76;
    font-size: 1rem;
    line-height: 1;
    padding: 2px 4px;
    touch-action: none;
    -webkit-touch-callout: none;
    user-select: none;
}
.pt-strip-drag-handle:active { cursor: grabbing; }

/* SortableJS state classes, shared by both the strip list and the gallery
   grid while Rearrange mode is on. */
.pt-sortable-ghost { opacity: 0.35; }
.pt-sortable-chosen { box-shadow: 0 0 0 2px var(--primary-color, #bb5d4c); }

.pt-ticket-select-check {
    flex: 0 0 auto;
    width: 22px;
    height: 22px;
    border-radius: 5px;
    background: rgba(255,255,255,0.9);
    border: 2px solid #b7ada0;
    padding: 0;
    cursor: pointer;
    position: relative;
}
.pt-ticket-select-check--on {
    background: var(--primary-color);
    border-color: var(--primary-color);
}
.pt-ticket-select-check--on::after {
    content: "\2713";
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 13px;
}

.pt-dots {
    display: flex;
    gap: 8px;
}

.pt-dot {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 1px solid #d8cabb;
    cursor: pointer;
    padding: 0;
    box-sizing: border-box;
}
.pt-dot--white { background: #ffffff; }
.pt-dot--pink  { background: #e8a9b3; border-color: #d98f9c; }
.pt-dot--blue  { background: #a7c0d9; border-color: #8fa9c4; }
.pt-dot--grey  { background: #8e8e8e; border-color: #737373; }
.pt-dot--gold  { background: #d4af6a; border-color: #b8944f; }
.pt-dot--lilac { background: #b39ddb; border-color: #9575cd; }
.pt-dot--selected {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Per-ticket toggle that turns the .pt-strip--fire outline on/off, sitting
   right next to the color dots. */
.pt-fire-toggle {
    width: 20px;
    height: 20px;
    border-radius: 6px;
    border: 1px solid #d8cabb;
    background: #fff;
    cursor: pointer;
    padding: 0;
    font-size: 11px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.5;
}
.pt-fire-toggle:hover { opacity: 0.8; }
.pt-fire-toggle--on {
    opacity: 1;
    background: linear-gradient(135deg, #ffb347, #ff5f1f, #d90000);
    border-color: transparent;
    box-shadow: 0 0 0 2px rgba(217, 0, 0, 0.25);
}

.pt-strip-menu-wrap { position: relative; }
.pt-strip-menu-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1;
    color: #6b5842;
    cursor: pointer;
    padding: 4px 10px;
}
.pt-strip-menu-btn:hover { color: var(--primary-dark); }
.pt-strip-menu {
    position: absolute;
    right: 0;
    top: 100%;
    background: #fff;
    border: 1px solid #e5ded5;
    border-radius: 10px;
    box-shadow: 0 6px 18px rgba(0,0,0,0.12);
    z-index: 50;
    min-width: 140px;
    overflow: hidden;
}
.pt-strip-menu-item {
    display: block;
    width: 100%;
    text-align: left;
    padding: 10px 14px;
    background: none;
    border: none;
    font-size: 0.88rem;
    color: var(--text-color);
    cursor: pointer;
}
.pt-strip-menu-item:hover { background: #f2ebe0; }
.pt-strip-menu-item--delete { color: #c0392b; }
.pt-strip-menu-item--delete:hover { background: #fde8e6; }

/* ── Strip body: left media | mid (checklist/caption) | right media ─── */
.pt-strip-body {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) minmax(220px, 1.2fr) minmax(200px, 1fr);
    gap: 16px;
    align-items: start;
}
@media (max-width: 860px) {
    .pt-strip-body { grid-template-columns: 1fr; }
}

/* ── Media zones ──────────────────────────────────────────────────── */
.pt-media-zone {
    position: relative;
    border: 1px dashed #ddd0c0;
    border-radius: 10px;
    padding: 8px;
    background: #f9f4ec;
    transition: background 0.15s, border-color 0.15s;
}
.pt-media-zone--dragover {
    background: #f0e6d4;
    border-color: var(--primary-color);
}

.pt-media-zone--left .pt-media-track {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    scroll-snap-type: x proximity;
    padding-bottom: 4px;
}
.pt-media-zone--left .pt-thumb {
    flex: 0 0 40%;
    scroll-snap-align: start;
}

.pt-media-zone--right .pt-media-track {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    max-height: 268px;
    overflow-y: auto;
}

.pt-thumb {
    position: relative;
    aspect-ratio: 3 / 4;
    border-radius: 8px;
    overflow: hidden;
    background: #eee2d0;
    touch-action: pan-y;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}
.pt-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    pointer-events: none;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

/* Shown once attachImgRetry() has exhausted its automatic retries -- hides
   the browser's default broken-image icon and gives a tappable way to try
   again instead of leaving a dead thumbnail until the page is reloaded. */
.pt-thumb--broken img,
.pt-gallery-tile-img.pt-thumb--broken img {
    visibility: hidden;
}
.pt-thumb--broken::after,
.pt-gallery-tile-img.pt-thumb--broken::after {
    content: 'Tap to retry';
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 6px;
    box-sizing: border-box;
    font-size: 0.72rem;
    color: #b3a693;
    background: #eee2d0;
    cursor: pointer;
}
.pt-gallery-tile-img.pt-thumb--broken {
    position: relative;
}

.pt-media-add {
    width: 100%;
    margin-top: 8px;
    padding: 8px;
    border: 1px solid #ddd0c0;
    border-radius: 8px;
    background: #fff;
    color: var(--primary-color);
    font-size: 1.1rem;
    cursor: pointer;
}
.pt-media-add:hover { background: #f2ebe0; }

.pt-media-download-all {
    width: 100%;
    margin-top: 6px;
    padding: 6px;
    border: 1px solid #ddd0c0;
    border-radius: 8px;
    background: #fff;
    color: #8a6f56;
    font-size: 0.78rem;
    cursor: pointer;
}
.pt-media-download-all:hover:not(:disabled) { background: #f2ebe0; color: var(--primary-color); }
.pt-media-download-all:disabled { opacity: 0.4; cursor: default; }

/* ── Mid column: checklist + caption/notes ───────────────────────────── */
.pt-mid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.pt-mid-top {
    display: flex;
    gap: 16px;
    border-bottom: 1px dashed #e5ded5;
    padding-bottom: 10px;
}

.pt-checklist {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 0 0 auto;
}
.pt-check-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.88rem;
    color: var(--text-color);
    cursor: pointer;
}

.pt-schedule {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 150px;
}
.pt-schedule-row {
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.pt-schedule-row-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
}
.pt-schedule-label {
    font-size: 0.78rem;
    font-weight: 600;
    color: #000;
}
.pt-schedule-remove-btn {
    border: none;
    background: none;
    color: #9a8a76;
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
    padding: 0 2px;
}
.pt-schedule-remove-btn:hover { color: #c17b6f; }
.pt-schedule-inputs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.pt-schedule-date-input,
.pt-schedule-time-input {
    padding: 7px 8px;
    border: 1px solid #ddd0c0;
    border-radius: 8px;
    font-size: 0.85rem;
    font-family: inherit;
    background: #fff;
    color: var(--text-color);
    box-sizing: border-box;
    flex: 1;
    min-width: 108px;
}
.pt-schedule-date-input:focus,
.pt-schedule-time-input:focus { outline: none; border-color: var(--primary-color); }
.pt-schedule-now-btn {
    border: 1px solid #ddd0c0;
    background: none;
    color: #8a6f56;
    font-size: 0.78rem;
    font-weight: 600;
    border-radius: 8px;
    padding: 7px 9px;
    cursor: pointer;
    flex: 0 0 auto;
}
.pt-schedule-now-btn:hover { border-color: var(--primary-color); color: var(--primary-color); background: #f5efe6; }
.pt-schedule-add-btn {
    align-self: flex-start;
    border: 1px dashed #ddd0c0;
    background: none;
    color: #8a6f56;
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: 8px;
    padding: 4px 10px;
    cursor: pointer;
}
.pt-schedule-add-btn:hover { border-color: var(--primary-color); color: var(--primary-color); }

.pt-field-row {
    display: flex;
    align-items: center;
    gap: 8px;
}
.pt-field-row--notes {
    align-items: flex-start;
}
.pt-field-label {
    font-size: 0.78rem;
    color: #9a8a76;
    width: 52px;
    flex: 0 0 auto;
}
.pt-field-row--notes .pt-field-label {
    padding-top: 7px;
}
.pt-caption-input, .pt-notes-input, .pt-link-input, .pt-ltk-input {
    flex: 1;
    padding: 7px 10px;
    border: 1px solid #ddd0c0;
    border-radius: 8px;
    font-size: 0.88rem;
    font-family: inherit;
    background: #fff;
}
.pt-notes-input {
    min-height: 60px;
    max-height: 320px;
    line-height: 1.4;
    resize: vertical;
    overflow-y: auto;
}
.pt-copy-btn, .pt-link-open-btn, .pt-ltk-open-btn {
    flex: 0 0 auto;
    background: #fff;
    border: 1px solid #ddd0c0;
    border-radius: 8px;
    padding: 6px 9px;
    cursor: pointer;
}
.pt-copy-btn:hover, .pt-link-open-btn:hover:not(:disabled), .pt-ltk-open-btn:hover:not(:disabled) { background: #f2ebe0; }
.pt-link-open-btn:disabled, .pt-ltk-open-btn:disabled { opacity: 0.4; cursor: default; }

/* ── Long-press bottom sheet (mirrors gallery.css's .slide-menu-*) ──── */
.pt-sheet-overlay {
    position: fixed;
    inset: 0;
    background: rgba(40, 24, 12, 0.45);
    z-index: 2000;
    display: flex;
    align-items: flex-end;
    opacity: 0;
    transition: opacity 0.18s ease;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}
.pt-sheet-overlay.pt-sheet-visible { opacity: 1; }
.pt-sheet-overlay.pt-sheet-closing { opacity: 0; }

.pt-sheet {
    width: 100%;
    background: #fdf8f2;
    border-radius: 18px 18px 0 0;
    padding: 20px 16px 36px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    transform: translateY(100%);
    transition: transform 0.18s ease;
    /* The sheet opens ON a long-press (over a thumbnail's own
       touch-callout:none) but the finger is often still down when it
       appears, so the continuing press lands on the sheet itself and
       triggers iOS's native text-selection callout on its button labels.
       Blocking selection here (and on the overlay behind it) stops that. */
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}
.pt-sheet-visible .pt-sheet { transform: translateY(0); }
.pt-sheet-closing .pt-sheet { transform: translateY(100%); }

.pt-sheet-btn {
    width: 100%;
    padding: 15px 16px;
    background: #f2ebe0;
    border: 1px solid #ddd0c0;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 500;
    color: #3a2518;
    cursor: pointer;
    font-family: inherit;
    text-align: left;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}
.pt-sheet-btn:hover { background: #e0d4c4; }
.pt-sheet-btn--delete {
    color: #c0392b;
    border-color: #e8c0bb;
    background: #fff5f4;
}
.pt-sheet-btn--delete:hover { background: #fde8e6; }
.pt-sheet-cancel {
    width: 100%;
    padding: 14px;
    background: transparent;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    color: #8a6a4a;
    cursor: pointer;
    font-family: inherit;
    margin-top: 2px;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}
.pt-sheet-cancel:hover { color: #3a2518; }

/* Color-swatch row inside the ticket options sheet (Move to top/Select
   multiple/Archive/Delete/Color/Rearrange) -- same .pt-dot swatches the
   strip's own color row uses, just laid out full-width to match the
   sheet's other rows. */
.pt-sheet-color-row {
    background: #f2ebe0;
    border: 1px solid #ddd0c0;
    border-radius: 12px;
    padding: 13px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.pt-sheet-color-label {
    font-size: 15px;
    font-weight: 500;
    color: #3a2518;
}
.pt-sheet-color-swatches {
    display: flex;
    gap: 12px;
    margin-left: auto;
}
.pt-sheet-color-swatches .pt-dot { width: 26px; height: 26px; }

/* Desktop: same fix as gallery.css's .slide-menu-* -- this was designed as
   a mobile bottom sheet (full width intentional there) but looked
   oversized stretched edge-to-edge on a wide screen. */
@media (min-width: 640px) {
    .pt-sheet-overlay {
        align-items: center;
        justify-content: center;
    }
    .pt-sheet {
        width: 100%;
        max-width: 400px;
        border-radius: 18px;
    }
}

/* ── Send to Carousel Planner modal ──────────────────────────────────── */
.pt-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(40, 24, 12, 0.45);
    z-index: 2100;
    display: flex;
    align-items: center;
    justify-content: center;
}
.pt-modal {
    background: #fff;
    border-radius: 14px;
    padding: 20px;
    width: 90%;
    max-width: 360px;
}
.pt-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}
.pt-modal-header h3 { margin: 0; font-size: 1.05rem; color: var(--primary-dark); }
.pt-modal-close {
    background: none;
    border: none;
    font-size: 1.3rem;
    cursor: pointer;
    color: #9a8a76;
}
.pt-modal-label { font-size: 0.8rem; color: #9a8a76; display: block; margin-bottom: 4px; }
.pt-modal-date-wrap { position: relative; margin-bottom: 12px; }
.pt-modal-date {
    width: 100%;
    padding: 8px 34px 8px 10px;
    border: 1px solid #ddd0c0;
    border-radius: 8px;
    font-family: inherit;
    background: #fff;
    color: transparent;
}
/* Native <input type="date"> renders its own locale format (e.g.
   "08/18/2026") that CSS can't reformat directly -- hide that text (color:
   transparent on the input and its -webkit sub-parts) and show our own
   "Tue Aug 18 2026" formatted text in a pointer-events:none overlay on top,
   so the native picker/calendar icon still works normally underneath. */
.pt-modal-date::-webkit-datetime-edit,
.pt-modal-date::-webkit-datetime-edit-fields-wrapper,
.pt-modal-date::-webkit-datetime-edit-text,
.pt-modal-date::-webkit-datetime-edit-month-field,
.pt-modal-date::-webkit-datetime-edit-day-field,
.pt-modal-date::-webkit-datetime-edit-year-field { color: transparent; }
.pt-modal-date-display {
    position: absolute;
    left: 11px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    font-family: inherit;
    font-size: 0.92rem;
    color: #3a2518;
    white-space: nowrap;
}
.pt-modal-options { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.pt-modal-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border: 1px solid #e5ded5;
    border-radius: 8px;
    font-size: 0.88rem;
    cursor: pointer;
}
.pt-modal-option-meta { margin-left: auto; color: #9a8a76; font-size: 0.78rem; }
.pt-modal-loading { color: #9a8a76; font-size: 0.85rem; }
.pt-modal-actions { display: flex; justify-content: flex-end; gap: 8px; }

/* ── Fullscreen image viewer ──────────────────────────────────────────── */
.pt-enlarge-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.85);
    z-index: 2200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}
.pt-enlarge-overlay img {
    max-width: 100%;
    max-height: 100%;
    border-radius: 6px;
}

.hidden { display: none !important; }

/* ── Undo toast (archive/delete) ─────────────────────────────────────── */
.pt-undo-toast {
    position: fixed;
    left: 50%;
    bottom: 24px;
    transform: translateX(-50%) translateY(20px);
    display: flex;
    align-items: center;
    gap: 14px;
    background: #2c1a10;
    color: #fff;
    padding: 12px 16px 12px 18px;
    border-radius: 10px;
    box-shadow: 0 6px 24px rgba(0,0,0,0.25);
    z-index: 5000;
    opacity: 0;
    transition: opacity 0.2s ease, transform 0.2s ease;
    max-width: calc(100vw - 32px);
}
.pt-undo-toast.pt-undo-toast-visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}
.pt-undo-toast-msg {
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.pt-undo-toast-btn {
    flex-shrink: 0;
    background: none;
    border: 1px solid rgba(255,255,255,0.5);
    color: #fff;
    padding: 5px 14px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
}
.pt-undo-toast-btn:hover { background: rgba(255,255,255,0.15); }

/* ── Story-ify prompt tool (mirrors collage.css's .storyify-*) ──────────── */
.storyify-toggle-btn {
    background: none;
    border: 1px solid #d6c9bb;
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 12px;
    font-weight: 500;
    color: #7a6855;
    cursor: pointer;
    font-family: inherit;
}
.storyify-toggle-btn:hover { border-color: var(--primary-color); color: var(--primary-color); }

.pt-storyify-copy-btn {
    background: #fff;
    border: 1px solid #d6c9bb;
    border-radius: 6px;
    padding: 8px 10px;
    font-size: 14px;
    cursor: pointer;
}
.pt-storyify-copy-btn:hover { border-color: var(--primary-color); }

.storyify-editor {
    margin: 0 0 18px;
    padding: 12px;
    background: #f5efe6;
    border: 1px solid #ede5d8;
    border-radius: 8px;
}
.storyify-textarea {
    width: 100%;
    box-sizing: border-box;
    resize: vertical;
    font-family: inherit;
    font-size: 12.5px;
    line-height: 1.5;
    color: #4a3728;
    padding: 8px 10px;
    border: 1px solid #d6c9bb;
    border-radius: 6px;
    background: #fff;
}
.storyify-hint {
    font-size: 11px;
    color: #a08060;
    margin: 6px 0 0;
}
.storyify-hint code {
    background: #ede5d8;
    padding: 1px 4px;
    border-radius: 3px;
}
.storyify-editor-actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}
.storyify-save-btn {
    padding: 7px 14px;
    background: #4a3728;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}
.storyify-save-btn:hover { background: #2c1a10; }
.storyify-reset-btn {
    padding: 7px 14px;
    background: none;
    border: 1px solid #d6c9bb;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    color: #7a6855;
    cursor: pointer;
}
.storyify-reset-btn:hover { border-color: var(--primary-color); color: var(--primary-color); }

/* ── Story prompt library (Photo Tickets: multiple saved/named prompts) ── */
.pt-prompt-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 10px;
}
.pt-prompt-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    background: #fff;
    border: 1px solid #ede5d8;
    border-radius: 8px;
}
.pt-prompt-row--active {
    border-color: var(--primary-color);
    background: #fbeee6;
}
.pt-prompt-row-info { flex: 1; min-width: 0; }
.pt-prompt-row-name {
    font-size: 12.5px;
    font-weight: 600;
    color: #4a3728;
}
.pt-prompt-row--active .pt-prompt-row-name::after {
    content: " \2713 active";
    font-weight: 500;
    color: var(--primary-color);
    font-size: 11px;
}
.pt-prompt-row-preview {
    font-size: 11px;
    color: #a08060;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.pt-prompt-row-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}
.pt-prompt-row-btn {
    background: none;
    border: 1px solid #d6c9bb;
    border-radius: 6px;
    padding: 4px 9px;
    font-size: 11px;
    color: #7a6855;
    cursor: pointer;
    font-family: inherit;
}
.pt-prompt-row-btn:hover { border-color: var(--primary-color); color: var(--primary-color); }
.pt-prompt-row-btn--delete:hover { border-color: #c0392b; color: #c0392b; }

.pt-prompt-form { margin-bottom: 10px; }
.pt-prompt-name-input {
    width: 100%;
    box-sizing: border-box;
    padding: 8px 10px;
    border: 1px solid #d6c9bb;
    border-radius: 6px;
    font-family: inherit;
    font-size: 12.5px;
    margin-bottom: 8px;
}
.pt-prompt-new-btn {
    background: none;
    border: 1px dashed #d6c9bb;
    border-radius: 6px;
    padding: 7px 12px;
    font-size: 12px;
    color: #7a6855;
    cursor: pointer;
    font-family: inherit;
    width: 100%;
}
.pt-prompt-new-btn:hover { border-color: var(--primary-color); color: var(--primary-color); }

/* ── Select multiple ─────────────────────────────────────────────────── */
.pt-thumb-select {
    position: absolute;
    top: 6px;
    left: 6px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(255,255,255,0.9);
    border: 2px solid #b7ada0;
    z-index: 5;
}
.pt-thumb--selected .pt-thumb-select {
    background: var(--primary-color);
    border-color: var(--primary-color);
}
.pt-thumb--selected .pt-thumb-select::after {
    content: "\2713";
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 13px;
}
.pt-thumb--selected img { opacity: 0.75; }

.pt-selection-bar {
    position: fixed;
    left: 50%;
    bottom: 24px;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 12px;
    background: #2c1a10;
    color: #fff;
    padding: 12px 16px;
    border-radius: 10px;
    box-shadow: 0 6px 24px rgba(0,0,0,0.25);
    z-index: 4500;
}
.pt-selection-bar-msg {
    font-size: 13px;
    white-space: nowrap;
}
.pt-selection-bar-download, .pt-selection-bar-cancel {
    flex-shrink: 0;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    padding: 6px 14px;
}
.pt-selection-bar-download {
    background: #fff;
    color: #2c1a10;
    border: none;
}
.pt-selection-bar-download:disabled { opacity: 0.5; cursor: not-allowed; }
.pt-selection-bar-download--delete { background: #f9d5d0; color: #a32c1f; }
.pt-selection-bar-cancel {
    background: none;
    border: 1px solid rgba(255,255,255,0.5);
    color: #fff;
}
.pt-selection-bar-cancel:hover { background: rgba(255,255,255,0.15); }

.pt-selection-legacy { display: none !important; }

/* Gallery quick-press reorder (matches the Carousel Planner's feel) */
.pt-gallery-tile.pt-tile-armed {
    transform: scale(1.08) translateY(-3px);
    box-shadow: 0 6px 18px rgba(0,0,0,0.18);
    transition: transform 0.12s ease, box-shadow 0.12s ease;
    z-index: 10;
}
.pt-gallery-tile.pt-tile-lifted { opacity: 0.35; }
.pt-reorder-ghost {
    position: fixed; z-index: 10000; width: 64px; height: 64px;
    transform: translate(-50%, -50%) scale(1.05);
    border-radius: 8px; overflow: hidden; pointer-events: none;
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}
.pt-reorder-ghost img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ── Prompts modal ───────────────────────────────────────────────────── */
.pt-prompts-overlay {
    position: fixed; inset: 0; z-index: 2000;
    background: rgba(40, 28, 20, 0.45);
    display: flex; align-items: center; justify-content: center;
    padding: 16px;
}
.pt-prompts-overlay.hidden { display: none; }
.pt-prompts-modal {
    position: relative;
    width: 100%; max-width: 440px; max-height: 88vh; overflow-y: auto;
    box-sizing: border-box;
    background: #fff; border-radius: 12px; padding: 20px 20px 18px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
}
.pt-prompts-title { margin: 0 28px 14px 0; font-size: 18px; color: #4a3728; }
.pt-prompts-title span { font-size: 12px; font-weight: 400; color: #a08060; }
.pt-prompts-close {
    position: absolute; top: 8px; right: 10px;
    background: none; border: none; font-size: 24px; line-height: 1;
    color: #7a6855; cursor: pointer;
}
.pt-prompts-close:hover { color: var(--primary-color); }
.pt-prompts-modal .pt-prompt-list { margin-bottom: 14px; }
.pt-prompts-modal .pt-prompt-row { padding: 0; background: none; border: none; gap: 8px; }
.pt-prompt-name-btn {
    flex: 1; min-width: 0; text-align: left;
    background: #fbf8f4; border: 1px solid #d6c9bb; border-radius: 6px;
    padding: 9px 12px; font-size: 14px; font-family: inherit; color: #4a3728;
    cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pt-prompt-name-btn:hover { border-color: var(--primary-color); background: #fbeee6; }
.pt-prompt-icon-btn {
    background: #fff; border: 1px solid #d6c9bb; border-radius: 6px;
    width: 36px; height: 36px; font-size: 15px; color: #7a6855; cursor: pointer;
}
.pt-prompt-icon-btn:hover { border-color: var(--primary-color); color: var(--primary-color); }
.pt-prompt-icon-btn--delete:hover { border-color: #c0392b; color: #c0392b; }
.pt-prompts-modal .pt-prompt-row-actions { gap: 6px; }
.pt-prompts-modal .pt-prompt-new-btn { width: auto; display: block; margin: 0 auto; padding: 7px 26px; }
.pt-prompts-modal .pt-prompt-form.hidden, .pt-prompts-modal #ptPromptsListView.hidden { display: none; }
.pt-prompt-grip {
    flex-shrink: 0; width: 18px; text-align: center; cursor: grab; user-select: none;
    touch-action: none; color: #b9a891; font-size: 16px; letter-spacing: -3px; line-height: 1;
}
.pt-prompt-grip:hover { color: var(--primary-color); }
.pt-prompt-row--dragging { opacity: 0.7; background: #fbeee6 !important; border-radius: 8px; }
.pt-prompt-row--dragging .pt-prompt-grip { cursor: grabbing; }

.pt-share-btn {
    width: 20px; height: 20px; border-radius: 6px; border: 1px solid #d8cabb;
    background: #fff; color: #7a6855; cursor: pointer; padding: 0;
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.pt-share-btn:hover { border-color: var(--primary-color); color: var(--primary-color); }
