:root { --ink:#1f2a30; --muted:#64748b; --brand:#0f4c5c; --accent:#0f766e; --bg:#f3f7f7; --card:#fff; --line:#d7e2e3;
        --ok:#15803d; --warn:#b45309; --bad:#b91c1c; }
@media (prefers-color-scheme: dark) { :root { --ink:#e6eef0; --muted:#9fb1b8; --bg:#0f1a1e; --card:#17252b; --line:#2a3b42; --brand:#7cc5d3; --accent:#5fd0c2; } }
* { box-sizing: border-box; }
body { margin:0; font:16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color:var(--ink); background:var(--bg); }
main { max-width:960px; margin:0 auto; padding:12px 16px 32px; }
a { color:var(--accent); }
.top { display:flex; justify-content:space-between; align-items:center; padding:12px 16px; background:var(--brand); color:#fff; }
@media (prefers-color-scheme: dark) { .top { background:#0f4c5c; } }
.top .brand { color:#fff; text-decoration:none; font-weight:700; font-size:18px; }
.top form { margin:0; }
button { font:inherit; border:1px solid var(--line); background:var(--card); color:var(--ink); border-radius:10px; padding:10px 14px; cursor:pointer; }
button.link { background:none; border:0; color:#fff; text-decoration:underline; padding:4px; }
button.primary, .primary { background:var(--accent); border-color:var(--accent); color:#fff; }
button.danger { color:var(--bad); border-color:var(--bad); }
.card { background:var(--card); border:1px solid var(--line); border-radius:14px; padding:16px; margin:12px 0; }
.capture { display:grid; grid-template-columns:1fr 1fr; gap:12px; margin:8px 0 4px; }
.big { display:flex; align-items:center; justify-content:center; min-height:72px; border-radius:14px; font-weight:700; font-size:18px;
       border:1px solid var(--line); background:var(--card); cursor:pointer; text-align:center; padding:8px; }
.hidden-file { position:absolute; width:1px; height:1px; opacity:0; }
.summary { display:flex; gap:10px; align-items:center; margin:14px 2px 6px; color:var(--muted); }
.list { list-style:none; margin:0; padding:0; }
.list li { background:var(--card); border:1px solid var(--line); border-radius:12px; margin:8px 0; }
.list a { display:flex; gap:12px; align-items:center; padding:8px; color:inherit; text-decoration:none; }
.list img { width:56px; height:72px; object-fit:cover; border-radius:8px; background:var(--line); flex:none; }
.list .info { flex:1; min-width:0; display:flex; flex-direction:column; }
.list .info strong { white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.list .right { display:flex; flex-direction:column; align-items:flex-end; gap:4px; white-space:nowrap; }
.list .empty { padding:24px; text-align:center; color:var(--muted); }
.muted { color:var(--muted); } .small { font-size:13px; }
.chip { font-size:12px; font-weight:700; padding:2px 8px; border-radius:999px; border:1px solid currentColor; }
.chip.read, .chip.verified { color:var(--ok); } .chip.needs_review { color:var(--warn); } .chip.failed { color:var(--bad); } .chip.reading { color:var(--muted); }
.msg { background:var(--card); border:1px solid var(--line); border-radius:10px; padding:10px 12px; }
.err { color:var(--bad); font-weight:600; }
.hint { background:color-mix(in srgb, var(--warn) 12%, transparent); border-radius:10px; padding:8px 10px; }
.detail { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1.2fr); gap:16px; align-items:start; }
@media (max-width:720px) { .detail { grid-template-columns:1fr; } }
.photo img { width:100%; border-radius:12px; border:1px solid var(--line); display:block; max-height:80vh; object-fit:contain; background:var(--card); }
@media (max-width:720px) { .photo img { max-height:38vh; } }
.fields label, .login label { display:flex; flex-direction:column; gap:4px; margin:8px 0; font-size:14px; color:var(--muted); }
input, select, textarea { font:inherit; color:var(--ink); background:var(--bg); border:1px solid var(--line); border-radius:10px; padding:10px; width:100%; }
.two { display:grid; grid-template-columns:1fr 1fr; gap:10px; }
.row-head { display:flex; justify-content:space-between; align-items:center; gap:8px; }
.row-head h1 { font-size:20px; margin:0; overflow-wrap:anywhere; }
.fields .primary { width:100%; margin-top:8px; font-weight:700; }
.readings { width:100%; border-collapse:collapse; font-size:14px; }
.readings th, .readings td { text-align:left; padding:6px 4px; border-bottom:1px solid var(--line); }
.actions { display:flex; gap:10px; margin-top:12px; } .actions form { margin:0; }
.login { max-width:380px; margin:40px auto; } .login .primary { width:100%; margin-top:8px; }
.foot { text-align:center; color:var(--muted); font-size:12px; padding:16px; }
@media (max-width:420px) { .readings th:nth-child(2), .readings td:nth-child(2) { display:none; } }
