/* =====================================================
   黃家小屋 - 樣式設計系統
   Timehut Clone Stylesheet
   ===================================================== */

/* CSS Variables - Design Tokens */
:root {
    /* Colors */
    --color-primary: #FFEC00;
    --color-primary-dark: #E6D400;
    --color-primary-light: #FFF59D;
    --color-secondary: #333333;
    --color-background: #F5F5F5;
    --color-surface: #FFFFFF;
    --color-text: #333333;
    --color-text-light: #666666;
    --color-text-muted: #999999;
    --color-border: #E0E0E0;
    --color-shadow: rgba(0, 0, 0, 0.1);
    --color-overlay: rgba(0, 0, 0, 0.7);

    /* Typography */
    --font-primary: 'Noto Sans TC', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-weight-normal: 400;
    --font-weight-medium: 500;
    --font-weight-bold: 700;

    /* Spacing */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;
    --spacing-2xl: 48px;

    /* Border Radius */
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 50%;

    /* Shadows */
    --shadow-sm: 0 2px 4px var(--color-shadow);
    --shadow-md: 0 4px 12px var(--color-shadow);
    --shadow-lg: 0 8px 24px var(--color-shadow);

    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.25s ease;
    --transition-slow: 0.4s ease;

    /* Layout */
    --header-height: 64px;
    --sidebar-width: 72px;
    --age-nav-width: 200px;
}

/* Reset & Base Styles */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-primary);
    font-weight: var(--font-weight-normal);
    color: var(--color-text);
    background: var(--color-background);
    line-height: 1.6;
    min-height: 100vh;
}

a {
    color: inherit;
    text-decoration: none;
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* =====================================================
   LOGIN PAGE STYLES
   ===================================================== */

.login-page {
    background: linear-gradient(135deg, var(--color-primary-light) 0%, var(--color-background) 50%, #E3F2FD 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-lg);
}

.login-container {
    width: 100%;
    max-width: 480px;
}

/* Logo Section */
.logo-section {
    text-align: center;
    margin-bottom: var(--spacing-xl);
}

.logo-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto var(--spacing-md);
    animation: float 3s ease-in-out infinite;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

.logo-text {
    font-size: 2.5rem;
    font-weight: var(--font-weight-bold);
    color: var(--color-secondary);
    margin-bottom: var(--spacing-xs);
}

.logo-subtitle {
    font-size: 1rem;
    color: var(--color-text-light);
}

/* Child Selection Cards */
.child-selection {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    padding: var(--spacing-xl);
    box-shadow: var(--shadow-lg);
    margin-bottom: var(--spacing-lg);
}

.selection-title {
    font-size: 1.1rem;
    font-weight: var(--font-weight-medium);
    text-align: center;
    margin-bottom: var(--spacing-lg);
    color: var(--color-text-light);
}

.child-cards {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.child-card {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-md) var(--spacing-lg);
    background: var(--color-background);
    border-radius: var(--radius-md);
    border: 2px solid transparent;
    transition: all var(--transition-normal);
}

.child-card:hover {
    border-color: var(--color-primary);
    background: var(--color-primary-light);
    transform: translateX(4px);
}

.child-card:active {
    transform: scale(0.98);
}

.child-avatar {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-full);
    background: var(--color-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.avatar-emoji {
    font-size: 1.8rem;
}

.child-info {
    flex: 1;
    text-align: left;
}

.child-name {
    display: block;
    font-size: 1.25rem;
    font-weight: var(--font-weight-bold);
    margin-bottom: var(--spacing-xs);
}

.child-age {
    display: block;
    font-size: 0.9rem;
    color: var(--color-text-muted);
}

.card-arrow {
    font-size: 1.5rem;
    color: var(--color-text-muted);
    transition: transform var(--transition-fast);
}

.child-card:hover .card-arrow {
    transform: translateX(4px);
    color: var(--color-secondary);
}

/* Features Section */
.features-section {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    box-shadow: var(--shadow-md);
    margin-bottom: var(--spacing-lg);
}

.features-title {
    font-size: 1.1rem;
    font-weight: var(--font-weight-bold);
    margin-bottom: var(--spacing-xs);
}

.features-subtitle {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    margin-bottom: var(--spacing-md);
}

.feature-tags {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-sm);
}

.feature-tag {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--color-primary-light);
    border-radius: var(--radius-xl);
    font-size: 0.85rem;
    font-weight: var(--font-weight-medium);
}

.tag-icon {
    font-size: 1rem;
}

/* Login Footer */
.login-footer {
    text-align: center;
    font-size: 0.8rem;
    color: var(--color-text-muted);
}

/* =====================================================
   TIMELINE PAGE STYLES
   ===================================================== */

.timeline-page {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Header */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    padding: 0 var(--spacing-lg);
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.header-left {
    flex: 0 0 auto;
}

.header-logo {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.logo-svg {
    width: 36px;
    height: 36px;
}

.header-title {
    font-size: 1.25rem;
    font-weight: var(--font-weight-bold);
}

.header-center {
    flex: 1;
    display: flex;
    justify-content: center;
    padding: 0 var(--spacing-xl);
}

.search-box {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    width: 100%;
    max-width: 400px;
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--color-background);
    border-radius: var(--radius-xl);
    border: 1px solid var(--color-border);
    transition: all var(--transition-fast);
}

.search-box:focus-within {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px var(--color-primary-light);
}

.search-icon {
    font-size: 1rem;
}

.search-box input {
    flex: 1;
    border: none;
    background: none;
    font-size: 0.9rem;
    outline: none;
}

.search-box input:not(:placeholder-shown)::placeholder {
    opacity: 0;
}

.search-btn {
    padding: var(--spacing-xs) var(--spacing-md);
    background: var(--color-primary);
    color: var(--color-secondary);
    border: none;
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    font-weight: var(--font-weight-medium);
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.search-btn:hover {
    background: var(--color-primary-dark);
}

.header-right {
    flex: 0 0 auto;
}

.header-btn {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: background var(--transition-fast);
}

.header-btn:hover {
    background: var(--color-background);
}

/* Header button with icon and label */
.header-btn .btn-icon {
    font-size: 1.2rem;
}

.header-btn .btn-label {
    display: none;
    font-size: 0.75rem;
    font-weight: var(--font-weight-medium);
}

/* Time Travel Mobile Menu */
.time-travel-menu {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    max-height: 60vh;
    background: var(--color-surface);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    overflow-y: auto;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
    }

    to {
        transform: translateY(0);
    }
}

@keyframes slideUpBottom {
    from {
        transform: translateY(100%);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.time-travel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-md);
    border-bottom: 1px solid var(--color-border);
    position: sticky;
    top: 0;
    background: var(--color-surface);
}

.time-travel-header h3 {
    margin: 0;
    font-size: 1.1rem;
}

.time-travel-header button {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    padding: var(--spacing-xs);
}

.time-travel-list {
    padding: var(--spacing-sm);
}

.time-travel-item {
    display: flex;
    align-items: center;
    padding: var(--spacing-sm) var(--spacing-md);
    margin-bottom: var(--spacing-xs);
    background: var(--color-background);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.time-travel-item:hover {
    background: var(--color-primary-light);
}

.time-travel-item .age-label {
    flex: 1;
    font-weight: var(--font-weight-medium);
}

.time-travel-item .photo-count {
    color: var(--color-text-muted);
    font-size: 0.85rem;
}

/* Main Content Layout */
.main-content {
    display: flex;
    margin-top: var(--header-height);
    min-height: calc(100vh - var(--header-height));
}

/* Left Sidebar */
.sidebar-left {
    position: fixed;
    left: 0;
    top: var(--header-height);
    width: var(--sidebar-width);
    height: calc(100vh - var(--header-height));
    background: var(--color-surface);
    border-right: 1px solid var(--color-border);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: var(--spacing-md) 0;
}

.child-profiles {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.profile-btn {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-full);
    background: var(--color-background);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    border: 2px solid transparent;
    transition: all var(--transition-fast);
}

.profile-btn:hover,
.profile-btn.active {
    border-color: var(--color-primary);
    background: var(--color-primary-light);
}

.profile-btn.active {
    box-shadow: var(--shadow-md);
}

/* Timeline Section */
.timeline-section {
    flex: 1;
    margin-left: var(--sidebar-width);
    margin-right: var(--age-nav-width);
    padding: var(--spacing-lg);
    max-width: 900px;
    margin-left: calc(var(--sidebar-width) + auto);
    margin-right: calc(var(--age-nav-width) + auto);
}

.timeline-header {
    text-align: center;
    margin-bottom: var(--spacing-xl);
    padding: var(--spacing-lg);
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    border-radius: var(--radius-lg);
    color: var(--color-secondary);
}

.current-child-name {
    font-size: 2rem;
    font-weight: var(--font-weight-bold);
    margin-bottom: var(--spacing-xs);
}

.current-child-age {
    font-size: 1.1rem;
    opacity: 0.8;
}

/* Age Group Headers for Time Travel */
.age-group-header {
    grid-column: 1 / -1;
    padding: var(--spacing-md) 0;
    margin-top: var(--spacing-lg);
    scroll-margin-top: calc(var(--header-height) + 20px);
}

.age-group-header:first-of-type {
    margin-top: 0;
}

.age-group-title {
    font-size: 1.5rem;
    font-weight: var(--font-weight-bold);
    color: var(--color-primary);
    /* Removed border-left to avoid line overlap issues on mobile */
    padding-left: 0;
}

.timeline-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--spacing-lg);
    position: relative;
}

/* P0: Vertical Timeline Line - DISABLED per user request to avoid alignment issues */
.timeline-container::before {
    display: none;
    /* User requested removal of vertical timeline line */
}

/* P0: Date Badge - Timehut Style */
.date-badge {
    position: absolute;
    left: 10px;
    background: var(--color-surface);
    border: 2px solid var(--color-primary);
    border-radius: var(--radius-md);
    padding: var(--spacing-xs) var(--spacing-sm);
    text-align: center;
    z-index: 1;
    min-width: 50px;
}

.date-badge .month {
    display: block;
    font-size: 0.7rem;
    color: var(--color-text-muted);
    text-transform: uppercase;
}

.date-badge .day {
    display: block;
    font-size: 1.2rem;
    font-weight: var(--font-weight-bold);
    color: var(--color-primary-dark);
}

/* Photo Cards */
.photo-card {
    background: var(--color-surface);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: all var(--transition-normal);
    cursor: pointer;
}

.photo-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.photo-wrapper {
    position: relative;
    /* P0: Preserve original aspect ratio instead of forcing 1:1 */
    overflow: hidden;
}

.photo-wrapper img {
    /* P0: Static positioning for natural aspect ratio */
    width: 100%;
    height: auto;
    object-fit: contain;
    transition: transform var(--transition-slow);
}

.photo-card:hover .photo-wrapper img {
    transform: scale(1.05);
}

.photo-info {
    padding: var(--spacing-md);
}

.photo-title {
    font-weight: var(--font-weight-medium);
    margin-bottom: var(--spacing-xs);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.photo-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--color-text-muted);
}

.photo-age {
    background: var(--color-primary-light);
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    font-weight: var(--font-weight-medium);
    color: var(--color-secondary);
}

/* Age Group Header */
.age-group-header {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-md) 0;
    margin-top: var(--spacing-lg);
}

.age-group-header:first-child {
    margin-top: 0;
}

.age-group-line {
    flex: 1;
    height: 2px;
    background: var(--color-primary);
}

.age-group-label {
    font-size: 1.1rem;
    font-weight: var(--font-weight-bold);
    color: var(--color-primary-dark);
    background: var(--color-surface);
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--radius-xl);
    border: 2px solid var(--color-primary);
}

/* Loading & Empty States */
.loading-indicator {
    grid-column: 1 / -1;
    text-align: center;
    padding: var(--spacing-2xl);
    color: var(--color-text-muted);
}

.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--color-border);
    border-top-color: var(--color-primary);
    border-radius: var(--radius-full);
    margin: 0 auto var(--spacing-md);
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: var(--spacing-2xl);
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: var(--spacing-md);
}

.empty-state h3 {
    font-size: 1.5rem;
    margin-bottom: var(--spacing-sm);
}

.empty-state p {
    color: var(--color-text-muted);
    margin-bottom: var(--spacing-lg);
}

.upload-btn {
    display: inline-block;
    padding: var(--spacing-sm) var(--spacing-lg);
    background: var(--color-primary);
    color: var(--color-secondary);
    font-weight: var(--font-weight-bold);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.upload-btn:hover {
    background: var(--color-primary-dark);
    transform: scale(1.02);
}

/* Reload Button for loading timeout */
.reload-btn {
    display: none;
    margin-top: var(--spacing-md);
    padding: var(--spacing-sm) var(--spacing-lg);
    background: var(--color-primary);
    color: var(--color-secondary);
    border: none;
    border-radius: var(--radius-md);
    font-weight: var(--font-weight-medium);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.reload-btn:hover {
    background: var(--color-primary-dark);
    transform: scale(1.05);
}

/* Right Sidebar - Age Navigation */
.sidebar-right {
    position: fixed;
    right: 0;
    top: var(--header-height);
    width: var(--age-nav-width);
    height: calc(100vh - var(--header-height));
    background: var(--color-surface);
    border-left: 1px solid var(--color-border);
    padding: var(--spacing-lg);
    overflow-y: auto;
}

.age-nav-title {
    font-size: 0.9rem;
    font-weight: var(--font-weight-bold);
    color: var(--color-text-muted);
    margin-bottom: var(--spacing-md);
}

.age-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.age-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    transition: all var(--transition-fast);
    cursor: pointer;
}

.age-item:hover {
    background: var(--color-primary-light);
}

.age-item.active {
    background: var(--color-primary);
    font-weight: var(--font-weight-bold);
}

.age-dot {
    width: 8px;
    height: 8px;
    border-radius: var(--radius-full);
    background: var(--color-primary);
}

.age-count {
    margin-left: auto;
    font-size: 0.75rem;
    color: var(--color-text-muted);
    background: var(--color-background);
    padding: 2px 6px;
    border-radius: var(--radius-sm);
}

/* Photo Modal */
.photo-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
}

.photo-modal.active {
    display: flex;
}

.modal-overlay {
    position: absolute;
    inset: 0;
    background: var(--color-overlay);
    backdrop-filter: blur(4px);
    cursor: pointer;
    transition: background 0.2s ease;
}

.modal-overlay:hover {
    background: rgba(0, 0, 0, 0.85);
}

.modal-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.modal-close {
    position: absolute;
    top: -40px;
    right: 0;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    background: var(--color-surface);
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: all var(--transition-fast);
}

.modal-close:hover {
    background: var(--color-primary);
}

.modal-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    border-radius: var(--radius-full);
    background: var(--color-surface);
    font-size: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.modal-prev {
    left: -60px;
}

.modal-next {
    right: -60px;
}

.modal-nav:hover {
    background: var(--color-primary);
}

.modal-image {
    max-width: 100%;
    max-height: 70vh;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
}

.modal-info {
    margin-top: var(--spacing-md);
    text-align: center;
    color: var(--color-surface);
}

.modal-info h3 {
    font-size: 1.25rem;
    margin-bottom: var(--spacing-xs);
    display: none;
    /* Hide meaningless filename/hash titles */
}

.modal-info p {
    font-size: 0.9rem;
    opacity: 0.8;
}

/* Photo page indicator (e.g., "1 / 10") */
.modal-page-indicator {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    z-index: 10;
    pointer-events: none;
}

/* =====================================================
   RESPONSIVE DESIGN
   ===================================================== */

@media (max-width: 1024px) {
    :root {
        --age-nav-width: 160px;
    }
}

@media (max-width: 768px) {
    :root {
        --sidebar-width: 0px;
        --age-nav-width: 0px;
    }

    .sidebar-left,
    .sidebar-right {
        display: none;
    }

    .timeline-section {
        margin-left: 0;
        margin-right: 0;
        padding: var(--spacing-md);
    }

    /* Search bar visibility handled in later media query with full width layout */

    .timeline-container {
        /* P0: Single column layout on mobile for immersive viewing */
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }

    /* Show navigation arrows on mobile for better affordance */
    .modal-nav {
        width: 44px;
        height: 44px;
        font-size: 1.8rem;
        background: rgba(0, 0, 0, 0.6);
        color: white;
        border: 2px solid rgba(255, 255, 255, 0.3);
        opacity: 0.9;
    }

    .modal-prev {
        left: 8px;
    }

    .modal-next {
        right: 8px;
    }
}

@media (max-width: 480px) {
    .timeline-container {
        grid-template-columns: 1fr;
    }

    .child-card {
        padding: var(--spacing-md);
    }

    .timeline-header {
        padding: var(--spacing-md);
    }

    .current-child-name {
        font-size: 1.5rem;
    }
}

/* =====================================================
   UPLOAD MODAL STYLES
   ===================================================== */

/* Header Upload Button */
.upload-header-btn {
    width: auto !important;
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--color-primary);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    font-weight: var(--font-weight-medium);
    margin-right: var(--spacing-sm);
    transition: all var(--transition-fast);
}

.upload-header-btn:hover {
    background: var(--color-primary-dark);
    transform: scale(1.02);
}

.upload-text {
    font-size: 0.9rem;
}

.header-right {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

/* Upload Modal */
.upload-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
}

.upload-modal.active {
    display: flex;
}

.upload-modal-content {
    position: relative;
    width: 90%;
    max-width: 520px;
    max-height: 90vh;
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    padding: var(--spacing-xl);
    box-shadow: var(--shadow-lg);
    overflow-y: auto;
    z-index: 1001;
}

.upload-header {
    text-align: center;
    margin-bottom: var(--spacing-lg);
}

.upload-header h2 {
    font-size: 1.5rem;
    margin-bottom: var(--spacing-xs);
}

.upload-header p {
    color: var(--color-text-muted);
    font-size: 0.9rem;
}

/* Upload Options */
.upload-options {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.upload-option {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-md);
    background: var(--color-background);
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border);
    transition: all var(--transition-fast);
}

.upload-option:hover {
    border-color: var(--color-primary);
}

.option-icon {
    font-size: 2rem;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-primary-light);
    border-radius: var(--radius-md);
}

.option-info {
    flex: 1;
}

.option-info h3 {
    font-size: 1rem;
    font-weight: var(--font-weight-bold);
    margin-bottom: 2px;
}

.option-info p {
    font-size: 0.8rem;
    color: var(--color-text-muted);
}

.option-btn {
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--color-background);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    font-weight: var(--font-weight-medium);
    white-space: nowrap;
    transition: all var(--transition-fast);
    text-decoration: none;
    color: var(--color-text);
}

.option-btn:hover {
    background: var(--color-primary-light);
    border-color: var(--color-primary);
}

.option-btn.primary {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: var(--color-secondary);
}

.option-btn.primary:hover {
    background: var(--color-primary-dark);
}

/* Drag and Drop Zone */
.upload-dropzone {
    margin-top: var(--spacing-md);
    padding: var(--spacing-xl);
    border: 2px dashed var(--color-border);
    border-radius: var(--radius-md);
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.upload-dropzone:hover,
.upload-dropzone.dragover {
    border-color: var(--color-primary);
    background: var(--color-primary-light);
}

.dropzone-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-sm);
}

.dropzone-icon {
    font-size: 3rem;
}

.dropzone-content p {
    font-weight: var(--font-weight-medium);
}

.dropzone-hint {
    font-size: 0.85rem;
    color: var(--color-text-muted);
}

/* Upload Queue */
.upload-queue {
    margin-top: var(--spacing-md);
    padding: var(--spacing-md);
    background: var(--color-background);
    border-radius: var(--radius-md);
}

.upload-queue h4 {
    font-size: 0.9rem;
    margin-bottom: var(--spacing-sm);
}

.queue-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    max-height: 200px;
    overflow-y: auto;
    margin-bottom: var(--spacing-md);
}

.queue-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm);
    background: var(--color-surface);
    border-radius: var(--radius-sm);
}

.queue-thumbnail {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: var(--radius-sm);
}

.queue-filename {
    flex: 1;
    font-size: 0.85rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.queue-remove {
    width: 24px;
    height: 24px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    transition: background var(--transition-fast);
}

.queue-remove:hover {
    background: #fee2e2;
    color: #ef4444;
}

.queue-actions {
    display: flex;
    gap: var(--spacing-sm);
    justify-content: flex-end;
}

.queue-btn {
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-weight: var(--font-weight-medium);
    transition: all var(--transition-fast);
}

.queue-btn.cancel {
    background: var(--color-background);
    border: 1px solid var(--color-border);
}

.queue-btn.cancel:hover {
    background: #fee2e2;
    border-color: #ef4444;
}

.queue-btn.upload {
    background: var(--color-primary);
    color: var(--color-secondary);
}

.queue-btn.upload:hover {
    background: var(--color-primary-dark);
}

/* Upload Tips */
.upload-tips {
    margin-top: var(--spacing-lg);
    padding: var(--spacing-md);
    background: var(--color-primary-light);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--spacing-md);
}

.upload-tips p {
    font-size: 0.85rem;
    margin: 0;
}

.refresh-btn {
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--color-surface);
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    font-weight: var(--font-weight-medium);
    white-space: nowrap;
    transition: all var(--transition-fast);
}

.refresh-btn:hover {
    background: var(--color-primary);
}

/* Responsive Upload */
@media (max-width: 768px) {
    .upload-text {
        display: none;
    }

    .upload-header-btn {
        width: 40px !important;
        padding: var(--spacing-sm);
    }

    .upload-option {
        flex-direction: column;
        text-align: center;
    }

    .upload-tips {
        flex-direction: column;
        text-align: center;
    }
}

/* =====================================================
   PASSWORD PROTECTION & MEMBER SELECTION STYLES
   ===================================================== */

/* Password Form */
.password-form {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.form-group {
    position: relative;
}

.password-input {
    width: 100%;
    padding: var(--spacing-md) var(--spacing-lg);
    font-size: 1.1rem;
    border: 2px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-background);
    transition: all var(--transition-fast);
    text-align: center;
    letter-spacing: 4px;
}

.password-input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 4px var(--color-primary-light);
}

.password-input::placeholder {
    letter-spacing: normal;
    color: var(--color-text-muted);
}

/* Shake Animation */
@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    10%,
    30%,
    50%,
    70%,
    90% {
        transform: translateX(-8px);
    }

    20%,
    40%,
    60%,
    80% {
        transform: translateX(8px);
    }
}

.password-input.shake {
    animation: shake 0.5s ease-in-out;
    border-color: #ef4444;
}

/* Submit Button */
.submit-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    width: 100%;
    padding: var(--spacing-md) var(--spacing-lg);
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    color: var(--color-secondary);
    font-size: 1.1rem;
    font-weight: var(--font-weight-bold);
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.submit-btn:active {
    transform: scale(0.98);
}

.btn-icon {
    font-size: 1.3rem;
}

/* Error Message */
.error-message {
    color: #ef4444;
    font-size: 0.9rem;
    text-align: center;
    padding: var(--spacing-sm);
    background: #fee2e2;
    border-radius: var(--radius-sm);
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Remember Checkbox */
.remember-checkbox {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    margin-top: var(--spacing-md);
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--color-text-light);
}

.remember-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--color-primary);
    cursor: pointer;
}

.checkbox-text {
    user-select: none;
}

/* Selection Subtitle */
.selection-subtitle {
    text-align: center;
    font-size: 0.9rem;
    color: var(--color-text-muted);
    margin-top: calc(-1 * var(--spacing-sm));
    margin-bottom: var(--spacing-lg);
}

/* Member Cards */
.member-cards {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-md);
    justify-content: center;
    margin-bottom: var(--spacing-lg);
}

.member-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-md);
    background: var(--color-background);
    border-radius: var(--radius-md);
    border: 2px solid transparent;
    transition: all var(--transition-normal);
    cursor: pointer;
    min-width: 80px;
}

.member-card:hover {
    border-color: var(--color-primary);
    background: var(--color-primary-light);
    transform: translateY(-4px);
}

.member-card:active {
    transform: scale(0.95);
}

.member-avatar {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-full);
    background: var(--color-primary);
    display: flex;
    align-items: center;
    justify-content: center;
}

.member-card .avatar-emoji {
    font-size: 1.5rem;
}

.member-name {
    font-size: 0.9rem;
    font-weight: var(--font-weight-medium);
    color: var(--color-text);
}

/* Skip Button */
.skip-btn {
    display: block;
    width: 100%;
    padding: var(--spacing-sm) var(--spacing-md);
    background: transparent;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    color: var(--color-text-muted);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.skip-btn:hover {
    background: var(--color-background);
    color: var(--color-text);
}

/* Current User Badge */
.current-user-badge {
    position: fixed;
    bottom: var(--spacing-lg);
    right: var(--spacing-lg);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--color-surface);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    z-index: 500;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.current-user-badge span {
    font-size: 1rem;
}

.logout-btn {
    width: 24px;
    height: 24px;
    border-radius: var(--radius-full);
    background: var(--color-background);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    color: var(--color-text-muted);
    transition: all var(--transition-fast);
}

.logout-btn:hover {
    background: #fee2e2;
    color: #ef4444;
}

/* Photo Tags */
.photo-tags {
    margin-top: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.photo-tag {
    font-size: 12px;
    color: var(--primary-color);
    background-color: rgba(255, 204, 0, 0.1);
    padding: 2px 8px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.photo-tag:hover {
    background-color: var(--primary-color);
    color: #333;
}

/* Modal Response */
/* Mobile responsive for password/member */
@media (max-width: 480px) {
    .member-cards {
        gap: var(--spacing-sm);
    }

    .member-card {
        min-width: 70px;
        padding: var(--spacing-sm);
    }

    .member-avatar {
        width: 40px;
        height: 40px;
    }

    .member-card .avatar-emoji {
        font-size: 1.2rem;
    }

    .current-user-badge {
        bottom: var(--spacing-md);
        right: var(--spacing-md);
    }
}

/* =====================================================
   UPLOAD ENHANCEMENTS
   ===================================================== */

/* Upload Field Container */
.upload-field {
    margin-top: 15px;
}

.upload-field label {
    display: block;
    font-size: 14px;
    color: #575757;
    margin-bottom: 8px;
}

/* Upload Select & Input */
.upload-select,
.upload-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    background: white;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.upload-select:hover,
.upload-input:hover {
    border-color: #ccc;
}

.upload-select:focus,
.upload-input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(255, 193, 7, 0.2);
}

/* Uploader Display (Fixed) */
.uploader-display {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: #f8f8f8;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
}

.uploader-icon {
    font-size: 18px;
}

.uploader-name {
    font-weight: 500;
    color: #575757;
}

/* Tagging Mode Toggle */
.tagging-mode-toggle {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.mode-btn {
    flex: 1;
    padding: 10px 16px;
    border: 1px solid #ddd;
    border-radius: 20px;
    background: white;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.mode-btn:hover {
    background: #f5f5f5;
}

.mode-btn.active {
    background: linear-gradient(135deg, #D4A017 0%, #C69214 100%);
    color: white;
    border-color: #C69214;
}

.mode-hint {
    display: block;
    margin-top: 8px;
    font-size: 11px;
    color: #888;
}

/* Queue Item Enhancements */
.queue-item {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--color-surface);
    border-radius: var(--radius-sm);
    border: 1px solid var(--color-border);
    margin-bottom: 8px;
}

.queue-icon {
    font-size: 1.2rem;
}

.queue-filename {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.queue-size {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    white-space: nowrap;
}

.queue-remove {
    background: none;
    border: none;
    color: #999;
    font-size: 16px;
    cursor: pointer;
    padding: 4px 8px;
}

.queue-remove:hover {
    color: #ff6b6b;
}

/* Individual tag input in queue */
.queue-item-tags {
    width: 100%;
    margin-top: 8px;
    padding: 8px 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 13px;
    box-sizing: border-box;
}

.queue-item-tags:focus {
    outline: none;
    border-color: var(--color-primary);
}

/* =====================================================
   BATCH DELETE / SELECTION MODE STYLES
   ===================================================== */

/* Selection Bar */
.selection-bar {
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    height: 50px;
    background: linear-gradient(135deg, #ff6b6b, #ee5a5a);
    color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--spacing-lg);
    z-index: 99;
    box-shadow: var(--shadow-md);
}

.selection-bar.hidden {
    display: none;
}

.selection-info {
    font-weight: var(--font-weight-bold);
    font-size: 1rem;
}

.selection-actions {
    display: flex;
    gap: var(--spacing-sm);
}

.btn-danger {
    background: white;
    color: #ff6b6b;
    border: none;
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--radius-md);
    font-weight: var(--font-weight-bold);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-danger:hover {
    background: #fff5f5;
    transform: scale(1.02);
}

.btn-secondary {
    background: #6c757d;
    color: white;
    border: 2px solid #6c757d;
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--radius-md);
    font-weight: var(--font-weight-medium);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-secondary:hover {
    background: #5a6268;
    border-color: #545b62;
    transform: scale(1.02);
}

/* Moment Selection Bar */
.moment-selection-bar {
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    height: 50px;
    background: linear-gradient(135deg, #6b7fff, #5a6aee);
    color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--spacing-lg);
    z-index: 99;
    box-shadow: var(--shadow-md);
}

.moment-selection-bar.hidden {
    display: none;
}

/* Moment Select Mode - Moment Item Checkbox */
body.moment-select-mode .moment-item {
    position: relative;
    cursor: pointer;
}

body.moment-select-mode .moment-item::before {
    content: '○';
    position: absolute;
    top: var(--spacing-md);
    right: var(--spacing-md);
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.95);
    border: 2px solid var(--color-border);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    color: var(--color-text-muted);
    z-index: 10;
    box-shadow: var(--shadow-sm);
}

body.moment-select-mode .moment-item.selected::before {
    content: '✓';
    background: #6b7fff;
    border-color: #5a6aee;
    color: white;
}

body.moment-select-mode .moment-item.selected {
    outline: 3px solid #6b7fff;
    outline-offset: -3px;
    border-radius: var(--radius-lg);
}

body.moment-select-mode .moment-item:hover {
    background: rgba(107, 127, 255, 0.05);
}

/* Main content offset when moment selection bar is visible */
body.moment-select-mode .main-content {
    margin-top: 50px;
}

/* Batch moment button active state */
.batch-moment-btn.active {
    background: #6b7fff;
    color: white;
}

.batch-moment-btn.active .btn-icon,
.batch-moment-btn.active .btn-label {
    color: white;
}

/* Select Mode - Photo Card Checkbox Overlay */
body.select-mode .photo-card {
    position: relative;
    cursor: pointer;
}

body.select-mode .photo-card::before {
    content: '○';
    position: absolute;
    top: var(--spacing-sm);
    left: var(--spacing-sm);
    width: 28px;
    height: 28px;
    background: rgba(255, 255, 255, 0.9);
    border: 2px solid var(--color-border);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: var(--color-text-muted);
    z-index: 10;
}

body.select-mode .photo-card.selected::before {
    content: '✓';
    background: var(--color-primary);
    border-color: var(--color-primary-dark);
    color: var(--color-secondary);
}

body.select-mode .photo-card.selected {
    outline: 3px solid var(--color-primary);
    outline-offset: -3px;
}

/* Main content offset when selection bar is visible */
body.select-mode .main-content {
    margin-top: 50px;
}

/* Photo Tags on Card (P1) */
.photo-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    padding: 0 var(--spacing-md) var(--spacing-md);
}

.photo-tag {
    font-size: 0.7rem;
    color: var(--color-primary-dark);
    background: var(--color-primary-light);
    padding: 2px 8px;
    border-radius: 12px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.photo-tag:hover {
    background: var(--color-primary);
}

/* P1: Uploader Badge on Photo Cards */
.photo-uploader {
    position: absolute;
    bottom: var(--spacing-sm);
    right: var(--spacing-sm);
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    box-shadow: var(--shadow-sm);
    z-index: 5;
    cursor: help;
}

.photo-uploader:hover::after {
    content: attr(title);
    position: absolute;
    bottom: 100%;
    right: 0;
    background: var(--color-secondary);
    color: white;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    white-space: nowrap;
    margin-bottom: 4px;
}

/* P1: Tagging Mode Toggle */
.tagging-mode-toggle {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.mode-btn {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: #f5f5f5;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}

.mode-btn:hover {
    background: #eee;
}

.mode-btn.active {
    background: var(--color-primary);
    color: var(--color-secondary);
    border-color: var(--color-primary);
    font-weight: var(--font-weight-medium);
}

/* P1: Individual Tags in Queue */
.queue-item-tags {
    width: 100%;
    padding: 6px 8px;
    margin-top: 4px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 12px;
}

.queue-item {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
}

/* P0: Tag Editing in Modal */
.modal-tags-edit {
    margin-top: var(--spacing-md);
    padding-top: var(--spacing-md);
    border-top: 1px solid var(--color-border);
}

.tags-edit-row {
    display: flex;
    gap: 8px;
}

#editTagsInput {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    background: var(--color-background);
}

#editTagsInput:focus {
    outline: none;
    border-color: var(--color-primary);
}

.save-tags-btn {
    padding: 8px 16px;
    background: var(--color-primary);
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 1rem;
    transition: all var(--transition-fast);
}

.save-tags-btn:hover {
    background: var(--color-primary-dark);
}

/* P0: Photo Batch Group Badge */
.photo-batch-badge {
    position: absolute;
    top: var(--spacing-sm);
    left: var(--spacing-sm);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    cursor: pointer;
    z-index: 5;
}

.photo-batch-badge:hover {
    background: var(--color-primary);
    color: var(--color-secondary);
}

/* P0: Batch View Modal */
.batch-view-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.batch-view-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(4px);
}

.batch-view-content {
    position: relative;
    width: 90%;
    max-width: 1200px;
    max-height: 90vh;
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.batch-view-close {
    position: absolute;
    top: var(--spacing-md);
    right: var(--spacing-md);
    font-size: 1.5rem;
    color: var(--color-text);
    z-index: 10;
}

.batch-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: var(--spacing-md);
    overflow-y: auto;
    padding: var(--spacing-md) 0;
    margin-top: var(--spacing-md);
}

.batch-gallery img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: transform var(--transition-fast);
}

.batch-gallery img:hover {
    transform: scale(1.05);
}

/* P1: Card Style Confirmation Modal */
.confirm-card {
    background: var(--color-surface);
    width: 90%;
    max-width: 320px;
    padding: 24px;
    border-radius: 16px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    text-align: center;
    animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.confirm-icon {
    font-size: 3rem;
    margin-bottom: 16px;
}

.confirm-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--color-text);
}

.confirm-message {
    font-size: 0.95rem;
    color: var(--color-text-secondary);
    margin-bottom: 24px;
    line-height: 1.5;
}

.confirm-actions {
    display: flex;
    gap: 12px;
    width: 100%;
}

.confirm-actions button {
    flex: 1;
    padding: 10px;
    border-radius: 8px;
    font-size: 0.95rem;
    border: none;
    cursor: pointer;
    transition: filter 0.2s;
}

.confirm-actions button:hover {
    filter: brightness(0.9);
}

@keyframes popIn {
    0% {
        transform: scale(0.8);
        opacity: 0;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Utility to ensure elements are hidden */
.hidden {
    display: none !important;
}

/* Fix: Ensure Modal Content is above Overlay */
.modal-overlay {
    z-index: 1000;
}

.upload-modal-content,
.modal-content,
.confirm-card {
    z-index: 1001;
    position: relative;
}

/* Modal Overlay as Centered Container (for confirmation modals) */
#confirmModal.modal-overlay,
#moveCollectionModal.modal-overlay,
#tagModal.modal-overlay,
#albumModal.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

#confirmModal.modal-overlay.hidden,
#moveCollectionModal.modal-overlay.hidden,
#tagModal.modal-overlay.hidden,
#albumModal.modal-overlay.hidden {
    display: none !important;
}

/* Confirm Card (Modal Content) */
.confirm-card {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    padding: var(--spacing-xl);
    box-shadow: var(--shadow-lg);
    text-align: center;
    max-width: 400px;
    width: 90%;
    animation: modalZoomIn 0.2s ease;
}

@keyframes modalZoomIn {
    from {
        transform: scale(0.9);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

.confirm-icon {
    font-size: 3rem;
    margin-bottom: var(--spacing-md);
}

.confirm-title {
    font-size: 1.25rem;
    font-weight: var(--font-weight-bold);
    margin-bottom: var(--spacing-sm);
}

.confirm-message {
    color: var(--color-text-muted);
    margin-bottom: var(--spacing-lg);
    white-space: pre-line;
}

.confirm-actions {
    display: flex;
    gap: var(--spacing-md);
    justify-content: center;
}

/* Collection Item Styles for Move Modal */
.collection-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    margin: 8px 0;
    border: 2px solid var(--color-border);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
}

.collection-item:hover {
    border-color: var(--color-primary);
    background: rgba(255, 236, 0, 0.1);
}

.collection-item.selected {
    border-color: var(--color-primary);
    background: rgba(255, 236, 0, 0.2);
}

.collection-check {
    color: var(--color-primary-dark);
    font-size: 1.2rem;
    font-weight: bold;
}

/* =====================================================
   P1: MOMENT CARD LAYOUT (Batch View)
   ===================================================== */
.moment-item {
    position: relative;
    margin-bottom: var(--spacing-2xl);
    padding-left: 0;
    /* Ensure z-index context for line */
    z-index: 1;
}

.moment-line {
    position: absolute;
    left: 28px;
    /* Center of date box (56/2) */
    top: 56px;
    bottom: -48px;
    /* Connect to next item */
    width: 3px;
    background: #F9F5F1;
    z-index: 0;
}

.moment-item:last-child .moment-line {
    display: none;
}

.moment-header {
    display: flex;
    align-items: center;
    position: relative;
    z-index: 1;
}

.moment-date-box {
    width: 56px;
    height: 56px;
    background: #FAF7F3;
    border-radius: 17px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    cursor: default;
}

.moment-month {
    font-size: 11px;
    color: #B5B5B5;
    line-height: 16px;
}

.moment-day {
    font-size: 23px;
    color: #ff6f59;
    font-weight: 600;
    line-height: 32px;
    margin-top: -4px;
}

.moment-info {
    margin-left: 14px;
}

.moment-age {
    font-size: 20px;
    font-weight: 600;
    color: #575757;
}

.moment-content-box {
    background: white;
    margin-top: 20px;
    margin-left: 28px;
    /* Indent slightly from date line */
    margin-right: var(--spacing-md);
    border: 1px solid #EFEFEF;
    border-radius: 20px;
    overflow: hidden;
    position: relative;
}

/* Grid Layout for Photos */
.moment-grid {
    display: grid;
    gap: 2px;
    width: 100%;
}

/* Grid Logic based on item count */
.moment-grid[data-count="1"] {
    grid-template-columns: 1fr;
}

.moment-grid[data-count="1"] .moment-photo-container {
    aspect-ratio: 4/3;
}

.moment-grid[data-count="2"] {
    grid-template-columns: 1fr 1fr;
}

.moment-grid[data-count="2"] .moment-photo-container {
    aspect-ratio: 1;
}

.moment-grid[data-count="3"] {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 2fr 1fr;
}

.moment-grid[data-count="3"] .moment-photo-container:first-child {
    grid-column: 1 / 2;
    grid-row: 1 / 3;
    aspect-ratio: 1/2;
}

.moment-grid[data-count="3"] .moment-photo-container:nth-child(2),
.moment-grid[data-count="3"] .moment-photo-container:nth-child(3) {
    aspect-ratio: 1;
}

/* 4-5 items: 2 large on top + 2-3 small on bottom (Timehut style) */
.moment-grid[data-count="4"] {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1.5fr 1fr;
}

.moment-grid[data-count="4"] .moment-photo-container:nth-child(1),
.moment-grid[data-count="4"] .moment-photo-container:nth-child(2) {
    aspect-ratio: 4/3;
}

.moment-grid[data-count="4"] .moment-photo-container:nth-child(3),
.moment-grid[data-count="4"] .moment-photo-container:nth-child(4) {
    aspect-ratio: 16/9;
}

/* 5 items: 2 large top + 3 small bottom - NO BLANK AREAS */
.moment-grid[data-count="5"] {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    /* 6-column grid for flexibility */
    grid-template-rows: 1.5fr 1fr;
    gap: 2px;
}

/* Top row: 2 large photos (3 columns each = 50%) */
.moment-grid[data-count="5"] .moment-photo-container:nth-child(1) {
    grid-column: 1 / 4;
    grid-row: 1;
    aspect-ratio: 4/3;
}

.moment-grid[data-count="5"] .moment-photo-container:nth-child(2) {
    grid-column: 4 / 7;
    grid-row: 1;
    aspect-ratio: 4/3;
}

/* Bottom row: 3 small photos (2 columns each = 33%) */
.moment-grid[data-count="5"] .moment-photo-container:nth-child(3) {
    grid-column: 1 / 3;
    grid-row: 2;
    aspect-ratio: 16/9;
}

.moment-grid[data-count="5"] .moment-photo-container:nth-child(4) {
    grid-column: 3 / 5;
    grid-row: 2;
    aspect-ratio: 16/9;
}

.moment-grid[data-count="5"] .moment-photo-container:nth-child(5) {
    grid-column: 5 / 7;
    grid-row: 2;
    aspect-ratio: 16/9;
}

/* Multi-grid fallback */
.moment-grid.multi-grid {
    grid-template-columns: repeat(6, 1fr);
    grid-template-rows: 1.5fr 1fr;
}

.moment-grid.multi-grid .moment-photo-container:nth-child(n+3) {
    aspect-ratio: 16/9;
}

.moment-photo-container {
    position: relative;
    overflow: hidden;
    aspect-ratio: 1;
    /* Square cells */
}

.moment-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    cursor: pointer;
    transition: transform 0.3s;
}

/* Keep queued/undecoded preview geometry without showing a browser error icon. */
.moment-photo:not([src]),
.moment-photo[aria-busy="true"] {
    visibility: hidden;
}

.moment-photo:hover {
    transform: scale(1.05);
}

.moment-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #c8c8c8;
    font-size: 36px;
    font-weight: 500;
    pointer-events: none;
}

.moment-footer {
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: white;
    border-top: 1px solid #f5f5f5;
}

.moment-actions {
    display: flex;
    align-items: center;
    gap: 5px;
}

.moment-action {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.moment-icon {
    font-size: 16px;
    cursor: pointer;
}

.moment-count {
    font-size: 14px;
    font-weight: 500;
    color: #575757;
    margin-left: 3px;
}

.moment-stats-right {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 14px;
    color: #575757;
}

.moment-album-link {
    color: #575757;
    cursor: pointer;
    transition: color 0.2s;
}

.moment-album-link:hover {
    color: var(--color-primary-dark);
}

.moment-stats {
    margin-left: auto;
    font-size: 14px;
    color: #575757;
}

/* Batch Badge */
.photo-batch-badge {
    /* Reuse specific style for badge inside photo if needed */
}

/* =====================================================
   MOBILE RESPONSIVE STYLES
   ===================================================== */

/* Tablets and smaller */
@media (max-width: 1024px) {
    .sidebar-right {
        display: none;
    }

    .timeline-section {
        margin-right: 0;
    }
}

/* Mobile devices */
@media (max-width: 768px) {
    :root {
        --header-height: 56px;
        --sidebar-width: 0px;
    }

    /* Header adjustments for mobile */
    .header {
        padding: 0 var(--spacing-sm);
        flex-wrap: wrap;
        height: auto;
        min-height: var(--header-height);
        padding-bottom: var(--spacing-sm);
    }

    .header-left {
        order: 1;
    }

    .header-title {
        font-size: 1rem;
    }

    .header-right {
        order: 2;
        display: flex;
        gap: var(--spacing-xs);
    }

    .header-btn {
        width: auto;
        height: auto;
        padding: var(--spacing-xs) var(--spacing-sm);
        font-size: 0.85rem;
        flex-direction: column;
        gap: 2px;
    }

    .header-btn .btn-icon {
        font-size: 1.1rem;
    }

    .header-btn .btn-label {
        display: block;
        font-size: 0.65rem;
    }

    .upload-text {
        display: none;
    }

    /* Search box takes full width on second row */
    .header-center {
        order: 3;
        width: 100%;
        padding: var(--spacing-xs) 0 0 0;
        flex-basis: 100%;
    }

    .search-box {
        max-width: 100%;
        width: 100%;
    }

    /* Hide sidebar on mobile */
    .sidebar-left {
        display: none;
    }

    .sidebar-right {
        display: none;
    }

    /* Full width timeline */
    .timeline-section {
        margin-left: 0;
        margin-right: 0;
        padding: var(--spacing-md);
    }

    .timeline-header {
        padding: var(--spacing-md);
    }

    .current-child-name {
        font-size: 1.5rem;
    }

    .current-child-age {
        font-size: 0.9rem;
    }

    /* Adjust main content margin */
    .main-content {
        margin-top: calc(var(--header-height) + 76px);
        /* Increase buffer by 32px to prevent header overlap */
    }

    /* Modal adjustments */
    .modal-content {
        max-width: 95vw;
        max-height: 85vh;
    }

    .modal-nav {
        width: 44px;
        height: 44px;
        font-size: 1.8rem;
        background: rgba(0, 0, 0, 0.6);
        color: white;
        border: 2px solid rgba(255, 255, 255, 0.3);
        opacity: 0.9;
        display: flex;
        /* Ensure arrows are visible */
    }

    .modal-prev {
        left: 8px;
    }

    .modal-next {
        right: 8px;
    }

    /* Upload modal */
    .upload-modal-content {
        width: 95vw;
        max-height: 90vh;
        padding: var(--spacing-md);
    }

    /* Moment cards */
    .moment-item {
        margin-left: 0;
    }

    .moment-line {
        display: none;
    }

    .moment-header {
        padding-left: 0;
    }
}

/* Small mobile devices */
@media (max-width: 480px) {
    .header-title {
        display: none;
    }

    .logo-svg {
        width: 32px;
        height: 32px;
    }

    .timeline-container {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }

    .moment-footer {
        flex-direction: column;
        gap: var(--spacing-sm);
        align-items: flex-start;
    }

    /* Compact header buttons for small screens */
    .header-right {
        gap: 2px;
    }

    .header-btn {
        padding: 4px 6px;
    }

    .header-btn .btn-icon {
        font-size: 1rem;
    }

    .header-btn .btn-label {
        font-size: 0.55rem;
    }

    /* Keep batch moment button visible */
    .batch-moment-btn {
        min-width: 36px;
    }
}

/* Mobile child switcher - floating bottom bar */
@media (max-width: 768px) {
    .child-profiles {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: var(--color-surface);
        border-top: 1px solid var(--color-border);
        padding: var(--spacing-sm);
        display: flex;
        flex-direction: row;
        justify-content: center;
        gap: var(--spacing-lg);
        z-index: 99;
        box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.1);
    }

    .profile-btn {
        width: 44px;
        height: 44px;
    }

    /* Add bottom padding to prevent content hidden by floating bar */
    .timeline-section {
        padding-bottom: 80px;
    }

    /* Fix: Move selection bar to bottom on mobile to avoid header overlap */
    .selection-bar,
    .moment-selection-bar {
        top: auto;
        bottom: 0;
        height: auto;
        min-height: 60px;
        flex-wrap: wrap;
        padding: 10px;
        justify-content: center;
        gap: 10px;
        animation: slideUpBottom 0.3s ease;
    }

    /* Adjust button sizes for mobile touch targets */
    .selection-actions {
        width: 100%;
        justify-content: space-around;
        flex-wrap: wrap;
    }

    .selection-actions button {
        flex: 1;
        min-width: 80px;
        padding: 8px 4px;
        font-size: 0.85rem;
    }

    /* Moment select mode checkbox position adjustment */
    body.moment-select-mode .moment-item::before {
        width: 28px;
        height: 28px;
        font-size: 1.2rem;
    }
}

/* =====================================================
   SEARCH RESULTS PAGE STYLES
   ===================================================== */

.search-page-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--spacing-lg);
}

.search-results-section {
    width: 100%;
}

.search-header {
    text-align: center;
    margin-bottom: var(--spacing-xl);
    padding: var(--spacing-lg);
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    border-radius: var(--radius-lg);
    color: var(--color-secondary);
}

.search-header h2 {
    font-size: 1.5rem;
    margin-bottom: var(--spacing-xs);
}

.search-header p {
    opacity: 0.8;
}

.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
}

.photo-grid .photo-card {
    cursor: pointer;
}

.photo-grid .photo-tags {
    font-size: 0.75rem;
    color: var(--color-primary-dark);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 150px;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: var(--spacing-lg);
    padding: var(--spacing-lg);
}

.page-btn {
    padding: var(--spacing-sm) var(--spacing-lg);
    background: var(--color-primary);
    color: var(--color-secondary);
    border: none;
    border-radius: var(--radius-md);
    font-weight: var(--font-weight-medium);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.page-btn:hover:not(:disabled) {
    background: var(--color-primary-dark);
}

.page-btn:disabled {
    background: var(--color-border);
    color: var(--color-text-muted);
    cursor: not-allowed;
}

#pageInfo {
    font-size: 0.9rem;
    color: var(--color-text-muted);
}

@media (max-width: 768px) {
    .search-page-content {
        padding: var(--spacing-md);
        margin-top: calc(var(--header-height) + 44px);
    }

    .photo-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: var(--spacing-sm);
    }

    .pagination {
        flex-direction: column;
        gap: var(--spacing-md);
    }

    /* Fix mobile card layout overlap */
    .photo-card .photo-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    .photo-card .photo-meta span {
        display: block;
        width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .photo-card .photo-tags {
        max-width: 100%;
        white-space: nowrap;
    }
}

/* =====================================================
   SWIPE CARD ANIMATION FOR PHOTO MODAL
   ===================================================== */
.modal-image-wrapper {
    position: relative;
    overflow: hidden;
}

.modal-image {
    transition: transform 0.3s ease-out, opacity 0.3s ease-out;
}

.modal-image.swipe-left-enter {
    animation: slideInFromRight 0.3s ease-out forwards;
}

.modal-image.swipe-right-enter {
    animation: slideInFromLeft 0.3s ease-out forwards;
}

.modal-image.swipe-left-exit {
    animation: slideOutToLeft 0.3s ease-out forwards;
}

.modal-image.swipe-right-exit {
    animation: slideOutToRight 0.3s ease-out forwards;
}

@keyframes slideInFromRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideInFromLeft {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutToLeft {
    from {
        transform: translateX(0);
        opacity: 1;
    }

    to {
        transform: translateX(-100%);
        opacity: 0;
    }
}

@keyframes slideOutToRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }

    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* =====================================================
   TOAST NOTIFICATION
   ===================================================== */
.toast-container {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10001;
    pointer-events: none;
}

.toast {
    background: rgba(0, 0, 0, 0.85);
    color: white;
    padding: 12px 24px;
    border-radius: 24px;
    font-size: 0.95rem;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    animation: toastSlideUp 0.3s ease-out forwards;
    display: flex;
    align-items: center;
    gap: 8px;
}

.toast.success {
    background: linear-gradient(135deg, #22c55e, #16a34a);
}

.toast.error {
    background: linear-gradient(135deg, #ef4444, #dc2626);
}

.toast.hide {
    animation: toastSlideDown 0.3s ease-in forwards;
}

@keyframes toastSlideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes toastSlideDown {
    from {
        transform: translateY(0);
        opacity: 1;
    }

    to {
        transform: translateY(20px);
        opacity: 0;
    }
}

/* =====================================================
   BUG FIXES
   ===================================================== */

/* Fix: Larger touch target for close buttons (44x44px min for mobile) */
.modal-close,
.upload-modal .modal-close,
.photo-modal .modal-close,
.time-travel-header button {
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    padding: 8px;
    cursor: pointer;
    border: none;
    background: rgba(0, 0, 0, 0.3);
    color: white;
    border-radius: var(--radius-full);
    transition: background 0.2s ease;
}

.modal-close:hover,
.time-travel-header button:hover {
    background: rgba(0, 0, 0, 0.6);
}

/* Fix: Photo object-fit to eliminate white gaps */
.moment-photo,
.moment-photo-container img {
    object-fit: cover;
    width: 100%;
    height: 100%;
}

/* =====================================================
   MOBILE: UPLOAD MODAL FIX
   ===================================================== */
@media (max-width: 768px) {

    /* Upload modal content sizing */
    .upload-modal-content {
        position: relative;
        max-height: 90vh;
        overflow-y: auto;
        padding-top: 50px;
        /* Space for close button */
    }

    /* Close button visible and fixed at top */
    .upload-modal .modal-close,
    .upload-modal-content .modal-close {
        position: fixed !important;
        top: 10px;
        right: 10px;
        z-index: 10002;
        min-width: 44px;
        min-height: 44px;
        background: rgba(0, 0, 0, 0.7);
        color: white;
        border: none;
        border-radius: 50%;
        font-size: 1.5rem;
        display: flex;
        align-items: center;
        justify-content: center;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    }

    /* Header buttons far right */
    .header-right {
        margin-left: auto;
        margin-right: 0 !important;
        padding-right: 8px;
    }
}

/* Download Button in Photo Modal */
.modal-download-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    margin-top: 12px;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
    border: none;
    border-radius: var(--radius-lg);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

.modal-download-btn:hover {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.modal-download-btn:active {
    transform: scale(0.98);
}

/* Mobile Timeline Line Alignment Fix */
@media (max-width: 768px) {

    /* Move vertical timeline line further left to avoid age header overlap */
    .timeline-container::before {
        left: 15px !important;
    }

    /* Move age group header right to avoid vertical line overlap */
    .age-group-header {
        padding-left: 35px !important;
        margin-left: 0 !important;
    }

    .age-group-title {
        margin-left: 5px !important;
    }

    /* Ensure download button is visible in photo modal */
    .modal-download-btn {
        display: block !important;
        width: calc(100% - 32px);
        margin: 12px 16px;
        z-index: 100;
    }

    /* Save tags button styling for clarity */
    .save-tags-btn {
        min-width: 80px;
        padding: 8px 12px;
        font-size: 0.9rem;
        background: linear-gradient(135deg, #22c55e, #16a34a);
        color: white;
        border: none;
        border-radius: 8px;
        cursor: pointer;
    }

    /* Hide timeline vertical line on mobile to avoid alignment issues */
    .timeline-container::before {
        display: none !important;
    }

    /* Hide age-group-title border-left on mobile */
    .age-group-title {
        border-left: none !important;
        padding-left: 0 !important;
    }

    /* New header 2-row layout for mobile */
    .header-mobile-stack {
        flex-direction: column;
        padding: 8px 12px;
        height: auto;
    }

    .header-row-top {
        display: flex;
        justify-content: space-between;
        align-items: center;
        width: 100%;
        margin-bottom: 8px;
    }

    .header-row-search {
        width: 100%;
    }

    .header-row-search .search-box {
        width: 100%;
        max-width: none;
    }

    /* Enlarged logo for mobile */
    .logo-svg-large {
        width: 36px;
        height: 36px;
    }

    .logo-img {
        width: 36px;
        height: 36px;
        border-radius: 50%;
        object-fit: cover;
        border: 2px solid var(--color-primary);
    }

    .header-logo-large .header-title {
        font-size: 1.1rem;
        font-weight: 600;
    }

    /* Header right buttons in row */
    .header-row-top .header-right {
        position: static;
        display: flex;
        gap: 4px;
    }

    /* Photo modal scrollable content for mobile */
    .photo-modal .modal-content {
        max-height: 90vh;
        overflow-y: auto;
        display: flex;
        flex-direction: column;
    }

    .photo-modal .modal-info {
        max-height: 35vh;
        overflow-y: auto;
        padding-bottom: 16px;
    }

    /* Ensure download button is always visible at bottom */
    .photo-modal .modal-download-btn {
        position: sticky;
        bottom: 0;
        width: calc(100% - 24px);
        margin: 8px 12px;
        flex-shrink: 0;
        background: linear-gradient(135deg, #3b82f6, #2563eb);
    }
}

/* =====================================================
   ALBUM SIDEBAR (Swipe from left)
   ===================================================== */
.album-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 280px;
    height: 100vh;
    background: var(--color-surface);
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
}

.album-sidebar.open {
    transform: translateX(0);
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-light));
    color: #333;
}

.sidebar-title {
    font-size: 1.2rem;
    font-weight: 600;
}

.sidebar-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 8px;
    transition: background 0.2s;
}

.sidebar-close:hover {
    background: rgba(0, 0, 0, 0.1);
}

.sidebar-albums {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

.sidebar-album-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    margin-bottom: 12px;
    background: var(--color-background);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all 0.2s ease;
    border: 2px solid transparent;
}

.sidebar-album-card:hover {
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.sidebar-album-card.active {
    border-color: var(--color-primary);
    background: linear-gradient(135deg, rgba(255, 236, 0, 0.1), rgba(255, 236, 0, 0.05));
}

.album-card-emoji {
    font-size: 2rem;
}

.album-card-info {
    flex: 1;
}

.album-card-name {
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--color-text);
}

.album-card-subtitle {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    margin-top: 4px;
}

.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: all 0.3s ease;
}

.sidebar-overlay.visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* Hamburger Menu Button */
.hamburger-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    margin-right: 8px;
    border-radius: var(--radius-md);
    transition: background 0.2s ease;
}

.hamburger-btn:hover {
    background: rgba(0, 0, 0, 0.05);
}

.hamburger-btn:active {
    background: rgba(0, 0, 0, 0.1);
}

.hamburger-icon {
    font-size: 1.5rem;
    color: var(--color-text);
}

/* Logo Image (replaces SVG) */
.logo-img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--color-primary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Desktop: Hide hamburger button (sidebar always visible or use other navigation) */
@media (min-width: 769px) {
    .hamburger-btn {
        display: flex;
        /* Keep visible for consistency */
    }
}

/* =====================================================
   SIDEBAR TAB HANDLE (Semi-circular bookmark on left edge)
   ===================================================== */
.sidebar-tab-handle {
    position: fixed;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 28px;
    height: 80px;
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-light));
    border-radius: 0 20px 20px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 998;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-left: none;
}

.sidebar-tab-handle:hover {
    width: 36px;
    box-shadow: 4px 0 16px rgba(0, 0, 0, 0.2);
}

.sidebar-tab-handle:active {
    transform: translateY(-50%) scale(0.95);
}

.sidebar-tab-handle .tab-icon {
    font-size: 1.1rem;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    margin-left: 2px;
}

/* Hide tab when sidebar is open */
.album-sidebar.open~.sidebar-overlay~.sidebar-tab-handle,
.sidebar-tab-handle.hidden {
    opacity: 0;
    pointer-events: none;
    transform: translateY(-50%) translateX(-100%);
}

/* Mobile: Show tab handle prominently */
@media (max-width: 768px) {
    .sidebar-tab-handle {
        top: 45%;
        height: 70px;
        width: 24px;
    }

    .sidebar-tab-handle .tab-icon {
        font-size: 1rem;
    }
}

/* Upload Progress */
.progress-container {
    width: 100%;
    height: 4px;
    background-color: var(--color-border);
    margin-top: 5px;
    border-radius: 2px;
    overflow: hidden;
    display: none;
    /* Hidden by default */
}

.progress-bar {
    height: 100%;
    background-color: var(--color-primary);
    width: 0%;
    transition: width 0.2s;
}

.queue-item.uploading .progress-container {
    display: block;
}

.progress-text {
    font-size: 0.8rem;
    color: var(--color-primary);
    margin-left: var(--spacing-xs);
    font-weight: bold;
    display: none;
}

.queue-item.uploading .progress-text {
    display: inline;
}


/* Global Progress Bar (Background Upload) */
.global-upload-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: var(--color-surface);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    z-index: 2000;
    padding: 10px 20px;
    display: none;
    /* Hidden by default */
    align-items: center;
    justify-content: space-between;
    transition: transform 0.3s ease;
}

.global-upload-bar.visible {
    display: flex;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        transform: translateY(-100%);
    }

    to {
        transform: translateY(0);
    }
}

.global-progress-info {
    flex: 1;
    margin-right: 20px;
}

.global-progress-text {
    font-size: 0.9rem;
    font-weight: bold;
    color: var(--color-text);
    margin-bottom: 5px;
    display: flex;
    justify-content: space-between;
}

.global-progress-track {
    width: 100%;
    height: 6px;
    background-color: var(--color-background);
    border-radius: 3px;
    overflow: hidden;
}

.global-progress-fill {
    height: 100%;
    background-color: var(--color-primary);
    width: 0%;
    transition: width 0.3s ease;
}

.global-upload-actions {
    display: flex;
    gap: 10px;
}

.global-minimize-btn {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 5px;
}
/* Timeline refinement. Scoped to this page so other album flows keep their layout. */
.timeline-page {
    --color-background: #f7f6f2;
    --color-text: #292d29;
    --color-text-muted: #656b63;
    --color-border: #e5e7de;
    background: var(--color-background);
}

.timeline-page .header {
    position: sticky;
    height: auto;
    min-height: 80px;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 12px 28px;
    padding: 12px 28px;
    box-shadow: 0 2px 12px #292d2905;
}

.timeline-page .header-row-top,
.timeline-page .header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.timeline-page .header-row-top { flex: 1; margin: 0; }
.timeline-page .header-right { margin-left: auto; padding-right: 0; gap: 8px; }
.timeline-page .header-row-search { flex: 0 1 350px; }
.timeline-page .search-box { max-width: none; padding: 4px 8px 4px 14px; border-radius: 14px; }
.timeline-page .search-box input { min-width: 0; min-height: 44px; font-family: inherit; }
.timeline-page .search-btn { min-height: 44px; }

.timeline-page .header-btn {
    width: auto;
    min-width: 52px;
    min-height: 48px;
    height: auto;
    border-radius: 12px;
    padding: 8px 12px;
    flex-direction: row;
    gap: 6px;
    color: var(--color-text);
}

.timeline-page .header-btn .btn-label { display: block; font-size: .85rem; }
.timeline-page .upload-header-btn { background: #ffec00; margin: 0; }
.timeline-page .header-btn.active { background: #fff5a4; box-shadow: inset 0 0 0 2px #8a7910; }
.timeline-page .hamburger-btn { min-width: 44px; min-height: 44px; }
.timeline-page .main-content { margin-top: 0; min-height: calc(100vh - 80px); }
.timeline-page .sidebar-left,
.timeline-page .sidebar-right { top: var(--timeline-header-height, 80px); height: calc(100dvh - var(--timeline-header-height, 80px)); }
.timeline-page .sidebar-left { background: transparent; border: 0; }
.timeline-page .sidebar-right { background: transparent; border: 0; }
.timeline-page .timeline-section { max-width: none; min-width: 0; margin-left: var(--sidebar-width); margin-right: var(--age-nav-width); padding: 32px; }
.timeline-page .timeline-header {
    text-align: left;
    background: #fff;
    border: 1px solid var(--color-border);
    border-left: 5px solid #ffdf36;
    padding: 28px 32px;
    box-shadow: 0 4px 24px #292d2904;
    margin-bottom: 28px;
}
.timeline-page .timeline-eyebrow { font-size: .8rem; color: #6b681a; font-weight: 700; letter-spacing: .12em; margin-bottom: 8px; }
.timeline-page .current-child-name { font-size: 2rem; line-height: 1.3; }
.timeline-page .current-child-age { color: #565e53; opacity: 1; margin: 8px 0 12px; }
.timeline-page .timeline-hint { font-size: .9rem; color: #656b63; }
.timeline-page .age-group-title { color: #555a34; font-size: 1.2rem; }
.timeline-page .age-group-header { scroll-margin-top: calc(var(--timeline-header-height, 80px) + 16px); }
.timeline-page .moment-item { border: 1px solid var(--color-border); box-shadow: 0 4px 16px #292d2906; }
.timeline-page .loading-indicator,
.timeline-page .empty-state { grid-column: 1 / -1; }
.timeline-page .time-travel-item,
.timeline-page .sidebar-album-card { width: 100%; text-align: left; color: inherit; }
.timeline-page .album-card-name,
.timeline-page .album-card-subtitle { display: block; }
.timeline-page .sidebar-close,
.timeline-page .time-travel-header button { min-width: 44px; min-height: 44px; }
.timeline-page .album-sidebar { max-width: calc(100vw - 32px); height: 100dvh; }
.timeline-page .time-travel-menu { max-height: 70dvh; padding-bottom: max(16px, env(safe-area-inset-bottom)); }
.timeline-page :is(button, a, input, select):focus-visible { outline: 3px solid #637448; outline-offset: 3px; }
.timeline-page .skip-link { position: fixed; top: -100px; left: 16px; padding: 12px 20px; background: #fff; color: #292d29; border-radius: 8px; z-index: 10010; }
.timeline-page .skip-link:focus { top: 12px; }

@media (max-width: 1100px) {
    .timeline-page .header { flex-direction: column; align-items: stretch; padding: 12px 20px; gap: 8px; }
    .timeline-page .header-row-top { flex: auto; justify-content: space-between; }
    .timeline-page .header-row-search { flex: auto; width: 100%; }
}

@media (max-width: 1024px) {
    .timeline-page .timeline-section { margin-right: 0; }
}

@media (max-width: 768px) {
    .timeline-page .header { padding: max(8px, env(safe-area-inset-top)) 12px 10px; }
    .timeline-page .header-row-top { gap: 8px; }
    .timeline-page .header-left { gap: 6px; }
    .timeline-page .header-title { display: none; }
    .timeline-page .header-right { gap: 4px; }
    .timeline-page .header-btn { min-width: 44px; min-height: 48px; padding: 5px 7px; flex-direction: column; gap: 1px; }
    .timeline-page .header-btn .btn-label { font-size: .72rem; }
    .timeline-page .header-btn .btn-icon { font-size: 1.1rem; }
    .timeline-page .sidebar-tab-handle { display: none; }
    .timeline-page .timeline-section { margin: 0; padding: 20px 16px max(100px, env(safe-area-inset-bottom)); }
    .timeline-page .timeline-header { padding: 22px; margin-bottom: 20px; }
    .timeline-page .current-child-name { font-size: 1.7rem; }
    .timeline-page .timeline-container { grid-template-columns: minmax(0, 1fr); gap: 16px; }
    .timeline-page .age-group-header { padding-left: 0 !important; }
    .timeline-page .age-group-title { margin-left: 0 !important; }
    .timeline-page .selection-bar,
    .timeline-page .moment-selection-bar { padding-bottom: max(12px, env(safe-area-inset-bottom)); }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .timeline-page *, .timeline-page *::before, .timeline-page *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

@media (max-width: 360px) {
    .timeline-page .header-row-top { gap: 6px; }
    .timeline-page .header-right { gap: 3px; }
}
/* Keep album lookup feedback beside the destination, including on narrow screens. */
.album-load-status { margin-top: 6px; font-size: 13px; line-height: 1.5; color: #625746; overflow-wrap: anywhere; }
.album-load-status[hidden], .album-load-status button[hidden] { display: none; }
.album-load-status button { display: block; min-height: 44px; margin-top: 4px; padding: 6px 12px; border: 1px solid #b7a98f; border-radius: 8px; background: #fffaf0; color: #514531; cursor: pointer; }
.album-load-status button:focus-visible { outline: 3px solid #856e45; outline-offset: 2px; }

/* Shiguang entry: search-row right side. */
.timeline-page .header-row-search { display: flex; align-items: center; gap: 10px; }
.timeline-page .header-row-search .search-box { flex: 1; min-width: 0; }
.timeline-page .header-row-search .shiguang-entry { display: flex; flex: 0 0 auto; align-items: center; justify-content: center; gap: 5px; min-height: 48px; padding: 10px 12px; border: 1px solid #e8cd77; border-radius: 14px; color: #493326; background: #fff0b2; text-decoration: none; white-space: nowrap; font-size: .9rem; }

/* Approved picture-book direction. Decoration never replaces album media. */
.storybook-page {
    --color-primary: #ffe589;
    --color-primary-light: #fff3be;
    --color-primary-dark: #715217;
    --color-background: #faf7ef;
    --color-surface: #fffefb;
    --color-text: #493326;
    --color-text-muted: #736d79;
    --color-border: #e9e3d8;
    --color-overlay: #39281cd6;
    --sidebar-width: 176px;
    --age-nav-width: 188px;
    --radius-lg: 22px;
    color: var(--color-text);
    background: radial-gradient(circle at 8% 4%, #edf5df 0, transparent 24%), #faf7ef;
    font-family: 'Noto Sans TC', system-ui, sans-serif;
}
.storybook-page :is(button, input, select) { font: inherit; }
.storybook-page [hidden] { display: none !important; }
.storybook-page :is(button, a, input, select):focus-visible { outline: 3px solid #538f81; outline-offset: 3px; }
.storybook-page :is(button, .btn, .action-btn, .header-btn, .back-btn) { min-height: 44px; }
.storybook-page .header {
    position: sticky; top: 0; height: auto; min-height: 80px;
    display: flex; flex-wrap: wrap; flex-direction: row; gap: 12px 20px;
    padding: 14px 24px; background: #fffefbf5; border-bottom: 1px solid #e7ead4;
    box-shadow: 0 3px 18px #49332609;
}
.storybook-page .header-row-top { flex: 1; gap: 16px; margin: 0; }
.storybook-page .header-row-search { flex: 0 1 330px; }
.storybook-page .header-logo { gap: 10px; }
.storybook-page .header-title { color: #493326; font-size: 1.4rem; font-weight: 800; }
.storybook-page .header-right { gap: 8px; padding-right: 0; margin-left: auto; }
.storybook-page .header-btn { width: auto; height: auto; padding: 8px 12px; flex-direction: row; gap: 5px; border-radius: 14px; }
.storybook-page .header-btn .btn-label { display: block; font-size: .85rem; }
.storybook-page .upload-header-btn { margin: 0; background: #ffe0e3; }
.storybook-page .time-travel-btn { background: #fff0b2; }
.storybook-page .settings-btn { background: #f2eee9; }
.storybook-page .batch-moment-btn { background: #e4f3fd; }
.storybook-page .photo-select-btn { background: #e8f4dd; }
.storybook-page .timeline-photo-select { display: none; position: absolute; right: 8px; top: 8px; width: 44px; height: 44px; z-index: 5; border: 2px solid #c59b37; border-radius: 12px; background: #fffefb; color: #493326; font-size: 1.4rem; }
.storybook-page.select-mode .timeline-photo-select { display: grid; place-items: center; }
.storybook-page.select-mode .moment-photo-container.selected { outline: 3px solid #e5b94e; outline-offset: -3px; }
.storybook-page .timeline-photo-select[aria-pressed="true"] { background: #ffe589; }
.storybook-page .header-btn.active { box-shadow: inset 0 0 0 2px #9b7c27; }
.storybook-page .batch-moment-btn.active .btn-icon,
.storybook-page .batch-moment-btn.active .btn-label { color: #604c34; }
.storybook-page .search-box { border: 1px solid #e3e3ea; border-radius: 16px; background: white; padding: 4px 8px 4px 14px; max-width: none; }
.storybook-page .search-box input { min-height: 42px; min-width: 0; }
.storybook-page .search-btn { border-radius: 12px; background: #ffe589; color: #493326; min-height: 44px; }
.storybook-page .main-content { margin-top: 0; min-height: calc(100dvh - 80px); }
.storybook-page .sidebar-left, .storybook-page .sidebar-right {
    top: var(--timeline-header-height, 80px); height: calc(100dvh - var(--timeline-header-height, 80px));
    background: transparent; border: 0; padding: 18px 12px;
}
.storybook-page .child-profiles { align-items: stretch; gap: 12px; }
.storybook-page .profile-btn { width: 100%; height: auto; min-height: 82px; padding: 10px; display: flex; align-items: center; gap: 8px; border-radius: 18px; background: #fffefb; border: 1px solid #e9e3d8; }
.storybook-page .profile-btn.active { background: #fff0b2; border-color: #e8cd65; }
.storybook-page .profile-emoji { display: flex; }
.storybook-page .profile-emoji img { width: 48px; height: 56px; object-fit: contain; }
.storybook-page .profile-label { font-size: .95rem; font-weight: 700; }
.storybook-page .sidebar-decoration { width: 100%; height: 180px; object-fit: contain; margin-top: 100px; pointer-events: none; }
.storybook-page .timeline-section { max-width: none; margin-left: var(--sidebar-width); margin-right: var(--age-nav-width); padding: 24px; }
.storybook-page .timeline-header {
    position: relative; min-height: 185px; padding: 26px 30px; border: 1px solid #dbe8d1;
    border-radius: 24px; background: linear-gradient(120deg, #e2f4fe, #f5faf0);
    text-align: left; box-shadow: 0 4px 18px #49332605; overflow: hidden; margin-bottom: 28px;
}
.storybook-page .timeline-header::after { content: ''; position: absolute; left: 8px; bottom: 8px; width: 28%; height: calc(100% - 16px); background: var(--storybook-portrait,url('../assets/storybook-boy.png')) center bottom / contain no-repeat; pointer-events: none; }
.storybook-page .timeline-header > * { position: relative; z-index: 1; margin-left: 29%; max-width: 70%; }
.storybook-page .timeline-eyebrow { color: #65551e; font-size: .8rem; font-weight: 700; letter-spacing: .08em; }
.storybook-page .current-child-name { font-size: 2rem; font-weight: 800; color: #493326; }
.storybook-page .current-child-age { margin: 6px 0 10px; color: #493326; opacity: 1; }
.storybook-page .timeline-hint { color: #736d79; font-size: .85rem; }
.storybook-page .timeline-container { display: grid; grid-template-columns: repeat(auto-fill, minmax(205px, 1fr)); gap: 16px; }
.storybook-page .age-group-header { grid-column: 1 / -1; margin: 8px 0 0; scroll-margin-top: calc(var(--timeline-header-height, 80px) + 18px); }
.storybook-page .age-group-title { color: #493326; font-size: 1.25rem; padding-left: 0; }
.storybook-page .moment-item { margin: 0; background: #fffefb; border: 1px solid #e9e3d8; border-radius: 18px; padding: 12px; box-shadow: 0 4px 15px #49332605; overflow: hidden; }
.storybook-page .moment-line { display: none; }
.storybook-page .moment-header { margin: 0 0 10px; align-items: center; gap: 6px; }
.storybook-page .moment-date-box { width: auto; height: auto; flex-direction: row; gap: 4px; background: transparent; border-radius: 0; }
.storybook-page .moment-month { color: #493326; font-size: .9rem; }
.storybook-page .moment-day { color: #493326; font-size: .9rem; line-height: 1.5; margin: 0; }
.storybook-page .moment-info { margin-left: auto; }
.storybook-page .moment-age { font-size: .72rem; color: #736d79; }
.storybook-page .moment-content-box { margin: 0; border: 0; border-radius: 12px; background: transparent; }
.storybook-page .moment-grid { border-radius: 12px; overflow: hidden; }
.storybook-page .moment-footer { flex-direction: column; align-items: stretch; gap: 8px; padding: 10px 0 0; }
.storybook-page .moment-actions { font-size: .85rem; color: #777488; }
.storybook-page .moment-stats-right { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; align-items: center; font-size: .75rem; }
.storybook-page .moment-album-link { padding: 7px 12px; border: 0; border-radius: 10px; background: #ffe589; color: #493326; cursor: pointer; min-height: 36px; }
.storybook-page .moment-tags { display: flex; flex-wrap: wrap; gap: 5px; padding-top: 8px; }
.storybook-page .moment-tag { padding: 3px 8px; border: 0; border-radius: 8px; background: #ffe4e9; color: #654042; font-size: .72rem; cursor: pointer; min-height: 32px; max-width: 100%; min-width: 0; white-space: normal; overflow-wrap: anywhere; text-align: left; }
.storybook-page .moment-tag:nth-child(even) { background: #e1f2ff; color: #365a70; }
.storybook-page .video-badge { position: absolute; inset: 0; display: grid; place-items: center; color: white; text-shadow: 0 1px 8px #000; pointer-events: none; font-size: 2rem; }
.storybook-page .age-nav { border: 1px solid #e5e8d6; border-radius: 22px; background: #fffefb; padding: 16px 10px; }
.storybook-page .age-nav-title { color: #493326; font-size: 1.1rem; }
.storybook-page .age-item { border-radius: 13px; padding: 10px 8px; }
.storybook-page .age-item.active { background: #fff0b2; }
.storybook-page .age-count { color: #736d79; }
.storybook-page .time-travel-menu, .storybook-page .album-sidebar { background: #fffefb; border-radius: 22px; }
.storybook-page .loading-indicator, .storybook-page .empty-state { grid-column: 1 / -1; border-radius: 22px; color: #736d79; }
.storybook-page .selection-bar, .storybook-page .moment-selection-bar { background: #fff2c0; border: 1px solid #e6d390; border-radius: 18px; padding: 12px 16px; box-shadow: 0 8px 25px #49332615; }
.storybook-page .selection-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.storybook-page :is(.action-btn, .btn-secondary, .btn-tag, .btn-danger) { border-radius: 12px; padding: 10px 14px; }
.storybook-page .action-btn { background: #fffefb; color: #493326; border: 1px solid #e9dfbe; }
.storybook-page .btn-secondary { color: #493326; background: #fffefb; border: 1px solid #e9e3d8; }
.storybook-page .btn-danger { background: #ffc2c7; color: #6e3035; border: 1px solid #e9a7ad; }
.storybook-page .btn-tag { background: #ffe589; color: #493326; }
.storybook-page .confirm-modal { background: #fffefb; border: 1px solid #e9e3d8; border-radius: 24px; color: #493326; }
.storybook-page .confirm-title { color: #493326; }
.storybook-page .confirm-message { color: #736d79; }
.storybook-page .confirm-actions > button { min-width: 0; padding-inline: 8px; white-space: nowrap; }
.storybook-page .video-warning { text-wrap: pretty; }
.storybook-page .collection-item { border-radius: 14px; }
.storybook-page .upload-modal-content { background: #fffefb; width: min(820px, calc(100vw - 40px)); max-width: 820px; max-height: 90dvh; border: 1px solid #e9e3d8; border-radius: 24px; overflow-y: auto; padding: 28px; }
.storybook-page .upload-header { text-align: left; margin-bottom: 18px; }
.storybook-page .upload-header h2 { color: #493326; }
.storybook-page .upload-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.storybook-page .upload-dropzone { grid-column: 1 / -1; min-height: 165px; border: 2px dashed #cedfc9; background: #f6faf0; border-radius: 20px; }
.storybook-page .upload-field { margin: 0; min-width: 0; }
.storybook-page .upload-field label { color: #493326; }
.storybook-page :is(.upload-input, .upload-select, .queue-item-tags, #editTagsInput, #tagInput) { min-height: 44px; border: 1px solid #dcdce3; border-radius: 12px; background: #fff; padding: 10px 12px; color: #493326; width: 100%; }
.storybook-page .upload-queue { grid-column: 1 / -1; }
.storybook-page .queue-item { border: 1px solid #e9e3d8; background: white; border-radius: 14px; padding: 12px; }
.storybook-page .queue-filename { min-width: 0; overflow-wrap: anywhere; white-space: normal; overflow: visible; text-overflow: clip; }
.storybook-page .queue-btn.upload, .storybook-page .refresh-btn { background: #ffe589; color: #493326; border-radius: 12px; }
.storybook-page .uploader-display { background: #f0eeeb; border-radius: 12px; }
.storybook-page .tagging-mode-toggle { border-radius: 14px; background: #f5f1e8; }
.storybook-page .mode-btn.active { background: #ffe589; color: #493326; }
/* Background status stays above the page and below modal controls. */
.storybook-page .global-upload-bar { background: #e2f3ff; color: #493326; border: 1px solid #b6d6e9; border-radius: 15px; z-index: 900; }
@media (min-width: 769px) {
    .storybook-page .global-upload-bar { top: auto; bottom: 12px; left: 24px; right: 24px; width: auto; }
    .storybook-page.album-detail-page.select-mode .global-upload-bar { bottom: calc(20px + var(--storybook-selection-height, 68px)); }
}
.storybook-page .photo-modal .modal-overlay { background: #39281ce8; }
.storybook-page .photo-modal .modal-content { display: grid; grid-template-columns: minmax(0, 1fr) 290px; grid-template-rows: minmax(0, 1fr); gap: 16px; width: min(1120px, calc(100vw - 80px)); max-width: 1120px; max-height: 90dvh; align-items: center; background: #493326; padding: 44px 18px 18px; border: 5px solid #f3e9b2; border-radius: 24px; }
.storybook-page .photo-modal .modal-image-wrapper { min-width: 0; width: 100%; grid-column: 1; }
.storybook-page .photo-modal :is(.modal-image, .modal-video) { max-height: 70dvh; width: 100%; object-fit: contain; border-radius: 16px; margin: 0; }
.storybook-page .photo-modal .modal-info { grid-column: 2; grid-row: 1; margin: 0; padding: 20px; background: #fffefb; color: #493326; border-radius: 18px; text-align: left; width: 100%; min-width: 0; min-height: 0; max-height: calc(90dvh - 76px); overflow-y: auto; overscroll-behavior: contain; }
.storybook-page .photo-modal .modal-info h3 { display: block; color: #493326; overflow-wrap: anywhere; margin-bottom: 14px; }
.storybook-page .photo-modal .modal-info p { color: #736d79; opacity: 1; margin: 8px 0; }
.storybook-page .photo-modal .modal-close { top: 4px; right: 8px; width: 40px; height: 40px; background: transparent; color: white; }
.storybook-page .photo-modal .modal-page-indicator { top: 4px; background: transparent; padding: 4px 12px; }
.storybook-page .photo-modal .modal-prev { left: 24px; }
.storybook-page .photo-modal .modal-next { right: 330px; }
.storybook-page .photo-modal .modal-nav { background: #493326b8; color: white; border: 1px solid #fff8; width: 44px; height: 44px; z-index: 3; }
.storybook-page .modal-download-btn { position: static; bottom: auto; width: 100%; border: 0; background: #d9efff; color: #355875; border-radius: 12px; min-height: 44px; padding: 10px 12px; margin: 16px 0 0; }
.storybook-page .modal-tags-edit button { background: #ffe589; color: #493326; border-radius: 12px; min-height: 44px; }
.storybook-page .modal-tags-edit { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.storybook-page .album-page-content { display: block; padding: 24px; max-width: 1360px; margin: auto; }
.storybook-page .album-header { display: grid; grid-template-columns: 240px minmax(0,1fr); gap: 24px; align-items: center; min-height: 185px; padding: 24px; margin-bottom: 24px; border: 1px solid #e4e9d7; border-radius: 24px; background: #fffdf4; }
.storybook-page .album-header > * { max-width: none; }
.storybook-page .album-cover { width: 100%; height: 165px; object-fit: cover; border-radius: 18px; }
.storybook-page .album-heading-copy { position: relative; padding-bottom: 12px; }
.storybook-page .album-heading-copy p { overflow-wrap: normal; }
.storybook-page .album-header h2 { font-size: 1.7rem; color: #493326; }
.storybook-page .album-header p { color: #736d79; margin-top: 8px; }
.storybook-page .album-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.storybook-page .album-photo-card { border: 2px solid #e9e3d8; border-radius: 16px; background: white; overflow: hidden; }
.storybook-page .album-photo-card.selected { border-color: #dea927; }
.storybook-page .settings-container { max-width: 1050px; padding: 28px 24px; }
.storybook-page .settings-header { border: 0; margin-bottom: 22px; }
.storybook-page .settings-title { font-size: 2rem; color: #493326; }
.storybook-page .settings-section { border: 1px solid #e9e3d8; border-radius: 24px; background: #fffefb; box-shadow: 0 4px 16px #49332606; padding: 24px; }
.storybook-page .section-title { color: #493326; font-size: 1.3rem; margin: -24px -24px 20px; padding: 22px 24px; border-radius: 24px 24px 0 0; background: #fff0b2; }
.storybook-page #childrenList { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.storybook-page .child-card { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 12px 18px; margin: 0; padding: 18px; border: 1px solid #e9e3d8; background: linear-gradient(135deg, #eef8ff, #fffefb 70%); border-radius: 20px; }
.storybook-page .child-card:nth-child(even) { background: linear-gradient(135deg, #fff0f1, #fffefb 70%); }
.storybook-page .child-emoji { grid-row: span 2; }
.storybook-page .child-emoji img { width: 150px; height: 180px; object-fit: contain; }
.storybook-page .child-name { color: #493326; font-size: 1.4rem; }
.storybook-page .child-age { display: inline-block; background: #fff0b2; border-radius: 10px; padding: 4px 8px; margin-top: 6px; }
.storybook-page .birthdate-input { width: 100%; min-width: 0; min-height: 44px; border: 1px solid #dddce4; padding: 9px 10px; border-radius: 12px; }
.storybook-page .save-btn { width: auto; min-width: 240px; margin: 24px auto; background: #ffe589; color: #493326; box-shadow: none; border-radius: 16px; }
.storybook-page .toast.success { background: #e3f3dc; border: 1px solid #bdd4b6; color: #3b5835; }
.storybook-page .toast.warning { background: #fff2bf; border: 1px solid #d8bd67; color: #725116; }
.storybook-page .toast.error { background: #ffe1e3; color: #743e40; }
.storybook-page .storybook-footer { text-align: center; color: #736d79; padding: 22px; font-size: .8rem; }
.storybook-page .storybook-install { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.timeline-page .transfer-entry-panel { margin-bottom: 14px; min-width: 0; border: 1px solid #dbe5d1; border-radius: 16px; background: #f0f6e8; padding: 4px 14px 12px; }
.timeline-page .transfer-entry-link { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; min-height: 44px; padding: 8px 0; color: #493326; text-decoration: none; }
.timeline-page .transfer-entry-link:focus-visible { outline: 3px solid #997436; outline-offset: 2px; border-radius: 8px; }
.timeline-page #transferQueueCount { font-size: .85rem; padding: 3px 8px; border-radius: 9px; background: #ffe89b; }
.timeline-page #transferQueueDetail { margin: 0; line-height: 1.5; overflow-wrap: anywhere; }
.settings-page .device-settings { margin-top: 12px; }
.settings-page .device-status-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.settings-page .device-status-card { min-width: 0; border: 1px solid #e4e6dd; background: #f3f7ed; border-radius: 16px; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.settings-page .device-status-card:nth-child(2) { background: #eef6fb; }
.settings-page .device-status-card:nth-child(3) { background: #fff2f3; }
.settings-page .device-status-card h3, .settings-page .device-status-card p { margin: 0; }
.settings-page .device-status-card h3 { font-size: 1rem; }
.settings-page .device-status-card p { line-height: 1.6; overflow-wrap: anywhere; }
.settings-page .device-status-card a { margin-top: auto; text-align: center; }
.settings-page .device-settings > .storybook-note { margin: 16px 0; }
.settings-page .device-settings .btn-secondary { min-height: 44px; }
@media (max-width: 760px) { .settings-page .device-status-grid { grid-template-columns: 1fr; } }
.storybook-page .storybook-note { color: #736d79; font-size: .85rem; margin-top: 8px; }
@media (max-width: 1100px) {
    .storybook-page .header { flex-direction: column; align-items: stretch; gap: 8px; }
    .storybook-page .header-row-top { width: 100%; justify-content: space-between; }
    .storybook-page .header-row-search { flex: auto; }
    .storybook-page .timeline-section { margin-right: 0; }
    .storybook-page .sidebar-right { display: none; }
    .storybook-page .photo-modal .modal-content { grid-template-columns: minmax(0, 1fr) 260px; }
    .storybook-page .photo-modal .modal-next { right: 300px; }
}
@media (max-width: 768px) {
    .storybook-page { --sidebar-width: 0px; --age-nav-width: 0px; }
    .storybook-page .header { padding: max(8px, env(safe-area-inset-top)) 12px 10px; }
    .storybook-page .header-row-top { flex-wrap: wrap; gap: 8px; }
    .storybook-page .header-left { gap: 6px; }
    .storybook-page .header-logo .header-title { display: block; font-size: 1.1rem; }
    .storybook-page .logo-img { width: 30px; height: 30px; }
    .storybook-page .header-right { width: 100%; justify-content: space-between; margin: 0; }
    .storybook-page .header-btn { flex: 1; padding: 7px; min-width: 44px; flex-direction: row; }
    .storybook-page .header-btn .btn-label { font-size: .78rem; }
    .storybook-page .header-btn .btn-icon { font-size: 1rem; }
    .storybook-page .timeline-section { margin: 0; padding: 18px 14px 110px; }
    .storybook-page .timeline-header { min-height: 160px; padding: 22px 18px; margin-bottom: 18px; }
    .storybook-page .current-child-name { font-size: 1.7rem; }
    .storybook-page .timeline-header > * { margin-left: 35%; max-width: 65%; }
    .storybook-page .timeline-header::after { width: 34%; opacity: 1; }
    .storybook-page .timeline-hint { font-size: .75rem; }
    .storybook-page .timeline-container { grid-template-columns: 1fr; gap: 14px; }
    .storybook-page .sidebar-left { display: none; }
    .storybook-page .moment-age { font-size: .8rem; }
    .storybook-page .moment-photo-container { max-height: 240px; }
    .storybook-page .selection-bar, .storybook-page .moment-selection-bar { position: fixed; top: auto; bottom: max(8px, env(safe-area-inset-bottom)); left: 8px; right: 8px; max-height: 40dvh; overflow-y: auto; padding: 10px; border-radius: 16px; }
    .storybook-page .selection-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); width: 100%; gap: 6px; }
    .storybook-page .selection-actions button { padding: 7px 6px; font-size: .8rem; min-width: 0; }
    .storybook-page .album-page-content { margin-top: 0; padding: 16px 14px 140px; }
    .storybook-page .album-header { grid-template-columns: 100px minmax(0,1fr); min-height: 150px; gap: 12px; padding: 14px; }
    .storybook-page .album-cover { height: 125px; }
    .storybook-page .album-header h2 { font-size: 1.3rem; }
    .storybook-page .album-header h2 { font-size: 1.4rem; }
    .storybook-page .album-header p { font-size: .85rem; }
    .storybook-page .album-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .storybook-page .settings-container { padding: 20px 14px; }
    .storybook-page .settings-section { padding: 16px; }
    .storybook-page .section-title { margin: -16px -16px 16px; padding: 18px 16px; }
    .storybook-page #childrenList { grid-template-columns: 1fr; gap: 14px; }
    .storybook-page .child-card { padding: 15px; grid-template-columns: 96px minmax(0, 1fr); gap: 12px; }
    .storybook-page .child-emoji img { width: 96px; height: 122px; }
    .storybook-page .child-name { font-size: 1.2rem; }
    .storybook-page .child-age { font-size: .75rem; }
    .storybook-page .save-btn { width: 100%; margin: 20px 0; }
    .storybook-page .upload-modal-content { width: calc(100vw - 20px); padding: 22px 16px; max-height: 92dvh; }
    .storybook-page .upload-options { grid-template-columns: 1fr; }
    .storybook-page .upload-dropzone { min-height: 145px; }
    .storybook-page .queue-actions { flex-wrap: wrap; }
    .storybook-page .photo-modal .modal-content { display: block; width: calc(100vw - 20px); max-height: 92dvh; padding: 42px 10px 12px; overflow-y: auto; }
    .storybook-page .photo-modal :is(.modal-image, .modal-video) { max-height: 43dvh; }
    .storybook-page .photo-modal .modal-info { padding: 16px; margin-top: 12px; max-height: none; overflow: visible; }
    .storybook-page .photo-modal .modal-close { position: sticky; float: right; top: 0; margin-top: -36px; margin-right: -2px; background: #493326; }
    .storybook-page .photo-modal .modal-prev { left: 14px; top: 24dvh; }
    .storybook-page .photo-modal .modal-next { right: 14px; top: 24dvh; }
    .storybook-page .global-upload-bar { top: auto; bottom: 12px; left: 10px; right: 10px; width: auto; max-width: none; }
    .storybook-page:is(.select-mode, .moment-select-mode) .global-upload-bar { bottom: calc(max(8px, env(safe-area-inset-bottom)) + var(--storybook-selection-height, 140px) + 8px); }
}
@media (prefers-reduced-motion: reduce) {
    .storybook-page *, .storybook-page *::before, .storybook-page *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

.storybook-page .timehut-dialog { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; background: #39281cd6; z-index: 10020; padding: 16px; cursor: default; }
.storybook-page .timehut-dialog .modal-card { background: #fffefb; border: 1px solid #e9e3d8; border-radius: 24px; width: min(460px, 100%); padding: 0; max-height: calc(100dvh - 32px); display: flex; flex-direction: column; overflow: hidden; }
.storybook-page .timehut-dialog .dialog-header { display: flex; flex: none; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 20px; border-bottom: 1px solid #e9e3d8; }
.storybook-page .timehut-dialog .dialog-header h3 { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.storybook-page .timehut-dialog .dialog-header .dialog-close { position: static; flex: none; width: 44px; min-height: 44px; }
.storybook-page .timehut-dialog .dialog-body { min-height: 0; padding: 16px 20px; overflow-y: auto; overscroll-behavior: contain; }
.storybook-page .timehut-dialog .modal-card > .modal-actions { flex: none; margin: 0; padding: 12px 20px; border-top: 1px solid #e9e3d8; background: #fffefb; }
.storybook-page .timehut-dialog h3 { color: #493326; margin-bottom: 12px; }
.storybook-page .timehut-dialog p { white-space: pre-line; color: #736d79; margin-bottom: 18px; }
.storybook-page .timehut-dialog label { display: block; color: #493326; }
.storybook-page .timehut-dialog :is(input, select) { display: block; width: 100%; min-height: 44px; border: 1px solid #dddce4; padding: 10px 12px; margin: 8px 0 16px; border-radius: 12px; background: #fff; }
.storybook-page .timehut-dialog [hidden] { display: none; }
.storybook-page .timehut-dialog .modal-actions { display: flex; justify-content: flex-end; gap: 12px; margin-top: 20px; }
.storybook-page .timehut-dialog .btn-primary { background: #ffe589; color: #493326; border: 0; border-radius: 12px; padding: 10px 18px; }
.storybook-page .danger-dialog .btn-primary.btn-danger { background: #ad3e57; color: #fff; }
.storybook-page .danger-dialog h3 { color: #933049; }
.storybook-page #moveCollectionConfirmBtn:disabled { background: #ece8df; color: #71685c; box-shadow: none; cursor: not-allowed; }
.storybook-page .collection-item { width: 100%; font: inherit; text-align: left; line-height: 1.5; }
.storybook-page .collection-text { min-width: 0; display: grid; }
.storybook-page .collection-title { font-weight: 600; }
.storybook-page .collection-age { white-space: nowrap; font-size: .85rem; }
.storybook-page .collection-detail { font-size: .85rem; color: var(--color-text-muted); }
.settings-page #settingsStatus.toast { position: static; transform: none; inset: auto; width: 100%; max-width: none; margin: 16px 0 0; padding: 12px 16px; min-height: 44px; line-height: 1.5; border-radius: 12px; color: #493326; background: #e9efe1; box-shadow: none; animation: none; white-space: normal; }
.settings-page #settingsStatus.toast.error { background: #fff0f2; color: #933049; border: 1px solid #ebc1cb; }
.settings-page #settingsStatus[hidden] { display: none; }
.storybook-page .collection-dialog-art { display: block; height: 80px; width: 100%; object-fit: contain; }

.storybook-page .upload-modal-content > .modal-close { position: sticky; float: right; top: 0; right: auto; margin-left: 10px; width: 44px; height: 44px; border-radius: 12px; background: #f5f0e5; color: #493326; z-index: 3; }
.storybook-page .upload-header { padding-right: 50px; }
.storybook-page .queue-item > div:first-child { gap: 8px; }
.storybook-page .queue-filename { flex: 1; }
.storybook-page .queue-size { white-space: nowrap; font-size: .8rem; }
.storybook-page .moment-grid[data-count="3"] { grid-template-rows: repeat(2, minmax(0, 1fr)); height: 240px; }
.storybook-page .moment-grid[data-count="3"] .moment-photo-container { min-height: 0; aspect-ratio: auto; }

.storybook-page .upload-dropzone { background: #f6faf0 url('../assets/storybook-family.png') left bottom / 200px auto no-repeat; padding: 24px 24px 24px 180px; }
@media (max-width: 768px) {
 .storybook-page .upload-dropzone { background-size: 150px auto; background-position: center bottom; padding: 18px 12px 92px; }
 .storybook-page .queue-item > div:first-child { flex-wrap: wrap; }
 .storybook-page .queue-size { width: auto; }
}

.storybook-page .modal-tags-edit .tags-edit-row { flex-direction: column; gap: 8px; }
.storybook-page .modal-tags-edit .save-tags-btn { width: 100%; }

/* Compact upload sheet: title/actions stay in the sheet while its contents scroll. */
.storybook-page .upload-modal-content { display: flex; flex-direction: column; padding: 0; overflow: hidden; position: relative; }
.storybook-page .upload-modal-content > .modal-close { position: absolute; float: none; right: 12px; top: 12px; margin: 0; }
.storybook-page .upload-header { flex: none; padding: 18px 68px 12px 22px; margin: 0; background: #fff8db; }
.storybook-page .upload-header p { margin-top: 4px; font-size: .85rem; }
.storybook-page .upload-options { padding: 16px 22px; overflow-y: auto; min-height: 0; gap: 12px; }
.storybook-page .upload-dropzone { min-height: 120px; padding: 14px 18px 14px 150px; background-size: 170px auto; }
.storybook-page .dropzone-icon { font-size: 2rem; }
.storybook-page .dropzone-content p { margin: 4px 0; }
.storybook-page .dropzone-hint { display: inline-block; border-radius: 18px; padding: 6px 12px; background: #ffe589; color: #493326; }
.storybook-page .upload-queue { margin: 0; }
.storybook-page .queue-list { max-height: 240px; overflow-y: auto; }
.storybook-page .queue-item { display: grid; grid-template-columns: minmax(0,1fr) minmax(180px,1fr); flex-shrink: 0; min-width: 0; gap: 8px; padding: 8px; }
.storybook-page .queue-item > div:first-child { display: grid !important; grid-template-columns: 56px minmax(0,1fr) 32px; min-width: 0; align-items: center; position: relative; }
.storybook-page .queue-item .queue-size { grid-column: 2; font-size: .7rem; color: #736d79; }
.storybook-page .queue-item .queue-remove { grid-row: 1 / 3; grid-column: 3; min-height: 44px; }
.storybook-page .queue-preview { grid-column: 1; grid-row: 1 / 3; width: 56px; height: 48px; object-fit: cover; border-radius: 8px; }
.storybook-page .queue-filename { font-size: .8rem; }
.storybook-page .queue-item .progress-container:empty, .storybook-page .queue-item .progress-container { display: none; }
.storybook-page .queue-item > div:last-child { display: none; }
.storybook-page .queue-actions { position: sticky; bottom: -16px; background: #fffefb; padding: 12px 0 4px; margin: 0; z-index: 2; }
.storybook-page .upload-tips { flex: none; padding: 8px 22px 14px; border-top: 1px solid #e9e3d8; margin: 0; text-align: left; }
.storybook-page .upload-tips > p:not(.storybook-note), .storybook-page .upload-tips .refresh-btn { display: none; }
.storybook-page .mode-btn.active { border: 2px solid #c49f27; font-weight: 800; box-shadow: none; }
.storybook-page .dialog-art { display: block; width: 100%; height: 130px; object-fit: contain; margin: 4px auto 14px; }
.storybook-page .timehut-dialog .modal-card { position: relative; }
.storybook-page .dialog-close { position: absolute; top: 10px; right: 10px; width: 44px; border: 0; border-radius: 12px; background: #f7f2e8; color: #493326; }
.storybook-page .viewer-decoration { width: 100%; height: 66px; object-fit: contain; opacity: .9; margin: 14px 0 0; }
.storybook-page .viewer-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 14px 0; }
.storybook-page .viewer-tag { padding: 5px 10px; border-radius: 14px; background: #ffe0e7; color: #493326; max-width: 100%; min-width: 0; white-space: normal; overflow-wrap: anywhere; }
.storybook-page .viewer-tags { min-width: 0; max-width: 100%; max-height: 76px; overflow-y: auto; overscroll-behavior: contain; align-content: flex-start; }
.storybook-page .viewer-tags:empty { display: none; }
.storybook-page .viewer-media-status { padding: 10px 12px; margin: 12px 0; border-radius: 12px; background: #ffe1e3; color: #743e40; overflow-wrap: anywhere; }
.storybook-page .viewer-media-status[hidden] { display: none; }
.storybook-page .modal-info { min-width: 0; }
.storybook-page .toast-container { width: min(460px, calc(100vw - 32px)); }
.storybook-page .toast-container.viewer-toast { position: static; inset: auto; transform: none; width: 100%; margin: 0 0 12px; z-index: auto; }
.storybook-page .toast-container.viewer-toast:empty { display: none; }
.storybook-page .toast-container.viewer-toast .toast { border-radius: 12px; box-shadow: none; white-space: normal; overflow-wrap: anywhere; line-height: 1.5; }
.storybook-page .viewer-tag:nth-child(even) { background: #fff0b2; }
.storybook-page .viewer-overview-toggle { width: 100%; margin-top: 14px; }
.storybook-page .photo-modal .viewer-actions { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; width: 100%; margin-top: 12px; }
.storybook-page .photo-modal .viewer-actions > button { min-width: 0; width: 100%; min-height: 48px; margin: 0; padding: 10px 8px; line-height: 1.5; }
.storybook-page .photo-modal .modal-content.viewer-overview-open { display: block; width: min(760px, calc(100vw - 80px)); }
.storybook-page .viewer-overview-open > :not(.viewer-overview):not(.modal-close):not(.modal-page-indicator) { display: none !important; }
.storybook-page .viewer-overview { max-height: calc(90dvh - 76px); overflow-y: auto; overscroll-behavior: contain; color: #fffefb; }
.storybook-page .viewer-overview-header { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-bottom: 14px; padding-right: 48px; }
.storybook-page .viewer-overview-header h3 { margin: 0; color: #fffefb; }
.storybook-page .viewer-filmstrip { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.storybook-page .viewer-overview-photo { position: relative; min-width: 0; padding: 4px; background: #39281c; color: #fffefb; border: 3px solid transparent; border-radius: 12px; text-align: left; }
.storybook-page .viewer-overview-photo[aria-current="true"] { border-color: #ffe589; background: #715217; }
.storybook-page .viewer-overview-photo img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 6px; }
.storybook-page .viewer-overview-caption { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; margin: 6px 3px; line-height: 1.4; font-size: .8rem; }
.storybook-page .viewer-overview-pages { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 12px; margin-top: 16px; }
.storybook-page .viewer-overview-pages p { flex: 1 0 100%; text-align: center; margin: 0; }
.storybook-page .viewer-overview-pages button { border-radius: 12px; padding: 8px 12px; background: #fff3be; color: #493326; }
.storybook-page .viewer-overview-pages button:disabled { opacity: .5; }
@media (max-width: 768px) {
 .storybook-page .photo-modal .modal-content { display: flex; flex-direction: column; align-items: stretch; height: 92dvh; overflow: hidden; }
 .storybook-page .photo-modal .modal-close { position: absolute; float: none; top: 4px; right: 8px; margin: 0; }
 .storybook-page .photo-modal .modal-content.viewer-overview-open { width: calc(100vw - 24px); }
 .storybook-page .viewer-filmstrip { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
 .storybook-page .photo-modal :is(.modal-image,.modal-video) { max-height: 28dvh; flex: 0 0 auto; }
 .storybook-page .photo-modal .modal-info { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; padding: 12px; overflow: hidden; }
 .storybook-page .photo-modal .viewer-details { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
 .storybook-page .photo-modal .modal-info > :not(.viewer-details) { flex-shrink: 0; }
 .storybook-page .photo-modal .modal-info h3 { margin-bottom: 8px; }
 .storybook-page .photo-modal .modal-info p { margin: 4px 0; }
 .storybook-page .photo-modal .viewer-decoration { display: none; }
 .storybook-page .photo-modal :is(.save-tags-btn,.modal-download-btn,.viewer-overview-toggle) { min-height: 48px; }
 .storybook-page .photo-modal .modal-prev,
 .storybook-page .photo-modal .modal-next { top: 18dvh; }
}
@media(max-width:360px) {
 .storybook-page .photo-modal :is(.modal-image,.modal-video) { max-height: 21dvh; }
 .storybook-page .photo-modal .viewer-tags { max-height: 38px; }
 .storybook-page .photo-modal .modal-prev,
 .storybook-page .photo-modal .modal-next { top: 15dvh; }
}
.storybook-page .moment-title { font-size: .95rem; margin: 10px 0 2px; font-weight: 700; color: #493326; overflow-wrap: anywhere; }
.storybook-page .moment-date-box { display: block; }
.storybook-page .moment-full-date { font-size: .85rem; font-weight: 700; white-space: nowrap; }
.storybook-page .transfer-setup { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 20px 0; }
.storybook-page .transfer-task { margin-top: 14px; padding: 20px; background: #fffefb; border: 1px solid #e9e3d8; border-radius: 20px; }
.storybook-page .transfer-task button { margin: 12px 8px 0 0; }
.storybook-page .transfer-empty { padding: 24px; text-align: center; }
.transfer-page .transfer-intro { padding: 16px; }
.storybook-page.transfer-page .settings-header { min-height: 100px; padding-bottom: 12px; margin-bottom: 12px; background-size: 220px auto; }
.transfer-page .transfer-default-tags summary { padding: 8px 0; cursor: pointer; font-weight: 700; }
.transfer-page .transfer-default-tags[open] label { display: block; margin-top: 8px; }
.transfer-page .transfer-intro .dialog-art { float: right; width: 64px; height: 64px; margin: 0 0 8px 12px; }
.transfer-page .transfer-intro p { margin: 0 0 10px; }
.transfer-page .transfer-setup { clear: both; margin: 12px 0; gap: 12px; }
.transfer-page .transfer-task { padding: 12px 16px; margin-top: 10px; }
.transfer-page .transfer-task h3 { margin: 0 0 8px; font-size: 1rem; overflow-wrap: anywhere; }
.transfer-page .transfer-task p { margin: 4px 0; }
.transfer-page .transfer-task button { margin: 6px 8px 0 0; }
.transfer-page .transfer-stage { display: inline-block; padding: 4px 10px; border-radius: 12px; background: #fff0b2; color: #493326; }
.transfer-page .transfer-task[data-stage="failed"] .transfer-stage { background: #ffe0e7; }
.transfer-page .transfer-task[data-stage="completed"] .transfer-stage, .transfer-page .transfer-task[data-stage="saved"] .transfer-stage { background: #e9efe1; }
.transfer-page .transfer-destination { font-weight: 700; }
.transfer-page .transfer-summary { font-weight: 700; margin: 10px 0; }
.transfer-page .transfer-filters { display: flex; flex-wrap: wrap; gap: 8px; }
.transfer-page .transfer-filters [aria-pressed="true"] { background: #fff0b2; border-color: #a86e29; }
.transfer-page .transfer-progress { width: 100%; height: 12px; accent-color: #b48436; }
.storybook-page #iosInstallSteps { list-style: none; padding: 0; display: grid; gap: 12px; }
.storybook-page #iosInstallSteps[hidden] { display: none; }
.storybook-page #iosInstallSteps li { display: flex; align-items: center; gap: 12px; }
.storybook-page .install-step-icon { display: grid; place-items: center; flex: 0 0 44px; height: 44px; border-radius: 14px; background: #fff0b2; font-size: 1.35rem; }
.storybook-page .moment-month, .storybook-page .moment-day { display: none; }
@media(max-width:768px) {
 .storybook-page .transfer-setup { grid-template-columns: 1fr; }
 .storybook-page .upload-header { padding-left: 16px; }
 .storybook-page .upload-options { grid-template-columns: repeat(2,minmax(0,1fr)); padding: 12px 16px; gap: 10px; }
 .storybook-page .upload-dropzone { padding: 12px 10px 12px 95px; min-height: 118px; background-position: left bottom; background-size: 120px auto; }
 .storybook-page .dropzone-icon { font-size: 1.8rem; }
 .storybook-page .dropzone-content p { font-size: .85rem; }
 .storybook-page .dropzone-hint { font-size: .65rem; }
 .storybook-page .upload-field label { font-size: .8rem; }
 .storybook-page .queue-item { grid-template-columns: minmax(0,1fr); }
 .storybook-page .queue-item-tags { padding: 6px 10px; }
 .storybook-page .queue-list { max-height: 185px; }
 .storybook-page .upload-tips { padding: 8px 16px 12px; }
 .storybook-page .storybook-note { font-size: .72rem; margin: 0; }
 .storybook-page .upload-modal-content { max-height: calc(100dvh - 24px); }
}

/* Garden borders are decorative layers; real family media remains untouched. */
.storybook-page .timeline-header { background: #fff8de url('../assets/storybook-garden-v1.png') right bottom / 70% auto no-repeat; padding-bottom: 32px; }
.storybook-page .current-child-age { margin-top: 6px; margin-bottom: 10px; margin-left: 29%; }
.storybook-page .moment-header { flex-direction: column; align-items: flex-start; gap: 3px; }
.storybook-page .moment-info { margin-left: 0; }
.storybook-page .moment-age { white-space: nowrap; }
.storybook-page .age-group-header { display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px 16px; padding: 10px 0; border-bottom: 1px solid #e4dcc3; }
.storybook-page .age-group-summary { font-size: .8rem; color: #736d79; }
.storybook-page .sidebar-decoration { height: 140px; width: 200px; margin-top: auto; object-fit: cover; object-position: right bottom; }
.storybook-page .age-nav-content { position: relative; padding-left: 10px; border-left: 2px solid #e9d790; }
.storybook-page .album-page-content { max-width: 1360px; width: 100%; }
.storybook-page .album-header { text-align: left; padding-bottom: 60px; background: #fffdf4 url('../assets/storybook-garden-v1.png') right bottom / 55% auto no-repeat; }
.storybook-page .album-grid { max-width: none; width: 100%; grid-template-columns: repeat(4,minmax(0,1fr)); }
.storybook-page .album-photo-card { aspect-ratio: 4 / 3; }
.storybook-page .upload-dropzone { background-image: url('../assets/storybook-upload-v1.png'); background-size: 145px auto; background-position: 10px bottom; }
.storybook-page .tagging-mode-field { grid-column: 1 / -1; }
.storybook-page .mode-btn { white-space: nowrap; background: #f5f1e8; color: #736d79; border: 2px solid transparent; }
.storybook-page .mode-btn.active { background: #ffe589; color: #493326; border-color: #c49f27; }
.storybook-page .dialog-art { height: 160px; }
.storybook-page .timehut-dialog .modal-actions > button { flex: 1; }
.storybook-page .settings-header { padding-bottom: 24px; background: url('../assets/storybook-garden-v1.png') right bottom / 55% auto no-repeat; }
@media(max-width:1024px) { .storybook-page .album-grid { grid-template-columns: repeat(3,minmax(0,1fr)); } }
@media(max-width:768px) {
 .storybook-page .current-child-age { margin-left: 35%; }
 .storybook-page .album-header { padding-bottom: 42px; background-size: 75% auto; }
 .storybook-page .album-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
 .storybook-page .upload-dropzone { background-size: 100px auto; background-position: 0 bottom; }
 .storybook-page .tagging-mode-toggle { width: 100%; }
 .storybook-page .child-card { grid-template-columns: 115px minmax(0,1fr); }
 .storybook-page .child-emoji img { width: 115px; height: 140px; }
 .storybook-page .settings-header { background-size: 65% auto; }
}

/* Stable selection tools and reserved text space, reviewed against all states. */
.storybook-page .selection-bar,.storybook-page .moment-selection-bar { position: sticky; top: var(--storybook-header-height,80px); height: auto; min-height: 68px; color: #493326; z-index: 98; margin: 8px 16px; }
.storybook-page .selection-info { color: #493326; }
.storybook-page .select-checkbox { width: 44px; height: 44px; min-height: 44px; border-radius: 50%; }
.storybook-page .timeline-header { background: #e6f3ff; min-height: 190px; }
.storybook-page .timeline-header::before { content: ''; position: absolute; right: 8px; bottom: 8px; width: 27%; height: 115px; background: url('../assets/storybook-garden-v1.png') right bottom / auto 100% no-repeat; pointer-events: none; }
.storybook-page .timeline-header > * { max-width: 43%; }
.storybook-page .timeline-hint { font-size: .8rem; }
.storybook-page .upload-dropzone { min-height: 145px; flex-shrink: 0; }
.storybook-page .dropzone-content { gap: 4px; }
.storybook-page .dropzone-content p { line-height: 1.5; }
.storybook-page .dropzone-hint { line-height: 1.5; padding: 6px 10px; font-size: .8rem; }
.storybook-page .settings-header { min-height: 150px; background-size: 360px auto; background-position: right bottom; }
@media(max-width:768px) {
 .storybook-page .selection-bar,.storybook-page .moment-selection-bar { position: fixed; top: auto; min-height: 0; margin: 0; bottom: max(8px,env(safe-area-inset-bottom)); height: auto; animation: none; }
 .storybook-page .timeline-header::before { width: 18%; height: 65px; opacity: .7; }
 .storybook-page .timeline-header > * { max-width: 63%; }
 .storybook-page .timeline-hint { max-width: 47%; }
 .storybook-page .upload-dropzone { min-height: 130px; padding-right: 6px; }
 .storybook-page .dropzone-hint { font-size: .72rem; }
 .storybook-page .settings-header { min-height: 150px; background-size: 300px auto; }
}
.storybook-page.select-mode .main-content,.storybook-page.moment-select-mode .main-content { margin-top: 0; }
.storybook-page.select-mode :is(.sidebar-left,.sidebar-right),.storybook-page.moment-select-mode :is(.sidebar-left,.sidebar-right) { top: calc(var(--storybook-header-height,80px) + var(--storybook-selection-height,68px) + 16px); }
@media(max-width:768px) { .storybook-page.select-mode .timeline-section,.storybook-page.moment-select-mode .timeline-section,.storybook-page.select-mode .album-page-content { padding-bottom: calc(32px + max(140px,var(--storybook-selection-height,140px))); } }

.storybook-page .install-actions { display: flex; flex-wrap: wrap; margin-top: 16px; gap: 12px; }
.storybook-page .install-actions a { display: inline-flex; align-items: center; min-height: 44px; }

/* Installation guide: separate browser/native availability and platform instructions. */
.install-page [hidden] { display: none !important; }
.install-page .install-symbols { position: absolute; width: 0; height: 0; overflow: hidden; }
.storybook-page.install-page .settings-container { max-width: 1240px; margin: 24px auto; }
.storybook-page.install-page .settings-header { min-height: 120px; margin-bottom: 24px; padding-bottom: 14px; background-size: 240px auto; }
.install-page .settings-header p { margin: 8px 0 0; color: #66564a; }
.install-page .install-layout { display: grid; grid-template-columns: 160px minmax(0,1fr); gap: 24px; }
.install-page .install-navigation { display: flex; flex-direction: column; align-items: stretch; gap: 10px; }
.install-page .install-navigation a { display: block; border: 1px solid #e4d9bc; border-radius: 12px; padding: 12px 14px; background: #fffef9; color: #493326; text-decoration: none; font-weight: 600; }
.install-page .install-navigation [aria-current] { background: #fff0b2; }
.install-page .install-app-options { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.install-page .settings-section { margin: 0 0 20px; padding: 20px; min-width: 0; }
.install-page .install-native-card { background: #edf3e6; }
.install-page .install-card-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.install-page .install-card-title > svg { width: 42px; height: 42px; flex: 0 0 42px; color: #49606c; }
.install-page .install-card-title h2 { margin: 0; font-size: 1.3rem; }
.install-page .install-option-label { font-size: .75rem; color: #66564a; }
.install-page .install-badge { margin-left: auto; border-radius: 20px; padding: 4px 10px; background: #fff0b2; color: #493326; font-size: .8rem; white-space: nowrap; }
.install-page .install-native-card .install-badge { background: #f8f7ef; }
.install-page .install-status { padding: 12px; background: #fff8e0; border: 1px solid #e9dab8; border-radius: 12px; }
.install-page .install-app-options p { line-height: 1.6; margin: 12px 0; }
.install-page .install-build { color: #66564a; font-size: .85rem; }
.install-page #androidDownload { display: inline-flex; justify-content: center; align-items: center; min-height: 48px; max-width: 100%; padding: 12px 18px; box-sizing: border-box; text-align: center; text-decoration: none; }
.install-page .install-apk-steps { padding-left: 22px; line-height: 1.7; font-size: .9rem; }
.install-page .install-apk-steps li + li { margin-top: 8px; }
.install-page .install-guide-heading { display: flex; align-items: center; flex-wrap: wrap; justify-content: space-between; gap: 12px; }
.install-page .install-guide-heading h2 { margin: 0; font-size: 1.2rem; }
.install-page .install-platforms { display: flex; flex-wrap: wrap; gap: 8px; }
.install-page .install-platforms button { border: 1px solid #d9cba9; background: #fffef9; color: #493326; border-radius: 12px; min-height: 44px; padding: 10px 14px; cursor: pointer; font: inherit; font-size: .9rem; }
.install-page .install-platforms [aria-pressed="true"] { background: #fff0b2; border-color: #997239; font-weight: 700; }
.storybook-page.install-page .install-steps { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); list-style: none; padding: 0; gap: 12px; margin: 20px 0; }
.storybook-page.install-page .install-steps li { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; background: #fffbef; border: 1px solid #e9dfc7; border-radius: 16px; padding: 16px; min-width: 0; }
.install-page .install-step-icon { width: 48px; height: 48px; flex-basis: 48px; background: #e9f0de; color: #49606c; }
.install-page .install-step-icon svg { width: 34px; height: 34px; }
.install-page .install-steps h3 { font-size: 1rem; margin: 0 0 8px; line-height: 1.5; }
.install-page .install-steps p { font-size: .9rem; margin: 0; line-height: 1.7; }
.install-page .install-switch-example { display: inline-flex; align-items: center; gap: 7px; font-size: .75rem; margin-top: 12px; color: #556446; }
.install-page .install-switch-example i { display: inline-block; width: 32px; height: 19px; border-radius: 14px; background: #6f905f; position: relative; }
.install-page .install-switch-example i::after { content: ''; position: absolute; height: 15px; width: 15px; border-radius: 50%; top: 2px; right: 2px; background: #fff; }
.install-page .install-open-check { background: #edf4e5; padding: 12px; border-radius: 12px; font-weight: 600; line-height: 1.6; }
.install-page .install-help { margin-top: 18px; font-size: .85rem; color: #66564a; }
.install-page .install-help summary { min-height: 44px; display: list-item; padding: 10px 0; cursor: pointer; }
.install-page .install-help a { color: #375b7b; text-decoration: underline; }
.install-page .install-closing { display: flex; align-items: center; gap: 15px; color: #66564a; }
.install-page .install-closing img { width: 76px; height: 76px; object-fit: contain; }
.install-page button:focus-visible, .install-page a:focus-visible, .install-page summary:focus-visible { outline: 3px solid #426891; outline-offset: 3px; }
@media(max-width:900px) {
 .install-page .install-layout { grid-template-columns: 1fr; gap: 16px; }
 .install-page .install-navigation { flex-direction: row; flex-wrap: wrap; gap: 8px; }
 .install-page .install-navigation a { padding: 10px 12px; font-size: .85rem; }
}
@media(max-width:600px) {
 .storybook-page.install-page .settings-container { margin: 12px auto; padding: 14px; }
 .storybook-page.install-page .settings-header { background-size: 130px auto; min-height: 108px; padding-bottom: 58px; margin-bottom: 16px; }
 .install-page .settings-header h1 { font-size: 1.6rem; }
 .install-page .settings-header p { font-size: .85rem; max-width: 240px; }
 .install-page .install-app-options { grid-template-columns: 1fr; gap: 0; }
 .install-page .settings-section { padding: 16px; margin-bottom: 16px; }
 .storybook-page.install-page .install-steps { grid-template-columns: 1fr; }
 .storybook-page.install-page .install-steps li { flex-direction: row; align-items: flex-start; padding: 14px; gap: 12px; }
 .install-page .install-card-title { gap: 8px; }
 .install-page .install-badge { font-size: .75rem; padding: 4px 8px; }
 .install-page .install-closing { font-size: .85rem; }
}

/* Transfer previews are local derived media; completion/status/action semantics stay independent. */
.storybook-page.transfer-page .transfer-task-overview { display: grid; grid-template-columns: 64px minmax(0,1fr); gap: 12px; align-items: start; }
.storybook-page.transfer-page .transfer-task-meta { min-width: 0; }
.storybook-page.transfer-page .transfer-task-meta h3 { overflow-wrap: anywhere; }
.storybook-page.transfer-page .transfer-thumbnail { width: 64px; height: 64px; border-radius: 10px; background: #eef1e8; color: #536657; border: 1px solid #dce4d1; position: relative; overflow: hidden; display: flex; align-items: center; justify-content: center; }
.storybook-page.transfer-page .transfer-thumbnail-symbol { width: 28px; height: 28px; margin-bottom: 9px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.storybook-page.transfer-page .transfer-thumbnail img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; opacity: 0; }
.storybook-page.transfer-page .transfer-thumbnail[data-preview-state="ready"] img { opacity: 1; }
.storybook-page.transfer-page .transfer-thumbnail-kind { position: absolute; bottom: 0; right: 0; left: 0; background: #fffcf0e8; color: #493326; font-size: 11px; text-align: center; line-height: 17px; }
@media(max-width:768px) {
 .storybook-page.transfer-page .transfer-task-overview { grid-template-columns: 56px minmax(0,1fr); gap: 10px; }
 .storybook-page.transfer-page .transfer-thumbnail { width: 56px; height: 56px; }
}

/* Completion preferences share the optional settings disclosure to keep primary transfer actions in view. */
@media (max-width: 430px) {
 .settings-page .child-emoji { grid-row: 1; }
 .settings-page .child-birthdate { grid-column: 1 / -1; }
}
.transfer-page .transfer-notification-settings { margin-top: 12px; border-top: 1px solid #e8ddc9; padding-top: 8px; }
.transfer-page .transfer-default-tags[open] label.transfer-notification-option { display:flex; align-items:center; gap:10px; min-height:44px; cursor:pointer; }
.transfer-page .transfer-notification-option input { flex:0 0 auto; width:20px; height:20px; accent-color:#ac7623; margin:0; }
.transfer-page #notificationStatus { margin:4px 0 0; line-height:1.6; }
/* Account album names can contain long filenames or unbroken text. */
.storybook-page #currentChildName { overflow-wrap: anywhere; word-break: normal; }

/* Six-board acceptance layout. Keep decoration clear of controls and media. */
.storybook-page .profile-btn { display: grid; grid-template-columns: 52px minmax(0,1fr); width: 100%; min-height: 78px; text-align: left; }
.storybook-page .profile-label { min-width: 0; overflow-wrap: anywhere; }
.storybook-page .profile-age { display: block; font-size: .68rem; font-weight: 400; margin-top: 4px; line-height: 1.5; }
.storybook-page .timeline-section { padding: 18px 22px 90px; }
.storybook-page .timeline-header { min-height: 152px; margin-bottom: 12px; padding: 20px 24px; background: #e4f4fd url('../assets/storybook-garden-v1.png') right bottom / auto 72px no-repeat; }
.storybook-page .timeline-header::after { width: 28%; height: calc(100% - 8px); bottom: 0; }
.storybook-page .timeline-header::before { display: none; }
.storybook-page .timeline-header > * { margin-left: 29%; max-width: 65%; }
.storybook-page .timeline-eyebrow { margin-bottom: 2px; }
.storybook-page .current-child-name { display: inline; font-size: 2rem; }
.storybook-page .current-child-age { display: inline; margin: 0 0 0 12px; font-weight: 600; }
.storybook-page .timeline-hint { margin-top: 10px; }
.timeline-page .transfer-entry-panel { padding: 0 12px; margin-bottom: 10px; }
.timeline-page .transfer-entry-link { min-height: 44px; padding: 4px 0; }
.timeline-page .transfer-entry-panel > summary { cursor: pointer; }
.timeline-page .transfer-entry-panel > summary .transfer-entry-link { display: inline-flex; width: calc(100% - 24px); vertical-align: middle; }
.timeline-page #transferQueueDetail { padding: 0 0 8px; font-size: .72rem; }
.storybook-page .moment-header { margin-bottom: 6px; }
.storybook-page .moment-grid { height: 176px; }
.storybook-page .moment-grid[data-count="3"] { height: 176px; }
.storybook-page .moment-photo-container { min-height: 0; height: auto; }
.storybook-page .age-nav-content { border: 0; padding-left: 0; }
.storybook-page .age-list { position: relative; }
.storybook-page .age-list::before { content: ''; position: absolute; left: 16px; top: 20px; bottom: 20px; width: 2px; background: #dcd9cb; }
.storybook-page .age-item { position: relative; padding-left: 30px; }
.storybook-page .age-dot { position: absolute; left: 9px; width: 14px; height: 14px; border-radius: 50%; border: 2px solid #878394; background: #fffefb; }
.storybook-page .age-item.active .age-dot { border-color: #b68b20; background: #ffe589; box-shadow: 0 0 0 4px #ffedab; }
.storybook-page .album-header { grid-template-columns: minmax(210px,28%) minmax(0,1fr); min-height: 0; padding: 18px; margin-bottom: 16px; background-size: 43% auto; }
.storybook-page .album-cover { height: 205px; }
.storybook-page .album-heading-copy { padding-bottom: 38px; }
.storybook-page .album-header h2 { font-size: 2rem; }
.storybook-page .album-header p { font-size: 1rem; }
.storybook-page .album-page-content + .selection-bar { position: fixed; top: auto; bottom: 12px; }
.storybook-page.album-detail-page .selection-bar { position: fixed; top: auto; bottom: 12px; left: 24px; right: 24px; margin: 0; }
.storybook-page .select-checkbox { border-radius: 7px; width: 28px; height: 28px; min-height: 0; font-size: 1rem; }
.storybook-page .photo-select-overlay { min-width: 44px; min-height: 44px; }
.storybook-page .album-photo-card.selected { border-color: #5d9bc6; }
.storybook-page .album-photo-card.selected .select-checkbox { background: #198ee5; border-color: #198ee5; color: white; }

/* Management uses the loaded photos as a compact grid; no hidden collage cells. */
.storybook-page:is(.select-mode,.moment-select-mode) .timeline-header { min-height: 0; padding: 12px 18px; background: #f1f7e8; }
.storybook-page:is(.select-mode,.moment-select-mode) .timeline-header::after { display: none; }
.storybook-page:is(.select-mode,.moment-select-mode) .timeline-header > * { margin-left: 0; max-width: 100%; }
.storybook-page:is(.select-mode,.moment-select-mode) .timeline-header .timeline-hint { display: none; }
.storybook-page:is(.select-mode,.moment-select-mode) .current-child-name { font-size: 1.3rem; }
.storybook-page:is(.select-mode,.moment-select-mode) .current-child-age { font-size: .85rem; margin-left: 10px; }
.storybook-page:is(.select-mode,.moment-select-mode) .transfer-entry-panel { margin-top: 8px; }
.storybook-page.select-mode .timeline-container { grid-template-columns: repeat(6,minmax(0,1fr)); gap: 12px; }
.storybook-page.select-mode :is(.moment-item,.moment-content-box,.moment-grid) { display: contents; }
.storybook-page.select-mode :is(.moment-header,.moment-footer,.moment-title,.moment-tags) { display: none; }
.storybook-page.select-mode .moment-photo-container { position: relative; display: block; grid-column: auto !important; grid-row: auto !important; width: auto; aspect-ratio: 1 !important; border: 2px solid #e7e2d7; border-radius: 12px; overflow: hidden; }
.storybook-page.select-mode .moment-photo-container.selected { border-color: #e7bd47; outline: 2px solid #ffe589; outline-offset: 1px; }
.storybook-page.select-mode .moment-photo { width: 100%; height: 100%; object-fit: cover; }
.storybook-page .timeline-photo-select { left: 0; top: 0; right: auto; width: 44px; height: 44px; border: 0; border-radius: 0 0 12px; background: #fffefbe8; font-size: 1.15rem; }
.storybook-page.moment-select-mode .timeline-container { grid-template-columns: repeat(5,minmax(0,1fr)); }
.storybook-page.moment-select-mode .moment-item { padding: 8px; }
.storybook-page.moment-select-mode .moment-item::before { width: 24px; height: 24px; top: 8px; left: 8px; border-radius: 6px; background: white; border-color: #d1c8b3; }
.storybook-page.moment-select-mode .moment-item.selected { border-color: #e0b347; background: #fffdf1; outline: 2px solid #ffe589; outline-offset: 1px; }
.storybook-page.moment-select-mode .moment-item.selected::before { color: #493326; background: #ffe589; border-color: #c9a33e; }
.storybook-page.moment-select-mode .moment-header { padding-left: 30px; min-height: 44px; }
.storybook-page.moment-select-mode .moment-grid { height: 130px; }
.storybook-page.moment-select-mode :is(.moment-actions,.moment-tags,.moment-album-link) { display: none; }
.storybook-page .settings-story-side { display: none; }
.storybook-page.settings-page .settings-container { position: relative; max-width: 1250px; padding: 22px 26px 40px 220px; }
.storybook-page.settings-page .settings-story-side { display: flex; position: absolute; left: 14px; top: 30px; width: 180px; height: 660px; flex-direction: column; gap: 16px; align-items: stretch; }
.settings-story-brand { color: #493326; font-size: 1.3rem; font-weight: 800; text-decoration: none; }
.settings-story-side .btn-secondary { text-decoration: none; text-align: center; }
.settings-story-side img { width: 100%; margin-top: auto; }
.settings-story-side p { font-size: .85rem; line-height: 1.9; }
.storybook-page.settings-page .settings-header { min-height: 110px; padding-bottom: 10px; background-size: 240px auto; }
.storybook-page.settings-page .child-card { grid-template-columns: 135px minmax(0,1fr); gap: 8px 12px; padding: 14px; }
.storybook-page.settings-page .child-emoji { grid-column: 1; grid-row: 1 / 3; align-self: center; }
.storybook-page.settings-page .child-emoji img { width: 135px; height: 170px; }
.storybook-page.settings-page .child-info { align-self: end; }
.storybook-page.settings-page .child-birthdate { grid-column: 2; min-width: 0; }
.storybook-page.settings-page .save-btn { margin: 16px auto; }
.settings-story-closing { display: flex; align-items: center; justify-content: center; gap: 20px; margin: 10px 0 26px; }
.settings-story-closing img { width: 180px; height: 105px; object-fit: contain; }
.settings-story-closing p { line-height: 1.8; font-size: .85rem; }
.storybook-page .upload-header { position: relative; padding: 16px 72px 14px 22px; background: #fffdf6; }
.storybook-page .upload-header::after { content: ''; position: absolute; right: 70px; bottom: 0; width: 100px; height: 70px; background: url('../assets/storybook-upload-v1.png') bottom / contain no-repeat; pointer-events: none; }
.storybook-page .upload-header h2 { position: relative; z-index: 1; max-width: 70%; }
.storybook-page .upload-dropzone { min-height: 155px; border-radius: 14px; background: #fbfdf7 url('../assets/storybook-upload-v1.png') left bottom / 220px auto no-repeat; padding-left: 210px; }
.storybook-page .upload-options { grid-template-columns: repeat(4,minmax(0,1fr)); }
.storybook-page .tagging-mode-field { grid-column: auto; }
.storybook-page .queue-list { max-height: 250px; }
.storybook-page .queue-item { position: relative; grid-template-columns: minmax(0,1fr) minmax(160px,1fr); min-height: 76px; padding: 8px; }
.storybook-page .queue-item .video-warning { grid-column: 1 / -1; }
.storybook-page .queue-item.uploading .progress-container { display: block; grid-column: 1 / -1; }
.storybook-page .queue-item.uploading > div:last-child { display: block; grid-column: 1 / -1; }
.storybook-page .upload-tips { background: #f1f7e7; }
.storybook-page #nativeBackgroundUploadLink { display: inline-flex; align-items: center; text-decoration: none; min-height: 44px; margin-bottom: 8px; font-weight: 700; }
.storybook-page .dialog-album-options { display: grid; gap: 8px; max-height: 270px; overflow-y: auto; }
.storybook-page .timehut-dialog .dialog-album-option { display: grid; grid-template-columns: 24px 58px minmax(0,1fr); gap: 12px; align-items: center; min-height: 70px; padding: 8px 12px; margin: 0; border: 1px solid #e9e3d8; border-radius: 12px; cursor: pointer; }
.storybook-page .dialog-album-option:has(input:checked) { background: #fff7d7; border-color: #d3a634; }
.storybook-page .dialog-album-option input { width: 22px; min-height: 22px; height: 22px; margin: 0; padding: 0; accent-color: #a8780c; }
.storybook-page .dialog-album-option img { width: 58px; height: 54px; object-fit: contain; border-radius: 10px; background: #e9f5fc; }
.storybook-page .dialog-album-option span { min-width: 0; overflow-wrap: anywhere; }
.storybook-page .confirm-story-art { width: 100%; height: 140px; object-fit: contain; margin-bottom: 14px; }
.storybook-page .confirm-card { border: 1px solid #e9e3d8; background: #fffefb; border-radius: 22px; }
.storybook-page:is(.select-mode,.moment-select-mode) .toast-container:not(.viewer-toast) { bottom: calc(var(--storybook-selection-height,140px) + 24px); }
@media(min-width:769px) {
 .storybook-page .album-header ~ .selection-bar { position: fixed; top: auto; bottom: 12px; }
 .storybook-page .album-page-content { padding-bottom: 120px; }
}
@media(max-width:1100px) and (min-width:769px) {
 .storybook-page.settings-page .settings-container { padding-left: 26px; }
 .storybook-page.settings-page .settings-story-side { display: none; }
 .storybook-page.settings-page .child-card { grid-template-columns: 110px minmax(0,1fr); }
 .storybook-page.settings-page .child-emoji img { width: 110px; }
 .storybook-page.moment-select-mode .timeline-container { grid-template-columns: repeat(4,minmax(0,1fr)); }
}
@media(max-width:768px) {
 .storybook-page .timeline-section { margin: 0; padding: 12px 12px 110px; }
 .storybook-page .timeline-header { min-height: 126px; padding: 16px 12px; border-radius: 16px; margin-bottom: 8px; background-size: auto 32px; }
 .storybook-page .timeline-header::after { left: 0; width: 38%; }
 .storybook-page .timeline-header > * { margin-left: 39%; max-width: 61%; }
 .storybook-page .timeline-eyebrow { font-size: .65rem; }
 .storybook-page .current-child-name { display: block; font-size: 1.45rem; }
 .storybook-page .current-child-age { display: block; margin: 2px 0 4px 39%; font-size: .8rem; }
 .storybook-page .timeline-hint { font-size: .7rem; margin-top: 0; }
 .timeline-page .transfer-entry-panel { margin-bottom: 8px; }
 .timeline-page #transferQueueDetail { font-size: .65rem; line-height: 1.5; }
 .storybook-page .moment-grid,.storybook-page .moment-grid[data-count="3"] { height: 220px; }
 .storybook-page .album-header { grid-template-columns: 115px minmax(0,1fr); padding: 12px 12px 34px; gap: 12px; background-size: auto 30px; }
 .storybook-page .album-cover { height: 145px; }
 .storybook-page .album-header h2 { font-size: 1.35rem; }
 .storybook-page .album-header p { font-size: .8rem; line-height: 1.65; }
 .storybook-page .album-heading-copy { padding-bottom: 12px; }
 .storybook-page .album-grid { gap: 8px; }
 .storybook-page.album-detail-page .selection-bar { left: 8px; right: 8px; bottom: max(8px,env(safe-area-inset-bottom)); }
 .storybook-page.select-mode .timeline-container { grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; }
 .storybook-page.moment-select-mode .timeline-container { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
 .storybook-page.moment-select-mode .moment-grid { height: 115px; }
 .storybook-page.moment-select-mode .moment-full-date { font-size: .7rem; white-space: normal; }
 .storybook-page.moment-select-mode .moment-age { font-size: .65rem; }
 .storybook-page:is(.select-mode,.moment-select-mode) .timeline-header > * { margin-left: 0; }
 .storybook-page:is(.select-mode,.moment-select-mode) .timeline-header { padding: 8px 12px; }
 .storybook-page:is(.select-mode,.moment-select-mode) .transfer-entry-panel { display: none; }
 .storybook-page:is(.select-mode,.moment-select-mode) .current-child-age { display: inline; }
 .storybook-page.settings-page .settings-container { padding: 14px 12px; }
 .storybook-page.settings-page .settings-story-side { display: none; }
 .storybook-page.settings-page .settings-header { min-height: 76px; margin-bottom: 12px; background-size: 150px auto; }
 .storybook-page.settings-page .settings-section { padding: 12px; }
 .storybook-page.settings-page .section-title { margin: -12px -12px 12px; padding: 14px 12px; font-size: 1.1rem; }
 .storybook-page.settings-page #childrenList { gap: 12px; }
 .storybook-page.settings-page .child-card { grid-template-columns: 100px minmax(0,1fr); padding: 10px; gap: 6px 12px; }
 .storybook-page.settings-page .child-emoji img { width: 100px; height: 136px; }
 .storybook-page.settings-page .child-name { font-size: 1.2rem; }
 .storybook-page.settings-page .child-age { font-size: .7rem; }
 .storybook-page.settings-page .birthdate-input { padding: 8px 6px; font-size: .85rem; }
 .storybook-page.settings-page .save-btn { margin: 14px 0; }
 .settings-story-closing { gap: 12px; }
 .settings-story-closing img { width: 110px; height: 90px; }
 .storybook-page .upload-header { padding: 14px 62px 12px 16px; }
 .storybook-page .upload-header::after { right: 62px; width: 75px; height: 60px; opacity: .75; }
 .storybook-page .upload-header h2 { font-size: 1.25rem; }
 .storybook-page .upload-header p { max-width: 68%; font-size: .72rem; }
 .storybook-page .upload-options { grid-template-columns: 1fr; gap: 10px; padding: 12px; }
 .storybook-page .tagging-mode-field { grid-column: 1 / -1; }
 .storybook-page .upload-dropzone { padding: 12px 6px 12px 120px; min-height: 132px; background-size: 155px auto; background-position: -8px bottom; }
 .storybook-page .dropzone-hint { font-size: .65rem; }
 .storybook-page .queue-item { grid-template-columns: minmax(0,1fr) minmax(100px,42%); gap: 6px; padding: 8px 44px 8px 6px; min-height: 68px; }
 .storybook-page .queue-item > div:first-child { position: static; grid-template-columns: 38px minmax(0,1fr); padding-right: 0; gap: 3px 5px; }
 .storybook-page .queue-preview { width: 38px; height: 44px; }
 .storybook-page .queue-filename { font-size: .7rem; padding-right: 8px; }
 .storybook-page .queue-item .queue-remove { position: absolute; right: 0; top: 12px; width: 44px; height: 44px; grid-column: auto; grid-row: auto; }
 .storybook-page .queue-item .queue-size { grid-column: 2; font-size: .65rem; }
 .storybook-page .queue-item-tags { align-self: center; margin-top: 0; font-size: .7rem; min-width: 0; }
 .storybook-page .queue-list { max-height: 220px; }
 .storybook-page .upload-tips { padding: 8px 12px; }
}
@media(max-width:360px) {
 .storybook-page.settings-page .child-card { grid-template-columns: 74px minmax(0,1fr); gap: 6px 8px; }
 .storybook-page.settings-page .child-emoji img { width: 74px; height: 118px; }
 .storybook-page.settings-page .child-age { padding: 4px; }
}

/* Album removal lives beside its name; recovery stays visible in settings. */
.storybook-page .album-remove { margin-top:8px; min-height:44px; color:#8b3b32; font-size:.9rem; }
.storybook-page .album-restore-row { display:flex; gap:12px; align-items:center; justify-content:space-between; flex-wrap:wrap; padding:12px 0; border-bottom:1px solid #dccfb5; }
.storybook-page #deleted-albums { margin:20px 0; }
.storybook-page #deleted-albums summary { cursor:pointer; font-weight:700; min-height:44px; }
.storybook-page .album-menu summary { cursor:pointer; padding:8px 0; min-height:44px; font-size:.9rem; }
.storybook-page .album-menu button { display:block; margin:6px 0; min-height:44px; }
.storybook-page .feedback-section { margin:24px auto; }
.storybook-page .feedback-section form { display:grid; grid-template-columns:minmax(0,1fr); min-width:0; gap:14px; }
.storybook-page .feedback-section label { display:grid; grid-template-columns:minmax(0,1fr); min-width:0; gap:8px; }
.storybook-page .feedback-section textarea { width:100%; min-width:0; min-height:120px; border:1px solid #ccb994; border-radius:12px; padding:12px; font:inherit; background:#fffdf5; color:#493326; resize:vertical; }
.storybook-page .feedback-section input[type=file] { width:100%; min-width:0; max-width:100%; min-height:44px; }
.storybook-page #feedback-preview,.storybook-page .feedback-saved-image { display:block; max-width:100%; max-height:380px; object-fit:contain; border-radius:12px; }
.storybook-page #feedback-preview[hidden] { display:none; }
.storybook-page .feedback-actions { display:flex; gap:10px; flex-wrap:wrap; }
.storybook-page .feedback-report,.storybook-page .feedback-notification { padding:16px 0; border-bottom:1px solid #dccfb5; overflow-wrap:anywhere; }
.storybook-page .feedback-report button,.storybook-page .feedback-notification button,.storybook-page .feedback-notification a { margin:6px 8px 6px 0; min-height:44px; }
.storybook-page .feedback-section details summary { min-height:44px; padding:10px 0; cursor:pointer; font-weight:700; }
.storybook-page .feedback-notification-toggle { display:flex!important; align-items:center; gap:10px; min-height:44px; }

/* Formal06 density candidate: keep controls reachable in narrow upload sheets. */
@media(max-width:760px) {
 .storybook-page .upload-modal-content { max-height:calc(100dvh - 24px); }
 .storybook-page .upload-header { padding:12px 68px 10px 12px; min-height:64px; }
 .storybook-page .upload-header::after { display:none; }
 .storybook-page .upload-header h2 { max-width:none; font-size:20px; line-height:1.3; }
 .storybook-page .upload-header p { max-width:none; font-size:12px; line-height:1.5; }
 .storybook-page .upload-modal-content > .modal-close { width:48px; height:48px; border-radius:12px; top:8px; right:8px; }
 .storybook-page .upload-options { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); align-items:start; gap:10px 12px; padding:12px; }
 .storybook-page .upload-dropzone { grid-column:1/-1; min-height:88px; padding:10px 8px 10px 88px; background-size:96px auto; background-position:0 bottom; }
 .storybook-page .dropzone-icon { display:none; }
 .storybook-page .dropzone-content p { font-size:14px; line-height:1.5; margin:0 0 4px; }
 .storybook-page .dropzone-hint { font-size:12px; line-height:1.5; padding:4px 8px; }
 .storybook-page .upload-field { min-width:0; }
 .storybook-page .upload-field > label { font-size:13px; line-height:1.5; margin:0 0 6px; }
 .storybook-page :is(.upload-input,.upload-select,.queue-item-tags) { min-height:48px; border-radius:12px; padding:10px 12px; font-size:16px; line-height:normal; }
 .storybook-page .uploader-display { min-height:48px; padding:10px 12px; font-size:16px; line-height:normal; border-radius:12px; }
 .storybook-page #batchTagsField { grid-column:1/-1; }
 .storybook-page .tagging-mode-field { display:grid; grid-template-columns:76px minmax(0,1fr); align-items:center; gap:4px 8px; }
 .storybook-page .tagging-mode-field > label { margin:0; }
 .storybook-page .tagging-mode-toggle { margin:0; }
 .storybook-page .tagging-mode-toggle .mode-btn { min-height:48px; padding:8px; font-size:16px; line-height:normal; border-radius:12px; }
 .storybook-page .mode-hint { grid-column:1/-1; margin:0; font-size:12px; line-height:1.5; }
 .storybook-page .upload-queue { grid-column:1/-1; padding:10px; }
 .storybook-page .upload-queue h4 { margin:0 0 8px; font-size:14px; line-height:1.5; }
 .storybook-page .queue-list { max-height:220px; }
 .storybook-page .queue-item { grid-template-columns:minmax(0,1fr); min-height:72px; padding:8px 44px 8px 6px; }
 .storybook-page .queue-filename { font-size:13px; }
 .storybook-page .queue-item .queue-remove { top:10px; height:48px; width:44px; }
 .storybook-page .queue-actions { gap:10px; padding:10px 0 0; bottom:-12px; }
 .storybook-page .queue-actions button { min-height:48px; padding:10px 12px; font-size:16px; line-height:normal; border-radius:12px; }
 .storybook-page .upload-tips { padding:8px 12px; }
 .storybook-page .upload-tips .storybook-note { font-size:12px; line-height:1.5; }
}

@media(max-width:760px) {
 .storybook-page .upload-modal-content > .modal-close { position:absolute!important; top:8px; right:8px; }
 .storybook-page .upload-field > label { font-size:16px; line-height:normal; }
 .storybook-page .mode-hint,.storybook-page .upload-tips .storybook-note { font-size:13px; line-height:normal; }
 .storybook-page .uploader-name { min-width:0; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
}
@media(max-width:360px) { .storybook-page .uploader-icon { display:none; } }

/* Intrinsic rows must grow with WebView text zoom instead of overlapping. */
.storybook-page .upload-sheet-scroll { display:contents; }
@media(max-width:760px) {
 .storybook-page .upload-options { grid-auto-rows:max-content; align-content:start; }
 .storybook-page .dropzone-content { min-width:0; overflow-wrap:anywhere; }
 .storybook-page .dropzone-content > :is(p,.dropzone-hint) { max-width:100%; }
}
@media(max-width:760px) and (max-height:700px) {
 .storybook-page .upload-sheet-scroll { display:block; min-height:0; overflow-y:auto; overscroll-behavior:contain; }
 .storybook-page .upload-options { overflow-y:visible; min-height:auto; }
 .storybook-page .queue-actions { position:static; }
}

@media(max-width:760px) {
 .storybook-page .tagging-mode-toggle { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); min-width:0; }
 .storybook-page .tagging-mode-toggle .mode-btn { min-width:0; white-space:normal; overflow-wrap:anywhere; }
}

.storybook-page .queue-list { scroll-padding-block:8px; }
.storybook-page .queue-item-tags { scroll-margin-block:8px; }
.storybook-page .upload-result-notice { margin:0 0 10px; padding:10px; border:1px solid #e6c9b5; border-radius:12px; background:#fff4e9; color:#693f2b; font-size:.875rem; line-height:1.5; overflow-wrap:anywhere; }
.storybook-page .upload-result-notice p { margin:0; }
.storybook-page .upload-result-notice p + p { margin-top:6px; }
.storybook-page .queue-retry-status { grid-column:1/-1; padding:6px 8px; border-radius:8px; background:#fff0e7; color:#7a3d29; font-size:.8rem; line-height:1.5; overflow-wrap:anywhere; }

/* Four-photo moments need two full rows, including their multi-grid class. */
.storybook-page:not(.select-mode) .moment-grid[data-count="4"] {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: repeat(2, minmax(0, 1fr));
}
.storybook-page:not(.select-mode) .moment-grid[data-count="4"] .moment-photo-container {
    aspect-ratio: auto;
    height: 100%;
}
/* Each search card ends after its own content when portrait photos are taller. */
.storybook-page .photo-grid { align-items: start; }

/* Timeline collages follow their existing cell aspect ratios at every width.
   Fixed fractional tracks leave blank bands around a narrow five-cell collage.
   Management layouts keep their separate selection-grid sizing. */
.storybook-page.timeline-page:not(.select-mode):not(.moment-select-mode) .moment-grid[data-count="5"] {
    height: auto;
    grid-template-rows: auto auto;
}

.photo-viewer-tools { display:flex; align-items:center; gap:8px; padding:8px; flex:none; z-index:20; }
.photo-viewer-tools button, .photo-viewer-load-status button { min-width:44px; min-height:44px; border:1px solid #ffffff80; border-radius:14px; background:#26312de6; color:white; padding:8px 12px; }
.photo-viewer-tools button:disabled { opacity:.5; }
.photo-modal #modalImage { touch-action:none; user-select:none; -webkit-user-select:none; }
.photo-viewer-load-status { position:absolute; inset:40% 12% auto; z-index:21; padding:20px; border-radius:16px; color:white; background:#202824f0; text-align:center; }
.photo-viewer-load-status[hidden] { display:none; }
.photo-modal.viewer-immersive { background:#090c0b; }
.photo-modal.viewer-immersive .modal-content { display:flex; flex-direction:row; align-items:center; gap:0; border:0; background:#090c0b; width:100%; height:100dvh; max-width:100%; max-height:100dvh; overflow:hidden; justify-content:center; padding:0; border-radius:0; }
.photo-modal.viewer-immersive #modalImage, .photo-modal.viewer-immersive #modalVideo { width:100%; height:100%; max-width:100%; max-height:100%; object-fit:contain; border-radius:0; box-shadow:none; }
.photo-modal.viewer-immersive .modal-info { display:none; }
.photo-modal.viewer-immersive .photo-viewer-tools { position:absolute; top:max(8px,env(safe-area-inset-top)); left:max(8px,env(safe-area-inset-left)); right:64px; }
.photo-modal.viewer-immersive .modal-close { top:max(8px,env(safe-area-inset-top)); right:max(8px,env(safe-area-inset-right)); width:44px; height:44px; z-index:22; }
.photo-modal.viewer-immersive .modal-prev { left:max(8px,env(safe-area-inset-left)); z-index:20; }
.photo-modal.viewer-immersive .modal-next { right:max(8px,env(safe-area-inset-right)); z-index:20; }
.photo-modal.viewer-immersive .modal-page-indicator { top:auto; bottom:max(12px,env(safe-area-inset-bottom)); z-index:20; }
@media (min-width:769px) {
    .storybook-page .photo-modal:not(.viewer-immersive) .modal-content:not(.viewer-overview-open) { padding-top:76px; }
    .storybook-page .photo-modal:not(.viewer-immersive) .photo-viewer-tools { position:absolute; top:12px; left:18px; max-width:calc(100% - 96px); }
    .storybook-page .photo-modal:not(.viewer-immersive) .modal-close { background:#493326; z-index:22; }
}

.timeline-preview-failed { width:100%; height:100%; min-height:80px; border:0; border-radius:12px; background:#f5eee0; color:#6a5947; padding:12px; font:inherit; }

.storybook-page .moment-photo-container img[hidden], .storybook-page .album-photo-card img[hidden], .storybook-page .photo-wrapper img[hidden], #albumCover[hidden] { display:none; }

.photo-modal.viewer-immersive .modal-nav { top:50%; transform:translateY(-50%); }

.album-create-entry {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 44px;
    box-sizing: border-box;
    max-width: 100%;
    padding: 10px 16px;
    border: 1px solid #d6b65d;
    border-radius: 14px;
    background: #fff0b0;
    color: #624626;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.4;
    text-align: center;
    text-decoration: none;
    overflow-wrap: anywhere;
}
.album-create-entry[hidden] { display: none !important; }
.album-create-entry:hover { background: #ffe69a; }
.album-create-entry:focus-visible,
#create-album-title:focus { outline: 3px solid #795431; outline-offset: 4px; }
.album-create-home-entry { margin: 0 auto 20px; }
.album-create-sidebar-entry {
    flex: 0 0 auto;
    margin: 12px 16px max(16px, env(safe-area-inset-bottom));
}
.storybook-page .timeline-header .album-create-entry { margin-top: 12px; margin-bottom: 0; }
#create-album { scroll-margin-top: 24px; }

/* Shared paper, ink and controls. Existing selected H/artwork remains unchanged. */
:root{--reading-ink:#4d3529;--reading-muted:#716454;--reading-paper:#fbf8ef;--reading-green:#486c51;--reading-line:#e6dcc8}
body{color:var(--reading-ink);background-color:var(--reading-paper);font-family:-apple-system,BlinkMacSystemFont,"PingFang TC","Noto Sans TC",sans-serif}
button,input,select,textarea{font:inherit}button,a,input{touch-action:manipulation}button,a{ -webkit-tap-highlight-color:transparent}button:focus-visible,a:focus-visible,input:focus-visible,summary:focus-visible{outline:3px solid #557d5f;outline-offset:3px}
.reading-skip{position:absolute;left:-10000px}.reading-skip:focus{left:16px;top:12px;z-index:2000;background:#fff;padding:12px}
.viewer-image-status{position:absolute;top:34%;left:50%;transform:translate(-50%,-50%);z-index:7;max-width:min(310px,80%);padding:16px 22px;background:#fff9e9f5;color:#4d3529;border:1px solid #e6dcc8;border-radius:20px;text-align:center;box-shadow:0 4px 20px #4d352918}
.viewer-image-status[hidden]{display:none!important}.viewer-image-status p{margin:0 0 8px}.viewer-image-status button{min-height:44px;border:1px solid #d9bc70;border-radius:12px;padding:8px 14px;background:#ffe28b;color:#4d3529}
#photoModal .modal-image{background:#f1ecdf}#photoModal .modal-image[style*="visibility: hidden"]{pointer-events:none}
.moment-photo-container,.album-photo-wrapper{background:#f1ecdf}.photo-preview-pending{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;pointer-events:none;color:#716454;font-size:13px;background:linear-gradient(110deg,#f3eedf,#faf7ed,#f3eedf);background-size:200% 100%;animation:reading-shimmer 1.8s ease infinite}.photo-preview-pending[hidden]{display:none}
@keyframes reading-shimmer{to{background-position:-200% 0}}
.current-user-badge{position:static!important;align-self:flex-end;margin:12px 0;box-shadow:none!important;border:1px solid var(--reading-line);z-index:auto!important}
.settings-version-footer{color:var(--reading-muted)}.transfer-item,.transfer-card,.memory-card,.card{border-color:var(--reading-line)}
.reading-recovery-note{background:#edf3e8;border:1px solid #d5e0cc;border-radius:16px;padding:14px 18px;margin:16px 0;color:#48634b}.reading-recovery-note a{font-weight:650;color:#35563f}
.reading-help-details{margin-top:18px;font-size:13px;color:#716454}.reading-help-details summary{cursor:pointer;min-height:44px;display:flex;align-items:center}.reading-help-details a{color:#486c51}
body.account-refined{min-height:100svh;background:radial-gradient(ellipse at 8% 2%,#e4f0de 0,transparent 40%),radial-gradient(ellipse at 95% 30%,#fff0c2 0,transparent 40%),#fbf8ef}
.account-refined .account-shell{max-width:1120px;padding:24px 30px 40px}.account-refined .account-header{border:0;align-items:center;justify-content:space-between;flex-direction:row;margin-bottom:10px;padding:0}.reading-brand{display:flex;align-items:center;gap:10px;text-decoration:none;color:#4d3529;font-weight:750;font-size:20px}.reading-brand img{width:40px;height:40px;border-radius:12px}.reading-brand small{display:block;font-size:11px;font-weight:400;color:#716454}.reading-top-actions{display:flex;gap:14px;align-items:center}.reading-top-actions a{min-height:44px;display:flex;align-items:center;color:#486c51;font-size:14px}.reading-login-layout{display:grid;grid-template-columns:1fr 440px;align-items:center;gap:55px;min-height:650px}.reading-welcome{text-align:center}.reading-welcome h1{font-size:42px;line-height:1.35;margin:16px 0}.reading-welcome p{color:#716454}.reading-welcome img{width:100%;max-width:420px;height:300px;object-fit:contain}.reading-welcome small{color:#716454}.account-refined #account-auth{max-width:none;width:100%;margin:18px 0;padding:30px 30px 36px;border:1px solid #e6dcc8;border-radius:28px;background:#fffef9 url('../assets/storybook-garden-v1.png') center bottom/100% auto no-repeat;box-shadow:0 10px 32px #6b4c1710;background-size:100% 24px}.account-refined #account-auth h2{font-size:28px;text-align:center;margin:0 0 6px}.account-refined #account-auth>p:first-of-type{text-align:center;font-size:13px;color:#716454;margin:0 0 20px}.account-refined .account-welcome-art{display:none}.account-refined #account-form label{font-size:14px;font-weight:650}.account-refined #account-form small{font-weight:400;color:#716454}.account-refined #account-form input:not([type=checkbox]){min-height:52px;background:white;border:1px solid #ded8cb;border-radius:14px;color:#4d3529;font-size:16px}.account-refined #account-submit{min-height:54px;background:#ffe28b;border:1px solid #e5c36c;border-radius:15px;font-weight:750;font-size:16px}.account-refined #account-toggle{min-height:48px;color:#486c51;background:#fffef9;border:1px solid #e6dcc8;border-radius:14px}.reading-after-login{text-align:center;font-size:12px;color:#716454;margin:10px 0}.reading-password-wrap{position:relative;display:block}.reading-password-wrap input{padding-right:55px}.reading-show-password{position:absolute;right:5px;top:4px;min-height:44px;min-width:48px;padding:5px;border:0;background:transparent;color:#486c51;font-size:13px}.account-refined #forgot-password{margin:12px 0}.account-refined #forgot-password>summary{min-height:44px;cursor:pointer;display:flex;align-items:center;color:#486c51}.account-refined:not(.is-authenticated) #deletion-status-panel:not(:target):not([open]){display:none}.account-refined.is-authenticated .reading-login-layout{display:block;min-height:0}.account-refined.is-authenticated .reading-welcome{display:none}.reading-account-title{margin-top:24px}.account-refined:not(.is-authenticated) .reading-account-title{display:none}.account-refined .account-story-welcome{display:none}.account-refined .reading-album-grid{display:grid!important;grid-template-columns:repeat(auto-fit,minmax(210px,1fr));gap:14px;margin:20px 0}.account-refined .reading-album-grid button{min-height:86px;text-align:left;border:1px solid #ded8cb;background:#fffdf5;border-radius:18px;padding:16px 20px;color:#4d3529}.account-refined .reading-album-grid button:after{content:'翻開相簿 →';display:block;font-size:13px;margin-top:8px;color:#486c51}.account-refined #account-home>.home-heading{margin-top:22px}.account-refined .card>summary{min-height:44px;cursor:pointer}.account-refined footer{color:#716454}.account-refined footer a{display:inline-flex;min-height:44px;align-items:center}
@media(max-width:760px){.account-refined .account-shell{padding:18px 18px 30px}.reading-brand{font-size:18px}.reading-brand img{width:36px;height:36px}.reading-top-actions{gap:8px}.reading-top-actions a{font-size:12px}.reading-login-layout{display:block;min-height:0;max-width:460px;margin:auto}.reading-welcome{height:144px;overflow:hidden}.reading-welcome h1,.reading-welcome p,.reading-welcome small{display:none}.reading-welcome img{height:144px;width:230px}.account-refined #account-auth{padding:24px 22px 32px;margin:0}.account-refined #account-auth h2{font-size:25px}.viewer-image-status{top:32%;font-size:13px}.current-user-badge{align-self:center}.account-refined .reading-album-grid{grid-template-columns:1fr!important}}
@media(prefers-reduced-motion:reduce){.photo-preview-pending{animation:none}*{scroll-behavior:auto!important}}

.account-refined #account-form #account-submit{color:#4d3529;background:#ffe28b}.account-refined #account-form .reading-show-password{background:transparent;color:#486c51;box-shadow:none;border:0;min-width:48px;font-size:13px;padding:5px}.account-refined #account-form input::placeholder{color:#756957}

@media(max-width:760px){.storybook-page .header-right .header-btn{display:flex;flex-direction:column;justify-content:center;gap:2px;min-height:54px;padding:6px 8px}.storybook-page .header-right .btn-label{white-space:nowrap;font-size:12px}}

/* Keep the same photo space while the next image is downloading/decoding. */
.storybook-page .photo-modal:not(.viewer-immersive) #modalImage{height:min(64dvh,640px);min-height:min(64dvh,640px);object-fit:contain}
@media(max-width:768px){.storybook-page .photo-modal:not(.viewer-immersive) #modalImage{height:28dvh;min-height:28dvh}}
@media(max-width:360px){.storybook-page .photo-modal:not(.viewer-immersive) #modalImage{height:21dvh;min-height:21dvh}}

.account-refined #reading-account-shell{max-width:1120px;color:var(--reading-ink)}
.account-refined #reading-account-shell .account-header{display:flex;flex-direction:row;align-items:center;justify-content:space-between;border:0}
@media(max-width:1000px){.reading-login-layout{display:block;max-width:460px;min-height:0;margin:auto}.reading-welcome{height:144px;overflow:hidden}.reading-welcome h1,.reading-welcome p,.reading-welcome small{display:none}.reading-welcome img{height:144px;width:230px}}

@media(min-width:1001px){.reading-welcome img{display:block;margin:12px auto}.reading-welcome small{display:block;margin-top:12px}}

/* Tag editing is a fixed action row; photo details alone may scroll. */
html body.app-ui.app-ui #photoModal .modal-info > .modal-tags-edit{flex:0 0 auto;margin:0;padding:6px 0 0;border-top:1px solid var(--app-line)}
html body.app-ui.app-ui #photoModal .modal-tags-edit .tags-edit-row{display:flex;flex-direction:row;align-items:center;gap:4px;min-width:0;padding:3px;border:1px solid var(--app-line);border-radius:12px;background:var(--app-paper,#fff)}
html body.app-ui.app-ui #photoModal .tags-edit-row:focus-within{border-color:var(--app-accent);box-shadow:0 0 0 2px color-mix(in srgb,var(--app-accent) 18%,transparent)}
html body.app-ui.app-ui #photoModal .tags-edit-row #editTagsInput{flex:1 1 0;width:0;min-width:0;min-height:44px;margin:0;padding:8px;border:0;border-radius:8px;background:transparent;font:inherit;line-height:1.25;box-shadow:none}
html body.app-ui.app-ui #photoModal .tags-edit-row .save-tags-btn{flex:0 0 auto;width:auto;min-width:64px;min-height:44px;margin:0;padding:8px 10px;border-radius:9px;white-space:nowrap;font:inherit;font-weight:700;line-height:1.25}
@media(max-width:768px) and (max-height:500px){
 html body.app-ui.app-ui #photoModal:not(.viewer-immersive):has(.tags-edit-row:focus-within) #modalImage{height:8dvh;max-height:8dvh;min-height:0}
}

/* Shared app chrome: grouped content, system typography and one restrained accent. */
:root{--app-bg:#f2f2f7;--app-surface:#fff;--app-ink:#1c1c1e;--app-muted:#636366;--app-line:#e5e5ea;--app-accent:#32664f;--app-secondary:#eaf1ed;--app-radius:16px;--reading-ink:var(--app-ink);--reading-muted:var(--app-muted);--reading-paper:var(--app-bg);--reading-green:var(--app-accent);--reading-line:var(--app-line);--color-primary:var(--app-accent);--color-background:var(--app-bg);--color-surface:var(--app-surface);--color-text:var(--app-ink);--color-text-muted:var(--app-muted)}
html{color-scheme:light;scroll-padding-top:20px}body.app-ui{margin:0;color:var(--app-ink);background:var(--app-bg);font:400 17px/1.5 -apple-system,BlinkMacSystemFont,"Helvetica Neue","PingFang TC",sans-serif;-webkit-font-smoothing:antialiased}body.app-ui *{box-sizing:border-box}body.app-ui [hidden]{display:none!important}body.app-ui :is(button,input,select,textarea){font:inherit}body.app-ui :is(button,a,input,select,textarea,summary){touch-action:manipulation}body.app-ui a{color:var(--app-accent)}body.app-ui :focus-visible{outline:3px solid var(--app-accent);outline-offset:3px}body.app-ui :is(h1,h2,h3,p){overflow-wrap:anywhere}body.app-ui h1{font-size:30px;line-height:1.2;letter-spacing:-.6px}body.app-ui h2{font-size:20px;line-height:1.35}body.app-ui h3{font-size:17px}body.app-ui :is(.app-note,.muted,.storybook-note,.service-notice,small){color:var(--app-muted)}
.app-shell{max-width:720px;margin:auto;padding:calc(16px + env(safe-area-inset-top,0px)) 20px calc(32px + env(safe-area-inset-bottom,0px))}.app-header{margin:0 0 24px;background:none;border:0}.app-header h1{margin:8px 0}.app-back{display:inline-flex;align-items:center;min-height:44px;text-decoration:none}.app-subtitle{font-size:15px;color:var(--app-muted);margin:8px 0}.app-card,.app-list{background:var(--app-surface);border:1px solid var(--app-line);border-radius:var(--app-radius);box-shadow:none}.app-card{padding:20px;margin-bottom:20px}.app-list{overflow:hidden;margin:12px 0 24px}.app-list>p{padding:16px;margin:0}.app-row{display:flex;align-items:center;gap:12px;width:100%;min-height:56px;padding:15px 16px;text-decoration:none;text-align:left;color:var(--app-ink)!important;background:var(--app-surface);border:0;border-radius:0;font:inherit;cursor:pointer}.app-row+.app-row{border-top:1px solid var(--app-line)}.app-row>span:first-child{flex:1;min-width:0}.app-row>span[aria-hidden]{color:#8e8e93;flex:0}.app-row-copy strong{display:block;font-weight:500}.app-row-copy small{display:block;font-size:13px;margin-top:3px;font-weight:400}.app-row:disabled{opacity:.5;cursor:default}.app-note{font-size:14px;line-height:1.6}
body.app-ui :is(.btn-tag,.btn-primary,.header-btn,button[type=submit],.save-settings){background:var(--app-accent);color:white;border-color:transparent;box-shadow:none}body.app-ui :is(.btn-secondary,button.secondary,a.secondary){background:var(--app-secondary);color:var(--app-accent);border-color:transparent;box-shadow:none}body.app-ui :is(button,.btn-secondary,.btn-tag,.header-btn){min-height:44px;border-radius:12px}body.app-ui :is(input:not([type=checkbox]):not([type=radio]),select,textarea){font-size:17px;max-width:100%;min-width:0}body.app-ui :is(input[type=checkbox],input[type=radio]){accent-color:var(--app-accent)}body.app-ui :is(.card,.panel,.settings-section,.line-card,.transfer-card){border-color:var(--app-line);border-radius:var(--app-radius);background:var(--app-surface);box-shadow:none}body.app-ui :is(.reading-brand,.brand,.line-back,.memory-back,.transfer-back){color:var(--app-accent)}body.app-ui :is(.reading-brand small,.brand small){color:var(--app-muted)}body.app-ui dialog{color:var(--app-ink);background:var(--app-surface);border:1px solid var(--app-line);border-radius:20px;max-width:min(620px,calc(100vw - 24px))}body.app-ui dialog::backdrop{background:#0006}body.app-ui .danger-text{color:#b4232d!important}
/* Utility pages share the same quiet surfaces. Brand illustrations stay at the reading home. */
body.app-ui:is(.account-refined,.line-page){background:var(--app-bg)}body.app-ui .reading-login-layout{display:block;min-height:0;max-width:520px;margin:24px auto}body.app-ui .reading-welcome{display:none}body.app-ui.account-refined .account-shell{max-width:720px;padding:20px}body.app-ui.account-refined #account-auth{background:var(--app-surface);box-shadow:none;border:1px solid var(--app-line);border-radius:16px}body.app-ui.account-refined :is(#account-submit,#account-toggle){border-radius:12px}body.app-ui.account-refined #account-submit{background:var(--app-accent);color:white;border:0}body.app-ui.account-refined .reading-account-title{font-size:30px}body.app-ui.account-refined .reading-album-grid{grid-template-columns:1fr!important}body.app-ui.account-refined .reading-album-grid button{border-radius:12px;border:1px solid var(--app-line);background:white;font-size:17px}body.app-ui.account-refined .account-header{gap:12px}body.app-ui.account-refined .reading-brand{color:var(--app-ink)}
body.app-ui.line-page main{max-width:960px;padding:20px;margin:auto}body.app-ui .line-welcome{display:block;margin:24px 0;padding:0;min-height:0}body.app-ui :is(.line-welcome-art,.intro-art,.line-welcome br,.line-eyebrow){display:none}body.app-ui .line-welcome>div>p:not(.line-intro):not(.line-eyebrow){display:none}body.app-ui .line-welcome h1{font-size:30px;line-height:1.2;margin:12px 0}body.app-ui .line-intro{max-width:640px}body.app-ui :is(.line-steps,.notice){background:var(--app-secondary);border-color:var(--app-line);box-shadow:none}body.app-ui .line-header{border:0}body.app-ui .line-card{padding:20px}body.app-ui .line-item{border-color:var(--app-line);border-radius:14px}body.app-ui .line-layout{gap:20px}body.app-ui .line-import-section{margin-top:20px}body.app-ui .line-footer{border-color:var(--app-line)}body.app-ui .line-controls,body.app-ui #line-controls{background:white;border-color:var(--app-line)}
body.app-ui :is(.memory-header,.settings-header,.search-header,.album-header){box-shadow:none}body.app-ui .memory-header{background:var(--app-surface);border-color:var(--app-line)}body.app-ui .memory-shell{max-width:960px;padding:20px}body.app-ui .intro{min-height:0;display:block;padding:8px 0 20px}body.app-ui .intro h1{font-size:30px;color:var(--app-ink)}body.app-ui .intro :is(.eyebrow,.intro-art){display:none}body.app-ui .memory-shell .panel{border:1px solid var(--app-line)}body.app-ui .transfer-back{color:var(--app-accent)}body.app-ui.transfer-minimal .btn-tag{background:var(--app-accent)}body.app-ui.transfer-minimal .btn-secondary{color:var(--app-accent);background:var(--app-secondary)}body.app-ui.transfer-minimal .settings-header h1{font-size:30px}body.app-ui.transfer-minimal :is(.transfer-notification-option input,progress){accent-color:var(--app-accent)}body.app-ui :is(.install-container,.service-page){color:var(--app-ink)}body.app-ui :is(.settings-story-side,.settings-story-closing){display:none}
@media(max-width:600px){body.app-ui .reading-brand small{display:none}body.app-ui .line-layout{display:block}body.app-ui .line-sidebar{margin-top:20px}body.app-ui .line-header{gap:12px}body.app-ui .line-header .reading-brand{font-size:17px}body.app-ui .reading-brand img{width:32px;height:32px}.app-shell{padding-left:16px;padding-right:16px}body.app-ui :is(.memory-header nav,.reading-top-actions){gap:10px}body.app-ui .memory-header{flex-wrap:wrap}}
@media(prefers-reduced-motion:reduce){body.app-ui *{scroll-behavior:auto!important;animation:none!important;transition:none!important}}
/* No decorative banner between operational pages. */
body.app-ui .intro{background:none;border:0;border-radius:0;box-shadow:none}body.app-ui .intro-copy{max-width:100%}body.app-ui .intro:before,body.app-ui .intro:after{display:none}body.app-ui .search-header{background:white;color:var(--app-ink);border:1px solid var(--app-line);border-radius:16px;box-shadow:none}body.app-ui .search-header :is(h1,h2,p){color:var(--app-ink)}body.app-ui .album-header{background:white!important;border:1px solid var(--app-line);border-radius:16px;padding:20px!important;min-height:0}body.app-ui .album-header:before,body.app-ui .album-header:after{display:none}body.app-ui .album-header :is(h1,h2,p){color:var(--app-ink)}body.app-ui .album-header img{display:none}body.app-ui .btn-search{background:var(--app-accent);color:white;border-color:transparent}body.app-ui .settings-container .app-list button.app-row{border-radius:0}body.app-ui.transfer-page.transfer-minimal{font:400 17px/1.5 -apple-system,BlinkMacSystemFont,"Helvetica Neue","PingFang TC",sans-serif}body.app-ui.line-page .line-status-card{background:white;border:1px solid var(--app-line);box-shadow:none;border-radius:16px}body.app-ui.line-page .line-card{margin:0 0 20px}body.app-ui.line-page :is(summary,.app-help summary){min-height:48px;cursor:pointer;font-size:17px;font-weight:600}body.app-ui.line-page #line-controls{margin-top:16px}body.app-ui.line-page .line-source-settings{margin-top:20px}body.app-ui.line-page .line-source-settings .line-card{border:0;padding:16px 0;margin:0}body.app-ui.line-page :is(button:not(.secondary),#line-direct,#golden-save){background:var(--app-accent);color:white;border-color:transparent;box-shadow:none}body.app-ui.line-page :is(button.secondary,.golden-pagination button){color:var(--app-accent);background:var(--app-secondary);border-color:transparent}body.app-ui .golden-save-bar{background:#fffffff5;border-color:var(--app-line);box-shadow:none}body.app-ui .golden-selected-panel{background:var(--app-secondary)}body.app-ui .app-help{font-size:15px;margin-bottom:16px}body.app-ui .settings-row-link{color:var(--app-ink)}body.app-ui .account-identity{padding-top:4px}body.app-ui #account-album-directory>summary{font-weight:600;min-height:44px;cursor:pointer}
body.app-ui .sidebar-tab-handle{display:none}body.app-ui .timeline-actions{position:relative;min-width:60px}body.app-ui .timeline-actions>summary{display:flex;align-items:center;justify-content:center;min-height:44px;padding:8px 14px;border-radius:12px;background:var(--app-secondary);color:var(--app-accent);list-style:none;cursor:pointer;font-size:15px;font-weight:600}body.app-ui .timeline-actions>summary::-webkit-details-marker{display:none}.timeline-action-menu{position:absolute;right:0;top:50px;min-width:210px;z-index:1200;display:grid;gap:4px;padding:8px;border:1px solid var(--app-line);border-radius:14px;background:white;box-shadow:0 6px 24px #0002}body.app-ui .timeline-action-menu .header-btn{width:100%;text-align:left;justify-content:flex-start;color:var(--app-ink);background:white}body.app-ui .header-right .header-btn:not(.upload-header-btn){background:var(--app-secondary);color:var(--app-accent);box-shadow:none;border-color:transparent}body.app-ui .header-right .header-btn .btn-icon{font-size:17px}
/* Detail screens and overlays keep the same hierarchy and neutral surfaces. */
body.app-ui .album-header{display:block!important}body.app-ui .album-heading-copy{width:100%;max-width:none}body.app-ui.account-refined #account-form #account-submit{background:var(--app-accent);color:white;border:0}body.app-ui #subject-crop-apply{background:var(--app-accent);color:white;border:0}body.app-ui .timeline-action-menu{left:0;right:auto;min-width:210px;max-width:calc(100vw - 32px)}body.app-ui .header:has(.timeline-actions[open]){overflow:visible}body.app-ui #photoModal .modal-content{background:#171719;border:0;box-shadow:0 12px 48px #0005}body.app-ui #photoModal :is(.modal-image,.modal-video){background:#171719}body.app-ui #photoModal .modal-info{background:white;border-color:var(--app-line);color:var(--app-ink)}body.app-ui #photoModal :is(.modal-close,.modal-nav){background:#252527e8;color:white;border:0}body.app-ui #photoModal .modal-overlay{background:#000b}body.app-ui #memory-viewer{background:#171719;border:0}body.app-ui .install-page .settings-header,body.app-ui.install-page .settings-header{background:none;min-height:0}body.app-ui .settings-container>.settings-section>img[src$="storybook-upload-v1.png"]{width:120px!important}
/* App-owned prompts share one presentation; OS permission and install dialogs stay with the system. */
body.app-ui :is(.timehut-dialog .modal-card,#tagModal .confirm-card,#moveCollectionModal .confirm-card,.queue-confirm,#subject-crop){background:var(--app-surface);color:var(--app-ink);border:1px solid var(--app-line);border-radius:18px;box-shadow:0 16px 60px #0003;max-width:min(560px,calc(100vw - 24px));font-family:inherit}body.app-ui .timehut-dialog .modal-card{width:min(460px,calc(100vw - 24px));padding:0;max-height:calc(100dvh - 32px);display:flex;flex-direction:column;overflow:hidden}body.app-ui .timehut-dialog .dialog-header{padding:20px 20px 12px;border:0;background:white}body.app-ui .timehut-dialog .dialog-header h3{font-size:20px;color:var(--app-ink);margin:0}body.app-ui .timehut-dialog .dialog-body{padding:0 20px 20px;overflow:auto;color:var(--app-ink);overscroll-behavior:contain}body.app-ui .timehut-dialog .dialog-body p{white-space:pre-line;font-size:16px;line-height:1.6}body.app-ui :is(.timehut-dialog .dialog-art,.confirm-story-art,#moveCollectionModal .confirm-icon,#tagModal .confirm-icon){display:none}body.app-ui .timehut-dialog .modal-actions{display:flex;gap:12px;padding:16px 20px;border-top:1px solid var(--app-line);background:white}body.app-ui .timehut-dialog .modal-actions button{flex:1;min-height:48px;font-size:16px;border-radius:12px;padding:10px 14px}body.app-ui .timehut-dialog .dialog-close{width:44px;height:44px;background:var(--app-secondary);color:var(--app-accent);border:0;border-radius:12px}body.app-ui .timehut-dialog :is(input:not([type=radio]),select){width:100%;min-height:48px;padding:10px;border:1px solid var(--app-line);border-radius:10px;background:white}body.app-ui .timehut-dialog label{font-size:16px;display:grid;gap:8px}body.app-ui .timehut-dialog .dialog-album-option{display:flex;align-items:center;min-height:56px;border-color:var(--app-line);background:white}body.app-ui .timehut-dialog .dialog-album-option img{width:36px;height:36px;object-fit:cover}body.app-ui .timehut-dialog .dialog-album-option input{width:20px;height:20px}body.app-ui .danger-dialog .btn-danger,body.app-ui .queue-destructive{background:#b4232d!important;color:white!important;border:0}body.app-ui .queue-confirm{padding:20px}body.app-ui .queue-confirm-actions{display:flex;gap:12px}body.app-ui .queue-confirm-actions button{flex:1;min-height:48px}body.app-ui #moveCollectionModal .confirm-card,body.app-ui #tagModal .confirm-card{padding:20px}body.app-ui #moveCollectionModal .confirm-title,body.app-ui #tagModal .confirm-title{font-size:20px}body.app-ui .confirm-actions{display:flex;gap:12px}body.app-ui .confirm-actions button{flex:1;min-height:48px}body.app-ui .upload-modal-content{background:white;border:1px solid var(--app-line);border-radius:18px;box-shadow:none}body.app-ui .upload-modal-content .dialog-art{display:none}

/* Complete modal foundation on every page, including settings and account pages without reading CSS. */
body.app-ui .timehut-dialog{position:fixed!important;inset:0!important;z-index:30000!important;display:flex!important;align-items:center;justify-content:center;padding:16px;background:rgba(0,0,0,.4)!important;backdrop-filter:blur(5px);margin:0!important;overflow:hidden}
body.app-ui .timehut-dialog .modal-card{margin:0!important;flex:none;min-height:0}
body.app-ui .timehut-dialog .dialog-header{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;flex-shrink:0}
body.app-ui .timehut-dialog .dialog-header h3{flex:1;min-width:0;padding-top:6px}
body.app-ui .timehut-dialog .dialog-body{min-height:0;flex:1}
body.app-ui .timehut-dialog .modal-actions{flex-shrink:0}
body.app-ui .timehut-dialog .dialog-close{flex-shrink:0;padding:0}
body.app-ui .timehut-dialog .dialog-album-options{display:grid;gap:8px;margin-top:12px}
body.app-ui .timehut-dialog .dialog-album-option{border:1px solid var(--app-line);border-radius:12px;padding:12px}
body.app-ui .timehut-dialog .btn-primary{background:var(--app-accent)!important;color:white!important}
body.app-ui .timehut-dialog .btn-danger{background:#b4232d!important}
body.app-ui .timehut-dialog button:disabled{opacity:.45;cursor:default}
body.app-ui .timehut-dialog :is(.btn-secondary,.dialog-close){background:var(--app-secondary)!important;color:var(--app-accent)!important}
body.app-ui :is(#moveCollectionModal,#tagModal) .collection-item.selected{background:var(--app-secondary)!important;border-color:var(--app-accent)!important}

/* Explicit margins survive the global CSS reset and center native HTML dialogs. */
body.app-ui dialog{margin:auto!important}

/* Crop actions stay outside scrolling fields; decorative day covers do not leave blank space. */
body.app-ui .album-cover-frame{display:none!important}
body.app-ui #subject-crop[open]{display:flex;flex-direction:column;max-height:calc(100dvh - 32px);padding:0;overflow:hidden}
body.app-ui .subject-crop-header{padding:16px 20px 8px;flex-shrink:0}
body.app-ui .subject-crop-header h2{margin:0;font-size:20px}
body.app-ui .subject-crop-header form{float:right}
body.app-ui .subject-crop-content{min-height:0;overflow:auto;padding:0 20px 16px;overscroll-behavior:contain}
body.app-ui .subject-crop-footer{padding:12px 20px;border-top:1px solid var(--app-line);background:white;flex-shrink:0}
body.app-ui #subject-crop-apply{position:static;margin:0;box-shadow:none}
body.app-ui #subject-crop-image{max-height:min(26dvh,220px)}

/* iOS keeps the layout viewport behind its keyboard; position forms in the visible viewport. */
body.app-ui :is(.timehut-dialog,#tagModal,#moveCollectionModal,#uploadModal,#photoModal){inset:var(--app-visual-top,0px) auto auto var(--app-visual-left,0px)!important;width:var(--app-visual-width,100vw)!important;height:var(--app-visual-height,100dvh)!important;box-sizing:border-box}
body.app-ui :is(.timehut-dialog .modal-card,#tagModal .confirm-card,#moveCollectionModal .confirm-card,.upload-modal-content){max-height:calc(var(--app-visual-height,100dvh) - 32px)}
body.app-ui dialog[open]{position:fixed;inset:auto;top:calc(var(--app-visual-top,0px) + var(--app-visual-height,100dvh)/2);left:calc(var(--app-visual-left,0px) + var(--app-visual-width,100vw)/2);margin:0!important;transform:translate(-50%,-50%);max-height:calc(var(--app-visual-height,100dvh) - 32px);max-width:calc(var(--app-visual-width,100vw) - 24px)}
body.app-ui #subject-crop[open]{max-height:calc(var(--app-visual-height,100dvh) - 32px)}

/* A transport failure remains a composed state in the current destination. */
body.app-ui .account-connection-state{margin:20px auto;max-width:680px;padding:24px;position:relative;z-index:2}
body.app-ui .account-connection-state h2{margin:0 0 12px;line-height:1.4}body.app-ui .account-connection-state p{margin:0 0 20px;line-height:1.65}
body.app-ui .account-connection-actions{display:flex;flex-wrap:wrap;gap:12px}body.app-ui .account-connection-actions a{display:inline-flex;align-items:center;min-height:44px;padding:10px 16px;text-decoration:none}
/* Mobile timeline: let the first memory share the opening viewport with controls. */
@media (max-width:600px) {
 body.app-ui.timeline-page .header-logo { min-height:44px; }
 body.app-ui.timeline-page .header-row-top { display:grid; grid-template-columns:92px minmax(0,1fr); gap:4px; }
 body.app-ui.timeline-page .header-left { gap:4px; }
 body.app-ui.timeline-page .header-left .hamburger-btn { flex:0 0 44px; margin-right:0; }
 body.app-ui.timeline-page .header-logo { flex:0 0 44px; width:44px; justify-content:center; }
 body.app-ui.timeline-page .header-logo .header-title { display:none; }
 body.app-ui.timeline-page .header-right { width:auto; gap:4px; }
 body.app-ui.timeline-page .timeline-actions { min-width:56px; }
 body.app-ui.timeline-page .timeline-actions>summary { min-height:50px; padding:8px 10px; }
 body.app-ui.timeline-page .header-right>.header-btn { flex-direction:column; gap:2px; min-width:44px; min-height:50px; padding:4px 0; }
 body.app-ui.timeline-page .header-right>.header-btn .btn-icon { line-height:20px; }
 body.app-ui.timeline-page .header-right>.header-btn .btn-label { font-size:14px; line-height:20px; }
 body.app-ui.timeline-page .header-row-search .search-box { padding:0 4px 0 12px; min-height:48px; }
 body.app-ui.timeline-page .header-row-search input { min-height:44px; }
 body.app-ui.timeline-page .header-row-search .shiguang-entry { min-height:44px; padding:8px 10px; }
 body.app-ui.timeline-page:not(.select-mode):not(.moment-select-mode) .timeline-header { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:4px 12px; min-height:0; padding:12px 16px; margin-bottom:12px; background:var(--app-surface); }
 body.app-ui.timeline-page:not(.select-mode):not(.moment-select-mode) .timeline-header::after { display:none; }
 body.app-ui.timeline-page:not(.select-mode):not(.moment-select-mode) .timeline-header>* { margin:0; max-width:none; }
 body.app-ui.timeline-page:not(.select-mode):not(.moment-select-mode) .timeline-header .timeline-eyebrow { display:none; }
 body.app-ui.timeline-page:not(.select-mode):not(.moment-select-mode) .timeline-header .current-child-name { grid-column:1/-1; display:block; font-size:24px; line-height:1.25; }
 body.app-ui.timeline-page:not(.select-mode):not(.moment-select-mode) .timeline-header .current-child-age { grid-column:1; grid-row:2; align-self:center; display:block; font-size:15px; line-height:22px; }
 body.app-ui.timeline-page:not(.select-mode):not(.moment-select-mode) .timeline-header .timeline-hint { display:none; }
 body.app-ui.timeline-page:not(.select-mode):not(.moment-select-mode) .timeline-header .album-create-timeline-entry { grid-column:2; grid-row:2; align-self:center; justify-self:end; min-height:44px; padding:8px 10px; font-size:14px; line-height:20px; }
 body.app-ui.timeline-page .transfer-entry-panel { margin-bottom:12px; }
 body.app-ui.timeline-page .transfer-entry-panel>summary .transfer-entry-link { gap:2px 8px; padding:6px 0; }
 body.app-ui.timeline-page #transferQueueCount { font-size:13px; line-height:20px; padding:0; background:transparent; }
 body.app-ui.timeline-page #transferQueueDetail { font-size:14px; line-height:22px; }
 body.app-ui.timeline-page .timeline-action-menu .header-btn { min-height:44px; flex-direction:row; gap:8px; padding:10px 12px; }
 body.app-ui.timeline-page .timeline-action-menu .btn-label { font-size:16px; line-height:24px; }
 body.app-ui.timeline-page .age-group-header { margin-top:0; padding:8px 0; }
 body.app-ui.timeline-page :is(.age-group-summary,.moment-full-date,.moment-age,.moment-stats-right) { font-size:13px; line-height:20px; }
}

/* Album rows keep the name readable before showing secondary controls. */
body.app-ui.line-page .line-golden-rows li { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:8px 16px; align-items:center; padding:16px 0; }
body.app-ui.line-page .line-golden-rows li>span { grid-column:1/-1; min-width:0; font-size:17px; line-height:1.5; overflow-wrap:anywhere; }
body.app-ui.line-page .line-golden-rows span small { margin-top:4px; font-size:13px; line-height:1.6; }
body.app-ui.line-page .line-golden-rows li>label { display:flex; align-items:center; gap:8px; min-height:44px; margin:0; font-size:15px; line-height:1.5; white-space:nowrap; }
body.app-ui.line-page .line-golden-rows label input { flex:none; width:20px; height:20px; margin:0; accent-color:var(--app-accent); }
body.app-ui.line-page .line-golden-rows li>a { font-size:15px; line-height:1.5; }

/* Native public reading headers reuse existing app navigation without changing page content. */
body.app-ui.public-reading-page .public-reading-header { display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:8px 16px;margin:0 0 16px;padding:0;border:0; }
body.app-ui.public-reading-page .public-reading-header .app-back { min-width:44px; }
body.app-ui.public-reading-page .public-reading-header .brand { min-height:44px;font-size:17px; }

/* Text entry must retain a scrollable viewer when the software keyboard reduces
   the visible area. The fixed download row must not consume the editor's space.
   Keep the same photo/form; scroll the card while its form owns focus. */
@media (max-width:768px){
 body.app-ui #photoModal .modal-content:has(.photo-ai-form:focus-within){height:calc(var(--app-visual-height,100dvh) - 24px);max-height:calc(var(--app-visual-height,100dvh) - 24px);overflow-y:auto;overscroll-behavior:contain}
 body.app-ui #photoModal .modal-info:has(.photo-ai-form:focus-within){flex:0 0 auto;max-height:none;overflow:visible}
 body.app-ui #photoModal .modal-info:has(.photo-ai-form:focus-within) .viewer-details{flex:none;overflow:visible}
}

/* Native-style supplementary actions; existing page controls remain visible. */
:root{--press-background:#f2f2f7;--press-surface:#fff;--press-text:#1c1c1e;--press-secondary:#636366;--press-blue:#0066cc;--press-danger:#c62828;--press-divider:#e5e5ea}
[data-press-photo],.device-review-preview,.viewer-overview-photo,.moment-photo,.album-photo-card,.photo-card{-webkit-touch-callout:none}
.press-pending{transition:opacity .15s ease;opacity:.86}
.press-menu{position:fixed;inset:auto 0 0;width:min(100%,540px);max-width:100%;max-height:85dvh;box-sizing:border-box;margin:0 auto;padding:20px 16px max(16px,env(safe-area-inset-bottom));border:0;border-radius:24px 24px 0 0;background:var(--press-background);color:var(--press-text);font-family:-apple-system,BlinkMacSystemFont,'Noto Sans TC',sans-serif;overflow-y:auto}
.press-menu::backdrop,.press-peek::backdrop{background:rgba(0,0,0,.28)}
.press-menu h2{font-size:17px;font-weight:600;line-height:1.4;margin:0 8px 16px;overflow-wrap:anywhere}
.press-menu-items{background:var(--press-surface);border-radius:16px;overflow:hidden}
.press-menu button{display:block;width:100%;min-height:50px;padding:14px 16px;border:0;background:var(--press-surface);color:var(--press-blue);font:inherit;font-size:17px;text-align:left;overflow-wrap:anywhere}
.press-menu-items button+button{border-top:1px solid var(--press-divider)}
.press-menu button:disabled{color:var(--press-secondary);opacity:.65}
.press-menu button.press-menu-danger{color:var(--press-danger)}
.press-menu button.press-menu-hover,.press-menu button:active{background:#eaf3ff}
.press-menu button.press-menu-cancel{margin-top:10px;border-radius:16px;text-align:center;font-weight:600}
.press-peek{position:fixed;inset:0;margin:0;padding:24px 16px;box-sizing:border-box;width:100%;height:100dvh;max-width:none;max-height:none;border:0;background:rgba(20,20,22,.95);color:#fff;overflow:hidden}
.press-peek[open]{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:16px}
.press-peek canvas{display:block;max-width:100%;max-height:72dvh;object-fit:contain;border-radius:14px}
.press-peek p{margin:0;font-size:15px;max-width:100%;overflow-wrap:anywhere;text-align:center}
.press-peek-close{min-height:44px;padding:8px 20px;border:0;border-radius:12px;background:rgba(255,255,255,.12);color:#fff;font:inherit}
.press-status{position:fixed;z-index:10001;inset:auto 16px max(86px,env(safe-area-inset-bottom));margin:0 auto;max-width:500px;width:max-content;max-width:calc(100% - 32px);box-sizing:border-box;background:#1c1c1e;color:#fff;border-radius:12px;padding:12px 16px;font-size:15px;pointer-events:none}
.press-status:empty{display:none}
.press-more{min-width:44px;min-height:44px;border:0;background:transparent;color:var(--press-blue);font-size:17px;padding:8px 12px;border-radius:10px}
.press-selected{outline:3px solid var(--press-blue);outline-offset:-3px}
.press-selected::after{content:'✓';position:absolute;right:8px;top:8px;background:var(--press-blue);color:#fff;border-radius:50%;width:24px;height:24px;display:grid;place-items:center;font-size:16px}
.press-search-selection{position:sticky;bottom:0;z-index:8;background:var(--press-surface);border-top:1px solid var(--press-divider);padding:12px max(12px,env(safe-area-inset-right)) max(12px,env(safe-area-inset-bottom));display:flex;flex-wrap:wrap;align-items:center;gap:8px}
.press-search-selection[hidden]{display:none}
.press-cover-photo{object-fit:cover!important;border-radius:50%}
@media(prefers-reduced-motion:reduce){.press-pending{transition:none}}

.press-album-cover-holder{display:inline-flex;width:44px;height:44px;flex-shrink:0;margin-right:12px}.press-album-cover-holder img,.album-card-emoji img.press-cover-photo{display:block;width:44px;height:44px;object-fit:cover}.press-share-status{margin:12px 8px 20px;font-size:16px;line-height:1.5}.press-task-selection{display:flex;flex-wrap:wrap;align-items:center;gap:8px;padding:12px;background:var(--press-surface)}

/* Management state follows the new hold Golden; ordinary reading keeps its brand. */
.storybook-page:is(.select-mode,.moment-select-mode) .selection-bar,.storybook-page:is(.select-mode,.moment-select-mode) .moment-selection-bar{background:#fff;border:1px solid #e5e5ea;border-radius:18px;color:#1c1c1e;box-shadow:0 -2px 12px #00000008}
.storybook-page:is(.select-mode,.moment-select-mode) .selection-bar button{background:#fff;color:var(--press-blue);border-color:#e5e5ea;font-size:15px;min-height:44px}
.storybook-page:is(.select-mode,.moment-select-mode) .selection-bar .btn-danger{color:#c62828;background:#fff}
.storybook-page.select-mode .moment-photo-container{border:1px solid #e5e5ea;border-radius:8px}
.storybook-page.select-mode .moment-photo-container.selected{border-color:var(--press-blue);outline:2px solid var(--press-blue);outline-offset:-2px}
.storybook-page.select-mode .timeline-photo-select{left:auto;top:auto;right:4px;bottom:4px;width:32px;height:32px;border-radius:50%;border:2px solid #fff;background:#ffffffd9;color:#636366;font-size:17px;box-shadow:0 0 0 6px #ffffff00}
.storybook-page.select-mode .timeline-photo-select[aria-pressed="true"]{background:var(--press-blue);color:#fff}
.storybook-page.select-mode .album-photo-card.selected{outline:2px solid var(--press-blue);outline-offset:-2px}
.storybook-page.select-mode .album-photo-card .select-checkbox{left:auto;top:auto;right:5px;bottom:5px;width:28px;height:28px;border:2px solid #fff}
.storybook-page.select-mode .album-photo-card.selected .select-checkbox{background:var(--press-blue);border-color:#fff}
.storybook-page.select-mode .album-photo-card.selected .select-checkbox::after{color:#fff}
/* Isolate these new surfaces from the older all-dialog/card presentation rules. */
html body dialog.press-menu[open]{display:block!important;position:fixed!important;inset:auto 0 0!important;top:auto!important;bottom:0!important;left:0!important;right:0!important;margin:0 auto!important;transform:none!important;width:min(100%,540px)!important;max-width:100%!important;max-height:85dvh!important;height:auto!important;padding:20px 16px max(16px,env(safe-area-inset-bottom))!important;border:0!important;border-radius:24px 24px 0 0!important;background:#f2f2f7!important;color:#1c1c1e!important;overflow-y:auto!important;box-sizing:border-box!important}
html body dialog.press-menu h2{font-size:20px!important;line-height:1.4!important;font-weight:600!important;margin:0 8px 18px!important;padding:0!important;color:#1c1c1e!important}
html body dialog.press-menu .press-menu-items{padding:0!important;margin:0!important;background:#fff!important;border:0!important;border-radius:16px!important;overflow:hidden!important}
html body dialog.press-menu button{display:block!important;width:100%!important;min-height:50px!important;height:auto!important;margin:0!important;padding:14px 16px!important;border:0!important;border-radius:0!important;box-shadow:none!important;background:#fff!important;color:var(--press-blue)!important;font-family:-apple-system,BlinkMacSystemFont,'Noto Sans TC',sans-serif!important;font-size:17px!important;font-weight:400!important;line-height:1.4!important;text-align:left!important;white-space:normal!important}
html body dialog.press-menu .press-menu-items button+button{border-top:1px solid #e5e5ea!important}
html body dialog.press-menu button.press-menu-cancel{margin-top:12px!important;border-radius:16px!important;text-align:center!important;font-weight:600!important}
html body dialog.press-menu button.press-menu-danger{color:#c62828!important}
html body dialog.press-menu button:disabled{color:#636366!important;opacity:.65!important}
html body dialog.press-menu button.press-menu-hover,html body dialog.press-menu button:active{background:#eaf3ff!important}
html body dialog.press-peek[open]{display:flex!important;flex-direction:column!important;align-items:center!important;justify-content:center!important;inset:0!important;top:0!important;left:0!important;right:0!important;bottom:0!important;margin:0!important;transform:none!important;width:100%!important;height:100dvh!important;max-width:none!important;max-height:none!important;padding:24px 16px!important;border:0!important;border-radius:0!important;background:#171719!important;color:#fff!important;overflow:hidden!important;box-sizing:border-box!important}
html body dialog.press-peek canvas{display:block!important;width:auto!important;height:auto!important;max-width:100%!important;max-height:72dvh!important;object-fit:contain!important;border-radius:14px!important}
html body dialog.press-peek p{color:#fff!important;font-size:16px!important;text-align:center!important;line-height:1.4!important}
html body dialog.press-peek button{background:#ffffff25!important;color:#fff!important;border:0!important;box-shadow:none!important;border-radius:999px!important;min-height:44px!important;padding:8px 20px!important;font-size:16px!important}

html body.storybook-page.select-mode .timeline-photo-select{display:flex!important;align-items:center!important;justify-content:center!important;box-sizing:border-box!important;width:32px!important;min-width:32px!important;max-width:32px!important;height:32px!important;min-height:32px!important;max-height:32px!important;padding:0!important;border-radius:50%!important;line-height:1!important}

html body dialog.press-peek canvas{width:min(100%,480px)!important}

.child-card .child-emoji img.press-cover-photo{object-fit:cover!important;border-radius:14px!important}

.child-card .avatar-emoji img.press-cover-photo{display:block;width:64px;height:64px;border-radius:14px!important;object-fit:cover!important}

html body dialog.press-peek canvas{flex:0 1 auto;min-height:0;max-height:calc(100dvh - 160px)!important}html body dialog.press-peek p{flex:0 1 auto;max-height:18dvh;overflow:auto;overflow-wrap:anywhere}html body dialog.press-peek button{flex-shrink:0}
html body dialog.press-menu button:focus{outline:0!important}html body dialog.press-menu button:focus-visible{outline:2px solid var(--press-blue)!important;outline-offset:-4px!important}
html body dialog.press-peek button:focus{outline:0!important}html body dialog.press-peek button:focus-visible{outline:2px solid #fff!important;outline-offset:3px!important}

/* WKWebView image callouts otherwise replace the app menu during a real hold. */
#modalImage,.moment-photo-container[data-photo-id],.album-photo-card[data-id],#resultsGrid .photo-card[data-photo-id],.device-review-preview,.viewer-overview-photo,.memory-card[data-photo-id],.profile-btn[data-child],.sidebar-album-card[data-child],.child-card[data-child-index] {
    -webkit-touch-callout:none;
}

/* ui-kit.css — one visual language for every page (direction C: soft colour blocks). Loaded last on each page.
   1 tokens · 2 base · 3 top bar and back · 4 buttons · 5 fields · 6 surfaces and lists · 7 disclosure ·
   8 dialogs, sheets, notices · 9 home, same-day, search · 10 page details · icons (generated)
   The older class names are mapped onto the same few parts, so a page never mixes two looks.
   Rules start with "html body.app-ui.app-ui" so they win over the older layers. */

/* ---------- 1. tokens ---------- */
:root{
--tk-bg:#F1F5EF;--tk-surface:#FFFFFF;--tk-ink:#1B2A22;--tk-muted:#51605A;--tk-faint:#8A978F;
--tk-line:#D5E2D5;--tk-line-soft:#E6EEE6;
--tk-primary:#2F6B4F;--tk-primary-press:#245640;--tk-on-primary:#FFFFFF;
--tk-tint:#DDEBDD;--tk-tint-press:#CBDFCB;--tk-tint-ink:#1F4D38;--tk-tint-soft:#E7F0E6;
--tk-honey:#FFE7A8;--tk-honey-press:#F9DA86;--tk-honey-ink:#4A3A00;
--tk-danger:#B3261E;--tk-danger-tint:#FBE6E3;--tk-danger-press:#F6D3CE;
--tk-scrim:rgba(27,42,34,.45);
--tk-r-tile:14px;--tk-r-field:16px;--tk-r-block:18px;--tk-r-btn:22px;--tk-r-card:24px;--tk-r-dialog:28px;--tk-gutter:16px;
--tk-shadow:0 10px 30px rgba(27,42,34,.18);--tk-shadow-float:0 6px 16px rgba(27,42,34,.24);--tk-focus:0 0 0 3px rgba(47,107,79,.24);
--tk-font:-apple-system,BlinkMacSystemFont,"PingFang TC","Noto Sans TC","Helvetica Neue",system-ui,sans-serif;
--app-bg:var(--tk-bg);--app-surface:var(--tk-surface);--app-ink:var(--tk-ink);--app-muted:var(--tk-muted);--app-line:var(--tk-line);--app-accent:var(--tk-primary);--app-secondary:var(--tk-tint);
--press-background:var(--tk-bg);--press-surface:var(--tk-surface);--press-text:var(--tk-ink);--press-secondary:var(--tk-muted);--press-blue:var(--tk-primary);--press-danger:var(--tk-danger);--press-divider:var(--tk-line);
}

/* ---------- 2. base ---------- */
html{background:var(--tk-bg);-webkit-text-size-adjust:100%}
html body.app-ui.app-ui:not(.account-entry-auth){
--color-background:var(--tk-bg);--color-surface:var(--tk-surface);--color-text:var(--tk-ink);--color-text-muted:var(--tk-muted);--color-text-light:var(--tk-muted);--color-border:var(--tk-line);
--ui-ink:var(--tk-ink);--ui-muted:var(--tk-muted);--ui-accent:var(--tk-primary);--ui-line:var(--tk-line);--ui-surface:var(--tk-surface);--ui-secondary:var(--tk-tint);--ui-field:var(--tk-surface);
--ink:var(--tk-ink);--accent:var(--tk-primary);--paper:var(--tk-bg);--line:var(--tk-line);
background:var(--tk-bg);color:var(--tk-ink);font-family:var(--tk-font);-webkit-tap-highlight-color:transparent}
body.app-ui :is(button,input,select,textarea){font-family:inherit}
body.app-ui :is(h1,h2,h3,h4){font-family:inherit;color:var(--tk-ink);letter-spacing:0}
body.app-ui h1{font-size:26px;line-height:32px;font-weight:700}
body.app-ui h2{font-size:20px;line-height:28px;font-weight:700}
body.app-ui h3{font-size:17px;line-height:24px;font-weight:700}
body.app-ui a{color:var(--tk-tint-ink)}
html body.app-ui.app-ui :focus-visible{outline:3px solid var(--tk-primary);outline-offset:2px}
body.app-ui ::selection{background:#CFE3D8}
body.app-ui :is(.app-note,.muted,.storybook-note,.service-notice,small){color:var(--tk-muted)}
/* text that only screen readers read (labels of round icon buttons) */
html body.app-ui.app-ui :is(.tk-sr,.tk-back>span,.tk-icon-btn .btn-label){position:absolute!important;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0}

/* ---------- 3. top bar: round back button, then the page title on the same line ---------- */
html body.app-ui.app-ui .tk-bar{position:sticky;top:0;z-index:40;display:flex;flex-wrap:nowrap;align-items:center;justify-content:flex-start;gap:10px;min-height:56px;margin:0 calc(var(--tk-gutter) * -1) 4px;padding:6px var(--tk-gutter);border:0;background:var(--tk-bg);box-shadow:none}
html body.app-ui.app-ui .tk-bar-space{flex:1 1 auto;min-width:0}
html body.app-ui.app-ui .tk-back{position:relative;display:inline-grid;place-items:center;flex:none;width:44px;height:44px;min-width:44px;min-height:44px;max-width:none;margin:0;padding:0;border:0;border-radius:22px;background:var(--tk-tint);box-shadow:none;color:var(--tk-tint-ink)!important;text-decoration:none!important;-webkit-tap-highlight-color:transparent}
html body.app-ui.app-ui .tk-back>.ti{--ti:var(--tk-i-arrow-left);width:22px;height:22px;margin:0}
html body.app-ui.app-ui .tk-back:active{background:var(--tk-tint-press)}
html body.app-ui.app-ui .tk-title{display:-webkit-box;flex:1 1 auto;min-width:0;margin:0;padding:0;overflow:hidden;-webkit-box-orient:vertical;-webkit-line-clamp:2;color:var(--tk-ink);font-size:22px;line-height:28px;font-weight:700;letter-spacing:0;overflow-wrap:anywhere}
@media(max-width:380px){html body.app-ui.app-ui .tk-title{font-size:20px;line-height:26px}}
/* edge-swipe hint (created by ui-kit.js) */
.tk-swipe{position:fixed;left:0;top:50%;z-index:2147483600;display:grid;place-items:center;width:44px;height:44px;margin-top:-22px;border-radius:22px;background:var(--tk-ink);color:#fff;opacity:0;transform:translateX(-52px);pointer-events:none}
.tk-swipe .ti{width:24px;height:24px}
/* what stays of the old title block under the bar: the subtitle */
html body.app-ui.app-ui :is(.app-header,.settings-header,.golden-heading,.intro){margin:0 0 16px;padding:0;border:0;background:none;box-shadow:none}
html body.app-ui.app-ui :is(.app-header,.settings-header,.golden-heading,.intro) h1{margin:4px 0 6px;font-size:26px;line-height:32px;font-weight:700;color:var(--tk-ink)}
html body.app-ui.app-ui :is(.app-subtitle,.transfer-subtitle,.intro p,.golden-heading>p){margin:0;font-size:15px;line-height:22px;color:var(--tk-muted)}
/* page shells share one gutter */
html body.app-ui.app-ui:not(.account-entry-auth) :is(.app-shell,.account-shell,.memory-shell),html body.app-ui.app-ui.line-page main,html body.app-ui.app-ui.transfer-page main.settings-container{box-sizing:border-box;max-width:720px;margin:0 auto;padding:0 var(--tk-gutter) calc(32px + env(safe-area-inset-bottom,0px))!important}

/* ---------- 4. buttons: pills; the usual second choice is a soft green block ---------- */
html body.app-ui.app-ui :is(.tk-btn,.btn,.btn-tag,.btn-primary,.btn-secondary,.btn-danger,.action-btn,.action-link,.upload-btn,.reload-btn,.coffee-buy,.save-settings,.entry-primary,button.secondary,a.secondary,button.danger,button.primary,.modal-download-btn,.golden-entry-link),
html body.app-ui.app-ui :is(main,dialog,form,fieldset,.timehut-dialog,.modal-card,.upload-modal-content,.modal-info) button:not([class]){
display:inline-flex;align-items:center;justify-content:center;gap:6px;box-sizing:border-box;width:auto;min-width:0;min-height:44px;height:auto;margin:0;padding:10px 18px;border:0;border-radius:var(--tk-r-btn);box-shadow:none;font-size:15px;line-height:22px;font-weight:700;letter-spacing:0;text-align:center;text-decoration:none;text-shadow:none;white-space:normal;cursor:pointer;-webkit-tap-highlight-color:transparent;transition:background-color .12s,opacity .12s,transform .12s}
html body.app-ui.app-ui :is(.tk-btn,.btn,.btn-tag,.btn-primary,.btn-secondary,.btn-danger,.action-btn,.action-link,.upload-btn,.reload-btn,.coffee-buy,.save-settings,.entry-primary,button.secondary,a.secondary,button.danger,button.primary,.modal-download-btn):active{transform:scale(.98)}
html body.app-ui.app-ui :is(button,.tk-btn):disabled,html body.app-ui.app-ui :is(button,.tk-btn)[aria-disabled=true]{opacity:.45;cursor:default;transform:none}
html body.app-ui.app-ui :is(.tk-btn,.action-btn,.btn-danger,.btn-secondary,.btn-tag,.modal-download-btn,button)>.ti{flex:none}
/* primary */
html body.app-ui.app-ui :is(.tk-btn--primary,.btn-tag,.btn-primary,.upload-btn,.coffee-buy,.save-settings,.entry-primary,.action-link,button.primary),
html body.app-ui.app-ui :is(main,dialog,form,fieldset,.timehut-dialog,.modal-card,.upload-modal-content,.modal-info) button[type=submit]:not([class]),
html body.app-ui.app-ui #golden-save{background:var(--tk-primary);color:var(--tk-on-primary)}
html body.app-ui.app-ui :is(.tk-btn--primary,.btn-tag,.btn-primary,.upload-btn,.coffee-buy,.save-settings,.entry-primary,.action-link,button.primary):active{background:var(--tk-primary-press)}
/* tonal: older "secondary" buttons land here too */
html body.app-ui.app-ui :is(.tk-btn--secondary,.tk-btn--tonal,.btn-secondary,.action-btn,.reload-btn,button.secondary,a.secondary,.modal-download-btn,.golden-entry-link),
html body.app-ui.app-ui :is(main,dialog,form,fieldset,.timehut-dialog,.modal-card,.upload-modal-content,.modal-info) button:not([class]):not([type=submit]){background:var(--tk-tint);color:var(--tk-tint-ink)}
html body.app-ui.app-ui :is(.tk-btn--secondary,.tk-btn--tonal,.btn-secondary,.action-btn,.reload-btn,button.secondary,a.secondary,.modal-download-btn,.golden-entry-link):active{background:var(--tk-tint-press)}
/* text, honey, danger */
html body.app-ui.app-ui :is(.tk-btn--text,.app-text-link){min-height:44px;padding:10px 8px;background:transparent;color:var(--tk-tint-ink);font-size:15px;font-weight:700;text-decoration:none}
html body.app-ui.app-ui .tk-btn--honey{background:var(--tk-honey);color:var(--tk-honey-ink)}
html body.app-ui.app-ui .tk-btn--honey:active{background:var(--tk-honey-press)}
html body.app-ui.app-ui :is(.tk-btn--danger,.btn-danger,button.danger){background:var(--tk-danger-tint);color:var(--tk-danger)}
html body.app-ui.app-ui :is(.tk-btn--danger,.btn-danger,button.danger):active{background:var(--tk-danger-press)}
html body.app-ui.app-ui :is(.tk-btn--danger-solid,.timehut-dialog.danger-dialog .btn-danger){background:var(--tk-danger);color:#fff}
html body.app-ui.app-ui .danger-text{color:var(--tk-danger)!important}
/* sizes */
html body.app-ui.app-ui .tk-btn--lg{min-height:48px;border-radius:24px;font-size:16px}
html body.app-ui.app-ui .tk-btn--block{display:flex;width:100%}
/* round icon button */
html body.app-ui.app-ui .tk-icon-btn{position:relative;display:inline-grid;place-items:center;flex:none;width:44px;height:44px;min-height:44px;margin:0;padding:0;border:0;border-radius:22px;background:var(--tk-tint);box-shadow:none;color:var(--tk-tint-ink);cursor:pointer;list-style:none;-webkit-tap-highlight-color:transparent}
html body.app-ui.app-ui .tk-icon-btn>.ti{width:22px;height:22px}
html body.app-ui.app-ui :is(.tk-icon-btn:active,.tk-icon-btn.active,.tk-icon-btn[aria-pressed=true]){background:var(--tk-tint-press)}
/* icon in front of a label that scripts rewrite as plain text: class="tk-ib ti-download" */
html body.app-ui.app-ui .tk-ib::before{content:"";display:inline-block;flex:none;width:1.25em;height:1.25em;margin-right:.35em;vertical-align:-.24em;background-color:currentColor;-webkit-mask:var(--ti) center/contain no-repeat;mask:var(--ti) center/contain no-repeat}
html body.app-ui.app-ui :is(button,a).tk-ib{display:inline-flex;align-items:center;justify-content:center}
html body.app-ui.app-ui :is(button,a).tk-ib::before{margin-right:6px;vertical-align:0}

/* ---------- 5. fields ---------- */
html body.app-ui.app-ui :is(input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=file]),select,textarea){box-sizing:border-box;min-height:48px;padding:10px 14px;border:1px solid var(--tk-line);border-radius:var(--tk-r-field);background:var(--tk-surface);box-shadow:none;color:var(--tk-ink);font-size:17px;line-height:24px;outline:0}
html body.app-ui.app-ui :is(input:not([type=checkbox]):not([type=radio]),select,textarea):focus{border-color:var(--tk-primary);box-shadow:var(--tk-focus)}
html body.app-ui.app-ui :is(input,textarea)::placeholder{color:var(--tk-faint);opacity:1}
html body.app-ui.app-ui select{appearance:none;-webkit-appearance:none;padding-right:40px!important;background-color:var(--tk-surface);background-image:var(--tk-i-chevron-down-muted)!important;background-repeat:no-repeat!important;background-position:right 12px center!important;background-size:20px!important}
html body.app-ui.app-ui :is(input[type=checkbox],input[type=radio]){width:22px;height:22px;min-height:0;margin:0 8px 0 0;accent-color:var(--tk-primary);flex:none;vertical-align:-4px}
html body.app-ui.app-ui label{color:var(--tk-ink)}
/* search pill */
html body.app-ui.app-ui .tk-search{display:flex;align-items:center;gap:8px;box-sizing:border-box;width:100%;max-width:none;min-height:54px;margin:0;padding:0 5px 0 18px;border:0;border-radius:27px;background:var(--tk-surface);box-shadow:none;color:var(--tk-muted)}
html body.app-ui.app-ui .tk-search:focus-within{box-shadow:var(--tk-focus)}
html body.app-ui.app-ui .tk-search>.ti{width:20px;height:20px;flex:none}
html body.app-ui.app-ui .tk-search>input{flex:1 1 auto;min-width:0;min-height:44px!important;padding:0!important;border:0!important;border-radius:0!important;background:transparent!important;box-shadow:none!important;font-size:16px;line-height:22px;color:var(--tk-ink)}
html body.app-ui.app-ui .tk-search-go{flex:none;min-height:44px;margin:0;padding:0 14px;border:0;border-radius:22px;background:var(--tk-tint);box-shadow:none;color:var(--tk-tint-ink);font-size:15px;line-height:20px;font-weight:700}
html body.app-ui.app-ui .tk-search-go:active{background:var(--tk-tint-press)}
html body.app-ui.app-ui .tk-search>input:placeholder-shown~.tk-search-go{display:none}
/* On phone home, submit search through the keyboard action. */
@media(max-width:760px){
  html body.app-ui.app-ui.timeline-page .tk-search-go{display:none}
}

html body.app-ui.app-ui .tk-search>.tk-btn{flex:none;min-height:44px;padding:0 14px;border-radius:22px}
html body.app-ui.app-ui .tk-search-clear{display:grid;place-items:center;flex:none;width:44px;height:44px;min-height:44px;margin:0;padding:0;border:0;border-radius:22px;background:transparent;box-shadow:none;color:var(--tk-muted)}
html body.app-ui.app-ui .tk-search-clear>.ti{width:18px;height:18px}

/* ---------- 6. surfaces and lists: white cards without borders on the soft green page ---------- */
html body.app-ui.app-ui :is(.app-card,.app-list,.card,.panel,.settings-section,.line-card,.line-status-card,.transfer-card,.tk-card){border:0;border-radius:var(--tk-r-card);background:var(--tk-surface);box-shadow:none}
html body.app-ui.app-ui :is(.app-card,.card,.panel,.settings-section,.line-card,.line-status-card,.tk-card){padding:16px}
html body.app-ui.app-ui .app-list{overflow:hidden;margin:6px 0 20px;padding:4px 0}
html body.app-ui.app-ui .app-row{display:flex;align-items:center;gap:12px;width:100%;min-height:60px;margin:0;padding:10px 16px;border:0;border-radius:0;background:var(--tk-surface);box-shadow:none;color:var(--tk-ink)!important;font-size:16px;line-height:22px;font-weight:700;text-align:left;text-decoration:none}
html body.app-ui.app-ui .app-row+.app-row{border-top:0}
html body.app-ui.app-ui .app-row:active{background:var(--tk-tint-soft)}
html body.app-ui.app-ui .app-row>:is(.app-row-copy,span:not([aria-hidden])){flex:1 1 auto;min-width:0}
html body.app-ui.app-ui .app-row-copy strong{display:block;font-size:16px;line-height:22px;font-weight:700}
html body.app-ui.app-ui .app-row-copy small{display:block;margin-top:2px;font-size:13px;line-height:18px;font-weight:400;color:var(--tk-muted)}
html body.app-ui.app-ui .app-row>.ti:last-child{flex:none;width:18px;height:18px;margin-left:auto;color:var(--tk-muted)}
html body.app-ui.app-ui .app-row.danger-text{color:var(--tk-danger)!important}
html body.app-ui.app-ui .app-row.app-list{border-radius:var(--tk-r-card);padding:10px 16px}
html body.app-ui.app-ui .tk-tile{display:grid;place-items:center;flex:none;width:40px;height:40px;border-radius:20px;background:var(--tk-tint);color:var(--tk-tint-ink)}
html body.app-ui.app-ui .tk-tile::before{content:"";width:20px;height:20px;background-color:currentColor;-webkit-mask:var(--ti) center/contain no-repeat;mask:var(--ti) center/contain no-repeat}
html body.app-ui.app-ui .tk-tile--honey{background:var(--tk-honey);color:var(--tk-honey-ink)}
html body.app-ui.app-ui .tk-tile--danger{background:var(--tk-danger-tint);color:var(--tk-danger)}
html body.app-ui.app-ui :is(.settings-group>h2,.tk-group-title){margin:18px 6px 6px;font-size:13px;line-height:18px;font-weight:700;color:var(--tk-muted);letter-spacing:0}
/* chips: soft green inside white cards, white on the page, honey for 拾光-related labels */
html body.app-ui.app-ui :is(.tk-chip,.moment-tag,.viewer-tag){display:inline-flex;align-items:center;gap:6px;min-height:32px;padding:0 12px;border:0;border-radius:16px;background:var(--tk-tint);box-shadow:none;color:var(--tk-tint-ink);font-size:13px;line-height:18px;font-weight:600}
html body.app-ui.app-ui .golden-badge{display:inline-flex;align-items:center;min-height:32px;padding:0 12px;border:0;border-radius:16px;background:var(--tk-honey);box-shadow:none;color:var(--tk-honey-ink);font-size:13px;line-height:18px;font-weight:700}
/* notes */
html body.app-ui.app-ui :is(.status-note,.notice,.tk-note){padding:12px 16px;border:0;border-radius:var(--tk-r-block);background:var(--tk-tint-soft);color:var(--tk-ink);font-size:15px;line-height:22px}

/* ---------- 7. disclosure ---------- */
html body.app-ui.app-ui details>summary{display:flex;align-items:center;gap:8px;min-height:48px;list-style:none;cursor:pointer;font-size:16px;line-height:22px;font-weight:700;color:var(--tk-ink);-webkit-tap-highlight-color:transparent}
html body.app-ui.app-ui details>summary::-webkit-details-marker{display:none}
html body.app-ui.app-ui details>summary::marker{content:""}
html body.app-ui.app-ui details>summary::after{content:"";flex:none;width:20px;height:20px;margin-left:auto;background-color:var(--tk-muted);-webkit-mask:var(--tk-i-chevron-down) center/contain no-repeat;mask:var(--tk-i-chevron-down) center/contain no-repeat;transition:transform .15s}
html body.app-ui.app-ui details[open]>summary::after{transform:rotate(180deg)}
html body.app-ui.app-ui details:is(.card,.panel,.line-card){padding:4px 16px}
html body.app-ui.app-ui details:is(.card,.panel,.line-card)[open]{padding-bottom:16px}

/* ---------- 8. dialogs, sheets, notices ---------- */
html body.app-ui.app-ui :is(.modal-overlay.timehut-dialog,.tk-layer){position:fixed;inset:0;z-index:2147483000;display:flex;align-items:center;justify-content:center;padding:16px;background:var(--tk-scrim)}
html body.app-ui.app-ui :is(.timehut-dialog:not(.line-group-dialog) .modal-card,.tk-dialog,dialog:not(.device-photo-picker)){box-sizing:border-box;width:min(100%,420px);max-height:calc(100vh - 48px);padding:0;border:0;border-radius:var(--tk-r-dialog);background:var(--tk-surface);box-shadow:var(--tk-shadow);color:var(--tk-ink);overflow:hidden}
html body.app-ui.app-ui dialog::backdrop{background:var(--tk-scrim)}
html body.app-ui.app-ui .tk-dialog{display:flex;flex-direction:column}
html body.app-ui.app-ui .tk-dialog-body{padding:22px 22px 4px;overflow:auto}
html body.app-ui.app-ui .tk-dialog-body h2{margin:0 0 8px;font-size:19px;line-height:26px;font-weight:700}
html body.app-ui.app-ui .tk-dialog-body p{margin:0;font-size:16px;line-height:24px;color:var(--tk-ink);white-space:pre-line;overflow-wrap:anywhere}
html body.app-ui.app-ui .tk-dialog-actions{display:flex;gap:8px;padding:16px 20px 20px}
html body.app-ui.app-ui .tk-dialog-actions>.tk-btn{flex:1 1 auto;text-wrap:balance;min-height:48px;border-radius:24px;font-size:16px}
html body.app-ui.app-ui .dialog-close{display:grid;place-items:center;width:44px;height:44px;min-height:44px;padding:0;border:0;border-radius:22px;box-shadow:none}
html body.app-ui.app-ui .dialog-close>.ti{width:20px;height:20px}
/* toast */
html body.app-ui.app-ui .toast-container:not(.viewer-toast),.tk-toasts{position:fixed;left:16px;right:16px;bottom:calc(20px + env(safe-area-inset-bottom,0px));top:auto;z-index:2147483200;display:flex;flex-direction:column;align-items:center;gap:8px;pointer-events:none;transform:none}
html body.app-ui.app-ui .toast,.tk-toast{display:flex;align-items:flex-start;gap:10px;box-sizing:border-box;max-width:min(100%,460px);margin:0;padding:12px 18px;border:0;border-radius:var(--tk-r-block);background:var(--tk-ink);box-shadow:var(--tk-shadow);color:#fff;font-size:15px;line-height:22px;font-weight:500;white-space:pre-line;overflow-wrap:anywhere;pointer-events:auto}
html body.app-ui.app-ui .toast>.ti,.tk-toast>.ti{flex:none;width:20px;height:20px;margin-top:1px;color:#BFE3CF}
html body.app-ui.app-ui .toast.error>.ti,.tk-toast.is-error>.ti{color:#FFB4AB}
html body.app-ui.app-ui .toast.warning>.ti,.tk-toast.is-warning>.ti{color:#FFE7A8}
.tk-toast{opacity:0;transform:translateY(8px);transition:opacity .16s,transform .16s}
.tk-toast.is-in{opacity:1;transform:none}
html body.app-ui.app-ui .toast.hide{opacity:0}
@media(prefers-reduced-motion:reduce){.tk-toast{transition:none}}

/* ---------- 9. home, same-day, search ---------- */
html body.app-ui.app-ui .header.tk-top{position:sticky;top:0;z-index:100;display:flex;flex-direction:column;align-items:stretch;gap:8px;width:auto;height:auto;min-height:0;margin:0;padding:6px var(--tk-gutter) 6px;border:0;background:var(--tk-bg);box-shadow:none;overflow:visible}
html body.app-ui.app-ui .tk-top-row{display:flex;align-items:center;gap:8px;min-height:48px}
html body.app-ui.app-ui .tk-top-title{flex:1 1 auto;min-width:0;overflow:hidden;padding-left:4px;color:var(--tk-ink)!important;font-size:22px;line-height:28px;font-weight:700;text-decoration:none;text-overflow:ellipsis;white-space:nowrap}
@media(max-width:359px){html body.app-ui.app-ui .tk-top-title{font-size:19px;letter-spacing:-0.2px}}
html body.app-ui.app-ui .tk-top-search{display:flex;flex-direction:column;gap:12px;padding:6px var(--tk-gutter) 14px;background:var(--tk-bg)}
html body.app-ui.app-ui .tk-top-chips{display:flex;align-items:center;gap:8px;min-width:0}
html body.app-ui.app-ui .tk-top-chips>.tk-btn{flex:none;padding:10px 16px;white-space:nowrap}
html body.app-ui.app-ui .tk-top-chips>.tk-btn>.ti{width:18px;height:18px}
html body.app-ui.app-ui .tk-top-chips>.tk-btn.active{background:var(--tk-primary);color:#fff}
html body.app-ui.app-ui .tk-top-status{flex:1 1 auto;min-width:0;overflow:hidden;color:var(--tk-muted);font-size:13px;line-height:18px;text-align:right;text-overflow:ellipsis;white-space:nowrap}
html body.app-ui.app-ui.timeline-page:is(.select-mode,.moment-select-mode) .tk-top-chips{display:none}
/* upload: the floating button */
html body.app-ui.app-ui .tk-fab{position:fixed;right:max(16px,env(safe-area-inset-right,0px));bottom:calc(24px + env(safe-area-inset-bottom,0px));z-index:90;display:inline-flex;align-items:center;justify-content:center;gap:8px;box-sizing:border-box;min-height:56px;margin:0;padding:0 22px;border:0;border-radius:28px;background:var(--tk-primary);box-shadow:var(--tk-shadow-float);color:#fff;font-size:16px;line-height:22px;font-weight:700;cursor:pointer;-webkit-tap-highlight-color:transparent}
html body.app-ui.app-ui .tk-fab>.ti{width:20px;height:20px}
html body.app-ui.app-ui .tk-fab:active{background:var(--tk-primary-press);transform:scale(.98)}
html body.app-ui.app-ui:is(.select-mode,.moment-select-mode) .tk-fab{display:none}
html body.app-ui.app-ui.tk-fab-away .tk-fab{opacity:0;transform:translateY(24px);pointer-events:none}
html body.app-ui.app-ui.timeline-page .main-content{padding-bottom:calc(96px + env(safe-area-inset-bottom,0px))}
/* notes and the "內容已更新" offer sit above the floating button */
html body.app-ui.app-ui.timeline-page:not(.select-mode):not(.moment-select-mode) :is(.tk-toasts,.toast-container:not(.viewer-toast)){bottom:calc(96px + env(safe-area-inset-bottom,0px))}
html body.app-ui.app-ui.timeline-page .app-refresh-offer{bottom:calc(96px + env(safe-area-inset-bottom,0px))!important}
/* wide screens keep the top area in a readable column */
@media(min-width:800px){html body.app-ui.app-ui .tk-top-row,html body.app-ui.app-ui .tk-top-search>*,html body.app-ui.app-ui .header.tk-top>.tk-search{box-sizing:border-box;width:100%;max-width:720px;margin-left:auto;margin-right:auto}}
/* the 選取 menu (a round button in the top row) */
html body.app-ui.app-ui .timeline-actions{position:relative;min-width:0;flex:none}
html body.app-ui.app-ui .timeline-actions>summary::after{display:none}
html body.app-ui.app-ui .timeline-action-menu{position:absolute;right:0;left:auto;top:52px;z-index:1200;display:grid;gap:2px;box-sizing:border-box;min-width:220px;max-width:calc(100vw - 32px);padding:8px;border:0;border-radius:var(--tk-r-card);background:var(--tk-surface);box-shadow:var(--tk-shadow)}
html body.app-ui.app-ui .tk-menu-item{display:flex;align-items:center;gap:12px;width:100%;min-height:48px;margin:0;padding:0 12px;border:0;border-radius:var(--tk-r-field);background:transparent;box-shadow:none;color:var(--tk-ink);font-size:16px;line-height:22px;font-weight:700;text-align:left;text-decoration:none}
html body.app-ui.app-ui .tk-menu-item>.ti{width:22px;height:22px;color:var(--tk-tint-ink)}
html body.app-ui.app-ui :is(.tk-menu-item:active,.tk-menu-item.active){background:var(--tk-tint)}
/* same-day page: the date is the title; age and counts are chips */
html body.app-ui.app-ui.album-detail-page .album-header{display:block;min-height:0;margin:0 0 12px;padding:0!important;border:0;border-radius:0;background:none!important;box-shadow:none}
html body.app-ui.app-ui.album-detail-page .album-cover-frame{display:none}
html body.app-ui.app-ui.album-detail-page .album-heading-copy{display:flex;flex-wrap:wrap;align-items:center;gap:8px}
html body.app-ui.app-ui.album-detail-page .album-heading-copy h2{display:none}
html body.app-ui.app-ui.album-detail-page :is(#momentAge,#momentInfo){display:inline-flex;align-items:center;min-height:32px;margin:0;padding:0 12px;border-radius:16px;background:var(--tk-surface);color:var(--tk-ink);font-size:13px;line-height:18px;font-weight:600}
html body.app-ui.app-ui.album-detail-page #momentAge:empty{display:none}
html body.app-ui.app-ui.album-detail-page .album-photo-card{border:0;border-radius:18px;background:var(--tk-tint-soft);overflow:hidden}

/* ---------- 10. page details ---------- */
/* bars that sit outside the page column (memories, subjects) and the account page's bar */
html body.app-ui.app-ui .tk-bar--page{margin:0;padding:6px max(var(--tk-gutter),calc((100% - 720px) / 2 + var(--tk-gutter)));border:0;box-shadow:none;background:var(--tk-bg)}
html body.app-ui.app-ui .tk-bar--account{display:none}
html body.app-ui.app-ui.is-authenticated:not(.account-entry-auth):not(.account-entry-pending) .tk-bar--account{display:flex}
html body.app-ui.app-ui .tk-bar--account .tk-title{display:none}
html body.app-ui.app-ui.account-security-mode .tk-bar--account .tk-title{display:-webkit-box}
html body.app-ui.app-ui .account-connection-state{margin:12px var(--tk-gutter)}
html body.app-ui.app-ui input[type=search]{-webkit-appearance:none;appearance:none}
html body.app-ui.app-ui input[type=search]::-webkit-search-cancel-button,html body.app-ui.app-ui input[type=search]::-webkit-search-decoration{-webkit-appearance:none;display:none}
/* a text link that leads somewhere, with its chevron */
html body.app-ui.app-ui .tk-link-row{display:flex;align-items:center;gap:8px;min-height:44px;color:var(--tk-tint-ink);font-size:16px;line-height:22px;font-weight:700;text-decoration:none}
html body.app-ui.app-ui .tk-link-row>span{flex:1 1 auto;min-width:0}
html body.app-ui.app-ui .tk-link-row>.ti{width:18px;height:18px;color:var(--tk-muted)}
html body.app-ui.app-ui .tk-chip-x{position:relative;min-height:32px}
html body.app-ui.app-ui .tk-chip-x::before{content:"";position:absolute;inset:-6px -2px}
html body.app-ui.app-ui .tk-chip-x::after{content:"";width:14px;height:14px;margin-left:6px;background-color:currentColor;-webkit-mask:var(--tk-i-x) center/contain no-repeat;mask:var(--tk-i-x) center/contain no-repeat;opacity:.7}
/* close buttons, also those written by older scripts as a "✕" character: a round soft green button */
html body.app-ui.app-ui :is(.dialog-close,.upload-modal .modal-close,.sidebar-close,.batch-view-close,.queue-remove){display:grid;place-items:center;width:44px;height:44px;min-height:44px;padding:0;border:0;border-radius:22px;background:var(--tk-tint)!important;box-shadow:none;color:var(--tk-tint-ink)!important;font-size:0!important;line-height:0!important}
html body.app-ui.app-ui :is(.dialog-close,.upload-modal .modal-close,.sidebar-close,.batch-view-close,.queue-remove)>.ti{width:20px;height:20px}
html body.app-ui.app-ui :is(.dialog-close:empty,.dialog-close:not(:has(.ti)))::before{content:"";width:20px;height:20px;background-color:currentColor;-webkit-mask:var(--tk-i-x) center/contain no-repeat;mask:var(--tk-i-x) center/contain no-repeat}
/* legal and footer cross-links: white pills on the page */
html body.app-ui.app-ui :is(.legal-nav,.service-links){display:flex;flex-wrap:wrap;gap:8px;margin:0 0 16px;padding:0;border:0}
html body.app-ui.app-ui :is(.legal-nav,.service-links) a{display:inline-flex;align-items:center;min-height:36px;padding:0 14px;border-radius:18px;background:var(--tk-surface);color:var(--tk-tint-ink);font-size:14px;line-height:20px;font-weight:700;text-decoration:none}
html body.app-ui.app-ui :is(.legal-nav,.service-links) a::after{content:none}
/* photo selection marks (shown only while selecting; the older layer places them) */
html body.app-ui.app-ui :is(.timeline-photo-select,.select-checkbox){padding:0;border:2px solid #fff;border-radius:50%;background:rgba(27,42,34,.32);box-shadow:0 1px 3px rgba(0,0,0,.28);color:#fff;font-size:0}
html body.app-ui.app-ui :is(.timeline-photo-select[aria-pressed=true],.album-photo-card.selected .select-checkbox){border-color:#fff;background:var(--tk-primary)}
html body.app-ui.app-ui .timeline-photo-select[aria-pressed=true]::before,html body.app-ui.app-ui .album-photo-card.selected .select-checkbox::after{content:"";display:block;width:16px;height:16px;margin:auto;background-color:#fff;-webkit-mask:var(--tk-i-check) center/contain no-repeat;mask:var(--tk-i-check) center/contain no-repeat}
html body.app-ui.app-ui.select-mode .album-photo-card .select-checkbox{display:grid;place-items:center;width:28px;height:28px;min-height:28px}
html body.app-ui.app-ui.select-mode :is(.moment-photo-container.selected,.album-photo-card.selected){outline:3px solid var(--tk-primary);outline-offset:-3px;border-color:var(--tk-primary)}
/* icon holders that used to hold an emoji */
html body.app-ui.app-ui :is(.empty-icon,.dropzone-icon,.confirm-icon){display:grid;place-items:center;color:var(--tk-tint-ink);font-size:40px;line-height:1}
html body.app-ui.app-ui :is(.empty-icon,.dropzone-icon,.confirm-icon)>.ti{width:40px;height:40px}
html body.app-ui.app-ui .album-card-emoji{display:grid;place-items:center;flex:none;width:44px;height:44px;border-radius:22px;background:var(--tk-tint);color:var(--tk-tint-ink);font-size:22px;overflow:hidden}
html body.app-ui.app-ui .album-card-emoji img{width:100%;height:100%;object-fit:cover}
html body.app-ui.app-ui :is(.uploader-icon,.tab-icon)>.ti{width:20px;height:20px}
html body.app-ui.app-ui .video-badge{display:grid;place-items:center;color:#fff}
html body.app-ui.app-ui .video-badge>.ti{width:16px;height:16px}
/* photo viewer controls */
html body.app-ui.app-ui .photo-modal :is(.modal-close,.modal-nav){display:grid;place-items:center;width:44px;height:44px;min-height:44px;padding:0;border:0;border-radius:22px;background:rgba(255,255,255,.14);box-shadow:none;color:#fff;font-size:0}
html body.app-ui.app-ui .photo-modal :is(.modal-close,.modal-nav)>.ti{width:24px;height:24px}
html body.app-ui.app-ui .photo-modal :is(.modal-close,.modal-nav):active{background:rgba(255,255,255,.26)}
html body.app-ui.app-ui .photo-viewer-tools button{display:inline-flex;align-items:center;justify-content:center;min-width:44px;min-height:44px;padding:0 14px;border:1px solid rgba(255,255,255,.28);border-radius:22px;background:rgba(255,255,255,.1);box-shadow:none;color:#fff;font-size:15px;line-height:20px;font-weight:700}
html body.app-ui.app-ui .photo-modal.viewer-immersive .photo-viewer-tools button{background:#26312de6}
html body.app-ui.app-ui .photo-viewer-tools button:empty::before{margin-right:0}
@media(max-width:768px){html body.app-ui.app-ui .photo-modal:not(.viewer-immersive) :is(.modal-prev,.modal-next){top:calc(80px + 14dvh)}}
/* home: album card */
html body.app-ui.app-ui.timeline-page .timeline-header{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:4px 12px;min-height:0;margin:0 0 16px;padding:18px;border:0;border-radius:var(--tk-r-card);background:var(--tk-surface);box-shadow:none;text-align:left;overflow:visible}
html body.app-ui.app-ui.timeline-page .timeline-header::before,html body.app-ui.app-ui.timeline-page .timeline-header::after{display:none}
html body.app-ui.app-ui.timeline-page .timeline-header>*{margin:0;max-width:none}
html body.app-ui.app-ui.timeline-page .timeline-header :is(.timeline-eyebrow,.timeline-hint){display:none}
html body.app-ui.app-ui.timeline-page .timeline-header .current-child-name{grid-column:1;display:block;margin:0;font-size:24px;line-height:30px;font-weight:700;color:var(--tk-ink)}
html body.app-ui.app-ui.timeline-page .timeline-header .current-child-age{grid-column:1;grid-row:2;display:block;margin:0;font-size:14px;line-height:20px;font-weight:400;color:var(--tk-muted);opacity:1}
html body.app-ui.app-ui.timeline-page .timeline-header .album-create-entry{grid-column:2;grid-row:1 / span 2;align-self:center;justify-self:end;margin:0}
html body.app-ui.app-ui.timeline-page:is(.select-mode,.moment-select-mode) .timeline-header .album-create-entry{display:none}
html body.app-ui.app-ui .album-create-entry{display:inline-flex;align-items:center;justify-content:center;gap:6px;box-sizing:border-box;min-height:44px;padding:10px 16px;border:0;border-radius:22px;background:var(--tk-tint);box-shadow:none;color:var(--tk-tint-ink);font-size:15px;line-height:22px;font-weight:700;text-decoration:none}
html body.app-ui.app-ui .album-create-entry:active{background:var(--tk-tint-press)}
html body.app-ui.app-ui .album-create-entry>.ti{width:18px;height:18px}
/* home: age sections and day cards */
html body.app-ui.app-ui.timeline-page .age-group-header{display:flex;flex-wrap:wrap;align-items:baseline;gap:4px 10px;margin:0;padding:8px 4px 6px;border:0}
html body.app-ui.app-ui.timeline-page .age-group-header :is(h2,h3,.age-group-title){margin:0;font-size:18px;line-height:26px;font-weight:700;color:var(--tk-ink)}
html body.app-ui.app-ui.timeline-page .age-group-summary{font-size:13px;line-height:18px;color:var(--tk-muted)}
html body.app-ui.app-ui.timeline-page .moment-item{padding:16px;border:0;border-radius:var(--tk-r-card);background:var(--tk-surface);box-shadow:none}
html body.app-ui.app-ui.timeline-page .moment-header{margin:0 0 12px}
html body.app-ui.app-ui.timeline-page .moment-full-date{font-size:16px;line-height:22px;font-weight:700;color:var(--tk-ink)}
html body.app-ui.app-ui.timeline-page .moment-age{font-size:13px;line-height:18px;color:var(--tk-muted)}
html body.app-ui.app-ui.timeline-page .moment-title{margin:12px 0 0;font-size:15px;line-height:22px;font-weight:600;color:var(--tk-ink)}
html body.app-ui.app-ui.timeline-page .moment-footer{padding:8px 0 0}
html body.app-ui.app-ui.timeline-page .moment-stats-right{display:flex;flex-direction:row-reverse;flex-wrap:nowrap;align-items:center;justify-content:space-between;gap:8px;font-size:13px;line-height:18px;color:var(--tk-muted)}
html body.app-ui.app-ui .moment-album-link{display:inline-flex;align-items:center;gap:4px;flex:none;min-height:44px;margin:0;padding:0 16px;border:0;border-radius:22px;background:var(--tk-tint);color:var(--tk-tint-ink);font-size:15px;line-height:22px;font-weight:700;cursor:pointer}
html body.app-ui.app-ui .moment-album-link>.ti{width:18px;height:18px}
html body.app-ui.app-ui .moment-album-link:active{background:var(--tk-tint-press)}
html body.app-ui.app-ui .moment-grid :is(.moment-photo-container,img){border-radius:var(--tk-r-tile)}
html body.app-ui.app-ui.storybook-page:not(.moment-select-mode) .moment-grid[data-count="2"]{height:auto}
html body.app-ui.app-ui .moment-overlay{border-radius:var(--tk-r-tile);background:rgba(47,107,79,.82);color:#fff;font-weight:700}
/* selection sheet: a floating white card; actions three across, icon above label */
html body.app-ui.app-ui :is(.selection-bar,.moment-selection-bar){box-sizing:border-box;max-height:none;overflow:visible;padding:12px;border:0;border-radius:var(--tk-r-dialog);background:var(--tk-surface);box-shadow:0 8px 28px rgba(27,42,34,.2);color:var(--tk-ink)}
html body.app-ui.app-ui :is(.selection-bar,.moment-selection-bar) .selection-info{margin:0 0 8px;font-size:15px;line-height:22px;font-weight:700;color:var(--tk-ink);text-align:center}
html body.app-ui.app-ui :is(.selection-bar,.moment-selection-bar) .selection-actions{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;width:100%}
html body.app-ui.app-ui :is(.selection-bar,.moment-selection-bar) .selection-actions>button{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;min-width:0;min-height:56px;padding:6px 4px;border:0;border-radius:var(--tk-r-block);background:var(--tk-tint);color:var(--tk-tint-ink);font-size:13px;line-height:18px;font-weight:700;white-space:nowrap}
html body.app-ui.app-ui :is(.selection-bar,.moment-selection-bar) .selection-actions>button::before{width:20px;height:20px;margin:0}
html body.app-ui.app-ui :is(.selection-bar,.moment-selection-bar) .selection-actions>.btn-danger{background:var(--tk-danger-tint);color:var(--tk-danger)}
html body.app-ui.app-ui :is(.selection-bar,.moment-selection-bar) .selection-actions>button:active{background:var(--tk-tint-press)}
@media(max-width:340px){html body.app-ui.app-ui :is(.selection-bar,.moment-selection-bar) .selection-actions>button{font-size:12px;letter-spacing:-.2px}html body.app-ui.app-ui :is(.selection-bar,.moment-selection-bar) .selection-actions{gap:6px}}
/* album chooser (side panel) and time travel sheet */
html body.app-ui.app-ui .album-sidebar{border-radius:0 var(--tk-r-dialog) var(--tk-r-dialog) 0;background:var(--tk-bg);box-shadow:none}
html body.app-ui.app-ui .album-sidebar.open{box-shadow:var(--tk-shadow)}
html body.app-ui.app-ui .sidebar-header{min-height:60px;padding:8px 10px 8px 20px;background:var(--tk-bg);color:var(--tk-ink)}
html body.app-ui.app-ui .sidebar-title{font-size:22px;line-height:28px;font-weight:700}
html body.app-ui.app-ui .sidebar-albums{padding:4px 16px 16px}
html body.app-ui.app-ui .sidebar-album-card{display:flex;align-items:center;gap:12px;width:100%;min-height:68px;margin:0 0 8px;padding:10px 12px;border:0;border-radius:20px;background:var(--tk-surface);box-shadow:none;color:var(--tk-ink);text-align:left;transform:none}
html body.app-ui.app-ui .sidebar-album-card.active{background:var(--tk-tint);box-shadow:inset 0 0 0 2px var(--tk-primary)}
html body.app-ui.app-ui .album-card-name{display:block;font-size:16px;line-height:22px;font-weight:700;color:var(--tk-ink)}
html body.app-ui.app-ui .album-card-subtitle{display:block;font-size:13px;line-height:18px;color:var(--tk-muted)}
html body.app-ui.app-ui .album-create-sidebar-entry{display:flex;margin:0 16px calc(16px + env(safe-area-inset-bottom,0px))}
html body.app-ui.app-ui .time-travel-menu{border:0;border-radius:var(--tk-r-dialog) var(--tk-r-dialog) 0 0;background:var(--tk-surface);box-shadow:0 -6px 24px rgba(27,42,34,.14)}
html body.app-ui.app-ui .time-travel-header{display:flex;align-items:center;justify-content:space-between;min-height:60px;padding:8px 10px 4px 18px;border-bottom:0}
html body.app-ui.app-ui .time-travel-header h3{margin:0;font-size:19px;line-height:26px;font-weight:700}
html body.app-ui.app-ui .time-travel-item{min-height:48px;border:0;border-radius:var(--tk-r-field);background:var(--tk-bg);color:var(--tk-ink);font-size:16px;font-weight:700}
/* transfer page */
html body.app-ui.app-ui.transfer-page .storybook-install{display:flex;flex-wrap:wrap;gap:8px;margin-top:12px}
html body.app-ui.app-ui.transfer-page .storybook-install>button{flex:1 1 auto}
html body.app-ui.app-ui.transfer-page .transfer-filters{display:flex;flex-wrap:nowrap;gap:2px;margin:0 0 14px;padding:4px;border:0;border-radius:26px;background:var(--tk-tint)}
html body.app-ui.app-ui.transfer-page .transfer-filters button{flex:1 1 0;min-width:0;min-height:44px;padding:0 2px;border:0;border-radius:22px;background:transparent;box-shadow:none;color:var(--tk-tint-ink);font-size:13px;line-height:18px;font-weight:700;white-space:nowrap}
html body.app-ui.app-ui.transfer-page .transfer-filters [aria-pressed=true]{background:var(--tk-surface);color:var(--tk-ink);box-shadow:0 1px 3px rgba(27,42,34,.14)}
html body.app-ui.app-ui.transfer-page .queue-batch-actions{display:flex;gap:8px}
html body.app-ui.app-ui.transfer-page .queue-batch-actions>button{flex:1 1 0}
/* in-app dialogs written by the older dialog helper */
html body.app-ui.app-ui .timehut-dialog:not(.line-group-dialog) .dialog-header{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:16px 12px 4px 22px;border:0;background:none}
html body.app-ui.app-ui .timehut-dialog:not(.line-group-dialog) .dialog-header h3{margin:0;font-size:19px;line-height:26px;font-weight:700}
html body.app-ui.app-ui .timehut-dialog:not(.line-group-dialog) .dialog-body{padding:4px 22px 8px}
html body.app-ui.app-ui .timehut-dialog .dialog-art{display:none}
html body.app-ui.app-ui .timehut-dialog:not(.line-group-dialog) .modal-actions{display:flex;gap:8px;margin:0;padding:12px 20px 20px;border:0;background:none}
html body.app-ui.app-ui .timehut-dialog .modal-actions>.btn{flex:1 1 auto;text-wrap:balance;min-height:48px;border-radius:24px;font-size:16px}
html body.app-ui.app-ui .timehut-dialog .btn-secondary{background:var(--tk-tint)!important;color:var(--tk-tint-ink)!important}
html body.app-ui.app-ui .timehut-dialog .btn-primary{background:var(--tk-primary)!important;color:#fff!important}
html body.app-ui.app-ui .timehut-dialog .btn-danger{background:var(--tk-danger)!important;color:#fff!important}
html body.app-ui.app-ui .timehut-dialog{background:var(--tk-scrim)!important}
html body.app-ui.app-ui .line-group-dialog .dialog-close{position:absolute;right:12px;top:12px}
html body.app-ui.app-ui .timehut-dialog .dialog-album-option{min-height:56px;border:0;border-radius:var(--tk-r-block);background:var(--tk-bg)}
/* memories: chips, progress, notes */
html body.app-ui.app-ui :is(.memory-shell,#memory-viewer) :is(.tag,.ai-tag){display:inline-flex;align-items:center;min-height:28px;padding:0 10px;border:0;border-radius:14px;background:var(--tk-tint);box-shadow:none;color:var(--tk-tint-ink);font-size:13px;line-height:18px;font-weight:600}
html body.app-ui.app-ui :is(.memory-shell,#memory-viewer) button.tag{min-height:32px;font-weight:700}
html body.app-ui.app-ui progress{accent-color:var(--tk-primary)}
html body.app-ui.app-ui .memory-shell progress{width:100%;height:8px;border:0;border-radius:4px;background:var(--tk-tint);overflow:hidden;-webkit-appearance:none;appearance:none}
html body.app-ui.app-ui .memory-shell progress::-webkit-progress-bar{background:var(--tk-tint);border-radius:4px}
html body.app-ui.app-ui .memory-shell progress::-webkit-progress-value{background:var(--tk-primary);border-radius:4px}
html body.app-ui.app-ui :is(.reading-recovery-note,.consent-card){padding:12px 16px;border:0;border-radius:var(--tk-r-block);background:var(--tk-tint-soft);box-shadow:none;color:var(--tk-ink);font-size:15px;line-height:22px}
/* golden: its badge sits with the heading */
html body.app-ui.app-ui .golden-heading .golden-badge{margin:0 0 10px}
/* move-to-another-day and tag sheets */
html body.app-ui.app-ui :is(#moveCollectionModal,#tagModal) .confirm-card{box-sizing:border-box;width:min(100%,420px);padding:22px;border:0;border-radius:var(--tk-r-dialog);background:var(--tk-surface);box-shadow:var(--tk-shadow);color:var(--tk-ink)}
html body.app-ui.app-ui :is(#moveCollectionModal,#tagModal) .confirm-title{margin:0 0 6px;font-size:19px;line-height:26px;font-weight:700;color:var(--tk-ink);text-align:left}
html body.app-ui.app-ui :is(#moveCollectionModal,#tagModal) .confirm-message{margin:0;font-size:15px;line-height:22px;color:var(--tk-muted);text-align:left}
html body.app-ui.app-ui :is(#moveCollectionModal,#tagModal) .confirm-actions{display:flex;gap:8px;margin-top:16px}
html body.app-ui.app-ui :is(#moveCollectionModal,#tagModal) .confirm-actions>button{flex:1 1 auto;text-wrap:balance;min-height:48px;border-radius:24px;font-size:16px}
html body.app-ui.app-ui #collectionListContainer{align-self:stretch;width:auto;text-align:left}
html body.app-ui.app-ui .collection-item{display:flex;align-items:center;justify-content:space-between;gap:12px;box-sizing:border-box;width:100%;min-height:68px;margin:0 0 8px;padding:8px 12px;border:0;border-radius:var(--tk-r-block);background:var(--tk-bg);box-shadow:none;color:var(--tk-ink);font-size:16px;line-height:22px;text-align:left}
html body.app-ui.app-ui .collection-item.selected{border-color:var(--tk-primary)!important;background:var(--tk-tint)!important;box-shadow:inset 0 0 0 2px var(--tk-primary)}
html body.app-ui.app-ui .collection-item .collection-thumb{flex:none;background:var(--tk-tint)}
html body.app-ui.app-ui .collection-item>div:first-child{min-width:0;background:none}
html body.app-ui.app-ui .collection-title{display:block;font-size:16px;line-height:22px;font-weight:700;color:var(--tk-ink)}
html body.app-ui.app-ui :is(.collection-age,.collection-detail){display:block;font-size:13px;line-height:18px;font-weight:400;color:var(--tk-muted)}
html body.app-ui.app-ui .collection-check{flex:none;color:var(--tk-primary)}
html body.app-ui.app-ui .collection-check>.ti{width:22px;height:22px}

/* ---------- icons (generated by harness/build-icons.py; do not edit below) ---------- */
/* direction C, review fixes (11/11) */
html body.app-ui.app-ui #create-album-title:focus:not(:focus-visible),html body.app-ui.app-ui .golden-photo:focus-within{outline:none}
html body.app-ui.app-ui #create-album-title:focus-visible,html body.app-ui.app-ui .golden-photo:has(:focus-visible){outline:3px solid var(--tk-primary);outline-offset:2px}
html body.app-ui.app-ui .coffee-card .coffee-buy:focus-visible{outline-color:var(--tk-primary)}
html body.app-ui.app-ui a#account-security-back.tk-back{width:44px;height:44px;padding:0;border-radius:22px;background:var(--tk-tint);color:var(--tk-tint-ink)}
html body.app-ui.app-ui input[type=date]{display:block;width:100%;min-width:0;max-width:100%}
@supports (-webkit-touch-callout:none){html body.app-ui.app-ui input[type=date]{-webkit-appearance:none;appearance:none;text-align:left}html body.app-ui.app-ui input[type=date]::-webkit-date-and-time-value{text-align:left}}
@media (max-width:360px){html body.app-ui.app-ui :is(.tk-dialog-actions>.tk-btn,.timehut-dialog .modal-actions>.btn,#moveCollectionModal .confirm-actions>button,#tagModal .confirm-actions>button){padding-left:12px;padding-right:12px;font-size:15px}}
html body.app-ui.app-ui.line-page fieldset{min-width:0;margin:16px 0 0;padding:16px;border:0;border-radius:var(--tk-r-card);background:var(--tk-surface);box-shadow:none}
html body.app-ui.app-ui.line-page fieldset>legend{float:left;width:100%;margin:0 0 10px;padding:0;font-size:18px;font-weight:700;color:var(--tk-ink)}
html body.app-ui.app-ui.line-page fieldset>legend+*{clear:both}
html body.app-ui.app-ui .line-item{border:0;border-radius:var(--tk-r-block);background:var(--tk-tint-soft);padding:14px 16px}
html body.app-ui.app-ui .line-item[data-stage="uploaded"]{background:var(--tk-tint)}
html body.app-ui.app-ui .line-item-kind{background:var(--tk-surface);color:var(--tk-tint-ink)}
html body.app-ui.app-ui :is(.line-item time,.line-updated,.line-item .line-item-detail,#line-items small,.golden-explanation,.golden-save-bar span){color:var(--tk-muted)}
html body.app-ui.app-ui .golden-page .golden-photo,html body.app-ui.app-ui .golden-missing{background:var(--tk-tint-soft)}
html body.app-ui.app-ui .golden-photo:has(input:checked){border-color:var(--tk-primary);box-shadow:0 0 0 1px var(--tk-primary)}
html body.app-ui.app-ui .golden-selected .golden-selected-item>button:not([class]){min-height:44px;margin-top:6px;padding:6px 8px;font-size:13px;white-space:nowrap;border-radius:22px}
html body.app-ui.app-ui .golden-save-bar{background:var(--tk-surface);border-top:1px solid var(--tk-line);box-shadow:0 -4px 16px rgba(27,42,34,.06)}
/* 拾光 section inside the shared photo viewer (js/photo-ai-insight.js) */
html body.app-ui.app-ui .photo-ai-insight{margin:14px 0 4px;padding:14px 0 0;border-top:1px solid var(--tk-line);text-align:left}
html body.app-ui.app-ui .photo-ai-head{display:flex;align-items:center;justify-content:space-between;gap:8px;margin:0 0 6px}
html body.app-ui.app-ui .photo-ai-head h4{margin:0;font-size:16px;line-height:22px;font-weight:700;color:var(--tk-ink)}
html body.app-ui.app-ui .photo-ai-head .photo-ai-edit{min-height:44px;padding:0 10px}
html body.app-ui.app-ui .photo-ai-insight .photo-ai-desc{margin:0 0 10px;font-size:15px;line-height:1.6;color:var(--tk-ink);white-space:pre-wrap;overflow-wrap:anywhere;opacity:1}
html body.app-ui.app-ui .photo-ai-insight .ai-tags{display:flex;flex-wrap:wrap;gap:6px;margin:0 0 8px}
html body.app-ui.app-ui .photo-ai-insight .ai-tag{display:inline-flex;align-items:center;min-height:28px;padding:0 10px;border-radius:14px;background:var(--tk-tint);color:var(--tk-tint-ink);font-size:13px;line-height:18px;font-weight:600}
html body.app-ui.app-ui .photo-ai-insight .photo-ai-scene{margin:0;font-size:13px;line-height:18px;color:var(--tk-muted);opacity:1}
html body.app-ui.app-ui .photo-ai-insight .photo-ai-status{margin:8px 0 0;font-size:13px;line-height:18px;color:var(--tk-tint-ink);opacity:1}
html body.app-ui.app-ui .photo-ai-form{display:grid;gap:10px;margin:0}
html body.app-ui.app-ui .photo-ai-field{display:grid;gap:6px;margin:0;font-size:13px;line-height:18px;font-weight:600;color:var(--tk-muted)}
html body.app-ui.app-ui .photo-ai-field textarea{width:100%;min-height:88px;resize:vertical}
html body.app-ui.app-ui .photo-ai-field input{width:100%}
html body.app-ui.app-ui .photo-ai-actions{display:flex;flex-wrap:wrap;gap:8px}
html body.app-ui.app-ui .photo-ai-actions>.tk-btn{flex:1 1 auto;min-height:44px}
html body.app-ui.app-ui #photoModal .modal-info:has(#photoAiInsight:not([hidden])) #modalSmartTags{display:none}
html body.app-ui.app-ui .viewer-download-status:empty{display:none}
/* an empty album already shows its own 上傳照片或影片 in the middle: no second, overlapping upload button */
html body.app-ui.app-ui:has(#emptyState:not([style*="none"])) .tk-fab{display:none}
/*icons:begin*/
/* stroke 2, 68 icons */
:root{--tk-i-alert:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 4l9 16H3zM12 10v4.5M12 17.5h0'/%3E%3C/svg%3E");--tk-i-arrow-down:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 5v14M6 13l6 6 6-6'/%3E%3C/svg%3E");--tk-i-arrow-left:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M19 12H5M11 6l-6 6 6 6'/%3E%3C/svg%3E");--tk-i-arrow-right:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14M13 6l6 6-6 6'/%3E%3C/svg%3E");--tk-i-arrow-up:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 19V5M6 11l6-6 6 6'/%3E%3C/svg%3E");--tk-i-bell:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 16v-5a6 6 0 1112 0v5l2 2H4zM10 20a2 2 0 004 0'/%3E%3C/svg%3E");--tk-i-book:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 4h11a3 3 0 013 3v13H8a3 3 0 01-3-3z'/%3E%3Cpath d='M5 17a3 3 0 013-3h11'/%3E%3C/svg%3E");--tk-i-calendar:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='4' y='5' width='16' height='15' rx='2'/%3E%3Cpath d='M4 10h16M8 3v4M16 3v4'/%3E%3C/svg%3E");--tk-i-calendar-check:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='4' y='5' width='16' height='15' rx='2'/%3E%3Cpath d='M4 10h16M8 3v4M16 3v4'/%3E%3Cpath d='M9 15l2 2 4-4'/%3E%3C/svg%3E");--tk-i-camera:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 8h3l2-3h6l2 3h3v11H4z'/%3E%3Ccircle cx='12' cy='13' r='3.5'/%3E%3C/svg%3E");--tk-i-check:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E");--tk-i-check-circle:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M8 12.5l3 3 5-6'/%3E%3C/svg%3E");--tk-i-check-square:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='4' y='4' width='16' height='16' rx='3'/%3E%3Cpath d='M8.5 12l2.5 2.5 4.5-5'/%3E%3C/svg%3E");--tk-i-chevron-down:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");--tk-i-chevron-left:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M15 18l-6-6 6-6'/%3E%3C/svg%3E");--tk-i-chevron-right:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 18l6-6-6-6'/%3E%3C/svg%3E");--tk-i-chevron-up:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 15l6-6 6 6'/%3E%3C/svg%3E");--tk-i-circle:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='8.5'/%3E%3C/svg%3E");--tk-i-clock:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 7v5l3 2'/%3E%3C/svg%3E");--tk-i-coffee:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 9h11v5a5 5 0 01-5 5h-1a5 5 0 01-5-5zM16 10h2a2.5 2.5 0 010 5h-2M8 3v2M12 3v2'/%3E%3C/svg%3E");--tk-i-copy:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='8' y='8' width='12' height='12' rx='2'/%3E%3Cpath d='M16 8V5a1 1 0 00-1-1H5a1 1 0 00-1 1v10a1 1 0 001 1h3'/%3E%3C/svg%3E");--tk-i-download:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 4v12M7 11l5 5 5-5M4 20h16'/%3E%3C/svg%3E");--tk-i-edit:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 20h4l10-10-4-4L4 16zM13 7l4 4'/%3E%3C/svg%3E");--tk-i-external:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 5h5v5M19 5l-8 8M18 14v5H5V6h5'/%3E%3C/svg%3E");--tk-i-eye:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2 12s3.5-7 10-7 10 7 10 7-3.5 7-10 7-10-7-10-7z'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3C/svg%3E");--tk-i-flag:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 21V4h11l-1.5 4L16 12H5'/%3E%3C/svg%3E");--tk-i-folder:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 7a2 2 0 012-2h4l2 2h8a2 2 0 012 2v9a2 2 0 01-2 2H5a2 2 0 01-2-2z'/%3E%3C/svg%3E");--tk-i-folder-move:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 7a2 2 0 012-2h4l2 2h8a2 2 0 012 2v9a2 2 0 01-2 2H5a2 2 0 01-2-2z'/%3E%3Cpath d='M10 13h5M13 11l2 2-2 2'/%3E%3C/svg%3E");--tk-i-grid:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='4' y='4' width='7' height='7' rx='1.5'/%3E%3Crect x='13' y='4' width='7' height='7' rx='1.5'/%3E%3Crect x='4' y='13' width='7' height='7' rx='1.5'/%3E%3Crect x='13' y='13' width='7' height='7' rx='1.5'/%3E%3C/svg%3E");--tk-i-heart:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 20s-7-4.4-7-10a4 4 0 017-2.6A4 4 0 0119 10c0 5.6-7 10-7 10z'/%3E%3C/svg%3E");--tk-i-help:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M9.5 9.5a2.5 2.5 0 115 0c0 1.5-2.5 2-2.5 3.5M12 17h0'/%3E%3C/svg%3E");--tk-i-home:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 11l8-7 8 7M6 10v10h12V10M10 20v-6h4v6'/%3E%3C/svg%3E");--tk-i-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='5' width='18' height='14' rx='2'/%3E%3Ccircle cx='9' cy='10' r='1.6'/%3E%3Cpath d='M21 16l-5-5-8 8'/%3E%3C/svg%3E");--tk-i-images:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='7' y='3' width='14' height='12' rx='2'/%3E%3Cpath d='M3 8v11a2 2 0 002 2h12M21 12l-3.5-3.5L11 15'/%3E%3C/svg%3E");--tk-i-info:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 11v6M12 7.5h0'/%3E%3C/svg%3E");--tk-i-key:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='8' cy='15' r='4'/%3E%3Cpath d='M11 12l9-9M17 6l3 3M14 9l2 2'/%3E%3C/svg%3E");--tk-i-leaf:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 19c0-8.5 5.5-13.5 14-14 0 9-5.500 14-14 14zM5 19l8-8'/%3E%3C/svg%3E");--tk-i-link:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10 14a4 4 0 005.7 0l3-3a4 4 0 00-5.7-5.7l-1 1M14 10a4 4 0 00-5.7 0l-3 3a4 4 0 005.7 5.7l1-1'/%3E%3C/svg%3E");--tk-i-lock:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='5' y='11' width='14' height='9' rx='2'/%3E%3Cpath d='M8 11V8a4 4 0 018 0v3'/%3E%3C/svg%3E");--tk-i-logout:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10 4H5v16h5M14 8l4 4-4 4M18 12H9'/%3E%3C/svg%3E");--tk-i-maximize:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 9V4h5M20 9V4h-5M4 15v5h5M20 15v5h-5'/%3E%3C/svg%3E");--tk-i-menu:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 6h16M4 12h16M4 18h16'/%3E%3C/svg%3E");--tk-i-message:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 5h16v11H9l-5 4z'/%3E%3C/svg%3E");--tk-i-minimize:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 4v5H4M15 4v5h5M9 20v-5H4M15 20v-5h5'/%3E%3C/svg%3E");--tk-i-minus:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14'/%3E%3C/svg%3E");--tk-i-more:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='5' cy='12' r='1.3' fill='%23000'/%3E%3Ccircle cx='12' cy='12' r='1.3' fill='%23000'/%3E%3Ccircle cx='19' cy='12' r='1.3' fill='%23000'/%3E%3C/svg%3E");--tk-i-phone:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='7' y='3' width='10' height='18' rx='2'/%3E%3Cpath d='M11 17.5h2'/%3E%3C/svg%3E");--tk-i-play:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8 5l11 7-11 7z'/%3E%3C/svg%3E");--tk-i-plus:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 5v14M5 12h14'/%3E%3C/svg%3E");--tk-i-refresh:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 12a8 8 0 01-14.3 4.9M4 12a8 8 0 0114.3-4.9M18 3v4.5h-4.5M6 21v-4.5h4.5'/%3E%3C/svg%3E");--tk-i-search:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M21 21l-4.3-4.3'/%3E%3C/svg%3E");--tk-i-settings:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 6h8M18 6h2M4 12h2M12 12h8M4 18h10M20 18h0'/%3E%3Ccircle cx='15' cy='6' r='2.2'/%3E%3Ccircle cx='9' cy='12' r='2.2'/%3E%3Ccircle cx='17' cy='18' r='2.2'/%3E%3C/svg%3E");--tk-i-share:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 15V4M8 8l4-4 4 4M5 12v7h14v-7'/%3E%3C/svg%3E");--tk-i-shield:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3l7 3v6c0 4.5-3 7.7-7 9-4-1.3-7-4.5-7-9V6z'/%3E%3C/svg%3E");--tk-i-sparkle:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M11 3l1.8 5.2L18 10l-5.2 1.8L11 17l-1.8-5.2L4 10l5.2-1.8zM18.5 15l.8 1.9 1.9.8-1.9.8-.8 1.9-.8-1.9-1.9-.8 1.9-.8z'/%3E%3C/svg%3E");--tk-i-star:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 4l2.5 5.2 5.7.8-4.1 4 1 5.6L12 17l-5.1 2.6 1-5.6-4.1-4 5.7-.8z'/%3E%3C/svg%3E");--tk-i-tag:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 12l8-8h8v8l-8 8z'/%3E%3Ccircle cx='15.5' cy='8.5' r='1.2'/%3E%3C/svg%3E");--tk-i-transfer:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 4v16M7 20l-3-3M7 20l3-3M17 20V4M17 4l-3 3M17 4l3 3'/%3E%3C/svg%3E");--tk-i-trash:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 7h16M9 7V4h6v3M6 7l1 13h10l1-13M10 11v5M14 11v5'/%3E%3C/svg%3E");--tk-i-upload:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 16V4M7 9l5-5 5 5M4 20h16'/%3E%3C/svg%3E");--tk-i-user:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='8' r='4'/%3E%3Cpath d='M4 20c1.5-4 5-5 8-5s6.5 1 8 5'/%3E%3C/svg%3E");--tk-i-user-check:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='10' cy='8' r='4'/%3E%3Cpath d='M2.5 20c1.3-4 4.5-5 7.5-5 1.6 0 3.2.3 4.6 1M16 18l2 2 4-4'/%3E%3C/svg%3E");--tk-i-users:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='9' cy='8' r='3.5'/%3E%3Cpath d='M2.5 20c1-3.5 3.8-4.5 6.5-4.5s5.5 1 6.5 4.5M16 4.6a3.5 3.5 0 010 6.8M18.5 15.8c1.6.6 2.6 1.9 3 4.2'/%3E%3C/svg%3E");--tk-i-video:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='6' width='13' height='12' rx='2'/%3E%3Cpath d='M16 10l5-3v10l-5-3'/%3E%3C/svg%3E");--tk-i-x:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 6l12 12M18 6L6 18'/%3E%3C/svg%3E");--tk-i-x-circle:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M9 9l6 6M15 9l-6 6'/%3E%3C/svg%3E");--tk-i-zoom-in:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M21 21l-4.3-4.3'/%3E%3Cpath d='M11 8v6M8 11h6'/%3E%3C/svg%3E");--tk-i-zoom-out:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M21 21l-4.3-4.3'/%3E%3Cpath d='M8 11h6'/%3E%3C/svg%3E");--tk-i-chevron-down-muted:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2351605A' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E")}
.ti{display:inline-block;flex:none;width:1.25em;height:1.25em;vertical-align:-.24em;background-color:currentColor;-webkit-mask:var(--ti) center/contain no-repeat;mask:var(--ti) center/contain no-repeat}
.ti--sm{width:1em;height:1em;vertical-align:-.14em}.ti--lg{width:1.5em;height:1.5em;vertical-align:-.36em}
.ti-alert{--ti:var(--tk-i-alert)}.ti-arrow-down{--ti:var(--tk-i-arrow-down)}.ti-arrow-left{--ti:var(--tk-i-arrow-left)}.ti-arrow-right{--ti:var(--tk-i-arrow-right)}.ti-arrow-up{--ti:var(--tk-i-arrow-up)}.ti-bell{--ti:var(--tk-i-bell)}.ti-book{--ti:var(--tk-i-book)}.ti-calendar{--ti:var(--tk-i-calendar)}.ti-calendar-check{--ti:var(--tk-i-calendar-check)}.ti-camera{--ti:var(--tk-i-camera)}.ti-check{--ti:var(--tk-i-check)}.ti-check-circle{--ti:var(--tk-i-check-circle)}.ti-check-square{--ti:var(--tk-i-check-square)}.ti-chevron-down{--ti:var(--tk-i-chevron-down)}.ti-chevron-left{--ti:var(--tk-i-chevron-left)}.ti-chevron-right{--ti:var(--tk-i-chevron-right)}.ti-chevron-up{--ti:var(--tk-i-chevron-up)}.ti-circle{--ti:var(--tk-i-circle)}.ti-clock{--ti:var(--tk-i-clock)}.ti-coffee{--ti:var(--tk-i-coffee)}.ti-copy{--ti:var(--tk-i-copy)}.ti-download{--ti:var(--tk-i-download)}.ti-edit{--ti:var(--tk-i-edit)}.ti-external{--ti:var(--tk-i-external)}.ti-eye{--ti:var(--tk-i-eye)}.ti-flag{--ti:var(--tk-i-flag)}.ti-folder{--ti:var(--tk-i-folder)}.ti-folder-move{--ti:var(--tk-i-folder-move)}.ti-grid{--ti:var(--tk-i-grid)}.ti-heart{--ti:var(--tk-i-heart)}.ti-help{--ti:var(--tk-i-help)}.ti-home{--ti:var(--tk-i-home)}.ti-image{--ti:var(--tk-i-image)}.ti-images{--ti:var(--tk-i-images)}.ti-info{--ti:var(--tk-i-info)}.ti-key{--ti:var(--tk-i-key)}.ti-leaf{--ti:var(--tk-i-leaf)}.ti-link{--ti:var(--tk-i-link)}.ti-lock{--ti:var(--tk-i-lock)}.ti-logout{--ti:var(--tk-i-logout)}.ti-maximize{--ti:var(--tk-i-maximize)}.ti-menu{--ti:var(--tk-i-menu)}.ti-message{--ti:var(--tk-i-message)}.ti-minimize{--ti:var(--tk-i-minimize)}.ti-minus{--ti:var(--tk-i-minus)}.ti-more{--ti:var(--tk-i-more)}.ti-phone{--ti:var(--tk-i-phone)}.ti-play{--ti:var(--tk-i-play)}.ti-plus{--ti:var(--tk-i-plus)}.ti-refresh{--ti:var(--tk-i-refresh)}.ti-search{--ti:var(--tk-i-search)}.ti-settings{--ti:var(--tk-i-settings)}.ti-share{--ti:var(--tk-i-share)}.ti-shield{--ti:var(--tk-i-shield)}.ti-sparkle{--ti:var(--tk-i-sparkle)}.ti-star{--ti:var(--tk-i-star)}.ti-tag{--ti:var(--tk-i-tag)}.ti-transfer{--ti:var(--tk-i-transfer)}.ti-trash{--ti:var(--tk-i-trash)}.ti-upload{--ti:var(--tk-i-upload)}.ti-user{--ti:var(--tk-i-user)}.ti-user-check{--ti:var(--tk-i-user-check)}.ti-users{--ti:var(--tk-i-users)}.ti-video{--ti:var(--tk-i-video)}.ti-x{--ti:var(--tk-i-x)}.ti-x-circle{--ti:var(--tk-i-x-circle)}.ti-zoom-in{--ti:var(--tk-i-zoom-in)}.ti-zoom-out{--ti:var(--tk-i-zoom-out)}
/*icons:end*/
/* People the LINE matching put this photo in, inside the 拾光 section (js/photo-ai-insight.js; Hank 2026-11-11) */
html body.app-ui.app-ui .photo-ai-people{display:flex;flex-wrap:wrap;align-items:center;gap:0 2px;margin:0 0 8px;font-size:15px;line-height:22px;color:var(--tk-ink);opacity:1}
html body.app-ui.app-ui .photo-ai-people-label{font-weight:700;color:var(--tk-ink)}
html body.app-ui.app-ui .photo-ai-person{display:inline-flex;align-items:center;justify-content:center;min-width:44px;min-height:44px;margin:0;padding:0 10px;border:0;border-radius:22px;background:var(--tk-tint-soft);box-shadow:none;color:var(--tk-tint-ink);font:inherit;font-size:15px;line-height:20px;font-weight:700;cursor:pointer}
html body.app-ui.app-ui .photo-ai-person:active,html body.app-ui.app-ui .photo-ai-person[aria-expanded="true"]{background:var(--tk-tint-press)}
html body.app-ui.app-ui .photo-ai-people-sep{padding:0 2px;color:var(--tk-faint)}
html body.app-ui.app-ui .photo-ai-people-source{margin-left:2px;font-size:13px;line-height:18px;color:var(--tk-muted)}
html body.app-ui.app-ui .photo-ai-person-menu{display:grid;gap:2px;margin:-2px 0 10px;padding:6px;border-radius:var(--tk-r-block);background:var(--tk-surface);box-shadow:var(--tk-shadow)}
html body.app-ui.app-ui .photo-ai-person-item{display:flex;align-items:center;width:100%;min-height:44px;margin:0;padding:0 14px;border:0;border-radius:14px;background:transparent;box-shadow:none;color:var(--tk-ink);font:inherit;font-size:15px;line-height:20px;font-weight:600;text-align:left}
html body.app-ui.app-ui .photo-ai-person-item:active{background:var(--tk-tint-soft)}
html body.app-ui.app-ui .photo-ai-person-item.is-danger{color:var(--tk-danger)}
html body.app-ui.app-ui .photo-ai-person-item.is-danger:active{background:var(--tk-danger-tint)}
html body.app-ui.app-ui .photo-ai-undo{display:flex;align-items:center;justify-content:space-between;gap:8px;margin:4px 0 8px;padding:2px 4px 2px 16px;border-radius:22px;background:var(--tk-ink);color:#fff;font-size:14px;line-height:20px}
html body.app-ui.app-ui .photo-ai-undo>span{flex:1 1 auto;min-width:0}
html body.app-ui.app-ui .photo-ai-insight .photo-ai-people-status{margin:0 0 8px}
html body.app-ui.app-ui .photo-ai-undo .photo-ai-undo-btn{flex:none;min-height:44px;padding:0 14px;color:var(--tk-honey);font-weight:700}
html body.app-ui.app-ui .tk-search-hint{margin:8px 6px 0;font-size:13px;line-height:18px;color:var(--tk-muted)}
html body.app-ui.app-ui .tk-search-hint a{margin:0 2px;color:var(--tk-primary);font-weight:700;text-decoration:underline;text-underline-offset:3px}
/* 2026-11-14 Hank「相簿名稱應放到頂部取代APP 名稱」: the home bar names the album being read, its age on a small line under it. */
html body.app-ui.app-ui .header.tk-top{flex-wrap:nowrap}html body.app-ui.app-ui .tk-top-row{min-width:0}/* a long album name is cut with …, it never widens the page */
html body.app-ui.app-ui h1.tk-top-album{display:flex;flex-direction:column;justify-content:center;margin:0;white-space:normal;letter-spacing:0}
html body.app-ui.app-ui .tk-top-album-name{display:block;overflow:hidden;font-size:22px;line-height:28px;font-weight:700;text-overflow:ellipsis;white-space:nowrap}
html body.app-ui.app-ui .tk-top-album-age{display:block;overflow:hidden;color:var(--tk-muted);font-size:13px;line-height:18px;font-weight:400;text-overflow:ellipsis;white-space:nowrap}
html body.app-ui.app-ui .tk-top-album-age:empty{display:none}
@media(max-width:359px){html body.app-ui.app-ui .tk-top-album-name{font-size:19px;letter-spacing:-0.2px}}

/* Claude R3415 batch05-05: a long placeholder ends with … instead of being cut through a character; the home queue status may use two lines. */
html body.app-ui.app-ui input:placeholder-shown{text-overflow:ellipsis}
html body.app-ui.app-ui input::placeholder{text-overflow:ellipsis}
html body.app-ui.app-ui .tk-top-status{white-space:normal;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;line-height:16px}
@media (max-width:359px){html body.app-ui.app-ui .tk-top-chips{flex-wrap:wrap;row-gap:2px}html body.app-ui.app-ui .tk-top-status{flex:1 0 100%;text-align:left;font-size:12px;line-height:16px}}
/* Claude R3415 batch05-06: headings and short labels wrap at a balanced phrase boundary instead of leaving one character of a word alone. */
html body.app-ui.app-ui :is(h1,h2,h3,.np-tab){text-wrap:balance}
html body.app-ui.app-ui .app-row-copy>strong{word-break:keep-all;overflow-wrap:anywhere}

/* Claude R3415 batch05-10: while selecting dates the day link stays hidden (as the selection mode intends) and the count keeps one line. */
html body.app-ui.app-ui.moment-select-mode .moment-album-link{display:none}
html body.app-ui.app-ui.moment-select-mode .moment-stats-right>span{white-space:nowrap}

/* Claude R3427 batch07-03: timeline header at large text: the album age is never cut (it may wrap: 「6歲10個月13天」) and the
   album name uses up to 2 lines before …. Scoped to the timeline ids; a short name at normal size stays one line as before. */
html body.app-ui.app-ui h1.tk-top-album>#currentChildName{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden;white-space:normal;overflow-wrap:anywhere}
html body.app-ui.app-ui h1.tk-top-album>#currentChildAge{overflow:visible;white-space:normal;text-overflow:clip}
html body.app-ui.app-ui h1.tk-top-album>#currentChildAge>span{display:inline-block}
/* Hank 2026-11-25: day card without the 「看這一天」 row — the date is a tappable chip, the counts sit at the top right, and a
   tap anywhere in the card opens the day (js/timeline.js). */
html body.app-ui.app-ui.timeline-page:not(.moment-select-mode) .moment-item .moment-header{display:flex;flex-direction:row;flex-wrap:wrap;align-items:center;column-gap:8px;row-gap:2px}
html body.app-ui.app-ui.timeline-page:not(.moment-select-mode) .moment-item .moment-header .moment-info{order:3;flex:1 0 100%;margin:0}
html body.app-ui.app-ui.timeline-page .moment-item .moment-stats{order:2;margin-left:auto;font-size:13px;line-height:18px;color:var(--tk-muted);white-space:nowrap}
html body.app-ui.app-ui.timeline-page .moment-item .moment-date-link{display:inline-flex;align-items:center;gap:2px;min-height:36px;margin:0 0 2px -2px;padding:6px 10px 6px 12px;border:0;border-radius:18px;background:var(--tk-tint);color:var(--tk-tint-ink);font:inherit;font-size:16px;line-height:22px;font-weight:700;text-align:left;cursor:pointer;-webkit-tap-highlight-color:transparent}
html body.app-ui.app-ui.timeline-page .moment-item .moment-date-link>.ti{width:18px;height:18px;flex:none}
/* Claude next25: the 「更多」 tile of a day still being read opens that day (style.css makes overlays ignore taps) */
html body.app-ui.app-ui.timeline-page .moment-item .moment-overlay.moment-overlay--more{pointer-events:auto;cursor:pointer}
html body.app-ui.app-ui.timeline-page .moment-item .moment-date-link:active{background:var(--tk-tint-press)}
html body.app-ui.app-ui.timeline-page .moment-item .moment-date-link:focus-visible{outline:2px solid var(--tk-tint-ink);outline-offset:2px}
html body.app-ui.app-ui.timeline-page:not(.select-mode):not(.moment-select-mode) .moment-item.moment-opens-day{cursor:pointer}
html body.app-ui.app-ui.timeline-page:is(.select-mode,.moment-select-mode) .moment-item .moment-date-link{min-height:0;padding:0;margin:0;background:none;color:inherit;pointer-events:none}
html body.app-ui.app-ui.timeline-page:is(.select-mode,.moment-select-mode) .moment-item .moment-date-link>.ti{display:none}
