.selector-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: flex-start;
}

.selector-row.column {
    flex-direction: column;
    align-items: center;
}

.selector-or {
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.9rem;
    margin: 1rem 0 1.75rem;
}

.selector-card {
    flex: 1 1 50%;
    max-width: 460px;
    min-width: 260px;
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 1.25rem 0;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    align-items: center;
    text-align: center;
}

.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.55rem 0.65rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-primary);
    min-width: 44px;
    height: 44px;
}

.btn-icon:hover {
    border-color: var(--accent);
    color: var(--accent);
}
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

.limit-banner {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
    padding: 0.75rem;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--surface);
}

.limit-banner--blocked {
    border-color: var(--error);
    background: rgba(235, 87, 87, 0.08);
}

.limit-banner-text {
    font-weight: 600;
}

.limit-banner-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.limit-banner-info {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
}

.limit-banner-reason {
    margin-left: auto;
    color: var(--error);
}

.limit-banner-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.limit-footer {
    display: none;
    justify-content: flex-start;
    padding: 1.25rem 0 0.75rem;
    color: var(--text-secondary);
    font-weight: 600;
}

.limit-footer-text {
    text-align: left;
}

.modal-content {
    position: relative;
}

.modal-close {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1.1rem;
    cursor: pointer;
    padding: 0.35rem;
    border-radius: 8px;
}

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

.limit-action-btn {
    padding: 0.35rem 0.75rem;
}

.public-create {
    margin: 0;
    padding: 0;
    border: none;
    border-radius: 0;
    background: transparent;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    align-items: center;
    text-align: center;
}

.public-create-title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
}

.public-create-row {
    display: flex;
    gap: 0.35rem;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
}

.input-with-button {
    display: flex;
    align-items: stretch;
    gap: 0;
    width: 100%;
    max-width: 440px;
}

.input-with-button.narrow {
    max-width: 320px;
}

.public-create-row input {
    flex: 1;
    min-width: 200px;
    max-width: 240px;
    padding: 0.75rem 0.9rem;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--surface);
}

.input-with-button input {
    max-width: none;
    border-radius: 12px 0 0 12px;
}

.input-with-button.has-left-addon input {
    border-radius: 0;
    min-width: 140px;
    border-left: none;
}

.input-with-button .btn-icon {
    border-radius: 12px 0 0 12px;
    border: 1px solid var(--border);
    border-right: none;
    background: var(--surface);
    box-shadow: none;
    height: auto;
    min-width: 48px;
}

.input-with-button .btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 0 12px 12px 0;
    height: auto;
    padding: 0 1.2rem;
    white-space: nowrap;
    box-shadow: 0 16px 30px var(--glow);
}

.create-toggle {
    width: 100%;
    max-width: 440px;
    justify-content: center;
}

.public-create-form {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    width: 100%;
    align-items: center;
}

.public-create-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: center;
}

.public-create-status {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.public-create-help {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-top: 0.5rem;
    text-align: center;
    max-width: 440px;
}

.public-create-hint {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-top: 0.25rem;
    text-align: center;
    max-width: 440px;
}

.public-create-advanced-toggle-row {
    width: 100%;
    display: flex;
    justify-content: center;
    margin-top: 0.5rem;
}

.public-create-advanced-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.public-create-advanced-toggle:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.public-create-advanced-toggle[aria-expanded="true"] .toggle-icon {
    transform: rotate(180deg);
}

.toggle-icon {
    transition: transform 0.2s ease;
    font-size: 0.75rem;
}

.public-create-advanced {
    width: 100%;
    max-width: 440px;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
    animation: slideDown 0.2s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.public-create-advanced-content {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    text-align: left;
}

.public-create-field {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.public-create-checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    cursor: pointer;
    font-size: 0.95rem;
    color: var(--text-primary);
    line-height: 1.5;
}

.public-create-checkbox-label input[type="checkbox"] {
    margin-top: 0.2rem;
    width: 18px;
    height: 18px;
    min-width: 18px;
    cursor: pointer;
    accent-color: var(--accent);
}

.public-create-password-wrapper {
    margin-left: 1.85rem;
    width: 100%;
    max-width: 440px;
}

.public-create-password-wrapper .input-with-button {
    max-width: 100%;
    position: relative;
    width: 100%;
}

.public-create-password-wrapper .input-with-button input {
    flex: 1;
    padding: 0.75rem 2.75rem 0.75rem 0.9rem;
    border-radius: 12px 0 0 12px;
    border: 1px solid var(--border);
    background: #ffffff;
    font-size: 1rem;
}

.public-create-password-wrapper .password-toggle {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 44px;
    border-left: 1px solid var(--border);
    border-radius: 0 12px 12px 0;
    background: var(--surface);
    color: var(--text-secondary);
    cursor: pointer;
    transition: color 0.2s ease;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.public-create-password-wrapper .password-toggle:hover {
    color: var(--accent);
}

.spin-text {
    animation: spinText 0.45s ease-in-out;
}

@keyframes spinText {
    0% { transform: rotateX(0deg); }
    50% { transform: rotateX(90deg); opacity: 0.4; }
    100% { transform: rotateX(0deg); opacity: 1; }
}

.link-button {
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    color: var(--accent);
    cursor: pointer;
    font: inherit;
    text-decoration: underline;
}
:root {
    --bg-primary: #f7f7f4;
    --bg-secondary: #ffffff;
    --bg-tertiary: #eef1f6;
    --accent: #3b82f6;
    --accent-hover: #2563eb;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --border: #e2e8f0;
    --success: #16a34a;
    --error: #ef4444;
    --shadow: rgba(15, 23, 42, 0.12);
    --glow: rgba(59, 130, 246, 0.14);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background:
        radial-gradient(circle at 15% 20%, rgba(59, 130, 246, 0.12), transparent 32%),
        radial-gradient(circle at 80% 0%, rgba(253, 186, 116, 0.18), transparent 30%),
        var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 2.5rem 2rem 3rem;
}

/* Header */
.header {
    margin-bottom: 3rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.header-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo {
    width: 48px;
    height: 48px;
    color: var(--accent);
    filter: drop-shadow(0 12px 24px var(--shadow));
}

.title-stack {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.header-logo {
    width: 48px;
    height: 48px;
    color: var(--accent);
    filter: drop-shadow(0 12px 24px var(--shadow));
}

.header-title {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.breadcrumb-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.product-tag {
    color: var(--text-secondary);
    font-weight: 600;
    letter-spacing: -0.01em;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.title-row {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex-wrap: wrap;
}

.gallery-title {
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
}

.brand-title {
    font-size: 2.6rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1;
}

.brand-title a {
    color: var(--text-primary);
    text-decoration: none;
    background: linear-gradient(120deg, #111827, #2563eb);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
    transition: transform 0.25s ease, filter 0.25s ease;
}

.brand-title a:hover {
    transform: translateY(-2px);
    filter: drop-shadow(0 12px 24px var(--glow));
}

.title-actions {
    display: flex;
    gap: 0.35rem;
}

.title-download {
    padding: 0;
    width: 38px;
    height: 38px;
    border-radius: 14px;
    box-shadow: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    min-width: 0;
    background: transparent;
    color: var(--text-primary);
    border: none;
    font-weight: 600;
    letter-spacing: -0.01em;
    appearance: none;
    transition: all 0.2s ease;
}

.download-icon {
    display: inline-flex;
    width: 32px;
    height: 32px;
}

.icon-action-label,
.download-label {
    overflow: hidden;
    max-width: 0;
    opacity: 0;
    white-space: nowrap;
    transition: all 0.2s ease;
    font-size: 0.95rem;
    margin-left: 0;
    display: inline-block;
}

.title-download:hover {
    background: linear-gradient(135deg, #e9f1ff, #dce9ff);
    padding: 0.35rem 0.65rem;
    gap: 0.3rem;
    width: auto;
    height: auto;
    transform: translateY(-1px);
    box-shadow: 0 14px 30px var(--glow);
    color: var(--text-primary);
}

.title-download:hover .download-label {
    max-width: 180px;
    opacity: 1;
    margin-left: 0.2rem;
}

.title-download:active {
    transform: translateY(0);
    box-shadow: 0 10px 24px var(--glow);
    color: var(--text-primary);
}

.title-download:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}

.btn-secondary.title-download {
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 0;
}

.gallery-title {
    font-size: 2.6rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.15;
    padding-bottom: 4px;
    background: linear-gradient(120deg, #111827, #2563eb);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: fadeUp 0.35s ease;
}

.gallery-title-icon {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
}

.gallery-title-text {
    line-height: 1.15;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.gallery-selector {
    display: flex;
    justify-content: center;
    gap: 0.35rem;
    align-items: center;
    background: transparent;
    padding: 0;
    border-radius: 0;
    box-shadow: none;
    border: none;
    max-width: 420px;
    margin: 0 auto;
}

.gallery-selector input {
    padding: 0.75rem 0.9rem;
    width: 220px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-primary);
}

.recent-visits {
    margin-top: 5.5rem;
    text-align: center;
}

.recent-title {
    margin: 0 0 0.5rem;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.recent-list {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.recent-pill {
    padding: 0.45rem 0.85rem;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--surface);
    cursor: pointer;
    color: var(--text-primary);
    transition: border-color 0.2s ease, color 0.2s ease;
}

.recent-pill:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.login-wrapper {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 0;
}

.login-toggle {
    display: none;
}

.logged-in-wrapper {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* logged-in-text removed (mode now shown on logout button) */

.auth-required {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    width: 100%;
    min-height: 200px;
    padding: 1.5rem;
}

.gallery-grid .auth-required,
.gallery-grid .empty-state {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.header-password-input {
    padding: 0.65rem 0.9rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 0.95rem;
    width: 160px;
    transition: all 0.25s ease;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.header-password-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 10px 30px var(--glow);
    width: 200px;
}

.header-password-input::placeholder {
    color: var(--text-muted);
}

#gallery-input {
    flex: 1;
    max-width: 400px;
    padding: 0.85rem 0.95rem;
    background: #ffffff;
    border: none;
    border-radius: 12px 0 0 12px;
    color: var(--text-primary);
    font-size: 1rem;
    transition: all 0.25s ease;
    box-shadow: 0 10px 24px var(--shadow);
}

#gallery-input:focus {
    outline: none;
    border-color: var(--accent);
    background: #ffffff;
    box-shadow: 0 16px 32px var(--shadow), 0 0 0 3px var(--glow);
}

/* Buttons */
button, .btn-primary, .btn-secondary {
    padding: 0.85rem 1.6rem;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.25s ease;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent), #60a5fa);
    color: white;
    box-shadow: 0 16px 30px var(--glow);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--accent-hover), #60a5fa);
    transform: translateY(-2px);
    box-shadow: 0 18px 38px var(--glow);
}

.btn-secondary {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border);
    box-shadow: 0 10px 26px var(--shadow);
}

.btn-secondary:hover {
    background: var(--bg-tertiary);
    transform: translateY(-1px);
}

.btn-disabled {
    opacity: 0.6;
    cursor: not-allowed;
    box-shadow: none;
}

#load-gallery-btn {
    background: linear-gradient(135deg, var(--accent), #60a5fa);
    color: white;
    padding: 0 1.2rem;
    border: none;
    border-radius: 0 12px 12px 0;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

#load-gallery-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 38px var(--glow);
}

/* Gallery Info */
.gallery-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
    padding-bottom: 0.5rem;
}

/* Upload Area */
.upload-area {
    margin-bottom: 2rem;
}

.upload-header {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 0.35rem;
}

.upload-close-btn {
    padding: 0.5rem 0.75rem;
    min-width: 0;
}

.upload-dropzone {
    border: 2px dashed var(--border);
    border-radius: 12px;
    padding: 3rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: var(--bg-secondary);
    box-shadow: 0 20px 40px var(--shadow);
}

.upload-dropzone:hover {
    border-color: var(--accent);
    background: linear-gradient(180deg, var(--bg-secondary), var(--bg-tertiary));
    transform: translateY(-2px);
    box-shadow: 0 24px 48px var(--shadow);
}

.upload-dropzone svg {
    width: 48px;
    height: 48px;
    margin: 0 auto 1rem;
    color: var(--text-secondary);
}

.upload-dropzone p {
    color: var(--text-secondary);
    font-size: 1rem;
}

.upload-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.upload-subtitle {
    margin-top: 0.25rem;
    color: var(--text-secondary);
}

.upload-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.25rem;
    align-items: stretch;
}

.upload-btn {
    flex: 1;
    border: none;
    border-radius: 12px;
    padding: 1rem 1.2rem;
    display: inline-flex;
    gap: 0.6rem;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--text-primary);
    background: var(--bg-tertiary);
    box-shadow: 0 10px 24px var(--shadow);
}

.upload-btn-primary {
    flex: 2;
    background: linear-gradient(135deg, var(--accent), #60a5fa);
    color: white;
    box-shadow: 0 16px 30px var(--glow);
}

.upload-btn-secondary {
    flex: 1;
    background: linear-gradient(135deg, #e9f1ff, #dce9ff);
    color: var(--text-primary);
}

.upload-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 36px var(--shadow);
}

.upload-btn:active {
    transform: translateY(0);
}

.upload-btn-icon {
    font-size: 1.2rem;
    line-height: 1;
}

.upload-btn-text {
    white-space: nowrap;
}

.upload-progress {
    margin-top: 1rem;
}

.upload-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem;
    background: var(--bg-secondary);
    border-radius: 8px;
    margin-bottom: 0.5rem;
}

.upload-item-name {
    flex: 1;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.upload-progress-bar {
    flex: 1;
    height: 6px;
    background: var(--bg-tertiary);
    border-radius: 3px;
    overflow: hidden;
}

.upload-progress-fill {
    height: 100%;
    background: var(--accent);
    transition: width 0.3s;
}

.upload-summary {
    margin-top: 0.5rem;
    font-weight: 600;
}

.upload-summary.success {
    color: var(--success);
}

.upload-summary.error {
    color: var(--error);
}

.upload-conflict-modal {
    margin-top: 1rem;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1rem;
    background: var(--bg-secondary);
    box-shadow: 0 10px 30px var(--shadow);
}

.upload-conflict-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.upload-conflict-headings h4 {
    margin: 0 0 0.25rem 0;
}

.upload-conflict-headings p {
    margin: 0;
    color: var(--text-secondary);
}

.upload-conflict-list {
    margin-top: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.upload-conflict-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.6rem;
    border-radius: 8px;
    background: var(--bg-tertiary);
}

.upload-conflict-name {
    flex: 1;
    word-break: break-word;
    font-weight: 600;
}

.upload-conflict-actions {
    margin-top: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    justify-content: space-between;
    flex-wrap: wrap;
}

.upload-conflict-apply {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.upload-conflict-apply select {
    padding: 0.35rem 0.6rem;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--bg-primary);
    color: var(--text-primary);
}

.upload-conflict-buttons {
    display: flex;
    gap: 0.5rem;
}
/* Gallery Grid */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.directory-bar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 0.25rem 0 0.75rem;
}

.directory-breadcrumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.2rem;
    margin: 0;
    color: var(--text-secondary);
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.mini-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: transparent;
    border: none;
    box-shadow: none;
    color: var(--text-primary);
    font-weight: 700;
    cursor: pointer;
    padding: 0.15rem 0.5rem;
    border-radius: 6px;
    transition: background 0.2s ease, color 0.2s ease;
}

.mini-action-btn:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.view-toggle-text {
    margin-left: auto;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-weight: 700;
    cursor: pointer;
    padding: 0.15rem 0.5rem;
    border-radius: 6px;
    transition: background 0.2s ease, color 0.2s ease;
}

.view-toggle-text:hover {
    background: var(--bg-tertiary);
}

.mini-action-btn .download-icon svg,
.mini-action-btn svg {
    width: 16px;
    height: 16px;
}

.header-icon-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: transparent;
    border: none;
    box-shadow: none;
    color: var(--text-primary);
    font-weight: 700;
    cursor: pointer;
    padding: 0.15rem 0.5rem;
    border-radius: 6px;
    transition: background 0.2s ease, color 0.2s ease;
}

.header-icon-btn:hover,
.header-icon-btn:focus-visible {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.header-icon-btn .icon-action-icon {
    display: inline-flex;
}

.header-icon-btn .icon-action-icon svg {
    width: 16px;
    height: 16px;
}

.header-icon-btn:hover .icon-action-label,
.header-icon-btn:focus-visible .icon-action-label {
    max-width: 180px;
    opacity: 1;
    margin-left: 0.2rem;
}

/* Share button: keep text visible */
.share-action .icon-action-label {
    max-width: 180px;
    opacity: 1;
    margin-left: 0.2rem;
}

.directory-download:hover .download-label,
.directory-download:focus-visible .download-label {
    max-width: 180px;
    opacity: 1;
    margin-left: 0.2rem;
}

.directory-download-hint {
    color: var(--text-secondary);
    font-size: 0.95rem;
    display: none;
    margin-left: 0.25rem;
}

.mini-action-btn:hover + .directory-download-hint,
.mini-action-btn:focus-visible + .directory-download-hint {
    display: inline;
}

.breadcrumb-btn {
    background: none;
    border: none;
    color: var(--accent);
    font-weight: inherit;
    font-size: inherit;
    cursor: pointer;
    padding: 0.15rem 0.35rem;
    border-radius: 6px;
    transition: background 0.2s ease, color 0.2s ease;
}

.breadcrumb-btn:hover {
    background: var(--bg-tertiary);
    color: var(--accent-hover);
}

.breadcrumb-sep {
    color: var(--text-secondary);
    padding: 0 0.05rem;
}

.limit-link {
    background: none;
    border: none;
    color: inherit;
    font: inherit;
    cursor: pointer;
    padding: 0;
    text-decoration: underline;
    text-decoration-color: var(--text-secondary);
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

.limit-link:hover,
.limit-link:focus-visible {
    color: var(--accent-hover);
    text-decoration-color: var(--accent-hover);
}

.directory-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.directory-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 1rem 1.1rem;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: linear-gradient(160deg, #ffffff, #f4f7fb);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    box-shadow: 0 20px 50px var(--shadow);
    aspect-ratio: 2 / 1; /* half the height of square thumbnails */
    position: relative;
}

.directory-card:hover {
    transform: translateY(-3px);
    border-color: var(--accent);
    box-shadow: 0 26px 60px var(--shadow);
}

.directory-card:hover .delete-btn {
    opacity: 1;
}

.directory-icon {
    font-size: 2.6rem;
}

.directory-name {
    font-weight: 700;
    color: var(--text-primary);
    word-break: break-word;
    text-align: center;
}


.gallery-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    background: linear-gradient(160deg, #ffffff, #f4f7fb);
    border: 1px solid var(--border);
    box-shadow: 0 20px 50px var(--shadow);
}

.gallery-item:hover {
    transform: translateY(-6px);
    box-shadow: 0 26px 60px var(--shadow);
    border-color: var(--accent);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.gallery-item video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    font-size: 3rem;
}

.file-card {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.5rem;
    height: 100%;
    padding: 1.25rem;
    background: linear-gradient(160deg, #f8fbff, #eef3fb);
}

.file-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.45rem 0.75rem;
    border-radius: 10px;
    background: var(--accent);
    color: white;
    font-weight: 800;
    letter-spacing: 0.05em;
    font-size: 0.85rem;
    box-shadow: 0 12px 30px rgba(76, 110, 245, 0.18);
    width: fit-content;
}

.file-badge.large {
    font-size: 1.35rem;
    padding: 0.8rem 1.25rem;
}

.file-name {
    font-weight: 700;
    color: var(--text-primary);
    word-break: break-word;
    line-height: 1.3;
}

.file-meta {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.file-viewer {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    min-width: 320px;
    max-width: 520px;
    box-shadow: 0 20px 50px var(--shadow);
}

.file-actions {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    margin-top: 1.25rem;
}

.file-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.65rem 1.1rem;
    border-radius: 10px;
    text-decoration: none;
    border: 1px solid transparent;
    background: var(--accent);
    color: #fff;
    font-weight: 700;
    transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.file-action-btn.secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border-color: var(--border);
}

.file-action-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 30px var(--shadow);
}

.delete-btn {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    width: 32px;
    height: 32px;
    background: rgba(239, 68, 68, 0.9);
    border: none;
    border-radius: 6px;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gallery-item:hover .delete-btn {
    opacity: 1;
}

.delete-btn:hover {
    background: var(--error);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 4rem 1.5rem;
    color: var(--text-primary);
    background: none;
    border-radius: 0;
    border: none;
    box-shadow: none;
    animation: fadeUp 0.6s ease;
}

.empty-icon {
    width: 88px;
    height: 88px;
    margin: 0 auto 1.75rem;
    opacity: 0.9;
    filter: drop-shadow(0 14px 36px var(--shadow));
}

.empty-icon-caption {
    text-align: center;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 0.6rem;
    font-size: 2.2rem;
    line-height: 1.1;
    background: linear-gradient(120deg, #111827, #2563eb);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.empty-subtitle {
    text-align: center;
    color: var(--text-secondary);
    font-weight: 600;
    margin-bottom: 1.4rem;
}

.empty-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.35rem;
    color: var(--text-primary);
}

.empty-subtitle {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
}

.modal-content {
    background: var(--bg-secondary);
    border-radius: 16px;
    padding: 2rem;
    max-width: 400px;
    width: 90%;
    border: 1px solid var(--border);
}

.modal-content h3 {
    margin-bottom: 0.5rem;
    font-size: 1.5rem;
}

.modal-content p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.modal-content input {
    width: 100%;
    padding: 0.75rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 1rem;
    margin-bottom: 1.5rem;
}

.modal-content input:focus {
    outline: none;
    border-color: var(--accent);
}

.modal-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
}

.share-link-row {
    margin-bottom: 0.5rem;
    align-items: center;
}

.share-link-row input {
    min-width: 0;
    margin-bottom: 0;
    border-radius: 12px 0 0 12px;
    border-right: none;
}

.share-desc {
    margin-bottom: 0.5rem;
}

.share-hint {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.share-link-row .btn-primary {
    border-radius: 0 12px 12px 0;
    height: 45px;
    padding: 0 0.9rem;
    box-shadow: none;
    font-size: 0.95rem;
}

/* Lightbox */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    backdrop-filter: blur(8px);
}

.lightbox-close {
    position: absolute;
    top: 2rem;
    right: 2rem;
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2300;
}

.lightbox-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 56px;
    height: 56px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2250;
}

.lightbox-nav:hover {
    background: rgba(255, 255, 255, 0.2);
}

.lightbox-prev {
    left: 2rem;
}

.lightbox-next {
    right: 2rem;
}

.lightbox-content {
    max-width: 90vw;
    max-height: 85vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 2100;
}

.lightbox-content img,
.lightbox-content video {
    max-width: 100%;
    max-height: 85vh;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.lightbox-content video {
    width: auto;
    height: auto;
}

.lightbox-caption {
    margin-top: 1.5rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
    text-align: center;
    z-index: 2100;
}

.lightbox-hotspot {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 33.3333%;
    z-index: 2150;
}

.lightbox-left {
    left: 0;
    cursor: w-resize;
}

.lightbox-center {
    left: 33.3333%;
    cursor: zoom-in;
}

.lightbox-right {
    right: 0;
    cursor: e-resize;
}

/* Footer */
.footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem 0 0;
    margin-top: 2rem;
    color: var(--text-secondary);
}

.footer a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.2s ease, transform 0.2s ease;
}

.footer a:hover {
    color: var(--accent-hover);
    transform: translateY(-1px);
}

.footer-links {
    display: flex;
    gap: 1rem;
}

.footer-github {
    font-weight: 600;
}

a {
    color: var(--accent);
}

.text-page {
    background: var(--bg-secondary);
    padding: 2rem;
    border-radius: 18px;
    box-shadow: 0 20px 40px var(--shadow);
}

.back-link {
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
}

.back-link:hover {
    color: var(--accent-hover);
}

/* Animations */
@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(14px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.extend-celebrate {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    z-index: 4000;
    animation: fadeUp 0.25s ease;
}

.extend-celebrate.is-hiding {
    opacity: 0;
    transform: translateY(-6px);
    transition: opacity 0.45s ease, transform 0.45s ease;
}

.extend-celebrate__card {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    border-radius: 18px;
    background: radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0)) var(--bg);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.05);
    overflow: hidden;
}

.extend-celebrate__icon-wrap {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-hover) 100%);
    display: grid;
    place-items: center;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    animation: extendPulse 1.6s ease-in-out infinite;
}

.extend-celebrate__icon {
    width: 40px;
    height: 40px;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
}

.extend-celebrate__text {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.extend-celebrate__title {
    font-weight: 700;
    font-size: 1rem;
    color: var(--text-primary);
}

.extend-celebrate__subtitle {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.extend-celebrate__confetti {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.extend-celebrate__confetti span {
    position: absolute;
    width: 8px;
    height: 14px;
    border-radius: 3px;
    background: var(--accent);
    left: calc(50% + (var(--i) - 4) * 8px);
    top: 50%;
    animation: extendConfetti 1.6s ease-out forwards;
    animation-delay: calc(var(--i) * 40ms);
}

.extend-celebrate__confetti span:nth-child(2n) {
    background: var(--accent-hover);
}

.extend-celebrate__confetti span:nth-child(3n) {
    background: #ffd166;
}

.extend-celebrate__confetti span:nth-child(4n) {
    background: #06d6a0;
}

@keyframes extendPulse {
    0% { transform: scale(1); box-shadow: 0 10px 25px rgba(0,0,0,0.2); }
    50% { transform: scale(1.05); box-shadow: 0 14px 30px rgba(0,0,0,0.24); }
    100% { transform: scale(1); box-shadow: 0 10px 25px rgba(0,0,0,0.2); }
}

@keyframes extendConfetti {
    0% { transform: translate(-50%, -10%) rotate(0deg); opacity: 1; }
    60% { opacity: 1; }
    100% { transform: translate(-50%, -120%) rotate(300deg); opacity: 0; }
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }

    .header {
        flex-direction: column;
        align-items: stretch;
    }

    .header-right {
        width: 100%;
        justify-content: space-between;
    }

    .login-toggle {
        display: inline-flex;
        align-items: center;
        gap: 0.35rem;
    }

    .login-wrapper {
        width: 100%;
        display: none !important;
    }

    .login-wrapper.is-open {
        display: flex !important;
    }

    .title-row {
        gap: 0.25rem;
    }

    .title-download:hover .download-label {
        max-width: 120px;
    }

    .gallery-selector {
        flex: 1;
        flex-direction: column;
        align-items: stretch;
        max-width: 100%;
    }

    .header-password-input {
        width: 120px;
    }

    .header-password-input:focus {
        width: 150px;
    }

    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 1rem;
    }

    .gallery-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .lightbox-nav {
        width: 40px;
        height: 40px;
        font-size: 1.5rem;
    }

    .lightbox-prev {
        left: 1rem;
    }

    .lightbox-next {
        right: 1rem;
    }

    .footer {
        flex-direction: column;
        align-items: flex-start;
    }
}

