/* Components. One file, ordered: chrome → actions → status → artwork → collections → forms → panels → feedback. */

/* ════════════════════════════════════════════════════════════════
   Site chrome
   ════════════════════════════════════════════════════════════════ */

/* Header: a slim bar with the logo hanging from it like a gallery sign.
   The logo is larger than the bar and overlaps the page; on scroll it folds up into the bar. */
.site-header {
    --bar-h: 84px;
    --logo: 136px;
    --fold: 0.6176; /* bar-h / logo */
    position: sticky; top: 0; z-index: 50;
    background: var(--paper);
    border-bottom: var(--rule);
}
.site-header__inner {
    position: relative;
    display: flex; align-items: center; justify-content: space-between; gap: var(--space-5);
    height: var(--bar-h);
}
.site-header__brand {
    position: relative; align-self: stretch;
    display: flex; align-items: center;
    padding-left: calc(var(--logo) + var(--space-5));
    text-decoration: none;
}
.site-header__brand img {
    position: absolute; left: 0; top: 0; z-index: 2;
    width: var(--logo); height: var(--logo);
    transform-origin: top left;
    /* Hangs like a sign: the "hung work" shadow lets the white lower half read against the page. */
    filter: drop-shadow(0 8px 16px rgba(17, 17, 17, 0.16));
    transition: transform 320ms var(--ease-out), filter 320ms var(--ease-out);
}
.site-header__tagline {
    font-size: var(--text-label); font-weight: 500;
    letter-spacing: 0.24em; text-transform: uppercase;
    transition: transform 320ms var(--ease-out);
}
/* Folded: the sign shrinks to the bar height (scale = bar / logo) and the tagline follows. */
.site-header.is-compact .site-header__brand img { transform: scale(var(--fold)); filter: none; }
.site-header.is-compact .site-header__tagline { transform: translateX(calc(var(--bar-h) - var(--logo))); }
/* An open mobile menu folds the sign too, so it never covers the first menu item. */
.site-header:has(.site-nav[data-open]) .site-header__brand img { transform: scale(var(--fold)); filter: none; }
.site-header:has(.site-nav[data-open]) .site-header__tagline { transform: translateX(calc(var(--bar-h) - var(--logo))); }

@media (max-width: 860px) {
    .site-header { --bar-h: 64px; --logo: 96px; --fold: 0.6667; }
    .site-header__brand { padding-left: calc(var(--logo) + var(--space-4)); }
}
@media (max-width: 480px) {
    .site-header__tagline { font-size: var(--text-micro); letter-spacing: 0.16em; max-width: 9em; line-height: 1.35; }
}

.site-nav ul { display: flex; gap: var(--space-2); margin: 0; padding: 0; list-style: none; }
.site-nav a {
    display: inline-flex; align-items: center; min-height: var(--bar-h, var(--target-min));
    padding-inline: var(--space-3);
    font-size: 1rem; font-weight: 500; text-decoration: none;
    box-shadow: inset 0 -3px 0 transparent;
    transition: box-shadow var(--dur-fast) var(--ease-out);
}
.site-nav a:hover { box-shadow: inset 0 -3px 0 var(--line); }
.site-nav a[aria-current="page"] { box-shadow: inset 0 -3px 0 var(--ink); }
.site-nav__login { color: var(--muted); }

.menu-toggle {
    display: none;
    align-items: center; justify-content: center; gap: var(--space-2);
    min-width: var(--target-min); min-height: var(--target-min);
    padding: 0 var(--space-3);
    background: none; border: 1px solid var(--line);
    font-size: var(--text-label); font-weight: 500; letter-spacing: var(--tracking-label); text-transform: uppercase;
}

@media (max-width: 860px) {
    .menu-toggle { display: inline-flex; }
    .site-nav { display: none; position: absolute; inset: 100% 0 auto; background: var(--paper); border-bottom: var(--rule); box-shadow: var(--shadow-menu); }
    .site-nav[data-open] { display: block; }
    .site-nav ul { flex-direction: column; padding: var(--space-2) var(--gutter) var(--space-4); }
    .site-nav a { width: 100%; min-height: 52px; font-size: 1.125rem; border-bottom: var(--rule); box-shadow: none; padding-inline: 0; }
    .site-nav a[aria-current="page"] { font-weight: 600; box-shadow: inset 3px 0 0 var(--ink); padding-left: var(--space-3); }
}

/* Footer: the building as the closing statement — where to go, when it's open, what's next. */
.site-footer {
    background: var(--ink); color: var(--on-ink);
    padding-block: var(--section) var(--space-6);
    font-size: 0.9375rem;
}
.site-footer p { margin: 0; }
.site-footer a { color: var(--on-ink); text-decoration: none; }
.site-footer a:hover { text-decoration: underline; text-underline-offset: 0.25em; }
.site-footer .label { color: var(--on-ink-muted); margin: 0 0 var(--space-4); display: block; }

.site-footer__hero {
    display: grid; gap: var(--space-7); align-items: end;
    padding-bottom: var(--space-8); border-bottom: 1px solid #2a2a2a;
}
.site-footer__street {
    font-size: clamp(2.5rem, 1.4rem + 5vw, 5.5rem); font-weight: 500;
    line-height: 1; letter-spacing: -0.03em;
}
.site-footer__city { margin-top: var(--space-3) !important; font-size: var(--text-lead); color: var(--on-ink-muted); }
.site-footer__actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-5); margin-top: var(--space-6) !important; }
.site-footer__link { font-weight: 500; text-decoration: underline !important; text-underline-offset: 0.25em; }
.btn--on-ink { background: var(--paper); color: var(--ink) !important; border-color: var(--paper); text-decoration: none !important; }
.btn--on-ink:hover { background: var(--wall); border-color: var(--wall); }

.site-footer__open {
    display: flex; gap: var(--space-4); align-items: center;
    padding: var(--space-4); border: 1px solid #333; max-width: 380px;
    transition: border-color var(--dur-fast) var(--ease-out);
}
.site-footer__open:hover { border-color: var(--on-ink-muted); text-decoration: none !important; }
.site-footer__open img { flex: none; width: 64px; height: auto; }
.site-footer__open > span { display: grid; gap: 2px; }
.site-footer__open .label { margin: 0; }
.site-footer__open strong { font-size: 1.25rem; font-weight: 500; }
.site-footer__open span span:last-child { color: var(--on-ink-muted); }
@media (min-width: 900px) { .site-footer__hero { grid-template-columns: 1fr auto; } }

.site-footer__grid {
    display: grid; gap: var(--space-7) var(--space-6);
    padding-block: var(--space-7);
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
}
.site-footer ul { margin: 0; padding: 0; list-style: none; display: grid; gap: var(--space-3); }
.site-footer__hours { display: grid; grid-template-columns: max-content 1fr; gap: var(--space-2) var(--space-4); margin: 0; }
.site-footer__hours dt { color: var(--on-ink-muted); }
.site-footer__hours dd { margin: 0; }
.site-footer__note { color: var(--on-ink-muted); max-width: 32ch; margin-bottom: var(--space-4) !important; }

.site-footer__base {
    display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3) var(--space-5);
    padding-top: var(--space-5); border-top: 1px solid #2a2a2a;
    color: var(--on-ink-muted); font-size: var(--text-meta);
}
.site-footer__logo { width: 56px; height: 56px; }
.site-footer__meta { margin-left: auto; display: grid; gap: var(--space-2); justify-items: end; text-align: right; }
.site-footer__meta > * { margin: 0; }
@media (max-width: 599px) { .site-footer__meta { margin-left: 0; width: 100%; justify-items: start; text-align: left; } }
.site-footer__legal a { color: var(--on-ink-muted); }

/* Agency credit — same pattern as other inSpace sites: quiet until hovered, the astronaut lifts off. */
.isa-credit {
    display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1) var(--space-3);
    font-size: var(--text-micro); letter-spacing: 0.14em; text-transform: uppercase;
    color: var(--on-ink-muted); opacity: 0.6; transition: opacity 300ms var(--ease-out);
}
.isa-credit:hover, .isa-credit:focus-within { opacity: 1; }
.isa-credit a { display: inline-flex; align-items: center; gap: var(--space-2); color: inherit; text-transform: none; letter-spacing: 0.02em; text-decoration: none; transition: color 200ms; }
.isa-credit a:hover { color: var(--on-ink); text-decoration: none; }
.isa-credit img { display: block; width: 14px; height: auto; transition: transform 500ms cubic-bezier(0.23, 1, 0.32, 1); }
.isa-credit a:hover img { transform: translateY(-3px) rotate(-6deg); }
@media (prefers-reduced-motion: reduce) { .isa-credit a:hover img { transform: none; } }

.breadcrumbs { font-size: var(--text-meta); color: var(--muted); }
.breadcrumbs ol { display: flex; flex-wrap: wrap; gap: var(--space-2); margin: 0; padding: 0; list-style: none; }
.breadcrumbs li + li::before { content: "/"; margin-right: var(--space-2); color: var(--control); }
.breadcrumbs a { color: var(--muted); }

/* ════════════════════════════════════════════════════════════════
   Actions
   ════════════════════════════════════════════════════════════════ */

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
    min-height: var(--control-h);
    padding: 0 var(--space-5);
    border: 1.5px solid var(--ink); border-radius: var(--radius);
    background: var(--paper); color: var(--ink);
    font: 500 var(--text-label) / 1 var(--font-ui);
    letter-spacing: var(--tracking-label); text-transform: uppercase; text-decoration: none;
    white-space: nowrap;
    transition: background-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out);
}
.btn:hover { background: var(--ink); color: var(--on-ink); }
.btn--primary { background: var(--ink); color: var(--on-ink); }
.btn--primary:hover { background: #2b2b2b; border-color: #2b2b2b; }
.btn--quiet { border-color: transparent; padding-inline: var(--space-3); text-decoration: underline; text-underline-offset: 0.3em; }
.btn--quiet:hover { background: var(--wall); color: var(--ink); }
.btn--danger { border-color: var(--error); color: var(--error); }
.btn--danger:hover { background: var(--error); color: var(--on-ink); }
.btn--block { width: 100%; }
.btn--panel { min-height: var(--control-h-panel); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: 0.45; pointer-events: none; }
.btn[aria-busy="true"] { pointer-events: none; }
.btn[aria-busy="true"]::after {
    content: ""; width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%;
    animation: spin 700ms linear infinite;
}
.btn svg { width: 18px; height: 18px; flex: none; }
@keyframes spin { to { transform: rotate(1turn); } }

.text-link { font-weight: 500; }
.text-link::after { content: " →"; }

/* Sticky action bar — the thumb zone on phones (artwork page, mobile forms) */
.action-bar {
    position: sticky; bottom: 0; z-index: 40;
    display: flex; gap: var(--space-2);
    padding: var(--space-3) var(--gutter) calc(var(--space-3) + env(safe-area-inset-bottom));
    background: var(--paper);
    border-top: var(--rule);
    box-shadow: var(--shadow-bar);
}
.action-bar > .btn { flex: 1 1 0; min-width: 0; padding-inline: var(--space-3); white-space: normal; text-align: center; line-height: 1.2; }
@media (min-width: 900px) { .action-bar--mobile-only { position: static; box-shadow: none; border: 0; padding-inline: 0; background: none; } }

/* ════════════════════════════════════════════════════════════════
   Status — event state (from dates) vs publication state (set by people)
   ════════════════════════════════════════════════════════════════ */

.status {
    display: inline-flex; align-items: center; gap: var(--space-2);
    min-height: 28px; padding: 0 var(--space-3);
    font-size: var(--text-micro); font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase;
    white-space: nowrap;
}
.status--current { background: var(--current); color: var(--on-ink); }
.status--upcoming { background: var(--upcoming); color: var(--on-ink); }
.status--past { background: var(--past); color: var(--ink); }

/* Publication: outlined, never filled with an event colour */
.pub {
    display: inline-flex; align-items: center; gap: var(--space-2);
    min-height: 28px; padding: 0 var(--space-3);
    font-size: var(--text-micro); font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase;
    border: 1px solid var(--ink); white-space: nowrap;
}
.pub--draft { border-style: dashed; border-color: var(--control); color: var(--muted); }
.pub--ready { border-color: var(--upcoming-ink); color: var(--upcoming-ink); }   /* published, waiting for opening */
.pub--archived { background: var(--stone); border-color: var(--stone); color: var(--muted); }
.pub--hidden { border-color: var(--error); color: var(--error); }

/* Availability is a word, not a colour */
.availability { font-size: var(--text-meta); font-weight: 500; }
.availability--sold::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: var(--space-2); border-radius: 50%; background: var(--ink); vertical-align: 0.05em; }

/* Data visibility markers in forms */
.vis { font-size: var(--text-micro); font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; }
.vis--public { color: var(--upcoming-ink); }
.vis--private { color: var(--muted); }
.demo-flag {
    display: inline-flex; align-items: center; min-height: 24px; padding: 0 var(--space-2);
    border: 1px solid var(--control); color: var(--muted);
    font-size: var(--text-micro); letter-spacing: 0.1em; text-transform: uppercase;
}

/* ════════════════════════════════════════════════════════════════
   Artwork — the label is the signature
   ════════════════════════════════════════════════════════════════ */

/* The museum label: same structure on screen and on paper.
   Title / artist / year · medium / size / price · availability / WSS code. */
.wall-label {
    border-top: 2px solid var(--ink);
    padding-top: var(--space-4);
    display: grid; gap: var(--space-2);
}
.wall-label > * { margin: 0; }
.wall-label__title { font-family: var(--font-display); font-weight: 500; font-size: var(--text-title); line-height: var(--leading-snug); letter-spacing: var(--tracking-display); }
.wall-label__artist { font-size: 1.0625rem; font-weight: 500; }
.wall-label__facts { font-size: var(--text-meta); color: var(--muted); }
.wall-label__facts span + span::before { content: " · "; }
.wall-label__row {
    display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--space-2) var(--space-4);
    padding-top: var(--space-3); margin-top: var(--space-2) !important; border-top: var(--rule);
}
.wall-label__row .wall-label__code { margin-left: auto; }
.wall-label__price { font-size: 1.375rem; font-weight: 500; font-variant-numeric: tabular-nums lining-nums; }
.wall-label__code { font-size: var(--text-micro); font-weight: 500; letter-spacing: 0.12em; color: var(--muted); font-variant-numeric: tabular-nums; }

/* Artwork stage: contained image on a wall mat — never cropped */
.artwork-stage { background: var(--wall); --stage-h: max(240px, min(46svh, 600px)); --stage-pad: var(--space-4); }
.artwork-stage__frame {
    display: flex; align-items: center; justify-content: center;
    height: var(--stage-h);
    padding: var(--stage-pad);
}
.artwork-stage__frame img {
    width: auto; height: auto;
    max-width: 100%; max-height: calc(var(--stage-h) - 2 * var(--stage-pad));
    object-fit: contain;
    box-shadow: 0 2px 8px rgba(17, 17, 17, 0.12);
}
.artwork-stage__thumbs { display: flex; gap: var(--space-2); padding: 0 var(--gutter) var(--space-3); margin-top: calc(-1 * var(--space-2)); overflow-x: auto; }
.artwork-stage__thumbs button {
    flex: none; width: 48px; height: 48px; padding: 0; border: 1px solid var(--line); background: var(--paper);
}
.artwork-stage__thumbs img { width: 100%; height: 100%; object-fit: cover; }
.artwork-stage__thumbs button[aria-current="true"] { outline: 2px solid var(--ink); outline-offset: 2px; }

/* Where to find the work / artist in the building */
.locator {
    display: flex; gap: var(--space-3); align-items: flex-start;
    padding: var(--space-4); background: var(--wall);
    font-size: var(--text-meta);
}
.locator svg { flex: none; width: 20px; height: 20px; margin-top: 2px; }
.locator strong { display: block; font-size: var(--text-body); }

/* "Shown in <exhibition> [status]" */
.provenance { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); font-size: var(--text-meta); color: var(--muted); }
.provenance a { color: var(--ink); font-weight: 500; }

/* Definition list for artwork facts */
.facts { display: grid; grid-template-columns: max-content 1fr; gap: var(--space-3) var(--space-5); margin: 0; }
.facts dt { font-size: var(--text-label); font-weight: 500; letter-spacing: var(--tracking-label); text-transform: uppercase; color: var(--muted); padding-top: 3px; }
.facts dd { margin: 0; }
.facts dd small { display: block; color: var(--muted); }

/* Artwork card: image on a mat + a miniature label */
.artwork-card { display: grid; align-content: start; row-gap: var(--space-2); text-decoration: none; }
.artwork-card__mat { aspect-ratio: 4 / 5; background: var(--wall); display: grid; place-items: center; padding: 10%; overflow: hidden; }
.artwork-card__mat img { max-width: 100%; max-height: 100%; object-fit: contain; transition: transform var(--dur) var(--ease-out); }
.artwork-card:hover .artwork-card__mat img { transform: scale(1.02); }
.artwork-card__title { border-top: 1px solid var(--ink); padding-top: var(--space-2); margin-top: var(--space-1); font-family: var(--font-display); font-size: var(--text-subtitle); font-weight: 500; line-height: var(--leading-snug); letter-spacing: var(--tracking-display); }
.artwork-card:hover .artwork-card__title { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
.artwork-card__meta { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0 var(--space-3); font-size: var(--text-meta); color: var(--muted); }
.artwork-card__meta .num { white-space: nowrap; font-size: var(--text-micro); letter-spacing: 0.08em; }
.section--wall .artwork-card__mat, .section--wall .artist-card__portrait, .section--wall .exhibition-card__cover { background: var(--paper); }

/* ════════════════════════════════════════════════════════════════
   Collections: artists & exhibitions
   ════════════════════════════════════════════════════════════════ */

.artist-card { display: grid; align-content: start; row-gap: var(--space-2); text-decoration: none; }
.artist-card__portrait { aspect-ratio: 4 / 5; background: var(--wall); overflow: hidden; }
.artist-card__portrait img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(0.15); transition: filter var(--dur) var(--ease-out); }
.artist-card:hover .artist-card__portrait img { filter: none; }
.artist-card__initials { width: 100%; height: 100%; display: grid; place-items: center; font-family: var(--font-display); font-size: 3rem; color: var(--muted); }
.artist-card__name { font-family: var(--font-display); font-size: var(--text-subtitle); font-weight: 500; line-height: var(--leading-snug); }
.artist-card:hover .artist-card__name { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
.artist-card__studio { font-size: var(--text-meta); color: var(--muted); }
/* Compact card for dense grids (directory): one-line name and meta. */
.artist-card--compact .artist-card__name { font-size: 0.9375rem; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.artist-card--compact .artist-card__studio { font-size: 0.8125rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.exhibition-card { display: grid; align-content: start; row-gap: var(--space-3); text-decoration: none; }
.exhibition-card__cover { aspect-ratio: 3 / 2; background: var(--wall); overflow: hidden; position: relative; }
.exhibition-card__cover img { width: 100%; height: 100%; object-fit: cover; }
.exhibition-card__cover .status { position: absolute; left: 0; top: 0; }
.exhibition-card__title { font-family: var(--font-display); font-size: var(--text-title); font-weight: 500; line-height: var(--leading-snug); }
.exhibition-card:hover .exhibition-card__title { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
.exhibition-card__dates { font-size: var(--text-meta); font-weight: 500; font-variant-numeric: tabular-nums; }
.exhibition-card__summary { color: var(--muted); max-width: 52ch; }
.exhibition-card__details { display: grid; justify-items: start; align-content: start; gap: var(--space-3); }
.artwork-card__extra { display: flex; flex-wrap: wrap; gap: var(--space-3); align-items: baseline; }

/* Cards in a grid share row tracks (subgrid), so titles, dates and meta line up
   across a row even when one card has a longer title or no summary. */
@supports (grid-template-rows: subgrid) {
    .grid > .exhibition-card { grid-row: span 4; grid-template-rows: subgrid; }
    .grid > .artwork-card { grid-row: span 4; grid-template-rows: subgrid; }
    .grid > .artist-card { grid-row: span 3; grid-template-rows: subgrid; }
}

/* Feature band for the exhibition on the walls right now */
.feature { display: grid; gap: 0; grid-template-columns: minmax(0, 1fr); }
.feature__media { background: var(--wall); min-height: 320px; }
.feature__media img { width: 100%; height: 100%; object-fit: cover; }
.feature__body { display: grid; align-content: center; gap: var(--space-4); padding: var(--space-7) var(--gutter); }
.feature--current .feature__body { border-top: 6px solid var(--current); }
.feature--upcoming .feature__body { border-top: 6px solid var(--upcoming); }
@media (min-width: 900px) {
    .feature { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); }
    .feature__body { padding: var(--space-8); }
    .feature--current .feature__body, .feature--upcoming .feature__body { border-top-width: 6px; }
}

/* Filter tabs (status) + compact select for long lists */
.tabs { display: flex; flex-wrap: wrap; gap: var(--space-1); border-bottom: var(--rule); }
.tabs a, .tabs button {
    display: inline-flex; align-items: center; min-height: var(--target-min); padding: 0 var(--space-4);
    background: none; border: 0; text-decoration: none; font-weight: 500;
    box-shadow: inset 0 -2px 0 transparent;
}
.tabs [aria-current="page"], .tabs [aria-selected="true"] { box-shadow: inset 0 -2px 0 var(--ink); }
.tabs .count { color: var(--muted); font-weight: 400; margin-left: var(--space-2); font-variant-numeric: tabular-nums; }

.pagination { display: flex; gap: var(--space-2); justify-content: center; margin-top: var(--space-7); }
.pagination a, .pagination span { display: inline-grid; place-items: center; min-width: var(--target-min); min-height: var(--target-min); border: var(--rule); text-decoration: none; font-variant-numeric: tabular-nums; }
.pagination [aria-current="page"] { background: var(--ink); color: var(--on-ink); border-color: var(--ink); }

/* ════════════════════════════════════════════════════════════════
   Forms
   ════════════════════════════════════════════════════════════════ */

.field { display: grid; gap: var(--space-2); }
.field__label { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-3); font-size: var(--text-meta); font-weight: 500; }
.field__hint { font-size: var(--text-meta); color: var(--muted); }
.field__error { font-size: var(--text-meta); color: var(--error); display: flex; gap: var(--space-2); align-items: flex-start; }
.field__error::before { content: "!"; flex: none; display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: var(--error); color: var(--on-ink); font-size: 12px; font-weight: 700; margin-top: 1px; }
.field__counter { font-size: var(--text-micro); color: var(--muted); font-variant-numeric: tabular-nums; }
.field__counter[data-over] { color: var(--error); font-weight: 600; }

.input, .select, .textarea {
    width: 100%; min-height: var(--control-h-panel);
    padding: 10px var(--space-3);
    background: var(--paper); color: var(--ink);
    border: 1.5px solid var(--control); border-radius: var(--radius);
    font-size: 1rem; /* 16px prevents iOS zoom */
    transition: border-color var(--dur-fast) var(--ease-out);
}
.input:hover, .select:hover, .textarea:hover { border-color: var(--ink); }
.input:focus-visible, .select:focus-visible, .textarea:focus-visible { outline: 3px solid var(--focus); outline-offset: 1px; border-color: var(--ink); }
.input::placeholder, .textarea::placeholder { color: var(--muted); opacity: 1; }
.textarea { min-height: 128px; resize: vertical; line-height: var(--leading-body); }
.select { appearance: none; padding-right: 40px; background: var(--paper) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none'%3E%3Cpath d='M1 1.5l5 5 5-5' stroke='%23111' stroke-width='1.6'/%3E%3C/svg%3E") no-repeat right 14px center; }
[aria-invalid="true"] { border-color: var(--error) !important; background-color: var(--error-wash); }
.input[readonly], .field--locked .input { background: var(--stone); border-style: dashed; color: var(--muted); cursor: default; }
.input-group { display: flex; }
.input-group > .input { flex: 1; min-width: 0; }
.input-group > .input + .select, .input-group > .addon { width: auto; flex: none; border-left: 0; }
.addon { display: inline-flex; align-items: center; padding: 0 var(--space-3); border: 1.5px solid var(--control); background: var(--wall); font-size: var(--text-meta); }

.check { display: flex; gap: var(--space-3); align-items: flex-start; min-height: var(--target-min); padding-block: 10px; cursor: pointer; }
.check input { flex: none; width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--ink); }

.segmented { display: inline-flex; border: 1.5px solid var(--ink); }
.segmented label { position: relative; }
.segmented input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.segmented span { display: inline-flex; align-items: center; min-height: var(--control-h-panel); padding: 0 var(--space-4); font-size: var(--text-meta); font-weight: 500; }
.segmented label + label span { border-left: 1.5px solid var(--ink); }
.segmented input:checked + span { background: var(--ink); color: var(--on-ink); }
.segmented input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }

.fieldset { border: 0; margin: 0; padding: 0; display: grid; gap: var(--space-5); }
.fieldset__legend { display: flex; justify-content: space-between; align-items: baseline; gap: var(--space-3); width: 100%; padding: 0 0 var(--space-3); border-bottom: var(--rule); font-family: var(--font-display); font-size: var(--text-subtitle); font-weight: 500; }

/* Progressive disclosure for optional field groups */
.disclosure { border-top: var(--rule); }
.disclosure > summary {
    display: flex; align-items: center; justify-content: space-between; gap: var(--space-3);
    min-height: 56px; list-style: none; cursor: pointer; font-weight: 500;
}
.disclosure > summary::-webkit-details-marker { display: none; }
.disclosure > summary::after { content: "+"; font-size: 1.5rem; font-weight: 300; line-height: 1; transition: transform var(--dur) var(--ease-out); }
.disclosure[open] > summary::after { transform: rotate(45deg); }
.disclosure > summary .meta { font-weight: 400; margin-left: auto; }
.disclosure__body { padding-bottom: var(--space-5); display: grid; gap: var(--space-5); }

/* Drop zone for uploads */
.dropzone {
    display: grid; place-items: center; gap: var(--space-2); text-align: center;
    min-height: 160px; padding: var(--space-5);
    border: 1.5px dashed var(--control); background: var(--wall);
}
.dropzone[data-over] { border-color: var(--ink); background: var(--stone); }
.progress { height: 4px; background: var(--line); overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--ink); transition: width var(--dur) var(--ease-out); }

/* ════════════════════════════════════════════════════════════════
   Panels (admin + artist) — Operate mode: denser, same materials
   ════════════════════════════════════════════════════════════════ */

.panel-shell { display: grid; min-height: 100vh; grid-template-columns: minmax(0, 1fr); }
.panel-nav { background: var(--ink); color: var(--on-ink); display: flex; flex-direction: column; }
.panel-nav a { display: flex; align-items: center; min-height: var(--target-min); padding: 0 var(--space-3); color: var(--on-ink-muted); text-decoration: none; font-weight: 500; }
.panel-nav a:hover { color: var(--on-ink); }
.panel-nav a[aria-current="page"] { color: var(--on-ink); box-shadow: inset 3px 0 0 var(--on-ink); background: #1d1d1d; }
.panel-nav__bar { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); }
.panel-nav__brand { gap: var(--space-3); padding: 0 !important; color: var(--on-ink) !important; box-shadow: none !important; background: none !important; }
.panel-nav__brand img { width: 40px; height: 40px; flex: none; }
.panel-nav__menu { display: flex; flex-direction: column; gap: var(--space-4); }
.panel-nav__list { margin: 0; padding: 0; list-style: none; display: grid; gap: 2px; }
.panel-nav__list + .panel-nav__list { padding-top: var(--space-4); border-top: 1px solid #2a2a2a; }
.panel-nav__foot { display: grid; gap: var(--space-1); padding-top: var(--space-4); border-top: 1px solid #2a2a2a; font-size: var(--text-meta); }
.panel-nav__user { display: grid; color: var(--on-ink); font-weight: 500; padding: 0 var(--space-3); margin: 0 0 var(--space-2); }
.panel-nav__user span { color: var(--on-ink-muted); font-weight: 400; overflow-wrap: anywhere; }
.panel-nav__signout {
    min-height: var(--target-min); padding: 0 var(--space-3); width: 100%; text-align: left;
    background: none; border: 0; color: var(--on-ink-muted); font-weight: 500; text-decoration: underline; text-underline-offset: 0.22em;
}
.panel-nav__signout:hover { color: var(--on-ink); }
.panel-nav__toggle {
    display: none; align-items: center; gap: var(--space-2); min-height: var(--target-min); padding: 0 var(--space-3);
    background: none; border: 1px solid #3a3a3a; color: var(--on-ink); font: inherit; font-weight: 500; cursor: pointer;
}
.panel-nav__toggle svg { width: 20px; height: 20px; }
.panel-nav__toggle[aria-expanded="true"] { border-color: var(--on-ink); }

/* Phone & tablet: compact sticky bar; the menu opens below it (stays open without JS). */
@media (max-width: 999px) {
    .panel-nav { position: sticky; top: 0; z-index: 50; padding: var(--space-2) var(--gutter); }
    .js .panel-nav__toggle { display: inline-flex; }
    .js .panel-nav__menu { display: none; }
    .panel-nav__menu { padding: var(--space-4) 0 var(--space-3); max-height: calc(100svh - 64px); overflow-y: auto; }
    .js .panel-nav[data-open] .panel-nav__menu { display: flex; }
    .panel-nav__brand span { font-size: var(--text-meta); }
    .panel-nav__list a { min-height: 48px; font-size: 1.0625rem; }
}
@media (min-width: 1000px) {
    .panel-shell { grid-template-columns: 248px minmax(0, 1fr); }
    .panel-nav { position: sticky; top: 0; height: 100vh; overflow-y: auto; padding: var(--space-5) var(--space-4); gap: var(--space-6); }
    .panel-nav__menu { flex: 1; }
    .panel-nav__foot { margin-top: auto; }
}
.panel-main { padding: var(--space-6) var(--gutter) var(--space-9); background: var(--paper); min-width: 0; }
.panel-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: var(--space-4); margin-bottom: var(--space-6); padding-bottom: var(--space-4); border-bottom: var(--rule); }
.panel-head h1 { font-size: var(--text-headline); }

.table-wrap { overflow-x: auto; border: var(--rule); }
.table { width: 100%; border-collapse: collapse; font-size: 0.9375rem; }
.table th { text-align: left; font-size: var(--text-label); font-weight: 500; letter-spacing: var(--tracking-label); text-transform: uppercase; color: var(--muted); padding: var(--space-3) var(--space-4); background: var(--wall); border-bottom: var(--rule); white-space: nowrap; }
.table td { padding: var(--space-3) var(--space-4); border-bottom: var(--rule); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: #fafaf8; }
.table td.num, .table th.num { text-align: right; }
.table__thumb { width: 48px; height: 48px; object-fit: cover; background: var(--wall); }
.table__actions { display: flex; gap: var(--space-1); justify-content: flex-end; }
.icon-btn { display: inline-grid; place-items: center; width: var(--target-min); height: var(--target-min); background: none; border: 1px solid transparent; }
.icon-btn:hover { border-color: var(--line); background: var(--wall); }
.icon-btn svg { width: 18px; height: 18px; }

.stat { padding: var(--space-4) 0; border-top: 2px solid var(--ink); display: grid; gap: var(--space-1); }
.stat__value { font-family: var(--font-display); font-size: var(--text-headline); line-height: 1; font-variant-numeric: lining-nums; }
.stat__label { font-size: var(--text-meta); font-weight: 500; }
.stat__note { font-size: var(--text-meta); color: var(--muted); }

.task-list { margin: 0; padding: 0; list-style: none; border-top: var(--rule); }
.task-list li { display: grid; grid-template-columns: 1fr auto; gap: var(--space-1) var(--space-4); align-items: center; padding: var(--space-4) 0; border-bottom: var(--rule); }
.task-list .meta { grid-column: 1; }

/* ════════════════════════════════════════════════════════════════
   Feedback & states
   ════════════════════════════════════════════════════════════════ */

.notice { display: flex; gap: var(--space-3); align-items: flex-start; padding: var(--space-4); border: 1px solid var(--line); background: var(--wall); }
.notice svg { flex: none; width: 20px; height: 20px; margin-top: 2px; }
.notice--success { background: var(--paper); border-color: var(--ink); }
.notice--error { background: var(--error-wash); border-color: var(--error); color: var(--ink); }
.notice--info { background: var(--paper); border-color: var(--upcoming-ink); }
.notice strong { display: block; }

.empty { display: grid; justify-items: start; gap: var(--space-3); padding: var(--space-7) var(--space-5); border: 1.5px dashed var(--line); }
.empty h3 { font-size: var(--text-subtitle); }
.empty p { color: var(--muted); max-width: 52ch; }

.toast {
    position: fixed; left: 50%; bottom: calc(var(--space-5) + env(safe-area-inset-bottom)); z-index: 90;
    transform: translateX(-50%);
    display: flex; gap: var(--space-4); align-items: center;
    padding: var(--space-3) var(--space-3) var(--space-3) var(--space-5);
    background: var(--ink); color: var(--on-ink); box-shadow: var(--shadow-menu);
    max-width: calc(100vw - 2 * var(--gutter));
}
.toast .btn { min-height: 36px; border-color: var(--on-ink); background: transparent; color: var(--on-ink); }

.dialog { border: 0; padding: 0; max-width: min(520px, calc(100vw - 2 * var(--gutter))); box-shadow: var(--shadow-menu); }
.dialog::backdrop { background: rgba(17, 17, 17, 0.5); }
.dialog__body { padding: var(--space-6); display: grid; gap: var(--space-4); }
.dialog__actions { display: flex; flex-wrap: wrap; gap: var(--space-2); justify-content: flex-end; padding: var(--space-4) var(--space-6); background: var(--wall); }

/* Error / gone pages: calm, ink only — the accent never decorates failure */
.state-page { padding-block: var(--space-10); }
.state-page__code { font-size: var(--text-label); font-weight: 500; letter-spacing: var(--tracking-label); color: var(--muted); }

/* ════════════════════════════════════════════════════════════════
   Print label preview (on screen) — mirrors the PDF
   ════════════════════════════════════════════════════════════════ */

.print-label {
    display: grid; grid-template-columns: 1.5in 1fr; gap: 0.14in; align-items: start;
    width: 3.75in; min-height: 2.25in; padding: 0.16in;
    background: var(--paper); outline: 1px dashed var(--control);
    font-family: var(--font-ui); color: #000;
}
.print-label__qr { display: grid; gap: 0.04in; justify-items: center; }
.print-label__qr img, .print-label__qr svg { width: 1.5in; height: 1.5in; }
.print-label__url { display: grid; justify-items: center; font-size: 9pt; line-height: 1.2; letter-spacing: 0; font-variant-numeric: tabular-nums; text-align: center; }
.print-label__url b { font-weight: 600; font-size: 10pt; letter-spacing: 0.04em; }
.print-label__title { font-family: var(--font-display); font-size: 14pt; font-weight: 500; line-height: 1.15; }
.print-label__artist { font-size: 10pt; font-weight: 500; margin-top: 0.04in; }
.print-label__facts { font-size: 9pt; line-height: 1.35; margin-top: 0.06in; }
.print-label__line { font-size: 9pt; line-height: 1.35; margin-top: 0.06in; }
.print-label__price { font-size: 11pt; font-weight: 600; margin-top: 0.06in; }
.print-label__studio { font-size: 9pt; letter-spacing: 0.12em; text-transform: uppercase; margin-top: 0.08in; }

/* Password field with a show/hide eye (added by app.js) */
.password-field { position: relative; display: block; }
.password-field .input { padding-right: calc(var(--target-min) + var(--space-2)); }
.password-field__toggle {
    position: absolute; top: 0; right: 0; bottom: 0; width: var(--target-min);
    display: grid; place-items: center; background: none; border: 0; color: var(--muted); cursor: pointer;
}
.password-field__toggle:hover, .password-field__toggle[aria-pressed="true"] { color: var(--ink); }
.password-field__toggle:focus-visible { outline: 3px solid var(--focus); outline-offset: -3px; }
.password-field__toggle svg { width: 20px; height: 20px; }
