/*
Theme Name:   Cars Theme
Description:  Front-end of the classic-car community: bento tiles, mobile first. Home page layout is set in Appearance → Home layout. Data logic lives in the Cars plugins; the theme only presents it.
Version:      0.16.0
Requires at least: 6.4
Requires PHP: 8.1
Text Domain:  cars-theme
*/

/* =====================================================================
   PALETTE: the only place with colours. Change these and the whole
   site follows (tiles, buttons, navigation, admin preview excluded).
   Liberty Drive · "retro sunset": warm sunset colours on cream, with
   deep plum as the dark anchor (text, dark tiles, bottom navigation).
   Contrast (WCAG AA): ink and muted pass on ground and surface; accent
   passes as text on ground, surface and accent-soft, and with white text
   on top of it; every on-ink colour passes on dark and dark-2.
   ===================================================================== */
:root {
	/* Brand colours (from the logo) */
	--c-sun: #fbb833;           /* star, highlights on dark tiles */
	--c-coral: #fd7681;         /* stripes, decoration only (not for text) */
	--c-salmon: #fe9e95;        /* stripes, decoration only */
	--c-sand: #fdd9a0;          /* stripes, secondary text on dark tiles */

	/* Roles */
	--c-ground: #fff6ea;        /* page background, between tiles (cream) */
	--c-surface: #ffffff;       /* tiles */
	--c-ink: #2b1e3f;           /* text (plum) */
	--c-dark: #2b1e3f;          /* dark tiles, bottom navigation, active pills */
	--c-dark-2: #3b2c52;        /* cards and fields inside a dark tile */
	--c-muted: #665870;         /* secondary text */
	--c-line: #efe2cf;          /* thin separators */
	--c-line-strong: #dcc5a4;   /* dashed placeholders, outlined buttons */
	--c-accent: #c42e44;        /* primary actions, links, active states (sunset red) */
	--c-accent-ink: #ffffff;    /* text on accent */
	--c-accent-soft: #ffebc8;   /* soft accent tiles and chips (light sun) */
	--c-on-ink: #fff6ea;        /* text on dark tiles */
	--c-on-ink-muted: #fdd9a0;  /* secondary text on dark tiles (sand) */
	--c-photo: #eadcc8;         /* photo placeholder */
	--c-shadow: 43, 30, 63;     /* RGB of shadows and photo overlays (plum) */
	--c-danger: #b42318;
	--c-danger-soft: #fdecea;
	--c-success-soft: #e5f2ea;
	--c-warn-soft: #fff4db;
}

/* ---- Shape and type (rarely changed) ---- */
:root {
	--r-tile: 22px;
	--r-ctl: 14px;
	--r-sm: 10px;
	--gap: 12px;
	--gap-lg: 20px;
	--f-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	--f-head: "Space Grotesk", var(--f-body);
	--tabbar-h: 68px;
	--shell: 1344px;
}

/* =====================================================================
   Base
   ===================================================================== */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
	margin: 0;
	font: 15px/1.5 var(--f-body);
	color: var(--c-ink);
	background: var(--c-ground);
	-webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
svg { flex-shrink: 0; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 2px; }
p a, .cct-content a, .cct-hint a, .cct-note a { color: var(--c-accent); }
h1, h2, h3, h4 { font-family: var(--f-head); font-weight: 600; letter-spacing: -0.015em; line-height: 1.15; }
h1 { font-size: 1.75rem; margin: .2em 0 .3em; }
h2 { font-size: 1.3rem; margin: 1.4em 0 .6em; }
h3 { font-size: 1.05rem; margin: 0 0 .3em; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--c-accent); outline-offset: 2px; }
.screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.screen-reader-text:focus { position: fixed !important; left: 8px; top: 8px; width: auto; height: auto; clip: auto; background: var(--c-surface); padding: 10px 14px; border-radius: var(--r-sm); z-index: 100; }

.cct-wrap, .cct-shell { max-width: var(--shell); margin: 0 auto; padding-left: 12px; padding-right: 12px; }
.cct-main { padding-top: 8px; padding-bottom: 48px; min-height: 60vh; }
@media (min-width: 1024px) { .cct-wrap, .cct-shell { padding-left: 32px; padding-right: 32px; } }
@media (max-width: 1023.98px) { body { padding-bottom: calc(var(--tabbar-h) + 28px + env(safe-area-inset-bottom)); } }

/* =====================================================================
   Header (top bar) and mobile tab bar
   ===================================================================== */
.cct-top { position: sticky; top: 0; z-index: 30; background: var(--c-ground); }
.cct-top__row { display: flex; align-items: center; gap: 12px; min-height: 68px; }
@media (min-width: 1024px) { .cct-top__row { min-height: 76px; gap: 24px; } }
.cct-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; min-width: 0; }
.cct-brand__logo { display: block; height: 44px; width: auto; max-width: min(200px, 52vw); object-fit: contain; object-position: left center; }
@media (min-width: 1024px) { .cct-brand__logo { height: 52px; max-width: 240px; } }
.cct-top__spacer { flex: 1; }
.cct-top__actions { display: flex; align-items: center; gap: 8px; }

.cct-pills { display: none; }
@media (min-width: 1024px) {
	.cct-pills { display: flex; gap: 4px; padding: 4px; border-radius: 16px; background: var(--c-surface); list-style: none; margin: 0; }
	.cct-pills a { height: 40px; padding: 0 16px; border-radius: 12px; display: flex; align-items: center; text-decoration: none; font-weight: 500; color: var(--c-muted); white-space: nowrap; }
	.cct-pills a:hover { color: var(--c-ink); background: var(--c-ground); }
	.cct-pills a[aria-current="page"] { background: var(--c-dark); color: var(--c-on-ink); font-weight: 600; }
}
.cct-only-desk { display: none !important; }
@media (min-width: 1024px) { .cct-only-desk { display: flex !important; } .cct-only-phone { display: none !important; } }

.cct-iconbtn { width: 44px; height: 44px; border-radius: var(--r-ctl); border: 0; background: var(--c-surface); display: inline-flex; align-items: center; justify-content: center; text-decoration: none; cursor: pointer; }
.cct-avatar { width: 44px; height: 44px; border-radius: var(--r-ctl); background: var(--c-accent-soft); color: var(--c-accent); display: inline-flex; align-items: center; justify-content: center; font-weight: 600; text-decoration: none; overflow: hidden; }
.cct-avatar img { width: 100%; height: 100%; object-fit: cover; }

/* Menus built on <details>: no JS needed, ui.js closes them on outside click / Esc. */
.cct-menu { position: relative; }
.cct-menu > summary { list-style: none; cursor: pointer; }
.cct-menu > summary::-webkit-details-marker { display: none; }
.cct-menu__panel { position: absolute; right: 0; top: calc(100% + 8px); min-width: 230px; background: var(--c-surface); border-radius: 18px; padding: 8px; box-shadow: 0 12px 40px rgba(var(--c-shadow), .16); z-index: 40; display: flex; flex-direction: column; }
.cct-menu__panel a, .cct-menu__panel .cct-menu__who { min-height: 44px; padding: 0 12px; border-radius: 12px; display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 500; }
.cct-menu__panel a:hover { background: var(--c-ground); }
.cct-menu__count { margin-left: auto; min-width: 22px; height: 22px; padding: 0 7px; border-radius: 99px; background: var(--c-accent); color: var(--c-accent-ink); font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.cct-menu__panel .cct-menu__who { color: var(--c-muted); font-size: 13px; min-height: 32px; }
/* Language menu (cars-i18n) */
.cct-lang__btn { gap: 6px; padding-inline: 12px; font-weight: 600; }
.cct-lang__panel { min-width: 180px; }
.cct-lang__code { min-width: 26px; font-size: 12px; font-weight: 700; color: var(--c-muted); }
.cct-lang__panel a[aria-current="true"] { background: var(--c-accent-soft); }
.cct-lang__panel a[aria-current="true"] .cct-lang__code { color: var(--c-accent); }
.cct-menu__sep { height: 1px; background: var(--c-line); margin: 6px 4px; }
/* Forum bell (Cars Forum): unread notifications on the icon button. */
.cforum-bell { position: relative; }
.cforum-bell__count { position: absolute; top: 4px; right: 2px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px; background: var(--c-accent); color: var(--c-accent-ink); font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; }

.cct-tabbar { position: fixed; left: 12px; right: 12px; bottom: calc(14px + env(safe-area-inset-bottom)); z-index: 30; height: var(--tabbar-h); border-radius: 24px; background: var(--c-dark); color: var(--c-on-ink); display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); align-items: center; padding: 0 6px; box-shadow: 0 10px 30px rgba(var(--c-shadow), .22); }
@media (min-width: 1024px) { .cct-tabbar { display: none; } }
.cct-tabbar__item { height: 56px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 11px; color: var(--c-on-ink-muted); text-decoration: none; border-radius: 16px; }
.cct-tabbar__item[aria-current="page"] { color: var(--c-on-ink); font-weight: 600; }
.cct-tabbar .cct-menu { display: flex; justify-content: center; }
.cct-tabbar .cct-menu > summary { height: 56px; display: flex; align-items: center; justify-content: center; }
.cct-tabbar__add { width: 52px; height: 52px; border-radius: 18px; background: var(--c-sun); color: var(--c-dark); display: flex; align-items: center; justify-content: center; }
.cct-tabbar .cct-menu__panel { top: auto; bottom: calc(100% + 14px); right: 50%; transform: translateX(50%); color: var(--c-ink); }


/* =====================================================================
   Footer
   ===================================================================== */
.cct-footer { padding: 8px 0 32px; }
.cct-footer__tile { background: var(--c-surface); border-radius: var(--r-tile); padding: 18px 20px; display: flex; flex-wrap: wrap; gap: 10px 24px; align-items: center; font-size: 14px; color: var(--c-muted); }
.cct-footer__tile nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 18px; }
.cct-footer__tile a { color: var(--c-ink); text-decoration: none; }

/* =====================================================================
   Tiles (bento)
   ===================================================================== */
.cct-t { background: var(--c-surface); border-radius: var(--r-tile); padding: 16px; min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.cct-t--bare { background: none; padding: 0; }
.cct-t--soft { background: var(--c-accent-soft); }
/* Dark tile (hero, and any tile switched to "Dark" in Appearance → Home layout).
   The colour roles are swapped inside it, so everything in the tile (links, buttons,
   cards, secondary text) stays readable without extra rules. */
.cct-t--ink {
	background: var(--c-dark); color: var(--c-on-ink);
	--c-ink: var(--c-on-ink);
	--c-muted: var(--c-on-ink-muted);
	--c-accent: var(--c-sun);
	--c-accent-ink: var(--c-dark);
	--c-accent-soft: var(--c-dark-2);
	--c-surface: var(--c-dark-2);
	--c-ground: var(--c-dark-2);
	--c-photo: var(--c-dark-2);
	--c-line: rgba(255, 246, 234, .14);
	--c-line-strong: rgba(255, 246, 234, .32);
}
.cct-t--flush { padding: 10px; }
.cct-t__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.cct-t__title { margin: 0; font-size: 18px; }
.cct-t__more { font-size: 14px; font-weight: 500; color: var(--c-accent); text-decoration: none; white-space: nowrap; }
.cct-t__more:hover { text-decoration: underline; }
.cct-t__text { margin: 0; color: var(--c-muted); }
.cct-t__empty { margin: 0; color: var(--c-muted); font-size: 14px; }
@media (min-width: 1024px) { .cct-t { padding: 18px; border-radius: 24px; } .cct-t--bare { padding: 0; } .cct-t--flush { padding: 10px; } }

/* Grid: 2 columns on phones and tablets, 12 on desktop. Sizes come from the layout screen. */
.cct-bento { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gap); align-items: stretch; }
.cct-bento > * { grid-column: span 2; }
.cct-bento > .cct-t--p1 { grid-column: span 1; }
@media (min-width: 1024px) {
	.cct-bento { grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--gap-lg); }
	.cct-bento > * { grid-column: span 12; }
	.cct-bento > .cct-t--d3 { grid-column: span 3; }
	.cct-bento > .cct-t--d4 { grid-column: span 4; }
	.cct-bento > .cct-t--d5 { grid-column: span 5; }
	.cct-bento > .cct-t--d6 { grid-column: span 6; }
	.cct-bento > .cct-t--d7 { grid-column: span 7; }
	.cct-bento > .cct-t--d8 { grid-column: span 8; }
	.cct-bento > .cct-t--d9 { grid-column: span 9; }
	.cct-bento > .cct-t--d12 { grid-column: span 12; }
}

/* Logged-in home: left column, feed, right column. */
.cct-home { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--gap); }
.cct-home__right { display: none; }
.cct-home__left.cct-bento, .cct-home__right.cct-bento { align-content: start; }
@media (min-width: 1024px) {
	.cct-home { grid-template-columns: 300px minmax(0, 1fr); grid-template-areas: "left main" "right main"; gap: var(--gap-lg); align-items: start; }
	.cct-home__left { grid-area: left; }
	.cct-home__main { grid-area: main; }
	.cct-home__right { grid-area: right; display: grid; }
	.cct-home__left.cct-bento, .cct-home__right.cct-bento { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
	.cct-home__left.cct-bento > *, .cct-home__right.cct-bento > * { grid-column: span 2; }
	.cct-home__left.cct-bento > .cct-t--p1, .cct-home__right.cct-bento > .cct-t--p1 { grid-column: span 1; }
}
@media (min-width: 1180px) {
	.cct-home { grid-template-columns: 300px minmax(0, 1fr) 320px; grid-template-areas: "left main right"; }
}
.cct-home__main { display: flex; flex-direction: column; gap: var(--gap); min-width: 0; }
@media (min-width: 1024px) { .cct-home__main { gap: 16px; } }
.cct-home__title { margin: 10px 4px 0; font-size: 22px; }
@media (min-width: 1024px) { .cct-home__title { font-size: 28px; margin-top: 4px; } }

/* ---- Hero (visitors) ---- */
.cct-hero { padding: 10px 10px 20px; gap: 16px; border-radius: 26px; }
.cct-hero__media { border-radius: 18px; background: var(--c-dark-2); min-height: 190px; overflow: hidden; }
.cct-hero__media img { width: 100%; height: 100%; object-fit: cover; }
.cct-hero__text { padding: 0 10px; display: flex; flex-direction: column; gap: 10px; }
.cct-hero__text h1 { margin: 0; font-size: 30px; line-height: 1.1; text-wrap: balance; }
.cct-hero__text p { margin: 0; color: var(--c-on-ink-muted); text-wrap: pretty; }
.cct-hero__actions { padding: 0 10px; display: flex; gap: 8px; flex-wrap: wrap; }
.cct-hero__actions .cct-btn--primary { flex: 1; }
@media (min-width: 1024px) {
	.cct-hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-rows: 1fr auto; gap: 24px 28px; padding: 14px; min-height: 420px; border-radius: 28px; }
	.cct-hero__media { grid-column: 2; grid-row: 1 / span 2; min-height: 0; }
	.cct-hero__text { grid-column: 1; grid-row: 1; padding: 32px 0 0 26px; justify-content: flex-start; }
	.cct-hero__text h1 { font-size: 44px; line-height: 1.05; letter-spacing: -0.03em; }
	.cct-hero__text p { font-size: 17px; }
	.cct-hero__actions { grid-column: 1; grid-row: 2; padding: 0 0 22px 26px; }
	.cct-hero__actions .cct-btn--primary { flex: 0 0 auto; }
}
.cct-hero--noimg .cct-hero__media { display: none; }
@media (min-width: 1024px) { .cct-hero--noimg { grid-template-columns: 1fr; } }

/* ---- Shortcuts (2 × 2 small tiles) ---- */
.cct-shortcuts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gap); height: 100%; }
@media (min-width: 1024px) { .cct-shortcuts { gap: var(--gap-lg); } }
.cct-shortcut { background: var(--c-surface); border-radius: var(--r-tile); padding: 16px; display: flex; flex-direction: column; justify-content: space-between; gap: 14px; min-height: 118px; text-decoration: none; }
.cct-shortcut:hover { box-shadow: inset 0 0 0 2px var(--c-accent-soft); }
.cct-shortcut--soft { background: var(--c-accent-soft); }
.cct-shortcut__icon { width: 40px; height: 40px; border-radius: 12px; background: var(--c-accent-soft); color: var(--c-accent); display: flex; align-items: center; justify-content: center; }
.cct-shortcut--soft .cct-shortcut__icon { background: var(--c-surface); }
.cct-shortcut__label { display: flex; flex-direction: column; }
.cct-shortcut__label strong { font-weight: 600; }
.cct-shortcut__label span { font-size: 13px; color: var(--c-muted); }

/* ---- Counters ---- */
.cct-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gap); }
@media (min-width: 1024px) { .cct-stats { gap: 16px; } }
.cct-stat { background: var(--c-surface); border-radius: var(--r-tile); padding: 16px; display: flex; flex-direction: column; text-decoration: none; }
.cct-stat--soft { background: var(--c-accent-soft); }
a.cct-stat { transition: box-shadow .15s; }
a.cct-stat:hover { box-shadow: inset 0 0 0 2px var(--c-line-strong); }
a.cct-stat:focus-visible { outline: 2px solid var(--c-accent); outline-offset: 2px; }
.cct-stat__n { font-family: var(--f-head); font-size: 26px; font-weight: 600; line-height: 1.15; }
.cct-stat__l { font-size: 13px; color: var(--c-muted); }

/* ---- My garage ---- */
.cct-mygarage { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.cct-mygarage a { display: flex; flex-direction: column; gap: 6px; min-width: 0; text-decoration: none; }
.cct-mygarage__img { aspect-ratio: 4 / 3; border-radius: 14px; background: var(--c-photo); overflow: hidden; }
.cct-mygarage__img img { width: 100%; height: 100%; object-fit: cover; }
.cct-mygarage__name { font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cct-mygarage__add .cct-mygarage__img { background: none; border: 1.5px dashed var(--c-line-strong); color: var(--c-muted); display: flex; align-items: center; justify-content: center; }
.cct-mygarage__add .cct-mygarage__name { color: var(--c-muted); }

/* ---- Small listing lists ---- */
.cct-minigrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.cct-minigrid > a { display: flex; flex-direction: column; gap: 8px; text-decoration: none; min-width: 0; }
.cct-minigrid__img { aspect-ratio: 4 / 3; border-radius: 14px; background: var(--c-photo); overflow: hidden; }
.cct-minigrid__img img { width: 100%; height: 100%; object-fit: cover; }
.cct-minigrid__price { font-family: var(--f-head); font-weight: 600; }
.cct-minigrid__name { font-size: 13px; line-height: 1.3; }
.cct-minilist { display: flex; flex-direction: column; gap: 4px; }
.cct-mini { min-height: 56px; display: flex; align-items: center; gap: 12px; text-decoration: none; }
.cct-mini + .cct-mini { border-top: 1px solid var(--c-line); padding-top: 4px; }
.cct-mini__img { width: 56px; height: 48px; border-radius: 12px; background: var(--c-photo); overflow: hidden; flex-shrink: 0; }
.cct-mini__img img { width: 100%; height: 100%; object-fit: cover; }
.cct-mini__text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.cct-mini__text strong { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cct-mini__text span { font-size: 13px; color: var(--c-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cct-mini__price { font-weight: 600; font-size: 14px; white-space: nowrap; }

/* ---- Featured listing (first item of a marketplace tile) ---- */
.cct-feature { display: flex; flex-direction: column; gap: 6px; text-decoration: none; }
.cct-feature .cct-minigrid__price { font-size: 18px; }
.cct-feature .cct-minigrid__name { font-size: 14px; font-weight: 500; }

/* ---- Car tiles (popular cars): 2 on phones, 3 on desktop, 4 in a full-width tile ---- */
.cct-cars { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gap); height: 100%; }
.cct-cars > :nth-child(n+5) { display: none; }
@media (min-width: 1024px) {
	.cct-cars { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gap-lg); }
	.cct-cars > :nth-child(n+4) { display: none; }
	.cct-t--d12 .cct-cars { grid-template-columns: repeat(4, minmax(0, 1fr)); }
	.cct-t--d12 .cct-cars > :nth-child(4) { display: flex; }
	.cct-home .cct-cars { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.cct-home .cct-cars > :nth-child(n+3) { display: none; }
}

/* ---- Car tile (popular cars) ---- */
.cct-cartile { padding: 8px; gap: 10px; text-decoration: none; }
.cct-cartile__img { aspect-ratio: 4 / 3; border-radius: 15px; background: var(--c-photo); overflow: hidden; }
.cct-cartile__img img { width: 100%; height: 100%; object-fit: cover; }
.cct-cartile__text { padding: 0 6px 8px; display: flex; flex-direction: column; }
.cct-cartile__text strong { font-size: 14px; font-weight: 600; line-height: 1.3; }
.cct-cartile__text span { font-size: 12px; color: var(--c-muted); }
@media (min-width: 1024px) { .cct-cartile { padding: 10px; } .cct-cartile__text strong { font-size: 15px; } .cct-cartile__text span { font-size: 13px; } }

/* ---- Chips (makes, labels) ---- */
.cct-chiprow { display: flex; flex-wrap: wrap; gap: 8px; }
.cct-chiprow a { min-height: 40px; padding: 0 14px; border-radius: 12px; background: var(--c-ground); display: inline-flex; align-items: center; font-size: 14px; font-weight: 500; text-decoration: none; }
.cct-chiprow a:hover { background: var(--c-accent-soft); }
.cct-chiprow a.cct-chiprow__all { background: none; box-shadow: inset 0 0 0 1.5px var(--c-line-strong); color: var(--c-accent); font-weight: 600; }
.cct-chip { align-self: flex-start; font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--c-muted); background: var(--c-ground); padding: 4px 10px; border-radius: 99px; }
.cct-chip--accent { color: var(--c-accent); background: var(--c-accent-soft); }

/* ---- Ads ---- */
.cct-t--ad { padding: 10px 12px 12px; gap: 8px; align-items: center; }
.cct-ad__label { align-self: stretch; font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--c-muted); }
.cct-ad__slot { width: 100%; min-height: 250px; display: flex; align-items: center; justify-content: center; overflow: hidden; }
@media (min-width: 1024px) { .cct-bento > .cct-t--ad.cct-t--d12 .cct-ad__slot { min-height: 90px; } }
.cct-ad__empty { width: 100%; max-width: 300px; min-height: 250px; border-radius: 14px; border: 1.5px dashed var(--c-line-strong); background: var(--c-ground); color: var(--c-muted); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font-size: 13px; text-align: center; padding: 12px; }
.cct-ad__empty strong { color: var(--c-ink); font-size: 14px; }

/* ---- Join call to action ---- */
.cct-join h2 { margin: 0; font-size: 22px; }
.cct-join p { margin: 0; color: var(--c-muted); }
.cct-join .cct-btn { align-self: stretch; }
@media (min-width: 1024px) { .cct-join .cct-btn { align-self: flex-start; } }

/* =====================================================================
   Feed posts (updates, new cars)
   ===================================================================== */
.cct-feed { display: flex; flex-direction: column; gap: var(--gap); }
@media (min-width: 1024px) { .cct-feed { gap: 16px; } }
.cct-feed__item { min-width: 0; }
.cct-post { background: var(--c-surface); border-radius: var(--r-tile); padding: 14px; display: flex; flex-direction: column; gap: 12px; }
@media (min-width: 1024px) { .cct-post { padding: 20px; border-radius: 24px; gap: 14px; } .cct-post__text { font-size: 16px; } }
.cct-post__head { display: flex; align-items: center; gap: 10px; }
.cct-post__avatar { width: 42px; height: 42px; border-radius: 12px; background: var(--c-photo); overflow: hidden; flex-shrink: 0; }
.cct-post__avatar img { width: 100%; height: 100%; object-fit: cover; }
.cct-post__who { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.cct-post__title { font-weight: 600; text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cct-post__title:hover { text-decoration: underline; }
.cct-post__meta { font-size: 13px; color: var(--c-muted); }
.cct-post__meta a { text-decoration: none; }
.cct-post__meta a:hover { text-decoration: underline; }
.cct-post__text { margin: 0; text-wrap: pretty; overflow-wrap: anywhere; }
.cct-post__foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.cct-post__comments { min-height: 44px; padding: 0 8px; display: inline-flex; align-items: center; font-size: 14px; font-weight: 500; color: var(--c-muted); text-decoration: none; }
.cct-post--vehicle .cct-post__row { display: flex; align-items: center; gap: 12px; }
.cct-post--vehicle .cct-post__row > div { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.cct-post--vehicle .cct-post__name { font-family: var(--f-head); font-weight: 600; font-size: 17px; text-decoration: none; }
.cct-post__cover { display: block; aspect-ratio: 16 / 10; border-radius: 16px; background: var(--c-photo); overflow: hidden; }
.cct-post__cover img { width: 100%; height: 100%; object-fit: cover; }
@media (min-width: 1024px) {
	.cct-post--vehicle { display: grid; grid-template-columns: 260px minmax(0, 1fr); align-items: center; gap: 20px; }
	.cct-post--vehicle .cct-post__cover { grid-row: 1 / span 2; aspect-ratio: 13 / 9; }
	.cct-post--vehicle .cct-chip { grid-column: 2; justify-self: start; align-self: end; }
}

/* Photos of an update: 1, 2 or 3+ (big + two small). */
.cct-photos { display: grid; gap: 6px; border-radius: 14px; overflow: hidden; }
.cct-photos a { display: block; background: var(--c-photo); border-radius: 14px; overflow: hidden; position: relative; min-height: 0; }
.cct-photos img { width: 100%; height: 100%; object-fit: cover; }
.cct-photos--1 a { aspect-ratio: 16 / 10; }
.cct-photos--2 { grid-template-columns: 1fr 1fr; }
.cct-photos--2 a { aspect-ratio: 1 / 1; }
.cct-photos--3 { grid-template-columns: 2fr 1fr; grid-template-rows: repeat(2, minmax(0, 1fr)); aspect-ratio: 3 / 2; }
.cct-photos--3 a:first-child { grid-row: span 2; }
.cct-photos__more { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(var(--c-shadow), .55); color: #fff; font-weight: 600; font-size: 18px; }
@media (min-width: 1024px) { .cct-photos { gap: 8px; } }

.cct-feed__end, .cct-feed__more { display: flex; align-items: center; justify-content: center; gap: 12px; min-height: 48px; color: var(--c-muted); }
.cct-feed__more [aria-busy="true"] { opacity: .6; cursor: progress; }

/* =====================================================================
   Buttons and actions (also the follow / like buttons from the plugins)
   ===================================================================== */
.cct-btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 8px;
	min-height: 44px; padding: 0 16px;
	border: 0; border-radius: var(--r-ctl);
	background: var(--c-ground); color: var(--c-ink);
	font-weight: 600; font-size: 15px; line-height: 1.2; cursor: pointer; text-decoration: none; white-space: nowrap;
}
.cct-btn:hover { filter: brightness(.97); }
.cct-btn--primary { background: var(--c-accent); color: var(--c-accent-ink); }
.cct-btn--primary:hover { filter: brightness(1.08); }
.cct-btn--outline { background: transparent; box-shadow: inset 0 0 0 1.5px var(--c-accent); color: var(--c-accent); }
.cct-btn--ghost { background: transparent; box-shadow: inset 0 0 0 1.5px var(--c-line-strong); }
.cct-btn--light { background: rgba(255, 255, 255, .12); color: var(--c-on-ink); }
.cct-btn--surface { background: var(--c-surface); }
.cct-btn--block { width: 100%; }
.cct-btn--lg { min-height: 50px; padding: 0 22px; border-radius: 15px; }
.cct-btn--small { min-height: 36px; padding: 0 12px; font-size: 14px; border-radius: 12px; }
.cct-btn--danger { background: var(--c-danger-soft); color: var(--c-danger); }
.cct-btn[aria-pressed="true"] { background: var(--c-accent-soft); color: var(--c-accent); }
.cct-btn--follow[aria-pressed="false"] { background: var(--c-accent); color: var(--c-accent-ink); }
.cct-btn:disabled { opacity: .6; cursor: default; filter: none; }
.cct-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin: 4px 0; }
.cct-action { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cct-action a { color: var(--c-accent); font-size: 14px; font-weight: 500; }
.cct-action__count { font-variant-numeric: tabular-nums; }
.cct-msg { color: var(--c-danger); font-size: 13px; }
.cct-msg:empty { display: none; }
.cct-tools { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }

/* =====================================================================
   Existing screens (singles, archives, forms, account): restyled as tiles
   until each gets its own redesign.
   ===================================================================== */
.cct-muted { color: var(--c-muted); }
.cct-meta { color: var(--c-muted); font-size: 14px; margin: .2em 0; }
.cct-missing { color: var(--c-danger); font-style: italic; }
.cct-note { background: var(--c-warn-soft); border-radius: var(--r-ctl); padding: 10px 14px; font-size: 14px; }
.cct-crumbs { margin: 0; font-size: 14px; color: var(--c-muted); }
.cct-crumbs a { color: var(--c-muted); }
.cct-lead { font-size: 1.1rem; margin: 0; }
.cct-h1-small { font-size: 1.35rem; }
.cct-page-head { margin: 8px 4px 16px; }
.cct-section h2 { display: flex; align-items: baseline; gap: 12px; }
.cct-more { font-size: 14px; font-weight: 500; color: var(--c-accent); }
.cct-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.cct-chips a { min-height: 40px; padding: 0 14px; border-radius: 12px; background: var(--c-surface); display: inline-flex; align-items: center; gap: 6px; text-decoration: none; font-size: 14px; font-weight: 500; }

.cct-badge { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 99px; background: var(--c-ground); font-size: 12px; font-weight: 600; }
.cct-badge--active { background: var(--c-success-soft); }
.cct-badge--sold { background: var(--c-accent-soft); color: var(--c-accent); }
.cct-badge--expired, .cct-badge--draft { background: var(--c-danger-soft); color: var(--c-danger); }

.cct-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gap); }
@media (min-width: 700px) { .cct-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .cct-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--gap-lg); } }
.cct-card { background: var(--c-surface); border-radius: 20px; padding: 8px; overflow: hidden; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.cct-card__media { display: block; aspect-ratio: 4 / 3; border-radius: 14px; overflow: hidden; background: var(--c-photo); }
.cct-card__media img { width: 100%; height: 100%; object-fit: cover; }
.cct-card__body { padding: 0 6px 6px; display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.cct-card__title { font-size: 15px; font-family: var(--f-body); letter-spacing: 0; line-height: 1.3; }
.cct-card__title a { text-decoration: none; }
.cct-card .cct-meta { font-size: 13px; }
.cct-country { display: inline-flex; align-items: center; gap: 6px; }
.cct-flag { width: 18px; height: 12px; border-radius: 2px; box-shadow: 0 0 0 1px rgba(var(--c-shadow), .12); flex: none; }
.cct-card .cct-price { font-size: 17px; margin: 0; }
.cct-card .cct-actions { margin-top: auto; }
.cct-card .cct-action .cct-muted { display: none; }
.cct-excerpt { font-size: 14px; }
.cct-noimg { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; color: var(--c-muted); font-size: 13px; }
.cct-noimg--large { aspect-ratio: 4 / 3; background: var(--c-photo); border-radius: 18px; }

.cct-single__head { background: var(--c-surface); border-radius: var(--r-tile); padding: 18px 16px; margin-bottom: var(--gap); }
.cct-single__head h1 { margin: 4px 0; }
.cct-single__grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--gap); }
@media (min-width: 900px) { .cct-single__grid { grid-template-columns: 3fr 2fr; gap: var(--gap-lg); } }
.cct-single__media img { border-radius: var(--r-tile); width: 100%; }
.cct-single__specs { background: var(--c-surface); border-radius: var(--r-tile); padding: 18px 16px; }
.cct-single__specs h2 { margin-top: 0; }
.cct-specs { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 8px 16px; margin: 0; }
.cct-specs dt { color: var(--c-muted); font-size: 14px; }
.cct-specs dd { margin: 0; font-weight: 500; }
.cct-price { font-size: 1.4rem; font-family: var(--f-head); margin: .3em 0; }
.cct-price .cct-muted { font-size: 13px; font-family: var(--f-body); }
.cct-status { margin: .2em 0; font-size: 14px; }
.cct-content { max-width: 760px; margin-top: 12px; overflow-wrap: anywhere; }
.cct-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 6px; margin-top: 8px; }
.cct-gallery img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 12px; }
.cct-vehicle-chip { display: inline-flex; gap: 10px; align-items: center; text-decoration: none; background: var(--c-surface); border-radius: var(--r-ctl); padding: 6px 14px 6px 6px; }
.cct-vehicle-chip img { width: 56px; height: 56px; object-fit: cover; border-radius: 10px; }

.cct-timeline { max-width: 760px; display: flex; flex-direction: column; gap: var(--gap); }
.cct-update { background: var(--c-surface); border-radius: var(--r-tile); padding: 16px; }
.cct-update__head { color: var(--c-muted); font-size: 14px; }
.cct-update__image { margin: 10px 0; }
.cct-update__image img { border-radius: 16px; }

.cct-comments { max-width: 760px; margin-top: 24px; background: var(--c-surface); border-radius: var(--r-tile); padding: 16px; }
.cct-comment-list { padding-left: 0; list-style: none; }
.cct-comment-list .comment-body { padding: 10px 0; border-bottom: 1px solid var(--c-line); }
.cct-comment-list .avatar { display: inline-block; border-radius: 50%; vertical-align: middle; margin-right: 6px; }
.cct-comments textarea { width: 100%; min-height: 110px; padding: 12px; border: 1.5px solid var(--c-line-strong); border-radius: var(--r-ctl); background: var(--c-surface); }
.cct-comments .submit { min-height: 44px; padding: 0 18px; border: 0; border-radius: var(--r-ctl); background: var(--c-accent); color: var(--c-accent-ink); font-weight: 600; cursor: pointer; }

.cct-pagination { margin: 20px 0; display: flex; flex-wrap: wrap; gap: 6px; }
.cct-pagination .page-numbers { min-width: 44px; min-height: 44px; padding: 0 12px; display: inline-flex; align-items: center; justify-content: center; border-radius: 12px; background: var(--c-surface); text-decoration: none; font-weight: 500; }
.cct-pagination .current { background: var(--c-dark); color: var(--c-on-ink); }

.cct-debug { margin-top: 24px; font-size: 12px; background: var(--c-surface); border: 1px dashed var(--c-line-strong); border-radius: var(--r-ctl); padding: 10px 14px; }
.cct-debug summary { cursor: pointer; color: var(--c-muted); }
.cct-debug table { border-collapse: collapse; margin-top: 8px; width: 100%; }
.cct-debug th { text-align: left; padding: 2px 12px 2px 0; vertical-align: top; white-space: nowrap; }
.cct-debug td { padding: 2px 0; word-break: break-all; }

/* ---- Forms ---- */
.cct-form { max-width: 860px; }
.cct-fieldset { background: var(--c-surface); border: 0; border-radius: var(--r-tile); padding: 16px 16px 4px; margin: 0 0 var(--gap); min-width: 0; }
.cct-fieldset > legend { float: left; width: 100%; font-family: var(--f-head); font-weight: 600; font-size: 17px; padding: 0; margin-bottom: 12px; }
.cct-fieldset > legend + * { clear: both; }
.cct-field { margin: 0 0 14px; }
.cct-field > label, .cct-checks > legend { display: block; font-weight: 500; font-size: 14px; margin-bottom: 6px; }
.cct-field input[type="text"], .cct-field input[type="number"], .cct-field input[type="email"], .cct-field input[type="password"], .cct-field input[type="search"], .cct-field input[type="url"], .cct-field select, .cct-field textarea,
.cct-filters input[type="number"], .cct-filters input[type="search"], .cct-filters select {
	width: 100%; min-height: 48px; padding: 0 14px;
	border: 1.5px solid var(--c-line-strong); border-radius: var(--r-ctl); background: var(--c-surface);
}
.cct-field textarea { min-height: 160px; padding: 12px 14px; }
.cct-field input:focus, .cct-field select:focus, .cct-field textarea:focus, .cct-filters input:focus, .cct-filters select:focus { border-color: var(--c-accent); outline: none; box-shadow: 0 0 0 3px var(--c-accent-soft); }
.cct-field--invalid input, .cct-field--invalid select, .cct-field--invalid textarea { border-color: var(--c-danger); }
.cct-field__error { color: var(--c-danger); font-size: 14px; margin: 6px 0 0; }
.cct-field__error:empty { display: none; }
.cct-hint { color: var(--c-muted); font-size: 13px; margin: 6px 0 0; }
.cct-req { color: var(--c-danger); }
.cct-grid-2 { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 16px; }
@media (min-width: 700px) { .cct-grid-2 { grid-template-columns: 1fr 1fr; } }
.cct-checks { border: 0; padding: 0; margin: 0 0 14px; }
.cct-check { display: flex; gap: 10px; align-items: flex-start; margin: 6px 0; font-weight: 400; }
.cct-check input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--c-accent); flex-shrink: 0; }
.cct-checks details { border-radius: 12px; background: var(--c-ground); padding: 6px 12px; margin-bottom: 6px; }
.cct-checks summary { cursor: pointer; min-height: 36px; display: flex; align-items: center; }
.cct-photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 12px; margin-bottom: 12px; }
.cct-photo { font-size: 13px; }
.cct-photo img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 12px; }
.cct-form__actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin: 20px 0; }
.cct-form--danger { margin-top: 32px; background: var(--c-danger-soft); border-radius: var(--r-tile); padding: 16px; }
.cct-form--danger h2 { margin-top: 0; }
.cct-alert { border-radius: var(--r-ctl); padding: 10px 14px; margin-bottom: var(--gap); }
.cct-alert p { margin: 4px 0; }
.cct-alert--error { background: var(--c-danger-soft); }
.cct-alert--success { background: var(--c-success-soft); }
.cct-list { padding-left: 1.2em; }
.cct-list li { margin: 4px 0; }

/* ---- Account pages (Cars Accounts) ---- */
.cct-accountpage { max-width: 480px; margin: 0 auto; }
.cct-accountpage .cct-form { max-width: none; }
.cct-accountpage__links { margin-top: 20px; font-size: 15px; }
.cct-consents { margin-top: 8px; }
.cct-consents .cct-field { margin-bottom: 8px; }

/* ---- Filters (Cars Search) ---- */
.cct-filters { margin: 0 0 var(--gap); padding: 16px; border-radius: var(--r-tile); background: var(--c-surface); }
.cct-filters__main { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 12px; }
@media (min-width: 1024px) { .cct-filters__main { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); max-width: 720px; gap: 12px 14px; } }
.cct-filters__more > summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; }
.cct-filters__more > summary::-webkit-details-marker { display: none; }
.cct-filters__more > summary::after { content: ""; width: 8px; height: 8px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg) translateY(-2px); margin-left: 2px; transition: transform .15s; }
.cct-filters__more[open] > summary::after { transform: rotate(-135deg) translateY(-2px); }
.cct-filters__more[open] > summary { margin-bottom: 12px; }
.cct-filters__count { background: var(--c-accent); color: var(--c-accent-ink); border-radius: 999px; padding: 2px 8px; font-size: 12px; font-weight: 600; }
.cct-filters__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px 14px; }
.cct-filters__field { margin: 0; }
.cct-filters__field label { display: block; font-size: 13px; font-weight: 500; margin-bottom: 4px; }
.cct-filters__field--checkbox { align-self: end; }
.cct-filters .cct-actions { margin: 14px 0 0; }
.cct-filters .cct-chips { margin: 12px 0 0; }
.cct-filters .cct-chips a { background: var(--c-ground); }

/* ---- Legacy CTA (fallback home) ---- */
.cct-cta { margin-top: var(--gap); padding: 18px; border-radius: var(--r-tile); background: var(--c-accent-soft); }
.cct-cta h2 { margin-top: 0; }

@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; animation: none !important; } }

/* =====================================================================
   Photo uploader (assets/js/uploader.js)
   ===================================================================== */
.cct-up { position: relative; clear: both; border-radius: var(--r-ctl); transition: box-shadow .15s; margin-bottom: 12px; }
.cct-up.is-drop { box-shadow: 0 0 0 3px var(--c-accent); }
.cct-up__head { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; margin-bottom: 10px; }
.cct-up__count { font-weight: 600; }
.cct-up__hint { color: var(--c-muted); font-size: 13px; }
.cct-up__grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
@media (max-width: 420px) { .cct-up__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.cct-up__tile, .cct-up__add { position: relative; aspect-ratio: 1; border-radius: 14px; overflow: hidden; background: var(--c-photo); }
.cct-up__tile { user-select: none; -webkit-user-select: none; cursor: grab; }
.cct-up__tile.is-dragging { z-index: 5; cursor: grabbing; box-shadow: 0 12px 28px rgba(var(--c-shadow), .35); transition: none; }
.cct-up.is-sorting .cct-up__tile:not(.is-dragging) { transition: transform .15s; }
.cct-up__img, .cct-up__img img { width: 100%; height: 100%; display: block; }
.cct-up__img img { object-fit: cover; pointer-events: none; -webkit-user-drag: none; }
.cct-up__tile.is-main { box-shadow: 0 0 0 3px var(--c-sun); }
.cct-up__badge { position: absolute; left: 8px; top: 8px; padding: 2px 8px; border-radius: 999px; background: var(--c-dark); color: var(--c-on-ink); font-size: 12px; font-weight: 600; display: none; }
.cct-up__tile.is-main .cct-up__badge { display: inline-block; }
.cct-up__grip { position: absolute; right: 6px; top: 6px; width: 34px; height: 34px; border-radius: 10px; display: flex; align-items: center; justify-content: center; background: rgba(255, 255, 255, .85); color: var(--c-ink); touch-action: none; cursor: grab; }
.cct-up__tools { position: absolute; left: 0; right: 0; bottom: 0; display: flex; justify-content: space-between; gap: 4px; padding: 6px; background: linear-gradient(transparent, rgba(var(--c-shadow), .65)); }
.cct-up__btn { width: 34px; height: 34px; border: 0; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; background: rgba(255, 255, 255, .92); color: var(--c-ink); cursor: pointer; padding: 0; }
.cct-up__btn:disabled { opacity: .35; cursor: default; }
.cct-up__btn--del { margin-left: auto; color: var(--c-danger); }
.cct-up__btn:focus-visible, .cct-up__addbtn:focus-visible, .cct-up__retry:focus-visible { outline: 3px solid var(--c-accent); outline-offset: 2px; }
.cct-up__tile.is-main [data-do="main"] { color: var(--c-sun); background: var(--c-dark); opacity: 1; }
.cct-up__bar { position: absolute; left: 10px; right: 10px; top: 50%; height: 6px; margin-top: -3px; border-radius: 3px; background: rgba(255, 255, 255, .7); display: none; overflow: hidden; }
.cct-up__bar i { display: block; height: 100%; width: 0; background: var(--c-accent); transition: width .2s; }
.cct-up__tile.is-busy .cct-up__bar { display: block; }
.cct-up__tile.is-busy .cct-up__img { opacity: .55; }
.cct-up__err { position: absolute; inset: 0; padding: 10px 10px 48px; display: none; flex-direction: column; justify-content: center; gap: 8px; background: rgba(253, 236, 234, .94); color: var(--c-danger); font-size: 12px; line-height: 1.35; overflow-wrap: anywhere; }
.cct-up__tile.is-error .cct-up__err { display: flex; }
.cct-up__retry { align-self: flex-start; display: inline-flex; gap: 4px; align-items: center; min-height: 32px; padding: 0 10px; border: 1px solid currentColor; border-radius: 10px; background: #fff; color: var(--c-danger); font: inherit; font-weight: 600; cursor: pointer; }
.cct-up__retry[hidden] { display: none; }
.cct-up__add { background: transparent; }
.cct-up__addbtn { width: 100%; height: 100%; border: 2px dashed var(--c-line-strong); border-radius: 14px; background: var(--c-surface); color: var(--c-ink); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font: inherit; font-weight: 600; cursor: pointer; padding: 8px; text-align: center; }
.cct-up__addbtn small { font-weight: 400; color: var(--c-muted); font-size: 12px; }
@media (hover: none) { .cct-up__addbtn small { display: none; } }
.cct-up__addbtn:hover { border-color: var(--c-accent); color: var(--c-accent); }
.cct-up__msg { margin: 8px 0 0; font-size: 14px; min-height: 1em; }
.cct-up__msg:empty { display: none; }
.cct-up__msg--error { color: var(--c-danger); }
.cct-form.is-waiting [type="submit"] { opacity: .6; pointer-events: none; }

/* =====================================================================
   Photo viewer (assets/js/lightbox.js) and gallery links
   ===================================================================== */
.cct-lb-open, .cct-lb-open body { overflow: hidden; }
.cct-lb { position: fixed; inset: 0; z-index: 1000; background: rgba(20, 14, 30, calc(.96 * var(--lb-fade, 1))); color: #fff; }
.cct-lb[hidden] { display: none; }
.cct-lb__stage { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; overflow: hidden; touch-action: none; }
.cct-lb__img { display: block; max-width: 100vw; max-height: 100vh; max-height: 100dvh; width: auto; height: auto; object-fit: contain; user-select: none; -webkit-user-select: none; -webkit-user-drag: none; will-change: transform; cursor: zoom-in; }
.cct-lb.is-zoomed .cct-lb__img { cursor: grab; }
.cct-lb__spin { position: absolute; width: 36px; height: 36px; border: 3px solid rgba(255, 255, 255, .25); border-top-color: #fff; border-radius: 50%; animation: cct-lb-spin .8s linear infinite; display: none; }
.cct-lb.is-loading .cct-lb__spin { display: block; }
@keyframes cct-lb-spin { to { transform: rotate(360deg); } }
.cct-lb__top { position: absolute; left: 0; right: 0; top: 0; display: flex; align-items: center; justify-content: space-between; padding: max(8px, env(safe-area-inset-top)) 8px 8px 16px; background: linear-gradient(rgba(0, 0, 0, .45), transparent); pointer-events: none; }
.cct-lb__top > * { pointer-events: auto; }
.cct-lb__count { font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }
.cct-lb__btn { width: 48px; height: 48px; border: 0; border-radius: 50%; background: rgba(0, 0, 0, .35); color: #fff; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; }
.cct-lb__btn:hover { background: rgba(0, 0, 0, .6); }
.cct-lb__btn:focus-visible { outline: 3px solid var(--c-sun); outline-offset: 2px; }
.cct-lb__nav { position: absolute; top: 50%; margin-top: -24px; }
.cct-lb__nav--prev { left: 12px; }
.cct-lb__nav--next { right: 12px; }
.cct-lb.is-single .cct-lb__nav, .cct-lb.is-zoomed .cct-lb__nav { display: none; }
@media (hover: none) { .cct-lb__nav { display: none; } }
.cct-lb__caption { position: absolute; left: 0; right: 0; bottom: 0; margin: 0; padding: 10px 16px max(12px, env(safe-area-inset-bottom)); text-align: center; font-size: 14px; background: linear-gradient(transparent, rgba(0, 0, 0, .45)); }
.cct-lb__caption:empty { display: none; }

a[data-cc-lb] { cursor: zoom-in; }
.cct-mainphoto { position: relative; display: block; border-radius: var(--r-tile); overflow: hidden; }
.cct-mainphoto img { display: block; width: 100%; }
.cct-mainphoto__count { position: absolute; right: 10px; bottom: 10px; display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; background: rgba(var(--c-shadow), .72); color: #fff; font-size: 13px; font-weight: 600; }
.cct-gallery a { display: block; border-radius: 12px; overflow: hidden; }
.cct-gallery a:focus-visible, .cct-mainphoto:focus-visible { outline: 3px solid var(--c-accent); outline-offset: 2px; }
@media (hover: hover) and (pointer: fine) { .cct-up__grip { display: none; } }
