:root { --accent: #2f6fed; --border: #c9ced6; --bg: #f7f8fa; --muted: #5b6573; --error: #b3261e; --ok: #1e7d46; }
* { box-sizing: border-box; }
/* Rules below set display on some elements, which would otherwise defeat the hidden attribute. */
[hidden] { display: none !important; }
body { margin: 0; font: 16px/1.5 system-ui, sans-serif; background: var(--bg); color: #1b1f24; }
main { max-width: 640px; margin: 0 auto; padding: 2rem 1rem; }
h1 { margin-bottom: .25rem; }
.lede { color: #555; margin-top: 0; }
.plan { font-size: .8rem; font-weight: 700; vertical-align: middle; padding: .15rem .55rem;
  background: var(--accent); color: #fff; border-radius: 999px; }

/* Developer switch: only rendered while DEV_PRO_TOGGLE is on */
.devbar { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; padding: .5rem 1rem;
  background: #fff4ce; border-bottom: 1px solid #e0c060; font-size: .85rem; }
.devbar span { color: #6b5a12; margin-right: auto; }
.devbar button { font: inherit; font-weight: 600; padding: .2rem .8rem; cursor: pointer;
  background: #fff; border: 1.5px solid #c9a227; border-radius: 6px; }
.devbar button[aria-pressed="true"] { background: #c9a227; color: #fff; }

#dropzone { display: block; padding: 2.5rem 1rem; text-align: center; background: #fff;
  border: 2px dashed var(--border); border-radius: 10px; cursor: pointer; }
#dropzone:hover, #dropzone:focus, #dropzone.over { border-color: var(--accent); outline: none; }
#dropzone input { display: none; }

/* The list of chosen images */
#batch { margin-top: 1rem; }
.batch-head { display: flex; justify-content: space-between; align-items: baseline; font-size: .9rem; font-weight: 600; }
#files { list-style: none; margin: .5rem 0 0; padding: 0; max-height: 19rem; overflow-y: auto;
  background: #fff; border: 1px solid var(--border); border-radius: 10px; }
#files li { display: grid; grid-template-columns: 40px 1fr auto auto; align-items: center; gap: .6rem;
  padding: .4rem .6rem; border-bottom: 1px solid #eceef2; }
#files li:last-child { border-bottom: 0; }
.thumb { width: 40px; height: 40px; object-fit: cover; border-radius: 6px; background: #e6e9ef; }
.about { min-width: 0; display: grid; }
.name { font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.note { font-size: .8rem; color: var(--muted); }
li[data-state="done"] .note { color: var(--ok); }
li[data-state="failed"] .note { color: var(--error); }
li[data-state="working"] .note { color: var(--accent); }
.link { font: inherit; font-size: .9rem; color: var(--accent); background: none; border: 0; padding: .2rem .3rem; cursor: pointer; }
.link:hover { text-decoration: underline; }
.remove { font-size: 1.2rem; line-height: 1; color: var(--muted); }
/* Nothing can be removed or cleared while a batch is converting. */
.running .remove, .running #clear { display: none; }

/* All the output settings, locked together while a batch runs */
#settings { margin: 0; padding: 0; border: 0; min-width: 0; }
#settings:disabled { opacity: .6; }

/* Presets: one tap sets every option */
.presets { display: flex; flex-wrap: wrap; gap: .5rem; margin: 1.25rem 0 1rem; }
.chip { font: inherit; font-size: .9rem; font-weight: 600; padding: .35rem .85rem; cursor: pointer;
  background: #fff; color: #1b1f24; border: 1.5px solid var(--border); border-radius: 999px; }
.chip:hover { border-color: var(--accent); }
.chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }

.field { display: grid; gap: .25rem; margin: 1rem 0; font-weight: 600; font-size: .9rem; }
.check { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; margin: .75rem 0; font-size: .95rem; }
.off { opacity: .5; }
select, input[type=number], input[type=text] { font: inherit; padding: .4rem .5rem; border: 1px solid var(--border); border-radius: 6px; }
input[type=number] { width: 6rem; }
input[type=text] { width: 11rem; }
input[type=color] { width: 2.5rem; height: 2rem; padding: 0; border: 1px solid var(--border); border-radius: 6px; background: #fff; }

details { margin: 1rem 0; padding: .25rem 1rem; background: #fff; border: 1px solid var(--border); border-radius: 10px; }
summary { padding: .5rem 0; font-weight: 600; cursor: pointer; }
details fieldset { margin: 1rem 0; padding: .25rem 1rem; border: 1px solid var(--border); border-radius: 8px; }
legend { padding: 0 .4rem; font-weight: 600; font-size: .9rem; }

.actions { display: flex; align-items: center; gap: 1rem; }
button[type=submit], .button { display: inline-block; font: inherit; font-weight: 600; padding: .65rem 1.25rem;
  background: var(--accent); color: #fff; border: 0; border-radius: 6px; cursor: pointer; text-decoration: none; }
button[type=submit]:disabled { background: #9aa6bf; cursor: not-allowed; }
progress { display: block; width: 100%; height: .5rem; margin-top: .75rem; accent-color: var(--accent); }

.hint { color: var(--muted); font-size: .85rem; font-weight: 400; }
p.hint { margin: .75rem 0 0; }
#status { min-height: 1.5em; }
#status.error { color: var(--error); }
#result { margin-top: 1rem; }
#preview { display: block; max-width: 100%; max-height: 320px; margin-bottom: 1rem;
  border: 1px solid var(--border); background: #fff; }
