html {
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    color: #1a1a2e;
}

body {
    margin: 0;
}

h1:focus {
    outline: none;
}

.app-header {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    padding: 0.7rem 1.5rem;
    background: var(--surface, #fff);
    color: var(--ink, #221d16);
    border-bottom: 1px solid var(--border, #ececf2);
    position: sticky;
    top: 0;
    z-index: 10;
}

.app-brand {
    color: var(--ink, #221d16);
    font-weight: 700;
    font-size: 1.15rem;
    text-decoration: none;
}

.app-user {
    opacity: 0.85;
    font-size: 0.9rem;
}

.alert-ok {
    background: #e8f8ec;
    border-color: #26b050;
    color: #157a36;
}

.smtp-form {
    display: block;
    max-width: 34rem;
}
/* Branding sections follow the design's 1040px content width.
   .inline-form.smtp-form must out-rank the plain .inline-form flex row
   defined later in this file — these are stacked cards, not filter rows. */
.inline-form.smtp-form {
    display: block;
}
.smtp-form.wide {
    max-width: 65rem;
}

.form-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 0.6rem;
    margin: 0.75rem 0;
}

.form-grid label {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    font-size: 0.85rem;
    min-width: 0;
}
/* Let inputs shrink below their default intrinsic width inside grid tracks. */
.form-grid input,
.form-grid select,
.form-grid textarea { min-width: 0; max-width: 100%; box-sizing: border-box; }
/* One column on phones — two cramped inputs side by side is unusable. */
@media (max-width: 560px) {
    .form-grid { grid-template-columns: 1fr; }
}

.form-grid input[type=text],
.form-grid input:not([type]) ,
.form-grid input[type=number],
.form-grid input[type=password] {
    padding: 0.35rem 0.5rem;
    border: 1px solid #c5c5d2;
    border-radius: 4px;
}

.logout-form {
    margin: 0;
}

.app-main {
    padding: 1.25rem;
    max-width: 60rem;
    margin: 0 auto;
}

/* Blazor unhandled-error banner. MUST be global (not scoped to one layout) —
   both MainLayout and PublicLayout render a #blazor-error-ui, and Blazor's JS
   flips it to display:block only on a real circuit error. */
#blazor-error-ui {
    color-scheme: light only;
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    box-sizing: border-box;
    padding: 0.6rem 1.25rem 0.7rem;
    background: lightyellow;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    z-index: 1000;
}
#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

.login-page {
    max-width: 22rem;
    margin: 4rem auto;
}

.login-shell {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: #f2f2f7;
}

.login-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 12px 40px rgba(26, 26, 46, 0.18);
    padding: 2.25rem 2rem;
    width: 100%;
    max-width: 22rem;
}

.login-card h1 {
    margin-top: 0;
    font-size: 1.4rem;
}

.login-logo {
    max-height: 3.5rem;
    max-width: 14rem;
    margin-bottom: 0.75rem;
}

.pub-banner {
    border-radius: 10px;
    padding: 2.5rem 1.75rem;
    margin-bottom: 1.5rem;
    background: #eef1fb;
    background-size: cover;
    background-position: center;
}

.pub-banner.has-image {
    color: #fff;
}

.pub-banner.has-image .pub-banner-text {
    background: rgba(20, 20, 40, 0.45);
    display: inline-block;
    padding: 1rem 1.5rem;
    border-radius: 8px;
}

.pub-banner h2 {
    margin: 0;
    font-size: 1.7rem;
}

.pub-banner p {
    margin: 0.4rem 0 0;
}

.branding-images {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    margin-top: 0.75rem;
}

@media (max-width: 900px) {
    .branding-images { grid-template-columns: 1fr; }
}

.branding-image-block {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    align-items: center;
    padding: 1.6rem 1.1rem;
    background: var(--surface, #fff);
    border: 1.5px dashed var(--border2, #c5c5d2);
    border-radius: 14px;
    text-align: center;
}

.branding-image-block strong { font-size: 0.9rem; }

.bib-icon {
    width: 42px; height: 42px; border-radius: 50%;
    background: var(--tint, #f0f0f2); color: var(--accent, #9a6a42);
    display: grid; place-items: center;
}

.bib-hint { font-size: 0.78rem; color: var(--text3, #a1a1a6); }

.bib-actions { display: flex; align-items: center; gap: 0.6rem; margin-top: 3px; }

.form-row {
    margin-bottom: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.form-row input[type=text],
.form-row input[type=password] {
    padding: 0.45rem 0.6rem;
    border: 1px solid #c5c5d2;
    border-radius: 4px;
}

button[type=submit] {
    padding: 0.45rem 1.1rem;
    border: none;
    border-radius: 4px;
    background: #3b4a8f;
    color: #fff;
    cursor: pointer;
}

.alert {
    background: #fde8e8;
    border: 1px solid #e50000;
    border-radius: 4px;
    color: #a00;
    padding: 0.5rem 0.75rem;
    margin: 0.75rem 0;
}

.upload-box {
    margin: 1rem 0;
}

.doc-table {
    width: 100%;
    border-collapse: collapse;
    /* Wide data tables scroll horizontally on mobile instead of forcing the
       whole page wider (which would zoom the layout out to desktop). */
    display: block;
    overflow-x: auto;
}

.doc-table th,
.doc-table td {
    text-align: left;
    padding: 0.5rem 0.6rem;
    border-bottom: 1px solid #ececf2;
}

.doc-table th {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #8a8aa0;
    font-weight: 600;
}

.doc-table tbody tr {
    transition: background 0.12s;
}

.doc-table tbody tr:hover {
    background: #f7f7fc;
}

.doc-table tbody tr:hover .actions-col .link {
    opacity: 1;
}

.actions-col .link {
    opacity: 0.45;
    transition: opacity 0.12s;
}

.breadcrumb {
    margin: 0.5rem 0 1rem;
    font-size: 0.95rem;
}

.crumb {
    text-decoration: none;
    color: #3b4a8f;
}

.crumb.current {
    color: #1a1a2e;
    font-weight: 600;
}

.crumb-sep {
    margin: 0 0.35rem;
    color: #9a9aa8;
}

.toolbar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.toolbar button,
.upload-button {
    padding: 0.4rem 0.9rem;
    border: 1px solid #c5c5d2;
    border-radius: 4px;
    background: #f6f6fa;
    color: #1a1a2e;
    cursor: pointer;
    font-size: 0.9rem;
}

.upload-button {
    display: inline-block;
}

.upload-button input[type=file] {
    display: none;
}

.trash-link {
    margin-left: auto;
    color: #3b4a8f;
    text-decoration: none;
    font-size: 0.9rem;
}

.inline-form {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    padding: 0.6rem;
    background: #f6f6fa;
    border: 1px solid #e3e3ea;
    border-radius: 4px;
}

.inline-form input,
.inline-form select {
    padding: 0.35rem 0.5rem;
    border: 1px solid #c5c5d2;
    border-radius: 4px;
    font-family: inherit;
}

.inline-form button {
    padding: 0.35rem 0.8rem;
    border: none;
    border-radius: 4px;
    background: #3b4a8f;
    color: #fff;
    cursor: pointer;
}

.inline-form button.secondary {
    background: #e3e3ea;
    color: #1a1a2e;
}

.picker select {
    font-family: ui-monospace, Consolas, monospace;
    white-space: pre;
}

.thumb-col {
    width: 3rem;
}

.thumb {
    width: 2.5rem;
    height: 2.5rem;
    object-fit: cover;
    border-radius: 3px;
    display: block;
}

.type-icon {
    font-size: 1.5rem;
    line-height: 1;
}

.folder-icon {
    vertical-align: middle;
    display: inline-block;
}

.color-swatch {
    width: 1.4rem;
    height: 1.4rem;
    border: 1px solid rgba(0, 0, 0, 0.15);
    border-radius: 4px;
    cursor: pointer;
    padding: 0;
}

.appearance-panel {
    flex-direction: column;
    align-items: stretch;
}

.appearance-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
    margin: 0.2rem 0;
}

.icon-choice {
    background: #fff;
    border: 1px solid #d5d5e0;
    border-radius: 6px;
    padding: 0.2rem 0.35rem;
    cursor: pointer;
    line-height: 0;
}

.icon-choice.active {
    border-color: var(--brand, #3b4a8f);
    box-shadow: 0 0 0 2px rgba(59, 74, 143, 0.25);
}

/* ---------- File-type badges ---------- */

.ftype-glyph {
    font-size: 1.5rem;
    line-height: 1;
}

.ftype-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.4rem;
    padding: 0.15rem 0.35rem;
    background: var(--ft, #667);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    border-radius: 4px;
}

.card-media .ftype-badge {
    min-width: 3.4rem;
    padding: 0.5rem 0.7rem;
    font-size: 1rem;
    border-radius: 6px;
}

.card-media .ftype-glyph {
    font-size: 3rem;
}

.actions-col {
    white-space: nowrap;
    text-align: right;
    width: 12rem;
}

button.link {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    padding: 0.1rem 0.25rem;
}

button.link.danger {
    color: #a00;
    font-size: 0.85rem;
}

a.link {
    text-decoration: none;
    padding: 0.1rem 0.25rem;
}

.empty-hint {
    color: #71718a;
    margin-top: 1.5rem;
}

/* ---------- Drag & drop ---------- */

.drop-container {
    position: relative;
    min-height: 8rem;
}

.drop-container.file-drop-active {
    outline: 2px dashed var(--brand, #3b4a8f);
    outline-offset: -2px;
    border-radius: 8px;
    background: #f7f9ff;
}

.dropzone-indicator {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    color: #3b4a8f;
    background: rgba(247, 249, 255, 0.9);
    z-index: 5;
    pointer-events: none;
    border-radius: 8px;
}

.dropzone-overlay {
    position: absolute;
    inset: 0;
    opacity: 0;
    z-index: 6;
    cursor: copy;
}

tr[draggable="true"] {
    cursor: grab;
}

tr.drop-target {
    outline: 2px solid var(--brand, #3b4a8f);
    outline-offset: -2px;
    background: #eef1fb;
}

tr.drop-before td {
    border-top: 3px solid var(--brand, #3b4a8f);
}

.share-panel {
    flex-wrap: wrap;
}

.grant-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    background: #e8ecf8;
    border-radius: 12px;
    padding: 0.15rem 0.3rem 0.15rem 0.6rem;
    font-size: 0.85rem;
}

.share-page {
    max-width: 52rem;
    margin: 2rem auto;
}

.share-meta {
    color: #71718a;
}

.share-preview {
    max-width: 100%;
    max-height: 70vh;
    border-radius: 6px;
}

.share-frame {
    width: 100%;
    height: 75vh;
    border: 1px solid #e3e3ea;
    border-radius: 6px;
}

.share-big-icon {
    font-size: 5rem;
    margin: 2rem 0;
}

.button-link {
    display: inline-block;
    padding: 0.5rem 1.2rem;
    background: #3b4a8f;
    color: #fff;
    border-radius: 4px;
    text-decoration: none;
    border: none;
    font: inherit;
    cursor: pointer;
}

/* two-class specificity so the later `.button-link { background: var(--brand) }`
   override cannot swallow the label (blue-on-blue) */
.button-link.button-secondary {
    background: #eef1fb;
    color: var(--brand, #3b4a8f);
}

.viewer-actions {
    display: flex;
    gap: 0.6rem;
    justify-content: center;
}

.created-link {
    font-family: ui-monospace, Consolas, monospace;
    font-size: 0.8rem;
}

.stats-panel {
    display: block;
}

.stats-head {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.stats-head button {
    margin-left: auto;
}

.stats-table {
    width: 100%;
    font-size: 0.85rem;
    border-collapse: collapse;
}

.stats-table td {
    padding: 0.2rem 0.6rem 0.2rem 0;
    border-bottom: 1px solid #e3e3ea;
    color: #454560;
}

.row-inactive td {
    opacity: 0.5;
}

.disk-bar {
    height: 1.1rem;
    background: #ececf2;
    border-radius: 6px;
    overflow: hidden;
    max-width: 40rem;
}

.disk-used {
    height: 100%;
    background: var(--brand, #3b4a8f);
}

.log-error td {
    background: #fdecec;
}

.log-source {
    color: #8a8aa0;
    font-size: 0.85rem;
}

.log-exc {
    white-space: pre-wrap;
    font-size: 0.75rem;
    background: #f6f6fa;
    padding: 0.5rem;
    border-radius: 4px;
    max-height: 16rem;
    overflow: auto;
}

.impersonation-bar {
    background: #ffe9b8;
    border-bottom: 1px solid #e0b84a;
    color: #6b4e00;
    padding: 0.5rem 1.25rem;
    font-size: 0.9rem;
    text-align: center;
}

.impersonation-bar a {
    color: #6b4e00;
    font-weight: 600;
    margin-left: 0.5rem;
}

.smtp-form label.full {
    display: block;
    margin: 0.5rem 0;
}

.smtp-form label.full input,
.smtp-form label.full textarea {
    width: 100%;
    padding: 0.4rem 0.5rem;
    border: 1px solid #c5c5d2;
    border-radius: 4px;
    font-family: inherit;
    box-sizing: border-box;
}

.comment-add {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.comment-row {
    border-bottom: 1px solid #e3e3ea;
    padding: 0.4rem 0;
    font-size: 0.9rem;
}

.comment-row p {
    margin: 0.2rem 0 0;
}

.comment-date {
    color: #9a9aa8;
    font-size: 0.8rem;
    margin-left: 0.5rem;
}

.stat-tiles {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
    gap: 0.75rem;
    margin: 1rem 0 2rem;
}

.stat-tile {
    background: #f6f6fa;
    border: 1px solid #e3e3ea;
    border-radius: 6px;
    padding: 0.9rem;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
}

.stat-label {
    color: #71718a;
    font-size: 0.85rem;
}

/* ---------- Tags ---------- */

.tag-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.15rem;
    background: #eef1fb;
    color: #3b4a8f;
    border-radius: 999px;
    padding: 0.1rem 0.55rem;
    font-size: 0.78rem;
    margin: 0 0.15rem;
}

.row-tags {
    margin-left: 0.4rem;
}

.tag-editor {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
}

.tag-editor input {
    padding: 0.3rem 0.5rem;
    border: 1px solid #c5c5d2;
    border-radius: 4px;
}

.tag-editor button {
    padding: 0.3rem 0.7rem;
    border: none;
    border-radius: 4px;
    background: #3b4a8f;
    color: #fff;
    cursor: pointer;
}

.name-link {
    background: none;
    border: none;
    padding: 0;
    font: inherit;
    color: #1a1a2e;
    cursor: pointer;
    text-align: left;
}

.name-link:hover {
    color: #3b4a8f;
    text-decoration: underline;
}

/* ---------- Asset detail overlay ---------- */

.overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 15, 30, 0.75);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    padding: 2rem;
}

.detail-card {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 18px 60px rgba(0, 0, 0, 0.35);
    display: grid;
    grid-template-columns: minmax(0, 1fr) 20rem;
    max-width: 72rem;
    width: 100%;
    max-height: 88vh;
    overflow: hidden;
}

.detail-media {
    background: #101018;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 24rem;
}

.detail-media img,
.detail-media video {
    max-width: 100%;
    max-height: 88vh;
    object-fit: contain;
}

.detail-media iframe {
    width: 100%;
    height: 88vh;
    border: none;
    background: #fff;
}

.detail-side {
    padding: 1.25rem;
    overflow-y: auto;
}

.detail-head {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
}

.detail-head h2 {
    margin: 0 auto 0.75rem 0;
    font-size: 1.1rem;
    word-break: break-word;
}

.detail-info {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.25rem 0.9rem;
    font-size: 0.88rem;
    margin: 0.5rem 0 1rem;
}

.detail-info dt {
    color: #8a8aa0;
}

.detail-info dd {
    margin: 0;
    word-break: break-word;
}

.detail-side h4 {
    margin: 1rem 0 0.5rem;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #8a8aa0;
}

.detail-actions {
    margin-top: 1.25rem;
}

@media (max-width: 56rem) {
    .detail-card {
        grid-template-columns: 1fr;
        overflow-y: auto;
    }

    .detail-media {
        min-height: 14rem;
    }
}

/* ---------- Guest gallery ---------- */

.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.card {
    position: relative;
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid #ececf2;
    border-radius: 10px;
    overflow: hidden;
    text-decoration: none;
    color: #1a1a2e;
    transition: transform 0.12s, box-shadow 0.12s;
}

.card-link {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    flex: 1;
}

/* Card basket action (design FileCard): glass circle, accent check when in basket */
.card-basket {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 2;
    width: 29px;
    height: 29px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: #fff;
    display: grid;
    place-items: center;
    cursor: pointer;
    text-decoration: none;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.28);
    opacity: 0;
    transition: opacity 0.2s, background 0.2s;
}

.card-basket:hover { background: rgba(255, 255, 255, 0.4); }
.card-basket.in-basket { background: var(--accent, #9a6a42); opacity: 1; }
.card:hover .card-basket { opacity: 1; }

/* Admin "add to collection" — second glass circle beside the basket */
.card-coll {
    position: absolute;
    top: 10px;
    right: 46px;
    z-index: 2;
    width: 29px;
    height: 29px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: #fff;
    display: grid;
    place-items: center;
    cursor: pointer;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.28);
    opacity: 0;
    transition: opacity 0.2s, background 0.2s;
}
.card-coll:hover { background: rgba(255, 255, 255, 0.4); }
.card:hover .card-coll { opacity: 1; }

/* ⋯ menu trigger on cards (name row) and table rows */
.card-more-slot {
    position: absolute;
    right: 4px;
    bottom: 4px;
    z-index: 2;
}
.more-btn {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: var(--text2, #6e6e73);
    display: inline-grid;
    place-items: center;
    cursor: pointer;
    vertical-align: middle;
    transition: background 0.2s;
}
.more-btn:hover { background: var(--hover, rgba(0, 0, 0, 0.05)); }

.row-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: var(--text2, #6e6e73);
    display: inline-grid;
    place-items: center;
    cursor: pointer;
    vertical-align: middle;
    text-decoration: none;
    transition: background 0.2s;
}
.row-icon:hover { background: var(--hover, rgba(0, 0, 0, 0.05)); color: var(--ink, #221d16); }
.row-icon.starred { color: var(--accent, #9a6a42); }

@media (hover: none) {
    .card-basket, .card-coll { opacity: 1; }
}

/* Dark context menu (design FileCard menu) */
@keyframes dcPop {
    from { opacity: 0; transform: translateY(-6px) scale(0.97); }
    to { opacity: 1; transform: none; }
}
.ctx-backdrop {
    position: fixed;
    inset: 0;
    z-index: 55;
    background: transparent;
}
.ctx-menu {
    position: absolute;
    top: calc(100% - 4px);
    right: 6px;
    width: 230px;
    background: #2a2a2c;
    color: #f5f5f7;
    border-radius: 16px;
    padding: 7px;
    box-shadow: 0 20px 50px -12px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.05);
    z-index: 60;
    animation: dcPop 0.18s cubic-bezier(0.22, 1, 0.36, 1);
    text-align: left;
}
.actions-col { position: relative; }
.actions-col .ctx-menu { top: auto; right: 40px; }
/* cards clip overflow for rounded corners — release it while a menu is open */
.card:has(> .ctx-menu) { overflow: visible; z-index: 5; }
/* the list table scrolls horizontally on mobile (display:block below), which also
   clips vertically — release it while a row menu is open so the menu can escape */
.doc-table:has(.ctx-menu) { overflow: visible; }
.ctx-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    padding: 8px 11px;
    border-radius: 10px;
    border: none;
    background: transparent;
    color: inherit;
    font-family: inherit;
    font-size: 14px;
    cursor: pointer;
    text-align: left;
    white-space: nowrap;
}
.ctx-item:hover { background: rgba(255, 255, 255, 0.1); }
.ctx-item.danger { color: #ff5a4f; }
.ctx-item.danger:hover { background: rgba(255, 90, 79, 0.15); }
.ctx-sep { height: 1px; background: rgba(255, 255, 255, 0.09); margin: 5px 8px; }

/* Add-to-collection dialog (design) */
.coll-overlay {
    position: fixed;
    inset: 0;
    background: rgba(20, 15, 8, 0.36);
    z-index: 96;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.coll-dialog {
    width: 430px;
    max-width: 100%;
    max-height: 560px;
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 30px 80px -22px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: dcPop 0.2s cubic-bezier(0.22, 1, 0.36, 1);
}
.coll-head {
    padding: 22px 24px 16px;
    border-bottom: 1px solid var(--border, rgba(34, 29, 22, 0.08));
}
.coll-title-row { display: flex; align-items: center; gap: 9px; }
.coll-title {
    font-family: var(--serif, Georgia, serif);
    font-size: 24px;
    font-weight: 600;
    color: var(--ink, #221d16);
    flex: 1;
}
.coll-item {
    display: block;
    font-size: 13px;
    color: var(--text2, #7c7466);
    margin-top: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.coll-list {
    flex: 1;
    overflow: auto;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.coll-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 12px;
    border: none;
    background: transparent;
    cursor: pointer;
    text-align: left;
    width: 100%;
    color: var(--accent, #9a6a42);
}
.coll-row:hover { background: var(--tint, #f2ede4); }
.coll-ico {
    width: 36px;
    height: 36px;
    border-radius: 9px;
    background: var(--sel, rgba(154, 106, 66, 0.12));
    display: grid;
    place-items: center;
    flex-shrink: 0;
}
.coll-name-col {
    flex: 1;
    min-width: 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--ink, #221d16);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.coll-name-col small { display: block; font-size: 12px; font-weight: 400; color: var(--text2, #7c7466); }
.coll-foot {
    padding: 14px 16px 18px;
    border-top: 1px solid var(--border, rgba(34, 29, 22, 0.08));
    display: flex;
    gap: 9px;
}
.coll-foot input {
    flex: 1;
    height: 44px;
    border-radius: 12px;
    border: 1px solid var(--border2, rgba(34, 29, 22, 0.1));
    background: #fff;
    padding: 0 14px;
    font-size: 13.5px;
    color: var(--ink, #221d16);
    outline: none;
    box-sizing: border-box;
}
.coll-foot button {
    height: 44px;
    padding: 0 20px;
    border-radius: 12px;
    background: var(--accent, #9a6a42);
    color: #fff;
    border: none;
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 7px;
}

/* ---------- Basket drawer (design: left panel, CSS-only, no JS) ---------- */

.drawer-check {
    display: none;
}

.drawer-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(20, 15, 8, 0.30);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
    z-index: 90;
}

.basket-drawer {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(24.5rem, 94vw);
    background: var(--bg, #faf7f2);
    border-right: 1px solid var(--border, rgba(34, 29, 22, 0.08));
    transform: translateX(-102%);
    transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.45s ease;
    z-index: 95;
    display: flex;
    flex-direction: column;
}

.drawer-check:checked ~ .drawer-backdrop {
    opacity: 1;
    pointer-events: auto;
}

.drawer-check:checked ~ .basket-drawer {
    transform: translateX(0);
    box-shadow: 24px 0 70px -24px rgba(0, 0, 0, 0.42);
}

.drawer-head {
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 24px 22px 17px;
    border-bottom: 1px solid var(--border, rgba(34, 29, 22, 0.08));
}

.drawer-emblem {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: var(--sel, rgba(154, 106, 66, 0.12));
    color: var(--accent, #9a6a42);
    display: grid;
    place-items: center;
    flex-shrink: 0;
}

.drawer-titles { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.drawer-title {
    font-family: var(--serif, Georgia, serif);
    font-size: 23px;
    font-weight: 600;
    color: var(--ink, #221d16);
}
.drawer-sub { font-size: 12.5px; color: var(--text2, #7c7466); }

.drawer-close {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    color: var(--text2, #7c7466);
    display: grid;
    place-items: center;
    cursor: pointer;
    flex-shrink: 0;
}

.drawer-close:hover {
    background: var(--hover, rgba(34, 29, 22, 0.05));
}

.drawer-empty {
    margin: auto;
    text-align: center;
    color: var(--text3, #a89f90);
    padding: 36px 18px;
    max-width: 280px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    font-size: 12.5px;
    line-height: 1.5;
}
.drawer-empty strong { font-size: 14px; color: var(--ink, #221d16); }
.drawer-empty-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 9px;
    border-radius: 50%;
    background: var(--tint, #f2ede4);
    display: grid;
    place-items: center;
}

.drawer-items {
    flex: 1;
    overflow-y: auto;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.drawer-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px;
    border-radius: 13px;
    background: var(--surface, #fff);
    box-shadow: 0 0 0 1px var(--border, rgba(34, 29, 22, 0.08));
    font-size: 13.5px;
}

.drawer-thumb {
    width: 52px;
    height: 52px;
    border-radius: 9px;
    object-fit: cover;
    flex-shrink: 0;
    background: var(--tint, #f2ede4);
}
.drawer-thumb-icon { display: grid; place-items: center; font-size: 1.4rem; }

.drawer-item-name {
    flex: 1;
    min-width: 0;
    font-weight: 600;
    color: var(--ink, #221d16);
    word-break: break-word;
    line-height: 1.3;
}

.drawer-item-name small { display: block; font-size: 12px; font-weight: 400; color: var(--text2, #7c7466); }

.drawer-remove {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    color: var(--text3, #a89f90);
    display: grid;
    place-items: center;
    flex-shrink: 0;
    text-decoration: none;
}
.drawer-remove:hover { background: var(--hover, rgba(34, 29, 22, 0.05)); color: var(--ink, #221d16); }

.drawer-foot {
    padding: 16px 18px 20px;
    border-top: 1px solid var(--border, rgba(34, 29, 22, 0.08));
    display: flex;
    flex-direction: column;
    gap: 11px;
}
.drawer-foot-row { display: flex; gap: 10px; }
.drawer-btn {
    flex: 1;
    height: 46px;
    border-radius: 999px;
    border: 1px solid var(--border2, rgba(34, 29, 22, 0.1));
    background: transparent;
    color: var(--ink, #221d16);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.drawer-btn:hover { background: var(--hover, rgba(34, 29, 22, 0.05)); }
.drawer-btn-primary {
    background: var(--accent, #9a6a42);
    border: none;
    color: #fff;
}
.drawer-btn-primary:hover { background: var(--accent, #9a6a42); filter: brightness(1.08); }
.drawer-clear {
    align-self: center;
    font-size: 12.5px;
    color: var(--text2, #7c7466);
    text-decoration: none;
}
.drawer-clear:hover { color: var(--ink, #221d16); text-decoration: underline; }

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 22px rgba(26, 26, 46, 0.12);
}

.card-media {
    height: 9rem;
    background: #f2f2f7;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.card-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card-icon {
    font-size: 3rem;
}

.card-name {
    padding: 0.55rem 0.7rem 0.15rem;
    font-size: 0.88rem;
    font-weight: 600;
    word-break: break-word;
}

.card-meta {
    padding: 0 0.7rem 0.6rem;
    font-size: 0.78rem;
    color: #8a8aa0;
}

.card-folder .card-media {
    background: #eef1fb;
}

/* List mode: same cards laid out as horizontal rows */
.gallery.gallery-list {
    grid-template-columns: 1fr;
    gap: 0.4rem;
}

.gallery-list .card {
    flex-direction: row;
    align-items: center;
}

.gallery-list .card-link {
    flex-direction: row;
    align-items: center;
    gap: 0.8rem;
    width: 100%;
}

.gallery-list .card-media {
    width: 3rem;
    height: 3rem;
    flex-shrink: 0;
}

.gallery-list .card-icon {
    font-size: 1.6rem;
}

.gallery-list .card-name {
    padding: 0;
    flex: 1;
}

.gallery-list .card-meta {
    padding: 0 1rem 0 0;
}

.gallery-list .card-basket {
    position: static;
    opacity: 1;
    box-shadow: none;
    background: none;
    align-self: center;
}

.view-toggle {
    display: inline-flex;
    gap: 0;
    border: 1px solid #d5d5e0;
    border-radius: 6px;
    overflow: hidden;
}

.view-toggle a {
    padding: 0.35rem 0.7rem;
    text-decoration: none;
    color: #55556a;
    background: #fff;
    font-size: 0.95rem;
}

.view-toggle a.active,
.view-toggle button.active {
    background: var(--brand, #3b4a8f);
    color: #fff;
}

.view-toggle button {
    border: none;
    background: #fff;
    color: #55556a;
    padding: 0.35rem 0.7rem;
    cursor: pointer;
    font-size: 0.95rem;
}

.toolbar-view {
    margin-left: 0.5rem;
}

.card-link-btn {
    border: none;
    background: none;
    cursor: pointer;
    font: inherit;
    text-align: left;
    padding: 0;
}

.listing-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 0.5rem 0 1rem;
}

.listing-count {
    color: #71718a;
    font-size: 0.9rem;
}

.share-viewer {
    text-align: center;
}

/* ---------- Public front page (legacy portal layout) ---------- */

.pub-root {
    min-height: 100vh;
    background: #fff;
}

.pub-shell {
    display: grid;
    grid-template-columns: 17rem minmax(0, 1fr) 16rem;
    min-height: calc(100vh - 4rem);
}

.pub-tree {
    border-right: 1px solid #ececf2;
    background: #fafafc;
    padding: 1rem 0.75rem;
    font-size: 0.92rem;
}

.pub-tree ul {
    list-style: none;
    margin: 0;
    padding-left: 0.9rem;
}

.pub-tree > ul {
    padding-left: 0;
}

.tree-node a {
    display: block;
    padding: 0.3rem 0.5rem;
    color: #35354a;
    text-decoration: none;
    border-radius: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tree-node a:hover {
    background: #eef1fb;
}

.tree-node.tree-current > a {
    background: var(--brand, #3b4a8f);
    color: #fff;
    font-weight: 600;
}

.pub-main {
    padding: 1.25rem 1.75rem;
}

.pub-heading {
    margin-top: 0;
}

.pub-tagline {
    color: #71718a;
    font-size: 1.05rem;
    margin-top: 0;
}

.pub-info {
    border-left: 1px solid #ececf2;
    padding: 1.25rem;
    font-size: 0.9rem;
}

.pub-info h3 {
    margin: 0 0 1rem;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #8a8aa0;
}

.pub-info-icon {
    font-size: 3.2rem;
    text-align: center;
    margin: 0.5rem 0;
}

.pub-info-name {
    text-align: center;
    font-weight: 600;
    word-break: break-word;
}

@media (max-width: 64rem) {
    .pub-shell {
        grid-template-columns: 1fr;
    }

    .pub-tree,
    .pub-info {
        display: none;
    }
}

.public-chip {
    background: #e3f3e8;
    color: #157a36;
    margin-left: 0.4rem;
}

.branding-logo-preview {
    max-height: 4rem;
    max-width: 14rem;
    background: #f2f2f7;
    padding: 0.5rem;
    border-radius: 6px;
}

.button-link {
    background: var(--brand, #3b4a8f);
}

.share-viewer .breadcrumb,
.share-viewer > p:first-child {
    text-align: left;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}
/* =====================================================================
   Elegant seasonal theme (design handoff: turn-2 direction)
   Season palettes + display serif + restyled surfaces via CSS vars.
   ===================================================================== */

body.season-autumn {
    --bg: #faf7f2; --tint: #f2ede4; --ink: #221d16; --text2: #6b6355; --text3: #7a7160;
    --accent: #9a6a42; --grad1: #c19a63; --grad2: #8a5a33;
    --ink-rgb: 34,29,22; --accent-rgb: 154,106,66;
}
body.season-summer {
    --bg: #f5fafa; --tint: #e6f0ef; --ink: #142428; --text2: #4f6668; --text3: #5d7476;
    --accent: #257d8f; --grad1: #58aebf; --grad2: #1e6b7c;
    --ink-rgb: 20,36,40; --accent-rgb: 37,125,143;
}
body.season-winter {
    --bg: #f6f8fa; --tint: #e8edf3; --ink: #161c26; --text2: #535e6c; --text3: #626d7b;
    --accent: #46618f; --grad1: #8296b9; --grad2: #35496f;
    --ink-rgb: 22,28,38; --accent-rgb: 70,97,143;
}
body.season-spring {
    --bg: #f8faf4; --tint: #ebf1e2; --ink: #1b2317; --text2: #5a6550; --text3: #68735c;
    --accent: #61804d; --grad1: #90ad78; --grad2: #4c663c;
    --ink-rgb: 27,35,23; --accent-rgb: 97,128,77;
}
body[class*="season-"] {
    --surface: #fff;
    --border: rgba(var(--ink-rgb), 0.08);
    --border2: rgba(var(--ink-rgb), 0.10);
    --hover: rgba(var(--ink-rgb), 0.05);
    --sel: rgba(var(--accent-rgb), 0.12);
    --radius: 16px;
    --shadow-rest: 0 1px 3px rgba(0,0,0,.07);
    --shadow-lift: 0 24px 55px -14px rgba(0,0,0,.28);
    --brand: var(--accent);
    --serif: 'Cormorant Garamond', Georgia, serif;
}

/* Base surfaces */
body[class*="season-"] {
    background: var(--bg);
    color: var(--ink);
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue", Helvetica, Arial, sans-serif;
}
body[class*="season-"] .app-main,
body[class*="season-"] .pub-root { background: var(--bg); }

/* Display serif headings */
body[class*="season-"] h1,
body[class*="season-"] .pub-heading,
body[class*="season-"] .hero-inner h1,
body[class*="season-"] .login-card h1 {
    font-family: var(--serif);
    font-weight: 500;
    letter-spacing: -0.01em;
}
body[class*="season-"] h1 { font-size: 2.1rem; }

/* Buttons → accent pills */
body[class*="season-"] button[type=submit],
body[class*="season-"] .button-link,
body[class*="season-"] .toolbar > button:first-child {
    background: var(--accent);
    border-radius: 999px;
    border: none;
    color: #fff;
    padding: 0.5rem 1.25rem;
    font-weight: 600;
}
body[class*="season-"] .button-link.button-secondary {
    background: var(--sel);
    color: var(--accent);
}

/* Cards → elegant radius, settled hover lift */
body[class*="season-"] .card {
    border: none;
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow-rest);
    transition: transform .55s cubic-bezier(.22,1,.36,1), box-shadow .55s cubic-bezier(.22,1,.36,1);
}
body[class*="season-"] .card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lift);
}
body[class*="season-"] .card-media { background: var(--tint); }
body[class*="season-"] .card-folder .card-media { background: var(--sel); }

/* Tables */
body[class*="season-"] .doc-table th {
    color: var(--text3);
    border-bottom-color: var(--border);
}
body[class*="season-"] .doc-table td { border-bottom-color: var(--border); }
body[class*="season-"] .doc-table tbody tr:hover { background: var(--hover); }

/* Breadcrumb + chrome accents */
body[class*="season-"] .crumb { color: var(--accent); }
body[class*="season-"] .crumb.current { color: var(--ink); }
body[class*="season-"] .pub-tree { background: var(--tint); border-right-color: var(--border); }
body[class*="season-"] .pub-info { border-left-color: var(--border); }

/* Login card */
body[class*="season-"] .login-shell { background: var(--tint); }
body[class*="season-"] .login-card { border-radius: 22px; box-shadow: 0 18px 60px rgba(var(--ink-rgb), 0.14); }

/* Tags / chips inherit accent */
body[class*="season-"] .tag-chip { background: var(--sel); color: var(--accent); }

/* Section headings small-caps "VIEW ALL" style link */
.section-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin: 1.5rem 0 0.75rem;
}
.section-head h2 { font-family: var(--serif); font-weight: 500; font-size: 1.9rem; margin: 0; }
.view-all {
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--accent);
    text-decoration: none;
}

/* Branding: seasonal scheme cards */
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.card-head h3 { margin: 0; }
.season-cards { display: flex; flex-wrap: wrap; gap: 0.9rem; margin-top: 0.75rem; }
.season-cards.grid4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; }
@media (max-width: 900px) {
    .season-cards.grid4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.season-cards.grid4 .season-card { width: auto; }
/* button.season-card must out-rank both the legacy ".inline-form button"
   indigo style and the seasonal pill overrides */
.inline-form button.season-card {
    display: flex; flex-direction: column; align-items: center; gap: 0.6rem;
    width: 12.5rem; padding: 0.65rem; cursor: pointer;
    background: #fff; border: 1px solid var(--border2, #ddd); border-radius: 16px;
    color: var(--ink, #221d16); font: inherit;
    transition: box-shadow .2s;
}
.inline-form button.season-card.active { box-shadow: 0 0 0 2px var(--sa), 0 8px 22px rgba(0,0,0,.1); border-color: transparent; }
/* Photo from /img/seasons/{season}.jpg with the season-accent wash;
   the bottom gradient shows when the image file is missing. */
.season-photo {
    position: relative; width: 100%; height: 7.4rem; border-radius: 11px; overflow: hidden;
    background-image:
        linear-gradient(to top, color-mix(in srgb, var(--sa) 40%, transparent), transparent 60%),
        var(--img, none),
        linear-gradient(160deg, var(--sa), rgba(0,0,0,.15));
    background-size: cover;
    background-position: center;
}
.season-radio {
    position: absolute; top: 10px; right: 10px; width: 22px; height: 22px;
    border-radius: 50%; box-sizing: border-box;
    background: rgba(255,255,255,.85); border: 1.5px solid rgba(0,0,0,.18);
    display: grid; place-items: center;
}
.season-card.active .season-radio { background: var(--sa); border-color: transparent; }
.season-card.active .season-radio::after { content: ""; width: 9px; height: 9px; border-radius: 50%; background: #fff; }
.season-foot {
    display: flex; align-items: center; justify-content: space-between;
    width: 100%; padding: 0 3px 3px; gap: 0.5rem;
}
.season-dots { display: flex; gap: 5px; }
.season-dot {
    width: 16px; height: 16px; border-radius: 50%;
    box-shadow: inset 0 0 0 1px rgba(0,0,0,.08);
}
.season-name { font-family: var(--serif, Georgia, serif); font-size: 1.25rem; font-weight: 600; text-transform: capitalize; }

/* Branding: read-only primary color row (follows the season scheme) */
.primary-color-row { display: flex; align-items: center; gap: 0.6rem; margin-top: 1rem; }
.primary-color-row .pcr-label { font-size: 0.85rem; color: var(--text2, #6e6e73); }
.primary-color-row .pcr-swatch {
    width: 26px; height: 26px; border-radius: 50%;
    background: var(--accent, #9a6a42); box-shadow: inset 0 0 0 1px rgba(0,0,0,.1);
}

/* Branding: live font preview */
.font-preview {
    display: flex; flex-direction: column; align-items: flex-start; gap: 0.55rem;
    margin-top: 1rem; padding: 1.4rem 1.6rem;
    background: var(--surface, #fff); border: 1px solid var(--border2, #ddd); border-radius: 14px;
}
.font-preview .fp-heading { font-family: var(--fp-serif); font-size: 2rem; font-weight: 600; color: var(--ink, #221d16); }
.font-preview .fp-body { font-family: var(--fp-body); font-size: 0.95rem; color: var(--text2, #6e6e73); }
.font-preview .fp-pill {
    font-family: var(--fp-body); font-size: 0.88rem; font-weight: 600;
    background: var(--accent, #9a6a42); color: #fff; border-radius: 999px; padding: 0.45rem 1.1rem;
}

/* License banners + status */
.license-banner {
    padding: 0.55rem 1.25rem;
    font-size: 0.9rem;
    text-align: center;
}
.license-banner.warn { background: #f7ecd3; color: #6b5220; }
.license-banner.danger { background: #c25749; color: #fff; }
.license-status .license-state {
    display: inline-block; padding: 0.25rem 0.9rem; border-radius: 999px;
    font-size: 0.82rem; font-weight: 700; letter-spacing: 0.03em;
}
.license-status .license-state.ok { background: rgba(88,165,102,.15); color: #3e7d4a; }
.license-status .license-state.warn { background: #f7ecd3; color: #6b5220; }
.license-status .license-state.bad { background: rgba(194,87,73,.15); color: #c25749; }
.license-note { font-size: 0.8rem; color: var(--text3, #a1a1a6); text-align: center; margin-top: 0.9rem; }

/* Branding: visibility toggles */
.toggle-row { display: flex; gap: 0.6rem; align-items: flex-start; margin: 0.55rem 0; font-size: 0.9rem; cursor: pointer; }
.toggle-row input { margin-top: 0.2rem; accent-color: var(--accent, #9a6a42); }

/* =====================================================================
   Front page: workspace (2a), search front (2b), mobile story (2c)
   ===================================================================== */

/* minmax(0,1fr) — a bare 1fr track keeps an auto (min-content) minimum, so a
   non-shrinkable child (mosaic images) blows the track past the viewport on
   mobile. minmax(0,…) lets the track shrink below content width. */
.pub-shell--front { grid-template-columns: minmax(0, 1fr); }
.pub-shell--front .pub-tree,
.pub-shell--front .pub-info { display: none; }
.pub-shell--front .pub-main { padding: 0 3.5rem 3rem; max-width: 1400px; margin: 0 auto; width: 100%; box-sizing: border-box; }

/* --- Hero band (2a) --- */
.hero-band {
    position: relative;
    height: 300px;
    border-radius: 18px;
    margin: 2.4rem 0 1rem;
    background: linear-gradient(150deg, var(--grad1), var(--grad2));
    background-size: cover;
    background-position: center;
    overflow: hidden;
    display: flex;
    align-items: flex-end;
    color: #fff;
}
.hero-band::after {
    content: "";
    position: absolute; inset: 0;
    background: linear-gradient(to top, rgba(20,15,8,.62), rgba(20,15,8,.05) 55%);
}
.hero-mono {
    position: absolute; top: 26px; right: 26px; z-index: 2;
    width: 46px; height: 46px; border-radius: 50%;
    border: 1px solid rgba(255,255,255,.55); background: rgba(255,255,255,.12);
    backdrop-filter: blur(8px);
    display: grid; place-items: center;
    font-family: var(--serif); font-size: 22px; color: #fff;
}
.hero-text { position: relative; z-index: 2; padding: 2.2rem 2.4rem; }
.hero-eyebrow { font-size: 12px; letter-spacing: .32em; color: rgba(255,255,255,.85); }
.hero-band h1 { font-family: var(--serif); font-weight: 500; font-size: 3rem; margin: .3rem 0 .4rem; color: #fff; }
.hero-meta { font-size: 14px; color: rgba(255,255,255,.8); }

/* --- Collections grid (2a) --- */
.coll-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 46px 44px;
}
.coll-card { display: flex; flex-direction: column; gap: 12px; min-width: 0; text-decoration: none; color: var(--ink);
    transition: transform .55s cubic-bezier(.22,1,.36,1); }
.coll-card:hover { transform: translateY(-8px); }
.coll-mosaic {
    display: grid; grid-template-columns: 1fr 1fr; grid-auto-rows: 1fr; gap: 2px;
    aspect-ratio: 1/1; border-radius: var(--radius); overflow: hidden; background: var(--tint);
    box-shadow: var(--shadow-rest); transition: box-shadow .55s;
}
.coll-card:hover .coll-mosaic { box-shadow: var(--shadow-lift); }
.coll-mosaic img { width: 100%; height: 100%; object-fit: cover; display: block; }
.coll-empty { grid-column: 1/3; grid-row: 1/3; display: grid; place-items: center; }
.coll-name { font-size: 15px; font-weight: 600; letter-spacing: -.01em; }
.coll-sub { font-size: 13px; color: var(--text2); }

/* --- Latest additions grid (2a) --- */
.latest-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 34px 32px; }
.latest-card { display: flex; flex-direction: column; gap: 10px; text-decoration: none; color: var(--ink);
    transition: transform .55s cubic-bezier(.22,1,.36,1); }
.latest-card:hover { transform: translateY(-6px); }
.latest-media { position: relative; aspect-ratio: 4/3; border-radius: var(--radius); overflow: hidden;
    background: var(--tint); box-shadow: var(--shadow-rest); }
.latest-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.latest-play {
    position: absolute; inset: 0; margin: auto; width: 44px; height: 44px;
    display: grid; place-items: center; color: #fff;
    background: rgba(0,0,0,.5); border-radius: 50%; backdrop-filter: blur(6px);
}
.latest-name { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* --- Story rail (2c mobile) — hidden on desktop --- */
.story-rail { display: none; }

/* --- Search front (2b) --- */
.searchfront { min-height: 70vh; display: flex; align-items: center; justify-content: center; padding: 3rem 1.5rem; }
.searchfront-inner { text-align: center; width: 100%; max-width: 680px; }
.sf-wordmark { font-family: var(--serif); font-weight: 500; font-size: 4rem; margin: 0; }
.sf-sub { font-size: 11.5px; letter-spacing: .38em; color: var(--text3); text-transform: uppercase; margin: .3rem 0 2rem; }
.sf-bar {
    display: flex; align-items: center; gap: .6rem;
    height: 58px; padding: 0 .5rem 0 1.2rem;
    background: var(--surface); border: 1px solid var(--border2); border-radius: 999px;
    box-shadow: 0 12px 34px rgba(var(--ink-rgb), .07);
    max-width: 640px; margin: 0 auto;
}
.sf-glass { color: var(--text3); flex-shrink: 0; }
.sf-bar input { flex: 1; border: none; outline: none; background: none; font-size: 15.5px; color: var(--ink); }
.sf-submit {
    width: 42px; height: 42px; border-radius: 50%; border: none; flex-shrink: 0;
    background: var(--accent); color: #fff; cursor: pointer; display: grid; place-items: center;
}
.sf-chips { display: flex; flex-wrap: wrap; gap: .5rem; justify-content: center; align-items: center; margin: 1.4rem 0; }
.sf-try { font-size: 13px; color: var(--text2); }
.sf-chip {
    background: var(--surface); border: 1px solid var(--border2); border-radius: 999px;
    padding: 8px 17px; font-size: 13px; color: var(--text2); text-decoration: none;
}
.sf-chip:hover { background: var(--sel); color: var(--accent); }
.sf-trending { font-size: 11px; letter-spacing: .18em; color: var(--text3); margin: 2rem 0 .8rem; }
.sf-thumbs { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.sf-thumb { width: 134px; height: 96px; border-radius: 14px; overflow: hidden; background: var(--tint); }
.sf-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* =====================================================================
   Responsive — mobile front (2c) + general reflow
   ===================================================================== */
@media (max-width: 900px) {
    .coll-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 16px; }
    .latest-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 16px; }
    .pub-shell--front .pub-main { padding: 0 1.1rem 2rem; }

    /* 2c story front: lead with the story rail (before the hero) so featured
       collections are the first thing seen on a phone. */
    .workspace { display: flex; flex-direction: column; }
    .workspace .story-rail { order: -1; margin-top: 1rem; }
    .hero-band { height: 210px; margin-top: 1.2rem; }
    .hero-band h1 { font-size: 2.1rem; }
    .sf-wordmark { font-size: 2.8rem; }

    /* 2c story rail becomes visible on mobile */
    .story-rail {
        display: flex; gap: 14px; overflow-x: auto; padding: 1rem 0 .5rem;
        -webkit-overflow-scrolling: touch; scrollbar-width: none;
    }
    .story-rail::-webkit-scrollbar { display: none; }
    .story { flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; gap: 6px;
        width: 68px; text-decoration: none; color: var(--ink); }
    .story-ring {
        width: 64px; height: 64px; border-radius: 50%; padding: 2.5px;
        background: linear-gradient(135deg, var(--grad1), var(--grad2));
        display: grid; place-items: center;
    }
    .story-ring img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover;
        border: 2.5px solid var(--bg); }
    .story-label { font-size: 11px; max-width: 68px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
}
@media (max-width: 560px) {
    .coll-grid, .latest-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px 12px; }
    .pub-topbar { flex-wrap: wrap; gap: .6rem; }
    .pub-search { order: 3; flex-basis: 100%; max-width: none; }
}

/* Branding front-page-style preview chips */
.fps-preview { width: 100%; height: 3.5rem; border-radius: 10px; background: var(--tint); position: relative; overflow: hidden; }
.fps-workspace::before { content: ""; position: absolute; left: 8px; right: 8px; top: 8px; height: 14px; border-radius: 4px; background: linear-gradient(120deg, var(--grad1), var(--grad2)); }
.fps-workspace::after { content: ""; position: absolute; left: 8px; bottom: 8px; width: 60%; height: 10px; border-radius: 3px; background: var(--border2); }
.fps-search::before { content: ""; position: absolute; left: 20%; right: 20%; top: 40%; height: 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border2); }

/* =====================================================================
   Cohesion layer — elegant chrome for the signed-in app (design 4a/5a)
   Overrides the legacy dark/blue styling with seasonal tokens.
   ===================================================================== */

/* Header */
body[class*="season-"] .app-brand { display: flex; align-items: center; gap: 0.55rem; }
.brand-chip {
    width: 28px; height: 28px; border-radius: 8px;
    background: var(--ink); color: #fff;
    display: grid; place-items: center; overflow: hidden;
}
.brand-chip img { width: 100%; height: 100%; object-fit: contain; }
.brand-name { font-weight: 700; font-size: 15px; }
.admin-badge {
    background: var(--sel); color: var(--accent);
    font-size: 10.5px; font-weight: 700; letter-spacing: .14em;
    padding: 3px 8px; border-radius: 6px;
}
body[class*="season-"] .app-user { color: var(--text2); font-size: 0.85rem; }
.ghost-pill {
    border: 1px solid var(--border2); background: var(--surface); color: var(--ink);
    border-radius: 999px; padding: 0.4rem 1rem; font-size: 0.85rem; cursor: pointer; text-decoration: none;
}
.ghost-pill:hover { background: var(--hover); }

/* Pill nav row */
.pill-nav {
    display: flex; align-items: center; gap: 0.4rem;
    padding: 0.6rem 1.5rem; overflow-x: auto; scrollbar-width: none;
    background: var(--bg); border-bottom: 1px solid var(--border);
}
.pill-nav::-webkit-scrollbar { display: none; }
.pill {
    flex: 0 0 auto; text-decoration: none; color: var(--text2);
    padding: 7px 14px; border-radius: 999px; font-size: 13.5px; white-space: nowrap;
    transition: background .15s, color .15s;
}
.pill:hover { background: var(--hover); color: var(--ink); }
.pill.active { background: var(--sel); color: var(--accent); font-weight: 600; }
.pill-sep { width: 1px; height: 20px; background: var(--border2); margin: 0 0.3rem; flex: 0 0 auto; }

/* Unified header (design 3a) — brand | centered nav | search · Upload · basket · avatar */
.app-brand { flex: 1 1 0; min-width: 0; }
.main-nav {
    display: flex; align-items: center; justify-content: center;
    gap: clamp(1rem, 3vw, 2.6rem);
    min-width: 0; overflow-x: auto; scrollbar-width: none;
    font-size: 14px;
}
.main-nav::-webkit-scrollbar { display: none; }
.nav-item {
    flex: 0 0 auto; text-decoration: none; color: var(--text2, #55556b);
    white-space: nowrap; transition: color .15s;
}
.nav-item:hover { color: var(--ink, #1a1a2e); }
.nav-item.active { color: var(--ink, #1a1a2e); font-weight: 600; }

.hdr-actions { flex: 1 1 0; min-width: 0; display: flex; justify-content: flex-end; align-items: center; gap: 10px; }
.hdr-icon-btn {
    position: relative; width: 38px; height: 38px; border-radius: 50%;
    border: none; background: transparent; color: var(--text2, #55556b);
    display: grid; place-items: center; cursor: pointer; flex-shrink: 0;
    transition: background .15s;
}
.hdr-icon-btn:hover { background: var(--hover, rgba(0,0,0,.05)); }
.hdr-search { display: flex; align-items: center; margin: 0; }
.hdr-search input {
    width: 0; padding: 0; border: none; opacity: 0;
    height: 38px; border-radius: 999px; background: var(--tint, #f2f2f7);
    color: var(--ink, #1a1a2e); font-size: 13.5px; outline: none;
    transition: width .3s ease, opacity .2s ease, padding .3s ease;
}
.hdr-search:focus-within input { width: 13rem; opacity: 1; padding: 0 14px; }
.hdr-search input::placeholder { color: var(--text3, #9a9ab8); }
.hdr-upload {
    height: 38px; padding: 0 19px; border-radius: 999px;
    background: var(--accent, var(--brand, #3b4a8f)); color: #fff;
    font-size: 13.5px; font-weight: 600; text-decoration: none;
    display: flex; align-items: center; gap: 7px; flex-shrink: 0;
}
.hdr-upload:hover { filter: brightness(1.08); }
.hdr-basket { text-decoration: none; }
.hdr-badge {
    position: absolute; top: 0; right: 0;
    min-width: 17px; height: 17px; padding: 0 4px; border-radius: 999px;
    background: var(--accent, #3b4a8f); color: #fff;
    font-size: 10px; font-weight: 700; display: grid; place-items: center;
    box-sizing: border-box;
}
.hdr-avatar {
    width: 36px; height: 36px; border-radius: 50%;
    background: linear-gradient(135deg, var(--grad1, #c19a63), var(--grad2, #8a5a33));
    color: #fff; display: grid; place-items: center;
    font-family: var(--serif, Georgia, serif); font-size: 17px; font-weight: 600;
    cursor: pointer; list-style: none; user-select: none;
}
.hdr-avatar::-webkit-details-marker { display: none; }
.hdr-user { position: relative; flex-shrink: 0; }
.hdr-menu {
    position: absolute; right: 0; top: calc(100% + 8px); z-index: 60;
    min-width: 13rem; padding: 0.9rem 1rem;
    background: var(--surface, #fff); border: 1px solid var(--border, #ececf2);
    border-radius: 14px; box-shadow: 0 18px 50px -18px rgba(0, 0, 0, .35);
    display: flex; flex-direction: column; align-items: flex-start; gap: 0.6rem;
}
.hdr-menu-user { font-size: 0.85rem; color: var(--text2, #55556b); word-break: break-all; }
.guest-pill {
    height: 30px; padding: 0 12px; border-radius: 999px;
    border: 1px solid var(--border2, rgba(0,0,0,.1)); background: transparent;
    color: var(--text2, #55556b); font-size: 11px; font-weight: 700; letter-spacing: .1em;
    text-decoration: none; display: flex; align-items: center; gap: 6px; flex-shrink: 0;
}
.guest-pill:hover { background: var(--hover, rgba(0,0,0,.05)); color: var(--ink, #1a1a2e); }
.guest-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--text3, #a0a0b8); }
@media (max-width: 900px) {
    .app-header { flex-wrap: wrap; }
    .app-brand, .hdr-actions { flex: 1 1 auto; }
    .main-nav { order: 3; width: 100%; justify-content: flex-start; }
    .hdr-search:focus-within input { width: 8rem; }
}
/* Phones: trim the header to just search + basket (+ avatar for staff). */
@media (max-width: 640px) {
    .hdr-upload, .guest-pill { display: none; }
}
/* Guest Files browse renders the pub-shell inside the staff layout — let it go full width. */
.app-main:has(> .pub-shell) { max-width: none !important; padding: 0; }
.app-main:has(> .login-shell) { max-width: none !important; padding: 0; }

.transfers-heading { margin-top: 2.2rem; }

/* Buttons — accent pills / outline pills everywhere */
body[class*="season-"] .toolbar button,
body[class*="season-"] .upload-button,
body[class*="season-"] .inline-form button:not(.season-card):not(.link),
body[class*="season-"] button[type=submit] {
    border-radius: 999px;
    border: 1px solid var(--border2);
    background: var(--surface);
    color: var(--ink);
    font-size: 0.88rem;
    padding: 0.45rem 1rem;
    cursor: pointer;
}
body[class*="season-"] .toolbar > button:first-child,
body[class*="season-"] .inline-form button:not(.secondary):not(.season-card):not(.link),
body[class*="season-"] button[type=submit] {
    background: var(--accent); color: #fff; border-color: transparent; font-weight: 600;
}
body[class*="season-"] .inline-form button.secondary,
body[class*="season-"] .inline-form .secondary {
    background: var(--tint); color: var(--ink); border-color: transparent;
}
body[class*="season-"] .trash-link { color: var(--text2); }
body[class*="season-"] .trash-link:hover { color: var(--accent); }

/* Panels (inline forms) → elegant tint cards */
body[class*="season-"] .inline-form {
    background: var(--tint);
    border: none;
    border-radius: var(--radius);
    padding: 0.9rem 1.1rem;
    gap: 0.6rem;
}
body[class*="season-"] .inline-form input,
body[class*="season-"] .inline-form select,
body[class*="season-"] .inline-form textarea,
body[class*="season-"] .form-grid input,
body[class*="season-"] .form-row input {
    border: 1px solid var(--border2);
    border-radius: 10px;
    background: var(--surface);
    color: var(--ink);
    padding: 0.4rem 0.6rem;
}
body[class*="season-"] .smtp-form label.full input,
body[class*="season-"] .smtp-form label.full textarea { border-radius: 10px; }

/* Tables (design 4a) */
body[class*="season-"] .doc-table td { padding: 0.6rem 0.7rem; }
body[class*="season-"] .doc-table tbody tr { border-radius: 12px; }
body[class*="season-"] .doc-table th { border-bottom: 1px solid var(--border); }
body[class*="season-"] .name-link { color: var(--ink); font-weight: 600; }
body[class*="season-"] .name-link:hover { color: var(--accent); }

/* Alerts */
body[class*="season-"] .alert {
    background: rgba(194,87,73,.12); border: 1px solid rgba(194,87,73,.3); color: #a33;
    border-radius: 12px;
}
body[class*="season-"] .alert-ok {
    background: rgba(88,165,102,.15); border-color: rgba(88,165,102,.4); color: #3e7d4a;
}

/* Public badge (green tint pill) */
.public-chip {
    background: rgba(88,165,102,.15) !important;
    color: #3e7d4a !important;
}

/* Dashboard stat tiles */
body[class*="season-"] .stat-tile {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius);
}
body[class*="season-"] .stat-value { color: var(--ink); }

/* Detail overlay + drawer surfaces */
body[class*="season-"] .detail-card { border-radius: 20px; }
body[class*="season-"] .basket-drawer { background: var(--surface); }

/* App main width for the workspace feel */
body[class*="season-"] .app-main { max-width: 1200px; }

/* Grid/tiles view-toggle in tint container */
body[class*="season-"] .view-toggle {
    border-color: var(--border2);
    background: var(--tint);
    border-radius: 10px;
}
body[class*="season-"] .view-toggle button,
body[class*="season-"] .view-toggle a { background: transparent; color: var(--text2); }
body[class*="season-"] .view-toggle .active { background: var(--accent); color: #fff; }

/* Folder mosaic (2x2 covers) inside a card-media */
.mosaic {
    display: grid; grid-template-columns: 1fr 1fr; grid-auto-rows: 1fr; gap: 2px;
    width: 100%; height: 100%;
}
.mosaic img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card-folder .card-media { padding: 0; overflow: hidden; }
