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

html {
    overflow-x: hidden;
}

:root {
    --bg: #f5f6f8;
    --bg-card: #ffffff;
    --accent: #3b82f6;
    --accent-hover: #2563eb;
    --text: #1a1a2e;
    --text-muted: #9b9b9b;
    --border: #e6e6e6;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 1px 8px rgba(0,0,0,0.06);
}

.dark {
    --bg: #0f0f12;
    --bg-card: #1a1a22;
    --accent: #4b8bf5;
    --accent-hover: #3b7be5;
    --text: #e4e4e7;
    --text-muted: #71717a;
    --border: #27272a;
    --shadow: 0 1px 8px rgba(0,0,0,0.3);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.5;
    transition: background 0.2s, color 0.2s;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 16px;
}

/* ─── Header ─── */
.header {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    padding: 0 20px;
    height: 52px;
    display: flex;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    transition: background 0.2s, border-color 0.2s;
}

.header-inner {
    max-width: 1000px;
    width: 100%;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    color: var(--text);
    text-decoration: none;
}

.logo img {
    display: block;
    height: 22px;
    width: auto;
}

.header-auth {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-user {
    font-size: 13px;
    color: var(--text-muted);
}

.header-link {
    font-size: 13px;
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.15s;
}

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

.header-dropdown {
    position: relative;
}
.header-dropdown-trigger {
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    padding: 4px 0;
}
.header-dropdown-trigger svg {
    transition: transform 0.15s;
}
.header-dropdown:hover .header-dropdown-trigger svg {
    transform: rotate(180deg);
}
.header-dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    min-width: 170px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    opacity: 0;
    visibility: hidden;
    transform: translateY(4px);
    transition: opacity 0.15s, visibility 0.15s, transform 0.15s;
    z-index: 200;
    overflow: hidden;
}
.header-dropdown:hover .header-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.header-dropdown-item {
    display: flex;
    align-items: center;
    padding: 9px 14px;
    font-size: 13px;
    text-decoration: none;
    color: var(--text);
    transition: background 0.1s;
    white-space: nowrap;
}
.header-dropdown-item:hover {
    background: var(--bg);
}
.header-dropdown-item--danger {
    color: #dc2626;
}
.dark .header-dropdown-item--danger {
    color: #ef4444;
}

.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    font-size: 10px;
    font-weight: 700;
    border-radius: 8px;
    background: #dc2626;
    color: #fff;
    line-height: 1;
}
.header-dropdown-item .badge {
    margin-left: 6px;
}
.header-dropdown-divider {
    height: 1px;
    background: var(--border);
    margin: 4px 0;
}

/* ─── Theme Toggle ─── */
.theme-toggle {
    background: none;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, color 0.15s;
}

.theme-toggle:hover {
    background: var(--border);
    color: var(--text);
}

/* ─── Buttons ─── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 18px;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s ease;
    white-space: nowrap;
    user-select: none;
    -webkit-user-select: none;
}

.btn-outline {
    background: var(--accent);
    color: #fff;
}

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

.btn-danger {
    background: #dc2626;
    color: #fff;
}
.btn-danger:hover {
    background: #b91c1c;
}
.dark .btn-danger {
    background: #ef4444;
}
.dark .btn-danger:hover {
    background: #dc2626;
}

/* ─── Album Toolbar ─── */
.album-banner {
    text-align: center;
    padding: 10px 16px;
    margin: 12px auto 0;
    max-width: 1000px;
    font-size: 13px;
    font-weight: 500;
    color: #92400e;
    background: #fef3c7;
    border-radius: var(--radius-sm);
}
.dark .album-banner {
    color: #fbbf24;
    background: #3b2f00;
}

.album-bar {
}
.album-bar-inner {
    max-width: 1000px;
    margin: 15px auto;
    padding: 0 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.album-bar-left {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 16px;
    color: var(--text-muted);
}
.album-token {
    font-family: monospace;
    font-size: 14px;
    font-weight: 500;
    color: var(--accent);
    cursor: pointer;
    padding: 2px 6px 0px 6px;
    border-radius: 4px;
    transition: background 0.1s;
    user-select: all;
}
.album-token:hover {
    background: var(--bg);
}
.album-author {
    font-size: 13px;
    font-family: inherit;
    color: var(--text-muted);
}
.album-token-hint {
    font-size: 11px;
    color: var(--text-muted);
}
.album-bar-right {
    display: flex;
    align-items: center;
    gap: 6px;
}

.toolbar-btn {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: var(--bg-card);
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, color 0.15s;
    border: 1px solid var(--border);
}

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

.toolbar-btn--danger:hover {
    background: #fee2e2;
    color: #dc2626;
    border-color: #dc2626;
}

.dark .toolbar-btn--danger:hover {
    background: #3b1010;
    color: #ef4444;
    border-color: #ef4444;
}

.toolbar-btn--report:hover {
    background: #fef3c7;
    color: #d97706;
    border-color: #d97706;
}

.dark .toolbar-btn--report:hover {
    background: #3b2f00;
    color: #fbbf24;
    border-color: #fbbf24;
}

/* ─── Album Page ─── */
.album-page {
    padding-bottom: 40px;
}

/* ─── Grid (index page) ─── */
.gallery {
    padding: 32px 0 48px;
}

.gallery-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 20px;
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    padding: 4px;
    border: 1px solid var(--border);
    width: fit-content;
}
.gallery-tab {
    padding: 6px 16px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    color: var(--text-muted);
    transition: background 0.15s, color 0.15s;
    user-select: none;
    -webkit-user-select: none;
}
.gallery-tab:hover {
    color: var(--text);
    background: var(--bg);
}
.gallery-tab--active {
    background: var(--accent);
    color: #fff;
}
.gallery-tab--active:hover {
    background: var(--accent-hover);
    color: #fff;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
}

.card {
    background: var(--bg-card);
    border-radius: var(--radius);
    overflow: hidden;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    border: 1px solid var(--border);
    text-decoration: none;
    color: inherit;
    display: block;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.08);
}

.card--own {
    box-shadow: 0 0 0 1px var(--accent), 0 0 16px rgba(59, 130, 246, 0.2);
}

.card--own:hover {
    box-shadow: 0 0 0 1px var(--accent), 0 0 24px rgba(59, 130, 246, 0.3);
}

.card-img {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: var(--border);
}

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

.card-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
}

.card-info {
    padding: 10px 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
}

.card-count {
    color: var(--text);
    font-weight: 500;
}

.card-date {
    color: var(--text-muted);
}

.card-link-wrap {
    display: block;
    text-decoration: none;
    color: inherit;
}

.card-actions {
    padding: 0 14px 12px;
    display: flex;
    gap: 6px;
    border-top: 1px solid var(--border);
    padding-top: 10px;
    margin-top: -2px;
}
.card-action-btn {
    flex: 1;
    display: block;
    text-align: center;
    text-decoration: none;
    font-size: 11px;
    font-weight: 500;
    padding: 5px 8px;
    border-radius: 6px;
    background: var(--bg);
    color: var(--text-muted);
    transition: background 0.15s, color 0.15s;
    user-select: none;
    -webkit-user-select: none;
}
.card-action-btn:hover {
    background: var(--border);
    color: var(--text);
}
.card-action-btn--danger {
    color: #dc2626;
}
.card-action-btn--danger:hover {
    background: #dc2626;
    color: #fff;
}
.dark .card-action-btn--danger {
    color: #ef4444;
}
.dark .card-action-btn--danger:hover {
    background: #ef4444;
    color: #fff;
}

.empty-state {
    max-width: 1000px;
    margin: 0 auto;
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-state p {
    font-size: 15px;
}

/* ─── Album Feed View ─── */
.album-feed {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 16px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.feed-item-wrap {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
    background: var(--bg-card);
    transition: border-color 0.2s;
}

.feed-item {
    display: block;
    text-decoration: none;
}

.feed-item img {
    display: block;
    width: 100%;
    height: auto;
    -webkit-user-drag: none;
    user-select: none;
    -webkit-user-select: none;
}

.feed-actions {
    position: absolute;
    top: 8px;
    right: 8px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    opacity: 0;
    transition: opacity 0.2s;
    z-index: 2;
}
.feed-item-wrap:hover .feed-actions {
    opacity: 1;
}

.feed-delete,
.feed-arrow {
    width: 30px;
    height: 30px;
    border: none;
    border-radius: 50%;
    background: rgba(0,0,0,0.45);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
    line-height: 0;
}
.feed-delete svg,
.feed-arrow svg {
    display: block;
}

.feed-delete:hover {
    background: #dc2626;
}
.feed-arrow:hover {
    background: rgba(255,255,255,0.25);
}

.feed-btn {
    width: 30px;
    height: 30px;
    border: none;
    border-radius: 50%;
    background: rgba(0,0,0,0.45);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
    line-height: 0;
    text-decoration: none;
}
.feed-download {
    margin-top: auto;
}
.feed-btn svg {
    display: block;
}
.feed-download:hover {
    background: var(--accent);
}
.feed-copy:hover {
    background: var(--accent);
}

/* ─── Scroll to Top ─── */
.scroll-top {
    position: fixed;
    bottom: 28px;
    left: 28px;
    width: 48px;
    height: 48px;
    border: 1px solid var(--border);
    border-radius: 50%;
    background: var(--bg-card);
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s, background 0.15s, color 0.15s;
    z-index: 999;
    box-shadow: var(--shadow);
}

.scroll-top.visible {
    opacity: 1;
    pointer-events: auto;
}

.scroll-top:hover {
    background: var(--border);
    color: var(--text);
}

/* ─── Spinner ─── */
.spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid var(--text-muted);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    vertical-align: middle;
    margin-right: 6px;
}

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

/* ─── Auth Pages ─── */
.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 52px);
    padding: 40px 16px;
}

.auth-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 32px;
    width: 100%;
    max-width: 380px;
}

.auth-card h1 {
    font-size: 22px;
    margin-bottom: 20px;
    text-align: center;
}

.auth-error {
    background: #fee2e2;
    color: #dc2626;
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 13px;
    margin-bottom: 16px;
}

.auth-success {
    background: #d1fae5;
    color: #059669;
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 13px;
    margin-bottom: 16px;
}

.dark .auth-success {
    background: #0a2a1a;
    color: #34d399;
}

.dark .auth-error {
    background: #3b1010;
    color: #ef4444;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text);
}

.form-group input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.15s;
    background: var(--bg);
    color: var(--text);
}

.form-group input:focus {
    border-color: var(--accent);
}

.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 14px;
    outline: none;
    font-family: inherit;
    transition: border-color 0.15s;
    background: var(--bg);
    color: var(--text);
    resize: vertical;
}
.form-group textarea:focus {
    border-color: var(--accent);
}

.form-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.4;
    cursor: pointer;
}
.form-checkbox input[type="checkbox"] {
    width: auto;
    margin-top: 2px;
    flex-shrink: 0;
}

/* Ticket list */
.ticket-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.ticket-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}
.ticket-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
}
.ticket-email {
    font-weight: 600;
    color: var(--text);
}
.ticket-status {
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
}
.ticket-type {
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
    background: #fef3c7;
    color: #92400e;
}
.dark .ticket-type {
    background: #3b2f00;
    color: #fbbf24;
}
.ticket-type--complaint {
    background: #fee2e2;
    color: #dc2626;
}
.dark .ticket-type--complaint {
    background: #3b1010;
    color: #ef4444;
}
.ticket-status--open {
    background: #d1fae5;
    color: #059669;
}
.dark .ticket-status--open {
    background: #0a2a1a;
    color: #34d399;
}
.ticket-status--closed {
    background: var(--border);
    color: var(--text-muted);
}
.ticket-date {
    margin-left: auto;
    font-size: 12px;
    color: var(--text-muted);
}
.ticket-meta {
    padding: 4px 16px 0;
    font-size: 11px;
    color: var(--text-muted);
}
.ticket-message {
    padding: 12px 16px;
    font-size: 13px;
    line-height: 1.5;
    color: var(--text);
    word-break: break-word;
}
.ticket-message a, .ticket-reply a {
    color: var(--accent);
    text-decoration: underline;
    word-break: break-all;
}
.ticket-reply {
    padding: 12px 16px;
    margin: 0 12px 12px;
    background: var(--bg);
    border-radius: var(--radius-sm);
    font-size: 13px;
    line-height: 1.5;
    border-left: 3px solid var(--accent);
}
.ticket-reply strong {
    display: block;
    margin-bottom: 4px;
}
.ticket-reply p {
    color: var(--text);
}
.ticket-reply-form {
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    border-top: 1px solid var(--border);
}
.ticket-reply-form .form-input {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 13px;
    font-family: inherit;
    outline: none;
    background: var(--bg);
    color: var(--text);
    resize: vertical;
    transition: border-color 0.15s;
}
.ticket-reply-form .form-input:focus {
    border-color: var(--accent);
}
.ticket-reply-form .btn {
    align-self: flex-start;
}

.auth-link {
    text-align: center;
    margin-top: 16px;
    font-size: 13px;
    color: var(--text-muted);
}

.auth-link a {
    color: var(--accent);
    text-decoration: none;
}

.auth-link a:hover {
    text-decoration: underline;
}

/* ─── Drag Overlay (full page) ─── */
.drag-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(59, 130, 246, 0.15);
    backdrop-filter: blur(4px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    border: 3px dashed var(--accent);
}

.drag-overlay.active {
    opacity: 1;
}

.drag-overlay-inner {
    text-align: center;
    color: var(--accent);
}

.drag-overlay-inner svg {
    margin-bottom: 12px;
}

.drag-overlay-inner p {
    font-size: 18px;
    font-weight: 600;
}

/* ─── Hidden Drop Zone (FAB) ─── */
.drop-zone {
    position: fixed !important;
    bottom: 28px;
    right: 28px;
    width: 56px;
    height: 56px;
    padding: 0;
    margin: 0;
    border: none;
    border-radius: 50%;
    background: var(--accent);
    cursor: pointer;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(59, 130, 246, 0.4);
    transition: transform 0.15s, box-shadow 0.15s;
}

.drop-zone:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 24px rgba(59, 130, 246, 0.5);
    background: var(--accent-hover);
}

.drop-zone .drop-zone-icon {
    color: #fff;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.drop-zone .drop-zone-icon svg {
    width: 24px;
    height: 24px;
}

.drop-zone h2,
.drop-zone p,
.drop-zone .drop-zone-hint {
    display: none;
}

/* ─── Upload Status Toast ─── */
.upload-status {
    display: none;
    position: fixed;
    bottom: 80px;
    right: 24px;
    z-index: 1001;
    margin: 0;
    padding: 10px 18px;
    border-radius: 8px;
    font-size: 13px;
    min-width: 200px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}

.upload-status.loading {
    display: block;
    background: #e8f0fe;
    color: var(--accent);
}

.dark .upload-status.loading {
    background: #1a2a3a;
}

.upload-status.success {
    display: block;
    background: #d1fae5;
    color: #059669;
}

.dark .upload-status.success {
    background: #0a2a1a;
    color: #34d399;
}

.upload-status.error {
    display: block;
    background: #fee2e2;
    color: #dc2626;
}

.dark .upload-status.error {
    background: #3b1010;
    color: #ef4444;
}

/* ─── Upload Modal Progress ─── */
.modal--upload .modal-body {
    padding: 24px;
}
.upload-progress-bar {
    height: 6px;
    background: var(--border);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 8px;
}
.upload-progress-fill {
    height: 100%;
    width: 0%;
    background: var(--accent);
    border-radius: 3px;
    transition: width 0.3s ease;
}
.upload-progress-text {
    font-size: 12px;
    color: var(--text-muted);
    text-align: center;
    margin-bottom: 16px;
}
.upload-file-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
    max-height: 240px;
    overflow-y: auto;
    margin-bottom: 16px;
}
.upload-file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font-size: 12px;
    padding: 6px 8px;
    border-radius: 6px;
    background: var(--bg);
}
.upload-file-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    color: var(--text);
}
.upload-file-status {
    flex-shrink: 0;
    font-weight: 600;
    font-size: 11px;
    min-width: 40px;
    text-align: right;
}
.upload-file-item--loading .upload-file-status {
    color: var(--accent);
}
.upload-file-item--loading .upload-file-status::before {
    content: '';
    display: inline-block;
    width: 12px;
    height: 12px;
    border: 2px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    vertical-align: middle;
    margin-right: 4px;
}
.upload-file-item--success .upload-file-status {
    color: #059669;
}
.upload-file-item--error .upload-file-status {
    color: #dc2626;
}
.upload-complete {
    display: flex;
    gap: 10px;
    justify-content: center;
    padding-top: 8px;
}

/* ─── Drop section ─── */
.drop-section {
    position: static;
    width: auto;
    margin: 0;
    padding: 0;
}

/* ─── Modal ─── */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
}
.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}
.modal {
    background: var(--bg-card);
    border-radius: var(--radius);
    width: 90%;
    max-width: 1100px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 16px 48px rgba(0,0,0,0.2);
    border: 1px solid var(--border);
}
.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
}
.modal-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}
.modal-tabs {
    display: flex;
    gap: 2px;
    background: var(--bg);
    border-radius: 6px;
    padding: 2px;
}
.modal-tab {
    padding: 5px 12px;
    font-size: 12px;
    font-weight: 500;
    border-radius: 5px;
    cursor: pointer;
    color: var(--text-muted);
    transition: background 0.12s, color 0.12s;
    user-select: none;
    -webkit-user-select: none;
}
.modal-tab:hover {
    color: var(--text);
}
.modal-tab--active {
    background: var(--bg-card);
    color: var(--text);
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.modal-header h2 {
    font-size: 16px;
    font-weight: 700;
}
.modal-close {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 50%;
    background: none;
    color: var(--text-muted);
    font-size: 22px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, color 0.15s;
}
.modal-close:hover {
    background: var(--border);
    color: var(--text);
}
.modal-body {
    padding: 0;
    overflow-y: auto;
    flex: 1;
}
.modal-loader {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: var(--text-muted);
    font-size: 14px;
}
.modal-empty {
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
    font-size: 14px;
}

/* ─── Visit Header Button ─── */
.visit-header-btn {
    padding: 4px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: none;
    color: var(--text-muted);
    font-size: 11px;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.visit-header-btn:hover {
    background: #fee2e2;
    color: #dc2626;
    border-color: #dc2626;
}
.dark .visit-header-btn:hover {
    background: #3b1010;
    color: #ef4444;
    border-color: #ef4444;
}
.visit-del-btn {
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 50%;
    background: none;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, color 0.15s;
    opacity: 0.4;
    line-height: 0;
}
.visit-del-btn svg {
    display: block;
}
tr:hover .visit-del-btn {
    opacity: 1;
}
.visit-del-btn:hover {
    background: #fee2e2;
    color: #dc2626;
}
.dark .visit-del-btn:hover {
    background: #3b1010;
    color: #ef4444;
}

/* ─── Visit Table ─── */
.visit-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}
.visit-table thead {
    position: sticky;
    top: 0;
    z-index: 1;
}
.visit-table th {
    background: var(--bg);
    padding: 10px 12px;
    text-align: left;
    font-weight: 600;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
.visit-table td {
    padding: 8px 12px;
    border-bottom: 1px solid var(--border);
    color: var(--text);
    vertical-align: top;
}
.visit-table td:last-child {
    vertical-align: middle;
    width: 40px;
    padding: 4px 8px;
}
.visit-table tr:hover td {
    background: var(--bg);
}
.visit-table .visit-ua {
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.visit-na {
    color: var(--text-muted);
}
.visit-ref {
    color: var(--accent);
    text-decoration: none;
}
.visit-ref:hover {
    text-decoration: underline;
}

/* ─── Prevent text selection on UI elements ─── */
.modal-close,
.toolbar-btn,
.feed-delete,
.feed-arrow,
.visit-del-btn,
.visit-header-btn,
.theme-toggle,
.scroll-top,
.btn,
.header-link {
    user-select: none;
    -webkit-user-select: none;
}

/* ─── Responsive ─── */
@media (max-width: 768px) {
    .grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 10px;
    }

    .album-feed {
        padding: 0 8px;
    }

    .scroll-top {
        left: 16px;
        bottom: 16px;
        width: 44px;
        height: 44px;
    }

    .card-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 2px;
    }
}

/* ─── Toast ─── */
.toast {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: var(--text);
    color: var(--bg);
    padding: 8px 18px;
    border-radius: 8px;
    font-size: 13px;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.2s, transform 0.2s;
    pointer-events: none;
}
.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ─── Album Meta ─── */
.album-meta {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 16px;
}
.album-meta-inner {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 10px 0;
    flex-wrap: wrap;
}
.album-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    color: var(--text-muted);
}
.album-meta-item svg {
    flex-shrink: 0;
    opacity: 0.7;
}

/* ─── Floating Auth Bar ─── */
.auth-float-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 998;
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    box-shadow: 0 -2px 12px rgba(0,0,0,0.08);
    transition: background 0.2s, border-color 0.2s;
}
.auth-float-bar-inner {
    max-width: 1000px;
    margin: 0 auto;
    padding: 10px 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}
.auth-float-bar-text {
    font-size: 13px;
    color: var(--text-muted);
}
.auth-float-bar-btn {
    display: inline-flex;
    align-items: center;
    padding: 6px 16px;
    border-radius: 6px;
    background: var(--accent);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.15s;
    white-space: nowrap;
}
.auth-float-bar-btn:hover {
    background: var(--accent-hover);
}
.auth-float-bar-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 20px;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
    transition: color 0.15s;
}
.auth-float-bar-close:hover {
    color: var(--text);
}

.dark .auth-float-bar {
    box-shadow: 0 -2px 12px rgba(0,0,0,0.3);
}

@media (max-width: 768px) {
    .auth-float-bar-text {
        font-size: 12px;
    }
    .album-meta-inner {
        gap: 10px;
    }
    .album-meta-item {
        font-size: 12px;
    }
}
