/* Cimaise — feuille de style unique */

:root {
  --bg: #f6f4ef;
  --surface: #ffffff;
  --wall: #ebe7df;
  --text: #1d1d1b;
  --muted: #6f6d66;
  --line: #e3ded4;
  --accent: rgb(10, 87, 75);
  --accent-hover: rgb(8, 70, 60);
  --accent-ink: #ffffff;
  --accent-soft: rgba(10, 87, 75, 0.09);
  --danger: #a63a2b;
  --danger-soft: rgba(166, 58, 43, 0.09);
  --success-soft: rgba(10, 87, 75, 0.1);
  --shadow-art: drop-shadow(0 8px 14px rgba(40, 30, 10, 0.22));
  --radius: 14px;
  --radius-sm: 9px;
  --tabbar-h: 64px;
  --font: 'Poppins', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #141615;
    --surface: #1c1f1e;
    --wall: #252927;
    --text: #ecebe6;
    --muted: #a3a199;
    --line: #2f3431;
    --accent: #5bbba5;
    --accent-hover: #74c9b5;
    --accent-ink: #0c1a17;
    --accent-soft: rgba(91, 187, 165, 0.12);
    --danger: #e0806f;
    --danger-soft: rgba(224, 128, 111, 0.12);
    --success-soft: rgba(91, 187, 165, 0.14);
    --shadow-art: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.55));
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #141615; --surface: #1c1f1e; --wall: #252927; --text: #ecebe6; --muted: #a3a199; --line: #2f3431;
  --accent: #5bbba5; --accent-hover: #74c9b5; --accent-ink: #0c1a17; --accent-soft: rgba(91, 187, 165, 0.12);
  --danger: #e0806f; --danger-soft: rgba(224, 128, 111, 0.12); --success-soft: rgba(91, 187, 165, 0.14);
  --shadow-art: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.55)); color-scheme: dark;
}

/* ---------- Base ---------- */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 300 16px/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, strong, b, legend, th, dt { font-weight: 600; }
h1 { font-size: clamp(1.6rem, 4vw, 2.2rem); line-height: 1.2; margin: 0 0 8px; letter-spacing: -0.01em; }
h2 { font-size: 1.05rem; line-height: 1.35; margin: 0; }
p { margin: 0 0 12px; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }
img { max-width: 100%; display: block; }
small, .small { font-size: 0.82rem; }
.muted { color: var(--muted); }
.icon { width: 20px; height: 20px; flex: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
[hidden] { display: none !important; }

/* ---------- Structure ---------- */

.main {
  max-width: 1240px;
  margin: 0 auto;
  padding: 20px 16px calc(var(--tabbar-h) + 32px + env(safe-area-inset-bottom));
}
.page-narrow { max-width: 720px; margin: 0 auto; }
.page-narrow.page-wide { max-width: 1240px; }
.page-form { max-width: 760px; margin: 0 auto; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.page-head h1 { margin: 0; }
.page-head .stats { width: 100%; margin: 0; color: var(--muted); }

/* Barre supérieure (grand écran) */
.topbar {
  display: none;
  position: sticky; top: 0; z-index: 20;
  align-items: center; justify-content: space-between;
  padding: 14px max(24px, calc((100vw - 1240px) / 2 + 16px));
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--line);
}
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; font-size: 1.1rem; color: var(--text); }
.brand-mark {
  width: 18px; height: 22px; border: 2.5px solid var(--accent); border-radius: 3px; display: inline-block;
  box-shadow: inset 0 -6px 0 -3px var(--accent);
}
.topnav { display: flex; align-items: center; gap: 6px; }
.topnav > a:not(.btn) { padding: 8px 14px; border-radius: 999px; color: var(--muted); font-weight: 400; }
.topnav > a:not(.btn):hover { color: var(--text); }
.topnav > a.is-active { color: var(--text); background: var(--accent-soft); font-weight: 600; }
.topnav .btn { margin-left: 8px; }

/* Barre d'onglets (mobile) */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: grid; grid-template-columns: repeat(4, 1fr);
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-top: 1px solid var(--line);
}
.tabbar a {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 6px 0; color: var(--muted); font-size: 0.7rem; font-weight: 400;
}
.tabbar a .icon { width: 24px; height: 24px; }
.tabbar a.is-active { color: var(--accent); font-weight: 600; }
.tabbar .tab-add .icon { background: var(--accent); color: var(--accent-ink); border-radius: 50%; padding: 3px; }

@media (min-width: 760px) {
  .topbar { display: flex; }
  .tabbar { display: none; }
  .main { padding: 32px 24px 64px; }
}

/* ---------- Boutons ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 18px;
  border: 1px solid var(--line); border-radius: 999px;
  background: var(--surface); color: var(--text);
  font: 600 0.95rem/1.2 var(--font); cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.btn:hover { border-color: var(--muted); color: var(--text); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: var(--accent-ink); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-ghost:hover { background: var(--accent-soft); border-color: transparent; }
.btn-danger { background: transparent; border-color: var(--danger); color: var(--danger); }
.btn-danger:hover { background: var(--danger-soft); border-color: var(--danger); color: var(--danger); }
.btn-sm { min-height: 38px; padding: 7px 14px; font-size: 0.88rem; }
.btn-sm .icon { width: 17px; height: 17px; }
.btn-block { width: 100%; }
.btn-icon { padding: 7px 10px; }
.btn[disabled], .is-busy .btn-primary { opacity: 0.6; pointer-events: none; }

.back { display: inline-flex; align-items: center; gap: 4px; margin: 0 0 14px -4px; color: var(--muted); font-weight: 400; }
.back .icon { width: 18px; height: 18px; }
.back:hover { color: var(--text); }

/* ---------- Messages ---------- */

.flash { padding: 12px 16px; border-radius: var(--radius-sm); margin-bottom: 16px; background: var(--success-soft); }
.flash-error { background: var(--danger-soft); color: var(--danger); }
.notice { padding: 10px 14px; border-radius: var(--radius-sm); background: var(--accent-soft); }

/* ---------- Filtres ---------- */

.filters { display: grid; gap: 12px; margin-bottom: 24px; }
.search { position: relative; }
.search .icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.filters .search input[type="search"][name] { padding-left: 46px; border-radius: 999px; background: var(--surface); }

.segmented { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.segmented::-webkit-scrollbar { display: none; }
.segmented a {
  flex: none; padding: 7px 16px; border-radius: 999px; border: 1px solid var(--line);
  color: var(--muted); font-size: 0.9rem; font-weight: 400; background: var(--surface);
}
.segmented a.is-active { background: var(--text); border-color: var(--text); color: var(--bg); font-weight: 600; }

.filter-more { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.filter-more summary {
  display: flex; align-items: center; gap: 8px; padding: 10px 16px; cursor: pointer; list-style: none;
  color: var(--muted); font-size: 0.92rem;
}
.filter-more summary::-webkit-details-marker { display: none; }
.filter-more summary .icon { width: 17px; height: 17px; }
.badge { background: var(--accent); color: var(--accent-ink); border-radius: 999px; padding: 0 8px; font-size: 0.75rem; font-weight: 600; }
.filter-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; padding: 4px 16px 0; }
.filter-grid .check { align-self: end; padding-bottom: 10px; }
.filter-actions { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 16px 16px; }

/* ---------- Galerie ---------- */

.gallery {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px 14px;
}
@media (min-width: 560px) { .gallery { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 960px) { .gallery { grid-template-columns: repeat(4, 1fr); gap: 32px 24px; } }
@media (min-width: 1200px) { .gallery { grid-template-columns: repeat(5, 1fr); } }

.card { display: block; color: var(--text); }
.card:hover { color: var(--text); }
.card-wall {
  position: relative; aspect-ratio: 4 / 5; border-radius: var(--radius-sm);
  background: var(--wall); display: grid; place-items: center; padding: 14%;
  transition: background 0.2s;
}
.card:hover .card-wall { background: color-mix(in srgb, var(--wall) 85%, var(--text)); }
.card-wall img { width: 100%; height: 100%; object-fit: contain; filter: var(--shadow-art); }
.no-photo { color: var(--muted); opacity: 0.6; }
.no-photo .icon { width: 34px; height: 34px; }
.card-body { padding: 10px 2px 0; }
.card-body h2 { font-size: 0.95rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-body p { margin: 2px 0 0; color: var(--muted); font-size: 0.85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-body .owner { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em; }
.tag { position: absolute; top: 8px; left: 8px; padding: 2px 9px; border-radius: 999px; font-size: 0.72rem; font-weight: 600; }
.tag-loan { background: var(--text); color: var(--bg); }

.empty { text-align: center; padding: 56px 16px; max-width: 420px; margin: 0 auto; }
.empty-frame { width: 72px; height: 90px; margin: 0 auto 24px; border: 3px solid var(--accent); border-radius: 5px; }
.empty h2 { font-size: 1.3rem; margin-bottom: 8px; }
.empty-inline { color: var(--muted); text-align: center; padding: 40px 0; }

.pager { display: flex; justify-content: center; align-items: center; gap: 16px; margin-top: 40px; color: var(--muted); }

/* ---------- Fiche œuvre ---------- */

.detail-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
.detail-top .back { margin-bottom: 0; }
.actions { display: flex; gap: 8px; }
.detail-grid { display: grid; gap: 28px; }
@media (min-width: 960px) {
  .detail-grid { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 48px; align-items: start; }
  .detail-media { position: sticky; top: 90px; }
}
@media (max-width: 559px) { .hide-sm { display: none; } }

.wall {
  display: grid; place-items: center; width: 100%; padding: 8%;
  border: 0; border-radius: var(--radius); background: var(--wall); cursor: zoom-in;
}
.wall img { max-height: 68vh; width: auto; height: auto; object-fit: contain; filter: var(--shadow-art); }
.wall-empty { aspect-ratio: 4 / 3; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; color: var(--muted); cursor: pointer; }
.wall-empty .icon { width: 36px; height: 36px; }

.thumbs { list-style: none; margin: 12px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 10px; }
.thumbs button { all: unset; display: block; cursor: zoom-in; }
.thumbs img { aspect-ratio: 1; width: 100%; object-fit: cover; border-radius: var(--radius-sm); background: var(--wall); }
.thumbs span { display: block; font-size: 0.75rem; color: var(--muted); margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.eyebrow { margin: 0 0 6px; color: var(--muted); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.08em; font-weight: 400; }
.detail-artist { font-size: 1.1rem; margin-bottom: 18px; }
.prose { margin: 18px 0 8px; }

.facts { margin-top: 28px; }
.facts h2 { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin-bottom: 6px; }
.facts dl { margin: 0; }
.facts dl > div { display: grid; grid-template-columns: minmax(120px, 38%) 1fr; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.facts dt { font-weight: 400; color: var(--muted); }
.facts dd { margin: 0; }
.meta { margin-top: 28px; font-size: 0.82rem; }

.docs { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.docs a { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); }
.docs a:hover { border-color: var(--accent); }
.docs span { display: flex; flex-direction: column; min-width: 0; }
.docs small { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- Formulaires ---------- */

.form { display: grid; gap: 16px; }
fieldset {
  margin: 0; padding: 20px 18px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); display: grid; gap: 14px; min-width: 0;
}
legend { float: left; width: 100%; padding: 0; margin-bottom: 4px; font-size: 1.05rem; }
legend + * { clear: both; }
.field { display: grid; gap: 6px; min-width: 0; }
.field > span { font-size: 0.88rem; font-weight: 400; color: var(--muted); }
.field abbr { color: var(--accent); text-decoration: none; }
.hint { margin: 0; color: var(--muted); font-size: 0.82rem; }

input:not([type="checkbox"]):not([type="radio"]):not([type="file"]), select, textarea {
  width: 100%; min-height: 46px; padding: 10px 14px;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--bg); color: var(--text);
  font: 400 16px/1.4 var(--font); /* 16px : pas de zoom automatique sur iPhone */
  -webkit-appearance: none; appearance: none;
}
select {
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 20px) 50%, calc(100% - 15px) 50%;
  background-size: 5px 5px; background-repeat: no-repeat; padding-right: 38px;
}
textarea { resize: vertical; min-height: 96px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
input:disabled { opacity: 0.6; }
input[type="date"] { min-width: 0; }
input[type="file"] { font: inherit; font-size: 0.9rem; max-width: 100%; }
input[type="checkbox"], input[type="radio"] { width: 18px; height: 18px; accent-color: var(--accent); margin: 0; }

.check { display: inline-flex; align-items: center; gap: 8px; font-size: 0.92rem; cursor: pointer; }
.check-danger { color: var(--danger); }

.row-2, .row-3 { display: grid; gap: 14px; }
@media (min-width: 560px) {
  .row-2 { grid-template-columns: 1fr 1fr; }
  .row-3 { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 559px) { .row-3 { grid-template-columns: repeat(3, 1fr); gap: 8px; } .row-3 .field > span { font-size: 0.78rem; } }

.dropzone {
  position: relative; display: flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 72px; padding: 16px; border: 1.5px dashed var(--line); border-radius: var(--radius-sm);
  color: var(--accent); font-weight: 600; cursor: pointer; background: var(--bg);
}
.dropzone:hover { border-color: var(--accent); }
.dropzone input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.previews { display: flex; flex-wrap: wrap; gap: 8px; }
.previews:empty { display: none; }
.previews img { width: 76px; height: 76px; object-fit: cover; border-radius: 8px; background: var(--wall); }
.previews .preview-note { width: 100%; font-size: 0.8rem; color: var(--muted); }

.photo-edit { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.photo-edit li { display: grid; grid-template-columns: 84px 1fr; gap: 12px; align-items: start; }
.photo-edit img { width: 84px; height: 84px; object-fit: cover; border-radius: 8px; background: var(--wall); }
.photo-edit li > div { display: grid; gap: 8px; }
.photo-edit .check { margin-right: 14px; }
.doc-edit { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.doc-edit li { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.doc-edit span { flex: 1; min-width: 0; }
.doc-edit small { color: var(--muted); }

.form-actions {
  position: sticky; bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); z-index: 5;
  display: flex; justify-content: flex-end; gap: 10px; padding: 12px 0;
  background: linear-gradient(to top, var(--bg) 70%, transparent);
}
@media (min-width: 760px) { .form-actions { bottom: 0; } }
.danger-zone { margin-top: 32px; padding-top: 20px; border-top: 1px solid var(--line); }

/* ---------- Listes & réglages ---------- */

.list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.list a { display: flex; align-items: center; gap: 14px; padding: 12px 4px; border-bottom: 1px solid var(--line); color: var(--text); }
.list a:hover { background: var(--accent-soft); }
.list-thumb { width: 52px; height: 52px; flex: none; border-radius: 8px; background: var(--wall); overflow: hidden; }
.list-thumb img { width: 100%; height: 100%; object-fit: cover; }
.list-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.list-main small { color: var(--muted); }
.list-count { color: var(--muted); font-size: 0.85rem; white-space: nowrap; }
.section-title { margin: 32px 0 16px; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }

.menu { list-style: none; margin: 20px 0; padding: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.menu li + li { border-top: 1px solid var(--line); }
.menu a { display: flex; flex-direction: column; padding: 14px 18px; color: var(--text); }
.menu a:hover { background: var(--accent-soft); }
.menu small { color: var(--muted); }
.install-help { margin: 20px 0; padding: 14px 18px; border-radius: var(--radius); background: var(--accent-soft); }
.install-help summary { cursor: pointer; font-weight: 600; }
.install-help ol { margin: 10px 0 0; padding-left: 20px; }
.logout { margin-top: 12px; }

.settings-block { margin-top: 28px; }
.settings-block h2 { margin-bottom: 12px; }
.inline-form { display: flex; gap: 8px; align-items: center; }
.inline-form input { flex: 1; min-width: 0; }
.edit-list { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 6px; }
.edit-list li { display: flex; align-items: center; gap: 4px; }
.edit-list li > form:first-child { flex: 1; }
.edit-list input { min-height: 40px !important; background: var(--surface) !important; }
.inline-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }

.user-list { list-style: none; margin: 20px 0 28px; padding: 0; display: grid; gap: 10px; }
.user-list > li { padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.user-head { display: flex; flex-direction: column; }
.user-list details { margin-top: 8px; }
.user-list summary { cursor: pointer; color: var(--accent); font-weight: 600; font-size: 0.9rem; margin-bottom: 10px; }

/* ---------- Connexion ---------- */

.page-auth .main { min-height: 100vh; display: grid; place-items: center; padding-bottom: 32px; }
.auth-card { width: 100%; max-width: 400px; }
.auth-brand { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 1.15rem; margin-bottom: 36px; }
.auth-card h1 { margin-bottom: 20px; }
.auth-card .form { margin-top: 8px; }

/* ---------- Visionneuse ---------- */

.lightbox { width: 100vw; height: 100vh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: #0c0d0d; color: #ecebe6; }
.lightbox[open] { display: grid; place-items: center; }
.lightbox::backdrop { background: #0c0d0d; }
.lightbox img { max-width: 96vw; max-height: 86vh; object-fit: contain; }
.lightbox-close {
  position: fixed; top: calc(12px + env(safe-area-inset-top)); right: 12px; width: 44px; height: 44px;
  display: grid; place-items: center; border: 0; border-radius: 50%; background: rgba(255, 255, 255, 0.12); color: #fff; cursor: pointer;
}
.lightbox-caption { position: fixed; bottom: calc(16px + env(safe-area-inset-bottom)); left: 0; right: 0; text-align: center; font-size: 0.9rem; opacity: 0.8; }

/* ---------- Version imprimable ---------- */

.print-tools { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 20px; }
.print-tools .back { margin: 0; }
.print-doc { max-width: 900px; margin: 0 auto; background: var(--surface); padding: 32px; border-radius: var(--radius); border: 1px solid var(--line); }
.print-head { margin-bottom: 24px; padding-bottom: 16px; border-bottom: 2px solid var(--text); }
.print-summary { border-collapse: collapse; margin: 12px 0 4px; font-size: 0.9rem; }
.print-summary th, .print-summary td { text-align: left; padding: 4px 18px 4px 0; border-bottom: 1px solid var(--line); }
.print-item { display: grid; grid-template-columns: 140px 1fr; gap: 20px; padding: 18px 0; border-bottom: 1px solid var(--line); break-inside: avoid; }
.print-photo img { width: 140px; max-height: 170px; object-fit: contain; object-position: top; }
.print-item h2 { margin-bottom: 8px; }
.print-item dl { margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px 20px; font-size: 0.86rem; }
.print-item dl > div { display: flex; gap: 6px; }
.print-item dt { font-weight: 400; color: var(--muted); white-space: nowrap; }
.print-item dt::after { content: ' :'; }
.print-item dd { margin: 0; }
.print-single { grid-template-columns: 1fr; }
.print-single .print-photo img { width: auto; max-width: 100%; max-height: 520px; margin: 0 auto; }
.print-single dl { font-size: 0.95rem; }
.print-extra { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 12px; }
.print-extra figure { margin: 0; width: 150px; }
.print-extra img { width: 150px; height: 150px; object-fit: contain; background: #f3f1ec; }
.print-extra figcaption { font-size: 0.75rem; color: var(--muted); }
@media (max-width: 559px) {
  .print-doc { padding: 18px; }
  .print-item { grid-template-columns: 90px 1fr; gap: 14px; }
  .print-photo img { width: 90px; }
  .print-item dl { grid-template-columns: 1fr; }
}

@media print {
  :root { --bg: #fff; --surface: #fff; --text: #000; --muted: #555; --line: #ccc; color-scheme: light; }
  body { font-size: 11pt; background: #fff; }
  .topbar, .tabbar, .no-print, .lightbox, .flash { display: none !important; }
  .main { padding: 0; max-width: none; }
  .print-doc { border: 0; padding: 0; border-radius: 0; max-width: none; }
  .print-single .print-photo img { max-height: 13cm; }
  a { color: inherit; }
  @page { margin: 1.5cm; }
}
