/* ============================================================================
   K.u.K. IR 61 — site theme
   Imperial black & gold, grass-green (the regiment's facing colour), cream
   paper. Two self-hosted fonts: Cormorant Garamond (titles) and Source Sans 3.
   ========================================================================== */
@font-face { font-family: "Cormorant Garamond"; src: url("../fonts/CormorantGaramond.woff2") format("woff2"); font-weight: 300 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Cormorant Garamond"; src: url("../fonts/CormorantGaramond-Italic.woff2") format("woff2"); font-weight: 300 700; font-style: italic; font-display: swap; }
@font-face { font-family: "Source Sans 3"; src: url("../fonts/SourceSans3.woff2") format("woff2"); font-weight: 200 900; font-style: normal; font-display: swap; }
@font-face { font-family: "Source Sans 3"; src: url("../fonts/SourceSans3-Italic.woff2") format("woff2"); font-weight: 200 900; font-style: italic; font-display: swap; }

:root {
  --ink: #1c1a16; --ink-2: #3a362f; --muted: #6f685c;
  --paper: #f4efe4; --paper-2: #ebe3d1; --card: #fffdf8; --line: #dcd2bd; --line-2: #c6b995;
  --gold: #b38e2c; --gold-2: #d9bb5c; --gold-soft: #f3e7c3;
  --green: #2e8b3d; --green-dark: #1f6b2e; --green-soft: #e0f0dc;
  --red: #8a1f2a; --red-soft: #f6dcdc;
  --black: #141210; --black-2: #221f1a;
  --font-display: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --font-body: "Source Sans 3", "Segoe UI", Roboto, system-ui, sans-serif;
  --radius: 6px;
  --shadow: 0 1px 2px rgba(20,18,16,.05), 0 10px 28px -16px rgba(20,18,16,.35);
  --wrap: 1180px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; font-family: var(--font-body); font-size: 17px; line-height: 1.55; color: var(--ink); background: var(--paper); }
img { max-width: 100%; height: auto; }
a { color: var(--green-dark); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 600; line-height: 1.15; margin: 0 0 .5em; color: var(--ink); letter-spacing: .01em; font-variant-numeric: lining-nums; }
h1 { font-size: 2.6rem; } h2 { font-size: 2rem; } h3 { font-size: 1.45rem; } h4 { font-size: 1.15rem; font-family: var(--font-body); font-weight: 700; text-transform: uppercase; letter-spacing: .08em; font-size: .85rem; color: var(--muted); }
p { margin: 0 0 1em; }
hr { border: 0; border-top: 1px solid var(--line); margin: 28px 0; }
code { background: var(--paper-2); padding: 1px 5px; border-radius: 4px; font-size: .9em; }
blockquote { margin: 1em 0; padding: .5em 1.2em; border-left: 3px solid var(--gold); background: var(--paper-2); font-style: italic; }
blockquote footer { margin-top: .4em; font-style: normal; font-size: .9em; color: var(--muted); }
blockquote footer::before { content: "— "; }
.wrap { width: min(var(--wrap), 100% - 32px); margin: 0 auto; }
.muted { color: var(--muted); } .small { font-size: .9rem; } .center { text-align: center; } .right { text-align: right; }
.nowrap { white-space: nowrap; }
.mt { margin-top: 20px; } .mb { margin-bottom: 20px; } .mt-s { margin-top: 10px; } .mb-0 { margin-bottom: 0; }
.skip { position: absolute; left: -999px; top: 0; background: var(--gold); color: var(--black); padding: 8px 12px; z-index: 100; }
.skip:focus { left: 8px; top: 8px; }

/* ---- header ------------------------------------------------------------- */
.site-header { background: var(--black); color: #efe8d6; position: relative; z-index: 20; }
.header-top { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 14px 0; }
.brand { display: flex; align-items: center; gap: 16px; color: inherit; min-width: 0; }
.brand:hover { text-decoration: none; }
.site-logo { height: 64px; width: auto; max-width: 220px; object-fit: contain; flex: 0 0 auto; filter: drop-shadow(0 2px 6px rgba(0,0,0,.4)); }
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-name { font-family: var(--font-display); font-weight: 700; font-size: 1.75rem; line-height: 1.1; color: var(--gold-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-sub { font-size: .78rem; letter-spacing: .14em; text-transform: uppercase; color: #cfc6ae; margin-top: 4px; }
.header-tools { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.header-tools .btn.ghost { color: #efe8d6; border-color: rgba(255,255,255,.3); }
.header-tools .btn.ghost:hover { background: rgba(255,255,255,.08); }
.lang-menu { position: relative; }
.lang-menu summary { list-style: none; cursor: pointer; padding: 7px 12px; border: 1px solid rgba(255,255,255,.25); border-radius: var(--radius); font-size: .85rem; letter-spacing: .06em; color: #efe8d6; user-select: none; }
.lang-menu summary::-webkit-details-marker { display: none; }
.lang-menu[open] summary { background: rgba(255,255,255,.08); }
.lang-list { position: absolute; right: 0; top: calc(100% + 6px); background: var(--card); color: var(--ink); border: 1px solid var(--line-2); border-radius: var(--radius); box-shadow: var(--shadow); min-width: 170px; padding: 6px; z-index: 50; display: grid; }
.lang-list a { padding: 7px 12px; border-radius: 4px; color: var(--ink); font-size: .95rem; }
.lang-list a:hover { background: var(--paper-2); text-decoration: none; }
.lang-list a.active { font-weight: 700; color: var(--green-dark); }
.nav-toggle { display: none; background: none; border: 1px solid rgba(255,255,255,.25); border-radius: var(--radius); width: 42px; height: 38px; cursor: pointer; padding: 8px; flex-direction: column; justify-content: space-between; }
.nav-toggle span { display: block; height: 2px; background: #efe8d6; border-radius: 2px; }
.main-nav { background: var(--black-2); border-top: 1px solid rgba(255,255,255,.06); }
.nav-in { display: flex; flex-wrap: wrap; align-items: center; }
.main-nav a { color: #e8e1cf; padding: 12px 11px; font-size: .8rem; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; border-bottom: 3px solid transparent; white-space: nowrap; }
.main-nav a:hover { color: #fff; text-decoration: none; background: rgba(255,255,255,.04); }
.main-nav a.active { color: var(--gold-2); border-bottom-color: var(--gold); }
.main-nav a.nav-admin { margin-left: auto; color: var(--gold-2); }
/* drop-down groups of the main menu */
.main-nav .menu { position: relative; }
.main-nav .menu-btn { display: inline-flex; align-items: center; gap: 6px; background: none; border: 0; border-bottom: 3px solid transparent; color: #e8e1cf; padding: 12px 11px; font: inherit; font-size: .8rem; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; cursor: pointer; white-space: nowrap; }
.main-nav .menu-btn .caret { font-size: .7em; opacity: .7; transition: transform .15s; }
.main-nav .menu:hover .menu-btn, .main-nav .menu.open .menu-btn, .main-nav .menu-btn:focus-visible { color: #fff; background: rgba(255,255,255,.04); }
.main-nav .menu.open .menu-btn .caret { transform: rotate(180deg); }
.main-nav .menu-btn.active { color: var(--gold-2); border-bottom-color: var(--gold); }
.main-nav .menu-list { display: none; position: absolute; top: 100%; left: 0; z-index: 60; min-width: 230px; padding: 6px; background: var(--black-2); border: 1px solid rgba(255,255,255,.12); border-top: 3px solid var(--gold); border-radius: 0 0 var(--radius) var(--radius); box-shadow: 0 14px 30px -10px rgba(0,0,0,.6); }
.main-nav .menu:hover .menu-list, .main-nav .menu.open .menu-list { display: block; }
.main-nav .menu-list a { display: block; padding: 10px 14px; border-bottom: 0; border-left: 3px solid transparent; border-radius: 3px; text-transform: none; letter-spacing: 0; font-size: .95rem; font-weight: 500; }
.main-nav .menu-list a:hover { background: rgba(255,255,255,.07); }
.main-nav .menu-list a.active { color: var(--gold-2); border-left-color: var(--gold); }
.stripe { height: 7px; background: linear-gradient(to bottom, var(--gold) 0 4px, var(--green) 4px 7px); }

/* ---- layout -------------------------------------------------------------- */
.page-main { padding: 34px 0 60px; min-height: 50vh; }
.page-title { margin-bottom: 22px; }
.page-title h1 { margin-bottom: 6px; }
.page-title h1::after { content: ""; display: block; width: 64px; height: 3px; background: var(--gold); margin-top: 10px; }
.page-title .lead { font-size: 1.15rem; color: var(--ink-2); max-width: 70ch; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin: 36px 0 16px; }
.section-head h2 { margin: 0; }
.section-head a { font-size: .95rem; font-weight: 600; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.card + .card { margin-top: 18px; }
.card.center { text-align: center; padding: 48px 22px; }
.grid { display: grid; gap: 18px; }
.cols-2 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 360px), 1fr)); }
.cols-3 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 270px), 1fr)); }
.cols-4 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 210px), 1fr)); }
.two-col { display: grid; grid-template-columns: 2fr 1fr; gap: 28px; align-items: start; }
.prose { max-width: 74ch; font-size: 1.06rem; }
.prose h2 { margin-top: 1.4em; } .prose h3 { margin-top: 1.2em; }
.prose img { border-radius: var(--radius); }
.prose ul, .prose ol { padding-left: 1.4em; }
.md-img { margin: 1.2em 0; } .md-img figcaption { font-size: .9rem; color: var(--muted); margin-top: 4px; }
.md-img img { display: block; max-height: 80vh; width: auto; max-width: 100%; }
.md-img.right, .md-img.left { width: 38%; margin-top: .3em; }
.md-img.right { float: right; margin-left: 22px; } .md-img.left { float: left; margin-right: 22px; }
.prose h2, .prose h3, .prose .md-gallery, .prose .table-wrap, .prose blockquote, .prose hr, .pager { clear: both; }
/* a block of picture lines = a gallery; the pictures keep their shape, the captions sit under them */
.md-gallery { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 18px; margin: 1.4em 0; }
.md-gallery.cols-3, .md-gallery.cols-4 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.md-gallery .md-img { margin: 0; }
.md-gallery .md-img img { width: 100%; max-height: none; border: 1px solid var(--line); background: var(--paper-2); }
.md-gallery .md-img figcaption { font-size: .82rem; line-height: 1.35; }
.prose blockquote p:last-child { margin-bottom: 0; }
/* chapters of a longer text (sub-pages) */
.breadcrumb { font-size: .9rem; color: var(--muted); margin-bottom: 6px; } .breadcrumb span { margin: 0 2px; }
.chapter-list { list-style: none; margin: 0; padding: 0; counter-reset: ch; }
.chapter-list li { counter-increment: ch; padding: 7px 0 7px 30px; border-bottom: 1px solid var(--line); position: relative; line-height: 1.3; }
.chapter-list li:last-child { border-bottom: 0; }
.chapter-list li::before { content: counter(ch); position: absolute; left: 0; top: 7px; width: 22px; height: 22px; border-radius: 50%; background: var(--paper-2); color: var(--muted); font-size: .78rem; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.chapter-list li:first-child::before { content: "✦"; color: var(--gold); }
.chapter-list li.current::before { background: var(--green); color: #fff; }
.chapter-list li.current a { color: var(--ink); font-weight: 700; }
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 2em; padding-top: 1.2em; border-top: 1px solid var(--line); }
.pager a { display: block; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); font-family: var(--font-display); font-size: 1.15rem; line-height: 1.25; color: var(--ink); }
.pager a:hover { border-color: var(--gold); background: var(--gold-soft); }
.pager a small { display: block; font-family: var(--font-body); font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 4px; }
.pager-next { text-align: right; }

/* ---- a page series: the menu bar of its chapters, under the main menu (styled by istoric.css) ---- */
.sub-nav { background: var(--green-dark); color: #e6efe2; }
.sub-nav .antet-interior { width: min(var(--wrap), 100% - 32px); margin: 0 auto; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 24px; padding: 8px 0; }
.sub-nav .meniu { display: flex; flex-wrap: wrap; gap: 2px 18px; }
.sub-nav .meniu a { color: inherit; padding: 4px 0; border-bottom: 2px solid transparent; }
.sub-nav .meniu a.activ { border-bottom-color: var(--gold-2); color: var(--gold-2); }
.sub-nav .sigla { color: inherit; display: flex; align-items: center; gap: 10px; }
.sub-nav.fara-sigla .antet-interior, .sub-nav.fara-sigla .meniu { justify-content: center; }   /* only the chapters: centred */

/* ---- the text of a series runs across the whole width ---- */
.prose.wide { max-width: none; padding: 28px 34px 30px; }
.prose.wide > p, .prose.wide > ul, .prose.wide > ol, .prose.wide > blockquote, .prose.wide .md-box > p, .prose.wide .md-col > p { max-width: 78ch; }
.prose.wide > .md-img:not(.right):not(.left):not(.wide) { max-width: 820px; }
.prose.wide > .md-img:not(.right):not(.left):not(.wide) img { width: 100%; max-height: none; }
.prose.wide h2 { font-size: 1.7rem; margin-top: 1.6em; padding-top: .6em; border-top: 1px solid var(--line); }
.prose.wide h2:first-child, .prose.wide .lead + h2, .prose.wide .md-img + h2 { border-top: 0; padding-top: 0; }
.prose .lead { font-size: 1.22rem; line-height: 1.5; color: var(--ink-2); max-width: 70ch; }
.md-img.wide { width: 100%; } .md-img.wide img { width: 100%; max-height: none; }
.md-img.right, .md-img.left { width: auto; max-width: min(38%, 420px); }
.md-img.right img, .md-img.left img { max-height: 520px; }
.prose.wide > .md-img:not(.right):not(.left):not(.wide) { width: fit-content; }
.prose.wide > .md-img:not(.right):not(.left):not(.wide) img { width: auto; max-height: 85vh; }
.md-timeline .year { font-variant-numeric: lining-nums tabular-nums; }
/* galleries in a wide article: even tiles, like mounted prints; 4 columns for portraits */
.prose.wide .md-gallery.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.prose.wide .md-gallery .md-img img { aspect-ratio: 4 / 3; object-fit: contain; background: var(--paper-2); padding: 4px; box-sizing: border-box; }
.prose.wide .md-gallery.cols-4 .md-img img { aspect-ratio: 3 / 4; }
.prose.wide .md-gallery.cols-2 .md-img img { aspect-ratio: auto; }
.md-gallery { align-items: start; }
.prose.wide > .md-timeline { max-width: 92ch; }
.md-img img { border: 1px solid var(--line); background: var(--paper-2); }

/* ---- BBCode blocks ---- */
.md-box { background: var(--paper-2); border: 1px solid var(--line-2); border-left: 4px solid var(--gold); border-radius: var(--radius); padding: 18px 22px; margin: 1.5em 0; clear: both; overflow: hidden; }
.md-box h3 { margin-top: 0; font-size: 1.25rem; }
.md-box > :last-child { margin-bottom: 0; }
.md-box .md-img.right, .md-box .md-img.left { width: 34%; margin-top: 0; }
.md-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 26px 44px; margin: 1em 0 1.4em; clear: both; }
.md-columns.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.md-col > :first-child { margin-top: 0; }
.prose .md-col h2 { border-top: 0; padding-top: 0; margin-top: .2em; font-size: 1.45rem; }
.md-facts { margin: .6em 0 1em; }
.md-facts div { display: grid; grid-template-columns: 11em minmax(0, 1fr); gap: 14px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.md-facts dt { font-weight: 700; color: var(--green-dark); }
.md-facts dd { margin: 0; }
.md-timeline { list-style: none; margin: 1.2em 0 1.6em; padding: 0; }
.md-timeline li { display: grid; grid-template-columns: 8em minmax(0, 1fr); gap: 18px; padding: 9px 0; position: relative; }
.md-timeline li::before { content: ""; position: absolute; left: calc(8em - 1px); top: 0; bottom: 0; border-left: 2px solid var(--line-2); }
.md-timeline li:first-child::before { top: 50%; } .md-timeline li:last-child::before { bottom: 50%; }
.md-timeline .year { font-family: var(--font-display); font-weight: 600; font-size: 1.15rem; color: var(--green-dark); text-align: right; padding-right: 22px; position: relative; line-height: 1.5; }
.md-timeline .year::after { content: ""; position: absolute; right: -6px; top: .55em; width: 12px; height: 12px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 3px var(--card); }
.md-honours { list-style: none; padding: 0; margin: 1em 0; display: flex; flex-wrap: wrap; gap: 8px; }
.md-honours li { background: var(--card); border: 1px solid var(--line-2); border-radius: 4px; padding: 5px 11px; font-family: var(--font-display); font-size: 1.05rem; }
.md-honours small { color: var(--muted); margin-left: 7px; font-family: var(--font-body); font-size: .8rem; }
.md-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; margin: 1.2em 0; clear: both; }
.md-card { display: block; padding: 14px 16px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); color: var(--ink); }
.md-card b { display: block; font-family: var(--font-display); font-size: 1.15rem; line-height: 1.25; color: var(--green-dark); margin-bottom: 5px; }
.md-card span { font-size: .93rem; color: var(--ink-2); }
a.md-card:hover { border-color: var(--gold); background: var(--gold-soft); text-decoration: none; }
.md-swatches { list-style: none; padding: 0; margin: .8em 0 1em; }
.md-swatches li { display: flex; align-items: center; gap: 10px; padding: 4px 0; }
.md-swatches .swatch { width: 26px; height: 26px; border-radius: 50%; border: 1px solid rgba(0,0,0,.22); flex: none; }
.md-small { font-size: .9rem; color: var(--ink-2); border-top: 1px solid var(--line); margin-top: 2em; padding-top: 1em; clear: both; }
.prose .md-small h2, .prose .md-small h3 { font-size: 1.1rem; margin-top: 0; border-top: 0; padding-top: 0; }
.md-doc { display: inline-block; padding: 4px 12px; margin: 2px 6px 4px 0; border-radius: 6px; background: var(--green); color: #fff; font-weight: 600; font-size: .92rem; }
.md-doc:hover { background: var(--green-dark); color: #fff; text-decoration: none; }
.md-button { display: inline-block; padding: 9px 18px; margin: 2px 6px 4px 0; border-radius: var(--radius); background: var(--gold-2); color: var(--black); font-weight: 700; border: 2px solid var(--gold-2); }
.md-button:hover { background: var(--gold); text-decoration: none; }
.md-button.alt { background: transparent; color: inherit; border-color: currentColor; }
.md-kicker { font-family: var(--font-display); font-size: 1.3rem; color: var(--green-dark); margin-bottom: .2em; }
.md-document { padding: 14px 0; border-bottom: 1px solid var(--line); }
.md-document.main { background: var(--paper-2); border-top: 3px solid var(--green); padding: 16px; }
.md-document h3 { margin: 0 0 .25em; font-size: 1.25rem; }
.md-document .author { font-weight: 700; margin-bottom: .3em; }
/* a document of the library this visitor may not open: the words stay, without the link (includes/markdown.php → md_locked) */
.doc-locked { color: var(--muted); }
a.doc-locked { text-decoration: underline dotted; }
span.doc-locked { cursor: help; }
.md-doc.locked, .md-button.locked { background: var(--paper-2); color: var(--muted); border: 1px dashed var(--line-2); }
span.md-doc.locked, span.md-button.locked { cursor: not-allowed; }
.md-document p { margin: 0 0 .6em; }
.md-reader-note { font-size: .88rem; color: var(--muted); margin: 6px 0 0; }
.md-card.with-img { display: grid; grid-template-columns: 1fr 120px; grid-template-areas: "k i" "t i" "d i"; gap: 2px 14px; align-items: start; }
.md-card small { grid-area: k; display: block; color: var(--muted); font-size: .85rem; }
.md-card.with-img b { grid-area: t; } .md-card.with-img span { grid-area: d; }
.md-card img { grid-area: i; width: 100%; aspect-ratio: 3 / 2; object-fit: cover; border-radius: 4px; }
.md-img.medium { max-width: 820px; } .md-img.vignette { max-width: 720px; margin: 2em auto 0; } .md-img.vignette img { border: 0; background: none; }
.md-gallery.portraits { display: flex; flex-wrap: wrap; justify-content: center; }   /* a row that is not full stays in the middle */
.md-gallery.portraits > .md-img { flex: 0 0 160px; min-width: 0; }
.md-gallery.portraits .md-img img { aspect-ratio: 3 / 4; object-fit: cover; object-position: top; }
.md-gallery.portraits.small { gap: 14px 12px; }
.md-gallery.portraits.small > .md-img { flex-basis: 118px; }
.md-gallery.portraits.small .md-img figcaption { font-size: .76rem; }
.md-gallery.masonry { display: block; columns: 3 220px; column-gap: 18px; }
.md-gallery.masonry .md-img { break-inside: avoid; margin: 0 0 16px; }
.md-gallery.framed .md-img img { border: 1px solid var(--line-2); }
.md-reader { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 28px; align-items: start; margin: 1em 0; clear: both; }
.prose .md-reader-docs > p { max-width: none; }
.md-reader-frame { position: sticky; top: 12px; }
.md-reader-frame .frame-box { position: relative; border: 1px solid var(--line-2); border-radius: var(--radius); background: var(--paper-2); overflow: hidden; }
.md-reader-frame .frame-hint { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: var(--muted); font-family: var(--font-display); font-size: 1.3rem; pointer-events: none; }
.md-reader-frame iframe { position: relative; width: 100%; height: 80vh; min-height: 420px; border: 0; display: block; background: transparent; }

/* ---- hero ---------------------------------------------------------------- */
.hero { background-color: var(--black-2); background-image: radial-gradient(ellipse at 20% 10%, rgba(217,187,92,.25), transparent 55%), linear-gradient(160deg, #2a261f, #141210); color: #f1ead8; border-radius: var(--radius); padding: 56px 40px; display: grid; grid-template-columns: auto 1fr; gap: 40px; align-items: center; position: relative; overflow: hidden; box-shadow: var(--shadow); }
.hero.has-image { background-size: cover; background-position: center; background-image: var(--hero-img); }
.hero.has-image::before { content: ""; position: absolute; inset: 0; background: linear-gradient(100deg, rgba(20,18,16,.92) 30%, rgba(20,18,16,.55)); }
.hero > * { position: relative; }
.hero-logo { height: 180px; width: auto; max-width: 260px; object-fit: contain; filter: drop-shadow(0 6px 18px rgba(0,0,0,.5)); }
.hero h1 { color: #fff; font-size: 3rem; margin-bottom: 8px; }
.hero h1 span { color: var(--gold-2); }
.hero .hero-sub { font-size: 1.2rem; color: #d8d0bb; max-width: 60ch; }
.hero .hero-kicker { text-transform: uppercase; letter-spacing: .18em; font-size: .8rem; color: var(--gold-2); margin-bottom: 10px; font-weight: 600; }
.hero .btn.ghost { border-color: rgba(255,255,255,.35); color: #fff; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin-top: 22px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; text-align: center; }
.stat b { display: block; font-family: var(--font-display); font-size: 2.2rem; color: var(--green-dark); line-height: 1; font-variant-numeric: lining-nums; }
.stat span { font-size: .82rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }

/* ---- buttons, badges, flashes ---------------------------------------------- */
.btn { display: inline-block; padding: 9px 18px; border: 1px solid var(--line-2); border-radius: var(--radius); background: var(--card); color: var(--ink); font: inherit; font-weight: 600; font-size: .95rem; cursor: pointer; line-height: 1.3; transition: background .15s, border-color .15s; }
.btn:hover { background: var(--paper-2); text-decoration: none; }
.btn.primary { background: var(--green); border-color: var(--green-dark); color: #fff; }
.btn.primary:hover { background: var(--green-dark); }
.btn.gold { background: var(--gold); border-color: #94741f; color: #fff; }
.btn.gold:hover { background: #94741f; }
.btn.danger { background: var(--card); color: var(--red); border-color: #d9a4a9; }
.btn.danger:hover { background: var(--red-soft); }
.btn.ghost { background: transparent; }
.btn.small { padding: 5px 11px; font-size: .85rem; }
.btn.tiny { padding: 2px 8px; font-size: .78rem; }
.btn.block { display: block; width: 100%; text-align: center; }
.btn[disabled] { opacity: .5; cursor: default; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.badge { display: inline-block; padding: 2px 9px; border-radius: 20px; font-size: .75rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; background: var(--paper-2); color: var(--ink-2); border: 1px solid var(--line); vertical-align: middle; }
.badge.green { background: var(--green-soft); color: var(--green-dark); border-color: #b8dcb4; }
.badge.gold { background: var(--gold-soft); color: #7a5e12; border-color: #e2cf8f; }
.badge.red { background: var(--red-soft); color: var(--red); border-color: #e5b7bb; }
.badge.dark { background: var(--black-2); color: #f1ead8; border-color: var(--black); }
.flash { padding: 12px 16px; border-radius: var(--radius); margin-bottom: 18px; border: 1px solid; }
.flash-ok { background: var(--green-soft); border-color: #b8dcb4; color: var(--green-dark); }
.flash-err { background: var(--red-soft); border-color: #e5b7bb; color: var(--red); }
.flash-info { background: var(--gold-soft); border-color: #e2cf8f; color: #6b5210; }
.stars { color: var(--gold); letter-spacing: 1px; font-size: .95rem; white-space: nowrap; }
.stars .dim { color: var(--line-2); }
.notice { background: var(--gold-soft); border: 1px solid #e2cf8f; border-radius: var(--radius); padding: 12px 16px; color: #6b5210; }
.empty { color: var(--muted); font-style: italic; padding: 24px; text-align: center; border: 1px dashed var(--line-2); border-radius: var(--radius); }

/* ---- forms --------------------------------------------------------------- */
label { display: block; font-weight: 600; font-size: .92rem; margin: 0 0 5px; color: var(--ink-2); }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=url], input[type=search], select, textarea { width: 100%; padding: 9px 11px; border: 1px solid var(--line-2); border-radius: var(--radius); background: #fff; font: inherit; font-size: .98rem; color: var(--ink); }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--gold-2); outline-offset: 1px; border-color: var(--gold); }
textarea { min-height: 130px; resize: vertical; line-height: 1.5; }
textarea.tall { min-height: 280px; }
input[type=file] { font-size: .92rem; }
input[type=checkbox], input[type=radio] { width: auto; margin-right: 6px; transform: scale(1.1); }
.field { margin-bottom: 16px; }
.field .help { font-size: .84rem; color: var(--muted); margin-top: 4px; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 14px; }
.check { display: flex; align-items: center; gap: 6px; font-weight: 500; }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; margin: 0 0 18px; }
legend { font-family: var(--font-display); font-size: 1.3rem; font-weight: 600; padding: 0 8px; }
.form-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.inline-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; }
.inline-form > * { margin: 0; }
.inline-form input, .inline-form select { width: auto; min-width: 120px; }
.md-toolbar { display: flex; gap: 4px; margin-bottom: 4px; flex-wrap: wrap; }
.md-toolbar button { padding: 3px 9px; font-size: .82rem; border: 1px solid var(--line-2); background: var(--paper-2); border-radius: 4px; cursor: pointer; font-family: inherit; }
.md-toolbar button:hover { background: var(--gold-soft); }
.md-toolbar.bb-blocks button { background: var(--green-soft); border-color: #b9d6b0; }
.md-toolbar.bb-blocks button:hover { background: var(--gold-soft); }
.bb-ref { font-size: .78rem; line-height: 1.45; background: var(--paper-2); padding: 12px 14px; border-radius: var(--radius); overflow-x: auto; white-space: pre; margin: 8px 0 0; }

/* ---- tables -------------------------------------------------------------- */
.table-wrap { overflow-x: auto; max-width: 100%; }
.card { min-width: 0; }
table.table { width: 100%; border-collapse: collapse; font-size: .96rem; background: var(--card); }
.table th, .table td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.table th { font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); background: var(--paper-2); }
.table tbody tr:hover { background: #fbf7ee; }
.table td.actions { text-align: right; white-space: nowrap; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table img.thumb { width: 44px; height: 44px; object-fit: cover; border-radius: 4px; border: 1px solid var(--line); }
.table img.insignia { height: 30px; }

/* ---- members ------------------------------------------------------------- */
.rank-group { margin-bottom: 34px; }
.rank-group > h2 { font-size: 1.5rem; border-bottom: 1px solid var(--line-2); padding-bottom: 6px; margin-bottom: 16px; }
.member-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column; transition: transform .15s, box-shadow .15s; }
.member-card:hover { transform: translateY(-2px); box-shadow: 0 14px 30px -14px rgba(20,18,16,.4); text-decoration: none; }
.member-photo { aspect-ratio: 1; background: var(--paper-2) center/cover no-repeat; display: flex; align-items: center; justify-content: center; color: var(--line-2); font-family: var(--font-display); font-size: 3rem; }
.member-body { padding: 12px 14px 14px; }
.member-name { font-family: var(--font-display); font-size: 1.35rem; font-weight: 700; color: var(--ink); line-height: 1.15; }
.member-rank { display: flex; align-items: center; gap: 8px; margin-top: 6px; font-size: .92rem; color: var(--ink-2); }
.insignia { height: 40px; width: auto; border-radius: 3px; }
.insignia.lg { height: 76px; }
.insignia.sm { height: 28px; }
.profile-head { display: grid; grid-template-columns: 260px 1fr; gap: 28px; align-items: start; }
.profile-photo { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: var(--radius); border: 1px solid var(--line); background: var(--paper-2); }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; font-size: .98rem; margin: 0; }
.kv dt { color: var(--muted); font-weight: 600; } .kv dd { margin: 0; }
.timeline { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--line-2); }
.timeline li { position: relative; padding: 0 0 16px 20px; }
.timeline li::before { content: ""; position: absolute; left: -7px; top: 7px; width: 12px; height: 12px; border-radius: 50%; background: var(--gold); border: 2px solid var(--card); }
.timeline .when { font-size: .85rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.award-list { display: grid; gap: 12px; }
.award-item { display: grid; grid-template-columns: 64px 1fr; gap: 14px; align-items: center; padding: 10px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); }
.award-item img { width: 64px; height: 64px; object-fit: contain; }
.award-item .no-img { width: 64px; height: 64px; border-radius: 50%; background: var(--gold-soft); display: flex; align-items: center; justify-content: center; color: var(--gold); font-size: 1.6rem; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }

/* ---- ranks --------------------------------------------------------------- */
.rank-row { display: grid; grid-template-columns: 320px 1fr; gap: 24px; padding: 18px 0; border-bottom: 1px solid var(--line); align-items: start; }
.rank-row:last-child { border-bottom: 0; }
.rank-insignia { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.rank-insignia figure { margin: 0; text-align: center; }
.rank-insignia img { width: 100%; max-width: 150px; height: auto; border-radius: 3px; }
.rank-insignia figcaption { color: var(--muted); font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; margin-top: 4px; }
.rank-name { font-family: var(--font-display); font-size: 1.6rem; font-weight: 700; margin: 0; }
.rank-sub { color: var(--ink-2); margin-bottom: 6px; }
details.more summary { cursor: pointer; color: var(--green-dark); font-weight: 600; font-size: .92rem; }
details.more[open] summary { margin-bottom: 8px; }

/* ---- awards -------------------------------------------------------------- */
.tabs { display: flex; flex-wrap: wrap; gap: 4px; border-bottom: 2px solid var(--line); margin-bottom: 22px; }
.tabs a { padding: 10px 16px; font-weight: 600; color: var(--ink-2); border-bottom: 3px solid transparent; margin-bottom: -2px; }
.tabs a:hover { text-decoration: none; color: var(--green-dark); }
.tabs a.active { color: var(--green-dark); border-bottom-color: var(--green); }
.award-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; text-align: center; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 8px; }
.award-card:hover { text-decoration: none; box-shadow: 0 14px 30px -14px rgba(20,18,16,.4); }
.award-img { height: 210px; display: flex; align-items: center; justify-content: center; background: #fff; border-radius: calc(var(--radius) - 4px); padding: 10px; box-shadow: inset 0 0 0 1px var(--line); }
.award-img img { max-height: 190px; max-width: 100%; object-fit: contain; }
.award-img .no-img { width: 110px; height: 110px; border-radius: 50%; background: var(--gold-soft); display: flex; align-items: center; justify-content: center; color: var(--gold); font-size: 3rem; }
.award-name { font-family: var(--font-display); font-size: 1.3rem; font-weight: 700; color: var(--ink); line-height: 1.15; }
.award-detail { display: grid; grid-template-columns: 320px 1fr; gap: 30px; align-items: start; }
.award-detail .big { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; text-align: center; }
.award-detail .big img { max-height: 480px; max-width: 100%; object-fit: contain; }
.award-detail .big a { display: block; cursor: zoom-in; }

/* ---- events & gallery ----------------------------------------------------- */
.event-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column; color: inherit; }
.event-card:hover { text-decoration: none; box-shadow: 0 14px 30px -14px rgba(20,18,16,.4); }
.event-cover { aspect-ratio: 16/9; background: var(--black-2) center/cover no-repeat; position: relative; }
.event-cover.empty-cover { background: linear-gradient(135deg, var(--black-2), #3a3429); display: flex; align-items: center; justify-content: center; color: var(--gold-2); font-family: var(--font-display); font-size: 2rem; }
.event-date { position: absolute; left: 12px; top: 12px; background: var(--card); color: var(--ink); border-radius: 4px; padding: 6px 10px; text-align: center; line-height: 1; box-shadow: 0 2px 8px rgba(0,0,0,.3); }
.event-date b { display: block; font-size: 1.4rem; font-family: var(--font-display); font-variant-numeric: lining-nums; }
.event-date span { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; }
.event-body { padding: 14px 16px 16px; }
.event-title { font-family: var(--font-display); font-size: 1.4rem; font-weight: 700; line-height: 1.15; }
.event-meta { font-size: .9rem; color: var(--muted); margin-top: 4px; display: flex; flex-wrap: wrap; gap: 6px 14px; }
.year-head { font-family: var(--font-display); font-size: 1.7rem; margin: 30px 0 12px; color: var(--muted); }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 190px), 1fr)); gap: 10px; }
.photo-grid a { display: block; aspect-ratio: 4/3; overflow: hidden; border-radius: 4px; background: var(--paper-2); position: relative; }
.photo-grid img { width: 100%; height: 100%; object-fit: cover; transition: transform .2s; }
.photo-grid a:hover img { transform: scale(1.04); }
.photo-grid .cap { position: absolute; left: 0; right: 0; bottom: 0; background: linear-gradient(transparent, rgba(0,0,0,.7)); color: #fff; font-size: .8rem; padding: 18px 8px 6px; }
.album-card { display: block; color: inherit; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.album-card:hover { text-decoration: none; }
.album-card .event-cover { aspect-ratio: 4/3; }
.album-card .event-body { padding: 10px 14px; }
.participants { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); gap: 8px; }
.participant { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); color: inherit; font-size: .95rem; }
.participant img.avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; background: var(--paper-2); }
.participant .avatar.ph { width: 40px; height: 40px; border-radius: 50%; background: var(--paper-2); display: flex; align-items: center; justify-content: center; font-family: var(--font-display); color: var(--muted); }
.lightbox { position: fixed; inset: 0; background: rgba(10,9,8,.94); z-index: 1000; display: flex; align-items: center; justify-content: center; }
.lightbox[hidden] { display: none; }
.lightbox img { max-width: 94vw; max-height: 86vh; object-fit: contain; box-shadow: 0 10px 40px rgba(0,0,0,.6); }
.lightbox button { position: absolute; background: rgba(255,255,255,.1); border: 0; color: #fff; font-size: 2.2rem; width: 54px; height: 54px; border-radius: 50%; cursor: pointer; line-height: 1; }
.lightbox button:hover { background: rgba(255,255,255,.22); }
.lb-close { top: 16px; right: 16px; } .lb-prev { left: 16px; top: 50%; transform: translateY(-50%); } .lb-next { right: 16px; top: 50%; transform: translateY(-50%); }
.lb-caption { position: absolute; bottom: 14px; left: 0; right: 0; text-align: center; color: #ddd; font-size: .95rem; padding: 0 70px; }
.lightbox { z-index: 1100; }   /* above the box of a story, whose picture it shows full size */

/* ---- the story of a person: a box over the page ([story] in a gallery) ---- */
figure.has-story > a { cursor: pointer; }
.story-open { display: table; margin-top: 4px; padding: 0; border: 0; background: none; color: var(--green-dark, #1f6b2e); font: inherit; font-size: .85em; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; cursor: pointer; }
.story-open:hover { text-decoration-thickness: 2px; }
#storybox { position: fixed; inset: 0; z-index: 1050; display: flex; align-items: center; justify-content: center; padding: 3vh 4vw; background: rgba(18, 16, 13, .72); }
#storybox[hidden] { display: none; }
#storybox .sb-panel { position: relative; width: min(100%, 36rem); max-height: 90vh; overflow: auto; padding: 26px 28px 24px; background: var(--card, #fff); color: var(--ink, #222); border-radius: 4px; box-shadow: 0 18px 50px rgba(0, 0, 0, .45); animation: sb-in .18s ease-out; }
#storybox .sb-panel.sz-m { width: min(100%, 44rem); }
#storybox .sb-panel.sz-l { width: min(100%, 54rem); }
#storybox .sb-photo { float: left; width: 9rem; margin: 2px 22px 10px 0; cursor: zoom-in; }
#storybox .sz-m .sb-photo { width: 10.5rem; } #storybox .sz-l .sb-photo { width: 12rem; }
#storybox .sb-photo img { display: block; width: 100%; height: auto; border: 1px solid rgba(0, 0, 0, .18); }
#storybox h2 { margin: 0 34px 10px 0; font-size: 1.4rem; line-height: 1.25; }
#storybox .sb-rank, #storybox .sb-name { display: block; }   /* the rank on its own line, the name under it, larger */
#storybox .sb-rank { margin-bottom: 3px; font-size: .68em; font-weight: normal; line-height: 1.3; opacity: .78; }
#storybox .sb-rank:empty { display: none; }
#storybox .sb-text p { margin: 0 0 .8em; line-height: 1.6; }
#storybox .sb-text p:last-child { margin-bottom: 0; }
#storybox .sb-text::after { content: ""; display: block; clear: both; }
#storybox .sb-close { position: absolute; top: 8px; right: 10px; width: 36px; height: 36px; border: 0; border-radius: 50%; background: transparent; color: inherit; font-size: 1.8rem; line-height: 1; cursor: pointer; }
#storybox .sb-close:hover, #storybox .sb-close:focus-visible { background: rgba(0, 0, 0, .07); }
#storybox .sb-prev, #storybox .sb-next { position: fixed; top: 50%; transform: translateY(-50%); width: 50px; height: 50px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .14); color: #fff; font-size: 2rem; line-height: 1; cursor: pointer; }
#storybox .sb-prev { left: 14px; } #storybox .sb-next { right: 14px; }
#storybox .sb-prev:hover, #storybox .sb-next:hover { background: rgba(255, 255, 255, .26); }
#storybox.single .sb-prev, #storybox.single .sb-next { display: none; }
@keyframes sb-in { from { opacity: 0; transform: translateY(8px) scale(.985); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { #storybox .sb-panel { animation: none; } }
@media (max-width: 640px) {
  #storybox { padding: 2vh 3vw; align-items: flex-start; }
  #storybox .sb-panel, #storybox .sb-panel.sz-m, #storybox .sb-panel.sz-l { width: 100%; max-height: calc(100vh - 2vh - 76px); max-height: calc(100dvh - 2vh - 76px); padding: 20px 18px 18px; }
  #storybox .sb-photo, #storybox .sz-m .sb-photo, #storybox .sz-l .sb-photo { width: 7.5rem; margin-right: 14px; }
  #storybox h2 { font-size: 1.25rem; }
  #storybox .sb-prev, #storybox .sb-next { top: auto; bottom: 14px; transform: none; width: 46px; height: 46px; background: rgba(0, 0, 0, .55); }
}

/* ---- library, news ------------------------------------------------------- */
.lib-item { display: grid; grid-template-columns: 48px 1fr auto; gap: 14px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.lib-item:last-child { border-bottom: 0; }
.lib-icon { width: 48px; height: 48px; border-radius: var(--radius); background: var(--paper-2); display: flex; align-items: center; justify-content: center; font-size: 1.4rem; }
.lib-title { font-weight: 700; font-size: 1.05rem; }
.post-card { border-bottom: 1px solid var(--line); padding: 18px 0; display: grid; grid-template-columns: 1fr; gap: 8px; }
.post-card.with-img { grid-template-columns: 220px 1fr; gap: 20px; }
.post-card img { width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: var(--radius); }
.post-title { font-family: var(--font-display); font-size: 1.5rem; font-weight: 700; }
.post-meta { font-size: .88rem; color: var(--muted); }

/* ---- footer -------------------------------------------------------------- */
.site-footer { background: var(--black); color: #cfc6ae; margin-top: 40px; border-top: 4px solid var(--gold); font-size: .95rem; }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 28px; padding: 40px 0 24px; }
.footer-brand { font-family: var(--font-display); font-size: 1.5rem; color: var(--gold-2); font-weight: 700; margin-bottom: 8px; }
.site-footer h4 { color: #e8e1cf; }
.site-footer a { color: #e8e1cf; }
.footer-links a { display: inline-block; margin: 0 14px 6px 0; }
.footer-links a.active { color: var(--gold-2); font-weight: 700; }
.social a { margin-right: 14px; font-weight: 600; }
.footer-bottom { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; padding: 14px 0 22px; border-top: 1px solid rgba(255,255,255,.1); font-size: .85rem; color: #9a917c; }
.footer-bottom a { color: #9a917c; }

/* ---- auth boxes ----------------------------------------------------------- */
.auth-box { max-width: 440px; margin: 30px auto; }

/* the two-step login (account.php, login.php) */
.ts-code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 1.35rem; letter-spacing: .18em; max-width: 12em; }
.ts-qr { width: 208px; max-width: 100%; margin: 10px 0; background: #fff; border: 1px solid var(--line); }
.ts-qr svg { display: block; width: 100%; height: auto; }
.ts-key { font-size: 1.05rem; letter-spacing: .06em; word-spacing: .3em; user-select: all; }
.ts-steps { padding-left: 1.3em; } .ts-steps > li { margin-bottom: 14px; }
.form-row.ts-inline, .ts-inline { display: flex; flex-wrap: wrap; gap: 10px 12px; align-items: flex-end; } .ts-inline .field { margin: 0; }
.ts-codes { columns: 2; padding-left: 1.8em; margin: 10px 0; } .ts-codes li { margin: 2px 0; } .ts-codes code { font-size: 1.05rem; letter-spacing: .05em; }
.ts-codes-box { background: var(--gold-soft); border: 1px solid #e2cf8f; border-radius: 6px; padding: 12px 16px; }
.auth-box h1 { font-size: 2rem; }

/* ---- admin ---------------------------------------------------------------- */
.admin-layout { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 26px; align-items: start; }
.admin-main { min-width: 0; }
body.admin .wrap { width: min(1560px, 100% - 32px); }
.admin-nav { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px; position: sticky; top: 12px; }
.admin-nav a { display: block; padding: 8px 12px; border-radius: 4px; color: var(--ink-2); font-weight: 600; font-size: .93rem; }
.admin-nav a:hover { background: var(--paper-2); text-decoration: none; }
.admin-nav a.active { background: var(--green-soft); color: var(--green-dark); }
.admin-nav .sep { border-top: 1px solid var(--line); margin: 6px 0; }
.admin-nav .count { float: right; background: var(--red); color: #fff; border-radius: 10px; font-size: .72rem; padding: 1px 7px; }
.admin-head { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; margin-bottom: 16px; }
.admin-head h1 { font-size: 2rem; margin: 0; }
/* the visibility of a document of the library: one button, a click moves it on (Admin → Library) */
.vis-form { margin: 0; }
.vis-btn { display: inline-block; min-width: 6.4em; padding: 3px 10px; border-radius: 20px; border: 1px solid; font: 700 .76rem/1.4 var(--font-body); letter-spacing: .06em; text-transform: uppercase; text-align: center; cursor: pointer; }
span.vis-btn { min-width: 0; cursor: default; padding: 0 8px; font-size: .68rem; }
.vis-btn.vis-public { background: var(--green-soft); color: var(--green-dark); border-color: #8fc489; }
.vis-btn.vis-members { background: var(--red-soft); color: var(--red); border-color: #d99aa1; }
.vis-btn.vis-admin { background: var(--black-2); color: #f1ead8; border-color: var(--black); }
button.vis-btn:hover { filter: brightness(.95); box-shadow: 0 0 0 2px rgba(20,18,16,.12); }
button.vis-btn:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.vis-btn.busy { opacity: .55; cursor: progress; }

/* ---- Admin → Pages: the pictures of a page ------------------------------- */
.pg-pics > summary { cursor: pointer; padding: 2px 0; }
.pg-pic-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 12px; margin-top: 8px; max-height: 34rem; overflow: auto; padding: 2px; }
.pg-pic { margin: 0; display: flex; flex-direction: column; gap: 4px; }
.pg-pic img { width: 100%; height: 120px; object-fit: cover; border: 1px solid var(--line); background: var(--paper-2); display: block; }
.pg-pic figcaption { display: flex; flex-direction: column; gap: 4px; font-size: .78rem; line-height: 1.3; }
.pg-pic-name { color: var(--muted, #6b6457); overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.pg-pic-btn { position: relative; overflow: hidden; text-align: center; cursor: pointer; }
.pg-pic-btn input[type=file], .pf-change input[type=file] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; font-size: 0; }
.pg-pic-status.ok, .pf-status.ok { color: var(--green-dark); } .pg-pic-status.err, .pf-status.err { color: var(--red); } .pf-status.warn { color: #8a6200; }

/* ---- Admin → Portraits and stories ------------------------------------------ */
.pf-pick { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 10px; }
.pf-pick select { max-width: 26rem; }
.pf-filter { display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center; margin-top: 12px; }
.pf-filter input[type=search] { flex: 1 1 15rem; max-width: 24rem; }
.pf-group { margin: 0 0 18px; }
.pf-group > summary { cursor: pointer; font-family: var(--font-display); font-size: 1.15rem; padding: 6px 2px; }
.pf-row { display: grid; grid-template-columns: 104px minmax(0, 1fr); gap: 12px 18px; padding: 14px 16px; margin: 10px 0; }
.pf-row.dirty { box-shadow: 0 0 0 2px var(--gold); }
.pf-photo { display: flex; flex-direction: column; gap: 6px; }
.pf-photo img { width: 104px; height: 136px; object-fit: cover; object-position: top; border: 1px solid var(--line); background: var(--paper-2); display: block; }
.pf-change { position: relative; overflow: hidden; text-align: center; cursor: pointer; white-space: normal; line-height: 1.2; }
.pf-line { display: grid; grid-template-columns: minmax(9rem, 1fr) minmax(11rem, 1.6fr); gap: 0 14px; }
.pf-row .field { margin-bottom: 8px; }
.pf-boxline { display: grid; grid-template-columns: minmax(0, 1fr) minmax(12rem, 1.15fr); gap: 0 14px; align-items: end; }
.pf-row .check.pf-box { margin: 0 0 16px; font-weight: 600; align-self: end; }
.pf-row.no-box .pf-boxline { grid-template-columns: 1fr; }
.pf-row textarea { min-height: 3.4em; resize: vertical; line-height: 1.45; }
.pf-row.no-box .pf-boxrank { display: none; }
.pf-actions { display: flex; align-items: center; gap: 10px; }
@media (max-width: 640px) {
  .pf-row { grid-template-columns: 76px minmax(0, 1fr); padding: 10px; gap: 10px; }
  .pf-photo img { width: 76px; height: 100px; }
  .pf-line, .pf-boxline { grid-template-columns: 1fr; }
  .pf-row .check.pf-box { margin-bottom: 8px; }
}
.vis-legend { margin: -6px 0 12px; line-height: 2; }
.dash-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); gap: 14px; }
.dash-tile { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; color: inherit; }
.dash-tile:hover { text-decoration: none; border-color: var(--gold); }
.dash-tile b { display: block; font-family: var(--font-display); font-size: 2rem; color: var(--green-dark); line-height: 1; font-variant-numeric: lining-nums; }
.dash-tile span { font-size: .85rem; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.subtabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 18px; }
.subtabs a { padding: 7px 14px; border: 1px solid var(--line-2); border-radius: 20px; font-size: .9rem; font-weight: 600; color: var(--ink-2); background: var(--card); }
.subtabs a.active { background: var(--black-2); color: #fff; border-color: var(--black); }
.subtabs a:hover { text-decoration: none; }
.progress { height: 10px; background: var(--paper-2); border-radius: 5px; overflow: hidden; border: 1px solid var(--line); }
.progress > span { display: block; height: 100%; background: var(--green); width: 0; transition: width .3s; }
.upload-list { font-size: .9rem; margin-top: 8px; }
.upload-list li.ok { color: var(--green-dark); } .upload-list li.err { color: var(--red); }
.drag { border: 2px dashed var(--line-2); border-radius: var(--radius); padding: 18px; text-align: center; background: #fff; }
.sortable-handle { cursor: grab; color: var(--muted); }
.preview-img { max-height: 120px; border-radius: 4px; border: 1px solid var(--line); }


/* ---- member profile: rank card, points, medal rack, service book ---------- */
.rank-card { text-align: center; padding: 14px; }
.rank-card-name { margin-top: 8px; font-family: var(--font-display); font-size: 1.35rem; font-weight: 700; }
.rank-since { margin-top: 2px; font-size: .85rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.points-card { background: var(--black-2); color: #efe8d6; border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.points-big { text-align: center; border-bottom: 1px solid rgba(255,255,255,.12); padding-bottom: 10px; margin-bottom: 8px; }
.points-big b { display: block; font-family: var(--font-display); font-size: 3rem; line-height: 1; color: var(--gold-2); font-variant-numeric: lining-nums; }
.points-big span { font-size: .78rem; text-transform: uppercase; letter-spacing: .14em; color: #cfc6ae; }
.points-row { display: flex; justify-content: space-between; font-size: .9rem; padding: 3px 0; color: #d8d0bb; }
.points-row b { color: #fff; }
.medal-rack { text-align: center; padding: 14px 16px; }
.rack-row { display: flex; flex-wrap: wrap; justify-content: center; align-items: flex-end; gap: 6px; margin-bottom: 8px; }
.rack-item { display: inline-flex; align-items: flex-end; justify-content: center; height: 96px; width: 68px; background: var(--paper-2); border: 1px solid var(--line); border-radius: 4px; padding: 4px; transition: transform .15s; }
.rack-item img { max-height: 88px; max-width: 60px; object-fit: contain; }
.rack-item:hover { transform: translateY(-3px); text-decoration: none; }
.rack-item.sm { height: 60px; width: 60px; align-items: center; }
.rack-item.sm img { max-height: 52px; max-width: 52px; }
.rack-item .no-img { color: var(--gold); font-size: 1.6rem; align-self: center; }
.rack-row.badges { border-top: 1px dashed var(--line); padding-top: 8px; }
.medal-strip { display: flex; gap: 3px; margin-top: 8px; flex-wrap: wrap; }
.medal-strip img { height: 30px; width: auto; max-width: 26px; object-fit: contain; }
.chip { display: inline-flex; align-items: center; gap: 4px; font-size: .85rem; background: var(--paper-2); border: 1px solid var(--line); border-radius: 14px; padding: 1px 8px 1px 3px; margin: 1px 2px 1px 0; color: var(--ink); white-space: nowrap; max-width: 100%; }
.chip img { height: 22px; width: 22px; object-fit: contain; border-radius: 50%; background: #fff; }
.chip span { overflow: hidden; text-overflow: ellipsis; }
.chip:hover { text-decoration: none; border-color: var(--gold); }
details.casette { padding: 0; overflow: hidden; }
details.casette > summary { list-style: none; cursor: pointer; padding: 14px 22px; background: var(--paper-2); border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 10px; }
details.casette > summary::-webkit-details-marker { display: none; }
details.casette > summary::before { content: "▸"; color: var(--gold); font-size: 1.1rem; transition: transform .15s; }
details.casette[open] > summary::before { transform: rotate(90deg); }
details.casette > summary h2 { margin: 0; font-size: 1.4rem; }
details.casette > :not(summary) { margin: 0; }
details.casette > .table-wrap, details.casette > .empty, details.casette > ul, details.casette > .grid, details.casette > .sheet-grid, details.casette > p { padding: 16px 22px; }
details.casette > .empty { border: 0; }
details.casette > .table-wrap { padding: 0; }
details.casette .table { font-size: .92rem; }
.events-sheet td, .events-sheet th { padding: 8px 10px; }
.events-sheet tfoot td { background: var(--paper-2); }
.sheet-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 18px; }
.sheet-group h4 { border-bottom: 1px solid var(--line); padding-bottom: 4px; margin-bottom: 8px; }
.sheet-group .kv { grid-template-columns: minmax(120px, max-content) 1fr; gap: 4px 12px; font-size: .92rem; }
.sheet-group .table td, .sheet-group .table th { padding: 6px 8px; }

/* ---- forum --------------------------------------------------------------- */
.board { display: grid; grid-template-columns: 1fr auto; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--line); align-items: center; }
.board:last-child { border-bottom: 0; }
.board-name { font-family: var(--font-display); font-size: 1.4rem; font-weight: 700; }
.board-stats { text-align: right; font-size: .85rem; color: var(--muted); min-width: 160px; }
.topic-row { display: grid; grid-template-columns: 1fr auto auto; gap: 14px; padding: 10px 0; border-bottom: 1px solid var(--line); align-items: center; }
.topic-row:last-child { border-bottom: 0; }
.topic-title { font-weight: 700; font-size: 1.05rem; }
.topic-title.unread::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--green); margin-right: 6px; vertical-align: middle; }
.topic-meta { font-size: .85rem; color: var(--muted); }
.topic-last { font-size: .85rem; color: var(--muted); text-align: right; min-width: 150px; }
.post { display: grid; grid-template-columns: 150px 1fr; gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.post:last-child { border-bottom: 0; }
.post-author { font-size: .9rem; }
.post-author .avatar { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; background: var(--paper-2); display: block; margin-bottom: 6px; }
.post-author .avatar.ph { display: flex; align-items: center; justify-content: center; font-family: var(--font-display); color: var(--muted); font-size: 1.3rem; }
.post-author b { display: block; }
.post-body { min-width: 0; }
.post-body .prose { max-width: none; font-size: 1rem; }
.post-head { display: flex; justify-content: space-between; gap: 10px; font-size: .82rem; color: var(--muted); margin-bottom: 6px; }
.post-head .btn-row { gap: 6px; }
.bb-toolbar button { font-family: inherit; }

/* ---- polls --------------------------------------------------------------- */
.poll-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.poll-q { font-family: var(--font-display); font-size: 1.45rem; font-weight: 700; line-height: 1.2; }
.poll-option { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 6px; background: var(--card); cursor: pointer; }
.poll-option:hover { border-color: var(--gold); }
.poll-option > span:first-of-type { flex: 1; }
.poll-count { font-size: .82rem; color: var(--muted); }
.poll-result { margin-bottom: 10px; }
.poll-bar { height: 22px; background: var(--paper-2); border-radius: 4px; overflow: hidden; border: 1px solid var(--line); }
.poll-bar span { display: block; height: 100%; background: var(--green); min-width: 2px; transition: width .3s; }
.poll-result-label { display: flex; justify-content: space-between; font-size: .92rem; margin-bottom: 2px; gap: 10px; }
.poll-result.mine .poll-bar span { background: var(--gold); }
.poll-names { margin-top: 2px; }

/* ---- newsletter / attendance / misc ------------------------------------- */
.news-layout { display: grid; grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr); gap: 24px; align-items: start; }
.subscribe-box { border-top: 4px solid var(--gold); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.att-table tr.present td { background: #eef7ee; }
.att-table input[type=text] { min-width: 120px; }
.perm-menu .lang-list label { display: flex; gap: 6px; align-items: flex-start; white-space: normal; }
.events-sheet input[type=text], .events-sheet input[type=number], .events-sheet select { font-size: .85rem; padding: 4px 6px; }
.events-sheet .chip form { margin-left: 2px; }
.events-sheet .chip .btn.tiny { padding: 0 5px; line-height: 1.3; }
@media (max-width: 900px) { .news-layout { grid-template-columns: 1fr; } }

@media (max-width: 900px) {
  .post { grid-template-columns: 1fr; }
  .post-author { display: flex; gap: 10px; align-items: center; }
  .post-author .avatar { margin: 0; }
  .topic-row { grid-template-columns: 1fr; }
  .topic-last { text-align: left; }
}

/* ---- Google Translate widget mode ---------------------------------------- */
.gt-hidden { display: none; }
body.gt-widget { top: 0 !important; }
.goog-te-banner-frame, .skiptranslate, #goog-gt-tt, .goog-te-balloon-frame { display: none !important; }
.goog-text-highlight { background: none !important; box-shadow: none !important; }
font { font-family: inherit !important; }

/* ---- responsive ------------------------------------------------------------ */
@media (max-width: 980px) {
  .two-col, .profile-head, .award-detail { grid-template-columns: 1fr; }
  .admin-layout { grid-template-columns: 1fr; }
  .admin-nav { position: static; display: flex; flex-wrap: wrap; gap: 2px; }
  .admin-nav .sep { display: none; }
}
@media (max-width: 900px) {
  .nav-toggle { display: flex; }
  .main-nav { display: none; }
  .main-nav.open { display: block; }
  .nav-in { flex-direction: column; align-items: stretch; }
  .main-nav a { border-bottom: 1px solid rgba(255,255,255,.06); border-left: 3px solid transparent; }
  .main-nav a.active { border-left-color: var(--gold); border-bottom-color: rgba(255,255,255,.06); }
  .main-nav a.nav-admin { margin-left: 0; }
  .main-nav .menu { position: static; }
  .main-nav .menu-btn { width: 100%; justify-content: space-between; border-bottom: 1px solid rgba(255,255,255,.06); border-left: 3px solid transparent; }
  .main-nav .menu-btn.active { border-left-color: var(--gold); border-bottom-color: rgba(255,255,255,.06); }
  .main-nav .menu:hover .menu-list { display: none; }
  .main-nav .menu.open .menu-list { display: block; }
  .main-nav .menu-list { position: static; min-width: 0; padding: 0; border: 0; border-radius: 0; box-shadow: none; background: rgba(0,0,0,.25); }
  .main-nav .menu-list a { padding-left: 28px; border-radius: 0; }
  .brand-sub { display: none; }
  .hero { grid-template-columns: 1fr; padding: 36px 24px; text-align: center; }
  .hero-logo { height: 130px; margin: 0 auto; }
  .hero h1 { font-size: 2.3rem; }
  .hero .hero-sub { margin: 0 auto; }
  .btn-row.hero-actions { justify-content: center; }
  .rank-row { grid-template-columns: 1fr; }
  .rank-insignia { max-width: 320px; }
  .post-card.with-img { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .md-columns, .md-columns.cols-3, .md-reader { grid-template-columns: 1fr; }
  .md-reader-frame { position: static; } .md-reader-frame iframe { height: 60vh; }
  .prose.wide { padding: 20px 18px; }
}
@media (max-width: 600px) {
  .md-timeline li { grid-template-columns: 4.6em minmax(0, 1fr); gap: 12px; } .md-timeline li::before { left: calc(4.6em - 1px); } .md-timeline .year { font-size: 1rem; padding-right: 16px; }
  .md-facts div { grid-template-columns: 1fr; gap: 2px; }
  .md-box .md-img.right, .md-box .md-img.left { width: 100%; float: none; margin: 0 0 1em; }
  .md-img.right, .md-img.left { float: none; width: 100%; margin-left: 0; margin-right: 0; }
  .md-gallery, .md-gallery.cols-3, .md-gallery.cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .md-gallery.portraits > .md-img { flex-basis: calc((100% - 12px) / 2); }
  .md-gallery.portraits.small > .md-img { flex-basis: calc((100% - 24px) / 3); }
  .pager { grid-template-columns: 1fr; } .pager-next { text-align: left; }
  body { font-size: 16px; }
  h1 { font-size: 2.1rem; } h2 { font-size: 1.6rem; }
  .site-logo { height: 48px; max-width: 150px; }
  .brand-name { font-size: 1.15rem; white-space: normal; }
  .photo-grid { grid-template-columns: repeat(2, 1fr); }
  .hero h1 { font-size: 1.9rem; }
  .header-top { padding: 10px 0; }
  .card { padding: 16px; }
  .lib-item { grid-template-columns: 40px 1fr; }
  .lib-item .btn { grid-column: 2; justify-self: start; }
  .kv { grid-template-columns: 1fr; gap: 2px; }
  .kv dt { margin-top: 8px; }
}
@media print {
  .site-header, .site-footer, .btn, .nav-toggle, .lang-menu { display: none !important; }
  body { background: #fff; }
  .card { box-shadow: none; }
}

/* the call to the enrolment form on the "how to join" page */
.join-cta { display: flex; flex-wrap: wrap; gap: 14px 24px; align-items: center; justify-content: space-between; border-left: 4px solid var(--green); margin-bottom: 18px; }
.join-cta h3 { margin: 0 0 4px; }

/* date fields written dd/mm/yyyy (assets/js/app.js): the text field, the calendar button, the browser's field hidden behind */
.dmy { position: relative; display: flex; align-items: stretch; gap: 6px; width: 100%; }
.dmy .dmy-text { flex: 1 1 auto; min-width: 0; font-variant-numeric: tabular-nums; }
.dmy .dmy-native { position: absolute; left: 0; bottom: 0; width: 1px !important; height: 1px !important; min-width: 0 !important; padding: 0 !important; border: 0 !important; opacity: 0; pointer-events: none; }
.dmy-btn { flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; width: 42px; padding: 0; border: 1px solid var(--line-2); border-radius: var(--radius); background: var(--card); color: var(--ink-2); cursor: pointer; }
.dmy-btn:hover { background: var(--paper-2); }
.dmy-btn:focus-visible { outline: 2px solid var(--gold); outline-offset: 1px; }
.inline-form .dmy, td .dmy { width: auto; }
.inline-form .dmy .dmy-text, td .dmy .dmy-text { width: 9.5em; min-width: 0; }
.dmy.dmy-sheet { display: block; height: 100%; }
.dmy.dmy-sheet .dmy-text { width: 100%; height: 100%; }

/* test data (Admin → Test data) */
.badge.test { background: #e6eefc; color: #1f3a75; border-color: #b9c9ec; }
.td-lead { max-width: 78ch; color: var(--ink-2); }
.td-now-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 12px 24px; }
.td-now h3 { margin: 0 0 2px; }
.td-counts { list-style: none; margin: 14px 0 12px; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; }
.td-counts li { display: flex; flex-direction: column; padding: 8px 12px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); }
.td-counts b { font-family: var(--font-display); font-size: 1.6rem; line-height: 1.1; font-variant-numeric: lining-nums; }
.td-counts span { font-size: .85rem; color: var(--muted); }
.td-form h3 { margin-top: 0; }
.td-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 0 18px; }
.td-plan { margin: 0 0 14px; padding: 10px 14px; background: var(--paper-2); border-left: 3px solid var(--green); border-radius: 4px; font-weight: 600; }
.td-what { border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px 12px; margin: 0 0 16px; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: 6px 18px; }
.td-what legend { padding: 0 6px; font-weight: 700; font-size: .9rem; }

/* page links of long lists */
.pages { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px; margin: 16px 0; }
.pages .gap { color: var(--muted); padding: 0 2px; }
.pages .small.muted { margin-left: 10px; }
/* the filters above long lists */
.list-filters { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: flex-end; margin: 0 0 14px; }
.list-filters > * { margin: 0; }
.list-filters input[type=search] { width: auto; flex: 0 1 300px; min-width: 200px; }
.list-filters select { width: auto; flex: 0 1 auto; max-width: 340px; }

/* the members: by rank or by unit (members.php) */
.view-switch { display: inline-flex; border: 1px solid var(--line-2); border-radius: 999px; overflow: hidden; background: var(--card); }
.view-switch a { padding: 6px 18px; font-weight: 600; color: var(--ink-2); }
.view-switch a:hover { text-decoration: none; background: var(--paper-2); }
.view-switch a.active { background: var(--black-2); color: #f1ead8; }
.unit-tree { display: grid; gap: 10px; }
.unit-node { border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); }
.unit-node .unit-node { background: var(--paper); }
.unit-node .unit-node .unit-node { background: var(--card); }
.unit-node > summary { cursor: pointer; padding: 10px 14px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; list-style: none; }
.unit-node > summary::-webkit-details-marker { display: none; }
.unit-node > summary::before { content: "▸"; color: var(--gold); display: inline-block; transition: transform .15s; }
.unit-node[open] > summary::before { transform: rotate(90deg); }
.unit-node > summary:focus-visible { outline: 2px solid var(--gold); outline-offset: -2px; }
.unit-name { font-family: var(--font-display); font-weight: 700; font-size: 1.3rem; line-height: 1.2; }
.unit-node.lvl1 .unit-name { font-size: 1.15rem; }
.unit-node.lvl2 .unit-name, .unit-node.lvl3 .unit-name { font-size: 1.05rem; }
.unit-n { font-size: .78rem; font-weight: 700; background: var(--paper-2); border: 1px solid var(--line); border-radius: 999px; padding: 0 8px; font-variant-numeric: tabular-nums; }
.unit-lead { font-size: .88rem; color: var(--muted); margin-left: auto; }
.unit-body { padding: 0 14px 12px 30px; display: grid; gap: 8px; }
.unit-people { list-style: none; margin: 0; padding: 0; columns: 3 250px; column-gap: 28px; }
.unit-people li { break-inside: avoid; padding: 3px 0; font-size: .95rem; line-height: 1.3; }
.unit-people a { display: inline-flex; align-items: center; gap: 6px; color: var(--ink); }
.unit-people .badge { font-size: .62rem; padding: 0 6px; }
.insignia.xs { height: 16px; width: auto; vertical-align: middle; }
@media (max-width: 600px) { .unit-body { padding-left: 12px; } .unit-lead { margin-left: 0; flex-basis: 100%; } }

/* ---- the history of the regiment is missing (admin dashboard) ---- */
.history-gone { border-left: 4px solid var(--gold); margin-bottom: 18px; }
.history-gone h3 { margin-top: 0; }
.history-gone .btn-row form { margin: 0; }
/* Admin → Encryption, and its alerts */
.crypto-alert { border-left: 4px solid var(--gold); margin-bottom: 18px; }
.crypto-alert.bad, .crypto-off { border-left: 4px solid var(--red); }
.crypto-alert h3, .crypto-off h2 { margin-top: 0; }
.crypto-state { font-weight: 700; font-size: 1.1rem; margin: 0 0 10px; }
.crypto-state.done { color: var(--green-dark); }
.crypto-state.busy { color: #6b5210; }
.crypto-state.busy::before { content: ""; display: inline-block; width: .7em; height: .7em; margin-right: .45em; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; vertical-align: -.05em; animation: crypto-spin 1.1s linear infinite; }
@keyframes crypto-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .crypto-state.busy::before { animation: none; } }
.crypto-test { list-style: none; padding: 0; margin: 12px 0 0; font-size: .95rem; }
.crypto-test li { padding: 5px 0 5px 26px; position: relative; border-top: 1px solid var(--line); }
.crypto-test li > span { position: absolute; left: 4px; top: 5px; font-weight: 700; }
.crypto-test li.ok > span { color: var(--green); }
.crypto-test li.warn > span { color: var(--gold); }
.crypto-test li.bad { color: var(--red); } .crypto-test li.bad > span { color: var(--red); }
.crypto-test code { word-break: break-all; }
.crypto-note { background: var(--green-soft); border-radius: var(--radius); padding: 8px 12px; }
.warn-text { color: #6b5210; font-weight: 600; }

/* ---- event page: the internal details, for those with an account ---- */
.event-internal { border-left: 4px solid var(--green); }
.event-internal-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 16px; margin-bottom: 10px; }
.event-internal-head h2 { margin: 0; font-size: 1.35rem; }
.event-internal-head .small { color: var(--green-dark); }
.event-internal-hint { margin: 14px 0 0; }
.ev-texts { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
@media (max-width: 900px) { .ev-texts { grid-template-columns: 1fr; } }

/* ---- Admin → Ranks: the classes, each with its ranks ---- */
.rank-class-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 8px 18px; margin-bottom: 10px; }
.rank-class-head h3 { margin: 0 0 2px; }
.rank-class-head .btn-row { margin: 0; }
.rank-class-head form { margin: 0; }
.rank-class-order { font-family: var(--font-body); font-size: .9rem; font-weight: 600; }
.rank-class .table-wrap { margin-top: 4px; }
.rank-class-none { border-left: 4px solid var(--gold); }
.rank-class-desc { margin: -4px 0 12px; max-width: 70ch; }

/* ---- logistics: the sections that fold, the photo place of each piece, the kit of an event, the loans ---- */
.kit-pick[hidden], .loan-new [hidden] { display: none !important; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.logi-tabs { padding: 12px 16px; }
.logi-tabs .subtabs { margin: 0; }
details.casette > summary .casette-meta { margin-left: auto; font-size: .9rem; color: var(--muted); text-align: right; }
details.casette > summary .casette-meta b { color: var(--ink); }
details.casette > .casette-body { padding: 18px 22px 22px; }
details.casette > .pages { padding: 0 22px 16px; margin-top: 14px; }
.logi-sec > summary h2 { font-size: 1.6rem; }
/* the photo of a piece, or its empty place */
.eq-photo { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; width: 96px; height: 96px; flex: 0 0 auto; overflow: hidden;
  border: 1px solid var(--line); border-radius: 4px; background: #fff; color: var(--line-2); margin: 0; font-weight: 400; }
.eq-photo img { width: 100%; height: 100%; object-fit: contain; }
.eq-photo svg { width: 42%; height: auto; }
.eq-photo.sm { width: 52px; height: 52px; }
.eq-photo.xs { width: 34px; height: 34px; border-radius: 3px; }
.eq-photo.sm svg, .eq-photo.xs svg { width: 60%; }
.eq-photo.nophoto { background: var(--paper-2); border-style: dashed; border-color: var(--line-2); }
.eq-photo.md.nophoto span { font-size: .72rem; line-height: 1.15; color: var(--muted); text-align: center; padding: 0 6px; }
.eq-photo.add { cursor: pointer; color: var(--gold); border-color: var(--gold); transition: background .15s; }
.eq-photo.add span { color: var(--green-dark); font-weight: 700; }
.eq-photo.add:hover, .eq-photo.add:focus-within { background: var(--gold-soft); }
.eq-photo.add:focus-within { outline: 2px solid var(--gold-2); outline-offset: 1px; }
.eq-photo-form { margin: 0; }
.eq-photo-form.busy .eq-photo { opacity: .55; cursor: progress; }
a.eq-photo:hover { border-color: var(--gold); }
.eq-cell-ph { width: 46px; padding-right: 0 !important; }
.eq-basic { color: var(--green-dark); font-weight: 600; }
.eq-nophoto { color: #8a6a12; }
/* the catalogue: a category per fold */
.eq-tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin-bottom: 4px; }
.eq-tools .btn-row { gap: 6px; }
.eq-cat { border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); margin-top: 10px; }
.eq-cat > summary { list-style: none; cursor: pointer; display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 12px; padding: 11px 16px; border-radius: var(--radius); }
.eq-cat > summary::-webkit-details-marker { display: none; }
.eq-cat > summary::before { content: "▸"; color: var(--gold); display: inline-block; transition: transform .15s; }
.eq-cat[open] > summary::before { transform: rotate(90deg); }
.eq-cat > summary:hover { background: var(--paper); }
.eq-cat[open] > summary { border-bottom: 1px solid var(--line); border-radius: var(--radius) var(--radius) 0 0; background: var(--paper); }
.eq-cat-name { font-family: var(--font-display); font-size: 1.35rem; font-weight: 600; line-height: 1.2; }
.eq-cat-meta { margin-left: auto; font-size: .88rem; color: var(--muted); }
.eq-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 310px), 1fr)); gap: 12px; padding: 14px 16px 16px; }
.eq-item { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 14px; align-items: start; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); scroll-margin-top: 90px; }
.eq-item.owned { border-left: 3px solid var(--green); padding-left: 10px; }
.eq-item:target { outline: 2px solid var(--gold-2); outline-offset: 2px; }
.eq-name { font-family: var(--font-body); font-size: 1.02rem; font-weight: 700; line-height: 1.3; margin: 0 0 3px; letter-spacing: 0; }
.eq-edit { font-weight: 400; color: var(--muted); font-size: .9em; }
.eq-tags { color: var(--ink-2); margin-bottom: 2px; }
.eq-spec { line-height: 1.4; }
.eq-desc { margin-top: 6px; }
.eq-desc p { margin: 0 0 .4em; }
.eq-owned { color: var(--green-dark); font-weight: 600; margin-top: 5px; }
.eq-add h3 { font-size: 1.25rem; }
.loans-callout { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 22px; border-left: 4px solid var(--gold); padding: 16px 22px; }
.loans-callout h3 { margin: 0 0 2px; font-size: 1.3rem; }
@media (max-width: 600px) {
  .eq-item { grid-template-columns: 72px minmax(0, 1fr); gap: 12px; }
  .eq-item .eq-photo.md { width: 72px; height: 72px; }
  .eq-photo.md.nophoto span { display: none; }
  .eq-cat-meta { margin-left: 0; flex-basis: 100%; }
  details.casette > summary { flex-wrap: wrap; }
  details.casette > summary .casette-meta { margin-left: 0; flex-basis: 100%; text-align: left; }
  details.casette > .casette-body { padding: 14px 14px 18px; }
  .eq-grid { padding: 12px; }
}
/* the kit of an event */
.kit-card { border-left: 4px solid var(--gold); }
.kit-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 16px; margin-bottom: 12px; }
.kit-head h2 { margin: 0; font-size: 1.45rem; }
.kit-head .small { color: var(--muted); }
.kit-table td { vertical-align: middle; }
.kit-table .kit-ph { width: 48px; padding-right: 0; }
.kit-table td, .kit-table th { padding-top: 7px; padding-bottom: 7px; }
.kit-layout.with-answer { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 26px; align-items: start; }
.kit-layout.with-answer .kit-answer { margin-top: 0; padding-top: 0; border-top: 0; position: sticky; top: 14px; }
@media (max-width: 900px) {
  .kit-layout.with-answer { grid-template-columns: minmax(0, 1fr); }
  .kit-layout.with-answer .kit-answer { order: -1; position: static; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
}
.kit-table tr.kit-lack td:first-child { box-shadow: inset 3px 0 0 var(--red); }
.kit-table tr.kit-surplus td:first-child { box-shadow: inset 3px 0 0 var(--gold); }
.kit-tag { display: inline-block; font-size: .84rem; font-weight: 700; padding: 1px 9px; border-radius: 12px; border: 1px solid; white-space: nowrap; }
.kit-tag.ok { color: var(--green-dark); background: var(--green-soft); border-color: #b8dcb4; }
.kit-tag.lack { color: var(--red); background: var(--red-soft); border-color: #e5b7bb; }
.kit-tag.surplus { color: #7a5e12; background: var(--gold-soft); border-color: #e2cf8f; }
.kit-answer { display: grid; gap: 14px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.kit-answer h3 { margin: 0; font-size: 1.25rem; }
.kit-q { margin: 0; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); }
.kit-q.offer { border-left: 4px solid var(--gold); }
.kit-q.need { border-left: 4px solid var(--red); }
.kit-q > p { margin: 0 0 4px; }
.kit-yn { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 2px; }
.kit-yn label { display: inline-flex; align-items: center; gap: 6px; margin: 0; padding: 6px 15px 6px 11px; border: 1px solid var(--line-2); border-radius: 20px; background: var(--card); font-weight: 600; cursor: pointer; }
.kit-yn label:hover { border-color: var(--gold); }
.kit-yn label:has(input:checked) { background: var(--black-2); border-color: var(--black); color: #fff; }
.kit-yn label:has(input:focus-visible) { outline: 2px solid var(--gold-2); outline-offset: 1px; }
.kit-yn input { margin: 0; transform: none; accent-color: var(--gold); }
.kit-pick { display: grid; gap: 4px; margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line-2); }
.kit-pick-row { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin: 0; padding: 3px 0; font-weight: 500; }
.kit-pick-row input[type=checkbox] { margin: 0; }
.kit-pick-name { flex: 1 1 9em; min-width: 0; line-height: 1.3; }
.kit-pick-qty { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; margin-left: auto; }
.kit-pick-row select { width: auto; min-width: 62px; padding: 4px 8px; }
.kit-pick-row .muted { font-size: .85rem; }
.kit-table th { white-space: nowrap; }
.kit-pick input[type=text] { margin-top: 6px; }
.kit-allset { margin: 0; color: var(--green-dark); font-weight: 600; }
.kit-answered { color: var(--muted); }
/* the loans: offers and requests side by side */
.loan-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
.loan-col > h3 { display: flex; align-items: baseline; gap: 8px; font-size: 1.3rem; margin: 0 0 10px; padding-bottom: 5px; border-bottom: 2px solid var(--gold); }
.loan-col.requests > h3 { border-bottom-color: var(--red); }
.loan-col > h3 .muted { font-family: var(--font-body); font-size: .85rem; font-weight: 600; }
.loan-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.loan { display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; gap: 12px; align-items: start; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); scroll-margin-top: 90px; }
.loan-mine { border-left: 3px solid var(--green); padding-left: 10px; }
.loan-agreed { background: #fbf6e6; }
.loan-done { background: var(--paper); }
.loan-done .loan-body { opacity: .8; }
.loan:target { outline: 2px solid var(--gold-2); outline-offset: 2px; }
.loan-match { border-color: #e2cf8f; box-shadow: inset 3px 0 0 var(--gold); }
.loan-for-you { display: inline-block; font-size: .78rem; font-weight: 700; color: #7a5e12; background: var(--gold-soft); border: 1px solid #e2cf8f; border-radius: 10px; padding: 0 7px; vertical-align: 1px; }
.loan-what { line-height: 1.3; }
.loan-qty { font-weight: 700; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.loan-meta { color: var(--ink-2); margin-top: 2px; }
.loan-note { margin-top: 4px; padding-left: 8px; border-left: 2px solid var(--line-2); color: var(--ink-2); }
.loan-deal { margin-top: 5px; }
.loan-acts { display: flex; flex-direction: column; align-items: stretch; gap: 6px; }
.loan-acts form { display: flex; gap: 4px; margin: 0; }
.loan-acts .btn { white-space: nowrap; flex: 1 1 auto; }
.loan-qty-sel { width: auto; padding: 3px 6px; font-size: .85rem; }
.loan-empty { padding: 14px; font-size: .95rem; }
.loan-new .loan-kind { display: inline-flex; border: 1px solid var(--line-2); border-radius: 22px; overflow: hidden; margin-bottom: 14px; }
.loan-new .loan-kind label { margin: 0; padding: 8px 18px; cursor: pointer; font-weight: 700; background: var(--card); display: flex; align-items: center; gap: 6px; }
.loan-new .loan-kind label + label { border-left: 1px solid var(--line-2); }
.loan-new .loan-kind label:has(input:checked) { background: var(--black-2); color: #fff; }
.loan-new .loan-kind input { margin: 0; accent-color: var(--gold); }
.loan-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.loan-filters .subtabs { margin: 0; }
.loan-filters select { width: auto; max-width: 100%; }
.loan-filters .check { margin: 0; }
@media (max-width: 800px) { .loan-cols { grid-template-columns: 1fr; } }
@media (max-width: 520px) {
  .loan { grid-template-columns: 52px minmax(0, 1fr); }
  .loan-acts { grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap; }
}
/* Admin → event → Kit */
.kit-add-cats { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: 10px; margin: 10px 0 14px; }
.kit-add-cats details { border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); padding: 0; }
.kit-add-cats summary { cursor: pointer; padding: 8px 12px; font-weight: 700; }
.kit-add-cats .chk-list { display: grid; gap: 2px; padding: 0 12px 10px; }
.kit-add-cats .chk-list label { font-weight: 500; margin: 0; display: flex; gap: 6px; align-items: flex-start; }
.kit-add-cats .chk-list input { margin-top: 4px; }

/* ============================================================================
   Line icons, the page of a piece of equipment, rows of photos
   ========================================================================== */
.ico { width: 1.15em; height: 1.15em; flex: 0 0 auto; vertical-align: -.2em; }
.eq-photo .ico { width: 46%; height: auto; color: var(--line-2); }
.eq-photo.add .ico { color: var(--gold); }
.eq-nph { display: inline-flex; align-items: center; gap: 2px; font-weight: 400; font-size: .8rem; color: var(--muted); }
.eq-nph .ico { width: 1em; height: 1em; }
.eq-name a { color: inherit; }
.eq-stock { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 12px; color: var(--ink-2); margin-bottom: 2px; }
.crumbs { margin: 18px 0 6px; color: var(--muted); }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--green-dark); }
.item-page { margin-bottom: 40px; }
.item-head { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 22px; align-items: start; margin: 4px 0 18px; }
.item-picto { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.eq-photo.lg { width: 132px; height: 132px; border-radius: 6px; }
.eq-photo.lg .ico { width: 52%; }
.picto-change { margin: 0; }
.picto-change .btn { cursor: pointer; }
.item-title h1 { margin: 0 0 10px; font-size: 2.4rem; }
.item-icons { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 8px; }
.item-icons li { display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px 4px 9px; border: 1px solid var(--line); border-radius: 999px; background: var(--card); font-size: .9rem; color: var(--ink-2); }
.item-icons li .ico { color: var(--gold); }
.item-icons li.on { border-color: #b8dcb4; background: var(--green-soft); color: var(--green-dark); }
.item-icons li.on .ico { color: var(--green-dark); }
.item-icons li.era-hechtgrau .ico { color: #7d8f9e; }
.item-icons li.era-feldgrau .ico { color: #6f7660; }
.item-spec { margin: 10px 0 0; color: var(--ink-2); }
.item-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(250px, 320px); gap: 28px; margin-top: 22px; align-items: start; }
.item-side { display: grid; gap: 16px; }
.item-side > * { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.item-facts { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 6px 14px; margin: 0; font-size: .95rem; }
.item-facts dt { color: var(--muted); }
.item-facts dd { margin: 0; }
.h-small { font-family: var(--font-body); font-size: 1rem; font-weight: 700; letter-spacing: 0; text-transform: none; color: var(--ink); margin: 0 0 6px; }
ul.plain { list-style: none; margin: 0; padding: 0; }
ul.plain li { margin: 4px 0; }
.item-events .ico { color: var(--gold); }
.item-pager { margin-top: 28px; }

/* a row of photos: under the name of a thing, scrolled sideways; a click opens the lightbox */
.photo-strip { position: relative; background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.ps-row { display: flex; gap: 14px; overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: thin; padding-bottom: 4px; }
.ps-item { flex: 0 0 auto; display: flex; flex-direction: column; width: min-content; margin: 0; scroll-snap-align: start; }
.ps-item > a { display: block; line-height: 0; border-radius: 4px; overflow: hidden; background: #fff; box-shadow: 0 1px 2px rgba(20,18,16,.12); }
.ps-item img { height: 230px; width: auto; max-width: min(78vw, 420px); min-width: 120px; object-fit: contain; display: block; }
.ps-item > a:hover img, .ps-item > a:focus-visible img { opacity: .92; }
.ps-item figcaption { font-size: .86rem; color: var(--ink-2); margin-top: 6px; line-height: 1.35; }
.ps-tools { display: flex; gap: 4px; margin-top: 6px; }
.ps-tools form { margin: 0; }
.ps-btn { min-width: 30px; height: 28px; padding: 0 6px; border: 1px solid var(--line-2); border-radius: 4px; background: var(--card); color: var(--ink-2); cursor: pointer; font-size: .85rem; }
.ps-btn:hover { border-color: var(--gold); background: var(--gold-soft); }
.ps-cap { margin-top: 4px; font-size: .82rem; }
.ps-cap summary { cursor: pointer; color: var(--green-dark); }
.ps-cap form { display: flex; gap: 4px; margin: 4px 0 0; }
.ps-cap input { min-width: 0; flex: 1; padding: 4px 6px; font-size: .85rem; }
.ps-add { margin: 0; position: relative; }
.ps-add label { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; width: 170px; height: 230px; border: 2px dashed var(--gold); border-radius: 4px;
  color: var(--green-dark); background: rgba(255,255,255,.55); cursor: pointer; text-align: center; padding: 10px; }
.ps-add label .ico { width: 34px; height: 34px; color: var(--gold); }
.ps-add label span { font-weight: 700; }
.ps-add label small { color: var(--muted); }
.ps-add label:hover, .ps-add label:focus-within { background: var(--gold-soft); }
.ps-add.busy label { opacity: .6; cursor: progress; }
.ps-empty { display: flex; align-items: center; gap: 8px; margin: 0; padding: 18px 6px; color: var(--muted); }
.ps-nav { position: absolute; top: 50%; transform: translateY(-50%); z-index: 2; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line-2);
  background: var(--card); color: var(--ink); font-size: 1.6rem; line-height: 1; cursor: pointer; box-shadow: var(--shadow); }
.ps-nav.prev { left: 6px; } .ps-nav.next { right: 6px; }
.ps-nav[hidden] { display: none; }
.ps-help { margin: 8px 2px 0; }
/* the vitrine: the dark row of the museum */
.photo-strip.vitrine { background: #24211c; border-color: #24211c; padding: 18px; box-shadow: inset 0 0 40px rgba(0,0,0,.45); }
.photo-strip.vitrine .ps-item > a { background: #2f2b25; box-shadow: none; }
.photo-strip.vitrine figcaption { color: #e6dfcf; }
.photo-strip.vitrine .ps-empty { color: #c9c0ad; }
.photo-strip.vitrine .ps-add label { background: rgba(255,255,255,.06); color: #f0e6c8; }
.photo-strip.vitrine .ps-cap summary { color: var(--gold-2); }
@media (max-width: 760px) {
  .item-body { grid-template-columns: 1fr; }
  .item-title h1 { font-size: 1.9rem; }
}
@media (max-width: 600px) {
  .item-head { grid-template-columns: 1fr; gap: 12px; }
  .item-picto { flex-direction: row; justify-content: flex-start; }
  .eq-photo.lg { width: 96px; height: 96px; }
  .ps-item img { height: 180px; }
  .ps-add label { height: 180px; width: 140px; }
  .photo-strip { padding: 10px; }
}

/* ============================================================================
   A member's own objects: their photos in the lists, on the profile, at the loans
   ========================================================================== */
.gear-thumbs { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px; margin-top: 4px; vertical-align: middle; }
.gear-thumbs a { display: block; line-height: 0; border-radius: 3px; overflow: hidden; border: 1px solid var(--line); background: #fff; }
.gear-thumbs img { width: 44px; height: 44px; object-fit: cover; display: block; }
.gear-thumbs a:hover, .gear-thumbs a:focus-visible { border-color: var(--gold); }
.gear-more { font-size: .8rem; color: var(--muted); padding: 0 4px; }
.gear-link { color: inherit; font-weight: 600; }
.gear-link:hover { color: var(--green-dark); }
.gear-nph { display: inline-flex; align-items: center; gap: 3px; color: var(--muted); }
.gear-nph.short { color: var(--red); font-weight: 700; }
.gear-notice { display: flex; align-items: flex-start; gap: 8px; margin-bottom: 14px; }
.gear-notice .ico { color: #8a6a12; margin-top: 3px; }
.gear-owner { margin: 0 0 4px; color: var(--muted); display: flex; align-items: center; gap: 5px; }
.gear-owner .ico { color: var(--gold); }
.item-icons li.warn { border-color: #e5b7bb; background: var(--red-soft); color: var(--red); }
.item-icons li.warn .ico { color: var(--red); }
.item-icons li.gear-cond-repair, .item-icons li.gear-cond-missing { border-color: #e2cf8f; background: var(--gold-soft); }
.gear-edit summary { cursor: pointer; font-weight: 700; }
.gear-cat p a { font-weight: 600; }
.loan-gear { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 4px; }
.loan-gear .gear-thumbs { margin-top: 0; }
.gear-theirs { margin-top: 26px; }
.gear-cards { list-style: none; margin: 8px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 150px), 1fr)); gap: 12px; }
.gear-cards a { display: flex; flex-direction: column; color: inherit; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.gear-cards a:hover { text-decoration: none; border-color: var(--line-2); }
.gear-cards a:hover .gear-card-who { color: var(--green-dark); text-decoration: underline; }
.gear-card-ph { display: block; aspect-ratio: 4 / 3; background: var(--paper-2); }
.gear-card-ph img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gear-card-who { padding: 8px 10px 0; font-weight: 600; font-size: .92rem; }
.gear-card-meta { display: flex; align-items: center; gap: 4px; padding: 0 10px 9px; color: var(--muted); }

/* Admin → Access and IPs */
.acc-today { margin: 0 0 16px; }
.acc-table code { font-size: .86rem; background: transparent; padding: 0; }
.acc-table { min-width: 900px; }
.acc-table .acc-path { min-width: 170px; max-width: 280px; overflow-wrap: anywhere; color: var(--ink-2); }
.acc-table tr.acc-banned td { background: #fbf0f0; }
.ban-pop { position: relative; display: inline-block; }
.ban-pop > summary { list-style: none; cursor: pointer; }
.ban-pop > summary::-webkit-details-marker { display: none; }
.ban-pop[open] .ban-form { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; width: 250px; display: grid; gap: 8px; padding: 12px;
  background: var(--card); border: 1px solid var(--line-2); border-radius: var(--radius); box-shadow: var(--shadow); text-align: left; }
.ban-form label { margin: 0; font-size: .82rem; display: grid; gap: 3px; }
.ban-form input, .ban-form select { width: 100%; padding: 5px 8px; font-size: .88rem; }
.gear-due { display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.gear-due .btn { flex: none; }
.gear-rule > summary h2 { display: flex; align-items: center; gap: 8px; font-size: 1.25rem; }
.gear-rule .casette-body > p:first-child { margin-top: 0; }
.gear-rule-now { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
form.busy { cursor: progress; }
form.busy button { opacity: .6; }
/* Access and IPs: the page of one address, the downloads */
.acc-today li a { display: flex; flex-direction: column; color: inherit; }
.acc-today li a:hover { text-decoration: none; }
.acc-today li a:hover span { color: var(--green-dark); text-decoration: underline; }
.acc-ip-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 18px; margin: 10px 0 4px; }
.acc-ip-head h2 { margin: 0; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.acc-ip-head h2 code { font-size: 1.35rem; background: transparent; padding: 0; overflow-wrap: anywhere; }
.acc-ip-act { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.acc-ip-act form { margin: 0; }
.acc-ip-facts { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; margin: 0 0 16px; }
.acc-ip-facts dt { color: var(--muted); }
.acc-ip-facts dd { margin: 0; }
details.acc-day { margin-bottom: 12px; }
details.acc-day > summary h2 { font-size: 1.15rem; }
details.acc-day > p { padding: 12px 22px; margin: 0; }
.acc-hits { min-width: 560px; }
.acc-hits td { vertical-align: top; }
.acc-hits .acc-what { overflow-wrap: anywhere; }
.acc-hits .acc-path, .acc-files .acc-path { overflow-wrap: anywhere; }
.acc-hits tr.acc-file td { background: #f3f6ef; }
.acc-hits tr.acc-form td { background: #fbf6e6; }
.acc-k { display: inline-block; width: 1.3em; }
.acc-files { min-width: 620px; }
.acc-ip-head h2 .badge { font-family: var(--font-body); }
details.acc-day > p.acc-more { padding: 10px 22px 0; }
/* ---- the members' part of an event (event page and its topic in the forum) ---- */
.hub { margin-top: 30px; }
.hub-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 16px; margin-bottom: 12px; }
.hub-head h2 { margin: 0; font-size: 1.8rem; }
.hub-closed { display: inline-flex; align-items: center; gap: 6px; font-size: .92rem; color: var(--muted); }
.hub-closed .ico { width: 16px; height: 16px; flex: none; }
.hub-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr)); gap: 8px; margin-bottom: 6px; }
.hub-tile { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); color: inherit; box-shadow: var(--shadow); }
.hub-tile:hover { border-color: var(--gold); text-decoration: none; }
.hub-tile:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.hub-tile .ico { width: 22px; height: 22px; flex: none; color: var(--gold); margin-top: 2px; }
.hub-tile-text { display: grid; gap: 1px; min-width: 0; }
.hub-tile-label { font-size: .82rem; color: var(--muted); }
.hub-tile b { font-size: .97rem; font-weight: 600; line-height: 1.3; }
.hub-you { font-size: .85rem; font-weight: 600; line-height: 1.3; }
.hub-you.ok { color: var(--green-dark); } .hub-you.warn { color: #7a5e12; } .hub-you.ask { color: var(--red); } .hub-you.muted { color: var(--muted); }
.hub-sec { margin-top: 12px; }
.hub-sec > summary h2 { display: flex; align-items: center; gap: 9px; }
.hub-sec > summary h2 .ico { width: 22px; height: 22px; color: var(--gold); flex: none; }
.hub-sub { font-family: var(--font-body); font-size: 1rem; font-weight: 700; margin: 18px 0 8px; color: var(--ink-2); }
.hub-sub:first-child { margin-top: 0; }
.hub-plain-title { font-size: 1.5rem; }
.hub-people { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); gap: 8px; }
.hub-person { display: flex; align-items: center; gap: 10px; padding: 7px 9px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); color: inherit; min-width: 0; }
a.hub-person:hover { border-color: var(--gold); text-decoration: none; }
.hub-person.me { border-color: var(--green); box-shadow: inset 3px 0 0 var(--green); }
.hub-person .avatar, .car-head .avatar, .hub-post .avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; flex: none; background: var(--paper-2); }
.hub-person .avatar.ph, .car-head .avatar.ph, .hub-post .avatar.ph { display: flex; align-items: center; justify-content: center; font-family: var(--font-display); font-weight: 600; color: var(--muted); }
.hub-person-text { display: grid; min-width: 0; line-height: 1.25; }
.hub-person-text b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hub-mark { font-size: .8rem; font-weight: 600; }
.hub-mark.m-car { color: var(--green-dark); } .hub-mark.m-seat { color: var(--ink-2); } .hub-mark.m-look { color: #7a5e12; }
.hub-note { display: block; font-size: .86rem; color: var(--ink-2); font-style: italic; overflow-wrap: anywhere; }
.hub-btn { display: inline-block; margin: 0; }
.hub-form > summary { list-style: none; display: inline-flex; align-items: center; gap: 6px; }
.hub-form > summary::-webkit-details-marker { display: none; }
.hub-form > summary .ico { width: 16px; height: 16px; }
.hub-form[open] > summary { background: var(--paper-2); }
.hub-form-body { margin-top: 10px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); }
.hub-form-body .form-actions { margin-top: 6px; }
/* who comes */
.rsvp { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 12px 14px; margin-bottom: 4px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); }
.rsvp-q { font-family: var(--font-display); font-size: 1.35rem; font-weight: 600; }
.rsvp-btns { display: inline-flex; border: 1px solid var(--line-2); border-radius: 999px; overflow: hidden; background: var(--card); }
.rsvp-btn { border: 0; background: none; padding: 7px 15px; font: inherit; font-weight: 600; cursor: pointer; color: var(--ink-2); border-right: 1px solid var(--line); }
.rsvp-btn:last-child { border-right: 0; }
.rsvp-btn:hover { background: var(--paper-2); }
.rsvp-btn:focus-visible { outline: 2px solid var(--gold); outline-offset: -3px; }
.rsvp-btn.on.yes { background: var(--green); color: #fff; } .rsvp-btn.on.maybe { background: var(--gold); color: #fff; } .rsvp-btn.on.no { background: var(--ink-2); color: #fff; }
.rsvp input[type=text] { flex: 1 1 260px; min-width: 0; width: auto; }
.rsvp-hint { color: var(--red); font-weight: 600; }
/* the transport: the member's own place, then the cars drawn from above */
.hub-mine { display: grid; gap: 8px; justify-items: start; padding: 12px 14px; border: 1px solid var(--line); border-left: 4px solid var(--green); border-radius: var(--radius); background: var(--paper); }
.hub-mine p .ico { width: 18px; height: 18px; vertical-align: -3px; color: var(--green-dark); }
.hub-mine .hub-form[open], .hub-choices .hub-form[open] { flex-basis: 100%; width: 100%; }
.hub-choices { align-items: center; }
.hub-invite { font-weight: 600; color: var(--green-dark); }
.cars { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 350px), 1fr)); gap: 14px; margin-top: 14px; }
.car-card { display: grid; grid-template-columns: 136px minmax(0, 1fr); grid-template-areas: "head head" "fig info"; gap: 10px 14px; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); align-items: start; }
.car-card.mine { border-color: var(--green); box-shadow: inset 0 3px 0 var(--green); }
.car-head { grid-area: head; display: flex; align-items: center; gap: 10px; min-width: 0; }
.car-head .avatar { width: 36px; height: 36px; }
.car-fig { grid-area: fig; margin: 0; display: flex; flex-direction: column; align-items: center; position: relative; z-index: 0; padding: 0 8px; }
.car-shell { position: relative; width: 120px; padding: 14px 9px 0; background: radial-gradient(ellipse 7px 4px at 24% 7px, #f3dc84 85%, transparent), radial-gradient(ellipse 7px 4px at 76% 7px, #f3dc84 85%, transparent), var(--paper); border: 2px solid var(--ink-2); border-radius: 44px 44px 16px 16px / 36px 36px 12px 12px; }
.car-shell::before, .car-shell::after { content: ""; position: absolute; left: -8px; right: -8px; height: 24px; border-left: 6px solid var(--ink); border-right: 6px solid var(--ink); border-radius: 3px; z-index: -1; }
.car-shell::before { top: 34px; } .car-shell::after { bottom: 26px; }
.car-fig.trunk-van .car-shell { border-radius: 20px 20px 8px 8px; }
.car-glass { display: block; height: 12px; margin: 6px 12px 9px; border-radius: 50% 50% 3px 3px / 100% 100% 3px 3px; background: linear-gradient(#cdd8d4, #e9efeb); border: 1px solid var(--line-2); }
.car-row { display: flex; justify-content: center; gap: 6px; margin-bottom: 6px; }
.car-fig .seat { width: 28px; height: 30px; flex: none; border-radius: 9px 9px 5px 5px; border: 2px solid var(--line-2); background: var(--card); display: flex; align-items: center; justify-content: center; font-family: var(--font-display); font-weight: 700; font-size: .8rem; line-height: 1; color: var(--ink-2); cursor: default; }
.car-fig .seat.driver { background: var(--ink-2); border-color: var(--ink); color: var(--gold-2); }
.car-fig .seat.taken { background: var(--green-soft); border-color: var(--green); color: var(--green-dark); }
.car-fig .seat.pending { border-style: dashed; border-color: var(--gold); background: var(--gold-soft); color: #7a5e12; }
.car-fig .seat.free { border-color: #d8ceb6; background: #fffefb; }
.car-trunk { margin: 2px -9px 0; padding: 6px 5px 9px; min-height: 34px; border-top: 2px dashed var(--line-2); display: flex; flex-wrap: wrap; gap: 4px; justify-content: center; align-content: center; background: radial-gradient(ellipse 6px 3px at 14% calc(100% - 4px), #b5413a 85%, transparent), radial-gradient(ellipse 6px 3px at 86% calc(100% - 4px), #b5413a 85%, transparent), var(--paper-2); border-radius: 0 0 14px 14px / 0 0 10px 10px; }
.car-fig.trunk-none .car-trunk { min-height: 14px; padding: 3px; }
.trunk-chip { display: inline-flex; align-items: center; gap: 3px; max-width: 100%; padding: 1px 6px; border-radius: 10px; background: var(--card); border: 1px solid var(--line-2); font-size: .72rem; line-height: 1.45; }
.trunk-chip .ico { width: 12px; height: 12px; flex: none; color: var(--ink-2); }
.trunk-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 84px; }
.trunk-chip.pending { border-style: dashed; border-color: var(--gold); }
.trunk-empty { font-size: .72rem; color: var(--muted); }
.car-hitch { width: 4px; height: 10px; background: var(--ink-2); }
.car-trailer { position: relative; width: 104px; min-height: 34px; padding: 5px; border: 2px solid var(--ink-2); border-radius: 6px; background: var(--paper-2); display: flex; flex-wrap: wrap; gap: 4px; justify-content: center; align-content: center; }
.car-trailer::before { content: ""; position: absolute; top: 7px; left: -8px; right: -8px; height: 18px; border-left: 6px solid var(--ink); border-right: 6px solid var(--ink); border-radius: 3px; z-index: -1; }
.car-info { grid-area: info; min-width: 0; }
.car-count { margin: 0 0 4px; line-height: 1.35; }
.car-people { list-style: none; margin: 8px 0; padding: 0; display: grid; gap: 5px; font-size: .93rem; }
.car-people li { display: flex; flex-wrap: wrap; align-items: center; gap: 3px 8px; }
.car-people .btn-row { gap: 4px; }
.ride-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--line-2); flex: none; }
.ride-accepted .ride-dot { background: var(--green); }
.ride-pending .ride-dot { background: var(--gold); }
.ride-declined { opacity: .75; } .ride-declined .ride-dot { background: var(--red); }
.car-info .hub-form, .car-info > .hub-btn { margin-top: 4px; }
.seekers { margin-top: 4px; }
.hub-seeker { display: grid; gap: 6px; align-content: start; justify-items: start; }
.hub-seeker .hub-person { width: 100%; }
/* the equipment and the loans */
.kit-block .kit-head h3 { margin: 0; font-size: 1.3rem; }
.kit-block + .kit-block { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
.loan-general { margin-top: 14px; padding: 10px 12px; border: 1px dashed var(--line-2); border-radius: var(--radius); background: var(--paper); }
.loan-general-list { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; }
.loan-general-list li { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.loan-general-list li > span { flex: 1 1 200px; }
/* what is to be carried */
.carry-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.carry { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: start; padding: 10px 12px; border: 1px solid var(--line); border-left-width: 4px; border-radius: var(--radius); background: var(--card); }
.carry-taken { border-left-color: var(--green); } .carry-open { border-left-color: var(--red); } .carry-proposed { border-left-color: var(--gold); }
.carry-what { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: baseline; }
.carry-state { margin-top: 6px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.carry-vols { display: inline-flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.carry-vol { display: inline-flex; gap: 6px; align-items: center; padding: 2px 3px 2px 9px; border: 1px solid var(--line); border-radius: 14px; background: var(--paper); }
.carry-acts { display: flex; flex-direction: column; gap: 6px; align-items: flex-end; }
.carry-propose { display: flex; gap: 4px; align-items: center; }
.carry-propose select { font-size: .85rem; padding: 3px 6px; max-width: 180px; }
.carry-modes { border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 12px 10px; margin: 8px 0; display: grid; gap: 4px; }
.carry-modes legend { font-weight: 600; padding: 0 4px; }
.carry-new { margin-top: 12px; }
/* the discussion */
.hub-posts { display: grid; }
.hub-post { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.hub-post:first-child { padding-top: 0; }
.hub-post-head { display: flex; flex-wrap: wrap; gap: 2px 10px; align-items: baseline; }
.hub-post .prose { font-size: .98rem; }
.hub-post .prose > :last-child { margin-bottom: 0; }
.hub-reply { margin-top: 12px; display: grid; gap: 8px; }
.hub-reply textarea { min-height: 110px; }
.hub-reply .form-actions { margin-top: 0; }
@media (max-width: 600px) {
  .carry { grid-template-columns: auto minmax(0, 1fr); }
  .carry-acts { grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap; align-items: center; }
  .rsvp-btns { width: 100%; } .rsvp-btn { flex: 1; padding: 8px 6px; }
}
@media (max-width: 420px) {
  .car-card { grid-template-columns: minmax(0, 1fr); grid-template-areas: "head" "fig" "info"; }
}
/* the forum section of the events: every event is a topic */
.board-events .board-name .ico { width: 22px; height: 22px; color: var(--gold); vertical-align: -3px; }
.ev-group-title { font-size: 1.45rem; margin-bottom: 4px; }
.ev-topic { display: grid; grid-template-columns: 58px minmax(0, 1fr) auto auto; gap: 14px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.ev-topic:last-of-type { border-bottom: 0; }
.ev-date { width: 58px; text-align: center; border: 1px solid var(--line-2); border-radius: var(--radius); background: var(--paper); padding: 4px 0 5px; line-height: 1.1; }
.ev-date b { display: block; font-family: var(--font-display); font-size: 1.55rem; }
.ev-date span { font-size: .72rem; color: var(--muted); }
.ev-now .ev-date { border-color: var(--green); background: var(--green-soft); }
.ev-past .ev-date { opacity: .75; }
.ev-topic-stats { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: .85rem; color: var(--muted); justify-content: flex-end; }
.ev-topic-stats span { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.ev-topic-stats .ico { width: 15px; height: 15px; }
@media (max-width: 700px) {
  .ev-topic { grid-template-columns: 52px minmax(0, 1fr); }
  .ev-date { width: 52px; }
  .ev-topic-stats, .ev-topic .topic-last { grid-column: 2; justify-content: flex-start; text-align: left; min-width: 0; }
}
.loan-link-sel { width: auto; max-width: 210px; padding: 3px 6px; font-size: .85rem; }
/* Admin → Association or group */
.org-switch { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; padding: 14px 18px; }
.org-switch form { margin: 0; }
.org-now .org-word { display: flex; flex-direction: column; margin: 0 0 10px; }
.org-now .org-word b { font-family: var(--font-display); font-size: 2.2rem; font-weight: 600; line-height: 1.1; }
.org-report h2 { font-size: 1.45rem; }
.org-list { margin-top: 10px; border-top: 1px solid var(--line); padding-top: 8px; }
.org-list summary { cursor: pointer; }
.org-list ul { margin: 8px 0 0; padding-left: 1.2em; display: grid; gap: 4px; font-size: .93rem; }
.org-list q { quotes: none; color: var(--ink-2); }
.org-list mark { background: var(--gold-soft); padding: 0 2px; border-radius: 2px; }
