﻿.click-highlight {
      position: absolute;
      border: 3px solid #ef4444;
      border-radius: 50%;
      background: rgba(239, 68, 68, 0.25);
      pointer-events: none;
      z-index: 100;
      box-shadow: 0 0 8px 2px #ef444444;
      transition: opacity 0.2s;
    }

    * {
      box-sizing: border-box;
    }

    body {
      font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
      background-color: var(--page-bg);
      color: var(--text-primary);
      line-height: 1.6;
      min-height: 100vh;
      margin: 0;
      display: flex;
      flex-direction: column;
    }

    .docura-topbar {
      width: 100%;
      background: var(--gradient-topbar);
      border-bottom: 1px solid rgba(15, 23, 42, 0.08);
      box-shadow: 0 4px 18px rgba(15, 23, 42, 0.08);
      position: sticky;
      top: 0;
      z-index: 20;
    }

    .topbar-content {
      max-width: 1400px;
      margin: 0 auto;
      padding: 10px 40px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 24px;
    }

    .brand-cluster {
      display: flex;
      align-items: center;
      gap: 12px;
    }

    .brand-logo {
      width: 38px;
      height: 38px;
      object-fit: contain;
    }

    .brand-meta {
      display: flex;
      flex-direction: column;
      line-height: 1.1;
    }

    .brand-name {
      font-weight: 700;
      color: #0f172a;
      letter-spacing: 0.01em;
    }

    .brand-subtext {
      font-size: 0.75rem;
      color: #94a3b8;
    }

    .top-nav {
      display: flex;
      align-items: center;
      gap: 24px;
      flex-wrap: wrap;
    }

    .top-nav a.nav-link {
      text-decoration: none;
      color: #0f172a;
      font-weight: 500;
      position: relative;
      padding-bottom: 4px;
      transition: color 0.2s ease;
    }

    .top-nav a.nav-link::after {
      content: "";
      position: absolute;
      left: 0;
      bottom: 0;
      width: 100%;
      height: 2px;
      background: var(--primary-hover);
      transform: scaleX(0);
      transform-origin: left;
      transition: transform 0.2s ease;
    }

    .top-nav a.nav-link:hover,
    .top-nav a.nav-link:focus-visible {
      color: var(--primary-hover);
    }

    .top-nav a.nav-link:hover::after,
    .top-nav a.nav-link:focus-visible::after {
      transform: scaleX(1);
    }

    .profile-menu {
      position: relative;
    }

    .profile-trigger {
      display: inline-flex;
      align-items: center;
      gap: 8px;
      background: rgba(99, 102, 241, 0.12);
      border: 1px solid transparent;
      border-radius: 999px;
      padding: 4px 12px 4px 4px;
      color: #312e81;
      font-weight: 600;
      cursor: pointer;
      transition: all 0.2s ease;
    }

    .profile-trigger:hover,
    .profile-trigger:focus-visible {
      background: rgba(79, 70, 229, 0.2);
      border-color: rgba(79, 70, 229, 0.35);
      outline: none;
    }

    .avatar-initial {
      width: 30px;
      height: 30px;
      border-radius: 50%;
      background: linear-gradient(135deg, var(--primary), var(--primary-hover));
      color: #fff;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      font-weight: 700;
    }

    .profile-name {
      font-size: 0.85rem;
    }

    .chevron {
      font-size: 0.75rem;
      color: #5b21b6;
    }

    .profile-dropdown {
      position: absolute;
      right: 0;
      top: calc(100% + 10px);
      background: #ffffff;
      border-radius: 12px;
      border: 1px solid #e2e8f0;
      box-shadow: 0 18px 35px rgba(15, 23, 42, 0.12);
      min-width: 190px;
      padding: 8px 0;
      display: none;
      z-index: 30;
    }

    .profile-dropdown.open {
      display: block;
    }

    .profile-dropdown a {
      display: block;
      padding: 10px 18px;
      color: #0f172a;
      text-decoration: none;
      font-weight: 500;
      transition: background 0.2s ease;
    }

    .profile-dropdown a:hover,
    .profile-dropdown a:focus-visible {
      background: #eef2ff;
      outline: none;
    }

    header {
      padding: 24px 40px;
      padding-bottom: 0;
      margin: 0 auto;
      width: 100%;
      max-width: 1100px;
    }

    header h1 {
      margin: 0 0 8px 0;
      font-size: 1.55rem;
      font-weight: 700;
      color: #0f172a;
    }

    header p {
      margin: 0;
      color: #64748b;
      font-size: 0.85rem;
    }

    .status-banner {
      margin: 24px auto 0;
      background: white;
      border-radius: 12px;
      padding: 16px 24px;
      display: flex;
      align-items: flex-start;
      flex-wrap: wrap;
      gap: 16px;
      box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
      width: 100%;
      max-width: 1100px;
    }

    .status-text {
      color: #059669;
      font-weight: 500;
      font-size: 0.95rem;
      flex: 0 0 auto;
    }

    .status-badges {
      display: flex;
      flex-wrap: wrap;
      justify-content: flex-start;
      gap: 8px;
    }

    .badge {
      background: #f1f5f9;
      color: #475569;
      padding: 4px 10px;
      border-radius: 6px;
      font-size: 0.8rem;
      font-weight: 500;
    }

    .toolbar-container {
      margin: 20px auto;
      padding: 0 40px;
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
      gap: 12px;
      width: 100%;
      max-width: 1100px;
    }

    .toolbar-container .btn {
      width: 100%;
    }

    .main-grid {
      display: grid;
      grid-template-columns: minmax(0, 1fr);
      gap: 24px;
      padding: 0 40px 40px;
      flex: 1;
      width: 100%;
      max-width: 1100px;
      margin: 0 auto;
    }

    .doc-column {
      background: white;
      border-radius: 16px;
      box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
      padding: 24px;
      border: 1px solid #e2e8f0;
    }


    .btn {
      border: none;
      border-radius: 12px;
      padding: 12px 24px;
      font-size: 0.93rem;
      font-weight: 600;
      cursor: pointer;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 8px;
      transition: all 0.2s;
      white-space: nowrap;
      width: 100%;
    }

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

    .btn-primary {
      background: var(--primary);
      color: white;
      box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
    }

    .btn-primary:hover {
      background: var(--primary-hover);
      box-shadow: 0 6px 16px rgba(37, 99, 235, 0.3);
    }

    .btn-secondary {
      background: #e2e8f0;
      color: #334155;
    }

    .btn-secondary:hover {
      background: #cbd5e1;
    }

    .btn-danger {
      background: linear-gradient(135deg, var(--danger) 0%, var(--danger-dark) 100%);
      color: white;
      box-shadow: 0 10px 18px rgba(239, 68, 68, 0.25);
    }

    .btn-danger:hover {
      transform: translateY(-2px);
      box-shadow: 0 14px 24px rgba(239, 68, 68, 0.35);
    }

    .stats {
      background: var(--background);
      border: 1px solid var(--border);
      border-radius: var(--radius);
      padding: 16px 20px;
      margin: 0 0 20px 0;
      box-shadow: var(--shadow-sm);
      width: 100%;
    }

    .stats-grid {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
      gap: 20px;
    }

    .stat-item {
      text-align: center;
      position: relative;
      padding: 14px;
      border-radius: var(--radius);
      background: var(--gradient-surface);
      transition: transform 0.2s ease;
    }

    .stat-item:hover {
      transform: translateY(-2px);
    }

    .stat-number {
      font-size: 1.8rem;
      font-weight: 700;
      background: var(--gradient-primary);
      -webkit-background-clip: text;
      -webkit-text-fill-color: transparent;
      background-clip: text;
      margin-bottom: 4px;
      line-height: 1;
    }

    .stat-label {
      font-size: 0.75rem;
      color: var(--text-muted);
      text-transform: uppercase;
      letter-spacing: 1px;
      font-weight: 600;
    }

    .step-item {
      background: var(--background);
      border: 1px solid var(--border);
      border-radius: var(--radius);
      padding: 12px 20px;
      margin: 0 0 10px 0;
      transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
      position: relative;
      overflow: hidden;
      box-shadow: var(--shadow-sm);
      width: 100%;
    }

    .step-item::before {
      content: '';
      position: absolute;
      top: 0;
      left: 0;
      width: 4px;
      height: 100%;
      background: var(--gradient-primary);
      transform: scaleY(0);
      transition: transform 0.3s ease;
    }

    .step-item:hover {
      border-color: var(--primary-light);
      box-shadow: var(--shadow-lg);
      transform: translateY(-2px);
    }

    .step-item:hover::before {
      transform: scaleY(1);
    }

    .step-header {
      display: flex;
      align-items: flex-start;
      gap: 10px;
      margin-bottom: 8px;
    }

    .step-icon {
      width: 36px;
      height: 36px;
      border-radius: 8px;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 16px;
      flex-shrink: 0;
      box-shadow: var(--shadow-sm);
      transition: transform 0.2s ease;
    }

    .step-item:hover .step-icon {
      transform: scale(1.1);
    }

    .step-icon.click {
      background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
      color: var(--primary-hover);
    }

    .step-icon.input {
      background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%);
      color: #166534;
    }

    .step-icon.route {
      background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
      color: #92400e;
    }

    .step-icon.screenshot {
      background: linear-gradient(135deg, #e0e7ff 0%, #c7d2fe 100%);
      color: #5b21b6;
    }

    .step-icon.recording_start {
      background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
      color: #dc2626;
    }

    .step-icon.recording_stop {
      background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
      color: #6b7280;
    }

    .step-info {
      flex: 1;
      min-width: 0;
    }

    .step-action {
      font-size: 0.88rem;
      font-weight: 600;
      color: var(--text-primary);
      margin-bottom: 2px;
      line-height: 1.3;
    }

    .step-details {
      color: var(--text-secondary);
      margin-bottom: 6px;
      font-size: 0.8rem;
    }

    .step-meta {
      display: flex;
      flex-wrap: wrap;
      gap: 10px;
      font-size: 0.8rem;
      color: var(--text-muted);
    }

    .step-time {
      font-family: 'JetBrains Mono', 'Fira Code', monospace;
      background: var(--surface);
      padding: 4px 8px;
      border-radius: 4px;
      color: var(--text-secondary);
      font-weight: 600;
      font-size: 0.75rem;
      border: 1px solid var(--border);
    }

    .step-url {
      color: var(--accent);
      text-decoration: none;
      font-weight: 500;
      transition: color 0.2s ease;
    }

    .step-url:hover {
      text-decoration: underline;
      color: var(--primary);
    }

    .screenshot-container {
      margin-top: 12px;
      text-align: center;
    }

    .screenshot {
      max-width: 100%;
      max-height: 420px;
      width: auto;
      height: auto;
      object-fit: contain;
      border: 1px solid var(--border);
      border-radius: 8px;
      box-shadow: var(--shadow-md);
      transition: transform 0.3s ease;
      display: inline-block;
    }

    .screenshot:hover {
      transform: scale(1.01);
    }

    .manual-screenshot-img {
      max-width: 100% !important;
      max-height: 420px !important;
      width: auto !important;
      object-fit: contain !important;
      border-radius: 8px !important;
      box-shadow: var(--shadow-md) !important;
      display: inline-block !important;
    }

    .screenshot-placeholder {
      background: var(--surface);
      border: 2px dashed var(--border-hover);
      border-radius: var(--radius);
      padding: 48px;
      text-align: center;
      color: var(--text-muted);
    }

    .delete-btn {
      position: absolute;
      top: 10px;
      right: 10px;
      background: var(--danger);
      color: white;
      border: none;
      border-radius: 50%;
      width: 28px;
      height: 28px;
      display: flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      font-size: 12px;
      transition: all 0.2s ease;
      opacity: 0.85;
      box-shadow: var(--shadow-sm);
      z-index: 10;
    }

    .delete-btn:hover {
      background: var(--danger-dark);
      transform: scale(1.1);
      opacity: 1;
    }

    .delete-btn span {
      display: inline-block;
      width: 24px;
      height: 24px;
      background: var(--surface);
      border-radius: 50%;
      display: flex;
      align-items: center;
      justify-content: center;
      box-shadow: var(--shadow-sm);
      transition: background 0.2s;
      color: var(--text-secondary);
    }

    .empty-state {
      text-align: center;
      padding: 60px 20px;
      color: var(--text-muted);
      background: var(--background);
      border-radius: var(--radius-lg);
      border: 2px dashed var(--border);
    }

    .empty-state-icon {
      font-size: 3rem;
      margin-bottom: 16px;
      opacity: 0.6;
      background: var(--gradient-primary);
      -webkit-background-clip: text;
      -webkit-text-fill-color: transparent;
      background-clip: text;
    }

    .empty-state h3 {
      font-size: 1.25rem;
      margin-bottom: 8px;
      color: var(--text-primary);
      font-weight: 700;
    }

    .empty-state p {
      font-size: 0.9rem;
      margin: 0;
      color: var(--text-secondary);
    }

    @media (max-width: 768px) {
      .topbar-content {
        padding: 10px 20px;
      }

      header {
        padding: 20px;
      }

      header h1 {
        font-size: 1.6rem;
      }

      .status-banner {
        margin: 0 20px 16px;
      }

      .toolbar-container {
        margin: 20px;
        grid-template-columns: 1fr;
      }

      .main-grid {
        padding: 0 20px 20px;
      }

      .doc-column {
        padding: 20px;
      }

      .stats {
        padding: 24px;
        margin-bottom: 24px;
      }

      .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
      }

      .stat-item {
        padding: 16px;
      }

      .step-item {
        padding: 12px;
      }

      .step-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
      }

      .step-meta {
        flex-direction: column;
        gap: 8px;
      }

      .step-icon {
        width: 32px;
        height: 32px;
        font-size: 14px;
      }
    }

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

      header h1 {
        font-size: 1.5rem;
      }
    }

    /* Edit Mode Styles */
    body:not(.edit-mode) .edit-only {
      display: none !important;
    }

    body:not(.edit-mode) .delete-btn {
      display: none !important;
    }

    /* Comment/Transcript textarea is ALWAYS visible (not edit-mode dependent) */
    /* The transcript-section container handles visibility */

    body:not(.edit-mode) #personaSettings {
      display: none !important;
    }

    body.edit-mode #editModeBtn {
      background: linear-gradient(135deg, #10b981 0%, #059669 100%);
      color: white;
      border-color: #10b981;
    }

    /* Drag handle for reordering */
    .drag-handle {
      cursor: grab;
      padding: 4px 8px;
      color: var(--text-muted);
      font-size: 16px;
      user-select: none;
      display: flex;
      align-items: center;
      justify-content: center;
      border-radius: 4px;
      transition: all 0.2s;
    }

    .drag-handle:hover {
      background: var(--surface);
      color: var(--primary);
    }

    .drag-handle:active {
      cursor: grabbing;
    }

    .step-item.dragging {
      opacity: 0.5;
      transform: scale(1.02);
      box-shadow: var(--shadow-xl);
      z-index: 100;
    }

    .step-item.drag-over {
      border-color: var(--primary);
      border-style: dashed;
      background: rgba(99, 102, 241, 0.05);
    }

    /* Editable fields in edit mode */
    .editable-field {
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: 4px;
      padding: 4px 8px;
      font-size: inherit;
      color: inherit;
      width: 100%;
      transition: border-color 0.2s;
    }

    .editable-field:focus {
      outline: none;
      border-color: var(--primary);
      background: white;
    }

    .editable-field:not(:focus) {
      border-color: transparent;
      background: transparent;
    }

    body:not(.edit-mode) .editable-field {
      border: none;
      background: transparent;
      padding: 0;
      pointer-events: none;
    }

    /* Move buttons */
    .move-buttons {
      display: flex;
      flex-direction: column;
      gap: 2px;
      margin-left: 8px;
    }

    .move-btn {
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: 4px;
      padding: 2px 6px;
      cursor: pointer;
      font-size: 10px;
      color: var(--text-secondary);
      transition: all 0.2s;
    }

    .move-btn:hover {
      background: var(--primary);
      color: white;
      border-color: var(--primary);
    }

    /* Edit mode indicator */
    .edit-mode-banner {
      background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
      border: 1px solid #f59e0b;
      border-radius: var(--radius);
      padding: 10px 16px;
      margin: 0 0 16px;
      width: 100%;
      display: flex;
      align-items: center;
      justify-content: space-between;
      font-size: 0.9rem;
      color: #92400e;
      position: sticky;
      top: 10px;
      z-index: 100;
      box-shadow: var(--shadow-md);
    }

    .edit-mode-banner span {
      font-weight: 600;
    }

    body:not(.edit-mode) .edit-mode-banner {
      display: none !important;
    }

    /* Step number badge */
    .step-number {
      width: 32px;
      height: 32px;
      background: var(--primary);
      color: white;
      border-radius: 50%;
      display: flex;
      align-items: center;
      justify-content: center;
      font-weight: 700;
      font-size: 0.85rem;
      box-shadow: var(--shadow-md);
      flex-shrink: 0;
    }

    /* Selection checkbox */
    .step-checkbox {
      width: 22px;
      height: 22px;
      cursor: pointer;
      accent-color: var(--primary);
      flex-shrink: 0;
    }

    .step-item.selected {
      border-color: var(--primary);
      box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2), var(--shadow-md);
    }

    /* Edit controls row */
    .edit-controls-row {
      display: flex;
      align-items: center;
      gap: 12px;
      margin-bottom: 12px;
      padding-bottom: 12px;
      border-bottom: 1px solid var(--border);
    }

    body:not(.edit-mode) .edit-controls-row {
      display: none !important;
    }

    /* Floating reorder toolbar */
    .reorder-toolbar {
      position: fixed;
      bottom: 24px;
      left: 50%;
      transform: translateX(-50%);
      background: #1e293b;
      color: white;
      padding: 10px 16px;
      border-radius: 12px;
      display: flex;
      align-items: center;
      gap: 8px;
      box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
      z-index: 1000;
      animation: slideUp 0.2s ease;
    }

    @keyframes slideUp {
      from {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
      }

      to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
      }
    }

    .reorder-toolbar .selected-count {
      display: flex;
      align-items: center;
      gap: 8px;
      padding-right: 12px;
      border-right: 1px solid #475569;
      font-weight: 600;
      font-size: 0.9rem;
    }

    .reorder-toolbar .selected-count .icon {
      background: var(--primary);
      padding: 4px 8px;
      border-radius: 6px;
      font-size: 0.8rem;
    }

    .reorder-toolbar button {
      background: transparent;
      border: none;
      color: white;
      padding: 8px 10px;
      cursor: pointer;
      border-radius: 6px;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 1.1rem;
      transition: background 0.2s;
    }

    .reorder-toolbar button:hover {
      background: #334155;
    }

    .reorder-toolbar button:disabled {
      opacity: 0.4;
      cursor: not-allowed;
    }

    .reorder-toolbar button.deselect-btn {
      background: #475569;
      padding: 8px 14px;
      font-size: 0.85rem;
      font-weight: 500;
    }

    .reorder-toolbar button.deselect-btn:hover {
      background: #64748b;
    }

    .toolbar-divider {
      width: 1px;
      height: 24px;
      background: #475569;
      margin: 0 4px;
    }

    body:not(.edit-mode) .reorder-toolbar {
      display: none !important;
    }

    body:not(.edit-mode) .step-checkbox {
      display: none !important;
    }

    body:not(.edit-mode) .step-number {
      display: none !important;
    }
