/*
 * vicevi.hr — hand-authored stylesheet (plain CSS, no build step).
 *
 * Visual identity follows production vicevi.hr (DEC-15, refreshed by DEC-48): navy header (#193660)
 * with the white script logo, the full-width RAINBOW TAB row (home red / jokes yellow / memes purple /
 * texts green / random orange / user blue), the inner blue content area (#4565a4), white cards with an
 * accent top border + corner flag, avatar ring + orange nickname, dialogue lines as grey speech boxes,
 * orange primary (#fc6d22). Modernised with a spacing/type scale, softer elevation, readable measure,
 * visible focus rings and a mobile bottom tab bar (PWA feel).
 *
 * Breakpoints (mobile-first; base rules are the phone layout):
 *   550 landscape phones · 768 tablets (rainbow tabs replace the bottom bar) · 992 desktop (sidebar)
 * Container max-width: 1100px. Loaded after normalize.css; ?v=<mtime> in base.phtml busts caches.
 */

/* ── Fonts ──────────────────────────────────────────────────────────── */

@font-face {
	font-family: "Clear Sans";
	src: url("fonts/clear-sans/ClearSans-Regular.woff") format("woff"),
	     url("fonts/clear-sans/ClearSans-Regular.ttf") format("truetype");
	font-weight: 400;
	font-style: normal;
	font-display: swap;
}
@font-face {
	font-family: "Clear Sans";
	src: url("fonts/clear-sans/ClearSans-Italic.woff") format("woff"),
	     url("fonts/clear-sans/ClearSans-Italic.ttf") format("truetype");
	font-weight: 400;
	font-style: italic;
	font-display: swap;
}
@font-face {
	font-family: "Clear Sans";
	src: url("fonts/clear-sans/ClearSans-Bold.woff") format("woff"),
	     url("fonts/clear-sans/ClearSans-Bold.ttf") format("truetype");
	font-weight: 700;
	font-style: normal;
	font-display: swap;
}
@font-face {
	font-family: "Clear Sans";
	src: url("fonts/clear-sans/ClearSans-BoldItalic.woff") format("woff"),
	     url("fonts/clear-sans/ClearSans-BoldItalic.ttf") format("truetype");
	font-weight: 700;
	font-style: italic;
	font-display: swap;
}
/* Handwriting face — production uses it for the Grafiti category only (DEC-48). */
@font-face {
	font-family: "Gloria Hallelujah";
	src: url("fonts/gloria-hallelujah/GloriaHallelujah.ttf") format("truetype");
	font-weight: 400;
	font-style: normal;
	font-display: swap;
}

/* ── Design tokens ──────────────────────────────────────────────────── */

:root {
	color-scheme: light;

	/* brand */
	--navy: #193660;             /* header / footer / drawer / bottom bar */
	--navy-deep: #12284a;        /* shadow side of the navy */
	--primary: #fc6d22;          /* orange — links, buttons, accents */
	--primary-dark: #e2560d;     /* hover / pressed */
	--on-primary: #ffffff;

	/* section accents = the rainbow (nav tabs, card ribbons, title bars) */
	--section-home: #ed0020;
	--section-jokes: #fecb2f;
	--section-memes: #b726f7;
	--section-texts: #96d92b;
	--section-random: #fc6d22;
	--section-user: #38a1fa;
	/* text that sits ON an accent (light accents need dark ink for contrast) */
	--ink-on-home: #ffffff;
	--ink-on-jokes: #3d2e00;
	--ink-on-memes: #ffffff;
	--ink-on-texts: #1f3a00;
	--ink-on-random: #ffffff;
	--ink-on-user: #ffffff;


	/* social */
	--c-facebook: #1877f2;
	--c-instagram: #bc2a8d;

	/* surfaces & text */
	--page-bg: #4565a4;          /* the dominant blue behind cards */
	--header-bg: #193660;
	--footer-bg: #193660;
	--card-bg: #ffffff;
	--raised-bg: #f4f6fa;        /* hover fills, chips, inputs */
	--ink: #1a1d24;
	--ink-soft: #3a3f4b;
	--muted: #6d7380;
	--rule: #e4e7ee;
	--field-bg: #f8f9fb;
	--field-border: #dfe3ea;
	--comment-bg: #eef1f6;
	--comment-sep: #d5deee;
	--dialogue-bg: #f1f2f4;
	--dialogue-rule: #cfd3da;
	--focus-ring: #1d6fe0;

	/* status */
	--ok: #2f9e44;
	--ok-bg: #ebfbee;
	--err: #e03131;
	--err-bg: #fff5f5;
	--info: #1971c2;
	--info-bg: #e7f5ff;

	/* elevation (soft navy-tinted, reads well on the blue page) */
	--shadow-1: 0 1px 2px rgba(10, 24, 50, .10), 0 2px 6px rgba(10, 24, 50, .10);
	--shadow-2: 0 2px 4px rgba(10, 24, 50, .12), 0 8px 24px rgba(10, 24, 50, .20);
	--shadow-3: 0 12px 40px rgba(10, 24, 50, .35);

	/* spacing scale */
	--space-1: .25rem;
	--space-2: .5rem;
	--space-3: .75rem;
	--space-4: 1rem;
	--space-5: 1.25rem;
	--space-6: 1.5rem;
	--space-7: 2rem;
	--space-8: 3rem;

	/* type scale */
	--fs-xs: .75rem;
	--fs-sm: .875rem;
	--fs-base: 1rem;
	--fs-md: 1.125rem;
	--fs-lg: 1.25rem;
	--fs-xl: 1.5rem;
	--fs-2xl: 1.875rem;
	--fs-body: clamp(1.0625rem, 1rem + .25vw, 1.125rem);  /* joke/text bodies */
	--lh-body: 1.6;
	--measure: 68ch;

	/* structure */
	--radius: 12px;
	--radius-sm: 8px;
	--radius-pill: 999px;
	--shell-max: 1100px;
	--sidebar-w: 300px;
	--bottom-nav-h: 60px;
	--font: "Clear Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
	--font-hand: "Gloria Hallelujah", "Comic Sans MS", cursive;
}

/*
 * Dark theme overrides. The two blocks below MUST stay identical — one fires when the user forces
 * dark (data-theme="dark"), the other when they leave it on "auto" and the OS prefers dark. Only
 * surfaces / text / borders / status tints re-tone; brand + section accents stay (DEC-15).
 */
:root[data-theme="light"] { color-scheme: light; }

:root[data-theme="dark"] {
	/* KEEP IN SYNC with the prefers-color-scheme block below */
	color-scheme: dark;
	--page-bg: #0e1a2e;
	--card-bg: #18223a;
	--raised-bg: #212d48;
	--ink: #e9ecf2;
	--ink-soft: #c3cad8;
	--muted: #8d96a8;
	--rule: #2b3854;
	--field-bg: #111b30;
	--field-border: #2f3d5c;
	--comment-bg: #141e34;
	--comment-sep: #2b3854;
	--dialogue-bg: #222d47;
	--dialogue-rule: #3b4a6b;
	--focus-ring: #8ab4ff;
	--ok: #51cf66;
	--ok-bg: #14311d;
	--err: #ff6b6b;
	--err-bg: #3a1c1c;
	--info: #4dabf7;
	--info-bg: #13283d;
	--shadow-1: 0 1px 2px rgba(0, 0, 0, .35), 0 2px 6px rgba(0, 0, 0, .25);
	--shadow-2: 0 2px 4px rgba(0, 0, 0, .35), 0 8px 24px rgba(0, 0, 0, .40);
	--shadow-3: 0 12px 40px rgba(0, 0, 0, .55);
}

@media (prefers-color-scheme: dark) {
	:root[data-theme="auto"] {
		/* KEEP IN SYNC with :root[data-theme="dark"] above */
		color-scheme: dark;
		--page-bg: #0e1a2e;
		--card-bg: #18223a;
		--raised-bg: #212d48;
		--ink: #e9ecf2;
		--ink-soft: #c3cad8;
		--muted: #8d96a8;
		--rule: #2b3854;
		--field-bg: #111b30;
		--field-border: #2f3d5c;
		--comment-bg: #141e34;
		--comment-sep: #2b3854;
		--dialogue-bg: #222d47;
		--dialogue-rule: #3b4a6b;
		--focus-ring: #8ab4ff;
		--ok: #51cf66;
		--ok-bg: #14311d;
		--err: #ff6b6b;
		--err-bg: #3a1c1c;
		--info: #4dabf7;
		--info-bg: #13283d;
		--shadow-1: 0 1px 2px rgba(0, 0, 0, .35), 0 2px 6px rgba(0, 0, 0, .25);
		--shadow-2: 0 2px 4px rgba(0, 0, 0, .35), 0 8px 24px rgba(0, 0, 0, .40);
		--shadow-3: 0 12px 40px rgba(0, 0, 0, .55);
	}
}

/* ── Base ───────────────────────────────────────────────────────────── */

*, *::before, *::after { box-sizing: border-box; }

/* normalize.css zeroes every margin; a modal <dialog> is centred by the UA's margin: auto, so restore it */
dialog { margin: auto; max-width: calc(100vw - 2rem); max-height: calc(100dvh - 2rem); }

html { -webkit-text-size-adjust: 100%; }

body {
	margin: 0;
	min-height: 100vh;
	min-height: 100dvh;
	display: flex;
	flex-direction: column;
	background: var(--page-bg);
	color: var(--ink);
	font-family: var(--font);
	font-size: var(--fs-base);
	line-height: 1.5;
	-webkit-font-smoothing: antialiased;
	/* room for the fixed bottom tab bar on phones */
	padding-bottom: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom, 0px));
}
@media (min-width: 768px) { body { padding-bottom: 0; } }

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 { font-weight: 700; line-height: 1.25; }

img { max-width: 100%; height: auto; }

/* One visible keyboard-focus style everywhere (mouse clicks don't show it). */
:focus-visible {
	outline: 3px solid var(--focus-ring);
	outline-offset: 2px;
}
/* on navy surfaces a warm ring reads better than blue */
.page-header, .drawer, .bottom-nav, .site-footer { --focus-ring: #ffd23f; }

.icon {
	display: inline-block;
	width: 1.15em;
	height: 1.15em;
	fill: currentColor;
	vertical-align: -0.18em;
	flex: none;
}
/* line icons (stroke-drawn: share, comment bubble) keep their own fill="none" */
.icon-share, .icon-comment-bubble { fill: none; }

.visually-hidden {
	position: absolute;
	width: 1px; height: 1px;
	padding: 0; margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

[hidden] { display: none !important; }

.shell {
	width: 100%;
	max-width: var(--shell-max);
	margin-left: auto;
	margin-right: auto;
	padding-left: var(--space-4);
	padding-right: var(--space-4);
}

/* ── Header (navy band) ─────────────────────────────────────────────── */

.page-header {
	position: sticky;
	top: 0;
	z-index: 40;
	background: var(--header-bg);
	color: #fff;
	box-shadow: 0 2px 10px rgba(0, 0, 0, .25);
}
/* desktop: the tall production header scrolls away; the tabs are part of it */
@media (min-width: 768px) {
	.page-header { position: relative; box-shadow: none; }
}

.page-header__inner {
	display: flex;
	align-items: center;
	gap: var(--space-2);
	min-height: 56px;
	padding-top: var(--space-2);
	padding-bottom: var(--space-2);
}
@media (min-width: 768px) {
	.page-header__inner { min-height: 96px; gap: var(--space-3); }
}

.brand { display: inline-flex; align-items: center; margin-right: auto; }
.brand img { display: block; height: 32px; width: auto; }
@media (min-width: 768px) { .brand img { height: 62px; } }

.header-actions {
	display: flex;
	align-items: center;
	gap: var(--space-2);
}

/* desktop search pill */
.header-search { display: none; position: relative; }
.header-search .icon {
	position: absolute;
	left: .7rem;
	top: 50%;
	transform: translateY(-50%);
	width: 18px;
	height: 18px;
	color: rgba(255, 255, 255, .7);
	pointer-events: none;
}
.header-search input {
	width: 13rem;
	padding: .55rem .9rem .55rem 2.2rem;
	border: 1px solid rgba(255, 255, 255, .18);
	border-radius: var(--radius-pill);
	background: rgba(255, 255, 255, .10);
	color: #fff;
	font: inherit;
	font-size: var(--fs-sm);
	transition: background .15s, width .2s;
}
.header-search input::placeholder { color: rgba(255, 255, 255, .7); }
.header-search input:focus { background: rgba(255, 255, 255, .2); width: 16rem; }
@media (min-width: 768px) {
	.header-search { display: flex; }
	.search-link { display: none !important; }
}

.nav-plain {
	display: inline-flex;
	align-items: center;
	gap: .35rem;
	min-height: 40px;
	padding: .45rem .7rem;
	border-radius: var(--radius-pill);
	color: rgba(255, 255, 255, .92);
	font-weight: 700;
	font-size: var(--fs-sm);
	white-space: nowrap;
}
.nav-plain:hover { background: rgba(255, 255, 255, .12); color: #fff; text-decoration: none; }

/* phones: header buttons collapse to icons */
@media (max-width: 767px) {
	.nav-plain { padding: .45rem .6rem; gap: 0; }
	.nav-plain .btn-label,
	.login-btn .btn-label,
	.user-menu__name { display: none; }
	.header-actions .login-btn { justify-content: center; width: 40px; padding: 0; }
}

/* icon-only header buttons (theme toggle, hamburger, search) */
.icon-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	border: none;
	border-radius: var(--radius-pill);
	background: rgba(255, 255, 255, .10);
	color: #fff;
	cursor: pointer;
	padding: 0;
}
.icon-btn:hover { background: rgba(255, 255, 255, .22); color: #fff; text-decoration: none; }
.icon-btn .icon { width: 20px; height: 20px; }

.theme-toggle__icon { display: none; }
:root[data-theme="auto"]  .theme-toggle__icon--auto,
:root[data-theme="light"] .theme-toggle__icon--light,
:root[data-theme="dark"]  .theme-toggle__icon--dark { display: inline-flex; }
:root:not([data-theme="light"]):not([data-theme="dark"]) .theme-toggle__icon--auto { display: inline-flex; }

/* context menus (user dropdown, bell, "⋮" card / comment menus) pop in from their toggle's corner on open;
   closing is instant. The animation hangs on the OPEN state selector, so closing removes it and every open restarts it
   (a closed <details> keeps its panel's finished animation otherwise). */
@keyframes menu-in {
	from { opacity: 0; transform: translateY(-6px) scale(.96); }
	to { opacity: 1; transform: none; }
}
.user-menu__panel, .bell__panel, .card-menu__panel { transform-origin: top right; }
.user-menu[data-open="true"] .user-menu__panel,
.bell__panel:not([hidden]),
.card-menu[open] > .card-menu__panel { animation: menu-in .16s cubic-bezier(.2, .9, .3, 1.15); }
@media (prefers-reduced-motion: reduce) {
	@keyframes menu-in { from { opacity: 0; } to { opacity: 1; } }
	.user-menu[data-open="true"] .user-menu__panel,
	.bell__panel:not([hidden]),
	.card-menu[open] > .card-menu__panel { animation-duration: .1s; animation-timing-function: linear; }
}

/* user dropdown; signed-out visitors get the same blue pill as the "Prijavi se" link */
.user-menu { position: relative; }
.user-menu__toggle,
.login-btn {
	display: inline-flex;
	align-items: center;
	gap: .4rem;
	max-width: 12rem;
	min-height: 40px;
	padding: .4rem .75rem;
	border: none;
	border-radius: var(--radius-pill);
	background: var(--section-user);
	color: #fff;
	font: inherit;
	font-weight: 700;
	font-size: var(--fs-sm);
	cursor: pointer;
}
.user-menu__toggle:hover,
.login-btn:hover { filter: brightness(.94); }
.login-btn, .login-btn:hover { color: var(--ink-on-user); text-decoration: none; white-space: nowrap; }
.user-menu__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-menu__caret { transition: transform .15s; }
.user-menu[data-open="true"] .user-menu__caret { transform: rotate(180deg); }
.user-menu__panel {
	position: absolute;
	top: calc(100% + .4rem);
	right: 0;
	min-width: 13rem;
	background: var(--card-bg);
	border-radius: var(--radius-sm);
	box-shadow: var(--shadow-3);
	padding: .35rem;
	display: none;
	z-index: 60;
}
.user-menu[data-open="true"] .user-menu__panel { display: block; }
.user-menu__panel a,
.user-menu__panel button {
	display: flex;
	align-items: center;
	gap: .5rem;
	width: 100%;
	padding: .55rem .65rem;
	border: none;
	border-radius: var(--radius-sm);
	background: none;
	color: var(--ink);
	font: inherit;
	font-size: var(--fs-sm);
	text-align: left;
	cursor: pointer;
}
.user-menu__panel a:hover,
.user-menu__panel button:hover { background: var(--raised-bg); color: var(--primary-dark); text-decoration: none; }
.user-menu__sep { height: 1px; background: var(--rule); margin: .35rem .2rem; }
.logout-form { margin: 0; }

/* notification bell (A7, DEC-59): a link to /obavijesti, a dropdown with JS (notifications.js) */
.bell { position: relative; }
.bell__toggle { position: relative; }
.bell__badge {
	position: absolute;
	top: -3px;
	right: -4px;
	min-width: 20px;
	height: 20px;
	padding: 0 5px;
	border-radius: var(--radius-pill);
	background: var(--section-home);
	color: var(--ink-on-home);
	box-shadow: 0 0 0 2px var(--header-bg);
	font-size: .7rem;
	font-weight: 700;
	line-height: 20px;
	text-align: center;
}
.bell__badge[hidden] { display: none; }
.bell__panel {
	position: absolute;
	top: calc(100% + .4rem);
	right: 0;
	width: min(24rem, calc(100vw - 2rem));
	max-height: min(32rem, calc(100vh - 6rem));
	display: flex;
	flex-direction: column;
	background: var(--card-bg);
	color: var(--ink);
	border-radius: var(--radius-sm);
	box-shadow: var(--shadow-3);
	z-index: 60;
	overflow: hidden;
}
.bell__panel[hidden] { display: none; }
/* phones: the panel spans the screen under the sticky bar */
@media (max-width: 549px) {
	.bell { position: static; }
	.bell__panel { position: fixed; top: 60px; left: var(--space-2); right: var(--space-2); width: auto; max-height: calc(100dvh - 60px - var(--bottom-nav-h) - 1rem); transform-origin: top center; }
}
.bell__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--space-2);
	padding: .65rem .65rem .65rem 1rem;
	border-bottom: 1px solid var(--rule);
}
.bell__settings { display: inline-flex; padding: .35rem; border-radius: var(--radius-pill); color: var(--muted); }
.bell__settings:hover { background: var(--raised-bg); color: var(--primary-dark); }
.bell__settings .icon { width: 18px; height: 18px; }
.bell__body { overflow-y: auto; overscroll-behavior: contain; }
.bell__empty { margin: 0; padding: 1rem; color: var(--muted); font-size: var(--fs-sm); }
.bell__all {
	display: block;
	padding: .7rem 1rem;
	border-top: 1px solid var(--rule);
	color: var(--primary-dark);
	font-weight: 700;
	font-size: var(--fs-sm);
	text-align: center;
}
.bell__all:hover { background: var(--raised-bg); text-decoration: none; }
.menu-count {
	margin-left: auto;
	min-width: 20px;
	padding: 0 6px;
	border-radius: var(--radius-pill);
	background: var(--section-home);
	color: var(--ink-on-home);
	font-size: .7rem;
	font-weight: 700;
	line-height: 20px;
	text-align: center;
}
.menu-count[hidden] { display: none; }

/* one notification (the bell dropdown and /obavijesti) */
.notif-list { list-style: none; margin: 0; padding: 0; }
.notif + .notif { border-top: 1px solid var(--rule); }
.notif__link {
	display: flex;
	gap: .7rem;
	padding: .85rem 1rem;
	color: var(--ink);
}
.notif__link:hover { background: var(--raised-bg); text-decoration: none; }
.notif--unread .notif__link { background: var(--info-bg); }
.notif--unread .notif__link:hover { background: color-mix(in srgb, var(--info) 14%, var(--card-bg)); }
.notif__dot { flex: none; width: 8px; height: 8px; margin-top: .45rem; border-radius: 50%; background: transparent; }
.notif--unread .notif__dot { background: var(--info); }
.notif__main { display: flex; flex-direction: column; gap: .2rem; min-width: 0; }
.notif__title { font-weight: 700; overflow-wrap: anywhere; }
.notif__body { color: var(--ink-soft); font-size: var(--fs-sm); overflow-wrap: anywhere; }
.notif--compact .notif__body { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.notif__meta { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; color: var(--muted); font-size: var(--fs-xs); }
.notif__tag {
	padding: 0 .45rem;
	border-radius: var(--radius-pill);
	background: var(--primary);
	color: var(--on-primary);
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: .03em;
	font-size: .65rem;
	line-height: 1.6;
}

/* ── Rainbow tabs (desktop/tablet main navigation) ──────────────────── */

.rainbow-tabs { display: none; }
@media (min-width: 768px) {
	.rainbow-tabs { display: block; }
}
.rainbow-tabs__list {
	display: flex;
	align-items: flex-end;
	gap: 4px;
	min-height: 54px;            /* = .rt.is-active height: hover never resizes the row, even with no active tab */
	list-style: none;
	margin-top: 0;
	margin-bottom: 0;
}
.rainbow-tabs__list > li { flex: 1 1 0; min-width: 0; }
/* the home tab is icon-only (aria-label carries the name): it keeps its own width, the others share the rest */
.rainbow-tabs__list > li:first-child { flex: 0 0 auto; }
.rt {
	--accent: var(--navy);
	--accent-ink: #fff;
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: .45rem;
	height: 46px;
	padding: 0 .6rem;
	border-radius: 10px 10px 0 0;
	background: var(--accent);
	color: var(--accent-ink);
	font-weight: 700;
	font-size: var(--fs-md);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	transition: height .15s ease, filter .15s ease;
}
.rt .icon { width: 1.15em; height: 1.15em; }
.rt:hover { color: var(--accent-ink); text-decoration: none; filter: brightness(1.07); height: 50px; }
/* the active tab is raised, with production's white notch on top */
.rt.is-active { height: 54px; box-shadow: inset 0 4px 0 rgba(255, 255, 255, .95); }
.rt.is-active::after {
	content: "";
	position: absolute;
	top: 4px;
	left: 50%;
	transform: translateX(-50%);
	border-style: solid;
	border-width: 7px 7px 0 7px;
	border-color: rgba(255, 255, 255, .95) transparent transparent transparent;
}
.rt--home   { --accent: var(--section-home);   --accent-ink: var(--ink-on-home); }
.rainbow-tabs .rt--home { padding: 0 1.4rem; }
.rainbow-tabs .rt--home .icon { width: 1.35em; height: 1.35em; }
.rt--jokes  { --accent: var(--section-jokes);  --accent-ink: var(--ink-on-jokes); }
.rt--memes  { --accent: var(--section-memes);  --accent-ink: var(--ink-on-memes); }
.rt--texts  { --accent: var(--section-texts);  --accent-ink: var(--ink-on-texts); }
.rt--random { --accent: var(--section-random); --accent-ink: var(--ink-on-random); }
.rt--user   { --accent: var(--section-user);   --accent-ink: var(--ink-on-user); }
@media (min-width: 768px) and (max-width: 991px) {
	.rt { font-size: var(--fs-sm); gap: .3rem; }
}
@media (prefers-reduced-motion: reduce) { .rt { transition: none; } }

/* ── Mobile drawer (hamburger) ──────────────────────────────────────── */

.nav-toggle { display: inline-flex; }
@media (min-width: 768px) { .nav-toggle { display: none; } }

.drawer {
	position: fixed;
	top: 0;
	left: 0;
	bottom: 0;
	z-index: 60;
	width: min(85vw, 320px);
	display: flex;
	flex-direction: column;
	gap: var(--space-4);
	padding: var(--space-4) var(--space-4) calc(var(--space-6) + env(safe-area-inset-bottom, 0px));
	background: var(--navy);
	color: #fff;
	box-shadow: 4px 0 24px rgba(0, 0, 0, .45);
	overflow-y: auto;
	transform: translateX(-105%);
	transition: transform .25s ease;
	visibility: hidden;
}
.drawer.is-open { transform: translateX(0); visibility: visible; }
.drawer__head { display: flex; align-items: center; justify-content: space-between; }
.drawer__head img { height: 30px; width: auto; display: block; }

.drawer__nav { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.drawer__link {
	display: flex;
	align-items: center;
	gap: .65rem;
	min-height: 46px;
	padding: 0 .85rem;
	border-radius: var(--radius-sm);
	border-left: 5px solid var(--accent, #fff);
	background: rgba(255, 255, 255, .06);
	color: #fff;
	font-weight: 700;
	font-size: var(--fs-md);
}
.drawer__link:hover { background: rgba(255, 255, 255, .12); color: #fff; text-decoration: none; }
.drawer__link.is-active { background: var(--accent); color: var(--accent-ink, #fff); }
.drawer__link.rt--home, .drawer__link.rt--jokes, .drawer__link.rt--memes,
.drawer__link.rt--texts, .drawer__link.rt--random, .drawer__link.rt--user { height: auto; }

.drawer__section-title {
	margin: 0 0 var(--space-2);
	font-size: var(--fs-xs);
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: .08em;
	color: rgba(255, 255, 255, .6);
}
.drawer__links { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 2px var(--space-2); }
.drawer__links a {
	display: block;
	padding: .45rem .25rem;
	color: rgba(255, 255, 255, .9);
	font-size: var(--fs-sm);
}
.drawer__links a:hover { color: #fff; }
.drawer__links .count { color: rgba(255, 255, 255, .45); font-size: var(--fs-xs); margin-left: .2rem; }

/* Search box inside the drawer (navy background). */
.drawer-search { display: flex; gap: .4rem; }
.drawer-search input {
	flex: 1;
	min-width: 0;
	min-height: 44px;
	padding: .5rem .8rem;
	border: 1px solid rgba(255, 255, 255, .18);
	border-radius: var(--radius-pill);
	background: rgba(255, 255, 255, .10);
	color: #fff;
	font: inherit;
}
.drawer-search input::placeholder { color: rgba(255, 255, 255, .7); }
.drawer-search input:focus { background: rgba(255, 255, 255, .2); }
.drawer-search button {
	border: none;
	border-radius: var(--radius-pill);
	background: var(--primary);
	color: #fff;
	min-width: 44px;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}
.drawer-search button:hover { background: var(--primary-dark); }

.nav-overlay {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, .5);
	z-index: 50;
	opacity: 0;
	visibility: hidden;
	transition: opacity .25s ease, visibility .25s ease;
}
.nav-overlay.is-open { opacity: 1; visibility: visible; }

@media (min-width: 768px) {
	.drawer, .nav-overlay { display: none; }
}
@media (prefers-reduced-motion: reduce) {
	.drawer, .nav-overlay { transition: none; }
}

/* ── Bottom tab bar (phones; app-like navigation for the PWA) ───────── */

.bottom-nav {
	position: fixed;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 45;
	display: flex;
	align-items: stretch;
	height: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom, 0px));
	padding-bottom: env(safe-area-inset-bottom, 0px);
	background: var(--navy);
	box-shadow: 0 -2px 12px rgba(0, 0, 0, .25);
}
@media (min-width: 768px) { .bottom-nav { display: none; } }

.bn {
	--accent: #fff;
	position: relative;
	flex: 1 1 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 2px;
	min-width: 0;
	color: rgba(255, 255, 255, .72);
	font-size: .7rem;
	font-weight: 700;
	letter-spacing: .01em;
}
.bn .icon { width: 24px; height: 24px; }
.bn:hover { color: #fff; text-decoration: none; }
.bn.is-active { color: var(--accent); }
.bn.is-active::before {
	content: "";
	position: absolute;
	top: 0;
	left: 22%;
	right: 22%;
	height: 4px;
	border-radius: 0 0 4px 4px;
	background: var(--accent);
}
.bn--home  { --accent: var(--section-home); }
.bn--jokes { --accent: var(--section-jokes); }
.bn--memes { --accent: #d68bff; }            /* lighter purple: legible on navy */
.bn--texts { --accent: var(--section-texts); }
.bn--home.is-active { color: #ff6b7d; }       /* lighter red on navy */
/* the centre "random" action is a raised orange disc */
.bn--random .bn__fab {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 48px;
	height: 48px;
	margin-top: -22px;
	border-radius: 50%;
	background: var(--primary);
	color: #fff;
	box-shadow: 0 4px 12px rgba(0, 0, 0, .35), 0 0 0 4px var(--navy);
}
.bn--random .bn__fab .icon { width: 26px; height: 26px; }
.bn--random:hover .bn__fab { background: var(--primary-dark); }

/* ── Page grid ──────────────────────────────────────────────────────── */

.layout {
	width: 100%;
	max-width: var(--shell-max);
	margin: 0 auto;
	padding: var(--space-4);
	flex: 1 0 auto;
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: var(--space-5);
	align-items: start;
}
@media (min-width: 768px) { .layout { padding-top: var(--space-5); } }
.content { min-width: 0; display: flex; flex-direction: column; gap: var(--space-4); }
.content > * { margin: 0; }
.sidebar { display: none; }

@media (min-width: 992px) {
	.layout { grid-template-columns: minmax(0, 1fr) var(--sidebar-w); }
	.sidebar { display: flex; flex-direction: column; gap: var(--space-4); position: sticky; top: var(--space-4); }
}

.feed { display: flex; flex-direction: column; gap: var(--space-4); }
.feed-grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: var(--space-4);
}
@media (min-width: 550px) { .feed-grid { grid-template-columns: repeat(2, 1fr); } }

/* section wrappers: the title bar, then controls, then the feed */
.page-section { display: flex; flex-direction: column; gap: var(--space-4); }

/* ── Page titles (slim section-accent bars) ─────────────────────────── */

.page-title {
	margin: 0;
	padding: .6rem 1rem;
	border-radius: var(--radius);
	background: var(--accent, var(--navy));
	color: var(--accent-ink, #fff);
	text-align: center;
	font-size: var(--fs-lg);
	box-shadow: var(--shadow-1);
}
@media (min-width: 768px) { .page-title { font-size: var(--fs-xl); } }
.pt--home  { --accent: var(--section-home);  --accent-ink: var(--ink-on-home); }
.pt--jokes { --accent: var(--section-jokes); --accent-ink: var(--ink-on-jokes); }
.pt--texts { --accent: var(--section-texts); --accent-ink: var(--ink-on-texts); }
.pt--memes { --accent: var(--section-memes); --accent-ink: var(--ink-on-memes); }
.pt--user  { --accent: var(--section-user);  --accent-ink: var(--ink-on-user); }
.pt--misc  { --accent: var(--navy);          --accent-ink: #fff; }

.empty, .hint, .result-count {
	margin: 0;
	padding: var(--space-4) var(--space-5);
	background: var(--card-bg);
	border-radius: var(--radius);
	box-shadow: var(--shadow-1);
	color: var(--muted);
}

/* ── Listing controls: sort tabs + tag filter chips ─────────────────── */

.listing-controls { display: flex; flex-direction: column; gap: var(--space-3); }

.sort-tabs {
	display: flex;
	gap: 4px;
	padding: 4px;
	border-radius: var(--radius-pill);
	background: var(--card-bg);
	box-shadow: var(--shadow-1);
	overflow-x: auto;
	scrollbar-width: none;
}
.sort-tabs::-webkit-scrollbar { display: none; }
.sort-tabs a {
	flex: 1 0 auto;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: .35rem;
	min-height: 40px;
	padding: 0 1rem;
	border-radius: var(--radius-pill);
	color: var(--ink-soft);
	font-weight: 700;
	font-size: var(--fs-sm);
	white-space: nowrap;
}
.sort-tabs a:hover { background: var(--raised-bg); color: var(--ink); text-decoration: none; }
.sort-tabs a[aria-current="page"] { background: var(--primary); color: var(--on-primary); }
.sort-tabs .icon { width: 18px; height: 18px; }
@media (max-width: 399px) {
	.sort-tabs a { padding: 0 .7rem; }
	.sort-tabs .icon { display: none; }
}

.chips {
	display: flex;
	gap: var(--space-2);
	margin: 0 calc(-1 * var(--space-4));
	padding: 2px var(--space-4) 6px;
	list-style: none;
	overflow-x: auto;
	scroll-snap-type: x proximity;
	scrollbar-width: none;
	-webkit-overflow-scrolling: touch;
}
.chips::-webkit-scrollbar { display: none; }
.chips li { scroll-snap-align: start; flex: none; }
.chip {
	display: inline-flex;
	align-items: center;
	gap: .35rem;
	min-height: 36px;
	padding: 0 .9rem;
	border-radius: var(--radius-pill);
	background: var(--card-bg);
	color: var(--ink);
	font-weight: 700;
	font-size: var(--fs-sm);
	white-space: nowrap;
	box-shadow: var(--shadow-1);
}
.chip:hover { color: var(--primary-dark); text-decoration: none; }
.chip .count { color: var(--muted); font-size: var(--fs-xs); font-weight: 700; }
.chips { --chip-on: var(--section-jokes); --chip-on-ink: var(--ink-on-jokes); }
.chips--meme { --chip-on: var(--section-memes); --chip-on-ink: var(--ink-on-memes); }
.chips--text { --chip-on: var(--section-texts); --chip-on-ink: var(--ink-on-texts); }
.chip[aria-current="page"] { background: var(--chip-on); color: var(--chip-on-ink); }
.chip[aria-current="page"] .count { color: var(--chip-on-ink); opacity: .7; }
@media (min-width: 992px) { .chips { display: none; } }

/* /vicevi/{tag}: "Slučajni vic iz kategorije" (keeps /slucajni-vic/{tag} reachable) */
.listing-random { margin: 0; display: flex; justify-content: center; }

/* ── Cards ──────────────────────────────────────────────────────────── */

.card {
	--accent: var(--navy);
	position: relative;
	background: var(--card-bg);
	border-radius: var(--radius);
	border-top: 5px solid var(--accent);
	padding: var(--space-4) var(--space-4) var(--space-3);
	box-shadow: var(--shadow-2);
	/* not overflow:hidden — the "⋮" menu panel may extend past a short card; the corner flag and the hero ribbon
	   round their own corners instead */
	scroll-margin-top: 72px;
}
.card:has(.card-menu[open]) { z-index: 5; }
@media (min-width: 550px) { .card { padding: var(--space-5) var(--space-6) var(--space-3); } }
.joke-card,  .teaser-joke { --accent: var(--section-jokes); }
.text-card,  .teaser-text { --accent: var(--section-texts); }
.meme-card,  .teaser-meme { --accent: var(--section-memes); }

/* corner ribbon + section glyph (top-right triangle, as on production) */
.card__flag {
	position: absolute;
	top: 0;
	right: 0;
	width: 52px;
	height: 52px;
	color: #fff;
	pointer-events: none;
	overflow: hidden;
	/* the padding-box corner under the 5px top border: 12px across, 7px down */
	border-top-right-radius: var(--radius) calc(var(--radius) - 5px);
}
.card__flag::before {
	content: "";
	position: absolute;
	top: 0;
	right: 0;
	border-style: solid;
	border-width: 0 52px 52px 0;
	border-color: transparent var(--accent) transparent transparent;
}
.card__flag .icon {
	position: absolute;
	top: 6px;
	right: 6px;
	width: 18px;
	height: 18px;
	z-index: 1;
}
.joke-card .card__flag, .teaser-joke .card__flag { color: var(--ink-on-jokes); }
.text-card .card__flag, .teaser-text .card__flag { color: var(--ink-on-texts); }

/* author row: avatar ring + orange nickname + kind/category */
.card__head {
	display: flex;
	align-items: center;
	gap: var(--space-3);
	margin-bottom: var(--space-3);
	padding-right: 44px;
	min-width: 0;
}
/* with the ⋮ menu the row runs to the right edge; the menu keeps clear of the corner flag's diagonal */
.card__head:has(.card-menu) { padding-right: 14px; }
.single .card__head:has(.card-menu) { padding-right: var(--space-4); }
.hero-joke .card__head:has(.card-menu) { padding-right: 0; }
.avatar {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: none;
	width: 42px;
	height: 42px;
	border-radius: 50%;
	border: 2px solid var(--primary);
	color: var(--primary);
	background: var(--card-bg);
}
.avatar .icon { width: 22px; height: 22px; }
@media (min-width: 550px) { .avatar { width: 48px; height: 48px; } .avatar .icon { width: 24px; height: 24px; } }
.card__who { display: flex; flex-direction: column; flex: 1 1 auto; gap: 3px; min-width: 0; line-height: 1.25; }
.card__nick {
	color: var(--primary);
	font-weight: 700;
	font-size: var(--fs-md);
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
/* the type + the item's tag pills, one wrapping line under the nickname (DEC-134) */
.card__subline { display: flex; flex-wrap: wrap; align-items: center; gap: 4px var(--space-2); min-width: 0; }
.card__sub { color: var(--muted); font-size: var(--fs-sm); font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.card__sub a { color: inherit; }
.card__sub a:hover { color: var(--primary); }

.card__title { margin: 0 0 var(--space-2); font-size: var(--fs-lg); line-height: 1.3; padding-right: 44px; }
.card__head + .card__title { padding-right: 0; }
.card__title a { color: var(--ink); }
.card__title a:hover { color: var(--primary); text-decoration: none; }

.card__body {
	color: var(--ink);
	font-size: var(--fs-body);
	line-height: var(--lh-body);
	max-width: var(--measure);
	overflow-wrap: break-word;
}
.card__more { display: inline-flex; align-items: center; gap: .25rem; margin-top: var(--space-2); font-weight: 700; font-size: var(--fs-sm); }

.meme-card .card__title { font-size: var(--fs-lg); }
.card__image { display: block; width: 100%; margin: var(--space-1) 0 var(--space-2); border-radius: var(--radius-sm); background: var(--raised-bg); }

/* An item's images (doc 18 P4, DEC-125): a multi-image meme is an Instagram-style carousel (owner, 18a Task 13) that
   works without JS — CSS scroll-snap, one image filling the frame at a time (no peek, no visible scrollbar), every slide
   in the first image's shape (--carousel-ratio, the others contained), dots under it (the current one in the section
   accent). carousel.js keeps the dots in sync and adds the arrows (shown on hover / keyboard focus) and arrow keys. */
.carousel { position: relative; margin: var(--space-1) 0 var(--space-2); }
.carousel__track {
	display: flex;
	margin: 0;
	padding: 0;
	list-style: none;
	overflow-x: auto;
	overscroll-behavior-x: contain;
	scroll-snap-type: x mandatory;
	scrollbar-width: none;
	border-radius: var(--radius-sm);
	background: var(--raised-bg);
}
.carousel__track::-webkit-scrollbar { display: none; }
.carousel__track:focus-visible { outline: 3px solid var(--focus-ring); outline-offset: 2px; }
.carousel__slide {
	flex: 0 0 100%;
	min-width: 0;
	aspect-ratio: var(--carousel-ratio, 4 / 3);
	scroll-snap-align: start;
}
.carousel__link { display: block; height: 100%; }
.carousel__image { display: block; width: 100%; height: 100%; object-fit: contain; }
.carousel__dots { display: flex; justify-content: center; gap: 5px; margin-top: var(--space-2); }
.carousel__dot { width: 6px; height: 6px; border-radius: 50%; background: color-mix(in srgb, var(--muted) 45%, transparent); transition: background-color .2s; }
.carousel__dot.is-active { background: var(--accent, var(--primary)); }
.carousel__nav {
	position: absolute;
	top: calc(50% - 23px); /* the image's middle (the dots row — 6 px + its margin — sits under it) minus half the button */
	z-index: 1;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: var(--card-bg);
	color: var(--ink);
	box-shadow: var(--shadow-1);
	cursor: pointer;
	opacity: 0;
	transition: opacity .15s;
}
.carousel:hover .carousel__nav,
.carousel:has(:focus-visible) .carousel__nav { opacity: .92; }
.carousel__nav:hover, .carousel__nav:focus-visible { opacity: 1; color: var(--primary); }
.carousel__nav:focus-visible { outline: 3px solid var(--focus-ring); outline-offset: 2px; }
.carousel__nav[disabled] { visibility: hidden; }
.carousel__nav .icon { width: 20px; height: 20px; }
.carousel__nav--prev { left: var(--space-2); }
.carousel__nav--next { right: var(--space-2); }
/* touch screens swipe: the arrows only for pointer devices (and keyboard focus). While they are invisible they must not
   take taps either — an invisible arrow over the image edge would turn a tap meant for the image link into a slide step */
@media (hover: none) {
	.carousel__nav { pointer-events: none; }
	.carousel:hover .carousel__nav { opacity: 0; }
	.carousel:has(:focus-visible) .carousel__nav { opacity: .92; pointer-events: auto; }
}
@media (prefers-reduced-motion: no-preference) { .carousel__track { scroll-behavior: smooth; } }
@media (prefers-reduced-motion: reduce) { .carousel__dot, .carousel__nav { transition: none; } }

/* a text card WITH a cover (doc 18 P4, the live site's layout): author → cover → title, no teaser; from 550 px the
   cover sits beside the title */
.text-cover { display: grid; gap: var(--space-2) var(--space-5); margin-bottom: var(--space-2); }
.text-cover .card__image { margin: var(--space-1) 0 0; }
.text-cover__title { margin: 0; padding-right: 0; }
@media (min-width: 550px) {
	.text-cover { grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); align-items: start; }
	.text-cover__title { padding-top: var(--space-2); }
}

/* an item's tags (DEC-122): pills in the head line next to the type (DEC-134) — a link where the section's tag page
   exists, else plain text */
.tag-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 4px var(--space-2);
	margin: 0;
	padding: 0;
	list-style: none;
}
.tag-chip {
	display: inline-flex;
	align-items: center;
	min-height: 24px;
	padding: 0 .6rem;
	border: 1px dashed var(--rule);
	border-radius: var(--radius-pill);
	color: var(--muted);
	font-size: var(--fs-xs);
	font-weight: 700;
	letter-spacing: .02em;
	line-height: 1.2;
	white-space: nowrap;
}
a.tag-chip { border-style: solid; background: var(--raised-bg); color: var(--ink-soft); }
a.tag-chip:hover { border-color: var(--primary); color: var(--primary-dark); text-decoration: none; }
a.tag-chip--more { background: transparent; color: var(--muted); }

/* Grafiti tag: production's handwriting face (DEC-48, DEC-122) */
.is-grafiti .card__body,
.is-grafiti .single-body { font-family: var(--font-hand); font-size: 1.15em; line-height: 1.7; }

/* "Vic dana" hero (home page 1) */
.hero-joke { border-top: none; padding-top: 0; box-shadow: var(--shadow-3); }
.hero-joke__ribbon {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--space-3);
	margin: 0 calc(-1 * var(--space-4)) var(--space-4);
	padding: .65rem var(--space-4);
	border-radius: var(--radius) var(--radius) 0 0;
	background: linear-gradient(90deg, var(--section-jokes), #ffd95c 60%, var(--primary));
	color: var(--ink-on-jokes);
}
@media (min-width: 550px) { .hero-joke__ribbon { margin: 0 calc(-1 * var(--space-6)) var(--space-5); padding: .7rem var(--space-6); } }
.hero-joke__label { display: inline-flex; align-items: center; gap: .45rem; font-weight: 700; font-size: var(--fs-md); text-transform: uppercase; letter-spacing: .06em; }
.hero-joke__date { font-size: var(--fs-sm); font-weight: 700; opacity: .8; }
.hero-joke .card__flag { display: none; }
.hero-joke .card__body { font-size: calc(var(--fs-body) * 1.08); }

/* ── Dialogue (TextFormatter: one grey speech box per line) ─────────── */

.card__body p,
.single-body p { margin: 0 0 var(--space-3); }
.card__body p:last-child,
.single-body p:last-child { margin-bottom: 0; }
.dialogue-line {
	padding: .55rem .9rem;
	border-left: 4px solid var(--dialogue-rule);
	border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
	background: var(--dialogue-bg);
}
.card__body .dialogue-line,
.single-body .dialogue-line { margin-bottom: var(--space-2); }
/* the leading dash stays in the DOM (copy/paste, screen readers) but is hidden visually */
.dialogue-dash {
	position: absolute;
	width: 1px; height: 1px;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
}
.comment-body .dialogue-line { padding: .3rem .6rem; margin-bottom: var(--space-1); }

/* ── Card footer: votes · comments · actions ────────────────────────── */

.card-actions {
	margin-top: var(--space-4);
	padding-top: var(--space-2);
	border-top: 1px solid var(--rule);
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: var(--space-1) var(--space-2);
	color: var(--muted);
	font-size: var(--fs-sm);
}
.card-actions__right { margin-left: auto; display: flex; align-items: center; gap: 2px; }

.comments-link {
	display: inline-flex;
	align-items: center;
	gap: .35rem;
	min-height: 44px;
	padding: 0 .6rem;
	border-radius: var(--radius-pill);
	color: var(--muted);
	font-weight: 700;
}
.comments-link:hover { background: var(--raised-bg); color: var(--primary); text-decoration: none; }
.comments-link .icon { width: 20px; height: 20px; }

.action-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 44px;
	min-height: 44px;
	padding: 0 .5rem;
	border: none;
	border-radius: var(--radius-pill);
	background: transparent;
	color: var(--primary);
	font: inherit;
	cursor: pointer;
	text-decoration: none;
}
.action-btn:hover { background: var(--raised-bg); color: var(--primary-dark); text-decoration: none; }
.action-btn .icon { width: 20px; height: 20px; }
/* production's orange square "open" button */
.action-btn--go { background: var(--primary); color: #fff; border-radius: var(--radius-sm); margin-left: 2px; }
.action-btn--go:hover { background: var(--primary-dark); color: #fff; }

/* ── Share: one "Podijeli" control (Web Share API / copy the /r/ short link, DEC-112) ── */
.share-btn {
	display: inline-flex;
	align-items: center;
	gap: .4rem;
	min-height: 44px;
	padding: 0 .8rem;
	border-radius: var(--radius-pill);
	color: var(--primary);
	font-weight: 700;
	font-size: var(--fs-sm);
	white-space: nowrap;
}
.share-btn:hover { background: var(--raised-bg); color: var(--primary-dark); text-decoration: none; }
.share-btn .icon { width: 20px; height: 20px; }

/* ── "⋮" content menu (native <details>; card-menu.js adds Esc / outside click, DEC-112) ── */
.card-menu { position: relative; flex: none; margin-left: auto; align-self: center; }
.card-menu > summary { list-style: none; }
.card-menu > summary::-webkit-details-marker { display: none; }
.card-menu__toggle {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	border-radius: var(--radius-pill);
	color: var(--muted);
	cursor: pointer;
}
.card-menu__toggle:hover, .card-menu[open] > .card-menu__toggle { background: var(--raised-bg); color: var(--ink); }
.card-menu__toggle .icon { width: 20px; height: 20px; }
.card-menu__panel {
	position: absolute;
	top: calc(100% + .25rem);
	right: 0;
	z-index: 30;
	min-width: 13rem;
	max-width: calc(100vw - 2rem);
	padding: .35rem;
	border: 1px solid var(--rule);
	border-radius: var(--radius-sm);
	background: var(--card-bg);
	box-shadow: var(--shadow-3);
	text-transform: none;
	letter-spacing: normal;
}
.card-menu__panel:has(details.report[open]) { width: min(18rem, calc(100vw - 4rem)); }
.card-menu__item,
.card-menu details.report.report--menu > summary {
	display: flex;
	align-items: center;
	gap: .55rem;
	width: 100%;
	min-height: 44px;
	padding: .5rem .65rem;
	border-radius: var(--radius-sm);
	color: var(--ink);
	font-size: var(--fs-sm);
	font-weight: 400;
	white-space: nowrap;
	cursor: pointer;
}
.card-menu__item:hover,
.card-menu details.report.report--menu > summary:hover { background: var(--raised-bg); color: var(--primary-dark); text-decoration: none; }
.card-menu__item .icon { width: 18px; height: 18px; flex: none; color: var(--muted); }
.card-menu details.report--menu { display: block; }
.card-menu details.report.report--menu[open] > summary { color: var(--primary-dark); }
.card-menu .report__form { margin: .25rem 0 .35rem; }
.card-menu .comment-action--done { display: flex; align-items: center; min-height: 44px; padding: .5rem .65rem; font-size: var(--fs-sm); color: var(--ok); }
.card-menu .comment-delete { display: block; }
.card-menu__form { margin: 0; }
.card-menu__item--button { border: 0; background: none; font: inherit; font-size: var(--fs-sm); text-align: left; }
.card-menu__item [data-save-icon] { display: inline-flex; }
.card-menu__item [data-save-icon][hidden] { display: none; }
.card-menu__item [data-save-icon="on"] .icon { color: var(--primary); }
.card-menu__form.is-busy { opacity: .6; pointer-events: none; }
.card-menu__item--danger { border: 0; background: none; font: inherit; font-size: var(--fs-sm); text-align: left; }
.card-menu__item--danger:hover { background: var(--err-bg); color: var(--err); }
.card-menu__item--danger:hover .icon { color: var(--err); }
/* a comment's ⋮ sits at the right end of its header row, a size smaller than the content boxes' */
.comment-menu { align-self: flex-start; margin: -.4rem -.5rem -.4rem auto; }
.comment-menu .card-menu__toggle { width: 32px; height: 32px; }
.comment-menu .card-menu__toggle .icon { width: 18px; height: 18px; }

/* ── Votes (card + detail; plain form POST, enhanced by vote.js) ────── */

.vote-widget {
	display: inline-flex;
	align-items: center;
	gap: 2px;
	margin: 0;
	padding: 2px;
	border-radius: var(--radius-pill);
	background: var(--raised-bg);
}
.btn-vote {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 42px;
	min-height: 42px;
	border: none;
	border-radius: var(--radius-pill);
	background: transparent;
	color: var(--muted);
	cursor: pointer;
	padding: 0;
	text-decoration: none;
	transition: color .15s, background .15s, transform .15s;
}
.btn-vote:hover { background: var(--card-bg); color: var(--primary); text-decoration: none; }
.btn-vote .icon { width: 22px; height: 22px; }
.btn-vote--up.is-active,
.btn-vote--up[aria-pressed="true"] { color: var(--ok); }
.btn-vote--down.is-active,
.btn-vote--down[aria-pressed="true"] { color: var(--err); }
.vote-score {
	min-width: 2.2ch;
	text-align: center;
	font-size: var(--fs-base);
	font-weight: 700;
	color: var(--ink);
	font-variant-numeric: tabular-nums;
}
.vote-score.is-positive { color: var(--ok); }
.vote-score.is-negative { color: var(--err); }
.vote-widget.is-busy { opacity: .7; pointer-events: none; }
.bump { animation: vote-bump .35s ease; }
@keyframes vote-bump {
	0% { transform: scale(1); }
	40% { transform: scale(1.35); }
	100% { transform: scale(1); }
}
@media (prefers-reduced-motion: reduce) { .bump { animation: none; } .btn-vote { transition: none; } }

@media (max-width: 399px) {
	/* small phones (after the base rules it overrides): keep votes · comments · Podijeli · open on one row (from 375px; 320px wraps the right group) */
	.card-actions { gap: 2px; }
	.comments-link { padding: 0 .35rem; }
	.btn-vote { min-width: 38px; }
	.action-btn { min-width: 40px; padding: 0 .3rem; }
	.share-btn { padding: 0 .4rem; gap: .3rem; }
}

/* ── Single content pages ───────────────────────────────────────────── */

.single {
	--accent: var(--navy);
	--accent-ink: #fff;
	background: var(--card-bg);
	border-radius: var(--radius);
	box-shadow: var(--shadow-2);
	/* not overflow:hidden (the ⋮ menu panel); the accent head and the last band round their own corners */
}
.single-joke { --accent: var(--section-jokes); --accent-ink: var(--ink-on-jokes); }
.single-text { --accent: var(--section-texts); --accent-ink: var(--ink-on-texts); }
.single-meme { --accent: var(--section-memes); --accent-ink: var(--ink-on-memes); }

/* accent title bar with production's Natrag / Sljedeći arrows */
.single-head {
	display: grid;
	grid-template-columns: auto 1fr auto;
	align-items: center;
	gap: var(--space-2);
	padding: var(--space-2);
	border-radius: var(--radius) var(--radius) 0 0;
	background: var(--accent);
	color: var(--accent-ink);
}
.single-head h1 { margin: 0; font-size: var(--fs-lg); text-align: center; padding: .2rem var(--space-2); }
@media (min-width: 768px) { .single-head h1 { font-size: var(--fs-xl); } }
.single-head__nav {
	display: inline-flex;
	align-items: center;
	gap: .2rem;
	min-height: 40px;
	padding: 0 .75rem;
	border-radius: var(--radius-pill);
	background: var(--primary);
	color: #fff;
	font-weight: 700;
	font-size: var(--fs-sm);
	box-shadow: 0 2px 0 var(--primary-dark);
}
.single-head__nav:hover { background: var(--primary-dark); color: #fff; text-decoration: none; }
.single-head__nav .icon { width: 18px; height: 18px; }
.single-head__nav.is-placeholder { visibility: hidden; }
@media (max-width: 549px) { .single-head__nav .label { display: none; } .single-head__nav { padding: 0 .55rem; } }

.single .card__head { padding: var(--space-4) var(--space-5) 0; margin-bottom: 0; }
.single-body, .single-desc { padding: var(--space-4) var(--space-5); overflow-wrap: break-word; }
@media (min-width: 550px) { .single-body, .single-desc, .single .card__head { padding-left: var(--space-6); padding-right: var(--space-6); } }
.single-body { font-size: var(--fs-body); line-height: var(--lh-body); }
.single-body > * { max-width: var(--measure); }
.single-meta {
	padding: var(--space-2) var(--space-5);
	border-top: 1px solid var(--rule);
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: var(--space-2) var(--space-3);
	font-size: var(--fs-sm);
	color: var(--muted);
}
.single-meta .signature { color: var(--primary); font-weight: 700; }
.single-meme img { display: block; margin: var(--space-4) auto; max-width: 100%; }
.single-meme .carousel { margin: var(--space-4) var(--space-5); }
.single-meme .carousel__image { margin: 0; width: 100%; max-width: none; }
@media (min-width: 550px) { .single-meme .carousel { margin-left: var(--space-6); margin-right: var(--space-6); } }
/* a text's cover (doc 18 P4): under the title bar and the author row, above the body */
.single-cover { padding: var(--space-4) var(--space-5) 0; }
.single-cover img { display: block; margin: 0 auto; border-radius: var(--radius-sm); background: var(--raised-bg); }
@media (min-width: 550px) { .single-cover { padding-left: var(--space-6); padding-right: var(--space-6); } }
.single-next {
	display: flex;
	flex-wrap: wrap;
	gap: var(--space-2);
	justify-content: center;
	padding: var(--space-3) var(--space-5) var(--space-4);
	border-radius: 0 0 var(--radius) var(--radius);
	background: var(--raised-bg);
}

.single-body blockquote {
	margin: .75rem 0;
	padding: .6rem .9rem;
	border-left: 5px solid var(--dialogue-rule);
	background: var(--comment-bg);
	color: var(--ink-soft);
	font-style: italic;
}

/* ── Comments ───────────────────────────────────────────────────────── */

.comments-section {
	background: var(--comment-bg);
	border-radius: var(--radius);
	padding: var(--space-4);
	box-shadow: var(--shadow-1);
	scroll-margin-top: 72px;
	display: flex;
	flex-direction: column;
	gap: var(--space-4);
}
@media (min-width: 550px) { .comments-section { padding: var(--space-5) var(--space-6) var(--space-6); } }

/* heading + sort tabs (DEC-56) */
.comments-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); flex-wrap: wrap; }
.comments-head h2 { margin: 0; font-size: var(--fs-lg); display: flex; align-items: center; gap: var(--space-2); }
.comments-head .count-pill { background: var(--card-bg); }
.comment-sort { display: inline-flex; padding: 3px; gap: 2px; border-radius: var(--radius-pill); background: var(--card-bg); box-shadow: inset 0 0 0 1px var(--comment-sep); }
.comment-sort__tab {
	padding: .35rem .8rem; border-radius: var(--radius-pill);
	color: var(--muted); font-size: .82rem; font-weight: 700; white-space: nowrap;
}
.comment-sort__tab:hover { color: var(--ink); text-decoration: none; }
.comment-sort__tab.is-active { background: var(--section-user); color: var(--ink-on-user); }

/* logged-out prompt */
.comment-login {
	display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap;
	padding: var(--space-4); border-radius: var(--radius); background: var(--card-bg);
	border: 1px dashed var(--comment-sep);
}
.comment-login p { margin: 0; flex: 1 1 14rem; color: var(--ink-soft); }
.comment-login__actions { display: flex; gap: var(--space-2); }

.comment-done {
	margin: 0; padding: var(--space-3) var(--space-4); border-radius: var(--radius);
	background: var(--card-bg); border: 1px dashed var(--comment-sep); color: var(--ink-soft);
}

/* composer */
.composer { display: flex; align-items: flex-start; gap: var(--space-3); }
.composer > .avatar-letter { margin-top: 2px; }
@media (max-width: 549px) { .composer > .avatar-letter { display: none; } }
.composer__box {
	flex: 1; min-width: 0;
	background: var(--card-bg);
	border: 1px solid var(--field-border);
	border-radius: var(--radius);
	transition: border-color .15s, box-shadow .15s;
}
.composer__box:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent); }
.comment-form textarea,
.reply__form textarea {
	display: block; width: 100%;
	padding: .75rem .9rem;
	border: 0; border-radius: var(--radius);
	background: transparent; color: var(--ink);
	font: inherit; line-height: 1.45;
	resize: none; min-height: 3.2rem;
	overflow-wrap: anywhere;
}
.comment-form textarea:focus, .reply__form textarea:focus { outline: none; }
.composer__foot {
	display: flex; align-items: center; justify-content: flex-end; gap: var(--space-3); flex-wrap: wrap;
	padding: .4rem .5rem .5rem .9rem;
	border-top: 1px solid var(--rule);
}
.composer__hint { margin-right: auto; font-size: .8rem; color: var(--muted); }
@media (hover: none) { .composer__kbd { display: none; } }
.composer__count { font-size: .78rem; color: var(--muted); }
.composer__count.is-low { color: var(--err); font-weight: 700; }
.composer__error { margin: 0; padding: .4rem .9rem; font-size: .85rem; color: var(--err); background: var(--err-bg); }
.comment-form .btn-primary, .reply__form .btn-primary { min-height: 38px; padding: .4rem 1.1rem; }
.is-busy .btn-primary { opacity: .65; cursor: progress; }
.js-comment-form .btn-primary:disabled { opacity: .5; cursor: not-allowed; filter: saturate(.6); }

/* the thread */
.comment-list { display: flex; flex-direction: column; gap: var(--space-3); }
.comments-empty { margin: 0; padding: var(--space-5) var(--space-4); text-align: center; color: var(--muted); border: 2px dashed var(--comment-sep); border-radius: var(--radius); }

.comment {
	display: flex; align-items: flex-start; gap: var(--space-3);
	scroll-margin-top: 80px;
	border-radius: var(--radius);
}
.comment-depth-0 { background: var(--card-bg); padding: var(--space-4); box-shadow: 0 1px 2px rgba(10, 24, 50, .06); }
.comment-main { flex: 1; min-width: 0; }
.comment-head { display: flex; align-items: center; flex-wrap: wrap; gap: .25rem .5rem; font-size: .85rem; line-height: 1.3; }
.comment-author { font-weight: 700; color: var(--primary); overflow-wrap: anywhere; }
.comment-badge {
	padding: .05rem .45rem; border-radius: var(--radius-pill);
	font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
}
.comment-badge--own { background: color-mix(in srgb, var(--section-user) 16%, var(--card-bg)); color: var(--section-user); }
.comment-badge--op { background: color-mix(in srgb, var(--primary) 16%, var(--card-bg)); color: var(--primary-dark); }
.comment-time { color: var(--muted); font-size: .8rem; }
.comment-time::before { content: "·"; margin-right: .5rem; }
.comment-time:hover { color: var(--ink-soft); }
.comment-body { margin-top: .3rem; color: var(--ink); line-height: 1.5; overflow-wrap: anywhere; }
.comment-body p { margin: 0 0 .5rem; }
.comment-body p:last-child { margin-bottom: 0; }
.comment-deleted { font-style: italic; color: var(--muted); }

.comment-actions { margin-top: .4rem; margin-left: -.45rem; display: flex; align-items: center; flex-wrap: wrap; gap: .1rem .25rem; }
.comment-action {
	display: inline-flex; align-items: center; gap: .3rem;
	min-height: 34px; padding: .25rem .55rem;
	border: 0; border-radius: var(--radius-pill); background: none;
	color: var(--muted); font: inherit; font-size: .82rem; font-weight: 700;
	cursor: pointer; list-style: none; white-space: nowrap;
}
.comment-action::-webkit-details-marker { display: none; }
.comment-action .icon { width: 16px; height: 16px; }
.comment-action:hover { background: var(--raised-bg); color: var(--ink); text-decoration: none; }
.comment-action--done { color: var(--ok); cursor: default; }
.comment-action--done:hover { background: none; color: var(--ok); }

.comment-vote { gap: 0; padding: 0; background: none; box-shadow: none; }
.comment-actions .btn-vote { min-width: 34px; min-height: 34px; padding: .1rem .3rem; border-radius: var(--radius-pill); }
.comment-actions .btn-vote .icon { width: 16px; height: 16px; }
.comment-vote .vote-score { min-width: 1.2rem; font-size: var(--fs-sm); text-align: center; }

/* replies: indented under the avatar column with a thread line */
.comment-children {
	margin-top: var(--space-3);
	padding-left: var(--space-3);
	border-left: 2px solid var(--comment-sep);
	display: flex; flex-direction: column; gap: var(--space-3);
}
@media (max-width: 549px) {
	.comment-depth-0 { padding: var(--space-3); }
	.comment { gap: var(--space-2); }
	.comment-children .avatar-letter--sm { width: 26px; height: 26px; font-size: .78rem; }
	.comment-children .comment-children { padding-left: var(--space-2); }
}

/* own / just-posted / linked comment highlights */
.comment-depth-0.is-own { box-shadow: inset 3px 0 0 var(--section-user), 0 1px 2px rgba(10, 24, 50, .06); }
.comment.is-new > .comment-main > .comment-body,
.comment:target > .comment-main > .comment-body { animation: comment-flash 2.4s ease-out; }
.comment:target { outline: 2px solid color-mix(in srgb, var(--primary) 55%, transparent); outline-offset: 4px; }
.comment:focus { outline: none; }
.comment.is-removing { opacity: 0; transform: scale(.98); transition: opacity .2s, transform .2s; }
@keyframes comment-flash {
	from { background: color-mix(in srgb, var(--primary) 22%, transparent); box-shadow: 0 0 0 6px color-mix(in srgb, var(--primary) 22%, transparent); border-radius: 4px; }
	to { background: transparent; box-shadow: 0 0 0 6px transparent; }
}
@media (prefers-reduced-motion: reduce) {
	.comment.is-new > .comment-main > .comment-body, .comment:target > .comment-main > .comment-body { animation: none; }
	.comment.is-removing { transition: none; }
}

.comments-more {
	display: flex; align-items: center; justify-content: center; gap: var(--space-2);
	min-height: 48px; border-radius: var(--radius);
	border: 2px dashed var(--comment-sep); background: var(--card-bg);
	color: var(--ink-soft); font-weight: 700;
}
.comments-more:hover { border-style: solid; border-color: var(--section-user); color: var(--section-user); text-decoration: none; }
.comments-more[aria-busy="true"] { opacity: .7; cursor: progress; }

/* reply + report disclosures */
details.reply { display: inline-block; }
details.report > summary { list-style: none; }
details.report > summary::-webkit-details-marker { display: none; }
/* an open reply box gets its own full-width row under the action buttons; its own
   Odustani button replaces the toggle */
.comment-actions details[open] { order: 10; flex-basis: 100%; }
.comment-actions details[open] > summary { display: none; }

.reply__form, .report__form {
	display: flex; flex-direction: column; gap: 0;
	margin: .35rem 0 .2rem .45rem;
	background: var(--card-bg);
	border: 1px solid var(--field-border); border-radius: var(--radius);
	overflow: hidden;
}
.reply__form:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent); }
.comment-children .reply__form { background: var(--field-bg); }
.report__form { gap: .5rem; padding: .75rem; }
.report__form textarea, .report__field select {
	width: 100%; padding: .45rem .55rem; border: 1px solid var(--field-border);
	border-radius: var(--radius-sm); background: var(--field-bg); color: inherit; font: inherit;
}
.report__form .composer__error { margin: 0 -.75rem; }
.report__field { display: flex; flex-direction: column; gap: .2rem; font-size: .82rem; color: var(--ink-soft); }
.reply__actions { display: flex; align-items: center; justify-content: flex-end; gap: .5rem; padding: .4rem .5rem; border-top: 1px solid var(--rule); flex-wrap: wrap; }
.reply__actions .composer__count { margin-right: auto; padding-left: .4rem; }
.reply__actions .btn { min-height: 38px; padding: .35rem .9rem; }
.report__actions { display: flex; gap: .5rem; justify-content: flex-end; flex-wrap: wrap; }

.comment-delete { margin: 0; }

.confirm-dialog {
	border: none; border-radius: var(--radius); padding: 1.25rem; max-width: 22rem;
	background: var(--card-bg); color: inherit; box-shadow: var(--shadow-3);
}
.confirm-dialog::backdrop { background: rgba(0, 0, 0, .4); }
.confirm-dialog__msg { margin: 0 0 1rem; }
.confirm-dialog__actions { display: flex; gap: .5rem; justify-content: flex-end; }

/* ── Pagination + load more ─────────────────────────────────────────── */

.pagination {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: .3rem;
	padding: .5rem;
	background: var(--card-bg);
	border-radius: var(--radius);
	box-shadow: var(--shadow-1);
	font-size: .95rem;
}
.pagination a,
.pagination span {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 42px;
	min-height: 42px;
	padding: 0 .55rem;
	border: 1px solid transparent;
	border-radius: var(--radius-pill);
	color: var(--primary);
	font-weight: 700;
}
.pagination a:hover { background: var(--primary); color: #fff; text-decoration: none; }
.pagination .page-current { background: var(--primary); color: #fff; }
.pagination .gap { color: var(--muted); min-width: 1.5rem; }

.load-more {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: .5rem;
	width: 100%;
	min-height: 52px;
	border: 2px dashed rgba(255, 255, 255, .55);
	border-radius: var(--radius);
	background: rgba(255, 255, 255, .08);
	color: #fff;
	font: inherit;
	font-weight: 700;
	font-size: var(--fs-md);
	cursor: pointer;
}
.load-more:hover { background: rgba(255, 255, 255, .16); border-style: solid; }
.load-more[aria-busy="true"] { opacity: .7; cursor: progress; }

/* ── Buttons ────────────────────────────────────────────────────────── */

.btn, button.btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: .4rem;
	padding: .5rem 1rem;
	border: 1px solid var(--rule);
	border-radius: var(--radius-pill);
	background: var(--card-bg);
	color: var(--ink);
	font: inherit;
	font-weight: 700;
	cursor: pointer;
	text-decoration: none;
	min-height: 42px;
}
.btn:hover { background: var(--raised-bg); text-decoration: none; }
.btn .icon { width: 18px; height: 18px; }

.btn-primary,
.comment-form button,
.contact-form button,
.auth-form button,
.submit-form button,
.search-form-lg button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: .4rem;
	padding: .55rem 1.2rem;
	border: none;
	border-radius: var(--radius-pill);
	background: var(--primary);
	color: var(--on-primary);
	font: inherit;
	font-weight: 700;
	cursor: pointer;
	text-decoration: none;
	min-height: 44px;
}
.btn-primary:hover,
.comment-form button:hover,
.contact-form button:hover,
.auth-form button:hover,
.submit-form button:hover,
.search-form-lg button:hover { background: var(--primary-dark); color: #fff; text-decoration: none; }

.btn-link {
	background: none;
	border: none;
	padding: .45rem .7rem;
	font: inherit;
	font-weight: 700;
	color: inherit;
	cursor: pointer;
}

.btn-danger, button.btn-danger, .auth-form button.btn-danger { color: #fff; background: var(--err); border-color: var(--err); }
.btn-danger:hover, button.btn-danger:hover, .auth-form button.btn-danger:hover { filter: brightness(0.95); background: var(--err); color: #fff; }

.submit-choices {
	display: grid;
	grid-template-columns: 1fr;
	gap: var(--space-3, .75rem);
	margin-top: 1rem;
}
@media (min-width: 550px) {
	.submit-choices { grid-template-columns: repeat(3, 1fr); }
}
.submit-choice {
	--accent: var(--navy);
	position: relative;
	overflow: hidden;
	display: grid;
	grid-template-columns: auto 1fr;
	grid-template-rows: auto auto;
	column-gap: 1rem;
	align-items: center;
	padding: 1rem 1.1rem 1rem 1.3rem;
	border: 2px solid var(--field-border);
	border-radius: var(--radius);
	background: var(--card-bg);
	color: var(--ink);
	text-decoration: none;
	transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
/* accent strip: left edge on phones, top edge on the square tiles */
.submit-choice::before {
	content: "";
	position: absolute;
	inset: 0 auto 0 0;
	width: 6px;
	background: var(--accent);
}
.submit-choice .submit-choice__icon { grid-row: 1 / 3; }
.submit-choice__label { align-self: end; }
.submit-choice__hint { align-self: start; }
@media (min-width: 550px) {
	.submit-choice {
		aspect-ratio: 1 / 1;
		grid-template-columns: 1fr;
		grid-template-rows: auto auto 2.6em;
		align-content: center;
		justify-items: center;
		row-gap: .4rem;
		padding: 1.4rem 1rem 1rem;
		text-align: center;
	}
	.submit-choice::before { inset: 0 0 auto 0; width: auto; height: 6px; }
	.submit-choice .submit-choice__icon { grid-row: auto; margin-bottom: .3rem; }
	.submit-choice__label, .submit-choice__hint { align-self: auto; }
}
.submit-choice:hover,
.submit-choice:focus-visible {
	border-color: var(--accent);
	box-shadow: var(--shadow-2);
	transform: translateY(-3px);
	color: var(--ink);
	text-decoration: none;
}
.submit-choice__icon {
	display: grid;
	place-items: center;
	width: 3.2rem;
	height: 3.2rem;
	border-radius: 50%;
	background: var(--accent);
	color: var(--accent-ink);
}
.submit-choice__icon .icon { width: 1.8rem; height: 1.8rem; }
@media (min-width: 550px) {
	.submit-choice__icon { width: 4rem; height: 4rem; }
	.submit-choice__icon .icon { width: 2.2rem; height: 2.2rem; }
}
.submit-choice__label { font-size: var(--fs-xl, 1.5rem); font-weight: 700; }
.submit-choice__hint { font-size: .88rem; color: var(--muted); }
.submit-choice--jokes { --accent: var(--section-jokes); --accent-ink: var(--ink-on-jokes); }
.submit-choice--texts { --accent: var(--section-texts); --accent-ink: var(--ink-on-texts); }
.submit-choice--memes { --accent: var(--section-memes); --accent-ink: var(--ink-on-memes); }
/* on /posalji/{vic|tekst|sliku}: the chosen tile is highlighted, the other two dimmed (still links to switch) */
.submit-choices.has-selection { margin-bottom: var(--space-6); }
.submit-choice.is-selected { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 35%, transparent); }
.has-selection .submit-choice:not(.is-selected) { opacity: .6; }
.has-selection .submit-choice:not(.is-selected):hover,
.has-selection .submit-choice:not(.is-selected):focus-visible { opacity: 1; }
.submit-form.submit-form--wide { max-width: none; }
@media (prefers-reduced-motion: reduce) {
	.submit-choice { transition: none; }
	.submit-choice:hover, .submit-choice:focus-visible { transform: none; }
}

/* ── Forms ──────────────────────────────────────────────────────────── */

.auth-form, .contact-form, .submit-form, .search-form-lg {
	display: flex;
	flex-direction: column;
	gap: .8rem;
	max-width: 480px;
}
.auth-form label, .contact-form label, .submit-form label {
	display: flex;
	flex-direction: column;
	gap: .3rem;
	font-weight: 700;
	color: var(--ink-soft);
	font-size: .92rem;
}
.auth-form input, .auth-form textarea,
.contact-form input, .contact-form textarea, .contact-form select,
.submit-form input, .submit-form textarea, .submit-form select,
.search-form-lg input,
.form input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
.form select, .form textarea {
	width: 100%;
	padding: .6rem .75rem;
	border: 1px solid var(--field-border);
	border-radius: var(--radius-sm);
	background: var(--field-bg);
	color: var(--ink);
	font: inherit;
}
.auth-form input:focus, .auth-form textarea:focus,
.contact-form input:focus, .contact-form textarea:focus, .contact-form select:focus,
.submit-form input:focus, .submit-form textarea:focus, .submit-form select:focus,
.search-form-lg input:focus,
.form input:focus, .form select:focus, .form textarea:focus {
	border-color: var(--primary);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent);
}
textarea { resize: vertical; }

/* /kontakt (DEC-137): the hints under the form's fields, and the trap field no person sees or tabs into */
.page-contact > p { margin: 0 0 var(--space-4); color: var(--ink-soft); }
.contact-form .form-hint { margin: -.3rem 0 0; }
.contact-form__trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.search-form-lg { flex-direction: row; max-width: none; }
.search-form-lg input { flex: 1; }

/* The submit forms' tag picker (DEC-123): 1–3 pill checkboxes. A plain checkbox list without JS; submit-tags.js adds the
   counter and disables the rest at three. The real checkbox sits invisibly over its pill (focus + keyboard + touch). */
.tag-picker { margin: 0; padding: 0; border: 0; min-width: 0; }
.tag-picker legend { padding: 0; margin: 0 0 .5rem; font-weight: 700; color: var(--ink-soft); font-size: .92rem; }
.tag-picker__list { display: flex; flex-wrap: wrap; gap: var(--space-2); margin: 0; padding: 0; list-style: none; }
.submit-form .tag-picker__option { position: relative; display: inline-flex; flex-direction: row; gap: 0; font-size: inherit; font-weight: 700; color: inherit; cursor: pointer; }
.submit-form .tag-picker__option input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; padding: 0; border: 0; opacity: 0; cursor: inherit; }
.tag-picker__label {
	display: inline-flex;
	align-items: center;
	gap: .35rem;
	min-height: 44px;
	padding: 0 1rem;
	border: 1px solid var(--rule);
	border-radius: var(--radius-pill);
	background: var(--raised-bg);
	color: var(--ink-soft);
	font-size: var(--fs-sm);
	line-height: 1.2;
}
.tag-picker__option:hover .tag-picker__label { border-color: var(--primary); color: var(--primary-dark); }
.tag-picker__option input:checked + .tag-picker__label { border-color: var(--primary); background: var(--primary); color: var(--on-primary); }
.tag-picker__option input:checked + .tag-picker__label::before { content: "\2713"; }
.tag-picker__option input:focus-visible + .tag-picker__label { outline: 2px solid var(--primary); outline-offset: 2px; }

/* the image inputs of /posalji/sliku and /posalji/tekst (doc 18 P4): submit-images.js lists what was chosen (count,
   sizes — the server judges) and warns before an oversize request is sent */
.submit-hint { margin: -.4rem 0 0; color: var(--muted); font-size: var(--fs-sm); }
/* the rights note above the submit button (DEC-136) follows the tag picker, not a field — no pull-up */
.submit-hint--terms { margin-top: 0; }
.submit-files { margin: 0; font-size: var(--fs-sm); color: var(--muted); }
.submit-files__summary { margin: 0 0 var(--space-2); font-weight: 700; color: var(--ink-soft); }
.submit-files.is-invalid .submit-files__summary { color: var(--err); }
.submit-files__list { display: grid; gap: var(--space-2); margin: 0; padding: 0; list-style: none; counter-reset: file; }
.submit-files__list li { display: flex; align-items: center; gap: var(--space-2); min-width: 0; counter-increment: file; }
.submit-files__list li::before { content: counter(file) "."; min-width: 1.5em; font-weight: 700; color: var(--ink-soft); }
.submit-files__list img { flex: none; width: 48px; height: 48px; object-fit: cover; border-radius: var(--radius-sm); background: var(--raised-bg); }
.submit-files__name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); }
.submit-files__size { flex: none; }
.tag-picker__option input:disabled + .tag-picker__label { opacity: .45; }
.tag-picker__option:has(input:disabled) { cursor: not-allowed; }
.tag-picker__option:has(input:disabled):hover .tag-picker__label { border-color: var(--rule); color: var(--ink-soft); }
.tag-picker__count { margin: .6rem 0 0; font-size: var(--fs-xs); color: var(--muted); }
.tag-picker__count.is-full { color: var(--ink-soft); font-weight: 700; }

/* generic card-like wrapper for standalone pages (auth, contact, submit, static, gone, profile, admin) */
.page-auth, .page-contact, .page-submit, .page-static, .page-gone,
.page-profile, .page-admin, .search-panel {
	background: var(--card-bg);
	border-radius: var(--radius);
	padding: var(--space-5) var(--space-5);
	box-shadow: var(--shadow-2);
}
@media (min-width: 550px) {
	.page-auth, .page-contact, .page-submit, .page-static, .page-gone,
	.page-profile, .page-admin, .search-panel { padding: var(--space-6) var(--space-7); }
}
.page-auth h1, .page-contact h1, .page-submit h1, .page-static h1,
.page-gone h1, .page-profile h1, .page-admin h1, .search-panel h1 { margin: 0 0 1rem; font-size: var(--fs-xl); }
.search-note { margin: .8rem 0 0; color: var(--muted); }
.page-auth { max-width: 460px; margin: 0 auto; width: 100%; }
.page-auth p { margin: .6rem 0 0; }
.auth-passkey { display: flex; flex-direction: column; gap: .4rem; margin-top: var(--space-4); }
.auth-passkey .btn { width: 100%; }
.auth-passkey .form-hint:empty { display: none; }
.auth-divider { display: flex; align-items: center; gap: .75rem; color: var(--muted); font-size: var(--fs-sm); }
.page-auth .auth-divider { margin: 0 0 .4rem; }
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; border-top: 1px solid var(--rule); }
.page-static p, .page-static li, .page-profile p, .page-admin p { color: var(--ink-soft); }
.page-static ul, .page-gone .gone-links { padding-left: 1.2rem; }
.gone-links { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: .5rem 1rem; }

/* legal pages (DEC-136): /uvjeti-koristenja, /pravila-privatnosti — long hand-written text inside .page-static */
.legal { line-height: 1.6; }
.legal section, .legal h3[id] { scroll-margin-top: 72px; }
.legal h2 { margin: var(--space-7) 0 var(--space-3); font-size: var(--fs-lg); }
.legal h3 { margin: var(--space-5) 0 var(--space-2); font-size: var(--fs-base); }
.legal ol { padding-left: 1.4rem; }
.legal li { margin: .35rem 0; }
.legal code { font-size: .9em; background: var(--raised-bg); border-radius: 4px; padding: .05rem .3rem; color: var(--ink); }
.legal .legal__meta { margin: -.5rem 0 var(--space-5); color: var(--muted); font-size: var(--fs-sm); }
.legal__summary { background: var(--raised-bg); border-left: 4px solid var(--primary); border-radius: var(--radius-sm); padding: var(--space-4) var(--space-5); }
.legal__summary h2 { margin: 0 0 var(--space-2); font-size: var(--fs-md); }
.legal__summary ul { margin: 0; }
.legal .legal__summary p { margin: var(--space-3) 0 0; color: var(--muted); font-size: var(--fs-sm); }
.legal__toc { margin-top: var(--space-5); padding: var(--space-4) 0; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.legal__toc ol { margin: 0; }
.legal__toc li { break-inside: avoid; }
@media (min-width: 768px) {
	.legal__toc ol { columns: 2; column-gap: var(--space-7); }
}
.legal__operator { margin: 0 0 var(--space-4); font-style: normal; line-height: 1.5; color: var(--ink-soft); }
.legal__cookies { margin: 0 0 var(--space-4); }
.legal__cookies dt { margin-top: var(--space-3); }
.legal__cookies dd { margin: .2rem 0 0; color: var(--ink-soft); }

/* ── Profiles + user area (DEC-55, DEC-100): /k/{slug}[/tekstovi|/slike|/komentari], /postavke[/lozinka|/ostalo] ── */

/* letter avatar (DEC-56) — colour derived from the username via --avatar-hue */
.avatar-letter {
	--avatar-hue: 210;
	flex: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	background: hsl(var(--avatar-hue) 62% 46%);
	color: #fff;
	font-weight: 700;
	font-size: 1.05rem;
	line-height: 1;
	box-shadow: 0 0 0 2px var(--card-bg), 0 0 0 4px hsl(var(--avatar-hue) 62% 46% / .25);
	user-select: none;
}
.avatar-letter--sm { width: 32px; height: 32px; font-size: .9rem; }
.avatar-letter--lg { width: 64px; height: 64px; font-size: 1.75rem; }
@media (min-width: 550px) { .avatar-letter--lg { width: 76px; height: 76px; font-size: 2rem; } }
.avatar-letter--anon { background: var(--raised-bg); color: var(--muted); box-shadow: 0 0 0 2px var(--card-bg); }
.avatar-letter--anon .icon { width: 60%; height: 60%; }

/* the user area has no sidebar: one centred column instead of an empty sidebar track */
@media (min-width: 992px) { .layout:has(> .content > .account) { grid-template-columns: minmax(0, 1fr); } }
.content:has(> .account) > * { width: 100%; max-width: 880px; margin-inline: auto; }
.account {
	background: var(--card-bg);
	border-radius: var(--radius);
	box-shadow: var(--shadow-2);
	overflow: hidden;
}
.account-hero {
	display: flex;
	align-items: center;
	gap: var(--space-4);
	padding: var(--space-6) var(--space-5) var(--space-5);
	background: linear-gradient(135deg, color-mix(in srgb, var(--section-user) 16%, var(--card-bg)), var(--card-bg) 70%);
	border-top: 4px solid var(--section-user);
}
@media (min-width: 550px) { .account-hero { padding: var(--space-7) var(--space-7) var(--space-6); gap: var(--space-5); } }
.account-hero__who { min-width: 0; flex: 1; }
.account-hero__name { margin: 0; font-size: var(--fs-xl); overflow-wrap: anywhere; }
@media (min-width: 550px) { .account-hero__name { font-size: 1.75rem; } }
.account-hero__meta { margin: var(--space-1) 0 0; color: var(--muted); font-size: var(--fs-sm); display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.account-hero__cta { flex: none; }
@media (max-width: 549px) {
	.account-hero { flex-wrap: wrap; }
	.account-hero__cta { width: 100%; }
}
.badge--admin { background: var(--navy); color: #fff; }

.account-tabs {
	display: flex;
	gap: var(--space-1);
	padding: 0 var(--space-3);
	border-bottom: 1px solid var(--rule);
	overflow-x: auto;
	scrollbar-width: none;
}
.account-tabs::-webkit-scrollbar { display: none; }
@media (min-width: 550px) { .account-tabs { padding: 0 var(--space-6); } }
.account-tabs__tab {
	display: inline-flex;
	align-items: center;
	gap: .4rem;
	padding: .85rem .8rem .75rem;
	border-bottom: 3px solid transparent;
	color: var(--ink-soft);
	font-weight: 700;
	white-space: nowrap;
	min-height: 48px;
}
.account-tabs__tab .icon { width: 18px; height: 18px; opacity: .75; }
@media (max-width: 419px) { .account-tabs { padding: 0 var(--space-1); gap: 0; } .account-tabs__tab { padding-inline: .6rem; } .account-tabs__tab .icon { display: none; } }
.account-tabs__tab:hover { color: var(--section-user); text-decoration: none; }
.account-tabs__tab.is-active { color: var(--section-user); border-bottom-color: var(--section-user); }
.account-tabs__tab.is-active .icon { opacity: 1; }

.account-body { padding: var(--space-5); display: flex; flex-direction: column; gap: var(--space-6); }
@media (min-width: 550px) { .account-body { padding: var(--space-6) var(--space-7) var(--space-7); } }

.account-block { display: flex; flex-direction: column; gap: var(--space-3); }
.account-block__head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); flex-wrap: wrap; }
.account-block__head h2 { margin: 0; font-size: var(--fs-lg); display: flex; align-items: center; gap: var(--space-2); }
.account-block__head a { font-weight: 700; font-size: var(--fs-sm); display: inline-flex; align-items: center; gap: .25rem; }
.account-block__head a .icon { width: 16px; height: 16px; }
.account-body > .account-block__head { margin-bottom: calc(-1 * var(--space-3)); }
.count-pill {
	display: inline-flex; align-items: center; justify-content: center;
	min-width: 1.8em; padding: .1rem .5rem; border-radius: var(--radius-pill);
	background: var(--raised-bg); color: var(--ink-soft); font-size: .8rem; font-weight: 700;
}

.stat-tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--space-3); }
@media (min-width: 768px) { .stat-tiles { grid-template-columns: repeat(4, 1fr); } }
.stat-tile {
	display: flex; flex-direction: column; gap: .15rem;
	padding: var(--space-4);
	border: 1px solid var(--rule);
	border-radius: var(--radius);
	background: var(--raised-bg);
	color: inherit;
	transition: border-color .15s, transform .15s;
}
.stat-tile:hover { text-decoration: none; border-color: var(--section-user); transform: translateY(-1px); }
.stat-tile__num { font-size: 1.75rem; font-weight: 700; line-height: 1.1; color: var(--ink); }
.stat-tile__label { font-size: var(--fs-sm); color: var(--muted); }

.empty-state {
	padding: var(--space-5);
	border: 2px dashed var(--field-border);
	border-radius: var(--radius);
	/* its own card surface: on /k/{slug} it sits straight on the blue page, where --ink-soft failed contrast */
	background: var(--card-bg);
	text-align: center;
	color: var(--ink-soft);
}
.empty-state p { margin: 0; }
.empty-state + .empty-state { margin-top: var(--space-3); }
.empty-state__icon { display: block; margin-bottom: var(--space-2); color: var(--muted); line-height: 1; }
.empty-state__icon .icon { width: 2.5rem; height: 2.5rem; }
.empty-state .empty-state__title { font-size: var(--fs-lg, 1.125rem); font-weight: 700; color: var(--ink); overflow-wrap: anywhere; }
.empty-state__title + p { margin-top: var(--space-1); }
.empty-state .empty-state__more { margin-top: var(--space-4); display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; justify-content: center; }
.empty-state__actions { margin-top: var(--space-4); display: flex; flex-wrap: wrap; gap: var(--space-2); justify-content: center; }

.sub-list, .history-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.sub-item {
	display: flex; align-items: center; gap: var(--space-3);
	padding: var(--space-3) 0;
	border-bottom: 1px solid var(--rule);
}
.sub-item:last-child { border-bottom: none; }
.sub-item__icon {
	flex: none; display: inline-flex; align-items: center; justify-content: center;
	width: 40px; height: 40px; border-radius: var(--radius-sm);
	background: color-mix(in srgb, var(--accent, var(--section-jokes)) 22%, var(--card-bg));
	color: var(--ink-soft);
}
.sub-item--joke { --accent: var(--section-jokes); }
.sub-item--meme { --accent: var(--section-memes); }
.sub-item--text { --accent: var(--section-texts); }
.sub-item__icon .icon { width: 22px; height: 22px; }
.sub-item__main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .15rem; }
.sub-item__title { font-weight: 700; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
a.sub-item__title:hover { color: var(--primary); }
.sub-item__meta { font-size: .82rem; color: var(--muted); display: flex; flex-wrap: wrap; align-items: center; gap: .3rem; }
.sub-item__meta .icon { width: 14px; height: 14px; vertical-align: -2px; }
.sub-item__meta a { color: var(--muted); }
.sub-item__hint { font-size: .8rem; color: var(--muted); font-style: italic; }
.sub-item .badge { flex: none; }

.history-item { padding: var(--space-4) 0; border-bottom: 1px solid var(--rule); display: flex; flex-direction: column; gap: var(--space-2); }
.history-item:first-child { padding-top: var(--space-1); }
.history-item:last-child { border-bottom: none; }
.history-item__context { margin: 0; font-size: .85rem; color: var(--muted); display: flex; align-items: center; gap: .35rem; flex-wrap: wrap; }
.history-item__context .icon { width: 16px; height: 16px; }
.history-item__context a { font-weight: 700; }
.history-item__body {
	padding: var(--space-3) var(--space-4);
	background: var(--comment-bg);
	border-radius: 4px var(--radius) var(--radius) var(--radius);
	color: var(--ink-soft);
	line-height: 1.45;
	overflow-wrap: anywhere;
}
.history-item__meta { margin: 0; font-size: .8rem; color: var(--muted); display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap; }
.history-item__meta .icon { width: 14px; height: 14px; vertical-align: -2px; }
.history-item__score.is-positive { color: var(--ok); }
.history-item__score.is-negative { color: var(--err); }
.history-item__open { margin-left: auto; font-weight: 700; }
.muted { color: var(--muted); }

/* public profiles (DEC-100): tab counts, the owner's "view as others" line, the feed below the profile card */
.account-tabs__count {
	display: inline-flex; align-items: center; justify-content: center;
	min-width: 1.6em; padding: .05rem .4rem; border-radius: var(--radius-pill);
	background: var(--raised-bg); color: var(--ink-soft); font-size: .72rem; font-weight: 700;
}
.account-tabs__tab.is-active .account-tabs__count { background: color-mix(in srgb, var(--section-user) 16%, var(--card-bg)); color: var(--section-user); }
.account-hero__view { margin: var(--space-2) 0 0; font-size: var(--fs-sm); color: var(--muted); display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; }
.account-hero__view .icon { width: 16px; height: 16px; }
.account-hero__view a { font-weight: 700; }
.account-block__note { margin: 0; font-size: var(--fs-sm); }
.account-block__elsewhere { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); font-size: var(--fs-sm); }
.profile-feed { scroll-margin-top: var(--space-6); }
.profile-feed .page-title { display: flex; align-items: center; justify-content: center; gap: var(--space-2); }
a.card__nick:hover, a.comment-author:hover { text-decoration: underline; }

.filter-chips, .settings-tabs { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.filter-chip {
	display: inline-flex; align-items: center; gap: .4rem;
	padding: .4rem .85rem; min-height: 38px;
	border: 1px solid var(--rule); border-radius: var(--radius-pill);
	background: var(--card-bg); color: var(--ink-soft);
	font-size: var(--fs-sm); font-weight: 700;
}
.filter-chip:hover { border-color: var(--section-user); color: var(--section-user); text-decoration: none; }
.filter-chip.is-active { background: var(--section-user); border-color: var(--section-user); color: var(--ink-on-user); }
.filter-chip__count { font-size: .75rem; opacity: .8; }

.settings-panel {
	padding: var(--space-5);
	border: 1px solid var(--rule);
	border-radius: var(--radius);
	display: flex; flex-direction: column; gap: var(--space-3);
}
.settings-panel h2 { margin: 0; font-size: var(--fs-md); }
.settings-panel__intro { margin: 0; color: var(--muted); font-size: var(--fs-sm); }
.settings-panel--quiet { background: var(--raised-bg); border-style: dashed; }
.settings-panel .auth-form { max-width: 420px; gap: var(--space-4); }
.settings-panel .auth-form button, .settings-form .btn-primary { width: auto; align-self: flex-start; }
.settings-panel .form-actions { margin-top: var(--space-1); }
.settings-form { display: flex; flex-direction: column; gap: var(--space-4); }

.switch-row { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); cursor: pointer; }
.switch-row__text { display: flex; flex-direction: column; gap: .15rem; }
.switch-row__text span { color: var(--muted); font-size: var(--fs-sm); }
.switch {
	appearance: none; -webkit-appearance: none;
	flex: none; position: relative; width: 48px; height: 28px; margin: 0;
	border-radius: var(--radius-pill); background: var(--field-border);
	cursor: pointer; transition: background .2s;
}
.switch::after {
	content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px;
	border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .3); transition: transform .2s;
}
.switch:checked { background: var(--ok); }
.switch:checked::after { transform: translateX(20px); }
.switch:focus-visible { outline: 3px solid var(--focus-ring); outline-offset: 2px; }

.theme-choices { border: 0; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: var(--space-3); }
.theme-choice {
	position: relative; display: flex; flex-direction: column; gap: .2rem;
	padding: var(--space-3); border: 2px solid var(--rule); border-radius: var(--radius); cursor: pointer;
}
.theme-choice:hover { border-color: var(--section-user); }
.theme-choice:has(input:checked) { border-color: var(--section-user); background: color-mix(in srgb, var(--section-user) 8%, var(--card-bg)); }
.theme-choice:has(input:focus-visible) { outline: 3px solid var(--focus-ring); outline-offset: 2px; }
.theme-choice input { position: absolute; bottom: var(--space-3); right: var(--space-3); margin: 0; width: 18px; height: 18px; accent-color: var(--section-user); }
.theme-choice__swatch { height: 44px; border-radius: var(--radius-sm); margin-bottom: var(--space-2); border: 1px solid var(--rule); }
.theme-choice--light .theme-choice__swatch { background: linear-gradient(#193660 0 30%, #4565a4 30% 100%); box-shadow: inset 0 -14px 0 -4px #fff; }
.theme-choice--dark .theme-choice__swatch { background: linear-gradient(#0b1424 0 30%, #141c2b 30% 100%); box-shadow: inset 0 -14px 0 -4px #232c3d; }
.theme-choice--auto .theme-choice__swatch { background: linear-gradient(105deg, #4565a4 0 50%, #141c2b 50% 100%); }
.theme-choice__label { font-weight: 700; }
.theme-choice__hint { font-size: .8rem; color: var(--muted); }

/* ── Sigurnost: passkeys, 2FA, backup codes (/postavke/sigurnost, /prijava/potvrda — SEC1) ─────────────── */
.security-status { display: inline-flex; align-items: center; gap: .4rem; margin: 0; font-weight: 700; }
.security-status .icon { width: 20px; height: 20px; }
.security-status--on { color: var(--ok); }
.security-status--off { color: var(--muted); }
.security-note {
	display: flex; align-items: flex-start; gap: .45rem; margin: 0;
	padding: var(--space-2) var(--space-3); border-radius: var(--radius-sm);
	background: var(--info-bg); color: var(--ink); font-size: var(--fs-sm);
}
.security-note .icon { flex: none; width: 18px; height: 18px; margin-top: .1rem; }
.security-note--ok { background: var(--ok-bg); }
.security-note--ok .icon { color: var(--ok); }
.security-note--warn { background: color-mix(in srgb, var(--primary) 14%, var(--card-bg)); }
.security-note[hidden] { display: none; }
.settings-panel h2 .icon { width: 20px; height: 20px; vertical-align: -3px; color: var(--section-user); }
.passkey-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-3); }
.passkey-item {
	display: flex; flex-direction: column; gap: var(--space-2);
	padding: var(--space-3); border: 1px solid var(--rule); border-radius: var(--radius-sm); background: var(--card-bg);
}
.passkey-item__head { display: flex; align-items: flex-start; gap: var(--space-3); min-width: 0; }
.passkey-item__icon {
	flex: none; display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px;
	border-radius: 50%; background: color-mix(in srgb, var(--section-user) 14%, var(--card-bg)); color: var(--section-user);
}
.passkey-item__icon .icon { width: 20px; height: 20px; }
.passkey-item__text { display: flex; flex-direction: column; gap: .15rem; min-width: 0; overflow-wrap: anywhere; }
.passkey-item__text span { color: var(--muted); font-size: var(--fs-sm); }
.passkey-item__actions { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-4); padding-left: calc(36px + var(--space-3)); }
.passkey-item__more > summary { cursor: pointer; color: var(--primary-dark); font-size: var(--fs-sm); font-weight: 700; }
.passkey-item__more[open] { flex-basis: 100%; }
.passkey-inline-form { display: flex; flex-direction: column; gap: var(--space-2); margin-top: var(--space-2); max-width: 420px; }
.passkey-inline-form label { display: flex; flex-direction: column; gap: .3rem; font-size: var(--fs-sm); font-weight: 700; }
.passkey-inline-form input {
	padding: .55rem .7rem; border: 1px solid var(--field-border); border-radius: var(--radius-sm);
	background: var(--field-bg); color: var(--ink); font: inherit;
}
.passkey-inline-form .btn { align-self: flex-start; }
[data-passkey-status]:empty { display: none; }
[data-passkey-status].is-error { color: var(--err); font-weight: 700; }
.backup-codes {
	display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: var(--space-2);
	margin: 0; padding: var(--space-3) var(--space-3) var(--space-3) 2.2rem;
	border: 1px dashed var(--field-border); border-radius: var(--radius-sm); background: var(--raised-bg);
}
.backup-codes code { font-size: var(--fs-base); letter-spacing: .06em; color: var(--ink); background: none; }
.backup-codes__actions .btn-primary { width: auto; }
.second-factor form[data-passkey] { margin-top: var(--space-4); }
.second-factor__codes { margin-top: var(--space-4); }
.second-factor__codes > summary { cursor: pointer; font-weight: 700; color: var(--primary-dark); }
.second-factor__codes .auth-form { margin-top: var(--space-3); }
.second-factor__cancel { margin-top: var(--space-4); }
/* admin step-up "Potvrdi pristup passkeyem" (SEC3): the bootstrap's step list breathes between text and button */
.page-step-up .step-list { margin: var(--space-3) 0 var(--space-4); }
/* ── Račun steps: e-mail change + account deletion (/postavke/e-mail, /postavke/brisanje-racuna — SEC2) ───── */
.settings-value { display: flex; align-items: center; gap: .45rem; margin: 0; overflow-wrap: anywhere; }
.settings-value .icon { flex: none; width: 18px; height: 18px; color: var(--section-user); }
.step-label { margin: 0; font-size: .75rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.step-list { display: flex; flex-wrap: wrap; gap: var(--space-2); margin: 0; padding: 0; list-style: none; counter-reset: step; }
.step-list li {
	counter-increment: step; display: inline-flex; align-items: center; gap: .4rem;
	padding: .3rem .75rem .3rem .35rem; border: 1px solid var(--rule); border-radius: var(--radius-pill);
	font-size: var(--fs-sm); color: var(--muted);
}
.step-list li::before {
	content: counter(step); display: inline-flex; align-items: center; justify-content: center;
	width: 1.5rem; height: 1.5rem; border-radius: 50%; background: var(--raised-bg); font-weight: 700; font-size: .75rem;
}
.step-list li.is-current { border-color: var(--section-user); color: var(--ink); font-weight: 700; }
.step-list li.is-current::before { background: var(--section-user); color: var(--ink-on-user); }
.step-list li.is-done::before { content: "✓"; background: var(--ok-bg); color: var(--ok); }
.otp-input { max-width: 12ch; font-size: 1.4rem; letter-spacing: .3em; font-variant-numeric: tabular-nums; text-align: center; }
.delete-matrix { display: grid; gap: var(--space-3); grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.delete-matrix h3 { margin: 0 0 var(--space-1); font-size: var(--fs-sm); }
.delete-matrix ul { margin: 0; padding-left: 1.2rem; font-size: var(--fs-sm); color: var(--ink-soft); display: flex; flex-direction: column; gap: .2rem; }
.delete-matrix .nowrap { white-space: nowrap; }
.settings-panel--danger { border-color: var(--err); background: var(--err-bg); }
.btn-danger-outline { color: var(--err); border-color: var(--err); background: transparent; }
.btn-danger-outline:hover { color: #fff; background: var(--err); border-color: var(--err); text-decoration: none; }
.btn-danger-outline .icon, .btn-danger .icon { width: 16px; height: 16px; vertical-align: -3px; }
@media print {
	.backup-codes-panel { border: 0; }
	.backup-codes-panel .form-actions, .backup-codes-panel .security-note--ok { display: none; }
}

/* Generic form primitives (admin edit forms) */
.form { display: flex; flex-direction: column; gap: .9rem; }
.form-field { display: flex; flex-direction: column; gap: .3rem; }
.form-field label { font-weight: 700; font-size: .9rem; }
.form-field--checkbox label { display: flex; align-items: center; gap: .5rem; font-weight: 400; }
.form textarea { resize: vertical; min-height: 8rem; }
.form-hint { font-size: .8rem; color: var(--muted); font-weight: 400; }
.form-actions { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }

/* ── PWA: install steps (/aplikacija) + install button ──────────────── */
.pwa-step { border: 1px solid var(--rule); border-radius: var(--radius-sm); margin: .6rem 0; padding: .2rem .9rem; }
.pwa-step > summary { cursor: pointer; font-weight: 700; padding: .55rem 0; color: var(--ink); }
.pwa-step > summary:hover { color: var(--primary); }
.pwa-step[open] > summary { border-bottom: 1px solid var(--rule); margin-bottom: .4rem; }
.pwa-step ol { margin: .4rem 0 .8rem; padding-left: 1.3rem; color: var(--ink-soft); }
.pwa-step ol li { margin: .25rem 0; }
.pwa-note { margin-top: 1.2rem; font-style: italic; color: var(--muted); }

.install-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: .45rem;
	min-height: 44px;
	padding: .5rem 1.1rem;
	border: 2px solid rgba(255, 255, 255, .7);
	border-radius: var(--radius-pill);
	background: transparent;
	color: #fff;
	font: inherit;
	font-weight: 700;
	cursor: pointer;
}
.install-btn:hover { background: rgba(255, 255, 255, .12); color: #fff; text-decoration: none; }
.page-pwa .install-btn { border-color: var(--primary); background: var(--primary); color: #fff; margin: var(--space-2) 0 var(--space-3); }
.page-pwa .install-btn:hover { background: var(--primary-dark); }

/* ── Flash + toast ──────────────────────────────────────────────────── */

.flash-messages { display: flex; flex-direction: column; gap: .5rem; }
.flash {
	display: flex;
	align-items: center;
	gap: .5rem;
	padding: .7rem .9rem;
	border-radius: var(--radius-sm);
	border: 1px solid transparent;
	font-size: .95rem;
	box-shadow: var(--shadow-1);
}
.flash .icon { width: 20px; height: 20px; }
.flash-success { background: var(--ok-bg); color: var(--ok); border-color: color-mix(in srgb, var(--ok) 40%, transparent); }
.flash-error   { background: var(--err-bg); color: var(--err); border-color: color-mix(in srgb, var(--err) 40%, transparent); }
.flash-info    { background: var(--info-bg); color: var(--info); border-color: color-mix(in srgb, var(--info) 40%, transparent); }

/* The inline answer of an auth form (auth-forms.js) — the look of .flash-error, in the form itself */
.form-error {
	padding: .7rem .9rem;
	border-radius: var(--radius-sm);
	border: 1px solid color-mix(in srgb, var(--err) 40%, transparent);
	background: var(--err-bg);
	color: var(--err);
	font-size: .95rem;
	font-weight: 400;
}
.form-error[hidden] { display: none; }
.form-success {
	padding: .7rem .9rem;
	border-radius: var(--radius-sm);
	border: 1px solid color-mix(in srgb, var(--ok) 40%, transparent);
	background: var(--ok-bg);
	color: var(--ok);
	font-size: .95rem;
	font-weight: 400;
}
.form-success[hidden] { display: none; }
/* auth-forms.js un-hides it for every new answer (it hides it again on each submit), so the entrance replays each time */
.form-error:not([hidden]), .form-success:not([hidden]) { animation: form-error-in .28s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes form-error-in {
	from { opacity: 0; transform: translateY(-8px); }
	to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
	.form-error:not([hidden]), .form-success:not([hidden]) { animation: none; }
}

.toast {
	position: fixed;
	left: 50%;
	bottom: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom, 0px) + var(--space-4));
	z-index: 95;
	transform: translate(-50%, 20px);
	padding: .65rem 1.1rem;
	border-radius: var(--radius-pill);
	background: #1a1d24;
	color: #fff;
	font-weight: 700;
	font-size: var(--fs-sm);
	box-shadow: var(--shadow-3);
	opacity: 0;
	pointer-events: none;
	transition: opacity .2s, transform .2s;
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }
@media (min-width: 768px) { .toast { bottom: var(--space-6); } }

/* ── Sidebar widgets ────────────────────────────────────────────────── */

.widget {
	--accent: var(--section-jokes);
	--accent-ink: var(--ink-on-jokes);
	background: var(--card-bg);
	border-radius: var(--radius);
	padding: 0 var(--space-4) var(--space-4);
	box-shadow: var(--shadow-2);
	overflow: hidden;
}
/* production's accent title bar on each widget */
.widget > h2 {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: .4rem;
	margin: 0 calc(-1 * var(--space-4)) var(--space-3);
	padding: .55rem var(--space-4);
	background: var(--accent);
	color: var(--accent-ink);
	font-size: var(--fs-base);
}
.widget > h2 .icon { width: 18px; height: 18px; }
.widget--home { --accent: var(--section-home); --accent-ink: var(--ink-on-home); }
.widget--meme { --accent: var(--section-memes); --accent-ink: var(--ink-on-memes); }
.widget--text { --accent: var(--section-texts); --accent-ink: var(--ink-on-texts); }
.widget ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.widget li { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.widget li a {
	flex: 1;
	display: block;
	padding: .4rem .5rem;
	border-radius: var(--radius-sm);
	color: var(--ink);
	font-weight: 700;
	font-size: .92rem;
}
.widget li a:hover { background: var(--raised-bg); color: var(--primary-dark); text-decoration: none; }
.widget .count {
	font-size: .75rem;
	font-weight: 700;
	color: var(--muted);
}
/* the section's tags ("kategorije"): compact two-column grid like production */
.widget .cat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 var(--space-2); }
.widget .cat-grid li a { padding: .3rem .4rem; color: var(--primary); font-size: .9rem; }
.widget .cat-grid li a:hover { color: var(--primary-dark); }
.widget .cat-grid li a[aria-current="page"] { background: var(--accent); color: var(--accent-ink); }
.widget .cat-grid li a[aria-current="page"] .count { color: inherit; opacity: .75; }

/* orange "Pošalji vic, zabavi ekipu" call-to-action */
.widget-cta {
	display: flex;
	align-items: center;
	gap: var(--space-3);
	padding: var(--space-3);
	border-radius: var(--radius);
	background: var(--primary);
	color: #fff;
	font-weight: 700;
	font-size: var(--fs-lg);
	line-height: 1.2;
	box-shadow: var(--shadow-2);
}
.widget-cta:hover { background: var(--primary-dark); color: #fff; text-decoration: none; }
.widget-cta__icon {
	display: flex;
	align-items: center;
	justify-content: center;
	flex: none;
	width: 64px;
	height: 56px;
	border-radius: var(--radius-sm);
	background: #fff;
	color: var(--primary);
}
.widget-cta__icon .icon { width: 30px; height: 30px; }

/* ── Cookie consent ─────────────────────────────────────────────────── */

.cookie-consent {
	position: fixed;
	left: var(--space-2);
	right: var(--space-2);
	bottom: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom, 0px) + var(--space-2));
	z-index: 90;
	background: rgba(16, 20, 30, .95);
	color: #fff;
	padding: .8rem 1rem;
	border-radius: var(--radius);
	box-shadow: var(--shadow-3);
	display: flex;
	align-items: center;
	justify-content: center;
	flex-wrap: wrap;
	gap: .5rem 1rem;
	font-size: .88rem;
	text-align: center;
}
@media (min-width: 768px) {
	.cookie-consent { left: 50%; right: auto; bottom: var(--space-4); transform: translateX(-50%); width: min(760px, calc(100% - 2rem)); }
}
.cookie-consent a { color: #fff; text-decoration: underline; }
.cookie-consent__btn {
	border: none;
	border-radius: var(--radius-pill);
	background: var(--primary);
	color: #fff;
	font: inherit;
	font-weight: 700;
	padding: .5rem 1.2rem;
	cursor: pointer;
	min-height: 40px;
}
.cookie-consent__btn:hover { background: var(--primary-dark); }

/* ── Footer ─────────────────────────────────────────────────────────── */

.site-footer {
	flex-shrink: 0;
	margin-top: var(--space-6);
	background: var(--footer-bg);
	color: rgba(255, 255, 255, .8);
	border-top: 4px solid transparent;
	border-image: linear-gradient(90deg, var(--section-home) 0 20%, var(--section-jokes) 20% 40%, var(--section-memes) 40% 60%, var(--section-texts) 60% 80%, var(--section-user) 80% 100%) 1;
}
.footer-inner {
	max-width: var(--shell-max);
	margin: 0 auto;
	padding: var(--space-7) var(--space-4);
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: var(--space-5);
	text-align: center;
}
.footer-social__label { margin: 0 0 .8rem; font-size: .85rem; color: rgba(255, 255, 255, .8); }
.footer-social__links { display: flex; justify-content: center; gap: 1.5rem; }
.footer-social__item {
	display: inline-flex;
	flex-direction: column;
	align-items: center;
	gap: .35rem;
	color: #fff;
	font-size: .8rem;
}
a.footer-social__item:hover { text-decoration: none; opacity: .85; }
.footer-social__links .icon { width: 28px; height: 28px; }
.footer-social__item.is-facebook:hover { color: color-mix(in srgb, var(--c-facebook) 55%, #fff); }
.footer-social__item.is-instagram:hover { color: color-mix(in srgb, var(--c-instagram) 55%, #fff); }
/* a profile without a URL yet (Threads): a labelled icon, not a link */
.footer-social__item.is-soon { cursor: default; }

.footer-nav { display: flex; flex-wrap: wrap; justify-content: center; gap: .5rem 1.25rem; }
.footer-nav a { color: rgba(255, 255, 255, .85); font-size: .9rem; }
.footer-nav a:hover { color: #fff; }

.footer-credits { margin: 0; font-size: .8rem; color: rgba(255, 255, 255, .6); }
.footer-credits a { color: rgba(255, 255, 255, .75); }

@media (min-width: 768px) {
	.footer-inner { flex-direction: row; justify-content: space-between; align-items: center; text-align: left; }
	.footer-social__links { gap: 1.25rem; }
}

/* ── Admin (reuses the same tokens) ─────────────────────────────────── */

.page-admin table { width: 100%; border-collapse: collapse; }
.page-admin th, .page-admin td { padding: .5rem .6rem; border-bottom: 1px solid var(--rule); text-align: left; }

.text-muted { color: var(--muted); }

/* Admin navigation + sub-tabs */
.admin-nav { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: 1rem; }
.admin-nav a {
	padding: .35rem .7rem; border-radius: var(--radius-sm); background: var(--card-bg);
	color: var(--ink); font-weight: 700; box-shadow: var(--shadow-1); font-size: .9rem;
}
.admin-nav a:hover, .admin-nav a.is-active { background: var(--navy); color: #fff; text-decoration: none; }

.admin-tabs { display: flex; flex-wrap: wrap; gap: .4rem; margin: 0 0 1rem; }
.admin-tabs a {
	padding: .3rem .6rem; border: 1px solid var(--rule); border-radius: var(--radius-pill);
	color: var(--ink-soft); font-size: .85rem; font-weight: 700;
}
.admin-tabs a:hover, .admin-tabs a.is-active { background: var(--primary); color: #fff; border-color: var(--primary); text-decoration: none; }

/* Admin filter bar */
.admin-filter { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin: 0 0 1rem; }
.admin-filter input, .admin-filter select {
	padding: .45rem .55rem; border: 1px solid var(--field-border); border-radius: var(--radius-sm);
	background: var(--field-bg); color: var(--ink); font: inherit;
}
.admin-filter__check { display: inline-flex; align-items: center; gap: .35rem; font-size: .9rem; }

/* Badges */
.badge {
	display: inline-block; padding: .1rem .5rem; border-radius: var(--radius-pill);
	font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .03em;
}
.badge--pending { background: var(--section-jokes); color: var(--ink-on-jokes); }
.badge--approved { background: var(--ok-bg); color: var(--ok); }
.badge--rejected { background: var(--err-bg); color: var(--err); }
.badge--scheduled { background: var(--info-bg); color: var(--info); }

/* Tables */
.table-scroll { overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.admin-table th, .admin-table td { padding: .55rem .65rem; text-align: left; border-bottom: 1px solid var(--rule); vertical-align: top; }
.admin-table th { background: var(--field-bg); font-size: .78rem; text-transform: uppercase; letter-spacing: .03em; color: var(--ink-soft); }
.admin-table tr:last-child td { border-bottom: none; }
.admin-table details summary { cursor: pointer; font-weight: 700; }
.admin-body-preview { margin: .5rem 0 0; padding: .5rem .65rem; background: var(--field-bg); border-radius: var(--radius-sm); font-size: .88rem; }

.admin-actions { display: flex; gap: .4rem; flex-wrap: wrap; align-items: center; }
.admin-actions form { display: inline; margin: 0; }

.admin-thumb { max-width: 320px; height: auto; border-radius: var(--radius-sm); }
.admin-thumb--sm { max-width: 84px; }

/* Pending queue items */
.admin-pending-item { border: 1px solid var(--rule); border-radius: var(--radius-sm); padding: .8rem .9rem; margin-bottom: 1rem; }
.admin-pending-item__head { display: flex; align-items: baseline; justify-content: space-between; gap: .8rem; flex-wrap: wrap; }
.admin-pending-item__head h3 { margin: 0; font-size: 1.05rem; }
.admin-pending-item__body { margin: .5rem 0 .7rem; }

/* Dashboard stat cards */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1rem; }
.stat-card { background: var(--card-bg); border: 1px solid var(--rule); border-radius: var(--radius); padding: 1rem; box-shadow: var(--shadow-1); text-align: center; color: inherit; }
.stat-card:hover { text-decoration: none; border-color: var(--primary); }
.stat-card__num { font-size: 2rem; font-weight: 700; color: var(--primary); }
.stat-card__label { font-size: .85rem; color: var(--muted); }

/* Report queue */
.report-queue { display: flex; flex-direction: column; gap: .8rem; }
.report-card { border: 1px solid var(--rule); border-radius: var(--radius-sm); padding: .8rem .9rem; }
.report-card__head { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.report-card__ctx { font-size: .82rem; margin-top: .25rem; }
.report-card__desc { margin: .5rem 0; font-size: .9rem; color: var(--ink-soft); }

.admin-add-category { margin-bottom: 1.5rem; }
.admin-edit-category { margin: .6rem 0; }

/* ── /obavijesti (A7, DEC-65) ───────────────────────────────────────── */

@media (min-width: 992px) { .layout:has(> .content > .notifications) { grid-template-columns: minmax(0, 1fr); } }
.content:has(> .notifications) > * { width: 100%; max-width: 760px; margin-inline: auto; }
.notifications {
	background: var(--card-bg);
	border-radius: var(--radius);
	box-shadow: var(--shadow-2);
	overflow: hidden;
}
.notifications__head {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: var(--space-3);
	padding: var(--space-5);
	border-bottom: 1px solid var(--rule);
}
.notifications__title { display: flex; align-items: center; gap: .5rem; margin: 0; font-size: var(--fs-xl); }
.notifications__title .icon { width: 26px; height: 26px; color: var(--section-user); }
.notifications__mark { margin: 0; }
.notifications__empty { padding: var(--space-6) var(--space-5); color: var(--ink-soft); }
.notifications__empty p { margin: 0 0 var(--space-2); }
.notifications .pagination { padding: var(--space-4) var(--space-5) 0; }
.notifications__foot { margin: 0; padding: var(--space-4) var(--space-5) var(--space-5); font-size: var(--fs-sm); }
.notifications__foot a { display: inline-flex; align-items: center; gap: .35rem; }
.notifications__foot .icon { width: 16px; height: 16px; }

/* /postavke/ostalo: this browser's push switch (shown by push.js only) */
.push-panel[hidden] { display: none; }
.switch:disabled { opacity: .55; cursor: not-allowed; }


/* ---------------------------------------------------------------------------------------------------------------
   Ads (doc 19): partials/ad_slot. A position reserves its height before the ad arrives (no layout jump) and
   collapses when Google leaves it empty. Tokens only — nothing here differs between the light and the dark theme.
   --------------------------------------------------------------------------------------------------------------- */
.ad-slot {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	background: var(--card-bg);
	border-radius: var(--radius);
	box-shadow: var(--shadow-1);
	padding: var(--space-5) var(--space-3) var(--space-3);
	overflow: hidden;
}
.ad-slot__label {
	position: absolute;
	top: .3rem;
	left: var(--space-3);
	font-size: .6875rem;
	line-height: 1;
	letter-spacing: .06em;
	text-transform: uppercase;
	color: var(--muted);
}
.ad-slot .adsbygoogle { display: block; width: 100%; }
.ad-slot--top { min-height: 122px; margin-bottom: var(--space-4); }
.ad-slot--bottom { min-height: 122px; margin-top: var(--space-4); }
.single + .ad-slot--bottom { margin-bottom: var(--space-4); }
.ad-slot--feed { min-height: 140px; }
.ad-slot--sidebar { min-height: 274px; }
.feed-grid > .ad-slot { grid-column: 1 / -1; }
.ad-slot:has(> .adsbygoogle[data-ad-status="unfilled"]),
.ad-slot[hidden] { display: none; }
.ad-slot--house { min-height: 0; }

.house-ad {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: var(--space-3);
	width: 100%;
	color: var(--ink);
	text-decoration: none;
	text-align: center;
}
.house-ad:hover .house-ad__title { text-decoration: underline; }
.house-ad__image { display: block; max-width: 100%; height: auto; border-radius: var(--radius-sm); }
.house-ad__text { display: flex; flex-direction: column; align-items: center; gap: var(--space-2); }
.house-ad__title { font-size: var(--fs-md, 1.0625rem); line-height: 1.25; }
.house-ad__body { color: var(--ink-soft); font-size: var(--fs-sm); }
.house-ad--text { padding: var(--space-2) 0; }
@media (min-width: 550px) {
	.ad-slot--top .house-ad:not(.house-ad--text):has(.house-ad__text),
	.ad-slot--feed .house-ad:not(.house-ad--text):has(.house-ad__text),
	.ad-slot--bottom .house-ad:not(.house-ad--text):has(.house-ad__text) { flex-direction: row; text-align: left; }
	.ad-slot--top .house-ad__image, .ad-slot--feed .house-ad__image, .ad-slot--bottom .house-ad__image { max-width: 55%; }
	.ad-slot--top .house-ad__text, .ad-slot--feed .house-ad__text, .ad-slot--bottom .house-ad__text { align-items: flex-start; }
}
