:root{color-scheme:dark;font:16px/1.6 "Cascadia Mono",Consolas,"SFMono-Regular",Menlo,monospace;--bg:#000812;--green:#5fff8f;--text:#c6d1d8;--action:#c3cdd2;--question:#ddd6b8;--muted:#788c9a;--label:#687e8c;--value:#8a9d9f;--surface:#10222d;--edge:#344b59;background:var(--bg);color:var(--text)}
*{box-sizing:border-box;min-width:0}
html,body{max-width:100%;overflow-x:hidden;overflow-x:clip}
body{margin:0;background:linear-gradient(140deg,#001f3333,transparent 55%);min-height:100dvh}
main{display:flex;flex-direction:column;width:100%;max-width:820px;margin:auto;min-height:100dvh;padding:clamp(24px,6vw,64px) max(22px,env(safe-area-inset-left)) max(14px,env(safe-area-inset-bottom));overflow-wrap:anywhere}
header{display:flex;align-items:center;gap:20px;width:100%;max-width:100%;justify-content:space-between}
h1{font-family:Bahnschrift,system-ui,sans-serif;font-size:clamp(2.4rem,8vw,3.5rem);line-height:1;letter-spacing:-.055em;font-weight:650;margin:0;color:#eee}
h1 span{color:#00ea6e;text-shadow:0 0 24px #00ea6e20}
.tag{font-family:inherit;font-weight:400;font-size:.75rem;line-height:1.4;letter-spacing:.18em;color:var(--muted);margin:0}
.brand-mark{width:56px;height:56px;flex:0 0 56px}
#flow{margin-top:32px;background:linear-gradient(100deg,#5fff8f04,transparent 70%)}
p{margin:12px 0}
.finding{font-family:inherit;font-weight:400;font-size:.9rem;line-height:1.65;min-height:6.6em;white-space:pre-line;color:#91a5b2;margin:0 0 24px}
.finding:after{content:none}
.finding .core-value{color:var(--green)}
.question,#prompt{color:var(--question)}
.question{font-size:.9rem;margin:20px 0 10px}
#message{color:#dfb66a}#message:empty,footer p:empty{display:none}
label{display:block;margin:16px 0;font-size:.9rem}
input,textarea{display:block;width:100%;max-width:100%;border:1px solid var(--edge);background:var(--surface);color:var(--action);border-radius:3px;font:inherit;font-size:16px;padding:11px 12px;margin-top:8px;caret-color:var(--green)}
textarea{min-height:100px;resize:vertical}
input::placeholder{color:var(--action);opacity:.8}
input:focus::placeholder{color:transparent}
#login .password-entry{display:block;max-width:340px;margin-top:12px}
#login input{margin:0}
button{display:inline-flex;align-items:center;justify-content:center;min-height:44px;max-width:100%;padding:9px 14px;border:1px solid var(--edge);border-radius:3px;background:var(--surface);color:var(--action);font:inherit;font-size:.9rem;line-height:1.5;cursor:pointer;white-space:normal;overflow-wrap:anywhere;text-align:left}
button.primary{border-color:#647c70;background:#192f29;color:#e2e9e3}
button:hover{background:#1b303b;border-color:#718995}
button.primary:hover{background:#254337;border-color:#9abcaa}
button:disabled{opacity:.45;cursor:wait}
button.quiet{font-size:.82rem}
a{color:var(--action);text-decoration:underline;text-decoration-color:#7e929d;text-underline-offset:4px;text-decoration-thickness:1px;line-height:1.6;overflow-wrap:anywhere}
a:hover{text-decoration-color:currentColor;color:#edf1f3}
a:not([href]){pointer-events:none;opacity:.45;text-decoration:none}
details{margin:16px 0}
summary{display:flex;align-items:center;gap:10px;cursor:pointer;min-height:44px;padding:9px 0;list-style:none;font-size:.9rem;color:var(--action)}
summary::-webkit-details-marker{display:none}
summary:before{content:"";display:block;flex:0 0 6px;width:6px;height:6px;border-right:1.5px solid currentColor;border-bottom:1.5px solid currentColor;transform:rotate(-45deg);margin:0 3px}
details[open]>summary:before{transform:rotate(45deg)}
summary:hover{color:#edf1f3}
#tools>details{margin:4px 0}
#logout{margin-top:16px}
.muted{font-size:.8rem;color:var(--muted)}
.job{border-top:1px solid #142b3a;padding:16px 0}
.job p{white-space:pre-wrap;margin:6px 0}
.job a{display:inline-flex;align-items:center;min-height:44px}
footer{margin-top:auto;padding-top:32px;font-size:.75rem;color:var(--label)}
footer details{position:relative;margin-bottom:0}
footer summary,footer button{font-size:inherit}
footer .diagnostics-body{position:absolute;top:100%;left:0;width:100%;padding-bottom:24px}
footer .diagnostic-group{margin:16px 0 24px;line-height:1.8}
footer .diagnostic-group h2{font:inherit;margin:0 0 6px;color:#91a5b2;font-weight:600}
footer .diagnostic-group p{margin:0;line-height:1.8}
footer .diag-value,footer #observed,footer [data-state]{color:var(--value)}
footer a{display:inline-flex;align-items:center;min-height:44px;padding:6px 0}
footer button{margin-top:8px}
#device-diagnostics,#diagnostics{white-space:pre-line}
:focus-visible{outline:2px solid #a8cbb7;outline-offset:3px}
[hidden]{display:none!important}
@media(prefers-reduced-motion:reduce){*{scroll-behavior:auto!important}}
/* Outline controls share one neutral colour; red is reserved for reset. */
button,button.primary{background:transparent;border-color:var(--action);color:var(--action)}
button:hover,button.primary:hover{background:transparent;border-color:#eef2f4;color:#eef2f4}
button.danger{color:#b87b80;border-color:#854951;background:transparent}
button.danger:hover{color:#d49b9f;border-color:#b87b80}
/* Password composer: stable geometry, native caret, pale send disc. */
#login label{margin-bottom:10px}
#login .password-entry{position:relative;display:flex;align-items:center;max-width:340px;min-height:58px;margin-top:0;padding:7px 8px 7px 16px;gap:10px;border:1px solid var(--edge);border-radius:3px;background:var(--surface);box-shadow:none}
#login input{flex:1;width:0;min-height:44px;margin:0;padding:9px 0;border:0;border-radius:0;background:transparent;box-shadow:none;color:var(--action);caret-color:var(--green);appearance:auto;-webkit-appearance:auto;outline:none}
#login input:focus,#login input:focus-visible{outline:none;background:transparent;box-shadow:none}
#login .entry-submit{flex:0 0 44px;width:44px;height:44px;min-height:44px;padding:13px;margin:0;border:0;border-radius:50%;background:radial-gradient(circle,#f1f2ef 0 16px,transparent 16.5px);color:#111719;box-shadow:none;-webkit-tap-highlight-color:transparent;touch-action:manipulation}
#login .entry-submit:hover{background:radial-gradient(circle,#fff 0 16px,transparent 16.5px);color:#111719;border:0}
#login .entry-submit:active{background:radial-gradient(circle,#dfe3e0 0 16px,transparent 16.5px)}
.entry-submit svg{display:block;width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:2.3;stroke-linecap:round;stroke-linejoin:round}
@media(forced-colors:active){#login .password-entry{border:1px solid CanvasText}#login input:focus-visible{outline:1px solid Highlight}#login .entry-submit{border:1px solid ButtonText}}
footer summary,footer summary:hover,footer summary:focus,footer summary:active,footer details[open]>summary{color:var(--label);-webkit-tap-highlight-color:transparent}
footer [data-state="connected"],footer [data-state="online"]{color:#708e7c}
#login .password-entry:focus-within{outline:2px solid #a8cbb7;outline-offset:3px}
.entry-caret{position:absolute;left:16px;top:50%;transform:translateY(-50%);width:2px;height:19px;background:var(--green);pointer-events:none;animation:caret-flash 1s steps(1,end) infinite}
.password-entry:focus-within .entry-caret,.password-entry:has(input:not(:placeholder-shown)) .entry-caret{display:none}
@keyframes caret-flash{50%{opacity:0}}
@media(prefers-reduced-motion:reduce){.entry-caret{animation:none}}
#login-error{color:#df8c91;font-size:.85rem;line-height:1.5;margin:10px 0 0;max-width:340px}
#login-error:empty{display:none}
#login .password-entry:has(input[aria-invalid="true"]){border-color:#b96b72;outline-color:#b96b72}
#collection-summary{color:#91a5b2;white-space:normal;font-family:inherit;font-size:.9rem;font-weight:400;line-height:1.65;margin:0 0 24px}
#site:has(+ #collection-summary:not([hidden])){margin-bottom:0;min-height:0}
.job button{margin:.6rem .6rem 0 0}
#collection-progress{color:#91a5b2;font-size:.9rem;line-height:1.65;overflow-wrap:anywhere}
#collection-progress:empty{display:none}
.outcome-pass{color:var(--green)}.outcome-warning{color:#ffcd5f}.outcome-fail{color:#ff6b75}.outcome-offline{color:#b69bd4}.outcome-neutral{color:var(--green)}
.summary-row{display:grid;grid-template-columns:max-content minmax(0,1fr);column-gap:1ch;margin:0;overflow-wrap:anywhere}
.summary-row>div{min-width:0}.assessment-note{font-size:.8rem;line-height:1.5}

.outcome-total{color:var(--text)}
.job>strong{display:flex;align-items:center;gap:6px;color:var(--green)}
.job .icon-edit{padding:8px;min-height:36px;width:36px;border:0;background:transparent;margin:0;color:var(--action)}
.icon-edit svg,.site-name-save svg{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.job .delete-data{margin:0 0 0 16px;padding:4px 9px;font-size:.75rem;min-height:36px}
.saved-editor{display:grid;grid-template-columns:minmax(0,1fr) 32px 32px;align-items:center;gap:6px;width:min(100%,36rem);margin:4px 0;font-weight:400}
.saved-editor input,.saved-editor textarea{margin:0;padding:5px 8px;min-height:36px;font-size:16px;line-height:1.5;background:transparent}
.saved-editor textarea{min-height:96px;grid-column:1/-1}
.saved-editor.notes-editor .edit-save{grid-column:2}
.job .saved-editor button{margin:0;width:32px;min-height:32px;height:32px;padding:6px;border:1px solid var(--edge);background:transparent}
.saved-editor svg{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.edit-error{grid-column:1/-1;color:#df8c91;font-size:.8rem}.edit-error:empty{display:none}
.saved-notes{display:flex;align-items:baseline;gap:8px;flex-wrap:wrap;margin:8px 0;font-size:.9rem}
.saved-note-label{color:var(--label)}.saved-note-value{color:var(--text);white-space:pre-wrap;overflow-wrap:anywhere}
.saved-notes .saved-editor{flex-basis:100%}
#capture{font-size:.9rem;color:#91a5b2}#collect-data{margin-top:16px;margin-right:12px}
.assessment-note p{font-size:.8rem;line-height:1.6}

#collection-meter{display:block;width:100%;height:5px;margin:8px 0 20px;accent-color:var(--green);border:0;border-radius:0;background:var(--surface)}
#collection-meter[hidden]{display:none}#collection-meter::-webkit-progress-bar{background:var(--surface)}#collection-meter::-webkit-progress-value{background:#708e7c}#collection-meter::-moz-progress-bar{background:#708e7c}

/* Collection and completed findings share the same console rhythm. */
#site:has(~ #tools #collection-progress:not(:empty)){margin-bottom:0;min-height:0}
#collection-progress{margin:0}.live-value{color:var(--muted)}
#collection-summary{margin-bottom:0}
#capture .notes-label{margin:0;font-size:inherit;line-height:1.65}
#capture textarea{margin:6px 0 12px;min-height:84px}
.main-actions{display:flex;align-items:center;gap:12px;flex-wrap:wrap}
.main-actions #logout{margin:0;font-size:.9rem}
button.primary{border-color:var(--green);color:var(--green)}
button.primary:hover{border-color:#a1ffbb;color:#a1ffbb}
#collect-data.refresh-action{display:inline-flex;min-height:36px;margin:8px 0 0;padding:4px 0;border:0;text-decoration:underline;text-underline-offset:4px;font-size:.8rem;color:var(--muted)}
#site .icon-edit{vertical-align:middle;min-height:28px;width:28px;padding:5px;margin:0 0 0 5px;border:0}
#site .icon-edit svg{width:14px;height:14px}
#site .saved-editor{display:inline-grid;width:min(100%,32rem);vertical-align:middle;margin:0}
#site .saved-editor button{margin:0}
.saved-notes{margin:0 0 6px}

/* Reserve the readout and notes depth while collection is running. */
#collection-meter{position:static;transform:none;width:100%;height:5px;margin:8px 0 12px;box-shadow:none}
#cancel-collection{display:flex;margin:0 0 16px}
/* Inline editors retain exactly the surrounding text rhythm. */
#site .icon-edit,.job .icon-edit{position:relative;vertical-align:baseline;display:inline-flex;align-items:center;justify-content:center;min-height:0;height:1em;width:1.4em;padding:0;margin:0 0 0 .25em;border:0;background:none;line-height:1}
#site .icon-edit svg,.job .icon-edit svg{width:13px;height:13px}
.job>strong{display:block;font-size:.9rem;line-height:1.65;font-weight:400}
#site .saved-editor,.saved-editor:not(.notes-editor){display:inline-grid;grid-template-columns:minmax(0,1fr) 22px 22px;gap:4px;align-items:center;width:min(100%,28rem);height:1.65em;vertical-align:baseline;margin:0;font:inherit;line-height:inherit}
.saved-editor:not(.notes-editor) input{height:1.65em;min-height:0;padding:0 3px;font:inherit;line-height:inherit;margin:0;border:1px solid var(--edge);border-radius:3px;background:transparent}
#site .saved-editor button,.job .saved-editor:not(.notes-editor) button{width:22px;height:22px;min-height:0;padding:3px;margin:0;border:0;background:none;line-height:1}
.saved-editor:not(.notes-editor) svg{height:13px;width:13px}
#site .saved-editor input{font-size:16px;transform-origin:left center}
.saved-notes .saved-note-label{flex:0 0 auto}
.saved-notes.notes-editing{align-items:baseline}
.editing-name{position:relative}.editing-name>.saved-editor:not(.notes-editor),#site .editing-name>.saved-editor{position:absolute;left:0;top:0;width:100%;min-width:0;height:23.76px}.editing-name>.saved-editor:not(.notes-editor) input{height:23.76px;line-height:23.76px}
/* v0.39: one reserved collection region from click through the final reveal. */
#collection-summary{min-height:calc(10 * 1.65em)}
#collection-summary .summary-row[data-field="controllers"]{height:1.65em;overflow:hidden}
#collection-summary .summary-row[data-field="buildings"]{height:1.65em;overflow:auto}
#collection-summary .summary-row[data-field="fittings"]{min-height:calc(7 * 1.65em)}
#collection-summary .inline-loading{white-space:normal;line-height:1.65;max-height:3.3em;overflow:hidden}
#collection-summary .summary-row>div>div{line-height:1.65;min-height:1.65em}
#tools[aria-busy="true"] #collection-meter{animation:reading-pulse 1.8s ease-in-out infinite}
@keyframes reading-pulse{50%{opacity:.55}}
@media(prefers-reduced-motion:reduce){#tools[aria-busy="true"] #collection-meter{animation:none}}
#collection-progress{height:3.3em;min-height:3.3em;font-size:.9rem;line-height:1.65;color:var(--muted);margin:0}
#collection-progress:empty{display:none}
#tools[aria-busy="true"] #collection-progress:empty{display:none}
.outcome-offline{color:#cf9bff}
/* Inputs use the same font metrics as their readout. */
#site .saved-editor input,.saved-editor input,.saved-editor textarea{font-family:inherit;font-size:inherit;font-weight:400;letter-spacing:inherit;color:var(--action);line-height:inherit}
#site .editing-name{display:inline;position:relative}
#site .editing-name>.saved-editor{width:clamp(14rem,55vw,28rem);max-width:calc(100vw - 10ch - 44px)}
.saved-editor:not(.notes-editor) input{font:inherit}
/* Notes begin as one line, grow with content and retain native resize. */
#capture .notes-label{display:grid;grid-template-columns:max-content minmax(0,1fr);align-items:start;column-gap:1ch;margin:0 0 12px}
#capture textarea,.saved-editor.notes-editor textarea{min-height:26px;height:26px;margin:0;padding:0 5px;line-height:1.65;font:inherit;resize:vertical;overflow-y:hidden;background:transparent}
.saved-notes{display:grid;grid-template-columns:max-content minmax(0,1fr) auto;gap:0 1ch;font:inherit;line-height:1.8;align-items:start;margin:0}
.saved-notes .notes-editor{grid-column:2/-1;display:grid;grid-template-columns:minmax(0,1fr) 22px 22px;width:100%;gap:4px;margin:0;font:inherit}
.saved-editor.notes-editor textarea{grid-column:1;grid-row:1}
.saved-editor.notes-editor .edit-save{grid-column:2;grid-row:1}
.saved-editor.notes-editor .edit-cancel{grid-column:3;grid-row:1}
.job .notes-editor button{min-height:22px;height:22px;width:22px;padding:3px;border:0}
.job{font:inherit;line-height:1.8}
.job>strong{font:inherit;line-height:1.8;color:var(--value);margin:0}
.saved-name,.saved-note-value{color:var(--value)}
#site .saved-name{color:var(--green)}
.saved-field-label,.saved-note-label{color:var(--label)}
.saved-meta{font:inherit;line-height:1.8;margin:0!important}
.saved-meta .diag-value{color:var(--value)}
.job .icon-edit{font-size:inherit}
.job .saved-editor:not(.notes-editor){font:inherit;height:1.8em}
.job .saved-editor:not(.notes-editor) input{font:inherit;height:1.8em;line-height:1.8}
.job .editing-name>.saved-editor:not(.notes-editor){left:11ch;width:calc(100% - 11ch);height:1.8em}

.inline-loading{color:var(--muted)}


/* Progress occupies the same next-line position as Notes, never the viewport edge. */
#collection-meter{margin:0 0 12px;position:static}
#collection-meter::-webkit-progress-value{transition:width .35s linear}
#collection-meter::-moz-progress-bar{transition:width .35s linear}

.summary-row>div{position:relative}
.result-status{position:absolute;inset:0 auto auto 0}

.password-account{position:absolute!important;width:1px!important;height:1px!important;clip-path:inset(50%);overflow:hidden;padding:0!important;border:0!important}

/* Determinate fill only: never sweep, pulse or restart while collecting. */
#collection-meter,#tools[aria-busy="true"] #collection-meter{appearance:none;-webkit-appearance:none;overflow:hidden;background:var(--surface);opacity:1;animation:none}
#collection-meter::-webkit-progress-bar{background:var(--surface)}
#collection-meter::-webkit-progress-value{background:#708e7c;transition:width .6s linear}
#collection-meter::-moz-progress-bar{background:#708e7c;transition:width .6s linear}
