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

    :root {
      --bg:       #0a0a0f;
      --bg2:      #111118;
      --bg3:      #1a1a24;
      --border:   #2a2a3a;
      --accent:   #7c6aff;
      --accent2:  #ff6a9b;
      --glow:     rgba(124,106,255,0.14);
      --text:     #e8e8f0;
      --text2:    #888899;
      --text3:    #444455;
      --success:  #4ade80;
      --error:    #f87171;
      --warn:     #fbbf24;
      --r:        12px;
      --r-sm:     8px;
      --mono:     'JetBrains Mono', monospace;
      --display:  'Syne', sans-serif;
    }

    html, body {
      min-height: 100vh;
      background: var(--bg);
      color: var(--text);
      font-family: var(--display);
      font-size: 15px;
      line-height: 1.6;
      -webkit-font-smoothing: antialiased;
    }

    /* ── Ambient glow top-right ── */
    body::before {
      content: '';
      position: fixed;
      top: -15%;
      right: -10%;
      width: 560px;
      height: 560px;
      background: radial-gradient(circle, rgba(124,106,255,0.07) 0%, transparent 70%);
      pointer-events: none;
      z-index: 0;
    }

    /* ── Layout ── */
    .app {
      position: relative;
      z-index: 1;
      max-width: 720px;
      margin: 0 auto;
      padding: 48px 24px 80px;
    }

    /* ── Header ── */
    .header {
      margin-bottom: 48px;
      animation: fadeUp 0.5s ease both;
    }
    .logo {
      font-size: 22px;
      font-weight: 800;
      letter-spacing: -0.5px;
      margin-bottom: 6px;
    }
    .logo span { color: var(--accent); }
    .subtitle {
      font-size: 13px;
      color: var(--text3);
      font-family: var(--mono);
    }

    /* ── Cards ── */
    .card {
      background: var(--bg2);
      border: 1px solid var(--border);
      border-radius: 16px;
      padding: 28px;
      margin-bottom: 16px;
      animation: fadeUp 0.5s ease both;
    }
    .card:nth-child(2) { animation-delay: 0.07s; }
    .card:nth-child(3) { animation-delay: 0.14s; }
    .card:nth-child(4) { animation-delay: 0.21s; }

    .card-label {
      font-size: 11px;
      font-weight: 700;
      letter-spacing: 1.2px;
      color: var(--text3);
      text-transform: uppercase;
      margin-bottom: 18px;
      display: flex;
      align-items: center;
      gap: 8px;
    }
    .card-label::after {
      content: '';
      flex: 1;
      height: 1px;
      background: var(--border);
    }

    /* ── Drop zone ── */
    .dropzone {
      border: 2px dashed var(--border);
      border-radius: var(--r);
      padding: 40px 24px;
      text-align: center;
      cursor: pointer;
      transition: all 0.2s;
      position: relative;
    }
    .dropzone:hover,
    .dropzone.drag-over {
      border-color: var(--accent);
      background: var(--glow);
    }
    .dropzone.has-file {
      border-color: var(--accent);
      border-style: solid;
      background: var(--glow);
    }
    .dropzone input[type="file"] {
      position: absolute;
      inset: 0;
      opacity: 0;
      cursor: pointer;
      width: 100%;
      height: 100%;
    }
    .dz-icon { font-size: 32px; margin-bottom: 10px; }
    .dz-title {
      font-weight: 700;
      font-size: 14px;
      margin-bottom: 4px;
    }
    .dz-sub {
      font-size: 12px;
      color: var(--text3);
      font-family: var(--mono);
    }
    .dz-file-name {
      font-family: var(--mono);
      font-size: 13px;
      color: var(--accent);
      font-weight: 500;
      margin-top: 6px;
    }

    /* ── Buttons ── */
    .btn {
      display: inline-flex;
      align-items: center;
      gap: 8px;
      padding: 11px 22px;
      border-radius: var(--r-sm);
      border: none;
      font-family: var(--display);
      font-size: 13px;
      font-weight: 700;
      cursor: pointer;
      transition: all 0.18s;
    }
    .btn:disabled { opacity: 0.45; cursor: not-allowed; }
    .btn-primary { background: var(--accent); color: #fff; }
    .btn-primary:not(:disabled):hover { opacity: 0.85; transform: translateY(-1px); }
    .btn-ghost {
      background: var(--bg3);
      color: var(--text2);
      border: 1px solid var(--border);
    }
    .btn-ghost:not(:disabled):hover { border-color: var(--accent); color: var(--text); }
    .btn-danger { background: rgba(248,113,113,0.12); color: var(--error); border: 1px solid rgba(248,113,113,0.25); }
    .btn-danger:not(:disabled):hover { background: rgba(248,113,113,0.2); }

    .btn-row {
      display: flex;
      gap: 10px;
      flex-wrap: wrap;
      margin-top: 18px;
    }

    /* ── Spinner ── */
    .spinner {
      width: 14px; height: 14px;
      border: 2px solid rgba(255,255,255,0.25);
      border-top-color: #fff;
      border-radius: 50%;
      animation: spin 0.7s linear infinite;
      flex-shrink: 0;
    }

    /* ── Status badge ── */
    .status-badge {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      padding: 5px 12px;
      border-radius: 20px;
      font-size: 12px;
      font-weight: 700;
      font-family: var(--mono);
    }
    .status-badge.idle    { background: var(--bg3); color: var(--text3); }
    .status-badge.running { background: rgba(251,191,36,0.12); color: var(--warn); }
    .status-badge.done    { background: rgba(74,222,128,0.12); color: var(--success); }
    .status-badge.error   { background: rgba(248,113,113,0.12); color: var(--error); }

    /* ── Output areas ── */
    .output-block {
      background: var(--bg3);
      border: 1px solid var(--border);
      border-radius: var(--r-sm);
      padding: 18px;
      font-family: var(--mono);
      font-size: 13px;
      line-height: 1.8;
      color: var(--text);
      white-space: pre-wrap;
      word-break: break-word;
      min-height: 80px;
      position: relative;
    }
    .output-block.placeholder { color: var(--text3); font-style: italic; }

    .output-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      margin-bottom: 10px;
    }
    .output-title {
      font-size: 12px;
      font-weight: 700;
      color: var(--text2);
      font-family: var(--mono);
      text-transform: uppercase;
      letter-spacing: 0.5px;
    }

    /* Copy button */
    .btn-copy {
      background: var(--bg3);
      border: 1px solid var(--border);
      color: var(--text3);
      padding: 4px 12px;
      border-radius: 6px;
      font-size: 11px;
      font-family: var(--mono);
      font-weight: 600;
      cursor: pointer;
      transition: all 0.15s;
    }
    .btn-copy:hover { border-color: var(--accent); color: var(--accent); }
    .btn-copy.copied { color: var(--success); border-color: var(--success); }

    /* ── Lang tag ── */
    .lang-tag {
      display: inline-block;
      background: var(--bg3);
      border: 1px solid var(--border);
      color: var(--text2);
      border-radius: 6px;
      padding: 3px 10px;
      font-family: var(--mono);
      font-size: 11px;
      font-weight: 600;
    }

    /* ── Markdown summary render ── */
    .summary-rendered h1 { font-size: 17px; font-weight: 800; margin-bottom: 10px; color: var(--accent); }
    .summary-rendered h2 { font-size: 14px; font-weight: 700; margin: 16px 0 6px; color: var(--text); }
    .summary-rendered h3 { font-size: 13px; font-weight: 700; margin: 12px 0 4px; color: var(--text2); }
    .summary-rendered p  { margin-bottom: 8px; font-family: var(--display); font-size: 14px; line-height: 1.8; }
    .summary-rendered ul, .summary-rendered ol { padding-left: 20px; margin-bottom: 8px; }
    .summary-rendered li { font-family: var(--display); font-size: 14px; margin-bottom: 4px; }
    .summary-rendered strong { color: var(--text); font-weight: 700; }

    /* ── Debug raw output ── */
    details {
      margin-top: 12px;
    }
    summary {
      font-size: 11px;
      color: var(--text3);
      font-family: var(--mono);
      cursor: pointer;
      user-select: none;
    }
    summary:hover { color: var(--text2); }

    /* ── Divider ── */
    .divider {
      height: 1px;
      background: var(--border);
      margin: 20px 0;
    }

    /* ── Animations ── */
    @keyframes fadeUp {
      from { opacity: 0; transform: translateY(10px); }
      to   { opacity: 1; transform: translateY(0); }
    }
    @keyframes spin {
      to { transform: rotate(360deg); }
    }
    @keyframes pulse {
      0%, 100% { opacity: 1; }
      50%       { opacity: 0.5; }
    }
    .pulsing { animation: pulse 1.2s ease-in-out infinite; }