@font-face { font-family:'Lato'; font-style:normal; font-weight:400; font-display:swap; src:url(/assets/fonts/lato-latin-400-normal.woff2) format('woff2'); unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family:'Lato'; font-style:normal; font-weight:400; font-display:swap; src:url(/assets/fonts/lato-latin-ext-400-normal.woff2) format('woff2'); unicode-range:U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family:'Lato'; font-style:normal; font-weight:700; font-display:swap; src:url(/assets/fonts/lato-latin-700-normal.woff2) format('woff2'); unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family:'Lato'; font-style:normal; font-weight:700; font-display:swap; src:url(/assets/fonts/lato-latin-ext-700-normal.woff2) format('woff2'); unicode-range:U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family:'Lato'; font-style:italic; font-weight:400; font-display:swap; src:url(/assets/fonts/lato-latin-400-italic.woff2) format('woff2'); unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family:'Lato'; font-style:italic; font-weight:400; font-display:swap; src:url(/assets/fonts/lato-latin-ext-400-italic.woff2) format('woff2'); unicode-range:U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }

/* ---------------------------------------------------------------- palette
   Light is the default. Dark applies when <html data-theme="dark"> (set by theme.js).
   To change the dark colours, edit only the second block. */
:root {
  --bg:#f4efe6; --card:#fffdf8; --field:#ffffff; --ink:#2b2622; --mute:#7d736a; --line:#ddd3c4;
  --acc:#b5502d; --on-acc:#ffffff; --heart:#c8374f; --over:#c0392b; --danger:#b3261e; --ok:#2e7d32;
}
:root[data-theme="dark"] {
  --bg:#181a1b; --card:#1e2123; --field:#1b1d1e; --ink:#e8e6e3; --mute:#a39e95; --line:#363b3d;
  --acc:#e0794f; --on-acc:#181a1b; --heart:#ee6a82; --over:#ff7b6b; --danger:#ff7b6b; --ok:#7fc88a;
}

* { box-sizing:border-box; }
body { margin:0; background:var(--bg); color:var(--ink); font:16px/1.6 Lato, system-ui, sans-serif; }
main { max-width:38rem; margin:0 auto; padding:1.5rem 1rem 3rem; }
a { color:var(--acc); }
.hidden { display:none !important; }
.top { display:flex; justify-content:space-between; align-items:center; gap:1rem; font-size:13px; }
.titlerow { display:flex; justify-content:space-between; align-items:baseline; gap:1rem; font-size:13px; }
h1 { margin:1.2rem 0 .1rem; font-size:2.4rem; font-weight:700; letter-spacing:-.01em; }
.sub { margin:0 0 1.4rem; color:var(--mute); font-style:italic; }
.muted { color:var(--mute); font-size:13px; }

.theme { display:inline-flex; border:1px solid var(--line); border-radius:999px; overflow:hidden; }
.theme button { background:none; border:0; color:var(--mute); font:inherit; font-size:12px; padding:.3rem .65rem; cursor:pointer; min-height:1.9rem; }
.theme button[aria-pressed="true"] { background:var(--acc); color:var(--on-acc); }

.card, .qa { background:var(--card); border:1px solid var(--line); border-radius:6px; padding:1rem 1.1rem; margin-bottom:.9rem; }
.card h2 { margin:0 0 .6rem; font-size:.8rem; font-weight:700; letter-spacing:.06em; text-transform:uppercase; color:var(--mute); }
.card h2.row { display:flex; justify-content:space-between; align-items:baseline; }

input[type=text], select { font:inherit; font-size:15px; padding:.6rem .7rem; border:1px solid var(--line); border-radius:4px; background:var(--field); color:var(--ink); width:100%; }
input:focus, select:focus, .btn:focus-visible { outline:2px solid var(--acc); outline-offset:-1px; }
label.lbl { display:block; margin:0 0 .2rem; font-size:12px; color:var(--mute); }
.grid2 { display:grid; grid-template-columns:1fr 1fr; gap:.7rem; }
.check { display:flex; align-items:center; gap:.5rem; margin:.6rem 0 .2rem; font-size:14px; color:var(--mute); cursor:pointer; }
.check input { width:1.1rem; height:1.1rem; accent-color:var(--acc); }
.stack > * + * { margin-top:.8rem; }

.btn { display:inline-flex; align-items:center; justify-content:center; gap:.5rem; font:700 14px Lato, system-ui, sans-serif; padding:.65rem 1.2rem; min-height:2.7rem; background:var(--acc); color:var(--on-acc); border:0; border-radius:4px; cursor:pointer; text-decoration:none; }
.btn.block { display:flex; width:100%; }
.btn.ghost { background:none; color:var(--acc); border:1px solid var(--line); }
.btn.ok { background:var(--ok); color:var(--bg); }
.btn.danger { background:var(--danger); color:var(--bg); }
.btn:disabled { cursor:progress; }
.chip { font:700 12px Lato, system-ui, sans-serif; padding:.3rem .6rem; min-height:1.9rem; background:none; color:var(--acc); border:1px solid var(--line); border-radius:4px; cursor:pointer; text-decoration:none; display:inline-flex; align-items:center; }
.chip.danger { color:var(--danger); }
.chip.fill { background:var(--danger); color:var(--bg); border-color:var(--danger); }
.link { background:none; border:0; padding:0; font:inherit; font-size:12px; color:var(--acc); cursor:pointer; }

.copyrow { position:relative; }
.copyrow input { padding-right:6.5rem; font-family:ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size:13px; }
.copyrow .btn { position:absolute; right:.3rem; top:.3rem; bottom:.3rem; min-height:0; padding:0 .8rem; font-size:12px; }
.copyrow.del input { color:var(--danger); }
.copyrow.del .btn { padding:0 .6rem; }

.drop { position:relative; display:block; border:2px dashed var(--line); border-radius:6px; padding:2.4rem 1rem; text-align:center; cursor:pointer; transition:border-color .15s, background-color .15s; }
.drop:hover, .drop.over { border-color:var(--acc); }
.drop input { position:absolute; inset:0; width:100%; height:100%; opacity:0; cursor:pointer; }
.drop .big { font-size:1.05rem; }
.progress { width:16rem; max-width:100%; margin:0 auto; }
.progress .pct { font-size:1.6rem; font-weight:700; color:var(--acc); }
.progress .track { height:.5rem; background:var(--line); border-radius:999px; overflow:hidden; margin:.3rem 0; }
.progress .fill { height:100%; width:0; background:var(--acc); transition:width .15s; }
.progress .name { font-size:12px; color:var(--mute); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.good { color:var(--ok); font-weight:700; }
.bad { color:var(--danger); font-weight:700; }

.qr { display:flex; flex-direction:column; align-items:center; gap:.3rem; padding:.5rem 0; }
.qr img { border-radius:4px; background:#fff; }

#history-list { display:grid; gap:.5rem; max-height:15rem; overflow-y:auto; }
.hrow { border:1px solid var(--line); border-radius:4px; padding:.5rem .6rem; background:var(--field); }
.hrow .line { display:flex; align-items:center; justify-content:space-between; gap:.6rem; }
.hrow .txt { min-width:0; display:flex; flex-direction:column; }
.hrow .nm { font-size:13px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.hrow .dt { font-size:11px; color:var(--mute); }
.hrow .btns { display:flex; gap:.3rem; flex-shrink:0; }
.hrow .thumb { width:2.6rem; height:1.8rem; object-fit:cover; border-radius:3px; flex-shrink:0; background:var(--line); }
.hrow .left { display:flex; align-items:center; gap:.6rem; min-width:0; }
.confirm { display:flex; align-items:center; justify-content:space-between; gap:.6rem; margin-top:.5rem; padding-top:.5rem; border-top:1px solid var(--line); font-size:12px; color:var(--mute); }

.result { margin-top:1.1rem; padding-top:1.1rem; border-top:1px solid var(--line); }
.vid { display:flex; gap:.8rem; margin-bottom:.8rem; }
.vid img { width:6rem; height:4rem; object-fit:cover; border-radius:4px; background:var(--line); }
.vid .t { font-weight:700; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.vid .m { font-size:12px; color:var(--mute); font-family:ui-monospace, Menlo, Consolas, monospace; }
.vid > div { min-width:0; }
.spin { width:1rem; height:1rem; border:2px solid currentColor; border-right-color:transparent; border-radius:50%; animation:spin .8s linear infinite; opacity:.8; }
@keyframes spin { to { transform:rotate(360deg); } }
.pulse { animation:pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity:.65; } }

.overlay { position:fixed; inset:0; z-index:50; display:flex; align-items:center; justify-content:center; padding:1rem; background:rgba(0,0,0,.6); }
.modal { position:relative; background:var(--card); border:1px solid var(--line); border-radius:8px; padding:1.5rem; display:flex; flex-direction:column; align-items:center; gap:.6rem; max-width:100%; }
.modal .x { position:absolute; top:.3rem; right:.6rem; background:none; border:0; color:var(--mute); font-size:1.5rem; line-height:1; cursor:pointer; min-width:2rem; min-height:2rem; }
.modal img { border-radius:4px; background:#fff; }
.modal .nm { max-width:16rem; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:13px; }

.qa h2 { margin:0 0 .4rem; font-size:1rem; }
.qa p, .qa ul { margin:.4rem 0; }
.qa ul { padding-left:1.2rem; }

/* The colours fade by animating the palette variables themselves, so every element follows the
   same value at the same time. theme.js sets .theme-fade for a moment after the visitor changes
   the mode. Browsers without @property support (before Chrome 85, Safari 16.4, Firefox 128)
   switch instantly. The fade also runs with "reduce motion" on: it moves nothing. */
@property --bg { syntax:'<color>'; inherits:true; initial-value:transparent; }
@property --card { syntax:'<color>'; inherits:true; initial-value:transparent; }
@property --field { syntax:'<color>'; inherits:true; initial-value:transparent; }
@property --ink { syntax:'<color>'; inherits:true; initial-value:transparent; }
@property --mute { syntax:'<color>'; inherits:true; initial-value:transparent; }
@property --line { syntax:'<color>'; inherits:true; initial-value:transparent; }
@property --acc { syntax:'<color>'; inherits:true; initial-value:transparent; }
@property --on-acc { syntax:'<color>'; inherits:true; initial-value:transparent; }
@property --heart { syntax:'<color>'; inherits:true; initial-value:transparent; }
@property --over { syntax:'<color>'; inherits:true; initial-value:transparent; }
@property --danger { syntax:'<color>'; inherits:true; initial-value:transparent; }
@property --ok { syntax:'<color>'; inherits:true; initial-value:transparent; }
:root.theme-fade { transition: --bg .3s ease, --card .3s ease, --field .3s ease, --ink .3s ease, --mute .3s ease, --line .3s ease, --acc .3s ease, --on-acc .3s ease, --heart .3s ease, --over .3s ease, --danger .3s ease, --ok .3s ease; }
