/* ── Design tokens ──────────────────────────────────────────────────────────── */
:root {
    --color-bg:           #f1f5f9;
    --color-surface:      #ffffff;
    --color-surface-2:    #f8fafc;
    --color-border:       #e2e8f0;
    --color-primary:      #3b82f6;
    --color-primary-dark: #2563eb;
    --color-primary-muted:#eff6ff;
    --color-danger:       #ef4444;
    --color-danger-dark:  #dc2626;
    --color-success:      #22c55e;
    --color-warning:      #f59e0b;
    --color-text:         #0f172a;
    --color-text-muted:   #64748b;
    --color-nav-bg:       #1e293b;
    --color-nav-text:     #cbd5e1;
    --color-nav-active:   #ffffff;
    --color-nav-hover-bg: #334155;

    --radius-sm:   4px;
    --radius-md:   8px;
    --radius-lg:   12px;
    --radius-xl:   16px;
    --radius-full: 9999px;

    --shadow-sm: 0 1px 2px rgba(0,0,0,.06), 0 1px 3px rgba(0,0,0,.08);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,.08), 0 2px 4px -1px rgba(0,0,0,.05);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,.08), 0 4px 6px -2px rgba(0,0,0,.04);

    --font: 'Inter', system-ui, -apple-system, sans-serif;
    --nav-width: 220px;
    --transition: 150ms ease;
}

/* ── Reset ──────────────────────────────────────────────────────────────────── */

/* ── App loading splash ────────────────────────────────────────────────────── */
#app-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: var(--color-bg, #f1f5f9);
}

/* ── Reset ──────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
    height: 100%;
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.6;
    color: var(--color-text);
    background: var(--color-bg);
    -webkit-font-smoothing: antialiased;
}

a { color: var(--color-primary); text-decoration: none; }
a:hover { text-decoration: underline; }

h1 { font-size: 1.6rem; font-weight: 700; margin-bottom: 1.25rem; }
h2 { font-size: 1.2rem; font-weight: 600; margin-bottom: 1rem; }
h1:focus { outline: none; }

p { color: var(--color-text-muted); margin-bottom: .75rem; }

/* ── App shell ──────────────────────────────────────────────────────────────── */
.app-shell {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

.app-shell__content {
    flex: 1;
    margin-left: var(--nav-width);
    padding: 2rem 2.5rem;
    overflow-y: auto;
    /*max-width: 1200px;*/
}

/* ── Navigation sidebar ─────────────────────────────────────────────────────── */
.nav {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: var(--nav-width);
    background: var(--color-nav-bg);
    display: flex;
    flex-direction: column;
    padding: 1.5rem 0 1rem;
    gap: .25rem;
    z-index: 100;
    box-shadow: 2px 0 8px rgba(0,0,0,.15);
}

.nav__brand {
    font-size: 1.15rem;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: -.01em;
    padding: 0 1.25rem .75rem;
    border-bottom: 1px solid #334155;
    margin-bottom: .5rem;
    text-decoration: none;
}

.nav__brand span { color: var(--color-primary); }

.nav__section {
    font-size: .7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: #475569;
    padding: .75rem 1.25rem .25rem;
}

.nav__link {
    display: flex;
    align-items: center;
    gap: .625rem;
    padding: .55rem 1.25rem;
    color: var(--color-nav-text);
    font-size: .875rem;
    font-weight: 500;
    border-radius: 0;
    transition: background var(--transition), color var(--transition);
    text-decoration: none;
}

.nav__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.25rem;
    flex-shrink: 0;
    font-style: normal;
}
.nav__link:hover { background: var(--color-nav-hover-bg); color: var(--color-nav-active); text-decoration: none; }
.nav__link.active { background: var(--color-primary); color: #fff; }

.nav__spacer { flex: 1; }

.nav__link--danger { color: #f87171; }
.nav__link--danger:hover { background: #7f1d1d30; color: #fca5a5; }

.nav__version {
    display: block;
    padding: .5rem 1.25rem .25rem;
    font-size: .65rem;
    color: #475569;
    text-align: center;
}

.nav__user {
    display: block;
    padding: .35rem 1.25rem .5rem;
    font-size: .8rem;
    font-weight: 600;
    color: var(--color-nav-active);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── Buttons ────────────────────────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .5rem 1rem;
    font-family: var(--font);
    font-size: .875rem;
    font-weight: 500;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-surface);
    color: var(--color-text);
    cursor: pointer;
    transition: background var(--transition), box-shadow var(--transition), border-color var(--transition);
    text-decoration: none;
    white-space: nowrap;
}
.btn:hover { background: var(--color-surface-2); border-color: #cbd5e1; box-shadow: var(--shadow-sm); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.btn--primary { background: var(--color-primary); color: #fff; border-color: var(--color-primary); }
.btn--primary:hover { background: var(--color-primary-dark); border-color: var(--color-primary-dark); }

.btn--danger { background: var(--color-danger); color: #fff; border-color: var(--color-danger); }
.btn--danger:hover { background: var(--color-danger-dark); border-color: var(--color-danger-dark); }

.btn--sm { padding: .3rem .7rem; font-size: .8rem; }
.btn--lg { padding: .7rem 1.4rem; font-size: 1rem; }
.btn--ghost { border-color: transparent; background: transparent; }
.btn--ghost:hover { background: var(--color-primary-muted); border-color: transparent; }

/* ── Forms ──────────────────────────────────────────────────────────────────── */
.form-group {
    display: flex;
    flex-direction: column;
    gap: .35rem;
    margin-bottom: 1.1rem;
}

label, .input-label {
    font-size: .8rem;
    font-weight: 600;
    color: var(--color-text);
    letter-spacing: .01em;
}

.form-control,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
textarea,
select {
    width: 100%;
    padding: .55rem .8rem;
    font-family: var(--font);
    font-size: .875rem;
    color: var(--color-text);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    transition: border-color var(--transition), box-shadow var(--transition);
    outline: none;
}
.form-control:focus,
input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
textarea:focus,
select:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(59,130,246,.15);
}

input[type="range"] {
    width: 100%;
    accent-color: var(--color-primary);
    cursor: pointer;
}

input[type="checkbox"] { accent-color: var(--color-primary); width: 1rem; height: 1rem; cursor: pointer; }

.form-actions { display: flex; gap: .625rem; margin-top: 1.5rem; }

.validation-message { font-size: .8rem; color: var(--color-danger); }
.error { font-size: .85rem; color: var(--color-danger); background: #fef2f2; border: 1px solid #fecaca; border-radius: var(--radius-md); padding: .5rem .75rem; }

/* ── Cards ──────────────────────────────────────────────────────────────────── */
.card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
}

.project-group {
    margin-bottom: 2rem;
}
.project-group__name {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0 0 .25rem;
}
.project-group__desc {
    font-size: .9rem;
    color: var(--color-text-muted);
    margin: 0 0 1rem;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.25rem;
}

.image-set-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    gap: .625rem;
    transition: box-shadow var(--transition), transform var(--transition);
}
.image-set-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }

.image-set-card__title { font-size: 1rem; font-weight: 600; color: var(--color-text); }

.image-set-card__desc { font-size: .85rem; color: var(--color-text-muted); flex: 1; }

.image-set-card__meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: .8rem;
    color: var(--color-text-muted);
}

/* ── Badges ─────────────────────────────────────────────────────────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    padding: .2rem .6rem;
    font-size: .72rem;
    font-weight: 600;
    border-radius: var(--radius-full);
    letter-spacing: .03em;
}
.badge--published { background: #dcfce7; color: #166534; }
.badge--draft     { background: #fef9c3; color: #854d0e; }

/* ── Tables ─────────────────────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; border-radius: var(--radius-lg); border: 1px solid var(--color-border); box-shadow: var(--shadow-sm); }

.table {
    width: 100%;
    border-collapse: collapse;
    background: var(--color-surface);
}
.table th {
    padding: .7rem 1rem;
    text-align: left;
    font-size: .75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--color-text-muted);
    background: var(--color-surface-2);
    border-bottom: 1px solid var(--color-border);
}
.table td {
    padding: .75rem 1rem;
    font-size: .875rem;
    border-bottom: 1px solid var(--color-border);
    vertical-align: middle;
}
.table tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: var(--color-surface-2); }

/* ── Page header ────────────────────────────────────────────────────────────── */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}
.page-header h1 { margin-bottom: 0; }

/* ── Edit image-set layout ──────────────────────────────────────────────────── */
.edit-layout {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.edit-layout__main {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.25rem;
}

.edit-layout__images {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

@media (min-width: 1024px) {
    .edit-layout__main {
        grid-template-columns: 3fr 2fr;
        align-items: start;
    }
}

/* ── Auth / Login page ──────────────────────────────────────────────────────── */
.auth-page {
    min-height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
}

.auth-card {
    width: 100%;
    max-width: 420px;
    background: var(--color-surface);
    border-radius: var(--radius-xl);
    padding: 2.5rem;
    box-shadow: var(--shadow-lg);
}

.auth-card__logo {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--color-text);
    text-align: center;
    margin-bottom: .375rem;
}
.auth-card__logo span { color: var(--color-primary); }

.auth-card__subtitle {
    font-size: .85rem;
    color: var(--color-text-muted);
    text-align: center;
    margin-bottom: 2rem;
}

/* ── Score workflow ─────────────────────────────────────────────────────────── */
.score-layout {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 1.5rem;
    align-items: start;
    height: calc(100vh - 4rem - 4rem); /* viewport minus content padding minus h1 */
}

@media (max-width: 860px) {
    .score-layout { grid-template-columns: 1fr; height: auto; }
}

.score-layout__image {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.image-filename {
    padding: .5rem .75rem;
    font-size: .75rem;
    color: var(--color-text-muted);
    border-top: 1px solid var(--color-border);
    font-family: monospace;
}

.score-layout__controls {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* header row: progress counter + auto-advance toggle side by side */
.score-controls-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.score-progress {
    font-size: .8rem;
    font-weight: 600;
    color: var(--color-text-muted);
    margin: 0;
    display: flex;
    align-items: baseline;
    gap: .25rem;
}

.score-progress__index {
    cursor: pointer;
    border-bottom: 1px dashed currentColor;
    line-height: 1;
    padding: .15rem .4rem;
    margin: -.15rem -.2rem;
    width: 2.35rem;
    text-align: center;
}

.score-progress__index:hover {
    color: var(--color-primary);
}

.jump-input,
.jump-input[type="number"] {
    width: 2.75rem;
    font-size: .8rem;
    font-weight: 600;
    padding: .1rem .25rem;
    border: 1px solid var(--color-primary);
    border-radius: 4px;
    text-align: center;
    /* hide browser spin buttons */
    appearance: textfield;
    margin:0 -.4rem;
}

.jump-input::-webkit-inner-spin-button,
.jump-input::-webkit-outer-spin-button {
    appearance: none;
}

/* ── Toggle switch ──────────────────────────────────────────────────────────── */
.toggle-label {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    cursor: pointer;
    user-select: none;
}

.toggle-input { display: none; }

.toggle-track {
    position: relative;
    display: inline-block;
    width: 36px;
    height: 20px;
    background: var(--color-border);
    border-radius: var(--radius-full);
    transition: background var(--transition);
}

.toggle-input:checked + .toggle-track { background: var(--color-primary); }

.toggle-thumb {
    position: absolute;
    top: 2px; left: 2px;
    width: 16px; height: 16px;
    background: #fff;
    border-radius: 50%;
    transition: transform var(--transition);
    box-shadow: 0 1px 3px rgba(0,0,0,.2);
}

.toggle-input:checked + .toggle-track .toggle-thumb { transform: translateX(16px); }

.toggle-text {
    font-size: .78rem;
    font-weight: 500;
    color: var(--color-text-muted);
}
/* ── End toggle ─────────────────────────────────────────────────────────────── */

.score-nav { display: flex; gap: .625rem; justify-content: space-between; margin-top: .5rem; }

.save-confirm {
    font-size: .85rem;
    color: var(--color-success);
    font-weight: 600;
    text-align: center;
    margin: 0;
}

/* ── Dimension scoring inputs ───────────────────────────────────────────────── */
.dimension {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 1rem;
    box-shadow: var(--shadow-sm);
}

/* keyboard-hint shown next to the star dimension label */
.input-hint {
    font-size: .7rem;
    font-weight: 400;
    color: var(--color-text-muted);
    margin-left: .4rem;
    letter-spacing: .03em;
}

.star-rating__options { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .375rem; }

.rating-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.4rem;
    height: 2.4rem;
    padding: 0 .6rem;
    font-size: .9rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-surface);
    color: var(--color-text-muted);
    cursor: pointer;
    transition: background var(--transition), border-color var(--transition),
                color var(--transition), box-shadow var(--transition), transform var(--transition);
    user-select: none;
}
.rating-pill input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}
@media (hover: hover) {
    .rating-pill:hover {
        border-color: var(--color-primary);
        color: var(--color-primary);
        background: var(--color-primary-muted);
        box-shadow: var(--shadow-sm);
    }
}
.rating-pill:active { transform: translateY(1px); }
.rating-pill:focus-visible { outline: none; }
.rating-pill--active {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: #fff;
    box-shadow: 0 2px 8px rgba(59,130,246,.35);
}

.label-select__options { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .375rem; }

.label-option {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .35rem .9rem;
    font-size: .85rem;
    font-weight: 500;
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius-full);
    background: var(--color-surface);
    cursor: pointer;
    transition: all var(--transition);
    color: var(--color-text);
}
.label-option input[type="radio"] {
    appearance: none;
    -webkit-appearance: none;
    width: .85rem;
    height: .85rem;
    border: 1.5px solid currentColor;
    border-radius: 50%;
    flex-shrink: 0;
    transition: background var(--transition), border-color var(--transition);
}
.label-option:hover { border-color: var(--color-primary); color: var(--color-primary); background: var(--color-primary-muted); }
.label-option--active { background: var(--color-primary); color: #fff; border-color: var(--color-primary); }
.label-option--active input[type="radio"] { background: #fff; border-color: #fff; }

.float-slider { display: flex; flex-direction: column; gap: .4rem; }

/* ── Image viewer ───────────────────────────────────────────────────────────── */
.image-viewer {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    overflow: hidden;
    min-height: 0;
}
.image-viewer__img {
    display: block;
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
}
.image-viewer__placeholder {
    display: flex; align-items: center; justify-content: center;
    height: 300px; color: var(--color-text-muted); font-size: .875rem;
    background: var(--color-surface-2);
}
.image-viewer__close-zoom {
    position: absolute;
    top: .75rem;
    right: .75rem;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.45);
    color: #fff;
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    transition: background 0.15s;
}
.image-viewer__close-zoom:hover {
    background: rgba(0, 0, 0, 0.7);
}

/* ── Loading skeleton ───────────────────────────────────────────────────────── */
.loading { color: var(--color-text-muted); font-size: .9rem; padding: 2rem 0; }

/* ── Modal overlay ──────────────────────────────────────────────────────────── */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    padding: 1rem;
}

.modal > * {
    background: var(--color-surface);
    border-radius: var(--radius-xl);
    padding: 2rem;
    width: 100%;
    max-width: 480px;
    box-shadow: var(--shadow-lg);
}

/* ── Profile dl ─────────────────────────────────────────────────────────────── */
.profile { display: grid; grid-template-columns: auto 1fr; gap: .5rem 1.25rem; font-size: .9rem; }
.profile dt { font-weight: 600; color: var(--color-text-muted); }

/* ── Dimension row (edit image set) ─────────────────────────────────────────── */
.dimension-block {
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: .75rem;
    margin-bottom: .75rem;
    background: var(--color-bg);
}

.dimension-row {
    display: grid;
    grid-template-columns: 1fr 160px auto;
    gap: .625rem;
    align-items: center;
}

.dimension-config {
    margin-top: .625rem;
    padding-top: .625rem;
    border-top: 1px solid var(--color-border);
}

/* ── Image grid (edit image set) ────────────────────────────────────────────── */
.image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 1rem;
}

@media (min-width: 1280px) {
    .image-grid { grid-template-columns: repeat(8, minmax(0, 1fr)); }
}

.image-thumb {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .375rem;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: .625rem;
}

.image-thumb img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: var(--radius-sm);
}

.image-thumb__placeholder {
    width: 100%;
    aspect-ratio: 1;
    border-radius: var(--radius-sm);
    background: var(--color-border);
    animation: pulse 1.4s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: .4; }
}

.image-thumb__name {
    font-size: .75rem;
    color: var(--color-text-muted);
    text-align: center;
    word-break: break-all;
    width: 100%;
}

/* ── Blazor error UI ────────────────────────────────────────────────────────── */
#blazor-error-ui {
    background: #fef2f2;
    color: #991b1b;
    border-top: 2px solid var(--color-danger);
    bottom: 0; left: 0;
    padding: .75rem 1.5rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
    display: none;
    font-size: .875rem;
}
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: 1rem; top: .75rem; font-size: 1.1rem; }

.blazor-error-boundary {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: var(--radius-md);
    padding: 1rem 1rem 1rem 3rem;
    color: var(--color-danger);
}
.blazor-error-boundary::after { content: "An error has occurred." }

/* ── Responsive ──────────────────────────────────────────────────────────────── */
@media (max-width: 640px) {
    .app-shell__content { margin-left: 0; padding: 1rem; }
    .nav {
        transform: translateX(-100%);
        visibility: hidden;
        transition: transform 250ms ease, visibility 250ms ease;
    }
    .nav--open {
        transform: translateX(0);
        visibility: visible;
    }
}

.nav-toggle {
    display: none;
    position: fixed;
    top: .75rem;
    right: .75rem;
    z-index: 101;
    background: var(--color-nav-bg);
    color: #fff;
    border: none;
    border-radius: var(--radius-md);
    width: 2.25rem;
    height: 2.25rem;
    font-size: 1.1rem;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-md);
}

.nav-overlay {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.4);
    z-index: 99;
    opacity: 0;
    visibility: hidden;
    transition: opacity 250ms ease, visibility 250ms ease;
    pointer-events: none;
}
.nav-overlay--visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

@media (max-width: 640px) {
    .nav-toggle { display: inline-flex; }
}

/* ── Review table ───────────────────────────────────────── */
.review-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .875rem;
}

.review-table thead tr {
    border-bottom: 2px solid var(--color-border);
}

.review-table th {
    padding: .5rem .75rem;
    text-align: left;
    font-size: .75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--color-text-muted);
    white-space: nowrap;
}

.review-table td {
    padding: .5rem .75rem;
    vertical-align: middle;
    border-bottom: 1px solid var(--color-border);
    color: var(--color-text);
}

.review-table tbody tr:last-child td {
    border-bottom: none;
}

.review-row {
    cursor: pointer;
    /* Ensure tap targets are large enough on touch screens */
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

.review-table tbody tr:hover td {
    background: var(--color-surface-2);
}

.review-row:active td {
    background: var(--color-primary-muted);
}

/* ── Review table thumbnails ────────────────────────────── */
.review-thumb-cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .35rem;
    min-width: 80px;
}

.review-thumb {
    width: 125px;
    height: 125px;
    object-fit: cover;
    border-radius: 4px;
    display: block;
}

.review-thumb--placeholder {
    width: 100%;
    aspect-ratio: 1;
    border-radius: var(--radius-sm);
    background: var(--color-border);
    animation: pulse 1.4s ease-in-out infinite;
}

.review-thumb-name {
    font-size: .7rem;
    color: var(--color-text-muted);
    word-break: break-all;
    text-align: center;
    max-width: 80px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* Toast */
.toast {
    position: fixed;
    top: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    background: var(--color-success, #2e7d32);
    color: #fff;
    padding: .625rem 1.25rem;
    border-radius: .5rem;
    font-size: .9rem;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(0,0,0,.25);
    z-index: 9999;
    animation: toast-in .3s ease-out;
}

.toast--out {
    animation: toast-out .3s ease-in forwards;
}

@keyframes toast-in {
    from { opacity: 0; transform: translateX(-50%) translateY(-1rem); }
    to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

@keyframes toast-out {
    from { opacity: 1; transform: translateX(-50%) translateY(0); }
    to   { opacity: 0; transform: translateX(-50%) translateY(-1rem); }
}
