/* ---- Jagtklubben: colour themes -------------------------------------------
   Three themes: dark, light and club (the old site's classic colours: olive, sage, khaki). Every colour
   in this file is a token in the blocks below; to adjust a theme, change its values here and nothing else.
   data-bs-theme on <html> is "dark" or "light" (Bootstrap's own components follow it); the club theme is light-based
   and adds data-jk-theme="club". js/theme.js sets both before the page is drawn (the member's choice, otherwise the
   device's setting); the theme menu in the header switches it.

   Each theme defines the same tokens. Text must stay readable: ThemeContrastTests checks every text / background
   pair below against WCAG AA (4.5:1) in every theme, and that each *-rgb token matches its colour. */

/* Dark */
:root,
[data-bs-theme="dark"] {
  --jk-ground: #0B0D10;        /* page background: darker than the cards, so posts stand apart */
  --jk-surface: #1A1D23;       /* cards, header, tab bar */
  --jk-card-foot: #15181D;     /* a post's comments, a step below the card */
  --jk-card-shadow: none;      /* shadows don't show on dark; the ground does the work */
  --jk-header: #1A1D23;       /* top bar and tab bar */
  --jk-raised: #23272F;        /* bubbles, chips, menus, hover */
  --jk-input: #15181D;         /* form fields */
  --jk-border: #2C313A;
  --jk-border-strong: #3B414C;
  --jk-text: #E6E8EC;
  --jk-muted: #A0A6B1;         /* secondary text */
  --jk-accent: #2F5BA8;        /* buttons and fills, with --jk-on-accent text */
  --jk-accent-rgb: 47, 91, 168;
  --jk-accent-hover: #264B8C;  /* darker, so white text stays readable on hover */
  --jk-accent-text: #8FB4F0;   /* links, highlights and accent text */
  --jk-accent-text-rgb: 143, 180, 240;
  --jk-accent-text-hover: #B7CEF6;
  --jk-accent-text-hover-rgb: 183, 206, 246;
  --jk-accent-soft: #1C2638;   /* selected / new backgrounds */
  --jk-accent-soft-strong: #26334B;
  --jk-beer-given: rgba(244, 180, 0, .45); /* a 🍺 you gave, on the photo viewer's black bar: the same in every theme */
  --jk-beer: #F2A60C;          /* the club's beer icon (Icons.Beer): the same in every theme */
  --jk-beer-edge: #C97F00;
  --jk-beer-foam: #FFF8E8;
  --jk-beer-foam-edge: #E6D9BC;
  --jk-beer-shine: #FFD66B;
  --jk-beer-handle: #C9D1DC;  /* the mug's handle: light on dark, dark on light */
  --jk-on-accent: #FFFFFF;
  --jk-on-colour: #FFFFFF;    /* text on avatars and over photos */
  --jk-amber-bg: #352A12;
  --jk-amber-border: #8A6A2A;
  --jk-amber-text: #F2C46D;
  --jk-danger-bg: #3A1D1B;     /* "Aflyst" badge */
  --jk-danger-text: #F3A39C;
  --jk-staging-bg: #5A3D0B;    /* staging banner */
  --jk-staging-text: #FFE3A8;
  --jk-memory: #1A2436;        /* "På denne dag" card */
  --jk-memory-text: #B7C7E3;
  --jk-memory-rule: #2D3B56;
  --jk-unread: #182131;        /* unread notifications */
  --jk-bar: #2A303A;           /* poll result bars */
  --jk-chart: #6F97DD;          /* admins' "Overblik": a single series (columns, meters) */
  --jk-chart-yes: #6F97DD;      /* an event's answers: "kommer" (blue, like its button) ... */
  --jk-chart-maybe: #C28C2E;    /* ... "måske" (amber, like its button) */
  --jk-chart-no: #565C67;       /* ... and "kan ikke" (grey, like its button) */
  --jk-chart-track: #2A303A;    /* empty: tracks, days with nothing */
  --jk-photo-bg: #0C0D10;      /* behind photos */
  --jk-scrim: rgba(0, 0, 0, .6);
  --jk-shadow: rgba(0, 0, 0, .45);
  /* Emblem shields (Infrastructure/EmblemArt.cs): a fill and an icon colour per topic, and the tiers' rims with their tag text */
  --jk-em-member-bg: #2A2F1C;
  --jk-em-member-fg: #C9D19A;
  --jk-em-events-bg: #1C2638;
  --jk-em-events-fg: #8FB4F0;
  --jk-em-photos-bg: #183331;
  --jk-em-photos-fg: #8FD6CC;
  --jk-em-posts-bg: #2A2238;
  --jk-em-posts-fg: #C6B1EE;
  --jk-em-beers-bg: #3A2C12;
  --jk-em-beers-fg: #F2C46D;
  --jk-em-secret-bg: #22262E;
  --jk-em-secret-fg: #C3C9D4;
  --jk-em-bronze: #9A5B24;
  --jk-em-on-bronze: #FFFFFF;
  --jk-em-silver: #A3A9B2;
  --jk-em-on-silver: #15171B;
  --jk-em-gold: #C9A23A;
  --jk-em-on-gold: #1E2128;
  --jk-em-club: #5E6632;
  --jk-em-on-club: #FFFFFF;
  color-scheme: dark;
}

/* Light */
[data-bs-theme="light"] {
  --jk-ground: #E6E9EE;
  --jk-surface: #FFFFFF;
  --jk-card-foot: #F6F7F9;
  --jk-card-shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .10);
  --jk-header: #FFFFFF;       /* top bar and tab bar */
  --jk-raised: #ECEEF2;
  --jk-input: #FFFFFF;
  --jk-border: #D7DBE2;
  --jk-border-strong: #B5BCC7;
  --jk-text: #171A20;
  --jk-muted: #505764;
  --jk-accent: #2B5398;
  --jk-accent-rgb: 43, 83, 152;
  --jk-accent-hover: #22437C;
  --jk-accent-text: #24498A;
  --jk-accent-text-rgb: 36, 73, 138;
  --jk-accent-text-hover: #18346A;
  --jk-accent-text-hover-rgb: 24, 52, 106;
  --jk-accent-soft: #E4EBF7;
  --jk-accent-soft-strong: #CCD9F0;
  --jk-beer-given: rgba(244, 180, 0, .45); /* the same in every theme: the viewer's bar is always black */
  --jk-beer: #F2A60C;          /* the club's beer icon (Icons.Beer): the same in every theme */
  --jk-beer-edge: #C97F00;
  --jk-beer-foam: #FFF8E8;
  --jk-beer-foam-edge: #E6D9BC;
  --jk-beer-shine: #FFD66B;
  --jk-beer-handle: #3A4250;  /* the mug's handle: light on dark, dark on light */
  --jk-on-accent: #FFFFFF;
  --jk-on-colour: #FFFFFF;    /* text on avatars and over photos */
  --jk-amber-bg: #FFF2D2;
  --jk-amber-border: #D3A13E;
  --jk-amber-text: #6E4A00;
  --jk-danger-bg: #FCE3E0;
  --jk-danger-text: #9E2A20;
  --jk-staging-bg: #FFE3A8;
  --jk-staging-text: #4A3209;
  --jk-memory: #E5ECF7;
  --jk-memory-text: #1B3260;
  --jk-memory-rule: #C0CEE8;
  --jk-unread: #EDF2FA;
  --jk-bar: #DDE2EA;
  --jk-chart: #2B5398;          /* admins' "Overblik": a single series (columns, meters) */
  --jk-chart-yes: #2B5398;      /* an event's answers: "kommer" (blue, like its button) ... */
  --jk-chart-maybe: #B87B12;    /* ... "måske" (amber, like its button) */
  --jk-chart-no: #B4BAC4;       /* ... and "kan ikke" (grey, like its button) */
  --jk-chart-track: #E9ECF0;    /* empty: tracks, days with nothing */
  --jk-photo-bg: #1A1C20;
  --jk-scrim: rgba(0, 0, 0, .5);
  --jk-shadow: rgba(17, 19, 24, .14);
  /* Emblem shields (Infrastructure/EmblemArt.cs): a fill and an icon colour per topic, and the tiers' rims with their tag text */
  --jk-em-member-bg: #E6E9D3;
  --jk-em-member-fg: #4D5A2E;
  --jk-em-events-bg: #E1EAF8;
  --jk-em-events-fg: #2B5398;
  --jk-em-photos-bg: #DCEFEC;
  --jk-em-photos-fg: #1F6560;
  --jk-em-posts-bg: #ECE5F6;
  --jk-em-posts-fg: #5B3C8C;
  --jk-em-beers-bg: #FAEBCF;
  --jk-em-beers-fg: #85500A;
  --jk-em-secret-bg: #E3E5EA;
  --jk-em-secret-fg: #2C3340;
  --jk-em-bronze: #9A5B24;
  --jk-em-on-bronze: #FFFFFF;
  --jk-em-silver: #A3A9B2;
  --jk-em-on-silver: #15171B;
  --jk-em-gold: #C9A23A;
  --jk-em-on-gold: #1E2128;
  --jk-em-club: #5E6632;
  --jk-em-on-club: #FFFFFF;
  color-scheme: light;
}

/* Club: the old site's classic colours (legacy inc/style_main.css, the colorschemes table "JK (classic)"
   and inc/theme_settings2.inc.php "JK STANDARD"): olive page, sage menu bar, white boxes, light sage rows, khaki side
   frames, moss-green buttons, black text, navy links that turn red on hover. Light-based. */
[data-bs-theme][data-jk-theme="club"] {
  --jk-ground: #A4A86A;        /* olive: the old page and header */
  --jk-surface: #FFFFFF;       /* white boxes */
  --jk-card-foot: #F6F7F1;     /* a post's comments: a hint of the sage */
  --jk-card-shadow: 0 1px 2px rgba(40, 44, 20, .10), 0 1px 3px rgba(40, 44, 20, .14);
  --jk-header: #B1BC9E;       /* sage: the old menu bar */
  --jk-raised: #D8DDCE;        /* light sage: the old alternate rows */
  --jk-input: #FFFFFF;
  --jk-border: #B1BC9E;        /* sage: the old menu bar */
  --jk-border-strong: #909363;
  --jk-text: #141609;
  --jk-muted: #34371F;
  --jk-accent: #4D5A2E;        /* moss: a darker shade of the olive and sage */
  --jk-accent-rgb: 77, 90, 46;
  --jk-accent-hover: #3E4925;
  --jk-accent-text: #2F381B;   /* dark moss: links and icons (the old navy clashed with the greens) */
  --jk-accent-text-rgb: 47, 56, 27;
  --jk-accent-text-hover: #A3000F; /* red on hover, as on the old site */
  --jk-accent-text-hover-rgb: 163, 0, 15;
  --jk-accent-soft: #ECE8CF;   /* pale khaki */
  --jk-accent-soft-strong: #C1B76A; /* khaki: the old side frames */
  --jk-beer-given: rgba(244, 180, 0, .45); /* the same in every theme: the viewer's bar is always black */
  --jk-beer: #F2A60C;          /* the club's beer icon (Icons.Beer): the same in every theme */
  --jk-beer-edge: #C97F00;
  --jk-beer-foam: #FFF8E8;
  --jk-beer-foam-edge: #E6D9BC;
  --jk-beer-shine: #FFD66B;
  --jk-beer-handle: #3A4250;  /* the mug's handle: light on dark, dark on light */
  --jk-on-accent: #FFFFFF;
  --jk-on-colour: #FFFFFF;    /* text on avatars and over photos */
  --jk-amber-bg: #FFF2D2;
  --jk-amber-border: #D3A13E;
  --jk-amber-text: #6E4A00;
  --jk-danger-bg: #FCE3E0;
  --jk-danger-text: #9E2A20;
  --jk-staging-bg: #FFE3A8;
  --jk-staging-text: #4A3209;
  --jk-memory: #E3DDB0;        /* khaki "På denne dag" card */
  --jk-memory-text: #3A3510;
  --jk-memory-rule: #C1B76A;
  --jk-unread: #EEF0E6;
  --jk-bar: #B1BC9E;
  --jk-chart: #4D5A2E;          /* admins' "Overblik": a single series (columns, meters) */
  --jk-chart-yes: #4F6B1F;      /* an event's answers: "kommer" (olive, like its button) ... */
  --jk-chart-maybe: #C08A2A;    /* ... "måske" (amber, like its button) */
  --jk-chart-no: #BDB89C;       /* ... and "kan ikke" (grey, like its button) */
  --jk-chart-track: #E8EADF;    /* empty: tracks, days with nothing */
  --jk-photo-bg: #1A1C20;
  --jk-scrim: rgba(0, 0, 0, .5);
  --jk-shadow: rgba(20, 22, 9, .18);
  /* Emblem shields (Infrastructure/EmblemArt.cs): a fill and an icon colour per topic, and the tiers' rims with their tag text */
  --jk-em-member-bg: #E6E9D3;
  --jk-em-member-fg: #4D5A2E;
  --jk-em-events-bg: #E1EAF8;
  --jk-em-events-fg: #2B5398;
  --jk-em-photos-bg: #DCEFEC;
  --jk-em-photos-fg: #1F6560;
  --jk-em-posts-bg: #ECE5F6;
  --jk-em-posts-fg: #5B3C8C;
  --jk-em-beers-bg: #FAEBCF;
  --jk-em-beers-fg: #85500A;
  --jk-em-secret-bg: #E3E5EA;
  --jk-em-secret-fg: #2C3340;
  --jk-em-bronze: #9A5B24;
  --jk-em-on-bronze: #FFFFFF;
  --jk-em-silver: #A3A9B2;
  --jk-em-on-silver: #15171B;
  --jk-em-gold: #C9A23A;
  --jk-em-on-gold: #1E2128;
  --jk-em-club: #5E6632;
  --jk-em-on-club: #FFFFFF;
  color-scheme: light;
}

/* Bootstrap, mapped onto the tokens (every theme) */
:root,
[data-bs-theme] {
  --bs-body-bg: var(--jk-ground);
  --bs-body-color: var(--jk-text);
  --bs-secondary-color: var(--jk-muted);
  --bs-tertiary-bg: var(--jk-raised);
  --bs-border-color: var(--jk-border);
  --bs-emphasis-color: var(--jk-text);
  --bs-primary: var(--jk-accent);
  --bs-primary-rgb: var(--jk-accent-rgb);
  --bs-link-color: var(--jk-accent-text);
  --bs-link-color-rgb: var(--jk-accent-text-rgb);
  --bs-link-hover-color: var(--jk-accent-text-hover);
  --bs-link-hover-color-rgb: var(--jk-accent-text-hover-rgb);
  --bs-font-sans-serif: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Layout sizes (the same in both themes) */
:root { --jk-topbar-height: 48px; --jk-tabbar-height: 52px; --jk-page-top: 12px; --jk-card-x: 12px; }
@media (min-width: 768px) { :root { --jk-page-top: 16px; } }

html { font-size: 15px; }
body { background: var(--jk-ground); color: var(--jk-text); }
body.signed-in { padding-bottom: calc(var(--jk-tabbar-height) + 8px + env(safe-area-inset-bottom)); }
@media (min-width: 768px) { body.signed-in { padding-bottom: 0; } }
.text-muted { color: var(--jk-muted) !important; }

/* Bootstrap components on the tokens */
.card { --bs-card-bg: var(--jk-surface); --bs-card-border-color: var(--jk-border); border-radius: 12px; box-shadow: var(--jk-card-shadow); }
.list-group { --bs-list-group-bg: var(--jk-surface); --bs-list-group-border-color: var(--jk-border);
  --bs-list-group-action-hover-bg: var(--jk-raised); --bs-list-group-action-active-bg: var(--jk-raised); }
.dropdown-menu { --bs-dropdown-bg: var(--jk-raised); --bs-dropdown-border-color: var(--jk-border-strong);
  --bs-dropdown-link-hover-bg: var(--jk-surface); --bs-dropdown-link-color: var(--jk-text); }
.pagination { --bs-pagination-bg: var(--jk-surface); --bs-pagination-border-color: var(--jk-border); --bs-pagination-color: var(--jk-accent-text);
  --bs-pagination-hover-bg: var(--jk-raised); --bs-pagination-active-bg: var(--jk-accent); --bs-pagination-active-border-color: var(--jk-accent);
  --bs-pagination-disabled-bg: var(--jk-surface); --bs-pagination-disabled-color: var(--jk-muted); }
.form-control, .form-select { background-color: var(--jk-input); border-color: var(--jk-border-strong); color: var(--jk-text); }
.form-control:focus, .form-select:focus { background-color: var(--jk-input); color: var(--jk-text); border-color: var(--jk-accent); }
.form-control::placeholder { color: var(--jk-muted); opacity: 1; }
.btn-primary { --bs-btn-bg: var(--jk-accent); --bs-btn-border-color: var(--jk-accent); --bs-btn-color: var(--jk-on-accent);
  --bs-btn-hover-bg: var(--jk-accent-hover); --bs-btn-hover-border-color: var(--jk-accent-hover); --bs-btn-hover-color: var(--jk-on-accent);
  --bs-btn-active-bg: var(--jk-accent-hover); --bs-btn-active-border-color: var(--jk-accent-hover);
  --bs-btn-disabled-bg: var(--jk-accent); --bs-btn-disabled-border-color: var(--jk-accent); }
.btn-outline-secondary { --bs-btn-color: var(--jk-text); --bs-btn-border-color: var(--jk-border-strong);
  --bs-btn-hover-bg: var(--jk-raised); --bs-btn-hover-border-color: var(--jk-border-strong); --bs-btn-hover-color: var(--jk-text);
  --bs-btn-active-bg: var(--jk-raised); --bs-btn-active-color: var(--jk-text); }
.btn-link { --bs-btn-color: var(--jk-accent-text); --bs-btn-hover-color: var(--bs-link-hover-color); }
.btn:focus-visible, .form-control:focus, .form-select:focus, a:focus-visible, button:focus-visible {
  outline: 2px solid var(--jk-accent-text); outline-offset: 2px; box-shadow: none; }

/* ---- header / tab bar ---- */
.topbar { background: var(--jk-header); border-bottom: 1px solid var(--jk-border); position: sticky; top: 0; z-index: 1020; }
.topbar-inner { max-width: 1120px; margin: 0 auto; padding: 0 16px; min-height: var(--jk-topbar-height); display: flex; align-items: center; gap: 24px; }
/* The club's logo (wwwroot/icons/logo.svg) instead of the name; the name is its alt text. */
.brand { display: inline-flex; align-items: center; flex-shrink: 0; }
.brand img { display: block; height: 35px; width: auto; }
/* The burgundy shield needs a faint light edge to stand out on the dark header. */
[data-bs-theme="dark"] .brand img { filter: drop-shadow(0 0 1px rgba(255, 255, 255, .55)) drop-shadow(0 0 3px rgba(255, 255, 255, .18)); }
.topnav { gap: 4px; }
.topnav a { padding: 8px 12px; border-radius: 8px; color: var(--jk-muted); text-decoration: none; }
.topnav a:hover { color: var(--jk-text); }
.topnav a[aria-current="page"] { background: var(--jk-accent-soft); color: var(--jk-accent-text); font-weight: 600; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.topbar .search { width: 240px; border-radius: 20px; }
/* A tablet's width: a narrower search field leaves room for admins' "Admin" in the menu. */
@media (max-width: 991.98px) { .topbar .search { width: 130px; } .topnav a { padding: 8px 8px; } }
.icon-btn { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border: 0; border-radius: 22px;
  background: transparent; color: var(--jk-text); cursor: pointer; text-decoration: none; }
.icon-btn:hover { background: var(--jk-raised); color: var(--jk-text); }
.icon-btn.on-memory { color: var(--jk-memory-text); width: 36px; height: 36px; }
.icon-btn.on-memory:hover { background: var(--jk-memory-rule); }
.bell-badge { position: absolute; top: 5px; right: 4px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px; background: var(--jk-accent); color: var(--jk-on-accent);
  font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 1020; background: var(--jk-header); border-top: 1px solid var(--jk-border);
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); padding-bottom: env(safe-area-inset-bottom); }
.tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: var(--jk-tabbar-height); font-size: 11px; color: var(--jk-muted); text-decoration: none; }
.tabbar a[aria-current="page"] { color: var(--jk-accent-text); font-weight: 600; }
.tabbar svg { width: 22px; height: 22px; } /* the same size for every icon, Admin's key included */

.page { max-width: 1120px; margin: 0 auto; padding: var(--jk-page-top) 8px 20px; }
@media (min-width: 768px) { .page { padding: var(--jk-page-top) 20px 20px; } }
.back-link { display: inline-flex; align-items: center; gap: 2px; margin-bottom: 4px; min-height: 36px; color: var(--jk-text); text-decoration: none; font-weight: 600; }

.avatar { --size: 36px; width: var(--size); height: var(--size); min-width: var(--size); border-radius: 50%; color: var(--jk-on-colour); display: inline-flex; align-items: center; justify-content: center;
  font-size: calc(var(--size) * .36); font-weight: 600; line-height: 1; user-select: none; }
img.avatar { object-fit: cover; background: var(--jk-raised); }

/* ---- feed layout ---- */
.feed-layout { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; }
/* Room between the posts, so each one reads as its own (less on a phone, where the screen is short). */
.feed-col { flex: 999 1 560px; min-width: 0; max-width: 680px; display: flex; flex-direction: column; gap: 16px; }
@media (max-width: 575.98px) { .feed-col { gap: 12px; } }
.feed-side { flex: 1 1 300px; min-width: 0; flex-direction: column; gap: 12px; position: sticky; top: calc(var(--jk-topbar-height) + 1px + var(--jk-page-top)); }
.side-card { padding: 12px 14px; }
.upcoming { list-style: none; margin: 0 0 10px; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.upcoming li { display: flex; gap: 12px; align-items: center; }
.upcoming a { color: var(--jk-text); text-decoration: none; }

.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.chips-sep { flex: none; width: 1px; align-self: stretch; margin: 4px 4px; background: var(--jk-border-strong); } /* what kind of post | which topic */
.chips.wrap { flex-wrap: wrap; overflow: visible; }
.chip { flex-shrink: 0; display: inline-flex; align-items: center; min-height: 36px; padding: 0 14px; border-radius: 18px; border: 1px solid var(--jk-border-strong);
  background: var(--jk-surface); color: var(--jk-text); font-size: .9rem; font-weight: 500; text-decoration: none; }
.chip.small { min-height: 30px; padding: 0 10px; font-size: .85rem; background: var(--jk-raised); border-color: transparent; }
.chip.on { background: var(--jk-accent); border-color: var(--jk-accent); color: var(--jk-on-accent); }
.chip:hover:not(.on) { border-color: var(--jk-accent-text); color: var(--jk-text); }

/* composer */
.composer { padding: 10px; gap: 6px; container-type: inline-size; }
.composer textarea { border: 0; padding: 6px 4px; font-size: 1rem; resize: none; box-shadow: none; background: transparent; }
.composer textarea:focus { background: transparent; }
/* One row: the topic dropdown shrinks (and cuts its text) rather than pushing "Del" onto a line of its own. */
.composer-tools { display: flex; flex-wrap: nowrap; align-items: center; gap: 6px; }
.composer-tools > * { flex: none; }
.composer-tools .tag-select { flex: 0 1 auto; min-width: 0; text-overflow: ellipsis; }
.tool-btn { position: relative; display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 12px; border-radius: 18px; background: var(--jk-raised);
  color: var(--jk-text); font-size: .875rem; text-decoration: none; cursor: pointer; overflow: hidden; }
.tool-btn svg { color: var(--jk-accent-text); width: 20px; height: 20px; }
.tool-btn:hover { background: var(--jk-accent-soft); color: var(--jk-text); }
.tool-btn input[type=file], .file-btn input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
/* Labels only when the composer has room for them (its own width, not the screen's). */
@container (max-width: 640px) { .tool-btn span { display: none; } }
.tag-select { width: auto; min-height: 40px; border-radius: 20px; }

/* memory */
.memory-card { background: var(--jk-memory); color: var(--jk-text); border: 1px solid var(--jk-memory-rule); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.memory-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.memory-label { font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--jk-memory-text); }
.memory-photos { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; }
.memory-photos img { width: 100%; aspect-ratio: 1; object-fit: cover; background: var(--jk-memory-rule); }
.memory-photos img:first-child { border-radius: 8px 0 0 8px; }
.memory-photos img:last-child { border-radius: 0 8px 8px 0; }
.memory-title { color: var(--jk-text); font-weight: 600; text-decoration: none; }
.memory-title:hover { color: var(--jk-text); text-decoration: underline; }
.memory-sub { font-size: 13px; color: var(--jk-memory-text); }
.memory-post.with-rule { border-top: 1px solid var(--jk-memory-rule); padding-top: 10px; }

/* ---- post card ---- */
.post-card { overflow: hidden; }
/* Bootstrap's px-3 inside a post lines up with the rest of the card. */
.post-card .px-3 { padding-left: var(--jk-card-x) !important; padding-right: var(--jk-card-x) !important; }
.post-card.is-new { box-shadow: 0 0 0 2px var(--jk-accent-soft-strong); }
.post-head { display: flex; align-items: center; gap: 8px; padding: 10px 10px 6px var(--jk-card-x); }
.post-meta { min-width: 0; line-height: 1.35; }
.post-meta a.text-muted { text-decoration: none; }
.tag-link { color: var(--jk-accent-text); text-decoration: none; font-weight: 500; }
.new-badge { background: var(--jk-accent); color: var(--jk-on-accent); font-weight: 600; }
.cancelled-badge { background: var(--jk-danger-bg); color: var(--jk-danger-text); font-weight: 600; vertical-align: middle; }
.cancelled-note { color: var(--jk-danger-text); }
.event-block.is-cancelled .event-line { text-decoration: line-through; color: var(--jk-muted); }
.not-answered { padding: 10px var(--jk-card-x); }
.not-answered-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.not-answered-list li { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 3px;
  background: var(--jk-raised); border-radius: 999px; font-size: .875rem; }
.post-title { font-size: 1.05rem; font-weight: 700; margin: 0 0 2px; letter-spacing: -0.01em; }
.post-title a { color: var(--jk-text); text-decoration: none; }
.post-title a:hover { text-decoration: underline; }
.post-body { overflow-wrap: anywhere; line-height: 1.45; }
.post-body > :last-child { margin-bottom: 0; }
.post-body p { margin-bottom: .5rem; }
.post-body blockquote { border-left: 3px solid var(--jk-border-strong); padding-left: .75rem; color: var(--jk-muted); margin: .25rem 0 .5rem; }
.post-body .mention { color: var(--jk-accent-text); font-weight: 600; text-decoration: none; }
.post-body .mention:hover { text-decoration: underline; }
.post-body.clamped { display: -webkit-box; -webkit-line-clamp: 8; -webkit-box-orient: vertical; overflow: hidden; }
.post-card > .post-body, .post-card > .poll { margin-bottom: 6px; }

.event-block { display: flex; gap: 12px; padding: 2px var(--jk-card-x) 8px; }
.date-tile { width: 56px; height: 60px; flex-shrink: 0; border-radius: 12px; background: var(--jk-accent-soft); display: flex; flex-direction: column; align-items: center; justify-content: center; }
.date-tile .month { font-size: 11px; font-weight: 700; color: var(--jk-accent-text); letter-spacing: .06em; }
.date-tile .day { font-size: 24px; font-weight: 700; color: var(--jk-text); line-height: 1; }
.date-tile.past { background: var(--jk-raised); }
.date-tile.past .month, .date-tile.past .day { color: var(--jk-muted); }
.date-tile.small-tile { width: 44px; height: 46px; border-radius: 10px; }
.date-tile.small-tile .month { font-size: 10px; }
.date-tile.small-tile .day { font-size: 18px; }
.event-line { font-size: .925rem; color: var(--jk-text); }
.event-people { display: flex; align-items: center; gap: 8px; padding: 0 var(--jk-card-x) 8px; }
/* The club's logo where a member's face would be (ClubBirthday). */
.avatar-club { object-fit: contain; padding: 4px; background: var(--jk-raised); }
.avatar-stack { display: flex; }
.avatar-stack .avatar { border: 2px solid var(--jk-surface); margin-left: -8px; }
.avatar-stack .avatar:first-child { margin-left: 0; }
.rsvp { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; padding: 2px var(--jk-card-x) 12px; }
/* Drawn 34px tall, but each button's tap area reaches 4px above and below and into half the gap beside it (::after),
   so it stays about 42px tall and the row has no dead spots. The chosen answer stands out by its fill. */
.rsvp-btn { position: relative; min-height: 34px; padding: 4px 6px; border-radius: 8px; border: 1px solid var(--jk-border-strong);
  background: var(--jk-raised); color: var(--jk-text); font-weight: 500; font-size: .85rem; line-height: 1.2; }
.rsvp-btn::after { content: ""; position: absolute; inset: -5px; } /* from inside the 1px border: 4px past it */
.rsvp-btn.on { font-weight: 600; }
.rsvp-btn:hover:not(:disabled) { border-color: var(--jk-accent-text); }
.rsvp-btn.going.on { background: var(--jk-accent); border-color: var(--jk-accent); color: var(--jk-on-accent); }
.rsvp-btn.maybe.on { background: var(--jk-amber-bg); border-color: var(--jk-amber-border); color: var(--jk-amber-text); }
.rsvp-btn.no.on { background: var(--jk-ground); border-color: var(--jk-muted); color: var(--jk-text); }
.rsvp-btn:disabled { opacity: .6; }
.event-organizers { margin-top: 4px; }
.event-organizers .avatar-stack { display: inline-flex; vertical-align: middle; margin-right: 6px; }
.event-organizers a { color: var(--jk-text); font-weight: 600; text-decoration: none; }
.event-organizers a:hover { text-decoration: underline; }
.organizer-list { max-height: 260px; overflow-y: auto; border: 1px solid var(--jk-border-strong); border-radius: 12px; background: var(--jk-input); padding: 4px; }
.organizer-option { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 4px 10px; border-radius: 8px; cursor: pointer; margin: 0; }
.organizer-option:hover { background: var(--jk-raised); }
.organizer-option .form-check-input { margin: 0; flex-shrink: 0; }
.organizer-option:has(:checked) { background: var(--jk-accent-soft); }
.event-gallery { display: flex; align-items: center; gap: 6px; padding: 0 var(--jk-card-x) 10px; font-weight: 600; font-size: .9rem; text-decoration: none; }

.poll { display: flex; flex-direction: column; gap: 6px; }
.poll-option { position: relative; overflow: hidden; display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 40px; padding: 0 12px;
  border-radius: 10px; border: 1px solid var(--jk-border-strong); background: var(--jk-raised); color: var(--jk-text); text-align: left; font-size: .925rem; }
.poll-option:hover:not(:disabled) { border-color: var(--jk-accent-text); }
.poll-option.mine { border: 2px solid var(--jk-accent-text); }
.poll-option .bar { position: absolute; left: 0; top: 0; bottom: 0; background: var(--jk-bar); transition: width .3s; }
.poll-option.mine .bar { background: var(--jk-accent-soft-strong); }
.poll-option .label, .poll-option .pct { position: relative; }
.poll-option .pct { font-weight: 600; }
.poll-option:disabled { opacity: 1; cursor: default; }

.photo-strip { display: grid; gap: 2px; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-bottom: 4px; }
.photo-strip.count-1 { grid-template-columns: 1fr; }
.photo-strip.count-3 > a:first-child { grid-row: span 2; }
.photo-strip a { position: relative; display: block; background: var(--jk-raised); }
.photo-strip a[hidden] { display: none; }
.photo-strip img { width: 100%; height: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; }
.photo-strip.count-1 img { aspect-ratio: auto; max-height: 520px; object-fit: contain; background: var(--jk-photo-bg); margin: 0 auto; }
.photo-strip.count-1 a { background: var(--jk-photo-bg); }
.photo-strip a.more::after { content: attr(data-more); position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  background: var(--jk-scrim); color: var(--jk-on-colour); font-size: 1.5rem; font-weight: 700; }

.post-actions { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-top: 4px; padding-bottom: 6px; }
.reactions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.reaction { min-height: 30px; padding: 0 9px; border-radius: 16px; border: 1px solid var(--jk-border); background: var(--jk-raised); font-size: .9rem; color: var(--jk-text); }
.reaction.mine { background: var(--jk-accent-soft); border-color: var(--jk-accent-text); color: var(--jk-accent-text); font-weight: 600; }
.reaction.add { color: var(--jk-muted); min-width: 36px; }
.reaction-menu .btn { font-size: 1.25rem; padding: 4px 8px; }
.comment-count { display: inline-flex; align-items: center; gap: 6px; color: var(--jk-muted); font-size: .875rem; text-decoration: none; min-height: 32px; }

.comments { display: flex; flex-direction: column; gap: 6px; border-top: 1px solid var(--jk-border); padding-top: 8px; padding-bottom: 10px; }
/* A post ends in its conversation, a shade off the card: the post, then its comments, then the next post. */
.post-card > .comments { background: var(--jk-card-foot); }
.comment { display: flex; gap: 8px; scroll-margin-top: calc(var(--jk-topbar-height) + 16px); }
.comment-main { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.bubble { background: var(--jk-raised); border-radius: 12px; padding: 6px 10px; font-size: .925rem; }
.comment.is-new .bubble { background: var(--jk-accent-soft); }
.comment-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; padding-left: 4px; font-size: 12px; color: var(--jk-muted); }
.link-btn { border: 0; background: transparent; padding: 6px 0; font-size: 12px; font-weight: 600; color: var(--jk-muted); }
.link-btn.mine { color: var(--jk-accent-text); font-weight: 700; }
.link-btn:hover { color: var(--jk-text); }
a.link-btn { text-decoration: none; } /* a link among buttons ("Ret" next to "Slet") looks like them */
.comment-img { max-height: 120px; border-radius: 8px; }
.new-divider { display: flex; align-items: center; gap: 8px; color: var(--jk-accent-text); font-size: 12px; font-weight: 600; scroll-margin-top: calc(var(--jk-topbar-height) + 16px); }
.new-divider::before, .new-divider::after { content: ""; flex: 1; border-top: 1px solid var(--jk-accent-text); }
.comment-form { display: flex; gap: 6px; align-items: flex-end; }
.comment-form textarea { flex: 1 1 0; width: auto; min-width: 0; border-radius: 20px; resize: none; min-height: 40px; padding: 8px 14px; }
/* Sending what's in the field next to it: a comment, a post, photos, a person on a photo. */
.icon-btn.send { width: 40px; height: 40px; background: var(--jk-accent); color: var(--jk-on-accent); flex-shrink: 0; }
.icon-btn.send:hover { background: var(--jk-accent-hover); color: var(--jk-on-accent); }
.comment-form .file-btn { width: 40px; height: 40px; background: var(--jk-raised); color: var(--jk-accent-text); flex-shrink: 0; overflow: hidden; }
.upload-card { padding: 12px; }

/* Choosing photos (_PhotoPicker, the composer's and comments' photo buttons; site.js): a button with the real file
   field invisibly on top, thumbnails of what was picked, a frame while photos are dragged over the form, progress. */
.photo-picker { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.photo-pick-btn { position: relative; display: inline-flex; align-items: center; gap: 6px; overflow: hidden; }
.photo-pick-btn svg { width: 18px; height: 18px; }
.photo-pick-btn input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.photo-pick-btn:focus-within, .tool-btn:focus-within, .file-btn:focus-within { outline: 2px solid var(--jk-accent); outline-offset: 2px; }
.photo-previews { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.photo-previews[hidden] { display: none; }
.photo-preview { position: relative; width: 72px; height: 72px; border-radius: 8px; overflow: hidden; background: var(--jk-raised); }
.photo-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-preview.no-preview img { display: none; }
.photo-preview.no-preview::after { content: attr(data-name); position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  padding: 4px; font-size: 11px; text-align: center; word-break: break-all; color: var(--jk-muted); }
.photo-preview-remove { position: absolute; top: 2px; right: 2px; width: 32px; height: 32px; display: flex; align-items: center; justify-content: center;
  padding: 0; border: 0; border-radius: 50%; background: var(--jk-scrim); color: var(--jk-on-colour); font-size: 20px; line-height: 1; }
.photo-count { flex-basis: 100%; font-size: .875rem; color: var(--jk-muted); }
form.is-dropping { outline: 2px dashed var(--jk-accent); outline-offset: 4px; }
.upload-progress { flex-basis: 100%; display: flex; flex-direction: column; gap: 4px; }
.upload-progress[hidden] { display: none; }
.upload-progress-track { height: 6px; border-radius: 3px; background: var(--jk-raised); overflow: hidden; }
.upload-progress-fill { height: 100%; width: 0; background: var(--jk-accent); transition: width .2s; }
.upload-progress-text { font-size: .875rem; color: var(--jk-muted); }
.comment-form { flex-wrap: wrap; }
.comment-edit { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.comment-edit textarea { border-radius: 12px; resize: none; }
/* A photo picker and its form's button on one row, the thumbnails below both (the feed's "Del dine billeder"). */
.picker-row { display: grid; grid-template-columns: auto auto 1fr; align-items: center; gap: 8px; }
.picker-row .photo-picker { display: contents; }
.picker-row .photo-previews { grid-column: 1 / -1; grid-row: 2; }
.picker-row > button { grid-row: 1; grid-column: 2; }
.comment-form .photo-previews { flex-basis: 100%; order: -1; }
.composer .photo-previews { padding: 0 4px; }

/* notifications */
.notification-list { list-style: none; margin: 0; padding: 0; overflow: hidden; }
.notification-list li + li { border-top: 1px solid var(--jk-border); }
.notification-list a { display: flex; align-items: center; gap: 10px; padding: 8px 12px; color: var(--jk-text); text-decoration: none; }
.notification-list a:hover { background: var(--jk-raised); }
.notification-list .text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.notification-list li.unread { background: var(--jk-unread); }
.notification-list .dot { width: 10px; height: 10px; border-radius: 5px; background: var(--jk-accent-text); flex-shrink: 0; }

/* mention autocomplete */
.mention-menu { position: absolute; z-index: 1080; min-width: 220px; max-height: 240px; overflow-y: auto; background: var(--jk-raised); border: 1px solid var(--jk-border-strong);
  border-radius: 12px; box-shadow: 0 8px 24px var(--jk-shadow); padding: 4px; list-style: none; margin: 0; color: var(--jk-text); }
.mention-menu li { padding: 8px 10px; border-radius: 8px; cursor: pointer; display: flex; justify-content: space-between; gap: 12px; }
.mention-menu li[aria-selected="true"], .mention-menu li:hover { background: var(--jk-accent-soft); }
.mention-menu .handle { color: var(--jk-muted); font-size: .85rem; }

/* ---- galleries ---- */
/* Where a page sits (_Crumbs): the parents, quiet, with a thin › between; the nearest one is the back link. On a phone
   just that back link, as on the other pages; on a wider screen the whole path, the back arrow left out. */
.crumbs { min-width: 0; }
.crumbs ol { display: flex; align-items: center; list-style: none; margin: 0 0 4px; padding: 0; min-width: 0; }
.crumbs li { display: flex; align-items: center; min-width: 0; }
.crumbs li + li::before { content: "›"; color: var(--jk-muted); padding: 0 8px; opacity: .7; }
.crumbs li:not(.parent) { flex-shrink: 2; }
.crumbs li:not(.parent) a { color: var(--jk-muted); text-decoration: none; min-height: 36px; line-height: 36px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crumbs li:not(.parent) a:hover, .crumbs .back-link:hover span { text-decoration: underline; }
.crumbs .back-link { margin-bottom: 0; min-width: 0; }
.crumbs .back-link span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (min-width: 576px) { .crumbs .back-link svg { display: none; } }
@media (max-width: 575.98px) {
  .crumbs li:not(.parent) { display: none; }
  .crumbs li + li::before { content: none; }
}
.photo-thumb .badge span + span { margin-left: 6px; } /* 💬 2  🍺 3 */
.gallery-card { border-radius: 12px; overflow: hidden; }
.gallery-card img { aspect-ratio: 4 / 3; object-fit: cover; background: var(--jk-raised); }
.gallery-cover { position: relative; }
.gallery-cover img { display: block; } /* no line gap under it */
.gallery-cover .badge { position: absolute; right: .375rem; bottom: .375rem; opacity: .85; }
/* Open to everyone's photos (GalleryCard.OpenUntil): on the cover, top left. */
.gallery-open { position: absolute; left: .375rem; top: .375rem; padding: 2px 8px; border-radius: 10px; font-size: .75rem; font-weight: 600;
  background: var(--jk-accent); color: var(--jk-on-accent); box-shadow: 0 1px 4px var(--jk-shadow); }
.gallery-cover-empty { aspect-ratio: 4 / 3; display: grid; place-items: center; background: var(--jk-raised); color: var(--jk-muted); }
.gallery-cover-empty svg { width: 36px; height: 36px; }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: .5rem; }
.photo-thumb { position: relative; display: block; }
.photo-thumb img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: .25rem; background: var(--jk-raised); }
.photo-thumb .badge { position: absolute; right: .25rem; bottom: .25rem; opacity: .85; }
details > summary { list-style: none; }
details > summary::-webkit-details-marker { display: none; }

/* members, profile, birthdays, rules */
.member-list { list-style: none; margin: 0; padding: 0; overflow: hidden; }
.member-list li + li { border-top: 1px solid var(--jk-border); }
.member-list a { display: flex; align-items: center; gap: 10px; padding: 8px 12px; color: var(--jk-text); text-decoration: none; }
.member-list a:hover { background: var(--jk-raised); }
.member-list .text { display: flex; flex-direction: column; min-width: 0; }
.member-title { color: var(--jk-accent-text); font-weight: 600; }
.profile-card { padding: 14px; display: flex; flex-direction: row; flex-wrap: wrap; gap: 14px; align-items: flex-start; }
.profile-main { flex: 1 1 240px; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.profile-facts { display: grid; grid-template-columns: max-content 1fr; gap: 2px 12px; margin: 8px 0; font-size: .925rem; }
.profile-facts dt { color: var(--jk-muted); font-weight: 400; }
.profile-facts dd { margin: 0; overflow-wrap: anywhere; }
/* The admins' list of emblems and their rules (Pages/Admin/Emblems.cshtml). */
.emblem-rules > li + li { border-top: 1px solid var(--jk-border); }
/* Emblems on the profile: an icon (emoji until they have images) with name and date. */
.emblem-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 8px; }
.emblem-list > li { border-radius: 10px; background: var(--jk-raised); }
.emblem summary { display: flex; align-items: center; gap: 10px; padding: 8px; cursor: pointer; list-style: none; }
.emblem summary::-webkit-details-marker { display: none; }
.emblem-list > li:has(> .emblem[open]) { grid-column: 1 / -1; } /* without script: the explanation gets the whole row */
/* The emblem sheet (site.js): slides up from the bottom on a phone, a dialog in the middle on a wide screen. */
.sheet { width: 100%; max-width: 480px; max-height: 85dvh; margin: auto auto 0; padding: 8px 20px calc(20px + env(safe-area-inset-bottom));
  border: 0; border-radius: 16px 16px 0 0; background: var(--jk-surface); color: var(--jk-text); overflow-y: auto; touch-action: pan-y; }
.sheet[open] { animation: sheet-up .2s ease-out; }
.sheet::backdrop { background: var(--jk-scrim); }
@keyframes sheet-up { from { transform: translateY(40px); opacity: 0; } }
@keyframes sheet-side { from { transform: translateX(40px); opacity: 0; } }
@media (min-width: 576px) { .sheet { margin: auto; border-radius: 16px; } }
.sheet-grip { width: 40px; height: 4px; margin: 2px auto 12px; border-radius: 2px; background: var(--jk-border-strong);
  box-shadow: 0 0 0 12px transparent; } /* a bigger area to grab */
.sheet-grip, .sheet .emblem-head { touch-action: none; } /* a drag here is the sheet's (swipe down to close) */
.sheet-close { position: absolute; top: 8px; right: 8px; }
.sheet .emblem-head { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; }
.sheet .emblem-head .emblem-icon { width: 76px; height: 88px; }
.sheet .emblem-head .emblem-tag { font-size: 12px; }
.sheet .emblem-head .emblem-name { font-size: 1.15rem; }
.sheet .emblem-why { padding: 14px 0 0; gap: 6px; font-size: .95rem; text-align: center; }
.emblem-why { padding: 0 10px 10px 58px; font-size: .875rem; display: flex; flex-direction: column; gap: 2px; }
/* An emblem's shield (Infrastructure/EmblemArt.cs): sized by .emblem-icon, coloured by its topic (.em-events …) and tier. */
.emblem-icon { flex: none; width: 40px; height: 47px; display: inline-block; }
.emblem-icon-sm { width: 22px; height: 26px; }
.notification-emblem { width: 40px; height: 47px; } /* a new emblem in the notifications: its shield where the picture would be */
.emblem-icon-xs { width: 16px; height: 19px; vertical-align: -4px; }
.emblem-art { position: relative; display: block; width: 100%; height: 100%; }
.emblem-art svg { display: block; width: 100%; height: 100%; overflow: visible; }
.em-shield { fill: var(--em-bg); stroke: var(--em-rim); stroke-width: 7; }
.em-icon { fill: none; stroke: var(--em-fg); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.emblem-tag { position: absolute; left: 50%; bottom: -5px; transform: translateX(-50%); padding: 0 5px; border-radius: 999px;
  font-size: 9px; font-weight: 700; line-height: 1.5; white-space: nowrap; background: var(--em-rim); color: var(--em-on-rim); }
.emblem-icon-sm .emblem-tag, .emblem-icon-xs .emblem-tag { display: none; }
.em-member { --em-bg: var(--jk-em-member-bg); --em-fg: var(--jk-em-member-fg); }
.em-events { --em-bg: var(--jk-em-events-bg); --em-fg: var(--jk-em-events-fg); }
.em-photos { --em-bg: var(--jk-em-photos-bg); --em-fg: var(--jk-em-photos-fg); }
.em-posts { --em-bg: var(--jk-em-posts-bg); --em-fg: var(--jk-em-posts-fg); }
.em-beers { --em-bg: var(--jk-em-beers-bg); --em-fg: var(--jk-em-beers-fg); }
.em-secret { --em-bg: var(--jk-em-secret-bg); --em-fg: var(--jk-em-secret-fg); }
.em-bronze { --em-rim: var(--jk-em-bronze); --em-on-rim: var(--jk-em-on-bronze); }
.em-silver { --em-rim: var(--jk-em-silver); --em-on-rim: var(--jk-em-on-silver); }
.em-gold { --em-rim: var(--jk-em-gold); --em-on-rim: var(--jk-em-on-gold); }
.em-club { --em-rim: var(--jk-em-club); --em-on-rim: var(--jk-em-on-club); }
.emblem-name { display: block; font-weight: 600; font-size: .875rem; line-height: 1.2; }
.emblem-date { display: block; font-size: 12px; color: var(--jk-muted); }
.emblem-times { color: var(--jk-accent-text); }
/* A year award's years, each with its count: small tiles that wrap. */
.emblem-years { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.emblem-years li { display: flex; flex-direction: column; align-items: center; min-width: 58px; padding: 6px 8px; border-radius: 8px;
  background: var(--jk-raised); line-height: 1.2; }
.emblem-years strong { font-size: .875rem; }
.emblem-years span { font-size: 12px; color: var(--jk-muted); }
.sheet .emblem-years { justify-content: center; }
/* Tavlen (Pages/Board.cshtml): this year's races, and the emblems with who has them. */
.race-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 8px; }
.race-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.race-list li { display: flex; align-items: center; gap: 8px; }
.race-list a { color: var(--jk-text); text-decoration: none; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.race-place { width: 1.5em; color: var(--jk-muted); font-variant-numeric: tabular-nums; }
.race-count { font-weight: 700; font-variant-numeric: tabular-nums; }
.race-list li.first .race-count { color: var(--jk-accent-text); }
.race-me { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--jk-border); }
.emblem-list > li.is-unearned .emblem-icon { filter: grayscale(1); opacity: .5; }
/* A profile's emblems as a wall of shields (4 a row on a phone): name under (two lines, hyphenated as Danish), the date
   and why in the sheet. */
.emblem-list.wall { grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 10px 4px; }
.emblem-list.wall > li { background: none; }
.emblem-list.wall .emblem summary { flex-direction: column; align-items: stretch; gap: 4px; padding: 6px 2px; text-align: center; border-radius: 10px; }
.emblem-list.wall .emblem-icon { align-self: center; }
.emblem-list.wall .emblem summary:hover { background: var(--jk-raised); }
.emblem-list.wall .emblem-icon { width: 46px; height: 54px; }
.emblem-list.wall .emblem-name { font-size: 12px; font-weight: 500; line-height: 1.2; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; hyphens: auto; }
.emblem-list.wall .emblem-times { display: block; font-size: 11px; margin-top: -2px; } /* its own line, not one of the name's two */
.emblem-list.wall .emblem-date { display: none; }
.sheet .emblem-head .emblem-date { display: block; } /* in the sheet the date is back */
.emblem-ladder { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 8px; text-align: left; }
.emblem-ladder li { padding-left: 12px; border-left: 3px solid var(--jk-border-strong); }
.emblem-ladder li.is-ahead { border-left-style: dashed; color: var(--jk-muted); }
/* A ladder's levels under its shield on the wall: one dot each, filled when reached (Profile.cshtml). */
.emblem-dots { display: flex; justify-content: center; gap: 3px; margin-top: 3px; }
.emblem-dots i { width: 6px; height: 6px; border-radius: 50%; border: 1px solid var(--jk-muted); }
.emblem-dots i.on { background: var(--jk-accent-text); border-color: var(--jk-accent-text); }
.holder-list { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.holder-list li { display: flex; align-items: center; gap: 8px; text-align: left; }
.holder-years { display: block; font-size: 12px; color: var(--jk-muted); }
.sheet .holder-list { align-items: flex-start; width: fit-content; margin-inline: auto; } /* one block, centred; rows aligned */
/* The profile's numbers (Pages/Members/Profile.cshtml): one card, cells parted by 1px lines (the card's border colour
   showing through the gap); six in a row on a wide screen, three by two on a phone. */
.stats { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 1px; background: var(--jk-border);
  border: 1px solid var(--jk-border); border-radius: 12px; overflow: hidden; }
.stats > * { background: var(--jk-surface); padding: 8px 4px; display: flex; flex-direction: column; align-items: center;
  text-align: center; color: inherit; text-decoration: none; min-width: 0; }
.stats strong { font-size: 1.1rem; line-height: 1.2; }
.stats span { font-size: 12px; color: var(--jk-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.stats > a:hover { background: var(--jk-raised); }
.stats > a:hover span { color: var(--jk-accent-text); }
@media (max-width: 767.98px) { .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
/* Admins' "Overblik" (Pages/Admin/Index): three numbers to a row on any screen, and its charts (Pages/Admin/Charts.cs).
   Marks are thin with rounded data ends on a shared baseline, 2px apart; the colours are the --jk-chart tokens, chosen
   against each theme's surface. An event's answers use the RSVP buttons' colours: blue, amber and grey (blue and amber
   pass colour-blind checks; the legend gives every count, so colour is never alone). */
.stats.stats-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stats strong small { font-size: .7em; font-weight: 400; color: var(--jk-muted); }
/* "Tidligere medlemmer" on Medlemmer: a heading like the others that opens the list (folded by default). */
.member-former summary { cursor: pointer; list-style: none; margin-bottom: .5rem; }
.member-former summary::-webkit-details-marker { display: none; }
.member-former summary::after { content: " ›"; display: inline-block; transition: transform .15s; }
.member-former[open] summary::after { transform: rotate(90deg); }
.overview-names { margin-top: 10px; font-size: .875rem; }
.overview-names summary { cursor: pointer; color: var(--jk-accent-text); list-style: none; }
.overview-names summary::-webkit-details-marker { display: none; }
.overview-names summary::after { content: " ›"; }
.overview-names[open] summary::after { content: " ‹"; }
.overview-rows li + li { margin-top: 6px; }
.overview-events li + li { margin-top: 14px; }

.chart-columns { margin: 14px 0 0; }
.chart-plot { position: relative; height: 84px; padding-top: 14px; border-bottom: 1px solid var(--jk-border-strong); }
.chart-plot::before { content: ""; position: absolute; left: 0; right: 0; top: 14px; border-top: 1px dashed var(--jk-border); }
.chart-max { position: absolute; left: 0; top: -2px; font-size: 11px; line-height: 1; color: var(--jk-muted); font-variant-numeric: tabular-nums; }
.chart-bars { position: relative; display: flex; align-items: flex-end; gap: 2px; height: 100%; }
.chart-bars > span { flex: 1 1 0; height: 100%; display: flex; align-items: flex-end; min-width: 0; }
.chart-bars i { display: block; width: 100%; min-height: 2px; background: var(--jk-chart); border-radius: 4px 4px 0 0; }
.chart-bars i.zero { height: 2px; background: var(--jk-chart-track); border-radius: 0; }
.chart-bars > span:hover i { opacity: .75; }
.chart-axis { display: flex; justify-content: space-between; margin-top: 4px; font-size: 11px; color: var(--jk-muted); }

.chart-meters { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: auto minmax(60px, 1fr) auto;
  column-gap: 12px; row-gap: 10px; align-items: center; font-size: .875rem; }
.chart-meters li { display: contents; }
.chart-meters .name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chart-meters .track { display: block; height: 8px; border-radius: 4px; background: var(--jk-chart-track); overflow: hidden; }
.chart-meters .track i { display: block; height: 100%; background: var(--jk-chart); border-radius: 4px; }
.chart-meters .figure { text-align: right; color: var(--jk-muted); font-variant-numeric: tabular-nums; white-space: nowrap; }

.chart-split { display: flex; gap: 2px; height: 8px; margin: 6px 0 4px; border-radius: 4px; overflow: hidden; }
.chart-split i, .chart-legend i { display: block; background: var(--jk-chart-track); }
.chart-split i { flex-basis: 0; min-width: 4px; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; }
.chart-legend span { display: inline-flex; align-items: center; gap: 6px; }
.chart-legend i { width: 10px; height: 10px; border-radius: 3px; }
.chart-legend .unanswered { box-shadow: inset 0 0 0 1px var(--jk-border-strong); }
.chart-split .going, .chart-legend .going { background: var(--jk-chart-yes); }
.chart-split .maybe, .chart-legend .maybe { background: var(--jk-chart-maybe); }
.chart-split .not-going, .chart-legend .not-going { background: var(--jk-chart-no); }
.rsvp-going-label { color: var(--jk-accent-text); }
/* A member's posts and events on their profile: by year, each row with a date tile, a thumbnail or an icon. */
.profile-list { list-style: none; margin: 0; padding: 0; overflow: hidden; }
.profile-list > li + li { border-top: 1px solid var(--jk-border); }
.profile-year { padding: 10px 12px 6px; font-size: 12px; font-weight: 600; letter-spacing: .06em; color: var(--jk-muted); background: var(--jk-raised); }
.profile-list a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; color: var(--jk-text); text-decoration: none; }
.profile-list a:hover { background: var(--jk-raised); }
.profile-thumb, .profile-kind { flex: none; width: 44px; height: 44px; border-radius: 8px; }
.profile-thumb { object-fit: cover; background: var(--jk-raised); }
.profile-kind { display: grid; place-items: center; background: var(--jk-raised); color: var(--jk-accent-text); }
.profile-kind svg { width: 20px; height: 20px; }
.profile-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.profile-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-meta { font-size: .8125rem; color: var(--jk-muted); }
.profile-comments { flex: none; font-size: .8125rem; color: var(--jk-muted); }
.birthday-card { flex-direction: row; align-items: center; gap: 10px; padding: 10px 12px; --bs-card-bg: var(--jk-amber-bg); --bs-card-border-color: var(--jk-amber-border); }
.birthday-card a:not(.btn) { color: var(--jk-text); }
.birthday-card .text-muted { color: var(--jk-amber-text) !important; }
/* Betaling */
.payment-facts { display: grid; grid-template-columns: max-content 1fr; gap: 2px 12px; margin: 0 0 8px; }
.payment-facts dt { color: var(--jk-muted); font-weight: 400; }
.payment-facts dd { margin: 0; overflow-wrap: anywhere; }
.payment-copy { min-width: 150px; }
.payment-copy .form-control { font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.payment-form .reg-field { width: 7.5rem; flex-shrink: 0; }
.rules h2 { font-size: 1.1rem; margin-top: 1.25rem; }
.rules h2:first-child { margin-top: 0; }
/* Rules as sections (Pages/Rules/RulesDocument): each § with its number in a column and its date below. */
.rules-section { scroll-margin-top: 72px; }
.rules-section h2.menu-heading { font-size: 12px; margin: 0 4px 6px; }
.rule { display: grid; grid-template-columns: 3.25rem 1fr; gap: 0 4px; padding: 12px 16px 12px 10px; scroll-margin-top: 72px; }
.rule + .rule { border-top: 1px solid var(--jk-border); }
.rule-number { color: var(--jk-accent-text); font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; text-align: right; padding-right: 10px; }
.rule-text .post-body > :last-child { margin-bottom: 0; }
.rule-adopted { margin-top: 4px; color: var(--jk-muted); font-size: .8rem; }
.rule:target { background: var(--jk-raised); }
.list-links { overflow: hidden; }
.list-links a { display: block; padding: 10px 12px; min-height: 40px; color: var(--jk-text); text-decoration: none; }
.list-links a + a { border-top: 1px solid var(--jk-border); }
.list-links a:hover { background: var(--jk-raised); }
/* Mig: the menu in groups, each row with an icon and an arrow. */
.menu-heading { margin: 0 4px 6px; font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--jk-muted); }
.menu-list a { display: flex; align-items: center; gap: 12px; }
.menu-icon { flex: none; display: grid; place-items: center; width: 22px; color: var(--jk-accent-text); }
.menu-icon svg { width: 18px; height: 18px; }
.menu-arrow { color: var(--jk-muted); font-size: 1.25rem; line-height: 1; }

/* Bootstrap compiles these colours in instead of reading --bs-primary */
.form-check-input { background-color: var(--jk-input); border-color: var(--jk-border-strong); }
.form-check-input:checked { background-color: var(--jk-accent); border-color: var(--jk-accent); }
.form-check-input:focus { border-color: var(--jk-accent-text); box-shadow: none; }
.topbar-right a { text-decoration: none; }

.gallery-cover-preview { width: 96px; height: 72px; object-fit: cover; border-radius: 6px; flex-shrink: 0; }

/* Staging only (Site:EnvironmentBanner): impossible to mistake for the real site. */
.environment-banner { background: var(--jk-staging-bg); color: var(--jk-staging-text); text-align: center;
  font-size: .8125rem; font-weight: 600; padding: 4px 16px; }

/* Theme menu (header) */
.theme-menu { margin-left: -12px; }
.theme-menu .dropdown-item { display: flex; align-items: center; gap: 8px; min-height: 40px; }
.theme-menu .dropdown-item .check { width: 16px; visibility: hidden; }
.theme-menu .dropdown-item[aria-checked="true"] .check { visibility: visible; }
.theme-menu .theme-hint { max-width: 220px; white-space: normal; padding-top: 8px; border-top: 1px solid var(--jk-border); margin-top: 4px; }
.theme-swatch { width: 14px; height: 14px; border-radius: 4px; border: 1px solid var(--jk-border-strong); }

/* Jumping to a post, comment or section (after a form without JavaScript, or a link): clear the sticky header. */
article[id], [id^="comment-"], section[id] { scroll-margin-top: calc(var(--jk-topbar-height) + 16px); }

/* Photo viewer (site.js): post and comment images open full screen in the site, not in a new tab. */
.viewer { width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0;
  background: #000; color: #fff; overscroll-behavior: contain; overflow: hidden; }
/* Drags are the viewer's (swipe to move, down to close; site.js); pinching still zooms. */
.viewer { touch-action: pinch-zoom; }
.viewer > img.settling { transition: transform .2s ease-out, opacity .2s ease-out; }
.viewer::backdrop { background: #000; }
.viewer > img { position: absolute; inset: 0; margin: auto; max-width: 100%; max-height: 100%; object-fit: contain;
  touch-action: pan-y pinch-zoom; user-select: none; -webkit-user-select: none; }
.viewer > button { position: absolute; z-index: 1; display: flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border: 0; border-radius: 50%; background: rgba(0, 0, 0, .45); color: #fff; padding: 0; }
.viewer > button:hover { background: rgba(0, 0, 0, .7); }
.viewer > button svg { width: 22px; height: 22px; }
.viewer > .close { top: max(12px, env(safe-area-inset-top)); right: 12px; }
.viewer > .prev, .viewer > .next { top: 50%; transform: translateY(-50%); }
.viewer > .prev { left: 12px; }
.viewer > .next { right: 12px; }
.viewer .count { position: absolute; z-index: 1; top: max(20px, calc(env(safe-area-inset-top) + 8px)); left: 0; right: 0;
  text-align: center; font-size: .875rem; pointer-events: none; text-shadow: 0 1px 2px #000; }
@media (hover: none) { .viewer > .prev, .viewer > .next { display: none; } } /* swipe instead */
.viewer .info { position: absolute; z-index: 1; left: 0; right: 0; bottom: 0; display: flex; align-items: center; gap: 12px;
  padding: 24px 16px max(14px, env(safe-area-inset-bottom)); background: linear-gradient(transparent, rgba(0, 0, 0, .7));
  font-size: .875rem; }
.viewer .info[hidden] { display: none; }
.viewer .info .tags { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.viewer .info .comments { flex-shrink: 0; padding: 6px 12px; border-radius: 16px; background: rgba(255, 255, 255, .15);
  color: #fff; text-decoration: none; }
.viewer .info .comments:hover { background: rgba(255, 255, 255, .25); }
/* The photo's 🍺 in the bar (site.js): filled in when you've given one. */
/* The club's beer (Icons.Beer) sits in the text like an emoji. */
.beer-icon { width: 1.15em; height: 1.15em; vertical-align: -.22em; flex: none; display: inline-block; }
.viewer, .beer-pop, .photo-thumb .badge { --jk-beer-handle: #C9D1DC; } /* on black (the viewer, a photo's badge), whatever the theme */
.viewer .info .beer { flex-shrink: 0; padding: 6px 12px; border: 0; border-radius: 16px; background: rgba(255, 255, 255, .15); color: #fff; font: inherit; }
.viewer .info .beer:hover { background: rgba(255, 255, 255, .25); }
.viewer .info .beer.mine { background: var(--jk-beer-given); }
/* A double tap on the photo: a 🍺 pops up on it and fades. */
.beer-pop { position: fixed; z-index: 3; font-size: 88px; color: #E8EAED; line-height: 1; pointer-events: none; transform: translate(-50%, -50%);
  animation: beer-pop .8s ease-out forwards; filter: drop-shadow(0 2px 8px rgba(0, 0, 0, .5)); }
@keyframes beer-pop {
  0% { transform: translate(-50%, -50%) scale(.4); opacity: 0; }
  25% { transform: translate(-50%, -50%) scale(1.15); opacity: 1; }
  60% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
  100% { transform: translate(-50%, -65%) scale(1); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) { .beer-pop { animation: beer-fade .8s ease-out forwards; } }
@keyframes beer-fade { 0%, 50% { opacity: 1; } 100% { opacity: 0; } }
/* The 🍺 row at the top of the sheet. */
.photo-beers { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.photo-beers form { display: contents; }
.beer-toggle { min-height: 36px; padding: 4px 14px; border: 1px solid var(--jk-border-strong); border-radius: 18px; background: transparent; color: var(--jk-text); }
.beer-toggle:hover { background: var(--jk-raised); }
.beer-toggle.mine { background: var(--jk-accent-soft); border-color: var(--jk-accent); }
.beer-from { color: var(--jk-muted); font-size: .875rem; }
/* The photo's comments in the viewer (site.js): a sheet under the photo on a phone, a panel beside it on a wide screen.
   The photo makes room for it; swiping sideways still moves through the gallery. Looks and closes like the emblem
   sheet (.sheet): its grip, rounding, padding, ✕ and slide up; dragged down from the grip or head it closes. Its own:
   a fixed height (the photo keeps its place above it), no dimming (the photo is what you're looking at). */
.viewer-sheet { position: absolute; z-index: 2; left: 0; right: 0; bottom: 0; height: 58dvh; display: flex; flex-direction: column;
  background: var(--jk-surface); color: var(--jk-text); border-radius: 16px 16px 0 0; box-shadow: 0 -4px 24px rgba(0, 0, 0, .4); touch-action: auto;
  animation: sheet-up .2s ease-out; }
.viewer-sheet[hidden] { display: none; }
.viewer-sheet .sheet-grip { flex: none; margin: 8px auto 0; }
.viewer-sheet .sheet-grip, .viewer-sheet .sheet-head { touch-action: none; } /* a drag here is the sheet's */
.viewer-sheet .sheet-head { display: flex; align-items: center; gap: 4px; padding: 0 8px 0 20px; }
.viewer-sheet .sheet-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-weight: 600; color: var(--jk-text); text-decoration: none; }
.viewer-sheet a.sheet-title[href]:hover { text-decoration: underline; }
.viewer-sheet .sheet-menu:empty { display: none; }
.viewer-sheet .sheet-body { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain;
  padding: 4px 20px max(20px, env(safe-area-inset-bottom)); }
/* The photo page's comments and who's on it, one under the other. */
.viewer-sheet .sheet-body > article { width: auto; max-width: none; padding: 0; margin: 0; }
.viewer-sheet .sheet-body > article + article { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--jk-border); }
/* Opened at a comment (a notification, the feed): it lights up a moment. */
.viewer-sheet .jumped-to { animation: jumped-to 2.4s ease-out; border-radius: 12px; }
@keyframes jumped-to { 0%, 40% { background: var(--jk-accent-soft); } 100% { background: transparent; } }
.viewer-sheet .sheet-body.loading { opacity: .5; }
.viewer.sheet-open > img { bottom: 58dvh; max-height: 42dvh; } /* % would be of the whole screen */
.viewer.sheet-open > .info { display: none; }
@media (min-width: 768px) {
  .viewer-sheet { left: auto; top: 0; width: 400px; height: auto; border-radius: 0; box-shadow: -4px 0 24px rgba(0, 0, 0, .4);
    animation-name: sheet-side; }
  .viewer-sheet .sheet-grip { display: none; } /* a panel at the side: closed with ✕ or Esc */
  .viewer-sheet .sheet-head { padding-top: 8px; }
  .viewer.sheet-open > img { bottom: 0; right: 400px; max-height: 100%; max-width: calc(100% - 400px); }
  .viewer.sheet-open > .close, .viewer.sheet-open > .next { right: 412px; }
  .viewer.sheet-open > .count { right: 400px; }
}

/* iPhone Safari zooms into any field whose text is under 16 px when it's tapped, and the site's text is 15 px.
   On touch screens, fields use 16 px. (Blocking zoom in the viewport tag would also stop pinch-zoom on Android.)
   !important: it must win over the smaller sizes given to particular fields, like the composer's. */
@media (pointer: coarse) {
  input:not([type="checkbox"]):not([type="radio"]):not([type="range"]), textarea, select, .form-control, .form-select {
    font-size: 16px !important;
  }
}

/* Editing a post's or comment's images (_EditImages): tick to remove; a ticked one is dimmed. */
.edit-images { display: flex; flex-wrap: wrap; gap: 8px; }
.edit-image { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; width: 96px;
  font-size: .8125rem; color: var(--jk-muted); cursor: pointer; }
.edit-image img { width: 96px; height: 96px; object-fit: cover; border-radius: 8px; background: var(--jk-raised); transition: opacity .15s; }
.edit-image input { position: absolute; top: 6px; right: 6px; width: 20px; height: 20px; accent-color: var(--jk-accent); }
.edit-image:has(input:checked) img { opacity: .35; }
.edit-image:has(input:checked) span { color: var(--jk-danger-text); font-weight: 600; }

/* ---- Loading bar and pull to refresh (site.js) ---- */
/* Waits a moment before showing, so quick pages don't flash it. */
.page-loading { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 2000; pointer-events: none; overflow: hidden; visibility: hidden; }
.page-loading.active { visibility: visible; animation: page-loading-show 0s .15s both; }
.page-loading::after { content: ""; position: absolute; inset: 0; width: 35%; background: var(--jk-accent-text); border-radius: 0 2px 2px 0; animation: page-loading 1.1s ease-in-out infinite; }
@keyframes page-loading-show { from { visibility: hidden; } to { visibility: visible; } }
@keyframes page-loading { from { transform: translateX(-100%); } to { transform: translateX(300%); } }
@media (prefers-reduced-motion: reduce) { .page-loading::after { animation: none; width: 100%; opacity: .6; } }

.pull-refresh { position: fixed; top: calc(env(safe-area-inset-top) + 4px); left: 50%; z-index: 2000; width: 38px; height: 38px; margin-left: -19px;
  display: grid; place-items: center; border-radius: 50%; background: var(--jk-surface); color: var(--jk-muted);
  border: 1px solid var(--jk-border); box-shadow: 0 2px 8px rgba(0, 0, 0, .25); pointer-events: none;
  opacity: 0; transform: translateY(calc(var(--pull, 0px) - 46px)); transition: transform .2s, opacity .2s, color .15s; }
.pull-refresh.pulling { opacity: 1; transition: color .15s; }
.pull-refresh.ready, .pull-refresh.reloading { color: var(--jk-accent-text); }
.pull-refresh svg { transform: rotate(var(--turn, 0deg)); }
.pull-refresh.reloading svg { animation: pull-spin .8s linear infinite; }
@keyframes pull-spin { to { transform: rotate(360deg); } }

/* ---- Hidden content (admins see it dimmed; members don't get it at all) ---- */
/* The content is dimmed; its label (.hidden-note) stays readable. */
.is-hidden { opacity: .55; }
.post-card.is-hidden, .comment.is-hidden, .is-hidden:has(> .hidden-note) { opacity: 1; }
.post-card.is-hidden > :not(.post-head):not(.hidden-note), .comment.is-hidden .comment-main > :not(.hidden-note):not(.comment-meta),
.is-hidden:has(> .hidden-note) > .post-body { opacity: .55; }
.hidden-note { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-size: .8125rem; color: var(--jk-amber-text);
  background: var(--jk-amber-bg); border: 1px solid var(--jk-amber-border); border-radius: 8px; padding: 4px 10px; margin: 6px 0; }
.hidden-note .link-btn { color: inherit; text-decoration: underline; }
.chip.is-hidden { text-decoration: line-through; }
.hidden-list > li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0; border-top: 1px solid var(--jk-border); }
.hidden-list > li:first-child { border-top: 0; }
.hidden-list > li.is-hidden { opacity: 1; }
.hidden-list > li.is-hidden > div { opacity: .55; }
/* A person on a photo (Galleries/Photo): name, then its small buttons (hide for admins, ×). */
.tag-chip { gap: 2px; padding-left: 4px; padding-right: 4px; }
.tag-chip .avatar { margin-right: 4px; }
.tag-chip .tag-name { margin-right: 2px; }
.tag-chip form { display: contents; }
.tag-chip button { border: 0; background: transparent; color: var(--jk-muted); display: grid; place-items: center; width: 26px; height: 26px; padding: 0; border-radius: 50%; }
.tag-chip button:hover { color: var(--jk-text); background: var(--jk-surface); }
.tag-chip svg { width: 14px; height: 14px; }
.photo-people .chips form { display: contents; }
/* Marking people: "Jeg er med" and "Markér andre", which opens a list to search in (site.js). */
.tag-actions { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 8px; }
.tag-actions form { display: contents; }
.tag-me { display: inline-flex; align-items: center; gap: 6px; }
.tag-picker { flex: 1 1 100%; }
.tag-picker > summary { list-style: none; display: inline-flex; }
.tag-picker > summary::-webkit-details-marker { display: none; }
.tag-picker[open] > summary { background: var(--jk-raised); }
.tag-picker-panel { margin-top: 8px; padding: 8px; border: 1px solid var(--jk-border); border-radius: 12px; background: var(--jk-surface); }
.tag-options { list-style: none; margin: 6px 0 0; padding: 0; max-height: 240px; overflow-y: auto; overscroll-behavior: contain; }
.tag-options li[hidden] { display: none; }
.tag-option { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; padding: 6px 8px; border: 0; border-radius: 8px;
  background: transparent; color: var(--jk-text); text-align: left; }
.tag-option:hover, .tag-option:focus-visible { background: var(--jk-raised); outline: none; }
.tag-none { padding: 8px; }
.photo-facts { display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; }
.photo-facts dt { font-weight: 500; color: var(--jk-muted); }
.photo-facts dd { margin: 0; }
.photo-thumb .photo-hidden-badge { left: .25rem; top: .25rem; right: auto; bottom: auto; opacity: 1; }

/* ---- Important dates and the planner's list (events page, event forms) ---- */
.planner { border: 1px solid var(--jk-border); border-radius: 12px; padding: 12px; background: var(--jk-surface); }
.planner-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 8px; }
.planner-status { font-size: .9rem; border-radius: 8px; padding: 8px 12px; margin-bottom: 10px; color: var(--jk-muted);
  background: var(--jk-raised); }
.planner-status.free { background: var(--jk-accent-soft); color: var(--jk-text); }
.planner-status.clash { background: var(--jk-amber-bg); border: 1px solid var(--jk-amber-border); color: var(--jk-amber-text); }
.planner-status-head { font-weight: 600; }
.planner-status ul { margin-top: 4px; }
.planner-list { max-height: 280px; overflow-y: auto; overscroll-behavior: contain; position: relative; }
.planner-month { position: sticky; top: 0; background: var(--jk-surface); font-size: .75rem; font-weight: 600; letter-spacing: .04em;
  text-transform: uppercase; color: var(--jk-muted); padding: 6px 0 4px; }
.planner-day { display: flex; gap: 10px; align-items: flex-start; padding: 5px 6px; border-radius: 8px; }
.planner-day + .planner-day { border-top: 1px solid var(--jk-border); }
.planner-date { flex: 0 0 2.6rem; display: flex; flex-direction: column; align-items: center; line-height: 1.1; }
.planner-date .wd { font-size: .7rem; text-transform: uppercase; color: var(--jk-muted); }
.planner-date .dn { font-size: 1.05rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.planner-day.weekend .wd { color: var(--jk-accent-text); }
.planner-items { display: flex; flex-direction: column; font-size: .9rem; padding-top: 2px; }
.planner-item a { color: inherit; text-decoration: none; }
.planner-item a:hover { text-decoration: underline; }
.planner-day.near { background: var(--jk-accent-soft); }
.planner-day.picked { background: var(--jk-amber-bg); box-shadow: inset 3px 0 0 var(--jk-amber-border); }

/* ---- A topic's description: under the chips when filtered, under the topic dropdowns ---- */
.tag-description { font-size: .875rem; color: var(--jk-muted); }
.composer .tag-description { padding: 0 4px; }

/* ---- Admin: topics ---- */
.topic-list > li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 12px; padding: 10px 0; border-top: 1px solid var(--jk-border); }
.topic-list > li:first-child { border-top: 0; }
.topic-list > li.is-hidden { opacity: 1; }
.topic-list > li.is-hidden .topic-text { opacity: .6; }
.topic-text { flex: 1 1 16rem; min-width: 0; }
.topic-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: flex-start; }
.year-input { width: 6.5rem; }

/* An in-place form's error (site.js): just above the form, in the card. */
.inplace-error { font-size: .875rem; color: var(--jk-danger-text); background: var(--jk-danger-bg);
  border-radius: 8px; padding: 6px 10px; margin-bottom: 6px; }
.inplace-error .alert { all: unset; display: block; }

/* ---- Admin rights switched on (AdminActivations): a bar on every page ---- */
.admin-bar { max-width: 680px; margin: 0 auto 12px; display: flex; align-items: center; gap: 8px; padding: 6px 12px;
  border-radius: 10px; font-size: .875rem; background: var(--jk-accent-soft); color: var(--jk-accent-text); }
.admin-bar svg { width: 16px; height: 16px; flex: none; }
.admin-bar span { flex: 1; }
.admin-bar form { margin: 0; }
.admin-bar .link-btn { color: inherit; font-weight: 600; }

/* ---- A gallery's photo-comment card in the feed ---- */
.photo-comments-icon { flex: none; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center;
  background: var(--jk-accent-soft); color: var(--jk-accent-text); }
.photo-comments-icon svg { width: 20px; height: 20px; }
.photo-comments-group { padding-left: 12px; padding-right: 12px; }
.photo-comments-group.with-thumb { flex-direction: row; gap: 10px; align-items: flex-start; }
.photo-comments-group .comment-meta a { color: inherit; text-decoration: none; }
.photo-comments-list { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 8px; }
.photo-comment-thumb { flex: none; }
.photo-comment-thumb img { width: 72px; height: 72px; object-fit: cover; border-radius: 8px; display: block; }
.photo-comments-more { padding: 0 12px 12px; }

/* ---- "Del dine billeder fra …" at the top of the feed ---- */
.share-prompt { padding: 12px; border-color: var(--jk-accent-text); background: var(--jk-accent-soft); }
.share-prompt-icon { flex: none; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center;
  background: var(--jk-surface); color: var(--jk-accent-text); }
.poll-result { font-weight: 600; font-size: .925rem; padding: 6px 10px; border-radius: 8px; background: var(--jk-accent-soft); margin-bottom: 6px; }

/* ---- countdown before the site opens (/soon) ---- */
.login-page { margin-top: 6vh; }
.countdown-page { max-width: 34rem; margin: 6vh auto 0; display: flex; flex-direction: column; align-items: center; gap: 1.5rem; }
.countdown-text { font-size: clamp(1.5rem, 6vw, 2.25rem); margin: 0; }
.countdown { display: flex; gap: .75rem; justify-content: center; }
.countdown-part { display: flex; flex-direction: column; align-items: center; min-width: 4.25rem; padding: .75rem .5rem;
  border-radius: 12px; background: var(--jk-raised); }
.countdown-value { font-size: clamp(1.75rem, 8vw, 2.75rem); font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1.1; }
.countdown-label { font-size: .8rem; color: var(--jk-muted); }

/* ---- passkey offer after a password login (Pages/Account/PasskeyOffer) ---- */
.passkey-offer { margin-top: 6vh; }
.passkey-offer-icon { display: inline-flex; align-items: center; justify-content: center; width: 56px; height: 56px; margin: 0 auto 1rem;
  border-radius: 50%; background: var(--jk-accent-soft); color: var(--jk-accent); }
.passkey-offer-icon svg { width: 28px; height: 28px; }

/* ---- calendar timeline (Pages/Events) ---- */
/* Kalender's "Kommende": one timeline by month; events as cards, birthdays and dates as lines, all with the date column
   (.planner-date, as on the event forms). */
.cal-timeline { display: flex; flex-direction: column; gap: 14px; }
.cal-past { gap: 4px; } /* one event a month or so: no month headings, just the cards */
.cal-month { font-size: .75rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--jk-muted); margin: 0 0 4px; }
.cal-day { display: flex; gap: 10px; align-items: flex-start; padding: 4px 0; }
.cal-day.has-event { padding: 6px 0; }
.cal-day.has-event > .planner-date { padding-top: 12px; }
.cal-day.today .wd { color: var(--jk-accent-text); font-weight: 600; text-transform: none; }
.cal-day-items { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; padding-top: 3px; }
.cal-day.has-event .cal-day-items { padding-top: 0; }
.cal-event { background: var(--jk-surface); border: 1px solid var(--jk-border); border-radius: 12px; overflow: hidden; box-shadow: var(--jk-card-shadow); }
.cal-note { font-size: .9rem; }
.cal-day.has-event .cal-note { padding-left: 12px; }
.cal-note a { color: inherit; text-decoration: none; }
.cal-note a:hover { text-decoration: underline; }
.cal-links a { color: var(--jk-accent-text); }

.event-row { display: flex; gap: 12px; align-items: center; padding: 10px 12px; color: var(--jk-text); text-decoration: none; }
.event-row:hover { background: var(--jk-raised); color: var(--jk-text); }
.event-row-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.event-row-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.event-row-meta { font-size: .85rem; color: var(--jk-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.event-row-meta span:first-child::first-letter { text-transform: uppercase; }
.event-row-people { display: flex; align-items: center; gap: 6px; margin-top: 2px; min-height: 24px; }
.event-row.cancelled .event-row-title { color: var(--jk-muted); }
.event-row-mine { flex: none; width: 28px; height: 28px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  background: var(--jk-accent-soft); color: var(--jk-accent-text); font-weight: 700; }
.avatar-more { width: 24px; height: 24px; margin-left: -8px; border-radius: 50%; border: 2px solid var(--jk-surface); background: var(--jk-raised);
  color: var(--jk-muted); font-size: 10px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.year-summary { display: flex; flex-wrap: wrap; gap: 4px 0; align-items: baseline; color: var(--jk-muted); font-size: .9rem; }
.year-summary strong { color: var(--jk-text); font-size: 1.25rem; margin-right: 10px; }
.year-summary span + span::before { content: "·"; margin: 0 6px; }

/* Help (Pages/Help): questions that open on tap, in a card like the Mig menu. */
.faq details + details { border-top: 1px solid var(--jk-border); }
.faq summary { display: flex; align-items: center; gap: 12px; padding: 12px 16px; cursor: pointer; font-weight: 500; scroll-margin-top: 72px; }
.faq-arrow { color: var(--jk-muted); font-size: 1.25rem; line-height: 1; transition: transform .15s; }
.faq details[open] .faq-arrow { transform: rotate(90deg); }
.faq-body { padding: 0 16px 14px; }
.faq-body ul { padding-left: 1.2rem; margin-bottom: .75rem; }

/* An image that never came over from the old site (Shared/_MissingImages): a dashed box where it would be. */
.missing-images { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.post-card > .missing-images { margin: 0 12px 10px; }
.image-missing { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border: 1px dashed var(--jk-border-strong); border-radius: 10px;
  color: var(--jk-muted); font-size: .85rem; background: var(--jk-raised); max-width: 100%; }
.image-missing svg { flex: none; width: 18px; height: 18px; }
.image-missing-name { display: block; font-size: .75rem; overflow-wrap: anywhere; }

/* ---- Search: the kinds found, as chips that jump to each list ---- */
.chip-count { margin-left: 6px; color: var(--jk-muted); font-variant-numeric: tabular-nums; }
.search-section { scroll-margin-top: calc(var(--jk-topbar-height) + 16px); }

/* Year chips under the profile's tabs (_YearChips, Small): a level below, so smaller. */
.chips-small .chip { min-height: 30px; padding: 0 11px; font-size: .875rem; }

/* ---- "Gemt." after a save (Infrastructure/Saved.cs): over the page, under the top bar, gone after a few seconds ---- */
.saved-notice { position: fixed; z-index: 1050; left: 50%; top: calc(var(--jk-topbar-height) + env(safe-area-inset-top) + 12px);
  transform: translateX(-50%); display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px; border-radius: 20px;
  background: var(--jk-surface); color: var(--jk-text); border: 1px solid var(--jk-border-strong); box-shadow: 0 6px 20px var(--jk-shadow);
  font-size: .9375rem; font-weight: 500; pointer-events: none; animation: saved-notice 3.2s ease forwards; }
.saved-notice svg { flex: none; color: var(--jk-accent-text); }
.saved-notice { max-width: calc(100vw - 32px); }
@keyframes saved-notice { 0% { opacity: 0; transform: translate(-50%, -6px); } 8%, 80% { opacity: 1; transform: translate(-50%, 0); } 100% { opacity: 0; visibility: hidden; } }
@media (prefers-reduced-motion: reduce) { @keyframes saved-notice { 0%, 85% { opacity: 1; } 100% { opacity: 0; visibility: hidden; } } }

/* ---- Mig (Pages/Me/Index) ---- */
.min-w-0 { min-width: 0; }
.me-emblems { display: flex; align-items: center; gap: 6px; color: var(--jk-text); text-decoration: none; }
.me-emblems .small { margin-left: 4px; color: var(--jk-accent-text); }
/* Kom i gang */
.me-progress { height: 6px; border-radius: 3px; background: var(--jk-raised); overflow: hidden; margin-bottom: 8px; }
.me-progress span { display: block; height: 100%; background: var(--jk-accent); border-radius: 3px; }
.me-steps { list-style: none; margin: 0; padding: 0; }
.me-steps a { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 4px 0; color: var(--jk-text); text-decoration: none; }
.me-steps li + li { border-top: 1px solid var(--jk-border); }
.me-step-mark { flex: none; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--jk-border-strong); }
.me-step-mark svg { width: 14px; height: 14px; }
.me-steps .is-done .me-step-mark { background: var(--jk-accent); border-color: var(--jk-accent); color: var(--jk-on-accent); }
.me-steps .is-done a { color: var(--jk-muted); }
/* Det næste for dig */
.me-next { list-style: none; margin: 0; padding: 0; }
.me-next li + li { border-top: 1px solid var(--jk-border); }
.me-next-event { display: flex; align-items: center; gap: 12px; padding: 10px var(--jk-card-x); color: var(--jk-text); text-decoration: none; }
/* Dit år i klubben */
.me-year { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.me-number { display: flex; flex-direction: column; padding: 12px; color: var(--jk-text); text-decoration: none; }
.me-number strong { font-size: 1.6rem; line-height: 1.1; font-variant-numeric: tabular-nums; }
.me-number:hover { background: var(--jk-raised); }
/* Klubben: tiles */
.me-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.me-tile { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 76px; padding: 10px 6px;
  border-radius: 12px; background: var(--jk-surface); border: 1px solid var(--jk-border); color: var(--jk-text); text-decoration: none; font-size: .875rem; text-align: center; }
.me-tile:hover { background: var(--jk-raised); }
.me-tile .menu-icon svg { width: 22px; height: 22px; }

/* Aktivitet (admin): a strip of the last 30 days, one bar per day */
.activity-strip { display: flex; gap: 2px; margin-top: 4px; }
.activity-strip span { flex: 1 1 0; max-width: 8px; height: 12px; border-radius: 2px; background: var(--jk-raised); }
.activity-strip span.on { background: var(--jk-accent); }
.activity-totals { grid-template-columns: repeat(3, minmax(0, 1fr)); }
/* "Opslag til alle" (Components/Announcement): a card in the middle, over a scrim when site.js opens it as a modal.
   Without script it's rendered open (not modal): fixed over the top of the page instead. */
.announcement { width: calc(100% - 32px); max-width: 440px; max-height: 85dvh; padding: 20px; overflow-y: auto;
  border: 1px solid var(--jk-border); border-radius: 16px; background: var(--jk-surface); color: var(--jk-text);
  box-shadow: 0 12px 40px var(--jk-shadow); }
.announcement:not(:modal) { position: fixed; top: 72px; z-index: 1050; margin: 0 auto; }
.announcement:modal { margin: auto; animation: sheet-up .2s ease-out; }
.announcement::backdrop { background: var(--jk-scrim); }
.announcement-text { font-size: .95rem; }
