:root {
    --ink: #293134;
    --muted: #737b7d;
    --line: #e1e5e3;
    --paper: #ffffff;
    --panel: #ffffff;
    --accent: #a54c45;
    --accent-dark: #833b35;
    --yellow: #bba35f;
    --cyan: #5d8f97;
    --sky: #b8ced2;
    --green: #819777;
    --sidebar: #ffffff;
    --soft: #f7f8f7;
    --shadow: none;
    --shadow-soft: none;
}

/* Final metadata viewer layout */
@media (min-width: 781px) {
    .iptc-dialog {
        width: min(1480px, calc(100vw - 24px));
        height: min(940px, calc(100vh - 24px));
        min-width: min(760px, calc(100vw - 24px));
        min-height: min(520px, calc(100vh - 24px));
        resize: both;
    }

    .iptc-dialog-body {
        grid-template-columns: minmax(430px, 1.35fr) minmax(360px, 0.75fr);
        overflow: hidden;
    }

    .iptc-modal-preview {
        position: relative;
        height: 100%;
        overflow: hidden;
    }
}

.iptc-fields-panel {
    overflow: auto;
    scrollbar-gutter: stable both-edges;
}

.iptc-featured,
.iptc-modal-fields,
.iptc-camera-section {
    min-width: 500px;
}

.iptc-modal-fields,
.iptc-camera-fields {
    display: grid;
    gap: 0;
    border-top: 1px solid var(--line);
}

.iptc-featured {
    gap: 0;
    border-radius: 0;
}

.iptc-featured .iptc-featured-row,
.iptc-modal-fields .iptc-modal-row,
.iptc-camera-fields .iptc-modal-row {
    display: grid;
    grid-template-columns: minmax(138px, 0.34fr) minmax(260px, 1fr);
    gap: 10px;
    padding: 7px 10px;
    border: 0;
    border-bottom: 1px solid var(--line);
    border-radius: 0;
    background: #fff;
    font-size: 12px;
    line-height: 1.35;
}

.iptc-featured .iptc-featured-row {
    background: #f7f9f8;
}

.iptc-compact-label {
    align-self: start;
    color: var(--ink);
    font-size: 12px;
    font-weight: 600;
}

.iptc-modal-values {
    display: grid;
    gap: 3px;
    min-width: 0;
}

.iptc-modal-values .metadata-value {
    white-space: normal;
}

.iptc-modal-values .metadata-value + .metadata-value {
    margin: 0;
    padding: 3px 0 0;
}

.iptc-camera-section {
    margin-top: 20px;
}

.iptc-camera-section[hidden] {
    display: none;
}

.iptc-camera-section h3 {
    margin: 0;
    padding: 12px 10px;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    background: #fafbfa;
    font-size: 14px;
    font-weight: 600;
}

.metadata-simple-list,
.featured-metadata.metadata-simple-list {
    display: grid;
    gap: 0;
    margin-bottom: 18px;
    border: 0;
    border-top: 1px solid var(--line);
    background: #fff;
}

.metadata-simple-row {
    display: grid;
    grid-template-columns: minmax(150px, 0.32fr) minmax(0, 1fr);
    gap: 12px;
    padding: 8px 10px;
    border-bottom: 1px solid var(--line);
    font-size: 13px;
    line-height: 1.4;
}

.metadata-simple-row strong {
    color: var(--ink);
    font-weight: 600;
}

.metadata-simple-row span {
    overflow-wrap: anywhere;
}

.iptc-modal-row.metadata-people-row,
.metadata-simple-row.metadata-people-row {
    background: #fff9dc;
}

.metadata-people-row .iptc-compact-label,
.metadata-people-row > strong {
    color: #675817;
}

.metadata-section-title {
    margin: 22px 0 0;
    padding: 12px 10px;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    background: #fafbfa;
}

.metadata-section-title h3 {
    margin: 3px 0 0;
    font-size: 16px;
}

@media (max-width: 780px) {
    .iptc-dialog {
        min-width: 0;
        min-height: 0;
        resize: none;
    }

    .iptc-featured,
    .iptc-modal-fields,
    .iptc-camera-section {
        min-width: 440px;
    }

    .metadata-simple-row {
        grid-template-columns: 1fr;
    }
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    color: var(--ink);
    background: #fff;
    font-family: "Avenir Next", Avenir, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
}

a {
    color: inherit;
}

input,
textarea,
select,
button {
    font: inherit;
}

.public-page {
    min-height: 100vh;
    background: var(--sidebar);
}

.login-screen {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(420px, 0.62fr);
    min-height: 100svh;
}

.login-visual {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100svh;
    padding: clamp(36px, 7vw, 110px);
    background:
        linear-gradient(rgba(18, 22, 23, 0.72), rgba(18, 22, 23, 0.86)),
        url("https://images.unsplash.com/photo-1516035069371-29a1b244cc32?auto=format&fit=crop&w=1600&q=80") center / cover;
    border-top: 7px solid var(--cyan);
}

.login-logo-dark {
    display: block;
    width: min(680px, 88%);
    height: auto;
    filter: drop-shadow(0 18px 30px rgba(0, 0, 0, 0.38));
}

.login-logo-light {
    display: block;
    width: min(320px, 92%);
    height: auto;
    margin-bottom: 52px;
}

.login-card,
.panel,
.upload-panel {
    border: 1px solid rgba(17, 19, 21, 0.08);
    border-radius: 8px;
    background: var(--panel);
    box-shadow: var(--shadow);
}

.upload-progress {
    display: grid;
    gap: 9px;
    padding: 14px;
    border: 1px solid #c9dcdf;
    border-radius: 8px;
    background: #edf4f4;
}

.upload-progress[hidden] {
    display: none;
}

.upload-progress-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    color: #315f67;
}

.upload-progress progress {
    width: 100%;
    height: 14px;
    accent-color: var(--cyan);
}

.upload-progress p {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.4;
}

.upload-panel button:disabled,
.upload-panel input:disabled {
    cursor: wait;
    opacity: 0.65;
}

.login-card {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
    padding: clamp(38px, 5vw, 76px);
    border: 0;
    border-top: 7px solid var(--accent);
    border-radius: 0;
    box-shadow: -18px 0 52px rgba(0, 0, 0, 0.18);
}

.login-card h1,
.panel h2,
.upload-panel h2 {
    margin: 0 0 18px;
    font-size: 24px;
    font-weight: 600;
}

.login-card h1 {
    margin-bottom: 30px;
    font-size: clamp(30px, 4vw, 40px);
    line-height: 1.1;
    font-weight: 600;
    letter-spacing: 0;
}

label {
    display: grid;
    gap: 8px;
    margin-bottom: 16px;
    color: #374151;
    font-weight: 600;
}

input,
textarea,
select {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    min-height: 48px;
    padding: 12px 14px;
    color: var(--ink);
}

input:focus,
textarea:focus,
select:focus {
    outline: 3px solid rgba(76, 141, 152, 0.14);
    border-color: var(--accent);
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 18px;
    border: 0;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.button.primary {
    color: #fff;
    background: var(--ink);
}

.button.primary:hover {
    background: var(--accent);
    transform: translateY(-1px);
}

.button.secondary {
    color: #315f67;
    background: #e5f0f1;
}

.button.danger {
    color: #8e3831;
    background: #f5e7e5;
}

.button.danger:hover {
    color: #fff;
    background: var(--accent-dark);
}

.button.metadata {
    color: #fff;
    background: var(--accent);
}

.button.metadata:hover {
    background: var(--accent-dark);
}

.login-card .button {
    width: 100%;
    min-height: 50px;
}

.login-gallery-link {
    margin-top: 10px;
}

.hint,
.empty {
    color: var(--muted);
    line-height: 1.5;
}

.login-card .hint {
    margin: 28px 0 0;
    padding-top: 20px;
    border-top: 1px solid var(--line);
    font-size: 13px;
}

.shell {
    display: grid;
    grid-template-columns: 286px minmax(0, 1fr);
    min-height: 100vh;
}

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    padding: 28px 22px;
    background: var(--sidebar);
    color: #fff;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.brand {
    display: block;
    padding: 8px 4px 26px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.14);
    color: inherit;
    text-decoration: none;
}

.brand img {
    display: block;
    width: 100%;
    max-width: 214px;
    height: auto;
}

.account small {
    display: block;
    color: rgba(255, 255, 255, 0.62);
}

.nav {
    display: grid;
    gap: 8px;
    margin-top: 32px;
}

.nav a,
.account a {
    padding: 12px;
    border-radius: 8px;
    color: #fff;
    text-decoration: none;
}

.nav a:hover,
.account a:hover {
    background: rgba(255, 255, 255, 0.1);
}

.nav a.active {
    color: var(--ink);
    background: #fff;
    box-shadow: inset 4px 0 0 var(--accent);
}

.account {
    position: absolute;
    right: 22px;
    bottom: 22px;
    left: 22px;
    display: grid;
    gap: 6px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.14);
}

.account a {
    padding-left: 0;
    color: #d9a29d;
}

.content {
    min-width: 0;
    padding: 40px;
}

.page-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 24px;
}

.page-head h1 {
    margin: 0;
    font-size: clamp(29px, 4vw, 40px);
    line-height: 1.08;
    font-weight: 600;
    letter-spacing: 0;
}

.page-head p {
    max-width: 760px;
    color: var(--muted);
}

.eyebrow {
    margin: 0 0 8px;
    color: var(--accent);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: uppercase;
}

.metric-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.metric {
    position: relative;
    overflow: hidden;
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    box-shadow: var(--shadow-soft);
}

.metric::before {
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    height: 5px;
    background: var(--accent);
    content: "";
}

.metric:nth-child(2)::before {
    background: var(--yellow);
}

.metric:nth-child(3)::before {
    background: var(--cyan);
}

.metric:nth-child(4)::before {
    background: var(--green);
}

.metric span {
    display: block;
    color: var(--muted);
    font-weight: 600;
}

.metric strong {
    display: block;
    margin-top: 10px;
    font-size: 32px;
    font-weight: 600;
}

.panel,
.upload-panel {
    padding: 22px;
}

.panel-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
}

.panel-head h2 {
    margin: 0;
}

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

.event-card {
    position: relative;
    display: grid;
    min-height: 170px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    box-shadow: var(--shadow-soft);
    text-decoration: none;
}

.event-card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.event-card:hover {
    border-color: rgba(228, 61, 45, 0.45);
    transform: translateY(-1px);
}

.folder-icon {
    width: 52px;
    height: 38px;
    border-radius: 6px;
    background: var(--yellow);
    box-shadow: inset -12px 0 0 var(--green), inset 12px 0 0 var(--cyan);
}

.event-card strong {
    align-self: end;
    font-size: 18px;
}

.event-card small {
    color: var(--muted);
    word-break: break-word;
}

.event-card em {
    color: #3c747d;
    font-style: normal;
    font-weight: 600;
}

.event-card.topic-card {
    border-left: 4px solid #0aa7b8;
    background: #f7fbfb;
}

.event-card.topic-card .folder-icon {
    border-left-color: #0aa7b8;
    background: #f1f8f8;
}

.topic-owner {
    color: #255d65;
    font-size: 12px;
    font-weight: 700;
}

.personal-client-list {
    display: grid;
    gap: 0;
}

.personal-client-row {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) minmax(220px, 0.8fr) auto;
    align-items: end;
    gap: 14px;
    padding: 16px 0;
    border-bottom: 1px solid var(--line);
}

.personal-client-row > div,
.personal-client-row form {
    display: grid;
    gap: 6px;
}

.personal-client-row span,
.personal-client-row small {
    color: var(--muted);
}

.personal-client-row input {
    min-width: 0;
}

@media (max-width: 900px) {
    .personal-client-row {
        grid-template-columns: 1fr;
        align-items: stretch;
    }
}

.keyword-preview {
    overflow: hidden;
    color: #4b5563;
    font-size: 12px;
    line-height: 1.4;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 5px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}

.status-badge.prepared {
    color: #6f5b2f;
    background: #f1ead4;
}

.status-badge.active {
    color: #315f67;
    background: #e5f0f1;
}

.status-badge.hidden {
    color: #7a3731;
    background: #f3dfdc;
}

.split {
    display: grid;
    grid-template-columns: minmax(280px, 0.42fr) minmax(0, 1fr);
    gap: 18px;
}

.event-layout {
    grid-template-columns: minmax(0, 1fr) 320px;
    align-items: start;
}

.form-panel {
    align-self: start;
}

.users-layout {
    grid-template-columns: minmax(310px, 0.38fr) minmax(0, 1fr);
}

.category-layout {
    grid-template-columns: minmax(300px, 0.36fr) minmax(0, 1fr);
}

.form-grid {
    display: grid;
    gap: 12px;
}

.form-grid.two-columns {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.field-help {
    color: var(--muted);
    font-weight: 500;
    line-height: 1.4;
}

fieldset {
    margin: 0 0 18px;
    padding: 0;
    border: 0;
}

legend {
    margin-bottom: 10px;
    font-weight: 600;
}

.check-list {
    display: grid;
    gap: 8px;
}

.check-list label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    font-weight: 600;
}

.check-list input {
    width: auto;
    min-height: 0;
}

.scroll-list {
    max-height: 260px;
    overflow-y: auto;
    padding-right: 6px;
}

.client-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.role-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.role-options label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    min-height: 82px;
    margin: 0;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
}

.role-options label:has(input:checked) {
    border-color: var(--accent);
    background: #fff7f7;
}

.role-options input {
    width: auto;
    min-height: 0;
    margin-top: 3px;
}

.role-options span,
.role-options small {
    display: block;
}

.role-options small {
    margin-top: 4px;
    color: var(--muted);
    font-weight: 500;
    line-height: 1.35;
}

.role-badge {
    display: inline-flex;
    padding: 5px 8px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
}

.role-badge.photographer {
    color: #315f67;
    background: #e5f0f1;
}

.role-badge.super_admin {
    color: #8e1d14;
    background: #fee2e2;
}

.role-badge.admin {
    color: #6f5b2f;
    background: #f1ead4;
}

.role-badge.client {
    color: #536b49;
    background: #e8eee5;
}

.password-reset {
    display: grid;
    grid-template-columns: minmax(170px, 1fr) auto;
    gap: 8px;
    min-width: 300px;
}

.role-update {
    display: grid;
    grid-template-columns: minmax(155px, 1fr) auto;
    gap: 8px;
    min-width: 270px;
}

.download-rule {
    display: grid;
    grid-template-columns: minmax(190px, 1fr) auto;
    gap: 8px;
    min-width: 315px;
}

.role-update select,
.download-rule select,
.password-reset input {
    min-height: 38px;
    padding: 8px 10px;
}

.table-secondary {
    display: block;
    margin-top: 4px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 500;
}

.user-directory form {
    margin: 0;
}

.visibility-control {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    margin-bottom: 20px;
    padding: 13px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f8f9f7;
    cursor: pointer;
}

.visibility-control input {
    width: auto;
    min-height: 0;
    margin-top: 3px;
}

.visibility-control span,
.visibility-control small {
    display: block;
}

.visibility-control small {
    margin-top: 3px;
    color: var(--muted);
    font-weight: 400;
    line-height: 1.4;
}

.publication-choice {
    display: grid;
    gap: 8px;
    margin-bottom: 18px;
}

.publication-choice > label {
    display: grid;
    grid-template-columns: 20px minmax(0, 1fr);
    align-items: start;
    gap: 10px;
    margin: 0;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 5px;
    background: #fafbfa;
    cursor: pointer;
}

.publication-choice input {
    width: 18px;
    min-height: 18px;
    margin: 2px 0 0;
}

.publication-choice span,
.publication-choice small {
    display: block;
}

.publication-choice small {
    margin-top: 3px;
    color: var(--muted);
    font-weight: 400;
    line-height: 1.45;
}

.publication-choice > label:has(input:checked) {
    border-color: #6f8f94;
    background: #f2f7f7;
}

.public-category-fieldset {
    margin-bottom: 18px;
    padding: 13px;
    border: 1px solid var(--line);
    border-left: 3px solid #315f67;
    background: #f8faf9;
}

.public-category-fieldset[hidden] {
    display: none;
}

.category-list {
    display: grid;
    gap: 14px;
}

.category-item {
    align-self: start;
}

.category-item-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.category-item-head h2 {
    margin: 0;
}

.category-item-head > span {
    color: var(--muted);
    font-size: 12px;
    white-space: nowrap;
}

.category-delete {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--line);
}

.empty-state {
    color: var(--muted);
    text-align: center;
}

.empty-state strong {
    color: var(--ink);
    font-size: 18px;
    font-weight: 600;
}

.password-reset input {
    min-height: 38px;
    padding: 8px 10px;
}

.event-search {
    display: grid;
    gap: 8px;
    margin-bottom: 18px;
    padding: 16px;
    border: 1px solid var(--line);
    border-left: 5px solid var(--cyan);
    border-radius: 8px;
    background: #fff;
    box-shadow: var(--shadow-soft);
}

.event-search label {
    margin: 0;
}

.event-search > div {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 8px;
}

.event-status-block {
    display: grid;
    justify-items: end;
    gap: 10px;
}

.event-metadata {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-bottom: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    box-shadow: var(--shadow-soft);
}

.event-metadata > span {
    min-width: 0;
    padding: 15px 16px;
    border-right: 1px solid var(--line);
}

.event-metadata > span:last-child {
    border-right: 0;
}

.event-metadata small,
.event-metadata strong {
    display: block;
}

.event-metadata small {
    margin-bottom: 5px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.event-metadata strong {
    overflow-wrap: anywhere;
    line-height: 1.35;
}

.keyword-list {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-bottom: 18px;
}

.keyword-list span {
    padding: 6px 9px;
    border: 1px solid #c9dcdf;
    border-radius: 6px;
    color: #315f67;
    background: #edf4f4;
    font-size: 12px;
    font-weight: 600;
}

.event-editor {
    margin-bottom: 18px;
    border-top: 5px solid var(--yellow);
}

.event-editor summary {
    cursor: pointer;
    font-size: 17px;
    font-weight: 600;
}

.event-editor[open] summary {
    margin-bottom: 20px;
}

.upload-panel {
    display: grid;
    gap: 16px;
    margin-bottom: 18px;
    border-top: 5px solid var(--cyan);
    background: #fff;
}

.drop-zone {
    place-items: center;
    min-height: 190px;
    margin: 0;
    border: 2px dashed rgba(8, 167, 195, 0.45);
    background: #f6fbfc;
    text-align: center;
    cursor: pointer;
    transition: border-color 160ms ease, background-color 160ms ease, box-shadow 160ms ease;
}

.drop-zone.is-dragging {
    border-color: var(--accent);
    background: #fff4f2;
    box-shadow: inset 0 0 0 3px rgba(181, 74, 64, 0.12);
}

.drop-zone.has-files {
    border-color: var(--green);
    background: #f4f8f2;
}

.drop-zone input {
    max-width: 330px;
}

.drop-zone span {
    font-size: 20px;
    color: #315f67;
}

.drop-zone small {
    color: var(--muted);
}

.photographer-metrics {
    grid-template-columns: repeat(2, minmax(180px, 280px));
}

.personal-upload {
    margin-bottom: 30px;
}

.personal-events-section,
.personal-photo-section {
    margin-top: 30px;
}

.personal-event-card {
    gap: 10px;
}

.personal-event-card strong {
    align-self: auto;
}

.personal-event-counts {
    color: #315f67;
    font-size: 13px;
    font-weight: 700;
}

.personal-event-card .button {
    align-self: end;
    margin-top: 4px;
}

.personal-photo-actions {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 7px;
}

.admin-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 28px;
    padding-bottom: 10px;
    overflow-x: auto;
    border-bottom: 1px solid var(--line);
}

.admin-tabs a {
    flex: 0 0 auto;
    padding: 10px 13px;
    border-radius: 6px;
    color: var(--muted);
    text-decoration: none;
    font-weight: 600;
}

.admin-tabs a:hover,
.admin-tabs a.active {
    color: var(--ink);
    background: #fff;
    box-shadow: inset 0 -3px 0 var(--accent);
}

.admin-shortcuts {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.admin-shortcut {
    display: grid;
    gap: 7px;
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    box-shadow: var(--shadow-soft);
    text-decoration: none;
}

.admin-shortcut:hover {
    border-color: rgba(76, 141, 152, 0.52);
}

.admin-shortcut strong {
    font-size: 18px;
}

.admin-shortcut span {
    color: var(--muted);
}

.download-log-panel {
    min-width: 0;
}

.download-log-table td {
    vertical-align: top;
}

.log-operation {
    display: inline-flex;
    padding: 5px 8px;
    border-radius: 6px;
    color: #315f67;
    background: #e5f0f1;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.path-pill {
    display: inline-flex;
    max-width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    color: var(--muted);
    font-weight: 600;
    word-break: break-word;
}

.assigned-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 20px;
}

.assigned-list span {
    padding: 8px 10px;
    border-radius: 8px;
    background: #f3f4f6;
    color: #374151;
    font-size: 13px;
    font-weight: 600;
}

.assigned-list .category-chip {
    color: #526943;
    background: #e9efe5;
}

.assigned-list small {
    display: block;
    margin-top: 3px;
    color: var(--muted);
    font-size: 10px;
    font-weight: 700;
}

.photo-library {
    padding: 4px 0;
}

.panel-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
}

.button.compact {
    min-height: 38px;
    padding: 0 13px;
    font-size: 13px;
}

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

.photo-card {
    min-width: 0;
    margin: 0;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 8px 24px rgba(17, 24, 39, 0.08);
}

.photo-image {
    display: block;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: #e5e7eb;
}

.photo-image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 180ms ease;
}

.photo-image:hover img {
    transform: scale(1.02);
}

.photo-card figcaption {
    display: grid;
    gap: 7px;
    padding: 14px;
}

.photo-card figcaption strong,
.photo-card figcaption span,
.photo-card figcaption small {
    overflow-wrap: anywhere;
}

.photo-card figcaption span,
.photo-card figcaption small {
    color: var(--muted);
}

.photo-card figcaption .button {
    margin-top: 5px;
}

.photo-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 7px;
}

.download-choice {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 7px;
    margin: 0;
}

.download-choice select {
    min-width: 0;
    min-height: 38px;
    padding: 7px 9px;
    font-size: 13px;
}

.bulk-download-choice {
    grid-template-columns: minmax(175px, 1fr) auto;
}

.fixed-download-size {
    display: inline-flex;
    align-items: center;
    min-height: 38px;
    padding: 7px 10px;
    border: 1px solid #c9dcdf;
    border-radius: 8px;
    color: #315f67;
    background: #edf4f4;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.metadata-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-bottom: 18px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    box-shadow: var(--shadow-soft);
}

.metadata-summary > span {
    min-width: 0;
    padding: 16px;
    border-right: 1px solid var(--line);
}

.metadata-summary > span:last-child {
    border-right: 0;
}

.metadata-summary small,
.metadata-summary strong {
    display: block;
}

.metadata-summary small {
    margin-bottom: 6px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.metadata-summary strong {
    overflow-wrap: anywhere;
    font-size: 18px;
}

.metadata-dashboard {
    display: grid;
    grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
    align-items: start;
    gap: 18px;
}

.metadata-preview {
    position: sticky;
    top: 24px;
    margin: 0;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--sidebar);
    box-shadow: var(--shadow-soft);
}

.metadata-preview > a {
    display: grid;
    place-items: center;
    min-height: 280px;
    max-height: 520px;
}

.metadata-preview img {
    display: block;
    width: 100%;
    max-height: 520px;
    object-fit: contain;
}

.metadata-preview figcaption {
    display: grid;
    gap: 6px;
    padding: 16px;
    background: #fff;
}

.metadata-preview figcaption span,
.metadata-preview figcaption small {
    overflow-wrap: anywhere;
    color: var(--muted);
}

.metadata-panel {
    min-width: 0;
}

.metadata-table td {
    vertical-align: top;
    white-space: normal;
}

.metadata-table td:nth-child(2) {
    min-width: 180px;
}

.metadata-table td:last-child {
    min-width: 260px;
}

.metadata-table code {
    color: #315f67;
    font-size: 12px;
    font-weight: 600;
}

.metadata-source {
    display: inline-flex;
    padding: 5px 7px;
    border-radius: 6px;
    color: #6f5b2f;
    background: #f1ead4;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}

.metadata-value {
    display: block;
    overflow-wrap: anywhere;
    white-space: pre-wrap;
}

.metadata-value + .metadata-value {
    margin-top: 7px;
    padding-top: 7px;
    border-top: 1px solid var(--line);
}

.metadata-empty {
    padding: 34px 0;
    color: var(--muted);
    text-align: center;
}

.metadata-empty strong {
    color: var(--ink);
    font-size: 18px;
}

.iptc-dialog {
    width: min(1180px, calc(100vw - 32px));
    max-width: none;
    height: min(900px, calc(100vh - 32px));
    max-height: none;
    padding: 0;
    overflow: hidden;
    border: 0;
    border-radius: 8px;
    background: #fff;
    color: var(--ink);
    box-shadow: 0 28px 80px rgba(0, 0, 0, 0.34);
}

.iptc-dialog::backdrop {
    background: rgba(8, 10, 11, 0.76);
}

.iptc-dialog-frame {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    height: 100%;
}

.iptc-dialog-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 16px 18px;
    border-bottom: 1px solid var(--line);
    background: #fff;
}

.iptc-dialog-head h2 {
    max-width: 680px;
    margin: 0;
    overflow: hidden;
    font-size: 22px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.iptc-dialog-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.icon-button {
    display: inline-grid;
    place-items: center;
    width: 42px;
    height: 42px;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--ink);
    background: #fff;
    font-size: 27px;
    line-height: 1;
    cursor: pointer;
}

.icon-button:hover {
    color: #fff;
    border-color: var(--accent);
    background: var(--accent);
}

.iptc-dialog-body {
    display: grid;
    grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
    min-height: 0;
    overflow: hidden;
}

.iptc-modal-preview {
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto;
    min-width: 0;
    min-height: 0;
    margin: 0;
    background: var(--sidebar);
}

.iptc-image-button {
    display: grid;
    place-items: center;
    min-width: 0;
    min-height: 0;
    padding: 0;
    overflow: hidden;
    border: 0;
    background: transparent;
    cursor: zoom-in;
}

.iptc-image-button img {
    display: block;
    width: 100%;
    height: 100%;
    min-height: 0;
    object-fit: contain;
}

.iptc-modal-preview figcaption {
    padding: 14px 16px;
    overflow-wrap: anywhere;
    color: rgba(255, 255, 255, 0.76);
    border-top: 1px solid rgba(255, 255, 255, 0.14);
    font-size: 13px;
    line-height: 1.45;
}

.iptc-fields-panel {
    min-width: 0;
    min-height: 0;
    padding: 18px;
    overflow-y: auto;
    background: var(--paper);
}

.iptc-modal-summary {
    margin-bottom: 12px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 600;
}

.iptc-loading {
    padding: 34px 0;
    color: var(--muted);
    text-align: center;
}

.iptc-loading[hidden] {
    display: none;
}

.iptc-modal-fields {
    display: grid;
    gap: 8px;
}

/* Compact editorial and camera metadata viewer */
.iptc-dialog {
    width: min(1480px, calc(100vw - 24px));
    height: min(940px, calc(100vh - 24px));
    min-width: min(760px, calc(100vw - 24px));
    min-height: min(520px, calc(100vh - 24px));
    resize: both;
}

.iptc-dialog-body {
    grid-template-columns: minmax(430px, 1.35fr) minmax(360px, 0.75fr);
}

.iptc-modal-preview {
    position: relative;
    height: 100%;
    overflow: hidden;
}

.iptc-fields-panel {
    overflow: auto;
    scrollbar-gutter: stable both-edges;
}

.iptc-featured,
.iptc-modal-fields,
.iptc-camera-section {
    min-width: 500px;
}

.iptc-modal-fields,
.iptc-camera-fields {
    display: grid;
    gap: 0;
    border-top: 1px solid var(--line);
}

.iptc-featured {
    gap: 0;
    border-radius: 0;
}

.iptc-featured-row,
.iptc-modal-row {
    display: grid;
    grid-template-columns: minmax(138px, 0.34fr) minmax(260px, 1fr);
    gap: 10px;
    padding: 7px 10px;
    border: 0;
    border-bottom: 1px solid var(--line);
    border-radius: 0;
    background: #fff;
    font-size: 12px;
    line-height: 1.35;
}

.iptc-featured-row {
    background: #f7f9f8;
}

.iptc-compact-label {
    align-self: start;
    color: var(--ink);
    font-size: 12px;
    font-weight: 600;
}

.iptc-modal-values {
    display: grid;
    gap: 3px;
    min-width: 0;
}

.iptc-modal-values .metadata-value {
    white-space: normal;
}

.iptc-modal-values .metadata-value + .metadata-value {
    margin: 0;
    padding: 3px 0 0;
}

.iptc-camera-section {
    margin-top: 20px;
}

.iptc-camera-section[hidden] {
    display: none;
}

.iptc-camera-section h3,
.metadata-section-title {
    margin: 0;
    padding: 12px 10px;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    background: #fafbfa;
}

.iptc-camera-section h3 {
    font-size: 14px;
    font-weight: 600;
}

.metadata-simple-list {
    display: grid;
    border-top: 1px solid var(--line);
}

.metadata-simple-row {
    display: grid;
    grid-template-columns: minmax(150px, 0.32fr) minmax(0, 1fr);
    gap: 12px;
    padding: 8px 10px;
    border-bottom: 1px solid var(--line);
    font-size: 13px;
    line-height: 1.4;
}

.metadata-simple-row strong {
    font-weight: 600;
}

.metadata-simple-row span {
    overflow-wrap: anywhere;
}

.metadata-section-title {
    margin-top: 22px;
}

.metadata-section-title h3 {
    margin: 3px 0 0;
    font-size: 16px;
}

.iptc-featured,
.featured-metadata {
    display: grid;
    gap: 1px;
    margin-bottom: 18px;
    border: 1px solid var(--line);
    background: var(--line);
}

.iptc-featured-row,
.featured-metadata article {
    display: grid;
    grid-template-columns: minmax(150px, 0.32fr) minmax(0, 1fr);
    gap: 16px;
    padding: 14px 16px;
    background: #fff;
}

.iptc-featured-row small,
.featured-metadata small {
    display: grid;
    align-content: start;
    gap: 5px;
    color: var(--muted);
}

.iptc-featured-row small strong {
    color: var(--ink);
    font-size: 13px;
}

.iptc-featured-row code,
.featured-metadata code {
    color: #315f67;
    font-size: 11px;
}

.iptc-featured-row > div,
.featured-metadata article > strong {
    display: grid;
    gap: 5px;
    min-width: 0;
    font-weight: 500;
    overflow-wrap: anywhere;
}

.featured-metadata {
    margin: 0 0 24px;
}

.event-caption {
    margin: 0 0 22px;
    padding: 16px 0;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.event-caption small {
    color: var(--muted);
    font-weight: 600;
}

.event-caption p {
    max-width: 980px;
    margin: 7px 0 0;
}

.metadata-copy-panel {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 18px;
    padding: 16px 0;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.metadata-copy-panel div,
.photo-people-editor form {
    display: grid;
    gap: 5px;
}

.metadata-copy-panel small,
.photo-people-editor small {
    color: var(--muted);
}

.photo-people {
    color: var(--ink) !important;
    font-size: 12px;
}

.photo-people-editor {
    margin-top: 4px;
    border-top: 1px solid var(--line);
    padding-top: 8px;
}

.photo-people-quick-editor {
    display: grid;
    gap: 8px;
    margin-top: 4px;
    padding: 12px;
    border: 1px solid #e4d797;
    border-radius: 4px;
    background: #fffbed;
}

.photo-people-quick-editor > label:first-of-type {
    display: grid;
    gap: 6px;
    color: var(--ink);
    font-size: 12px;
    font-weight: 700;
}

.photo-people-quick-editor textarea {
    width: 100%;
    min-height: 64px;
    resize: vertical;
}

.photo-people-quick-editor .button {
    width: 100%;
}

.photo-people-editor summary {
    cursor: pointer;
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
}

.photo-people-editor form {
    margin-top: 8px;
}

.photo-people-editor textarea {
    width: 100%;
    min-height: 64px;
    resize: vertical;
}

.iptc-modal-row {
    display: grid;
    grid-template-columns: minmax(180px, 0.42fr) minmax(0, 1fr);
    gap: 14px;
    padding: 13px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
}

.iptc-modal-field-head {
    display: grid;
    align-content: start;
    justify-items: start;
    gap: 6px;
    min-width: 0;
}

.iptc-modal-field-head strong,
.iptc-modal-field-head code {
    overflow-wrap: anywhere;
}

.iptc-modal-field-head code {
    color: #315f67;
    font-size: 11px;
    font-weight: 600;
}

.iptc-modal-values {
    min-width: 0;
}

.iptc-dialog.photo-mode .iptc-dialog-body {
    grid-template-columns: 1fr;
    background: var(--sidebar);
}

.iptc-dialog.photo-mode .iptc-fields-panel,
.iptc-dialog.photo-mode .iptc-modal-preview figcaption {
    display: none;
}

.iptc-dialog.photo-mode .iptc-image-button {
    cursor: zoom-out;
}

.table-wrap {
    width: 100%;
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 13px 10px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    white-space: nowrap;
}

th {
    color: var(--muted);
    font-size: 12px;
    text-transform: uppercase;
}

.flash {
    margin-bottom: 16px;
    padding: 12px 14px;
    border-radius: 8px;
    font-weight: 700;
}

.flash.success {
    color: #065f46;
    background: #d1fae5;
}

.flash.error {
    color: var(--accent-dark);
    background: #fee2e2;
}

.public-gallery-page {
    min-height: 100vh;
    background: #f4f5f3;
}

.public-gallery-header {
    position: sticky;
    z-index: 20;
    top: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 82px;
    padding: 14px clamp(22px, 5vw, 72px);
    border-bottom: 1px solid rgba(32, 40, 43, 0.12);
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 8px 24px rgba(32, 40, 43, 0.05);
}

.public-gallery-brand {
    display: block;
    width: min(236px, 46vw);
}

.public-gallery-brand img {
    display: block;
    width: 100%;
    height: auto;
}

.public-gallery-nav {
    display: flex;
    align-items: center;
    gap: 10px;
}

.public-gallery-nav > a:not(.button) {
    padding: 10px 12px;
    border-bottom: 2px solid transparent;
    color: var(--muted);
    text-decoration: none;
    font-weight: 600;
}

.public-gallery-nav > a.active {
    border-bottom-color: var(--accent);
    color: var(--ink);
}

.public-gallery-main {
    width: min(1440px, 100%);
    min-height: calc(100vh - 160px);
    margin: 0 auto;
    padding: clamp(28px, 5vw, 64px) clamp(18px, 5vw, 64px) 72px;
}

.public-gallery-intro,
.public-event-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(260px, 0.4fr);
    align-items: end;
    gap: 36px;
    margin-bottom: 28px;
    padding-bottom: 28px;
    border-bottom: 1px solid var(--line);
}

.public-gallery-intro h1,
.public-event-head h1 {
    margin: 0;
    font-size: clamp(34px, 5vw, 58px);
    line-height: 1.04;
    font-weight: 600;
    letter-spacing: 0;
}

.public-gallery-intro > p,
.public-event-head > div > p:last-child {
    margin: 0;
    color: var(--muted);
    font-size: 17px;
    line-height: 1.6;
}

.public-event-head > div > p:last-child {
    max-width: 840px;
    margin-top: 18px;
}

.public-gallery-search {
    display: grid;
    gap: 9px;
    margin-bottom: 28px;
    padding: 18px;
    border-left: 5px solid var(--cyan);
    background: #fff;
    box-shadow: var(--shadow-soft);
}

.public-gallery-search label {
    margin: 0;
    font-size: 13px;
}

.public-gallery-search > div {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 8px;
}

.public-event-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 22px;
}

.public-event-card {
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    box-shadow: var(--shadow-soft);
    text-decoration: none;
    transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.public-event-card:hover {
    transform: translateY(-2px);
    border-color: rgba(76, 141, 152, 0.52);
    box-shadow: var(--shadow);
}

.public-event-cover {
    display: grid;
    place-items: center;
    aspect-ratio: 3 / 2;
    overflow: hidden;
    background: #242b2d;
    color: rgba(255, 255, 255, 0.7);
    font-size: 13px;
}

.public-event-cover img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none;
    user-select: none;
}

.public-event-card-body {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 7px 14px;
    padding: 17px;
}

.public-event-card-body small,
.public-event-card-body span {
    color: var(--muted);
}

.public-event-card-body strong,
.public-event-card-body span {
    grid-column: 1 / -1;
    overflow-wrap: anywhere;
}

.public-event-card-body strong {
    font-size: 19px;
    font-weight: 600;
}

.public-event-card-body em {
    color: #315f67;
    font-size: 13px;
    font-style: normal;
    font-weight: 700;
}

.public-gallery-empty {
    grid-column: 1 / -1;
    padding: 54px 24px;
    border: 1px solid var(--line);
    background: #fff;
    color: var(--muted);
    text-align: center;
}

.public-gallery-empty strong {
    display: block;
    color: var(--ink);
    font-size: 20px;
}

.public-gallery-empty p {
    margin: 8px 0 0;
}

.public-breadcrumb {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    color: var(--muted);
    font-size: 13px;
}

.public-breadcrumb a {
    color: #315f67;
    font-weight: 700;
}

.public-event-facts {
    display: grid;
    gap: 10px;
}

.public-event-facts span {
    display: grid;
    grid-template-columns: 92px minmax(0, 1fr);
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--line);
    font-weight: 600;
    overflow-wrap: anywhere;
}

.public-event-facts small {
    color: var(--muted);
    font-weight: 500;
}

.public-keywords {
    margin-bottom: 24px;
}

.public-protection-note {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px;
    margin-bottom: 24px;
    padding: 14px 16px;
    border-left: 5px solid var(--yellow);
    background: #fff;
    box-shadow: var(--shadow-soft);
}

.public-protection-note span {
    color: var(--muted);
    font-size: 13px;
}

.public-protection-note a {
    color: #315f67;
    font-weight: 700;
}

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

.public-photo-card {
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto;
    height: 420px;
    min-width: 0;
    margin: 0;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    box-shadow: var(--shadow-soft);
}

.public-photo-open {
    display: block;
    width: 100%;
    height: 100%;
    min-height: 0;
    aspect-ratio: auto;
    padding: 0;
    overflow: hidden;
    border: 0;
    background: #f3f5f4;
    cursor: zoom-in;
}

.public-photo-open img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    pointer-events: none;
    user-select: none;
    transition: transform 180ms ease;
}

.public-photo-open:hover img {
    transform: scale(1.018);
}

.public-photo-card figcaption {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
}

.public-photo-card figcaption span {
    color: var(--muted);
    font-size: 12px;
}

.public-photo-dialog {
    width: min(1360px, calc(100vw - 36px));
    max-width: none;
    height: min(900px, calc(100vh - 36px));
    max-height: none;
    padding: 0;
    overflow: hidden;
    border: 0;
    border-radius: 8px;
    background: #15191a;
    color: #fff;
    box-shadow: 0 30px 90px rgba(0, 0, 0, 0.45);
}

.public-photo-dialog::backdrop {
    background: rgba(10, 12, 13, 0.88);
}

.public-photo-dialog figure {
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto;
    height: 100%;
    margin: 0;
}

.public-photo-dialog img {
    align-self: center;
    justify-self: center;
    display: block;
    max-width: 100%;
    max-height: calc(100vh - 100px);
    object-fit: contain;
    user-select: none;
}

.public-photo-dialog figcaption {
    padding: 12px 64px 14px 18px;
    color: rgba(255, 255, 255, 0.74);
    font-size: 13px;
}

.public-photo-close {
    position: absolute;
    z-index: 2;
    top: 12px;
    right: 12px;
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    background: rgba(16, 19, 20, 0.78);
    color: #fff;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
}

.public-gallery-footer {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    padding: 24px clamp(22px, 5vw, 72px);
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    background: var(--sidebar);
    color: rgba(255, 255, 255, 0.7);
    font-size: 12px;
}

.public-gallery-footer a {
    color: inherit;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.privacy-page {
    width: min(900px, 100%);
    margin: 0 auto;
}

.privacy-head {
    margin-bottom: 16px;
    padding-bottom: 26px;
    border-bottom: 1px solid var(--line);
}

.privacy-head h1 {
    margin: 0 0 12px;
    font-size: 42px;
    line-height: 1.1;
    letter-spacing: 0;
}

.privacy-head > p:not(.eyebrow) {
    margin: 0 0 8px;
    color: var(--muted);
    font-size: 17px;
    line-height: 1.55;
}

.privacy-head small {
    color: var(--muted);
}

.privacy-page > section {
    padding: 22px 0;
    border-bottom: 1px solid var(--line);
}

.privacy-page h2 {
    margin: 0 0 10px;
    font-size: 20px;
    line-height: 1.3;
}

.privacy-page p,
.privacy-page li {
    color: #4f5a5c;
    font-size: 15px;
    line-height: 1.7;
}

.privacy-page p {
    margin: 0 0 10px;
}

.privacy-page ul {
    margin: 0 0 12px;
    padding-left: 22px;
}

.privacy-page a:not(.button) {
    color: #315f67;
    text-decoration: underline;
}

.privacy-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding-top: 28px;
}

@media (max-width: 640px) {
    .privacy-head h1 {
        font-size: 34px;
    }

    .privacy-actions .button {
        width: 100%;
    }
}

/* Light editorial theme */
.public-page,
.app-page,
.public-gallery-page {
    background: #fff;
}

.login-screen {
    grid-template-columns: minmax(0, 1fr) minmax(400px, 520px);
}

.login-visual {
    min-height: 100svh;
    border-top: 0;
    border-right: 1px solid var(--line);
    background: var(--soft);
}

.login-logo-dark {
    width: min(570px, 76%);
    filter: none;
}

.login-logo-light {
    width: min(250px, 84%);
    margin-bottom: 38px;
}

.login-card,
.panel,
.upload-panel {
    border: 1px solid var(--line);
    border-radius: 4px;
    box-shadow: none;
}

.login-card {
    border-width: 0 0 0 1px;
    border-color: var(--line);
    border-radius: 0;
    box-shadow: none;
}

.login-card h1 {
    margin-bottom: 26px;
    font-size: clamp(28px, 3vw, 36px);
    font-weight: 500;
}

.login-card h1,
.panel h2,
.upload-panel h2 {
    font-weight: 500;
}

label {
    color: #41494b;
    font-weight: 500;
}

input,
textarea,
select {
    min-height: 44px;
    border-radius: 4px;
    background: #fff;
}

input:focus,
textarea:focus,
select:focus {
    outline: 2px solid rgba(93, 143, 151, 0.14);
    border-color: var(--cyan);
}

.button {
    min-height: 42px;
    border: 1px solid transparent;
    border-radius: 4px;
    font-weight: 500;
}

.button.primary {
    border-color: var(--ink);
    background: var(--ink);
}

.button.primary:hover {
    border-color: #3b4649;
    background: #3b4649;
    transform: none;
}

.button.secondary {
    border-color: var(--line);
    color: #405f65;
    background: #fff;
}

.button.secondary:hover {
    border-color: var(--cyan);
    background: #f8fbfb;
}

.button.metadata {
    border-color: #d8b8b4;
    color: var(--accent-dark);
    background: #fff;
}

.button.metadata:hover {
    color: #fff;
}

.button.danger {
    border-color: #ead3d0;
    background: #fff;
}

.shell {
    grid-template-columns: 250px minmax(0, 1fr);
}

.sidebar {
    padding: 28px 20px;
    border-right: 1px solid var(--line);
    background: #fff;
    color: var(--ink);
}

.brand {
    padding: 4px 3px 24px;
    border-bottom-color: var(--line);
}

.brand img {
    max-width: 190px;
}

.nav {
    gap: 2px;
    margin-top: 26px;
}

.nav a,
.account a {
    border-radius: 3px;
    color: var(--muted);
}

.nav a:hover,
.account a:hover {
    color: var(--ink);
    background: var(--soft);
}

.nav a.active {
    color: var(--ink);
    background: #fff;
    box-shadow: inset 2px 0 0 var(--accent);
}

.account {
    border-top-color: var(--line);
}

.account small {
    color: var(--muted);
}

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

.content {
    padding: 38px clamp(28px, 4vw, 58px) 64px;
    background: #fff;
}

.page-head {
    margin-bottom: 28px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--line);
}

.page-head h1 {
    font-size: clamp(27px, 3.5vw, 36px);
    font-weight: 500;
}

.page-head p {
    margin-bottom: 0;
}

.eyebrow {
    color: var(--accent);
    font-weight: 600;
}

.metric-grid {
    gap: 0;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.metric {
    padding: 18px 22px;
    border: 0;
    border-right: 1px solid var(--line);
    border-radius: 0;
    box-shadow: none;
}

.metric:last-child {
    border-right: 0;
}

.metric::before {
    display: none;
}

.metric span {
    font-weight: 500;
}

.metric strong {
    margin-top: 6px;
    font-size: 28px;
    font-weight: 500;
}

.panel,
.upload-panel {
    padding: 22px;
}

.panel-head {
    margin-bottom: 18px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--line);
}

.panel-head h2 {
    font-size: 20px;
    font-weight: 500;
}

.event-card,
.photo-card,
.admin-shortcut,
.public-event-card,
.public-photo-card {
    border-radius: 4px;
    box-shadow: none;
}

.event-card:hover,
.admin-shortcut:hover,
.public-event-card:hover {
    border-color: #bcc7c5;
    box-shadow: none;
    transform: none;
}

.event-card strong,
.public-event-card-body strong {
    font-weight: 500;
}

.folder-icon {
    width: 48px;
    height: 34px;
    border: 1px solid #cfd6d4;
    border-left: 4px solid var(--yellow);
    border-radius: 3px;
    background: #fff;
    box-shadow: none;
}

.status-badge,
.role-badge,
.metadata-source,
.log-operation {
    border: 1px solid var(--line);
    border-radius: 3px;
    background: #fff;
    font-weight: 600;
}

.status-badge.active,
.role-badge.photographer,
.log-operation {
    border-color: #cbdcde;
    background: #f8fbfb;
}

.status-badge.prepared,
.role-badge.admin,
.metadata-source {
    border-color: #dfd6b9;
    background: #fdfcf7;
}

.status-badge.hidden,
.role-badge.super_admin {
    border-color: #e3cbc8;
    background: #fdf9f8;
}

.role-badge.client {
    border-color: #d5dfd0;
    background: #fafcf9;
}

.event-search,
.public-gallery-search {
    border: 1px solid var(--line);
    border-left: 3px solid var(--cyan);
    border-radius: 3px;
    box-shadow: none;
}

.event-metadata,
.metadata-summary {
    border-radius: 4px;
    box-shadow: none;
}

.keyword-list span,
.assigned-list span,
.fixed-download-size {
    border-color: var(--line);
    border-radius: 3px;
    color: #536164;
    background: #fff;
    font-weight: 500;
}

.event-editor,
.upload-panel {
    border-top: 1px solid var(--line);
}

.upload-panel {
    border-left: 3px solid var(--cyan);
}

.drop-zone {
    min-height: 170px;
    border-color: #c7d2d1;
    border-radius: 3px;
    background: #fbfcfb;
}

.drop-zone span {
    color: #496c72;
    font-size: 18px;
    font-weight: 500;
}

.photo-library,
.personal-events-section,
.personal-photo-section {
    margin-top: 30px;
    padding-top: 26px;
    border-top: 1px solid var(--line);
}

.photo-card {
    border-color: var(--line);
}

.photo-image {
    background: #f1f3f2;
}

.admin-tabs {
    gap: 18px;
}

.admin-tabs a {
    padding: 9px 2px;
    border-radius: 0;
    font-weight: 500;
}

.admin-tabs a:hover,
.admin-tabs a.active {
    background: #fff;
    box-shadow: inset 0 -2px 0 var(--accent);
}

.admin-shortcut {
    border-radius: 4px;
}

th,
td {
    padding: 13px 12px;
}

th {
    border-top: 1px solid var(--line);
    background: #fafbfa;
    font-weight: 600;
}

.flash {
    border: 1px solid var(--line);
    border-radius: 3px;
    font-weight: 500;
}

.flash.success {
    border-color: #cfe0d7;
    background: #f7fbf9;
}

.flash.error {
    border-color: #ead0cd;
    background: #fdf8f7;
}

.iptc-fields-panel {
    background: #fff;
}

.iptc-modal-preview {
    background: var(--soft);
}

.iptc-modal-preview figcaption {
    color: var(--muted);
    border-top-color: var(--line);
    background: #fff;
}

.icon-button {
    border-radius: 4px;
}

.upload-progress {
    border-color: var(--line);
    border-radius: 3px;
    background: #fff;
}

.iptc-modal-row,
.iptc-dialog,
.metadata-preview {
    border-radius: 4px;
    box-shadow: none;
}

.public-gallery-page {
    background: #fff;
}

.public-gallery-header {
    min-height: 78px;
    border-bottom-color: var(--line);
    box-shadow: none;
}

.public-gallery-brand {
    width: min(210px, 44vw);
}

.public-gallery-main {
    padding-top: clamp(26px, 4vw, 48px);
}

.public-gallery-intro h1,
.public-event-head h1 {
    font-size: clamp(32px, 4vw, 46px);
    font-weight: 500;
}

.public-gallery-intro > p,
.public-event-head > div > p:last-child {
    font-size: 15px;
}

.public-event-grid,
.public-photo-grid {
    gap: 18px;
}

.public-event-card:hover {
    transform: none;
}

.public-event-cover,
.public-photo-open {
    background: var(--soft);
    color: var(--muted);
}

.public-photo-dialog {
    border: 1px solid var(--line);
    background: #fff;
    color: var(--ink);
    box-shadow: 0 18px 54px rgba(41, 49, 52, 0.14);
}

.public-photo-dialog::backdrop {
    background: rgba(41, 49, 52, 0.42);
}

.public-photo-dialog figcaption {
    border-top: 1px solid var(--line);
    color: var(--muted);
    background: #fff;
}

.public-photo-close {
    border-color: var(--line);
    background: rgba(255, 255, 255, 0.94);
    color: var(--ink);
}

.public-protection-note {
    border: 1px solid var(--line);
    border-left: 3px solid var(--yellow);
    box-shadow: none;
}

.public-gallery-footer {
    border-top: 1px solid var(--line);
    background: #fff;
    color: var(--muted);
}

.public-gallery-section + .public-gallery-section {
    margin-top: 42px;
}

.public-gallery-section-head {
    margin: 0 0 18px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--line);
}

.public-gallery-section-head h2 {
    margin: 2px 0 0;
    font-size: 22px;
    font-weight: 600;
}

@media (max-width: 980px) {
    .login-screen,
    .shell,
    .split,
    .event-layout {
        grid-template-columns: 1fr;
    }

    .metadata-dashboard {
        grid-template-columns: 1fr;
    }

    .metadata-preview {
        position: static;
    }

    .iptc-dialog-body {
        grid-template-columns: minmax(220px, 0.42fr) minmax(0, 1fr);
    }

    .iptc-modal-row {
        grid-template-columns: 1fr;
    }

    .event-metadata,
    .metadata-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .event-metadata > span:nth-child(2) {
        border-right: 0;
    }

    .event-metadata > span:nth-child(-n + 2) {
        border-bottom: 1px solid var(--line);
    }

    .metadata-summary > span:nth-child(2) {
        border-right: 0;
    }

    .metadata-summary > span:nth-child(-n + 2) {
        border-bottom: 1px solid var(--line);
    }

    .sidebar {
        position: static;
        height: auto;
    }

    .brand img {
        max-width: 190px;
    }

    .nav {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
        margin-top: 20px;
    }

    .account {
        position: static;
        margin-top: 26px;
    }

    .login-visual {
        min-height: 42svh;
        padding: 46px;
    }

    .login-logo-dark {
        width: min(520px, 80%);
    }

    .login-card {
        min-height: 58svh;
        border-width: 1px 0 0;
        box-shadow: none;
    }

    .metric-grid {
        grid-template-columns: 1fr;
    }

    .metric {
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }

    .metric:last-child {
        border-bottom: 0;
    }

    .login-visual {
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }

    .panel-head,
    .panel-actions {
        align-items: flex-start;
    }

    .panel-head {
        flex-direction: column;
    }

    .panel-actions {
        flex-wrap: wrap;
        justify-content: flex-start;
    }

    .public-gallery-intro,
    .public-event-head {
        grid-template-columns: 1fr;
        align-items: start;
        gap: 18px;
    }

    .admin-shortcuts {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .content {
        padding: 18px;
    }

    .login-visual {
        min-height: 30svh;
        padding: 28px;
    }

    .login-logo-dark {
        width: min(390px, 94%);
    }

    .login-card {
        min-height: 70svh;
        padding: 34px 24px;
    }

    .login-logo-light {
        width: min(260px, 88%);
        margin-bottom: 38px;
    }

    .sidebar {
        padding: 22px 18px;
    }

    .nav {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .page-head {
        display: grid;
    }

    .iptc-dialog {
        width: 100vw;
        height: 100vh;
        border-radius: 0;
    }

    .iptc-dialog-head {
        align-items: flex-start;
        padding: 12px;
    }

    .iptc-dialog-head h2 {
        max-width: 52vw;
        font-size: 18px;
    }

    .iptc-dialog-actions .button {
        max-width: 145px;
        min-height: 42px;
        padding: 6px 9px;
        font-size: 12px;
        line-height: 1.2;
        text-align: center;
    }

    .iptc-dialog-body {
        grid-template-columns: 1fr;
        grid-template-rows: minmax(210px, 38vh) minmax(0, 1fr);
        overflow-y: auto;
    }

    .iptc-dialog.photo-mode .iptc-dialog-body {
        grid-template-rows: 1fr;
        overflow: hidden;
    }

    .iptc-fields-panel {
        overflow: visible;
    }

    .event-grid {
        grid-template-columns: 1fr;
    }

    .role-options,
    .photo-grid,
    .form-grid.two-columns,
    .client-grid,
    .event-metadata,
    .metadata-summary,
    .event-search > div,
    .password-reset {
        grid-template-columns: 1fr;
    }

    .iptc-featured-row,
    .featured-metadata article {
        grid-template-columns: 1fr;
    }

    .metadata-copy-panel {
        align-items: stretch;
        flex-direction: column;
    }

    .role-update {
        grid-template-columns: 1fr;
        min-width: 220px;
    }

    .download-rule {
        grid-template-columns: 1fr;
        min-width: 230px;
    }

    .bulk-download-choice {
        grid-template-columns: 1fr;
        width: 100%;
    }

    .category-item-head {
        display: grid;
    }

    .category-item-head > span {
        white-space: normal;
    }

    .event-metadata > span,
    .event-metadata > span:nth-child(2) {
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }

    .event-metadata > span:last-child {
        border-bottom: 0;
    }

    .metadata-summary > span,
    .metadata-summary > span:nth-child(2) {
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }

    .metadata-summary > span:last-child {
        border-bottom: 0;
    }

    .event-status-block {
        justify-items: start;
    }

    .password-reset {
        min-width: 230px;
    }

    .public-gallery-header {
        min-height: 70px;
        padding: 12px 16px;
    }

    .public-gallery-brand {
        width: min(170px, 42vw);
    }

    .public-gallery-nav > a:not(.button) {
        display: none;
    }

    .public-gallery-main {
        padding: 28px 16px 52px;
    }

    .public-gallery-search > div,
    .public-protection-note {
        grid-template-columns: 1fr;
    }

    .public-event-grid,
    .public-photo-grid {
        grid-template-columns: 1fr;
    }

    .public-event-head h1,
    .public-gallery-intro h1 {
        font-size: 36px;
    }

    .public-photo-dialog {
        width: 100vw;
        height: 100vh;
        border-radius: 0;
    }

    .public-gallery-footer {
        display: grid;
        padding: 22px 16px;
    }

    .photographer-metrics,
    .personal-photo-actions {
        grid-template-columns: 1fr;
    }
}

.download-stat-metrics {
    margin-bottom: 20px;
}

.download-chart-panel,
.download-stat-table-panel {
    margin-bottom: 20px;
}

.download-user-chart {
    display: grid;
    gap: 0;
    border-top: 1px solid var(--line);
}

.download-user-bar {
    display: grid;
    grid-template-columns: minmax(160px, 0.35fr) minmax(220px, 1fr) 56px;
    align-items: center;
    gap: 16px;
    min-height: 58px;
    padding: 9px 4px;
    border-bottom: 1px solid var(--line);
}

.download-user-label {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.download-user-label strong,
.download-user-label small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.download-user-label strong {
    font-size: 14px;
    font-weight: 600;
}

.download-user-label small {
    color: var(--muted);
    font-size: 11px;
}

.download-user-bar progress {
    width: 100%;
    height: 16px;
    overflow: hidden;
    border: 0;
    border-radius: 2px;
    background: #edf0ee;
    color: var(--cyan);
}

.download-user-bar progress::-webkit-progress-bar {
    background: #edf0ee;
}

.download-user-bar progress::-webkit-progress-value {
    background: var(--cyan);
}

.download-user-bar progress::-moz-progress-bar {
    background: var(--cyan);
}

.download-user-total {
    color: var(--ink);
    font-size: 18px;
    font-weight: 600;
    text-align: right;
}

.statistics-empty {
    padding: 28px 0 8px;
}

.download-stat-table td {
    font-variant-numeric: tabular-nums;
}

@media (max-width: 680px) {
    .download-user-bar {
        grid-template-columns: minmax(0, 1fr) 42px;
        gap: 8px 12px;
    }

    .download-user-bar progress {
        grid-column: 1 / -1;
        grid-row: 2;
    }

    .download-user-total {
        grid-column: 2;
        grid-row: 1;
    }
}

.client-last-login {
    display: grid;
    gap: 2px;
    margin-bottom: 8px;
    white-space: normal;
}

.client-last-login span {
    color: var(--muted);
    font-size: 11px;
    text-transform: uppercase;
}

.client-last-login strong {
    font-size: 13px;
    font-weight: 600;
}

.client-profile-card {
    width: min(560px, 78vw);
    white-space: normal;
}

.client-profile-card > summary {
    width: fit-content;
    color: var(--accent-dark);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.client-profile-card > form {
    display: grid;
    gap: 11px;
    margin-top: 10px;
    padding: 14px;
    border: 1px solid var(--line);
    background: #fafbfa;
}

.client-profile-card label {
    display: grid;
    gap: 5px;
    margin: 0;
    color: var(--ink);
    font-size: 12px;
    font-weight: 600;
}

.client-profile-card input,
.client-profile-card textarea {
    min-height: 38px;
    padding: 8px 10px;
    font-size: 13px;
}

.client-profile-card textarea {
    min-height: 78px;
    resize: vertical;
}

.client-profile-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

@media (max-width: 640px) {
    .client-profile-card {
        width: min(420px, 80vw);
    }

    .client-profile-grid {
        grid-template-columns: 1fr;
    }
}

/* Keep the photograph fixed while the metadata frame scrolls. */
@media (min-width: 781px) {
    .iptc-dialog {
        width: min(1480px, calc(100vw - 24px));
        height: min(940px, calc(100vh - 24px));
        min-width: min(760px, calc(100vw - 24px));
        min-height: min(520px, calc(100vh - 24px));
        resize: both;
    }

    .iptc-dialog-body {
        grid-template-columns: minmax(430px, 1.35fr) minmax(360px, 0.75fr);
        overflow: hidden;
    }

    .iptc-modal-preview {
        position: relative;
        height: 100%;
        overflow: hidden;
    }

    .iptc-fields-panel {
        overflow: auto;
        scrollbar-gutter: stable both-edges;
    }

    .metadata-dashboard .metadata-preview {
        position: sticky;
        top: 24px;
        align-self: start;
        max-height: calc(100vh - 48px);
    }

    .metadata-dashboard .metadata-panel {
        max-height: calc(100vh - 48px);
        overflow: auto;
        scrollbar-gutter: stable both-edges;
    }
}

.iptc-order-panel {
    max-width: 980px;
}

.iptc-order-list {
    display: grid;
    gap: 0;
    margin: 18px 0 0;
    padding: 0;
    border-top: 1px solid var(--line);
    list-style: none;
}

.iptc-order-item {
    display: grid;
    grid-template-columns: 46px minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px;
    min-height: 58px;
    padding: 8px 10px;
    border-bottom: 1px solid var(--line);
    background: #fff;
}

.iptc-order-position {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border: 1px solid var(--line);
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
}

.iptc-order-name {
    display: grid;
    gap: 3px;
    min-width: 0;
}

.iptc-order-name strong {
    font-size: 14px;
    font-weight: 600;
}

.iptc-order-name small {
    overflow-wrap: anywhere;
    color: var(--muted);
    font-size: 11px;
}

.iptc-order-actions {
    display: flex;
    gap: 6px;
}

.iptc-order-actions form {
    margin: 0;
}

.iptc-order-actions button {
    min-width: 54px;
}

.iptc-order-actions button:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

@media (max-width: 680px) {
    .iptc-order-item {
        grid-template-columns: 38px minmax(0, 1fr);
    }

    .iptc-order-actions {
        grid-column: 2;
    }
}

.user-preview-active {
    padding-top: 64px;
}

.user-preview-bar {
    position: fixed;
    z-index: 1200;
    top: 0;
    right: 0;
    left: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    min-height: 64px;
    padding: 10px 22px;
    border-bottom: 1px solid #c9d7d3;
    background: #eef5f2;
    color: var(--ink);
}

.user-preview-bar > div {
    display: flex;
    align-items: baseline;
    gap: 12px;
    min-width: 0;
}

.user-preview-bar strong {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
}

.user-preview-bar span {
    overflow: hidden;
    color: #52625e;
    font-size: 13px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-preview-bar form {
    flex: 0 0 auto;
    margin: 0;
}

.button.preview-return {
    border-color: #758f87;
    background: #fff;
    color: #354b45;
}

/* Keep the people field visible across the legacy metadata style layers. */
.iptc-fields-panel .iptc-modal-fields .iptc-modal-row.metadata-people-row,
.iptc-fields-panel .iptc-modal-row[data-metadata-field="people"],
.metadata-panel .metadata-simple-row.metadata-people-row {
    background-color: #fff8d8 !important;
    box-shadow: inset 3px 0 0 #e0c86c;
}

.iptc-fields-panel .metadata-people-row .iptc-compact-label,
.metadata-panel .metadata-people-row > strong {
    color: #675817;
}

.button.preview-return:hover {
    border-color: #526d65;
    background: #f8fbfa;
}

.user-preview-active .sidebar {
    top: 64px;
    height: calc(100vh - 64px);
}

.user-preview-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    max-width: 1050px;
}

.user-preview-options .form-panel {
    align-content: start;
}

.user-preview-options .form-panel h2 {
    margin-top: 3px;
}

@media (max-width: 760px) {
    .user-preview-active {
        padding-top: 92px;
    }

    .user-preview-bar {
        min-height: 92px;
        padding: 10px 14px;
    }

    .user-preview-bar > div {
        display: grid;
        gap: 2px;
    }

    .button.preview-return {
        max-width: 170px;
        white-space: normal;
    }

    .user-preview-active .sidebar {
        height: auto;
    }

    .user-preview-options {
        grid-template-columns: 1fr;
    }
}

.client-professional-rule {
    width: min(320px, 72vw);
    white-space: normal;
}

.client-professional-rule > summary {
    width: fit-content;
    color: var(--accent-dark);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.client-professional-rule > form {
    display: grid;
    gap: 10px;
    margin-top: 10px;
    padding: 12px;
    border: 1px solid var(--line);
    background: #fafbfa;
}

.professional-check-list {
    max-height: 220px;
    overflow-y: auto;
    padding-right: 5px;
}

.professional-check-list label {
    align-items: flex-start;
    padding: 5px 0;
    border-bottom: 1px solid var(--line);
    font-size: 13px;
}

.professional-check-list label:last-child {
    border-bottom: 0;
}

.professional-check-list span,
.professional-check-list small {
    display: block;
}

.professional-check-list small {
    margin-top: 2px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 500;
}

.client-professional-rule .field-help {
    display: block;
    font-size: 11px;
}

.user-directory tr.newly-created-user td {
    background: #eef6f1;
}

.user-directory tr.newly-created-user td:first-child {
    box-shadow: inset 3px 0 0 #6f927f;
}

/* Photographic entrance for the reserved area. */
.login-visual {
    position: relative;
    isolation: isolate;
    align-items: flex-start;
    justify-content: flex-start;
    overflow: hidden;
    border: 0;
    background:
        linear-gradient(135deg, rgba(10, 15, 17, 0.38), rgba(10, 15, 17, 0.14) 46%, rgba(10, 15, 17, 0.62)),
        url("images/rfgpress-login-photo.jpg") center center / cover no-repeat;
}

.login-visual::after {
    position: absolute;
    z-index: -1;
    inset: 0;
    border-right: 1px solid rgba(255, 255, 255, 0.18);
    background: linear-gradient(180deg, rgba(3, 8, 10, 0.08), rgba(3, 8, 10, 0.32));
    content: "";
    pointer-events: none;
}

.login-logo-dark {
    position: relative;
    z-index: 1;
    width: min(520px, 62%);
    filter: drop-shadow(0 8px 22px rgba(0, 0, 0, 0.46));
}

@media (max-width: 980px) {
    .login-visual {
        background-position: center 58%;
    }

    .login-logo-dark {
        width: min(430px, 62%);
    }
}

@media (max-width: 640px) {
    .login-visual {
        min-height: 36svh;
        padding: 24px;
        background-position: center 54%;
    }

    .login-logo-dark {
        width: min(300px, 72%);
    }

    .login-card {
        min-height: 64svh;
    }
}

/* Bulk people metadata editor. */
.photo-card {
    position: relative;
}

.photo-card.is-bulk-selected {
    border-color: #c7ad48;
    box-shadow: inset 0 0 0 2px #f0dda0;
}

.photo-bulk-selector {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 32px;
    padding: 5px 8px;
    border: 1px solid rgba(41, 49, 52, 0.22);
    border-radius: 4px;
    background: #fff;
    color: var(--ink);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

.photo-bulk-selector:has(input:checked) {
    border-color: #c7ad48;
    background: #fff8d8;
}

.photo-bulk-selector input {
    width: 17px;
    height: 17px;
    margin: 0;
    accent-color: #9b8430;
}

.photo-management-row {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 0;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.photo-record-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.photo-record-actions form {
    margin: 0;
}

.photo-record-actions .icon-button {
    display: inline-grid;
    width: 34px;
    height: 34px;
    min-height: 34px;
    padding: 7px;
    place-items: center;
}

.photo-record-actions .icon-button svg {
    display: block;
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

.photo-delete-button {
    color: #98463f;
}

.photo-move-control {
    position: relative;
}

.photo-card:has(.photo-move-control[open]) {
    z-index: 10;
    overflow: visible;
}

.photo-move-control summary {
    list-style: none;
}

.photo-move-control summary::-webkit-details-marker {
    display: none;
}

.photo-move-control form {
    position: absolute;
    z-index: 8;
    top: calc(100% + 7px);
    right: 0;
    display: grid;
    gap: 9px;
    width: 210px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 4px;
    background: #fff;
    box-shadow: 0 12px 30px rgba(41, 49, 52, 0.16);
}

.photo-move-control form label {
    gap: 5px;
    font-size: 11px;
}

.photo-move-control form select {
    width: 100%;
    min-height: 38px;
    font-size: 12px;
}

.bulk-people-panel {
    margin: 0 0 24px;
    padding: 0 0 24px;
    border-bottom: 1px solid var(--line);
}

.event-sidebar-metadata {
    margin: 0 0 24px;
    padding: 0 0 24px;
    border-bottom: 1px solid var(--line);
}

.sidebar-scope-panel {
    position: relative;
    padding: 14px;
    border: 1px solid var(--line);
    border-left-width: 4px;
    border-radius: 4px;
}

.sidebar-scope-panel.future-upload-scope {
    border-left-color: #315f67;
    background: #f5f9f9;
}

.sidebar-scope-panel.uploaded-photos-scope {
    border-left-color: #c5a94f;
    background: #fffbed;
}

.refinement-event-picker {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: 14px;
    margin-bottom: 18px;
}

.refinement-event-picker label {
    margin: 0;
}

.refinement-workspace {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(310px, 380px);
    align-items: start;
    gap: 18px;
}

.refinement-gallery {
    min-width: 0;
}

.refinement-selection-tools {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 8px;
}

.refinement-selection-tools > span {
    margin-right: 4px;
    color: var(--muted);
    font-size: 13px;
}

.refinement-selection-tools > span strong {
    color: var(--ink);
}

.refinement-photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 10px;
}

.refinement-photo-card {
    position: relative;
    display: grid;
    grid-template-rows: 160px minmax(112px, 1fr);
    min-width: 0;
    height: 286px;
    margin: 0;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 5px;
    background: #fff;
    cursor: pointer;
    transition: border-color 150ms ease, box-shadow 150ms ease;
}

.refinement-photo-card:hover {
    border-color: #8aa1a4;
}

.refinement-photo-card.is-selected {
    border-color: #315f67;
    box-shadow: 0 0 0 2px rgba(49, 95, 103, 0.14);
}

.refinement-photo-card > input {
    position: absolute;
    z-index: 3;
    top: 10px;
    left: 10px;
    width: 20px;
    height: 20px;
    margin: 0;
    opacity: 0;
}

.refinement-photo-check {
    position: absolute;
    z-index: 2;
    top: 9px;
    left: 9px;
    display: grid;
    width: 24px;
    height: 24px;
    place-items: center;
    border: 1px solid rgba(49, 63, 66, 0.35);
    border-radius: 3px;
    color: transparent;
    background: rgba(255, 255, 255, 0.94);
    font-size: 15px;
    font-weight: 800;
}

.refinement-photo-card.is-selected .refinement-photo-check {
    border-color: #315f67;
    color: #fff;
    background: #315f67;
}

.refinement-photo-card > img {
    display: block;
    width: 100%;
    height: 160px;
    object-fit: contain;
    background: #f2f4f3;
}

.refinement-photo-info {
    display: grid;
    align-content: start;
    gap: 5px;
    min-width: 0;
    padding: 10px;
    color: var(--ink);
}

.refinement-photo-info strong,
.refinement-photo-info small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.refinement-photo-info strong {
    font-size: 12px;
}

.refinement-photo-info small {
    color: var(--muted);
    font-size: 11px;
}

.refinement-lock-summary {
    min-height: 18px;
    color: #315f67;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0;
}

.refinement-editor {
    position: sticky;
    top: 18px;
    max-height: calc(100vh - 36px);
    overflow-y: auto;
    scrollbar-gutter: stable;
}

.refinement-editor form {
    display: grid;
    gap: 13px;
}

.refinement-editor h2 {
    margin: 0;
}

.refinement-editor-note {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
}

.refinement-field {
    display: grid;
    gap: 7px;
    margin: 0;
    padding: 10px;
    border: 1px solid var(--line);
    border-left: 3px solid #c9d0d0;
    border-radius: 4px;
    background: #fafbfa;
}

.refinement-field.is-enabled {
    border-left-color: #315f67;
    background: #f5f9f9;
}

.refinement-field > span {
    color: var(--ink);
    font-size: 12px;
    font-weight: 750;
}

.refinement-field > span input {
    width: 16px;
    height: 16px;
    margin: 0 6px 0 0;
    vertical-align: -3px;
}

.refinement-field textarea,
.refinement-field > input {
    width: 100%;
    margin: 0;
}

.refinement-field textarea:disabled,
.refinement-field > input:disabled {
    color: #778082;
    background: #f0f2f1;
    opacity: 0.75;
}

.refinement-locks {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
    margin: 2px 0 0;
    padding: 12px;
    border: 1px solid var(--line);
}

.refinement-locks legend {
    padding: 0 5px;
    color: var(--ink);
    font-size: 12px;
    font-weight: 750;
}

.refinement-locks label {
    margin: 0;
    font-size: 11px;
}

.refinement-locks select {
    min-height: 36px;
    padding: 6px;
    font-size: 11px;
}

@media (max-width: 980px) {
    .refinement-workspace {
        grid-template-columns: 1fr;
    }

    .refinement-editor {
        position: static;
        max-height: none;
    }
}

@media (max-width: 640px) {
    .refinement-event-picker {
        grid-template-columns: 1fr;
    }

    .refinement-gallery .panel-head,
    .refinement-selection-tools {
        align-items: stretch;
    }

    .refinement-selection-tools {
        justify-content: flex-start;
    }

    .refinement-photo-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .refinement-photo-card {
        grid-template-rows: 130px minmax(112px, 1fr);
        height: 256px;
    }

    .refinement-photo-card > img {
        height: 130px;
    }

    .refinement-locks {
        grid-template-columns: 1fr;
    }
}

.sidebar-scope-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin: -2px 0 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--line);
}

.sidebar-scope-label strong {
    color: var(--ink);
    font-size: 12px;
}

.sidebar-scope-label span {
    color: var(--muted);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
}

.event-sidebar-metadata h2 {
    margin: 3px 0 8px;
}

.event-sidebar-metadata > p:not(.eyebrow) {
    margin: 0 0 16px;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.5;
}

.event-sidebar-metadata form,
.event-sidebar-metadata form > label {
    display: grid;
    gap: 9px;
}

.event-sidebar-metadata form {
    gap: 18px;
}

.event-sidebar-metadata textarea {
    width: 100%;
    resize: vertical;
}

.event-sidebar-metadata .button {
    width: 100%;
}

.event-preparation {
    margin-bottom: 18px;
    border-left: 4px solid #315f67;
}

.event-preparation > summary {
    font-size: 15px;
    font-weight: 700;
}

.workflow-note {
    display: grid;
    gap: 4px;
    padding: 12px 0;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.workflow-note span {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.45;
}

.rapid-upload-panel {
    gap: 12px;
    margin-bottom: 20px;
    padding: 18px;
    border-left: 4px solid #c5a94f;
}

.rapid-upload-panel h2 {
    margin-bottom: 4px;
}

.rapid-upload-panel > div:first-of-type p:last-child {
    margin-bottom: 0;
    font-size: 13px;
}

.bulk-people-panel h2 {
    margin: 3px 0 8px;
}

.bulk-people-panel > p:not(.eyebrow) {
    margin: 0 0 16px;
    color: var(--muted);
    font-size: 13px;
}

.bulk-people-panel form {
    display: grid;
    gap: 12px;
}

.bulk-people-panel textarea {
    min-height: 112px;
    resize: vertical;
}

.bulk-people-panel form > small {
    margin-top: -6px;
    color: var(--muted);
    font-size: 11px;
}

.bulk-selection-status {
    display: flex;
    align-items: baseline;
    gap: 6px;
    padding: 10px 0;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.bulk-selection-status strong {
    color: #806d25;
    font-size: 22px;
}

.bulk-selection-status span {
    color: var(--muted);
    font-size: 12px;
}

.bulk-selection-tools {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.bulk-selection-tools .button {
    width: 100%;
    padding-inline: 8px;
}

.event-iptc-editor {
    display: grid;
    gap: 16px;
    margin: 0 0 22px;
    border-left: 3px solid #d8c36f;
}

.event-iptc-editor .panel-head {
    margin-bottom: 0;
}

.event-iptc-editor > label {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: 8px 10px;
}

.event-iptc-editor > label textarea {
    grid-column: 1 / -1;
    min-height: 78px;
    resize: vertical;
}

.event-iptc-editor > label .button {
    grid-column: 2;
    min-width: 150px;
}

.event-iptc-editor > small {
    color: var(--muted);
}

.photo-caption-text {
    display: grid;
    gap: 3px;
    margin: 2px 0;
    padding: 9px 10px;
    border-left: 3px solid #d8c36f;
    background: #fffbed;
    color: var(--ink);
    font-size: 12px;
    line-height: 1.45;
}

.photo-caption-text small {
    color: #806d25 !important;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
}

.photo-caption-text span {
    color: var(--ink) !important;
}

.client-download-panel {
    display: grid;
    grid-template-columns: minmax(190px, 1fr) auto minmax(280px, auto);
    align-items: end;
    gap: 16px;
    margin: 0 0 18px;
    padding: 14px 0;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.client-download-panel > div:first-child {
    display: grid;
    gap: 3px;
}

.client-download-panel small {
    color: var(--muted);
}

.client-download-selection-tools {
    display: flex;
    gap: 7px;
}

.photo-download-selector {
    display: flex !important;
    align-items: center;
    gap: 8px;
    padding: 9px 10px;
    border: 1px solid #c9dcdf;
    border-radius: 4px;
    background: #f5f9f9;
    cursor: pointer;
}

.photo-download-selector input {
    width: 18px;
    height: 18px;
    margin: 0;
}

.photo-download-selector span {
    color: #315f67 !important;
    font-size: 12px;
    font-weight: 700;
}

.photo-card.is-download-selected {
    border-color: #9dbfc3;
}

@media (max-width: 1250px) {
    .client-download-panel {
        grid-template-columns: 1fr;
        align-items: stretch;
    }

    .client-download-selection-tools {
        flex-wrap: wrap;
    }

    .client-zip-form {
        max-width: 460px;
    }
}

.photo-headline-text {
    display: grid;
    gap: 3px;
    margin: 2px 0;
    color: var(--ink);
    font-size: 12px;
    line-height: 1.45;
}

.photo-headline-text small {
    color: var(--muted);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
}

.photo-people-editor code {
    color: #806d25;
    font-weight: 700;
}

.caption-lock-control {
    display: flex !important;
    align-items: center;
    gap: 8px;
    padding: 9px;
    border: 1px solid var(--line);
    border-radius: 4px;
    background: #fafbfa;
}

.caption-lock-control input {
    width: 17px;
    height: 17px;
    margin: 0;
}

.caption-lock-control span {
    color: var(--ink) !important;
    font-size: 12px;
    font-weight: 600;
}

.photo-lock-controls {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
}

.photo-library .photo-grid {
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 500px), 1fr));
    gap: 18px;
}

.photo-library .photo-card {
    display: grid;
    grid-template-columns: minmax(190px, 0.72fr) minmax(280px, 1.28fr);
    align-items: stretch;
    height: 620px;
}

.photo-library .photo-image {
    min-height: 0;
    height: 100%;
    aspect-ratio: auto;
    background: #f3f5f4;
}

.photo-library .photo-image img {
    object-fit: contain;
}

.photo-library .photo-image:hover img,
.public-photo-open:hover img {
    transform: none;
}

.photo-library .photo-card figcaption {
    align-content: start;
    min-height: 0;
    max-height: 620px;
    overflow-x: hidden;
    overflow-y: auto;
    scrollbar-gutter: stable;
}

.photo-sort-control {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
}

.photo-sort-control select {
    width: 100%;
}

.gallery-view-switch {
    display: inline-flex;
    padding: 3px;
    border: 1px solid var(--line);
    border-radius: 4px;
    background: #f5f7f6;
}

.gallery-view-switch a {
    padding: 6px 10px;
    border-radius: 3px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.gallery-view-switch a.active {
    color: var(--ink);
    background: #fff;
    box-shadow: 0 1px 3px rgba(41, 49, 52, 0.12);
}

.photo-library .panel-actions {
    flex-wrap: wrap;
}

@media (max-width: 640px) {
    .event-iptc-editor > label {
        grid-template-columns: 1fr;
    }

    .event-iptc-editor > label .button {
        grid-column: 1;
        width: 100%;
    }

    .photo-library .photo-card {
        grid-template-columns: 1fr;
        grid-template-rows: 300px minmax(0, 1fr);
        height: 820px;
    }

    .photo-library .photo-image {
        min-height: 0;
        height: 300px;
        aspect-ratio: auto;
    }

    .photo-library .photo-card figcaption {
        max-height: 520px;
        overflow-x: hidden;
        overflow-y: auto;
    }

    .public-photo-card {
        height: 460px;
    }

    .photo-lock-controls {
        grid-template-columns: 1fr;
    }

    .client-download-panel {
        grid-template-columns: 1fr;
        align-items: stretch;
    }

    .client-download-selection-tools,
    .client-zip-form {
        width: 100%;
    }
}

.photo-library.is-grid-view .photo-grid {
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 10px;
}

.photo-library.is-grid-view .photo-card {
    display: block;
    height: 220px;
    overflow: hidden;
}

.photo-library.is-grid-view .photo-image {
    width: 100%;
    height: 100%;
}

.photo-library.is-grid-view .photo-card figcaption {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    max-height: none;
    padding: 0;
    overflow: visible;
    pointer-events: none;
}

.photo-library.is-grid-view .photo-card figcaption > * {
    display: none !important;
}

.photo-library.is-grid-view .photo-card figcaption > .photo-download-selector,
.photo-library.is-grid-view .photo-card figcaption > .photo-management-row {
    position: absolute;
    z-index: 3;
    top: 9px;
    left: 9px;
    display: flex !important;
    width: auto;
    min-height: 0;
    margin: 0;
    padding: 5px;
    border: 1px solid rgba(41, 49, 52, 0.28);
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 2px 8px rgba(41, 49, 52, 0.16);
    pointer-events: auto;
}

.photo-library.is-grid-view .photo-management-row .photo-record-actions,
.photo-library.is-grid-view .photo-bulk-selector span,
.photo-library.is-grid-view .photo-download-selector span {
    display: none !important;
}

.photo-library.is-grid-view .photo-bulk-selector,
.photo-library.is-grid-view .photo-download-selector {
    min-height: 0;
    padding: 0;
    border: 0;
    background: transparent;
}

.photo-library.is-grid-view .photo-bulk-selector input,
.photo-library.is-grid-view .photo-download-selector input {
    width: 20px;
    height: 20px;
}

@media (max-width: 640px) {
    .photo-sort-control {
        grid-template-columns: 1fr;
    }

    .panel-actions {
        flex-wrap: wrap;
    }

    .photo-library.is-grid-view .photo-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .photo-library.is-grid-view .photo-card {
        height: 190px;
    }
}
