:root {
  color-scheme: light dark;
  --bg:#f5f6fa; --card:#fff; --text:#171922; --muted:#596275;
  --line:#e1e5ee; --field:#f6f8fc; --accent:#005bd6; --soft:#eaf2ff;
  font:16px/1.5 -apple-system, BlinkMacSystemFont, "PingFang SC", system-ui, sans-serif;
}
@media(prefers-color-scheme:dark) {
  :root { --bg:#101117; --card:#1b1e27; --text:#f2f4fa; --muted:#aeb8cb;
    --line:#333948; --field:#141721; --accent:#8cbaff; --soft:#222f48; }
}
* { box-sizing:border-box; }
[hidden] { display:none !important; }
body { margin:0; background:var(--bg); color:var(--text); }
.top,main { max-width:680px; margin:auto; padding-inline:max(20px,env(safe-area-inset-left)) max(20px,env(safe-area-inset-right)); }
.top { display:flex; align-items:center; gap:12px; padding-top:calc(18px + env(safe-area-inset-top)); font-weight:750; }
.top img { border-radius:12px; }
.top small { display:block; color:var(--muted); font-size:.8125rem; font-weight:500; }
main { padding-bottom:calc(96px + env(safe-area-inset-bottom)); }
.hero { margin:34px 0 22px; }
h1,h2,p { margin:0; overflow-wrap:anywhere; }
h1 { font-size:2rem; line-height:1.24; margin-bottom:8px; letter-spacing:-.035em; }
h2 { font-size:1.125rem; }
p { color:var(--muted); }
.card { padding:18px; margin-bottom:14px; border:1px solid var(--line); border-radius:20px; background:var(--card); }
label,strong { font-weight:650; }
textarea { display:block; margin-top:10px; width:100%; min-height:115px; resize:vertical; font:inherit; background:var(--field); color:inherit; border:1px solid var(--line); border-radius:12px; padding:12px; }
textarea::placeholder { color:var(--muted); }
button,.button { display:inline-flex; justify-content:center; align-items:center; min-height:44px; padding:8px 13px; border:0; border-radius:12px; background:var(--soft); color:var(--accent); font:inherit; font-weight:650; text-decoration:none; cursor:pointer; text-align:center; }
.primary { background:#0863d7; color:#fff; }
button:disabled { opacity:.56; cursor:default; }
:focus-visible { outline:2px solid var(--accent); outline-offset:2px; }
.block { width:100%; margin-top:14px; }
.tools,.actions,.import { display:flex; align-items:center; gap:9px; }
.tools,.actions { flex-wrap:wrap; }
.tools { margin-top:10px; }
#detected,#clear-history { margin-inline-start:auto; }
#detected,.notice,.import p,#expiry { color:var(--muted); font-size:.875rem; }
.notice,#expiry { margin-top:10px; }
.actions { margin-top:12px; }
.permission { display:flex; align-items:center; gap:8px; margin-top:12px; font-size:.9rem; }
input[type=checkbox] { width:18px; height:18px; }
.import { justify-content:space-between; gap:12px; }
.import .button { flex-shrink:0; }
.import:focus-within .button { outline:2px solid var(--accent); outline-offset:2px; }
.visually-hidden { position:absolute; width:1px; height:1px; clip-path:inset(50%); overflow:hidden; }
.cover,video { display:block; width:100%; max-height:360px; object-fit:contain; border-radius:12px; margin-bottom:12px; background:var(--field); }
dl { display:grid; grid-template-columns:repeat(3,1fr); gap:8px; background:var(--field); padding:10px; border-radius:12px; text-align:center; font-size:.875rem; }
dt { color:var(--muted); }
dd { margin:3px 0 0; overflow-wrap:anywhere; }
progress { width:100%; accent-color:var(--accent); }
.entry { display:flex; align-items:center; gap:10px; padding:12px 0; border-bottom:1px solid var(--line); }
.entry img { width:46px; height:46px; border-radius:9px; object-fit:cover; }
.entry div { flex:1; min-width:0; overflow-wrap:anywhere; }
.entry time,.entry a { display:block; font-size:.875rem; }
.entry a { color:var(--accent); }
.instructions h2:not(:first-child) { margin-top:18px; }
nav { position:fixed; inset:auto 0 0; display:flex; justify-content:center; gap:4px; border-top:1px solid var(--line); background:var(--card); padding:6px max(10px,env(safe-area-inset-right)) calc(6px + env(safe-area-inset-bottom)) max(10px,env(safe-area-inset-left)); }
nav button { flex:1; max-width:145px; display:flex; flex-direction:column; gap:2px; color:var(--muted); background:transparent; font-size:.8125rem; }
nav button[aria-current] { background:var(--soft); color:var(--accent); }
nav svg { width:22px; height:22px; fill:none; stroke:currentColor; stroke-width:1.75; stroke-linecap:round; stroke-linejoin:round; }
