:root { color-scheme: light; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; --tint: #e20074; }
* { box-sizing: border-box; }
body { margin: 0; background: #000; color: #222; }
[hidden] { display: none !important; }
button, a { -webkit-tap-highlight-color: transparent; }
button { font: inherit; color: var(--tint); cursor: pointer; border: 0; background: transparent; min-height: 44px; padding: 8px 10px; }
button:disabled { color: #a4a4a4; cursor: default; }
button:focus-visible, a:focus-visible { outline: 2px solid var(--tint); outline-offset: 2px; }
.capture-screen { min-height: 100dvh; background: #f2f2f7; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 20px; padding: 30px; text-align: center; }
.capture-screen h1 { margin: 0; font-size: 24px; }
.capture-screen p { max-width: 440px; margin: 0; line-height: 1.5; }
.capture-button { display: flex; flex-direction: column; align-items: center; gap: 12px; background: white; border-radius: 14px; padding: 24px 40px; }
.drop-zone { border: 1px dashed #aaa; border-radius: 12px; padding: 20px; }
.drop-zone.hover { background: #e5e5ea; }
.server-status { font-size: 12px; color: #666; }
.error { color: #c62828; }
.editor { height: 100dvh; display: flex; flex-direction: column; overflow: hidden; }
.navigation { flex: 0 0 auto; display: flex; align-items: center; min-height: 44px; background: #f8f8fa; padding: env(safe-area-inset-top) max(6px, env(safe-area-inset-right)) 0 max(6px, env(safe-area-inset-left)); border-bottom: 1px solid #ccc; }
.navigation h1 { flex: 1; text-align: center; font-size: 17px; margin: 0; }
.navigation button { white-space: nowrap; font-size: 17px; }
.workspace { position: relative; flex: 1; min-height: 0; overflow: hidden; background: #000; color: #fff; }
#photoCanvas { width: 100%; height: 100%; display: block; touch-action: none; outline: none; }
.steps { position: absolute; top: 10px; right: 10px; width: 250px; padding: 7px 10px; background: rgb(0 0 0 / 66%); border: 1px solid #000; border-radius: 10px; user-select: none; pointer-events: none; }
.step { color: #a5a5a5; }
.step-heading { display: flex; align-items: center; gap: 10px; min-height: 28px; }
.step strong { font-size: 17px; font-weight: 500; flex: 1; }
.step p { display: none; margin: 2px 0 8px; font-size: 14px; line-height: 1.3; }
.step .info { visibility: hidden; border: 1.5px solid currentColor; border-radius: 50%; min-height: 20px; width: 20px; padding: 0; font-size: 14px; color: inherit; pointer-events: auto; }
.step.active { color: #fff; }
.step.active p { display: block; }
.step.active .info { visibility: visible; }
.step.done { color: #34c759; }
.steps.invalid .step:first-child { color: #ff453a; }
.magnifier { position: absolute; left: 0; top: 0; width: 200px; height: 200px; border: 3px solid #c7c7cc; background: #000; pointer-events: none; z-index: 3; }
.result-card { position: absolute; padding: 7px 10px; border-radius: 10px; background: rgb(0 0 0 / 58%); min-width: 168px; pointer-events: none; font-size: 17px; }
#measureValues { line-height: 30px; padding-right: 36px; white-space: pre-line; }
.reset-outline { position: absolute; top: 26px; right: 6px; font-size: 32px; padding: 0; width: 32px; pointer-events: auto; }
.result-card small { display: block; white-space: pre-line; font-size: 11px; line-height: 1.4; }
.scale-card { position: absolute; left: 50%; bottom: 66px; transform: translateX(-50%); background: rgb(0 0 0 / 66%); border-radius: 10px; padding: 5px 10px; display: flex; align-items: center; gap: 15px; }
.view-controls { position: absolute; bottom: max(10px, env(safe-area-inset-bottom)); left: 10px; display: flex; gap: 2px; background: rgb(0 0 0 / 66%); border-radius: 10px; }
.view-controls button { color: #fff; min-width: 40px; }
.view-controls button:disabled { color: #777; }
.wound-choices { position: absolute; bottom: calc(62px + env(safe-area-inset-bottom)); left: 10px; right: 10px; display: flex; gap: 6px; flex-wrap: wrap; pointer-events: none; }
.wound-choices button { pointer-events: auto; background: rgb(0 70 220 / 85%); color: #fff; border-radius: 8px; }
.wound-choices button[aria-pressed="true"] { background: #168435; }
.editor-message { position: absolute; left: 10px; bottom: 115px; max-width: calc(100% - 20px); background: rgb(0 0 0 / 85%); padding: 10px; border-radius: 8px; }
.loader-container { position: fixed; inset: 0; background: rgb(0 0 0 / 70%); display: flex; flex-direction: column; align-items: center; justify-content: center; z-index: 10; color: white; }
.loader { width: 42px; height: 42px; border: 5px solid #ddd; border-top-color: var(--tint); border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
dialog { border: 0; border-radius: 14px; max-width: min(440px, 90vw); padding: 24px; line-height: 1.5; }
dialog::backdrop { background: rgb(0 0 0 / 55%); }
dialog h2 { font-size: 20px; margin-top: 0; }
dialog p { white-space: pre-line; }
dialog a { display: block; color: var(--tint); padding: 10px 0; }
dialog form { text-align: right; }
@media (max-width: 600px) {
  .navigation h1 { font-size: 15px; }
  .navigation button { padding: 8px 6px; font-size: 15px; }
  .steps { width: 210px; padding: 6px 8px; }
  .step strong { font-size: 15px; }
  .step p { font-size: 12px; }
  .workspace:has(.magnifier:not([hidden])) .steps { opacity: 0; pointer-events: none; }
}
