*,
*::before,
*::after {
    box-sizing: border-box;
}

:root {
    --bg: #f4f1ec;
    --surface: #ffffff;
    --text: #1a1a1a;
    --muted: #6b6560;
    --border: #e3ddd4;
    --primary: #2c2419;
    --primary-hover: #1f1812;
    --accent: #c8956c;
    --success-bg: #edf7ef;
    --success-text: #1f6b33;
    --error-bg: #fdeeee;
    --error-text: #9b2c2c;
    --info-bg: #f0f4ff;
    --info-text: #2c4a8c;
    --radius: 12px;
    --shadow: 0 8px 30px rgba(44, 36, 25, 0.08);
}

body {
    margin: 0;
    font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
}

.container {
    width: min(1100px, calc(100% - 2rem));
    margin: 0 auto;
    padding: 2rem 0 3rem;
}

.client-container {
    padding-top: 3rem;
}

.admin-body {
    --admin-navy: #1F2A44;
    --admin-beige: #E8DCC8;
    --admin-gold: #C6A75E;
    --admin-gold-hover: #b89850;
    --admin-navy-hover: #162033;

    --bg: var(--admin-beige);
    --surface: #f5efe3;
    --text: var(--admin-navy);
    --muted: #5c667a;
    --border: #d9cdb8;
    --primary: var(--admin-navy);
    --primary-hover: var(--admin-navy-hover);
    --accent: var(--admin-gold);
    --shadow: 0 8px 30px rgba(31, 42, 68, 0.1);

    background: var(--admin-beige);
    color: var(--admin-navy);
}

.admin-body .admin-sidebar {
    background: var(--admin-navy);
    color: var(--admin-beige);
}

.admin-body .sidebar-logo {
    color: var(--admin-beige);
    border-bottom-color: rgba(232, 220, 200, 0.15);
}

.admin-body .sidebar-section-label {
    color: rgba(232, 220, 200, 0.5);
}

.admin-body .sidebar-link {
    color: rgba(232, 220, 200, 0.88);
}

.admin-body .sidebar-link:hover {
    background: rgba(198, 167, 94, 0.15);
    color: var(--admin-beige);
}

.admin-body .sidebar-link.is-active {
    background: rgba(198, 167, 94, 0.22);
    color: var(--admin-beige);
    box-shadow: inset 3px 0 0 var(--admin-gold);
}

.admin-body .sidebar-back,
.admin-body .sidebar-logout {
    color: rgba(232, 220, 200, 0.65);
}

.admin-body .sidebar-footer {
    border-top-color: rgba(232, 220, 200, 0.15);
}

.admin-body .btn-primary {
    background: var(--admin-gold);
    border-color: var(--admin-gold);
    color: var(--admin-navy);
}

.admin-body .btn-primary:hover {
    background: var(--admin-gold-hover);
    border-color: var(--admin-gold-hover);
    color: var(--admin-navy);
}

.admin-body .btn-secondary {
    background: transparent;
    border-color: var(--admin-navy);
    color: var(--admin-navy);
}

.admin-body .btn-secondary:hover {
    background: rgba(31, 42, 68, 0.06);
}

.admin-body .filter-tab.active,
.admin-body .view-toggle-btn.active {
    background: var(--admin-navy);
    border-color: var(--admin-navy);
    color: var(--admin-beige);
}

.admin-body .favorites-counter {
    color: var(--admin-gold);
}

.admin-body h1,
.admin-body h2,
.admin-body h3 {
    color: var(--admin-navy);
}

.admin-body .auth-card {
    background: var(--surface);
    border-color: var(--border);
}

.admin-shell {
    display: flex;
    min-height: 100vh;
}

.admin-sidebar {
    width: 240px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    padding: 1.5rem 0;
    position: sticky;
    top: 0;
    height: 100vh;
}

.sidebar-logo {
    display: block;
    padding: 0 1.25rem 1.5rem;
    color: #fff;
    font-weight: 700;
    font-size: 1rem;
    text-decoration: none;
    line-height: 1.3;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 1rem;
}

.sidebar-section-label {
    padding: 0 1.25rem;
    margin: 0 0 0.5rem;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255, 255, 255, 0.45);
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    padding: 0 0.75rem;
    flex: 1;
}

.sidebar-link {
    display: block;
    padding: 0.65rem 0.75rem;
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.82);
    text-decoration: none;
    font-size: 0.95rem;
    transition: background 0.15s ease, color 0.15s ease;
}

.sidebar-link:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.sidebar-link.is-active {
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
    font-weight: 600;
}

.sidebar-link.is-disabled {
    padding: 0.65rem 0.75rem;
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.35);
    cursor: not-allowed;
}

.sidebar-link.is-disabled small {
    display: block;
    font-size: 0.75rem;
    margin-top: 0.15rem;
}

.sidebar-back {
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.65);
}

.sidebar-footer {
    padding: 1rem 0.75rem 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: auto;
}

.sidebar-logout {
    color: rgba(255, 255, 255, 0.65);
}

.admin-main {
    flex: 1;
    min-width: 0;
    padding: 2rem 2rem 3rem;
    max-width: 1400px;
}

.category-list {
    display: grid;
    gap: 0.65rem;
    margin-bottom: 1rem;
}

.category-row {
    display: flex;
    gap: 0.65rem;
    align-items: center;
}

.category-row input {
    flex: 1;
}

.template-list {
    display: grid;
    gap: 1rem;
}

.template-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
}

.template-card-body h2 {
    font-size: 1.05rem;
    margin-bottom: 0.25rem;
}

.template-card-actions {
    flex-shrink: 0;
}

.placeholder-list {
    margin: 0;
    padding-left: 1.25rem;
    color: var(--muted);
}

.placeholder-list code {
    color: var(--text);
}

textarea {
    width: 100%;
    padding: 0.75rem 0.9rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font: inherit;
    font-family: Consolas, "Courier New", monospace;
    font-size: 0.9rem;
    background: #fff;
    resize: vertical;
}

input[type="email"] {
    width: 100%;
    padding: 0.75rem 0.9rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font: inherit;
    background: #fff;
}

.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

h1, h2, h3 {
    margin: 0 0 0.5rem;
    line-height: 1.2;
}

.subtitle, .meta, .hint, .empty-text {
    color: var(--muted);
    margin: 0;
}

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    margin-bottom: 1.5rem;
}

.auth-card {
    max-width: 420px;
    margin: 4rem auto;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: var(--shadow);
}

.form {
    display: grid;
    gap: 1rem;
}

label {
    display: grid;
    gap: 0.4rem;
    font-weight: 600;
    font-size: 0.95rem;
}

input[type="text"],
input[type="password"],
input[type="file"] {
    width: 100%;
    padding: 0.75rem 0.9rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font: inherit;
    background: #fff;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
}

.optional {
    font-weight: 400;
    color: var(--muted);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.65rem 1rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    text-decoration: none;
    font: inherit;
    cursor: pointer;
}

.btn:hover {
    background: #faf8f5;
}

.btn-primary {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.btn-primary:hover {
    background: var(--primary-hover);
}

.btn-secondary {
    background: transparent;
}

.btn-danger {
    background: #fff;
    border-color: #e0b4b4;
    color: var(--error-text);
}

.btn-small {
    padding: 0.35rem 0.65rem;
    font-size: 0.85rem;
}

.btn-block {
    width: 100%;
}

.form-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
}

.alert {
    padding: 0.9rem 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.alert-success {
    background: var(--success-bg);
    color: var(--success-text);
}

.alert-error {
    background: var(--error-bg);
    color: var(--error-text);
}

.alert-info {
    background: var(--info-bg);
    color: var(--info-text);
}

.gallery-list {
    display: grid;
    gap: 1rem;
}

.gallery-card {
    display: flex;
    align-items: stretch;
    gap: 1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.gallery-card-thumb {
    flex-shrink: 0;
    width: 120px;
    display: block;
    background: #eae4dc;
}

.gallery-card-thumb img {
    width: 100%;
    height: 100%;
    min-height: 90px;
    object-fit: cover;
    display: block;
}

.gallery-card-thumb-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--muted);
    font-size: 0.8rem;
    text-align: center;
    padding: 0.5rem;
}

.gallery-card-body {
    flex: 1;
    padding: 1.25rem 0 1.25rem 0;
    min-width: 0;
}

.gallery-card-actions {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    padding: 1.25rem 1.5rem 1.25rem 0;
}

.dashboard-toolbar {
    margin-bottom: 1.5rem;
}

.gallery-filters {
    display: grid;
    gap: 1rem;
}

.filter-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
}

.filter-field {
    display: grid;
    gap: 0.35rem;
    font-weight: 600;
    font-size: 0.9rem;
}

.filter-field-grow {
    grid-column: span 2;
}

.filter-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
}

.view-toggle {
    display: flex;
    margin-left: auto;
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
}

.view-toggle-btn {
    padding: 0.5rem 0.9rem;
    text-decoration: none;
    color: var(--muted);
    background: var(--surface);
    font-size: 0.9rem;
}

.view-toggle-btn.active {
    background: var(--primary);
    color: #fff;
}

.gallery-grid-view {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.25rem;
}

.gallery-grid-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
}

.gallery-grid-thumb {
    display: block;
    aspect-ratio: 4 / 3;
    background: #eae4dc;
    overflow: hidden;
}

.gallery-grid-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.gallery-grid-body {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    flex: 1;
}

.gallery-grid-body h2 {
    font-size: 1rem;
    margin: 0;
    line-height: 1.3;
}

.meta-small {
    font-size: 0.8rem;
}

.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-top: 2rem;
}

.pagination-info {
    color: var(--muted);
    font-size: 0.95rem;
}

input[type="date"],
input[type="search"] {
    width: 100%;
    padding: 0.75rem 0.9rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font: inherit;
    background: #fff;
}

.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    background: var(--surface);
    border: 1px dashed var(--border);
    border-radius: var(--radius);
}

.grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.share-box h3 {
    margin-bottom: 1rem;
}

.share-details {
    display: grid;
    gap: 0.75rem;
}

.share-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.share-label {
    min-width: 100px;
    font-weight: 600;
}

.share-value {
    flex: 1;
    padding: 0.4rem 0.6rem;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 6px;
    word-break: break-all;
}

.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1rem;
}

.photo-item {
    position: relative;
    background: #faf8f5;
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
}

.photo-item img {
    display: block;
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
}

.photo-meta,
.photo-actions {
    padding: 0.65rem 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.photo-name {
    font-size: 0.85rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.photo-size {
    font-size: 0.8rem;
    color: var(--muted);
}

.photo-delete-form {
    padding: 0 0.75rem 0.75rem;
}

.photo-admin-actions {
    padding: 0 0.75rem 0.75rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.photo-item-cover {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(200, 149, 108, 0.35);
}

.cover-badge {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    z-index: 1;
    background: var(--accent);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.25rem 0.5rem;
    border-radius: 999px;
}

.photo-link {
    display: block;
    border: 0;
    padding: 0;
    width: 100%;
    background: none;
    cursor: pointer;
}

.photo-link:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.client-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.client-header-plain {
    padding-top: 2rem;
}

.client-gallery-section {
    padding: 2rem 0 3rem;
}

.client-gallery-header {
    margin-bottom: 1.5rem;
}

.client-gallery-header h2 {
    margin-bottom: 0.25rem;
}

.gallery-hero {
    position: relative;
    height: 75vh;
    min-height: 320px;
    background-size: cover;
    background-position: center;
    display: flex;
}

.gallery-hero-overlay {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(
        rgba(20, 16, 12, 0.62),
        rgba(20, 16, 12, 0.62)
    );
    color: #fff;
    padding: 2rem 0;
}

.gallery-hero-content {
    width: min(1100px, calc(100% - 2rem));
    margin: 0 auto;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.85rem;
}

.gallery-hero-logo {
    max-width: min(220px, 60vw);
    max-height: 100px;
    width: auto;
    height: auto;
    object-fit: contain;
}

.gallery-hero-brand-name {
    margin: 0;
    font-size: 1.1rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    opacity: 0.9;
}

.gallery-hero-no-cover {
    background: linear-gradient(135deg, #1a1612 0%, #0c0b0a 100%);
}

.gallery-hero h1 {
    font-size: clamp(2rem, 5vw, 3.25rem);
    margin: 0;
    color: #fff;
}

.gallery-hero-expiry {
    margin: 0;
    font-size: 0.95rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    opacity: 0.88;
}

.gallery-hero-actions {
    margin-top: 0.25rem;
}

.gallery-hero .gallery-hero-btn {
    background: var(--accent);
    border-color: var(--accent);
    color: #1a1208;
    min-height: 2.5rem;
    padding: 0 1.25rem;
    font-size: 0.95rem;
    font-weight: 600;
}

.gallery-hero .gallery-hero-btn:hover {
    background: #d4a67a;
    border-color: #d4a67a;
    color: #1a1208;
}

.gallery-hero-subtitle,
.gallery-hero-meta {
    margin: 0;
    opacity: 0.92;
}

.gallery-hero-subtitle {
    font-size: 1.15rem;
    margin-bottom: 0.35rem;
}

.gallery-hero-meta {
    margin-bottom: 1.25rem;
    font-size: 0.95rem;
}

.btn-hero {
    border-color: #fff;
}

.lightbox-open {
    overflow: hidden;
}

.lightbox {
    position: fixed;
    inset: 0;
    z-index: 1000;
}

.lightbox-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(10, 8, 6, 0.92);
}

.lightbox-dialog {
    position: relative;
    z-index: 1;
    height: 100%;
    display: grid;
    grid-template-columns: auto 1fr auto;
    grid-template-rows: 1fr auto;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
}

.lightbox-stage {
    grid-column: 2;
    grid-row: 1;
    margin: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 0;
    height: 100%;
}

.lightbox-stage img {
    max-width: 100%;
    max-height: calc(100vh - 8rem);
    object-fit: contain;
    border-radius: 8px;
}

.lightbox-caption {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1.5rem;
    justify-content: center;
    color: #fff;
    margin-top: 1rem;
    text-align: center;
}

.lightbox-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 2;
    width: 2.5rem;
    height: 2.5rem;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    font-size: 1.75rem;
    line-height: 1;
    cursor: pointer;
}

.lightbox-nav {
    width: 3rem;
    height: 3rem;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
}

.lightbox-nav:disabled {
    opacity: 0.35;
    cursor: default;
}

.lightbox-download {
    grid-column: 2;
    grid-row: 2;
    justify-self: center;
}

.lightbox-actions {
    grid-column: 2;
    grid-row: 2;
    justify-self: center;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

@media (prefers-reduced-motion: no-preference) {
    html:has(.client-body) {
        scroll-behavior: smooth;
    }
}

.client-body {
    --client-bg: #0c0b0a;
    --client-surface: #161412;
    --client-surface-raised: #1f1c19;
    --client-text: #ece8e3;
    --client-muted: #9a938a;
    --client-border: #2a2622;
    background: var(--client-bg);
    color: var(--client-text);
}

.client-brand-header {
    background: var(--client-surface);
    border-bottom: 1px solid var(--client-border);
    padding: 1rem 0;
}

.client-brand-name {
    font-weight: 700;
    font-size: 1.1rem;
    letter-spacing: 0.02em;
    color: var(--client-text);
}

.client-footer {
    border-top: 1px solid var(--client-border);
    padding: 1.5rem 0 2rem;
    text-align: center;
    color: var(--client-muted);
    font-size: 0.9rem;
}

.client-container {
    width: min(1400px, calc(100% - 2rem));
}

.client-header-plain h1,
.client-gallery-header h2 {
    color: var(--client-text);
}

.client-header-plain .subtitle,
.photo-count {
    color: var(--client-muted);
}

.client-gallery-section {
    padding: 2rem 0 3rem;
}

.client-gallery-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.client-gallery-header h2 {
    margin-bottom: 0.25rem;
}

.favorites-counter,
.gallery-toolbar-meta {
    font-weight: 600;
    color: var(--client-muted);
    font-size: 0.875rem;
    white-space: nowrap;
}

.gallery-toolbar-meta #favorites-count {
    color: var(--client-text);
}

.filter-tab {
    border: 1px solid var(--client-border);
    background: var(--client-surface-raised);
    color: var(--client-text);
    border-radius: 8px;
    padding: 0 0.85rem;
    min-height: 2.25rem;
    cursor: pointer;
    font: inherit;
    font-size: 0.875rem;
    line-height: 1.2;
}

.filter-tab:hover {
    background: #2a2622;
    border-color: #3a3530;
}

.filter-tab.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #1a1208;
}

.filter-tab.active:hover {
    background: #d4a67a;
    border-color: #d4a67a;
    color: #1a1208;
}

.client-body .empty-state {
    background: var(--client-surface);
    border-color: var(--client-border);
    color: var(--client-text);
}

.client-body .empty-state p {
    color: var(--client-muted);
}

.masonry-grid {
    column-count: 3;
    column-gap: 1rem;
}

.masonry-item {
    break-inside: avoid;
    margin-bottom: 1rem;
}

.client-photo {
    background: transparent;
    border: 0;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.35);
}

.client-photo.is-favorited {
    box-shadow: 0 0 0 2px var(--accent), 0 4px 24px rgba(0, 0, 0, 0.35);
}

.client-photo .photo-link {
    display: block;
    line-height: 0;
}

.client-photo img {
    width: 100%;
    height: auto;
    display: block;
    aspect-ratio: unset;
    object-fit: unset;
    vertical-align: middle;
}

.photo-thumb-wrap {
    position: relative;
}

.photo-thumb-wrap::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.45) 0%, transparent 40%);
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
}

.photo-thumb-wrap:hover::after,
.photo-thumb-wrap:focus-within::after {
    opacity: 1;
}

.photo-overlay-actions {
    position: absolute;
    bottom: 0.65rem;
    right: 0.65rem;
    z-index: 2;
    display: flex;
    gap: 0.45rem;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.photo-thumb-wrap:hover .photo-overlay-actions,
.photo-thumb-wrap:focus-within .photo-overlay-actions {
    opacity: 1;
}

.photo-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border: 0;
    border-radius: 999px;
    background: rgba(12, 11, 10, 0.75);
    color: #fff;
    cursor: pointer;
    text-decoration: none;
    backdrop-filter: blur(4px);
    transition: background 0.15s ease, color 0.15s ease;
}

.photo-icon-btn:hover {
    background: rgba(12, 11, 10, 0.92);
    color: #fff;
}

.photo-icon-btn.favorite-btn {
    color: rgba(255, 255, 255, 0.7);
}

.photo-icon-btn.favorite-btn.is-active {
    color: var(--accent);
}

.mobile-action-bar {
    display: none;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 50;
    background: var(--client-surface);
    border-top: 1px solid var(--client-border);
    padding: 0.75rem 1rem;
    justify-content: center;
    align-items: center;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.35);
}

.mobile-action-bar .mobile-fav-count {
    color: var(--client-text);
    font-weight: 600;
}

.client-body .btn {
    background: var(--client-surface-raised);
    border-color: var(--client-border);
    color: var(--client-text);
}

.client-body .btn:hover {
    background: #2a2622;
    border-color: #3a3530;
    color: var(--client-text);
}

.client-body .btn-primary {
    background: var(--accent);
    border-color: var(--accent);
    color: #1a1208;
}

.client-body .btn-primary:hover {
    background: #d4a67a;
    border-color: #d4a67a;
    color: #1a1208;
}

.client-body .btn-secondary {
    background: var(--client-surface-raised);
    border-color: var(--client-border);
    color: var(--client-text);
}

.client-body .btn-secondary:hover {
    background: #2a2622;
    border-color: #3a3530;
    color: var(--client-text);
}

.client-body .auth-card {
    background: var(--client-surface);
    border-color: var(--client-border);
    color: var(--client-text);
}

.client-body .auth-card .subtitle {
    color: var(--client-muted);
}

.client-body label {
    color: var(--client-text);
}

.client-body input[type="text"],
.client-body input[type="password"] {
    background: var(--client-surface-raised);
    border-color: var(--client-border);
    color: var(--client-text);
}

.lightbox-actions .photo-icon-btn {
    width: 2.75rem;
    height: 2.75rem;
    background: rgba(255, 255, 255, 0.12);
}

.lightbox-actions .photo-icon-btn:hover {
    background: rgba(255, 255, 255, 0.22);
}

.lightbox-actions .favorite-btn.is-active {
    color: var(--accent);
}

.hero-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    justify-content: center;
}

.favorite-badge {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    z-index: 1;
    background: #c0392b;
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.25rem 0.5rem;
    border-radius: 999px;
}

.drag-handle {
    position: absolute;
    bottom: 0.5rem;
    left: 0.5rem;
    z-index: 2;
    background: rgba(255, 255, 255, 0.92);
    border-radius: 6px;
    padding: 0.2rem 0.4rem;
    cursor: grab;
    font-size: 0.85rem;
}

.photo-item.is-dragging {
    opacity: 0.5;
}

.photo-item.drag-over {
    outline: 2px dashed var(--accent);
}

.section-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.section-header-row h2 {
    margin: 0;
}

.inline-form {
    margin: 0;
}

.logo-preview img {
    max-height: 80px;
    width: auto;
}

select {
    width: 100%;
    padding: 0.75rem 0.9rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font: inherit;
    background: #fff;
}

input[type="color"] {
    width: 100%;
    height: 42px;
    padding: 0.2rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
}

.photo-count {
    color: var(--client-muted);
    margin: 0;
}

.gallery-toolbar {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.65rem;
    flex-shrink: 0;
}

.gallery-toolbar-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
}

.gallery-toolbar-row-favorites {
    padding: 0.65rem 0.75rem;
    border: 1px solid var(--client-border);
    border-radius: 10px;
    background: var(--client-surface);
}

.gallery-toolbar-view-controls {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.client-body .gallery-toolbar .btn-toolbar,
.client-body .gallery-toolbar .view-all-btn {
    min-height: 2.25rem;
    padding: 0 0.85rem;
    font-size: 0.875rem;
    line-height: 1.2;
    border-radius: 8px;
}

.client-body .gallery-toolbar .view-all-btn.is-active {
    background: var(--accent);
    border-color: var(--accent);
    color: #1a1208;
}

.client-body .gallery-toolbar .view-all-btn.is-active:hover {
    background: #d4a67a;
    border-color: #d4a67a;
    color: #1a1208;
}

.gallery-toolbar-field {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
    font-size: 0.875rem;
}

.gallery-toolbar-label {
    color: var(--client-muted);
    white-space: nowrap;
}

.client-body .gallery-toolbar-select,
.client-body .gallery-toolbar select {
    min-width: 11rem;
    max-width: 16rem;
    min-height: 2.25rem;
    padding: 0 2rem 0 0.65rem;
    border: 1px solid var(--client-border);
    border-radius: 8px;
    background: var(--client-surface-raised);
    color: var(--client-text);
    font: inherit;
    font-size: 0.875rem;
    line-height: 1.2;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23ece8e3' d='M2 4l4 4 4-4'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.65rem center;
}

.client-body .gallery-toolbar-select:focus,
.client-body .gallery-toolbar select:focus {
    outline: 2px solid var(--accent);
    outline-offset: 1px;
}

.client-body .gallery-toolbar-select option,
.client-body .gallery-toolbar select option {
    background: var(--client-surface);
    color: var(--client-text);
}

.filter-tabs {
    display: flex;
    gap: 0.35rem;
}

.client-brand-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 2.5rem;
    padding: 0;
}

.client-header-signed-in {
    margin: 0;
    font-size: 0.9rem;
    color: var(--client-muted);
}

.client-logo {
    max-height: 48px;
    width: auto;
}

.danger-zone {
    border-color: #e0b4b4;
}

@media (max-width: 1100px) {
    .gallery-grid-view {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 800px) {
    .gallery-grid-view {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1200px) {
    .masonry-grid {
        column-count: 4;
    }
}

@media (max-width: 768px) {
    .admin-shell {
        flex-direction: column;
    }

    .admin-sidebar {
        width: 100%;
        height: auto;
        position: static;
        padding: 1rem 0;
    }

    .sidebar-nav {
        flex-direction: row;
        flex-wrap: wrap;
        padding: 0 1rem;
    }

    .sidebar-footer {
        border-top: 0;
        padding-top: 0;
    }

    .admin-main {
        padding: 1.25rem 1rem 2rem;
    }
}

@media (max-width: 640px) {
    .page-header,
    .client-header,
    .gallery-card {
        flex-direction: column;
        align-items: stretch;
    }

    .gallery-card-thumb {
        width: 100%;
        height: 160px;
    }

    .gallery-card-body {
        padding: 1rem 1.25rem 0;
    }

    .gallery-card-actions {
        padding: 0 1.25rem 1.25rem;
    }

    .gallery-grid-view {
        grid-template-columns: repeat(2, 1fr);
    }

    .filter-field-grow {
        grid-column: span 1;
    }

    .view-toggle {
        margin-left: 0;
        width: 100%;
    }

    .view-toggle-btn {
        flex: 1;
        text-align: center;
    }

    .form-actions {
        flex-direction: column;
    }

    .lightbox-dialog {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr auto auto;
        padding-top: 3.5rem;
    }

    .lightbox-stage {
        grid-column: 1;
        grid-row: 2;
    }

    .lightbox-prev,
    .lightbox-next {
        display: none;
    }

    .lightbox-download {
        grid-column: 1;
        grid-row: 4;
    }

    .lightbox-actions {
        grid-column: 1;
        grid-row: 4;
    }

    .client-gallery-header {
        flex-direction: column;
    }

    .gallery-toolbar {
        width: 100%;
        align-items: stretch;
    }

    .gallery-toolbar-row {
        justify-content: stretch;
    }

    .gallery-toolbar-row-primary .btn-toolbar,
    .gallery-toolbar-row-favorites .btn-toolbar,
    .gallery-toolbar-row-favorites .gallery-toolbar-field {
        flex: 1 1 auto;
    }

    .gallery-toolbar-row-favorites {
        flex-direction: column;
        align-items: stretch;
    }

    .gallery-toolbar-field {
        width: 100%;
    }

    .client-body .gallery-toolbar-select,
    .client-body .gallery-toolbar select {
        flex: 1;
        max-width: none;
        width: 100%;
    }

    .gallery-toolbar-meta {
        text-align: center;
    }

    .masonry-grid {
        column-count: 2;
    }

    .photo-overlay-actions {
        opacity: 1;
    }

    .photo-thumb-wrap::after {
        opacity: 1;
    }

    .mobile-action-bar {
        display: flex;
    }

    .client-container {
        padding-bottom: 5rem;
    }
}

@media (max-width: 520px) {
    .masonry-grid {
        column-count: 1;
    }

    .gallery-grid-view {
        grid-template-columns: 1fr;
    }
}

.table-wrap {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.data-table th,
.data-table td {
    padding: 0.75rem 0.85rem;
    border-bottom: 1px solid var(--border);
    text-align: left;
    vertical-align: middle;
}

.data-table th {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--muted);
}

.data-table .btn-small {
    white-space: nowrap;
}

.gallery-viewers-card {
    margin-bottom: 1.5rem;
}

.client-login-hint {
    margin: 0 0 1rem;
    font-size: 0.85rem;
    line-height: 1.45;
}

.preset-row {
    position: relative;
    align-items: end;
    margin-bottom: 0.75rem;
}

.preset-row .preset-remove {
    margin-bottom: 0.15rem;
}

.preset-list .grid-2 {
    grid-template-columns: 1fr 120px auto;
    gap: 0.75rem;
}

@media (max-width: 720px) {
    .preset-list .grid-2 {
        grid-template-columns: 1fr;
    }
}

.gallery-manage-shell {
    display: flex;
    gap: 1.75rem;
    align-items: flex-start;
}

.gallery-manage-sidebar {
    width: 240px;
    flex-shrink: 0;
    position: sticky;
    top: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.gallery-info-panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.1rem 1.15rem;
    box-shadow: var(--shadow);
}

.gallery-info-title {
    margin: 0 0 0.35rem;
    font-size: 1.05rem;
    line-height: 1.3;
}

.gallery-info-client {
    margin: 0 0 0.85rem;
    color: var(--muted);
    font-size: 0.9rem;
}

.gallery-info-meta {
    margin: 0;
    display: grid;
    gap: 0.55rem;
}

.gallery-info-meta div {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    font-size: 0.85rem;
}

.gallery-info-meta dt {
    margin: 0;
    color: var(--muted);
}

.gallery-info-meta dd {
    margin: 0;
    font-weight: 600;
    text-align: right;
}

.gallery-section-nav {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.45rem;
    box-shadow: var(--shadow);
}

.gallery-section-link {
    display: block;
    padding: 0.65rem 0.75rem;
    border-radius: 8px;
    color: var(--text);
    text-decoration: none;
    font-size: 0.95rem;
    transition: background 0.15s ease, color 0.15s ease;
}

.gallery-section-link:hover {
    background: var(--bg);
    color: var(--primary);
}

.gallery-section-link.is-active {
    background: var(--primary);
    color: #fff;
    font-weight: 600;
}

.gallery-back-link {
    display: block;
    padding: 0.5rem 0.75rem;
    font-size: 0.9rem;
    color: var(--muted);
    text-decoration: none;
}

.gallery-back-link:hover {
    color: var(--primary);
}

.gallery-manage-content {
    flex: 1;
    min-width: 0;
    display: grid;
    gap: 1.25rem;
}

.gallery-manage-content > .card,
.gallery-manage-content > .alert {
    margin: 0;
}

.admin-photo-grid-compact {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
}

@media (max-width: 960px) {
    .gallery-manage-shell {
        flex-direction: column;
    }

    .gallery-manage-sidebar {
        width: 100%;
        position: static;
    }

    .gallery-section-nav {
        flex-direction: row;
        flex-wrap: wrap;
    }
}

.download-activity-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.download-activity-actions .btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.download-activity-table td:last-child {
    white-space: nowrap;
}

.admin-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.admin-modal[hidden] {
    display: none;
}

.admin-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(20, 16, 12, 0.55);
}

.admin-modal-dialog {
    position: relative;
    z-index: 1;
    width: min(900px, 100%);
    max-height: calc(100vh - 3rem);
    overflow: auto;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.5rem;
}

.admin-modal-close {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    border: none;
    background: transparent;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    color: var(--muted);
}

.admin-modal-close:hover {
    color: var(--text);
}

.admin-modal-loading,
.admin-modal-error {
    padding: 1rem 0;
    color: var(--muted);
}

.admin-modal-error {
    color: var(--error-text);
}

#download-photos-modal-grid {
    margin-top: 1rem;
}

.option-group {
    margin-bottom: 1.75rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--border);
}

.option-group:last-of-type {
    border-bottom: none;
}

.option-list,
.option-row {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.option-row {
    flex-direction: row;
    align-items: center;
}

.option-row input[type="text"] {
    flex: 1;
}

.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.5rem 1rem;
}

.product-option-section[hidden],
#commerce-fields[hidden],
#free-download-limit-field[hidden] {
    display: none;
}

.inline-form {
    display: inline;
}

.badge {
    display: inline-block;
    margin-left: 0.35rem;
    padding: 0.1rem 0.45rem;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 0.75rem;
    font-weight: 600;
    vertical-align: middle;
}

.price-input {
    width: 7rem;
}

.price-table td:last-child {
    width: 8rem;
}

fieldset {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.85rem 1rem 1rem;
    margin: 0 0 1rem;
}

fieldset legend {
    padding: 0 0.35rem;
    font-weight: 600;
}

.product-image-preview img,
.variant-mockup-thumb {
    max-width: 120px;
    max-height: 120px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    object-fit: cover;
}

.frame-mockup-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border);
}

.frame-mockup-row:last-child {
    border-bottom: none;
}

.frame-overlay-matrix td,
.frame-overlay-matrix th {
    vertical-align: top;
    min-width: 140px;
}

.frame-overlay-matrix th[scope="row"] {
    white-space: nowrap;
}

.frame-overlay-upload-form {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin-top: 0.35rem;
}

.frame-overlay-upload-form input[type="file"] {
    max-width: 100%;
    font-size: 0.85rem;
}

.aperture-preview-cell .hint {
    display: block;
    font-size: 0.8rem;
    color: var(--muted);
}

.mount-fields,
.size-mount-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(3.5rem, 1fr));
    gap: 0.35rem;
    margin: 0.35rem 0;
}

.mount-fields label,
.size-mount-fields label {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--muted);
}

.mount-fields input,
.size-mount-fields input {
    width: 100%;
    min-width: 0;
    padding: 0.25rem 0.35rem;
    font-size: 0.85rem;
}

.frame-mount-form {
    margin-top: 0.35rem;
}

.frame-spec-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(4rem, 1fr));
    gap: 0.35rem;
    margin: 0.35rem 0;
}

.frame-spec-fields label {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--muted);
}

.frame-spec-fields input {
    width: 100%;
    min-width: 0;
    padding: 0.25rem 0.35rem;
    font-size: 0.85rem;
}

.frame-spec-form {
    margin-top: 0.35rem;
}

.frame-spec-aperture-label {
    margin: 0.35rem 0 0;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text);
}

.frame-spec-preview {
    width: 100%;
    max-width: 120px;
    margin-bottom: 0.35rem;
}

.frame-spec-preview__outer {
    position: relative;
    width: 100%;
    border-radius: 2px;
    overflow: hidden;
}

.frame-spec-preview__inner {
    position: absolute;
    box-sizing: border-box;
}

.frame-spec-preview__aperture {
    width: 100%;
    height: 100%;
    min-height: 12px;
    background: linear-gradient(135deg, #8a9bb0 0%, #5c6b7a 100%);
}

.cart-total {
    margin: 1rem 0;
    font-size: 1.1rem;
}

.shop-modal {
    position: fixed;
    inset: 0;
    z-index: 1100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.shop-modal[hidden] {
    display: none;
}

.shop-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(20, 16, 12, 0.55);
}

.shop-modal-dialog {
    position: relative;
    z-index: 1;
    width: min(720px, 100%);
    max-height: calc(100vh - 2rem);
    overflow: auto;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.25rem;
}

.shop-modal-close {
    position: absolute;
    top: 0.5rem;
    right: 0.75rem;
    border: none;
    background: transparent;
    font-size: 1.5rem;
    cursor: pointer;
}

.shop-modal-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

@media (max-width: 720px) {
    .shop-modal-body {
        grid-template-columns: 1fr;
    }
}

.product-mockup {
    position: relative;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    aspect-ratio: 1;
    background: #f3f0ec;
    border-radius: var(--radius);
    overflow: hidden;
}

.product-mockup--framed {
    background: linear-gradient(180deg, #ebe7e1 0%, #ddd8d0 100%);
}

.product-mockup--css-frame {
    background: #ebe7e1;
}

.css-frame-mockup {
    position: absolute;
    inset: 0;
    z-index: 0;
}

.css-frame-inner {
    position: absolute;
    box-sizing: border-box;
    display: flex;
    align-items: stretch;
    justify-content: stretch;
}

.product-mockup--css-frame .mockup-photo-slot {
    position: relative;
    inset: auto;
    flex: 1 1 auto;
    min-width: 0;
    min-height: 0;
}

.product-mockup .mockup-photo-slot {
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    z-index: 1;
}

.print-crop-viewport {
    position: relative;
    overflow: hidden;
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    flex: 0 1 auto;
}

.print-crop-viewport.is-draggable {
    cursor: grab;
    touch-action: none;
}

.print-crop-viewport.is-dragging {
    cursor: grabbing;
}

.product-mockup .mockup-photo {
    position: absolute;
    top: 50%;
    left: 50%;
    display: block;
    width: auto;
    height: auto;
    max-width: none;
    max-height: none;
    user-select: none;
    -webkit-user-drag: none;
    pointer-events: none;
    transform-origin: center center;
    will-change: transform;
}

.print-crop-viewport.is-draggable .mockup-photo {
    pointer-events: none;
}

.shop-preview-col {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-width: 0;
}

.shop-crop-hint {
    margin: 0;
    font-size: 0.85rem;
    color: var(--muted);
    text-align: center;
}

.shop-modal-body:has(.shop-crop-hint:not([hidden])) {
    gap: 0.75rem 1rem;
}

.product-mockup .mockup-overlay {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    z-index: 2;
    pointer-events: none;
}

.shop-price {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0.75rem 0;
}

.favorite-picker {
    position: fixed;
    z-index: 1100;
    min-width: 220px;
    max-width: min(92vw, 280px);
    padding: 0.75rem;
    border-radius: var(--radius);
    border: 1px solid var(--client-border);
    background: var(--client-surface);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
}

.favorite-picker-title {
    margin: 0 0 0.5rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--client-muted);
}

.favorite-picker-lists {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.favorite-picker-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.95rem;
}

.favorite-picker-option input {
    margin: 0;
}

.favorite-picker-new {
    display: block;
    width: 100%;
    margin-top: 0.65rem;
    padding: 0.45rem 0.5rem;
    border: 1px dashed var(--client-border);
    border-radius: var(--radius);
    background: transparent;
    color: var(--client-text);
    font: inherit;
    cursor: pointer;
}

.favorite-picker-new:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.favorite-manage-modal[hidden] {
    display: none;
}

.favorite-manage-modal {
    position: fixed;
    inset: 0;
    z-index: 1200;
}

.favorite-manage-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
}

.favorite-manage-dialog {
    position: relative;
    width: min(92vw, 420px);
    margin: 10vh auto 0;
    padding: 1.25rem;
    border-radius: var(--radius);
    background: var(--client-surface);
    border: 1px solid var(--client-border);
    color: var(--client-text);
}

.favorite-manage-dialog h2 {
    margin: 0 0 1rem;
    font-size: 1.15rem;
}

.favorite-manage-close {
    position: absolute;
    top: 0.65rem;
    right: 0.75rem;
    border: 0;
    background: transparent;
    color: var(--client-muted);
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
}

.favorite-manage-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.favorite-manage-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding-bottom: 0.65rem;
    border-bottom: 1px solid var(--client-border);
}

.favorite-manage-item:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.favorite-manage-name {
    font-weight: 600;
}

.favorite-manage-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

body.favorite-manage-open {
    overflow: hidden;
}

.cart-link {
    white-space: nowrap;
}
