/* hdrshot in the browser. One centered column like the desktop window,
   widened for the web. Colors are the desktop app's (crates/hdrshot-gui/src/theme.rs),
   and so is the font: the Inter subset it bundles. */
@font-face { font-family: "Inter"; font-weight: 400; font-display: swap; src: url("fonts/Inter-Regular.ttf") format("truetype"); }
@font-face { font-family: "Inter"; font-weight: 600; font-display: swap; src: url("fonts/Inter-SemiBold.ttf") format("truetype"); }
:root {
  --panel: #f3f5f8; --card: #ffffff; --inactive: #e8ecf1; --hovered: #dde3ea; --active: #d0d8e2;
  --border: #d5dbe3; --text: #1b1f27; --weak: #596170; --accent: #0f6fd8; --accent-soft: #dbe9fb;
  --ok: #1e8232; --error: #c42b1c; --heart: #dc465a; --thumb: #e8ecf1;
  --font: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  --radius: 8px; --radius-s: 6px;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --panel: #15181e; --card: #1d2129; --inactive: #262b35; --hovered: #2f3542; --active: #384050;
  --border: #2c323d; --text: #e6e9ef; --weak: #9aa0aa; --accent: #1f8ef1; --accent-soft: #19304a;
  --ok: #78c878; --error: #f26860; --heart: #dc465a; --thumb: #262b35; color-scheme: dark } }
:root[data-theme="dark"] {
  --panel: #15181e; --card: #1d2129; --inactive: #262b35; --hovered: #2f3542; --active: #384050;
  --border: #2c323d; --text: #e6e9ef; --weak: #9aa0aa; --accent: #1f8ef1; --accent-soft: #19304a;
  --ok: #78c878; --error: #f26860; --heart: #dc465a; --thumb: #262b35; color-scheme: dark }

[hidden] { display: none !important; }
html, body { min-height: 100%; }
body { background: var(--panel); color: var(--text); font: 14px/1.45 var(--font); }
.page { max-width: 760px; margin: 0 auto; padding-block: 24px 96px;
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));
  display: flex; flex-direction: column; gap: 16px; }
button, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: var(--inactive); border-radius: var(--radius-s); padding: 6px 12px; }
button:hover { background: var(--hovered); }
button:disabled { cursor: default; opacity: .55; }
button:disabled:hover { background: var(--inactive); }
button svg { flex: none; }
button:focus-visible, select:focus-visible, a:focus-visible, input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.weak { color: var(--weak); }
.num { font-variant-numeric: tabular-nums; }

/* Header */
header { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; margin-right: auto; }
.brand img { width: 30px; height: 30px; }
.brand h1 { font-size: 19px; font-weight: 600; margin: 0; letter-spacing: -0.01em; }
.tag { font-size: 12px; color: var(--weak); background: var(--inactive); border-radius: 99px; padding: 2px 9px; }
.desktop-link { background: var(--accent-soft); color: var(--accent); font-weight: 500; border-radius: var(--radius-s); padding: 6px 12px; }
.desktop-link:hover { text-decoration: none; filter: brightness(0.97); }

/* Desktop app notice */
.notice { display: grid; grid-template-columns: auto 1fr auto; gap: 4px 12px; align-items: start;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; }
.notice svg { margin-top: 2px; }
.notice h2 { font-size: 14px; font-weight: 600; margin: 0; }
.notice p { margin: 2px 0 0; color: var(--weak); max-width: 62ch; }
.notice .actions { grid-column: 2; display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.notice .close { background: transparent; padding: 2px; line-height: 0; color: var(--weak); }
.notice .close:hover { background: var(--hovered); }
.btn-accent { background: var(--accent); color: #fff; font-weight: 600; }
.btn-accent:hover, .btn-accent:disabled:hover { background: var(--accent); }
.btn-accent:hover:not(:disabled) { filter: brightness(1.08); }
#zip { display: inline-flex; gap: 6px; align-items: center; }
a.btn { display: inline-block; border-radius: var(--radius-s); padding: 6px 12px; }
a.btn:hover { text-decoration: none; }
a.btn-plain { background: var(--inactive); color: var(--text); }
a.btn-plain:hover { background: var(--hovered); }

/* List header */
.listbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.listbar .count { margin-right: auto; color: var(--weak); }
.privacy { display: flex; align-items: center; gap: 6px; color: var(--weak); font-size: 13px; }

/* Drop zone */
.drop { border: 2px dashed var(--border); border-radius: var(--radius); background: var(--card);
  padding: 48px 20px; display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.drop.over, body.dragging .drop { border-color: var(--accent); background: var(--accent-soft); }
body.dragging .rows { outline: 2px dashed var(--accent); outline-offset: 4px; border-radius: var(--radius); }
.drop h2 { font-size: 17px; font-weight: 600; margin: 4px 0 0; }
.drop p { margin: 0; color: var(--weak); }
.drop .formats { font-size: 13px; }
.drop button { margin-top: 6px; }

/* Rows */
.rows { display: flex; flex-direction: column; gap: 6px; }
.row { display: grid; grid-template-columns: 100px 1fr auto; gap: 14px; align-items: center;
  background: var(--card); border-radius: var(--radius); padding: 8px 12px 8px 8px; }
.row .thumb { padding: 0; background: var(--thumb); border-radius: 4px; line-height: 0; }
.row .thumb:disabled { opacity: 1; cursor: default; }
.row img, .row .ph { width: 100px; height: 56px; border-radius: 4px; object-fit: cover; background: var(--thumb); display: block; }
.row .info { min-width: 0; }
.row .name { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .meta { color: var(--weak); font-size: 13px; }
.row .meta.error { color: var(--error); }
.row .remove { background: transparent; padding: 4px; line-height: 0; color: var(--weak); visibility: hidden; }
.row:hover .remove, .row:focus-within .remove { visibility: visible; }
.row .remove:hover { background: var(--hovered); }
@media (hover: none) { .row .remove { visibility: visible; } }
.row .end { display: flex; align-items: center; gap: 8px; }
.dl { font-size: 13px; padding: 4px 10px; display: inline-flex; gap: 6px; align-items: center; }
.dl .size { color: var(--weak); }
.bar { height: 3px; background: var(--inactive); border-radius: 2px; margin-top: 6px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--accent); }
.status { width: 22px; height: 22px; flex: none; }
.spin { animation: spin 1s linear infinite; transform-origin: 50% 50%; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spin { animation: none; } }

.message { margin: -8px 0 0; color: var(--weak); font-size: 13px; }
.list-actions { display: flex; gap: 8px; }

/* Result */
.result { display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; align-items: center;
  border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; background: var(--card); }
.result .title { font-weight: 600; font-size: 15px; }
.result .actions { grid-column: 1 / -1; display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.result .note { grid-column: 1 / -1; color: var(--weak); font-size: 13px; margin-top: 8px; max-width: 64ch; }

/* Chips and convert */
.controls { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.chip { position: relative; }
.chip select { appearance: none; background: var(--card); border: 1px solid var(--border); border-radius: 99px;
  padding: 5px 28px 5px 12px; cursor: pointer; }
.chip select:hover { background: var(--hovered); }
.chip::after { content: ""; position: absolute; right: 12px; top: 50%; width: 6px; height: 6px; margin-top: -5px;
  border-right: 1.5px solid var(--text); border-bottom: 1.5px solid var(--text); transform: rotate(45deg); pointer-events: none; }
.icon-btn { line-height: 0; padding: 6px; background: var(--card); border: 1px solid var(--border); border-radius: 99px; }
.convert-row { display: flex; justify-content: flex-end; align-items: center; gap: 12px; flex-wrap: wrap; }
.convert-row .hint { color: var(--weak); font-size: 13px; margin-right: auto; }
.btn-big { font-size: 15px; padding: 9px 18px; }

/* Settings panel */
.settings { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; display: grid; gap: 14px; }
.settings h2 { margin: 0; font-size: 15px; }
.settings .grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px 20px; }
.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.field label { font-weight: 500; }
.field .help { color: var(--weak); font-size: 12.5px; }
.field select, .field input[type="number"] { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius-s); padding: 5px 8px; }
.check { display: flex; gap: 8px; align-items: flex-start; }
.check input { margin-top: 3px; accent-color: var(--accent); }
.check:has(input:disabled) { opacity: .55; }

.field input:invalid { border-color: var(--error); }

/* Large preview */
.viewer { border: 0; padding: 0; background: var(--card); color: var(--text); border-radius: var(--radius);
  max-width: min(1200px, calc(100vw - 32px)); max-height: calc(100vh - 32px); box-shadow: 0 12px 40px rgba(0,0,0,.4); }
.viewer::backdrop { background: rgba(0,0,0,.6); }
.viewer-bar { display: flex; align-items: center; gap: 12px; padding: 8px 8px 8px 16px; }
.viewer-bar span { margin-right: auto; font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.viewer .close { background: transparent; padding: 4px; line-height: 0; color: var(--weak); }
.viewer img { display: block; max-width: 100%; max-height: calc(100vh - 120px); margin: 0 auto; background: #000; }
.viewer p { margin: 0; padding: 8px 16px 12px; font-size: 12.5px; }

/* About: what the page is for, for people arriving from a search */
.about { margin-top: 40px; padding-top: 32px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 20px; }
.about h2 { font-size: 22px; font-weight: 600; line-height: 1.25; margin: 0; letter-spacing: -0.01em; text-wrap: balance; }
.about h3 { font-size: 15px; font-weight: 600; margin: 0 0 4px; }
.about p { margin: 0; color: var(--weak); }
.about .lead { font-size: 15px; color: var(--text); max-width: 68ch; }
.about code { font-size: 0.92em; background: var(--inactive); border-radius: 4px; padding: 1px 5px; overflow-wrap: anywhere; }
.compare { margin: 0; }
.compare img { display: block; width: 100%; height: auto; border-radius: var(--radius); background: #000; }
.compare figcaption { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 8px; font-size: 13px; color: var(--weak); }
.compare figcaption span:last-child { text-align: right; color: var(--text); font-weight: 500; }
.faq { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px 28px; }
.get { display: grid; grid-template-columns: 1fr auto; gap: 10px 20px; align-items: center;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
.get-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.get .install { grid-column: 1 / -1; font-size: 13px; }

/* Footer */
footer { display: flex; justify-content: center; gap: 6px 14px; flex-wrap: wrap; color: var(--weak); font-size: 12.5px; padding-top: 8px; }
footer .made { display: inline-flex; align-items: center; gap: 5px; }

@media (max-width: 520px) {
  .tag { display: none; }
  header { flex-wrap: nowrap; }
  .desktop-link { font-size: 13px; padding: 5px 10px; white-space: nowrap; }
  .row { grid-template-columns: 72px 1fr; }
  .row img, .row .ph { width: 72px; height: 40px; }
  .row .end { grid-column: 1 / -1; justify-content: flex-end; flex-wrap: wrap; }
  .notice { grid-template-columns: auto 1fr; }
  .notice .close { grid-row: 1; grid-column: 3; }
  .about h2 { font-size: 19px; }
  .faq { grid-template-columns: 1fr; }
  .get { grid-template-columns: 1fr; }
}
