:root {
  --bg: #f4f5f8;
  --panel: #ffffff;
  --ink: #1f2a44;
  --muted: #5b6478;
  --accent: #2f6fed;
  --accent-ink: #ffffff;
  --line: #dfe3ec;
  --ok: #1a7f4b;
  --err: #c0392b;
  --radius: 12px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); line-height: 1.5; }

header { max-width: 900px; margin: 0 auto; padding: 18px 20px 8px; }
.header-row { display: flex; align-items: center; gap: 14px; }
.app-logo { width: 46px; height: 46px; border-radius: 11px; flex-shrink: 0; }
header h1 { margin: 0; font-size: 1.6rem; letter-spacing: -0.02em; color: var(--accent); }
.brl-title { font-weight: 400; letter-spacing: 0.06em; }
.sub { margin: 6px 0 0; padding-left: 60px; color: var(--muted); font-size: 0.9rem; }
.toolbar { margin-left: auto; display: flex; gap: 8px; flex-shrink: 0; }
.icon-btn {
  width: 40px; height: 40px; padding: 0; border-radius: 50%; font-size: 1.2rem; font-weight: 700;
  background: var(--panel); color: var(--ink); border: 1.5px solid var(--line); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; line-height: 1;
  transition: background .15s, border-color .15s, color .15s;
}
/* larger settings button (holds the gear icon) */
.icon-btn-lg { width: 48px; height: 48px; }
/* SumIt-style highlight: fill with the accent colour, text/icon white */
.icon-btn:hover, .icon-btn:focus-visible {
  background: var(--accent); border-color: var(--accent); color: #fff;
}
.icon-btn svg { display: block; }
.adv-btn {
  height: 40px; padding: 0 16px; border-radius: 999px; font: inherit; font-weight: 600; font-size: .92rem;
  background: var(--accent); color: #fff; border: 0; cursor: pointer; white-space: nowrap;
  transition: filter .15s;
}
.adv-btn:hover, .adv-btn:focus-visible { filter: brightness(1.08); }

main { max-width: 900px; margin: 0 auto; padding: 10px 20px 40px; }

.dropzone {
  position: relative; border: 2.5px dashed #c4cddf; border-radius: 18px;
  background: linear-gradient(180deg, #ffffff 0%, #f7f9fe 100%);
  padding: 52px 24px 44px; text-align: center; cursor: pointer;
  transition: border-color .15s, background .15s, box-shadow .15s, transform .05s;
}
.dropzone:hover { border-color: #9fb0d6; box-shadow: 0 8px 24px rgba(31,42,68,.06); }
.dropzone.drag { border-color: var(--accent); background: #eaf1fe; box-shadow: 0 0 0 4px rgba(47,111,237,.14); }
.dropzone:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.dz-inner { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.dz-icon {
  width: 96px; height: 96px; display: grid; place-items: center; margin-bottom: 10px;
  border-radius: 50%; background: #eaf1fe; color: var(--accent); transition: transform .15s, background .15s;
}
.dropzone:hover .dz-icon { transform: translateY(-2px); }
.dropzone.drag .dz-icon { background: var(--accent); color: #fff; transform: scale(1.05); }
.dz-title { font-size: 1.3rem; font-weight: 700; margin: 0; letter-spacing: -0.01em; }
.dz-or { color: var(--muted); margin: 8px 0; font-size: 0.9rem; }
.dz-inner #chooseBtn { padding: 12px 30px; font-size: 1.02rem; border-radius: 10px; box-shadow: 0 6px 16px rgba(47,111,237,.28); }
.dz-formats { display: flex; flex-wrap: wrap; gap: 7px; justify-content: center; margin-top: 22px; }
.chip {
  font-size: 0.72rem; font-weight: 700; letter-spacing: .04em; color: var(--muted);
  background: #eef1f7; border: 1px solid #e0e5ef; border-radius: 999px; padding: 4px 11px;
}
.dz-file { margin: 16px 0 0; font-weight: 600; color: var(--accent); min-height: 1.2em; }

button {
  font: inherit; font-weight: 600; color: var(--accent-ink); background: var(--accent);
  border: 0; border-radius: 8px; padding: 10px 18px; cursor: pointer;
}
button:hover { filter: brightness(1.05); }
button:disabled { background: #aeb6c7; cursor: not-allowed; }
#chooseBtn { background: var(--ink); }
.icon-btn:disabled { background: var(--panel); }

.status { min-height: 1.3em; margin: 8px 2px; font-size: 1.05rem; color: var(--muted); text-align: center; }
.status.err { color: var(--err); font-weight: 600; }
.status.ok { color: var(--ok); }

.result { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.result-bar { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--line); }
#resultMeta { color: var(--muted); font-size: 0.9rem; }
.preview {
  margin: 0; padding: 16px; overflow-x: auto; background: #fbfbfd;
  font-family: "SF Mono", "Menlo", "Consolas", monospace; font-size: 13px; line-height: 1.35;
  white-space: pre; color: #222; max-height: 60vh;
}

/* dialogs */
.dialog { border: 0; border-radius: 14px; padding: 0; max-width: 520px; width: calc(100% - 32px); box-shadow: 0 24px 60px rgba(20,28,50,.28); color: var(--ink); }
.dialog::backdrop { background: rgba(20,28,50,.42); }
.dialog-body { padding: 18px 20px 20px; }
.dialog-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.dialog-head h2 { margin: 0; font-size: 1.2rem; }
.dialog .field { display: flex; flex-direction: column; gap: 4px; margin-top: 14px; }
.dialog .field-row { display: flex; gap: 14px; }
.dialog .field-row .field { flex: 1; }
.field label { font-size: 0.78rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
.field select, .field input { font: inherit; padding: 9px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; width: 100%; }
.dialog-foot { margin-top: 20px; display: flex; justify-content: flex-end; }

.help-content h3 { margin: 16px 0 4px; font-size: 0.98rem; }
.help-content p, .help-content li { font-size: 0.92rem; }
.help-content .help-note { color: var(--muted); font-style: italic; font-size: 0.84rem; }
.help-content ol, .help-content ul { margin: 4px 0; padding-left: 20px; }
.help-content code { background: #eef1f7; padding: 1px 5px; border-radius: 5px; font-size: 0.85em; }
.help-content a { color: var(--accent); }
.credits { list-style: none; padding-left: 0; }
.credits li { margin-bottom: 7px; padding-left: 14px; position: relative; }
.credits li::before { content: "•"; position: absolute; left: 0; color: var(--accent); }

@media (max-width: 560px) {
  header h1 { font-size: 1.3rem; }
  .sub { font-size: 0.82rem; padding-left: 0; }
}
