:root {
  --bg: #0f172a;
  --surface: #1e293b;
  --surface2: #334155;
  --text: #f1f5f9;
  --muted: #94a3b8;
  --primary: #2563eb;
  --primary2: #1d4ed8;
  --line: #334155;
  --ok: #34d399;
  --err: #f87171;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--text);
  font-family: -apple-system, "Hiragino Kaku Gothic ProN", "Noto Sans JP", sans-serif; }
#app { max-width: 560px; margin: 0 auto; min-height: 100vh; }
.screen { padding: 16px env(safe-area-inset-right) 40px env(safe-area-inset-left); padding-left: 16px; padding-right: 16px; }
.center { display: flex; align-items: center; justify-content: center; min-height: 90vh; }

.topbar { display: flex; align-items: center; gap: 12px; padding: 4px 0 16px; }
.topbar .title { font-size: 18px; font-weight: 600; flex: 1; }
.link { background: none; border: none; color: var(--primary); font-size: 15px; padding: 6px; }

h1 { font-size: 22px; margin: 0 0 4px; }
h3 { margin: 24px 0 8px; font-size: 16px; }
.muted { color: var(--muted); font-size: 14px; }
.err { color: var(--err); font-size: 14px; min-height: 18px; }
.ok { color: var(--ok); font-size: 14px; min-height: 18px; }

.card { background: var(--surface); border-radius: 16px; padding: 24px; width: 100%; }
.login { max-width: 320px; text-align: center; }
.login input { width: 100%; margin: 16px 0; }

input, textarea {
  width: 100%; background: var(--surface); color: var(--text);
  border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px;
  font-size: 16px; font-family: inherit;
}
textarea { resize: vertical; }
.field { margin: 12px 0; }
.field label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }

.btn { background: var(--surface2); color: var(--text); border: none; border-radius: 12px;
  padding: 14px 18px; font-size: 16px; font-weight: 600; }
.btn.primary { background: var(--primary); }
.btn.primary:active { background: var(--primary2); }
.btn.big { width: 100%; padding: 18px; font-size: 18px; margin-bottom: 20px; }
.actions { display: flex; gap: 10px; margin: 14px 0; }
.actions .btn { flex: 1; }

.list { display: flex; flex-direction: column; gap: 10px; }
.row { display: flex; gap: 12px; background: var(--surface); border-radius: 14px; padding: 12px; align-items: center; }
.thumb { width: 56px; height: 40px; border-radius: 8px; overflow: hidden; background: var(--surface2);
  display: flex; align-items: center; justify-content: center; flex: none; font-size: 20px; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.rowmain { flex: 1; min-width: 0; }
.rowtop { display: flex; align-items: center; gap: 8px; }
.name { font-weight: 600; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sub { color: var(--muted); font-size: 13px; margin-top: 2px; }

.badge { font-size: 11px; padding: 3px 8px; border-radius: 999px; white-space: nowrap; }
.st-captured { background: #475569; }
.st-extracted { background: #0e7490; }
.st-drafted { background: #b45309; }
.st-sent { background: #166534; }

.camwrap { position: relative; width: 100%; aspect-ratio: 3/4; background: #000; border-radius: 16px; overflow: hidden; }
.camwrap video, .camwrap img { width: 100%; height: 100%; object-fit: cover; }
.guide { position: absolute; inset: 18% 8%; border: 2px solid rgba(255,255,255,.85);
  border-radius: 10px; box-shadow: 0 0 0 2000px rgba(0,0,0,.25); pointer-events: none; }
.camfallback { display: flex; align-items: center; justify-content: center; height: 100%; padding: 24px; text-align: center; color: var(--muted); font-size: 14px; line-height: 1.7; }
.camctl { display: flex; justify-content: center; padding: 18px 0; }
.camctl .btn.big { width: 100%; }
.shutter { width: 72px; height: 72px; border-radius: 50%; background: #fff; border: 5px solid var(--surface2); }
.shutter:active { transform: scale(.94); }

.warmth { display: flex; gap: 8px; }
.warmth button { flex: 1; background: var(--surface); border: 1px solid var(--line); color: var(--text);
  border-radius: 12px; padding: 12px 6px; font-size: 14px; }
.warmth button.on { background: var(--primary); border-color: var(--primary); }

.cardimg { width: 100%; border-radius: 12px; margin-bottom: 12px; }

.shootcard { background: var(--surface); border-radius: 16px; padding: 28px 20px; text-align: center; margin-top: 8px; }
.shooticon { font-size: 56px; line-height: 1; margin-bottom: 4px; }
.shoothint { color: var(--muted); font-size: 14px; line-height: 1.7; margin: 10px 0 20px; }
.shootcard .btn.big { width: 100%; margin-bottom: 0; }
.shootcard .link { display: inline-block; margin-top: 14px; }
.preview { width: 100%; border-radius: 16px; }
