/* =====================================================================
   Site chrome - 2026 redesign.
   Loaded by _layout/overall_a.php on every page (the legacy
   anuntul_video_main.css is loaded BEFORE this file so any clashing
   structural rules - e.g. #page_core, #header, #wrapper - are overridden
   by the rules below).
   ===================================================================== */

/* =====================================================================
   Theme tokens. Light is the default; dark mode is opted in via
   <html data-theme="dark"> (set by the boot script in overall_a.php).
   The legacy stylesheets still hard-code many colors, so the bottom of
   this file also has a [data-theme="dark"] override block that paints
   the most visible surfaces directly.
   ===================================================================== */
:root {
  --av-bg-page:       #f5f6f8;
  --av-bg-surface:    #ffffff;
  --av-bg-elev:       #f6f8fa;
  --av-bg-muted:      #eef0f3;
  --av-bg-overlay:    rgba(0, 0, 0, 0.5);
  --av-text:          #1f2328;
  --av-text-strong:   #0d1117;
  --av-text-muted:    #57606a;
  --av-text-faint:    #8b949e;
  --av-link:          #1f6feb;
  --av-link-hover:    #0a4ec1;
  --av-border:        #e3e6ea;
  --av-border-strong: #d0d7de;
  --av-accent:        #d92121;
  --av-accent-hover:  #b81818;
  --av-accent-soft:   #fff5f5;
  --av-shadow-sm:     0 1px 2px rgba(15, 23, 42, 0.04);
  --av-shadow-md:     0 4px 12px rgba(15, 23, 42, 0.08);
  --av-shadow-lg:     0 10px 30px rgba(15, 23, 42, 0.12);
  color-scheme: light;
}
:root[data-theme="dark"] {
  --av-bg-page:       #0d1117;
  --av-bg-surface:    #161b22;
  --av-bg-elev:       #21262d;
  --av-bg-muted:      #1c2128;
  --av-bg-overlay:    rgba(0, 0, 0, 0.7);
  --av-text:          #e6edf3;
  --av-text-strong:   #f0f6fc;
  --av-text-muted:    #9da7b1;
  --av-text-faint:    #6e7681;
  --av-link:          #58a6ff;
  --av-link-hover:    #79b8ff;
  --av-border:        #30363d;
  --av-border-strong: #444c56;
  --av-accent:        #f85149;
  --av-accent-hover:  #ff6a62;
  --av-accent-soft:   #2a1414;
  --av-shadow-sm:     0 1px 2px rgba(0, 0, 0, 0.4);
  --av-shadow-md:     0 4px 12px rgba(0, 0, 0, 0.5);
  --av-shadow-lg:     0 10px 30px rgba(0, 0, 0, 0.6);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body.page-home,
body.page-app {
  font-family: Arial, Helvetica, sans-serif;
  font-size: 13px;
  color: #1f2328;
  background: #f5f6f8;
}
body.page-home a,
body.page-app a { color: #1f6feb; text-decoration: none; }
/* Underline on hover only in real content — not header/sidebar/tabs/cards
   (body.page-app a:hover was winning over .hp-tab:hover etc. and looked broken). */
body.page-home #page_core a:hover,
body.page-app #page_core a:hover { text-decoration: underline; }
body.page-home #page_core .hp-card-thumb:hover,
body.page-app #page_core .hp-card-thumb:hover { text-decoration: none; }

/* Tame the legacy main stylesheet's structural rules so the new chrome
   has full control over layout. anuntul_video_main.css sized #page_core
   to a fixed 660px floated column; the new layout flows it inside the
   .hp-content section. */
body.page-app #page_core {
  width: auto !important;
  float: none !important;
  padding: 0 !important;
  margin: 0 !important;
  overflow: visible !important;
}
body.page-app #page_core h1,
body.page-app #page_core h2,
body.page-app #page_core h3,
body.page-app #page_core h4 { margin: 12px 0 8px; }
body.page-app #page_core .page { width: auto; }

/* ---------------- header ---------------- */
.hp-header {
  background: #fff;
  border-bottom: 1px solid #e3e6ea;
}
.hp-header-inner {
  max-width: 1180px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 20px;
}
.hp-logo img {
  height: 36px;
  display: block;
}
.hp-search {
  flex: 1 1 auto;
  display: flex;
  justify-content: center;
}
.hp-search-box {
  position: relative;
  width: 100%;
  max-width: 520px;
}
.hp-search-box input[type="text"] {
  width: 100%;
  height: 38px;
  padding: 0 44px 0 16px;
  border: 1px solid #d0d7de;
  border-radius: 19px;
  background: #f6f8fa;
  font-size: 14px;
  color: #1f2328;
  outline: none;
}
.hp-search-box input[type="text"]:focus {
  background: #fff;
  border-color: #1f6feb;
}
.hp-search-box button {
  position: absolute;
  right: 4px;
  top: 4px;
  width: 30px;
  height: 30px;
  border: none;
  background: transparent;
  cursor: pointer;
  color: #6e7781;
  display: flex;
  align-items: center;
  justify-content: center;
}
.hp-search-box button svg { width: 16px; height: 16px; }

.hp-add {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: green;
  border: 1px solid #006400;
  color: #fff !important;
  padding: 8px 14px;
  border-radius: 20px;
  font-weight: bold;
  font-size: 13px;
  white-space: nowrap;
}
.hp-add:hover { background: #009900; text-decoration: none; }

/* ---------------- theme toggle ---------------- */
.hp-theme-toggle {
  width: 36px;
  height: 36px;
  border: 1px solid var(--av-border);
  border-radius: 50%;
  background: var(--av-bg-surface);
  color: var(--av-text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  margin-right: 4px;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
  flex-shrink: 0;
}
.hp-theme-toggle:hover {
  background: var(--av-bg-elev);
  color: var(--av-text);
  border-color: var(--av-border-strong);
}
.hp-theme-toggle:focus { outline: 2px solid rgba(31,111,235,0.35); outline-offset: 2px; }
.hp-theme-toggle svg { display: block; }
.hp-theme-toggle__ico { display: none; line-height: 0; }
:root[data-theme-pref="auto"]  .hp-theme-toggle__ico--auto,
:root[data-theme-pref="light"] .hp-theme-toggle__ico--light,
:root[data-theme-pref="dark"]  .hp-theme-toggle__ico--dark { display: inline-flex; }
/* If the boot script hasn't run yet (e.g. JS disabled), fall back to auto. */
:root:not([data-theme-pref]) .hp-theme-toggle__ico--auto { display: inline-flex; }
.hp-add::before {
  content: "+";
  font-size: 18px;
  font-weight: 900;
  line-height: 1;
}
.hp-user-icons {
  display: flex;
  align-items: center;
  gap: 14px;
  color: #1f2328;
  position: relative;
}
.hp-user-icons > a {
  color: #1f2328;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
}

/* ---------------- account dropdown ---------------- */
.hp-user-menu {
  position: relative;
  display: inline-flex;
  align-items: center;
}
.hp-user-menu__trigger {
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  border: 0;
  padding: 0;
  margin: 0;
  width: 24px;
  height: 24px;
  color: #1f2328;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
}
.hp-user-menu__trigger:hover { color: #1f6feb; }
.hp-user-menu__trigger:focus { outline: 2px solid rgba(31,111,235,0.35); outline-offset: 2px; }
.hp-user-menu__trigger svg {
  fill: #1f6feb;
}
.hp-user-menu__panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 220px;
  background: #fff;
  border: 1px solid #d0d7de;
  border-radius: 12px;
  box-shadow: 0 10px 28px rgba(0,0,0,0.14);
  padding: 14px 0 8px;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s;
}
.hp-user-menu:hover .hp-user-menu__panel,
.hp-user-menu:focus-within .hp-user-menu__panel,
.hp-user-menu.is-open .hp-user-menu__panel {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.hp-user-menu__title {
  font-weight: 700;
  font-size: 14px;
  text-align: center;
  color: #1f2328;
  padding: 0 16px 10px;
  margin: 0 16px 6px;
  border-bottom: 1px solid #e6ebf0;
}
.hp-user-menu__item {
  display: flex !important;
  align-items: center;
  gap: 12px;
  width: auto !important;
  height: auto !important;
  padding: 9px 16px !important;
  text-decoration: none !important;
  color: #1f2328 !important;
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
}
.hp-user-menu__item:hover {
  background: #f6f8fa;
  color: #d92121 !important;
}
.hp-user-menu__item--danger:hover { color: #d92121 !important; background: #fff5f5; }
.hp-user-menu__ico {
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #1f2328;
}
.hp-user-menu__item:hover .hp-user-menu__ico { color: #d92121; }
.hp-user-menu__ico svg {
  /* iOS Safari occasionally computes a 0x0 intrinsic size when an
     inline SVG with a viewBox sits inside a flex container and lacks
     explicit width/height attributes. The HTML attributes are now set
     on every SVG, but keep these min-width/height as a safety net so
     the icon can never collapse to a sliver. */
  width: 22px;
  height: 22px;
  min-width: 22px;
  min-height: 22px;
  display: block;
}
.hp-user-menu__ico img { width: 22px; height: 22px; display: block; object-fit: contain; }
.hp-user-menu__divider {
  height: 1px;
  background: #e6ebf0;
  margin: 6px 16px;
}

/* ---------------- hamburger sidebar dropdown ----------------
   Mobile + tablet only. On desktop the full sidebar is already
   visible in the left column, so the hamburger trigger would just
   duplicate it and clutter the header. We default to hidden and
   only re-enable the inline-flex layout at <=1024px (covers
   phones and portrait tablets up through iPad Pro 11"). */
.hp-nav-menu {
  position: relative;
  display: none;
  align-items: center;
}
@media (max-width: 1024px) {
  .hp-nav-menu { display: inline-flex; }
}
.hp-nav-menu__trigger {
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  border: 0;
  padding: 0;
  margin: 0;
  width: 28px;
  height: 28px;
  /* Use the same dark text color as the other header icons; the previous
     #1f6feb (thin blue) rendered almost invisibly against the white header
     on iOS Safari. */
  color: #1f2328;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
}
.hp-nav-menu__trigger:hover { background: #eef0f3; }
.hp-nav-menu__trigger svg { display: block; width: 22px; height: 22px; }
.hp-nav-menu__trigger:focus { outline: 2px solid rgba(31,111,235,0.35); outline-offset: 2px; }
.hp-nav-menu__panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 300px;
  max-height: 80vh;
  overflow-y: auto;
  background: #fff;
  border: 1px solid #d0d7de;
  border-radius: 12px;
  box-shadow: 0 10px 28px rgba(0,0,0,0.14);
  padding: 14px;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s;
  /* mirror the sidebar's flex-column rhythm so the cloned children render
     as the same vertical stack of pills + rubrici list. */
  display: flex;
  flex-direction: column;
  gap: 6px;
  overscroll-behavior: contain;
  overscroll-behavior-y: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
}
.hp-nav-menu:hover .hp-nav-menu__panel,
.hp-nav-menu:focus-within .hp-nav-menu__panel,
.hp-nav-menu.is-open .hp-nav-menu__panel {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
/* The cloned sidebar items already carry .hp-side-pill / .hp-side-link
   styles. We only need to make sure the optional sticky/wide sidebar
   tweaks don't apply, and that scroll behaviour is smooth. */
.hp-nav-menu__panel .hp-rubrici { margin-top: 4px; }
.hp-nav-menu__panel .hp-side-services { margin-top: 8px; }

/* ---------------- main grid ---------------- */
.hp-main {
  max-width: 1180px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 20px;
  padding: 18px 20px 60px;
}

/* ---------------- left sidebar ---------------- */
.hp-sidebar {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.hp-side-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 6px;
  color: #1f2328 !important;
  font-weight: bold;
  font-size: 13px;
}
.hp-side-link:hover { background: #eef0f3; text-decoration: none; }
.hp-side-link.is-active { background: #f6f8fa; }
.hp-side-link .ico {
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #57606a;
}
/* iOS Safari occasionally computes a 0x0 intrinsic size for an inline
   SVG with only a viewBox in a flex container. Force an explicit size
   here too as a backup to the width/height attributes on the element
   (otherwise the "Favorite" star and similar icons disappear). */
.hp-side-link .ico svg {
  width: 20px;
  height: 20px;
  min-width: 20px;
  min-height: 20px;
  display: block;
}
.hp-side-link .ico--asset img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.hp-side-link--home {
  padding: 8px 10px;
  border: 1px solid #d0d7de;
  border-radius: 8px;
  background: #fff;
  gap: 12px;
}
.hp-side-link--home:hover { background: #f6f8fa; text-decoration: none; }
.hp-side-link--home.is-active { background: #fff; }
.hp-side-link--home .ico {
  width: 28px;
  height: 28px;
  color: #1f2328;
}
.hp-side-link--home .ico svg { width: 22px; height: 22px; }

.hp-side-pill {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  border: 1px solid #d0d7de;
  border-radius: 8px;
  background: #fff;
  color: #1f2328 !important;
  font-weight: bold;
  font-size: 13px;
  text-decoration: none !important;
}
.hp-side-pill:hover { background: #f6f8fa; }
.hp-side-pill .badge {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 14px;
  flex-shrink: 0;
}
.hp-side-pill .badge--asset {
  background: transparent;
  padding: 0;
  overflow: hidden;
}
.hp-side-pill .badge--asset img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.hp-pill-red    .badge { background: #d92121; }
.hp-pill-red    .badge--asset { background: transparent; }
.hp-pill-yellow .badge { background: #f4b400; color: #fff; }
.hp-pill-yellow .badge--asset { background: transparent; }
.hp-pill-blue   .badge { background: #1f6feb; }
.hp-pill-blue   .badge--asset { background: transparent; }
.hp-pill-recipe .badge { background: #d92121; }
.hp-pill-recipe .badge--asset { background: transparent; }

.hp-rubrici { margin-top: 18px; }
.hp-rubrici h3 {
  margin: 0 0 8px 10px;
  color: #d92121;
  font-size: 13px;
  font-weight: bold;
  letter-spacing: 0.5px;
}
.hp-rubrici ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.hp-rubrici > ul > li > a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: bold;
  color: #1f2328 !important;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  border-radius: 4px;
}
.hp-rubrici > ul > li > a:hover { background: #f6f8fa; text-decoration: none; }
.hp-rubrici > ul > li > a .arrow {
  color: #6e7781;
  font-weight: bold;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  transition: transform 0.18s ease;
  font-size: 14px;
  line-height: 1;
}
.hp-rubrici > ul > li.has-subs > a { cursor: pointer; }
.hp-rubrici > ul > li.is-expanded > a .arrow { transform: rotate(90deg); }

/* Active-route highlights */
/* Top-level category page: strong red bar + bold red text. */
.hp-rubrici > ul > li > a.is-current {
  color: #d92121 !important;
  background: #fff5f5;
  border-left: 3px solid #d92121;
  padding-left: 7px;
}
.hp-rubrici > ul > li > a.is-current .arrow { color: #d92121; }
/* Subcategory page: parent row gets a softer red text-only hint so the
   user can see the section they're in even when scrolled past the sub. */
.hp-rubrici > ul > li.has-current-sub > a {
  color: #d92121 !important;
}
.hp-rubrici > ul > li.has-current-sub > a .arrow { color: #d92121; }
/* Subcategory link itself: strong red highlight with left bar. */
.hp-subcats li a.is-current {
  color: #d92121 !important;
  background: #fff5f5;
  border-left: 3px solid #d92121;
  padding-left: 7px;
  font-weight: 600;
}

.hp-subcats {
  list-style: none !important;
  margin: 0 0 6px 10px !important;
  padding: 0 !important;
}
.hp-rubrici > ul > li.has-subs > .hp-subcats { display: none; }
.hp-rubrici > ul > li.is-expanded > .hp-subcats { display: block; }
.hp-subcats li a {
  display: block;
  padding: 4px 10px;
  font-size: 12px;
  color: #1f2328 !important;
  font-weight: normal;
  text-transform: none;
  letter-spacing: 0;
  border-radius: 4px;
}
.hp-subcats li a:hover { background: #f6f8fa; text-decoration: none; }

.hp-side-services {
  margin-top: 22px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-top: 1px solid #e3e6ea;
  padding-top: 14px;
}
.hp-side-services a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  font-size: 12px;
  color: #1f2328 !important;
  font-weight: bold;
}
.hp-side-services a:hover { background: #f6f8fa; text-decoration: none; }
.hp-side-services .badge {
  width: 22px;
  height: 22px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 900;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  flex-shrink: 0;
}
.hp-svc-at .badge { background: #d92121; }
.hp-svc-gs .badge { background: #f4b400; }
.hp-side-services .badge--asset {
  background: transparent;
  border-radius: 0;
  width: 24px;
  height: 24px;
  padding: 0;
  overflow: visible;
}
.hp-side-services .badge--asset img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.hp-svc-at .badge--asset { background: transparent; }
.hp-svc-gs .badge--asset { background: transparent; }

/* ---------------- main content ---------------- */
.hp-content { min-width: 0; }

/* Keep the strip + dropdowns above subsequent #page_core content (later siblings
   paint on top when z-index is auto — submenus looked “behind” on phones). */
.hp-content > nav.hp-tabs {
  position: relative;
  z-index: 210;
}

/* tabs — outer nav stays overflow:visible so submenus aren't clipped by a
   horizontal scrollport; inner .hp-tabs-scroll handles one-row sideways scroll */
.hp-tabs {
  padding-bottom: 14px;
  border-bottom: 1px solid #e3e6ea;
  overflow: visible;
}
.hp-tabs-scroll {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 6px;
  min-width: 0;
  /* Horizontal scroll; vertical overflow hidden for a tidy strip. Floating submenus are
     reparented to document.body in JS so they are not clipped by this scrollport. */
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  /* Hide scrollbar; horizontal scroll still works (touch/trackpad/shift-wheel). */
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.hp-tabs-scroll::-webkit-scrollbar {
  display: none;
}
.hp-tab-wrap {
  position: relative;
  display: inline-block;
  flex: 0 0 auto;
}
.hp-tab {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 1px 7px;
  border-radius: 16px;
  font-size: 13px;
  color: #1f2328 !important;
  background: transparent;
  white-space: nowrap;
}
.hp-tab:hover { background: #eef0f3; text-decoration: none; }
.hp-tab.is-active {
  background: #1f2328;
  color: #fff !important;
  font-weight: bold;
}
/* Tabs without 'has-subs' class: adjust padding for is-active state */
.hp-tab-wrap:not(.has-subs) > .hp-tab.is-active {
  padding: 4px 8px;
}
/* Cluster = label toggle + chevron (no parent <a> URL when submenus exist). */
/* Cluster inherits text colour for the category label toggle + chevron. */
.hp-tab-cluster {
  display: inline-flex;
  align-items: center;
  vertical-align: middle;
  max-width: 100%;
  color: #1f2328;
  touch-action: manipulation;
}
:root[data-theme="dark"] .hp-tab-cluster {
  color: var(--av-text-muted);
}
.hp-tab-cluster > button.hp-tab {
  appearance: none;
  -webkit-appearance: none;
  border: 0;
  margin: 0;
  font: inherit;
  line-height: inherit;
  cursor: pointer;
  text-align: inherit;
}
.hp-tab-wrap.has-subs .hp-tab-cluster > .hp-tab {
  padding-right: 4px;
}
/* Active tab: one pill spans label + chevron (no navigating parent URL for has-subs). */
.hp-tab-wrap.has-subs .hp-tab-cluster:has(> .hp-tab.is-active) {
  background: #1f2328;
  border-radius: 16px;
  /* Room past the chevron so it doesn’t sit on the pill’s right curve */
  padding-right: 8px;
  box-sizing: border-box;
}
.hp-tab-wrap.has-subs .hp-tab-cluster > .hp-tab.is-active {
  padding: 4px 4px 4px 8px;
  background: transparent !important;
}
.hp-tab-wrap.has-subs .hp-tab.is-active ~ .hp-tab__chev-btn {
  color: #fff !important;
}
:root[data-theme="dark"] .hp-tab-wrap.has-subs .hp-tab-cluster:has(> .hp-tab.is-active) {
  background: transparent;
}
:root[data-theme="dark"] .hp-tab-wrap.has-subs .hp-tab.is-active ~ .hp-tab__chev-btn {
  color: var(--av-text-muted) !important;
}
.hp-tab__chev-btn {
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  border: 0;
  padding: 6px 2px 6px 2px;
  margin: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: currentColor;
  cursor: pointer;
  border-radius: 16px;
  vertical-align: middle;
  /* Pull the button tight against the tab so they look like one chip. */
  margin-left: -4px;
  position: relative;
  z-index: 1;
  /* iOS Safari touch optimizations: skip the 300ms double-tap delay
     and give visible feedback when tapped (the default tap highlight
     is invisible against the white header). */
  touch-action: manipulation;
  -webkit-tap-highlight-color: rgba(31, 35, 40, 0.12);
}
.hp-tab__chev-btn:hover { /* background: #eef0f3; */ }
.hp-tab__chev-btn:focus { outline: 2px solid rgba(31,111,235,0.35); outline-offset: 2px; }
.hp-tab__chev {
  width: 10px;
  height: 10px;
  display: block;
  opacity: .65;
  transition: transform .15s ease, opacity .15s ease;
  /* Make the inner SVG transparent to pointer events so any tap that
     lands on it routes to the parent <button>. Safari (especially on
     iOS) sometimes makes `e.target` the SVG element on taps, and
     Element.closest() across the SVG -> HTML namespace boundary has
     historically been unreliable. With pointer-events:none here,
     `e.target` will always be the <button>. */
  pointer-events: none;
}
.hp-tab-wrap.has-subs:hover .hp-tab__chev,
.hp-tab-wrap.has-subs:focus-within .hp-tab__chev,
.hp-tab-wrap.has-subs.is-open .hp-tab__chev {
  transform: rotate(180deg);
  opacity: 1;
}
.hp-tab-menu {
  position: absolute;
  top: calc(100% - 4px);
  left: 0;
  /* Was 50; must clear page cards/rails that sit after .hp-tabs in the DOM */
  z-index: 5000;
  min-width: 180px;
  max-width: 240px;
  padding: 6px;
  background: #ffffff;
  border: 1px solid #d0d7de;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .12);
  display: flex;
  flex-direction: column;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity .12s ease, transform .12s ease, visibility 0s linear .12s;
  pointer-events: none;
}
.hp-tab-wrap.has-subs:hover .hp-tab-menu,
.hp-tab-wrap.has-subs:focus-within .hp-tab-menu,
.hp-tab-wrap.has-subs.is-open .hp-tab-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  transition: opacity .15s ease, transform .15s ease, visibility 0s linear 0s;
  pointer-events: auto;
}
/* Touch / phones: sticky :hover can fire without a mouse; suppress hover-only submenu
   so we rely on chevron (.is-open) + JS-fixed positioning instead of a clipped panel. */
@media (hover: none) {
  .hp-tab-wrap.has-subs:not(.is-open):hover .hp-tab-menu {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
    transform: translateY(-4px);
    transition: none;
  }
}
.hp-tab-menu__item,
.hp-tab-menu__item:link,
.hp-tab-menu__item:visited {
  display: block;
  padding: 8px 12px;
  border-radius: 7px;
  font: 500 13px/1.3 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: #1f2328 !important;
  text-decoration: none !important;
  white-space: nowrap;
  transition: background .12s ease, color .12s ease;
}
.hp-tab-menu__item:hover {
  background: #f6f8fa;
  color: #d92121 !important;
}
.hp-tab-menu__item.is-current {
  background: #fff1f1;
  color: #d92121 !important;
  font-weight: 600;
}
/* Anchor the last couple of dropdowns to the right edge so they don't
   spill outside the viewport on narrower screens. */
.hp-tabs-scroll > .hp-tab-wrap:nth-last-child(-n+2) .hp-tab-menu {
  left: auto;
  right: 0;
}
.hp-tabs-arrow {
  margin-left: auto;
  color: #1f2328;
  font-size: 18px;
  cursor: pointer;
  padding: 0 6px;
}

/* featured (3 large videos) - same hp_card rendering as the grid below,
   but in a 3-up layout so each thumbnail is a bit larger. */
.hp-featured {
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

/* section heading */
.hp-section-heading {
  text-align: center;
  font-size: 16px;
  font-weight: bold;
  color: #1f2328;
  margin: 26px 0 18px;
}

/* category row */
.hp-cat-row { margin-bottom: 28px; }
.hp-cat-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: bold;
  margin: 0 0 14px 0;
  color: #1f2328;
}
.hp-cat-title .dot {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
  display: block;
  background: var(--hp-cat-accent, #999);
  border-radius: 2px;
}
.hp-cat-title__label {
  flex-shrink: 0;
  white-space: nowrap;
}
/* Coloured rule continues from the title to the right edge (homepage category rows). */
.hp-cat-title__line {
  flex: 1 1 auto;
  min-width: 20px;
  height: 3px;
  background: var(--hp-cat-accent, #d0d7de);
  border-radius: 0;
}

/* cards grid - playlist toggle, thumbnail with overlay, then stars + uploader */
.hp-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}
.hp-card {
  display: flex;
  flex-direction: column;
  font-size: 12px;
  position: relative;
}
.hp-card-cb {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 6px;
  padding: 3px 0px 3px 5px;
  border-radius: 999px;
  background: #ffffff;
  border: 1px solid #d0d7de;
  color: #1f2328;
  font: 600 10px/1 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  cursor: pointer;
  user-select: none;
  max-width: 100%;
  transition: background .15s ease, border-color .15s ease, color .15s ease;

  position: absolute;
  top: 5px;
  right: 5px;
  z-index: 1;
}
.hp-card-cb:hover { background: #f6f8fa; border-color: #afb8c1; }
.hp-card-cb__input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 0;
  height: 0;
  margin: 0;
}
.hp-card-cb__ico {
  display: block;
  width: 14px;
  height: 14px;
  color: inherit;
  flex: 0 0 auto;
  overflow: visible;
  transition: color .15s ease;
}
.hp-card-cb__ico path { stroke: none; }
.hp-card-cb .add,
.hp-card-cb .rem {
  color: inherit !important;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.hp-card-cb:has(.hp-card-cb__input:checked) {
  background: #eef9f1;
  border-color: #a8d9b6;
  color: #1a7a3a;
}
.hp-card-cb:has(.hp-card-cb__input:checked) .hp-card-cb__ico { color: #1a7a3a; }
.hp-card-thumb {
  position: relative;
  display: block;
  border-radius: 6px;
  overflow: hidden;
  background: #000;
  aspect-ratio: 16 / 9;
  text-decoration: none !important;
}
.hp-card-thumb > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.hp-card-thumb .hp-card-info {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 14px 10px 8px;
  background: linear-gradient(to top, rgba(0,0,0,0.9), rgba(0,0,0,0));
  color: #fff;
  pointer-events: none;
}
.hp-card-thumb .hp-card-info .title {
  display: block;
  font-size: 12px;
  font-weight: bold;
  color: #fff;
  line-height: 1.25;
  margin-bottom: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.hp-card-thumb .hp-card-info .meta {
  font-size: 10px;
  color: #ccc;
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.hp-card-info__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  width: 100%;
}
.hp-stars {
  position: relative;
  display: inline-block;
  font-size: 12px;
  letter-spacing: 1px;
  line-height: 1;
  color: rgba(255, 255, 255, 0.4);
  flex: 0 0 auto;
}
.hp-stars .bg { display: inline-block; }
.hp-stars .fg {
  position: absolute;
  left: 0;
  top: 0;
  overflow: hidden;
  white-space: nowrap;
  color: #f4b400;
}

/* ---------------------------------------------------------------------
   Legacy-card extras (used by large_item() across categorie / cautare /
   utilizator / ultimele_filme listings). The base card layout reuses
   .hp-card / .hp-card-cb / .hp-card-thumb / .hp-card-info from above;
   these rules add the master/owner-only controls below the thumbnail.
   --------------------------------------------------------------------- */
.hp-card-duration {
  position: absolute;
  bottom: 8px;
  right: 8px;
  z-index: 1;
  background: rgba(0,0,0,0.78);
  color: #fff;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.2;
  pointer-events: none;
}
.hp-card-thumb--processing {
  position: relative;
  display: block;
  border-radius: 6px;
  overflow: hidden;
  background: #000;
  aspect-ratio: 16 / 9;
}
.hp-card-thumb--processing > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  opacity: .7;
}

.hp-card-actions {
  display: flex;
  gap: 6px;
  margin-top: 8px;
  flex-wrap: wrap;
}
.hp-card-actions--select { gap: 0; }
.hp-card-action {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 10px;
  border-radius: 999px;
  font: 600 11px/1 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  text-decoration: none !important;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
  flex: 1 1 0;
  justify-content: center;
  min-width: 0;
}
.hp-card-action svg {
  width: 12px;
  height: 12px;
  flex: 0 0 auto;
}
.hp-card-action--edit, .hp-card-action--edit:link, .hp-card-action--edit:visited {
  color: #0969da !important;
  background: #ddf4ff;
  border-color: #b6e3ff;
}
.hp-card-action--edit:hover { background: #b6e3ff; border-color: #54aeff; }
.hp-card-action--del, .hp-card-action--del:link, .hp-card-action--del:visited {
  color: #d92121 !important;
  background: #ffebe9;
  border-color: #ffcecb;
}
.hp-card-action--del:hover { background: #ffcecb; border-color: #ff8182; }
.hp-card-action--fav-rem, .hp-card-action--fav-rem:link, .hp-card-action--fav-rem:visited {
  color: #8a6a00 !important;
  background: #fff8e1;
  border-color: #f4c542;
}
.hp-card-action--fav-rem:hover { background: #ffe69d; border-color: #f4b400; }
.hp-card-action--fav-add, .hp-card-action--fav-add:link, .hp-card-action--fav-add:visited {
  color: #1f2328 !important;
  background: #f6f8fa;
  border-color: #d0d7de;
}
.hp-card-action--fav-add:hover { background: #eaeef2; border-color: #afb8c1; }

.hp-card-select {
  width: 100%;
  padding: 6px 28px 6px 10px;
  border-radius: 8px;
  border: 1px solid #d0d7de;
  background: #ffffff
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 10 10'><path d='M1 3l4 4 4-4' stroke='%2357606a' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/></svg>")
    no-repeat right 10px center;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  font: 500 11px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: #1f2328;
  cursor: pointer;
}
.hp-card-select:hover { border-color: #afb8c1; }
.hp-card-select:focus { outline: 2px solid #0969da33; outline-offset: 1px; border-color: #0969da; }

/* footer */
.hp-footer {
  background: #ffffff;
  color: #000000;
  padding: 24px 20px;
  text-align: center;
  font-size: 12px;
  margin-top: 30px;
}
.hp-footer a { color: #000000; }

/* ---------------------------------------------------------------------
   Legacy listing pages (categorie / cautare / utilizator / ultimele_filme
   / h). These pages use large_item() in _php/functions.php, which now
   emits modern .hp-card.legacy-card markup. Each paginated slice is one
   <div class="page"> listing grid (.hp-content .page in this codebase),
   visually aligned with the homepage `.hp-cards` grids.
   --------------------------------------------------------------------- */
.hp-content hr {
  border: none;
  border-top: 1px solid #e3e6ea;
  margin: 14px 0 18px;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  column-gap: 8px;
  row-gap: 4px;
  padding: 10px 0 6px;
  margin: 0;
  font-size: 15px;
  font-weight: bold;
  color: #1f2328;
  list-style: none;
}
.breadcrumb a, .breadcrumb a:visited {
  color: #1f2328 !important;
  text-decoration: none;
}
.breadcrumb a:hover { color: #d92121 !important; text-decoration: none; }
.breadcrumb .sep {
  color: #8c959f;
  font-weight: 400;
  font-size: 16px;
  line-height: 1;
  user-select: none;
}
.breadcrumb .current { color: #0099ff; }
.breadcrumb a.current { color: #0099ff !important; }
.breadcrumb a.current:hover { color: #007acc !important; }

/* Category sort filter (cele mai noi / vizionate / votate). Underline tabs
   with a small "Sorteaza" label; active tab gets a red underline. */
.cat-sort {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 6px;
  margin: 8px 0 18px;
  border-bottom: 1px solid #e3e6ea;
}
.cat-sort__label {
  font: 600 11px/1 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: #8c959f;
  padding: 0 14px 0 2px;
  margin-bottom: -1px;
}
.cat-sort__item,
.cat-sort__item:link,
.cat-sort__item:visited {
  position: relative;
  padding: 11px 14px 12px;
  font: 600 13px/1 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: #57606a !important;
  text-decoration: none !important;
  white-space: nowrap;
  margin-bottom: -1px;
  border-bottom: 2px solid transparent;
  transition: color .15s ease, border-color .15s ease;
}
.cat-sort__item:hover {
  color: #1f2328 !important;
  border-bottom-color: #d0d7de;
}
.cat-sort__item.is-active,
.cat-sort__item.is-active:link,
.cat-sort__item.is-active:visited {
  color: #d92121 !important;
  border-bottom-color: #d92121;
}
.cat-sort__item.is-active:hover {
  color: #b41818 !important;
  border-bottom-color: #b41818;
}
@media (max-width: 520px) {
  .cat-sort__label { width: 100%; padding: 8px 0 0; }
  .cat-sort__item { padding: 10px 10px 11px; font-size: 12px; }
}

.hp-content .page {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 14px;
  background: transparent;
}

/* Reset legacy float/width for cards rendered by large_item() inside the
   listing grid. The .hp-card class supplies the modern flex layout. */
.hp-content .page > .home_swf_item {
  width: auto;
  margin: 0;
  padding: 0;
  float: none;
  min-width: 0;
  text-align: left;
}
/* The trailing <div class="block"> is a legacy clearfix for the old
   floats; not needed (and visually noisy) inside the grid. */
.hp-content .page > .block { display: none; }

/* Homepage + listing grids on desktop: 3-across so each thumbnail is larger
   than the base 4-col layout; keep the roomier gutters (unchanged px). */
@media (min-width: 901px) {
  .hp-cards,
  .hp-content .page {
    grid-template-columns: repeat(3, 1fr);
    column-gap: 24px;
    row-gap: 26px;
  }
}

/* responsive */
@media (max-width: 900px) {
  .hp-main { grid-template-columns: 1fr; }
  .hp-sidebar { display: none; }
  .hp-featured { grid-template-columns: 1fr; }
  .hp-cards { grid-template-columns: repeat(2, 1fr); }
  .hp-content .page { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 520px) {
  .hp-cards { grid-template-columns: 1fr; }
  .hp-content .page { grid-template-columns: 1fr; }
}

/* Reusable confirm modal --------------------------------------------- */
.av-modal {
	position: fixed; inset: 0; z-index: 10000;
	display: flex; align-items: center; justify-content: center;
	padding: 20px;
	font: 14px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
.av-modal[hidden] { display: none; }
.av-modal__overlay {
	position: absolute; inset: 0;
	background: rgba(15, 17, 21, 0.55);
	backdrop-filter: blur(2px);
	animation: av-modal-fade .15s ease;
}
.av-modal__panel {
	position: relative;
	width: 100%; max-width: 420px;
	background: #ffffff;
	border-radius: 16px;
	box-shadow: 0 20px 60px rgba(0, 0, 0, .25);
	padding: 24px 26px 20px;
	text-align: center;
	animation: av-modal-pop .18s ease;
}
.av-modal__icon {
	width: 56px; height: 56px;
	margin: 0 auto 14px;
	border-radius: 50%;
	display: inline-flex; align-items: center; justify-content: center;
	background: #ddf4ff; color: #0969da;
}
.av-modal--danger .av-modal__icon { background: #ffebe9; color: #cf222e; }
.av-modal__icon svg { width: 26px; height: 26px; }
.av-modal__title {
	margin: 0 0 6px;
	font: 700 18px/1.3 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	color: #1f2328;
}
.av-modal__message {
	margin: 0 0 20px;
	font-size: 14px; line-height: 1.5;
	color: #57606a;
}
.av-modal__actions {
	display: flex; gap: 10px;
	justify-content: center;
}
.av-modal__btn {
	display: inline-flex; align-items: center; justify-content: center;
	min-width: 110px;
	padding: 10px 18px;
	border-radius: 999px;
	font: 600 13px/1 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	letter-spacing: .3px;
	cursor: pointer;
	transition: background .15s ease, transform .05s ease, border-color .15s ease;
}
.av-modal__btn--cancel {
	background: #f6f8fa; color: #1f2328;
	border: 1px solid #d0d7de;
}
.av-modal__btn--cancel:hover { background: #eaeef2; border-color: #afb8c1; }
.av-modal__btn--confirm {
	background: #0969da; color: #ffffff;
	border: 1px solid #0758b8;
}
.av-modal__btn--confirm:hover { background: #0758b8; }
.av-modal__btn:active { transform: translateY(1px); }
.av-modal--danger .av-modal__btn--confirm {
	background: #d92121; border-color: #b41818;
}
.av-modal--danger .av-modal__btn--confirm:hover { background: #b41818; }

@keyframes av-modal-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes av-modal-pop  { from { opacity: 0; transform: translateY(8px) scale(.96); } to { opacity: 1; transform: none; } }

@media (max-width: 480px) {
	.av-modal__panel { padding: 22px 20px 18px; }
	.av-modal__actions { flex-direction: column-reverse; }
	.av-modal__btn { width: 100%; }
}

/* =====================================================================
   MOBILE RESPONSIVENESS - 2026
   The site has had mobile breakpoints scattered through the file as it
   grew; this block consolidates the cross-cutting tweaks needed to make
   every page genuinely usable down to 320px viewports. Component-local
   responsive rules above (cat-sort, ss-box, av-modal, pg-nav, ...) stay
   where they are so they're easy to find next to the component.
   ===================================================================== */

/* ---- Tablet / narrow desktop (≤ 900px) ----
   At this width the sidebar already collapses (display:none above), the
   main grid drops to a single column and the home cards drop to 2-up. */
@media (max-width: 900px) {
	.hp-main { padding: 14px 12px 40px; gap: 16px; }
	.hp-header-inner { gap: 10px; padding: 12px 12px; }
	.hp-search-box { max-width: none; }
	.hp-cat-row { margin-bottom: 22px; }
}

/* ---- Phone landscape / small tablet (≤ 700px) ----
   Compress the header so logo + search + add + menu fit. The "+ Adauga
   video" pill drops its label and becomes an icon-only button. */
@media (max-width: 700px) {
	.hp-logo img { height: 30px; }
	.hp-add {
		padding: 6px 9px;
		font-size: 0;            /* hide label */
		gap: 0;
		white-space: nowrap;
	}
	.hp-add::before {
		font-size: 18px;
	}
	/* font-size MUST be ≥16px on iOS or Safari auto-zooms the page on
	   focus. Keep it at 16px on phones; the input itself is wide enough
	   to accommodate the slightly larger glyphs. */
	.hp-search-box input[type="text"] { height: 36px; font-size: 16px; }
	.hp-user-icons { gap: 8px; }

	/* Featured + main card grid go single column on small phones too,
	   which is already declared above for 520px. Repeat at 700px so 2-up
	   on tablets remains; then 1-up at 520px below. */
	.hp-featured { gap: 10px; }
	.hp-cards { gap: 10px; }

	/* Card thumb overlays — larger title + views on handheld screens */
	.hp-card-thumb .hp-card-info {
		padding: 16px 12px 10px;
	}
	.hp-card-thumb .hp-card-info .title {
		font-size: 16px;
		line-height: 1.3;
		margin-bottom: 4px;
	}
	.hp-card-thumb .hp-card-info .meta {
		font-size: 13px;
		color: rgba(255, 255, 255, 0.92);
	}
	.hp-stars {
		font-size: 14px;
	}

	/* Footer: single-line on desktop, stacked on phones. */
	.hp-footer { padding: 18px 14px; font-size: 12px; }

	/* Bigger tap targets in dropdown menus (account / sidebar drawer). */
	.hp-user-menu__item { padding: 11px 16px !important; }
	/* The trigger icons aren't at the viewport's right edge (hamburger
	   sits next to the user icon, etc.), so an absolutely-positioned
	   panel anchored to the trigger container ends up extending past
	   the left side of the screen. Pin to the viewport instead. */
	.hp-user-menu__panel,
	.hp-nav-menu__panel {
		position: fixed;
		top: 58px;
		left: 8px;
		right: 8px;
		width: auto;
		min-width: 0;
		max-width: none;
		max-height: calc(100vh - 70px);
		overflow-y: auto;
		overscroll-behavior: contain;
		overscroll-behavior-y: contain;
		-webkit-overflow-scrolling: touch;
		touch-action: pan-y;
	}
	.hp-nav-menu__panel { padding: 12px; }
}

/* Hamburger drawer open: stop background page scrolling behind the panel (touch / mobile). */
html.hp-nav-drawer-open {
	overflow: hidden;
	height: 100%;
	overscroll-behavior: none;
}
body.hp-nav-drawer-open {
	overflow: hidden;
}

/* ---- Phone portrait (≤ 520px) ----
   The hp-cards grid drops to 1 column above; tighten paddings and
   ensure the card-cb pill never overflows when titles wrap. */
@media (max-width: 520px) {
	.hp-main { padding: 10px 10px 30px; }
	.hp-section-heading { font-size: 14px; margin: 18px 0 12px; }
	.hp-cat-title { font-size: 13px; }

	/* Card chips slightly larger so they're easier to tap. */
	.hp-card-cb__ico { width: 20px; height: 20px; }

	/* Pagination already adapts at 520px. */

	/* Confirm modal already adapts at 480px. */

	/* Breadcrumb: keep on a single line if possible, else wrap nicely. */
	.breadcrumb { font-size: 13px; padding: 8px 0 4px; gap: 6px 6px; }

	/* Footer: stack the inline links vertically. */
	.hp-footer { padding: 16px 10px; line-height: 1.6; }
	.hp-footer p { margin: 6px 0 0; }
}

/* ---- Tiny phones (≤ 360px) ---- */
@media (max-width: 360px) {
	.hp-header-inner { padding: 10px 8px; gap: 6px; }
	.hp-logo img { height: 26px; }
	.hp-search-box input[type="text"] { padding: 0 36px 0 12px; }
	.hp-add { padding: 6px 7px; }
	.hp-theme-toggle { width: 32px; height: 32px; margin-right: 0; }
	.hp-theme-toggle svg { width: 18px; height: 18px; }
}

/* ---- Floating playlist drawer (legacy jcarousel) ----
   Defaults to ~120px tall with 290px wide cards. On phones the drawer
   would cover ~25% of the viewport and the cards would extend beyond
   the screen; collapse the prev/next buttons closer to the edges and
   shrink the cards. */
@media (max-width: 700px) {
	#hp_fb_like_wrapper {
		font-size: 12px;
	}
	#hp_fb_like_wrapper .jcarousel-skin-tango .jcarousel-container-horizontal {
		padding: 6px 44px !important;
	}
	#hp_fb_like_wrapper .jcarousel-skin-tango .jcarousel-prev-horizontal { left: 4px; }
	#hp_fb_like_wrapper .jcarousel-skin-tango .jcarousel-next-horizontal { right: 4px; }
	#hp_fb_like_wrapper .jcarousel-skin-tango .jcarousel-item,
	.playlist-item {
		width: 240px !important;
	}
	.playlist-item__thumb { width: 86px; height: 50px; }
	.playlist-toggle { font-size: 10px; padding: 5px 10px; }
}
@media (max-width: 420px) {
	#hp_fb_like_wrapper .jcarousel-skin-tango .jcarousel-item,
	.playlist-item {
		width: 220px !important;
	}
	.playlist-item__title { font-size: 11px; }
}

/* ---- Form responsiveness ----
   The legacy stylesheet has many inputs hard-coded to widths like
   367px / 200px / 116px. Inputs/textareas inside the modern .adv-card,
   .pg-* layouts, the contact + login forms, and any plain <input> in
   _pages should never exceed their parent's width on phones. */
@media (max-width: 700px) {
	body.page-app input[type="text"],
	body.page-app input[type="email"],
	body.page-app input[type="password"],
	body.page-app input[type="search"],
	body.page-app input[type="url"],
	body.page-app input[type="number"],
	body.page-app input[type="tel"],
	body.page-app textarea,
	body.page-app select {
		max-width: 100%;
		box-sizing: border-box;
	}
	/* Tables emitted by legacy pages can blow out the viewport. Wrap them
	   in a horizontal scroll container by allowing the page itself to
	   never overflow horizontally. */
	body.page-app #page_core { overflow-x: hidden; }
	body.page-app #page_core table { max-width: 100%; }
	body.page-app img { max-width: 100%; height: auto; }
}

/* ---- Touch tweaks ----
   Disable hover styles that block taps on touch devices (the dropdowns
   already handled above). Increase minimum tap targets on key actions. */
@media (hover: none) and (pointer: coarse) {
	.hp-tab:hover { background: transparent; }
	.hp-card-cb:hover { background: #ffffff; border-color: #d0d7de; }
	.hp-card-cb:has(.hp-card-cb__input:checked):hover {
		background: #eef9f1; border-color: #a8d9b6;
	}
	.cat-sort__item:hover { color: #57606a !important; border-bottom-color: transparent; }
	.cat-sort__item.is-active:hover {
		color: #d92121 !important; border-bottom-color: #d92121;
	}

	/* Account / hamburger panels: on touch devices the trigger button
	   keeps :focus after a tap, which would keep the panel visible via
	   :focus-within even after the explicit click handler removes the
	   `is-open` class. Disable the hover/focus-within open paths here so
	   the panel is driven exclusively by `is-open` -> the second tap
	   really closes it. */
	.hp-user-menu:hover .hp-user-menu__panel,
	.hp-user-menu:focus-within .hp-user-menu__panel,
	.hp-nav-menu:hover .hp-nav-menu__panel,
	.hp-nav-menu:focus-within .hp-nav-menu__panel {
		opacity: 0;
		visibility: hidden;
		transform: translateY(-6px);
	}
	.hp-user-menu.is-open .hp-user-menu__panel,
	.hp-nav-menu.is-open .hp-nav-menu__panel {
		opacity: 1;
		visibility: visible;
		transform: translateY(0);
	}
}

/* =====================================================================
   DARK MODE OVERRIDES
   The legacy stylesheets (anuntul_video_main.css and ~80 page-specific
   files under _pages/) hard-code colors, and many redesign rules above
   already use `color: ... !important` to defeat the legacy
   `body.page-app a { color: ...; }` cascade. To beat those without
   touching the original rules, the dark overrides below all use
   `!important` for color/background/border declarations.
   ===================================================================== */
:root[data-theme="dark"] body,
:root[data-theme="dark"] body.page-home,
:root[data-theme="dark"] body.page-app {
  background: var(--av-bg-page) !important;
  color: var(--av-text) !important;
}
/* Generic link recolor (legacy CSS uses a navy that is unreadable on
   a dark background). The redesign's blueish link is lightened.
   NOTE: we deliberately do NOT include `:link / :visited / :active`
   pseudo-class selectors here — each adds +1 to specificity and would
   beat component-level overrides like `:root[data-theme="dark"]
   .hp-side-link` (specificity 0,3,0). The bare `a` selector
   (specificity 0,2,1) loses cleanly to component rules but still
   defeats legacy `a:link { color: ... }` rules thanks to !important. */
:root[data-theme="dark"] a {
  color: var(--av-link) !important;
}
:root[data-theme="dark"] a:hover { color: var(--av-link-hover) !important; }

/* ---------------- header ---------------- */
:root[data-theme="dark"] .hp-header {
  background: var(--av-bg-surface) !important;
  border-bottom-color: var(--av-border) !important;
}
/* `.hp-search-box` is just a position:relative wrapper - the rounded
   pill is the inner <input> (border-radius 19px). Painting the wrapper
   would put a SQUARE dark surface behind the round input, leaking
   visibly at the four corners. So drop the dark background on the
   wrapper and apply it directly to the rounded input instead. */
:root[data-theme="dark"] .hp-search-box {
  background: transparent !important;
}
:root[data-theme="dark"] .hp-search-box input[type="text"] {
  background: var(--av-bg-elev) !important;
  border-color: var(--av-border) !important;
  color: var(--av-text) !important;
}
:root[data-theme="dark"] .hp-search-box input[type="text"]:focus {
  background: var(--av-bg-muted) !important;
  border-color: var(--av-link) !important;
}
:root[data-theme="dark"] .hp-search-box input[type="text"]::placeholder { color: var(--av-text-faint) !important; }
:root[data-theme="dark"] .hp-search-box button { color: var(--av-text-muted) !important; background: transparent !important; }
:root[data-theme="dark"] .hp-add {
  background: green !important;
  color: #fff !important;
  border-color: #006400 !important;
}
:root[data-theme="dark"] .hp-add:hover {
  background: #009900 !important;
  color: #fff !important;
}
:root[data-theme="dark"] .hp-user-icons > a { color: var(--av-text-muted) !important; }
:root[data-theme="dark"] .hp-user-icons > a:hover { color: var(--av-link) !important; }
:root[data-theme="dark"] .hp-user-menu__trigger { color: var(--av-text-muted) !important; }
:root[data-theme="dark"] .hp-user-menu__trigger:hover { color: var(--av-link) !important; }
:root[data-theme="dark"] .hp-nav-menu__trigger { color: var(--av-text-muted) !important; }
:root[data-theme="dark"] .hp-nav-menu__trigger:hover { background: var(--av-bg-elev) !important; }

/* ---------------- popovers ---------------- */
:root[data-theme="dark"] .hp-user-menu__panel,
:root[data-theme="dark"] .hp-nav-menu__panel,
:root[data-theme="dark"] .hp-tab-menu {
  background: var(--av-bg-surface) !important;
  border-color: var(--av-border) !important;
  box-shadow: var(--av-shadow-lg) !important;
}
:root[data-theme="dark"] .hp-user-menu__title { color: var(--av-text-muted) !important; }
:root[data-theme="dark"] .hp-user-menu__item { color: var(--av-text-muted) !important; }
:root[data-theme="dark"] .hp-user-menu__ico { color: var(--av-text-muted) !important; }
:root[data-theme="dark"] .hp-user-menu__item:hover {
  background: var(--av-bg-elev) !important;
  color: #ff6b6b !important;
}
:root[data-theme="dark"] .hp-user-menu__item:hover .hp-user-menu__ico { color: #ff6b6b !important; }
:root[data-theme="dark"] .hp-user-menu__item--danger:hover { background: var(--av-accent-soft) !important; }
:root[data-theme="dark"] .hp-user-menu__divider { background: var(--av-border) !important; }
:root[data-theme="dark"] .hp-tab-menu__item { color: var(--av-text-muted) !important; }
:root[data-theme="dark"] .hp-tab-menu__item:hover {
  background: var(--av-bg-elev) !important;
  color: var(--av-text) !important;
}
:root[data-theme="dark"] .hp-tab-menu__item.is-current,
:root[data-theme="dark"] .hp-tab-menu__item.is-current:link,
:root[data-theme="dark"] .hp-tab-menu__item.is-current:visited {
  background: var(--av-bg-elev) !important;
  color: var(--av-text-strong) !important;
}
:root[data-theme="dark"] .hp-tab-menu__item.is-current:hover {
  background: var(--av-bg-elev) !important;
  color: var(--av-text-strong) !important;
}

/* ---------------- sidebar ----------------
   In dark mode the sidebar uses a muted grey for resting state so the
   labels and icons don't shout against the page surface; hover and
   active states bump back up to bright text/icons for affordance. */
:root[data-theme="dark"] .hp-sidebar { color: var(--av-text-muted) !important; }
:root[data-theme="dark"] .hp-side-link,
:root[data-theme="dark"] .hp-side-link--home {
  color: var(--av-text-muted) !important;
  background: transparent !important;
  /* `.hp-side-link--home` carries `border: 1px solid #d0d7de` from the
     light-mode rule; that's bright on the dark surface so we recolor
     it to match the rest of the sidebar pills. */
  border-color: var(--av-border) !important;
}
:root[data-theme="dark"] .hp-side-link--home .ico,
:root[data-theme="dark"] .hp-side-link .ico { color: var(--av-text-muted) !important; }
:root[data-theme="dark"] .hp-side-link:hover,
:root[data-theme="dark"] .hp-side-link.is-active {
  background: var(--av-bg-elev) !important;
  color: var(--av-text) !important;
}
:root[data-theme="dark"] .hp-side-link--home:hover {
  background: var(--av-bg-elev) !important;
  color: var(--av-text) !important;
}
/* The Home pill keeps the same surface background as the category
   pills (`.hp-side-pill`) below it, both at rest and when active, so
   the sidebar reads as a single column of consistent pills. Listed
   AFTER the generic hover/active rule above (and uses the same
   3-class specificity as `.hp-side-link.hp-side-link--home.is-active`)
   so it wins the cascade for the home link's active state. */
:root[data-theme="dark"] .hp-side-link.hp-side-link--home,
:root[data-theme="dark"] .hp-side-link.hp-side-link--home.is-active {
  background: var(--av-bg-surface) !important;
}
:root[data-theme="dark"] .hp-side-link:hover .ico,
:root[data-theme="dark"] .hp-side-link.is-active .ico,
:root[data-theme="dark"] .hp-side-link--home:hover .ico,
:root[data-theme="dark"] .hp-side-link--home.is-active .ico { color: var(--av-text) !important; }
:root[data-theme="dark"] .hp-side-pill {
  color: var(--av-text-muted) !important;
  border-color: var(--av-border) !important;
  background: var(--av-bg-surface) !important;
}
:root[data-theme="dark"] .hp-side-pill:hover {
  background: var(--av-bg-elev) !important;
  color: var(--av-text) !important;
}
:root[data-theme="dark"] .hp-rubrici h3 { color: var(--av-text-faint) !important; }
:root[data-theme="dark"] .hp-rubrici > ul > li > a { color: var(--av-text-muted) !important; }
:root[data-theme="dark"] .hp-rubrici > ul > li > a:hover {
  background: var(--av-bg-elev) !important;
  color: var(--av-text) !important;
}
:root[data-theme="dark"] .hp-rubrici > ul > li > a.is-current,
:root[data-theme="dark"] .hp-rubrici > ul > li > a.is-current:link,
:root[data-theme="dark"] .hp-rubrici > ul > li > a.is-current:visited,
:root[data-theme="dark"] .hp-rubrici > ul > li.has-current-sub > a,
:root[data-theme="dark"] .hp-rubrici > ul > li.has-current-sub > a:link,
:root[data-theme="dark"] .hp-rubrici > ul > li.has-current-sub > a:visited {
  background: var(--av-bg-elev) !important;
  color: var(--av-text-strong) !important;
}
:root[data-theme="dark"] .hp-rubrici > ul > li > a.is-current:hover,
:root[data-theme="dark"] .hp-rubrici > ul > li.has-current-sub > a:hover {
  background: var(--av-bg-elev) !important;
  color: var(--av-text-strong) !important;
}
:root[data-theme="dark"] .hp-subcats li a { color: var(--av-text-muted) !important; background: transparent !important; }
:root[data-theme="dark"] .hp-subcats li a:hover { background: var(--av-bg-elev) !important; color: var(--av-text) !important; }
:root[data-theme="dark"] .hp-subcats li a.is-current,
:root[data-theme="dark"] .hp-subcats li a.is-current:link,
:root[data-theme="dark"] .hp-subcats li a.is-current:visited {
  background: var(--av-bg-elev) !important;
  color: var(--av-text-strong) !important;
}
:root[data-theme="dark"] .hp-subcats li a.is-current:hover {
  background: var(--av-bg-elev) !important;
  color: var(--av-text-strong) !important;
}
:root[data-theme="dark"] .hp-side-services a { color: var(--av-text-muted) !important; background: transparent !important; }
:root[data-theme="dark"] .hp-side-services a:hover {
  background: var(--av-bg-elev) !important;
  color: var(--av-text) !important;
}

/* ---------------- top tabs ---------------- */
:root[data-theme="dark"] .hp-tabs {
  border-bottom-color: var(--av-border) !important;
  background: transparent !important;
}
:root[data-theme="dark"] .hp-tab { color: var(--av-text-muted) !important; background: transparent !important; }
:root[data-theme="dark"] .hp-tab:hover { color: var(--av-text) !important; background: var(--av-bg-elev) !important; }
/* Active top tab keeps the same muted grey as the others - the red
   bottom underline already signals the active section, so no need to
   bump the text to bright white. */
:root[data-theme="dark"] .hp-tab.is-active { color: var(--av-text-strong) !important; }
:root[data-theme="dark"] .hp-tab__chev-btn { color: var(--av-text-muted) !important; background: transparent !important; }
:root[data-theme="dark"] .hp-tabs-arrow {
  background: var(--av-bg-surface) !important;
  color: var(--av-text) !important;
  border-color: var(--av-border) !important;
}

/* ---------------- cards / video grids ---------------- */
:root[data-theme="dark"] .hp-card,
:root[data-theme="dark"] .hp-cat-row,
:root[data-theme="dark"] .hp-content,
:root[data-theme="dark"] .hp-main { color: var(--av-text) !important; }
/* Use #page_core to outweigh the generic
   `:root[data-theme="dark"] #page_core h1..h5 { color: --av-text-strong }`
   rule below; otherwise the section/category headings stay bright
   white (the user wants them in muted grey). */
:root[data-theme="dark"] #page_core .hp-cat-title,
:root[data-theme="dark"] #page_core .hp-section-heading,
:root[data-theme="dark"] .hp-cat-title,
:root[data-theme="dark"] .hp-section-heading { color: var(--av-text-muted) !important; }
:root[data-theme="dark"] .hp-card-cb {
  background: #FFF !important;
  border-color: var(--av-border) !important;
  color: #FFF !important;
  box-shadow: var(--av-shadow-sm) !important;
}
:root[data-theme="dark"] .hp-card-cb:hover {
  background: var(--av-bg-muted) !important;
  border-color: var(--av-border-strong) !important;
  color: var(--av-text) !important;
}
:root[data-theme="dark"] .hp-card-cb__ico { color: var(--av-text-faint) !important; }
/* "In playlist" checked state - same dark-green palette as the
   detail-page .df-playlist-toggle for visual consistency. */
:root[data-theme="dark"] .hp-card-cb:has(.hp-card-cb__input:checked) {
  background: #0f2a1a !important;
  border-color: #1f5034 !important;
  color: #7ee2a8 !important;
}
:root[data-theme="dark"] .hp-card-cb:has(.hp-card-cb__input:checked) .hp-card-cb__ico { color: #7ee2a8 !important; }
/* Same in the mobile media query at 480px which redeclares the hover/
   checked colors using literal hex values. */
@media (max-width: 480px) {
  :root[data-theme="dark"] .hp-card-cb:hover {
    background: var(--av-bg-elev) !important;
    border-color: var(--av-border) !important;
  }
  :root[data-theme="dark"] .hp-card-cb:has(.hp-card-cb__input:checked):hover {
    background: #0f2a1a !important;
    border-color: #1f5034 !important;
  }
}
:root[data-theme="dark"] .hp-card-thumb { background: #000 !important; }
/* Starbox rating widgets: in light mode the sprite gutter is opaque
   white which blends with the page; in dark mode the same gutter
   becomes a glaring bright bar around the stars. Override by clipping
   the .stars track to the star shapes via a CSS mask (gutter becomes
   transparent and picks up the dark surface). The masks are alpha
   inverses of the sprite PNGs - generated by _tools/starbox_make_masks.py. */
:root[data-theme="dark"] .df-meta__rating .starbox .stars {
  -webkit-mask-image: url("../_js/starbox/images/starbox/pointy7_mask.png");
          mask-image: url("../_js/starbox/images/starbox/pointy7_mask.png");
  -webkit-mask-repeat: repeat-x;
          mask-repeat: repeat-x;
  -webkit-mask-size: 23px 22px;
          mask-size: 23px 22px;
  background: #6b737f !important;
}
/* Right-rail "similar films" stars already use the small7 mask in
   _pages/detalii_film.php; only the track colour needs a dark tweak. */
:root[data-theme="dark"] .df-film-similar #same_category .starbox .stars {
  background: #6b737f !important;
}
:root[data-theme="dark"] .hp-card-info__row { color: var(--av-text-muted) !important; }
:root[data-theme="dark"] .hp-card-action,
:root[data-theme="dark"] .hp-card-action:link,
:root[data-theme="dark"] .hp-card-action:visited {
  background: var(--av-bg-elev) !important;
  color: var(--av-text) !important;
  border-color: var(--av-border) !important;
}
:root[data-theme="dark"] .hp-card-action:hover { background: var(--av-bg-muted) !important; }
/* Mirror the light-mode color story for the three coloured variants
   (blue Modifica / red Sterge / yellow Sterge din favorite) using
   translucent washes so they pop against the dark card without being
   harsh. Listed after the generic .hp-card-action override so the
   variant rules win the cascade. */
:root[data-theme="dark"] .hp-card-action--edit,
:root[data-theme="dark"] .hp-card-action--edit:link,
:root[data-theme="dark"] .hp-card-action--edit:visited {
  background: rgba(56,139,253,.16) !important;
  border-color: rgba(56,139,253,.45) !important;
  color: #58a6ff !important;
}
:root[data-theme="dark"] .hp-card-action--edit:hover {
  background: rgba(56,139,253,.28) !important;
  border-color: rgba(56,139,253,.6) !important;
  color: #79b8ff !important;
}
:root[data-theme="dark"] .hp-card-action--del,
:root[data-theme="dark"] .hp-card-action--del:link,
:root[data-theme="dark"] .hp-card-action--del:visited {
  background: rgba(248,81,73,.16) !important;
  border-color: rgba(248,81,73,.45) !important;
  color: #ff7b72 !important;
}
:root[data-theme="dark"] .hp-card-action--del:hover {
  background: rgba(248,81,73,.28) !important;
  border-color: rgba(248,81,73,.6) !important;
  color: #ffa198 !important;
}
:root[data-theme="dark"] .hp-card-action--fav-rem,
:root[data-theme="dark"] .hp-card-action--fav-rem:link,
:root[data-theme="dark"] .hp-card-action--fav-rem:visited {
  background: rgba(245,180,0,.14) !important;
  border-color: rgba(245,180,0,.45) !important;
  color: #f5b400 !important;
}
:root[data-theme="dark"] .hp-card-action--fav-rem:hover {
  background: rgba(245,180,0,.24) !important;
  border-color: rgba(245,180,0,.6) !important;
  color: #ffd56a !important;
}
:root[data-theme="dark"] .hp-card-thumb--processing { background: var(--av-bg-elev) !important; color: var(--av-text-muted) !important; }

/* ---------------- footer ---------------- */
:root[data-theme="dark"] .hp-footer {
  background: var(--av-bg-surface) !important;
  border-top-color: var(--av-border) !important;
  color: var(--av-text-muted) !important;
}
:root[data-theme="dark"] .hp-footer a { color: var(--av-text-muted) !important; }
:root[data-theme="dark"] .hp-footer a:hover { color: var(--av-text) !important; }

/* ---------------- breadcrumb / sort bar ---------------- */
:root[data-theme="dark"] .breadcrumb { color: var(--av-text-muted) !important; }
:root[data-theme="dark"] .breadcrumb a,
:root[data-theme="dark"] .breadcrumb a:visited { color: var(--av-text-muted) !important; }
:root[data-theme="dark"] .breadcrumb a:hover { color: var(--av-text) !important; }
/* Current page in the breadcrumb - render in pure white so the user
   can clearly see where they are, while parent links stay muted. The
   harsh blue (#0099ff) from light mode is dropped for a clean white
   that's consistent with section headings/strong text in dark mode. */
:root[data-theme="dark"] .breadcrumb .current,
:root[data-theme="dark"] .breadcrumb a.current,
:root[data-theme="dark"] .breadcrumb a.current:hover { color: var(--av-text-muted) !important; }
:root[data-theme="dark"] .cat-sort { border-bottom-color: var(--av-border) !important; }
:root[data-theme="dark"] .cat-sort__label { color: var(--av-text-muted) !important; }
:root[data-theme="dark"] .cat-sort__item { color: var(--av-text-muted) !important; }
:root[data-theme="dark"] .cat-sort__item:hover { color: var(--av-text) !important; }
:root[data-theme="dark"] .cat-sort__item.is-active { color: var(--av-accent) !important; }

/* ---------------- modals (av-modal) ---------------- */
:root[data-theme="dark"] .av-modal__overlay { background: var(--av-bg-overlay) !important; }
:root[data-theme="dark"] .av-modal__panel {
  background: var(--av-bg-surface) !important;
  color: var(--av-text) !important;
  border-color: var(--av-border) !important;
  box-shadow: var(--av-shadow-lg) !important;
}
:root[data-theme="dark"] .av-modal__title { color: var(--av-text-strong) !important; }
:root[data-theme="dark"] .av-modal__message { color: var(--av-text-muted) !important; }
:root[data-theme="dark"] .av-modal__btn--cancel {
  background: var(--av-bg-elev) !important;
  color: var(--av-text) !important;
  border-color: var(--av-border) !important;
}
:root[data-theme="dark"] .av-modal__btn--cancel:hover { background: var(--av-bg-muted) !important; }

/* ---------------- detail page (df-* / ab-*) ----------------
   The detail page (_pages/detalii_film.php) carries its own inline
   <style> blocks with hardcoded white surfaces. Override every visible
   surface and text color so the page reads correctly in dark mode.
*/
:root[data-theme="dark"] .df-detail-head { color: var(--av-text) !important; }
:root[data-theme="dark"] .df-title-row,
:root[data-theme="dark"] .df-title-row__title { color: var(--av-text-strong) !important; }

/* Meta strip (user / date / favorite / views / rating / IMDB) */
:root[data-theme="dark"] .df-meta,
:root[data-theme="dark"] .df-meta-strip {
  background: var(--av-bg-surface) !important;
  border-color: var(--av-border) !important;
  color: var(--av-text) !important;
}
:root[data-theme="dark"] .df-meta__item,
:root[data-theme="dark"] .df-meta-strip__item { color: var(--av-text-muted) !important; }
:root[data-theme="dark"] .df-meta__item svg { color: var(--av-text-faint) !important; }
:root[data-theme="dark"] .df-meta__item strong { color: var(--av-text-muted) !important; }
:root[data-theme="dark"] .df-meta__user { color: var(--av-link) !important; }
:root[data-theme="dark"] .df-meta__nota { color: var(--av-text-muted) !important; }
:root[data-theme="dark"] .df-meta__nota b { color: var(--av-accent) !important; }
/* Need body.page-app prefix to beat the global `body.page-app a` link color rule. */
:root[data-theme="dark"] body.page-app .df-fav,
:root[data-theme="dark"] body.page-app a.df-fav {
  background: var(--av-bg-elev) !important;
  border-color: var(--av-border) !important;
  color: var(--av-text-muted) !important;
}
:root[data-theme="dark"] body.page-app .df-fav:hover {
  background: var(--av-bg-muted) !important;
  border-color: var(--av-border-strong) !important;
  color: var(--av-text) !important;
}
:root[data-theme="dark"] body.page-app .df-fav--remove { color: var(--av-text-muted) !important; }
:root[data-theme="dark"] .df-must-login {
  background: var(--av-accent-soft) !important;
  border-color: rgba(248, 81, 73, 0.4) !important;
  color: #ff8b85 !important;
}
:root[data-theme="dark"] .df-desc { color: var(--av-text-muted) !important; }

/* Playlist toggle pill (top-right of the title row) */
:root[data-theme="dark"] .df-playlist-toggle {
  background: var(--av-bg-elev) !important;
  border-color: var(--av-border) !important;
  color: var(--av-text-muted) !important;
}
:root[data-theme="dark"] .df-playlist-toggle:hover {
  background: var(--av-bg-muted) !important;
  border-color: var(--av-border-strong) !important;
  color: var(--av-text) !important;
}
:root[data-theme="dark"] .df-playlist-toggle svg { color: var(--av-text-muted) !important; }
:root[data-theme="dark"] .df-playlist-toggle:has(.df-playlist-toggle__input:checked) {
  background: #0f2a1a !important; border-color: #1f5034 !important; color: #7ee2a8 !important;
}
:root[data-theme="dark"] .df-playlist-toggle:has(.df-playlist-toggle__input:checked) svg { color: #7ee2a8 !important; }

/* Similar / album rail */
:root[data-theme="dark"] .df-film-similar {
  background: var(--av-bg-surface) !important;
  border-color: var(--av-border) !important;
}
:root[data-theme="dark"] .df-film-similar__title { color: var(--av-text-strong) !important; border-bottom-color: var(--av-border) !important; }
:root[data-theme="dark"] .df-film-similar #same_category tr { background: var(--av-bg-surface) !important; }
:root[data-theme="dark"] .df-film-similar #same_category tr:hover { background: var(--av-bg-elev) !important; }
:root[data-theme="dark"] .df-film-similar #same_category a { color: var(--av-text-muted) !important; }
:root[data-theme="dark"] .df-film-similar #same_category a:hover { color: var(--av-text) !important; }
:root[data-theme="dark"] .df-film-similar #same_category .rsi-meta { color: var(--av-text-muted) !important; }
:root[data-theme="dark"] .df-film-similar--album #same_category tr.rsi-current { background: var(--av-bg-elev) !important; }

/* Album banner */
:root[data-theme="dark"] .df-album-banner {
  background: var(--av-bg-surface) !important;
  border-color: var(--av-border) !important;
  color: var(--av-text) !important;
}

/* Album artist page — mobile header + horizontal strip (_pages/detalii_film.php) */
:root[data-theme="dark"] .df-album-mobile-header {
  border-bottom-color: var(--av-border) !important;
  color: var(--av-text-muted) !important;
}
:root[data-theme="dark"] .df-album-mobile-header__artist {
  color: #ff6b6b !important;
}
:root[data-theme="dark"] .df-album-mobile-header__sep {
  color: var(--av-text-faint) !important;
}
:root[data-theme="dark"] .df-album-mobile-header__album {
  color: var(--av-text-strong) !important;
}
:root[data-theme="dark"] .df-album-mobile-strip__item {
  color: var(--av-text-muted) !important;
}
:root[data-theme="dark"] .df-album-mobile-strip__title {
  color: var(--av-text-muted) !important;
}
:root[data-theme="dark"] .df-album-mobile-strip__item.is-current .df-album-mobile-strip__title {
  color: #ff6b6b !important;
}
:root[data-theme="dark"] .df-album-mobile-strip__year {
  color: var(--av-text-faint) !important;
}
/* Current-album card: keep a light elevated surface so cover + hint stay readable */
:root[data-theme="dark"] .df-album-mobile-strip .df-strip-autoplay-panel {
  background: #ffffff !important;
  border-color: #8b949e !important;
  box-shadow:
    0 6px 22px rgba(0, 0, 0, 0.45),
    0 0 0 1px rgba(255, 255, 255, 0.12) inset !important;
}
:root[data-theme="dark"] .df-strip-autoplay-panel__title,
:root[data-theme="dark"] .df-strip-autoplay-panel__year {
  color: #1f2328 !important;
}
:root[data-theme="dark"] .df-strip-autoplay-panel__hint {
  color: #d92121 !important;
}
:root[data-theme="dark"] .df-album-now-playing--strip-slot {
  background: var(--av-bg-surface) !important;
  border-color: var(--av-border) !important;
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.35) !important;
}
:root[data-theme="dark"] .df-album-now-playing__album,
:root[data-theme="dark"] .df-album-now-playing__year {
  color: var(--av-text-strong) !important;
}
:root[data-theme="dark"] .df-album-now-playing__hint {
  color: #ff6b6b !important;
}

/* "Semnaleaza o problema" form ("ab-*") */
:root[data-theme="dark"] .ab-toggle {
  background: var(--av-bg-surface) !important;
  border-color: var(--av-border) !important;
  color: var(--av-text-muted) !important;
}
:root[data-theme="dark"] .ab-toggle:hover {
  background: var(--av-bg-elev) !important;
  border-color: var(--av-border-strong) !important;
  color: var(--av-text) !important;
}
:root[data-theme="dark"] .ab-toggle.is-open { border-bottom-color: transparent !important; }
:root[data-theme="dark"] .ab-toggle__ico {
  background: var(--av-accent-soft) !important;
  color: var(--av-accent) !important;
}
:root[data-theme="dark"] .ab-toggle__chev { color: var(--av-text-muted) !important; }
:root[data-theme="dark"] .ab-card {
  background: var(--av-bg-surface) !important;
  border-color: var(--av-border) !important;
  color: var(--av-text-muted) !important;
}
:root[data-theme="dark"] .ab-reasons label {
  background: var(--av-bg-elev) !important;
  border-color: var(--av-border) !important;
  color: var(--av-text-muted) !important;
}
:root[data-theme="dark"] .ab-reasons label:hover {
  background: var(--av-bg-muted) !important;
  border-color: var(--av-border-strong) !important;
  color: var(--av-text) !important;
}
:root[data-theme="dark"] .ab-reasons input[type=radio]:checked + label,
:root[data-theme="dark"] .ab-reasons label:has(input[type=radio]:checked) {
  background: #2a1414 !important;
  border-color: var(--av-accent) !important;
  color: #ff8b85 !important;
}
:root[data-theme="dark"] .ab-note {
  background: #2a1414 !important;
  border-color: rgba(248, 81, 73, 0.4) !important;
  color: #ff8b85 !important;
}
:root[data-theme="dark"] .ab-note svg,
:root[data-theme="dark"] .ab-note strong { color: #ff8b85 !important; }
:root[data-theme="dark"] .ab-field label { color: var(--av-text-muted) !important; }
:root[data-theme="dark"] .ab-input,
:root[data-theme="dark"] .ab-textarea {
  background: var(--av-bg-elev) !important;
  color: var(--av-text) !important;
  border-color: var(--av-border) !important;
}
:root[data-theme="dark"] .ab-input:focus,
:root[data-theme="dark"] .ab-textarea:focus {
  border-color: var(--av-link) !important;
  box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.2) !important;
}
:root[data-theme="dark"] .ab-captcha img {
  background: var(--av-bg-elev) !important;
  border-color: var(--av-border) !important;
}
:root[data-theme="dark"] .ab-alert--success { background: #0e2a1c !important; color: #7ee2a8 !important; border-color: #1f5034 !important; }
:root[data-theme="dark"] .ab-alert--error   { background: #2a1414 !important; color: #ff8b85 !important; border-color: #5a2a2a !important; }
:root[data-theme="dark"] .error { color: #ff8b85 !important; }

/* Comments (legacy block can also live on the page) */
:root[data-theme="dark"] .df-comments,
:root[data-theme="dark"] .df-rating-widget {
  background: var(--av-bg-surface) !important;
  border-color: var(--av-border) !important;
  color: var(--av-text) !important;
}

/* ---------------- legacy content surfaces ---------------- */
:root[data-theme="dark"] #page_core,
:root[data-theme="dark"] #wrapper,
:root[data-theme="dark"] #container_page { color: var(--av-text) !important; }
:root[data-theme="dark"] #page_core h1,
:root[data-theme="dark"] #page_core h2,
:root[data-theme="dark"] #page_core h3,
:root[data-theme="dark"] #page_core h4,
:root[data-theme="dark"] #page_core h5 { color: var(--av-text-muted) !important; }
/* Film/album detail page main title - sits directly above the meta
   strip (which uses `--av-text-muted`) so the user wants the title
   to read in the same muted grey rather than blazing white. */
:root[data-theme="dark"] #page_core h1#titlu_film { color: var(--av-text-muted) !important; }
/* Inputs / textareas / selects across legacy forms. */
:root[data-theme="dark"] input[type="text"],
:root[data-theme="dark"] input[type="email"],
:root[data-theme="dark"] input[type="password"],
:root[data-theme="dark"] input[type="search"],
:root[data-theme="dark"] input[type="url"],
:root[data-theme="dark"] input[type="number"],
:root[data-theme="dark"] input[type="tel"],
:root[data-theme="dark"] textarea,
:root[data-theme="dark"] select {
  background: var(--av-bg-elev) !important;
  color: var(--av-text) !important;
  border-color: var(--av-border) !important;
}
:root[data-theme="dark"] input::placeholder,
:root[data-theme="dark"] textarea::placeholder { color: var(--av-text-faint) !important; }

/* Cookie / consent banner that some pages render full-width white. */
:root[data-theme="dark"] #cookie-consent,
:root[data-theme="dark"] .cookie-consent,
:root[data-theme="dark"] .cookie-banner,
:root[data-theme="dark"] .cookie-bar,
:root[data-theme="dark"] [class*="cookie"][class*="banner"],
:root[data-theme="dark"] [id*="cookie"][id*="banner"] {
  background: var(--av-bg-surface) !important;
  color: var(--av-text) !important;
  border-color: var(--av-border) !important;
}

/* ---------------- search autocomplete ----------------
   The smartsuggest dropdown has its own stylesheet
   (_js/smartsuggest/css/jquery.smartsuggest.css). Dark-mode overrides
   live there, next to the rules they're overriding. */

/* ---------------- pagination ---------------- */
:root[data-theme="dark"] .pagination a,
:root[data-theme="dark"] .pagination .page-num,
:root[data-theme="dark"] .pagination span {
  background: var(--av-bg-surface) !important;
  color: var(--av-text) !important;
  border-color: var(--av-border) !important;
}
:root[data-theme="dark"] .pagination a:hover { background: var(--av-bg-elev) !important; }
:root[data-theme="dark"] .pagination .current,
:root[data-theme="dark"] .pagination .active,
:root[data-theme="dark"] .pagination .is-current { background: var(--av-accent) !important; color: #fff !important; border-color: transparent !important; }

/* ---------------- mobile menu (hamburger panel content) ---------------- */
@media (max-width: 1024px) {
  :root[data-theme="dark"] .hp-nav-menu__panel { background: var(--av-bg-surface) !important; }
}
@media (max-width: 720px) {
  /* Same square-corner gotcha as the desktop rule: paint the rounded
     <input>, not the outer wrapper. */
  :root[data-theme="dark"] .hp-search-box { background: transparent !important; }
  :root[data-theme="dark"] .hp-search-box input[type="text"] { background: var(--av-bg-elev) !important; }
}
@media only screen and (max-width: 720px) {
    input[type="text"], textarea {font-size: 16px !important; }
}