:root { font: 15px system-ui, sans-serif; color: #17212b; background: #e4e9eb; color-scheme: light; }
* { box-sizing: border-box; }
body { margin: 0; height: 100dvh; overflow: hidden; display: flex; flex-direction: column; }
header { flex: none; background: #f7f9fa; padding: max(8px, env(safe-area-inset-top)) 12px 8px;
  border-bottom: 1px solid #ccd5da; z-index: 3; }
[data-look=toolbar], .secondary { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
[data-look=brand] { font-size: 18px !important; font-weight: 700; margin-right: 10px; }
button, select { font: inherit; border: 1px solid #bdc9cf; border-radius: 7px; background: white;
  color: inherit; min-height: 36px; padding: 5px 11px; touch-action: manipulation; cursor: pointer; }
button:hover { background: #eaf1f5; } button:disabled { opacity: .4; cursor: default; }
button:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid #2168ba; outline-offset: 2px; }
.secondary { margin-top: 7px; font-size: 13px; }
#title { font: inherit; font-weight: 600; border: none; background: transparent; min-width: 80px;
  max-width: 260px; flex: 1; padding: 5px; }
#save-status { flex: 1; color: #48616d; min-width: 120px; }
#workspace { overflow: auto; flex: 1; min-height: 0; padding: 24px; overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch; outline: none; }
#paper { position: relative; background: white; box-shadow: 0 3px 20px #18303d26;
  margin: 0 auto; flex: none; isolation: isolate; }
#paper canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
#active { touch-action: none; cursor: crosshair; }
#prediction, #background, #committed { pointer-events: none; }
#compare { padding: 10px 14px; border-top: 1px solid #c4cdd2; background: #f7f9fa; z-index: 4;
  max-height: 35dvh; overflow-y: auto; }
#compare label { margin-right: 12px; white-space: nowrap; }
#metrics { display: block; margin-top: 8px; white-space: pre-wrap; font: 12px ui-monospace, monospace; }
[hidden] { display: none !important; }
#error { position: fixed; bottom: 12px; left: 12px; right: 12px; padding: 14px; z-index: 10;
  background: #fff0ea; color: #7a2711; border: 1px solid #cf9b87; border-radius: 9px; }
#prompt { position: fixed; left: 10%; right: 10%; bottom: max(24px,env(safe-area-inset-bottom));
  padding: 14px; background: white; box-shadow: 0 4px 30px #0003; z-index: 8; display: flex; gap: 8px; }
#prompt-text { flex: 1; min-width: 0; font: inherit; padding: 8px; }
@media (max-width: 650px) { header { padding: 6px; } #workspace { padding: 12px; }
  [data-look=brand] { display: none; } button { padding: 5px 8px; min-height: 40px; }
  #save-status { font-size: 11px; } #title { max-width: 130px; } }
@media print { header, #compare, #prompt, #error { display: none; } }
