:root {
  --bg: #ffffff; --mist: #f2f5f9; --line: #dde3ea; --text: #16202b; --muted: #5d6b7a;
  --blue: #1f6fd1; --blue-ink: #ffffff; --green: #1a8a4a; --yellow: #b77900; --yellow-bg: #fff6df;
  --red: #c8333a; --red-bg: #fdecec; --radius: 14px;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 17px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; -webkit-text-size-adjust: 100%; }
body.camming { overflow: hidden; }
main { padding: 12px 16px 120px; max-width: 720px; margin: 0 auto; }
h1 { font-size: 18px; margin: 0; flex: 1; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
h2 { font-size: 15px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 22px 0 8px; }
h3 { font-size: 14px; color: var(--muted); margin: 14px 0 6px; }
p { margin: 8px 0; }
.muted { color: var(--muted); } .small { font-size: 14px; }
.ok { color: var(--green); } .bad { color: var(--red); } .warnt { color: var(--yellow); }

header.top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 8px; padding: calc(env(safe-area-inset-top) + 8px) 12px 8px; background: var(--bg); border-bottom: 1px solid var(--line); }
header .logo { font-weight: 700; color: var(--blue); min-width: 44px; }
.icon { min-width: 44px; height: 44px; border: 0; background: none; font-size: 28px; color: var(--blue); }
.statusbars { position: sticky; top: 61px; z-index: 4; }
.bar { display: block; width: 100%; border: 0; padding: 10px 16px; font-size: 15px; text-align: left; }
.bar.info { background: var(--mist); color: var(--text); }
.bar.warn { background: var(--yellow-bg); color: #6b4700; font-weight: 600; }

.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 18px; border-radius: 12px; border: 1px solid var(--line); background: var(--mist); color: var(--text); font: inherit; font-weight: 600; }
.btn.primary { background: var(--blue); border-color: var(--blue); color: var(--blue-ink); }
.btn.ghost { background: none; }
.btn.danger { color: var(--red); border-color: var(--red); }
.btn.primary.danger { background: var(--red); color: #fff; }
.btn.big { width: 100%; min-height: 56px; font-size: 18px; margin: 8px 0; }
.btn.small { min-height: 38px; padding: 0 12px; font-size: 15px; }
.btn.light { color: #fff; border-color: rgba(255,255,255,.5); }
.btn:disabled { opacity: .45; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 8px; }
.row.end { justify-content: flex-end; } .row.spread { justify-content: space-between; margin: 10px 0; }

.row-card { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; width: 100%; text-align: left; margin: 8px 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg); font: inherit; color: inherit; }
.row-card .clip { flex-basis: 100%; color: var(--muted); font-size: 15px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.row-card.done { background: var(--mist); }
.row-card.done strong, .row-card.done .clip { text-decoration: line-through; color: var(--muted); }
.tag { font-size: 13px; padding: 2px 8px; border-radius: 999px; background: var(--mist); color: var(--muted); }
.tag.warn { background: var(--yellow-bg); color: var(--yellow); }
.pill { font-size: 13px; font-weight: 600; padding: 3px 9px; border-radius: 999px; background: var(--mist); color: var(--muted); }
.pill.ok { background: #e3f4ea; color: var(--green); } .pill.warn { background: var(--yellow-bg); color: var(--yellow); }
.dot { display: inline-block; width: 11px; height: 11px; border-radius: 50%; margin-right: 4px; }
.dot.green { background: var(--green); } .dot.yellow { background: #e6a400; } .dot.red { background: var(--red); }
.issue { padding: 10px 12px; border-radius: 12px; background: var(--yellow-bg); margin: 8px 0; }

.form label { display: block; font-size: 14px; font-weight: 600; color: var(--muted); margin: 16px 0 6px; }
.form label.check { display: flex; gap: 8px; align-items: center; color: var(--text); }
input, textarea, select { width: 100%; font: inherit; font-size: 17px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); color: var(--text); }
input[type=checkbox] { width: 22px; height: 22px; }
textarea { resize: vertical; }
.seg { display: flex; gap: 6px; flex-wrap: wrap; }
.seg button { flex: 1; min-height: 44px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); font: inherit; font-size: 15px; }
.seg button.on { background: var(--blue); border-color: var(--blue); color: #fff; }

.counts { display: grid; grid-template-columns: repeat(auto-fit, minmax(60px, 1fr)); gap: 8px; margin: 12px 0; }
.counts div { background: var(--mist); border-radius: 12px; padding: 10px 6px; text-align: center; }
.counts b { display: block; font-size: 24px; } .counts span { font-size: 13px; color: var(--muted); }
.unplaced { padding-left: 20px; color: var(--muted); font-size: 15px; }

details.sec { border: 1px solid var(--line); border-radius: var(--radius); margin: 12px 0; padding: 0 12px 8px; }
details.sec summary { display: flex; justify-content: space-between; align-items: center; min-height: 54px; font-weight: 700; list-style: none; }
details.sec summary::-webkit-details-marker { display: none; }
details.sec.complete summary .secname { text-decoration: line-through; color: var(--muted); }
details.sec .count { font-weight: 600; color: var(--muted); }
details.sec.complete .count { color: var(--green); }
details.more { margin-top: 28px; } details.more summary { color: var(--muted); min-height: 44px; }
details.more .btn { width: 100%; margin: 6px 0; }
.add { width: 100%; margin-top: 4px; }

.sticky { position: fixed; left: 0; right: 0; bottom: 0; padding: 10px 16px calc(env(safe-area-inset-bottom) + 10px); background: rgba(255,255,255,.96); border-top: 1px solid var(--line); z-index: 6; }
.sticky > * { max-width: 688px; margin-left: auto; margin-right: auto; }

.cardview .cardhead { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.cardview .code { font-size: 30px; font-weight: 800; }
.cardview .title { font-weight: 600; }
.who { font-size: 16px; }
.lines .line { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; margin: 8px 0; }
.lines .line.current { border: 2px solid var(--blue); }
.lines .line.got .ltext { color: var(--muted); }
.ltext { font-size: 20px; line-height: 1.35; }
.ltext .n { font-size: 13px; color: var(--muted); margin-right: 6px; }
.ltext .sp { font-weight: 700; color: var(--blue); }
details.fields { margin: 16px 0; border-top: 1px solid var(--line); padding-top: 8px; }
details.fields summary { min-height: 44px; font-weight: 600; color: var(--muted); }
.f { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--mist); font-size: 15px; }
.f span { color: var(--muted); } .f b { text-align: right; font-weight: 600; }

.checks { list-style: none; padding: 0; }
.checks li { padding: 12px 0; border-bottom: 1px solid var(--line); font-weight: 600; }
.checks li .btn { margin-top: 8px; }

.modal { position: fixed; inset: 0; background: rgba(10,20,30,.5); z-index: 20; display: flex; align-items: flex-end; justify-content: center; }
.modal .sheet { background: var(--bg); width: 100%; max-width: 720px; border-radius: 18px 18px 0 0; padding: 18px 16px calc(env(safe-area-inset-bottom) + 16px); max-height: 92vh; overflow: auto; }
.modal.player { flex-direction: column; align-items: center; justify-content: center; gap: 12px; background: #000; padding: 16px; }
.modal.player video { max-width: 100%; max-height: 75vh; }
.modal.player .who { color: #fff; }
.toast { position: fixed; left: 50%; bottom: calc(env(safe-area-inset-bottom) + 96px); transform: translateX(-50%); background: #16202b; color: #fff; padding: 12px 18px; border-radius: 12px; z-index: 40; max-width: 90vw; font-size: 15px; }

#cam { position: fixed; inset: 0; background: #000; z-index: 30; color: #fff; }
#cam video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
#cam .camtop { position: absolute; top: 0; left: 0; right: 0; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: calc(env(safe-area-inset-top) + 8px) 12px 8px; background: linear-gradient(rgba(0,0,0,.6), transparent); }
#cam .prompter { position: absolute; top: calc(env(safe-area-inset-top) + 64px); left: 12px; right: 12px; padding: 12px 14px; border-radius: 14px; background: rgba(0,0,0,.55); font-size: 24px; line-height: 1.3; font-weight: 600; }
#cam .prompter .sp { display: block; font-size: 14px; color: #9cc3ff; font-weight: 700; }
#cam .meter { position: absolute; left: 12px; right: 12px; bottom: calc(env(safe-area-inset-bottom) + 128px); height: 6px; border-radius: 3px; background: rgba(255,255,255,.25); overflow: hidden; }
#cam .meter div { height: 100%; width: 0; background: #3ad07a; transition: width .08s linear; }
#cam .meter div.clip { background: #ff5b5b; }
#cam .cambottom { position: absolute; left: 0; right: 0; bottom: 0; display: flex; justify-content: center; align-items: center; gap: 12px; padding: 16px 16px calc(env(safe-area-inset-bottom) + 24px); background: linear-gradient(transparent, rgba(0,0,0,.6)); }
#cam .rec { width: 76px; height: 76px; border-radius: 50%; border: 5px solid #fff; background: #e5484d; }
#cam .rec.on { border-radius: 22px; width: 64px; height: 64px; }
#cam .timer { font-size: 20px; font-weight: 700; min-width: 56px; }
#cam .timer.good { color: #3ad07a; }
