:root { --bg:#0f172a; --card:#1e293b; --fg:#f1f5f9; --mute:#94a3b8; --accent:#f59e0b; }
* { box-sizing: border-box; }
body { margin:0; font-family: system-ui, "Noto Sans Thai", "Sarabun", sans-serif; background:var(--bg); color:var(--fg); font-size:17px; line-height:1.5; }
#app { max-width:560px; margin:0 auto; padding:16px 16px 80px; }
h1 { font-size:1.4rem; margin:.2em 0 .6em; }
button, input, textarea { font:inherit; border-radius:12px; border:1px solid #334155; background:var(--card); color:var(--fg); padding:12px 14px; width:100%; margin:6px 0; }
button { cursor:pointer; width:auto; }
button.primary { background:var(--accent); color:#111; border:0; font-weight:700; width:100%; }
button.primary:disabled { opacity:.4; }
button.ghost { background:transparent; }
.tabs, .weights, .chips { display:flex; flex-wrap:wrap; gap:8px; }
.tab, .weights button, .chips button { flex:1 1 auto; padding:10px 12px; }
.tab.active, .weights .active, .chips .active { background:var(--accent); color:#111; border-color:var(--accent); }
.drop { display:flex; align-items:center; justify-content:center; min-height:160px; border:2px dashed #475569; border-radius:16px; margin:10px 0; overflow:hidden; color:var(--mute); cursor:pointer; }
.drop img { width:100%; max-height:340px; object-fit:contain; }
#status { color:#fca5a5; min-height:1.5em; }
.shot { background:var(--card); border-radius:14px; padding:12px 14px; margin:12px 0; break-inside:avoid; page-break-inside:avoid; }
.shot header { display:flex; justify-content:space-between; font-weight:700; color:var(--accent); margin-bottom:6px; }
.row { display:grid; grid-template-columns: 7.5em 1fr; gap:6px; padding:3px 0; }
.row b { color:var(--mute); font-weight:500; }
.meta { color:var(--mute); }
.hist-item { display:flex; gap:8px; align-items:center; }
.hist-item button:first-child { flex:1; text-align:left; }

.diagram { margin:4px 0 8px; }

@media print {
  body { background:#fff; color:#000; font-size:12pt; }
  #app > h1, .tabs, #pane-photo, #pane-video, #pane-history, #result-actions, #status { display:none !important; }
  .shot { background:#fff; border:1px solid #999; }
  .diagram svg { max-width:60%; }
  .row b, .meta, .shot header { color:#000; }
}
