:root {
  --bg: #0d0d0d;
  --bg-elevated: #121212;
  --bg-surface: #161616;
  --bg-hover: #1c1c1c;
  --border: #262626;
  --border-strong: #3a3a3a;
  --text: #ffffff;
  --text-secondary: #cccccc;
  --text-muted: #999999;
  --accent: #3d5afe;
  --accent-hover: #536dfe;
  --ok: #00c4b4;
  --danger: #c62828;
  --danger-soft: #ef9a9a;
  --radius: 8px;
  --radius-sm: 4px;
  --font: Inter, "Helvetica Neue", Helvetica, Arial, sans-serif;
  --header-height: 56px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --page-x: max(16px, var(--safe-left));
  --page-x-right: max(16px, var(--safe-right));
}

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

/* Keine Focus-Ringe, Focus-Borders oder Focus-Schatten (Klick / Tastatur). */
:focus,
:focus-visible {
  outline: none !important;
  box-shadow: none !important;
}

button,
a,
input,
select,
textarea,
[tabindex] {
  -webkit-tap-highlight-color: transparent;
}

/* Mindestens 16px: verhindert Auto-Zoom beim Tippen auf Inputs (iOS/Android). */
input,
select,
textarea {
  font-size: 16px;
}

html {
  height: 100%;
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100%;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}

.app {
  min-height: 100dvh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.app-header,
.menu-top-bar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
  padding-top: var(--safe-top);
}

.menu-top-bar-inner,
.app-header-inner {
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 var(--page-x-right) 0 var(--page-x);
  width: min(1120px, 100%);
  margin: 0 auto;
  min-width: 0;
}

.menu-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  color: var(--text);
  text-decoration: none;
  flex: 0 1 auto;
}

/* Wie vodx-app AuthBrandMark / Loading-Emblem: rundes „V“. */
.menu-brand__emblem {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  border-radius: 50%;
  font-size: 15px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0;
  color: #ffffff;
  background: var(--bg-surface);
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.menu-brand__text {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1.15;
  white-space: nowrap;
}

.menu-dropdown {
  position: relative;
  flex: 0 1 auto;
  margin-left: auto;
  width: max-content;
  max-width: min(100%, 15.5rem);
}

.menu-dropdown__toggle {
  appearance: none;
  box-sizing: border-box;
  border: 1px solid var(--border);
  background: var(--bg-surface);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.2;
  width: 100%;
  min-width: 8.75rem;
  min-height: 34px;
  max-width: 100%;
  padding: 6px 10px 6px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  position: relative;
}

.menu-dropdown__toggle:hover {
  border-color: var(--border-strong);
  background: var(--bg-hover);
}

.menu-dropdown.is-open .menu-dropdown__toggle {
  border-color: var(--border-strong);
  background: var(--bg-hover);
}

.menu-dropdown__label {
  flex: 1 1 auto;
  min-width: 0;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.menu-dropdown__indicator,
.menu-item__indicator {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.35);
  flex-shrink: 0;
}

.menu-dropdown__indicator {
  display: inline-block;
}

.menu-dropdown__caret {
  flex: 0 0 auto;
  width: 0;
  height: 0;
  margin-left: 2px;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid var(--text-muted);
  transition: transform 0.12s ease;
}

.menu-dropdown.is-open .menu-dropdown__caret {
  transform: rotate(180deg);
  border-top-color: var(--text-secondary);
}

.menu-item__indicator {
  position: absolute;
  top: 50%;
  right: 12px;
  transform: translateY(-50%);
}

.menu-item[aria-current="page"] .menu-item__indicator {
  background: var(--accent-hover);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.2);
}

.menu-nav,
.menu-dropdown__panel {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 2px;
  margin: 0;
  padding: 6px;
  list-style: none;
}

.menu-dropdown__panel {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  left: auto;
  z-index: 40;
  box-sizing: border-box;
  width: max(100%, 13.5rem);
  min-width: 13.5rem;
  max-width: min(18rem, calc(100vw - 2 * var(--page-x)));
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
}

.menu-dropdown__panel[hidden] {
  display: none !important;
}

.menu-item {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  padding: 9px 28px 9px 12px;
  min-height: 38px;
  cursor: pointer;
  border-left: 2px solid transparent;
  transition: color 0.12s ease, border-color 0.12s ease, background 0.12s ease;
  white-space: nowrap;
  display: flex;
  align-items: center;
  text-decoration: none;
  position: relative;
  border-radius: var(--radius-sm);
}

.menu-item:hover {
  color: var(--text-secondary);
  background: var(--bg-hover);
}

.menu-item[aria-current="page"] {
  color: var(--text);
  border-left-color: var(--accent);
  background: var(--bg-hover);
}

.app-main {
  flex: 1;
  width: min(1120px, 100%);
  margin: 0 auto;
  /* Unten kein Padding: Scroll-Seiten (FikFap) müssen bis zum Viewport-Rand gehen.
     Andere Seiten setzen ihren Abstand selbst am Page-Container. */
  padding: 20px var(--page-x-right) 0 var(--page-x);
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 0;
  overflow: hidden;
}

.page {
  display: none;
  flex-direction: column;
  gap: 16px;
  flex: 1;
  min-width: 0;
  min-height: 0;
}

.page.is-active {
  display: flex;
}

.page.is-active:not(.page-fikfap):not(.page-fikfap-user):not(.page-fikfap-video):not(.page-bunny):not(.page-bunny-videos):not(.page-bunny-user):not(.page-bunny-video) {
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-bottom: calc(28px + var(--safe-bottom));
}

.page-fikfap.is-active,
.page-fikfap-user.is-active,
.page-fikfap-video.is-active,
.page-bunny.is-active,
.page-bunny-videos.is-active,
.page-bunny-user.is-active,
.page-bunny-video.is-active {
  overflow: hidden;
}

.fikfap-page-header {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--bg);
  padding-bottom: 4px;
}

.bunny-page-intro {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0;
}

.bunny-page-intro__text {
  min-width: 0;
  flex: 1;
}

.bunny-page-intro__text h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
}

.bunny-page-intro__text p {
  margin: 4px 0 0;
  color: var(--text-muted);
  font-size: 13px;
}

.bunny-subnav__tabs {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  gap: 4px;
}

.bunny-subnav__tab {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  min-width: 36px;
  min-height: 36px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.12s ease, background 0.12s ease;
  touch-action: manipulation;
}

.bunny-subnav__tab svg {
  display: block;
  pointer-events: none;
}

.bunny-subnav__tab:hover:not(.bunny-subnav__tab--active):not([aria-selected="true"]) {
  color: var(--text-secondary);
}

.bunny-subnav__tab--active,
.bunny-subnav__tab[aria-selected="true"] {
  color: var(--text);
  background: var(--bg-hover);
}

.bunny-search-form {
  width: 100%;
}

.bunny-lazy-sentinel {
  display: block;
  width: 100%;
  min-height: 1px;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text-muted);
  font: inherit;
  font-size: 13px;
  text-align: center;
  pointer-events: none;
  appearance: none;
}

.bunny-lazy-sentinel.is-loading {
  min-height: 40px;
  padding: 12px 0;
}

.bunny-video-title-link {
  cursor: pointer;
}

.bunny-video-title-link:hover {
  color: #fff;
}

.page-intro-hint {
  margin: 0;
  color: var(--text-muted);
  font-size: 13px;
}

.fikfap-page-body {
  flex: 1;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  display: block;
  /* Abstand nur im Scroll-Inhalt, damit das letzte Item voll sichtbar ist
     und der Clip-Rand am Viewport-Boden liegt */
  padding-bottom: max(20px, var(--safe-bottom));
}

.metrics {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  align-items: stretch;
  gap: 0;
  /* Darf in der Flex-Page nicht auf min-height schrumpfen — sonst clippt overflow. */
  flex-shrink: 0;
  min-height: 40px;
  padding: 0;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.metric {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
  padding: 10px 12px;
}

.metric + .metric {
  border-left: 1px solid var(--border);
}

.metric-label {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

.metric-value {
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}

.metric-value.is-ok {
  color: var(--ok);
}

.metric-value.is-muted {
  color: var(--text-secondary);
}

.metric-value.is-accent {
  color: var(--accent);
}

.monitor-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.chart-card {
  min-width: 0;
  max-width: 100%;
}

.chart-card .panel-header {
  padding-bottom: 8px;
}

.chart-wrap {
  position: relative;
  width: 100%;
  height: 180px;
  min-height: 180px;
  max-height: 180px;
  min-width: 0;
  margin: 0 0 12px;
  padding: 0 12px;
  overflow: hidden;
  box-sizing: border-box;
}

.chart-wrap canvas {
  display: block;
  width: 100% !important;
  height: 180px !important;
  max-width: 100% !important;
  max-height: 180px !important;
  min-width: 0 !important;
  min-height: 0 !important;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.info-list {
  margin: 0;
  padding: 4px 0 10px;
}

.info-row {
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr);
  gap: 12px;
  padding: 8px 18px;
  border-bottom: 1px solid var(--border);
}

.info-row:last-child {
  border-bottom: none;
}

.info-row dt {
  margin: 0;
  color: var(--text-muted);
  font-size: 12px;
}

.info-row dd {
  margin: 0;
  color: var(--text-secondary);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.sensor-blocks {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-bottom: 8px;
}

.sensor-block {
  padding: 10px 18px 6px;
  border-bottom: 1px solid var(--border);
}

.sensor-block:last-child {
  border-bottom: none;
}

.sensor-block h3 {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.sensor-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 0;
  font-size: 13px;
  color: var(--text-secondary);
}

.sensor-row strong {
  color: var(--text);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.sensor-empty {
  margin: 0;
  color: var(--text-muted);
  font-size: 13px;
}

.panel {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.panel-header {
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
}

.panel-header h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
}

.panel-header p {
  margin: 4px 0 0;
  color: var(--text-muted);
  font-size: 13px;
}

.page-intro {
  margin: 0 0 4px;
}

.page-intro h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
}

.page-intro p {
  margin: 4px 0 0;
  color: var(--text-muted);
  font-size: 13px;
}

.service-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  min-height: 0;
  padding: 12px 14px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: background 0.12s ease;
}

.service-row:hover {
  background: var(--bg-hover);
}

.fikfap-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
}

.fikfap-filter-menu-wrap {
  position: relative;
  flex-shrink: 0;
}

.fikfap-filter-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: min(280px, calc(100vw - 32px));
  padding: 12px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}

.fikfap-filter-menu[hidden] {
  display: none;
}

.fikfap-filter-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.fikfap-filter-label {
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.2;
}

.fikfap-filter-select {
  width: 100%;
  min-height: 40px;
  padding: 8px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
  font: inherit;
  font-size: 16px;
}

.btn-icon-filter:hover:not(:disabled) {
  color: var(--text);
  border-color: var(--border-strong);
  background: rgba(255, 255, 255, 0.06);
}

.btn-icon-filter.is-active {
  color: var(--accent);
  border-color: rgba(61, 90, 254, 0.5);
  background: rgba(61, 90, 254, 0.12);
}

.btn-icon-filter[aria-expanded="true"] {
  color: var(--text);
  border-color: var(--border-strong);
  background: rgba(255, 255, 255, 0.06);
}

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

.fikfap-search-input {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 40px;
  padding: 8px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  color: var(--text);
  font: inherit;
  font-size: 16px;
}

.fikfap-hashtag-sentinel {
  width: 100%;
  height: 1px;
  pointer-events: none;
}

.fikfap-profile-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-shrink: 0;
}

.fikfap-profile-row {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
}

.fikfap-profile-row:hover {
  background: var(--bg-hover);
}

.fikfap-profile-actions {
  flex-shrink: 0;
}

.fikfap-profile-actions .btn-icon {
  cursor: pointer;
}

.fikfap-profile-avatar {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  flex-shrink: 0;
}

.fikfap-profile-avatar-empty {
  display: block;
  background: var(--bg-hover);
}

.fikfap-profile-main {
  min-width: 0;
}

.fikfap-profile-name {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
}

.fikfap-profile-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 8px;
  margin: 4px 0 0;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.25;
}

.fikfap-profile-stat {
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.fikfap-meta-sep {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--border-strong);
  flex-shrink: 0;
}

.fikfap-footer {
  display: flex;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 16px;
}

.page-fikfap-user.is-active {
  overflow: hidden;
}

.fikfap-user-intro {
  display: flex;
  align-items: center;
  gap: 12px;
}

.fikfap-user-avatar-host {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
}

.fikfap-user-avatar {
  display: block;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  background: var(--bg-surface);
  border: 1px solid var(--border);
}

.fikfap-user-avatar-empty {
  background: var(--bg-hover);
}

.fikfap-user-intro-text {
  min-width: 0;
  flex: 1;
}

.fikfap-user-intro-text h2 {
  margin: 0;
}

.fikfap-user-stats {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 10px;
  margin: 6px 0 0;
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.2;
}

.fikfap-user-stats-loading {
  color: var(--text-muted);
}

.fikfap-user-stat {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.fikfap-user-stat-icon {
  display: inline-flex;
  color: var(--text-muted);
}

.fikfap-user-stat-icon svg {
  width: 13px;
  height: 13px;
}

.fikfap-user-stat-value {
  color: var(--text-secondary);
}

.fikfap-user-stat-sep {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--border-strong);
  flex-shrink: 0;
}

.btn-icon-back:hover:not(:disabled) {
  color: var(--text);
  border-color: var(--border-strong);
  background: rgba(255, 255, 255, 0.06);
}

.video-grid {
  --video-grid-min: 140px;
  --video-grid-gap: 12px;
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(
    auto-fill,
    minmax(min(100%, var(--video-grid-min)), 1fr)
  );
  gap: var(--video-grid-gap);
  width: 100%;
  min-width: 0;
  flex-shrink: 0;
}

.video-tile {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  touch-action: manipulation;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

/* Mobile Long-Press: keine Textauswahl / Callout auf Kacheln und Status-Badges. */
.video-grid,
.video-tile__media,
.video-tile__status,
.video-tile__meta,
.video-tile__title,
.video-tile__post-id,
.video-tile__fallback,
.video-tile__avatar-badge {
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

body.video-tile-long-pressing,
body.video-tile-long-pressing *,
body.video-tile-menu-open,
body.video-tile-menu-open * {
  -webkit-touch-callout: none !important;
  -webkit-user-select: none !important;
  user-select: none !important;
}

.video-tile--playable {
  cursor: pointer;
}

.video-tile--playable .video-tile__media {
  outline-offset: 0;
}

/* Hover nur bei echten Zeigegeräten – sonst sticky „Markierung“ beim ersten Tap. */
@media (hover: hover) and (pointer: fine) {
  .video-tile--playable:hover .video-tile__media {
    border-color: var(--accent);
  }
}

.page-fikfap-video.is-active,
.page-bunny-video.is-active {
  position: relative;
  gap: 0;
}

/* Video-Seite: Main ohne Seitenabstand, Player füllt den Viewport-Bereich. */
.app-main:has(.page-fikfap-video.is-active),
.app-main:has(.page-bunny-video.is-active) {
  width: 100%;
  max-width: none;
  padding: 0;
  gap: 0;
}

/* FikFap Live-/Feed-Player: globale Topbar ausblenden (Fullscreen). */
.app:has([data-page="fikfap-video-player"].is-active) .menu-top-bar,
.app:has([data-page="fikfap-feed"].is-active) .menu-top-bar {
  display: none;
}

/* Mobile Swipe: Browser soll vertikale Gesten nicht scrollen/abfangen. */
[data-page="fikfap-video-player"] .fikfap-video-body,
[data-page="fikfap-video-player"] .fikfap-video-frame,
[data-page="fikfap-video-player"] .fikfap-video-player-host,
[data-page="fikfap-video-player"] .video-player,
[data-page="fikfap-video-player"] .video-player__element,
[data-page="fikfap-feed"] .fikfap-video-body,
[data-page="fikfap-feed"] .fikfap-video-frame,
[data-page="fikfap-feed"] .fikfap-video-player-host,
[data-page="fikfap-feed"] .video-player,
[data-page="fikfap-feed"] .video-player__element {
  touch-action: none;
  overscroll-behavior: none;
  user-select: none;
  -webkit-user-select: none;
}

/* Live-/Feed-Player: keine Player-Steuerung (Swipe-only). */
[data-page="fikfap-video-player"] .video-player__controls,
[data-page="fikfap-feed"] .video-player__controls {
  display: none !important;
}

.fikfap-video-chrome {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  pointer-events: none;
  padding: 12px 12px 40px;
  background: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.72) 0%,
    rgba(0, 0, 0, 0.35) 55%,
    rgba(0, 0, 0, 0) 100%
  );
}

.fikfap-video-chrome__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  pointer-events: none;
}

.fikfap-video-chrome__bar .btn-icon {
  pointer-events: auto;
  flex-shrink: 0;
  background: rgba(18, 18, 18, 0.72);
  border-color: rgba(255, 255, 255, 0.16);
}

.fikfap-video-chrome__identity {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  min-width: 0;
  max-width: calc(100% - 56px);
  pointer-events: none;
}

.fikfap-video-chrome__text {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  text-align: right;
  order: 1;
}

.fikfap-video-chrome__title-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  min-width: 0;
  max-width: 100%;
}

.fikfap-video-chrome__text h2 {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  color: var(--text);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.55);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.fikfap-video-quality {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  padding: 2px 6px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 4px;
  background: rgba(18, 18, 18, 0.78);
  color: #cccccc;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.fikfap-video-quality[hidden] {
  display: none !important;
}

.fikfap-video-avatar-host {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  order: 2;
}

.fikfap-video-avatar {
  display: block;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  background: var(--bg-surface);
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.fikfap-video-avatar-empty {
  display: block;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.fikfap-video-hint {
  margin: 0;
  color: rgba(255, 255, 255, 0.78);
  font-size: 12px;
  line-height: 1.2;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.55);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

/* Hashtag-Badge im Live-/Feed-Player (unten links). */
.fikfap-feed-hashtag-badge {
  position: absolute;
  left: 12px;
  bottom: 12px;
  z-index: 20;
  display: inline-flex;
  align-items: center;
  max-width: min(70%, 16rem);
  padding: 4px 8px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 4px;
  background: rgba(18, 18, 18, 0.78);
  color: #cccccc;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: 0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
}

.fikfap-feed-hashtag-badge[hidden] {
  display: none !important;
}

.fikfap-video-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  background: #000;
  container-type: size;
}

/* Frame = sichtbare Videofläche; Chrome liegt exakt darauf. */
.fikfap-video-frame {
  --player-ar-w: 9;
  --player-ar-h: 16;
  position: relative;
  flex: 0 0 auto;
  width: min(100cqw, calc(100cqh * var(--player-ar-w) / var(--player-ar-h)));
  height: min(100cqh, calc(100cqw * var(--player-ar-h) / var(--player-ar-w)));
  max-width: 100%;
  max-height: 100%;
  overflow: hidden;
  background: #000;
}

.bunny-video-like-btn {
  appearance: none;
  position: absolute;
  right: 14px;
  bottom: 78px;
  z-index: 12;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  margin: 0;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 50%;
  background: rgba(18, 18, 18, 0.72);
  color: #ffffff;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
  transition: background 0.12s ease, color 0.12s ease, transform 0.12s ease, border-color 0.12s ease;
  touch-action: manipulation;
}

.bunny-video-like-btn svg {
  width: 22px;
  height: 22px;
  display: block;
  pointer-events: none;
}

.bunny-video-like-btn:hover:not(:disabled) {
  background: rgba(30, 30, 30, 0.88);
  border-color: rgba(255, 255, 255, 0.28);
}

.bunny-video-like-btn:active:not(:disabled) {
  transform: scale(0.96);
}

.bunny-video-like-btn:disabled {
  opacity: 0.55;
  cursor: wait;
}

.bunny-video-like-btn.is-liked {
  color: #ef5350;
  border-color: rgba(239, 83, 80, 0.45);
  background: rgba(18, 18, 18, 0.82);
}

.fikfap-video-player-host {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 0;
  display: flex;
  align-items: stretch;
  justify-content: stretch;
}

/* Chrome liegt im Player-Host über dem Video (nicht als Frame-Sibling). */
.fikfap-video-player-host > .fikfap-video-chrome {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  pointer-events: none;
}

/* Multi-Slot Warm-Pool: inaktive Slots bleiben im DOM (Buffer), nur unsichtbar. */
.fikfap-live-pool {
  position: relative;
  flex: 1 1 auto;
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  background: #000;
  z-index: 1;
}

.fikfap-live-pool__slot {
  position: absolute;
  inset: 0;
  z-index: 1;
  visibility: hidden;
  pointer-events: none;
}

.fikfap-live-pool__slot.is-active {
  z-index: 2;
  visibility: visible;
  pointer-events: auto;
}

.fikfap-live-pool__status {
  position: absolute;
  left: 16px;
  right: 16px;
  top: 50%;
  z-index: 5;
  transform: translateY(-50%);
}

.video-player {
  --player-ar-w: 9;
  --player-ar-h: 16;
  position: relative;
  flex: 1 1 auto;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  border: none;
  border-radius: 0;
  overflow: hidden;
  background: #000;
}

.video-player__element {
  display: block;
  width: 100%;
  height: 100%;
  max-height: none;
  aspect-ratio: auto;
  object-fit: contain;
  background: #000;
  vertical-align: middle;
}

.video-player__controls {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 28px 12px calc(12px + var(--safe-bottom));
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.82) 0%,
    rgba(0, 0, 0, 0.45) 45%,
    rgba(0, 0, 0, 0) 100%
  );
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.video-player.is-controls-visible .video-player__controls,
.video-player:not(.is-playing) .video-player__controls {
  opacity: 1;
  pointer-events: auto;
}

.video-player__scrub {
  display: flex;
  align-items: center;
  min-height: 16px;
}

.video-player__bar {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
}

.video-player__spacer {
  flex: 1;
  min-width: 8px;
}

.video-player__btn {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: rgba(255, 255, 255, 0.92);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.video-player__btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.video-player__btn.is-active {
  color: #fff;
}

.video-player__btn svg {
  width: 18px;
  height: 18px;
}

.video-player__progress {
  --player-progress: 0%;
  width: 100%;
  height: 3px;
  margin: 0;
  appearance: none;
  -webkit-appearance: none;
  background: linear-gradient(
    to right,
    #ffffff 0%,
    #ffffff var(--player-progress),
    rgba(255, 255, 255, 0.28) var(--player-progress),
    rgba(255, 255, 255, 0.28) 100%
  );
  border-radius: 999px;
  cursor: pointer;
  transition: height 0.12s ease;
}

.video-player__scrub:hover .video-player__progress {
  height: 5px;
}

.video-player__progress::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 11px;
  height: 11px;
  margin-top: -4px;
  border-radius: 50%;
  background: #fff;
  border: none;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.35);
  opacity: 0;
  transition: opacity 0.12s ease;
}

.video-player__scrub:hover .video-player__progress::-webkit-slider-thumb,
.video-player__progress:active::-webkit-slider-thumb {
  opacity: 1;
}

.video-player__progress::-moz-range-thumb {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #fff;
  border: none;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.35);
  opacity: 0;
  transition: opacity 0.12s ease;
}

.video-player__scrub:hover .video-player__progress::-moz-range-thumb,
.video-player__progress:active::-moz-range-thumb {
  opacity: 1;
}

.video-player__progress::-webkit-slider-runnable-track {
  height: 3px;
  background: transparent;
  border: none;
}

.video-player__progress::-moz-range-track {
  height: 3px;
  background: transparent;
  border: none;
}

.video-player__time {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: 2px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 12px;
  line-height: 1;
  letter-spacing: 0.01em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  user-select: none;
}

.video-player__time-sep {
  opacity: 0.45;
}

.video-player__error,
.fikfap-video-player-host .error-box,
.fikfap-video-player-host .empty-box {
  margin: auto;
  max-width: 28rem;
  padding: 16px;
}

.video-tile__media {
  position: relative;
  width: 100%;
  aspect-ratio: 9 / 16;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-surface);
  border: 1px solid var(--border);
}

.video-tile__thumb-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
  -webkit-user-drag: none;
  user-select: none;
  -webkit-touch-callout: none;
}

.video-tile__fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  padding: 12px;
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
}

.video-tile__status {
  position: absolute;
  left: 6px;
  bottom: 6px;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  max-width: calc(100% - 12px);
  min-height: 22px;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.28);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  background: rgba(20, 24, 32, 0.82);
  color: #ffffff;
}

.video-tile__status--stored {
  background: rgba(0, 196, 180, 0.92);
}

.video-tile__status--downloading,
.video-tile__status--uploading,
.video-tile__status--encoding,
.video-tile__status--registering {
  background: rgba(61, 90, 254, 0.92);
}

.video-tile__status--error {
  background: rgba(198, 40, 40, 0.92);
}

.video-tile__avatar-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 2;
  max-width: calc(100% - 16px);
  padding: 5px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  background: rgba(0, 196, 180, 0.92);
  color: #ffffff;
}

.video-tile--avatar-source .video-tile__media {
  outline: 2px solid #00c4b4;
  outline-offset: 2px;
}

.video-tile__menu {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 4;
}

.video-tile__menu-trigger {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 6px;
  background: rgba(20, 24, 32, 0.82);
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s ease, background 0.15s ease;
}

@media (hover: hover) and (pointer: fine) {
  .video-tile:hover .video-tile__menu-trigger {
    opacity: 1;
  }
}

.video-tile__menu--open .video-tile__menu-trigger {
  opacity: 1;
}

.video-tile__menu-trigger:hover,
.video-tile__menu--open .video-tile__menu-trigger {
  background: rgba(20, 24, 32, 0.94);
}

.video-tile__menu-icon {
  display: block;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 -5px 0 #ffffff, 0 5px 0 #ffffff;
}

.video-tile__menu-panel {
  min-width: 168px;
  padding: 6px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: var(--bg-elevated);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.video-tile__menu-panel--floating {
  position: fixed;
  z-index: 1100;
}

/* Mobile: App-Action-Sheet von unten */
.video-tile__menu-sheet-root {
  position: fixed;
  inset: 0;
  z-index: 1100;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.video-tile__menu-backdrop {
  position: absolute;
  inset: 0;
  margin: 0;
  padding: 0;
  border: 0;
  background: rgba(0, 0, 0, 0.64);
  cursor: pointer;
}

.video-tile__menu-panel--sheet {
  position: relative;
  z-index: 1;
  width: 100%;
  min-width: 0;
  max-width: none;
  margin: 0;
  padding: 8px 12px calc(14px + var(--safe-bottom));
  border: 1px solid var(--border-strong);
  border-bottom: 0;
  border-radius: 16px 16px 0 0;
  background: var(--bg-elevated);
  box-shadow: 0 -16px 48px rgba(0, 0, 0, 0.5);
}

.video-tile__menu-sheet-handle {
  width: 40px;
  height: 4px;
  margin: 4px auto 14px;
  border-radius: 2px;
  background: var(--border-strong);
}

.video-tile__menu-panel--sheet .video-tile__menu-item {
  min-height: 52px;
  padding: 14px 16px;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.3;
}

.video-tile__menu-panel--sheet .video-tile__menu-item + .video-tile__menu-item {
  margin-top: 4px;
}

.video-tile__menu-panel--sheet .video-tile__menu-item:active:not(:disabled) {
  background: rgba(255, 255, 255, 0.1);
}

body.video-tile-menu-open {
  overflow: hidden;
}

.video-tile__menu-item {
  display: block;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #ffffff;
  font-size: 13px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
}

.video-tile__menu-item:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.08);
}

.video-tile__menu-item:disabled {
  opacity: 0.55;
  cursor: default;
}

.video-tile__meta {
  min-width: 0;
}

.video-tile__title,
.video-tile__post-id {
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.video-tile__title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.video-tile__post-id {
  margin-top: 2px;
  font-size: 11px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

@media (max-width: 640px) {
  .video-grid {
    --video-grid-min: 110px;
    --video-grid-gap: 10px;
  }
}


.service-main {
  min-width: 0;
}

.service-name {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1.2;
}

.service-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 8px;
  margin: 3px 0 0;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.25;
}

.service-meta-sep {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--border-strong);
  flex-shrink: 0;
}

.service-stat {
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.service-stat.is-empty {
  color: var(--text-muted);
}

.service-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-shrink: 0;
}

.actions {
  display: inline-flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 6px;
}

.btn-icon {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  min-width: 40px;
  min-height: 40px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-secondary);
  cursor: pointer;
  transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease;
  touch-action: manipulation;
}

.btn-icon svg {
  display: block;
  pointer-events: none;
}

.btn-icon:disabled {
  opacity: 0.28;
  color: var(--text-muted);
  cursor: not-allowed;
}

.btn-icon-start:hover:not(:disabled) {
  color: var(--ok);
  border-color: rgba(0, 196, 180, 0.45);
  background: rgba(0, 196, 180, 0.1);
}

.btn-icon-stop:hover:not(:disabled) {
  color: var(--danger-soft);
  border-color: rgba(198, 40, 40, 0.55);
  background: rgba(198, 40, 40, 0.12);
}

.btn-icon-restart:hover:not(:disabled) {
  color: var(--text);
  border-color: var(--border-strong);
  background: rgba(255, 255, 255, 0.06);
}

.btn-icon-download:hover:not(:disabled) {
  color: var(--accent);
  border-color: rgba(61, 90, 254, 0.5);
  background: rgba(61, 90, 254, 0.12);
}

.btn-icon-delete:hover:not(:disabled) {
  color: var(--danger-soft);
  border-color: rgba(198, 40, 40, 0.55);
  background: rgba(198, 40, 40, 0.12);
}

.status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 8px;
  height: 8px;
  min-width: 8px;
  min-height: 8px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: var(--text-muted);
  flex-shrink: 0;
}

.status-badge.is-running {
  background: var(--ok);
}

.status-badge.is-stopped {
  background: var(--border-strong);
}

.status-badge.is-busy {
  background: var(--accent);
}

.btn {
  appearance: none;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  min-height: 40px;
  min-width: 84px;
  padding: 8px 12px;
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  color: var(--text);
  background: #252525;
  transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease;
  touch-action: manipulation;
}

.btn:disabled {
  opacity: 0.38;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--accent);
}

.btn-primary:hover:not(:disabled) {
  background: var(--accent-hover);
}

.btn-secondary {
  background: transparent;
  border-color: var(--border-strong);
  color: var(--text-secondary);
}

.btn-secondary:hover:not(:disabled) {
  border-color: #555;
  color: var(--text);
}

.btn-danger {
  background: transparent;
  border-color: rgba(198, 40, 40, 0.7);
  color: var(--danger-soft);
}

.btn-danger:hover:not(:disabled) {
  background: var(--danger);
  border-color: var(--danger);
  color: var(--text);
}

.confirm-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(16px, var(--safe-top)) max(16px, var(--safe-right)) max(16px, var(--safe-bottom)) max(16px, var(--safe-left));
  background: rgba(0, 0, 0, 0.72);
}

.confirm-overlay[hidden] {
  display: none !important;
}

body.confirm-open {
  overflow: hidden;
}

.confirm-dialog {
  width: min(400px, 100%);
  padding: 22px 22px 18px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.45);
}

.confirm-title {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.confirm-message {
  margin: 10px 0 0;
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.5;
}

.confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 22px;
}

.confirm-actions .btn {
  min-width: 96px;
}

.error-box,
.empty-box {
  margin: 0;
  padding: 16px;
  border-radius: var(--radius);
  font-size: 14px;
}

.error-box {
  border: 1px solid rgba(198, 40, 40, 0.7);
  color: var(--danger-soft);
  background: #161010;
}

.empty-box {
  border: 1px dashed var(--border);
  color: var(--text-muted);
  text-align: center;
}

.mobile-only {
  display: none !important;
}

.desktop-only {
  display: block;
}

.desktop-only.status-badge,
span.desktop-only {
  display: inline-flex;
}

/* Installierte PWA / Standalone */
@media (display-mode: standalone) {
  .menu-top-bar {
    background: var(--bg-elevated);
  }
}

@media (max-width: 960px) {
  .monitor-grid,
  .info-grid {
    grid-template-columns: 1fr;
  }

  .metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .metric {
    border-left: 1px solid var(--border);
  }

  .metric:nth-child(3n + 1) {
    border-left: none;
  }

  .metric:nth-child(n + 4) {
    border-top: 1px solid var(--border);
  }

  .service-row {
    gap: 10px;
    padding: 12px 14px;
  }
}

@media (max-width: 640px) {
  .menu-brand__emblem {
    width: 30px;
    height: 30px;
    font-size: 14px;
  }

  .menu-brand__text {
    font-size: 14px;
  }

  .menu-dropdown {
    max-width: min(100%, 12.5rem);
  }

  .menu-dropdown__toggle {
    min-height: 32px;
    padding: 5px 8px 5px 10px;
    font-size: 12px;
  }

  .menu-dropdown__panel {
    min-width: 12.5rem;
    width: max(100%, 12.5rem);
  }

  .app-main {
    padding-top: 16px;
    gap: 12px;
  }

  .metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .metric {
    border-left: 1px solid var(--border);
  }

  .metric:nth-child(2n + 1) {
    border-left: none;
  }

  .metric:nth-child(n + 3) {
    border-top: 1px solid var(--border);
  }
}

/* Process-Seite (aktive Downloads) */
.page-process {
  overflow: auto;
}

.process-page__inner {
  width: min(960px, 100%);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.process-page__header {
  margin-bottom: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.process-page__header-copy {
  min-width: 0;
}

.process-page__header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.process-page__simulation,
.process-page__auto-download {
  width: 36px;
  height: 36px;
  min-width: 36px;
  min-height: 36px;
}

.process-page__simulation--active {
  border-color: var(--accent);
  background: rgba(61, 90, 254, 0.16);
  color: var(--accent-hover);
}

.process-page__auto-download--active {
  border-color: rgba(198, 40, 40, 0.55);
  background: rgba(198, 40, 40, 0.12);
  color: var(--danger-soft);
}

.process-page__state {
  margin: 0;
  padding: 20px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-surface);
  color: var(--text-muted);
  font-size: 14px;
}

.process-page__state--error {
  color: var(--danger-soft);
  border-color: rgba(198, 40, 40, 0.35);
}

.process-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.process-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-surface);
  overflow: hidden;
}

.process-card--expanded {
  border-color: var(--border-strong);
}

.process-card--coordinator {
  border-color: rgba(61, 90, 254, 0.35);
}

.process-card--simulation {
  border-color: rgba(61, 90, 254, 0.45);
}

.process-card__body {
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.process-card__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: nowrap;
}

.process-card__lead {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-width: 0;
  flex: 1 1 auto;
}

.process-card__avatar {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--bg-hover);
  flex-shrink: 0;
}

.process-card__avatar-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.process-card__avatar-fallback {
  display: block;
  width: 100%;
  height: 100%;
  background: var(--bg-hover);
}

.process-card__identity {
  min-width: 0;
}

.process-card__username {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
}

button.process-card__username--link {
  display: inline;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: inherit;
  text-align: left;
  cursor: pointer;
}

button.process-card__username--link:hover {
  color: var(--accent);
}

.process-card__meta {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.35;
}

.process-card__summary {
  margin: 6px 0 0;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--text-secondary);
}

.process-card__actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  margin-left: auto;
}

.process-card__expand,
.process-card__stop {
  width: 32px;
  height: 32px;
  min-width: 32px;
  min-height: 32px;
}

.process-card__bar {
  height: 4px;
  margin-top: 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.process-card__bar-fill {
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  transition: width 0.2s ease;
}

.process-card__metrics {
  display: grid;
  grid-template-columns: minmax(110px, 140px) minmax(0, 1fr);
  gap: 8px 12px;
  width: 100%;
  min-width: 0;
  padding: 10px 0 0;
  margin-top: 8px;
}

.process-card__metrics-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.process-card__metrics-group-label {
  margin: 0;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
  line-height: 1.2;
}

.process-card__metrics-cells {
  display: grid;
  gap: 4px 6px;
  min-width: 0;
}

.process-card__metrics-cells--profile {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.process-card__metrics-cells--batch {
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.process-card__metric {
  min-width: 0;
  text-align: left;
  padding: 4px 6px;
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
}

.process-card__metric--active {
  background: rgba(61, 90, 254, 0.18);
}

.process-card__metric-value {
  margin: 0 0 1px;
  font-size: 13px;
  line-height: 1.2;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}

.process-card__metric--active .process-card__metric-value {
  color: var(--accent-hover);
}

.process-card__metric-label {
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.15;
  font-size: 9px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.process-card__videos {
  border-top: 1px solid var(--border);
  background: var(--bg-elevated);
  max-height: 320px;
  overflow: auto;
}

.process-card__videos-empty {
  margin: 0;
  padding: 14px 18px;
  font-size: 13px;
  color: var(--text-muted);
}

.process-card__video-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.process-card__video-item {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px 14px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
}

.process-card__video-item:last-child {
  border-bottom: 0;
}

.process-card__video-item--active {
  background: rgba(61, 90, 254, 0.08);
}

.process-card__video-item--failed {
  background: rgba(198, 40, 40, 0.08);
}

.process-card__video-thumb {
  width: 48px;
  height: 64px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--bg-hover);
  flex-shrink: 0;
}

.process-card__video-thumb-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: var(--bg-hover);
}

.process-card__video-thumb-fallback {
  width: 100%;
  height: 100%;
  background: var(--bg-hover);
}

.process-card__video-main {
  min-width: 0;
}

.process-card__video-id {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.process-card__video-title {
  margin: 2px 0 0;
  font-size: 12px;
  line-height: 1.3;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.process-card__video-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.process-card__video-status {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
}

.process-card__video-item--active .process-card__video-status {
  color: var(--accent-hover);
}

.process-card__video-progress {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.process-card__video-error {
  grid-column: 2 / -1;
  margin: 0;
  font-size: 12px;
  line-height: 1.35;
  color: var(--danger-soft);
}

@media (max-width: 900px) {
  .process-card__metrics {
    grid-template-columns: 1fr;
  }

  .process-card__metrics-cells--batch {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .process-card__header {
    flex-wrap: nowrap;
    align-items: flex-start;
  }

  .process-card__actions {
    width: auto;
    justify-content: flex-end;
  }

  .process-card__metrics-cells--batch {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .process-card__video-item {
    grid-template-columns: 44px minmax(0, 1fr);
    gap: 8px 12px;
  }

  .process-card__video-thumb {
    width: 44px;
    height: 58px;
  }

  .process-card__video-meta {
    grid-column: 2;
    justify-content: flex-start;
  }

  .process-card__video-error {
    grid-column: 2;
  }
}

/* —— Einstellungen (analog Dashboard, Dark-Theme) —— */
.settings-page {
  width: 100%;
  max-width: 920px;
}

.settings-page__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.settings-page__title {
  margin: 0 0 6px;
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
}

.settings-page__subtitle {
  margin: 0;
  max-width: 720px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-muted);
}

.settings-page__status {
  flex-shrink: 0;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  background: rgba(61, 90, 254, 0.14);
  color: var(--accent-hover);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.settings-page__state {
  margin: 0 0 16px;
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-surface);
  color: var(--text-muted);
  font-size: 14px;
}

.settings-page__state--error {
  color: var(--danger-soft);
  background: rgba(198, 40, 40, 0.1);
  border-color: rgba(198, 40, 40, 0.35);
}

.settings-page__notice {
  margin: 0 0 16px;
  padding: 12px 16px;
  border: 1px solid rgba(0, 196, 180, 0.35);
  border-radius: var(--radius);
  background: rgba(0, 196, 180, 0.1);
  color: var(--ok);
  font-size: 13px;
  font-weight: 600;
}

.settings-panel {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-surface);
  overflow: hidden;
}

.settings-panel__section-head {
  display: grid;
  grid-template-columns: minmax(180px, 240px) minmax(0, 1fr);
  gap: 32px;
  align-items: center;
  padding: 20px 28px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-elevated);
}

.settings-panel__section-lead {
  min-width: 0;
}

.settings-panel__title {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.settings-panel__description {
  margin: 0;
  font-size: 13px;
  line-height: 1.55;
  color: var(--text-muted);
}

.settings-panel__rows {
  display: flex;
  flex-direction: column;
}

.settings-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(200px, 320px);
  gap: 40px;
  align-items: center;
  padding: 20px 28px;
}

.settings-row + .settings-row {
  border-top: 1px solid var(--border);
}

.settings-row__meta {
  min-width: 0;
}

.settings-row__label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
}

.settings-row__hint {
  margin: 6px 0 0;
  font-size: 12px;
  line-height: 1.45;
  color: var(--text-muted);
}

.settings-row__control {
  display: flex;
  justify-content: flex-end;
}

.settings-row__input {
  width: 100%;
  max-width: 320px;
  height: 44px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.settings-row__input:disabled {
  background: var(--bg-hover);
  color: var(--text-muted);
}

.settings-panel__error {
  margin: 0;
  padding: 12px 22px;
  border-top: 1px solid rgba(198, 40, 40, 0.3);
  background: rgba(198, 40, 40, 0.1);
  color: var(--danger-soft);
  font-size: 13px;
}

.settings-panel__footer {
  display: flex;
  justify-content: flex-end;
  padding: 16px 28px;
  border-top: 1px solid var(--border);
  background: var(--bg-elevated);
}

.settings-panel__submit {
  min-width: 140px;
  height: 40px;
  padding: 0 18px;
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: #ffffff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.settings-panel__submit:hover:not(:disabled) {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

.settings-panel__submit:disabled {
  border-color: var(--border);
  background: var(--bg-hover);
  color: var(--text-muted);
  cursor: not-allowed;
}

@media (max-width: 760px) {
  .settings-page__header {
    flex-direction: column;
    align-items: stretch;
  }

  .settings-panel__section-head {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 18px 16px;
  }

  .settings-row {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 18px 16px;
  }

  .settings-row__control {
    justify-content: stretch;
  }

  .settings-row__input {
    max-width: none;
    text-align: left;
  }

  .settings-panel__footer {
    justify-content: stretch;
    padding: 14px 16px;
  }

  .settings-panel__submit {
    width: 100%;
  }
}
