/* ArtGM.online — shared stylesheet. Version: see version.txt (appended to the URL as ?v=). */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
:root {
  --bg:#f7f5f0; --surface:#fff; --border:#ddd9d0; --border-light:#eeebe4;
  --text:#2a2a2a; --text-muted:#6a6a6a;
  --accent:#8b6914; --accent-dark:#6a4f0e; --accent-light:#f5edd8; --accent-line:#d4ad50; --on-accent:#fff;
  /* Gold accent defaults. A gallery's brand colour re-points these (includes/header.php, brandAccentCss()). */
  --nav-bg:#1a1a1a; --nav-text:#ede9e0; --nav-hover:#8b6914;
  /* Nav theme tokens. Defaults = the dark nav. .nav-custom (below) re-points them for a custom bar colour;
     header.php supplies the values. */
  --nav-hover-text:#fff; --nav-brand:#e8c96a; --nav-brand-hover:#f0d87a; --nav-brand-line:#3a3a3a;
  --nav-logout:#999; --nav-logout-line:#444;
  --nav-menu-bg:#252525; --nav-menu-line:#333; --nav-menu-divider:#2e2e2e;
  --nav-m-line:#2a2a2a; --nav-m-menu-bg:#1e1e1e; --nav-m-menu-divider:#1a1a1a;
  --nav-shadow:0 2px 6px rgba(0,0,0,.3);
  --modal-blur:1.5px;     /* how much the page behind a dialog is blurred */
  --modal-speed:.28s;   /* how long every dialog takes to fade/grow in and out */
  --green:#2d6a2d; --green-bg:#eaf4ea; --red:#c0392b; --red-bg:#fdf0ee;
  --orange:#a35900; --orange-bg:#fff4e5; --blue:#1a5276; --blue-bg:#eaf2fb; /* orange darkened for >=4.5:1 text contrast on --orange-bg */
  --th-bg:#f0ede5; --row-hover:#faf8f4; --btn-secondary-hover:#ccc9c0; --green-dark:#1d4a1d;
  --radius:6px; --shadow:0 2px 8px rgba(0,0,0,.08); --shadow-sm:0 1px 4px rgba(0,0,0,.06);
}
body { font-family:'Segoe UI',system-ui,-apple-system,sans-serif; background:var(--bg); color:var(--text); font-size:15px; line-height:1.6; min-height:100vh; min-height:100dvh; /* dvh: iOS Safari's 100vh includes the collapsing URL bar */ display:flex; flex-direction:column; }
img { max-width:100%; height:auto; }
/* Not inside tables: a percentage max-width on an image in an auto-width table cell collapses it to 0 (list thumbnails vanished). */
table img { max-width:none; }
a { color:var(--accent); text-decoration:none; }
a:hover { color:var(--accent-dark); text-decoration:underline; }
/* Visible keyboard focus for every interactive element (inputs get their own ring below). */
:focus-visible { outline:2px solid var(--accent-line, #d4ad50); outline-offset:2px; }

.nav { background:var(--nav-bg); padding:0 24px; display:flex; align-items:center; position:sticky; top:0; z-index:100; box-shadow:var(--nav-shadow); }
.nav-brand { font-family:Georgia,serif; font-size:1.15rem; color:var(--nav-brand); padding:16px 24px 16px 0; margin-right:8px; border-right:1px solid var(--nav-brand-line); white-space:nowrap; text-decoration:none; }
.nav-brand:hover { color:var(--nav-brand-hover); text-decoration:none; }
.nav-links { display:flex; align-items:stretch; flex:1; }
/* Top-level nav items: plain links and the Modules dropdown toggle share one base. */
.nav-links a, .nav-dropdown-toggle { color:var(--nav-text); padding:0 16px; display:flex; align-items:center; font-size:.92rem; transition:background .15s,color .15s; text-decoration:none; height:52px; }
.nav-links a:hover, .nav-links a.active { background:var(--nav-hover); color:var(--nav-hover-text); text-decoration:none; }
.nav-right { margin-left:auto; display:flex; align-items:center; gap:12px; }
.nav-right a { color:var(--nav-text); font-size:.82rem; text-decoration:none; padding:6px 10px; border-radius:var(--radius); transition:background .15s,color .15s; }
.nav-right a:hover, .nav-right a.active { background:var(--nav-hover); color:var(--nav-hover-text); text-decoration:none; }
.nav-logo { max-height:40px; width:auto; display:block; }
.nav-logout { font-size:.8rem; color:var(--nav-logout) !important; border:1px solid var(--nav-logout-line); padding:5px 12px !important; border-radius:var(--radius); transition:background .15s,color .15s; }
.nav-logout:hover { background:var(--nav-hover); color:var(--nav-hover-text) !important; border-color:var(--nav-hover); }
.nav-toggle { display:none; background:none; border:none; cursor:pointer; padding:10px; margin-left:auto; flex-direction:column; justify-content:center; gap:5px; }
.nav-toggle span { display:block; width:22px; height:2px; background:var(--nav-text); border-radius:2px; transition:transform .2s, opacity .2s; }
.nav-open .nav-toggle span:nth-child(1) { transform:translateY(7px) rotate(45deg); }
.nav-open .nav-toggle span:nth-child(2) { opacity:0; transform:scaleX(0); }
.nav-open .nav-toggle span:nth-child(3) { transform:translateY(-7px) rotate(-45deg); }
/* Modules dropdown */
.nav-dropdown { position:relative; display:flex; align-items:stretch; }
.nav-dropdown-toggle { gap:5px; cursor:pointer; background:none; border:0; font-family:inherit; text-align:left; } /* base: shared rule with .nav-links a above; the toggle is a <button>, so reset the browser button look */
.nav-dropdown-toggle:hover, .nav-dropdown.open .nav-dropdown-toggle, .nav-dropdown-toggle.active { background:var(--nav-hover); color:var(--nav-hover-text); text-decoration:none; }
.nav-dropdown-arrow { font-size:.7rem; opacity:.75; }
.nav-dropdown-menu { display:none; position:absolute; top:100%; left:0; background:var(--nav-menu-bg); border:1px solid var(--nav-menu-line); border-top:none; min-width:180px; z-index:200; box-shadow:0 6px 18px rgba(0,0,0,.4); }
.nav-dropdown.open .nav-dropdown-menu { display:block; }
.nav-dropdown-menu a { display:block; color:var(--nav-text); padding:11px 18px; font-size:.87rem; text-decoration:none; border-bottom:1px solid var(--nav-menu-divider); white-space:nowrap; transition:background .12s,color .12s; }
.nav-dropdown-menu a:last-child { border-bottom:none; }
/* Add-on the gallery has no subscription for: muted, with a padlock; links to the Subscription page */
.nav-dropdown-menu a.nav-locked { opacity:.55; }
.nav-dropdown-menu a.nav-child, .nav-right .nav-dropdown-menu a.nav-child { padding-left:31px; font-size:.82rem; border-left:3px solid var(--nav-menu-divider); background:color-mix(in srgb, var(--nav-menu-divider) 45%, transparent); }   /* a child item (Voting under Exhibitions): tinted, with a bar on its left edge */
.nav-dropdown-menu a.nav-child:hover, .nav-dropdown-menu a.nav-child.active { background:var(--nav-hover); }
/* A menu row with sub-items behind a chevron: the row is the link plus the chevron button; the sub-items show when .open */
.nav-dropdown-menu .nav-sub { border-bottom:1px solid var(--nav-menu-divider); }
.nav-dropdown-menu .nav-sub:last-child { border-bottom:none; }
.nav-dropdown-menu .nav-sub a { border-bottom:none; }
.nav-sub-row { display:flex; align-items:stretch; }
.nav-sub-row a { flex:1; }
.nav-sub-toggle { background:none; border:0; border-left:1px solid var(--nav-menu-divider); color:var(--nav-text); padding:0 14px; cursor:pointer; }
.nav-sub-toggle:hover { background:var(--nav-hover); color:var(--nav-hover-text); }
.nav-sub-menu { display:none; }
.nav-dropdown-menu .nav-sub.open .nav-sub-row { background:color-mix(in srgb, var(--nav-menu-divider) 45%, transparent); }   /* an open group: its parent row carries the same tint as the child items */
.nav-sub.open .nav-sub-menu { display:block; }
.nav-dropdown-menu a.nav-locked:hover { opacity:.85; }
.nav-lock-icon { margin-left:6px; vertical-align:-1px; }
/* Past-due notice under the nav bar (includes/nav.php) */
.past-due-banner { background:var(--orange-bg); color:var(--orange); border-bottom:1px solid var(--orange); padding:10px 24px; font-size:.88rem; text-align:center; }
.past-due-banner a { color:inherit; font-weight:600; text-decoration:underline; margin-left:6px; white-space:nowrap; }
.past-due-form { display:inline; margin:0; }
.past-due-form button { background:none; border:none; padding:0; margin-left:6px; font:inherit; font-weight:600; color:inherit; text-decoration:underline; cursor:pointer; white-space:nowrap; }
.nav-dropdown-menu a:hover, .nav-dropdown-menu a.active { background:var(--nav-hover); color:var(--nav-hover-text); text-decoration:none; }
/* Settings dropdown in the right-hand nav group: small toggle matching the other right-hand links; menu opens right-aligned */
.nav-right .nav-dropdown { align-items:center; }
.nav-right .nav-dropdown-toggle { height:auto; padding:6px 10px; font-size:.82rem; border-radius:var(--radius); }
.nav-right .nav-dropdown-menu { top:calc(100% + 10px); left:auto; right:0; }
.nav-right .nav-dropdown-menu a { padding:11px 18px; font-size:.87rem; border-radius:0; }

/* Custom nav bar colour (Appearance > Branding > Nav bar colour). includes/header.php sets every --nav-* token
   for the chosen colour; only the shadow is fixed here. */
.nav-custom { --nav-shadow:0 1px 0 rgba(0,0,0,.12); }

.page-wrapper { max-width:1200px; margin:0 auto; padding:32px 24px 60px; flex:1; width:100%; }
.page-header { display:flex; align-items:center; justify-content:space-between; margin-bottom:28px; padding-bottom:16px; border-bottom:2px solid var(--border); gap:16px; flex-wrap:wrap; }
.page-title { font-family:Georgia,serif; font-size:1.7rem; font-weight:normal; overflow-wrap:anywhere; }
.page-subtitle { font-size:.9rem; color:var(--text-muted); margin-top:2px; }

.btn { display:inline-flex; align-items:center; gap:6px; padding:9px 18px; border-radius:var(--radius); font-size:.88rem; font-weight:500; cursor:pointer; border:none; transition:background .15s; text-decoration:none; white-space:nowrap; }
.btn:hover { text-decoration:none; }
.btn-primary { background:var(--accent); color:var(--on-accent); }
.btn-primary:hover { background:var(--accent-dark); color:var(--on-accent); }
.btn:disabled, .btn:disabled:hover { background:var(--border-light); color:var(--text-muted); border:none; cursor:not-allowed; }   /* inactive button: greyed out, no hover */
.btn-secondary { background:var(--border); color:var(--text); }
.btn-secondary:hover { background:var(--btn-secondary-hover); color:var(--text); }
.btn-danger { background:var(--red-bg); border:1px solid var(--red); color:var(--red); }
.btn-danger:hover { background:var(--red); border-color:var(--red); color:#fff; }
.btn-success { background:var(--green); color:#fff; }
.btn-success:hover { background:var(--green-dark); color:#fff; }
.btn-sm { padding:5px 12px; font-size:.82rem; }
.page-header-actions { display:flex; gap:8px; flex-wrap:wrap; }
.page-header-actions form { display:flex; margin:0; }
.page-header-actions form .btn { height:100%; } /* post-form buttons (Archive, Restore, Delete) stretch to the same height as the bordered link buttons beside them */
.gd-ic { justify-content:center; width:30px; height:30px; padding:0; } /* icon-only button: pair with .btn, title + aria-label, and docIcon() */
.sr-only { position:absolute; width:1px; height:1px; margin:-1px; padding:0; overflow:hidden; clip:rect(0,0,0,0); border:0; } /* visually hidden, e.g. the copy-fallback textarea in js/payment-link.js */
.btn-outline { background:transparent; border:1px solid var(--accent); color:var(--accent); }
.btn-outline:hover { background:var(--accent); color:var(--on-accent); }

/* Shared "surface card" base — .card and .stat-card
   use the same background/border/radius/shadow; each below only adds
   its own padding/layout on top. */
.card, .stat-card { background:var(--surface); border:1px solid var(--border); border-radius:var(--radius); box-shadow:var(--shadow-sm); }
.card { padding:24px; }
.card-title { font-family:Georgia,serif; font-size:1.05rem; font-weight:normal; margin-bottom:16px; padding-bottom:10px; border-bottom:1px solid var(--border-light); }
body.style-gold .card { overflow:hidden; }
body.style-gold .card-title { background:var(--accent-light); border-bottom:2px solid var(--accent-line); color:var(--accent-dark); margin:-24px -24px 20px; padding:15px 24px; }
body.style-gold .detail-section:first-child h3 { background:var(--accent-light); border-bottom:2px solid var(--accent-line); color:var(--accent-dark); margin:-24px -24px 12px; padding:10px 24px; }
body.style-gold .detail-section + .detail-section h3 { background:var(--accent-light); border-top:1px solid var(--accent-line); border-bottom:2px solid var(--accent-line); color:var(--accent-dark); margin:0 -24px 12px; padding:10px 24px; }
body.style-gold .card-table-header { background:var(--accent-light); border-bottom:2px solid var(--accent-line); }
body.style-gold .card-table-header h2 { color:var(--accent-dark); }

.stats-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(160px,1fr)); gap:16px; margin-bottom:32px; }
.card-grid      { display:grid; grid-template-columns:repeat(auto-fill,minmax(min(340px,100%),1fr)); gap:24px; }
.card-full      { grid-column:1/-1; }   /* a card that spans every column of its .card-grid */
.card-grid-2-1  { display:grid; grid-template-columns:2fr 1fr; gap:24px; }
/* Equal-width card columns (minmax(0,…) so wide content can't blow a column out); stack on narrower screens.
   .card-grid-2 = two across; .card-grid-3 = three across, two under 1000px. */
.card-grid-2, .card-grid-3 { display:grid; gap:24px; align-items:start; grid-template-columns:repeat(2, minmax(0, 1fr)); }
.card-grid-3 { grid-template-columns:repeat(3, minmax(0, 1fr)); }
@media (max-width: 1000px) { .card-grid-3 { grid-template-columns:repeat(2, minmax(0, 1fr)); } }
@media (max-width: 900px)  { .card-grid-2 { grid-template-columns:minmax(0, 1fr); } }
@media (max-width: 640px)  { .card-grid-3 { grid-template-columns:minmax(0, 1fr); } }

/* The app's one chevron for anything that opens and closes: <span class="chev" aria-hidden="true"></span>.
   Points right when closed and turns down when open: inside an open <details>, inside an open .nav-dropdown, inside a
   button with aria-expanded="true", or when it carries .is-open. Colour and size come from the parent (set font-size
   and color on the span or its container). The table-row version (.chevron-btn below) uses the same glyph. */
.chev { display:inline-block; font-size:.8rem; line-height:1; flex-shrink:0; transition:transform .2s; }
.chev::before { content:"\276F"; }
details[open] > summary .chev, .nav-dropdown.open .chev, [aria-expanded="true"] .chev, .chev.is-open { transform:rotate(90deg); }

/* Expand/collapse chevron on table rows + the panel that opens under the row (Users settings) */
.chevron-btn { background:none; border:none; cursor:pointer; color:var(--text-muted); font-size:.9rem; padding:4px 8px; border-radius:var(--radius); transition:color .15s, transform .2s; display:inline-block; transform:rotate(0deg); }
.chevron-btn:hover { color:var(--accent); }
.chevron-btn.open  { transform:rotate(90deg); color:var(--accent); }
.staff-expand-row td { background:#faf8f4; border-bottom:2px solid var(--border); }
.staff-panel { padding:18px 20px; }
.staff-panel-fields { display:flex; flex-wrap:wrap; gap:14px 20px; margin-bottom:16px; }
.sp-field { display:flex; flex-direction:column; gap:4px; }
.sp-field label { font-size:.82rem; font-weight:500; color:var(--text-muted); }
.sp-field input[type="text"], .sp-field input[type="email"], .sp-field select { padding:7px 10px; border:1px solid var(--border); border-radius:var(--radius); font-size:.88rem; font-family:inherit; background:#fff; min-width:180px; }
.sp-field input:focus, .sp-field select:focus { outline:none; border-color:var(--accent-line, #d4ad50); box-shadow:0 0 0 3px var(--accent-light, rgba(139,105,20,.12)); }
.sp-field-check { justify-content:flex-end; }
.sp-field-check label { display:flex; align-items:center; gap:6px; font-size:.88rem; cursor:pointer; }
.staff-panel-actions { display:flex; gap:8px; flex-wrap:wrap; align-items:center; }

/* A checkbox/radio label that should read as normal text, not the muted field label.
   label.check-label (not just .check-label) so it also beats `.sp-field label`. */
label.check-label { font-weight:normal; font-size:.88rem; color:var(--text); cursor:pointer; }
/* Checkbox labels stacked one per line */
.check-stack { display:flex; flex-direction:column; gap:8px; }

/* One-time-code box (authenticator / recovery code): wide-spaced digits */
.code-input { letter-spacing:.2em; font-size:1.2rem; }
.stat-card { padding:20px; text-align:center; border-top:3px solid var(--accent); }
/* Shared with .stat-card-v's vertical variant below — only font-size/margin differ per layout. */
.stat-value, .stat-card-v .stat-value { font-family:Georgia,serif; color:var(--accent); font-weight:normal; line-height:1; }
.stat-label, .stat-card-v .stat-label { color:var(--text-muted); }
.stat-value { font-size:2rem; margin-bottom:6px; }
.stat-label { font-size:.85rem; }

.table-wrap { overflow-x:auto; }
table { width:100%; border-collapse:collapse; font-size:.9rem; }
thead th { text-align:left; padding:10px 14px; background:var(--th-bg); border-bottom:2px solid var(--border); font-weight:500; font-size:.85rem; color:var(--text-muted); white-space:nowrap; }
tbody tr { border-bottom:1px solid var(--border-light); }
tbody tr:last-child { border-bottom:none; }
tbody tr:hover { background:var(--row-hover); }
tbody td { padding:11px 14px; vertical-align:middle; }
.td-actions { display:flex; gap:6px; flex-wrap:wrap; align-items:center; }
.td-actions-nowrap { flex-wrap:nowrap; } /* icon-only actions: keep on one row, the column grows to fit */

thead th.sortable a { display:inline-flex; align-items:center; gap:3px; color:inherit; text-decoration:none; }
thead th.sortable a:hover { color:var(--accent-dark); text-decoration:none; }
thead th.sortable .arrow { font-size:.7rem; color:var(--accent); }
thead th.sort-active { color:var(--accent-dark); background:var(--accent-light); }


.badge { display:inline-block; padding:3px 9px; border-radius:var(--radius); font-size:.78rem; font-weight:500; }
/* Colour-named badges (.badge-green etc.) are aliases for the status-named
   ones — same look, used when the badge isn't about artwork/sale status,
   so the class name matches what it actually looks like. */
.badge-available, .badge-sold, .badge-green  { background:var(--green-bg);  color:var(--green); }
.badge-red                      { background:var(--red-bg);    color:var(--red); }
.badge-reserved,  .badge-amber  { background:var(--orange-bg); color:var(--orange); }
.badge-transfer_pending, .badge-blue { background:var(--blue-bg); color:var(--blue); }
.badge-not_for_sale, .badge-archived, .badge-gray { background:var(--border); color:var(--text-muted); }

.form-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(260px,1fr)); gap:18px 24px; }
.form-section { grid-column:1/-1; margin-top:12px; padding-top:16px; border-top:1px solid var(--border-light); font-family:Georgia,serif; font-size:.95rem; color:var(--accent); }
.form-group { display:flex; flex-direction:column; gap:5px; }
.form-group.full-width { grid-column:1/-1; }
/* Two equal columns for fields that should line up in rows (the buyer block on the sale form), and the small heading above such a group. */
.form-grid.cols-2 { grid-template-columns:repeat(2,minmax(0,1fr)); }
/* Two minicards stacked in one grid cell (artwork add/edit: Description over Dimensions). */
.form-stack { display:flex; flex-direction:column; gap:18px 24px; min-width:0; }
.form-subsection { font-size:.8rem; font-weight:600; color:var(--text-muted); margin:0 0 8px; }
/* A thin outlined box around a group of fields (Contact and Address on the sale form). */
.form-box { border:1px solid var(--border); border-radius:var(--radius); padding:14px 16px; }
/* Gold style: a minicard's title becomes the same tinted header strip as .card-title, flush to the box edges (box padding is 14px 16px). */
body.style-gold .form-box { overflow:hidden; }
body.style-gold .form-box > .form-subsection { background:var(--accent-light); border-bottom:2px solid var(--accent-line); color:var(--accent-dark); font-family:Georgia,serif; font-size:.95rem; font-weight:normal; margin:-14px -16px 14px; padding:9px 16px; }
/* A plain (non-rich) field directly under a minicard title (Notes on the artist edit page): keep the title strip and the field apart. */
.form-box > .form-subsection + .form-group.form-group-under-title { padding-top:14px; }
/* One artwork row of the sale form: artwork, quantity, price, commission and a remove button, with a line of detail under them. */
.sale-line { display:grid; grid-template-columns:minmax(0,3fr) minmax(0,.7fr) minmax(0,1.1fr) minmax(0,1fr) auto; gap:12px 16px; align-items:end; padding:12px 14px; border:1px solid var(--border); border-radius:var(--radius); margin-bottom:10px; }
.sale-line .line-info { grid-column:1/-1; font-size:.85rem; color:var(--text-muted); margin-top:-4px; }
.sale-line .line-info:empty { display:none; }
.sale-line .line-warn { grid-column:1/-1; margin-top:-4px; }
.field-error[hidden] { display:none; }   /* .field-error sets display:flex, which would otherwise beat the hidden attribute */
/* Breathing space between stacked (non-.form-grid) form-groups — e.g. a
   single-column card with several fields in a row. .form-grid already
   spaces its own children via `gap`, so that case is reset back to 0
   here rather than doubling up. */
.form-group + .form-group { margin-top:18px; }
.form-grid .form-group + .form-group { margin-top:0; }
label { font-size:.85rem; font-weight:500; color:var(--text-muted); }
label .required { color:var(--red); margin-left:2px; }
input[type="text"],input[type="email"],input[type="tel"],input[type="number"],input[type="date"],input[type="password"],input[type="url"],select,textarea {
  width:100%; padding:9px 12px; border:1px solid var(--border); border-radius:var(--radius); font-size:.92rem; font-family:inherit; background:#fff; color:var(--text); transition:border-color .15s,box-shadow .15s; appearance:none; }
input:focus,select:focus,textarea:focus { outline:2px solid var(--accent-line, #d4ad50); outline-offset:-1px; border-color:var(--accent-line, #d4ad50); box-shadow:0 0 0 3px var(--accent-light, rgba(139,105,20,.12)); }
textarea { resize:vertical; min-height:90px; }
select { background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236a6a6a' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat:no-repeat; background-position:right 10px center; padding-right:32px; }
.field-hint { font-size:.78rem; color:var(--text-muted); margin-top:2px; }
.field-error { font-size:.78rem; color:var(--red); font-weight:600; margin-top:2px; display:flex; align-items:center; gap:4px; }
.text-muted { color:var(--text-muted); }
.sub-body { font-size:.9rem; color:var(--text); margin-top:4px; margin-bottom:0; }
.sub-hint { font-size:.82rem; color:var(--text-muted); margin-top:4px; margin-bottom:0; }
/* Subscription page Storage card: gap before the next card, and a <progress> bar drawn like the trial bar */
.storage-card { margin-bottom:24px; }
.storage-progress { display:block; width:100%; height:6px; margin-top:10px; border:0; border-radius:3px; overflow:hidden; background:var(--border); -webkit-appearance:none; appearance:none; }
.storage-progress::-webkit-progress-bar { background:var(--border); border-radius:3px; }
.storage-progress::-webkit-progress-value { background:var(--accent); border-radius:3px; }
.storage-progress::-moz-progress-bar { background:var(--accent); border-radius:3px; }
.form-group.has-error input,.form-group.has-error select,.form-group.has-error textarea { border-color:var(--red); box-shadow:0 0 0 3px rgba(192,57,43,.12); }
.form-actions { display:flex; gap:12px; align-items:center; margin-top:28px; padding-top:20px; border-top:1px solid var(--border-light); flex-wrap:wrap; }
.tpl-extra-form { margin-top:8px; }

.alert { padding:12px 16px; border-radius:var(--radius); margin-bottom:20px; font-size:.9rem; border-left:4px solid; }
.alert ul { margin:6px 0 0 18px; }
.alert-success { background:var(--green-bg); border-color:var(--green); color:var(--green); }
.alert-error   { background:var(--red-bg);   border-color:var(--red);   color:var(--red); }
.alert-info    { background:var(--blue-bg);  border-color:var(--blue);  color:var(--blue); }
.alert-warning { background:var(--orange-bg);border-color:var(--orange);color:var(--orange); }

.detail-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(280px,1fr)); gap:24px; }
.detail-section h3 { font-family:Georgia,serif; font-size:.95rem; font-weight:normal; color:var(--accent); margin-bottom:12px; padding-bottom:6px; border-bottom:1px solid var(--border-light); }
/* Small right-aligned tag in a card header (h3 or .form-subsection) naming the user role group that can see the card; see cardRoleTag() */
.card-tag { float:right; font-family:inherit; font-size:.75rem; font-weight:normal; color:var(--text-muted); }
.detail-section +.detail-section { margin-top:16px; padding-top:16px; border-top:1px solid var(--border-light); }
body.style-gold .detail-section + .detail-section { border-top:none; padding-top:0; }
/* Clamp a long text block to N lines (set via data-clamp-lines, JS applies -webkit-line-clamp) with a "Show more"/"Show less" toggle */
.clamp-text[data-clamp-lines] p { display:-webkit-box; -webkit-box-orient:vertical; overflow:hidden; }
.clamp-text.is-expanded p { display:block; -webkit-line-clamp:unset; }
.clamp-text-toggle { background:none; border:none; padding:4px 0 0; margin-top:4px; font-size:.82rem; color:var(--accent); cursor:pointer; text-decoration:underline; }
.card-table-header { padding:20px 24px 12px; display:flex; justify-content:space-between; align-items:center; }
.card-table-header h2 { font-family:Georgia,serif; font-size:1.1rem; font-weight:normal; }
dl { display:grid; grid-template-columns:auto minmax(0,1fr); gap:6px 16px; align-items:baseline; }
dt { font-size:.85rem; font-weight:500; color:var(--text-muted); white-space:nowrap; }
dd { font-size:.92rem; color:var(--text); min-width:0; overflow-wrap:anywhere; } /* long emails/locations wrap instead of widening the card */
/* Very narrow screens: label above value */
@media (max-width:480px) {
  dl { grid-template-columns:minmax(0,1fr); gap:0; }
  dd { margin-bottom:8px; }
}
/* artwork_view: image column left, details right (collapses to one column at 768px, see below). minmax(0,…) stops wide content blowing a column out. */

.artwork-image { width:100%; max-width:400px; border-radius:var(--radius); border:1px solid var(--border); display:block; margin-bottom:16px; }
.image-placeholder { width:100%; max-width:400px; height:200px; background:var(--bg); border:2px dashed var(--border); border-radius:var(--radius); display:flex; align-items:center; justify-content:center; color:var(--text-muted); font-size:.85rem; margin-bottom:16px; }

.login-wrap { min-height:100vh; display:flex; align-items:center; justify-content:center; background:var(--nav-bg); padding:24px; }
.login-box { background:var(--surface); border-radius:8px; padding:40px 44px; width:100%; max-width:420px; box-shadow:0 8px 32px rgba(0,0,0,.35); }
.login-logo { font-family:Georgia,serif; font-size:1.5rem; color:var(--accent); text-align:center; margin-bottom:4px; }
.login-subtitle { text-align:center; font-size:.9rem; color:var(--text-muted); margin-bottom:32px; }
.login-box .btn { width:100%; justify-content:center; padding:11px; }

.filter-bar { display:flex; gap:10px; flex-wrap:wrap; align-items:center; margin-bottom:20px; }
.filter-bar input,.filter-bar select { width:auto; min-width:140px; height:34px; padding:0 12px; font-size:.87rem; box-sizing:border-box; }
.filter-bar .btn { height:34px; padding:0 14px; font-size:.87rem; box-sizing:border-box; }
/* Custom From-To of the shared range bar (modules/_shared/range_bar.php); [hidden] must win over display:flex */
.range-custom { display:flex; gap:10px; flex-wrap:wrap; align-items:center; }
.range-custom[hidden] { display:none; }
.range-custom-label { display:flex; align-items:center; gap:6px; font-size:.87rem; color:var(--text-muted); }

.thumb { width:48px; height:48px; object-fit:cover; border-radius:4px; border:1px solid var(--border); }
.thumb-placeholder { width:48px; height:48px; background:var(--bg); border:1px solid var(--border); border-radius:4px; display:flex; align-items:center; justify-content:center; color:var(--text-muted); font-size:.7rem; }

.sale-summary { background:var(--accent-light); border:1px solid var(--accent-line); border-radius:var(--radius); padding:18px 22px; margin-bottom:24px; display:grid; grid-template-columns:repeat(auto-fit,minmax(160px,1fr)); gap:12px 24px; }
.sale-summary-item .label { font-size:.85rem; font-weight:500; color:var(--accent-dark); margin-bottom:2px; }
.sale-summary-item .value { font-family:Georgia,serif; font-size:1.2rem; color:var(--accent-dark); }


.dash-layout { display:grid; grid-template-columns:200px 1fr; gap:20px; align-items:stretch; margin-bottom:24px; }
.dash-stats { display:flex; flex-direction:column; gap:8px; }
.stat-card-v { display:flex; flex-direction:column; align-items:flex-start; padding:8px 12px; border-top:none; border-left:3px solid var(--accent); position:relative; }
.stat-card-v .stat-label { font-size:.8rem; line-height:1; }
.stat-card-v .stat-value { font-size:1.15rem; margin-top:3px; }
.stat-card-v .stat-value-sm { font-size:1rem; }
.stat-card-v .drag-grip { position:absolute; top:6px; right:8px; }
.dash-chart-card { padding:20px; display:flex; flex-direction:column; }
.dash-chart-header { display:flex; justify-content:space-between; align-items:center; flex-wrap:wrap; gap:10px; margin-bottom:16px; }
.dash-chart-checks { display:flex; flex-wrap:wrap; gap:6px 18px; margin-top:14px; padding-top:14px; border-top:1px solid var(--border-light); }
.dash-check { display:flex; align-items:center; gap:6px; font-size:.82rem; cursor:pointer; user-select:none; color:var(--text-muted); }
.dash-check input { accent-color:var(--accent); cursor:pointer; flex-shrink:0; }
.stat-now { font-size:.72rem; font-weight:500; background:var(--border-light); color:var(--text-muted); border-radius:3px; padding:0 4px; vertical-align:middle; }
.drag-grip { font-size:1rem; color:#8a8a8a; /* >=3:1 on white (was --border, ~1.4:1) */ cursor:grab; padding:0 2px; user-select:none; transition:color .15s; flex-shrink:0; }
.stat-card-v:hover .drag-grip { color:var(--text-muted); }
.drag-grip:active { cursor:grabbing; }


.breadcrumb { font-size:.92rem; color:color-mix(in srgb, var(--text-muted) 50%, var(--text)); margin-bottom:20px; }
.breadcrumb a { color:inherit; text-decoration:underline; }
.breadcrumb a:hover { color:var(--accent); }
.breadcrumb .sep { margin:0 6px; }

.empty-state { text-align:center; padding:48px 24px; color:var(--text-muted); }
.empty-state .empty-icon { color:var(--border); line-height:0; margin-bottom:14px; }
.empty-state p { margin-bottom:16px; }

#toast-container { position:fixed; bottom:24px; right:24px; z-index:9999; display:flex; flex-direction:column; gap:10px; pointer-events:none; }
.toast { background:var(--surface); border:1px solid var(--border); border-left:4px solid; border-radius:var(--radius); padding:12px 16px; min-width:260px; max-width:380px; box-shadow:0 4px 20px rgba(0,0,0,.15); font-size:.88rem; pointer-events:all; display:flex; align-items:flex-start; gap:10px; animation:toast-in .25s ease; }
.toast-success { border-left-color:var(--green); color:var(--green); }
.toast-error   { border-left-color:var(--red);   color:var(--red); }
.toast-info    { border-left-color:var(--blue);   color:var(--blue); }
.toast-warning { border-left-color:var(--orange); color:var(--orange); }
.toast-msg { flex:1; color:var(--text); }
.toast-close { cursor:pointer; font-size:.8rem; line-height:1.4; color:var(--text-muted); background:none; border:none; padding:0; flex-shrink:0; }
.toast-close:hover { color:var(--text); }
@keyframes toast-in { from { opacity:0; transform:translateX(40px); } to { opacity:1; transform:translateX(0); } }

/* Small confirm dialog (unsell, reverse sale): the overlay keeps an inline display:none that the page script toggles. */
.confirm-overlay { position:fixed; inset:0; background:rgba(0,0,0,.5); z-index:1000; align-items:center; justify-content:center; }
.confirm-card { background:var(--surface); border-radius:8px; padding:28px; max-width:460px; width:90%; max-height:90vh; max-height:90dvh; overflow-y:auto; box-shadow:0 4px 24px rgba(0,0,0,.2); }
.confirm-card h3 { margin:0 0 8px; }
.confirm-card > p { font-size:.9rem; color:var(--text-muted); margin-bottom:16px; }

/* Exhibition picker inside .confirm-card (artworks list > With selected > Add to exhibition): one radio row per exhibition. */
.exhibition-choice-list { display:flex; flex-direction:column; gap:6px; max-height:50vh; overflow-y:auto; }
.exhibition-choice { display:flex; align-items:center; gap:10px; padding:9px 12px; border:1px solid var(--border); border-radius:var(--radius); cursor:pointer; }
.exhibition-choice:hover { background:var(--border-light); }
.exhibition-modal-actions { display:flex; gap:10px; margin-top:16px; }
/* Artwork names listed in the shared confirmation modal (artworks list > With selected > Delete); scrolls when long. */
.confirm-item-list { margin:0 0 4px; padding:8px 12px 8px 28px; max-height:30vh; overflow-y:auto; border:1px solid var(--border); border-radius:var(--radius); font-size:.88rem; overflow-wrap:anywhere; }
.confirm-item-list[hidden] { display:none; }
/* "With selected" dropdown on the artworks list: sized to its longest option (not full width) so Apply sits right after it. */
.bulk-select { width:auto; font-size:.85rem; }
.exhibition-new-fields { display:flex; flex-direction:column; gap:12px; margin-top:12px; }
.exhibition-new-fields[hidden] { display:none; }
.exhibition-new-dates { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
.exhibition-new-fields .form-group + .form-group { margin-top:0; }
.exhibition-choice-name { flex:1; min-width:0; overflow-wrap:anywhere; }

.picker-modal-overlay { display:none; position:fixed; inset:0; background:rgba(0,0,0,.5); z-index:900; align-items:center; justify-content:center; }
.picker-modal-overlay.open { display:flex; }
.picker-modal { background:#fff; border-radius:8px; width:min(92vw,800px); max-height:82vh; display:flex; flex-direction:column; overflow:hidden; box-shadow:0 8px 32px rgba(0,0,0,.18); }
.picker-modal-header { padding:14px 20px; border-bottom:1px solid var(--border-light); display:flex; align-items:center; gap:12px; }
.picker-modal-header h3 { flex:1; font-size:1rem; margin:0; }
.picker-body { flex:1; overflow-y:auto; padding:16px 20px; }

/* "Get help" link in the page header of documentation.php (opens the pop-up form): lifering, text, muted version; underline on hover */
.help-link { display:inline-flex; align-items:center; gap:8px; background:none; border:0; padding:0; font:inherit; color:inherit; cursor:pointer; }
.help-link-icon { flex-shrink:0; color:var(--accent); }
.help-link:hover .help-link-text { text-decoration:underline; }
.help-link-ver { font-size:.8em; color:var(--text-muted); }
/* All dialogs: the backdrop fades and the dialog grows slightly, both in and out.
   .picker-modal-overlay: shown by adding "open". The transition on `display` (allow-discrete) keeps the overlay
   on screen until the fade-out has finished, and @starting-style gives the fade-in; a browser without these simply
   shows and hides instantly.
   .confirm-overlay: shown by its page script clearing an inline display:none, so it can only fade in (keyframes). */
/* Slight blur of the page behind every dialog */
.picker-modal-overlay, .confirm-overlay { -webkit-backdrop-filter:blur(var(--modal-blur)); backdrop-filter:blur(var(--modal-blur)); }
.picker-modal-overlay { opacity:0; transition:opacity var(--modal-speed) ease-out, display var(--modal-speed) allow-discrete; }
.picker-modal-overlay.open { opacity:1; }
.picker-modal-overlay .picker-modal { opacity:0; transform:scale(.94); transition:opacity var(--modal-speed) ease-out, transform var(--modal-speed) ease-out; }
.picker-modal-overlay.open .picker-modal { opacity:1; transform:scale(1); }
@starting-style {
  .picker-modal-overlay.open { opacity:0; }
  .picker-modal-overlay.open .picker-modal { opacity:0; transform:scale(.94); }
}
.confirm-overlay { animation:modal-fade-in var(--modal-speed) ease-out; }
.confirm-overlay .confirm-card { animation:modal-grow-in var(--modal-speed) ease-out; }
@keyframes modal-fade-in { from { opacity:0; } to { opacity:1; } }
@keyframes modal-grow-in { from { opacity:0; transform:scale(.94); } to { opacity:1; transform:scale(1); } }
@media (prefers-reduced-motion:reduce) {
  .picker-modal-overlay, .picker-modal-overlay .picker-modal { transition:none; }
  .confirm-overlay, .confirm-overlay .confirm-card { animation:none; }
}
.help-modal-close { padding:2px 10px; font-size:1rem; line-height:1; }
.picker-modal.help-modal { width:min(92vw,480px); max-height:90vh; }
.help-backdrop { position:relative; min-height:0; flex:1; }   /* help.php: fills the page under the nav like login.php's .login-wrap, with the same background */
/* Help page (help.php): heading with lifering icon, and the "Get help" form */
/* Signed-out nav "Help" link: lifering icon, larger text, muted version number */
.nav-right a.nav-help { display:inline-flex; align-items:center; gap:8px; font-size:1.05rem; }
.nav-help-icon { flex-shrink:0; }
.nav-help-ver { font-size:.75rem; opacity:.6; }
.help-form { padding:20px; overflow-y:auto; }
.help-form[hidden], .picker-modal > div[hidden], .help-form .alert[hidden] { display:none; }
.help-form .alert { margin:20px 0 0; }
.help-details { margin-top:6px; font-size:.8rem; }
.help-details summary { cursor:pointer; text-decoration:underline; }
.help-details code { display:block; margin-top:6px; word-break:break-word; white-space:pre-wrap; color:var(--text-muted); }
.help-actions { display:flex; justify-content:space-between; gap:12px; margin-top:20px; }
.help-hp { position:absolute; left:-9999px; width:1px; height:1px; overflow:hidden; }   /* honeypot, hidden from people */


.table-tabs { display:flex; gap:4px; padding-left:12px; margin:8px 0 -1px; position:relative; z-index:1; }   /* tabs attached to the top of the table card below */
.table-tabs a { padding:9px 22px; border:1px solid var(--border); border-bottom:0; border-radius:var(--radius) var(--radius) 0 0; background:var(--bg); color:var(--text-muted); font-size:.9rem; text-decoration:none; }
.table-tabs a:hover { color:var(--text); }
.table-tabs a.on { background:var(--th-bg); color:var(--text); font-weight:600; }   /* same tint as the table header it joins */
.table-tabs + div > .card { border-top-left-radius:0; }   /* the card sits inside #sales-panel */
.pagination-bar { display:flex; align-items:center; flex-wrap:wrap; gap:12px; margin-top:16px; scroll-margin-top:70px; }
.pagination-label { font-size:.85rem; font-weight:normal; color:var(--text-muted); }   /* the "Paginate at" label: plain weight, not the medium-weight form-label style */
.pagination-info { font-size:.82rem; color:var(--text-muted); flex:1; min-width:160px; }
.pagination-controls { display:flex; gap:4px; flex-wrap:wrap; }
.page-btn { display:inline-flex; align-items:center; justify-content:center; min-width:30px; height:30px; padding:0 8px; border-radius:var(--radius); border:1px solid var(--border); background:#fff; color:var(--text); font-size:.82rem; text-decoration:none; }
.page-btn:hover { border-color:var(--accent); color:var(--accent); text-decoration:none; }
.page-btn.active { background:var(--accent-light, #f5edd8); border-color:var(--accent-line, #d4ad50); color:var(--accent-dark, #6a4f0e); font-weight:600; }   /* selection = muted brand tint + muted outline */
.page-btn.disabled { opacity:.4; pointer-events:none; }

#scroll-top { position:fixed; bottom:80px; right:24px; width:38px; height:38px; border-radius:50%; background:var(--surface); border:1px solid var(--border); box-shadow:var(--shadow); cursor:pointer; display:flex; align-items:center; justify-content:center; color:var(--text-muted); opacity:0; visibility:hidden; transition:opacity .2s,visibility .2s,background .15s,color .15s; z-index:500; }
#scroll-top.scroll-top-visible { opacity:1; visibility:visible; }
#scroll-top:hover { background:var(--accent-light); color:var(--accent); border-color:var(--accent); }

/* Image drop zone (artwork_add / artwork_edit) */
.drop-zone { border:2px dashed var(--border); border-radius:8px; padding:28px 20px; text-align:center; cursor:pointer; background:var(--bg); transition:border-color .15s,background .15s; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:6px; width:300px; max-width:100%; aspect-ratio:4/5; box-sizing:border-box; align-self:flex-start; user-select:none; }
.drop-zone:hover, .drop-zone.drag-over { border-color:var(--accent); background:var(--accent-light); }
.drop-zone.has-file { border-color:var(--accent); border-style:solid; background:var(--accent-light); }
/* Image cell inside the Artwork details card (artwork_add / artwork_edit): a small thumbnail or compact drop zone beside Title and Artist. */
.image-cell { align-items:flex-end; text-align:right; }   /* thumbnail right-aligned in its cell */
.image-cell .img-preview, .image-cell .drop-zone { align-self:flex-end; }
.image-cell .artwork-image { max-width:120px; margin-bottom:6px; }
.image-cell .drop-zone { width:120px; padding:10px 6px; }
.image-cell .img-preview { max-width:120px; max-height:150px; }
.qr-preview { display:block; width:100%; max-width:140px; height:auto; }   /* QR preview on the artwork view page's label card */
.drop-zone-icon { color:var(--text-muted); line-height:0; }
.drop-zone-text { font-size:.9rem; color:var(--text); }
.drop-zone-hint { font-size:.78rem; color:var(--text-muted); }
/* Plain file input (e.g. the certificate PDF on artwork edit): its "Choose file" button is styled like .btn .btn-outline .btn-sm */
.file-input { display:block; width:100%; max-width:100%; font-size:.85rem; color:var(--text-muted); cursor:pointer; }
.file-input::file-selector-button { margin-right:12px; padding:5px 12px; border:1px solid var(--accent); border-radius:var(--radius); background:transparent; color:var(--accent); font:inherit; font-size:.82rem; font-weight:500; cursor:pointer; transition:background .15s; }
.file-input::file-selector-button:hover { background:var(--accent); color:var(--on-accent); }
.img-preview { display:none; align-self:flex-start; width:auto; max-width:300px; height:auto; max-height:300px; margin-top:8px; border-radius:4px; }   /* upload/selected-image preview on artwork add/edit: capped at 300px, not stretched by the flex-column .form-group (image_picker.php toggles .is-shown) */
.img-preview.is-shown { display:block; }
.file-input-hidden { display:none; }   /* the real <input type=file> behind a drop zone / Update link */
.image-actions { margin-top:8px; display:flex; align-items:center; gap:8px; flex-wrap:wrap; }   /* "Browse uploads…" row under the drop zone */
.image-existing-label { font-size:.85rem; color:var(--text-muted); }
.note-small { color:var(--text-muted); font-size:.8rem; }   /* muted aside inside a value, e.g. "(at asking)" */
.label-small { font-size:.8rem; font-weight:600; color:var(--text-muted); display:block; margin-bottom:4px; }   /* small field label in the Share card */
.share-row { display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
.share-input, .share-snippet { font-family:monospace; border:1px solid var(--border); border-radius:var(--radius); background:var(--bg); }
.share-input { font-size:.82rem; flex:1; min-width:160px; padding:5px 8px; }
.share-snippet { font-size:.78rem; width:100%; padding:6px 8px; resize:none; }
.share-actions { margin-top:4px; }
.pre-text { white-space:pre-wrap; overflow-wrap:anywhere; font-size:.9rem; }   /* user text shown with its line breaks (internal notes) */
.pre-text-loose { white-space:pre-wrap; overflow-wrap:anywhere; font-size:.9rem; line-height:1.7; }   /* same, roomier (provenance) */
.rich-text { font-size:.9rem; line-height:1.7; overflow-wrap:anywhere; }   /* rendered rich-text description */
.detail-grid-spaced { margin-bottom:28px; }
.detail-grid-2 { grid-template-columns:repeat(2,minmax(0,1fr)); } /* artist view: two cells per row, mirrors the edit page */
/* Artist Documents cell (includes/artist_documents_card.php), a card on the view page and a form-box on the edit page */
.artist-docs-upload { display:flex; gap:10px; align-items:center; flex-wrap:wrap; margin-top:12px; }
.artist-docs-upload input[type=file] { font-size:.85rem; max-width:100%; }
.inline-form { display:inline; }
.form-hidden { display:none; }

/* Profile page: other cards in a grid (left), the tall Notification Preferences card beside them (right) */
.profile-layout { display:grid; grid-template-columns:minmax(0,1.15fr) minmax(0,1fr); gap:24px; align-items:start; }
.profile-layout-single { grid-template-columns:minmax(0,1fr); }
.profile-cards { display:grid; grid-template-columns:repeat(auto-fit,minmax(240px,1fr)); gap:24px; align-items:start; }

/* Notification bell (core/notifications.php, includes/nav.php). One panel shared by a desktop bell (in .nav-right)
   and a mobile bell (beside the hamburger). The panel uses the page's light surface, not the nav colours. */
.nav-bell, .nav-help-btn { position:relative; display:flex; align-items:center; background:none; border:none; cursor:pointer; color:var(--nav-text); padding:7px; border-radius:var(--radius); transition:background .15s,color .15s; }
.nav-bell:hover, .nav-help-btn:hover, .nav-docs-btn.active { background:var(--nav-hover); color:var(--nav-hover-text); }
.nav-docs-btn, .nav-right a.nav-docs-btn { text-decoration:none; padding:5px; }   /* the documentation book is a link, not a <button>; the second selector beats ".nav-right a" padding. 22px icon + 5px padding = the same 32px square as the 18px lifering + 7px padding */
/* Page turn: the loose page in bookOpenSvg() (core/helpers.php) swings from the right-hand page across the spine (x=12) to the left on hover.
   The scale passes through 0 on the way, so it reads as a page standing up and falling over. Child transform, not on the <svg> itself (Safari). */
.book-flip { transform-box:view-box; transform-origin:12px 12px; transition:transform .5s ease; }
.book-left, .book-right { transition:opacity .5s ease; }
.book-right { opacity:0; }   /* base right page: hidden at rest (the loose page covers that side), fades in as the loose page leaves it */
.nav-docs-btn:hover .book-flip { transform:scaleX(-1); }
.nav-docs-btn:hover .book-left { opacity:0; }
.nav-docs-btn:hover .book-right { opacity:1; }
@media (prefers-reduced-motion:reduce) { .book-flip, .book-left, .book-right { transition:none; } }
.nav-docs-desktop { margin-right:-13px; }   /* same icon-to-icon gap as lifering-to-bell: 12px flex gap -13px = -1px box overlap, so 5+5-1 = 9px between the icons (lifering-bell: 7+7-5 = 9px). The lifering (z-index:1) draws over the overlap */
.nav-docs-mobile { display:none; }
.nav-bell-mobile, .nav-help-mobile { display:none; }
.nav-help-desktop { margin-right:-17px; z-index:1; }   /* .nav-right puts 12px between its items; the negative margin pulls the bell up against the lifering to tighten the gap. The lifering keeps its full 7px padding on every side, so its hover shade is a complete, even square; z-index:1 draws that shade above the bell it overlaps */
/* The lifering turns a quarter turn clockwise when hovered (nav buttons, signed-out Help link, documentation "Get help" link).
   The wrapper span (core/helpers.php lifeRingSvg()) is what rotates; the SVG inside stays still. */
.lifering-spin { display:inline-flex; flex-shrink:0; transition:transform .45s ease; }
.nav-help-btn:hover .lifering-spin, .nav-help:hover .lifering-spin, .help-link:hover .lifering-spin { transform:rotate(90deg); }
@media (prefers-reduced-motion:reduce) { .lifering-spin { transition:none; } }
/* The bell jiggles when hovered (core/notifications.php notificationBellSvg() wraps it in .bell-jiggle): a quick swing from the top, like a ringing bell. */
.bell-jiggle { display:inline-flex; flex-shrink:0; transform-origin:50% 8%; }
.nav-bell:hover .bell-jiggle { animation:bell-jiggle .6s ease-in-out; }
@keyframes bell-jiggle { 0%,100% { transform:rotate(0); } 15% { transform:rotate(14deg); } 30% { transform:rotate(-12deg); } 45% { transform:rotate(9deg); } 60% { transform:rotate(-6deg); } 75% { transform:rotate(3deg); } }
@media (prefers-reduced-motion:reduce) { .nav-bell:hover .bell-jiggle { animation:none; } }
.nav-bell-badge { position:absolute; top:0; right:0; min-width:16px; height:16px; padding:0 4px; border-radius:99px; background:var(--red); color:#fff; font-size:.7rem; font-weight:600; line-height:16px; text-align:center; }
.nav-bell-badge[hidden] { display:none; }
.gu-bank-group[hidden] { display:none; }   /* the "banking details" tick on the Users page: .sp-field / .form-group set display, which would otherwise beat the hidden attribute */
.nav-notif-panel { display:none; position:absolute; top:100%; right:12px; width:380px; max-width:calc(100vw - 24px); background:var(--surface); color:var(--text); border:1px solid var(--border); border-top:none; border-radius:0 0 var(--radius) var(--radius); box-shadow:0 6px 18px rgba(0,0,0,.25); z-index:200; }
.nav-notif-panel.open { display:block; }
.nav-notif-head { display:flex; justify-content:space-between; align-items:center; padding:10px 14px; border-bottom:1px solid var(--border-light); font-size:.9rem; }
.nav-notif-head-actions { display:flex; align-items:center; gap:10px; }
.nav-notif-compose { display:flex; align-items:center; background:none; border:none; padding:2px; border-radius:var(--radius); color:var(--text-muted); cursor:pointer; }
.nav-notif-compose:hover { color:var(--accent); background:var(--accent-light); }
.nav-notif-msg { white-space:pre-line; color:var(--text); }
.msg-modal { width:min(92vw,460px); }
/* Payment settings: "Apply for Paytrail" link under the credentials form and its modal (wider than a message modal) */
.paytrail-apply-link { margin-top:12px; }
.paytrail-apply-modal { width:min(92vw,720px); }
.paytrail-apply-modal input[readonly] { background:var(--bg); color:var(--text-muted); cursor:default; }
.paytrail-activate-confirm { display:flex; align-items:center; gap:8px; margin-top:14px; font-size:.9rem; color:var(--text); cursor:pointer; }
.msg-modal-meta { display:flex; justify-content:space-between; gap:12px; margin-top:4px; }
.msg-modal-error { margin:8px 0 0; color:var(--red); font-size:.85rem; }
.msg-modal-error[hidden] { display:none; }
.msg-modal-foot { display:flex; justify-content:flex-end; gap:8px; padding:12px 20px; border-top:1px solid var(--border-light); }
.bc-table { margin-top:10px; }
.bc-table th, .bc-table td { padding:6px 10px; text-align:right; white-space:nowrap; }
.bc-table th:first-child { text-align:left; font-weight:500; white-space:normal; }
.bc-table thead th { font-size:.78rem; color:var(--text-muted); font-weight:500; }
.bc-example th, .bc-example td { color:color-mix(in srgb, var(--text-muted) 65%, var(--surface)); font-weight:400; }
.bc-note { margin-top:10px; }
.sub-head-status { display:block; margin-top:2px; font-family:'Segoe UI',system-ui,-apple-system,sans-serif; font-size:.9rem; color:var(--text); }
.sub-head-status-muted { font-size:.95rem; color:var(--text-muted); }
.bc-panel { scroll-margin-top:90px; /* the sticky nav would otherwise cover it when jumped to (#billing-card) */ border:1px solid var(--border-light); border-radius:var(--radius); background:var(--bg); margin-top:16px; padding:13px 16px; }
.bc-panel-solo { border:0; background:none; margin-top:0; padding:0; }
.bc-panel-title { font-weight:500; font-size:.9rem; margin-bottom:6px; }
.bc-expired { color:var(--red); font-size:.85rem; margin:2px 0 0; }
.bc-actions { display:flex; flex-wrap:wrap; gap:8px; margin-top:14px; }
.nav-notif-markread { background:none; border:none; color:var(--accent); cursor:pointer; font-size:.8rem; padding:0; }
.nav-notif-markread:hover { color:var(--accent-dark); text-decoration:underline; }
.nav-notif-markread[hidden] { display:none; }
.nav-notif-list { max-height:min(420px, 60vh); overflow-y:auto; }
.nav-notif-item { padding:10px 14px; border-bottom:1px solid var(--border-light); border-left:3px solid transparent; color:var(--text); font-size:.85rem; line-height:1.4; }
.nav-notif-item:hover { background:var(--row-hover); }
.nav-notif-item.is-unread { border-left-color:var(--accent); background:var(--accent-light); }
.nav-notif-item.is-unread .nav-notif-title { font-weight:600; }
.nav-notif-item.is-failed .nav-notif-title { color:var(--red); }
.nav-notif-main { display:block; color:inherit; text-decoration:none; }
.nav-notif-main:hover { color:inherit; text-decoration:none; }
.nav-notif-title, .nav-notif-detail { display:block; overflow-wrap:anywhere; }
.nav-notif-detail { color:var(--text-muted); font-size:.8rem; }
.nav-notif-foot { display:flex; justify-content:space-between; align-items:baseline; gap:10px; margin-top:2px; }
.nav-notif-time { color:var(--text-muted); font-size:.75rem; }
.nav-notif-actions { color:var(--text-muted); font-size:.72rem; white-space:nowrap; }
.nav-notif-actions button { background:none; border:none; padding:0; font:inherit; color:var(--text-muted); cursor:pointer; text-decoration:underline; }
.nav-notif-actions button:hover { color:var(--accent); }
.nav-notif-empty { padding:18px 14px; color:var(--text-muted); font-size:.85rem; }
.nav-notif-all { display:block; padding:10px 14px; text-align:center; font-size:.85rem; border-top:1px solid var(--border-light); }
.notif-page { padding:0; overflow:hidden; }
.notif-page .nav-notif-item:last-child { border-bottom:none; }
.notif-pager { display:flex; gap:16px; align-items:center; justify-content:center; margin:14px 0; font-size:.88rem; }

/* Hamburger nav. Kicks in at 1024px, not 768px: with ~10 links plus the right-hand group the desktop bar overflows on tablets in portrait. */
@media (max-width:1024px) {
  .nav { padding:0 12px; flex-wrap:wrap; }
  .nav-toggle { display:flex; margin-left:0; }
  .nav-bell-mobile { display:flex; margin-left:auto; }
  .nav-docs-mobile { display:flex; margin-left:auto; }   /* book, lifering, bell: only the first carries the auto margin */
  .nav-help-mobile { display:flex; margin-left:auto; }   /* the lifering sits left of the mobile bell */
  .nav-help-mobile + .nav-bell-mobile, .nav-docs-mobile + .nav-help-mobile, .nav-docs-mobile + .nav-bell-mobile { margin-left:0; }
  .nav-help-desktop, .nav-docs-desktop { display:none; }
  .nav-bell-desktop { display:none; } /* the mobile bell beside the hamburger replaces it */
  .nav-notif-panel { left:0; right:0; width:auto; max-width:none; border-left:none; border-right:none; border-radius:0; }
  .nav-links { display:none; flex:none; width:100%; }
  .nav-right { display:none; flex:none; width:100%; margin-left:0; }
  /* Signed-out visitors have no hamburger, so the Help link stays in the bar as just the lifering icon */
  .nav-right.nav-right-guest { display:flex; width:auto; margin-left:auto; }
  .nav-right.nav-right-guest a.nav-help { padding:6px 10px; border-bottom:0; }
  .nav-right-guest .nav-help-text, .nav-right-guest .nav-help-ver { display:none; }
  .nav-right-guest .nav-help-icon { width:26px; height:26px; }
  .nav-open .nav-links { display:flex; flex-direction:column; border-top:1px solid var(--nav-m-line); }
  .nav-open .nav-right { display:flex; flex-direction:column; align-items:stretch; gap:0; padding:0; border-top:1px solid var(--nav-m-line); }
  /* right-hand links (Help, Audit log, Profile, Log out) become full-width rows like the main links */
  .nav-right a { padding:13px 16px; font-size:.9rem; border-radius:0; border-bottom:1px solid var(--nav-m-line); }
  .nav-right .nav-logout { padding:13px 16px !important; border-width:0 0 1px 0; text-align:left; font-size:.9rem; }
  .nav-links a { height:auto; padding:13px 16px; border-bottom:1px solid var(--nav-m-line); font-size:.9rem; }
  .nav-dropdown { display:flex; flex-direction:column; align-items:stretch; position:static; }
  .nav-dropdown-toggle { height:auto; padding:13px 16px; border-bottom:1px solid var(--nav-m-line); font-size:.9rem; }
  .nav-dropdown-menu { position:static; border:none; box-shadow:none; min-width:auto; background:var(--nav-m-menu-bg); }
  .nav-dropdown-menu a { padding:11px 28px; border-bottom:1px solid var(--nav-m-menu-divider); font-size:.9rem; }
  .nav-right .nav-dropdown { width:100%; align-items:stretch; }
  .nav-right .nav-dropdown-toggle { padding:13px 16px; font-size:.9rem; border-radius:0; }
  .nav-right .nav-dropdown-menu { position:static; }
  .nav-right .nav-dropdown-menu a { padding:11px 28px; font-size:.9rem; border-bottom:1px solid var(--nav-m-menu-divider); }
}

@media (max-width:768px) {
  .profile-layout { grid-template-columns:minmax(0,1fr); }
  .page-wrapper { padding:20px 14px 40px; }
  .form-grid, .form-grid.cols-2 { grid-template-columns:1fr; }
  .sale-line { grid-template-columns:1fr 1fr; }
  .sale-line .form-group:first-child { grid-column:1/-1; }
  .card-grid-2-1 { grid-template-columns:1fr; }
  .detail-grid-2 { grid-template-columns:minmax(0,1fr); }
  .dash-layout { grid-template-columns:1fr; }
  .dash-stats { display:grid; grid-template-columns:repeat(2,1fr); }
  .stat-card-v { border-left:none; border-top:3px solid var(--accent); }
  .stats-grid { grid-template-columns:repeat(2,1fr); }
  .login-box { padding:28px 22px; }
  .page-header { flex-direction:column; align-items:flex-start; }
}

/* Respect the OS "reduce motion" setting: no smooth scroll or slide effects. */
@media (prefers-reduced-motion:reduce) {
  html { scroll-behavior:auto; }
  *, *::before, *::after { animation-duration:.01ms !important; transition-duration:.01ms !important; }
}
.avatar-circle { width:64px; height:64px; border-radius:50%; object-fit:cover; border:1px solid var(--border-light); flex-shrink:0; }
.avatar-circle.avatar-sm { width:36px; height:36px; }
img.avatar-circle { display:block; }
.avatar-circle.avatar-initials { display:flex; box-sizing:border-box; line-height:1; align-items:center; justify-content:center; background:var(--accent-light); color:var(--accent-dark); font-size:1.3rem; }
.avatar-circle.avatar-sm.avatar-initials { font-size:.8rem; }
dd.dd-trunc { min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }

/* ── Documents: segmented two-way choice (Send dialog From / How; Sent tab Group by) ── */
/* Segmented two-way choice (same shape as Portrait | Landscape in the label editor): the chosen side uses the muted brand tint; primary actions keep the full brand colour. */
.gd-seg { display: inline-flex; width: max-content; max-width: 100%; border: 1px solid var(--border-light, #cfc9be); border-radius: 8px; overflow: hidden; background: #fff; }
.gd-seg-btn { display: inline-flex; align-items: center; padding: 6px 14px; border: 0; border-right: 1px solid var(--border-light, #cfc9be); background: transparent; color: inherit; font: inherit; font-size: .85rem; cursor: pointer; }
.gd-seg-btn:last-child { border-right: 0; }
.gd-seg-btn:hover { background: #f3efe7; }
.gd-seg-btn[aria-pressed="true"] { background: var(--accent-light, #f5edd8); color: var(--accent-dark, #6a4f0e); font-weight: 600; }
.gd-seg-btn:focus-visible { outline: 2px solid var(--accent-line, #d4ad50); outline-offset: -2px; }

/* ── Documents: Sent tab (modules/gallery_documents/_sent.php, js/document-sent.js) ── */
.gd-sent-bar { display: flex; flex-wrap: wrap; gap: 14px 22px; align-items: flex-end; margin-bottom: 12px; }
.gd-sent-bar label { display: block; font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); margin-bottom: 4px; }
.gd-sent-bar select { min-width: 170px; max-width: 260px; }
.gd-sent-count { margin-left: auto; font-size: .85rem; color: var(--text-muted); }
.gd-sent-group { margin-bottom: 12px; }
.gd-sent-group > summary { cursor: pointer; list-style: none; display: flex; align-items: baseline; gap: 10px; padding: 10px 16px; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; }
.gd-sent-group[open] > summary { border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
.gd-sent-group > summary::-webkit-details-marker { display: none; }
.gd-sent-gname { font-weight: 600; }
.gd-sent-gmeta { font-size: .82rem; color: var(--text-muted); }
.gd-sent-gcount { margin-left: auto; font-size: .82rem; color: var(--text-muted); white-space: nowrap; }
.gd-sent-group .table-wrap { border: 1px solid var(--border); border-top: 0; border-radius: 0 0 8px 8px; background: var(--surface); }
.gd-sent-sub { display: block; font-size: .82rem; color: var(--text-muted); }
.gd-sent-none { padding: 16px; color: var(--text-muted); }
.gd-sent-when { white-space: nowrap; }

/* ── Open calls module settings (modules/open_calls/settings.php, js/open-calls-settings.js) ── */
.oc-tabs { display: flex; gap: 4px; border-bottom: 2px solid var(--border); margin-bottom: 20px; }
.oc-tab-btn { padding: 10px 18px; border: none; background: none; cursor: pointer; font-size: .95rem; color: var(--text-muted); border-bottom: 2px solid transparent; margin-bottom: -2px; }
.oc-tab-btn.active { color: var(--accent-dark, #6a4f0e); border-bottom-color: var(--accent-line, #d4ad50); font-weight: 600; }
.oc-tab-panel[hidden] { display: none; }
.oc-card { max-width: 820px; margin-bottom: 24px; }
.oc-card .text-muted { margin-bottom: 14px; }
.oc-copy-wrap { display: flex; align-items: center; gap: 6px; }
.oc-copy-wrap input { min-width: 0; flex: 1; font-family: monospace; font-size: .85rem; }
.oc-copy-btn { flex-shrink: 0; width: 30px; height: 30px; padding: 0; border: 1px solid var(--border); border-radius: var(--radius); background: #fff; color: var(--text-muted); font-size: 1rem; line-height: 1; cursor: pointer; }
.oc-copy-btn:hover { border-color: var(--accent); color: var(--text); }
.oc-copy-btn.copied { border-color: var(--green); color: var(--green); }
.oc-reveal-box { margin: 10px 0; padding: 12px 14px; border: 1px solid var(--accent, #0e6e85); border-radius: var(--radius); background: var(--bg-alt, #f7fbfc); }
.oc-reveal-box[hidden] { display: none; }
.oc-reveal-box .sub-body { margin-bottom: 6px; }
.oc-reveal-box .btn { margin-top: 8px; }
.oc-actions { display: flex; gap: 8px; align-items: center; margin-top: 8px; }
.oc-docs { max-width: 820px; }
.oc-docs h2 { margin: 28px 0 12px; font-family: Georgia, serif; font-size: 1.2rem; font-weight: normal; color: var(--accent-dark); padding-bottom: 8px; border-bottom: 1px solid var(--border-light); }
.oc-docs h2:first-child { margin-top: 0; }
.oc-docs p, .oc-docs ul, .oc-docs ol { margin: 0 0 12px; line-height: 1.7; }
.oc-docs ul, .oc-docs ol { padding-left: 22px; }
.oc-docs .table-wrap { margin-bottom: 12px; }
.oc-pre { margin: 8px 0 14px; padding: 10px 14px; background: var(--bg-alt, #f7fbfc); border-radius: var(--radius); overflow-x: auto; }

/* Voting add-on (modules/exhibitions/voting.php) */
.vote-card { margin-bottom: 24px; }
.vote-option { margin: 16px 0 4px; }
/* Voting: the saved look, previewed on a picture-coloured strip */
.vote-style { margin-top: 24px; }
.vote-preview { display: flex; gap: 24px; padding: 20px; background: #c9c3b6; border-radius: var(--radius); }
.vote-preview-item { display: inline-block; --vs: 36px; }
.vote-btn.vp-btn { --vs: 36px; }
/* Look of the button: settings on the left, the colours table on the right; one column on a narrower screen */
.vote-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; column-gap: 48px; }
@media (max-width: 1100px) { .vote-cols { grid-template-columns: minmax(0, 1fr); } }
.vote-group { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border-light); }
.vote-grid { grid-template-columns: repeat(auto-fill, 160px); margin-top: 14px; }   /* the site's .form-grid with fixed narrow columns, so every row's fields line up */
.vote-group > .vote-grid:first-child { margin-top: 0; }
.vote-group .check-label { display: inline-flex; align-items: center; gap: 8px; }
.vote-colours { width: 100%; }
.vote-radios { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-top: 6px; }   /* the corner choice: site-style radios on one row */
/* The Colours table reads as part of the form: its header is a field label (as "Text", "Voted" beside it), not the site's shaded table header, and the first column lines up with the fields' left edge */
.vote-colours thead th { background: none; padding: 0 20px 8px 0; border-bottom: 1px solid var(--border-light); font-size: .85rem; }
.vote-colours td { padding-left: 0; padding-right: 20px; }
.vote-colours input[type=color] { width: 44px; height: 28px; padding: 0; }
.vote-same { font-size: .8rem; color: var(--text-muted); }
#vote-form [hidden] { display: none !important; }   /* a setting that doesn't apply to the current choices (js/voting-settings.js): the classes above set display, which would otherwise beat the hidden attribute */
.vote-status { margin: 16px 0 0; font-size: .85rem; color: var(--text-muted); }
.vote-status.is-error { color: var(--red, #c0392b); }
.vote-settings { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 32px; }   /* both settings on one row */
.vote-limit-label { display: flex; align-items: center; gap: 10px; font-weight: normal; }
.vote-limit-text small { display: block; color: var(--text-muted); }   /* "(0 = no limit)" on its own line */
.vote-limit-label input { width: 70px; }
.vc-plot { position: relative; height: 260px; }
.vc-artworks { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border-light); }
.vc-chips-h { font-size: .75rem; color: var(--text-muted); margin-bottom: 8px; }
.vc-chips + .vc-chips-h { margin-top: 12px; }
.vc-chips { display: flex; flex-wrap: wrap; gap: 6px; max-height: 120px; overflow-y: auto; }
.vc-chip { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 4px 10px; font: inherit; font-size: .8rem; cursor: pointer; color: var(--text-muted); background: var(--bg); border: 1px solid var(--border); border-radius: 999px; }
.vc-chip:focus-visible { outline: 2px solid var(--ic); outline-offset: 2px; }
.vc-chip-sw { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; border: 2px solid var(--ic); }
.vc-chip-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vc-chip-n { font-variant-numeric: tabular-nums; }
.vc-chip[aria-pressed="true"] { color: var(--text); background: var(--surface); border-color: var(--ic); }
.vc-chip[aria-pressed="true"] .vc-chip-sw { background: var(--ic); }
/* Vote for this artist (modules/exhibitions/voting.php, js/voting-artists.js) */
.va-group th { background: var(--bg); font-weight: 600; text-align: left; }
.va-link-cell { width: 50%; }
.va-qr-cell { width: 1%; white-space: nowrap; }
.va-row { display: flex; align-items: center; gap: 8px; }
.va-link { flex: 1; min-width: 0; }
.va-qr { background: #fff; }
/* ── Access matrix (core/access.php renderAccessMatrix, js/access-matrix.js) ── */
.am { border:1px solid var(--border); border-radius:var(--radius); overflow:hidden; background:var(--surface); }
.am-row { display:grid; grid-template-columns:minmax(0, 1fr) 64px 64px; align-items:center; min-height:38px; padding:0 14px; border-bottom:1px solid var(--border); font-size:.9rem; }
.am-kids .am-row:last-child, .am > .am-row:last-child { border-bottom:0; }
.am-row:not(.am-th):hover { background:var(--bg); }
.am-th { min-height:34px; background:var(--bg); color:var(--text-muted); font-size:.78rem; font-weight:500; }
.am-c { text-align:center; }
.am-row input[type=checkbox] { margin:0; cursor:pointer; }
.am-lbl { display:flex; align-items:center; gap:6px; min-width:0; }
.am-grp { font-weight:500; }
.am-d1 { padding-left:22px; }
.am-d2 { padding-left:44px; }
.am-d3 { padding-left:66px; }
.am-sp { display:inline-block; width:24px; flex-shrink:0; }
.am-chev { background:none; border:none; cursor:pointer; color:var(--text-muted); padding:2px 6px; border-radius:var(--radius); }
.am-chev:hover { color:var(--accent); }
.am-chev[aria-expanded="true"] .chev { transform:rotate(90deg); }
.am-dash, .am-note { color:var(--text-muted); }
.am-note { font-size:.75rem; }
.am-locked .am-lbl { color:var(--text-muted); }
.am-off { opacity:.55; }
.am-off input, .am-off .am-chev { cursor:default; }
.am-off .am-chev { pointer-events:auto; }
.access-default-cb { margin-bottom:8px; }
/* Collapsible card (Users page: Assistant access, Invite new user; same look as the role-group cards: card header strip, body joined underneath) */
.collapse-card > summary { cursor:pointer; list-style:none; display:flex; align-items:center; }
.collapse-card > summary::-webkit-details-marker { display:none; }
.collapse-card-head { flex:1; display:flex; align-items:center; gap:8px; padding:12px 16px; }
.collapse-card-title { font-weight:600; }
.collapse-card-head .chev { margin-left:auto; color:var(--text-muted); }
.collapse-card-body { border-top:0; border-top-left-radius:0; border-top-right-radius:0; }
.am-hint { margin-bottom:12px; }
.access-group { margin-bottom:12px; }
/* Users page: page stack, and every card on it in one column, capped in width */
.su-stack { display:flex; flex-direction:column; gap:24px; max-width:820px; }
.su-stack > .card, .su-stack > .user-groups-wrap, .su-stack > .empty-state { margin:0; }
.user-groups-wrap { display:flex; flex-direction:column; gap:24px; }
/* Documents v2 (beta) file browser (modules/documents_v2): folder tree on the left, folder contents on the right */
.dv2 { display:grid; grid-template-columns:260px minmax(0, 1fr); padding:0; overflow:hidden; min-height:420px; }
.dv2-side { border-right:1px solid var(--border-light); padding:12px 8px; overflow:auto; }
.dv2-main { padding:16px 20px; min-width:0; }
.dv2-main.dv2-drop { outline:2px dashed var(--accent-line); outline-offset:-8px; background:var(--accent-light); }
.dv2-drag { display:inline-flex; cursor:grab; }   /* the icon of a movable document/PDF row: drag it onto a tree folder */
.dv2-dragging { opacity:.5; }
.dv2-node.dv2-drop-target { outline:2px dashed var(--accent-line); outline-offset:-2px; background:var(--accent-light); }
.dv2-tree-trash { margin-top:14px; padding-top:8px; border-top:1px solid var(--border-light); }   /* the Trash entry, set apart from the folders */
.dv2-link-plain { display:inline-flex; align-items:center; gap:8px; }   /* a trashed item's name: looks like a link row but is not clickable */
.dv2-tree-list { list-style:none; margin:0; padding:0; }
.dv2-tree-list .dv2-tree-list { padding-left:16px; }
.dv2-tree-label { font-size:.75rem; text-transform:uppercase; letter-spacing:.04em; color:var(--text-muted); padding:14px 8px 4px; }
.dv2-node { display:flex; align-items:center; gap:2px; border-radius:var(--radius); }
.dv2-node:hover, .dv2-node.active { background:var(--accent-light); }
.dv2-node.active .dv2-node-name { color:var(--accent-dark); font-weight:600; }
.dv2-twisty { width:22px; height:28px; padding:0; border:0; background:none; color:var(--text-muted); cursor:pointer; display:inline-flex; align-items:center; justify-content:center; flex-shrink:0; }
.dv2-twisty .dv2-svg { width:14px; height:14px; transition:transform .12s; }
.dv2-twisty.open .dv2-svg { transform:rotate(90deg); }
.dv2-twisty.empty { visibility:hidden; }
.dv2-node-name { flex:1; min-width:0; display:flex; align-items:center; gap:8px; padding:5px 6px 5px 2px; border:0; background:none; font:inherit; color:var(--text); text-align:left; cursor:pointer; }
.dv2-node-text { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.dv2-svg { width:20px; height:20px; flex-shrink:0; }
.dv2-ic-folder { color:var(--accent); }
.dv2-ic-pdf { color:var(--red); }
.dv2-crumbs { display:flex; flex-wrap:wrap; align-items:center; gap:6px; margin-bottom:14px; font-size:.9rem; }
.dv2-crumb { border:0; background:none; padding:0; font:inherit; color:var(--accent); cursor:pointer; }
.dv2-crumb:hover { text-decoration:underline; }
.dv2-crumb-sep { color:var(--text-muted); }
.dv2-readonly { margin-left:8px; }
.dv2-link { display:inline-flex; align-items:center; gap:8px; border:0; background:none; padding:0; font:inherit; color:var(--text); text-align:left; cursor:pointer; text-decoration:none; }
.dv2-link:hover { color:var(--accent-dark); text-decoration:underline; }
.dv2-name-cell { overflow-wrap:anywhere; }
.dv2-nowrap { white-space:nowrap; }
.dv2-empty { padding:32px 8px; text-align:center; color:var(--text-muted); }
.dv2-hint { margin-top:12px; font-size:.82rem; color:var(--text-muted); }
.dv2-error { margin-top:8px; font-size:.85rem; color:var(--red); }
.dv2-modal { width:min(92vw, 440px); }
.dv2-modal-buttons { display:flex; justify-content:flex-end; gap:8px; margin-top:16px; }
.dv2-file-input { display:none; }
.page-header-actions[hidden], .dv2-hint[hidden], .dv2-error[hidden] { display:none; }
@media (max-width:760px) {
  .dv2 { grid-template-columns:minmax(0, 1fr); }
  .dv2-side { border-right:0; border-bottom:1px solid var(--border-light); max-height:240px; }
}
/* Documents v2 (beta) editor and Send to dialog (modules/documents_v2/edit.php, _send_modal.php; the editor itself is styled by css/document-editor.css) */
.dv2-w460 { width:min(92vw, 460px); }
.dv2-w480 { width:min(92vw, 480px); }
.dv2-w520 { width:min(92vw, 520px); }
.dv2-w620 { width:min(92vw, 620px); }
.dv2-mfoot { padding:12px 20px; border-top:1px solid var(--border-light); }
.dv2-mfoot-flex { display:flex; flex-wrap:wrap; gap:8px; align-items:center; }
/* Custom margins in a cross: Top centred on its own row, Left and Right either side on the next, Bottom centred on the last. */
.dv2-ps-custom { display:grid; grid-template-columns:repeat(3, 92px); gap:4px; justify-content:center; margin-bottom:16px; }   /* a tight cross in the middle of the dialog */
.dv2-ps-custom .dv2-ps-top { grid-column:2; grid-row:1; }
.dv2-ps-custom .dv2-ps-left { grid-column:1; grid-row:2; }
.dv2-ps-custom .dv2-ps-right { grid-column:3; grid-row:2; }
.dv2-ps-custom .dv2-ps-bottom { grid-column:2; grid-row:3; }
.dv2-nomargin { margin:0; }
.dv2-muted { color:var(--text-muted); }
.dv2-pointer { cursor:pointer; }
.dv2-push-right { margin-left:auto; }
.dv2-send-doc { font-weight:600; margin-bottom:12px; }
.dv2-send-hint { margin-top:6px; }
.dv2-send-ask { font-weight:600; margin-bottom:10px; }
.dv2-send-frame { width:100%; height:300px; border:1px solid var(--border); border-radius:6px; background:#f4f4f4; }
.dv2-send-err { flex-basis:100%; margin:0 0 4px; color:var(--red); font-size:.9rem; font-weight:600; }
.gd-lock-form { display:inline; }
#gd-m-send [hidden] { display:none !important; }   /* the Send to dialog shows only the current step's fields (the .btn and .form-group display rules would beat the hidden attribute) */
.gd-warn { display:flex; flex-direction:column; gap:3px; margin:0 0 12px; padding:10px 12px; border:1px solid var(--orange, #a35900); border-radius:6px; background:var(--orange-bg, #fff4e5); color:var(--orange, #a35900); font-size:.88rem; }
.gd-pair { display:grid; grid-template-columns:1fr 1fr; gap:12px; margin:18px 0; align-items:start; }
.gd-pair .form-group + .form-group { margin-top:0; }
@media (max-width:768px) { .gd-pair { grid-template-columns:minmax(0, 1fr); } }
#gd-send-confirm:disabled { opacity:.4; cursor:not-allowed; }
.dv2-doc-ic { color:var(--accent-dark); }
.gd-seg[hidden] { display:none; }   /* .gd-seg sets display:inline-flex, which would otherwise beat the hidden attribute (Send dialog: Send as, for an uploaded PDF) */
.dv2-act-groups { gap:18px; justify-content:flex-end; }   /* a clear gap between the groups (editing, sending, file actions); the icons sit at the column's right edge */
.dv2-act-group { display:inline-flex; gap:6px; }
.dv2-ic-muted, .dv2-ic-muted:hover { opacity:.4; cursor:not-allowed; }   /* Delete on a folder that still has contents: shown but inert */
.dv2-act-off { opacity:.4; cursor:not-allowed; }   /* a muted row action (email on a draft document) */

/* Help page (documentation.php): section cards, short intro line, and task lists (a bold task name with numbered steps under it) */
.doc-card { margin-bottom:20px; scroll-margin-top:70px; }
.doc-lead { margin:6px 0 0; color:var(--text-muted); }
.doc-list { margin:8px 0 0 18px; line-height:1.7; }
.doc-list > li { margin-top:10px; }
.doc-steps { margin:4px 0 0 20px; line-height:1.7; }
.doc-tag { font-size:.8rem; color:var(--text-muted); }
.doc-figure { margin:10px 0 0; }
.doc-figure img { display:block; max-width:100%; height:auto; border:1px solid var(--border-light); border-radius:4px; }   /* mock-up picture in the help pages */
.doc-figure figcaption { margin-top:4px; font-size:.82rem; color:var(--text-muted, #555); }
.doc-code { margin:8px 0 0; padding:10px 12px; background:var(--surface-1, #f7f5f0); border:1px solid var(--border-light); border-radius:4px; overflow-x:auto; font-size:.82rem; line-height:1.5; }   /* code sample in the help pages */

/* Trash page (trash.php) */
.card-flush { padding:0; }
/* Transfers page (transfers.php): the Leaving and Arriving cards sit one above the other with a gap; a row's Release/Accept/Decline
   buttons are each in their own form, so make the forms flex items with no margin and the same gap as other row actions */
.transfer-stack { display:flex; flex-direction:column; gap:24px; }
.transfer-actions form { display:flex; margin:0; }
.nowrap { white-space:nowrap; }
.trash-restore-form { display:inline-flex; margin:0; }

/* Exhibition settings > Catalogue card: title row with the List | Grid toggle at the right; Grid hides the List-only blocks
   (catalogue editor link, Fonts) and shows the Grid-only ones (intro, preview). */
.card-head { display:flex; align-items:flex-start; justify-content:space-between; gap:12px; margin-bottom:16px; border-bottom:1px solid var(--border-light); }
.card-head .card-title { margin-bottom:0; border-bottom:0; padding-bottom:10px; }
.card-head .ed-seg { flex-shrink:0; margin-top:-4px; }
.catalogue-card .only-grid { display:none; }
.catalogue-card.is-grid .only-grid { display:block; }
.catalogue-card.is-grid .only-list { display:none; }
/* Catalogue settings: each block is a sub-card inside the Catalogue card */
.sub-card { border:1px solid var(--border); border-radius:var(--radius); padding:16px 18px; margin-bottom:16px; }
.sub-card-title { font-weight:600; margin:0 0 10px; }
/* Smart group: the Strict | Relaxed choice only shows while Smart group is ticked */
.smart-mode { display:none; margin-top:8px; }
.smart-mode.is-on { display:block; }
.smart-mode .field-hint { display:block; margin-top:6px; }
.smart-mode .check-label { margin-top:10px; }
.group-order-body.is-off { display:none; }   /* the drag list shows only while Manual order is ticked */
.gp-wrap { display:flex; flex-wrap:wrap; gap:24px; align-items:flex-end; }
.gp-device { position:relative; border:1px solid var(--border-light, #cfc9be); border-radius:6px; background:#fff; padding:8px 8px 22px; }
.gp-desktop { flex:1 1 320px; max-width:460px; }
.gp-mobile { flex:0 0 150px; border-radius:14px; }
.gp-bar { height:8px; margin-bottom:8px; background:#eee; border-radius:2px; }
.gp-grid { display:grid; gap:6px; }
.gp-grid-4 { grid-template-columns:repeat(4, minmax(0, 1fr)); }
.gp-grid-2 { grid-template-columns:repeat(2, minmax(0, 1fr)); }
.gp-tile { display:flex; flex-direction:column; gap:3px; }
.gp-img { display:block; aspect-ratio:4 / 3; background:#e6e1d8; }
.gp-line { display:block; height:4px; background:#d6d0c4; border-radius:2px; }
.gp-short { width:55%; }
.gp-label { position:absolute; left:0; right:0; bottom:5px; text-align:center; font-size:.7rem; color:var(--text-muted, #777); }

/* Exhibition settings > Catalogue > Print: A4 page mock-up with the optional QR corner */
.pp-page { position:relative; width:100%; max-width:210px; aspect-ratio:210 / 297; padding:14px 12px; background:#fff; border:1px solid var(--border-light, #cfc9be); box-shadow:0 1px 4px rgba(0,0,0,.08); }
.pp-line { display:block; height:4px; margin-bottom:5px; background:#d6d0c4; border-radius:2px; }
.pp-title { width:55%; height:7px; margin:0 auto 10px; }
.pp-group { width:35%; margin-bottom:10px; }
.pp-row { display:flex; gap:8px; margin-bottom:10px; }
.pp-img { flex:0 0 32%; aspect-ratio:4 / 3; background:#e6e1d8; }
.pp-text { flex:1; padding-top:3px; }
.pp-short { width:60%; }
.pp-qr { display:none; position:absolute; right:8px; bottom:8px; width:20px; height:20px; background:repeating-conic-gradient(#222 0 25%, #fff 0 50%) 0 0 / 6px 6px; border:2px solid #222; }
.pp-qr.is-on { display:block; }
.gp-print { flex:0 0 150px; }
.gp-label-static { display:block; margin-top:6px; text-align:center; font-size:.7rem; color:var(--text-muted, #777); }
.pp-toggle { display:flex; align-items:center; justify-content:center; gap:5px; margin-top:2px; font-size:.7rem; font-weight:normal; color:var(--text-muted, #777); cursor:pointer; }
.pp-hint { display:block; text-align:center; font-size:.7rem; }

/* Exhibition settings > Catalogue > Grid details: tick the details shown under each picture; drag a row (or focus its grip and
   press Up / Down) to reorder. Behaviour in js/sortable-list.js. */
.gf-list { list-style:none; margin:0; padding:0; max-width:340px; border:1px solid var(--border-light, #e5e0d8); border-radius:4px; background:#fff; }
.gf-row { display:flex; align-items:center; gap:10px; padding:6px 10px; border-top:1px solid var(--border-light, #e5e0d8); position:relative; }
.gf-row:first-child { border-top:0; }
.gf-grip { flex:0 0 auto; width:22px; height:26px; padding:0; border:0; background:none; color:var(--text-muted, #777); font-size:1rem; line-height:1; cursor:grab; touch-action:none; border-radius:3px; }
.gf-grip:hover, .gf-grip:focus-visible { color:var(--text, #1a1a1a); background:var(--border-light, #eee); }
.gf-label { display:flex; align-items:center; gap:8px; flex:1; margin:0; font-weight:normal; cursor:pointer; }
.gf-label input { margin:0; }
.gf-fixed { margin-left:auto; font-size:.72rem; color:var(--text-muted, #777); }
.gf-list.is-sorting, .gf-list.is-sorting .gf-grip { cursor:grabbing; }
.gf-row.is-dragging { opacity:.5; background:var(--accent-light, #f5edd8); }
.gf-row.is-drop-before::before, .gf-row.is-drop-after::after { content:''; position:absolute; left:0; right:0; height:2px; background:var(--accent, #6a4f0e); }
.gf-row.is-drop-before::before { top:-1px; }
.gf-row.is-drop-after::after { bottom:-1px; }
/* Grid details: the list with a live sample tile beside it (wraps under the list on narrow screens) */
.gf-layout { display:flex; flex-wrap:wrap; gap:20px 28px; align-items:flex-start; }
.gf-list { flex:0 1 340px; min-width:240px; }
.gf-mock { flex:0 0 190px; padding:8px; border:1px solid var(--border-light, #cfc9be); border-radius:6px; background:#fff; }
.gf-mock-img { display:block; aspect-ratio:4 / 5; background:#e6e1d8; margin-bottom:6px; }
.gf-mock-title { font-size:.85rem; line-height:1.4; color:#1a1a1a; }
.gf-mock-meta { font-size:.75rem; line-height:1.4; color:#666; }

/* ── Digital signatures (esign_sign.php, modules/esign/*) ───── */
.esign-box { max-width:720px; }
/* .form-group has no bottom margin of its own (login.php adds one inline); every field on the signing page is followed by a button or a tick box, so give them room here. */
.esign-box .form-group { margin-bottom:16px; }
.esign-lead { font-size:.9rem; color:var(--text-muted); margin-bottom:14px; }
.esign-step { font-size:1.05rem; margin:0 0 8px; }
.esign-pdf { display:block; width:100%; height:60vh; min-height:360px; border:1px solid var(--border); border-radius:6px; margin-bottom:16px; background:#fff; }
.esign-consent { display:flex; align-items:flex-start; gap:8px; margin:14px 0 18px; font-size:.88rem; font-weight:normal; cursor:pointer; }
.esign-consent input { margin-top:3px; }
.esign-decline { margin-top:28px; padding-top:18px; border-top:1px solid var(--border); }
.esign-decline .btn, .esign-box .esign-resend .btn-link { width:auto; }
.esign-resend { margin-top:14px; display:flex; align-items:center; gap:10px; flex-wrap:wrap; }
.esign-footer { margin-top:26px; font-size:.75rem; color:var(--text-muted); text-align:center; }
.btn-link { background:none; border:0; padding:0; color:var(--accent); text-decoration:underline; cursor:pointer; font:inherit; }
.esign-signers { margin-bottom:16px; }
.esign-downloads { display:flex; flex-wrap:wrap; align-items:center; gap:10px; }
.esign-seal-link { font-size:.82rem; }
.esign-seal-state { margin-top:12px; font-size:.85rem; }
.esign-row-actions { white-space:nowrap; }
.esign-inline { display:inline; margin:0; }
.esign-card { margin-bottom:20px; }   /* .card has no outer margin; the staff pages stack several cards */
.esign-actions { display:flex; gap:10px; flex-wrap:wrap; align-items:center; }
.esign-artist-list { list-style:none; margin:0 0 12px; padding:0; }
.esign-artist-list li { margin-bottom:6px; font-size:.9rem; }
/* Document picker on modules/esign/index.php: folder tree like the Documents file browser */
.esign-tree { border:1px solid var(--border); border-radius:var(--radius); background:var(--surface); padding:6px; max-height:320px; overflow:auto; }
.esign-tree-list { list-style:none; margin:0; padding:0; }
.esign-tree-children > .esign-tree-list { margin-left:18px; }
.esign-tree-node { display:flex; align-items:center; gap:8px; width:100%; padding:6px 8px; border:0; border-radius:var(--radius); background:none; color:var(--text); font:inherit; font-size:.9rem; text-align:left; cursor:pointer; }
.esign-tree-node:hover { background:var(--row-hover); }
.esign-tree-folder { font-weight:500; }
.esign-tree-caret { width:0; height:0; flex-shrink:0; border-left:5px solid var(--text-muted); border-top:4px solid transparent; border-bottom:4px solid transparent; transition:transform .15s; }
.esign-tree-folder[aria-expanded="true"] > .esign-tree-caret { transform:rotate(90deg); }
.esign-tree-count { margin-left:auto; font-size:.75rem; font-weight:normal; color:var(--text-muted); }
.esign-tree-doc { padding-left:26px; }
.esign-tree-draft { margin-left:auto; }
.esign-tree-sel, .esign-tree-sel:hover { background:var(--accent-light); color:var(--accent-dark); }
.esign-tree-chosen { margin:8px 0 0; font-size:.85rem; color:var(--text-muted); }
.esign-tree-chosen span { color:var(--text); }
.esign-tree-err { margin:8px 0 0; font-size:.85rem; color:var(--red); }

/* ── Certificates of authenticity (includes/certificate_card.php) ───── */
.cert-file-row { display:flex; align-items:center; justify-content:space-between; gap:10px; }   /* uploaded PDF: name left, bin icon right */
.cert-file-row .icon-btn { margin-right:0; flex-shrink:0; }
.cert-status { margin:0 0 12px; font-size:.9rem; }
.cert-actions { display:flex; flex-wrap:wrap; gap:10px; align-items:center; margin-bottom:12px; }
.cert-countersign { margin-top:14px; padding-top:14px; border-top:1px solid var(--border); }
.cert-countersign .form-group { margin-bottom:16px; }
.cert-create { display:inline-flex; flex-wrap:wrap; gap:10px; align-items:center; }
.cert-upload { margin-top:14px; padding-top:14px; border-top:1px solid var(--border); display:flex; flex-wrap:wrap; gap:10px; align-items:center; }
.cert-upload .field-hint { flex-basis:100%; margin:0; }

/* Icon-only action buttons (Certificates list): 30px square, outline icon, tooltip via title attribute. */
.cert-actions-cell { white-space:nowrap; }
.icon-btn { display:inline-flex; align-items:center; justify-content:center; width:30px; height:30px; padding:0; margin-right:4px; vertical-align:middle; border:1px solid var(--border); border-radius:6px; background:transparent; color:var(--text); cursor:pointer; text-decoration:none; }
.icon-btn svg { width:17px; height:17px; fill:none; stroke:currentColor; stroke-width:2; stroke-linecap:round; stroke-linejoin:round; }
.icon-btn:hover { background:var(--accent-light, #f5edd8); }
.icon-btn:focus-visible { outline:2px solid var(--accent, #8b6914); outline-offset:1px; }
.icon-btn-danger { background:var(--red-bg); border-color:var(--red); color:var(--red); }
.icon-btn-danger:hover { background:var(--red); border-color:var(--red); color:#fff; }

/* Certificates list: "Create Certificate" pop-up (artwork search + list) */
.cert-create-step[hidden] { display:none; }   /* .msg-modal-foot sets display:flex, which would otherwise beat the hidden attribute */
#cert-create-send[hidden] { display:none; }   /* .btn sets display:inline-flex: hide Send when the artist has no email */

/* Certificates: "Create certificate" pop-up (modules/certificates/create_modal.php) — wide, with a grid of scaled-down template previews.
   Thumbnails are 260px wide; the preview page is rendered at A4 pixel size (794x1123, or 1123x794 landscape) and scaled to fit. */
.cert-create-wide { width:min(94vw,960px); }
.cert-create-wide > form { display:flex; flex-direction:column; flex:1; min-height:0; }   /* header / scrolling body / footer: the footer buttons stay in view when the content is tall (the form sits between .picker-modal and its parts) */
.cert-create-wide .form-group { margin-bottom:12px; }
.cert-tpl-grid { display:grid; grid-template-columns:repeat(auto-fill,284px); gap:16px; justify-content:center; margin:12px 0; }
.cert-tpl-card { position:relative; display:flex; flex-direction:column; gap:8px; padding:10px; border:2px solid var(--border); border-radius:var(--radius); background:#fff; cursor:pointer; }
.cert-tpl-card:hover { border-color:var(--text-muted); }   /* neutral, so a hovered card is never mistaken for the chosen (gold) one */
.cert-tpl-card.is-selected { border-color:var(--accent-line, #d4ad50); box-shadow:0 0 0 3px var(--accent-light, rgba(139,105,20,.12)); }
.cert-tpl-card:focus-within { outline:2px solid var(--accent-line, #d4ad50); outline-offset:2px; }
.cert-tpl-card input { position:absolute; opacity:0; pointer-events:none; }
.cert-tpl-thumb { position:relative; display:block; width:260px; overflow:hidden; background:#fff; border:1px solid var(--border-light); }
.cert-thumb-p { height:368px; }
.cert-thumb-l { height:184px; }
.cert-tpl-thumb iframe { position:absolute; top:0; left:0; border:0; transform-origin:0 0; pointer-events:none; }
.cert-thumb-p iframe { width:794px; height:1123px; transform:scale(.3275); }
.cert-thumb-l iframe { width:1123px; height:794px; transform:scale(.2315); }
.cert-tpl-name { font-size:.9rem; font-weight:500; }
/* Shared Fonts dialog (modules/_shared/fonts_dialog.php): add and remove the gallery's own Google Fonts */
.fd-inline { display:flex; gap:8px; }
.fd-inline input { flex:1; }
.fd-msg { min-height:1.3em; margin:4px 0 0; }
.fd-warn { color:var(--red); }
.fd-preview { margin-top:8px; padding:10px 12px; border:1px solid var(--border-light); border-radius:6px; font-size:1.2rem; background:#fff; }
.fd-opts { display:flex; flex-wrap:wrap; align-items:center; gap:6px 16px; margin-top:6px; }
.fd-opt { display:inline-flex; align-items:center; gap:4px; font-weight:400; }
.fd-row { display:flex; align-items:center; gap:12px; padding:6px 0; border-bottom:1px solid var(--border-light); }
.fd-row-name { flex:1; font-size:1.05rem; }
.gd-toolbar .gd-size-in { width:64px; height:30px; padding:0 8px; font-size:.84rem; border-radius:4px; }   /* Documents v2 editor: the free-entry font size box */
.gd-toolbar select[data-cmd="weight"] { width:104px; }
/* Documents v2 editor: the name box for a new style sheet (Page settings). */
#gd-ps-sheetname { margin-top:6px; }
#gd-ps-sheetname[hidden] { display:none; }
