/* ==========================================================================
   HUKAM ACE – Studio Engine Styling (Cyber-Luxury OLED Dark Architecture)
   ========================================================================== */

:root {
  /* High-end OLED Luxury Palette */
  --bg: #070507;
  --bg-2: #0e090c;
  --surface: #140d12;
  --surface-hi: #1c131a;
  --line: rgba(255, 255, 255, 0.08);
  --line-2: rgba(255, 255, 255, 0.16);
  --ink: #FBF7F9;
  --ink-2: #B39FA6;
  --ink-3: #756369;

  /* Rose & Neon Accents */
  --rose-50: #26161c;
  --rose-100: #3b1e28;
  --rose-300: #9e4362;
  --rose-500: #e04b7b;
  --pink: #FF3377;
  --pink-hi: #FF5C98;
  --pink-lo: #D91D5F;
  --on-pink: #FFF8FA;
  --cyan: #00F0FF;

  /* Status Colors */
  --ok: #00E599;
  --warn: #FFB300;
  --bad: #FF4D4D;

  /* Clay & Glass Physical Lighting */
  --clay-bg: #181016;
  --clay-hi: rgba(255, 255, 255, 0.12);
  --clay-lo: rgba(0, 0, 0, 0.65);
  --edge: rgba(0, 0, 0, 0.65);
  --drop: rgba(0, 0, 0, 0.85);

  --well: #090608;
  --well-in: rgba(0, 0, 0, 0.75);
  --well-hi: rgba(255, 255, 255, 0.06);

  --grain: .10;
  --focus: #FF3377;
  --scrim: rgba(4, 2, 5, 0.84);

  /* Typography */
  --f-display: 'Schibsted Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --f-body: 'Hanken Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --f-mono: 'DM Mono', ui-monospace, Menlo, Monaco, Consolas, monospace;
  --r-clay: 20px;
}

/* Enforce Dark Scheme Everywhere for High-End Video Production Terminal */
@media (prefers-color-scheme: dark) {
  :root { color-scheme: dark; }
}
:root[data-theme="dark"], :root {
  color-scheme: dark;
}

/* Reset & Box Sizing */
*, *::before, *::after {
  box-sizing: border-box;
}
[hidden], [hidden="true"], .login[hidden], .view[hidden], .sec-gate[hidden] {
  display: none !important;
  pointer-events: none !important;
}
html, body {
  height: 100%;
  margin: 0;
  padding: 0;
}
body {
  background: var(--bg);
  color: var(--ink);
  font: 400 14.5px/1.5 var(--f-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow: hidden;
}

button, input, textarea, select {
  font: inherit;
  color: inherit;
}
button {
  cursor: pointer;
  background: none;
  border: 0;
  padding: 0;
}
h1, h2, h3 {
  font-family: var(--f-display);
  margin: 0;
  letter-spacing: -0.015em;
  color: var(--ink);
}
p {
  margin: 0;
}

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
  border-radius: 8px;
}

.i {
  width: 18px;
  height: 18px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.mono {
  font-family: var(--f-mono);
  font-variant-numeric: tabular-nums;
}
.muted {
  color: var(--ink-2);
}
.faint {
  color: var(--ink-3);
}
.eyebrow {
  font: 600 11.5px/1 var(--f-display);
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--ink-3);
}
kbd {
  font: 500 11px/1 var(--f-mono);
  padding: 3px 6px;
  border-radius: 6px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  color: var(--ink-2);
}

/* ---------- Clay & Glass Primitives ---------- */
.clay {
  position: relative;
  background: var(--clay-bg);
  border-radius: var(--r-clay);
  border: 1px solid var(--line);
  box-shadow: inset 0 1.5px 1px var(--clay-hi), inset 0 -4px 8px var(--clay-lo), 0 1px 1px var(--edge), 0 16px 36px -12px var(--drop);
  transition: border-color .15s, box-shadow .15s;
}
.well {
  background: var(--well);
  border-radius: 14px;
  border: 1px solid var(--line);
  box-shadow: inset 0 2px 5px var(--well-in), inset 0 -1px 0 var(--well-hi);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 38px;
  padding: 0 15px;
  border-radius: 11px;
  font: 600 13.5px/1 var(--f-body);
  color: var(--ink);
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  transition: all .14s cubic-bezier(0.16, 1, 0.3, 1);
}
.btn:hover {
  background: var(--surface-hi);
  border-color: var(--line-2);
  color: #fff;
}
.btn:active {
  transform: translateY(1px);
}
.btn[disabled] {
  opacity: .45;
  pointer-events: none;
}
.btn-quiet {
  border-color: transparent;
  background: transparent;
  color: var(--ink-2);
  box-shadow: none;
}
.btn-quiet:hover {
  background: var(--bg-2);
  color: var(--ink);
}
.btn-danger {
  color: var(--bad);
}
.btn-danger:hover {
  background: rgba(255, 77, 77, 0.12);
  border-color: rgba(255, 77, 77, 0.3);
}
.icon-btn {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 10px;
}

/* Luminous Pink 3D Button */
.btn-clay {
  position: relative;
  height: 44px;
  padding: 0 22px;
  border-radius: 13px;
  border: 0;
  color: #FFF8FA;
  font: 600 14px/1 var(--f-body);
  letter-spacing: -0.01em;
  background: linear-gradient(180deg, #FF5C98 0%, #FF3377 55%, #D91D5F 100%);
  box-shadow: inset 0 1.5px 1px rgba(255, 255, 255, 0.5), inset 0 -3px 4px rgba(110, 10, 50, 0.35), 0 8px 24px -6px rgba(255, 51, 119, 0.7);
  text-shadow: 0 1px 1px rgba(90, 10, 40, 0.35);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform .14s, box-shadow .14s, filter .14s;
}
.btn-clay:hover {
  transform: translateY(-1px);
  filter: brightness(1.08);
  box-shadow: inset 0 1.5px 1px rgba(255, 255, 255, 0.6), inset 0 -3px 4px rgba(110, 10, 50, 0.35), 0 12px 30px -6px rgba(255, 51, 119, 0.85);
}
.btn-clay:active {
  transform: translateY(1px);
  box-shadow: inset 0 3px 6px rgba(110, 10, 50, 0.6), 0 3px 8px rgba(255, 51, 119, 0.4);
}
.btn-clay.sm {
  height: 36px;
  padding: 0 16px;
  font-size: 13px;
  border-radius: 11px;
}

/* Segmented Controls */
.seg {
  display: inline-flex;
  gap: 3px;
  padding: 3px;
  border-radius: 12px;
  background: var(--well);
  border: 1px solid var(--line);
  box-shadow: inset 0 2px 4px var(--well-in);
  max-width: 100%;
}
.seg button {
  height: 32px;
  padding: 0 13px;
  border-radius: 9px;
  font: 500 13px/1 var(--f-body);
  color: var(--ink-2);
  white-space: nowrap;
  transition: all .14s cubic-bezier(0.16, 1, 0.3, 1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.seg button:hover {
  color: var(--ink);
}
.seg button[aria-pressed="true"], .seg button.active {
  color: #FFF8FA;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.03)), var(--clay-bg);
  font-weight: 600;
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4), inset 0 1px 1px var(--clay-hi);
}

/* Toggle Switches */
.switch {
  width: 44px;
  height: 24px;
  border-radius: 12px;
  background: var(--well);
  border: 1px solid var(--line);
  box-shadow: inset 0 2px 4px var(--well-in);
  position: relative;
  flex: none;
  transition: background .2s, border-color .2s;
  cursor: pointer;
}
.switch::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--ink-2);
  box-shadow: 0 2px 4px rgba(0,0,0,0.4);
  transition: transform .2s cubic-bezier(0.16, 1, 0.3, 1), background .2s;
}
.switch[aria-checked="true"] {
  background: rgba(255, 51, 119, 0.25);
  border-color: var(--pink);
}
.switch[aria-checked="true"]::after {
  transform: translateX(20px);
  background: var(--pink);
  box-shadow: 0 0 10px rgba(255, 51, 119, 0.8);
}

/* Form Controls & Inputs */
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.field > label, .lbl {
  font: 500 12.5px/1.2 var(--f-body);
  color: var(--ink-2);
}
.input, .textarea, select.input {
  width: 100%;
  box-sizing: border-box;
  border-radius: 12px;
  border: 1px solid var(--line-2);
  background: var(--surface);
  color: var(--ink);
  padding: 0 14px;
  height: 42px;
  font-size: 13.5px;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.textarea {
  height: auto;
  min-height: 84px;
  padding: 10px 14px;
  resize: vertical;
  line-height: 1.45;
}
.input:hover, .textarea:hover {
  border-color: rgba(255, 255, 255, 0.25);
}
.input:focus, .textarea:focus {
  outline: none;
  border-color: var(--pink);
  box-shadow: 0 0 0 3px rgba(255, 51, 119, 0.25), 0 0 16px -4px rgba(255, 51, 119, 0.35);
  background: var(--surface-hi);
}
.input::placeholder, .textarea::placeholder {
  color: var(--ink-3);
  font-size: 13px;
}
.counter {
  font: 400 11.5px var(--f-mono);
  color: var(--ink-3);
  align-self: flex-end;
}

/* Tooltips */
[data-tip] {
  position: relative;
}
[data-tip]::before {
  content: attr(data-tip);
  position: absolute;
  z-index: 60;
  left: 50%;
  bottom: calc(100% + 8px);
  transform: translate(-50%, 3px);
  white-space: nowrap;
  padding: 6px 10px;
  border-radius: 8px;
  background: rgba(18, 12, 16, 0.96);
  border: 1px solid var(--line-2);
  color: #fff;
  font: 500 12px/1.2 var(--f-body);
  opacity: 0;
  pointer-events: none;
  box-shadow: 0 10px 20px -5px rgba(0,0,0,0.6);
  transition: opacity .12s, transform .12s;
}
[data-tip]:hover::before, [data-tip]:focus-visible::before {
  opacity: 1;
  transform: translate(-50%, 0);
  transition-delay: .3s;
}
[data-tip-pos="right"]::before {
  left: calc(100% + 8px);
  bottom: auto;
  top: 50%;
  transform: translate(-3px, -50%);
}
[data-tip-pos="right"]:hover::before, [data-tip-pos="right"]:focus-visible::before {
  transform: translate(0, -50%);
}
[data-tip-pos="below"]::before {
  bottom: auto;
  top: calc(100% + 8px);
}

/* ==========================================================================
   Shell & Layout
   ========================================================================== */
.app {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  height: 100%;
}
.rail {
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 22px 14px 16px;
  background: var(--bg-2);
  border-right: 1px solid var(--line);
  min-height: 0;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 8px;
}
.brand-logo-wrap {
  width: 58px;
  height: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
}
.brand-logo-img {
  width: 100%;
  height: auto;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 0 12px rgba(255, 51, 119, 0.85));
}
.brand b {
  font: 700 18px/1.1 var(--f-display);
  letter-spacing: -0.02em;
  display: block;
  color: var(--ink);
}
.brand small {
  display: block;
  margin-top: 4px;
  font: 400 11.5px/1.2 var(--f-body);
  color: var(--ink-3);
}

/* Navigation Links */
.nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.nav button {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 40px;
  padding: 0 12px;
  border-radius: 12px;
  color: var(--ink-2);
  font: 500 13.5px/1 var(--f-body);
  text-align: left;
  transition: all .14s cubic-bezier(0.16, 1, 0.3, 1);
  border: 1px solid transparent;
}
.nav button:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--ink);
}
.nav button[aria-current="page"] {
  color: #FFF8FA;
  font-weight: 600;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02)), var(--clay-bg);
  border-color: rgba(255, 51, 119, 0.3);
  box-shadow: 0 4px 12px -4px rgba(0, 0, 0, 0.6), inset 0 1px 1px var(--clay-hi);
}
.nav button[aria-current="page"] .i {
  color: var(--pink);
}
.nav .count {
  margin-left: auto;
  font: 500 11.5px var(--f-mono);
  color: var(--ink-3);
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--well);
  border: 1px solid var(--line);
}
.nav kbd {
  margin-left: auto;
  opacity: 0;
  transition: opacity .14s;
}
.nav button:hover kbd {
  opacity: 1;
}
.nav button:hover .count {
  display: none;
}

/* Rail Footer */
.rail-foot {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.channel {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.channel .row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 13px;
}
.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ink-3);
  flex: none;
}
.dot.on {
  background: var(--ok);
  box-shadow: 0 0 8px var(--ok);
}
.rail-links {
  display: flex;
  gap: 6px;
  align-items: center;
}
.proto {
  font-size: 11.5px;
  line-height: 1.4;
  color: var(--ink-3);
  padding: 0 8px;
}

/* Stage & Pages */
.stage {
  min-width: 0;
  min-height: 0;
  overflow: auto;
  position: relative;
  background: var(--bg);
}
.view {
  min-height: 100%;
}
.page {
  max-width: 960px;
  margin: 0 auto;
  padding: 40px 44px 72px;
  display: flex;
  flex-direction: column;
  gap: 32px;
}
.page-head {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.page-head h1 {
  font-size: 28px;
  line-height: 1.15;
  font-weight: 700;
  color: var(--ink);
}
.page-head p {
  color: var(--ink-2);
  max-width: 58ch;
  font-size: 14px;
}
.section-h {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 12px;
}
.section-h h2 {
  font-size: 16px;
  font-weight: 600;
}
.section-h .aside {
  margin-left: auto;
  font-size: 12.5px;
  color: var(--ink-3);
}

/* ==========================================================================
   Create View Components
   ========================================================================== */
.drop {
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.linkrow {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.linkrow .field {
  flex: 1;
  min-width: 0;
}
.linkrow .input-wrap {
  position: relative;
}
.linkrow .input-wrap .i {
  position: absolute;
  left: 14px;
  top: 14px;
  color: var(--ink-3);
}
textarea.input-area {
  min-height: 72px;
  height: auto;
  padding: 12px 14px 12px 42px;
  resize: vertical;
  line-height: 1.45;
  font-family: var(--f-mono);
  font-size: 13px;
}
.errmsg {
  display: flex;
  gap: 7px;
  align-items: flex-start;
  color: var(--bad);
  font-size: 12.5px;
  line-height: 1.35;
  margin-top: 6px;
}
.errmsg .i {
  width: 15px;
  height: 15px;
  margin-top: 1px;
}

/* Options Grid */
.opts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 20px 24px;
  padding: 0 4px;
}
.opt {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-start;
  min-width: 0;
}
.opt .sw {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 36px;
}

/* Stream & Live Chat Review Hero Banner */
.stream-hero {
  padding: 20px 22px;
  border-radius: var(--r-clay);
  background: linear-gradient(135deg, rgba(255, 51, 119, 0.12), var(--clay-bg));
  border: 1.5px solid rgba(255, 51, 119, 0.35);
  box-shadow: inset 0 1.5px 1px var(--clay-hi), 0 12px 30px -10px rgba(255, 51, 119, 0.25);
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.stream-hero-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.stream-hero-title {
  display: flex;
  align-items: center;
  gap: 12px;
}
.stream-hero-icon {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: linear-gradient(180deg, var(--pink-hi), var(--pink-lo));
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 19px;
  flex: none;
  box-shadow: 0 4px 12px -2px var(--pink-lo);
}
.stream-hero-txt b {
  display: block;
  font: 600 15px/1.2 var(--f-display);
  color: var(--ink);
}
.stream-hero-txt small {
  font-size: 12.5px;
  color: var(--ink-2);
  display: block;
  margin-top: 3px;
}
.stream-prio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
}
.prio-card {
  padding: 14px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  text-align: left;
  cursor: pointer;
  transition: all .15s cubic-bezier(0.16, 1, 0.3, 1);
}
.prio-card:hover {
  background: var(--surface-hi);
  border-color: var(--line-2);
  transform: translateY(-1px);
}
.prio-card[aria-pressed="true"] {
  background: var(--clay-bg);
  border-color: var(--pink);
  box-shadow: 0 0 0 2px rgba(255, 51, 119, 0.3), inset 0 1px 1px var(--clay-hi);
}
.prio-card .h {
  font: 600 13px/1.2 var(--f-display);
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 5px;
  color: var(--ink);
}
.prio-card p {
  font-size: 11.5px;
  color: var(--ink-2);
  line-height: 1.4;
}

/* Processing Queue */
.q {
  display: flex;
  flex-direction: column;
}
.qrow {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 14px 0;
  border-top: 1px solid var(--line);
}
.qrow:first-child {
  border-top: 0;
}
.qrow .ttl {
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.qrow .stp {
  font-size: 12.5px;
  color: var(--ink-2);
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}
.bar {
  height: 10px;
  border-radius: 6px;
  background: var(--well);
  border: 1px solid var(--line);
  box-shadow: inset 0 1.5px 3px var(--well-in);
  overflow: hidden;
  position: relative;
}
.bar > i {
  display: block;
  height: 100%;
  border-radius: 6px;
  background: linear-gradient(90deg, #FF3377, #FF5C98, #00F0FF);
  box-shadow: 0 0 12px rgba(255, 51, 119, 0.8);
  transition: width .3s ease-out;
}
.empty {
  display: flex;
  gap: 18px;
  align-items: center;
  padding: 24px;
  border-radius: 16px;
  border: 1.5px dashed var(--line-2);
  color: var(--ink-2);
}
.empty svg.art {
  width: 64px;
  height: 64px;
  flex: none;
}
.empty b {
  display: block;
  color: var(--ink);
  font-weight: 600;
  margin-bottom: 3px;
}
.thumb {
  width: 44px;
  aspect-ratio: 9/16;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 0 0 1px var(--line), 0 4px 10px rgba(0,0,0,0.5);
  flex: none;
  background: var(--bg-2);
}
.thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.recent {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 16px;
}
.rc {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 10px;
  border-radius: 14px;
  text-align: left;
  border: 1px solid var(--line);
  background: var(--surface);
  transition: all .14s;
}
.rc:hover {
  background: var(--surface-hi);
  border-color: var(--line-2);
  transform: translateY(-1px);
}
.rc .t {
  font: 600 13px/1.3 var(--f-body);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.rc .s {
  font-size: 11.5px;
  color: var(--ink-3);
  margin-top: 3px;
}

/* Status Pills */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 24px;
  padding: 0 9px;
  border-radius: 12px;
  font: 500 12px/1 var(--f-body);
  background: var(--bg-2);
  color: var(--ink-2);
  white-space: nowrap;
}
.pill i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}
.pill.draft {
  background: var(--rose-50);
  color: var(--rose-500);
}
.pill.uploaded {
  background: rgba(0, 229, 153, 0.15);
  color: var(--ok);
  border: 1px solid rgba(0, 229, 153, 0.3);
}
.pill.failed {
  background: rgba(255, 77, 77, 0.15);
  color: var(--bad);
  border: 1px solid rgba(255, 77, 77, 0.3);
}
.pill.busy {
  background: rgba(255, 51, 119, 0.15);
  color: var(--pink-hi);
  border: 1px solid rgba(255, 51, 119, 0.3);
}
.pill.busy i {
  animation: pulse 1.1s infinite;
}

/* ==========================================================================
   Library View Components
   ========================================================================== */
.tools {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}
.list {
  display: flex;
  flex-direction: column;
}
.lrow {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 128px 62px 84px 112px;
  gap: 16px;
  align-items: center;
  padding: 12px 8px;
  border-top: 1px solid var(--line);
  transition: background .14s;
}
.lrow:hover {
  background: rgba(255, 255, 255, 0.03);
}
.lhead {
  border-top: 0;
  padding-top: 0;
  padding-bottom: 8px;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--ink-3);
  font-weight: 600;
}
.lhead:hover {
  background: none;
}
.lrow .main {
  min-width: 0;
}
.lrow .ttl {
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
  text-align: left;
  width: 100%;
}
.lrow .ttl:hover {
  color: var(--pink);
}
.lrow .sub {
  font-size: 12.5px;
  color: var(--ink-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lrow .sub.err {
  color: var(--bad);
  white-space: normal;
}
.lrow .acts {
  display: flex;
  justify-content: flex-end;
  gap: 4px;
}
.lrow .acts a.btn {
  text-decoration: none;
}

/* ==========================================================================
   Editor & Styles View (9:16 Smartphone Mockup)
   ========================================================================== */
.editor-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 28px;
  align-items: start;
}
@media (max-width: 960px) {
  .editor-layout {
    grid-template-columns: 1fr;
  }
}
.phone-viewport {
  width: 100%;
  max-width: 320px;
  aspect-ratio: 9/16;
  margin: 0 auto;
  border-radius: 38px;
  background: #000;
  border: 7px solid #20141a;
  position: relative;
  overflow: hidden;
  box-shadow: 0 30px 60px -15px rgba(0, 0, 0, 0.9), inset 0 0 0 1px rgba(255, 255, 255, 0.12);
  display: flex;
  flex-direction: column;
}
.phone-island {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  width: 90px;
  height: 22px;
  background: #000;
  border-radius: 14px;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 8px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}
.phone-island-cam {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #151515;
}
.phone-island-sensor {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #0a0a0a;
}
.phone-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.phone-caption-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 24px;
  text-align: center;
  z-index: 15;
}
.caption-word-box {
  max-width: 90%;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .02em;
  line-height: 1.2;
  font-size: 20px;
  text-shadow: 0 3px 12px rgba(0, 0, 0, 0.9), 0 1px 3px rgba(0, 0, 0, 0.8);
  color: #fff;
}
.caption-word-highlight {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 7px;
  color: #000;
  transform: scale(1.08);
  margin: 0 2px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.4);
}

/* Color Palette Dots */
.palette-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.palette-dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform .14s, box-shadow .14s;
  position: relative;
}
.palette-dot:hover {
  transform: scale(1.15);
}
.palette-dot[aria-selected="true"] {
  box-shadow: 0 0 0 2px #fff, 0 0 12px var(--pink);
  transform: scale(1.1);
}

/* ==========================================================================
   Trends & AI Copy View
   ========================================================================== */
.trend-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 6px;
}
.trend-table th {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--ink-3);
  padding: 6px 12px;
  text-align: left;
}
.trend-table td {
  padding: 10px 12px;
  background: var(--surface);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}
.trend-table tr td:first-child {
  border-left: 1px solid var(--line);
  border-radius: 10px 0 0 10px;
}
.trend-table tr td:last-child {
  border-right: 1px solid var(--line);
  border-radius: 0 10px 10px 0;
}
.copy-box {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.copy-box .cb-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-3);
  text-transform: uppercase;
}
.copy-box .cb-txt {
  font-size: 13px;
  line-height: 1.45;
  color: var(--ink);
  white-space: pre-wrap;
}
.copy-btn {
  height: 26px;
  padding: 0 8px;
  border-radius: 7px;
  font-size: 11px;
  font-weight: 600;
  border: 1px solid var(--line);
  background: var(--bg-2);
  color: var(--ink-2);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  transition: all .12s;
}
.copy-btn:hover {
  background: var(--clay-bg);
  color: var(--ink);
  border-color: var(--pink);
}

/* ==========================================================================
   Publishing Schedule & Calendar View
   ========================================================================== */
.pause-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 20px;
  border-radius: 16px;
  background: rgba(255, 179, 0, 0.1);
  border: 1.5px solid rgba(255, 179, 0, 0.35);
  transition: all .2s;
}
.pause-banner.paused {
  background: rgba(255, 77, 77, 0.12);
  border-color: var(--bad);
}
.pause-txt b {
  font: 600 14.5px var(--f-display);
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 8px;
}
.pause-txt small {
  font-size: 12.5px;
  color: var(--ink-2);
  display: block;
  margin-top: 3px;
}
.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ok);
  display: inline-block;
  box-shadow: 0 0 0 0 rgba(0, 229, 153, 0.7);
  animation: pulseRadar 2s infinite;
}
.paused .pulse-dot {
  background: var(--bad);
  box-shadow: 0 0 0 0 rgba(255, 77, 77, 0.7);
}
@keyframes pulseRadar {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(0, 229, 153, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 8px rgba(0, 229, 153, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(0, 229, 153, 0); }
}
.calendar-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  margin-bottom: 10px;
}
.calendar-item .time-pill {
  padding: 5px 9px;
  border-radius: 8px;
  background: var(--bg-2);
  font: 500 12px var(--f-mono);
  color: var(--ink-2);
}

/* ==========================================================================
   Analytics Dashboard View
   ========================================================================== */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
}
.stat-card {
  padding: 20px;
  border-radius: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: all .15s;
}
.stat-card:hover {
  background: var(--surface-hi);
  border-color: var(--line-2);
  transform: translateY(-1px);
}
.stat-card .val {
  font: 700 30px/1 var(--f-display);
  letter-spacing: -0.02em;
  color: var(--ink);
}
.stat-card .lbl {
  font-size: 12.5px;
  color: var(--ink-2);
  font-weight: 500;
}
.stat-card .sub {
  font-size: 11.5px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
}
.sub.up { color: var(--ok); }
.sub.warn { color: var(--warn); }

/* ==========================================================================
   Modals, Scrim & Overlays (Spotless, High-Def, Anti-Bleed)
   ========================================================================== */
#toasts {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
  z-index: 99999;
  width: max-content;
  max-width: calc(100vw - 32px);
}
.toast {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 18px;
  border-radius: 14px;
  background: #181116;
  border: 1px solid rgba(255, 51, 119, 0.4);
  color: var(--ink);
  font-size: 13.5px;
  box-shadow: 0 16px 36px -10px rgba(0,0,0,0.85), 0 0 20px -5px rgba(255, 51, 119, 0.3);
  animation: tin .22s ease-out;
}
.toast.err {
  background: #241113;
  border-color: rgba(255, 77, 77, 0.5);
  color: #FFA29E;
}
.toast button {
  font-weight: 600;
  color: var(--pink-hi);
  padding: 4px 8px;
  border-radius: 8px;
}
.toast.err button {
  color: #fff;
  text-decoration: underline;
}
@keyframes tin {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Scrim & Modals */
.scrim {
  position: fixed;
  inset: 0;
  background: rgba(4, 2, 5, 0.84);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  display: grid;
  place-items: center;
  z-index: 1000;
  padding: 20px;
  animation: scrimIn .18s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes scrimIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
.modal {
  width: min(520px, 94vw);
  max-height: 90vh;
  overflow-y: auto;
  padding: 28px 26px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: rgba(20, 13, 18, 0.96);
  border-radius: 22px;
  border: 1.5px solid rgba(255, 51, 119, 0.3);
  box-shadow: 0 32px 80px -15px rgba(0, 0, 0, 0.95), 0 0 45px -10px rgba(255, 51, 119, 0.25), inset 0 1px 1px rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(32px);
  -webkit-backdrop-filter: blur(32px);
  animation: modalPop .2s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes modalPop {
  from { opacity: 0; transform: scale(0.96) translateY(8px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}
.modal.wide {
  width: min(580px, 95vw);
}
.modal h2 {
  font: 700 20px/1.2 var(--f-display);
  letter-spacing: -0.015em;
  color: #fff;
}
.modal .acts {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 10px;
}
.pv-modal video {
  display: block;
  width: 100%;
  max-height: 68vh;
  aspect-ratio: 9/16;
  background: #000;
  border-radius: 16px;
  object-fit: contain;
}

/* ==========================================================================
   Master Security Gate (MUSTBEROMMY Level 5 Clear)
   ========================================================================== */
.sec-gate {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: radial-gradient(ellipse at 50% 35%, #230d17 0%, #0d070b 60%, #050204 100%);
  display: grid;
  place-items: center;
  padding: 20px;
  overflow-y: auto;
  backdrop-filter: blur(28px);
}
.sec-card {
  width: 100%;
  max-width: 450px;
  background: rgba(22, 14, 19, 0.92);
  border: 1.5px solid rgba(255, 51, 119, 0.35);
  border-radius: 26px;
  padding: 38px 32px;
  box-shadow: 0 30px 80px -15px rgba(0, 0, 0, 0.9), 0 0 50px -10px rgba(255, 51, 119, 0.3), inset 0 1px 1px rgba(255, 255, 255, 0.16);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
  animation: secFadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes secFadeIn {
  from { opacity: 0; transform: scale(0.96) translateY(12px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}
.sec-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(255, 51, 119, 0.14);
  border: 1px solid rgba(255, 51, 119, 0.35);
  color: var(--pink);
  font: 600 11px/1 var(--f-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 20px;
}
.sec-logo-wrap {
  width: 80px;
  height: 80px;
  border-radius: 24px;
  background: linear-gradient(135deg, rgba(255, 92, 152, 0.25), rgba(217, 29, 95, 0.15));
  border: 1.5px solid rgba(255, 51, 119, 0.45);
  display: grid;
  place-items: center;
  margin-bottom: 18px;
  box-shadow: 0 10px 28px -6px rgba(255, 51, 119, 0.5);
}
.sec-logo-img {
  width: 50px;
  height: 50px;
  object-fit: contain;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,0.5));
}
.sec-title {
  font: 700 25px/1.2 var(--f-display);
  color: #FFF8FA;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}
.sec-sub {
  font-size: 13.5px;
  color: rgba(245, 235, 231, 0.72);
  line-height: 1.45;
  max-width: 320px;
  margin-bottom: 26px;
}
.sec-form {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.sec-input-wrap {
  position: relative;
  width: 100%;
}
.sec-input {
  width: 100%;
  height: 52px;
  border-radius: 14px;
  border: 1.5px solid rgba(255, 51, 119, 0.35);
  background: rgba(14, 9, 12, 0.95);
  color: #FFF8FA;
  padding: 0 46px 0 16px;
  font: 600 15px var(--f-mono);
  letter-spacing: 2.5px;
  text-align: center;
  text-transform: uppercase;
  transition: all 0.18s;
  outline: none;
}
.sec-input:focus {
  border-color: var(--pink);
  box-shadow: 0 0 0 3px rgba(255, 51, 119, 0.28), 0 0 24px -5px rgba(255, 51, 119, 0.45);
}
.sec-input::placeholder {
  font-size: 12px;
  letter-spacing: 1px;
  color: rgba(188, 170, 170, 0.45);
  text-transform: none;
}
.sec-eye-btn {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: rgba(245, 235, 231, 0.5);
  padding: 6px;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: color 0.14s;
}
.sec-eye-btn:hover {
  color: var(--pink);
}
.sec-btn {
  width: 100%;
  height: 50px;
  border-radius: 14px;
  border: 0;
  background: linear-gradient(180deg, #FF5C98 0%, #FF3377 55%, #D91D5F 100%);
  color: #FFF8FA;
  font: 600 14.5px/1 var(--f-body);
  letter-spacing: 0.04em;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 10px 24px -6px rgba(255, 51, 119, 0.65), inset 0 1.5px 1px rgba(255, 255, 255, 0.45);
  transition: all 0.15s;
}
.sec-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.06);
  box-shadow: 0 14px 28px -6px rgba(255, 51, 119, 0.85);
}
.sec-btn:active {
  transform: translateY(1px);
  box-shadow: 0 4px 10px -2px rgba(255, 51, 119, 0.5);
}
.sec-err {
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(255, 77, 77, 0.15);
  border: 1px solid rgba(255, 77, 77, 0.4);
  color: #FFA29E;
  font-size: 12.5px;
  font-weight: 500;
  display: none;
  align-items: center;
  justify-content: center;
  gap: 6px;
  animation: shake 0.35s ease-in-out;
}
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}
.sec-foot {
  font-size: 11.5px;
  color: rgba(188, 170, 170, 0.5);
  margin-top: 16px;
  line-height: 1.4;
}
.sec-quick-fill-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  border-radius: 999px;
  background: rgba(255, 51, 119, 0.12);
  border: 1px dashed rgba(255, 51, 119, 0.5);
  color: var(--pink);
  font: 700 12px/1 var(--f-display);
  cursor: pointer;
  transition: all 0.2s;
}
.sec-quick-fill-btn:hover, .sec-quick-fill-btn:active {
  background: rgba(255, 51, 119, 0.26);
  border-color: var(--pink);
  color: #fff;
  transform: scale(1.02);
}

/* ==========================================================================
   Account & Connected Channels Modal
   ========================================================================== */
.acc-modal {
  width: min(480px, 94vw);
}
.acc-modal-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.acc-sec-card {
  padding: 16px 14px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(255, 51, 119, 0.12), rgba(255, 255, 255, 0.02));
  border: 1px solid rgba(255, 51, 119, 0.35);
}
.acc-sec-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.acc-sec-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  font: 700 10.5px/1 var(--f-mono);
  letter-spacing: 0.05em;
}
.acc-user-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.acc-avatar-box {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--pink), #8000ff);
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 800;
  font-size: 19px;
  flex: none;
  box-shadow: 0 4px 14px rgba(255, 51, 119, 0.4);
}
.acc-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.acc-sec-lbl {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}
.acc-cards-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.acc-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
}
.acc-row.unlinked {
  border-style: dashed;
}
.sec-status-pill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-radius: 11px;
  background: var(--well);
  border: 1px solid var(--line);
  font-size: 12px;
  color: var(--ink-2);
}
.sec-status-pill b {
  color: var(--ok);
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.sec-lock-btn {
  background: none;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-2);
  cursor: pointer;
  transition: all .12s;
}
.sec-lock-btn:hover {
  background: var(--bg-2);
  color: var(--bad);
  border-color: var(--bad);
}

/* ==========================================================================
   Instagram & YouTube Channel Cards
   ========================================================================== */
.ig-channel-card {
  padding: 11px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  border: 1px solid rgba(225, 48, 108, 0.3);
  background: linear-gradient(135deg, rgba(225, 48, 108, 0.08), var(--surface));
  transition: border-color .15s;
}
.ig-channel-card:hover {
  border-color: rgba(225, 48, 108, 0.55);
}
.ig-link-btn {
  transition: transform .14s, color .14s;
}
.ig-link-btn:hover {
  transform: scale(1.08);
  color: #C13584 !important;
}

/* ==========================================================================
   YouTube OAuth Login Screen
   ========================================================================== */
.login {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  background: var(--bg);
  overflow: auto;
}
.login[hidden] {
  display: none !important;
  pointer-events: none !important;
}
.login-art {
  position: relative;
  overflow: hidden;
  background: var(--bg-2);
  border-right: 1px solid var(--line);
  display: grid;
  place-items: center;
  min-height: 100%;
}
.ring {
  position: absolute;
  left: 50%;
  top: 50%;
  width: var(--s);
  height: var(--s);
  margin: calc(var(--s)/-2) 0 0 calc(var(--s)/-2);
  border-radius: 50%;
  border: 1px solid var(--line-2);
  opacity: var(--o);
  background: rgba(255, 51, 119, 0.04);
  animation: ripple 4.4s ease-in-out infinite;
  animation-delay: calc(var(--i) * .16s);
}
.ring.dash {
  border-style: dashed;
  background: none;
}
@keyframes ripple {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(.95); }
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
@keyframes unspin {
  to { transform: rotate(-360deg); }
}
.orbit {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 0;
  height: 0;
  animation: spin var(--d) linear infinite;
  animation-delay: var(--dl);
}
.orbit > .it {
  position: absolute;
  left: var(--r);
  top: 0;
  animation: unspin var(--d) linear infinite;
  animation-delay: var(--dl);
}
.it.ak-orbit {
  width: var(--w, 52px);
  height: auto;
  aspect-ratio: auto;
  margin: calc(var(--w, 52px) * -.2) 0 0 calc(var(--w, 52px) / -2);
  display: flex;
  align-items: center;
  justify-content: center;
}
.orbit-ak-img {
  width: 100%;
  height: auto;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 0 8px rgba(255, 51, 119, 0.85));
  opacity: .88;
}
.art-core {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  text-align: center;
  padding: 0 24px;
}
.art-ak-hero {
  width: 290px;
  max-width: 85vw;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 6px;
}
.art-ak-img {
  width: 100%;
  height: auto;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 0 25px rgba(255, 51, 119, 1)) drop-shadow(0 0 50px rgba(255, 51, 119, 0.6));
}
.art-core b {
  font: 700 28px/1 var(--f-display);
  letter-spacing: -0.02em;
}
.art-core span {
  color: var(--ink-2);
  font-size: 15px;
}
.login-form {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 36px 28px;
  min-width: 0;
}
.lf-inner {
  width: min(400px, 100%);
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.lf-inner h1 {
  font-size: 30px;
  line-height: 1.15;
  font-weight: 700;
}
.lf-inner .sub {
  color: var(--ink-2);
  max-width: 38ch;
  font-size: 14px;
}
.gbtn {
  width: 100%;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  border-radius: 14px;
  background: #fff;
  color: #111;
  border: 1px solid rgba(255, 255, 255, 0.8);
  font: 600 15px/1 var(--f-body);
  box-shadow: 0 10px 24px -10px rgba(255, 255, 255, 0.4);
  transition: transform .14s, box-shadow .14s;
  cursor: pointer;
}
.gbtn:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 28px -10px rgba(255, 255, 255, 0.6);
}
.scopes {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 16px;
  font-size: 13px;
  color: var(--ink-2);
}
.scopes div {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.scopes .i {
  width: 16px;
  height: 16px;
  margin-top: 2px;
  color: var(--pink);
}
.scopes b {
  color: var(--ink);
  font-weight: 600;
}

/* ==========================================================================
   Live Stream & Broadcast Indicators
   ========================================================================== */
.pulse-beacon {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #FF2D55;
  display: inline-block;
  box-shadow: 0 0 0 0 rgba(255, 45, 85, 0.7);
  animation: pulseLiveBeacon 1.4s infinite;
}
@keyframes pulseLiveBeacon {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(255, 45, 85, 0.8); }
  70% { transform: scale(1.1); box-shadow: 0 0 0 10px rgba(255, 45, 85, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(255, 45, 85, 0); }
}
.pulse-beacon.beacon-amber {
  background: #FFAA00;
  box-shadow: 0 0 0 0 rgba(255, 170, 0, 0.7);
  animation: pulseAmberBeacon 1.4s infinite;
}
@keyframes pulseAmberBeacon {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(255, 170, 0, 0.8); }
  70% { transform: scale(1.1); box-shadow: 0 0 0 10px rgba(255, 170, 0, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(255, 170, 0, 0); }
}
.live-dot-badge {
  font: 700 9.5px/1 var(--f-mono);
  background: rgba(255, 45, 85, 0.2);
  border: 1px solid rgba(255, 45, 85, 0.5);
  color: #FF2D55;
  padding: 3px 6px;
  border-radius: 999px;
  letter-spacing: 0.05em;
  animation: pulse 1.4s infinite;
}
.live-prompt-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(255, 45, 85, 0.1), var(--surface));
  border: 1px solid rgba(255, 45, 85, 0.3);
  margin-top: 10px;
}
.mobile-bar {
  display: none;
}

/* ==========================================================================
   Destination Upload Modal Styles ("Where do you want to upload?")
   ========================================================================== */
.dest-dialog-wrap {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.dest-video-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.dest-video-header .thumb {
  width: 44px;
  height: 58px;
  border-radius: 8px;
  overflow: hidden;
  flex: none;
  background: #000;
  display: grid;
  place-items: center;
}
.dest-video-header .thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.dest-info {
  flex: 1;
  min-width: 0;
}
.dest-title {
  font-weight: 600;
  font-size: 13.5px;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dest-meta {
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 3px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.dest-badge {
  background: var(--rose-100);
  color: var(--pink-lo);
  padding: 1px 6px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 10.5px;
}
.dest-prompt-label {
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  margin-top: 2px;
}
.dest-quick-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.dest-quick-btn {
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  border: 1px solid var(--line);
  cursor: pointer;
  transition: all 0.2s ease;
}
.dest-quick-btn:hover {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.2);
}
.dest-quick-btn.active {
  background: rgba(255, 0, 122, 0.16);
  border-color: var(--pink);
  color: #fff;
  box-shadow: 0 0 12px rgba(255, 0, 122, 0.2);
}
.dest-cards-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.dest-card {
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  transition: all 0.2s ease;
}
.dest-card.selected {
  border-color: rgba(255, 0, 122, 0.5);
  background: linear-gradient(135deg, rgba(255, 0, 122, 0.05), rgba(255, 255, 255, 0.02));
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}
.dest-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.dest-card-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}
.dest-icon-box {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  flex: none;
}
.dest-icon-box.yt {
  background: rgba(255, 0, 0, 0.15);
  color: #ff3333;
  border: 1px solid rgba(255, 0, 0, 0.3);
}
.dest-icon-box.ig {
  background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888);
  color: #fff;
}
.dest-brand-title {
  font-weight: 600;
  font-size: 13.5px;
  color: #fff;
}
.dest-brand-acc {
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 2px;
}
.dest-toggle {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 22px;
  cursor: pointer;
  flex: none;
}
.dest-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}
.dest-toggle-slider {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--line);
  transition: 0.2s;
  border-radius: 22px;
}
.dest-toggle-slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background-color: #fff;
  transition: 0.2s;
  border-radius: 50%;
}
.dest-toggle input:checked + .dest-toggle-slider {
  background-color: var(--pink);
}
.dest-toggle input:checked + .dest-toggle-slider:before {
  transform: translateX(18px);
}

/* ==========================================================================
   Responsive Mobile Architecture (< 860px)
   ========================================================================== */
@media (max-width: 860px) {
  body {
    overflow-x: hidden;
    overflow-y: auto;
  }
  .app {
    display: block;
    height: auto;
  }

  /* Sleek Fixed Mobile Top Bar */
  .mobile-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 52px;
    padding: 0 14px;
    background: rgba(12, 8, 11, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--line);
    z-index: 55;
  }
  .mb-left {
    display: flex;
    align-items: center;
    gap: 9px;
  }
  .mb-logo {
    width: 32px;
    height: auto;
    display: flex;
    align-items: center;
  }
  .mb-logo img {
    width: 100%;
    height: auto;
    filter: drop-shadow(0 0 8px rgba(255, 51, 119, 0.85));
  }
  .mb-title {
    font: 700 16px var(--f-display);
    letter-spacing: -0.02em;
    color: #fff;
  }
  .mb-right {
    display: flex;
    align-items: center;
    gap: 6px;
  }
  .mb-auth-wrap {
    display: inline-flex;
    align-items: center;
    gap: 6px;
  }
  .mb-user-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    height: 32px;
    padding: 0 9px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 51, 119, 0.4);
    color: #fff;
    font: 700 11.5px var(--f-display);
    cursor: pointer;
    transition: all 0.2s;
  }
  .mb-user-btn:hover, .mb-user-btn:active {
    background: rgba(255, 51, 119, 0.2);
    border-color: var(--pink);
  }
  .mb-user-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--ok);
    box-shadow: 0 0 6px var(--ok);
  }
  .mb-logout-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    height: 32px;
    padding: 0 9px;
    border-radius: 999px;
    background: rgba(255, 77, 106, 0.16);
    border: 1px solid rgba(255, 77, 106, 0.5);
    color: #ff6b81;
    font: 700 11.5px var(--f-display);
    cursor: pointer;
    transition: all 0.2s;
  }
  .mb-logout-btn:hover, .mb-logout-btn:active {
    background: rgba(255, 77, 106, 0.3);
    color: #fff;
    box-shadow: 0 0 10px rgba(255, 77, 106, 0.4);
  }
  .mb-login-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    height: 32px;
    padding: 0 13px;
    border-radius: 999px;
    font: 700 12px var(--f-display);
    background: linear-gradient(135deg, #FF3377, #FF5C98);
    color: #fff;
    border: 0;
    box-shadow: 0 4px 14px rgba(255, 51, 119, 0.5);
    cursor: pointer;
  }
  .icon-btn.sm {
    width: 32px;
    height: 32px;
  }

  /* Fixed Glass Bottom Tab Bar */
  .rail {
    position: fixed;
    z-index: 55;
    left: 0;
    right: 0;
    bottom: 0;
    top: auto;
    flex-direction: row;
    align-items: center;
    padding: 4px 4px calc(4px + env(safe-area-inset-bottom, 0px));
    border-right: 0;
    border-top: 1px solid var(--line);
    background: rgba(12, 8, 11, 0.96);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.8);
    gap: 0;
  }
  .rail .brand, .rail-foot, .nav kbd, .nav .count, #secStatusPill {
    display: none !important;
  }
  .nav {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 4px;
    width: 100%;
    padding: 2px 4px;
  }
  .nav::-webkit-scrollbar {
    display: none;
  }
  .nav button {
    flex: 0 0 auto;
    min-width: 60px;
    height: 48px;
    padding: 2px 4px;
    font-size: 10px;
    border-radius: 9px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    gap: 3px;
  }
  .nav-lbl[data-short]::after {
    content: attr(data-short);
  }
  .nav-lbl[data-short] {
    font-size: 0;
  }
  .nav-lbl[data-short]::after {
    font-size: 10px;
  }
  .nav button span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
  }
  .nav button .i {
    width: 17px;
    height: 17px;
  }
  .nav button[aria-current="page"] {
    background: linear-gradient(180deg, rgba(255, 51, 119, 0.22), rgba(255, 51, 119, 0.06));
    border-color: rgba(255, 51, 119, 0.6);
    color: #fff;
    box-shadow: 0 0 12px rgba(255, 51, 119, 0.35);
  }

  /* Stage & Padding on Mobile */
  .stage {
    overflow-x: hidden;
    overflow-y: visible;
    padding-top: 56px;
    padding-bottom: 84px;
  }
  .page {
    padding: 18px 12px 36px;
    gap: 20px;
  }
  .page-head h1 {
    font-size: 22px;
  }
  .page-head p {
    font-size: 13px;
  }

  /* Inputs & Options on Mobile */
  .linkrow {
    flex-direction: column;
    gap: 10px;
  }
  .linkrow .btn-clay {
    width: 100%;
    height: 44px;
  }
  .opts {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  .seg {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .seg::-webkit-scrollbar {
    display: none;
  }
  .seg button {
    flex: 1 0 auto;
    padding: 0 10px;
    font-size: 12px;
  }

  /* Library Cards on Mobile */
  .lhead {
    display: none;
  }
  .lrow {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    padding: 14px 12px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--surface);
    margin-bottom: 10px;
  }
  .lrow .dur, .lrow .lh-dur, .lrow .date {
    display: inline-block;
    font-size: 11px;
  }
  .lrow .main {
    width: 100%;
  }
  .lrow .acts {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
    border-top: 1px solid var(--line);
    padding-top: 10px;
    gap: 6px;
  }
  .lrow .acts .btn {
    height: 36px;
    padding: 0 10px;
    font-size: 11.5px;
  }

  /* 9:16 Mockup in Editor on Mobile */
  .editor-layout {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .phone-viewport {
    max-width: 220px;
    max-height: 390px;
    aspect-ratio: 9/16;
    margin: 0 auto 16px;
    border-width: 5px;
    border-radius: 28px;
  }
  .phone-island {
    top: 6px;
    width: 70px;
    height: 16px;
  }
  .caption-word-box {
    font-size: 15px;
  }

  /* Trends & Analytics on Mobile */
  .stat-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
  .stat-card {
    padding: 14px;
  }
  .stat-card .val {
    font-size: 24px;
  }

  /* Dialogs & Security Gate on Mobile */
  .modal {
    width: 95vw;
    padding: 20px 16px;
    border-radius: 18px;
    max-height: 85vh;
  }
  .sec-card {
    padding: 26px 18px;
    border-radius: 22px;
    max-width: 92vw;
  }
  .sec-title {
    font-size: 22px;
  }
  .sec-sub {
    font-size: 12.5px;
    margin-bottom: 20px;
  }
  .sec-input {
    height: 48px;
    font-size: 14px;
  }
  .sec-btn {
    height: 46px;
    font-size: 14px;
  }

  .live-prompt-banner {
    flex-direction: column;
    align-items: flex-start;
  }
  .live-prompt-banner button {
    width: 100%;
  }

  .login {
    grid-template-columns: 1fr;
  }
  .login-art {
    display: none;
  }

  /* Prevent iOS Safari Viewport Auto-zoom */
  input, textarea, select {
    font-size: 16px !important;
  }
}
