:root {
      --bg: #fafafa;
      --bg-surface: #ffffff;
      --bg-subtle: #f4f4f5;
      --bg-subtle-hover: #ebebee;
      --border: #e4e4e7;
      --border-subtle: #f1f1f4;
      --border-hover: #d4d4d8;
      --border-focus: #2563eb;

      --text-main: #09090b;
      --text-muted: #52525b;
      --text-dim: #71717a;

      --accent: #2563eb;
      --accent-hover: #1d4ed8;
      --accent-glow: rgba(37, 99, 235, 0.15);
      --accent-light: #eff6ff;
      --accent-border: #bfdbfe;

      --success: #059669;
      --success-light: #ecfdf5;
      --success-border: #a7f3d0;

      --warning: #d97706;
      --warning-light: #fffbeb;
      --warning-border: #fde68a;

      --danger: #dc2626;
      --danger-light: #fef2f2;
      --danger-border: #fecaca;

      --radius-sm: 8px;
      --radius-md: 12px;
      --radius-lg: 16px;
      --radius-xl: 22px;
      --radius-full: 9999px;

      --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
      --font-mono: 'JetBrains Mono', monospace;

      --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
      --shadow-card: 0 2px 8px -2px rgba(0, 0, 0, 0.04), 0 12px 30px -8px rgba(0, 0, 0, 0.06);
    }

    * {
      box-sizing: border-box;
      margin: 0;
      padding: 0;
    }

    /* ══ CURSOR CONFIGURATION ══ */
    /* Desktop with mouse: Custom ShiftTools Cursor */
    @media (min-width: 1025px) and (pointer: fine) {

      html,
      body,
      *,
      *::before,
      *::after {
        cursor: none !important;
      }

      #shift-cursor {
        position: fixed;
        top: 0;
        left: 0;
        width: 24px;
        height: 24px;
        pointer-events: none;
        z-index: 9999999;
        transform: translate(-100px, -100px);
        transition: opacity 0.2s ease;
        will-change: transform;
      }

      #shift-trail {
        position: fixed;
        top: 0;
        left: 0;
        width: 24px;
        height: 24px;
        pointer-events: none;
        z-index: 9999998;
        transform: translate(-100px, -100px);
        opacity: 0.35;
        transition: opacity 0.2s ease;
        will-change: transform;
      }

      #shift-cursor svg,
      #shift-trail svg {
        width: 100%;
        height: 100%;
        filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.2));
        transition: transform 0.15s cubic-bezier(0.16, 1, 0.3, 1);
        transform-origin: 5px 3px;
      }

      body.custom-cursor-hover #shift-cursor svg {
        transform: scale(1.22);
      }
    }

    /* Mobile & Tablet View (<= 1024px or touch/coarse): Completely remove custom cursor */
    @media (max-width: 1024px),
    (pointer: coarse),
    (hover: none) {

      #shift-cursor,
      #shift-trail {
        display: none !important;
        visibility: hidden !important;
        pointer-events: none !important;
      }

      html,
      body,
      *,
      *::before,
      *::after {
        cursor: auto;
      }

      button,
      a,
      input,
      select,
      textarea,
      .custom-dropdown-trigger,
      .custom-unit-trigger,
      .dropdown-option,
      .custom-unit-option,
      .cue-table tbody tr,
      .nudge-pill,
      .fps-card-btn,
      .mode-tab-btn,
      .scope-pill,
      .cue-action-btn,
      .cue-row-check,
      .cue-micro-btn {
        cursor: pointer;
      }
    }

    body {
      background-color: var(--bg);
      color: var(--text-main);
      font-family: var(--font-sans);
      min-height: 100vh;
      line-height: 1.5;
      -webkit-font-smoothing: antialiased;
      overflow-x: hidden;
      position: relative;
    }

    /* Minimal geometric subtle grid background */
    .bg-grid {
      position: fixed;
      inset: 0;
      background-image: linear-gradient(to right, rgba(0, 0, 0, 0.02) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(0, 0, 0, 0.02) 1px, transparent 1px);
      background-size: 32px 32px;
      pointer-events: none;
      z-index: 0;
    }

    .app-shell {
      position: relative;
      z-index: 1;
      max-width: 1100px;
      margin: 0 auto;
      padding: 32px 24px 100px;
    }

    /* ══ TOPBAR ══ */
    .topbar {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding-bottom: 24px;
      border-bottom: 1px solid var(--border);
      margin-bottom: 40px;
    }

    .brand-wrap {
      display: flex;
      align-items: center;
      gap: 12px;
      text-decoration: none;
      color: inherit;
    }

    .brand-icon {
      width: 40px;
      height: 40px;
      background: #09090b;
      border-radius: var(--radius-md);
      display: flex;
      align-items: center;
      justify-content: center;
      color: #ffffff !important;
      box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    }
    .brand-icon svg {
      stroke: #ffffff !important;
      color: #ffffff !important;
      fill: none !important;
    }

    .brand-title {
      font-size: 19px;
      font-weight: 800;
      letter-spacing: -0.5px;
      color: #09090b;
    }

    .brand-pill {
      font-size: 11px;
      font-weight: 700;
      background: var(--bg-subtle);
      color: var(--text-muted);
      padding: 3px 9px;
      border-radius: var(--radius-full);
      border: 1px solid var(--border);
      letter-spacing: 0.3px;
    }

    .topbar-nav {
      display: flex;
      align-items: center;
      gap: 16px;
    }

    .privacy-badge {
      display: flex;
      align-items: center;
      gap: 6px;
      font-size: 12px;
      font-weight: 600;
      color: #15803d;
      background: rgba(22, 163, 74, 0.08);
      border: 1px solid #bbf7d0;
      padding: 4px 12px;
      border-radius: var(--radius-full);
    }

    .privacy-dot {
      width: 6px;
      height: 6px;
      border-radius: 50%;
      background: #16a34a;
    }

    .topbar-link {
      display: inline-flex;
      align-items: center;
      gap: 7px;
      font-size: 13px;
      font-weight: 600;
      color: var(--text-main);
      background: var(--bg-card);
      border: 1px solid var(--border);
      padding: 7px 14px;
      border-radius: var(--radius-full);
      text-decoration: none;
      box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
      transition: all 0.15s ease;
    }

    .topbar-link:hover {
      color: var(--accent);
      border-color: var(--accent-border);
      background: var(--accent-light);
      transform: translateY(-1px);
      box-shadow: 0 3px 8px rgba(37, 99, 235, 0.12);
    }

    /* ══ HERO SECTION ══ */
    .hero-section {
      text-align: center;
      max-width: 760px;
      margin: 0 auto 36px;
    }

    .hero-badge {
      display: inline-flex;
      align-items: center;
      gap: 7px;
      padding: 5px 14px;
      border-radius: var(--radius-full);
      background: #ffffff;
      border: 1px solid var(--border);
      box-shadow: var(--shadow-sm);
      font-size: 12.5px;
      font-weight: 700;
      color: var(--accent);
      margin-bottom: 16px;
    }

    .hero-title {
      font-size: 40px;
      font-weight: 800;
      letter-spacing: -1.2px;
      color: #09090b;
      line-height: 1.15;
      margin-bottom: 14px;
    }

    .hero-desc {
      font-size: 16px;
      color: var(--text-muted);
      line-height: 1.6;
    }

    /* ══ MAIN STUDIO CARD (MINIMAL WHITE) ══ */
    .studio-card {
      background: #ffffff;
      border: 1px solid var(--border);
      border-radius: var(--radius-xl);
      padding: 32px;
      box-shadow: var(--shadow-card);
      margin-bottom: 40px;
      position: relative;
    }

    /* ══ DROPZONE AREA ══ */
    .dropzone-container {
      border: 2px dashed #d4d4d8;
      border-radius: var(--radius-lg);
      padding: 44px 24px;
      text-align: center;
      background: #fafafa;
      transition: all 0.2s ease;
      position: relative;
    }

    .dropzone-container.drag-over {
      border-color: var(--accent);
      background: var(--accent-light);
      transform: scale(0.995);
    }

    .drop-icon-wrap {
      width: 56px;
      height: 56px;
      border-radius: 50%;
      background: #ffffff;
      border: 1px solid var(--border);
      box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
      display: inline-flex;
      align-items: center;
      justify-content: center;
      color: var(--accent);
      margin-bottom: 16px;
      transition: transform 0.2s;
    }

    .dropzone-container:hover .drop-icon-wrap {
      transform: translateY(-2px);
    }

    .drop-title {
      font-size: 17px;
      font-weight: 700;
      color: var(--text-main);
      margin-bottom: 6px;
    }

    .drop-subtitle {
      font-size: 13.5px;
      color: var(--text-muted);
      margin-bottom: 20px;
    }

    .drop-actions-row {
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 12px;
      flex-wrap: wrap;
    }

    .btn-primary {
      background: #09090b;
      color: #ffffff;
      border: none;
      padding: 10px 20px;
      border-radius: var(--radius-sm);
      font-size: 13.5px;
      font-weight: 700;
      font-family: inherit;
      display: inline-flex;
      align-items: center;
      gap: 8px;
      box-shadow: 0 4px 14px rgba(0, 0, 0, 0.1);
      transition: all 0.15s;
    }

    .btn-primary:hover {
      background: #18181b;
      transform: translateY(-1px);
    }

    .btn-secondary {
      background: #ffffff;
      color: var(--text-main);
      border: 1px solid var(--border);
      padding: 10px 18px;
      border-radius: var(--radius-sm);
      font-size: 13.5px;
      font-weight: 600;
      font-family: inherit;
      display: inline-flex;
      align-items: center;
      gap: 8px;
      transition: all 0.15s;
    }

    .btn-secondary:hover {
      background: var(--bg-subtle);
      border-color: var(--border-hover);
    }

    .btn-sample {
      background: var(--accent-light);
      color: var(--accent);
      border: 1px solid var(--accent-border);
      padding: 10px 16px;
      border-radius: var(--radius-sm);
      font-size: 13.5px;
      font-weight: 700;
      font-family: inherit;
      display: inline-flex;
      align-items: center;
      gap: 7px;
      transition: all 0.15s;
    }

    .btn-sample:hover {
      background: #dbeafe;
    }

    /* Paste text drawer */
    .paste-drawer {
      display: none;
      margin-top: 20px;
      text-align: left;
    }

    .paste-textarea {
      width: 100%;
      height: 160px;
      background: #ffffff;
      border: 1.5px solid var(--border);
      border-radius: var(--radius-md);
      padding: 14px;
      font-family: var(--font-mono);
      font-size: 12.5px;
      color: var(--text-main);
      resize: vertical;
      outline: none;
      transition: border-color 0.15s;
    }

    .paste-textarea:focus {
      border-color: var(--border-focus);
      box-shadow: 0 0 0 3.5px var(--accent-glow);
    }

    /* ══ ACTIVE FILE INFO BAR ══ */
    .file-meta-bar {
      display: none;
      align-items: center;
      justify-content: space-between;
      background: #f8fafc;
      border: 1px solid var(--border);
      border-radius: var(--radius-md);
      padding: 14px 18px;
      margin-bottom: 24px;
      flex-wrap: wrap;
      gap: 12px;
    }

    .file-meta-left {
      display: flex;
      align-items: center;
      gap: 12px;
    }

    .file-badge-type {
      font-family: var(--font-mono);
      font-size: 11px;
      font-weight: 800;
      padding: 3px 8px;
      border-radius: 6px;
      background: #09090b;
      color: #ffffff;
      text-transform: uppercase;
    }

    .file-name-text {
      font-size: 14px;
      font-weight: 700;
      color: var(--text-main);
      max-width: 320px;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    .file-stat-pill {
      font-size: 12px;
      color: var(--text-muted);
      background: #ffffff;
      border: 1px solid var(--border);
      padding: 3px 10px;
      border-radius: var(--radius-full);
      font-weight: 600;
    }

    .btn-icon-clear {
      background: transparent;
      border: none;
      color: var(--text-dim);
      font-size: 12.5px;
      font-weight: 600;
      display: flex;
      align-items: center;
      gap: 6px;
      transition: color 0.15s;
    }

    .btn-icon-clear:hover {
      color: var(--danger);
    }

    /* ══ TABBED SYNC MODES ══ */
    .sync-modes-panel {
      display: none;
      margin-bottom: 28px;
    }

    .mode-tab-nav {
      display: flex;
      align-items: center;
      border-bottom: 1.5px solid var(--border);
      gap: 4px;
      margin-bottom: 24px;
      overflow-x: auto;
    }

    .mode-tab-btn {
      background: transparent;
      border: none;
      padding: 12px 18px;
      font-family: inherit;
      font-size: 14px;
      font-weight: 700;
      color: var(--text-dim);
      border-bottom: 2.5px solid transparent;
      margin-bottom: -2px;
      display: flex;
      align-items: center;
      gap: 8px;
      transition: all 0.15s;
      white-space: nowrap;
    }

    .mode-tab-btn:hover {
      color: var(--text-main);
    }

    .mode-tab-btn.active {
      color: var(--accent);
      border-bottom-color: var(--accent);
    }

    .tab-badge {
      font-size: 10px;
      font-weight: 800;
      text-transform: uppercase;
      padding: 2px 6px;
      border-radius: 4px;
      background: var(--bg-subtle);
      color: var(--text-muted);
    }

    .mode-tab-btn.active .tab-badge {
      background: var(--accent-light);
      color: var(--accent);
    }

    .mode-tab-content {
      display: none;
      animation: fadeIn 0.2s ease-in-out;
    }

    .mode-tab-content.active {
      display: block;
    }

    @keyframes fadeIn {
      from {
        opacity: 0;
        transform: translateY(4px);
      }

      to {
        opacity: 1;
        transform: translateY(0);
      }
    }

    /* Mode 1: Constant Offset UI */
    .offset-controller-card {
      background: #fafafa;
      border: 1px solid var(--border);
      border-radius: var(--radius-lg);
      padding: 24px;
    }

    /* Scope Selector for Subtitle Shifting */
    .shift-scope-bar {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
      margin-bottom: 16px;
      flex-wrap: wrap;
      background: #fafafa;
      border: 1px solid var(--border-subtle);
      padding: 8px 12px;
      border-radius: var(--radius-md);
    }

    .scope-label {
      font-size: 11.5px;
      font-weight: 700;
      color: var(--text-muted);
      text-transform: uppercase;
      letter-spacing: 0.5px;
    }

    .scope-pills {
      display: flex;
      align-items: center;
      gap: 6px;
      flex-wrap: wrap;
    }

    .scope-pill {
      background: #ffffff;
      border: 1.5px solid var(--border);
      border-radius: var(--radius-full);
      padding: 5px 12px;
      font-size: 12px;
      font-weight: 600;
      color: var(--text-muted);
      display: flex;
      align-items: center;
      gap: 6px;
      transition: all 0.14s ease;
      font-family: inherit;
    }

    .scope-pill:hover {
      border-color: var(--border-hover);
      color: var(--text-main);
    }

    .scope-pill.active {
      background: var(--accent);
      color: #ffffff;
      border-color: var(--accent);
      box-shadow: 0 2px 6px rgba(37, 99, 235, 0.25);
    }

    .scope-pill.active svg {
      stroke: #ffffff;
    }

    .offset-main-row {
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 16px;
      margin-bottom: 20px;
      flex-wrap: wrap;
    }

    .btn-step {
      width: 48px;
      height: 48px;
      border-radius: var(--radius-md);
      background: #ffffff;
      border: 1.5px solid var(--border);
      color: var(--text-main);
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 20px;
      font-weight: 700;
      transition: all 0.15s;
    }

    .btn-step:hover {
      background: var(--bg-subtle);
      border-color: var(--border-hover);
      transform: scale(1.03);
    }

    .offset-input-wrap {
      display: flex;
      align-items: center;
      background: #ffffff;
      border: 2px solid var(--border);
      border-radius: var(--radius-md);
      height: 52px;
      padding: 0 16px;
      min-width: 220px;
      transition: border-color 0.15s, box-shadow 0.15s;
    }

    .offset-input-wrap:focus-within {
      border-color: var(--border-focus);
      box-shadow: 0 0 0 3.5px var(--accent-glow);
    }

    .offset-input {
      font-family: var(--font-mono);
      font-size: 22px;
      font-weight: 700;
      color: var(--text-main);
      border: none;
      outline: none;
      width: 130px;
      text-align: right;
      background: transparent;
    }

    /* ══ ULTRA-MODERN CUSTOM DROPDOWN COMPONENT ══ */
    .custom-dropdown {
      position: relative;
      width: 100%;
      max-width: 580px;
    }

    .custom-dropdown-trigger {
      width: 100%;
      background: #ffffff;
      border: 1.5px solid var(--border);
      border-radius: var(--radius-md);
      padding: 10px 14px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      text-align: left;
      font-family: inherit;
      transition: all 0.15s ease;
      box-shadow: var(--shadow-sm);
    }

    .custom-dropdown-trigger:hover {
      border-color: var(--border-hover);
      background: var(--bg-subtle);
    }

    .custom-dropdown.open .custom-dropdown-trigger {
      border-color: var(--accent);
      box-shadow: 0 0 0 3.5px var(--accent-glow);
      background: #ffffff;
    }

    .dropdown-trigger-content {
      display: flex;
      align-items: center;
      gap: 10px;
      flex-wrap: wrap;
    }

    .dropdown-selected-title {
      font-size: 13.5px;
      font-weight: 700;
      color: var(--text-main);
    }

    .dropdown-selected-badge {
      font-size: 11px;
      font-weight: 600;
      color: #059669;
      background: #ecfdf5;
      padding: 2px 7px;
      border-radius: 4px;
      border: 1px solid #a7f3d0;
    }

    .dropdown-chevron {
      color: var(--text-dim);
      transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
      flex-shrink: 0;
    }

    .custom-dropdown.open .dropdown-chevron,
    .custom-unit-dropdown.open .dropdown-chevron {
      transform: rotate(180deg);
      color: var(--accent);
    }

    .custom-dropdown-menu {
      position: absolute;
      top: calc(100% + 6px);
      left: 0;
      right: 0;
      background: #ffffff;
      border: 1.5px solid var(--border);
      border-radius: var(--radius-md);
      box-shadow: 0 14px 40px -4px rgba(0, 0, 0, 0.12), 0 4px 14px rgba(0, 0, 0, 0.05);
      padding: 6px;
      z-index: 1000;
      max-height: 280px;
      overflow-y: auto;
      display: none;
      flex-direction: column;
      gap: 3px;
    }

    .custom-dropdown.open .custom-dropdown-menu {
      display: flex;
      animation: dropdownPop 0.18s cubic-bezier(0.16, 1, 0.3, 1);
    }

    @keyframes dropdownPop {
      from {
        opacity: 0;
        transform: translateY(-6px) scale(0.99);
      }

      to {
        opacity: 1;
        transform: translateY(0) scale(1);
      }
    }

    .dropdown-option {
      padding: 9px 12px;
      border-radius: var(--radius-sm);
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      transition: background 0.12s, color 0.12s;
    }

    .dropdown-option:hover {
      background: #f8fafc;
    }

    .dropdown-option.selected {
      background: #eff6ff;
    }

    .option-main {
      display: flex;
      flex-direction: column;
      gap: 2px;
    }

    .option-title {
      font-size: 13px;
      font-weight: 700;
      color: var(--text-main);
    }

    .dropdown-option.selected .option-title {
      color: var(--accent);
    }

    .option-desc {
      font-size: 11.5px;
      color: var(--text-muted);
    }

    .option-check {
      opacity: 0;
      flex-shrink: 0;
      transition: opacity 0.12s;
    }

    .dropdown-option.selected .option-check,
    .custom-unit-option.selected .option-check {
      opacity: 1;
    }

    /* Unit custom dropdown in Mode 1 */
    .custom-unit-dropdown {
      position: relative;
      display: inline-block;
      margin-left: 8px;
    }

    .custom-unit-trigger {
      background: #ffffff;
      border: 1.5px solid var(--border);
      border-radius: var(--radius-sm);
      padding: 6px 12px;
      display: flex;
      align-items: center;
      gap: 8px;
      font-family: inherit;
      font-size: 13px;
      font-weight: 700;
      color: var(--text-main);
      box-shadow: var(--shadow-sm);
      transition: all 0.15s;
    }

    .custom-unit-trigger:hover {
      border-color: var(--border-hover);
      background: var(--bg-subtle);
    }

    .custom-unit-dropdown.open .custom-unit-trigger {
      border-color: var(--accent);
      box-shadow: 0 0 0 3px var(--accent-glow);
    }

    .custom-unit-menu {
      position: absolute;
      top: calc(100% + 5px);
      right: 0;
      min-width: 170px;
      background: #ffffff;
      border: 1.5px solid var(--border);
      border-radius: var(--radius-md);
      box-shadow: 0 10px 28px -4px rgba(0, 0, 0, 0.12), 0 3px 10px rgba(0, 0, 0, 0.05);
      padding: 5px;
      z-index: 1000;
      display: none;
      flex-direction: column;
      gap: 2px;
    }

    .custom-unit-dropdown.open .custom-unit-menu {
      display: flex;
      animation: dropdownPop 0.18s cubic-bezier(0.16, 1, 0.3, 1);
    }

    .custom-unit-option {
      padding: 7px 10px;
      border-radius: var(--radius-sm);
      font-size: 12.5px;
      font-weight: 600;
      color: var(--text-main);
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 8px;
      transition: background 0.12s;
    }

    .custom-unit-option:hover {
      background: #f8fafc;
    }

    .custom-unit-option.selected {
      background: #eff6ff;
      color: var(--accent);
    }

    .quick-nudge-bar {
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 8px;
      flex-wrap: wrap;
      margin-bottom: 16px;
    }

    .nudge-pill {
      background: #ffffff;
      border: 1px solid var(--border);
      padding: 6px 12px;
      border-radius: var(--radius-sm);
      font-size: 12.5px;
      font-weight: 700;
      font-family: var(--font-mono);
      color: var(--text-muted);
      transition: all 0.15s;
    }

    .nudge-pill:hover {
      color: var(--accent);
      border-color: var(--accent);
      background: var(--accent-light);
    }

    .offset-explanation-banner {
      display: flex;
      align-items: center;
      justify-content: space-between;
      background: #ffffff;
      border: 1px solid var(--border);
      border-radius: var(--radius-sm);
      padding: 10px 14px;
      font-size: 13px;
      color: var(--text-muted);
    }

    .offset-stat-highlight {
      font-weight: 700;
      color: var(--accent);
      font-family: var(--font-mono);
    }

    /* Mode 2: Framerate Drift UI */
    .fps-presets-grid {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
      gap: 12px;
      margin-bottom: 20px;
    }

    .fps-card-btn {
      background: #ffffff;
      border: 1.5px solid var(--border);
      border-radius: var(--radius-md);
      padding: 14px 16px;
      text-align: left;
      font-family: inherit;
      transition: all 0.15s;
      position: relative;
    }

    .fps-card-btn:hover {
      border-color: var(--border-hover);
      background: #fafafa;
    }

    .fps-card-btn.selected {
      border-color: var(--accent);
      background: var(--accent-light);
    }

    .fps-card-title {
      font-size: 14px;
      font-weight: 700;
      color: var(--text-main);
      margin-bottom: 4px;
      display: flex;
      align-items: center;
      justify-content: space-between;
    }

    .fps-card-desc {
      font-size: 12px;
      color: var(--text-muted);
    }

    .fps-drift-indicator {
      font-size: 11px;
      font-weight: 700;
      color: #059669;
      background: #ecfdf5;
      padding: 2px 6px;
      border-radius: 4px;
      border: 1px solid #a7f3d0;
    }

    .custom-fps-row {
      display: flex;
      align-items: center;
      gap: 12px;
      background: #fafafa;
      border: 1px solid var(--border);
      border-radius: var(--radius-md);
      padding: 14px 16px;
      flex-wrap: wrap;
    }

    .fps-input-box {
      width: 100px;
      height: 38px;
      background: #ffffff;
      border: 1px solid var(--border);
      border-radius: var(--radius-sm);
      padding: 0 10px;
      font-family: var(--font-mono);
      font-size: 13.5px;
      font-weight: 700;
      color: var(--text-main);
      outline: none;
    }

    .fps-input-box:focus {
      border-color: var(--border-focus);
    }

    /* Mode 3: Two-Point Anchor UI */
    .anchor-grid {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 20px;
      margin-bottom: 20px;
    }

    @media (max-width: 680px) {
      .anchor-grid {
        grid-template-columns: 1fr;
      }
    }

    .anchor-box {
      background: #fafafa;
      border: 1px solid var(--border);
      border-radius: var(--radius-md);
      padding: 18px;
    }

    .anchor-box-title {
      font-size: 14px;
      font-weight: 700;
      color: var(--text-main);
      margin-bottom: 12px;
      display: flex;
      align-items: center;
      gap: 8px;
    }

    .anchor-orig-time {
      font-family: var(--font-mono);
      font-size: 13px;
      color: var(--text-dim);
      margin-bottom: 8px;
    }

    .anchor-target-input {
      width: 100%;
      height: 42px;
      background: #ffffff;
      border: 1.5px solid var(--border);
      border-radius: var(--radius-sm);
      padding: 0 12px;
      font-family: var(--font-mono);
      font-size: 14px;
      font-weight: 700;
      color: var(--accent);
      outline: none;
      transition: border-color 0.15s;
    }

    .anchor-target-input:focus {
      border-color: var(--border-focus);
      box-shadow: 0 0 0 3px var(--accent-glow);
    }

    /* ══ SPLIT VERIFICATION VIEW: CUE TABLE + VIDEO SANDBOX ══ */
    .verification-split {
      display: none;
      grid-template-columns: 1.15fr 0.85fr;
      gap: 24px;
      margin-bottom: 32px;
      align-items: flex-start;
    }

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

    /* Cue Table Box */
    .cue-table-card {
      background: #ffffff;
      border: 1px solid var(--border);
      border-radius: var(--radius-lg);
      overflow: hidden;
      box-shadow: var(--shadow-sm);
    }

    .cue-table-header {
      padding: 14px 18px;
      background: #fafafa;
      border-bottom: 1px solid var(--border);
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      flex-wrap: wrap;
    }

    .cue-table-title {
      font-size: 13.5px;
      font-weight: 700;
      color: var(--text-main);
      display: flex;
      align-items: center;
      gap: 7px;
    }

    .cue-search-input {
      background: #ffffff;
      border: 1px solid var(--border);
      border-radius: var(--radius-sm);
      height: 32px;
      padding: 0 10px;
      font-size: 12.5px;
      color: var(--text-main);
      outline: none;
      width: 170px;
    }

    .cue-search-input:focus {
      border-color: var(--border-focus);
    }

    .cue-scroll-area {
      max-height: 480px;
      overflow-y: auto;
      overflow-x: auto;
      -webkit-overflow-scrolling: touch;
    }

    .cue-table {
      width: 100%;
      min-width: 440px;
      border-collapse: collapse;
      font-size: 12.5px;
    }

    .cue-table th {
      position: sticky;
      top: 0;
      background: #f8fafc;
      padding: 10px 14px;
      text-align: left;
      font-weight: 700;
      font-size: 11px;
      text-transform: uppercase;
      letter-spacing: 0.5px;
      color: var(--text-dim);
      border-bottom: 1px solid var(--border);
      z-index: 10;
    }

    .cue-table-header-right {
      display: flex;
      align-items: center;
      gap: 10px;
      flex-wrap: wrap;
    }

    .cue-select-actions {
      display: flex;
      align-items: center;
      gap: 5px;
    }

    .cue-action-btn {
      background: #ffffff;
      border: 1px solid var(--border);
      border-radius: var(--radius-sm);
      padding: 5px 10px;
      font-size: 11px;
      font-weight: 600;
      color: var(--text-muted);
      font-family: inherit;
      transition: all 0.12s ease;
    }

    .cue-action-btn:hover {
      background: var(--bg-subtle);
      color: var(--text-main);
      border-color: var(--border-hover);
    }

    .cue-selected-badge {
      font-size: 11px;
      font-weight: 700;
      color: #2563eb;
      background: #eff6ff;
      border: 1px solid #bfdbfe;
      padding: 2px 8px;
      border-radius: var(--radius-full);
      margin-left: 6px;
    }

    .cue-row-check,
    #cueMasterCheckbox {
      width: 16px;
      height: 16px;
      accent-color: var(--accent);
      cursor: pointer;
      vertical-align: middle;
    }

    .cue-table tr.selected-cue td {
      background: #f0f7ff !important;
    }

    .cue-table tr.selected-cue td:first-child {
      border-left: 3px solid var(--accent);
    }

    .cue-adjust-cell {
      display: flex;
      align-items: center;
      gap: 4px;
      justify-content: center;
    }

    .cue-micro-btn {
      width: 26px;
      height: 26px;
      border-radius: var(--radius-sm);
      border: 1px solid var(--border);
      background: #ffffff;
      color: var(--text-main);
      font-family: var(--font-mono);
      font-size: 13px;
      font-weight: 700;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      padding: 0;
      line-height: 1;
      transition: all 0.12s ease;
      box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    }

    .cue-micro-btn:hover {
      background: var(--accent);
      color: #ffffff;
      border-color: var(--accent);
      transform: translateY(-1px);
    }

    .cue-table tbody tr {
      transition: background-color 0.12s;
    }

    .cue-table td {
      padding: 12px 14px;
      border-bottom: 1px solid var(--border-subtle);
      vertical-align: top;
    }

    .cue-table tr:hover td {
      background: #fafafa;
    }

    .cue-table tr.active-playing td {
      background: #eff6ff !important;
      border-left: 3px solid var(--accent);
    }

    .time-orig-strike {
      font-family: var(--font-mono);
      color: var(--text-dim);
      text-decoration: line-through;
      font-size: 11px;
      display: block;
    }

    .time-new-bold {
      font-family: var(--font-mono);
      color: var(--accent);
      font-weight: 700;
      font-size: 12px;
      display: block;
    }

    .cue-text-cell {
      color: var(--text-main);
      font-size: 12.5px;
      line-height: 1.4;
      word-break: break-word;
    }

    /* Video Player Sandbox */
    .video-sandbox-card {
      background: #ffffff;
      border: 1px solid var(--border);
      border-radius: var(--radius-lg);
      padding: 20px;
      box-shadow: var(--shadow-sm);
    }

    .video-sandbox-title {
      font-size: 14px;
      font-weight: 700;
      color: var(--text-main);
      margin-bottom: 14px;
      display: flex;
      align-items: center;
      justify-content: space-between;
    }

    .video-player-frame {
      position: relative;
      background: #09090b;
      border-radius: var(--radius-md);
      overflow: hidden;
      aspect-ratio: 16 / 9;
      display: flex;
      align-items: center;
      justify-content: center;
      margin-bottom: 14px;
    }

    #localVideoPlayer {
      width: 100%;
      height: 100%;
      object-fit: contain;
      display: none;
    }

    /* Custom subtitle overlay text on player */
    .subtitle-live-overlay {
      position: absolute;
      bottom: 24px;
      left: 12px;
      right: 12px;
      text-align: center;
      pointer-events: none;
      z-index: 20;
    }

    .subtitle-live-text {
      display: inline-block;
      background: rgba(0, 0, 0, 0.78);
      color: #ffffff;
      font-family: var(--font-sans);
      font-size: 14px;
      font-weight: 700;
      padding: 4px 12px;
      border-radius: 6px;
      text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
      max-width: 90%;
      line-height: 1.4;
      transition: opacity 0.15s;
    }

    .video-drop-placeholder {
      padding: 24px 16px;
      text-align: center;
      color: #71717a;
    }

    .video-drop-placeholder svg {
      color: #a1a1aa;
      margin-bottom: 8px;
    }

    .video-actions-row {
      display: flex;
      align-items: center;
      gap: 10px;
      justify-content: space-between;
      flex-wrap: wrap;
    }

    /* ══ EXPORT DOCK ══ */
    /* ══ EXPORT DOCK (MINIMAL WHITE DESIGN) ══ */
    .export-dock {
      display: none;
      background: #ffffff;
      border: 1px solid var(--border);
      border-radius: var(--radius-xl);
      padding: 16px 20px;
      align-items: center;
      justify-content: space-between;
      box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04), 0 1px 3px rgba(0, 0, 0, 0.02);
      color: var(--text-main);
      flex-wrap: wrap;
      gap: 14px;
      margin-top: 24px;
    }

    .export-left {
      display: flex;
      align-items: center;
      gap: 10px;
    }

    .export-badge-dot {
      width: 8px;
      height: 8px;
      border-radius: 50%;
      background: #16a34a;
      box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.15);
      flex-shrink: 0;
    }

    .export-summary-text {
      font-size: 13.5px;
      font-weight: 600;
      color: var(--text-main);
      letter-spacing: -0.2px;
    }

    .export-summary-highlight {
      color: #2563eb;
      font-weight: 700;
    }

    .export-buttons-group {
      display: flex;
      align-items: center;
      gap: 8px;
      flex-wrap: wrap;
    }

    .btn-download-srt {
      background: #2563eb;
      color: #ffffff;
      border: 1px solid #1d4ed8;
      padding: 9px 18px;
      border-radius: var(--radius-md);
      font-size: 13px;
      font-weight: 700;
      font-family: inherit;
      display: inline-flex;
      align-items: center;
      gap: 7px;
      box-shadow: 0 2px 6px rgba(37, 99, 235, 0.25);
      transition: all 0.15s ease;
      cursor: pointer;
    }

    .btn-download-srt:hover {
      background: #1d4ed8;
      border-color: #1e40af;
      transform: translateY(-1px);
      box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
    }

    .btn-download-srt:active {
      transform: translateY(0);
    }

    .btn-download-vtt {
      background: #ffffff;
      color: var(--text-main);
      border: 1px solid var(--border);
      padding: 9px 16px;
      border-radius: var(--radius-md);
      font-size: 13px;
      font-weight: 600;
      font-family: inherit;
      display: inline-flex;
      align-items: center;
      gap: 7px;
      transition: all 0.15s ease;
      cursor: pointer;
      box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    }

    .btn-download-vtt:hover {
      background: var(--bg-subtle);
      border-color: var(--border-hover);
      color: #2563eb;
      transform: translateY(-1px);
    }

    .btn-download-vtt:active {
      transform: translateY(0);
    }

    .btn-copy-dock {
      background: #ffffff;
      color: var(--text-muted);
      border: 1px solid var(--border);
      padding: 9px 14px;
      border-radius: var(--radius-md);
      font-size: 12.5px;
      font-weight: 600;
      display: inline-flex;
      align-items: center;
      gap: 6px;
      transition: all 0.15s ease;
      cursor: pointer;
      box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    }

    .btn-copy-dock:hover {
      background: var(--bg-subtle);
      color: var(--text-main);
      border-color: var(--border-hover);
      transform: translateY(-1px);
    }

    /* ══ SEO SECTIONS (HOW IT WORKS, DRIFT GUIDE, FAQ) ══ */
    .seo-section {
      margin-top: 60px;
      margin-bottom: 40px;
    }

    .section-tag {
      font-size: 11.5px;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: 0.6px;
      color: var(--accent);
      margin-bottom: 8px;
    }

    .section-heading {
      font-size: 26px;
      font-weight: 800;
      letter-spacing: -0.6px;
      color: var(--text-main);
      margin-bottom: 24px;
    }

    .steps-grid {
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      gap: 20px;
      margin-bottom: 48px;
    }

    @media (max-width: 800px) {
      .steps-grid {
        grid-template-columns: 1fr;
      }
    }

    .step-card {
      background: #ffffff;
      border: 1px solid var(--border);
      border-radius: var(--radius-lg);
      padding: 24px;
      box-shadow: var(--shadow-sm);
    }

    .step-num {
      width: 32px;
      height: 32px;
      border-radius: 50%;
      background: var(--accent-light);
      color: var(--accent);
      border: 1px solid var(--accent-border);
      display: flex;
      align-items: center;
      justify-content: center;
      font-weight: 800;
      font-size: 13px;
      margin-bottom: 16px;
    }

    .step-title {
      font-size: 16px;
      font-weight: 700;
      margin-bottom: 8px;
      color: var(--text-main);
    }

    .step-desc {
      font-size: 13.5px;
      color: var(--text-muted);
      line-height: 1.55;
    }

    /* Comparison Table for Frame Rates & Troubleshooting Matrix */
    .comp-card {
      background: #ffffff;
      border: 1px solid var(--border);
      border-radius: var(--radius-lg);
      padding: 24px;
      box-shadow: var(--shadow-sm);
      margin-bottom: 48px;
    }

    .table-scroll-wrapper {
      width: 100%;
      overflow-x: auto;
      -webkit-overflow-scrolling: touch;
      border-radius: var(--radius-md);
      border: 1px solid var(--border);
      margin-top: 14px;
      margin-bottom: 8px;
      background: #ffffff;
    }

    .table-scroll-wrapper::-webkit-scrollbar {
      height: 6px;
    }

    .table-scroll-wrapper::-webkit-scrollbar-track {
      background: #f1f5f9;
      border-radius: 3px;
    }

    .table-scroll-wrapper::-webkit-scrollbar-thumb {
      background: #cbd5e1;
      border-radius: 3px;
    }

    .comp-table {
      width: 100%;
      min-width: 600px;
      border-collapse: collapse;
      font-size: 13.5px;
    }

    .table-scroll-wrapper .comp-table {
      border: none;
    }

    .comp-table th {
      text-align: left;
      padding: 12px 14px;
      border-bottom: 1.5px solid var(--border);
      font-size: 12.5px;
      font-weight: 700;
      color: var(--text-main);
      background: #f8fafc;
    }

    .comp-table td {
      padding: 14px;
      border-bottom: 1px solid var(--border);
      color: var(--text-muted);
    }

    .comp-table tr:last-child td {
      border-bottom: none;
    }

    /* FAQ Accordion */
    .faq-container {
      background: #ffffff;
      border: 1px solid var(--border);
      border-radius: var(--radius-xl);
      overflow: hidden;
      box-shadow: var(--shadow-sm);
      margin-bottom: 60px;
    }

    .faq-item {
      border-bottom: 1px solid var(--border);
    }

    .faq-item:last-child {
      border-bottom: none;
    }

    .faq-question-btn {
      width: 100%;
      padding: 20px 24px;
      background: #ffffff;
      border: none;
      display: flex;
      align-items: center;
      justify-content: space-between;
      text-align: left;
      font-size: 15px;
      font-weight: 700;
      color: var(--text-main);
      font-family: inherit;
      transition: background 0.15s, color 0.15s;
    }

    .faq-question-btn:hover {
      background: var(--bg-subtle);
      color: var(--accent);
    }

    .faq-chevron {
      color: var(--text-dim);
      transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1);
      flex-shrink: 0;
      margin-left: 12px;
    }

    .faq-question-btn[aria-expanded="true"] .faq-chevron {
      transform: rotate(180deg);
      color: var(--accent);
    }

    .faq-answer {
      display: none;
      padding: 0 24px 24px;
      font-size: 14px;
      color: var(--text-muted);
      line-height: 1.68;
    }

    .faq-answer p {
      margin-bottom: 12px;
    }

    .faq-answer p:last-child {
      margin-bottom: 0;
    }

    .faq-answer ul {
      margin: 8px 0 14px 22px;
      padding-left: 0;
    }

    .faq-answer li {
      margin-bottom: 6px;
    }

    .faq-answer strong {
      color: var(--text-main);
    }

    .faq-answer code {
      background: var(--bg-subtle);
      border: 1px solid var(--border-subtle);
      border-radius: 4px;
      padding: 1px 6px;
      font-family: var(--font-mono);
      font-size: 12.5px;
      color: var(--accent);
    }

    .faq-question-btn[aria-expanded="true"]+.faq-answer {
      display: block;
    }

    /* ══ SEO RICH CONTENT CARDS & MATRICES ══ */
    .seo-rich-block {
      margin-bottom: 52px;
    }

    .seo-grid-3 {
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      gap: 20px;
      margin-bottom: 32px;
    }

    .seo-grid-2 {
      display: grid;
      grid-template-columns: repeat(2, 1fr);
      gap: 20px;
      margin-bottom: 32px;
    }

    @media (max-width: 860px) {
      .seo-grid-3,
      .seo-grid-2 {
        grid-template-columns: 1fr;
      }
    }

    .seo-info-card {
      background: #ffffff;
      border: 1px solid var(--border);
      border-radius: var(--radius-lg);
      padding: 24px;
      box-shadow: var(--shadow-sm);
      transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
    }

    .seo-info-card:hover {
      box-shadow: 0 8px 24px -4px rgba(0, 0, 0, 0.08);
      transform: translateY(-2px);
      border-color: var(--border-hover);
    }

    .seo-card-icon {
      width: 42px;
      height: 42px;
      border-radius: var(--radius-md);
      background: #eff6ff;
      border: 1px solid #bfdbfe;
      color: var(--accent);
      display: flex;
      align-items: center;
      justify-content: center;
      margin-bottom: 16px;
    }

    .seo-card-title {
      font-size: 16px;
      font-weight: 700;
      color: var(--text-main);
      margin-bottom: 8px;
    }

    .seo-card-text {
      font-size: 13.5px;
      color: var(--text-muted);
      line-height: 1.6;
    }

    .seo-tag-row {
      display: flex;
      flex-wrap: wrap;
      gap: 6px;
      margin-top: 14px;
    }

    .seo-pill-tag {
      font-size: 11px;
      font-weight: 600;
      padding: 3px 8px;
      border-radius: var(--radius-full);
      background: var(--bg-subtle);
      border: 1px solid var(--border);
      color: var(--text-main);
    }

    .badge-fix {
      display: inline-block;
      font-size: 11px;
      font-weight: 700;
      padding: 2px 8px;
      border-radius: 4px;
      background: #ecfdf5;
      color: #059669;
      border: 1px solid #a7f3d0;
    }

    /* Toast */
    .toast {
      position: fixed;
      bottom: 28px;
      right: 28px;
      background: #09090b;
      border: 1px solid #27272a;
      box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
      color: #f4f4f5;
      padding: 12px 18px;
      border-radius: var(--radius-md);
      font-size: 13.5px;
      font-weight: 600;
      display: flex;
      align-items: center;
      gap: 9px;
      transform: translateY(80px);
      opacity: 0;
      pointer-events: none;
      transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.2s;
      z-index: 100000;
    }

    .toast.show {
      transform: translateY(0);
      opacity: 1;
    }

    /* Footer */
    .footer {
      border-top: 1px solid var(--border);
      padding-top: 32px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      font-size: 13px;
      color: var(--text-dim);
      flex-wrap: wrap;
      gap: 12px;
    }

    .footer-links {
      display: flex;
      gap: 18px;
    }

    .footer-links a {
      color: var(--text-dim);
      text-decoration: none;
      transition: color 0.15s;
    }

    .footer-links a:hover {
      color: var(--text-main);
    }

    /* ══ RESPONSIVE POLISH: TABLET & MOBILE VIEWPORTS ══ */
    @media (max-width: 900px) {
      .verification-split {
        grid-template-columns: 1fr;
      }
    }

    @media (max-width: 768px) {
      .app-shell {
        padding: 0 16px 60px;
      }

      .topbar {
        height: auto;
        min-height: 64px;
        padding: 12px 0;
        margin-bottom: 24px;
        flex-wrap: wrap;
        gap: 12px;
      }

      .studio-card {
        padding: 22px 18px;
        border-radius: var(--radius-lg);
        margin-bottom: 28px;
      }

      .dropzone-container {
        padding: 34px 18px;
      }

      .drop-actions-row {
        flex-direction: column;
        width: 100%;
      }

      .drop-actions-row button {
        width: 100%;
        justify-content: center;
      }

      .file-meta-bar {
        padding: 12px 14px;
      }

      .mode-tab-nav {
        gap: 2px;
        margin-bottom: 18px;
      }

      .mode-tab-btn {
        padding: 10px 14px;
        font-size: 13px;
      }

      .offset-main-row {
        flex-wrap: wrap;
        gap: 10px;
        justify-content: center;
      }

      .offset-input-wrap {
        min-width: 160px;
        flex: 1 1 auto;
      }

      .fps-presets-grid {
        grid-template-columns: 1fr;
      }

      .anchor-grid {
        grid-template-columns: 1fr;
      }

      .export-dock {
        flex-direction: column;
        align-items: stretch;
        gap: 14px;
        padding: 16px 18px;
      }

      .export-buttons-group {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        width: 100%;
      }

      .export-buttons-group button {
        flex: 1 1 130px;
        justify-content: center;
      }

      .steps-grid,
      .feature-grid {
        grid-template-columns: 1fr;
      }

      .comp-card,
      .history-card {
        padding: 20px 16px;
      }

      .troubleshoot-matrix th {
        width: auto !important;
        min-width: 130px;
      }
    }

    @media (max-width: 480px) {
      .app-shell {
        padding: 0 12px 50px;
      }

      .hero-title {
        font-size: 24px;
        letter-spacing: -0.5px;
      }

      .hero-desc {
        font-size: 14px;
      }

      .studio-card {
        padding: 16px 12px;
      }

      .dropzone-container {
        padding: 28px 12px;
      }

      .drop-title {
        font-size: 15.5px;
      }

      .drop-subtitle {
        font-size: 12px;
      }

      .file-meta-left {
        flex-wrap: wrap;
        gap: 6px;
      }

      .file-name-text {
        max-width: 180px;
      }

      .quick-nudge-bar {
        gap: 5px;
      }

      .nudge-pill {
        padding: 5px 8px;
        font-size: 11.5px;
      }

      .cue-scroll-area {
        max-height: 360px;
      }

      .cue-table-header {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
      }

      .cue-search-input {
        width: 100%;
      }

      .time-orig-strike,
      .time-new-bold {
        font-size: 11.5px;
      }

      .video-actions-row {
        flex-direction: column;
        align-items: stretch;
      }

      .video-actions-row button {
        width: 100%;
        justify-content: center;
      }

      .export-dock {
        padding: 14px 14px;
        border-radius: var(--radius-lg);
      }

      .export-summary-text {
        font-size: 13px;
      }

      .export-buttons-group {
        display: flex;
        flex-direction: row;
        flex-wrap: wrap;
        width: 100%;
        gap: 6px;
      }

      .export-buttons-group button {
        flex: 1 1 auto;
        padding: 7px 12px;
        font-size: 12px;
        height: 36px;
        justify-content: center;
      }
    }