/* 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;
    gap: 16px;
}

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

.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;
}

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

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

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

.pt-strip--white { background: #ffffff; }
.pt-strip--pink  { background: #fbe6ea; border-color: #f0c7d0; }
.pt-strip--blue  { background: #e7eff8; border-color: #c7d6e8; }
.pt-strip--grey  { background: #eeebe5; border-color: #d8d2c6; }
.pt-strip--gold  { background: #faf1d9; border-color: #e8d3a0; }

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

.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: #b7ada0; border-color: #9c9285; }
.pt-dot--gold  { background: #d4af6a; border-color: #b8944f; }
.pt-dot--selected {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.pt-strip-menu-wrap { position: relative; }
.pt-strip-menu-btn {
    background: none;
    border: none;
    font-size: 1.2rem;
    line-height: 1;
    color: #9a8a76;
    cursor: pointer;
    padding: 4px 8px;
}
.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;
}

.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; }

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

.pt-checklist {
    display: flex;
    flex-direction: column;
    gap: 6px;
    border-bottom: 1px dashed #e5ded5;
    padding-bottom: 10px;
}
.pt-check-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.88rem;
    color: var(--text-color);
    cursor: pointer;
}

.pt-field-row {
    display: flex;
    align-items: center;
    gap: 8px;
}
.pt-field-label {
    font-size: 0.78rem;
    color: #9a8a76;
    width: 52px;
    flex: 0 0 auto;
}
.pt-caption-input, .pt-notes-input {
    flex: 1;
    padding: 7px 10px;
    border: 1px solid #ddd0c0;
    border-radius: 8px;
    font-size: 0.88rem;
    font-family: inherit;
    background: #fff;
}
.pt-copy-btn {
    flex: 0 0 auto;
    background: #fff;
    border: 1px solid #ddd0c0;
    border-radius: 8px;
    padding: 6px 9px;
    cursor: pointer;
}
.pt-copy-btn:hover { background: #f2ebe0; }

/* ── 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;
}
.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;
}
.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;
}
.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;
}
.pt-sheet-cancel:hover { color: #3a2518; }

/* ── 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 {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #ddd0c0;
    border-radius: 8px;
    font-family: inherit;
    margin-bottom: 12px;
}
.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-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); }
