  :root{
    --bg: #f5f2ea;
    --panel: #ffffff;
    --panel-2: #f4f1e8;
    --line: #e2ddc9;
    --safelight: #c2632a;
    --safelight-soft: #f8dfc4;
    --safelight-dim: #fdf1e2;
    --text: #241e12;
    --muted: #7a715c;
    --muted-2: #9b937c;
    --lighttable: #fdfcf8;
    --good: #2e7d4f;
    --bad: #b3402f;
  }



  .section-box{
    background: var(--panel-2);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 18px;
    margin-bottom: 16px;
  }

  .label{
    display: block;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-bottom: 10px;
    color: var(--muted);
  }

  /* DROPZONE */
  .dropzone{
    border: 2px dashed var(--line);
    border-radius: 10px;
    padding: 30px 20px;
    text-align: center;
    cursor: pointer;
    transition: border-color .15s ease, background .15s ease;
  }
  .dropzone:hover, .dropzone.dragover{
    border-color: var(--safelight);
    background: var(--safelight-dim);
  }
  .dropzone .icon{ font-size: 28px; margin-bottom: 8px; }
  .dropzone .main{ font-size: 14px; font-weight: 600; }
  .dropzone .sub{ font-size: 12px; color: var(--muted); margin-top: 4px; }
  input[type=file]{ display: none; }

  /* FILM STRIP OF UPLOADS */
  .strip{
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-top: 14px;
  }
  .frame{
    flex: 0 0 auto;
    width: 96px;
    background: var(--lighttable);
    border-radius: 6px;
    padding: 6px;
    position: relative;
    box-shadow: 0 2px 8px rgba(0,0,0,0.4);
  }
  .frame img{
    width: 100%;
    height: 64px;
    object-fit: cover;
    border-radius: 3px;
    display: block;
    background:
      linear-gradient(45deg, #e5e2d8 25%, transparent 25%),
      linear-gradient(-45deg, #e5e2d8 25%, transparent 25%),
      linear-gradient(45deg, transparent 75%, #e5e2d8 75%),
      linear-gradient(-45deg, transparent 75%, #e5e2d8 75%);
    background-size: 10px 10px;
    background-position: 0 0, 0 5px, 5px -5px, -5px 0px;
  }
  .frame .fmt{
    text-align: center;
    font-family: 'JetBrains Mono', monospace;
    font-size: 9.5px;
    color: #6b5f42;
    margin-top: 4px;
    text-transform: uppercase;
    letter-spacing: .4px;
  }
  .frame .remove{
    position: absolute;
    top: 2px; right: 2px;
    width: 16px; height: 16px;
    border-radius: 50%;
    background: rgba(21,19,15,0.85);
    color: var(--safelight);
    border: none;
    font-size: 11px;
    line-height: 16px;
    cursor: pointer;
    padding: 0;
  }

  /* SETTINGS */
  .settings-grid{
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 14px;
  }

  .format-picker{ display: flex; gap: 8px; flex-wrap: wrap; }
  .format-chip{
    padding: 9px 16px;
    border-radius: 20px;
    border: 1px solid var(--line);
    background: var(--bg);
    color: var(--muted);
    font-family: 'JetBrains Mono', monospace;
    font-size: 12.5px;
    font-weight: 500;
    cursor: pointer;
  }
  .format-chip.active{
    background: var(--safelight-soft);
    border-color: var(--safelight);
    color: var(--safelight);
  }

  .field{ display: flex; flex-direction: column; gap: 6px; }
  .field .rowss{ display: flex; justify-content: space-between; align-items: baseline; }
  .field .val{ font-family: 'JetBrains Mono', monospace; color: var(--safelight); font-size: 12px; }
  input[type=range]{ width: 100%; accent-color: var(--safelight); }

  .btns{
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 16px;
    flex-wrap: wrap;
  }

  .app{
    padding: 11px 22px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 13.5px;
    font-family: 'Inter', sans-serif;
    color: #1a1109;
    background: linear-gradient(135deg, var(--safelight), #f0a366);
    transition: filter .15s ease;
  }
  .app:hover{ filter: brightness(1.08); }
  .app:disabled{ opacity: 0.5; cursor: not-allowed; }
  .gray{ background: var(--line); color: var(--text); }

  .empty-state{ text-align: center; color: var(--muted-2); padding: 26px 10px; font-size: 13.5px; }
  .loading{ text-align: center; padding: 26px 10px; color: var(--safelight); font-family: 'JetBrains Mono', monospace; font-size: 13px; }

  /* RESULTS */
  .result-grid{
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 14px;
  }
  .result-card{
    background: var(--lighttable);
    border-radius: 8px;
    overflow: hidden;
    color: #241e12;
  }
  .result-card img{
    width: 100%;
    height: 140px;
    object-fit: contain;
    display: block;
    background:
      linear-gradient(45deg, #e5e2d8 25%, transparent 25%),
      linear-gradient(-45deg, #e5e2d8 25%, transparent 25%),
      linear-gradient(45deg, transparent 75%, #e5e2d8 75%),
      linear-gradient(-45deg, transparent 75%, #e5e2d8 75%);
    background-size: 14px 14px;
    background-position: 0 0, 0 7px, 7px -7px, -7px 0px;
  }
  .result-info{ padding: 10px 12px; }
  .result-info .name{ font-size: 12.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .result-info .stats{
    font-family: 'JetBrains Mono', monospace;
    font-size: 10.5px;
    color: #6b5f42;
    margin-top: 3px;
    display: flex;
    justify-content: space-between;
  }
  .result-info .stats .shrink{ color: #2e7d4f; }
  .result-info .stats .grow{ color: #b3402f; }
  .result-info .dl-btn{
    width: 100%;
    margin-top: 8px;
    padding: 7px;
    border: none;
    border-radius: 5px;
    background: var(--safelight-dim);
    color: var(--safelight);
    font-size: 11.5px;
    font-weight: 600;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
  }
  .result-info .dl-btn:hover{ filter: brightness(1.3); }