/*
 * المشاركة الفورية — /instant/
 *
 * ألوانُ هوية المتجر (بنفسجي على أسود) بنفس رموز صفحة الريموت. والنصف الثاني
 * من الملف يكسو عناصرَ عميل VRCast (`ui.js`) بأسماء أصنافها كما يولّدها:
 * أنماطُ المصدر الأصلية (أخضر على أسود، ومحدّدات عامّة على `body` و`button`)
 * لا تُحمَّل هنا أصلاً.
 */
:root {
  --ic-bg: #08060d;
  --ic-panel: #120e1c;
  --ic-panel-2: #181128;
  --ic-line: #241a3a;
  --ic-ink: #efeaf8;
  --ic-dim: #9b8fb5;
  --ic-brand: #7c4dff;
  --ic-brand-2: #a17bff;
  --ic-ok: #27c07a;
  --ic-warn: #f0a83c;
  --ic-bad: #e2544a;
  --ic-radius: 14px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--ic-bg);
  color: var(--ic-ink);
  font-family: "Segoe UI", Tahoma, system-ui, sans-serif;
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
}
body {
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(124, 77, 255, .22), transparent 70%),
    var(--ic-bg);
}
a { color: var(--ic-brand-2); }
code { font-family: ui-monospace, Consolas, monospace; font-size: .92em;
       background: var(--ic-line); padding: 1px 6px; border-radius: 6px; }
button, input, select { font: inherit; color: inherit; }

.ic-app {
  max-width: 1040px;
  margin: 0 auto;
  padding: 14px 16px 48px;
}

/* ---------------------------------------------------------------- الترويسة */
.ic-top {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 6px 0 14px;
}
.ic-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ic-ink);
  text-decoration: none;
  min-width: 0;
}
.ic-brand img { width: 36px; height: 36px; border-radius: 50%; background: #fff; }
.ic-brand-name { font-weight: 800; font-size: 18px; white-space: nowrap; }
.ic-spacer { flex: 1; }
.ic-pill {
  font-size: 12px;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid rgba(124, 77, 255, .6);
  color: var(--ic-brand-2);
  white-space: nowrap;
}
.ic-pill--bolt::before { content: "⚡"; margin-inline-end: 4px; }
.ic-who {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 220px;
  font-size: 14px;
  color: var(--ic-dim);
}
.ic-who-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ic-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .5px;
  padding: 2px 7px;
  border-radius: 6px;
  background: linear-gradient(135deg, #b48cff, #7c4dff);
  color: #fff;
  direction: ltr;
}
.ic-badge--world { background: var(--ic-line); color: var(--ic-ink); }
.ic-back {
  font-size: 14px;
  color: var(--ic-dim);
  text-decoration: none;
  padding: 7px 12px;
  border: 1px solid var(--ic-line);
  border-radius: 10px;
  white-space: nowrap;
}
.ic-back::after { content: " ←"; }
.ic-back:hover { color: var(--ic-ink); border-color: var(--ic-brand); }
.ic-live {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  background: rgba(226, 84, 74, .18);
  border: 1px solid rgba(226, 84, 74, .6);
  padding: 3px 10px;
  border-radius: 999px;
}
.ic-live i {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--ic-bad);
  animation: ic-pulse 1.2s ease-in-out infinite;
}
@keyframes ic-pulse { 50% { opacity: .3; } }

/* ---------------------------------------------------------------- الشرائط */
.ic-banner {
  margin: 0 0 14px;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid rgba(240, 168, 60, .55);
  background: rgba(240, 168, 60, .1);
  color: #f5d39b;
  font-size: 14px;
}
.ic-banner--bad { border-color: rgba(226, 84, 74, .6); background: rgba(226, 84, 74, .1); color: #ffb4ad; }
.ic-banner--ok { border-color: rgba(39, 192, 122, .5); background: rgba(39, 192, 122, .1); color: #9ff0c8; }

/* ---------------------------------------------------------------- الأقسام */
.ic-tabs {
  display: flex;
  gap: 6px;
  padding: 5px;
  margin: 0 0 18px;
  background: var(--ic-panel);
  border: 1px solid var(--ic-line);
  border-radius: 12px;
  width: max-content;
  max-width: 100%;
}
.ic-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: 9px;
  color: var(--ic-dim);
  text-decoration: none;
  font-weight: 700;
  white-space: nowrap;
}
.ic-tab:hover { color: var(--ic-ink); }
body[data-view="pro"] .ic-tab[data-view-link="pro"],
body[data-view="worlds"] .ic-tab[data-view-link="worlds"] {
  background: var(--ic-brand);
  color: #fff;
}
body[data-view="pro"] .ic-tab[data-view-link="pro"] .ic-badge { background: #fff; color: var(--ic-brand); }
body[data-view="home"] .ic-tabs { display: none; }

.ic-pane { display: none; }
body[data-view="home"] .ic-pane[data-pane="home"],
body[data-view="pro"] .ic-pane[data-pane="pro"],
body[data-view="worlds"] .ic-pane[data-pane="worlds"] { display: block; }

/* ---------------------------------------------------------------- الرئيسية */
.ic-hero { text-align: center; margin: 22px auto 26px; max-width: 680px; }
.ic-hero h1 { margin: 0 0 8px; font-size: clamp(26px, 5vw, 38px); }
.ic-hero p { margin: 0; color: var(--ic-dim); font-size: 16px; }

.ic-branches {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
}
.ic-branch {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 20px;
  border-radius: var(--ic-radius);
  background: var(--ic-panel);
  border: 1px solid var(--ic-line);
  color: var(--ic-ink);
  text-decoration: none;
  transition: border-color .15s, transform .15s;
}
.ic-branch:hover, .ic-branch:focus-visible { border-color: var(--ic-brand); transform: translateY(-2px); outline: 0; }
.ic-branch--pro {
  border-color: rgba(124, 77, 255, .55);
  background: linear-gradient(140deg, rgba(124, 77, 255, .24), rgba(18, 14, 28, 1) 60%);
}
.ic-branch-ico {
  flex: 0 0 52px;
  height: 52px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--ic-line);
  color: var(--ic-brand-2);
}
.ic-branch--pro .ic-branch-ico { background: var(--ic-brand); color: #fff; }
.ic-branch-ico svg { width: 26px; height: 26px; }
.ic-branch-body { flex: 1; min-width: 0; }
.ic-branch-body b { display: block; font-size: 19px; }
.ic-branch-body small { display: block; color: var(--ic-dim); font-size: 14px; margin: 2px 0 10px; }
.ic-branch-list { display: flex; flex-wrap: wrap; gap: 6px; }
.ic-branch-list span {
  font-size: 12.5px;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .05);
  border: 1px solid var(--ic-line);
}
.ic-branch-go { font-size: 22px; color: var(--ic-dim); align-self: center; }

.ic-steps {
  list-style: none;
  counter-reset: s;
  padding: 0;
  margin: 26px 0 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}
.ic-steps li {
  counter-increment: s;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px dashed var(--ic-line);
}
.ic-steps li::before {
  content: counter(s);
  display: inline-flex;
  width: 26px; height: 26px;
  align-items: center; justify-content: center;
  border-radius: 50%;
  background: var(--ic-line);
  color: var(--ic-brand-2);
  font-weight: 800;
  margin-inline-end: 8px;
}
.ic-steps b { font-size: 15px; }
.ic-steps span { display: block; color: var(--ic-dim); font-size: 13.5px; margin-top: 4px; }

/* ---------------------------------------------------------------- رأس القسم */
.ic-section-head { margin: 0 0 16px; }
.ic-section-head h2 { margin: 0 0 4px; font-size: 24px; display: flex; align-items: center; gap: 8px; }
.ic-section-head p { margin: 0; color: var(--ic-dim); }

/* ---------------------------------------------------------------- مقارنة برو */
.ic-compare {
  border: 1px solid var(--ic-line);
  border-radius: var(--ic-radius);
  overflow: hidden;
  margin: 0 0 14px;
  background: var(--ic-panel);
}
.ic-compare-row {
  display: grid;
  grid-template-columns: 1.1fr 1fr 1.2fr;
  gap: 8px;
  padding: 10px 14px;
  border-top: 1px solid var(--ic-line);
  font-size: 14px;
}
.ic-compare-row:first-child { border-top: 0; }
.ic-compare-row > span:first-child { color: var(--ic-dim); }
.ic-compare-head { font-weight: 700; background: var(--ic-panel-2); }
.ic-col-pro { color: #d9c8ff; font-weight: 700; }

.ic-presets {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 0 0 16px;
}
.ic-presets-title { color: var(--ic-dim); font-size: 13px; margin-inline-end: 4px; }
.ic-preset {
  font-size: 12.5px;
  padding: 4px 10px;
  border-radius: 8px;
  background: var(--ic-panel);
  border: 1px solid var(--ic-line);
  direction: rtl;
}
.ic-preset em { font-style: normal; font-size: 10px; font-weight: 800; color: var(--ic-brand-2); }
.ic-preset.is-locked { opacity: .55; }
.ic-preset.is-locked::before { content: "🔒 "; }

/* ---------------------------------------------------------------- الرابط الثابت */
.ic-perma {
  margin: 0 0 16px;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid rgba(124, 77, 255, .45);
  background: rgba(124, 77, 255, .08);
}
.ic-switch { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; }
.ic-switch input { position: absolute; opacity: 0; pointer-events: none; }
.ic-switch-ui {
  flex: 0 0 44px;
  height: 24px;
  border-radius: 999px;
  background: var(--ic-line);
  position: relative;
  transition: background .15s;
  margin-top: 2px;
}
.ic-switch-ui::after {
  content: "";
  position: absolute;
  top: 3px;
  right: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  transition: transform .15s;
}
.ic-switch input:checked + .ic-switch-ui { background: var(--ic-brand); }
.ic-switch input:checked + .ic-switch-ui::after { transform: translateX(-20px); }
.ic-switch input:focus-visible + .ic-switch-ui { outline: 2px solid var(--ic-brand-2); outline-offset: 2px; }
.ic-switch input:disabled + .ic-switch-ui { opacity: .5; }
.ic-switch-text b { display: block; }
.ic-switch-text small { display: block; color: var(--ic-dim); font-size: 13px; }

/* ---------------------------------------------------------------- البوابات */
.ic-gate {
  text-align: center;
  padding: 26px 18px;
  border-radius: var(--ic-radius);
  border: 1px solid var(--ic-line);
  background: var(--ic-panel);
  margin: 0 0 18px;
}
.ic-gate h3 { margin: 0 0 6px; font-size: 20px; }
.ic-gate p { margin: 0 auto 14px; color: var(--ic-dim); max-width: 560px; }
.ic-gate--slim { padding: 16px; }
.ic-gate--slim p { margin-bottom: 10px; }
.ic-gate-acts { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.ic-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 10px 22px;
  border-radius: 10px;
  border: 1px solid var(--ic-brand);
  background: var(--ic-brand);
  color: #fff;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}
.ic-btn:hover { background: #8d63ff; }
.ic-btn--ghost { background: transparent; color: var(--ic-brand-2); }
.ic-btn--ghost:hover { background: rgba(124, 77, 255, .12); }
.ic-note {
  padding: 12px 16px;
  border-radius: 12px;
  background: var(--ic-panel);
  border: 1px solid var(--ic-line);
  margin: 0 0 16px;
}
.ic-dim { color: var(--ic-dim); }

/* ---------------------------------------------------------------- العوالم */
.ic-worlds {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
  margin: 0 0 18px;
}
.ic-worlds > p { grid-column: 1 / -1; margin: 0; }
.ic-world {
  border-radius: 12px;
  overflow: hidden;
  background: var(--ic-panel);
  border: 1px solid var(--ic-line);
}
.ic-world.is-mine { border-color: var(--ic-brand); box-shadow: 0 0 0 1px var(--ic-brand) inset; }
.ic-world-cover {
  aspect-ratio: 16 / 9;
  background: linear-gradient(135deg, #2a1a52, #120e1c);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ic-brand-2);
  font-size: 34px;
  font-weight: 800;
}
.ic-world-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ic-world-body { padding: 10px 12px 12px; }
.ic-world-body b { display: block; font-size: 15.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ic-world-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; font-size: 12px; color: var(--ic-dim); }
.ic-world-meta span { padding: 1px 8px; border-radius: 999px; background: var(--ic-line); }
.ic-world-meta .ic-ok { background: rgba(39, 192, 122, .16); color: #9ff0c8; }

.ic-howto {
  padding: 16px 18px;
  border-radius: var(--ic-radius);
  border: 1px solid var(--ic-line);
  background: var(--ic-panel);
}
.ic-howto h3 { margin: 0 0 8px; font-size: 17px; }
.ic-howto ol { margin: 0 0 8px; padding-inline-start: 20px; }
.ic-howto li { margin: 4px 0; }
.ic-howto p { margin: 0; font-size: 13.5px; }

/* =================================================================
 * لوحة البث: عناصر عميل VRCast
 * ================================================================= */
.ic-console {
  position: relative;
  padding: 16px;
  margin: 0 0 18px;
  border-radius: var(--ic-radius);
  background: var(--ic-panel);
  border: 1px solid var(--ic-line);
}
.ic-console-head { display: flex; align-items: center; gap: 10px; margin: 0 0 6px; }
.ic-console-head h3 { margin: 0; font-size: 17px; flex: 1; }
.ic-server-stats { margin: 0; font-size: 13px; color: var(--ic-dim); direction: rtl; }
.ic-engine-hidden { display: none !important; }

.ic-console button { background: none; border: 0; cursor: pointer; color: inherit; }
.ic-console button:disabled { cursor: default; opacity: .45; }
.ic-console select { background: var(--ic-bg); color: var(--ic-ink); border: 0; }
.ic-console option { background: var(--ic-panel); color: var(--ic-ink); }

/* اختيارٌ نصّيّ: قائمةٌ شفافة فوق نصّها المعروض */
.text-select {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  cursor: pointer;
  color: var(--ic-ink);
}
.text-select::before { content: "▾"; font-size: 12px; color: var(--ic-dim); pointer-events: none; }
.text-select-display { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; pointer-events: none; }
.text-select > select { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.text-select:has(> select:disabled) { opacity: .45; cursor: default; }

/* اختيار المصدر الأول */
.first-source-selection { position: relative; margin: 10px 0 0; }
.first-source-selection > h2,
.stream-panel > h2 { margin: 0 0 12px; font-size: 18px; text-align: center; }
.source-choices {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 10px;
}
.source-choice { position: relative; display: flex; flex-direction: column; min-width: 0; }
.source-choice > button {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 150px;
  padding: 16px 10px 14px;
  border-radius: 12px !important;
  border: 1px solid var(--ic-line) !important;
  background: var(--ic-bg) !important;
  transition: border-color .15s, transform .15s;
}
.source-choice > button:not(:disabled):hover { border-color: var(--ic-brand) !important; transform: translateY(-2px); }
.source-choice--main > button {
  border-color: rgba(124, 77, 255, .6) !important;
  background: linear-gradient(150deg, rgba(124, 77, 255, .26), var(--ic-bg) 70%) !important;
}
.source-choice img {
  width: 64px;
  height: 64px;
  object-fit: contain;
  /* أيقوناتُ المصدر بيضاء على شفاف: تُصبغ بلون الهوية. */
  filter: brightness(0) saturate(100%) invert(62%) sepia(48%) saturate(2400%) hue-rotate(222deg) brightness(102%);
}
.source-choice--main img { width: 76px; height: 76px; filter: brightness(0) invert(1); }
.source-choice > button > span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 2.6em;
  font-weight: 700;
  font-size: 14px;
  text-align: center;
}
.source-choice > button > span.is-select-placeholder { visibility: hidden; }
.source-choice > button.is-browser-disabled { cursor: not-allowed; opacity: .5; }
.experimental-splash {
  position: absolute;
  top: 10px;
  left: 10px;
  font-size: 11px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--ic-ok);
  color: #04130b;
  pointer-events: none;
}
.source-label-select-wrap {
  position: absolute;
  inset: auto 6px 10px 6px;
  justify-content: center;
  min-height: 2.6em;
  font-weight: 700;
  font-size: 14px;
}
.source-label-select-display { white-space: normal; text-align: center; }
.tab-audio-hint {
  display: none;
  margin: 10px 0 0;
  text-align: center;
  font-size: 13px;
  color: var(--ic-warn);
}
.tab-audio-hint.is-visible { display: block; }
.start-tip { margin: 14px auto 0; max-width: 560px; text-align: center; font-size: 13px; color: var(--ic-dim); }

/* لوح البث الجاري */
.stream-panel { position: relative; display: flex; flex-direction: column; gap: 10px; margin: 10px 0 0; }
.url-wrap { position: relative; }
.url-wrap input {
  width: 100%;
  height: 48px;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid rgba(124, 77, 255, .6);
  background: var(--ic-bg);
  color: #e8dcff;
  text-align: center;
  cursor: pointer;
  font-family: ui-monospace, Consolas, monospace;
}
.url-wrap input:hover, .url-wrap input:focus { outline: 0; border-color: var(--ic-brand-2); background: #0d0918; }
.link-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-size: 13px; }
.link-actions span { color: var(--ic-dim); }
#newLink { color: var(--ic-brand-2); font-size: 13px; text-decoration: underline; text-underline-offset: 3px; }
body.ic-perma-on #newLink { display: none; }

.stream-hint {
  display: none;
  position: fixed;
  z-index: 20;
  padding: 6px 10px;
  border-radius: 8px;
  background: #0d0918;
  border: 1px solid var(--ic-brand);
  color: var(--ic-ink);
  font-size: 12px;
  line-height: 1.45;
  white-space: pre-wrap;
  direction: ltr;
  text-align: left;
  width: max-content;
}
.stream-hint.is-visible { display: block; }

#sources { display: grid; gap: 10px; }
.add-sources { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; }
.add-sources:empty { display: none; }
.add-source-button {
  display: inline-flex !important;
  align-items: center;
  gap: 6px;
  padding: 7px 12px !important;
  border-radius: 9px;
  border: 1px solid var(--ic-line) !important;
  background: var(--ic-bg) !important;
  font-size: 13px;
  font-weight: 600;
}
.add-source-button:hover { border-color: var(--ic-brand) !important; }
.add-source-button img { width: 16px; height: 16px; filter: brightness(0) invert(1); }
.add-source-mic { display: inline-flex; }
.add-source-hidden-select { position: fixed; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
#stop {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 8px 18px !important;
  border-radius: 10px;
  border: 1px solid rgba(226, 84, 74, .6) !important;
  background: rgba(226, 84, 74, .12) !important;
  color: #ff8f86 !important;
  font-weight: 800;
}
#stop:hover { background: rgba(226, 84, 74, .22) !important; }

/* بطاقة المصدر */
.source-card {
  --card-fg: #d9c8ff;
  --card-soft: #6f56a8;
  --card-bg: #150f24;
  --card-icon-bg: #1e1534;
  position: relative;
  display: flex;
  min-width: 0;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--ic-line);
  color: var(--card-fg);
}
.source-card[data-source-kind="mic"] { --card-fg: #9fe6dc; --card-soft: #3f8a82; --card-bg: #0d1c1c; --card-icon-bg: #10282a; }
.source-card[data-source-kind="screen"] { --card-fg: #a9d2f6; --card-soft: #4c789b; --card-bg: #0d1522; --card-icon-bg: #112136; }
.source-icon {
  position: relative;
  flex: 0 0 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px !important;
  background: var(--card-icon-bg) !important;
}
.source-icon-img { display: block; width: 36px; height: 36px; background: var(--card-fg); transition: transform .12s; }
.source-icon:is(:hover, :focus-visible) .source-icon-img { transform: scale(1.08); }
.source-icon-hint {
  display: none;
  position: absolute;
  top: 50%;
  right: calc(100% + 6px);
  transform: translateY(-50%);
  z-index: 3;
  padding: 3px 8px;
  border-radius: 6px;
  background: #0d0918;
  border: 1px solid var(--card-soft);
  font-size: 12px;
  white-space: nowrap;
}
.source-icon:is(:hover, :focus-visible) .source-icon-hint { display: block; }
.source-card.is-muted .source-icon { background: #2a1214 !important; }
.source-card.is-muted .source-icon-img { background: var(--ic-bad); }
.source-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; padding: 10px; background: var(--card-bg); }
.source-head { display: flex; align-items: center; gap: 8px; min-width: 0; }
.source-head > .source-control, .source-head > .text-select { flex: 1; min-width: 0; }
.source-control { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: right; font-weight: 600; }
.source-remove { flex: 0 0 28px; font-size: 22px; line-height: 1; color: var(--card-soft) !important; }
.source-remove:hover { color: var(--card-fg) !important; }
.source-settings { display: flex; align-items: center; gap: 10px; }
.source-gain { flex: 1; display: flex; align-items: center; gap: 8px; min-width: 6rem; direction: ltr; }
.source-gain-meter {
  position: relative;
  flex: 1;
  height: 16px;
  min-width: 0;
  overflow: hidden;
  border-radius: 4px;
  background: #0a0712;
  border: 1px solid var(--card-soft);
}
.source-gain-meter::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--source-level, 0%);
  background: var(--card-fg);
  opacity: .8;
  transition: width .07s linear;
}
.source-gain-meter::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(90deg, transparent 0 68%, rgba(240, 168, 60, .3) 68% 85%, rgba(226, 84, 74, .4) 85%);
}
.source-gain-meter input[type=range] {
  -webkit-appearance: none;
  appearance: none;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  background: transparent;
  cursor: pointer;
}
.source-gain-meter input[type=range]::-webkit-slider-runnable-track { height: 16px; background: transparent; border: 0; }
.source-gain-meter input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 6px; height: 16px; background: #fff; border-radius: 2px; }
.source-gain-meter input[type=range]::-moz-range-track { height: 16px; background: transparent; border: 0; }
.source-gain-meter input[type=range]::-moz-range-thumb { width: 6px; height: 16px; background: #fff; border-radius: 2px; border: 0; }
.source-gain-value { min-width: 2.6rem; font-size: 12px; text-align: right; }
.source-mono { display: flex; align-items: center; gap: 4px; font-size: 13px; white-space: nowrap; }
.source-card input[type=checkbox] { accent-color: var(--ic-brand); width: 15px; height: 15px; }
.source-preview {
  display: block;
  width: 100%;
  aspect-ratio: var(--video-preview-aspect-ratio, 16 / 9);
  object-fit: contain;
  background: #000;
  border-radius: 8px;
  border: 1px solid var(--card-soft);
}

.stream-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding-top: 8px;
  border-top: 1px solid var(--ic-line);
  font-size: 13px;
}
.stream-selects { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; min-width: 0; }
.stream-select { max-width: 15rem; }
.stream-select-icon { width: 15px; height: 15px; filter: brightness(0) invert(1); opacity: .8; }
.stream-info-wrap { cursor: help; outline: 0; }
.stream-info { color: var(--ic-dim); direction: ltr; }

.ic-console-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px solid var(--ic-line);
  font-size: 12px;
}
.ic-console-foot a { color: var(--ic-dim); text-decoration: none; }
.ic-console-foot a:hover { color: var(--ic-ink); }
/* بلا رابط المحرّك (إخفاؤه من لوحة الإدارة): الفاصلُ كان بين المحرّك والسياسات فلا يسبق أولَ رابط.
   وإن غابت السياساتُ وبقي «الإبلاغ» وحده سقط فاصلُه أيضاً. `ui.js` يبدّل `hidden` فقط فلا يعارض هذا. */
.ic-foot--no-credit #policiesSeparator { display: none; }
.ic-foot--no-credit #policiesLink[hidden] + #reportAbuseSeparator { display: none; }

/* ---------------------------------------------------------------- الإشعار */
.ic-toast {
  position: fixed;
  inset: auto 16px 16px 16px;
  margin: 0 auto;
  max-width: 560px;
  z-index: 50;
  padding: 14px 16px;
  border-radius: 12px;
  background: #1b1030;
  border: 1px solid var(--ic-bad);
  box-shadow: 0 16px 50px rgba(0, 0, 0, .55);
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.ic-toast p { margin: 0; flex: 1; white-space: pre-line; font-size: 14px; }
.ic-toast small { display: block; color: var(--ic-dim); margin-top: 4px; direction: ltr; text-align: right; }
.ic-toast button {
  border: 0;
  background: transparent;
  color: var(--ic-dim);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

/* ---------------------------------------------------------------- الهاتف */
@media (max-width: 640px) {
  .ic-brand-name { font-size: 16px; }
  .ic-top .ic-pill { display: none; }
  .ic-who { max-width: 140px; }
  .ic-tabs { width: 100%; }
  .ic-tab { flex: 1; justify-content: center; padding: 9px 10px; }
  .source-choices { grid-template-columns: 1fr 1fr; }
  .source-choice--main { grid-column: 1 / -1; }
  .source-choice > button { min-height: 120px; }
  .ic-compare-row { grid-template-columns: 1fr 1fr 1fr; font-size: 13px; padding: 9px 10px; }
}
@media (prefers-reduced-motion: reduce) {
  .ic-live i { animation: none; }
  .ic-branch, .source-choice > button { transition: none; }
}
