/* ===== RESET & BASE ===== */
    * {
      margin: 0;
      padding: 0;
      box-sizing: border-box;
    }
    
    html {
      scroll-behavior: smooth;
    }
    
    body {
      font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
      background-color: #0a0a0a;
      color: #e0e0e0;
      line-height: 1.6;
      -webkit-font-smoothing: antialiased;
      -moz-osx-font-smoothing: grayscale;
      display: flex;
      flex-direction: column;
      min-height: 100vh;
    }
    
    /* ===== CONTAINER ===== */
    .container {
      max-width: 1400px;
      margin: 0 auto;
      padding: 0 20px;
      width: 100%;
    }
    
    /* ===== HEADER ===== */
    header {
      background: linear-gradient(135deg, #1a1a1a 0%, #0f0f0f 100%);
      border-bottom: 1px solid #333333;
      padding: 16px 0;
    }
    
    .header-content {
      display: flex;
      justify-content: space-between;
      align-items: center;
      gap: 40px;
    }
    
    .header-info h1 {
      font-size: 36px;
      font-weight: 700;
      color: #ffffff;
      margin-bottom: 4px;
      letter-spacing: -0.5px;
    }
    
    .header-info p {
      font-size: 14px;
      color: #b0b0b0;
    }
    
    .back-button {
      display: inline-flex;
      align-items: center;
      gap: 8px;
      background: #1a1a1a;
      border: 1px solid #333333;
      color: #00ff88;
      padding: 10px 20px;
      border-radius: 6px;
      font-size: 14px;
      font-weight: 600;
      cursor: pointer;
      text-decoration: none;
      transition: all 0.2s ease;
    }
    
    .back-button:hover {
      background: #252525;
      border-color: #00ff88;
    }
    
    /* ===== MAIN CONTENT ===== */
    main {
      flex: 1;
      padding: 30px 0;
    }
    
    /* ===== DEMO GRID ===== */
    .demo-grid {
      display: grid;
      grid-template-columns: 1fr 1fr 1fr;
      gap: 24px;
      margin-top: 20px;
    }
    
    @media (max-width: 1024px) {
      .demo-grid {
        grid-template-columns: 1fr;
      }
    }
    
    /* ===== PANEL STYLES ===== */
    .panel {
      background: linear-gradient(135deg, #1a1a1a 0%, #141414 100%);
      border: 1px solid #333333;
      border-radius: 12px;
      padding: 24px;
      min-height: 400px;
    }
    
    .panel-header {
      display: flex;
      align-items: center;
      gap: 12px;
      margin-bottom: 20px;
      padding-bottom: 16px;
      border-bottom: 1px solid #333333;
    }
    
    .panel-header .material-icons {
      font-size: 28px;
      color: #00ff88;
    }
    
    .panel-header h2 {
      font-size: 18px;
      font-weight: 600;
      color: #ffffff;
    }
    
    .panel-header .repo-link {
      margin-left: auto;
      font-size: 12px;
      color: #888888;
      text-decoration: none;
      display: flex;
      align-items: center;
      gap: 4px;
    }
    
    .panel-header .repo-link:hover {
      color: #00ff88;
    }
    
    /* ===== INPUT PANEL ===== */
    .input-group {
      margin-bottom: 20px;
    }
    
    .input-group label {
      display: block;
      font-size: 14px;
      font-weight: 500;
      color: #b0b0b0;
      margin-bottom: 8px;
    }
    
    .input-group input,
    .input-group select {
      width: 100%;
      padding: 12px 16px;
      background: #0f0f0f;
      border: 1px solid #333333;
      border-radius: 8px;
      color: #ffffff;
      font-size: 14px;
      font-family: inherit;
      transition: border-color 0.2s ease;
    }
    
    .input-group input:focus,
    .input-group select:focus {
      outline: none;
      border-color: #00ff88;
    }
    
    .input-group input::placeholder {
      color: #666666;
    }
    
    .run-button {
      width: 100%;
      padding: 14px 24px;
      background: linear-gradient(135deg, #00ff88 0%, #00cc6a 100%);
      border: none;
      border-radius: 8px;
      color: #0a0a0a;
      font-size: 16px;
      font-weight: 600;
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 8px;
      transition: all 0.2s ease;
      margin-top: 24px;
    }
    
    .run-button:hover:not(:disabled) {
      transform: translateY(-2px);
      box-shadow: 0 8px 24px rgba(0, 255, 136, 0.3);
    }
    
    .run-button:disabled {
      opacity: 0.6;
      cursor: not-allowed;
      transform: none;
    }
    
    .run-button.running {
      background: linear-gradient(135deg, #ffaa00 0%, #ff8800 100%);
    }
    
    /* ===== PROGRESS PANEL ===== */
    .workflow-status {
      display: flex;
      align-items: center;
      gap: 8px;
      margin-bottom: 16px;
      padding: 12px 16px;
      background: #0f0f0f;
      border-radius: 8px;
    }
    
    .status-indicator {
      width: 12px;
      height: 12px;
      border-radius: 50%;
      background: #666666;
    }
    
    .status-indicator.pending {
      background: #666666;
    }
    
    .status-indicator.in_progress {
      background: #ffaa00;
      animation: pulse 1.5s infinite;
    }
    
    .status-indicator.completed {
      background: #00ff88;
    }
    
    .status-indicator.failed {
      background: #ff4444;
    }
    
    @keyframes pulse {
      0%, 100% { opacity: 1; }
      50% { opacity: 0.5; }
    }
    
    .status-text {
      font-size: 14px;
      font-weight: 500;
      color: #ffffff;
    }
    
    .status-time {
      margin-left: auto;
      font-size: 12px;
      color: #888888;
    }
    
    /* ===== STEP LIST ===== */
    .step-list {
      list-style: none;
    }
    
    .step-item {
      display: flex;
      align-items: flex-start;
      gap: 12px;
      padding: 12px 0;
      border-bottom: 1px solid #222222;
    }
    
    .step-item:last-child {
      border-bottom: none;
    }
    
    .step-number {
      width: 28px;
      height: 28px;
      border-radius: 50%;
      background: #333333;
      color: #888888;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 12px;
      font-weight: 600;
      flex-shrink: 0;
    }
    
    .step-item.completed .step-number {
      background: #00ff88;
      color: #0a0a0a;
    }
    
    .step-item.in_progress .step-number {
      background: #ffaa00;
      color: #0a0a0a;
      animation: pulse 1.5s infinite;
    }
    
    .step-item.failed .step-number {
      background: #ff4444;
      color: #ffffff;
    }
    
    .step-content {
      flex: 1;
    }
    
    .step-title {
      font-size: 14px;
      font-weight: 500;
      color: #ffffff;
      margin-bottom: 2px;
    }
    
    .step-item.pending .step-title {
      color: #666666;
    }
    
    .step-message {
      font-size: 12px;
      color: #888888;
    }
    
    /* ===== RUN LINK ===== */
    .run-link {
      display: inline-flex;
      align-items: center;
      gap: 4px;
      margin-top: 16px;
      padding: 8px 12px;
      background: #252525;
      border-radius: 6px;
      font-size: 12px;
      color: #00ff88;
      text-decoration: none;
      transition: background 0.2s ease;
    }
    
    .run-link:hover {
      background: #333333;
    }
    
    /* ===== HOW IT WORKS ===== */
    .how-it-works {
      margin-top: 40px;
      padding: 24px;
      background: linear-gradient(135deg, #1a1a1a 0%, #141414 100%);
      border: 1px solid #333333;
      border-radius: 12px;
    }
    
    .how-it-works h3 {
      font-size: 20px;
      font-weight: 600;
      color: #ffffff;
      margin-bottom: 16px;
      display: flex;
      align-items: center;
      gap: 8px;
    }
    
    .how-it-works h3 .material-icons {
      color: #00ff88;
    }
    
    .flow-diagram {
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 16px;
      flex-wrap: wrap;
      padding: 24px 0;
    }
    
    .flow-step {
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 8px;
      padding: 16px 20px;
      background: #0f0f0f;
      border: 1px solid #333333;
      border-radius: 8px;
      min-width: 120px;
    }
    
    .flow-step .material-icons {
      font-size: 32px;
      color: #00ff88;
    }
    
    .flow-step span {
      font-size: 12px;
      color: #b0b0b0;
      text-align: center;
    }
    
    .flow-arrow {
      font-size: 24px;
      color: #444444;
    }
    
    /* ===== RATE LIMIT MESSAGE ===== */
    .rate-limit-message {
      padding: 12px 16px;
      background: #2a1a00;
      border: 1px solid #ff8800;
      border-radius: 8px;
      color: #ffaa00;
      font-size: 13px;
      display: none;
      margin-top: 16px;
    }
    
    .rate-limit-message.visible {
      display: block;
    }
    
    /* ===== ERROR MESSAGE ===== */
    .error-message {
      padding: 12px 16px;
      background: #2a0000;
      border: 1px solid #ff4444;
      border-radius: 8px;
      color: #ff6666;
      font-size: 13px;
      display: none;
      margin-top: 16px;
    }
    
    .error-message.visible {
      display: block;
    }
    
    /* ===== FOOTER ===== */
    footer {
      background: #0f0f0f;
      border-top: 1px solid #333333;
      padding: 20px 0;
      text-align: center;
    }
    
    footer p {
      font-size: 14px;
      color: #666666;
    }
    
    footer a {
      color: #00ff88;
      text-decoration: none;
    }
    
    footer a:hover {
      text-decoration: underline;
    }

    /* ===== TEMPLATE PICKER ===== */
    .template-picker {
      display: flex;
      gap: 10px;
    }

    .template-option {
      flex: 1;
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 6px;
      padding: 16px 8px;
      background: #1a1a1a;
      border: 2px solid #333;
      border-radius: 10px;
      cursor: pointer;
      transition: all 0.2s ease;
      color: #e0e0e0;
      font-size: 13px;
    }

    .template-option:hover {
      border-color: #555;
      background: #222;
    }

    .template-option.selected {
      border-color: #00ff88;
      background: #0a2a1a;
    }

    .template-icon {
      font-size: 28px;
    }

    .template-name {
      font-weight: 600;
    }

    /* ===== THEME PICKER ===== */
    .theme-picker {
      display: flex;
      gap: 10px;
    }

    .theme-swatch {
      width: 44px;
      height: 44px;
      border-radius: 50%;
      border: 3px solid transparent;
      cursor: pointer;
      transition: all 0.2s ease;
    }

    .theme-swatch:hover {
      transform: scale(1.15);
    }

    .theme-swatch.selected {
      border-color: #00ff88;
      box-shadow: 0 0 12px rgba(0, 255, 136, 0.4);
    }

    /* ===== DEMO INTRO ===== */
    .demo-intro {
      font-size: 13px;
      color: #888;
      margin-bottom: 16px;
      line-height: 1.5;
    }

    /* ===== COMPLETION CARD ===== */
    .completion-card {
      background: linear-gradient(135deg, #0a2a1a, #1a1a2e);
      border: 1px solid #00ff88;
      border-radius: 12px;
      padding: 24px;
      margin-top: 20px;
      text-align: center;
      animation: fadeInUp 0.5s ease;
    }

    .completion-card h3 {
      color: #00ff88;
      font-size: 20px;
      margin-bottom: 12px;
    }

    .completion-card .live-url {
      display: block;
      margin: 12px 0;
      padding: 12px 16px;
      background: #0f0f0f;
      border-radius: 8px;
      font-family: 'Courier New', monospace;
      font-size: 13px;
      color: #00b4d8;
      word-break: break-all;
    }

    .completion-card .action-buttons {
      display: flex;
      gap: 12px;
      justify-content: center;
      margin-top: 16px;
      flex-wrap: wrap;
    }

    .completion-card .action-buttons a,
    .completion-card .action-buttons button {
      padding: 10px 20px;
      border-radius: 6px;
      font-size: 14px;
      font-weight: 600;
      cursor: pointer;
      text-decoration: none;
      transition: all 0.2s ease;
    }

    .btn-open-page {
      background: #00ff88;
      color: #000;
      border: none;
    }

    .btn-open-page:hover {
      background: #00cc6a;
    }

    .btn-share {
      background: transparent;
      border: 1px solid #00ff88;
      color: #00ff88;
    }

    .btn-share:hover {
      background: #0a2a1a;
    }

    .btn-run-again {
      background: transparent;
      border: 1px solid #555;
      color: #ccc;
    }

    .btn-run-again:hover {
      border-color: #888;
      color: #fff;
    }

    /* ===== DELIVERY RECEIPT ===== */
    .delivery-receipt {
      margin-top: 20px;
      padding: 20px;
      background: #111;
      border: 1px solid #333;
      border-radius: 10px;
    }

    .delivery-receipt h4 {
      color: #b0b0b0;
      font-size: 14px;
      margin-bottom: 12px;
      text-transform: uppercase;
      letter-spacing: 0.5px;
    }

    .receipt-row {
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding: 8px 0;
      border-bottom: 1px solid #1a1a1a;
      font-size: 13px;
    }

    .receipt-row:last-child {
      border-bottom: none;
    }

    .receipt-label {
      color: #888;
    }

    .receipt-value {
      color: #e0e0e0;
      font-family: 'Courier New', monospace;
    }

    .receipt-value a {
      color: #00b4d8;
      text-decoration: none;
    }

    .receipt-value a:hover {
      text-decoration: underline;
    }

    @keyframes fadeInUp {
      from { opacity: 0; transform: translateY(20px); }
      to   { opacity: 1; transform: translateY(0); }
    }

    @media (max-width: 600px) {
      .template-picker {
        flex-direction: column;
      }
      .completion-card .action-buttons {
        flex-direction: column;
        align-items: center;
      }
    }

    /* ===== DEBUG PANEL ===== */
    .debug-panel {
      position: fixed;
      bottom: 0;
      left: 0;
      right: 0;
      max-height: 50vh;
      background: #0d0d0d;
      border-top: 2px solid #333;
      font-family: 'Courier New', monospace;
      font-size: 12px;
      color: #aaa;
      z-index: 9999;
      display: none;
      flex-direction: column;
    }

    .debug-panel.visible {
      display: flex;
    }

    .debug-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 8px 16px;
      background: #1a1a1a;
      border-bottom: 1px solid #333;
      flex-shrink: 0;
    }

    .debug-header span {
      font-weight: 600;
      color: #00ff88;
      font-size: 13px;
    }

    .debug-header button {
      background: none;
      border: 1px solid #555;
      color: #aaa;
      font-size: 11px;
      padding: 2px 10px;
      border-radius: 4px;
      cursor: pointer;
      margin-left: 8px;
    }

    .debug-header button:hover {
      border-color: #00ff88;
      color: #00ff88;
    }

    .debug-tabs {
      display: flex;
      gap: 0;
      border-bottom: 1px solid #333;
      flex-shrink: 0;
    }

    .debug-tab {
      padding: 6px 16px;
      background: none;
      border: none;
      color: #888;
      font-size: 12px;
      font-family: 'Courier New', monospace;
      cursor: pointer;
      border-bottom: 2px solid transparent;
    }

    .debug-tab.active {
      color: #00ff88;
      border-bottom-color: #00ff88;
    }

    .debug-content {
      flex: 1;
      overflow-y: auto;
      padding: 12px 16px;
    }

    .debug-content pre {
      white-space: pre-wrap;
      word-break: break-all;
    }

    .debug-stats {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
      gap: 8px;
      margin-bottom: 12px;
    }

    .debug-stat {
      padding: 6px 10px;
      background: #111;
      border: 1px solid #222;
      border-radius: 4px;
    }

    .debug-stat .label {
      color: #666;
      font-size: 10px;
      text-transform: uppercase;
    }

    .debug-stat .value {
      color: #e0e0e0;
      font-size: 13px;
      margin-top: 2px;
    }

    .debug-stat .value.ok {
      color: #00ff88;
    }

    .debug-stat .value.warn {
      color: #ffaa00;
    }

    .debug-stat .value.error {
      color: #ff4444;
    }

    .debug-timeline {
      list-style: none;
      padding: 0;
    }

    .debug-timeline li {
      padding: 4px 0;
      border-bottom: 1px solid #1a1a1a;
      display: flex;
      gap: 12px;
    }

    .debug-timeline .ts {
      color: #555;
      flex-shrink: 0;
      min-width: 85px;
    }

    .debug-timeline .evt {
      color: #ccc;
    }

    .debug-timeline .evt.error {
      color: #ff4444;
    }

    .debug-toggle {
      position: fixed;
      bottom: 16px;
      right: 16px;
      background: #1a1a1a;
      border: 1px solid #333;
      color: #00ff88;
      padding: 8px 14px;
      border-radius: 8px;
      font-size: 12px;
      font-weight: 600;
      cursor: pointer;
      z-index: 10000;
      font-family: 'Courier New', monospace;
      transition: all 0.2s ease;
    }

    .debug-toggle:hover {
      border-color: #00ff88;
      box-shadow: 0 0 12px rgba(0, 255, 136, 0.2);
    }

    .debug-toggle .poll-dot {
      display: inline-block;
      width: 8px;
      height: 8px;
      border-radius: 50%;
      background: #555;
      margin-right: 6px;
      vertical-align: middle;
    }

    .debug-toggle .poll-dot.active {
      background: #00ff88;
      animation: pulse 1.5s infinite;
    }

    /* Theme swatch backgrounds */
    .theme-swatch[data-theme="ocean"]    { background: linear-gradient(135deg, #0077b6, #00b4d8); }
    .theme-swatch[data-theme="sunset"]   { background: linear-gradient(135deg, #e63946, #f4a261); }
    .theme-swatch[data-theme="forest"]   { background: linear-gradient(135deg, #2d6a4f, #52b788); }
    .theme-swatch[data-theme="midnight"] { background: linear-gradient(135deg, #1a1a2e, #16213e); }
    .theme-swatch[data-theme="coral"]    { background: linear-gradient(135deg, #ff6b6b, #ffa07a); }

    /* One-off note / code blocks */
    .demo-note-green {
      margin-top: 24px;
      background: rgba(0, 255, 136, 0.04);
      border: 1px solid rgba(0, 255, 136, 0.2);
      border-radius: 8px;
      padding: 20px;
    }
    .demo-pre-code {
      background: #0a0a0a;
      border: 1px solid #333;
      border-radius: 6px;
      padding: 16px;
      font-family: 'JetBrains Mono', monospace;
      font-size: 12px;
      color: #b0b0b0;
      line-height: 1.6;
      margin: 0;
      overflow-x: auto;
    }
