/* =============================================
   COMPONENTS — LetsGetFitness V2
   ============================================= */

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius-md);
    font-family: var(--font-family);
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    border: 1px solid transparent;
    outline: none;
    transition: var(--transition);
    text-decoration: none;
    line-height: 1;
    white-space: nowrap;
    flex-shrink: 0;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none !important; }
.btn svg { flex-shrink: 0; }

/* Primary CTA. Per the design guidelines the primary action is theme-dependent:
   light = solid near-black (#1A1A1A) with white text; dark = solid gold with black
   text. --action-primary / --action-primary-text already flip per theme, so one rule
   serves both. Hover raises a soft shadow in light and a gold glow in dark, which
   --shadow-hover also already encodes per theme. */
.btn-primary {
    background: var(--action-primary);
    color: var(--action-primary-text);
    border-color: var(--action-primary);
}
.btn-primary:hover {
    background: var(--action-primary);
    border-color: var(--action-primary);
    color: var(--action-primary-text);
    box-shadow: var(--shadow-hover);
}
.btn-primary:active { box-shadow: none; }

.btn-secondary {
    background: var(--color-surface-2);
    color: var(--color-text);
    border-color: var(--color-border);
}
.btn-secondary:hover {
    background: var(--color-surface-hover);
    border-color: var(--brand-gold);
    color: var(--text-primary);
}

.btn-ghost {
    background: transparent;
    color: var(--color-text-muted);
    border-color: transparent;
}
.btn-ghost:hover { background: var(--color-surface-2); color: var(--brand-gold); }

.btn-danger {
    background: rgba(255,82,82,0.12);
    color: var(--color-danger);
    border-color: rgba(255,82,82,0.2);
}
.btn-danger:hover { background: var(--color-danger); color: #FFFFFF; border-color: var(--color-danger); }

.btn-outline {
    background: transparent;
    color: var(--text-primary);
    border-width: 1.5px;
    border-color: var(--border-subtle);
}
.btn-outline:hover { border-color: var(--brand-gold); color: var(--brand-gold); }

.btn-full { width: 100%; }
.btn-sm { padding: 6px 14px; font-size: 13px; border-radius: var(--radius-sm); }
.btn-lg { padding: 14px 28px; font-size: 16px; }
.btn-icon {
    display: inline-flex; align-items: center; justify-content: center;
    width: 36px; height: 36px; padding: 0;
    border-radius: var(--radius-sm);
    background: var(--color-surface-2);
    color: var(--color-text-muted);
    border: 1px solid var(--color-border);
    cursor: pointer;
    transition: var(--transition);
    flex-shrink: 0;
}
.btn-icon:hover { background: var(--color-surface-hover); color: var(--brand-gold); border-color: var(--brand-gold); }

/* Cards */
.card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: var(--spacing-lg);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}
.card-hover:hover {
    border-color: var(--color-border-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}
.card-clickable { cursor: pointer; }
.card-clickable:hover { border-color: var(--brand-gold-ring); }

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--spacing-lg);
    padding-bottom: var(--spacing-md);
    border-bottom: 1px solid var(--color-border);
}
.card-header h3 { margin: 0; }

/* Form elements */
.form-group {
    margin-bottom: var(--spacing-md);
    position: relative;
}

.form-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--color-text-muted);
    margin-bottom: 6px;
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    background: var(--color-surface-2);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    color: var(--color-text);
    font-family: var(--font-family);
    font-size: 14px;
    transition: var(--transition);
    outline: none;
}
.form-control::placeholder { color: var(--color-text-dim); }
.form-control:focus {
    border-color: var(--color-primary);
    background: var(--color-surface-active);
    box-shadow: 0 0 0 3px var(--color-primary-glow);
}
.form-control:disabled { opacity: 0.5; cursor: not-allowed; }
textarea.form-control { min-height: 100px; resize: vertical; line-height: 1.55; }
select.form-control { appearance: none; cursor: pointer; }

/* Floating label inputs */
.floating-group { position: relative; margin-bottom: var(--spacing-md); }
.floating-input {
    width: 100%;
    padding: 18px 14px 8px;
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    color: var(--color-text);
    font-family: var(--font-family);
    font-size: 15px;
    transition: var(--transition);
    outline: none;
}
.floating-input:focus {
    border-color: var(--color-primary);
    background: rgba(255,255,255,0.06);
    box-shadow: 0 0 0 3px var(--color-primary-glow);
}
.floating-input::placeholder { color: transparent; }
.floating-label {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--color-text-dim);
    font-size: 15px;
    pointer-events: none;
    transition: var(--transition);
}
.floating-input:focus ~ .floating-label,
.floating-input:not(:placeholder-shown) ~ .floating-label {
    top: 8px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--color-primary);
    transform: none;
}

/* Tabs */
.tabs {
    display: flex;
    gap: 2px;
    background: var(--color-surface-2);
    border-radius: var(--radius-md);
    padding: 4px;
    overflow-x: auto;
    scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
    flex-shrink: 0;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text-muted);
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
    border: none;
    background: transparent;
    font-family: var(--font-family);
}
.tab:hover { color: var(--color-text); }
.tab.active { background: var(--color-surface-active); color: var(--text-primary); }
.tab-primary.active { background: var(--color-primary); color: #000; }

/* Pill filters */
.pill-filters { display: flex; gap: 8px; flex-wrap: wrap; }
.pill {
    padding: 6px 16px;
    border-radius: var(--radius-full);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid var(--color-border);
    background: transparent;
    color: var(--color-text-muted);
    font-family: var(--font-family);
    transition: var(--transition);
    text-decoration: none;
    display: inline-block;
}
.pill:hover { border-color: var(--color-border-hover); color: var(--color-text); }
.pill.active { background: var(--color-primary); color: #000; border-color: var(--color-primary); }

/* Vote buttons */
.vote-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 6px;
    border-radius: var(--radius-sm);
    background: none;
    border: none;
    cursor: pointer;
    color: var(--color-text-muted);
    font-family: var(--font-family);
    font-weight: 700;
    font-size: 13px;
    transition: var(--transition);
    min-width: 40px;
}
.vote-btn:hover { color: var(--brand-gold); background: var(--color-surface-2); }
.vote-btn.voted-up { color: var(--color-primary); }
.vote-btn.voted-down { color: var(--color-danger); }
.vote-count { font-size: 14px; font-weight: 800; }

/* Like bar */
.like-bar {
    display: flex;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    overflow: hidden;
}
.like-bar-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    border: none;
    cursor: pointer;
    font-family: var(--font-family);
    font-weight: 600;
    font-size: 14px;
    transition: var(--transition);
}
.like-bar-btn.like { background: var(--brand-gold-ring); color: var(--color-primary); }
.like-bar-btn.like:hover, .like-bar-btn.like.active { background: var(--color-primary); color: #000; }
.like-bar-btn.dislike { background: rgba(255,82,82,0.08); color: var(--color-danger); }
.like-bar-btn.dislike:hover, .like-bar-btn.dislike.active { background: var(--color-danger); color: #FFFFFF; }

/* Post / Forum cards */
.post-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: var(--transition-slow);
    max-width: 600px;
    margin: 0 auto;
}
.post-card:hover { border-color: var(--color-border-hover); }
.post-card-header { padding: 16px 20px 12px; }
.post-card-image { width: 100%; max-height: 360px; object-fit: cover; }
.post-card-body { padding: 16px 20px; }
.post-card-actions { padding: 4px 20px 16px; display: flex; gap: 8px; }

.forum-row {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    display: flex;
    gap: 16px;
    padding: 20px;
    transition: var(--transition);
    cursor: pointer;
}
.forum-row:hover { border-color: var(--brand-gold-ring); transform: translateX(2px); }

/* Nutrition macros bar */
.macro-bar {
    background: var(--color-surface-2);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 16px 20px;
    display: flex;
    justify-content: space-around;
    gap: 16px;
    flex-wrap: wrap;
}
.macro-item { text-align: center; }
.macro-value { font-size: 24px; font-weight: 700; color: var(--text-primary); }
.macro-goal-den { font-size: 14px; font-weight: 500; opacity: 0.65; }
.macro-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.6px; color: var(--color-text-muted); }
.macro-unit { font-size: 11px; color: var(--color-text-dim); }

/* Workout card hero */
.workout-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: var(--transition-slow);
    display: flex;
    flex-direction: column;
}
.workout-card:hover { border-color: var(--brand-gold-ring); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.workout-card-hero {
    height: 160px;
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #111 0%, #1a2a1a 100%);
    display: flex;
    align-items: flex-end;
    padding: 12px 16px;
}
.workout-card-hero img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0.4; }
.workout-card-hero .hero-overlay {
    position: absolute; inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.7), transparent);
}
.workout-card-hero .hero-content { position: relative; z-index: 1; width: 100%; }
.workout-card-body { padding: 16px; flex: 1; display: flex; flex-direction: column; gap: 8px; }
.workout-card-footer { padding: 12px 16px; border-top: 1px solid var(--color-border); display: flex; gap: 8px; }

/* Profile header */
.profile-banner {
    height: 220px;
    width: 100%;
    object-fit: cover;
    background: linear-gradient(135deg, #111 0%, #1a2a1a 100%);
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    display: block;
}
.profile-header-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    overflow: hidden;
    margin-bottom: var(--spacing-lg);
}
.profile-header-body {
    display: flex;
    align-items: flex-end;
    gap: 20px;
    padding: 0 24px 20px;
    margin-top: -40px;
    flex-wrap: wrap;
}
.profile-avatar-wrap {
    position: relative;
    width: 88px; height: 88px;
    border-radius: 50%;
    border: 4px solid var(--color-bg);
    overflow: hidden;
    flex-shrink: 0;
}
.profile-avatar-wrap img { width: 100%; height: 100%; object-fit: cover; }

/* Exercise row */
.exercise-row {
    background: var(--color-surface-2);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 16px 20px;
    margin-bottom: 8px;
    transition: var(--transition);
}
.exercise-row:hover { border-color: var(--color-border-hover); }
.exercise-row-title { font-weight: 600; font-size: 16px; color: var(--text-primary); margin-bottom: 4px; }
.exercise-row-meta { font-size: 13px; color: var(--color-text-muted); margin-bottom: 8px; }
.exercise-row-stats { display: flex; gap: 20px; flex-wrap: wrap; }
.exercise-stat { font-size: 13px; }
.exercise-stat span { color: var(--text-primary); font-weight: 600; }

/* Food log item */
.food-log-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--color-border);
    transition: var(--transition);
}
.food-log-item:hover { background: var(--color-surface-2); }
.food-log-item:last-child { border-bottom: none; }

/* Meal section */
.meal-section {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    overflow: hidden;
    margin-bottom: var(--spacing-md);
}
.meal-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    border-bottom: 1px solid var(--color-border);
    background: var(--color-surface-2);
    cursor: pointer;
}
.meal-section-header:hover { background: var(--color-surface-hover); }

/* Admin table */
.data-table { width: 100%; border-collapse: collapse; }
.data-table th {
    text-align: left;
    padding: 10px 16px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--color-text-muted);
    border-bottom: 1px solid var(--color-border);
    background: var(--color-surface-2);
}
.data-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--color-border);
    font-size: 14px;
    color: var(--color-text);
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--color-surface-2); }

/* Search bar */
.search-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--color-surface-2);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    padding: 8px 14px;
    transition: var(--transition);
}
.search-bar:focus-within { border-color: var(--color-primary); box-shadow: 0 0 0 3px var(--color-primary-glow); }
.search-bar input {
    flex: 1;
    background: none;
    border: none;
    outline: none;
    color: var(--color-text);
    font-family: var(--font-family);
    font-size: 14px;
}
.search-bar input::placeholder { color: var(--color-text-dim); }

/* Comment composer */
.comment-composer {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 16px 20px;
    border-top: 1px solid var(--color-border);
}
.comment-box {
    flex: 1;
    display: flex;
    gap: 8px;
    align-items: center;
    background: var(--color-surface-2);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    padding: 8px 14px;
    transition: var(--transition);
}
.comment-box:focus-within { border-color: var(--color-primary); }
.comment-box input {
    flex: 1;
    background: none;
    border: none;
    outline: none;
    color: var(--color-text);
    font-family: var(--font-family);
    font-size: 14px;
}

/* Dropdown */
.dropdown { position: relative; display: inline-block; }
.dropdown-menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    background: var(--color-surface-2);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    z-index: 200;
    min-width: 160px;
    overflow: hidden;
    animation: fadeIn 0.15s ease;
}
.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    font-size: 14px;
    color: var(--color-text);
    cursor: pointer;
    transition: var(--transition);
}
.dropdown-item:hover { background: var(--color-surface-hover); color: var(--text-primary); }
.dropdown-item.danger { color: var(--color-danger); }
.dropdown-item.danger:hover { background: rgba(255,82,82,0.1); }

/* Progress bar */
.progress-bar { height: 6px; background: var(--color-surface-2); border-radius: var(--radius-full); overflow: hidden; }
.progress-bar-fill { height: 100%; background: var(--color-primary); border-radius: var(--radius-full); transition: width 0.6s ease; }

/* Article card */
.article-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: var(--transition-slow);
    display: flex;
    flex-direction: column;
}
.article-card:hover { border-color: var(--brand-gold-ring); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.article-card-body { padding: 16px; flex: 1; display: flex; flex-direction: column; gap: 6px; }
.article-card-title { font-size: 15px; font-weight: 600; color: var(--text-primary); line-height: 1.35; }
.article-card-excerpt { font-size: 13px; color: var(--color-text-muted); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.article-card-footer { padding: 12px 16px; border-top: 1px solid var(--color-border); display: flex; gap: 8px; }

/* Meal plan card */
.meal-plan-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: var(--transition-slow);
    cursor: pointer;
    position: relative;
}
.meal-plan-card:hover { border-color: var(--brand-gold-ring); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.meal-plan-card-hero {
    height: 160px;
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #0d1a0d 0%, #162216 100%);
}
.meal-plan-card-hero img { width: 100%; height: 100%; object-fit: cover; opacity: 0.5; }
.meal-plan-card-hero-overlay {
    position: absolute; inset: 0;
    background: linear-gradient(to bottom, transparent, rgba(0,0,0,0.7));
    display: flex; align-items: flex-end; padding: 12px 16px;
}
.meal-plan-card-body { padding: 16px; }

/* ==========================================================================
   Confirmation dialog (App.confirm)
   Replaces window.confirm so destructive actions match the rest of the UI.
   ========================================================================== */
.confirm-overlay {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-lg);
    background: rgba(0, 0, 0, 0.65);
    opacity: 0;
    transition: opacity 0.18s ease;
}
.confirm-overlay.open { opacity: 1; }

.confirm-box {
    width: 100%;
    max-width: 420px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: var(--spacing-xl);
    transform: translateY(8px) scale(0.98);
    transition: transform 0.18s ease;
}
.confirm-overlay.open .confirm-box { transform: translateY(0) scale(1); }

.confirm-title {
    margin: 0 0 var(--spacing-sm);
    font-size: 17px;
    font-weight: 700;
    color: var(--color-text);
}
.confirm-message {
    margin: 0;
    font-size: 14px;
    line-height: 1.55;
    color: var(--color-text-muted);
}
.confirm-message:empty { display: none; }

.confirm-actions {
    display: flex;
    justify-content: flex-end;
    gap: var(--spacing-sm);
    margin-top: var(--spacing-xl);
}

@media (max-width: 480px) {
    .confirm-actions { flex-direction: column-reverse; }
    .confirm-actions .btn { width: 100%; justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
    .confirm-overlay,
    .confirm-box { transition: none; }
}

/* Skip link — visible only once focused via keyboard. */
.skip-link {
    position: absolute;
    top: -100%;
    left: var(--spacing-md);
    z-index: 10000;
    padding: 10px 18px;
    background: var(--color-primary);
    color: #04140a;
    font-size: 14px;
    font-weight: 700;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    transition: top 0.15s ease;
}
.skip-link:focus {
    top: var(--spacing-md);
    color: #04140a;
}

/* ==========================================================================
   Theme toggle — shows the icon for the theme you'd switch TO.
   ========================================================================== */
.theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
    background: var(--bg-surface);
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition-snappy);
}
.theme-toggle:hover {
    color: var(--brand-gold);
    border-color: var(--brand-gold);
}

/* In light mode you can switch to dark -> show the moon. */
.theme-icon-sun { display: none; }
.theme-icon-moon { display: block; }

/* In dark mode you can switch to light -> show the sun. */
:root[data-theme="dark"] .theme-icon-sun { display: block; }
:root[data-theme="dark"] .theme-icon-moon { display: none; }

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]):not([data-theme="dark"]) .theme-icon-sun { display: block; }
    :root:not([data-theme="light"]):not([data-theme="dark"]) .theme-icon-moon { display: none; }
}

/* Accent button — a gold-filled action that sits beside the primary (black/gold) button
   without competing with it. Used for AI-assisted actions. Gold is light in both themes,
   so the foreground is --on-gold (near-black) in both. */
.btn-accent {
    background: var(--brand-gold);
    color: var(--on-gold);
    border-color: var(--brand-gold);
}
.btn-accent:hover {
    background: var(--brand-gold-hover);
    border-color: var(--brand-gold-hover);
    color: var(--on-gold);
    box-shadow: var(--shadow-hover);
}
.btn-accent:active { box-shadow: none; }

/* ---- Shared image uploader (meal plans + custom exercises) ---- */
.img-uploader { display: block; }
.img-uploader-dropzone {
    position: relative;
    border: 1.5px dashed var(--border-strong);
    border-radius: var(--radius-md, 10px);
    background: var(--bg-input);
    padding: 20px;
    cursor: pointer;
    transition: var(--transition-snappy);
    text-align: center;
}
.img-uploader-dropzone:hover,
.img-uploader-dropzone:focus-visible {
    border-color: var(--brand-gold);
    outline: none;
}
.img-uploader-dropzone.img-uploader-drag {
    border-color: var(--brand-gold);
    background: color-mix(in srgb, var(--brand-gold) 12%, var(--bg-input));
}
.img-uploader-dropzone.img-uploader-busy { opacity: 0.7; pointer-events: none; }
.img-uploader-empty { color: var(--text-secondary); }
.img-uploader-empty svg { margin: 0 auto 8px; color: var(--text-secondary); opacity: 0.7; }
.img-uploader-hint { margin: 0; font-size: 13px; color: var(--text-primary); }
.img-uploader-browse { color: var(--brand-gold); font-weight: 700; text-decoration: underline; }
.img-uploader-subhint { margin: 4px 0 0; font-size: 11.5px; color: var(--text-secondary); }
.img-uploader-preview-wrap { position: relative; display: inline-block; max-width: 100%; }
.img-uploader-preview {
    max-width: 100%;
    max-height: 180px;
    border-radius: var(--radius-sm, 6px);
    display: block;
    object-fit: cover;
    background: var(--bg-base);
}
.img-uploader-remove {
    position: absolute;
    top: -8px; right: -8px;
    width: 26px; height: 26px;
    border-radius: 999px;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-snappy);
}
.img-uploader-remove:hover { border-color: var(--brand-gold); color: var(--brand-gold); }
.img-uploader-actions { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 8px; }
.img-uploader-ai-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.img-uploader-ai-btn.is-loading {
    opacity: 0.75;
    pointer-events: none;
}
.img-uploader-ai-btn.is-loading .img-uploader-ai-label::after {
    content: '';
    display: inline-block;
    width: 12px;
    height: 12px;
    margin-left: 6px;
    border: 1.5px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    vertical-align: -2px;
    animation: img-uploader-spin 0.7s linear infinite;
}
@keyframes img-uploader-spin {
    to { transform: rotate(360deg); }
}
@media (prefers-reduced-motion: reduce) {
    .img-uploader-ai-btn.is-loading .img-uploader-ai-label::after { animation: none; }
}
.img-uploader-status { font-size: 12px; margin-top: 6px; min-height: 16px; color: var(--text-secondary); }
.img-uploader-status-pending { color: var(--text-secondary); }
.img-uploader-status-success { color: var(--status-success); }
.img-uploader-status-error { color: var(--status-error, var(--color-danger)); }
.img-uploader-url-fallback { margin-top: 8px; }
.img-uploader-url-fallback summary {
    cursor: pointer;
    font-size: 12px;
    color: var(--text-secondary);
    list-style: none;
}
.img-uploader-url-fallback summary::-webkit-details-marker { display: none; }
.img-uploader-url-fallback summary:hover { color: var(--text-primary); }

/* Notification bell panel */
.notification-empty {
    padding: 28px 16px;
    font-size: 13px;
    /* --color-text-dim only reaches 4.0:1 on the light panel. */
    color: var(--color-text-muted, var(--text-secondary));
    text-align: center;
}
.notification-item {
    padding: 12px 16px;
    /* Left edge is reserved for the unread accent so read and unread rows keep
       their text on the same vertical line. */
    border-left: 3px solid transparent;
    border-bottom: 1px solid var(--color-border);
    transition: background 0.15s ease;
}
.notification-item:last-child { border-bottom: none; }
.notification-item:hover {
    background: var(--color-surface-hover, rgba(0, 0, 0, 0.04));
}
.notification-item:focus-visible {
    outline: none;
    background: var(--color-surface-hover, rgba(0, 0, 0, 0.04));
    box-shadow: inset var(--focus-ring);
}
/* Unread is tinted with the brand gold rather than the neutral hover fill —
   they were the same colour, so hovering a read row impersonated an unread one. */
/* Read vs unread is carried by fill + accent + weight, never by colour alone. */
.notification-item.is-unread {
    background: var(--brand-gold-soft);
    border-left-color: var(--color-primary, var(--brand-gold));
}
.notification-item.is-unread:hover,
.notification-item.is-unread:focus-visible {
    background: var(--brand-gold-ring);
}
.notification-item.is-unread .notification-msg { font-weight: 600; }
.notification-item-top {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 4px;
}
/* Gold reads at 2.1:1 on the light panel, so the metadata line stays neutral and
   the brand accent lives in the unread fill and border instead. */
.notification-type-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--color-text-muted, var(--text-secondary));
}
.notification-when {
    font-size: 11px;
    color: var(--color-text-muted, var(--text-secondary));
    flex-shrink: 0;
}
.notification-msg {
    font-size: 13px;
    line-height: 1.35;
    color: var(--color-text, var(--text-primary));
}
