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

body {
    font-family: "Segoe UI", Arial, sans-serif;
    margin: 0;
    color: #1f2933;
    background: #f4f7f8;
    line-height: 1.5;
}

a {
    color: #124c7c;
}

.button,
button {
    display: inline-block;
    text-decoration: none;
}

.site-header,
.site-footer {
    padding: 1rem 2rem;
    border-bottom: 1px solid #d8dee4;
}

.site-footer {
    border-top: 1px solid #d8dee4;
    border-bottom: 0;
}

.brand {
    display: inline-block;
    margin-right: 2rem;
    font-weight: 700;
    text-decoration: none;
    color: #17212b;
}

.main-nav,
.client-nav {
    display: inline-flex;
    flex-wrap: wrap;
    gap: .75rem;
}

.main-nav a,
.client-nav a {
    text-decoration: none;
}

.main-nav a:hover,
.client-nav a:hover {
    text-decoration: underline;
}

.site-main {
    padding: 2rem;
    max-width: 70rem;
}

.client-login-body {
    min-height: 100vh;
    margin: 0;
    background:
        radial-gradient(circle at top, rgba(29, 78, 111, .28), transparent 28rem),
        linear-gradient(180deg, #081018 0%, #05090d 100%);
    color: #eaf2f5;
}

.client-login-shell {
    display: grid;
    place-items: center;
    min-height: 100vh;
    padding: 2rem;
}

.client-login-card {
    position: relative;
    overflow: hidden;
    width: min(100%, 28rem);
    padding: 1.35rem;
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: .75rem;
    background:
        linear-gradient(135deg, rgba(95, 225, 238, .055), transparent 42%),
        rgba(10, 14, 18, .93);
    box-shadow: 0 1.4rem 3.2rem rgba(0, 0, 0, .34);
}

.client-login-card::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 2px;
    background: linear-gradient(180deg, transparent, rgba(95, 225, 238, .72), transparent);
    pointer-events: none;
}

.client-login-brand {
    display: flex;
    align-items: center;
    gap: .8rem;
    margin-bottom: 1.15rem;
}

.client-login-brand span {
    display: inline-grid;
    place-items: center;
    inline-size: 2.65rem;
    block-size: 2.65rem;
    border-radius: .7rem;
    background: #5fe1ee;
    color: #061014;
    font-weight: 900;
}

.client-login-brand h1 {
    margin: 0;
    color: #ffffff;
    font-size: clamp(1.45rem, 2vw, 1.8rem);
    line-height: 1.12;
}

.client-login-error {
    margin: 1rem 0 0;
    padding: .75rem .9rem;
    border: 1px solid rgba(245, 196, 196, .32);
    border-radius: .55rem;
    background: rgba(245, 196, 196, .08);
    color: #f5c4c4;
}

.client-login-form {
    display: grid;
    gap: .62rem;
    margin-top: .9rem;
}

.client-login-form label {
    color: #d9eef4;
    font-weight: 700;
}

.client-login-form input {
    min-height: 2.9rem;
    padding: .75rem .9rem;
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: .55rem;
    background: rgba(255, 255, 255, .04);
    color: #ffffff;
}

.client-login-form input:focus-visible {
    outline: 2px solid #5fe1ee;
    outline-offset: 2px;
}

.client-login-submit {
    min-height: 2.9rem;
    margin-top: .35rem;
    border: 1px solid rgba(95, 225, 238, .55);
    border-radius: .55rem;
    background: #5fe1ee;
    color: #061014;
    font-weight: 900;
}

.client-login-submit:hover,
.client-login-submit:focus-visible {
    background: #7aeaf2;
}

.client-login-back {
    display: inline-flex;
    margin-top: 1rem;
    color: #b8c7ce;
    text-decoration: none;
}

.client-login-back:hover,
.client-login-back:focus-visible {
    color: #ffffff;
    text-decoration: underline;
}

.client-shell {
    display: grid;
    grid-template-columns: 17.5rem minmax(0, 1fr);
    min-height: 100vh;
    background: #f4f7f8;
}

.client-sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    min-width: 0;
    padding: 1.1rem;
    border-right: 1px solid #d9e2e8;
    background: #f8fbfb;
    box-shadow: 1px 0 0 rgba(15, 23, 42, .02);
}

.client-sidebar-toggle {
    position: absolute;
    inline-size: 1px;
    block-size: 1px;
    opacity: 0;
    pointer-events: none;
}

.client-brand {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    column-gap: .82rem;
    row-gap: .45rem;
    padding: .35rem .25rem .9rem;
    border-bottom: 1px solid #e4ebef;
}

.client-brand-mark {
    display: inline-grid;
    place-items: center;
    inline-size: 2.45rem;
    block-size: 2.45rem;
    border-radius: .85rem;
    background: #123c55;
    color: #ffffff;
    font-weight: 800;
    letter-spacing: .04em;
}

.client-brand strong,
.client-brand span {
    display: block;
}

.client-brand-main {
    display: grid;
    gap: .42rem;
    min-width: 0;
}

.client-brand strong {
    color: #17212b;
    font-size: .98rem;
    line-height: 1.15;
}

.client-brand-identity > span {
    margin-top: .15rem;
    color: #697886;
    font-size: .82rem;
}

.client-sidebar-account {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .65rem;
    padding-top: .42rem;
    border-top: 1px solid #e8eef2;
    color: #52616f;
    font-size: .84rem;
}

.client-sidebar-account > span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 650;
}

.client-sidebar-account form {
    margin: 0;
}

.client-sidebar-account button {
    min-height: 0;
    padding: .16rem .52rem;
    border-color: #cbd7de;
    border-radius: 999px;
    background: #ffffff;
    color: #31576b;
    font-family: inherit;
    font-size: .84rem;
    font-weight: 650;
    line-height: 1.25;
}

.client-nav {
    display: grid;
    gap: .28rem;
    margin: 1rem 0;
}

.client-nav a {
    display: flex;
    align-items: center;
    gap: .7rem;
    min-height: 2.45rem;
    padding: .55rem .7rem;
    border: 1px solid transparent;
    border-radius: .75rem;
    color: #334150;
    font-weight: 650;
    text-decoration: none;
}

.client-nav-icon {
    display: inline-grid;
    place-items: center;
    flex: 0 0 1.55rem;
    inline-size: 1.55rem;
    block-size: 1.55rem;
    border-radius: .55rem;
    background: #edf3f4;
    color: #31576b;
    font-size: .76rem;
    font-weight: 800;
}

.client-nav-label {
    flex: 1 1 auto;
    min-width: 0;
}

.client-nav-badge {
    min-width: 1.45rem;
    padding: .08rem .45rem;
    border-radius: 999px;
    background: #9f1239;
    color: #ffffff;
    font-size: .75rem;
    font-weight: 800;
    line-height: 1.25;
    text-align: center;
}

.client-nav a:hover,
.client-nav a:focus-visible {
    border-color: #d1e0e6;
    background: #ffffff;
    text-decoration: none;
}

.client-nav a.is-active {
    border-color: #b8d7df;
    background: #eaf5f6;
    color: #123c55;
    box-shadow: inset 3px 0 0 #1e6c83;
}

.client-nav a.is-active .client-nav-icon {
    background: #123c55;
    color: #ffffff;
}

.client-nav-external {
    margin-top: .4rem;
}

.client-workspace {
    min-width: 0;
    display: grid;
    grid-template-rows: auto 1fr;
}

.client-topbar {
    display: none;
    position: sticky;
    top: 0;
    z-index: 5;
    align-items: center;
    justify-content: flex-start;
    gap: 1rem;
    min-width: 0;
    padding: .85rem 1.35rem;
    border-bottom: 1px solid #d9e2e8;
    background: rgba(255, 255, 255, .92);
    backdrop-filter: blur(10px);
}

.client-menu-button {
    display: none;
    padding: .45rem .7rem;
    border: 1px solid #c9d5dc;
    border-radius: .65rem;
    background: #ffffff;
    color: #243746;
    font-weight: 700;
    cursor: pointer;
}

.client-breadcrumb {
    display: flex;
    align-items: center;
    min-width: 0;
    gap: .45rem;
    color: #697886;
    font-size: .9rem;
}

.client-breadcrumb a {
    color: #31576b;
    font-weight: 700;
    text-decoration: none;
}

.client-breadcrumb span:last-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.client-userbox {
    display: flex;
    align-items: center;
    gap: .75rem;
}

.client-userbox a {
    color: #243746;
    font-weight: 700;
    text-decoration: none;
}

.client-userbox form {
    margin: 0;
}

.client-content {
    min-width: 0;
    padding: 2rem;
}

.client-shell-dashboard .client-content {
    padding-top: 1.25rem;
}

h1 {
    margin-top: 0;
}

.form {
    display: grid;
    gap: .75rem;
    max-width: 24rem;
}

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

input,
select,
textarea {
    padding: .55rem .65rem;
    border: 1px solid #b7c0ca;
    border-radius: .45rem;
    background: #ffffff;
}

textarea {
    min-height: 8rem;
    resize: vertical;
}

button {
    padding: .55rem .85rem;
    border: 1px solid #124c7c;
    border-radius: .5rem;
    background: #124c7c;
    color: #ffffff;
    cursor: pointer;
}

button:hover {
    background: #0d3a5f;
}

.button {
    padding: .55rem .85rem;
    border: 1px solid #124c7c;
    border-radius: .5rem;
    background: #124c7c;
    color: #ffffff;
}

.button:hover {
    background: #0d3a5f;
    text-decoration: none;
}

.button.secondary,
button.secondary {
    border-color: #b7c0ca;
    background: #ffffff;
    color: #1f2933;
}

.button.secondary:hover,
button.secondary:hover {
    background: #eef2f6;
}

.button:focus-visible,
button:focus-visible,
a:focus-visible,
select:focus-visible,
input:focus-visible,
textarea:focus-visible {
    outline: 3px solid #8ab8dc;
    outline-offset: 2px;
}

.button.danger,
button.danger {
    border-color: #9f1239;
    background: #9f1239;
    color: #ffffff;
}

.button.danger:hover,
button.danger:hover {
    background: #7f0f2f;
    text-decoration: none;
}

.error {
    color: #9f1239;
    font-weight: 700;
}

.notice {
    border-radius: .55rem;
    padding: .75rem 1rem;
    background: #eef8f0;
    border: 1px solid #b8dfc0;
}

.validation-summary,
.field-validation {
    color: #9f1239;
    font-weight: 700;
}

.validation-summary {
    grid-column: 1 / -1;
}

.empty-state {
    border-radius: .75rem;
    padding: 1rem;
    background: #f6f8fa;
    border: 1px solid #d8dee4;
}

.page-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e2e8ee;
}

.page-heading h1 {
    margin: 0;
    color: #17212b;
    font-size: clamp(1.55rem, 1.15rem + 1vw, 2.05rem);
    letter-spacing: -.025em;
}

.page-heading p {
    margin: .25rem 0 0;
    overflow-wrap: anywhere;
}

.toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: end;
    gap: 1rem;
    margin-bottom: 1rem;
    padding: .85rem;
    border: 1px solid #dce5ea;
    border-radius: .75rem;
    background: #ffffff;
}

.toolbar label,
.wide-form label {
    display: grid;
    gap: .35rem;
}

.table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: #ffffff;
}

th,
td {
    padding: .35rem;
    border-bottom: 1px solid #d8dee4;
    text-align: left;
    vertical-align: top;
}

th {
    color: #52616f;
    font-size: .78rem;
    letter-spacing: .035em;
    text-transform: uppercase;
    background: #f7fafb;
}

tbody tr:hover {
    background: #f9fcfd;
}

td span {
    display: block;
    margin-top: .25rem;
    color: #52616f;
}

.actions,
.form-actions,
.pagination {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem;
}

.actions form {
    margin: 0;
}

.pagination {
    margin-top: 1rem;
}

.client-settings-shell {
    display: grid;
    grid-template-columns: minmax(10rem, 12rem) minmax(0, 1fr);
    gap: 1.1rem;
    align-items: start;
}

.client-settings-nav {
    align-self: start;
    display: grid;
    gap: .15rem;
    padding: .45rem;
    border: 1px solid #dce5ea;
    border-radius: .5rem;
    background: #ffffff;
}

.client-settings-nav a {
    padding: .5rem .65rem;
    border-radius: .4rem;
    color: #425466;
    font-size: .9rem;
    font-weight: 700;
    text-decoration: none;
}

.client-settings-nav a:hover,
.client-settings-nav a:focus-visible {
    background: #eef6f8;
    color: #164e63;
}

.client-settings-content {
    display: grid;
    gap: .8rem;
    min-width: 0;
    scroll-padding-top: 0;
    scroll-behavior: smooth;
    scrollbar-gutter: stable;
}

.client-settings-section {
    display: grid;
    gap: .75rem;
    scroll-margin-top: 1rem;
    padding: 1rem;
    border: 1px solid #dce5ea;
    border-radius: .5rem;
    background: #ffffff;
}

.client-settings-section-header {
    display: grid;
    gap: .25rem;
    padding-bottom: .65rem;
    border-bottom: 1px solid #e8eef2;
}

.client-settings-section-header h2,
.client-settings-group h3 {
    margin: 0;
    color: #17212b;
}

.client-settings-section-header h2 {
    font-size: 1.25rem;
}

.client-settings-section-header p,
.client-settings-note {
    margin: 0;
    color: #617181;
}

.client-settings-group {
    display: grid;
    gap: .65rem;
    padding-top: .1rem;
}

.client-settings-group + .client-settings-group {
    padding-top: .75rem;
    border-top: 1px solid #edf2f5;
}

.client-settings-group h3 {
    font-size: 1rem;
}

.client-data-list,
.client-settings-list,
.photo-card-meta {
    display: grid;
    gap: .35rem;
    margin: 0;
}

.client-data-list > div,
.client-settings-list > div,
.photo-card-meta > div {
    display: grid;
    grid-template-columns: minmax(8rem, 34%) minmax(0, 1fr);
    gap: .5rem 1rem;
    align-items: center;
    min-width: 0;
}

.client-data-list dt,
.client-settings-list dt,
.photo-card-meta dt {
    color: #697886;
    font-size: .76rem;
    font-weight: 800;
    letter-spacing: .035em;
    text-transform: uppercase;
}

.client-data-list dd,
.client-settings-list dd,
.photo-card-meta dd {
    margin: 0;
    overflow-wrap: anywhere;
    color: #243746;
}

.client-settings-status {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    min-height: 1.5rem;
    padding: .18rem .5rem;
    border-radius: 999px;
    border: 1px solid #dce5ea;
    background: #f8fafb;
    color: #425466;
    font-size: .82rem;
    font-weight: 800;
}

.client-settings-status.is-active {
    border-color: #b8e2d1;
    background: #ecfdf6;
    color: #17624a;
}

.client-settings-status.is-neutral {
    border-color: #d7e6ed;
    background: #f2f8fa;
    color: #164e63;
}

.client-settings-status.is-muted {
    border-color: #dce5ea;
    background: #f5f7f8;
    color: #6b7a88;
}

.watermark-summary {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: .8rem;
    align-items: start;
    padding: .35rem 0 .2rem;
}

.watermark-summary-list {
    align-self: center;
}

.watermark-summary-list dd {
    display: flex;
    flex-wrap: wrap;
    gap: .45rem;
    align-items: center;
}

.watermark-preview {
    display: inline-grid;
    place-items: center;
    width: fit-content;
    max-width: 100%;
    padding: .5rem;
    border: 1px solid #dce5ea;
    border-radius: .5rem;
    background-color: #f8fafb;
    background-image:
        linear-gradient(45deg, #dfe8ee 25%, transparent 25%),
        linear-gradient(-45deg, #dfe8ee 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #dfe8ee 75%),
        linear-gradient(-45deg, transparent 75%, #dfe8ee 75%);
    background-position: 0 0, 0 .5rem, .5rem -.5rem, -.5rem 0;
    background-size: 1rem 1rem;
}

.watermark-preview img {
    display: block;
    max-width: 10rem;
    max-height: 5rem;
    object-fit: contain;
}

.client-settings-empty {
    padding: .75rem;
    border: 1px dashed #cdd8df;
    border-radius: .45rem;
    color: #697886;
    background: #fbfcfd;
}

.client-settings-form {
    display: grid;
    gap: .55rem;
    max-width: 52rem;
}

.client-settings-inline-form {
    display: flex;
    flex-wrap: wrap;
    gap: .55rem .7rem;
    align-items: center;
    max-width: 100%;
}

.client-settings-inline-form label {
    min-width: 10rem;
    margin: 0;
    color: #52616f;
    font-size: .82rem;
    font-weight: 800;
}

.client-compact-select,
.client-compact-input,
.client-compact-file {
    width: min(100%, 24rem);
    min-width: 12rem;
    max-width: 24rem;
}

.client-compact-select,
.client-compact-input {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (max-width: 760px) {
    .client-settings-shell {
        grid-template-columns: 1fr;
    }

    .client-settings-nav {
        position: sticky;
        top: 3.75rem;
        z-index: 4;
        display: flex;
        overflow-x: auto;
    }

    .client-settings-nav a {
        white-space: nowrap;
    }

    .client-settings-inline-form {
        display: grid;
        grid-template-columns: 1fr;
    }

    .client-settings-inline-form label,
    .client-compact-select,
    .client-compact-input,
    .client-compact-file {
        width: 100%;
        max-width: none;
    }

    .watermark-summary {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 761px) {
    .client-settings-shell {
        height: calc(100vh - 7.5rem);
        min-height: 32rem;
    }

    .client-settings-nav {
        position: static;
    }

    .client-settings-content {
        max-height: 100%;
        overflow-y: scroll;
        padding-right: .25rem;
    }

    .client-settings-section {
        scroll-margin-top: 0;
    }
}

.photo-toolbar {
    align-items: end;
}

.photo-view-switch {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    align-items: center;
}

.photo-view-option {
    border: 1px solid #dce5ea;
    border-radius: 999px;
    padding: .55rem .9rem;
    text-decoration: none;
    color: inherit;
    background: #ffffff;
}

.photo-view-option.is-active {
    background: #1f6feb;
    color: #ffffff;
    border-color: #1f6feb;
}

.photo-list-view,
.photo-text-view {
    display: grid;
    gap: .9rem;
}

.photo-order-bar {
    display: flex;
    flex-wrap: wrap;
    gap: .75rem 1rem;
    align-items: center;
    margin: 1rem 0;
}

.photo-bulk-toolbar {
    position: sticky;
    top: 1rem;
    z-index: 12;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: .85rem 1rem;
    margin-bottom: 1rem;
}

.photo-bulk-toolbar-main,
.photo-bulk-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .75rem;
}

.photo-select-all,
.photo-select-inline,
.photo-select-card {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    font-size: .92rem;
    font-weight: 700;
    color: #27485a;
}

.photo-select-inline span,
.photo-select-card span {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.photo-bulk-count {
    font-size: .92rem;
    color: #36566a;
    font-weight: 700;
}

.photo-order-message {
    color: #5f6f7d;
    font-size: .95rem;
}

.photo-order-status[hidden] {
    display: none;
}

.photo-drag-handle {
    width: 2.25rem;
    min-width: 2.25rem;
    height: 2.25rem;
    padding: 0;
    border-radius: .5rem;
    cursor: grab;
    font-size: .85rem;
    letter-spacing: 0;
    line-height: 1;
}

.photo-drag-handle:active {
    cursor: grabbing;
}

.photo-list-row,
.photo-text-row {
    display: grid;
    grid-template-columns: minmax(180px, 210px) minmax(0, 1fr) auto;
    gap: 0;
    align-items: center;
    padding: 0;
    border: 1px solid #dce5ea;
    border-radius: 1rem;
    background: #ffffff;
}

.photo-list-row:has(.photo-drag-handle) {
    grid-template-columns: 3rem minmax(180px, 210px) minmax(0, 1fr) auto;
}

.photo-text-row:has(.photo-drag-handle) {
    grid-template-columns: 3rem minmax(0, 1fr) auto;
}

.photo-list-row .photo-drag-handle,
.photo-text-row .photo-drag-handle {
    margin: 1rem .5rem 1rem 1rem;
    align-self: center;
}

[data-photo-id].is-dragging {
    opacity: .55;
    outline: 2px solid #1f6feb;
}

[data-photo-id].is-drop-target {
    border-color: #1f6feb;
    box-shadow: 0 0 0 3px rgba(31, 111, 235, .16);
}

.photo-list-row {
    align-items: stretch;
    overflow: hidden;
    min-height: 9rem;
    transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease, background-color 180ms ease;
}

.photo-list-row:hover,
.photo-list-row:focus-within {
    transform: translateY(-1px);
    border-color: #9eb2bc;
    box-shadow: 0 16px 30px rgba(18, 47, 63, .11);
    background: #f8fbfc;
}

.photo-list-row.is-deleted,
.photo-text-row.is-deleted {
    opacity: .75;
}

.photo-list-thumb {
    display: block;
    align-self: stretch;
    overflow: hidden;
    border-radius: 1rem 0 0 1rem;
    background: transparent;
    aspect-ratio: 3 / 2;
    flex-shrink: 0;
}

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

.photo-list-thumb:hover,
.photo-list-thumb:focus-visible {
    outline: none;
}

.photo-list-thumb:hover img,
.photo-list-thumb:focus-visible img {
    transform: scale(1.02);
}

.photo-list-main,
.photo-text-main {
    min-width: 0;
    padding: 1rem 1rem 1rem 1rem;
}

.photo-list-title,
.photo-text-title {
    display: flex;
    flex-wrap: wrap;
    gap: .6rem;
    align-items: center;
    margin-bottom: .55rem;
}

.photo-list-title h2,
.photo-text-title h2 {
    margin: 0;
    font-size: 1.05rem;
}

.photo-list-subtitle {
    flex-basis: 100%;
    color: #5f6f7d;
    font-size: .92rem;
    font-weight: 600;
}

.photo-list-meta,
.photo-text-meta {
    display: flex;
    flex-wrap: wrap;
    gap: .6rem 1rem;
    color: #5f6f7d;
    font-size: .95rem;
}

.photo-list-actions,
.photo-text-actions {
    padding: 1rem 1rem 1rem 0;
    justify-content: flex-end;
}

.trash-compact-list {
    display: grid;
    gap: .7rem;
}

.trash-compact-row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: .8rem;
    align-items: center;
    padding: .75rem;
    border: 1px solid #dfe7ec;
    border-radius: .5rem;
    background: #fff;
}

.trash-compact-photo-row {
    padding: 0 .75rem 0 0;
    overflow: hidden;
}

.trash-compact-thumb {
    display: block;
    width: 4.5rem;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    border-radius: .4rem;
    background: #eef3f5;
}

.trash-compact-photo-row .trash-compact-thumb {
    align-self: stretch;
    width: 10.5rem;
    min-height: 7.9rem;
    aspect-ratio: auto;
    border-radius: .5rem 0 0 .5rem;
    background: transparent;
}

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

.trash-compact-main {
    min-width: 0;
}

.trash-compact-title {
    display: flex;
    flex-wrap: wrap;
    gap: .45rem;
    align-items: center;
}

.trash-compact-title h2 {
    margin: 0;
    font-size: 1rem;
}

.trash-compact-meta {
    display: flex;
    flex-wrap: wrap;
    gap: .45rem .75rem;
    margin-top: .25rem;
    color: #697886;
    font-size: .86rem;
}

.trash-compact-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
    justify-content: flex-end;
}

.trash-compact-actions form {
    margin: 0;
}

.photo-hover-preview {
    position: fixed;
    z-index: 50;
    width: min(380px, calc(100vw - 32px));
    border: 1px solid #dce5ea;
    border-radius: 1rem;
    background: rgba(255, 255, 255, .98);
    box-shadow: 0 24px 60px rgba(18, 47, 63, .2);
    pointer-events: none;
}

.photo-hover-preview img {
    display: block;
    width: 100%;
    height: auto;
    max-height: min(66vh, 420px);
    object-fit: contain;
    border-radius: inherit;
}

@media (prefers-reduced-motion: reduce) {
    .photo-list-row,
    .photo-list-thumb img {
        transition: none;
    }
}

.photo-gallery-view {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr));
    gap: 1rem;
}

.photo-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr));
    gap: 1rem;
}

.photo-card {
    display: grid;
    position: relative;
    overflow: hidden;
    min-width: 0;
    border: 1px solid #dce5ea;
    border-radius: 1rem;
    background: #ffffff;
    box-shadow: 0 12px 28px rgba(18, 47, 63, .06);
}

.photo-card.is-selected,
.photo-list-row.is-selected,
.photo-text-row.is-selected {
    border-color: #1d6f8f;
    box-shadow: 0 0 0 3px rgba(29, 111, 143, .16);
}

.photo-card-grid .photo-card {
    grid-template-rows: auto 1fr;
    height: 100%;
}

.photo-card.is-deleted {
    border-color: #f3c4cf;
    background: #fff8fa;
}

.photo-select-card {
    position: absolute;
    top: .8rem;
    left: .8rem;
    z-index: 3;
    border-radius: 999px;
    background: rgba(255, 255, 255, .94);
    padding: .35rem .5rem;
    box-shadow: 0 8px 24px rgba(18, 47, 63, .14);
}

.photo-card-preview {
    display: block;
    aspect-ratio: 4 / 3;
    background: #eef3f5;
}

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

.photo-card-body {
    display: grid;
    gap: .85rem;
    padding: 1rem;
}

.photo-card-grid .photo-card-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}

.photo-card-header,
.photo-card-footer {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: .75rem;
}

.photo-card-grid .photo-card-header {
    align-items: flex-start;
}

.photo-card-heading {
    display: flex;
    flex: 1;
    min-width: 0;
    flex-direction: column;
}

.photo-card-header h2 {
    margin: .15rem 0 0;
    font-size: 1.05rem;
    line-height: 1.25;
}

.photo-card-title {
    min-height: calc(1.25em * 2);
}

.photo-card-title,
.photo-card-title a {
    display: -webkit-box;
    overflow: hidden;
    text-overflow: ellipsis;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
}

.photo-card-id {
    color: #697886;
    font-size: .8rem;
    font-weight: 800;
}

.status-badge,
.photo-card-state {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: .18rem .55rem;
    font-size: .75rem;
    font-weight: 800;
    white-space: nowrap;
}

.status-badge {
    background: #edf3f4;
    color: #31576b;
}

.photo-card-state.is-ok {
    background: #eef8f0;
    color: #166534;
}

.photo-card-state.is-danger {
    background: #fff0f3;
    color: #9f1239;
}

.photo-card-grid .status-badge {
    flex-shrink: 0;
    align-self: flex-start;
}

.photo-card-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .45rem .75rem;
    min-height: 1.5rem;
    color: #4f6473;
    font-size: .88rem;
    line-height: 1.35;
}

.photo-card-meta span {
    display: inline-flex;
    align-items: center;
}

.photo-card-grid .photo-card-footer {
    margin-top: auto;
    align-items: center;
    padding-top: .1rem;
}

.photo-card-grid .photo-card-footer > * {
    min-height: 2.5rem;
}

.photo-card-grid .photo-card-footer form {
    margin: 0;
}

.photo-card-grid .photo-card-footer .button,
.photo-card-grid .photo-card-footer .danger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.photo-list-row,
.photo-text-row {
    position: relative;
}

.photo-list-row .photo-select-inline,
.photo-text-row .photo-select-inline {
    align-self: flex-start;
    margin-top: .2rem;
}

.danger-text {
    color: #9f1239;
    font-weight: 700;
}

.wide-form {
    max-width: 42rem;
}

.heading-line {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .65rem;
}

.heading-line h1 {
    margin: 0;
    font-size: clamp(1.35rem, 1rem + 1vw, 1.8rem);
    line-height: 1.15;
}

.photo-detail-heading {
    margin-bottom: 1rem;
}

.photo-detail-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.55fr) minmax(19rem, .7fr);
    gap: 1.25rem;
    align-items: start;
}

.photo-detail-main,
.photo-detail-side {
    display: grid;
    gap: 1rem;
    min-width: 0;
    align-content: start;
}

.panel {
    min-width: 0;
    padding: 1rem;
    border: 1px solid #d8dee4;
    background: #ffffff;
    border-radius: .45rem;
    box-shadow: 0 1px 2px rgba(23, 33, 43, .04);
}

.panel-header {
    display: flex;
    min-width: 0;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: .85rem;
}

.panel-header h2 {
    margin: 0;
    font-size: 1.05rem;
    line-height: 1.25;
}

.panel-header h3,
.danger-zone h3,
.action-group h3,
.ai-card h3,
.metadata-group h3 {
    margin: 0;
    font-size: .78rem;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: #52616f;
}

.panel-header p {
    margin: .2rem 0 0;
    color: #52616f;
}

.status-badge,
.variant-badge {
    display: inline-flex;
    align-items: center;
    min-height: 1.55rem;
    padding: .15rem .55rem;
    border: 1px solid #c9d3de;
    border-radius: 999px;
    background: #f6f8fa;
    color: #334150;
    font-size: .82rem;
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
}

.status-draft {
    border-color: #c8d2dd;
    background: #f6f8fa;
}

.status-published {
    border-color: #9fc6aa;
    background: #eef8f0;
    color: #1f5d30;
}

.status-archived {
    border-color: #d3c5a0;
    background: #fff8e6;
    color: #69521a;
}

.preview-panel {
    padding-bottom: 1.1rem;
}

.preview-specs {
    color: #52616f;
    font-size: .92rem;
    text-align: right;
}

.preview-stage {
    display: grid;
    min-width: 0;
    place-items: center;
    min-height: 22rem;
    padding: 1rem;
    border: 1px solid #e1e7ed;
    border-radius: .4rem;
    background: #f6f8fa;
}

.preview-stage img {
    display: block;
    max-width: 100%;
    max-height: 34rem;
    width: auto;
    height: auto;
    object-fit: contain;
    border: 1px solid rgba(31, 41, 51, .08);
    box-shadow: 0 8px 24px rgba(23, 33, 43, .08);
}

.variant-selector {
    display: flex;
    min-width: 0;
    flex-wrap: wrap;
    gap: .5rem;
    margin-top: .85rem;
}

.variant-button[aria-pressed="true"] {
    border-color: #124c7c;
    background: #e7f1f9;
    color: #0d3a5f;
    box-shadow: inset 0 0 0 1px #124c7c;
}

.file-table tbody tr.is-selected-variant {
    background: #eef6fb;
    box-shadow: inset 3px 0 0 #124c7c;
}

.file-table tbody tr.is-selected-variant .variant-badge {
    border-color: #124c7c;
    background: #e7f1f9;
    color: #0d3a5f;
}

.detail-grid,
.mini-list,
.metadata-grid {
    display: grid;
    gap: .45rem;
    margin: 0;
}

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

.detail-grid > div,
.mini-list > div,
.metadata-grid > div {
    display: grid;
    grid-template-columns: minmax(8rem, 34%) minmax(0, 1fr);
    gap: .45rem .85rem;
    align-items: center;
    min-width: 0;
}

.detail-full {
    grid-column: 1 / -1;
}

.detail-grid dt,
.mini-list dt,
.metadata-grid dt,
.metadata-grid strong {
    margin: 0;
    color: #52616f;
    font-size: .78rem;
    font-weight: 700;
    text-transform: uppercase;
}

.detail-grid dd,
.mini-list dd,
.metadata-grid dd,
.metadata-grid span {
    margin: 0;
    overflow-wrap: anywhere;
}

code {
    padding: .08rem .25rem;
    border-radius: .25rem;
    background: #f6f8fa;
    color: #273542;
    font-family: Consolas, "Liberation Mono", monospace;
    font-size: .92em;
    overflow-wrap: anywhere;
}

.muted {
    margin: 0;
    color: #52616f;
}

.metadata-groups {
    display: grid;
    gap: .85rem;
}

.metadata-group {
    display: grid;
    gap: .45rem;
    padding-top: .75rem;
    border-top: 1px solid #eef2f6;
}

.metadata-group:first-child {
    padding-top: 0;
    border-top: 0;
}

.photo-ai-result-panel {
    min-width: 0;
    margin-top: 0;
    padding: 1.1rem;
    border: 1px solid #d8dee4;
    background: #ffffff;
    border-radius: .55rem;
    box-shadow: 0 1px 2px rgba(23, 33, 43, .04);
}

.ai-result-heading {
    align-items: center;
}

.ai-card-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    margin-top: .9rem;
}

.ai-card {
    min-width: 0;
    display: grid;
    align-content: start;
    gap: .7rem;
    padding: 1rem;
    border: 1px solid #e1e7ed;
    border-radius: .5rem;
    background: #fbfcfd;
}

.ai-card-wide {
    grid-column: 1 / -1;
}

.ai-card p,
.ai-card ul {
    margin: 0;
}

.ai-card p {
    line-height: 1.65;
    white-space: pre-line;
}

.ai-card ul {
    display: grid;
    gap: .45rem;
    padding-left: 1.15rem;
}

.editorial-comparison-card {
    gap: .85rem;
}

.editorial-comparison-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: .75rem;
}

.editorial-comparison-badge {
    display: inline-flex;
    align-items: center;
    min-height: 1.55rem;
    padding: .15rem .55rem;
    border: 1px solid #c9d3de;
    border-radius: 999px;
    background: #f6f8fa;
    color: #334150;
    font-size: .8rem;
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
}

.editorial-comparison-badge-positive {
    border-color: #9fc6aa;
    background: #eef8f0;
    color: #1f5d30;
}

.editorial-comparison-badge-attention {
    border-color: #d3c5a0;
    background: #fff8e6;
    color: #69521a;
}

.editorial-comparison-badge-info {
    border-color: #a7c7df;
    background: #eef6fc;
    color: #174b70;
}

.editorial-comparison-badge-neutral {
    border-color: #c9d3de;
    background: #f6f8fa;
    color: #334150;
}

.editorial-comparison-badge-muted {
    border-color: #d8dee4;
    background: #fbfcfd;
    color: #6b7785;
}

.editorial-comparison-values {
    display: grid;
    gap: .65rem;
}

.editorial-comparison-value {
    min-width: 0;
    padding-top: .65rem;
    border-top: 1px solid #eef2f6;
}

.editorial-comparison-value:first-child {
    padding-top: 0;
    border-top: 0;
}

.editorial-comparison-suggestion {
    padding-left: .75rem;
    border-left: 3px solid #d7e7f3;
}

.editorial-comparison-label {
    margin: 0 0 .2rem;
    color: #52616f;
    font-size: .76rem;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.editorial-comparison-text {
    display: grid;
    gap: .45rem;
}

.editorial-comparison-text p {
    margin: 0;
    overflow-wrap: anywhere;
    white-space: pre-line;
}

.editorial-comparison-toggle {
    justify-self: start;
    padding: 0;
    border: 0;
    background: transparent;
    color: #124c7c;
    font-weight: 700;
}

.editorial-comparison-toggle:hover {
    background: transparent;
    text-decoration: underline;
}

.suggestion-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .9rem 1.1rem;
}

.suggestion-grid h4 {
    margin: 0 0 .35rem;
    color: #334150;
    font-size: .9rem;
}

.ai-technical-list {
    margin-top: .85rem;
}

.ai-history {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #eef2f6;
}

.ai-history h3 {
    margin: 0 0 .65rem;
    font-size: .78rem;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: #52616f;
}

.ai-history details {
    padding: .65rem 0;
    border-top: 1px solid #eef2f6;
}

.ai-history details:first-of-type {
    border-top: 0;
}

.ai-history summary {
    display: flex;
    justify-content: space-between;
    gap: .65rem;
    cursor: pointer;
    font-weight: 700;
}

.status-form,
.action-stack {
    display: grid;
    gap: .65rem;
}

.action-group {
    display: grid;
    gap: .65rem;
    padding-bottom: 1rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid #eef2f6;
}

.status-form label {
    color: #52616f;
    font-size: .82rem;
    font-weight: 700;
}

.status-form button,
.status-form select,
.action-stack .button,
.action-stack button {
    width: 100%;
}

.action-stack form {
    margin: 0;
}

.danger-zone {
    display: grid;
    gap: .65rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #ead5dc;
}

.danger-zone details {
    display: grid;
    gap: .65rem;
}

.danger-zone summary {
    cursor: pointer;
    list-style: none;
    text-align: center;
}

.danger-zone summary::-webkit-details-marker {
    display: none;
}

.delete-confirmation {
    display: grid;
    gap: .65rem;
    margin-top: .75rem;
    padding: .85rem;
    border: 1px solid #ead5dc;
    border-radius: .4rem;
    background: #fff7f9;
}

.delete-confirmation p {
    margin: 0;
}

.delete-confirmation h2 {
    margin: 0;
    font-size: 1.15rem;
}

.delete-dialog {
    max-width: min(32rem, calc(100vw - 2rem));
    padding: 0;
    border: 0;
    border-radius: 1rem;
    box-shadow: 0 1.5rem 4rem rgba(15, 23, 42, .28);
}

.delete-dialog::backdrop {
    background: rgba(15, 23, 42, .42);
}

.delete-dialog .form-actions {
    justify-content: flex-end;
}

.contact-page {
    max-width: 58rem;
    margin: 0 auto;
    padding: 2rem 1rem 3rem;
}

.contact-heading {
    max-width: 42rem;
    margin-bottom: 1.25rem;
}

.contact-heading h1 {
    margin-bottom: .35rem;
}

.contact-heading p {
    margin: 0;
    color: #52616f;
    line-height: 1.6;
}

.contact-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem 1.1rem;
    padding: 1.25rem;
}

.contact-field {
    display: grid;
    gap: .35rem;
    min-width: 0;
}

.contact-field label {
    color: #334150;
    font-weight: 700;
}

.contact-field label small {
    color: #6b7785;
    font-weight: 500;
}

.contact-field input,
.contact-field textarea {
    width: 100%;
    box-sizing: border-box;
}

.contact-field textarea {
    min-height: 11rem;
}

.character-counter {
    font-size: .88rem;
    font-weight: 700;
}

.character-counter-neutral {
    color: #6b7785;
}

.character-counter-invalid {
    color: #9f1239;
}

.character-counter-valid {
    color: #1f5d30;
}

.contact-field-full,
.contact-actions {
    grid-column: 1 / -1;
}

.contact-actions {
    display: flex;
    justify-content: flex-end;
}

.file-table-wrap {
    min-width: 0;
    max-width: 100%;
    border: 1px solid #e1e7ed;
    border-radius: .4rem;
    overflow-x: auto;
}

.file-table {
    min-width: 46rem;
}

.file-table th {
    background: #f6f8fa;
    color: #52616f;
    font-size: .78rem;
    text-transform: uppercase;
}

.file-table td {
    padding: .65rem .75rem;
}

.file-table tbody tr:hover {
    background: #f8fbfd;
}

.text-action {
    font-weight: 700;
    text-decoration: none;
}

.text-action:hover {
    text-decoration: underline;
}

.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: .85rem;
    margin-bottom: 1rem;
}

.dashboard-stat-card {
    display: grid;
    gap: .08rem;
    min-width: 0;
    padding: .52rem .68rem;
    border: 1px solid #dce5ea;
    border-radius: .85rem;
    background: #ffffff;
    color: #243746;
    text-decoration: none;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
}

.dashboard-stat-card:hover {
    border-color: #b8d7df;
    background: #fbfefe;
    text-decoration: none;
}

.dashboard-overview {
    display: grid;
    gap: .5rem;
    margin-bottom: .6rem;
}

.dashboard-section {
    display: grid;
    gap: .4rem;
    padding-block: .62rem;
}

.dashboard-section-header {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    align-items: center;
    justify-content: space-between;
}

.dashboard-section-header h2 {
    margin: 0;
    line-height: 1.15;
}

.dashboard-metric-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: .45rem;
}

.dashboard-metric-grid-compact {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.trash-overview-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

.trash-overview-card {
    display: grid;
    align-content: space-between;
    gap: 1rem;
}

.trash-overview-card h2 {
    margin: 0 0 .35rem;
}

.trash-overview-card p {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 800;
}

.trash-overview-card small {
    display: block;
    margin-top: .35rem;
    color: #52616f;
    line-height: 1.45;
}

.message-list {
    display: grid;
    gap: .75rem;
}

.message-list-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: .75rem;
    align-items: center;
    padding: .9rem;
    border: 1px solid #d8dee4;
    border-radius: .7rem;
    background: #ffffff;
    box-shadow: 0 1px 2px rgba(23, 33, 43, .04);
}

.message-list-item-new {
    border-color: #a7c7df;
    background: #f4f9fd;
}

.message-list-link {
    display: grid;
    grid-template-columns: minmax(10rem, .8fr) minmax(0, 1.5fr) auto;
    gap: .85rem;
    align-items: center;
    min-width: 0;
    color: inherit;
    text-decoration: none;
}

.message-list-link:hover {
    text-decoration: none;
}

.message-sender,
.message-subject,
.message-meta {
    min-width: 0;
}

.message-sender,
.message-subject {
    display: grid;
    gap: .15rem;
}

.message-sender small,
.message-subject small,
.message-meta time {
    color: #52616f;
}

.message-sender strong,
.message-subject strong,
.message-subject small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.message-meta {
    display: grid;
    justify-items: end;
    gap: .3rem;
}

.message-unread-dot {
    display: inline-block;
    width: .55rem;
    height: .55rem;
    margin-right: .25rem;
    border-radius: 999px;
    background: #124c7c;
    vertical-align: middle;
}

.message-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .45rem;
    justify-content: flex-end;
}

.message-actions form {
    margin: 0;
}

button.secondary-danger {
    border-color: #ead5dc;
    background: #fff7f9;
    color: #9f1239;
}

button.secondary-danger:hover {
    background: #fde8ef;
}

.dashboard-stat-card span {
    color: #697886;
    font-size: .82rem;
    font-weight: 800;
    letter-spacing: .035em;
    text-transform: uppercase;
}

.dashboard-stat-card strong {
    color: #123c55;
    font-size: clamp(1.45rem, 1.1rem + .72vw, 1.92rem);
    line-height: 1;
}

.dashboard-stat-card small {
    color: #697886;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(18rem, .75fr);
    gap: 1rem;
    margin-bottom: 1rem;
    align-items: start;
}

.dashboard-panel {
    display: grid;
    gap: .5rem;
}

.dashboard-empty {
    display: grid;
    gap: .8rem;
    max-width: 42rem;
}

.dashboard-recent-list,
.dashboard-warning-list {
    display: grid;
    gap: .45rem;
}

.dashboard-recent-item {
    display: grid;
    grid-template-columns: 4.25rem minmax(0, 1fr);
    gap: .6rem;
    align-items: center;
    padding: .48rem;
    border: 1px solid #e1e8ed;
    border-radius: .75rem;
    color: #243746;
    text-decoration: none;
    background: #ffffff;
}

.dashboard-recent-item:hover {
    border-color: #b8d7df;
    background: #f8fcfd;
    text-decoration: none;
}

.dashboard-thumb {
    display: grid;
    place-items: center;
    inline-size: 4.25rem;
    block-size: 3.2rem;
    overflow: hidden;
    border-radius: .65rem;
    background: #edf3f4;
    color: #31576b;
    font-weight: 800;
}

.dashboard-thumb img {
    inline-size: 100%;
    block-size: 100%;
    object-fit: cover;
}

.dashboard-recent-copy {
    min-width: 0;
}

.dashboard-recent-copy strong,
.dashboard-recent-copy small {
    display: block;
    overflow-wrap: anywhere;
}

.dashboard-recent-copy small {
    margin-top: .15rem;
    color: #697886;
}

.dashboard-recent-photos-panel {
    margin-bottom: .65rem;
}

.dashboard-photo-strip {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: .5rem;
}

.dashboard-photo-item {
    display: grid;
    gap: .32rem;
    min-width: 0;
    color: #243746;
    text-decoration: none;
}

.dashboard-photo-item:hover {
    text-decoration: none;
}

.dashboard-photo-thumb {
    display: grid;
    place-items: center;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    border-radius: .55rem;
    background: #edf3f4;
    color: #31576b;
    font-weight: 800;
}

.dashboard-photo-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.dashboard-photo-copy {
    display: grid;
    gap: .1rem;
    min-width: 0;
}

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

.dashboard-photo-copy small {
    color: #697886;
    font-size: .84rem;
}

.dashboard-warning {
    display: grid;
    gap: .15rem;
    padding: .75rem;
    border: 1px solid #dce5ea;
    border-radius: .75rem;
    background: #f8fbfd;
}

.dashboard-warning strong {
    color: #243746;
}

.dashboard-warning span {
    color: #52616f;
}

.dashboard-warning-warning {
    border-color: #e8d59a;
    background: #fff9e8;
}

.dashboard-warning-error {
    border-color: #ecc4cf;
    background: #fff7f9;
}

.dashboard-warning-info {
    border-color: #c8dde7;
    background: #f2f8fb;
}

.dashboard-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .55rem;
}

.analytics-period-form {
    display: flex;
    flex-wrap: wrap;
    gap: .6rem;
    align-items: end;
}

.analytics-period-form label {
    display: grid;
    gap: .3rem;
}

.analytics-period-form span {
    color: #52616f;
    font-size: .78rem;
    font-weight: 800;
    letter-spacing: .035em;
    text-transform: uppercase;
}

.analytics-kpi-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: .85rem;
    margin-bottom: 1rem;
}

.analytics-kpi-card {
    pointer-events: none;
}

.analytics-panel {
    display: grid;
    gap: .85rem;
    min-width: 0;
}

.analytics-chart {
    display: flex;
    align-items: end;
    gap: .35rem;
    min-height: 15rem;
    overflow-x: auto;
    padding: .85rem .4rem .25rem;
}

.analytics-chart-bar {
    display: grid;
    grid-template-rows: 1.6rem 1fr auto;
    justify-items: center;
    gap: .35rem;
    min-width: 2.3rem;
    height: 13rem;
}

.analytics-chart-value {
    color: #52616f;
    font-size: .78rem;
    font-weight: 800;
}

.analytics-chart-column {
    align-self: end;
    width: 100%;
    height: var(--bar-height);
    min-height: .25rem;
    border-radius: .45rem .45rem .15rem .15rem;
    background: #1e6c83;
}

.analytics-chart-label {
    color: #697886;
    font-size: .75rem;
    white-space: nowrap;
    writing-mode: vertical-rl;
    transform: rotate(180deg);
}

.analytics-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.analytics-ranking {
    display: grid;
    gap: .5rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.analytics-ranking li {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: .75rem;
    align-items: center;
    padding: .7rem;
    border: 1px solid #e1e8ed;
    border-radius: .7rem;
    background: #ffffff;
}

.analytics-ranking span {
    min-width: 0;
}

.analytics-ranking strong,
.analytics-ranking small {
    display: block;
    overflow-wrap: anywhere;
}

.analytics-ranking small {
    margin-top: .1rem;
    color: #697886;
    font-size: .82rem;
}

.analytics-ranking b {
    color: #123c55;
    font-size: 1.1rem;
}

.news-content {
    overflow-wrap: anywhere;
    white-space: pre-line;
}

.news-public-list {
    display: grid;
    gap: 1rem;
    max-width: 54rem;
}

@media (max-width: 720px) {
    .site-header,
    .site-footer,
    .site-main,
    .client-content {
        padding: 1rem;
    }

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

    .client-sidebar {
        position: fixed;
        inset: 0 auto 0 0;
        z-index: 20;
        width: min(18rem, calc(100vw - 3rem));
        height: 100vh;
        transform: translateX(-105%);
        transition: transform .18s ease-out;
        border-right: 0;
        border-bottom: 0;
        box-shadow: 1rem 0 2.5rem rgba(15, 23, 42, .18);
    }

    .client-sidebar-toggle:checked ~ .client-sidebar {
        transform: translateX(0);
    }

    .client-topbar {
        display: flex;
        padding: .75rem 1rem;
    }

    .client-menu-button {
        display: inline-flex;
    }

    .client-breadcrumb {
        display: none;
    }

    .client-userbox {
        display: none;
    }

    .client-userbox a {
        display: none;
    }

    .client-userbox button {
        padding: .45rem .65rem;
    }

    .page-heading,
    .panel-header {
        display: grid;
    }

    .page-heading > *,
    .panel-header > * {
        min-width: 0;
    }

    .page-heading .button {
        width: 100%;
        text-align: center;
    }

    .client-settings-section {
        scroll-margin-top: 4.25rem;
    }

    .toolbar {
        display: grid;
        grid-template-columns: 1fr;
    }

    .photo-list-row,
    .photo-text-row {
        grid-template-columns: 1fr;
    }

    .photo-list-thumb {
        border-radius: 1rem 1rem 0 0;
        aspect-ratio: 3 / 2;
    }

    .photo-list-main,
    .photo-text-main,
    .photo-list-actions,
    .photo-text-actions {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .photo-list-actions,
    .photo-text-actions {
        justify-content: flex-start;
        flex-wrap: wrap;
    }

    .photo-bulk-toolbar {
        top: .5rem;
    }

    .toolbar button,
    .toolbar .button {
        width: 100%;
    }

    .photo-detail-layout,
    .detail-grid,
    .ai-card-grid,
    .suggestion-grid,
    .dashboard-grid,
    .dashboard-stats,
    .dashboard-metric-grid,
    .dashboard-metric-grid-compact,
    .dashboard-photo-strip,
    .analytics-kpi-grid,
    .analytics-grid {
        grid-template-columns: 1fr;
    }

    .photo-detail-side {
        grid-template-columns: 1fr;
    }

    .photo-detail-side .panel:first-child {
        grid-column: auto;
    }

    .detail-grid,
    .ai-card-grid,
    .suggestion-grid {
        grid-template-columns: 1fr;
    }

    .client-data-list > div,
    .client-settings-list > div,
    .photo-card-meta > div,
    .detail-grid > div,
    .mini-list > div,
    .metadata-grid > div {
        grid-template-columns: 1fr;
        gap: .12rem;
        align-items: start;
    }

    .preview-stage {
        min-height: 14rem;
        padding: .65rem;
    }

    .preview-stage img {
        max-height: 24rem;
    }

    .preview-specs {
        text-align: left;
    }

    .variant-selector,
    .form-actions {
        display: grid;
        grid-template-columns: 1fr;
    }

    .variant-selector button,
    .form-actions .button,
    .form-actions button {
        width: 100%;
    }

    .photo-ai-result-panel {
        padding: .9rem;
    }

    .ai-card {
        padding: .85rem;
    }

    .editorial-comparison-card-header {
        display: grid;
    }

    .editorial-comparison-card form button {
        width: 100%;
    }

    .editorial-comparison-suggestion {
        padding-left: .6rem;
    }

    .dashboard-recent-item {
        grid-template-columns: 3.75rem minmax(0, 1fr);
    }

    .dashboard-thumb {
        inline-size: 3.75rem;
        block-size: 3rem;
    }

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

    .trash-compact-row,
    .trash-compact-photo-row {
        grid-template-columns: 1fr;
        padding: .75rem;
    }

    .trash-compact-photo-row .trash-compact-thumb {
        width: 100%;
        min-height: 0;
        aspect-ratio: 3 / 2;
        border-radius: .5rem;
    }

    .trash-compact-actions {
        justify-content: stretch;
    }

    .trash-compact-actions .button,
    .trash-compact-actions button,
    .trash-compact-actions form {
        width: 100%;
    }

    .analytics-period-form {
        display: grid;
        grid-template-columns: 1fr;
    }

    .analytics-period-form button,
    .analytics-period-form select {
        width: 100%;
    }

    .dashboard-actions .button {
        width: 100%;
        text-align: center;
    }

    .trash-overview-grid,
    .message-list-item,
    .message-list-link {
        grid-template-columns: 1fr;
    }

    .message-meta {
        justify-items: start;
    }

    .message-actions {
        justify-content: stretch;
    }

    .message-actions .button,
    .message-actions button {
        width: 100%;
    }

    .contact-page {
        padding: 1.25rem .75rem 2rem;
    }

    .contact-form {
        grid-template-columns: 1fr;
        padding: 1rem;
    }

    .contact-actions {
        justify-content: stretch;
    }

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

@media (min-width: 721px) and (max-width: 1100px) {
    .photo-detail-layout {
        grid-template-columns: minmax(0, 1.35fr) minmax(17rem, .75fr);
        gap: 1rem;
    }

    .photo-detail-side {
        grid-template-columns: minmax(0, 1fr);
    }

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

    .dashboard-stats {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

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

/* Client Foto - toolbar unificata e viste più leggibili */
.photo-toolbar-v2 {
    padding: 1rem;
}

.photo-upload-dialog {
    width: min(42rem, calc(100vw - 2rem));
    padding: 0;
    border: 0;
    border-radius: .85rem;
    background: transparent;
}

.photo-upload-dialog::backdrop {
    background: rgba(16, 33, 45, .42);
}

.photo-upload-modal {
    position: relative;
    display: grid;
    gap: .9rem;
    padding: 1.2rem;
    border: 1px solid #d7e2e8;
    border-radius: .85rem;
    background: #ffffff;
    box-shadow: 0 1rem 2.5rem rgba(19, 47, 64, .16);
}

.photo-upload-modal h2 {
    margin: 0;
}

.photo-upload-close {
    position: absolute;
    top: .65rem;
    right: .65rem;
    width: 2rem;
    height: 2rem;
    padding: 0;
    border-radius: 999px;
}

.photo-upload-input {
    position: absolute;
    inline-size: 1px;
    block-size: 1px;
    opacity: 0;
    pointer-events: none;
}

.photo-upload-stage {
    position: relative;
    height: 14rem;
}

.photo-upload-dropzone,
.photo-upload-preview {
    position: absolute;
    inset: 0;
}

.photo-upload-dropzone {
    display: grid;
    place-items: center;
    gap: .45rem;
    padding: 1.2rem;
    border: 1px dashed #b8ccd7;
    border-radius: .7rem;
    background: #f8fbfc;
    color: #243746;
    text-align: center;
}

.photo-upload-dropzone.is-dragover {
    border-color: #1e6c83;
    background: #eef8fb;
}

.photo-upload-icon {
    display: grid;
    place-items: center;
    width: 2.4rem;
    height: 2.4rem;
    border-radius: 999px;
    background: #e6f4f7;
    color: #1e6c83;
    font-size: 1.35rem;
    font-weight: 800;
}

.photo-upload-dropzone small {
    color: #697886;
}

.photo-upload-preview {
    display: grid;
}

.photo-upload-dropzone[hidden],
.photo-upload-preview[hidden],
.photo-upload-actions [hidden] {
    display: none;
}

.photo-upload-file-data[hidden] {
    display: grid;
    visibility: hidden;
}

.photo-upload-preview-media {
    display: grid;
    place-items: center;
    height: 100%;
    overflow: hidden;
    border: 1px solid #dce5ea;
    border-radius: .7rem;
    background: #f3f7f9;
}

.photo-upload-preview-media img {
    display: block;
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
}

.photo-upload-file-data {
    margin: 0;
}

.photo-upload-progress {
    display: flex;
    gap: .65rem;
    align-items: center;
    color: #164e63;
}

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

.photo-upload-spinner {
    width: 1.15rem;
    height: 1.15rem;
    border: 2px solid #c8e2ea;
    border-top-color: #1e6c83;
    border-radius: 999px;
    animation: photo-upload-spin .8s linear infinite;
}

.photo-upload-actions {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: .6rem;
}

.photo-upload-actions [data-photo-upload-cancel] {
    justify-self: end;
}

.photo-upload-actions [data-photo-upload-change] {
    justify-self: center;
}

.photo-upload-actions [data-photo-upload-submit] {
    justify-self: start;
}

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

.photo-prepare-shell {
    display: grid;
    gap: 1rem;
    justify-items: center;
}

.photo-prepare-preview,
.photo-prepare-form {
    display: grid;
    width: min(100%, 78rem);
    gap: .85rem;
    min-width: 0;
}

.photo-prepare-image {
    display: grid;
    place-items: center;
    min-height: clamp(18rem, 56vw, 42rem);
    padding: .35rem;
    overflow: hidden;
    border-radius: .75rem;
    background: #f4f8fa;
}

.photo-prepare-image img {
    max-width: 100%;
    max-height: min(72vh, 48rem);
    object-fit: contain;
}

.photo-prepare-meta {
    display: flex;
    flex-wrap: wrap;
    gap: .45rem .8rem;
    align-items: center;
    color: #6b7884;
    font-size: .84rem;
}

.photo-prepare-meta > span:not(.client-settings-status) {
    display: inline-flex;
    align-items: center;
    min-height: 1.6rem;
}

.photo-prepare-fields {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(11rem, 14rem);
    gap: .85rem;
    align-items: end;
}

.photo-prepare-form label {
    display: grid;
    gap: .35rem;
    min-width: 0;
}

.photo-prepare-form label > span {
    color: #425466;
    font-size: .78rem;
    font-weight: 800;
    letter-spacing: .035em;
    text-transform: uppercase;
}

.photo-prepare-form textarea {
    min-height: 5.5rem;
    resize: vertical;
}

.photo-prepare-actions {
    justify-content: flex-end;
    margin-top: .15rem;
}

.photo-card .photo-drag-handle {
    position: absolute;
    top: .75rem;
    left: .75rem;
    z-index: 2;
    background: rgba(255, 255, 255, .94);
}

.photo-toolbar-grid {
    display: grid;
    grid-template-columns: minmax(15rem, 1.5fr) repeat(3, minmax(10rem, .75fr)) auto;
    gap: .85rem;
    align-items: end;
}

.photo-toolbar-grid label {
    min-width: 0;
}

.photo-toolbar-grid label > span {
    display: block;
    margin-bottom: .35rem;
    color: #425466;
    font-size: .78rem;
    font-weight: 800;
    letter-spacing: .035em;
    text-transform: uppercase;
}

.photo-toolbar-grid input,
.photo-toolbar-grid select {
    width: 100%;
}

.photo-toolbar-actions {
    display: flex;
    gap: .5rem;
    align-items: center;
}

.photo-view-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin: .25rem 0 1rem;
}

.photo-result-count {
    color: #5f6f7d;
    white-space: nowrap;
}

.photo-result-count strong {
    color: #17324d;
}

.photo-list-row,
.photo-text-row,
.photo-card {
    border-color: #d6e1e7;
}

.photo-text-row {
    grid-template-columns: minmax(0, 1fr) auto;
    min-height: 4.65rem;
}

.photo-text-main {
    padding-block: .8rem;
}

.photo-card-footer,
.photo-list-actions,
.photo-text-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    align-items: center;
}

@media (max-width: 1180px) {
    .photo-toolbar-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .photo-toolbar-actions {
        grid-column: 1 / -1;
    }
}

@media (max-width: 720px) {
    .photo-toolbar-grid {
        grid-template-columns: 1fr;
    }

    .photo-toolbar-actions {
        grid-column: auto;
    }

    .photo-toolbar-actions .button {
        flex: 1;
        text-align: center;
    }

    .photo-prepare-image {
        min-height: 16rem;
        padding: .5rem;
    }

    .photo-prepare-fields {
        grid-template-columns: 1fr;
    }

    .photo-prepare-actions {
        display: grid;
        grid-template-columns: 1fr;
    }

    .photo-prepare-actions .button,
    .photo-prepare-actions button {
        width: 100%;
    }

    .photo-view-bar {
        align-items: flex-start;
        flex-direction: column;
    }

    .photo-view-switch {
        width: 100%;
    }

    .photo-view-option {
        flex: 1;
        text-align: center;
    }

    .photo-list-row,
    .photo-text-row {
        grid-template-columns: 1fr;
    }

    .photo-list-thumb {
        border-radius: 1rem 1rem 0 0;
    }

    .photo-list-actions,
    .photo-text-actions {
        padding: 0 1rem 1rem;
        justify-content: flex-start;
    }
}

/* Photo detail refinement: stable variant preview + fullscreen overlay */
.preview-stage {
    height: clamp(24rem, 56vh, 38rem);
    min-height: 0;
    overflow: hidden;
}

.preview-stage-button {
    display: grid;
    width: 100%;
    height: 100%;
    padding: 0;
    border: 0;
    background: transparent;
    place-items: center;
    cursor: zoom-in;
}

.preview-stage-button:hover,
.preview-stage-button:focus-visible {
    background: transparent;
    box-shadow: none;
}

.preview-stage img {
    max-width: 100%;
    max-height: 100%;
    border: 0;
    box-shadow: none;
}

.variant-lightbox[hidden] { display: none; }

.variant-lightbox {
    position: fixed;
    inset: 0;
    z-index: 2500;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-rows: auto minmax(0, 1fr);
    grid-template-areas:
        "header header header"
        "prev figure next";
    align-items: center;
    justify-items: center;
    gap: 1rem;
    padding: 2rem;
    background: rgba(7, 12, 18, .94);
}

.variant-lightbox-header {
    grid-area: header;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    width: min(100%, 68rem);
}

.variant-lightbox-label {
    display: inline-flex;
    align-items: center;
    min-height: 1.65rem;
    padding: .25rem .65rem;
    border: 1px solid rgba(255,255,255,.18);
    border-radius: 999px;
    background: rgba(13, 20, 27, .6);
    color: #eef6fb;
    font-size: .78rem;
    font-weight: 800;
    letter-spacing: .05em;
    text-transform: uppercase;
}

.variant-lightbox-figure {
    grid-area: figure;
    display: grid;
    min-width: 0;
    width: min(100%, 68rem);
    height: min(calc(100vh - 9rem), 52rem);
    margin: 0;
    place-items: center;
}

.variant-lightbox-figure img {
    display: block;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.variant-lightbox-nav,
.variant-lightbox-close {
    display: grid;
    width: 2.85rem;
    height: 2.85rem;
    padding: 0;
    border: 1px solid rgba(255,255,255,.34);
    border-radius: 50%;
    background: rgba(20, 28, 36, .72);
    color: #fff;
    place-items: center;
    box-shadow: 0 .45rem 1.1rem rgba(0, 0, 0, .22);
}

.variant-lightbox-close {
    position: absolute;
    top: 1.25rem;
    right: 1.25rem;
}

.variant-lightbox-nav {
    align-self: center;
}

.variant-lightbox-prev {
    grid-area: prev;
    justify-self: start;
    margin-left: .25rem;
}

.variant-lightbox-next {
    grid-area: next;
    justify-self: end;
    margin-right: .25rem;
}

.variant-lightbox-nav svg,
.variant-lightbox-close svg {
    width: 1.05rem;
    height: 1.05rem;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.variant-lightbox-nav:hover,
.variant-lightbox-nav:focus-visible,
.variant-lightbox-close:hover,
.variant-lightbox-close:focus-visible {
    background: rgba(29, 106, 131, .92);
    border-color: rgba(168, 229, 246, .72);
}

.is-variant-lightbox-open { overflow: hidden; }

.photo-detail-side .action-stack {
    align-items: stretch;
}

.photo-detail-side .action-stack > a,
.photo-detail-side .action-stack > form,
.photo-detail-side .action-stack > form > button,
.photo-detail-side .danger-zone details > summary {
    width: 100%;
}

.photo-detail-side .action-stack > a,
.photo-detail-side .action-stack > form > button,
.photo-detail-side .danger-zone > button,
.photo-detail-side .danger-zone details > summary {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.photo-detail-side .client-data-list > div,
.ai-technical-list > div {
    grid-template-columns: minmax(8.5rem, 42%) minmax(0, 1fr);
}

.photo-ai-form {
    display: grid;
    gap: .55rem;
    margin-top: .85rem;
}

.photo-ai-form select {
    width: min(18rem, 100%);
}

.photo-ai-form textarea {
    min-height: 6.25rem;
    resize: vertical;
}

.metadata-variant-summary {
    margin-top: .65rem;
}

.metadata-variant-note {
    margin-top: .5rem;
}

.action-hint {
    margin: -.2rem 0 .45rem;
    font-size: .8rem;
}

.photo-ai-result-panel .mini-list > div {
    align-items: start;
}

@media (max-width: 700px) {
    .variant-lightbox {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto;
        grid-template-areas:
            "header"
            "figure"
            "prev"
            "next";
        gap: .65rem;
        padding: 1rem .6rem;
    }
    .variant-lightbox-nav,
    .variant-lightbox-close {
        width: 2.5rem;
        height: 2.5rem;
    }
    .variant-lightbox-header {
        width: min(100%, 100%);
    }
    .variant-lightbox-figure {
        width: 100%;
        height: min(calc(100vh - 8.5rem), 42rem);
    }
    .variant-lightbox-prev,
    .variant-lightbox-next {
        justify-self: center;
        margin: 0;
    }
    .preview-stage {
        height: 22rem;
    }
}

/* Refinement: modal Nuova fotografia stabile tra selezione, preview e caricamento */
.photo-upload-dialog {
    width: min(46rem, calc(100vw - 2rem));
}

.photo-upload-modal {
    min-height: 0;
    padding-bottom: .7rem;
}

.photo-upload-modal form {
    display: grid;
    grid-template-rows: 24rem 4.9rem 2rem 2.65rem;
    gap: .65rem;
    min-height: 0;
}

.photo-upload-stage {
    height: 24rem;
}

.photo-upload-preview-media {
    padding: .3rem;
}

.photo-upload-file-data {
    align-content: start;
    padding-top: .3rem;
}

.photo-upload-file-data [data-photo-upload-dimensions-row][hidden] {
    display: grid;
    visibility: hidden;
}

.photo-upload-progress {
    min-height: 2rem;
}

.photo-upload-progress[hidden] {
    display: flex;
    visibility: hidden;
}

.photo-upload-actions {
    display: flex;
    justify-content: center;
    align-items: center;
    align-self: end;
    gap: .6rem;
    min-height: 2.65rem;
    margin-top: .2rem;
}

.photo-upload-actions [data-photo-upload-cancel],
.photo-upload-actions [data-photo-upload-change],
.photo-upload-actions [data-photo-upload-submit] {
    justify-self: auto;
}

@media (max-width: 720px) {
    .photo-upload-dialog {
        width: min(46rem, calc(100vw - 1rem));
    }

    .photo-upload-modal {
        min-height: 0;
    }

    .photo-upload-modal form {
        grid-template-rows: 19rem 4.9rem 2rem auto;
        min-height: 0;
    }

    .photo-upload-stage {
        height: 19rem;
    }

    .photo-upload-actions {
        flex-wrap: wrap;
    }
}


/* Refinement: watermark choice, uncropped detail preview, delete confirmation dialog */
.photo-watermark-options {
    display: grid;
    gap: .55rem;
    margin-top: .75rem;
}

.photo-watermark-options label {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: .55rem;
    width: fit-content;
    cursor: pointer;
}

.photo-watermark-options input[type="radio"] {
    flex: 0 0 auto;
    margin: 0;
}

.photo-watermark-options label.is-disabled {
    cursor: not-allowed;
    opacity: .55;
}

.preview-stage,
.preview-stage-button {
    background: #f3f6f8;
}

.preview-stage img {
    display: block;
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    object-position: center;
}

.delete-dialog {
    width: min(32rem, calc(100vw - 2rem));
    max-width: none;
    padding: 0;
    overflow: hidden;
}

.delete-dialog-content {
    display: grid;
    gap: 1rem;
    padding: 1.25rem;
}

.delete-dialog-content p { margin: 0; }

.delete-dialog-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.delete-dialog-header h2 { margin: 0; }

.delete-dialog-close {
    display: grid;
    place-items: center;
    width: 2.25rem;
    height: 2.25rem;
    padding: 0;
    border-radius: 50%;
    font-size: 1.35rem;
    line-height: 1;
}

/* Refinement 05: stable upload spacing + uncropped fixed detail preview + restored fullscreen lightbox */
.photo-upload-preview-media {
    box-sizing: border-box;
    padding: .35rem;
}

.preview-stage-button > img {
    display: block;
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
    object-fit: contain !important;
    object-position: center !important;
}

.variant-lightbox {
    grid-template-columns: 3.25rem minmax(0, 1fr) 3.25rem;
    grid-template-rows: auto minmax(0, 1fr);
    gap: .75rem;
    padding: 1.25rem;
}

.variant-lightbox-header {
    width: 100%;
    max-width: none;
    padding-inline: 4rem;
}

.variant-lightbox-figure {
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    min-width: 0;
    min-height: 0;
    margin: 0;
    overflow: hidden;
    place-items: center;
}

.variant-lightbox-figure img {
    display: block;
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.variant-lightbox-prev { margin-left: 0; }
.variant-lightbox-next { margin-right: 0; }

@media (max-width: 720px) {
    .variant-lightbox {
        grid-template-columns: 2.75rem minmax(0, 1fr) 2.75rem;
        padding: .75rem;
        gap: .4rem;
    }

    .variant-lightbox-header {
        padding-inline: 3.25rem;
    }
}

/* Refinement 06: preview geometry only — do not alter modal/lightbox behavior */
.photo-upload-preview-media {
    padding: .6rem;
}

.photo-upload-preview-media img {
    display: block;
    width: auto !important;
    height: auto !important;
    max-width: 100% !important;
    max-height: 100% !important;
    margin: auto;
    object-fit: contain !important;
    object-position: center !important;
}

.preview-stage-button {
    position: relative;
    overflow: hidden;
}

.preview-stage-button > img {
    position: absolute;
    inset: 0;
    display: block;
    width: auto !important;
    height: auto !important;
    max-width: 100% !important;
    max-height: 100% !important;
    margin: auto;
    object-fit: contain !important;
    object-position: center !important;
}

/* Refinement 07: center upload preview only; preserve all other approved UI behavior */
.photo-upload-preview-media {
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    padding: .6rem;
}

.photo-upload-preview-media img {
    display: block;
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
    margin: 0 !important;
    object-fit: contain !important;
    object-position: center center !important;
}


.ai-description-notice-control {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.45rem 0.75rem;
    margin-top: 0.65rem;
    color: var(--muted, #777);
    font-size: 0.78rem;
}

.ai-description-notice-control form {
    margin: 0;
}
