:root { color-scheme: dark; font: 15px system-ui, sans-serif; color: #edf1ef; background: #171b1c; --line: #3d4748; --accent: #c4e1b7; }
* { box-sizing: border-box; } [hidden] { display: none !important; }
html, body { margin: 0; width: 100%; height: 100%; overflow: hidden; overscroll-behavior: none; }
body { height: 100dvh; display: flex; flex-direction: column; padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); }
button, select, input { font: inherit; } button, select { min-height: 44px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; background: #252d2e; color: inherit; cursor: pointer; touch-action: manipulation; }
button:disabled, select:disabled { opacity: .4; cursor: default; } button:focus-visible, select:focus-visible, input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
button:active { filter: brightness(1.3); } button.primary { background: var(--accent); color: #19221a; border-color: var(--accent); font-weight: 700; }
button[aria-pressed=true], .selected { border-color: var(--accent); color: var(--accent); background: #344434; }
header { display: flex; gap: 10px; align-items: center; padding: 7px 10px; } #project-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; color: #b3c0bc; }
#viewer { position: relative; flex: 1; min-height: 80px; overflow: hidden; touch-action: none; background: #121616; user-select: none; }
canvas, #grid { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
#grid { display: none; background-image: linear-gradient(to right, #fff 1px, transparent 1px), linear-gradient(to bottom, #fff 1px, transparent 1px); background-size: 20% 20%; }
#image-label, #save-status { position: absolute; top: 10px; left: 12px; padding: 4px 7px; background: #111b; border-radius: 5px; font-size: 11px; letter-spacing: .08em; pointer-events: none; }
#save-status { top: auto; bottom: 8px; letter-spacing: 0; color: #b8c6c0; }
#empty { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 16px; }
h1 { font-size: clamp(23px, 5vw, 38px); font-weight: 550; line-height: 1.2; margin: 0 0 8px; } p { color: #bcc8c4; line-height: 1.45; } h2 { font-size: 19px; margin: 0; }
#controls { padding: 7px 10px; background: #171b1c; max-height: 65dvh; overflow-y: auto; }
.row { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; } .row > h2, .row > strong { flex: 1; } .grow { flex: 1; } .scroll { overflow-x: auto; } .scroll > button { flex-shrink: 0; }
#versions:empty { display: none; } #versions button { min-height: 38px; font-size: 12px; display: flex; gap: 7px; align-items: center; } #versions img { width: 24px; height: 28px; object-fit: cover; border-radius: 3px; }
#compare { min-height: 52px; font-size: 16px; } .view-row { margin: 0; } .view-row button { flex: 1; font-size: 12px; padding: 6px; min-width: 0; }
#align-tools > button { flex: 1; } #align-hint { margin: 4px 0 8px; font-size: 12px; } #fine-controls > button { flex: 1; } #fine-controls output { white-space: nowrap; font-size: 12px; } .slider { display: flex; align-items: center; gap: 8px; font-size: 12px; min-height: 32px; } .slider input { flex: 1; min-width: 40px; accent-color: var(--accent); }
dialog { border: 1px solid var(--line); border-radius: 18px; background: #1c2324; color: inherit; padding: 18px; width: min(480px, calc(100% - 20px)); max-height: 90dvh; overflow: auto; }
dialog::backdrop { background: #0009; } dialog button { margin-bottom: 4px; } dialog .stack { display: grid; gap: 8px; margin: 12px 0; } dialog label:not(.slider) { display: block; margin: 12px 0; } dialog input[type=text] { width: 100%; padding: 12px; border-radius: 8px; border: 1px solid var(--line); background: #131819; color: inherit; } .muted { font-size: 12px; color: #a5b3ae; } .danger { color: #ffb7aa; } .project-entry { padding: 12px 0; border-bottom: 1px solid var(--line); } .project-entry strong { display: block; overflow-wrap: anywhere; margin-bottom: 4px; }
#notice { position: fixed; z-index: 10; top: 65px; left: 5%; width: 90%; background: #663d28; padding: 14px; border: 1px solid #e6ba92; border-radius: 12px; cursor: pointer; }
#restore { position: absolute; top: 8px; right: 8px; opacity: .8; } #quiet-compare { position: absolute; bottom: 12px; right: 12px; background: #1c2324c9; }
body.quiet header, body.quiet #controls, body.quiet #save-status { display: none; }
@media (orientation: landscape) and (max-height: 550px) { body { display: grid; grid-template-columns: 1fr 300px; grid-template-rows: 48px 1fr; } header { grid-column: 1 / 3; } #viewer { grid-row: 2; } #controls { grid-column: 2; grid-row: 2; max-height: none; } body.quiet { display: flex; } #compare { font-size: 14px; } }
@media (min-width: 800px) and (min-height: 551px) { #controls { width: 620px; align-self: center; } }

#reset-alignment { float: right; min-height: 32px; font-size: 11px; margin-left: 8px; margin-bottom: 4px; }

#blend-control { position: absolute; bottom: 32px; left: 12px; right: 12px; padding: 8px 12px; background: #171b1ce8; border-radius: 10px; max-width: 440px; margin: auto; }
body.quiet #blend-control { display: none; }
#mode, #speed { flex: 1; min-width: 0; padding: 8px 6px; font-size: 12px; }
#play, #edit-align { flex-shrink: 0; padding: 8px; font-size: 13px; }

/* v2 additions are contained here; the v1 stylesheet is never shared. */
#registration-status { position: absolute; top: 35px; left: 12px; font-size: 11px; padding: 3px 7px; background: #111b; border-radius: 5px; pointer-events: none; }
#registration-status:empty { display: none; }
#alignment-locks button { flex: 1; padding: 5px; min-height: 36px; font-size: 11px; }
#alignment-locks button[aria-pressed=true] { color: #edca8f; border-color: #ab8b56; background: #393327; }
#align-tools button { min-width: 0; padding: 7px 5px; font-size: 12px; }
.recovery button { flex: 1; font-size: 11px; min-height: 36px; padding: 5px; }
#align-hint { min-height: 18px; }
#marks-instruction { font-size: 13px; margin: 5px 0 8px; }
#marks-actions { flex-wrap: wrap; } #marks-actions button { flex: 1; min-width: 90px; font-size: 12px; }
#loupe { width: 130px; height: 130px; left: auto; bottom: auto; right: 10px; top: 10px; border: 2px solid #d5e8b9; border-radius: 50%; box-shadow: 0 2px 12px #000; background: #fff; }
.mark-example { display: flex; justify-content: space-around; align-items: center; padding: 10px; background: #ebe4cf; color: #272a24; border-radius: 10px; }
.mark-example span { display: grid; text-align: center; gap: 4px; font-size: 12px; }.mark-example b { font-size: 35px; }
#notice { max-height: 35dvh; overflow: auto; }
body.marking #versions, body.marking .view-row, body.marking #registration-status { display: none; }
body.marking #grid { visibility: hidden; }
#compare-panel .row { min-height: 44px; }
#compare { height: 56px; line-height: 18px; }

#image-label { max-width: calc(100% - 24px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#registration-status.warning { color: #ffe0a8; background: #503921e8; }
#blend-target { max-width: 30%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
