/* Blyatflix homepage redesign stylesheet.
 * Copied from docs/homepage-redesign/design-system/components/bundle.css.
 * All values come from tokens.css (generated from tokens.json).
 * Do not add raw hex values here — add tokens to tokens.json and regenerate tokens.css.
 */

/* Bootstrap 3 sets body { background-color:#fff; color:#333 }.  These rules
   must win no matter in which order the stylesheets load, so the background
   is repeated with a higher specificity (html body) and !important. */
html, body { margin: 0; background: var(--bg-000); color: var(--ink); font-family: var(--font-sans); font-size: 14px; line-height: 20px; -webkit-font-smoothing: antialiased; }
html body { background-color: var(--bg-000) !important; color: var(--ink) !important; }

/* ── Top bar ─────────────────────────────────────────── */
.bf-topbar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: var(--space-5); height: 56px; padding: 0 var(--space-6); background: var(--bg-100); border-bottom: 1px solid var(--line); }
.bf-topbar__logo { height: 22px; display: block; }
.bf-nav { display: flex; height: 100%; }
.bf-nav a { position: relative; display: flex; align-items: center; padding: 0 14px; color: var(--ink-muted); font-weight: 600; }
.bf-nav a:hover { color: var(--ink); }
.bf-nav a[aria-current] { color: var(--ink); box-shadow: inset 0 -3px 0 var(--brand); }
.bf-nav__count { margin-left: 6px; font: 600 12px/1 var(--font-mono); color: var(--brand-ink); }
.bf-topbar__end { margin-left: auto; display: flex; align-items: center; gap: var(--space-2); }
.bf-iconbtn { position: relative; display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: var(--radius-md); border: 0; background: transparent; color: var(--ink-muted); cursor: pointer; }
.bf-iconbtn:hover { background: var(--bg-300); color: var(--ink); }
.bf-iconbtn__dot { position: absolute; top: 7px; right: 7px; width: 7px; height: 7px; border-radius: 50%; background: var(--brand); }
.bf-avatar { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--bg-400); font-weight: 700; font-size: 13px; }
.bf-user { display: flex; align-items: center; gap: var(--space-2); margin-left: var(--space-2); padding: 4px 10px 4px 4px; border: 1px solid var(--line); border-radius: var(--radius-pill); background: var(--bg-200) !important; box-shadow: none; cursor: pointer; color: var(--ink); }
.bf-user:hover, .bf-user:focus-visible { background: var(--bg-300) !important; color: var(--ink); }
.bf-user__name { font-weight: 600; font-size: 13px; line-height: 16px; }
.bf-user__srv { font-size: 11px; line-height: 14px; color: var(--ink-muted); }

/* ── Pills, dots ─────────────────────────────────────── */
.bf-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); flex: none; }
.bf-dot--warn { background: var(--warn); }
.bf-dot--down { background: var(--down); }
.bf-dot--unknown { background: var(--ink-subtle); opacity: 0.6; }
.bf-dot--off { background: var(--bg-400); box-shadow: inset 0 0 0 1.5px var(--ink-subtle); }

/* ── Buttons ─────────────────────────────────────────── */
.bf-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 36px; padding: 0 14px; border-radius: var(--radius-md); border: 1px solid var(--line-strong); background: var(--bg-300); color: var(--ink); font-weight: 600; font-size: 13px; cursor: pointer; white-space: nowrap; }
.bf-btn:hover { background: var(--bg-400); }
.bf-btn--primary { background: var(--brand-strong); border-color: var(--brand-strong); color: var(--on-brand); }
.bf-btn--primary:hover { background: var(--brand); }
.bf-btn--ghost { background: transparent; border-color: transparent; color: var(--ink-muted); }
.bf-btn--ghost:hover { background: var(--bg-300); color: var(--ink); }
.bf-btn--sm { height: 28px; padding: 0 10px; font-size: 12px; border-radius: var(--radius-sm); }
.bf-btn--icon { width: 28px; padding: 0; }

/* ── Sections: a heading and a rule, no boxes ─────────── */
.bf-tabs { display: flex; gap: var(--space-4); margin-left: var(--space-4); }
.bf-tabs button { height: 26px; padding: 0; border: 0; background: none; color: var(--ink-subtle); font-size: 13px; font-weight: 600; cursor: pointer; }
.bf-tabs button:hover { color: var(--ink); }
.bf-tabs button[aria-selected="true"] { color: var(--ink); box-shadow: inset 0 -2px 0 var(--ink); }
/* legacy widget wrapper (kept for WidgetCard) */
.bf-card { min-width: 0; }
.bf-card__head { display: flex; align-items: baseline; gap: var(--space-3); padding-bottom: var(--space-2); margin-bottom: var(--space-3); border-bottom: 1px solid var(--line); }
.bf-card__title { margin: 0; font-family: var(--font-display); font-stretch: 70%; font-size: 22px; line-height: 26px; font-weight: 800; }
.bf-card__src { color: var(--ink-subtle); font-size: 13px; }
.bf-card__more { margin-left: auto; color: var(--ink-muted); font-size: 13px; font-weight: 600; }
.bf-card__more:hover { color: var(--ink); }

/* ── News: one or more unseen updates, each dismissable ── */
.bf-news { max-width: var(--page-max); margin: var(--space-4) auto 0; border-radius: var(--radius-md); background: var(--news-soft); padding: 4px 4px 4px var(--space-4); }
.bf-news__item { display: flex; align-items: center; gap: var(--space-3); min-height: 34px; font-size: 13px; line-height: 18px; }
.bf-news__item + .bf-news__item { border-top: 1px solid var(--bg-000); }
.bf-news__ver { font: 600 12px/16px var(--font-mono); color: var(--news); width: 52px; flex: none; }
.bf-news__text { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bf-news__text b { font-weight: 700; }
.bf-news__text a { color: var(--news); font-weight: 600; margin-left: 6px; }
.bf-news .bf-iconbtn { width: 28px; height: 28px; }
.bf-news__foot { display: flex; justify-content: space-between; align-items: center; padding: 4px 8px 2px 0; border-top: 1px solid var(--bg-000); font-size: 12px; color: var(--ink-muted); }
.bf-news__foot button { border: 0; background: none; color: var(--news); font-weight: 600; font-size: 12px; cursor: pointer; }

/* ── Spotlight ───────────────────────────────────────── */
 .bf-spot { --spot-c: var(--spot); position: relative; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); min-height: 232px; border-radius: var(--radius-lg); background: var(--spot-soft); overflow: hidden; }
 .bf-spot__copy { padding: var(--space-6) var(--space-5) var(--space-5) var(--space-6); display: flex; flex-direction: column; align-items: flex-start; z-index: 1; }
 .bf-spot__kicker { font-size: 11px; line-height: 14px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--spot-c); }
 .bf-spot__title { margin: 8px 0 8px; font-family: var(--font-display); font-stretch: 70%; font-size: 40px; line-height: 40px; font-weight: 800; letter-spacing: -.01em; }
 .bf-spot__text { margin: 0 0 var(--space-4); color: var(--ink-muted); max-width: 440px; }
 .bf-spot__actions { display: flex; gap: var(--space-2); margin-top: auto; }
 .bf-spot__wall { position: relative; display: grid; grid-template-columns: repeat(auto-fit, minmax(64px, 1fr)); align-items: center; gap: var(--space-2); padding: var(--space-4) var(--space-3); transform: rotate(-4deg) translate(8px, -14px); }
 .bf-spot__wall .bf-poster:nth-child(even) { margin-top: 36px; }
 .bf-poster { position: relative; display: block; min-width: 0; aspect-ratio: 2 / 3; overflow: hidden; border-radius: var(--radius-md); background: var(--bg-300); }
.bf-spot__wall .bf-poster__art b { font-family: var(--font-display); font-stretch: 70%; font-size: 18px; line-height: 19px; }
.bf-spot__wall .bf-poster__kind { position: absolute; left: 8px; bottom: 8px; font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink); }
.bf-spot__dots { position: absolute; left: var(--space-6); bottom: var(--space-3); display: none; gap: 4px; }
.bf-spot__pager { position: absolute; right: var(--space-3); bottom: var(--space-3); z-index: 2; display: flex; align-items: center; gap: 2px; padding: 2px; border-radius: var(--radius-md); background: var(--scrim); font: 500 12px/1 var(--font-mono); color: var(--ink-muted); }
.bf-spot__pager span { padding: 0 6px; }

/* ── Search ──────────────────────────────────────────── */
.bf-hero { max-width: var(--search-max); margin: 0 auto; padding: var(--space-6) 0 var(--space-6); }
.bf-search { display: flex; align-items: center; gap: var(--space-2); height: 56px; padding: 5px; border-radius: var(--radius-lg); background: var(--bg-200); border: 1px solid var(--line-strong); }
.bf-search:focus-within { border-color: var(--ink-subtle); box-shadow: var(--shadow-pop); }
.bf-mode { display: flex; padding: 3px; border-radius: var(--radius-md); background: var(--bg-000); flex: none; }
.bf-mode button { display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 12px; border: 0; border-radius: 4px; background: transparent; color: var(--ink-muted); font-weight: 600; font-size: 13px; cursor: pointer; }
.bf-mode button[aria-pressed="true"] { background: var(--bg-300); color: var(--ink); }
.bf-mode button[data-mode="request"][aria-pressed="true"] { background: var(--brand-soft); color: var(--brand-ink); }
.bf-search__input { flex: 1; min-width: 0; height: 44px; border: 0; background: transparent; color: var(--ink); font: 400 18px/24px var(--font-sans); padding: 0 var(--space-2); }
.bf-search__input::placeholder { color: var(--ink-subtle); }
.bf-search__input:focus-visible { outline: none; }
.bf-kbd { display: inline-flex; align-items: center; height: 22px; padding: 0 6px; border-radius: var(--radius-sm); border: 1px solid var(--line-strong); color: var(--ink-subtle); font: 500 11px/1 var(--font-mono); flex: none; }
.bf-search__go { display: inline-grid; place-items: center; width: 46px; height: 46px; border: 0; border-radius: var(--radius-md); background: var(--brand-strong); color: var(--on-brand); cursor: pointer; flex: none; }
.bf-search__go:hover { background: var(--brand); }
.bf-chips { display: flex; gap: var(--space-2); margin-top: var(--space-3); overflow-x: auto; scrollbar-width: none; padding: 2px; }
.bf-chips::-webkit-scrollbar { display: none; }
.bf-chip[data-cat="films"] { --c: var(--cat-films); }
.bf-chip[data-cat="series"] { --c: var(--cat-series); }
.bf-chip[data-cat="mangas"] { --c: var(--cat-mangas); }
.bf-chip[data-cat="games"] { --c: var(--cat-games); }
.bf-chip[data-cat="software"] { --c: var(--cat-software); }
.bf-chip--more { padding: 0 10px; }

/* ── Posters ─────────────────────────────────────────── */
.bf-poster__art { position: absolute; inset: 0; background-color: var(--bg-100); background-repeat: no-repeat; background-position: center; background-size: contain; }
.bf-poster__art b { position: absolute; left: 10px; top: 10px; right: 10px; font-size: 16px; line-height: 18px; font-weight: 800; color: var(--ink); }

/* ── New episodes ────────────────────────────────────── */
/* Horizontally scrollable block of upcoming episodes, two rows high.
   The items are placed column-major, so every column holds two
   episodes and scrolling reveals further columns. */
.bf-newgrid {
  display: grid;
  grid-template-rows: repeat(2, auto);
  grid-auto-flow: column;
  grid-auto-columns: 220px;
  gap: 2px var(--space-4);
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: thin;
  padding-bottom: var(--space-2);
  -webkit-overflow-scrolling: touch;
}
.bf-newgrid::-webkit-scrollbar { height: 6px; }
.bf-newgrid::-webkit-scrollbar-track { background: transparent; }
.bf-newgrid::-webkit-scrollbar-thumb { background: var(--line); border-radius: 3px; }
.bf-newgrid > .bf-mini { min-width: 0; }
.bf-mini { display: flex; gap: var(--space-3); align-items: center; padding: 6px 0; min-width: 0; }
.bf-mini:hover .bf-mini__title { text-decoration: underline; text-underline-offset: 3px; }
.bf-mini__art { position: relative; width: 36px; height: 54px; border-radius: var(--radius-sm); flex: none; overflow: hidden; }
.bf-mini__body { min-width: 0; flex: 1; }
.bf-mini__title { font-size: 14px; line-height: 18px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bf-mini__ep { font: 500 12px/16px var(--font-mono); color: var(--ink-muted); }
.bf-mini__when { font-size: 12px; line-height: 16px; color: var(--ink-subtle); }
.bf-mini__when .fav { color: var(--warn); }
.bf-mini .bf-badge { flex: none; }

/* ── Rows ────────────────────────────────────────────── */
.bf-list { display: flex; flex-direction: column; }
.bf-row { display: flex; align-items: center; gap: var(--space-3); padding: 10px 0; min-width: 0; border-bottom: 1px solid var(--line); }
/* Rows become anchors when the series has a deep link. */
a.bf-row { color: inherit; text-decoration: none; }
a.bf-row:hover .bf-row__title { text-decoration: underline; text-underline-offset: 3px; }
.bf-row:last-child { border-bottom: 0; }
.bf-row__thumb { width: 36px; height: 54px; border-radius: var(--radius-sm); display: grid; place-items: center; flex: none; background: var(--bg-300); color: var(--ink-muted); overflow: hidden; }
.bf-row__body { flex: 1; min-width: 0; }
.bf-row__title { font-size: 14px; line-height: 20px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bf-row__meta { display: flex; align-items: center; gap: 6px; font-size: 12px; line-height: 16px; color: var(--ink-muted); white-space: nowrap; overflow: hidden; }
.bf-row__end { display: flex; align-items: center; gap: 4px; flex: none; }
.bf-date { width: 38px; flex: none; text-align: center; }
.bf-date b { display: block; font-family: var(--font-display); font-stretch: 70%; font-size: 24px; line-height: 24px; font-weight: 800; }
.bf-date small { display: block; font-size: 11px; line-height: 14px; font-weight: 700; color: var(--info); }
.bf-src { color: var(--ink-subtle); font-weight: 600; }
.bf-meter { display: flex; align-items: center; gap: 6px; }
.bf-meter__bar { width: 44px; height: 4px; border-radius: 2px; background: var(--bg-400); overflow: hidden; }
.bf-meter__bar > i { display: block; height: 100%; background: var(--ok); }
.bf-meter__bar--warn > i { background: var(--warn); }

/* ── Workspaces ──────────────────────────────────────── */
.bf-ws { padding: 10px var(--space-3); border-radius: var(--radius-md); background: var(--bg-200); border: 1px solid var(--line); }
.bf-ws + .bf-ws { margin-top: var(--space-2); }
.bf-ws__top { display: flex; align-items: center; gap: var(--space-3); }
.bf-ws__icon { width: 36px; height: 36px; border-radius: var(--radius-md); background: var(--bg-000); display: grid; place-items: center; flex: none; color: var(--ink); font-weight: 700; }
.bf-ws__icon img { width: 24px; height: 24px; }
.bf-ws__body { flex: 1; min-width: 0; }
.bf-ws__name { font-size: 14px; line-height: 18px; font-weight: 600; }
.bf-ws__state { display: flex; align-items: center; gap: 6px; font-size: 12px; line-height: 16px; color: var(--ink-muted); white-space: nowrap; }
.bf-ws__res { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: var(--space-3); margin-top: var(--space-3); padding-top: var(--space-3); border-top: 1px solid var(--line); }
.bf-ws__res small { display: block; font-size: 11px; line-height: 14px; font-weight: 600; color: var(--ink-muted); margin-bottom: 4px; }
.bf-ws__res .bf-meter__bar { width: 100%; }
.bf-ws--paused { background: transparent; border-style: dashed; border-color: var(--line-strong); }
.bf-launch { display: flex; gap: var(--space-2); margin-top: var(--space-3); }
.bf-launch a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 4px; border-radius: var(--radius-md); border: 1px solid var(--line-strong); font-size: 11px; font-weight: 600; color: var(--ink-muted); }
.bf-launch .bf-ws__icon { width: 30px; height: 30px; }

/* ── Apps: 8-column grid · favorite 4 · normal 2 · klein 1 ── */
.bf-apps { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); grid-auto-flow: row dense; gap: var(--space-2); }
.bf-app { position: relative; grid-column: span 2; display: flex; align-items: center; gap: var(--space-3); padding: 10px var(--space-3); border-radius: var(--radius-md); background: var(--bg-200); border: 1px solid var(--line); min-width: 0; }
.bf-app:hover { background: var(--bg-300); border-color: var(--line-strong); }
.bf-app__icon { position: relative; width: 36px; height: 36px; border-radius: var(--radius-md); display: grid; place-items: center; flex: none; background: var(--bg-000); color: var(--ink); font-weight: 800; font-size: 15px; }
.bf-app__icon img { width: 24px; height: 24px; object-fit: contain; display: block; }
.bf-app__icon--letter { color: var(--on-brand); }
.bf-app__body { min-width: 0; flex: 1; }
.bf-app__name { font-size: 14px; line-height: 18px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-right: 18px; }
.bf-app__desc { font-size: 12px; line-height: 16px; color: var(--ink-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bf-app__status { position: absolute; width: 9px; height: 9px; border-radius: 50%; box-shadow: 0 0 0 2px var(--bg-200); left: calc(var(--space-3) + 29px); top: calc(50% + 9px); }
.bf-app__star { position: absolute; top: 6px; right: 6px; display: grid; place-items: center; width: 24px; height: 24px; border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--ink-subtle); cursor: pointer; opacity: 0; }
.bf-app:hover .bf-app__star, .bf-app__star:focus-visible { opacity: 1; }
.bf-app__star:hover { background: var(--bg-400); color: var(--ink); }
.bf-app__star svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; }
/* favorite: starred by the user */
.bf-app--fav { grid-column: span 4; gap: var(--space-4); padding: var(--space-4); }
.bf-app--fav .bf-app__icon { width: 48px; height: 48px; }
.bf-app--fav .bf-app__icon img { width: 32px; height: 32px; }
.bf-app--fav .bf-app__icon--letter { font-size: 20px; }
.bf-app--fav .bf-app__name { font-size: 15px; line-height: 20px; }
.bf-app--fav .bf-app__desc { font-size: 13px; line-height: 18px; white-space: normal; }
.bf-app--fav .bf-app__status { left: calc(var(--space-4) + 40px); top: calc(50% + 15px); }
.bf-app--fav .bf-app__star { opacity: 1; color: var(--warn); }
.bf-app--fav .bf-app__star svg { fill: currentColor; }
/* fav-klein: from the 4th favourite on the row switches to the narrow
   layout - half width, icon only, so a full row still fits. */
.bf-app--fav-compact { grid-column: span 2; flex-direction: column; justify-content: center; gap: 6px; padding: 10px 6px 8px; text-align: center; }
.bf-app--fav-compact .bf-app__icon { width: 30px; height: 30px; }
.bf-app--fav-compact .bf-app__icon img { width: 20px; height: 20px; }
.bf-app--fav-compact .bf-app__icon--letter { font-size: 13px; }
.bf-app--fav-compact .bf-app__body { width: 100%; }
.bf-app--fav-compact .bf-app__name { font-size: 12px; line-height: 16px; font-weight: 500; color: var(--ink-muted); padding: 0; }
.bf-app--fav-compact .bf-app__desc { display: none; }
.bf-app--fav-compact .bf-app__status { left: calc(50% + 10px); top: 32px; }
.bf-app--fav-compact .bf-app__star { top: 2px; right: 2px; }
/* drag-to-reorder states */
.bf-app--dragging { opacity: .35; outline: 2px dashed var(--line-strong); outline-offset: -2px; cursor: grabbing !important; }
.bf-app--drag-over { outline: 2px solid var(--accent); outline-offset: -2px; }
/* klein: set in the admin for minor tools — half width, no description */
.bf-app--minor { grid-column: span 1; flex-direction: column; justify-content: center; gap: 6px; padding: 10px 6px 8px; text-align: center; }
.bf-app--minor .bf-app__icon { width: 30px; height: 30px; }
.bf-app--minor .bf-app__icon img { width: 20px; height: 20px; }
.bf-app--minor .bf-app__body { width: 100%; }
.bf-app--minor .bf-app__name { font-size: 12px; line-height: 16px; font-weight: 500; color: var(--ink-muted); padding: 0; }
.bf-app--minor .bf-app__desc { display: none; }
.bf-app--minor .bf-app__status { left: calc(50% + 10px); top: 32px; }
.bf-app--minor .bf-app__star { top: 2px; right: 2px; }
.bf-app__hint { grid-column: 1 / -1; font-size: 12px; color: var(--ink-subtle); padding-top: 4px; margin: 0; }
.bf-apps--compact { grid-template-columns: repeat(4, 1fr); gap: var(--space-3) var(--space-2); }
.bf-apps--compact .bf-app, .bf-apps--compact .bf-app--minor { grid-column: span 1; flex-direction: column; gap: 6px; padding: 0; background: transparent; border: 0; text-align: center; }
.bf-apps--compact .bf-app__icon { width: 52px; height: 52px; border-radius: 12px; background: var(--bg-200); }
.bf-apps--compact .bf-app__icon img { width: 30px; height: 30px; }
.bf-apps--compact .bf-app__body { width: 100%; }
.bf-apps--compact .bf-app__name { font-size: 11px; line-height: 14px; font-weight: 500; color: var(--ink-muted); padding: 0; }
.bf-apps--compact .bf-app__desc { display: none; }
.bf-apps--compact .bf-app__status { left: calc(50% + 18px); top: 42px; box-shadow: 0 0 0 2px var(--bg-000); }
.bf-apps--compact .bf-app--minor .bf-app__icon { width: 44px; height: 44px; }
.bf-apps--compact .bf-app--minor .bf-app__status { top: 36px; left: calc(50% + 14px); }
.bf-apps--compact .bf-app--fav { grid-column: span 2; flex-direction: row; text-align: left; padding: 8px; background: var(--bg-200); border: 1px solid var(--line); }
.bf-apps--compact .bf-app--fav .bf-app__icon { width: 40px; height: 40px; background: var(--bg-000); }
.bf-apps--compact .bf-app--fav .bf-app__name { font-size: 13px; color: var(--ink); padding-right: 18px; }
.bf-apps--compact .bf-app--fav .bf-app__status { left: 42px; top: 40px; }
.bf-apps--compact .bf-app__star { display: none; }
.bf-apps--compact .bf-app--fav .bf-app__star { display: grid; top: 50%; transform: translateY(-50%); right: 2px; }

/* ── Mobile tab bar ──────────────────────────────────── */
.bf-tabbar { display: flex; justify-content: space-around; padding: 6px 4px 22px; background: var(--bg-100); border-top: 1px solid var(--line); }
.bf-tabbar a { display: flex; flex-direction: column; align-items: center; gap: 2px; width: 64px; padding-top: 4px; font-size: 10px; line-height: 12px; font-weight: 600; color: var(--ink-subtle); }
.bf-tabbar a[aria-current] { color: var(--ink); }
.bf-tabbar a[aria-current] .bf-ico { color: var(--brand); }

/* ── Admin ───────────────────────────────────────────── */
.ad-shell { display: grid; grid-template-columns: 220px minmax(0, 1fr); min-height: 100%; }
.ad-side { background: var(--bg-100); border-right: 1px solid var(--line); padding: var(--space-4) var(--space-3); }
.ad-side img { height: 18px; margin: 4px 8px 20px; display: block; }
.ad-side a { display: flex; align-items: center; gap: 10px; height: 34px; padding: 0 10px; border-radius: var(--radius-md); color: var(--ink-muted); font-weight: 600; font-size: 13px; }
.ad-side a:hover { background: var(--bg-300); color: var(--ink); }
.ad-side a[aria-current] { background: var(--bg-300); color: var(--ink); }
.ad-side small { display: block; margin: 16px 10px 6px; font-size: 11px; font-weight: 700; color: var(--ink-subtle); }
.ad-main { padding: var(--space-5) var(--space-6); min-width: 0; }
.ad-title { display: flex; align-items: center; gap: var(--space-3); margin-bottom: var(--space-4); }
.ad-title h1 { margin: 0; font-family: var(--font-display); font-stretch: 70%; font-size: 30px; line-height: 32px; font-weight: 800; }
.ad-title .bf-btn--primary { margin-left: auto; }
.ad-panel { background: var(--bg-200); border: 1px solid var(--line); border-radius: var(--radius-lg); }
.ad-panel__head { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--line); font-weight: 700; }
.ad-panel__body { padding: var(--space-4); }
.ad-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.ad-table th { text-align: left; font-size: 11px; font-weight: 700; color: var(--ink-subtle); padding: 8px var(--space-4); border-bottom: 1px solid var(--line); }
.ad-table td { padding: 10px var(--space-4); border-bottom: 1px solid var(--line); vertical-align: middle; }
.ad-table tr:last-child td { border-bottom: 0; }
.ad-table tr[aria-selected="true"] td { background: var(--bg-300); }
.ad-swatch { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: -1px; margin-right: 8px; }
.ad-form { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-3) var(--space-4); }
.ad-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.ad-field--full { grid-column: 1 / -1; }
.ad-field label { font-size: 12px; font-weight: 600; color: var(--ink-muted); }
.ad-input { height: 36px; padding: 0 10px; border-radius: var(--radius-md); border: 1px solid var(--line-strong); background: var(--bg-000); color: var(--ink); font: 400 14px/20px var(--font-sans); display: flex; align-items: center; gap: 8px; min-width: 0; }
textarea.ad-input { height: 64px; padding: 8px 10px; resize: none; }
.ad-input--drop { height: 64px; border-style: dashed; justify-content: center; color: var(--ink-muted); font-size: 13px; }
.ad-seg { display: flex; padding: 3px; border-radius: var(--radius-md); background: var(--bg-000); border: 1px solid var(--line-strong); }
.ad-seg button { flex: 1; height: 28px; border: 0; border-radius: 4px; background: none; color: var(--ink-muted); font-size: 12px; font-weight: 600; cursor: pointer; }
.ad-seg button[aria-pressed="true"] { background: var(--bg-400); color: var(--ink); }
.ad-items { display: flex; flex-direction: column; gap: 6px; }
.ad-item { display: flex; align-items: center; gap: var(--space-3); padding: 6px 8px; border-radius: var(--radius-md); background: var(--bg-000); border: 1px solid var(--line); }
.ad-item__grip { color: var(--ink-subtle); cursor: grab; letter-spacing: -2px; }
.ad-item__img { width: 28px; height: 42px; border-radius: 3px; flex: none; }
.ad-item__body { flex: 1; min-width: 0; }
.ad-item__t { font-size: 13px; font-weight: 600; line-height: 18px; }
.ad-item__m { font-size: 12px; color: var(--ink-muted); line-height: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ad-tag { font-size: 11px; font-weight: 700; padding: 2px 6px; border-radius: var(--radius-sm); background: var(--bg-400); color: var(--ink-muted); }
.ad-tag--silo { color: var(--svc-silo); background: var(--bg-300); }
.ad-tag--own { color: var(--cat-games); background: var(--bg-300); }

/* poster art fills — solid grounds standing in for real cover images */
.art-1 { background: #3b1d4f; } .art-2 { background: #12324a; } .art-3 { background: #4a2a12; }
.art-4 { background: #1d3b2b; } .art-5 { background: #4a1418; } .art-6 { background: #2b2f4a; }
.art-7 { background: #39401a; } .art-8 { background: #14363a; }
.ad-seg button { white-space: nowrap; padding: 0 8px; }
.ad-table td.bf-mono, .ad-table td .bf-pill { white-space: nowrap; }

/* ── App groups (categories from the admin, like the old homepage) ── */
.bf-apps--favs { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-bottom: var(--space-5); }
.bf-apps--favs .bf-app--fav { grid-column: span 1; }
.bf-appgroups { columns: 2; column-gap: var(--space-5); }
.bf-appgroup { break-inside: avoid; margin-bottom: var(--space-4); }
.bf-appgroup__head { display: flex; align-items: center; gap: var(--space-2); width: 100%; height: 26px; margin-bottom: 6px; padding: 0; border: 0; background: none; color: var(--ink-muted); font-size: 12px; font-weight: 700; letter-spacing: .04em; cursor: pointer; text-align: left; }
.bf-appgroup__head span { color: var(--ink-subtle); font-weight: 500; letter-spacing: 0; }
.bf-appgroup__head .bf-ico { margin-left: auto; color: var(--ink-subtle); transform: rotate(90deg); }
.bf-appgroup__head:hover { color: var(--ink); }
.bf-appgroup[data-collapsed] .bf-apps { display: none; }
.bf-appgroup[data-collapsed] .bf-appgroup__head .bf-ico { transform: none; }
.bf-appgroup .bf-apps { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.bf-appgroup .bf-apps--compact { grid-template-columns: repeat(4, 1fr); }

/* ── Page shell (from HomepageDesktop / HomepageMobile previews) ── */
.bf-page { max-width: var(--page-max); margin: 0 auto; padding: 0 var(--space-6) var(--space-7); }
.bf-spotwrap { margin-top: var(--space-4); }
.bf-stage { display: grid; grid-template-columns: minmax(0, 1fr) var(--rail-width); gap: var(--space-6); align-items: start; }
.bf-col { display: flex; flex-direction: column; gap: var(--space-6); min-width: 0; }
.bf-rail { min-width: 0; }
.bf-hidden { display: none !important; }
.bf-widget { min-width: 0; }

/* Without a search bar (anonymous visitors) the app list would stick to the
   very top of the page. The stage then fills the viewport and the app
   section is centered vertically. Horizontally the block is centered as
   well: the empty rail column is dropped and the apps get a fixed width.
   The logged-in layout is not touched by any of this. */
.bf-page--full { min-height: calc(100vh - 56px); display: flex; flex-direction: column; padding-bottom: 0; }
.bf-page--full .bf-stage { flex: 1 1 auto; align-items: start; align-content: center; row-gap: 0; grid-template-columns: minmax(0, 1fr); }
.bf-page--full .bf-col { justify-content: flex-start; width: 100%; max-width: 1000px; margin: 0 auto; }
.bf-widget__err { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-muted); }
.bf-widget__skel { height: 36px; border-radius: var(--radius-md); background: var(--bg-300); margin-bottom: var(--space-2); }
.bf-menu { position: absolute; right: 0; top: calc(100% + 8px); z-index: 30; min-width: 220px; padding: var(--space-2); border-radius: var(--radius-lg); background: var(--bg-200); border: 1px solid var(--line); box-shadow: var(--shadow-pop); }
.bf-menu a, .bf-menu button { display: flex; align-items: center; gap: 10px; width: 100%; height: 34px; padding: 0 10px; border: 0; border-radius: var(--radius-md); background: none; color: var(--ink-muted); font-weight: 600; font-size: 13px; text-align: left; cursor: pointer; }
.bf-menu a:hover, .bf-menu button:hover { background: var(--bg-300); color: var(--ink); }
.bf-menu hr { border: 0; border-top: 1px solid var(--line); margin: var(--space-2) 0; }
.bf-userwrap { position: relative; }

/* Tablet: one column, rail last */
@media (max-width: 1199px) {
  .bf-stage { grid-template-columns: minmax(0, 1fr); }
}

/* Mobile */
@media (max-width: 767px) {
  /* ── Chrome ──────────────────────────────────────────── */
  .bf-topbar { height: 48px; padding: 0 var(--space-4); gap: var(--space-3); }
  .bf-topbar .bf-nav { display: none; }

  /* ── Page ────────────────────────────────────────────── */
  .bf-page { padding: 0 var(--space-4) 80px; /* space for tab bar */ }
  /* Anonymous visitors have no tab bar, so the page uses the full height. */
  .bf-page--full { min-height: calc(100vh - 48px); padding-bottom: 0; }
  .bf-page--full .bf-stage { flex: 1 1 auto; }
  .bf-col { gap: var(--space-5); }
  .bf-sec__title { font-size: 20px; }

  /* ── NewsBar ─────────────────────────────────────────── */
  .bf-news { margin: var(--space-2) var(--space-4) 0; padding-left: var(--space-3); }
  .bf-news__item { align-items: flex-start; padding-top: 6px; }
  .bf-news__text { white-space: normal; font-size: 12px; line-height: 16px; }
  .bf-news__ver { width: auto; }

  /* ── Spotlight: compact (kicker + title + one button only) ── */
  .bf-spotwrap { margin-top: var(--space-3); }
  .bf-spot { grid-template-columns: 1fr; min-height: 0; }
  .bf-spot__copy { padding: var(--space-4); }
  .bf-spot__title { font-size: 26px; line-height: 26px; }
  .bf-spot__text, .bf-spot__wall { display: none; }
  .bf-spot__actions { margin-top: var(--space-2); }
  .bf-spot__pager { top: var(--space-3); bottom: auto; }
  /* Collapse button: shift right of pager */
  .bf-spot__collapse { top: var(--space-2); right: var(--space-7); }

  /* ── Search hero ─────────────────────────────────────── */
  .bf-hero { padding: var(--space-4) 0 0; }
  /* Force the flex layout even with Bootstrap loaded */
  .bf-search { display: flex !important; flex-wrap: nowrap; height: 52px; }
  .bf-mode button { padding: 0 8px; height: 36px; font-size: 12px; }
  .bf-search__input { font-size: 16px; flex: 1 1 0; min-width: 0; }
  .bf-kbd { display: none; }
  .bf-search__go { flex: none; width: 40px; height: 40px; }
  /* Settings dropdown stays inline */
  .bf-search .dropdown { flex: none; display: flex; align-items: center; }
  .bf-chips { margin: var(--space-3) calc(var(--space-4) * -1) 0; padding: 2px var(--space-4); }

  /* ── Neue Folgen: 2 columns ──────────────────────────── */
  .bf-newgrid { grid-auto-columns: 170px; gap: 0 var(--space-3); }
  .bf-mini .bf-badge, .bf-mini__when { display: none; }
  .bf-mini__art { width: 30px; height: 45px; }

  /* ── Apps: compact icon grid per HomepageMobile mockup ── */
  .bf-app__hint { display: none; }

  /* Favoriten-Reihe: 2-spaltig, wie im Mockup */
  .bf-apps--favs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-2);
    margin-bottom: var(--space-4);
  }
  .bf-apps--favs .bf-app--fav {
    grid-column: span 1;
    flex-direction: row;
    align-items: center;
    gap: var(--space-3);
    padding: 8px;
    background: var(--bg-200);
    border: 1px solid var(--line);
  }
  .bf-apps--favs .bf-app--fav .bf-app__icon { width: 40px; height: 40px; }
  .bf-apps--favs .bf-app--fav .bf-app__icon img { width: 28px; height: 28px; }
  .bf-apps--favs .bf-app--fav .bf-app__name { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .bf-apps--favs .bf-app--fav .bf-app__desc { font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .bf-apps--favs .bf-app--fav .bf-app__status { left: 42px; top: 40px; }
  .bf-apps--favs .bf-app--fav .bf-app__star { top: 50%; transform: translateY(-50%); right: 4px; opacity: 1; }

  /* Gruppen-Grid: 4 Spalten compact, 2 Spalten pro Gruppe */
  .bf-appgroups { columns: 1; }
  .bf-appgroup { margin-bottom: var(--space-3); break-inside: auto; }
  .bf-appgroup .bf-apps {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: var(--space-2) var(--space-1);
    grid-auto-flow: row dense;
  }
  /* Alle normalen Kacheln → compact icon style */
  .bf-appgroup .bf-apps .bf-app {
    grid-column: span 1;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 4px;
    padding: 6px 4px;
    background: transparent;
    border: 0;
    text-align: center;
  }
  .bf-appgroup .bf-apps .bf-app .bf-app__icon {
    width: 48px; height: 48px; border-radius: 12px; background: var(--bg-200);
  }
  .bf-appgroup .bf-apps .bf-app .bf-app__icon img { width: 28px; height: 28px; }
  .bf-appgroup .bf-apps .bf-app .bf-app__body { width: 100%; }
  .bf-appgroup .bf-apps .bf-app .bf-app__name {
    font-size: 10px; line-height: 13px; color: var(--ink-muted); padding: 0;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .bf-appgroup .bf-apps .bf-app .bf-app__desc { display: none; }
  .bf-appgroup .bf-apps .bf-app .bf-app__status { left: calc(50% + 18px); top: 42px; }
  /* The star is the only way to favorite on mobile, so it stays visible.
     It sits in the top-right corner of the tile. */
  .bf-appgroup .bf-apps .bf-app .bf-app__star { display: grid; opacity: 1; top: 0; right: 0; width: 22px; height: 22px; }
  .bf-appgroup .bf-apps .bf-app .bf-app__star svg { width: 12px; height: 12px; }
  /* Minor (klein) even smaller */
  .bf-appgroup .bf-apps .bf-app--minor .bf-app__icon { width: 40px; height: 40px; }
  .bf-appgroup .bf-apps .bf-app--minor .bf-app__status { left: calc(50% + 14px); top: 34px; }

  /* Tab bar: pinned to the bottom of the viewport */
  .bf-tabbar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; }
  .bf-tabbar--hidden { display: none !important; }
}
@media (min-width: 768px) {
  .bf-tabbar { display: none; }
}

/* ── Spotlight with a background image instead of the cover wall ── */
.bf-spot__bg { position: absolute; inset: 0; background-size: cover; background-position: center; opacity: .28; }
.bf-spot > .bf-spot__bg + .bf-spot__copy { position: relative; }

/* ── Requests (Phase E) ─────────────────────────────────────────────── */
.rq-page { display: grid; grid-template-columns: minmax(0, 1fr) 480px; gap: var(--space-5); max-width: var(--page-max); margin: 0 auto; padding: var(--space-5) var(--space-6) var(--space-7); align-items: start; }
.rq-list { min-width: 0; }
.rq-head { display: flex; align-items: center; gap: var(--space-3); margin-bottom: var(--space-3); }
.rq-head h1 { margin: 0; font-family: var(--font-display); font-stretch: 70%; font-size: 30px; line-height: 32px; font-weight: 800; }
.rq-head .bf-note { color: var(--ink-subtle); font-size: 13px; margin-right: auto; }
.rq-filters { display: flex; align-items: center; gap: var(--space-4); flex-wrap: wrap; margin-bottom: var(--space-4); }
.rq-tabs button span, .bf-tabs button span { margin-left: 6px; font: 600 12px/1 var(--font-mono); color: var(--ink-subtle); }
.bf-tabs button[aria-selected="true"] span { color: var(--accent); }
.rq-group { margin: var(--space-4) 0 var(--space-1); font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-subtle); }
.rq-row { display: flex; align-items: center; gap: var(--space-3); padding: 10px var(--space-2); border-bottom: 1px solid var(--line); min-width: 0; border-radius: var(--radius-md); cursor: pointer; }
.rq-row:hover { background: var(--bg-200); }
.rq-row[aria-selected="true"] { background: var(--bg-300); }
.rq-type { width: 34px; height: 34px; border-radius: var(--radius-md); display: grid; place-items: center; flex: none; background: var(--bg-300); color: var(--ink-muted); }
.rq-type--films { color: var(--cat-films); }
.rq-type--series { color: var(--cat-series); }
.rq-type--mangas, .rq-type--books { color: var(--cat-mangas); }
.rq-type--games { color: var(--cat-games); }
.rq-type--software { color: var(--cat-software); }
.rq-title { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rq-sub { font-size: 12px; color: var(--ink-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rq-sub b { color: var(--ink-subtle); }
.rq-state { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex: none; }
.rq-when { font-size: 12px; color: var(--ink-subtle); flex: none; width: 68px; text-align: right; }
.rq-pill { display: inline-flex; align-items: center; height: 20px; padding: 0 8px; border-radius: var(--radius-pill); font-size: 11px; font-weight: 700; }
.rq-pill--wait { background: var(--warn-soft); color: var(--warn); }
.rq-pill--run { background: var(--bg-300); color: var(--info); }
.rq-pill--done { background: var(--ok-soft); color: var(--ok-ink); }
.rq-pill--fail { background: var(--down-soft); color: var(--down); }
.rq-ticket { display: flex; flex-direction: column; min-width: 0; height: calc(100vh - 56px - var(--space-6)); border-radius: var(--radius-lg); background: var(--bg-200); border: 1px solid var(--line); overflow: hidden; }
.rq-ticket__head { padding: var(--space-4); border-bottom: 1px solid var(--line); }
.rq-ticket__top { display: flex; align-items: center; gap: var(--space-2); }
.rq-ticket__title { margin: 0; font-size: 15px; line-height: 20px; font-weight: 600; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rq-ticket__meta { display: flex; align-items: center; gap: var(--space-2); margin-top: var(--space-2); font-size: 12px; color: var(--ink-muted); }
.rq-track { display: flex; gap: 2px; margin-top: var(--space-3); }
.rq-track > div { flex: 1; padding-top: 6px; border-top: 2px solid var(--bg-400); font-size: 11px; color: var(--ink-subtle); }
.rq-track > div.done { border-color: var(--ok); color: var(--ok-ink); }
.rq-track > div.now { border-color: var(--info); color: var(--info); }
.rq-chat { flex: 1; overflow-y: auto; padding: var(--space-4); display: flex; flex-direction: column; gap: var(--space-2); }
.rq-day { text-align: center; font-size: 11px; color: var(--ink-subtle); }
.rq-msg { max-width: 82%; padding: 8px 12px; border-radius: var(--radius-lg); font-size: 13px; line-height: 18px; white-space: pre-wrap; }
.rq-msg--me { align-self: flex-end; background: var(--brand-strong); color: var(--on-brand); border-bottom-right-radius: var(--radius-sm); }
.rq-msg--bot { align-self: flex-start; background: var(--bg-300); border-bottom-left-radius: var(--radius-sm); }
.rq-msg--sys { align-self: center; background: transparent; color: var(--ink-subtle); font-size: 12px; }
.rq-msg .who { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; font-weight: 700; font-size: 12px; }
.rq-choices { display: flex; flex-direction: column; gap: 6px; margin-top: var(--space-2); }
.rq-choice { display: flex; align-items: center; gap: var(--space-2); width: 100%; padding: 8px; border-radius: var(--radius-md); border: 1px solid var(--line-strong); background: var(--bg-200); color: var(--ink); text-align: left; cursor: pointer; }
.rq-choice:hover { background: var(--bg-400); }
.rq-choice--none { border-style: dashed; background: transparent; }
.rq-choice__n { width: 20px; flex: none; font: 600 12px/1 var(--font-mono); color: var(--ink-subtle); }
.rq-choice__img { width: 28px; height: 42px; border-radius: 3px; flex: none; background: var(--bg-400); }
.rq-choice__t { font-size: 13px; font-weight: 600; }
.rq-choice__m { font-size: 12px; color: var(--ink-muted); }
.rq-choice__tag { margin-left: auto; font: 600 11px/1 var(--font-mono); color: var(--info); }
.rq-quick { display: flex; flex-wrap: wrap; gap: 6px; margin-top: var(--space-2); }
.rq-quick button { height: 26px; padding: 0 10px; border-radius: var(--radius-pill); border: 1px solid var(--line-strong); background: transparent; color: var(--ink-muted); font-size: 12px; font-weight: 600; cursor: pointer; }
.rq-quick button:hover { background: var(--bg-400); color: var(--ink); }
.rq-compose { padding: var(--space-3) var(--space-4); border-top: 1px solid var(--line); }
.rq-compose__box { display: flex; gap: var(--space-2); align-items: center; }
.rq-compose__box input { flex: 1; min-width: 0; height: 38px; padding: 0 var(--space-3); border-radius: var(--radius-md); border: 1px solid var(--line-strong); background: var(--bg-000); color: var(--ink); font: 400 14px/20px var(--font-sans); }
.rq-compose__hint { display: flex; justify-content: space-between; margin-top: 6px; font-size: 11px; color: var(--ink-subtle); }
.rq-drawer { position: fixed; top: 0; right: 0; bottom: 0; width: 480px; z-index: 40; box-shadow: var(--shadow-pop); }
.rq-empty { display: grid; place-items: center; height: 100%; color: var(--ink-muted); font-size: 13px; text-align: center; padding: var(--space-6); }
@media (max-width: 1199px) { .rq-page { grid-template-columns: minmax(0, 1fr); } .rq-ticket { height: auto; max-height: 70vh; } }
@media (max-width: 767px) { .rq-drawer { width: 100%; } }

/* ── Anfrage starten (RequestStart) ─────────────────────────────────── */
.rs-panel { margin-top: var(--space-3); padding: var(--space-4); border-radius: var(--radius-lg); background: var(--bg-200); border: 1px solid var(--line); }
.rs-detected { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3); border-radius: var(--radius-md); background: var(--bg-300); margin-bottom: var(--space-3); }
.rs-detected__t { font-size: 14px; font-weight: 600; }
.rs-detected__m { font-size: 12px; color: var(--ink-muted); }
.rs-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: var(--space-2); }
.rs-cat { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: var(--space-3); border-radius: var(--radius-md); border: 1px solid var(--line); background: var(--bg-000); color: var(--ink); text-align: left; cursor: pointer; }
.rs-cat:hover { background: var(--bg-300); }
.rs-cat__t { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; }
.rs-cat__m { font-size: 12px; color: var(--ink-muted); }
.rs-cat--films .rs-cat__t { color: var(--cat-films); }
.rs-cat--series .rs-cat__t { color: var(--cat-series); }
.rs-cat--games .rs-cat__t { color: var(--cat-games); }
.rs-cat--software .rs-cat__t { color: var(--cat-software); }
.rs-cat--books .rs-cat__t { color: var(--cat-mangas); }
.rs-cat--other .rs-cat__t { color: var(--ink-muted); }
.rs-note { font-size: 12px; color: var(--ink-subtle); margin: var(--space-3) 0 0; }

/* ── LoginScreens ───────────────────────────────────────────────────── */
.lg-card { width: 100%; max-width: 380px; margin: 0 auto; padding: var(--space-6); border-radius: var(--radius-lg); background: var(--bg-100); border: 1px solid var(--line); text-align: center; }
.lg-card img { height: 26px; margin-bottom: var(--space-4); }
.lg-card h2 { margin: 0 0 var(--space-2); font-family: var(--font-display); font-stretch: 70%; font-size: 22px; line-height: 26px; font-weight: 800; }
.lg-card p { margin: 0 0 var(--space-4); color: var(--ink-muted); }
.lg-card .bf-btn { width: 100%; margin-bottom: var(--space-2); }
.lg-note { font-size: 12px; color: var(--ink-subtle); margin: var(--space-3) 0 0; }
.lg-done { width: 44px; height: 44px; margin: 0 auto var(--space-4); border-radius: 50%; display: grid; place-items: center; background: var(--ok-soft); color: var(--ok-ink); }
.lg-field { text-align: left; margin-bottom: var(--space-3); }
.lg-field label { display: block; font-size: 12px; font-weight: 600; color: var(--ink-muted); margin-bottom: 6px; }
.lg-input { height: 40px; padding: 0 var(--space-3); border-radius: var(--radius-md); border: 1px solid var(--line-strong); background: var(--bg-000); color: var(--ink); display: flex; align-items: center; }
.lg-input--focus { border-color: var(--focus); }
.lg-or { margin: var(--space-3) 0; font-size: 12px; color: var(--ink-subtle); }

/* ── Infrastructure (Phase F) ──────────────────────────────────────── */
.kpi-bar { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: var(--space-2); margin-bottom: var(--space-5); }
.kpi { min-width: 0; padding: var(--space-3); border-radius: var(--radius-md); background: var(--bg-200); border: 1px solid var(--line); }
.kpi small { display: block; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-subtle); }
.kpi__l { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-subtle); }
.kpi__v { display: block; font-family: var(--font-mono); font-size: 18px; line-height: 22px; font-weight: 500; color: var(--ink); }
.kpi__v > span { font-family: var(--font-sans); font-size: 11px; line-height: 16px; font-weight: 500; color: var(--ink-muted); margin-left: 5px; }
.kpi__bar { display: block; width: 100%; height: 4px; border-radius: 2px; background: var(--bg-400); margin-top: 6px; overflow: hidden; }
.kpi__bar > i { display: block; height: 100%; background: var(--ok); }
.kpi__bar--warn > i { background: var(--warn); }
.kpi__bar--down > i { background: var(--down); }

/* ── Search hero: keep the Bootstrap dropdown inside the flex row ────────
 * Bootstrap 3 styles .dropdown as display:block, which breaks the
 * horizontal .bf-search row. The redesign keeps the dropdown for the
 * advanced-filter menu but resets its box model. */
.bf-search .dropdown { flex: none; }
.bf-search .dropdown > .bf-btn { height: 40px; width: 40px; padding: 0; }
.bf-search .dropdown-menu { border-radius: var(--radius-lg); background: var(--bg-200); border: 1px solid var(--line-strong); box-shadow: var(--shadow-pop); }
/* The dropdown's own toggle button is now the .bf-btn above, not a bootstrap
   .dropdown-toggle, so strip the pseudo-element arrow if present. */
.bf-search .dropdown > .bf-btn::after { display: none; }

/* ws-grid: 3-column workspace strip above the app launcher */
.ws-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-2); }
.ws-grid .bf-ws + .bf-ws { margin-top: 0; }
@media (max-width: 767px) { .ws-grid { grid-template-columns: 1fr; } }

/* ── Artwork placeholders ────────────────────────────────────────────
 * Every place that shows artwork (new episodes, spotlight cover wall,
 * workspace icons) falls back to the item's initial on a deterministic
 * ground, so a missing cover never leaves an empty box. */
.bf-art-fallback { font: 800 15px/1 var(--font-display); color: var(--on-brand); text-transform: uppercase; }
.bf-mini__art { display: grid; place-items: center; }
.bf-mini__art .bf-art-fallback { font-size: 16px; }
.bf-poster__art.bf-art-empty { display: grid; place-items: center; }
.bf-poster__art.bf-art-empty .bf-art-fallback { font-size: 22px; }
.bf-app__icon.bf-art-empty { display: grid; place-items: center; }

/* Workspace: the provider kind (Sealskin, Coder, …) sits under the name. */
.bf-ws__name { display: flex; align-items: baseline; gap: var(--space-2); }
.bf-ws__kind { font-size: 11px; line-height: 14px; font-weight: 600; color: var(--ink-subtle); }

/* ── Collapsible Spotlight banner ─────────────────────────────────── */
.bf-spotwrap { position: relative; }
.bf-spot__collapse {
  position: absolute;
  top: var(--space-2);
  right: var(--space-2);
  z-index: 5;
  background: var(--scrim);
  color: var(--ink);
}
.bf-spot__collapse:hover { background: var(--scrim); color: var(--ink); }
.bf-spot__collapse .bf-ico { transition: transform 150ms ease; }
/* Collapsed: only a slim header strip stays, so the page keeps its rhythm. */
.bf-spotwrap[data-spot-collapsed] .bf-spot { min-height: 0; height: 0; padding: 0; border-radius: 0; }
.bf-spotwrap[data-spot-collapsed] .bf-spot > * { display: none; }
.bf-spotwrap[data-spot-collapsed]::after {
  content: "";
  display: block;
  height: var(--space-3);
  border-bottom: 1px solid var(--line);
}

/* ── Search bar: neutralize Bootstrap overrides ─────────────────────
 * Bootstrap 3 sets .form-horizontal to display:block and its child
 * .form-group to margin-right / margin-left. The redesign dropdown uses
 * a plain div with those classes; we only need to keep the flex layout
 * of the outer .bf-search container intact. */
/* Bootstrap 3 overrides — all of these would break the search flex row.
 * The real fix was removing the nested <form> (now a <div>); these rules
 * keep the layout intact defensively in case other Bootstrap rules fire. */
.bf-search { display: flex !important; flex-wrap: nowrap !important; }
/* Each direct child must be a flex item, not block-box. */
.bf-search > * { flex: none; }
.bf-search > input,
.bf-search > .bf-search__input { flex: 1 1 0 !important; min-width: 0 !important; }
/* Bootstrap 3: .form-horizontal and .input-group are tables. Kill that. */
.bf-search .form-horizontal,
.bf-search .input-group { display: block; }
.bf-search .dropdown { display: flex; align-items: center; }
.bf-search .dropdown-menu .form-horizontal { margin: 0; }
/* Reset Bootstrap's margin injected by .form-group */
.bf-search .form-group { margin-bottom: 0; margin-left: 0; margin-right: 0; }

/* ── Favorites: always show the star on fav tiles, even in compact/mobile ──
 * The compact layout hides all stars by default; fav tiles need the unstar
 * button to always be reachable, otherwise mobile users can never remove a
 * favourite. Normal (non-fav) tiles in groups stay star-free on mobile. */
.bf-apps--favs .bf-app--fav .bf-app__star { display: grid !important; opacity: 1; }
@media (max-width: 767px) {
  /* Fav row on mobile: show the star, hide it on group tiles */
  .bf-apps--favs .bf-app--fav .bf-app__star { display: grid !important; opacity: 1; position: static; transform: none; }
  .bf-apps--favs .bf-app--fav { position: relative; }
}

/* ── RequestStart panel ──────────────────────────────── */
.rq-start { max-width: var(--search-max); margin: var(--space-2) auto 0; padding: var(--space-4); border-radius: var(--radius-lg); background: var(--bg-200); border: 1px solid var(--line); }
.rq-start__q { font-size: 13px; color: var(--ink-muted); margin-bottom: var(--space-3); }
.rq-start__q b { color: var(--ink); }
.rq-detect { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3); border-radius: var(--radius-md); background: var(--bg-300); margin-bottom: var(--space-3); }
.rq-detect span { flex: 1; min-width: 0; font-size: 13px; line-height: 18px; }
.rq-cats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: var(--space-2); }
.rq-cat { --c: var(--ink-muted); display: flex; align-items: center; gap: var(--space-2); padding: var(--space-3); border-radius: var(--radius-md); border: 1px solid var(--line); background: var(--bg-000); color: var(--ink); text-align: left; cursor: pointer; }
.rq-cat:hover { background: var(--bg-300); border-color: var(--c); }
.rq-cat .bf-ico { color: var(--c); flex: none; }
.rq-cat b { display: block; font-size: 13px; line-height: 18px; }
.rq-cat small { display: block; font-size: 11px; color: var(--ink-muted); line-height: 15px; }

/* ── RequestsPage: progress bar ──────────────────────── */
.rq-progress { display: flex; align-items: center; gap: var(--space-2); padding: var(--space-2) var(--space-4); background: var(--bg-300); border-radius: var(--radius-md); margin: var(--space-2) var(--space-4); }
.rq-progress__bar { height: 4px; border-radius: 2px; background: var(--info); transition: width 0.5s ease; flex: 1 0 auto; }
.rq-progress__label { font: 600 12px/1 var(--font-mono); color: var(--info); flex: none; }

/* ── Row selected state ──────────────────────────────── */
.rq-row--active { background: var(--bg-300); }

/* ── Ticket: rq-type icon in row ─────────────────────── */
.rq-type--books { color: var(--cat-mangas); }
.rq-type--films { color: var(--cat-films); }
.rq-type--series { color: var(--cat-series); }
.rq-type--games { color: var(--cat-games); }
.rq-type--software { color: var(--cat-software); }

/* ── Touch / mobile: stars always visible on fav tiles ──────────────────────
 * On touch devices hover never fires. The unstar action must always be
 * reachable. We use a media feature that reliably detects coarse input
 * (finger, stylus) — this is more accurate than a viewport-width check. */
@media (hover: none) {
  /* Normal tiles: show the star with a slight delay tap — achieved by making
   * the star accessible at all rather than requiring hover. */
  .bf-app__star { opacity: 0.4; }
  /* Fav tiles: always fully visible, filled and labelled */
  .bf-app--fav .bf-app__star { opacity: 1 !important; display: grid !important; }
}

/* ── Phase F: Infrastructure page token bridge ────────────────────────────
 * infrastructure.html uses hardcoded colours from before the design system.
 * These vars are set on :root so its inline CSS picks up the same palette
 * without touching any logic or the map/topology rendering. */
:root {
  /* map */
  --map-land: #1f2125;
  --map-border: #2c2f34;
  /* network overlays — kept from the standalone InfraMap preview */
  --net-eu-edge: #38bdf8;
  --net-wg: #7f86e0;
  --net-jp-direct: #b48cf2;
  --net-jp-edge: #ff8a65;
  --net-vlan: #f0609e;
  /* The MapLibre controller reads these names for the Natural Earth basemap. */
  --infra-map-land: var(--map-land);
  --infra-map-border: var(--map-border);
  --infra-map-water: #0f1012;
}
/* The infra-shell height is relative to the topbar; the new bf-topbar
   is 56px, same as the old placeholder, so no recalculation needed. */

/* ── Phase F: Infrastructure page — KPI bar ──────────────────────────────── */
.in-page { max-width: 1600px; margin: 0 auto; padding: 12px 18px 14px; display: grid; grid-template-rows: auto auto auto 1fr; gap: 0; height: calc(100vh - 56px); overflow: hidden; }
.in-head { display: flex; align-items: center; gap: var(--space-4); margin-bottom: 14px; }
.in-head h1 { margin: 0; font-size: 22px; font-weight: 800; font-family: var(--font-display); font-stretch: 70%; }
.in-updated { display: flex; align-items: center; gap: 6px; margin-left: auto; font-size: 12px; color: var(--ink-subtle); }

/* KPI strip */
.in-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: var(--space-2); margin-bottom: 10px; }
.in-kpi { padding: 8px 10px 7px; border-radius: var(--radius-md); background: var(--bg-200); border: 1px solid var(--line); min-width: 0; }
.in-kpi small { display: block; font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-subtle); margin-bottom: 3px; }
.in-kpi b { display: block; font-family: var(--font-mono); font-size: 18px; line-height: 22px; font-weight: 500; white-space: nowrap; }
.in-kpi b span { font-size: 10px; font-weight: 500; color: var(--ink-muted); margin-left: 4px; font-family: var(--font-sans); }
.in-kpi .bf-meter__bar { margin-top: 5px; width: 100%; height: 4px; }

/* Filters */
.in-filters { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-bottom: 10px; }
.in-chip { display: inline-flex; align-items: center; height: 26px; padding: 0 10px; border-radius: var(--radius-pill); border: 1px solid var(--line-strong); background: var(--bg-300); color: var(--ink-muted); font-size: 11px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.in-chip:hover { background: var(--bg-400); color: var(--ink); }
.in-chip.active, .in-chip[aria-pressed="true"] { background: var(--ink); color: var(--bg-000); border-color: var(--ink); }
.in-chip--sep { margin-left: var(--space-2); }

/* Segmented control */
.ad-seg { display: inline-flex; padding: 3px; border-radius: var(--radius-md); background: var(--bg-300); gap: 2px; }
.ad-seg button { height: 26px; padding: 0 12px; border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--ink-muted); font-size: 12px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.ad-seg button:hover { color: var(--ink); }
.ad-seg button[aria-pressed="true"], .ad-seg button.active { background: var(--bg-000); color: var(--ink); }

/* Stage: canvas + detail rail */
.in-stage { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(300px, 0.8fr); gap: 14px; min-height: 0; height: 100%; }
.in-canvas { position: relative; border-radius: var(--radius-lg); background: var(--bg-200); border: 1px solid var(--line); overflow: hidden; min-height: 0; }

/* View switch (top-left overlay) */
.in-view { position: absolute; left: 12px; top: 12px; z-index: 6; }

/* Zoom controls (top-right overlay) */
.in-zoom { position: absolute; right: 12px; top: 12px; z-index: 6; display: flex; gap: 4px; }
.in-zoom button { width: 32px; height: 32px; border-radius: var(--radius-md); border: 1px solid var(--line-strong); background: var(--scrim); color: var(--ink); font-size: 16px; font-weight: 700; cursor: pointer; display: inline-grid; place-items: center; }
.in-zoom button:hover { background: var(--bg-300); }

/* Network legend (bottom-right overlay) */
.in-legend { position: absolute; right: 12px; bottom: 12px; left: auto; top: auto; z-index: 6; width: min(280px, calc(100% - 24px)); background: var(--scrim); border: 1px solid var(--line-strong); backdrop-filter: blur(8px); border-radius: var(--radius-md); padding: 10px; }
.in-legend h4 { margin: 0 0 8px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-subtle); display: flex; align-items: center; justify-content: space-between; }
.in-legend h4 span { font-size: 10px; font-weight: 500; color: var(--ink-subtle); }
.in-net { display: flex; align-items: center; gap: 8px; padding: 4px 6px; border-radius: var(--radius-sm); cursor: pointer; font-size: 12px; color: var(--ink); border: 1px solid transparent; }
.in-net:hover { background: var(--bg-300); }
.in-net.is-selected { background: rgba(255,212,59,.1); border-color: rgba(255,212,59,.35); }
.in-net i { width: 16px; height: 3px; flex: none; background: var(--c); border-radius: 2px; display: block; }
.in-net i.dash { background: repeating-linear-gradient(90deg, var(--c) 0, var(--c) 4px, transparent 4px, transparent 8px); }
.in-net div { flex: 1; min-width: 0; }
.in-net div small { display: block; font-size: 10px; color: var(--ink-muted); font-family: var(--font-mono); }
.in-net span { font-size: 10px; color: var(--ink-subtle); flex: none; }

/* Map attribution */
.in-attr { position: absolute; bottom: 8px; left: 12px; right: auto; z-index: 5; font-size: 10px; color: var(--ink-subtle); }

/* Region labels and dividers in topology */
.in-region { position: absolute; left: 10px; writing-mode: vertical-rl; text-orientation: mixed; font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-subtle); pointer-events: none; z-index: 3; transform: rotate(180deg) translateY(50%); }

/* Topology node card */
.in-node { position: absolute; transform: translate(-50%, -50%); width: 178px; background: var(--bg-200); border: 1px solid var(--line-strong); border-left: 4px solid var(--ok); border-radius: var(--radius-md); padding: 9px 10px; cursor: pointer; }
.in-node.selected, .in-node:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.in-node__top { display: flex; align-items: center; gap: 6px; margin-bottom: 2px; }
.in-node__top b { font-size: 13px; font-weight: 700; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.in-node__sub { font-size: 11px; color: var(--ink-muted); margin-bottom: 6px; }
.in-node .in-use { display: flex; align-items: center; gap: 6px; font-size: 11px; margin-bottom: 4px; }
.in-node .in-use span:first-child { width: 28px; flex: none; font-weight: 600; color: var(--ink-subtle); }
.in-node .in-use b { margin-left: auto; font-size: 10px; font-family: var(--font-mono); font-weight: 500; color: var(--ink-muted); white-space: nowrap; }
.in-node .in-use .bf-meter__bar { flex: 1; min-width: 0; width: auto; height: 4px; }
.in-node__nets { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 4px; }
.in-node__nets i { width: 10px; height: 10px; border-radius: 50%; background: var(--c); display: block; flex: none; }

/* Detail rail (right panel) */
.in-detail { background: var(--bg-200); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 14px; overflow-y: auto; height: 100%; }
.in-detail__head { margin-bottom: 12px; }
.in-detail__head h2 { display: flex; align-items: center; gap: 8px; margin: 0 0 4px; font-size: 16px; font-weight: 700; }
.in-detail__head p { margin: 0; font-size: 12px; color: var(--ink-muted); }
.in-detail__sec { margin-bottom: 12px; }
.in-detail__sec h3 { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-subtle); margin: 0 0 8px; border-bottom: 1px solid var(--line); padding-bottom: 6px; }
.in-use { display: flex; align-items: center; gap: 8px; font-size: 12px; margin-bottom: 6px; }
.in-use > span:first-child { width: 32px; flex: none; font-weight: 600; color: var(--ink-muted); }
.in-use > b { margin-left: auto; font-size: 11px; font-family: var(--font-mono); font-weight: 500; white-space: nowrap; }
.in-use .bf-meter__bar { flex: 1; width: auto; height: 4px; }
.in-bar--hot > i { background: var(--down) !important; }
.in-hosts { display: flex; flex-direction: column; gap: 6px; }
.in-host { display: grid; grid-template-columns: 10px 1fr 50px 50px; gap: 8px; align-items: center; font-size: 12px; cursor: pointer; padding: 3px 4px; border-radius: var(--radius-sm); }
.in-host:hover { background: var(--bg-300); }
.in-host b { display: block; font-size: 12px; font-weight: 600; }
.in-host small { display: block; font-size: 10px; color: var(--ink-muted); }
.in-kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; font-size: 12px; margin: 0; }
.in-kv dt { font-weight: 600; color: var(--ink-muted); }
.in-kv dd { margin: 0; }
.in-tag { display: inline-flex; align-items: center; gap: 4px; height: 18px; padding: 0 7px; border-radius: var(--radius-pill); font-size: 10px; font-weight: 600; background: var(--bg-300); color: var(--ink-muted); border: 1px solid var(--line-strong); white-space: nowrap; }
.in-tag i { width: 8px; height: 8px; border-radius: 50%; background: var(--c, var(--ink-muted)); display: block; }
.in-ip { font-family: var(--font-mono); font-size: 11px; }

@media (max-width: 1100px) {
  .in-page { height: auto; min-height: calc(100vh - 56px); overflow: visible; }
  .in-stage { grid-template-columns: 1fr; }
  .in-canvas { min-height: 500px; }
}
