  /* ---------- Reset & base ---------- */
  *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

  :root {
    --accent: rgb(129, 65, 123);
    --accent-light: rgba(129, 65, 123, 0.10);
    --accent-hover: rgb(110, 50, 105);
    --bg: rgb(255, 255, 255);
    --text: rgb(0, 0, 0);
    --text-muted: #555;
    --border: #ddd;
    --radius: 10px;
    --shadow: 0 2px 12px rgba(0,0,0,.08);
  }

  html { scroll-behavior: smooth; }

  body {
    font-family: 'Inter', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
  }

  a { color: var(--accent); }

  /* ---------- Header ---------- */
  header {
    background: var(--accent);
    color: #fff;
    text-align: center;
    padding: 2rem 1rem 1.6rem;
  }
  header h1 { font-size: 1.75rem; font-weight: 700; }
  header p { font-size: .95rem; opacity: .88; margin-top: .3rem; }

  header img#logo {
    -webkit-filter: brightness(0) invert(1);
    filter: brightness(0) invert(1);
    max-height: 60px;
    }

  /* ---------- Main container ---------- */
  .container {
    max-width: 740px;
    width: 100%;
    margin: 2rem auto;
    padding: 0 1rem;
    flex: 1;
  }

  /* ---------- Card ---------- */
  .card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
  }
  .card h2 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    color: var(--accent);
  }

  /* ---------- Drop zone ---------- */
  .dropzone {
    border: 2px dashed var(--accent);
    border-radius: var(--radius);
    padding: 3rem 1rem;
    text-align: center;
    cursor: pointer;
    transition: background .2s, border-color .2s;
    position: relative;
  }
  .dropzone.drag-over {
    background: var(--accent-light);
    border-color: var(--accent-hover);
  }
  .dropzone svg { width: 48px; height: 48px; color: var(--accent); margin-bottom: .75rem; }
  .dropzone p { color: var(--text-muted); }
  .dropzone .browse-link { color: var(--accent); font-weight: 600; text-decoration: underline; cursor: pointer; }
  #fileInput { display: none; }

  /* ---------- File list ---------- */
  .file-list { list-style: none; margin-top: 1rem; }
  .file-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .45rem .6rem;
    border-radius: 6px;
    font-size: .88rem;
  }
  .file-list li:nth-child(odd) { background: var(--accent-light); }
  .file-list li .name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .file-list li .size { color: var(--text-muted); margin: 0 .75rem; white-space: nowrap; }
  .file-list li .remove-btn {
    background: none; border: none; color: #c0392b; cursor: pointer; font-size: 1.1rem; padding: 0 .3rem;
  }

  /* ---------- Settings ---------- */
  .settings-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .85rem 1.25rem;
  }
  @media (max-width: 500px) { .settings-grid { grid-template-columns: 1fr; } }

  .field label {
    display: block;
    font-size: .82rem;
    font-weight: 600;
    margin-bottom: .25rem;
    color: var(--text-muted);
  }
  .field select,
  .field input[type="number"] {
    width: 100%;
    padding: .5rem .6rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-family: inherit;
    font-size: .9rem;
    outline: none;
    transition: border-color .2s;
  }
  .field select:focus,
  .field input:focus { border-color: var(--accent); }

  .field .range-row { display: flex; align-items: center; gap: .6rem; }
  .field input[type="range"] { flex: 1; accent-color: var(--accent); }
  .field .range-val { min-width: 2.4rem; text-align: center; font-weight: 600; font-size: .9rem; }

  .field .hint { font-size: .75rem; color: var(--text-muted); margin-top: .15rem; }

  /* ---------- Buttons ---------- */
  .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    padding: .7rem 1.6rem;
    border: none;
    border-radius: 8px;
    font-family: inherit;
    font-size: .95rem;
    font-weight: 600;
    cursor: pointer;
    transition: background .2s, opacity .2s;
  }
  .btn-primary { background: var(--accent); color: #fff; }
  .btn-primary:hover { background: var(--accent-hover); }
  .btn-primary:disabled { opacity: .5; cursor: not-allowed; }
  .btn-secondary { background: var(--accent-light); color: var(--accent); }

  .actions { margin-top: 1.25rem; display: flex; gap: .75rem; flex-wrap: wrap; align-items: center; }

  /* ---------- Progress / status ---------- */
  .progress-wrap { margin-top: 1rem; display: none; }
  .progress-wrap.visible { display: block; }
  .progress-bar-outer {
    height: 8px;
    background: var(--accent-light);
    border-radius: 4px;
    overflow: hidden;
  }
  .progress-bar-inner {
    height: 100%;
    background: var(--accent);
    width: 0%;
    transition: width .3s;
    border-radius: 4px;
  }
  .status-text { font-size: .85rem; color: var(--text-muted); margin-top: .4rem; }

  .error-text { color: #c0392b; font-size: .88rem; margin-top: .6rem; }

  /* ---------- Footer ---------- */
  footer {
    text-align: center;
    padding: 1.2rem 1rem;
    font-size: .8rem;
    color: var(--text-muted);
    border-top: 1px solid var(--border);
  }

  /* ---------- Busy overlay ---------- */
  .busy-overlay {
    display: none;
    position: fixed; inset: 0;
    background: rgba(255,255,255,.7);
    z-index: 999;
    align-items: center;
    justify-content: center;
  }
  .busy-overlay.visible { display: flex; }
  .spinner {
    width: 48px; height: 48px;
    border: 4px solid var(--accent-light);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin .7s linear infinite;
  }
  @keyframes spin { to { transform: rotate(360deg); } }
