:root {
    --bg: #0b0d10;
    --panel: rgba(19, 22, 26, 0.86);
    --panel-solid: #13161a;
    --panel-strong: rgba(22, 25, 30, 0.96);
    --ink: #edf2f7;
    --muted: #8c97a3;
    --line: rgba(255, 255, 255, 0.1);
    --accent: #2bb4a0;
    --accent-soft: rgba(43, 180, 160, 0.16);
    --danger: #ef6c5b;
    --shadow: 0 24px 80px rgba(0, 0, 0, 0.38);
    --radius: 6px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    color: var(--ink);
    background:
        radial-gradient(circle at top left, rgba(35, 52, 70, 0.42), transparent 38%),
        linear-gradient(180deg, #090b0d 0%, #101419 100%);
    font: 16px/1.5 "Avenir Next", Avenir, "Segoe UI", sans-serif;
}

h1,
h2,
h3,
p,
strong,
span,
label,
button,
a {
    overflow-wrap: anywhere;
}

img {
    max-width: 100%;
    display: block;
}

a {
    color: inherit;
    text-decoration: none;
}

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

code {
    font: 500 0.92rem/1.4 "SF Mono", "Roboto Mono", monospace;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 30;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    backdrop-filter: blur(18px);
    background: rgba(10, 12, 15, 0.86);
    border-bottom: 1px solid var(--line);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.brand-mark {
    width: 2.2rem;
    height: 2.2rem;
    border-radius: 999px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, #0f5f57, #1d8074);
    color: white;
    font-size: 0.8rem;
}

.topbar-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
}

.topbar-nav a {
    color: var(--muted);
}

.topbar-user {
    color: var(--ink);
    font-size: 0.95rem;
    white-space: nowrap;
}

.topbar-client .topbar-nav {
    width: auto;
    flex-wrap: nowrap;
}

.topbar-client .topbar-nav a {
    flex: 0 0 auto;
}

.page-shell,
.auth-shell {
    width: min(1240px, calc(100vw - 2rem));
    margin: 0 auto;
    padding: 1.5rem 0 4rem;
}

.landing-shell {
    min-height: 100vh;
    padding: 0;
}

.landing-body {
    background: #07090b;
    color: white;
}

.landing-hero {
    position: relative;
    min-height: 100vh;
    display: grid;
    align-items: end;
    justify-items: center;
    padding: 2rem 1rem 2.5rem;
    overflow: hidden;
}

.landing-backdrop,
.landing-layer {
    position: absolute;
    inset: 0;
}

.landing-layer {
    opacity: 0;
    transition: opacity 1.8s ease;
    background-position: center;
    background-size: cover;
    transform: scale(1.04);
    filter: saturate(0.92);
}

.landing-layer.is-visible {
    opacity: 1;
}

.landing-backdrop::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(180deg, rgba(3, 4, 5, 0.42), rgba(3, 4, 5, 0.74)),
        radial-gradient(circle at top right, rgba(43, 180, 160, 0.18), transparent 35%);
}

.landing-panel {
    position: relative;
    z-index: 2;
    width: min(420px, 100%);
    display: grid;
    gap: 0.85rem;
}

.landing-links {
    display: flex;
    justify-content: center;
}

.landing-links a {
    color: rgba(255, 255, 255, 0.8);
}

.landing-password-input {
    text-align: center;
}

.landing-password-input::placeholder {
    text-align: center;
}

.eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.16em;
    font-size: 0.76rem;
    color: var(--muted);
}

.panel-card,
.content-card,
.auth-card {
    background: var(--panel-solid);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.panel-card,
.auth-card,
.content-card {
    padding: 1.3rem;
}

.auth-body {
    min-height: 100vh;
}

.auth-card {
    max-width: 560px;
    margin: 3rem auto;
}

.stack-form {
    display: grid;
    gap: 1rem;
}

label {
    display: grid;
    gap: 0.38rem;
    color: var(--muted);
    font-size: 0.96rem;
}

input,
textarea,
select {
    width: 100%;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    padding: 0.5rem 0.65rem;
    background: #0e1115;
    color: var(--ink);
}

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

.button {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    padding: 0.8rem 1rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(20, 24, 29, 0.95);
    color: var(--ink);
    cursor: pointer;
    transition: transform 140ms ease, background 140ms ease;
}

.admin-ui .button {
    padding: 0.62rem 0.82rem;
    font-size: 0.92rem;
}

.button:hover {
    transform: translateY(-1px);
}

.button-primary {
    background: var(--accent);
    color: white;
    border-color: transparent;
}

.button-danger {
    color: var(--danger);
}

.button-small {
    padding: 0.55rem 0.8rem;
    font-size: 0.9rem;
}

.button-block {
    width: 100%;
}

.flash {
    margin-bottom: 1rem;
    padding: 0.9rem 1rem;
    border-radius: 8px;
    border: 1px solid var(--line);
}

.flash-success {
    background: rgba(28, 129, 92, 0.18);
}

.flash-error {
    background: rgba(171, 61, 44, 0.18);
}

.flash-info {
    background: rgba(44, 100, 171, 0.18);
}

.breadcrumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-bottom: 1rem;
    color: var(--muted);
    font-size: 0.92rem;
}

.breadcrumbs a {
    color: inherit;
    text-decoration: none;
}

.breadcrumbs a:hover {
    color: var(--ink);
}

.breadcrumbs-sep {
    opacity: 0.5;
}

.section-head {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.2rem;
}

.section-head > *,
.gallery-card-top > *,
.gallery-admin-header > *,
.project-card-header > *,
.modal-card-head > *,
.tree-group summary > *,
.tree-scene summary > * {
    min-width: 0;
}

.section-head.compact {
    align-items: center;
    margin-bottom: 1rem;
}

.section-head h1,
.section-head h2,
.content-card h2 {
    margin: 0.2rem 0 0;
    line-height: 1.04;
    letter-spacing: -0.03em;
}

.section-head h1 {
    font-size: clamp(2rem, 4vw, 3rem);
}

.section-head h1.gallery-title {
    font-size: clamp(1.5rem, 2.6vw, 2rem);
}

.actions,
.tag-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.compact-actions {
    gap: 0.4rem;
}

.section-meta,
.muted,
.small {
    color: var(--muted);
}

.small {
    font-size: 0.85rem;
}

.badge,
.tag {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    border-radius: 999px;
    padding: 0.35rem 0.7rem;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 0.85rem;
    font-weight: 600;
}

.gallery-grid,
.stats-grid,
.admin-grid,
.slideshow-grid {
    display: grid;
    gap: 1rem;
}

.gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 280px));
    justify-content: start;
}

.slideshow-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 160px));
    justify-content: start;
    gap: 0.85rem;
}

.gallery-card,
.action-card,
.slide-card,
.stat-card {
    border-radius: 6px;
    background: var(--panel-strong);
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
}

.gallery-cover {
    aspect-ratio: 16 / 9;
    display: block;
    background: linear-gradient(135deg, #21303f, #162028);
}

.gallery-cover img,
.slide-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
    border-radius: 0;
}

.slide-card {
    overflow: hidden;
}

.slide-card-preview {
    position: relative;
    aspect-ratio: 16 / 9;
    background: linear-gradient(135deg, #21303f, #162028);
}

.slide-card-body {
    padding: 0.7rem 0.8rem;
}

.slide-card-body strong {
    font-size: 0.88rem;
    font-weight: 600;
    line-height: 1.3;
}

.slide-card-remove-form {
    position: absolute;
    top: 0.6rem;
    right: 0.6rem;
}

.slide-card-remove {
    width: 2rem;
    height: 2rem;
    border: 0;
    border-radius: 999px;
    background: rgba(11, 14, 18, 0.82);
    color: #fff;
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
    display: grid;
    place-items: center;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
}

.slide-card-remove:hover {
    background: rgba(155, 52, 47, 0.96);
}

.gallery-cover-placeholder {
    display: grid;
    place-items: center;
    width: 100%;
    height: 100%;
    color: rgba(255, 255, 255, 0.76);
}

.gallery-card-body,
.action-card,
.slide-card-body {
    padding: 1rem 1.1rem;
}

.slide-card-body strong {
    display: block;
    overflow-wrap: anywhere;
}

.gallery-card-top {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: start;
}

.stats-grid {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    margin-bottom: 1rem;
}

.stat-card {
    padding: 1.2rem;
}

.stat-card strong {
    display: block;
    font-size: 2rem;
    line-height: 1;
}

.stats-inline {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem 1.25rem;
    margin-bottom: 1rem;
    color: var(--muted);
}

.stat-inline-item {
    display: inline-flex;
    align-items: baseline;
    gap: 0.45rem;
}

.stat-inline-item strong {
    color: var(--ink);
    font-size: 1rem;
    line-height: 1;
}

.stat-inline-item span {
    font-size: 0.88rem;
}

.admin-grid {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    margin-bottom: 1rem;
}

.action-card h2 {
    margin-top: 0;
}

.action-card-link {
    display: grid;
    gap: 0.35rem;
}

.admin-layout,
.split-layout {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(280px, 0.95fr);
    gap: 1rem;
}

.admin-layout-form-left {
    grid-template-columns: minmax(300px, 0.9fr) minmax(0, 1.55fr);
}

.admin-layout-balanced {
    grid-template-columns: minmax(0, 1.35fr) minmax(360px, 1fr);
}

.grow-card {
    min-width: 0;
}

.sticky-card {
    position: sticky;
    top: 5.6rem;
    align-self: start;
}

.side-stack,
.stack-gap,
.contact-stack {
    display: grid;
    gap: 1rem;
}

.table-wrap {
    overflow: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.table th,
.table td {
    text-align: left;
    padding: 0.85rem 0.7rem;
    border-bottom: 1px solid var(--line);
    vertical-align: top;
    overflow-wrap: anywhere;
}

.tags-page-head,
.tags-card {
    max-width: 42rem;
}

.tags-card .table {
    width: auto;
    min-width: 30rem;
    table-layout: auto;
}

.tags-card .table th:last-child,
.tags-card .table td:last-child {
    width: 1%;
    white-space: nowrap;
}

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

.checkbox-stack {
    display: grid;
    gap: 0.6rem;
}

.checkbox-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--ink);
}

.checkbox-row input {
    width: auto;
}

.checkbox-row-tristate {
    position: relative;
    cursor: pointer;
}

.checkbox-row-tristate input[data-bulk-tristate] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.tri-state-indicator {
    width: 1rem;
    height: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.18);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--ink);
    font-size: 0.8rem;
    line-height: 1;
    flex: 0 0 1rem;
}

.checkbox-row-tristate[data-state="all"] .tri-state-indicator,
.checkbox-row-tristate[data-state="some"] .tri-state-indicator {
    border-color: rgba(43, 180, 160, 0.7);
    background: rgba(43, 180, 160, 0.16);
}

.scroll-stack {
    max-height: 18rem;
    overflow: auto;
    padding-right: 0.2rem;
}

.upload-dropzone {
    margin-top: 1rem;
    margin-bottom: 1rem;
    border: 1.5px dashed rgba(43, 180, 160, 0.35);
    border-radius: 6px;
    padding: 1.5rem;
    background: rgba(43, 180, 160, 0.06);
}

.upload-dropzone.is-dragover {
    background: rgba(43, 180, 160, 0.1);
    border-color: var(--accent);
}

.upload-copy {
    display: grid;
    justify-items: center;
    text-align: center;
    gap: 0.5rem;
}

.upload-copy p {
    margin: 0;
    color: var(--muted);
}

.upload-status {
    margin-top: 0.8rem;
    text-align: center;
    color: var(--muted);
}

.upload-queue {
    margin-top: 0.85rem;
    text-align: center;
    color: var(--ink);
    font-size: 0.92rem;
}

.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 0.9rem;
    content-visibility: auto;
    contain-intrinsic-size: 0 600px;
}

.photo-tile,
.photo-admin-card {
    padding: 0;
    border: 0;
    border-radius: 0;
    background: #0f1216;
    box-shadow: 0 10px 30px rgba(22, 22, 22, 0.1);
}

.photo-tile {
    cursor: pointer;
    overflow: hidden;
    aspect-ratio: 16 / 9;
    position: relative;
}

.photo-tile img,
.photo-admin-card img {
    width: 100%;
    border-radius: 0;
}

.photo-tile img {
    height: 100%;
    object-fit: cover;
}

.photo-admin-card img {
    display: block;
    aspect-ratio: 16 / 9;
    object-fit: cover;
}

.photo-admin-image-trigger {
    padding: 0;
    border: 0;
    background: transparent;
    cursor: zoom-in;
    display: block;
    position: relative;
}

.photo-admin-card img.is-portrait {
    object-fit: contain;
    background: #000;
}

.photo-admin-card {
    display: flex;
    flex-direction: column;
    position: relative;
    cursor: grab;
}

.photo-media-badge {
    position: absolute;
    top: 0.55rem;
    left: 0.55rem;
    z-index: 2;
    padding: 0.2rem 0.45rem;
    background: rgba(6, 8, 11, 0.82);
    border: 1px solid rgba(255, 255, 255, 0.14);
    color: rgba(255, 255, 255, 0.92);
    font-size: 0.72rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.photo-admin-meta,
.photo-admin-actions {
    padding: 0.8rem;
}

.photo-admin-meta {
    padding-bottom: 0.2rem;
}

.photo-admin-actions {
    display: flex;
    justify-content: flex-end;
    position: absolute;
    top: 0.55rem;
    right: 0.55rem;
    z-index: 3;
    padding: 0;
}

.text-action {
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
}

.text-action:hover {
    color: var(--ink);
}

.text-action-danger {
    color: var(--danger);
}

.photo-admin-menu {
    position: relative;
}

.upload-picker-menu {
    position: relative;
}

.upload-picker-menu summary {
    list-style: none;
}

.upload-picker-menu summary::-webkit-details-marker {
    display: none;
}

.upload-picker-menu-panel {
    position: absolute;
    top: calc(100% + 0.35rem);
    right: 0;
    min-width: 10rem;
    display: grid;
    gap: 0.55rem;
    padding: 0.7rem 0.8rem;
    border: 1px solid var(--line);
    background: rgba(11, 14, 18, 0.98);
    z-index: 6;
}

.ftp-browser-list {
    display: grid;
    gap: 0.55rem;
    max-height: 22rem;
    overflow: auto;
    padding: 0.75rem;
    border: 1px solid var(--line);
    background: rgba(11, 14, 18, 0.38);
}

.ftp-browser-entry {
    display: flex;
    align-items: start;
    gap: 0.7rem;
    padding: 0.15rem 0;
}

.ftp-browser-entry-body {
    display: grid;
    gap: 0.2rem;
    min-width: 0;
}

.browser-card-menu {
    position: absolute;
    top: 0.55rem;
    right: 0.55rem;
    z-index: 3;
}

.photo-admin-menu-trigger {
    list-style: none;
    cursor: pointer;
    color: var(--muted);
    padding: 0;
    line-height: 1;
}

.photo-admin-menu-trigger::-webkit-details-marker {
    display: none;
}

.photo-admin-menu-panel {
    position: absolute;
    bottom: calc(100% + 0.35rem);
    right: 0;
    min-width: 10rem;
    display: grid;
    gap: 0.55rem;
    padding: 0.7rem 0.8rem;
    border: 1px solid var(--line);
    background: rgba(11, 14, 18, 0.98);
    z-index: 6;
}

.photo-admin-actions .photo-admin-menu-panel {
    top: calc(100% + 0.35rem);
    bottom: auto;
}

.browser-card-menu .photo-admin-menu-trigger {
    display: grid;
    place-items: center;
    width: 1.45rem;
    height: 1.45rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(8, 11, 15, 0.78);
}

.photo-admin-actions .photo-admin-menu-trigger {
    display: grid;
    place-items: center;
    width: 1.45rem;
    height: 1.45rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(8, 11, 15, 0.78);
}

.browser-card-menu .photo-admin-menu-panel {
    top: calc(100% + 0.35rem);
    bottom: auto;
}

.photo-admin-card.is-dragging {
    opacity: 0.45;
    cursor: grabbing;
}

.contact-card {
    padding: 1rem;
    border-radius: 5px;
    background: rgba(17, 20, 24, 0.94);
    border: 1px solid var(--line);
}

.project-list {
    display: grid;
    gap: 1rem;
}

.gallery-admin-list {
    display: grid;
    gap: 1rem;
}

.gallery-admin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 280px));
    justify-content: start;
    gap: 1rem;
}

.gallery-admin-card {
    display: grid;
    gap: 1rem;
}

.gallery-admin-card-grid {
    align-content: start;
}

.gallery-admin-layout {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 1rem;
    align-items: start;
}

.gallery-admin-preview {
    background: rgba(16, 19, 23, 0.9);
    min-height: 150px;
}

.gallery-admin-preview img {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    object-position: top center;
}

.gallery-admin-content {
    display: grid;
    gap: 0.9rem;
}

.gallery-admin-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    gap: 1rem;
}

.gallery-admin-header h2 {
    margin: 0;
}

.gallery-admin-header p {
    margin: 0.45rem 0 0;
}

.hierarchy-card {
    display: grid;
    gap: 1rem;
}

.browser-layout {
    display: grid;
    grid-template-columns: minmax(240px, 300px) minmax(0, 1fr);
    gap: 1rem;
    align-items: start;
}

.browser-sidebar {
    position: sticky;
    top: 5.6rem;
    display: grid;
    gap: 0.8rem;
}

.browser-sidebar-head h2 {
    margin: 0;
    font-size: 0.94rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--muted);
}

.browser-nav-list,
.browser-nav-group,
.browser-nav-children {
    display: grid;
    gap: 0.12rem;
}

.browser-nav-group-bottom {
    margin-top: 0.8rem;
    padding-top: 0.8rem;
    border-top: 1px solid var(--line);
}

.browser-nav-link {
    display: flex;
    justify-content: space-between;
    align-items: start;
    gap: 0.75rem;
    padding: 0.2rem 0;
    color: var(--muted);
}

.browser-nav-link.is-active {
    color: var(--ink);
    font-weight: 600;
}

.browser-nav-child {
    margin-left: 0.9rem;
}

.browser-nav-grandchild {
    margin-left: 1.8rem;
}

.browser-nav-count {
    color: var(--muted);
    font-size: 0.82rem;
    white-space: nowrap;
}

.browser-nav-caption {
    margin: -0.05rem 0 0 0.9rem;
    color: var(--muted);
    font-size: 0.76rem;
}

.browser-main {
    display: grid;
    gap: 1rem;
    min-width: 0;
}

.browser-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 230px));
    justify-content: start;
    gap: 1rem;
}

.browser-card {
    position: relative;
    overflow: hidden;
}

.browser-card.is-selected {
    border-color: var(--accent);
}

.browser-card-cover {
    background: rgba(16, 19, 23, 0.92);
}

.browser-card-select {
    position: absolute;
    top: 0.55rem;
    left: 0.55rem;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.3rem;
    height: 1.3rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(8, 11, 15, 0.78);
}

.browser-card-select input {
    width: 0.78rem;
    height: 0.78rem;
    margin: 0;
    accent-color: rgba(95, 192, 179, 0.85);
}

.browser-card-body {
    display: grid;
    gap: 0.4rem;
}

.browser-card-body h2 {
    margin: 0;
    font-size: 1.08rem;
}

.browser-card-body p {
    margin: 0;
}

.browser-view-tabs {
    display: flex;
    gap: 0.55rem;
    margin-bottom: 1rem;
}

.browser-view-tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.45rem 0.8rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--muted);
    text-decoration: none;
}

.browser-view-tab.is-active {
    color: var(--ink);
    border-color: rgba(95, 192, 179, 0.4);
    background: rgba(95, 192, 179, 0.14);
}

.selects-contact-list {
    display: grid;
    gap: 1rem;
}

.selects-contact-card {
    display: grid;
    grid-template-columns: 160px minmax(0, 1fr);
    align-items: start;
    overflow: hidden;
}

.selects-contact-preview {
    height: auto;
}

.selects-contact-body {
    display: grid;
    gap: 0.75rem;
    min-width: 0;
    padding: 1rem 1.1rem;
}

.selects-contact-body h2,
.selects-contact-body p {
    margin: 0;
    overflow-wrap: anywhere;
}

.browser-meta-tree {
    display: grid;
    gap: 0.2rem;
    color: var(--muted);
    font-size: 0.84rem;
}

.browser-meta-line {
    display: flex;
    gap: 0.45rem;
    align-items: start;
}

.browser-meta-label {
    color: var(--muted);
    min-width: 3.5rem;
}

.browser-meta-value {
    color: var(--ink);
}

.browser-meta-children {
    display: grid;
    gap: 0.15rem;
    padding-left: 0.85rem;
}

.browser-selection-summary {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    color: var(--muted);
    font-size: 0.88rem;
}

.browser-selection-summary-inline {
    margin-right: 0.35rem;
}

.library-action-button {
    border-radius: 3px;
    padding: 0.45rem 0.7rem;
    min-height: 2rem;
}

.bulk-remove-tags {
    display: grid;
    gap: 0.65rem;
}

.bulk-remove-tags h3 {
    margin: 0;
}

.bulk-tag-row-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem 1rem;
}

.bulk-tag-row-list .checkbox-row-tristate {
    min-width: 8rem;
}

.hierarchy-tree,
.tree-group-body,
.tree-link-list {
    display: grid;
    gap: 0.65rem;
}

.tree-group,
.tree-scene {
    border: 1px solid var(--line);
    background: rgba(16, 19, 23, 0.86);
}

.tree-group summary,
.tree-scene summary {
    list-style: none;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 0.9rem 1rem;
}

.tree-group summary::-webkit-details-marker,
.tree-scene summary::-webkit-details-marker {
    display: none;
}

.tree-group-body {
    padding: 0 1rem 1rem;
}

.tree-subgroup {
    display: grid;
    gap: 0.6rem;
}

.tree-subhead {
    color: var(--muted);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.tree-scene {
    margin-left: 1rem;
}

.tree-link {
    display: grid;
    gap: 0.1rem;
    padding: 0.75rem 0.85rem;
    border: 1px solid var(--line);
    background: rgba(11, 14, 18, 0.92);
}

.tree-link:hover {
    border-color: rgba(255, 255, 255, 0.22);
}

.modal-card {
    width: min(720px, calc(100vw - 2rem));
    border: 1px solid var(--line);
    background: var(--panel-solid);
    color: var(--ink);
    padding: 1.2rem;
    box-shadow: var(--shadow);
}

.modal-card-wide {
    width: min(920px, calc(100vw - 2rem));
}

.modal-card::backdrop {
    background: rgba(7, 9, 12, 0.72);
    backdrop-filter: blur(6px);
}

.modal-card-head {
    display: flex;
    justify-content: space-between;
    align-items: start;
    gap: 1rem;
    margin-bottom: 1rem;
}

.modal-card-head h2 {
    margin: 0;
}

.modal-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.modal-tab-button {
    border: 1px solid var(--line);
    background: transparent;
    color: var(--muted);
    border-radius: 999px;
    padding: 0.45rem 0.85rem;
    font: inherit;
    cursor: pointer;
}

.modal-tab-button.is-active {
    background: rgba(95, 192, 179, 0.14);
    border-color: rgba(95, 192, 179, 0.4);
    color: var(--ink);
}

.modal-tab-panels {
    margin-top: 0;
}

.modal-tab-context {
    margin: -0.15rem 0 0.9rem;
    color: var(--muted);
}

.modal-tab-context strong {
    color: var(--ink);
    font-size: 1rem;
}

.modal-tab-panel[hidden] {
    display: none;
}

.gallery-edit-page .stack-form {
    gap: 0.75rem;
}

.contact-form-list {
    display: grid;
    gap: 0.8rem;
}

.contact-form-row {
    display: grid;
    gap: 0.55rem;
    padding: 0.8rem;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.02);
}

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

.contact-form-notes {
    grid-column: 1 / -1;
}

.contact-form-actions {
    align-items: center;
}

.contact-form-actions .button {
    margin-left: auto;
}

.admin-users-table td:last-child,
.admin-users-table th:last-child {
    width: 7rem;
    white-space: nowrap;
}

.admin-users-table {
    width: auto;
    max-width: 100%;
    table-layout: auto;
}

.admin-users-table th,
.admin-users-table td {
    padding: 0.58rem 0.45rem;
    font-size: 0.92rem;
}

.admin-users-table th:nth-child(2),
.admin-users-table td:nth-child(2),
.admin-users-table th:nth-child(4),
.admin-users-table td:nth-child(4) {
    width: 1%;
    white-space: nowrap;
}

.admin-users-table th:nth-child(3),
.admin-users-table td:nth-child(3) {
    width: 1%;
    white-space: nowrap;
}

.admin-users-table th:nth-child(5),
.admin-users-table td:nth-child(5) {
    width: 14rem;
    max-width: 14rem;
}

.admin-users-table th:first-child,
.admin-users-table td:first-child {
    width: 12rem;
}

.admin-users-table td:nth-child(5) .small {
    display: block;
    line-height: 1.3;
}

.user-row-actions {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.35rem;
    white-space: nowrap;
}

.user-row-actions form {
    display: inline;
    margin: 0;
}

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

.users-table-wrap .admin-users-table {
    margin-right: auto;
}

.search-shell {
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
}

.gallery-admin-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.search-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.8rem;
}

.search-form > * {
    min-width: 0;
}

.project-card {
    display: grid;
    gap: 1rem;
}

.project-card-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    gap: 1rem;
}

.project-card-header h2,
.project-scene-column h3 {
    margin: 0;
}

.project-card-header p {
    margin: 0.45rem 0 0;
}

.project-metrics {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.project-assignment-list,
.project-scene-tag-groups {
    display: grid;
    gap: 0.8rem;
}

.project-assignment-card,
.project-scene-tag-card {
    display: grid;
    gap: 0.6rem;
    padding: 0.9rem 1rem;
    border: 1px solid var(--line);
    background: rgba(16, 19, 23, 0.9);
}

.project-assignment-scenes,
.project-scene-tag-list {
    display: grid;
    gap: 0.55rem;
    padding-left: 1.6rem;
}

.project-assignment-scene-group {
    display: grid;
    gap: 0.35rem;
}

.project-assignment-scene-list {
    display: grid;
    gap: 0.35rem;
}

.upload-tag-picker {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem 0.6rem;
    max-height: 13rem;
    overflow: auto;
    padding: 0.1rem;
}

.upload-tag-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    margin: 0;
    padding: 0.3rem 0.55rem;
    border: 1px solid var(--line);
    background: rgba(16, 19, 23, 0.9);
    border-radius: 999px;
    font-size: 0.9rem;
}

.project-scene-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.9fr);
    gap: 1rem;
}

.project-scene-column {
    display: grid;
    gap: 0.9rem;
}

.scene-list {
    display: grid;
    gap: 0.8rem;
}

.scene-item {
    display: flex;
    justify-content: space-between;
    align-items: start;
    gap: 1rem;
    padding: 1rem;
    border: 1px solid var(--line);
    background: rgba(16, 19, 23, 0.9);
}

.scene-item p {
    margin: 0.35rem 0 0;
}

.scene-picker {
    display: flex;
    flex-wrap: wrap;
    gap: 0.7rem;
    margin-bottom: 1rem;
}

.scene-section {
    margin-bottom: 2rem;
}

.gallery-map-card {
    padding-bottom: 1rem;
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 1rem;
}

.map-frame {
    width: min(100%, 350px);
    aspect-ratio: 16 / 9;
    border: 0;
    border-radius: 0;
    margin-bottom: 0;
    flex: 0 0 auto;
}

.gallery-map-address {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    min-width: 0;
    flex: 1 1 200px;
}

.gallery-map-address address {
    font-style: normal;
    color: var(--color-muted, #666);
    line-height: 1.4;
}

.gallery-map-directions {
    align-self: flex-start;
    font-size: 0.9rem;
}

.prose-card p {
    margin: 0;
}

.prose-card p + p {
    margin-top: 0.8rem;
}

.lightbox {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: none;
    background: rgba(7, 7, 7, 0.86);
    padding: 2rem;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.lightbox.is-open {
    display: flex;
}

.lightbox-toolbar {
    position: absolute;
    top: 1rem;
    right: 1rem;
    display: flex;
    flex-wrap: wrap;
    justify-content: end;
    gap: 0.6rem;
}

.lightbox-stage {
    width: min(100%, 1200px);
    display: grid;
    gap: 0.8rem;
    justify-items: center;
}

.lightbox-stage img {
    max-height: calc(100vh - 8rem);
    width: auto;
    border-radius: 0;
    will-change: opacity;
    transition: opacity 120ms ease;
}

.lightbox-stage video {
    max-height: calc(100vh - 8rem);
    max-width: min(100%, 1200px);
    width: auto;
    border-radius: 0;
    background: #000;
}

.lightbox.is-loading .lightbox-stage img {
    opacity: 0.35;
}

.lightbox-caption {
    color: rgba(255, 255, 255, 0.84);
    display: grid;
    gap: 0.25rem;
    text-align: center;
}

.lightbox-close,
.lightbox-nav,
.lightbox-tool {
    border: 0;
    background: transparent;
    color: white;
    cursor: pointer;
}

.lightbox-close {
    padding: 0.25rem 0.4rem;
}

.lightbox-nav {
    width: 3rem;
    height: 3rem;
    font-size: 2rem;
    display: grid;
    place-items: center;
}

.lightbox-tool {
    padding: 0.75rem 1rem;
    border-radius: 999px;
}

.empty-state {
    padding: 2rem;
    text-align: center;
    border-radius: 6px;
    border: 1px dashed rgba(255, 255, 255, 0.14);
    color: var(--muted);
}

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

    .browser-layout {
        grid-template-columns: 1fr;
    }

    .gallery-grid,
    .gallery-admin-grid,
    .photo-grid,
    .stats-grid,
    .admin-grid,
    .slideshow-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 240px));
        justify-content: start;
    }

    .slideshow-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 150px));
    }

    .project-scene-layout {
        grid-template-columns: 1fr;
    }

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

    .sticky-card {
        position: static;
    }

    .browser-sidebar {
        display: none;
    }

    .table td .actions,
    .table td .compact-actions {
        display: grid;
        grid-template-columns: 1fr;
        width: 100%;
    }

    .table td .actions > *,
    .table td .compact-actions > * {
        width: 100%;
        min-width: 0;
    }

    .table td .actions .button,
    .table td .compact-actions .button {
        width: 100%;
    }
}

@media (max-width: 720px) {
    .page-shell,
    .auth-shell {
        width: min(100vw - 1rem, 1240px);
        padding-top: 1rem;
    }

    .topbar {
        padding: 0.9rem 1rem;
        align-items: start;
        flex-direction: column;
    }

    .topbar.topbar-client {
        align-items: center;
        flex-direction: row;
    }

    .section-head,
    .gallery-card-top,
    .project-card-header,
    .gallery-admin-header,
    .modal-card-head,
    .tree-group summary,
    .tree-scene summary {
        flex-direction: column;
        align-items: start;
    }

    .topbar-nav,
    .actions,
    .compact-actions,
    .scene-picker,
    .tag-row,
    .gallery-admin-meta,
    .project-metrics,
    .project-assignment-scenes,
    .project-scene-tag-list {
        width: 100%;
    }

    .topbar-nav {
        gap: 0.6rem;
    }

    .topbar-client .topbar-nav {
        width: auto;
    }

    .topbar-nav a {
        flex: 1 1 140px;
    }

    .topbar-client .topbar-nav a {
        flex: 0 0 auto;
    }

    .actions > *,
    .compact-actions > *,
    .scene-picker > *,
    .topbar-nav > * {
        flex: 1 1 100%;
    }

    .actions .button,
    .compact-actions .button,
    .scene-picker .button {
        width: 100%;
    }

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

    .gallery-grid,
    .gallery-admin-grid,
    .photo-grid,
    .stats-grid,
    .admin-grid,
    .slideshow-grid {
        grid-template-columns: 1fr;
    }

    .slideshow-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    }

    .table-wrap {
        overflow: visible;
    }

    .table,
    .table thead,
    .table tbody,
    .table tr,
    .table th,
    .table td {
        display: block;
        width: 100%;
    }

    .table thead {
        display: none;
    }

    .table tr {
        padding: 0.9rem 0;
        border-bottom: 1px solid var(--line);
    }

    .table td {
        border: 0;
        padding: 0.42rem 0;
    }

    .table td .actions,
    .table td .compact-actions {
        gap: 0.55rem;
    }

    .table td::before {
        content: attr(data-label);
        display: block;
        margin-bottom: 0.18rem;
        color: var(--muted);
        font-size: 0.78rem;
        text-transform: uppercase;
        letter-spacing: 0.08em;
    }

    .two-up {
        grid-template-columns: 1fr;
    }

    .search-form {
        grid-template-columns: 1fr;
    }

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

    .selects-contact-card {
        grid-template-columns: 1fr;
    }

    .gallery-admin-preview {
        min-height: 0;
    }

    .project-scene-tag-card,
    .project-assignment-card,
    .scene-item,
    .content-card,
    .panel-card,
    .auth-card {
        padding: 1rem;
    }

    .lightbox {
        padding: 1rem 0.5rem;
    }

    .lightbox-toolbar {
        top: 0.75rem;
        left: 0.75rem;
        right: 0.75rem;
    }

    .lightbox-nav {
        position: absolute;
        bottom: 1rem;
    }

    .lightbox-prev {
        left: 1rem;
    }

    .lightbox-next {
        right: 1rem;
    }
}
