/* Woodscape PDP admin — brand palette: teal #005E71, light teal #4EBCC1,
   cream #F7F7F5, charcoal #86828A, baby blue #BFEAF3, grey #D8D7D9 */
* {
    box-sizing: border-box;
}

:root {
    --teal: #005E71;
    --teal-dark: #004856;
    --light-teal: #4EBCC1;
    --cream: #F7F7F5;
    --charcoal: #4a4750;
    --muted: #86828A;
    --grey: #D8D7D9;
    --blue: #BFEAF3;
    --danger: #a03030;
    --ok: #2c7a4b;
    --warn: #9a6b1f;
    --radius: 8px;
}

body {
    margin: 0;
    font: 15px/1.5 -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: var(--charcoal);
    background: var(--cream);
}

a {
    color: var(--teal);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.shell {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 232px;
    flex: none;
    background: var(--teal);
    color: #fff;
    display: flex;
    flex-direction: column;
}

.brand {
    display: flex;
    gap: 10px;
    align-items: center;
    padding: 18px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, .15);
}

.brand-mark {
    width: 34px;
    height: 34px;
    flex: none;
    border-radius: 8px;
    background: var(--light-teal);
    color: var(--teal-dark);
    font-weight: 800;
    font-size: 20px;
    display: grid;
    place-items: center;
}

.brand strong {
    display: block;
    line-height: 1.1;
}

.brand small {
    opacity: .75;
    font-size: 11px;
    display: block;
}

.sidebar nav {
    flex: 1;
    padding: 10px 0;
    overflow-y: auto;
}

.sidebar nav a {
    display: block;
    padding: 8px 16px;
    color: rgba(255, 255, 255, .88);
    font-size: 14px;
}

.sidebar nav a:hover {
    background: rgba(255, 255, 255, .08);
    text-decoration: none;
}

.sidebar nav a.active {
    background: rgba(255, 255, 255, .14);
    border-left: 3px solid var(--light-teal);
    padding-left: 13px;
}

.nav-group {
    display: block;
    padding: 14px 16px 4px;
    font-size: 11px;
    letter-spacing: .08em;
    text-transform: uppercase;
    opacity: .55;
}

.sidebar-footer {
    padding: 14px 16px;
    border-top: 1px solid rgba(255, 255, 255, .15);
    font-size: 13px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sidebar-footer a {
    color: #fff;
}

.sidebar-footer .muted {
    opacity: .65;
}

.main {
    flex: 1;
    min-width: 0;
    padding: 28px 32px;
}

/* Content + right-hand aside. The aside holds each page's "create new …" form. */
.work {
    display: flex;
    align-items: flex-start;
    gap: 24px;
}

.work-main {
    flex: 1;
    min-width: 0;
}

.work-aside {
    width: 330px;
    flex: none;
    position: sticky;
    top: 28px;
    max-height: calc(100vh - 56px);
    overflow-y: auto;
}

.work-aside .card {
    margin-bottom: 16px;
    padding: 14px 16px;
}

.work-aside .card > h2 {
    margin: 0 0 8px;
    font-size: 15px;
}

.work-aside label:first-child {
    margin-top: 0;
}

.work-aside button[type=submit] {
    width: 100%;
    margin-top: 14px;
}

@media (max-width: 1100px) {
    /* Stacked: stretch, or the column cross-axis would shrink both children to content width. */
    .work {
        flex-direction: column;
        align-items: stretch;
    }

    .work-aside {
        width: 100%;
        position: static;
        max-height: none;
        overflow: visible;
    }
}

/* Phone width: the sidebar gives up its column and becomes a top bar (brand and account links
   on one line, the nav wrapping beneath) so the content gets the full width. */
@media (max-width: 760px) {
    .shell {
        flex-direction: column;
    }

    .sidebar {
        width: auto;
        flex-flow: row wrap;
        align-items: center;
    }

    .brand {
        flex: 1;
        border-bottom: 0;
    }

    .sidebar-footer {
        border-top: 0;
        text-align: right;
    }

    /* Last, on a line of its own. */
    .sidebar nav {
        order: 1;
        flex-basis: 100%;
        display: flex;
        flex-wrap: wrap;
        gap: 4px;
        padding: 0 6px 12px;
    }

    .sidebar nav a {
        padding: 4px 10px;
        border-radius: 6px;
    }

    .sidebar nav a.active {
        padding-left: 7px;
    }

    /* A heading mid-row reads as another link; the links stand on their own. */
    .nav-group {
        display: none;
    }

    .main {
        padding: 28px 16px;
    }

    /* Its nine fixed-share columns were tuned at ~950px (2026-07-22). Squeezed to phone width they
       overlap and clip, so it keeps that width and scrolls in its .table-scroll. */
    .doc-table {
        width: 950px;
    }

    /* Side-by-side blocks (e.g. the profile's two cards) wrap once they no longer fit. */
    .field-row {
        flex-wrap: wrap;
    }

    /* 380px is wider than a 375px screen: keep the shell's 16px gutter either side. */
    .login-card {
        max-width: calc(100vw - 32px);
    }
}

h1 {
    margin: 0 0 4px;
    font-size: 24px;
    color: var(--teal-dark);
}

h2 {
    font-size: 17px;
    color: var(--teal-dark);
    margin: 26px 0 10px;
}

.sub {
    color: var(--muted);
    margin: 0 0 20px;
}

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

.card {
    background: #fff;
    border: 1px solid var(--grey);
    border-radius: var(--radius);
    padding: 18px 20px;
    margin-bottom: 18px;
}

.cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 14px;
    margin-bottom: 22px;
}

.stat {
    background: #fff;
    border: 1px solid var(--grey);
    border-radius: var(--radius);
    padding: 14px 16px;
}

.stat b {
    display: block;
    font-size: 26px;
    color: var(--teal);
}

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

.stat.warn b {
    color: var(--warn);
}

table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border: 1px solid var(--grey);
    border-radius: var(--radius);
    overflow: hidden;
}

th, td {
    text-align: left;
    padding: 9px 12px;
    border-bottom: 1px solid #eceaee;
    font-size: 14px;
    vertical-align: top;
}

th {
    background: #f1f0f3;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--muted);
}

tr:last-child td {
    border-bottom: 0;
}

tr:hover td {
    background: #fbfbfa;
}

th.sortable {
    padding: 0;
}

th.sortable a {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 9px 12px;
    color: inherit;
    text-decoration: none;
    white-space: nowrap;
}

th.sortable a:hover {
    background: #e7e5ea;
    color: var(--teal-dark);
}

th.sortable.sorted {
    color: var(--teal-dark);
}

th.sortable .sort-ind {
    font-size: 10px;
    line-height: 1;
}

th.sortable:not(.sorted) .sort-ind {
    opacity: .3;
}

/* Wraps a table so that, when it outgrows its column (phone width, long unbroken values), it
   scrolls sideways in this box instead of widening the page. The table stays display: table:
   as a block it would stop filling the width and .doc-table would lose its fixed layout. */
.table-scroll {
    overflow-x: auto;
}

.badge {
    display: inline-block;
    padding: 1px 9px;
    border-radius: 99px;
    font-size: 12px;
    font-weight: 600;
}

.badge.published {
    background: #e0f2e7;
    color: var(--ok);
}

.badge.draft {
    background: #eee;
    color: var(--muted);
}

.badge.in_review {
    background: var(--blue);
    color: var(--teal-dark);
}

.badge.archived {
    background: #f6e3e3;
    color: var(--danger);
}

.badge.review {
    background: #fdf0d7;
    color: var(--warn);
}

.badge.rule {
    background: var(--blue);
    color: var(--teal-dark);
}

.badge.curated {
    background: #e0f2e7;
    color: var(--ok);
}

.badge.kind {
    background: #eee;
    color: var(--muted);
    font-weight: 500;
}

button, .btn {
    display: inline-block;
    border: 0;
    border-radius: 6px;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    background: var(--teal);
    color: #fff;
}

button:hover, .btn:hover {
    background: var(--teal-dark);
    text-decoration: none;
}

.btn.secondary {
    background: #fff;
    color: var(--teal);
    border: 1px solid var(--grey);
}

.btn.danger {
    background: var(--danger);
}

.btn.small {
    padding: 4px 10px;
    font-size: 13px;
}

button:disabled {
    opacity: .5;
    cursor: not-allowed;
}

form.inline {
    display: inline;
}

label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin: 12px 0 4px;
    color: var(--charcoal);
}

input[type=text], input[type=email], input[type=password], input[type=number], input[type=url],
input[type=datetime-local], select, textarea {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--grey);
    border-radius: 6px;
    font: inherit;
    background: #fff;
}

input:focus, select:focus, textarea:focus {
    outline: 2px solid var(--light-teal);
    border-color: var(--light-teal);
}

.field-row {
    display: flex;
    gap: 14px;
}

.field-row > div {
    flex: 1;
}

.help {
    font-size: 12px;
    color: var(--muted);
    margin-top: 3px;
}

.filters {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: flex-end;
    margin-bottom: 14px;
}

.filters label {
    margin: 0 0 4px;
}

.filters input, .filters select {
    width: auto;
    min-width: 130px;
}

.flash {
    padding: 10px 14px;
    border-radius: 6px;
    margin-bottom: 14px;
    font-size: 14px;
}

.flash-success {
    background: #e0f2e7;
    color: var(--ok);
}

.flash-error {
    background: #f6e3e3;
    color: var(--danger);
}

.flash-warning {
    background: #fdf0d7;
    color: var(--warn);
}

.tabs {
    display: flex;
    gap: 2px;
    border-bottom: 2px solid var(--grey);
    margin: 18px 0 16px;
}

.tabs a {
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 600;
    color: var(--muted);
    border-radius: 6px 6px 0 0;
}

.tabs a.active {
    color: var(--teal-dark);
    background: #fff;
    border: 1px solid var(--grey);
    border-bottom: 2px solid #fff;
    margin-bottom: -2px;
}

.tabs a:hover {
    text-decoration: none;
    color: var(--teal);
}

.attr-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 24px;
}

/* Product → Categories: the checkbox tree flows into as many columns as fit; a top-level
   category and its sub-categories never split across a column break. */
.category-picker {
    columns: 200px;
    column-gap: 24px;
}

.category-group {
    break-inside: avoid;
}

.category-picker .inline-check {
    display: flex;
    padding: 3px 0;
    white-space: normal;
}

/* Product → Tags & ranges: each kind is a row of ticked pills (untick to remove on save)
   followed by a type-ahead input that fills the rest of the line. */
.token-field input[type=text] {
    flex: 1 1 180px;
    width: auto;
}

.token-field .pill:has(input:not(:checked)) {
    text-decoration: line-through;
    opacity: .55;
}

.pill-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.pill {
    background: var(--blue);
    color: var(--teal-dark);
    border-radius: 99px;
    padding: 2px 10px;
    font-size: 12px;
}

pre.json {
    background: #2b2b33;
    color: #e8e8ee;
    padding: 14px;
    border-radius: var(--radius);
    overflow-x: auto;
    font-size: 13px;
}

/* Table column that should claim no more width than its content needs. */
th.shrink, td.shrink {
    width: 1%;
    white-space: nowrap;
}

/* Documents: filename stem + the auto-appended version/extension, kept on one line so the
   input stays aligned with the other controls in the row. */
.filename-field {
    display: flex;
    align-items: center;
    gap: 3px;
}

.filename-field input {
    min-width: 0;
    padding-left: 6px;
    padding-right: 6px;
}

.filename-field .filename-version {
    flex: none;
    width: 62px;
}

.filename-field span {
    white-space: nowrap;
}

/* Hover hint: a small icon carrying an in-page tooltip. A native title tooltip wraps
   wherever the browser likes, so this is drawn in the page — label line, then body line,
   never broken. Cells that host one must lift their own overflow (see .doc-table). */
.tip {
    position: relative;
    flex: none;
    color: var(--muted);
    cursor: help;
    font-size: 14px;
    line-height: 1;
}

.tip:hover {
    color: var(--teal);
}

.tip.warn {
    color: var(--warn);
}

.tip.warn:hover {
    color: var(--danger);
}

.tip-body {
    display: none;
    position: absolute;
    right: -4px;
    bottom: calc(100% + 7px);
    z-index: 60;
    background: var(--charcoal);
    color: #fff;
    padding: 7px 10px;
    border-radius: 6px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, .28);
}

.tip:hover .tip-body {
    display: block;
}

.tip-body em {
    display: block;
    font-style: normal;
    font-size: 11px;
    opacity: .7;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.tip-body b {
    display: block;
    margin-top: 2px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
}

.tip-body b.mono {
    font-family: ui-monospace, "SF Mono", Menlo, monospace;
}

/* Little pointer down to the icon. */
.tip-body::after {
    content: "";
    position: absolute;
    top: 100%;
    right: 8px;
    border: 5px solid transparent;
    border-top-color: var(--charcoal);
}

/* Nine columns of mostly form controls over-constrain auto layout — every column collapses
   toward its longest word and the title ends up unreadable. Fixed layout lets the widths
   below be authoritative. Nested revision tables keep auto layout (table-layout does not
   inherit). Columns: title, type, collection, downloads-as, version, size, linked, public,
   actions. */
.doc-table {
    table-layout: fixed;
}

/* Right-hand columns hold content that cannot shrink — buttons, a checkbox label, header
   words — so they get what they measure and the text inputs on the left absorb the rest. */
.doc-table > tbody > tr > th:nth-child(1) {
    width: 15%;
}

.doc-table > tbody > tr > th:nth-child(2) {
    width: 15%;
}

.doc-table > tbody > tr > th:nth-child(3) {
    width: 10%;
}

.doc-table > tbody > tr > th:nth-child(4) {
    width: 23%;
}

.doc-table > tbody > tr > th:nth-child(5) {
    width: 5%;
}

.doc-table > tbody > tr > th:nth-child(6) {
    width: 6%;
}

.doc-table > tbody > tr > th:nth-child(7) {
    width: 9%;
}

.doc-table > tbody > tr > th:nth-child(8) {
    width: 14%;
}

.doc-table > tbody > tr > th:nth-child(9) {
    width: 4%;
}

.doc-table > tbody > tr > td:nth-child(8) {
    white-space: nowrap;
}

.doc-table > tbody > tr > td {
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Cells hosting a tooltip must let it escape; their content never overflows anyway. */
.doc-table > tbody > tr > td:nth-child(4),
.doc-table > tbody > tr > td:nth-child(9) {
    overflow: visible;
}

/* Unclassified flag sits in a fixed right-hand column so the eye can scan straight down it. */
.doc-flag {
    text-align: center;
}

.doc-unclassified {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Tighter gutters buy ~60px back across eight columns — the difference between the action
   buttons fitting and being clipped. */
.doc-table > tbody > tr > th, .doc-table > tbody > tr > td {
    padding-left: 8px;
    padding-right: 8px;
}

.doc-table > tbody > tr > th.sortable a {
    padding-left: 8px;
    padding-right: 8px;
}

/* Documents: per-row revision history + replace-file panel. */
.doc-revisions-row > td {
    padding: 0 12px 0 12px;
    border-bottom: 2px solid var(--grey);
}

.doc-revisions-row summary {
    font-weight: 400;
    color: var(--muted);
    padding: 4px 0;
}

.doc-revisions-row summary:hover {
    color: var(--teal);
}

.doc-revisions {
    padding: 4px 0 14px;
}

.doc-replace {
    display: flex;
    gap: 12px;
    align-items: flex-end;
    margin-bottom: 12px;
}

.doc-replace label {
    margin: 0 0 4px;
}

.doc-replace input {
    width: auto;
}

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

.small {
    font-size: 13px;
}

.mono {
    font-family: ui-monospace, "SF Mono", Menlo, monospace;
    font-size: 13px;
}

.right {
    text-align: right;
}

.pagination {
    display: flex;
    gap: 6px;
    margin-top: 14px;
}

.pagination a, .pagination span {
    padding: 5px 11px;
    border: 1px solid var(--grey);
    border-radius: 6px;
    background: #fff;
    font-size: 13px;
}

.pagination .current {
    background: var(--teal);
    color: #fff;
    border-color: var(--teal);
}

.login-wrap {
    min-height: 100vh;
    display: grid;
    place-items: center;
    background: linear-gradient(160deg, var(--teal) 0%, var(--teal-dark) 100%);
}

.login-card {
    width: 380px;
    background: #fff;
    border-radius: 12px;
    padding: 34px;
    box-shadow: 0 18px 50px rgba(0, 0, 0, .28);
}

.login-card .brand {
    padding: 0 0 18px;
    border: 0;
    color: var(--charcoal);
}

.login-card .brand small {
    color: var(--muted);
}

.diff-add {
    color: var(--ok);
}

.diff-del {
    color: var(--danger);
    text-decoration: line-through;
}

.diff-chg {
    color: var(--warn);
}

details {
    margin: 8px 0;
}

details summary {
    cursor: pointer;
    font-weight: 600;
    color: var(--teal);
}

.schema-table input, .schema-table select {
    padding: 5px 7px;
    font-size: 13px;
}

.schema-table td {
    padding: 6px 8px;
}

/* Visual/Code HTML editor (admin-editor.js + Quill + CodeMirror) */
.html-editor {
    margin-bottom: 4px;
}

.html-editor-tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 6px;
}

.html-editor-tabs button {
    padding: 3px 12px;
    font-size: 12px;
    font-weight: 600;
    background: #fff;
    color: var(--muted);
    border: 1px solid var(--grey);
    border-radius: 6px;
}

.html-editor-tabs button:hover {
    background: #fff;
    color: var(--teal);
}

.html-editor-tabs button.active {
    background: var(--teal);
    border-color: var(--teal);
    color: #fff;
}

.html-editor-format {
    display: none;
    margin-left: auto;
}

.html-editor.code-active .html-editor-format {
    display: block;
}

.html-editor.code-active .html-editor-visual {
    display: none;
}

/* The textarea stays the form field but is never shown; .html-editor-code holds CodeMirror. */
.html-editor textarea {
    display: none;
}

.html-editor-code {
    display: none;
}

.html-editor.code-active .html-editor-code {
    display: block;
}

.html-editor .cm-editor {
    border: 1px solid var(--grey);
    border-radius: 6px;
    background: #fff;
    font-family: ui-monospace, "SF Mono", Menlo, monospace;
    font-size: 13px;
}

.html-editor .cm-editor.cm-focused {
    outline: 2px solid var(--light-teal);
    outline-offset: -1px;
}

.html-editor .cm-scroller {
    min-height: 260px;
    max-height: 60vh;
    line-height: 1.55;
    border-radius: 6px;
}

.html-editor .cm-gutters {
    background: var(--cream);
    border-right: 1px solid var(--grey);
    color: var(--muted);
    border-radius: 6px 0 0 6px;
}

.html-editor .cm-activeLine, .html-editor .cm-activeLineGutter {
    background: rgba(191, 234, 243, 0.28);
}

.html-editor .cm-matchingBracket {
    background: var(--blue);
    outline: none;
}

.html-editor .ql-toolbar.ql-snow {
    border: 1px solid var(--grey);
    border-radius: 6px 6px 0 0;
    background: #fff;
    font-family: inherit;
}

.html-editor .ql-container.ql-snow {
    border: 1px solid var(--grey);
    border-top: 0;
    border-radius: 0 0 6px 6px;
    background: #fff;
    font: inherit;
}

.html-editor .ql-editor {
    min-height: 180px;
}

.html-editor .ql-snow a {
    color: var(--teal);
}

/* Media thumbnails + lightbox (admin-lightbox.js) */
.media-thumb {
    height: 168px;
    border-radius: 6px;
    border: 1px solid var(--grey);
    display: block;
    cursor: zoom-in;
}

.lightbox {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 26, 0.88);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.lightbox.open {
    display: flex;
}

/* max-* only ever shrinks: the image renders at natural size unless the viewport is smaller */
.lightbox img {
    max-width: calc(100vw - 128px);
    max-height: calc(100vh - 96px);
    border-radius: 4px;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.5);
    background: #fff;
}

.lightbox button {
    position: fixed;
    background: none;
    border: 0;
    color: #fff;
    cursor: pointer;
    line-height: 1;
    padding: 10px 14px;
    opacity: 0.8;
}

.lightbox button:hover {
    opacity: 1;
    background: none;
}

.lightbox-close {
    top: 10px;
    right: 12px;
    font-size: 40px;
}

.lightbox-prev, .lightbox-next {
    top: 50%;
    transform: translateY(-50%);
    font-size: 56px;
}

.lightbox-prev {
    left: 8px;
}

.lightbox-next {
    right: 8px;
}

.lightbox-counter {
    position: fixed;
    bottom: 14px;
    left: 50%;
    transform: translateX(-50%);
    color: #fff;
    font-size: 13px;
    opacity: 0.8;
}

/* Media library picker overlay (admin-media-picker.js) */
.picker-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 26, 0.6);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 900;
    padding: 24px;
}

.picker-overlay.open {
    display: flex;
}

.picker-overlay-body {
    background: var(--bg, #fff);
    border-radius: 10px;
    width: min(1000px, 100%);
    max-height: 90vh;
    overflow: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

.picker-loading, .picker-error {
    padding: 40px;
    text-align: center;
    color: var(--muted);
}

.media-picker-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--grey);
    position: sticky;
    top: 0;
    background: #fff;
}

.media-picker-head strong {
    flex: 1;
}

.media-picker-filters {
    display: flex;
    gap: 8px;
    padding: 12px 18px;
    border-bottom: 1px solid var(--grey);
}

.media-picker-filters input[type=search] {
    flex: 1;
}

.media-picker-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
    padding: 18px;
}

.media-pick {
    display: flex;
    flex-direction: column;
    gap: 3px;
    cursor: pointer;
    border: 1px solid var(--grey);
    border-radius: 8px;
    padding: 8px;
    position: relative;
}

.media-pick:hover {
    border-color: var(--teal);
}

.media-pick img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: 4px;
    background: #f4f4f4;
}

.media-pick input[type=checkbox] {
    position: absolute;
    top: 12px;
    left: 12px;
    width: 18px;
    height: 18px;
}

.media-pick.is-linked {
    opacity: 0.55;
}

.media-pick .media-pick-name {
    font-size: 12px;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.media-pick .pill {
    position: absolute;
    top: 10px;
    right: 10px;
}

.media-picker-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 14px 18px;
    border-top: 1px solid var(--grey);
    position: sticky;
    bottom: 0;
    background: #fff;
}

.media-picker-foot .pager {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Media library section (media.html.twig + admin-media-library.js) */
.view-toggle {
    display: flex;
    gap: 4px;
}

.view-toggle .btn.active {
    background: var(--teal);
    color: #fff;
    border-color: var(--teal);
}

.inline-check {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    font-weight: 400;
    white-space: nowrap;
}

.inline-check input {
    width: auto;
}

.bulk-bar {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 8px 2px;
}

.bulk-bar [data-selected-count] {
    flex: 1;
}

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

.media-card {
    position: relative;
    border: 1px solid var(--grey);
    border-radius: 8px;
    padding: 8px;
    background: #fff;
}

.media-card:hover {
    border-color: var(--teal);
}

.media-card.selected {
    border-color: var(--teal);
    box-shadow: 0 0 0 2px var(--teal);
}

.media-card .media-thumb {
    height: 168px;
    width: 100%;
    object-fit: cover;
}

.media-card .media-select {
    position: absolute;
    top: 12px;
    left: 12px;
    width: 18px;
    height: 18px;
    z-index: 2;
}

.media-card-meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-top: 6px;
}

.media-card-meta .name {
    font-size: 12px;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.usage-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    color: var(--teal);
}

.usage-badge.unused {
    color: var(--muted);
}

table.align-middle td, table.align-middle th {
    vertical-align: middle;
}

table.media-list tr[data-media-detail]:hover {
    background: #f6fafa;
    cursor: pointer;
}

table.media-list tr.selected {
    background: #eef7f7;
}

.media-thumb-sm {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid var(--grey);
    display: block;
}

.media-sidebar {
    border: 1px solid var(--grey);
    border-radius: 10px;
    background: #fff;
    padding: 14px;
}

.media-sidebar[data-empty] {
    color: var(--muted);
}

.media-detail-head {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.media-detail-head strong {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
}

.media-detail-img {
    width: 100%;
    border-radius: 6px;
    border: 1px solid var(--grey);
    background: #f4f4f4;
}

.media-detail-info {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 3px 12px;
    margin: 12px 0;
    font-size: 13px;
}

.media-detail-info dt {
    color: var(--muted);
}

.media-detail-info dd {
    margin: 0;
    text-align: right;
}

.media-detail-usage ul {
    list-style: none;
    padding: 0;
    margin: 6px 0;
    max-height: 160px;
    overflow: auto;
}

.media-detail-usage li {
    padding: 3px 0;
    font-size: 13px;
}

.media-detail-edit {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 12px;
    border-top: 1px solid var(--grey);
    padding-top: 12px;
}

.media-detail-edit label {
    font-size: 12px;
}

.media-detail-delete {
    margin-top: 12px;
}
