/* â”€â”€ Modal Overlay â”€â”€ */
    .modal-overlay {
      position: fixed;
      inset: 0;
      background: rgba(11, 39, 69, 0.55);
      backdrop-filter: blur(6px);
      z-index: 500;
      display: flex;
      align-items: center;
      justify-content: center;
      padding: 24px;
      opacity: 0;
      pointer-events: none;
      transition: opacity 0.25s ease;
    }
    .modal-overlay.open {
      opacity: 1;
      pointer-events: all;
    }
    .modal-box {
      background: #fff;
      border-radius: 16px;
      box-shadow: 0 32px 80px rgba(11, 39, 69, 0.22);
      width: 100%;
      max-width: 560px;
      max-height: 90vh;
      overflow-y: auto;
      transform: translateY(24px) scale(0.97);
      transition: transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.25s ease;
      opacity: 0;
      border: 1px solid rgba(192, 216, 224, 0.6);
    }
    .modal-box.modal-wide { max-width: 680px; }
    .modal-overlay.open .modal-box {
      transform: translateY(0) scale(1);
      opacity: 1;
    }
    .modal-head {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 16px;
      padding: 16px 18px 14px;
      border-bottom: 1px solid rgba(192, 216, 224, 0.7);
      position: sticky;
      top: 0;
      background: #fff;
      border-radius: 16px 16px 0 0;
      z-index: 1;
    }
    .modal-head-left {
      display: flex;
      align-items: center;
      gap: 14px;
    }
    .modal-icon {
      width: 38px;
      height: 38px;
      border-radius: 12px;
      background: linear-gradient(135deg, var(--teal), var(--navy-mid));
      color: white;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 16px;
      flex-shrink: 0;
    }
    .modal-title {
      font-size: 16px;
      font-weight: 600;
      color: var(--navy-deep);
    }
    .modal-subtitle {
      font-size: 13px;
      color: var(--muted);
      margin-top: 2px;
    }
    .modal-close {
      width: 36px;
      height: 36px;
      border-radius: 50%;
      border: 1px solid rgba(192, 216, 224, 0.7);
      background: rgba(232, 245, 248, 0.7);
      color: var(--muted);
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 15px;
      transition: background 0.2s, color 0.2s;
      flex-shrink: 0;
    }
    .modal-close:hover { background: #fee2e2; color: var(--danger); }
    .modal-body {
      padding: 16px 18px 18px;
    }
    .modal-footer {
      display: flex;
      align-items: center;
      justify-content: flex-end;
      gap: 10px;
      padding: 12px 18px;
      border-top: 1px solid rgba(192, 216, 224, 0.7);
      background: rgba(232, 245, 248, 0.4);
      border-radius: 0 0 16px 16px;
      position: sticky;
      bottom: 0;
    }
    .btn-ghost {
      display: inline-flex;
      align-items: center;
      gap: 8px;
      background: transparent;
      color: var(--muted);
      border: 1px solid rgba(169, 196, 206, 0.6);
      padding: 6px 12px;
      font-size: 14px;
      font-weight: 500;
      border-radius: 12px;
      cursor: pointer;
      transition: all 0.2s ease;
      width: auto;
    }
    .btn-ghost:hover { color: var(--navy); border-color: var(--navy); background: rgba(22, 58, 95, 0.05); }
    .btn-save {
      display: inline-flex;
      align-items: center;
      gap: 8px;
      background: linear-gradient(135deg, var(--teal) 0%, var(--navy-mid) 100%);
      color: white;
      border: none;
      padding: 6px 12px;
      font-size: 14px;
      font-weight: 500;
      border-radius: 12px;
      cursor: pointer;
      transition: all 0.2s ease;
      box-shadow: 0 10px 22px rgba(22, 58, 95, 0.18);
      width: auto;
    }
    .btn-save:hover { transform: translateY(-1px); box-shadow: 0 14px 28px rgba(22, 58, 95, 0.24); filter: brightness(1.05); }
    .header-actions {
      display: flex;
      align-items: center;
      gap: 10px;
      flex-wrap: wrap;
      justify-content: flex-end;
    }
    .sample-format-box {
      margin-top: 20px;
      padding: 18px;
      border-radius: 18px;
      background: linear-gradient(135deg, rgba(232, 245, 248, 0.92), rgba(255, 255, 255, 0.96));
      border: 1px solid rgba(192, 216, 224, 0.9);
    }
    .sample-format-box strong {
      display: block;
      color: var(--navy-deep);
      font-size: 14px;
      margin-bottom: 10px;
    }
    .sample-format-box code {
      display: block;
      padding: 12px 14px;
      border-radius: 12px;
      background: rgba(11, 39, 69, 0.06);
      color: var(--navy);
      font-family: 'JetBrains Mono', monospace;
      font-size: 13px;
      overflow-x: auto;
      white-space: pre-wrap;
    }
    .modal-note {
      margin-top: 14px;
      color: var(--muted);
      font-size: 13px;
      line-height: 1.6;
    }
    .filters-grid {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
      gap: 16px;
      margin-bottom: 24px;
    }
    .report-metrics {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
      gap: 16px;
      margin-bottom: 24px;
    }
    .report-metric {
      padding: 18px 20px;
      border-radius: 18px;
      background: linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(232, 245, 248, 0.88));
      border: 1px solid rgba(192, 216, 224, 0.9);
      box-shadow: 0 12px 24px rgba(18, 46, 74, 0.06);
    }
    .report-metric span {
      display: block;
      color: var(--muted);
      font-size: 12px;
      font-weight: 700;
      letter-spacing: 0.08em;
      text-transform: uppercase;
      margin-bottom: 10px;
    }
    .report-metric strong {
      font-size: 24px;
      color: var(--navy-deep);
    }
    .report-section {
      margin-top: 24px;
      padding-top: 24px;
      border-top: 1px solid rgba(192, 216, 224, 0.82);
    }
    .report-section:first-of-type {
      margin-top: 0;
      padding-top: 0;
      border-top: none;
    }
    .report-section-title {
      font-size: 17px;
      font-weight: 700;
      color: var(--navy-deep);
      margin-bottom: 14px;
      display: flex;
      align-items: center;
      gap: 10px;
    }
    .report-conversation {
      display: flex;
      flex-direction: column;
      gap: 14px;
    }
    .conversation-item {
      padding: 18px;
      border-radius: 18px;
      background: rgba(248, 251, 252, 0.96);
      border: 1px solid rgba(192, 216, 224, 0.78);
    }
    .conversation-question {
      color: var(--navy-deep);
      font-weight: 700;
      margin-bottom: 10px;
      line-height: 1.55;
    }
    .conversation-answer {
      color: var(--text);
      line-height: 1.7;
    }
    .workflow-list {
      display: flex;
      flex-direction: column;
      gap: 12px;
    }
    .workflow-step {
      display: flex;
      gap: 14px;
      align-items: flex-start;
      padding: 16px 18px;
      border-radius: 18px;
      background: rgba(232, 245, 248, 0.76);
      border: 1px solid rgba(169, 196, 206, 0.58);
    }
    .workflow-step-index {
      width: 30px;
      height: 30px;
      border-radius: 50%;
      background: linear-gradient(135deg, var(--teal), var(--navy-mid));
      color: white;
      font-size: 13px;
      font-weight: 700;
      display: flex;
      align-items: center;
      justify-content: center;
      flex-shrink: 0;
    }
    .report-loading {
      text-align: center;
      padding: 40px 20px;
      color: var(--muted);
    }
    .report-loading i {
      font-size: 26px;
      color: var(--teal);
      margin-bottom: 14px;
    }
    .report-header-card {
      padding: 22px;
      border-radius: 22px;
      background: linear-gradient(135deg, rgba(11, 39, 69, 0.96), rgba(46, 82, 128, 0.96));
      color: white;
      margin-bottom: 24px;
    }
    .report-header-meta {
      display: flex;
      flex-wrap: wrap;
      gap: 12px;
      margin-top: 12px;
    }
    .report-header-meta .badge {
      background: rgba(255, 255, 255, 0.14);
      color: white;
      border: 1px solid rgba(255, 255, 255, 0.18);
    }
    .export-actions {
      display: flex;
      gap: 8px;
      flex-wrap: wrap;
    }
    .view-toggle {
      display: inline-flex;
      gap: 8px;
      padding: 6px;
      border-radius: 999px;
      background: rgba(232, 245, 248, 0.88);
      border: 1px solid rgba(192, 216, 224, 0.9);
      margin-bottom: 16px;
    }
    .toggle-btn {
      border: none;
      background: transparent;
      color: var(--muted);
      padding: 9px 14px;
      border-radius: 999px;
      font-size: 13px;
      font-weight: 700;
      cursor: pointer;
      transition: all 0.2s ease;
    }
    .toggle-btn.active {
      background: linear-gradient(135deg, var(--teal), var(--navy-mid));
      color: white;
      box-shadow: 0 10px 20px rgba(22, 58, 95, 0.16);
    }
    .workflow-diagram {
      display: flex;
      flex-direction: column;
      gap: 18px;
    }
    .workflow-sequence {
      display: flex;
      flex-wrap: wrap;
      gap: 10px;
      align-items: center;
      padding: 16px 18px;
      border-radius: 18px;
      background: rgba(248, 251, 252, 0.96);
      border: 1px solid rgba(192, 216, 224, 0.82);
    }
    .sequence-chip {
      display: inline-flex;
      align-items: center;
      gap: 8px;
      padding: 10px 12px;
      border-radius: 14px;
      background: white;
      border: 1px solid rgba(192, 216, 224, 0.86);
      font-size: 13px;
      color: var(--navy);
      box-shadow: 0 8px 16px rgba(18, 46, 74, 0.05);
    }
    .sequence-chip strong {
      color: var(--teal);
      font-size: 11px;
      letter-spacing: 0.08em;
      text-transform: uppercase;
    }
    .sequence-arrow {
      color: var(--line-strong);
      font-weight: 700;
    }
    .swimlane-board {
      display: flex;
      flex-direction: column;
      gap: 16px;
    }
    .swimlane-row {
      display: grid;
      grid-template-columns: minmax(150px, 190px) minmax(0, 1fr);
      border: 1px solid rgba(192, 216, 224, 0.9);
      border-radius: 20px;
      overflow: hidden;
      background: rgba(251, 254, 255, 0.98);
    }
    .swimlane-label {
      padding: 20px 18px;
      background: linear-gradient(135deg, var(--navy), var(--navy-mid));
      color: white;
      font-size: 14px;
      font-weight: 700;
      display: flex;
      align-items: center;
    }
    .swimlane-steps {
      padding: 18px;
      display: flex;
      flex-wrap: wrap;
      gap: 12px;
      align-items: center;
      min-height: 96px;
      background:
        linear-gradient(90deg, rgba(192, 216, 224, 0.16) 0, rgba(192, 216, 224, 0.16) 1px, transparent 1px) 0 0 / 190px 100%,
        linear-gradient(180deg, rgba(255,255,255,0.98) 0%, rgba(247, 251, 252, 1) 100%);
    }
    .swimlane-step {
      display: inline-flex;
      align-items: center;
      gap: 10px;
      min-width: 170px;
      max-width: 230px;
      padding: 14px 16px;
      border-radius: 16px;
      background: white;
      border: 1px solid rgba(192, 216, 224, 0.86);
      box-shadow: 0 10px 20px rgba(18, 46, 74, 0.05);
    }
    .swimlane-step-index {
      width: 28px;
      height: 28px;
      border-radius: 50%;
      background: linear-gradient(135deg, var(--teal), var(--navy-mid));
      color: white;
      font-size: 12px;
      font-weight: 700;
      display: flex;
      align-items: center;
      justify-content: center;
      flex-shrink: 0;
    }
    .swimlane-step-arrow {
      color: var(--line-strong);
      font-size: 18px;
      font-weight: 700;
    }
    .swimlane-empty {
      color: var(--muted);
      font-style: italic;
    }
    .workflow-text-list {
      display: flex;
      flex-direction: column;
      gap: 12px;
    }
    .workflow-text-item {
      display: flex;
      gap: 12px;
      align-items: flex-start;
      padding: 16px 18px;
      border-radius: 18px;
      background: rgba(232, 245, 248, 0.76);
      border: 1px solid rgba(169, 196, 206, 0.58);
    }
    .workflow-text-item strong {
      min-width: 88px;
      color: var(--teal);
      font-size: 12px;
      letter-spacing: 0.08em;
      text-transform: uppercase;
      padding-top: 3px;
    }
    @media (max-width: 860px) {
      .swimlane-row {
        grid-template-columns: 1fr;
      }
      .swimlane-label {
        justify-content: center;
      }
    }
    .modal-link {
      display: inline-flex;
      align-items: center;
      gap: 8px;
      margin-top: 16px;
      color: var(--teal);
      font-weight: 600;
      text-decoration: none;
      cursor: pointer;
    }
    .modal-link:hover {
      color: var(--navy-mid);
    }
    .jargon-meaning {
      max-width: 440px;
      line-height: 1.6;
    }

    /* â”€â”€ Confirm Delete Dialog â”€â”€ */
    .confirm-dialog {
      background: #fff;
      border-radius: 24px;
      max-width: 420px;
      width: 100%;
      box-shadow: 0 32px 80px rgba(11, 39, 69, 0.24);
      padding: 32px 28px;
      text-align: center;
      transform: scale(0.94);
      opacity: 0;
      transition: all 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
    }
    .modal-overlay.open .confirm-dialog { transform: scale(1); opacity: 1; }
    .confirm-icon {
      width: 64px;
      height: 64px;
      border-radius: 50%;
      background: #fee2e2;
      color: var(--danger);
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 26px;
      margin: 0 auto 20px;
    }
    .confirm-title { font-size: 20px; font-weight: 700; color: var(--navy-deep); margin-bottom: 10px; }
    .confirm-body { font-size: 14px; color: var(--muted); line-height: 1.65; margin-bottom: 28px; }
    .confirm-actions { display: flex; gap: 12px; justify-content: center; }
    .btn-danger {
      display: inline-flex;
      align-items: center;
      gap: 8px;
      background: linear-gradient(135deg, #dc2626, #b91c1c);
      color: white;
      border: none;
      padding: 11px 22px;
      font-size: 14px;
      font-weight: 600;
      border-radius: 12px;
      cursor: pointer;
      transition: all 0.2s;
      width: auto;
      box-shadow: 0 10px 22px rgba(220, 38, 38, 0.25);
    }
    .btn-danger:hover { transform: translateY(-1px); filter: brightness(1.06); }

    /* Toast */
    #toast-container {
      position: fixed;
      bottom: 28px;
      right: 28px;
      z-index: 9999;
      display: flex;
      flex-direction: column;
      gap: 12px;
    }
    .toast {
      display: flex;
      align-items: center;
      gap: 12px;
      min-width: 280px;
      max-width: 380px;
      padding: 16px 20px;
      border-radius: 16px;
      background: white;
      box-shadow: 0 16px 32px rgba(11, 39, 69, 0.14);
      border-left: 4px solid var(--teal);
      font-size: 14px;
      font-weight: 500;
      color: var(--text);
      animation: slideInToast 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    }
    .toast i { font-size: 17px; color: var(--teal); }
    .toast-error { border-left-color: var(--danger); }
    .toast-error i { color: var(--danger); }
    .toast-warning { border-left-color: var(--amber); }
    .toast-warning i { color: var(--amber); }
    @keyframes slideInToast {
      from { transform: translateX(40px); opacity: 0; }
      to { transform: translateX(0); opacity: 1; }
    }
    @keyframes fadeOutToast {
      to { transform: translateX(40px); opacity: 0; }
    }

    /* btn-icon tweaks */
    .btn-icon.edit:hover { color: var(--teal); }
    .btn-icon.delete:hover { color: var(--danger); }
    .btn-icon { padding: 7px 9px; border-radius: 10px; border: 1px solid transparent; }
    .btn-icon:hover { border-color: rgba(192,216,224,0.6); background: rgba(232,245,248,0.7); }
    .btn-icon.delete:hover { border-color: #fca5a5; background: #fee2e2; }

    /* â”€â”€ File Upload Zone â”€â”€ */
    .file-upload-zone {
      border: 2px dashed rgba(169, 196, 206, 0.8);
      border-radius: 16px;
      padding: 22px 18px;
      text-align: center;
      cursor: pointer;
      background: rgba(232, 245, 248, 0.35);
      transition: border-color 0.2s ease, background 0.2s ease;
      position: relative;
    }
    .file-upload-zone:hover,
    .file-upload-zone.drag-over {
      border-color: var(--teal);
      background: rgba(14, 122, 138, 0.06);
    }
    .file-upload-zone input[type=file] {
      position: absolute;
      inset: 0;
      opacity: 0;
      cursor: pointer;
      width: 100%;
      height: 100%;
    }
    .file-upload-icon {
      font-size: 28px;
      color: var(--teal);
      margin-bottom: 8px;
    }
    .file-upload-label {
      font-size: 14px;
      font-weight: 600;
      color: var(--navy);
    }
    .file-upload-hint {
      font-size: 12px;
      color: var(--muted);
      margin-top: 4px;
    }
    .file-list {
      display: flex;
      flex-direction: column;
      gap: 8px;
      margin-top: 12px;
    }
    .file-chip {
      display: flex;
      align-items: center;
      gap: 10px;
      padding: 9px 12px;
      border-radius: 12px;
      background: rgba(232, 245, 248, 0.7);
      border: 1px solid rgba(169, 196, 206, 0.5);
      font-size: 13px;
      color: var(--navy);
    }
    .file-chip i { color: var(--teal); font-size: 15px; }
    .file-chip-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .file-chip-remove {
      background: none;
      border: none;
      color: var(--muted);
      cursor: pointer;
      padding: 2px 4px;
      border-radius: 6px;
      font-size: 13px;
      transition: color 0.2s;
    }
    .file-chip-remove:hover { color: var(--danger); }

    /* â”€â”€ Question Builder â”€â”€ */
    .question-list {
      display: flex;
      flex-direction: column;
      gap: 10px;
      margin-bottom: 10px;
    }
    .question-row {
      display: flex;
      align-items: center;
      gap: 8px;
    }
    .question-row .q-num {
      width: 26px;
      height: 26px;
      border-radius: 50%;
      background: var(--navy);
      color: white;
      font-size: 11px;
      font-weight: 700;
      display: flex;
      align-items: center;
      justify-content: center;
      flex-shrink: 0;
    }
    .question-row input {
      flex: 1;
    }
    .question-row .btn-remove-q {
      background: none;
      border: 1px solid rgba(192,216,224,0.6);
      color: var(--muted);
      cursor: pointer;
      width: 32px;
      height: 32px;
      border-radius: 8px;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 13px;
      transition: all 0.2s;
      flex-shrink: 0;
    }
    .question-row .btn-remove-q:hover { border-color: #fca5a5; background: #fee2e2; color: var(--danger); }
    .btn-add-question {
      display: inline-flex;
      align-items: center;
      gap: 8px;
      background: rgba(232, 245, 248, 0.8);
      border: 1px dashed rgba(14,122,138,0.5);
      color: var(--teal);
      padding: 9px 16px;
      font-size: 13px;
      font-weight: 600;
      border-radius: 12px;
      cursor: pointer;
      transition: all 0.2s;
      width: 100%;
      justify-content: center;
    }
    .btn-add-question:hover { background: rgba(14,122,138,0.1); border-color: var(--teal); }

    /* â”€â”€ Campaign Selector â”€â”€ */
    .campaign-selector {
      display: flex;
      flex-direction: column;
      gap: 4px;
      margin-left: 0;
      width: 240px;
      flex-shrink: 0;
    }
    .campaign-selector label {
      font-size: 11px;
      font-weight: 600;
      color: var(--muted);
      text-transform: uppercase;
      letter-spacing: 0.05em;
    }
    .campaign-selector select {
      min-width: 180px;
      padding: 6px 12px;
      border: 1px solid rgba(192, 216, 224, 0.7);
      border-radius: 8px;
      background: rgba(232, 245, 248, 0.5);
      color: var(--navy);
      font-size: 13px;
      font-weight: 500;
      cursor: pointer;
      transition: all 0.2s ease;
    }
    .campaign-selector select:focus {
      outline: none;
      border-color: var(--teal);
      background: white;
      box-shadow: 0 0 0 3px rgba(14, 122, 138, 0.1);
    }

    @media (max-width: 1180px) {
      .topbar-heading {
        flex-wrap: wrap;
      }

      .campaign-selector {
        width: min(100%, 320px);
      }

      .campaign-selector select {
        width: 100%;
        min-width: 0;
      }
    }

    @media (max-width: 960px) {
      .modal-overlay {
        padding: 16px;
      }

      .modal-head,
      .modal-body,
      .modal-footer {
        padding-left: 18px;
        padding-right: 18px;
      }

      .modal-footer {
        flex-wrap: wrap;
      }

      .modal-footer > * {
        flex: 1 1 180px;
        justify-content: center;
      }

      .header-actions {
        width: 100%;
        justify-content: stretch;
      }

      .header-actions > * {
        flex: 1 1 180px;
        justify-content: center;
      }

      .topbar-actions {
        width: 100%;
      }
    }

    @media (max-width: 640px) {
      #toast-container {
        left: 16px;
        right: 16px;
        bottom: 16px;
      }

      .toast {
        min-width: 0;
        max-width: none;
        width: 100%;
      }

      .campaign-selector {
        width: 100%;
      }

      .campaign-selector select {
        width: 100%;
      }

      .campaign-selector label {
        white-space: nowrap;
      }

      .question-row {
        flex-wrap: wrap;
      }

      .question-row input {
        flex-basis: 100%;
        min-width: 0;
      }

      .question-row .btn-remove-q {
        width: 100%;
      }

      .modal-box,
      .modal-box.modal-wide {
        max-width: 100%;
        border-radius: 22px;
      }

      .modal-head {
        border-radius: 22px 22px 0 0;
      }

      .modal-footer {
        border-radius: 0 0 22px 22px;
      }
    }
