/* Dowelify application surface coherence v1.
   This final stylesheet harmonizes the existing application surfaces without
   changing their DOM, state ownership, or interaction contracts. */

:root {
  --dowelify-canvas: #10130f;
  --dowelify-ink: #151814;
  --dowelify-ink-2: #1d211c;
  --dowelify-ink-3: #252a23;
  --dowelify-panel: #121510;
  --dowelify-field: #141713;
  --dowelify-cream: #f7f4ea;
  --dowelify-muted: #9ba096;
  --dowelify-rule: rgb(247 244 234 / .13);
  --dowelify-control-rule: rgb(247 244 234 / .18);
  --dowelify-control-edge: rgb(247 244 234 / .36);
  --dowelify-acid: #d7ff43;
  --dowelify-acid-hover: #e1ff72;
  --dowelify-reference: #c7ff24;
  --dowelify-copper: #d4934a;
  --dowelify-teal: #0bc4ae;
  --dowelify-mark-copper: #d37b2c;
  --dowelify-mark-teal: #22d9ce;
  --dowelify-mark-lime: #c7ff24;
  --dowelify-mark-registered-physical: #cdbd28;
  --dowelify-mark-overlap: #7baa7d;
  --dowelify-mark-seated: #75ec79;
  --dowelify-warning: #f4bf72;
  --dowelify-error: #ffc49b;
  --dowelify-chamfer: polygon(0 0, calc(100% - 14px) 0, 100% 14px, 100% 100%, 0 100%);
  --dowelify-chamfer-rule-projection: 1.55563492px;
  --dowelify-sans: "Geist", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --dowelify-mono: "Geist Mono", ui-monospace, "SFMono-Regular", Consolas, monospace;
}

body.is-product-workspace-active,
.app-shell.is-product-workspace {
  --shell-canvas: var(--dowelify-canvas);
  --shell-panel: var(--dowelify-panel);
  --shell-raised: var(--dowelify-ink-2);
  --shell-inset: var(--dowelify-field);
  --shell-border: var(--dowelify-rule);
  --shell-control-border: var(--dowelify-control-edge);
  --shell-muted: var(--dowelify-muted);
  --shell-text: var(--dowelify-cream);
  --shell-subtle: #c9cdc3;
  --shell-blue-bg: #192b43;
  --shell-blue-text: #a9cbff;
  --shell-green-bg: #193526;
  --shell-green-text: #8fddb0;
  --shell-amber-bg: #3b2a15;
  --shell-amber-text: var(--dowelify-warning);
  --shell-red-bg: #40201d;
  --shell-red-text: var(--dowelify-error);
  --paper: var(--dowelify-canvas);
  --paper-2: var(--dowelify-field);
  --surface: var(--dowelify-ink-2);
  --line: var(--dowelify-rule);
  --muted: var(--dowelify-muted);
  --ink: var(--dowelify-cream);
  --ink-2: var(--dowelify-ink-2);
  --acid: var(--dowelify-acid);
  --acid-dark: var(--dowelify-reference);
  --amber: var(--dowelify-warning);
  --amber-bg: var(--shell-amber-bg);
  --red: var(--dowelify-error);
  --red-bg: var(--shell-red-bg);
  --font: var(--dowelify-sans);
  background: var(--dowelify-canvas);
  color: var(--dowelify-cream);
  color-scheme: dark;
  font-family: var(--dowelify-sans);
}

body.is-product-workspace-active :is(
  .eyebrow,
  .section-label,
  .status-kicker,
  .part-id,
  .mono,
  .product-navigator-title small,
  .navigator-group-title,
  .front-door-kicker,
  .job-file-header small,
  .job-file-identity > small,
  .job-file-section > small,
  .job-file-decision-status > small,
  .job-file-result-list article small,
  .job-file-decision-list article small,
  .job-panel-eyebrow,
  .job-map-boundary > span,
  .job-map-temporal-status span,
  .path-inspector-empty span
) {
  font-family: var(--dowelify-mono);
}

body.is-product-workspace-active .app-stage,
.app-shell.is-product-workspace,
.app-shell.is-product-workspace .job-workplane,
.app-shell.is-product-workspace .workspace-center,
.app-shell.is-product-workspace .intelligence-workspace,
.app-shell.is-product-workspace .intelligence-transcript {
  background-color: var(--dowelify-canvas);
}

.app-shell.is-product-workspace .job-workplane {
  background-image:
    radial-gradient(circle at 90% 0, rgb(199 255 36 / .035), transparent 24rem),
    linear-gradient(180deg, var(--dowelify-panel), var(--dowelify-canvas) 34%);
}

.app-shell.is-product-workspace.is-workspace-grid-visible .job-workplane {
  background-image:
    linear-gradient(rgb(247 244 234 / .024) 1px, transparent 1px),
    linear-gradient(90deg, rgb(247 244 234 / .024) 1px, transparent 1px),
    radial-gradient(circle at 90% 0, rgb(199 255 36 / .035), transparent 24rem),
    linear-gradient(180deg, var(--dowelify-panel), var(--dowelify-canvas) 34%);
  background-size: 22px 22px, 22px 22px, auto, auto;
}

.app-shell.is-product-workspace :is(button, input, textarea, select):focus-visible,
.app-shell.is-product-workspace :is(a[href], [role="button"]):focus-visible,
body.is-product-workspace-active .bottom-sheet :is(button, input, textarea, select, a[href], [role="button"], [tabindex]):focus-visible {
  outline: 2px solid var(--dowelify-acid);
  outline-offset: 2px;
}

.app-shell.is-product-workspace :is(button, input, textarea, select):disabled,
body.is-product-workspace-active .bottom-sheet :is(button, input, textarea, select):disabled {
  cursor: not-allowed;
  opacity: .45;
  transform: none;
}

/* Work and Account are one durable structural plate, not floating cards. */
.app-shell.is-product-workspace .work-navigator {
  border-right: 1px solid var(--dowelify-rule);
  background: var(--dowelify-panel);
  clip-path: var(--dowelify-chamfer);
}

.app-shell.is-product-workspace .work-navigator::before,
.app-shell.is-product-workspace .job-file-panel::before,
body.is-product-workspace-active .bottom-sheet::before,
.app-shell.is-product-workspace .application-front-door.is-new-job::before {
  position: absolute;
  z-index: 20;
  top: -1px;
  right: -1px;
  width: 14px;
  height: 14px;
  background: var(--dowelify-rule);
  clip-path: polygon(
    0 0,
    100% 100%,
    calc(100% - var(--dowelify-chamfer-rule-projection)) 100%,
    0 var(--dowelify-chamfer-rule-projection)
  );
  content: "";
  pointer-events: none;
}

.app-shell.is-product-workspace .workspace-tool-rail {
  border-right-color: var(--dowelify-rule);
  background: var(--dowelify-canvas);
}

.app-shell.is-product-workspace .workspace-tool-rail button::after {
  border-color: var(--dowelify-control-edge);
  border-radius: 0;
  background: var(--dowelify-panel);
  box-shadow: none;
}

.app-shell.is-product-workspace .product-navigator-head {
  border-bottom-color: var(--dowelify-rule);
  background: var(--dowelify-panel);
}

.app-shell.is-product-workspace .product-navigator-scroll,
.app-shell.is-product-workspace .job-navigator .product-navigator-scroll {
  background: var(--dowelify-panel);
}

.app-shell.is-product-workspace .navigator-group-title {
  color: var(--dowelify-muted);
}

.app-shell.is-product-workspace :is(.navigator-row, .navigator-job-row, .navigator-subrows button) {
  border-radius: 0;
}

.app-shell.is-product-workspace :is(.navigator-row, .navigator-job-row):hover,
.app-shell.is-product-workspace :is(.navigator-row, .navigator-job-row).is-active,
.app-shell.is-product-workspace .navigator-subrows button:hover {
  background: rgb(199 255 36 / .055);
  box-shadow: inset 2px 0 0 var(--dowelify-reference);
}

.app-shell.is-product-workspace .navigator-new-job {
  min-height: 48px;
  border-radius: 0;
  background: var(--dowelify-acid);
  color: var(--dowelify-ink);
  clip-path: var(--dowelify-chamfer);
  transition: background 150ms ease, transform 150ms ease;
}

.app-shell.is-product-workspace .navigator-new-job:focus-visible {
  outline-color: var(--dowelify-ink);
  outline-offset: -5px;
}

@media (hover: hover) and (pointer: fine) {
  .app-shell.is-product-workspace .navigator-new-job:hover {
    background: var(--dowelify-acid-hover);
    transform: translateY(-2px);
  }
}

.app-shell.is-product-workspace :is(
  .workspace-tool-rail button,
  .workspace-shell-toggle,
  .navigator-list-state button,
  .request-surface-head button,
  .work-request-row,
  .navigator-capability-note,
  .job-panel-card,
  .account-display-settings > button,
  .saved-location-card,
  .saved-location-card-head > span,
  .saved-location-rename button,
  .saved-location-actions button,
  .account-location-form input,
  .nearby-help-form input,
  .nearby-help-form select,
  .saved-location-rename input,
  .account-location-form button,
  .nearby-help-form button,
  .account-location-actions button,
  .nearby-help-state,
  .nearby-listings a,
  .participation-form input,
  .participation-form select,
  .participation-form textarea,
  .selected-work-request textarea,
  .job-panel-inline-error,
  .job-panel-inline-error button,
  .share-job-link input
) {
  border-radius: 0;
  box-shadow: none;
}

.app-shell.is-product-workspace :is(
  .intelligence-consent input,
  .video-media-retention input,
  .measurement-check input
) {
  accent-color: var(--dowelify-acid);
}

.app-shell.is-product-workspace :is(
  .navigator-capability-note,
  .work-request-row,
  .job-panel-card,
  .saved-location-card,
  .nearby-help-state,
  .nearby-listings a
) {
  border-color: var(--dowelify-rule);
  background: var(--dowelify-field);
}

.app-shell.is-product-workspace :is(
  .account-location-form input,
  .nearby-help-form input,
  .nearby-help-form select,
  .saved-location-rename input,
  .participation-form input,
  .participation-form select,
  .participation-form textarea,
  .selected-work-request textarea,
  .share-job-link input
) {
  min-height: 44px;
  border-color: var(--dowelify-control-edge);
  background: var(--dowelify-field);
  color: var(--dowelify-cream);
}

.app-shell.is-product-workspace :is(
  .account-location-form button,
  .nearby-help-form button,
  .account-location-actions button
) {
  border-color: var(--dowelify-acid);
  background: var(--dowelify-acid);
  color: var(--dowelify-ink);
}

.app-shell.is-product-workspace .navigator-capability-note > button {
  min-height: 44px;
  border: 1px solid var(--dowelify-control-edge);
  border-radius: 0;
  background: var(--dowelify-ink-3);
  color: var(--dowelify-cream);
}

/* Every resolver state uses the same entrance grammar. */
.app-shell.is-product-workspace .application-front-door {
  --entrance-canvas: var(--dowelify-canvas);
  --entrance-panel: var(--dowelify-panel);
  --entrance-ink: var(--dowelify-ink);
  --entrance-cream: var(--dowelify-cream);
  --entrance-muted: var(--dowelify-muted);
  --entrance-rule: var(--dowelify-rule);
  --entrance-acid: var(--dowelify-acid);
  --entrance-action-hover: var(--dowelify-acid-hover);
  --entrance-reference: var(--dowelify-reference);
  --entrance-chamfer: var(--dowelify-chamfer);
  --entrance-chamfer-projection: var(--dowelify-chamfer-rule-projection);
  position: relative;
  overflow: visible;
  border: 1px solid var(--dowelify-rule);
  border-radius: 0;
  background:
    radial-gradient(circle at 91% 4%, rgb(199 255 36 / .07), transparent 16rem),
    var(--dowelify-panel);
  box-shadow: none;
  color: var(--dowelify-cream);
  isolation: isolate;
}

.app-shell.is-product-workspace .application-front-door.is-new-job {
  clip-path: var(--dowelify-chamfer);
}

.app-shell.is-product-workspace .application-front-door h1 {
  color: var(--dowelify-cream);
  font-weight: 600;
  letter-spacing: -.055em;
  line-height: 1.02;
}

.app-shell.is-product-workspace .application-front-door > p,
.app-shell.is-product-workspace .front-door-boundary,
.app-shell.is-product-workspace .front-door-capture-actions small,
.app-shell.is-product-workspace .front-door-continue em,
.app-shell.is-product-workspace .front-door-new small,
.app-shell.is-product-workspace .front-door-work-list :is(small, em) {
  color: var(--dowelify-muted);
}

.app-shell.is-product-workspace :is(
  .front-door-capture-actions > button,
  .front-door-primary-actions > button,
  .front-door-work-list,
  .front-door-work-list > button,
  .front-door-recovery-actions > button,
  .front-door-help
) {
  border-color: var(--dowelify-control-edge);
  border-radius: 0;
  background: rgb(247 244 234 / .025);
  color: var(--dowelify-cream);
  box-shadow: none;
}

.app-shell.is-product-workspace :is(
  .front-door-capture-actions > button,
  .front-door-primary-actions > button,
  .front-door-work-list > button,
  .front-door-recovery-actions > button,
  .front-door-help
):hover {
  border-color: rgb(215 255 67 / .58);
  background: rgb(215 255 67 / .055);
}

.app-shell.is-product-workspace .front-door-boot-line {
  border-radius: 0;
  background: var(--dowelify-rule);
}

.app-shell.is-product-workspace .front-door-boot-line span { border-radius: 0; }

/* Conversation remains the visual center; only attributed person speech is enclosed. */
.app-shell.is-product-workspace .intelligence-workspace {
  padding: 10px 14px max(12px, env(safe-area-inset-bottom));
  background:
    radial-gradient(circle at 82% 0, rgb(199 255 36 / .025), transparent 20rem),
    var(--dowelify-canvas);
}

.app-shell.is-product-workspace .intelligence-transcript {
  color: var(--dowelify-cream);
}

.app-shell.is-product-workspace .intelligence-message-body {
  border-color: var(--dowelify-rule);
  border-radius: 0;
  background: var(--dowelify-ink-2);
  box-shadow: none;
  color: var(--dowelify-cream);
}

.app-shell.is-product-workspace .intelligence-message.is-person .intelligence-message-body {
  border-color: var(--dowelify-control-rule);
  border-radius: 0;
  background: var(--dowelify-ink-2);
  color: var(--dowelify-cream);
  box-shadow: inset -2px 0 0 var(--dowelify-copper);
}

.app-shell.is-product-workspace .intelligence-message.is-assistant .intelligence-message-body {
  background: transparent;
  box-shadow: none;
}

.app-shell.is-product-workspace .intelligence-message.is-pending .intelligence-message-body {
  border-color: rgb(212 147 74 / .48);
  background: rgb(212 147 74 / .055);
}

.app-shell.is-product-workspace .intelligence-composer {
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}

.app-shell.is-product-workspace .intelligence-composer-row {
  min-height: 58px;
  padding: 6px;
  border: 1px solid var(--dowelify-control-edge);
  border-radius: 0;
  background: var(--dowelify-panel);
  box-shadow: none;
}

.app-shell.is-product-workspace
  .intelligence-workspace:has(.application-front-door.is-new-job)
  .intelligence-composer-row {
  border-color: var(--dowelify-control-edge);
}

.app-shell.is-product-workspace .intelligence-composer-row:focus-within {
  border-color: var(--dowelify-acid);
  box-shadow: 0 0 0 3px rgb(215 255 67 / .09);
}

.app-shell.is-product-workspace .intelligence-composer textarea {
  min-height: 44px;
  color: var(--dowelify-cream);
  font-size: 15px;
}

.app-shell.is-product-workspace .intelligence-composer textarea::placeholder { color: var(--dowelify-muted); }

.app-shell.is-product-workspace :is(
  .intelligence-photo-button,
  .intelligence-tool-button,
  .intelligence-voice-button,
  .intelligence-send-button
) {
  min-width: 44px;
  min-height: 44px;
  border-radius: 0;
}

.app-shell.is-product-workspace .intelligence-send-button {
  background: var(--dowelify-ink);
  color: var(--dowelify-acid);
}

.app-shell.is-product-workspace :is(
  .intelligence-error,
  .intelligence-selected-image,
  .intelligence-selected-preview,
  .intelligence-selected-preview button,
  .intelligence-status-strip,
  .intelligence-case-panel,
  .intelligence-case-body dl div,
  .intelligence-case-body li,
  .intelligence-block,
  .intelligence-perception-panel,
  .intelligence-observation-list li,
  .intelligence-open-requests,
  .visual-reference-card,
  .visual-reference-link-preview,
  .visual-reference-actions > a,
  .visual-reference-offer button,
  .visual-reference-offer.is-terminal,
  .research-retry-card-body button,
  .intelligence-pending-actions button,
  .video-media-panel,
  .video-media-add,
  .video-media-actions button,
  .video-media-selected,
  .video-media-artifact,
  .video-media-unavailable,
  .video-media-error,
  .video-media-invalid-observation
) {
  border-radius: 0;
  box-shadow: none;
}

.app-shell.is-product-workspace .intelligence-block.is-path-options li {
  border-color: var(--dowelify-rule);
  border-radius: 0;
  background: var(--dowelify-field);
}

.app-shell.is-product-workspace :is(
  .intelligence-selected-preview button,
  .intelligence-pending-actions button,
  .visual-reference-actions > a
) {
  min-width: 44px;
  min-height: 44px;
}

.app-shell.is-product-workspace :is(
  .intelligence-selected-image,
  .intelligence-case-panel,
  .intelligence-block,
  .intelligence-perception-panel,
  .intelligence-observation-list li,
  .visual-reference-card,
  .video-media-panel,
  .video-media-selected,
  .video-media-artifact
) {
  border-color: var(--dowelify-rule);
  background: var(--dowelify-field);
  color: var(--dowelify-cream);
}

.app-shell.is-product-workspace .intelligence-block.is-request {
  border-left: 2px solid var(--dowelify-teal);
  background: rgb(11 196 174 / .055);
  color: var(--dowelify-cream);
}

.app-shell.is-product-workspace .intelligence-block.is-warning,
.app-shell.is-product-workspace .intelligence-limitations {
  border-color: rgb(244 191 114 / .35);
  background: var(--shell-amber-bg);
  color: var(--dowelify-warning);
}

.app-shell.is-product-workspace .intelligence-block.is-case {
  border-left: 2px solid var(--dowelify-reference);
  background: rgb(199 255 36 / .045);
  color: var(--dowelify-cream);
}

.app-shell.is-product-workspace .intelligence-error {
  border: 1px solid rgb(255 196 155 / .35);
  background: var(--shell-red-bg);
  color: var(--dowelify-error);
}

.app-shell.is-product-workspace :is(
  .intelligence-error-actions button,
  .workspace-composer .intelligence-error > button
) {
  min-height: 44px;
  border: 1px solid var(--dowelify-error);
  border-radius: 0;
  background: var(--dowelify-error);
  color: var(--dowelify-ink);
}

.app-shell.is-product-workspace :is(
  .workspace-topbar > button,
  .workspace-availability.is-offline button,
  .workspace-case-prompts button,
  .workspace-question-card,
  .workspace-quick-replies button,
  .workspace-unknown-button,
  .workspace-artifact,
  .workspace-artifact button,
  .workspace-attention,
  .intelligence-error-actions button,
  .workspace-composer .intelligence-error > button,
  .workspace-tool-list > button,
  .workspace-tool-list > button > span,
  .garage-empty-case,
  .garage-empty-case button,
  .resume-card,
  .recent-card,
  .garage-card,
  .content-card
) {
  border-radius: 0;
  box-shadow: none;
}

.app-shell.is-product-workspace .workspace-tool-list > button > span,
body.is-product-workspace-active .bottom-sheet .workspace-tool-list > button > span {
  border: 1px solid var(--dowelify-control-edge);
  border-radius: 0;
  background: var(--dowelify-field);
  color: var(--dowelify-acid);
}

.app-shell.is-product-workspace .workspace-tool-list > button.is-pinned > span,
.app-shell.is-product-workspace .workspace-tool-list > button.is-status > span,
body.is-product-workspace-active .bottom-sheet .workspace-tool-list > button.is-pinned > span,
body.is-product-workspace-active .bottom-sheet .workspace-tool-list > button.is-status > span {
  background: var(--dowelify-field);
  color: var(--dowelify-muted);
}

.app-shell.is-product-workspace :is(.job-panel-card button, .job-panel-action) {
  min-height: 44px;
  border: 1px solid var(--dowelify-control-edge);
  border-radius: 0;
  background: var(--dowelify-ink-3);
  color: var(--dowelify-cream);
}

.app-shell.is-product-workspace :is(
  .workspace-topbar > button,
  .workspace-availability.is-offline button,
  .workspace-case-prompts button,
  .workspace-quick-replies button,
  .workspace-unknown-button,
  .workspace-artifact button,
  .workspace-composer .intelligence-error > button,
  .workspace-tool-list > button,
  .garage-empty-case button
) {
  min-height: 44px;
  border-color: var(--dowelify-control-edge);
}

.app-shell.is-product-workspace :is(
  .workspace-question-card,
  .workspace-artifact,
  .workspace-tool-list > button,
  .garage-empty-case,
  .resume-card,
  .recent-card,
  .garage-card,
  .content-card
) {
  border-color: var(--dowelify-rule);
  background: var(--dowelify-field);
  color: var(--dowelify-cream);
}

.app-shell.is-product-workspace .workspace-question-card {
  border-left: 2px solid #a9cbff;
  background: var(--shell-blue-bg);
  color: var(--shell-blue-text);
}

.app-shell.is-product-workspace .workspace-attention {
  border-color: rgb(255 196 155 / .35);
  background: var(--shell-red-bg);
  color: var(--shell-red-text);
}

.app-shell.is-product-workspace .workspace-attention.is-check {
  border-color: rgb(244 191 114 / .35);
  background: var(--shell-amber-bg);
  color: var(--shell-amber-text);
}

/* Preserve semantic states after the neutral surface rules above. */
.app-shell.is-product-workspace .work-request-row.is-safety {
  border-color: rgb(255 196 155 / .42);
  background: var(--shell-red-bg);
}

.app-shell.is-product-workspace .work-request-row.is-safety > span:first-child {
  background: rgb(255 196 155 / .12);
  color: var(--shell-red-text);
}

.app-shell.is-product-workspace .saved-location-card.is-default,
.app-shell.is-product-workspace .account-display-settings > button[aria-pressed="true"] {
  border-color: rgb(215 255 67 / .55);
  background: rgb(215 255 67 / .07);
}

.app-shell.is-product-workspace .nearby-help-state.is-error {
  border-color: rgb(255 196 155 / .42);
  background: var(--shell-red-bg);
  color: var(--shell-red-text);
}

/* Reachable legacy content uses explicit roles instead of the overloaded
   historical --ink alias, which is cream in the dark product workspace. */
.app-shell.is-product-workspace .intelligence-status-strip {
  border: 1px solid var(--dowelify-rule);
  background: var(--dowelify-ink-3);
  color: var(--dowelify-cream);
}

.app-shell.is-product-workspace .intelligence-region-box b {
  background: var(--dowelify-acid);
  color: var(--dowelify-ink);
}

.app-shell.is-product-workspace .intelligence-observation-list li > span {
  background: var(--dowelify-acid);
  color: var(--dowelify-ink);
}

.app-shell.is-product-workspace :is(
  .research-retry-card-body button,
  .visual-reference-offer button,
  .intelligence-pending-actions button,
  .measurement-conversation-card > button,
  .measurement-operation-recovery button,
  .measurement-protocol-state button,
  .garage-empty-case button
) {
  min-height: 44px;
  border: 1px solid var(--dowelify-control-edge);
  border-radius: 0;
  background: var(--dowelify-ink-3);
  color: var(--dowelify-cream);
  font-family: var(--dowelify-sans);
}

.app-shell.is-product-workspace .visual-reference-actions > a {
  border-color: var(--dowelify-control-edge);
  background: var(--dowelify-ink-3);
  color: var(--dowelify-cream);
}

.app-shell.is-product-workspace .visual-reference-actions > a.is-secondary {
  background: transparent;
  color: var(--dowelify-cream);
}

.app-shell.is-product-workspace .visual-reference-label {
  border-bottom-color: var(--dowelify-rule);
  background: var(--dowelify-field);
  color: var(--dowelify-reference);
}

.app-shell.is-product-workspace .visual-reference-link-preview {
  background: var(--dowelify-ink-3);
  color: var(--dowelify-muted);
}

.app-shell.is-product-workspace .workspace-case-sections section {
  border: 1px solid var(--dowelify-rule);
  border-radius: 0;
  background: var(--dowelify-field);
}

.app-shell.is-product-workspace :is(.video-media-add, .video-media-actions button) {
  min-height: 44px;
  border: 1px solid var(--dowelify-control-edge);
  border-radius: 0;
  background: var(--dowelify-ink-3);
  color: var(--dowelify-cream);
}

.app-shell.is-product-workspace .video-media-actions button.is-primary {
  border-color: var(--dowelify-acid);
  background: var(--dowelify-acid);
  color: var(--dowelify-ink);
}

.app-shell.is-product-workspace :is(.video-media-status, .video-media-observations li) {
  border-radius: 0;
  background: var(--dowelify-ink-3);
}

.app-shell.is-product-workspace .video-media-observations li {
  border-left-color: var(--dowelify-teal);
}

.app-shell.is-product-workspace .video-media-time-range { color: #62e0d1; }

.app-shell.is-product-workspace .video-media-preview,
.app-shell.is-product-workspace .video-media-fixture-label {
  border-radius: 0;
}

.app-shell.is-product-workspace .video-media-fixture-label {
  border: 1px solid #5d7fa7;
  background: var(--shell-blue-bg);
  color: var(--shell-blue-text);
}

.app-shell.is-product-workspace :is(.video-media-unavailable, .video-media-invalid-observation) {
  border: 1px solid rgb(244 191 114 / .42);
  background: var(--shell-amber-bg);
  color: var(--shell-amber-text);
}

.app-shell.is-product-workspace .video-media-error,
.app-shell.is-product-workspace .video-media-artifact.is-failed {
  border: 1px solid rgb(255 196 155 / .42);
  background: var(--shell-red-bg);
  color: var(--shell-red-text);
}

.app-shell.is-product-workspace :is(
  .video-media-artifact.is-partial,
  .video-media-artifact.is-recovery
) {
  border-color: rgb(244 191 114 / .42);
  background: var(--shell-amber-bg);
}

.app-shell.is-product-workspace .video-media-artifact.is-deleted {
  border-color: var(--dowelify-control-rule);
  border-style: dashed;
  background: rgb(247 244 234 / .02);
}

/* Job File keeps the five read views; the outer plate carries one signature cut. */
.app-shell.is-product-workspace .job-file-panel {
  position: relative;
  overflow: visible;
  border: 1px solid var(--dowelify-rule);
  background: var(--dowelify-panel);
  clip-path: var(--dowelify-chamfer);
}

.app-shell.is-product-workspace .job-file-header {
  border-bottom-color: var(--dowelify-rule);
  background: var(--dowelify-panel);
}

.app-shell.is-product-workspace .job-file-header button {
  border-color: var(--dowelify-control-edge);
  border-radius: 0;
  background: var(--dowelify-field);
}

.app-shell.is-product-workspace .job-file-rail {
  border-bottom-color: var(--dowelify-rule);
  background: var(--dowelify-field);
}

.app-shell.is-product-workspace .job-file-rail button {
  border-right-color: var(--dowelify-rule);
  border-radius: 0;
}

.app-shell.is-product-workspace .job-file-rail button:nth-child(1) > span { color: var(--dowelify-mark-lime); }
.app-shell.is-product-workspace .job-file-rail button:nth-child(2) > span { color: var(--dowelify-mark-copper); }
.app-shell.is-product-workspace .job-file-rail button:nth-child(3) > span { color: var(--dowelify-mark-registered-physical); }
.app-shell.is-product-workspace .job-file-rail button:nth-child(4) > span { color: var(--dowelify-mark-seated); }
.app-shell.is-product-workspace .job-file-rail button:nth-child(5) > span { color: var(--dowelify-mark-overlap); }

.app-shell.is-product-workspace .job-file-rail .job-view-glyph-layer.is-reference {
  color: var(--dowelify-mark-lime);
}

.app-shell.is-product-workspace .job-file-rail .job-view-glyph-layer.is-physical {
  color: var(--dowelify-mark-copper);
}

.app-shell.is-product-workspace .job-file-rail .job-view-glyph-layer.is-representation {
  color: var(--dowelify-mark-teal);
}

.app-shell.is-product-workspace .job-file-rail button.is-active {
  border-bottom-color: var(--dowelify-acid);
  background: rgb(215 255 67 / .055);
  color: var(--dowelify-cream);
}

.app-shell.is-product-workspace .job-file-scroll { background: var(--dowelify-panel); }

.app-shell.is-product-workspace :is(
  .job-file-loading,
  .job-file-empty,
  .job-file-empty button,
  .job-file-identity,
  .job-file-section,
  .job-file-decision-status,
  .job-file-result-list article,
  .job-file-decision-list article,
  .job-file-fact,
  .job-file-record-list > li,
  .job-file-record-meta > span,
  .job-file-capabilities span
) {
  border-radius: 0;
  box-shadow: none;
}

.app-shell.is-product-workspace :is(
  .job-file-loading,
  .job-file-empty,
  .job-file-identity,
  .job-file-section,
  .job-file-decision-status,
  .job-file-result-list article,
  .job-file-decision-list article,
  .job-file-record-list > li
) {
  border-color: var(--dowelify-rule);
  background: rgb(247 244 234 / .02);
}

.app-shell.is-product-workspace .job-file-fact {
  border-color: var(--dowelify-rule);
  background: var(--dowelify-field);
}

.app-shell.is-product-workspace .job-file-record-meta > span.is-person { background: rgb(212 147 74 / .1); color: #e8aa6d; }
.app-shell.is-product-workspace .job-file-record-meta > span.is-model { background: rgb(11 196 174 / .09); color: #62e0d1; }
.app-shell.is-product-workspace .job-file-record-meta > span.is-instrument { background: rgb(199 255 36 / .075); color: var(--dowelify-reference); }

/* Tool and Measurement views use the same dark working surface on screen. */
.app-shell.is-product-workspace .job-navigator .product-navigator-scroll.has-measurement-protocol,
.app-shell.is-product-workspace .measurement-protocol-workfield,
.app-shell.is-product-workspace .measurement-protocol-header {
  background: var(--dowelify-panel);
  color: var(--dowelify-cream);
}

.app-shell.is-product-workspace .measurement-protocol-header { border-bottom-color: var(--dowelify-rule); }
.app-shell.is-product-workspace .measurement-protocol-header > button { border-radius: 0; color: var(--dowelify-cream); }
.app-shell.is-product-workspace .measurement-protocol-header > button:hover { background: rgb(215 255 67 / .055); }

.app-shell.is-product-workspace :is(
  .measurement-protocol-section,
  .measurement-operation-recovery,
  .measurement-artifact-state,
  .measurement-section-heading > span,
  .measurement-fact-grid > div,
  .measurement-copy-block,
  .measurement-empty-copy,
  .measurement-form :is(input:not([type="checkbox"]), textarea, select),
  .measurement-check,
  .measurement-primary-action,
  .measurement-stop-actions button,
  .measurement-operation-recovery button,
  .measurement-protocol-state button,
  .measurement-stop-form details,
  .measurement-result-heading > span,
  .measurement-result-boundary > div,
  .measurement-conversation-card,
  .measurement-compact-result,
  .measurement-conversation-facts,
  .measurement-conversation-facts > div,
  .measurement-conversation-quality,
  .measurement-conversation-boundary > div,
  .measurement-conversation-record,
  .measurement-card-notice,
  .workspace-measurement-form input,
  .workspace-measurement-form button
) {
  border-radius: 0;
  box-shadow: none;
}

.app-shell.is-product-workspace :is(
  .measurement-protocol-section,
  .measurement-operation-recovery,
  .measurement-artifact-state,
  .measurement-fact-grid > div,
  .measurement-copy-block,
  .measurement-empty-copy,
  .measurement-check,
  .measurement-result-boundary > div,
  .measurement-conversation-card,
  .measurement-compact-result,
  .measurement-conversation-facts > div,
  .measurement-conversation-quality,
  .measurement-conversation-boundary > div,
  .measurement-conversation-record
) {
  border-color: var(--dowelify-rule);
  background: var(--dowelify-field);
  color: var(--dowelify-cream);
}

.app-shell.is-product-workspace .measurement-protocol-workfield :is(
  p,
  li,
  label,
  small,
  dt,
  code,
  .measurement-form-note,
  .measurement-copy-block li
) {
  color: var(--dowelify-muted);
}

.app-shell.is-product-workspace .measurement-form label :is(b, em) {
  color: var(--dowelify-muted);
}

.app-shell.is-product-workspace .measurement-protocol-workfield :is(
  h2,
  h3,
  strong,
  dd,
  summary
) {
  color: var(--dowelify-cream);
}

.app-shell.is-product-workspace :is(
  .measurement-procedure-steps > li > span,
  .measurement-observation-list > li > span
) {
  border-radius: 0;
  background: var(--dowelify-ink-3);
  color: var(--dowelify-reference);
}

.app-shell.is-product-workspace :is(
  .measurement-copy-block.is-hold,
  .measurement-stop-form details,
  .measurement-card-notice
) {
  border-color: rgb(244 191 114 / .35);
  background: var(--shell-amber-bg);
  color: var(--shell-amber-text);
}

.app-shell.is-product-workspace :is(
  .measurement-copy-block.is-limit,
  .measurement-compact-result.is-rejected,
  .measurement-compact-result.is-aborted,
  .measurement-result-detail.is-rejected,
  .measurement-result-detail.is-aborted
) {
  border-color: rgb(255 196 155 / .35);
  background: var(--shell-red-bg);
  color: var(--shell-red-text);
}

.app-shell.is-product-workspace .measurement-form :is(input:not([type="checkbox"]), textarea, select),
.app-shell.is-product-workspace .workspace-measurement-form input {
  border-color: var(--dowelify-control-edge);
  background: var(--dowelify-field);
  color: var(--dowelify-cream);
}

.app-shell.is-product-workspace :is(.measurement-primary-action, .workspace-measurement-form button) {
  border-color: var(--dowelify-acid);
  background: var(--dowelify-acid);
  color: var(--dowelify-ink);
  clip-path: var(--dowelify-chamfer);
}

.app-shell.is-product-workspace :is(
  .measurement-form :is(input:not([type="checkbox"]), textarea, select),
  .measurement-primary-action,
  .measurement-stop-actions button,
  .measurement-operation-recovery button,
  .measurement-protocol-state button,
  .measurement-conversation-card > button
) {
  font-family: var(--dowelify-sans);
}

.app-shell.is-product-workspace :is(
  .measurement-operation-recovery button,
  .measurement-protocol-state button,
  .measurement-artifact-state button,
  .measurement-conversation-card > button
) {
  min-height: 44px;
  border: 1px solid var(--dowelify-control-edge);
  border-radius: 0;
  background: var(--dowelify-ink-3);
  color: var(--dowelify-cream);
}

.app-shell.is-product-workspace .measurement-stop-actions button {
  min-height: 44px;
  border-color: var(--dowelify-error);
  border-radius: 0;
  background: var(--dowelify-error);
  color: var(--dowelify-ink);
}

.app-shell.is-product-workspace :is(.workspace-measurement-form input, .workspace-measurement-form button) {
  min-height: 44px;
}

.app-shell.is-product-workspace .measurement-conversation-card > header > span {
  border-color: var(--dowelify-control-edge);
  border-radius: 0;
  background: var(--dowelify-ink-3);
  color: var(--dowelify-reference);
}

.app-shell.is-product-workspace .measurement-conversation-card > header small {
  color: var(--dowelify-muted);
}

.app-shell.is-product-workspace .measurement-conversation-facts {
  border-color: var(--dowelify-rule);
  border-radius: 0;
  background: var(--dowelify-rule);
}

.app-shell.is-product-workspace :is(
  .measurement-artifact-state button,
  .measurement-artifact-error
) {
  border-radius: 0;
  box-shadow: none;
}

.app-shell.is-product-workspace .measurement-artifact-error,
.app-shell.is-product-workspace .measurement-operation-recovery.is-error,
.app-shell.is-product-workspace .measurement-protocol-state.is-error {
  border: 1px solid rgb(255 196 155 / .42);
  background: var(--shell-red-bg);
  color: var(--shell-red-text);
}

.app-shell.is-product-workspace .measurement-operation-recovery:not(.is-error),
.app-shell.is-product-workspace .measurement-protocol-section.is-unavailable {
  border-color: rgb(244 191 114 / .42);
  background: var(--shell-amber-bg);
  color: var(--shell-amber-text);
}

.app-shell.is-product-workspace .measurement-protocol-section.is-unavailable { border-style: dashed; }

.app-shell.is-product-workspace .measurement-operation-recovery.is-error :is(p, small, strong),
.app-shell.is-product-workspace .measurement-artifact-error :is(p, code, strong),
.app-shell.is-product-workspace .measurement-protocol-state.is-error :is(h3, p) {
  color: inherit;
}

/* The proposed-measurement card is a server proposal, not a Need. It reads as
   a quiet offer so it can never be mistaken for a recorded measurement. */
.measurement-need-draft-card {
  display: grid;
  gap: 10px;
  margin: 12px 0 0;
  padding: 14px 16px;
  border: 1px dashed var(--dowelify-rule, rgb(0 0 0 / .18));
  border-radius: 14px;
  background: transparent;
}

.measurement-need-draft-card header {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.measurement-need-draft-card small {
  display: block;
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
  opacity: .68;
}

.measurement-need-draft-card h3 {
  margin: 4px 0 0;
  font-size: 15px;
  line-height: 1.35;
}

.measurement-need-draft-card p { margin: 0; font-size: 14px; }

.measurement-need-draft-card :is(.measurement-need-draft-limits ul, .measurement-need-draft-honesty) {
  margin: 4px 0 0;
  padding-left: 18px;
  display: grid;
  gap: 4px;
  font-size: 12.5px;
  opacity: .82;
}

.measurement-need-draft-card button {
  justify-self: start;
  display: inline-flex;
  gap: 6px;
  align-items: center;
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid var(--dowelify-rule, rgb(0 0 0 / .2));
  border-radius: 999px;
  background: transparent;
  font: inherit;
  cursor: pointer;
}

.measurement-need-draft-card.is-compact { margin: 8px 0 4px; }

.measurement-form-error {
  margin: 0;
  font-size: 13px;
  color: var(--shell-red-text, #8a2a1a);
}

.app-shell.is-product-workspace :is(.measurement-primary-action, .workspace-measurement-form button):focus-visible,
body.is-product-workspace-active .bottom-sheet .sheet-action.is-primary:focus-visible {
  outline-color: var(--dowelify-ink);
  outline-offset: -5px;
}

/* Paths retains its governed geometry; only chrome and inspector plates change. */
.app-shell.is-product-workspace .job-map-workfield {
  background: transparent;
}

.app-shell.is-product-workspace :is(.job-map-toolbar, .job-map-operation-note) {
  border-color: var(--dowelify-rule);
  background: transparent;
}

.app-shell.is-product-workspace :is(
  .path-back-to-now,
  .job-map-empty button,
  .job-map-operation-note button,
  .job-map-lens,
  .job-map-annotation,
  .path-inspector-head > button,
  .path-inspector-content > button,
  .job-map-read-only-note,
  .job-map-person-possibility-state,
  .job-map-person-possibility-state button,
  .job-map-person-possibility input,
  .job-map-person-possibility textarea,
  .job-map-person-possibility > button,
  .job-map-bounded-notice > button
) {
  border-radius: 0;
  box-shadow: none;
}

.app-shell.is-product-workspace .job-map-annotation {
  border-color: var(--dowelify-control-edge);
  background: var(--dowelify-ink-2);
}

.app-shell.is-product-workspace :is(.path-back-to-now, .job-map-empty button) {
  border-color: var(--dowelify-control-edge);
  background: var(--dowelify-field);
}

.app-shell.is-product-workspace .job-map-lens[aria-pressed="true"] {
  background: color-mix(in srgb, var(--lens-color) 9%, transparent);
  box-shadow: inset 0 -2px 0 var(--lens-color);
}

.app-shell.is-product-workspace .job-map-person-possibility :is(input, textarea) {
  border-color: var(--dowelify-control-edge);
  background: var(--dowelify-field);
  color: var(--dowelify-cream);
}

/* Independent overlays are allowed one structural cut; their contents stay square. */
body.is-product-workspace-active .bottom-sheet {
  position: fixed;
  border-color: var(--dowelify-control-edge);
  border-radius: 0;
  background: var(--dowelify-ink-2);
  box-shadow: 0 28px 70px rgb(0 0 0 / .42);
  clip-path: var(--dowelify-chamfer);
}

body.is-product-workspace-active .sheet-backdrop {
  background: rgb(0 0 0 / .66);
  backdrop-filter: none;
}

/* Inline still capture is a local composition instrument. The overlay lines
   are deliberately static: they do not inspect pixels or represent alignment. */
.inline-camera-backdrop,
.inline-camera {
  position: fixed;
  z-index: 120;
}

.inline-camera-backdrop {
  inset: 0;
  background: rgb(0 0 0 / .78);
}

.inline-camera {
  box-sizing: border-box;
  top: 50%;
  left: 50%;
  display: grid;
  width: min(760px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  overflow: auto;
  border: 1px solid var(--dowelify-control-edge);
  background: var(--dowelify-panel);
  color: var(--dowelify-cream);
  box-shadow: 0 28px 90px rgb(0 0 0 / .58);
  transform: translate(-50%, -50%);
  color-scheme: dark;
  font-family: var(--dowelify-sans);
}

.inline-camera[hidden],
.inline-camera-backdrop[hidden],
.inline-camera :is(button, [hidden])[hidden] {
  display: none;
}

.inline-camera-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  min-width: 0;
  padding: 18px 18px 15px;
  gap: 18px;
  border-bottom: 1px solid var(--dowelify-rule);
}

.inline-camera-header > div { min-width: 0; }
.inline-camera-eyebrow {
  color: var(--dowelify-acid);
  font: 750 10px/1.2 var(--dowelify-mono);
  letter-spacing: .12em;
}
.inline-camera-header h2 {
  margin: 4px 0 0;
  font-size: clamp(20px, 3vw, 28px);
  line-height: 1.05;
  letter-spacing: -.035em;
}

.inline-camera-close,
.inline-camera-secondary,
.inline-camera-primary,
.inline-camera-shutter {
  min-width: 44px;
  min-height: 44px;
  border: 1px solid var(--dowelify-control-edge);
  border-radius: 0;
  background: var(--dowelify-field);
  color: var(--dowelify-cream);
  font: 700 13px/1 var(--dowelify-sans);
  cursor: pointer;
}
.inline-camera-close { display: grid; flex: 0 0 44px; place-items: center; padding: 0; }
.inline-camera-close svg { width: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.inline-camera :is(button, [tabindex]):focus-visible {
  outline: 2px solid var(--dowelify-acid);
  outline-offset: 2px;
}
.inline-camera button:disabled { cursor: not-allowed; opacity: .45; }

.inline-camera-stage {
  position: relative;
  overflow: hidden;
  min-height: min(58vh, 470px);
  background:
    radial-gradient(circle at 50% 42%, rgb(247 244 234 / .055), transparent 35%),
    #090b08;
  isolation: isolate;
}
.inline-camera-stage video {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #090b08;
}
.inline-camera:not([data-camera-state="live"]):not([data-camera-state="capturing"]) .inline-camera-stage video { visibility: hidden; }
.inline-camera-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: rgb(247 244 234 / .42);
}
.inline-camera-empty svg { width: 58px; fill: none; stroke: currentColor; stroke-width: 1.1; }
.inline-camera:is([data-camera-state="live"], [data-camera-state="capturing"]) .inline-camera-empty { display: none; }

.inline-camera-guides {
  position: absolute;
  z-index: 2;
  inset: clamp(18px, 6%, 40px);
  pointer-events: none;
}
.inline-camera-guides > i {
  position: absolute;
  width: clamp(42px, 10vw, 82px);
  height: clamp(42px, 10vw, 82px);
  border-color: rgb(215 255 67 / .82);
  border-style: solid;
  border-width: 0;
}
.inline-camera-guides .is-top-left { top: 0; left: 0; border-top-width: 1px; border-left-width: 1px; }
.inline-camera-guides .is-top-right { top: 0; right: 0; border-top-width: 1px; border-right-width: 1px; }
.inline-camera-guides .is-bottom-left { bottom: 0; left: 0; border-bottom-width: 1px; border-left-width: 1px; }
.inline-camera-guides .is-bottom-right { right: 0; bottom: 0; border-right-width: 1px; border-bottom-width: 1px; }
.inline-camera-guides > span {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 16px;
  height: 16px;
  border-top: 1px solid rgb(247 244 234 / .58);
  border-left: 1px solid rgb(247 244 234 / .58);
  transform: translate(-50%, -50%) rotate(45deg);
}

.inline-camera.is-capture-family-overlay .inline-camera-guides {
  visibility: hidden;
}

.inline-camera-copy {
  display: grid;
  padding: 13px 18px 12px;
  gap: 5px;
  border-top: 1px solid var(--dowelify-rule);
}
.inline-camera-copy p { margin: 0; color: var(--dowelify-cream); font-size: 13px; line-height: 1.45; }
.inline-camera-copy small { color: var(--dowelify-muted); font: 650 10px/1.45 var(--dowelify-mono); }
.inline-camera[data-camera-state="denied"] .inline-camera-copy p,
.inline-camera[data-camera-state="unavailable"] .inline-camera-copy p,
.inline-camera[data-camera-state="ended"] .inline-camera-copy p { color: var(--dowelify-warning); }

.inline-camera-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  padding: 0 18px 18px;
  gap: 10px;
}
.inline-camera-primary {
  border-color: var(--dowelify-acid);
  background: var(--dowelify-acid);
  color: var(--dowelify-ink);
}
.inline-camera-primary:focus-visible { outline-color: var(--dowelify-ink); outline-offset: -5px; }
.inline-camera-shutter {
  position: relative;
  justify-self: end;
  width: 62px;
  height: 62px;
  border: 2px solid var(--dowelify-cream);
  border-radius: 50%;
  background: transparent;
}
.inline-camera-shutter span {
  position: absolute;
  inset: 5px;
  border-radius: 50%;
  background: var(--dowelify-acid);
}

@media (hover: hover) and (pointer: fine) {
  .inline-camera :is(.inline-camera-close, .inline-camera-secondary):hover { background: var(--dowelify-ink-3); }
  .inline-camera-primary:hover { background: var(--dowelify-acid-hover); }
}

@media (max-width: 600px) {
  .inline-camera {
    top: 0;
    left: 0;
    width: 100vw;
    height: 100dvh;
    max-height: none;
    overflow: hidden;
    grid-template-rows: auto minmax(0, 1fr) auto auto;
    border: 0;
    clip-path: none;
    transform: none;
  }
  .inline-camera-header { padding: max(12px, env(safe-area-inset-top)) 12px 11px; }
  .inline-camera-header h2 { font-size: 20px; }
  .inline-camera-stage { min-height: 0; }
  .inline-camera-copy { padding: 10px 12px 8px; }
  .inline-camera-actions { padding: 0 12px max(12px, env(safe-area-inset-bottom)); }
  .inline-camera-secondary, .inline-camera-primary { min-height: 50px; }
  .inline-camera.is-capture-carousel {
    grid-template-rows: auto auto auto auto minmax(0, 1fr) auto auto;
  }
  .inline-camera.is-capture-carousel .capture-carousel,
  .inline-camera.is-capture-carousel .capture-scale-band,
  .inline-camera.is-capture-carousel .capture-sibling-lighting { padding-inline: 12px; }
}

@media (max-width: 365px) {
  .inline-camera-header { gap: 10px; }
  .inline-camera-copy p { font-size: 12px; }
  .inline-camera-copy small { font-size: 9px; }
  .inline-camera-actions { grid-template-columns: minmax(0, 1fr) auto; }
  .inline-camera-primary { padding-inline: 13px; }
}

@media (forced-colors: active) {
  .inline-camera,
  .inline-camera-stage,
  .inline-camera :is(button, video) {
    border: 1px solid CanvasText;
  }
  .inline-camera-guides > i { border-color: Highlight; }
  .inline-camera-guides > span { border-color: Highlight; }
  .inline-camera-shutter span { background: Highlight; }
  .capture-overlay-coin,
  .capture-overlay-scale,
  .capture-overlay-thread,
  .capture-overlay-context,
  .capture-overlay-box,
  .capture-overlay-nameplate { stroke: Highlight; }
  .capture-qr-corner-glyph { border-color: Highlight; }
}

.capture-carousel {
  display: flex;
  min-width: 0;
  padding: 8px 18px 0;
  border-bottom: 1px solid var(--dowelify-rule);
}
.capture-carousel-strip {
  display: flex;
  gap: 8px;
  min-width: 0;
  overflow-x: auto;
  padding-bottom: 8px;
}
.capture-carousel-tile {
  flex: 0 0 auto;
  min-width: 44px;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--dowelify-control-edge);
  border-radius: 0;
  background: var(--dowelify-field);
  color: var(--dowelify-cream);
  font: 650 12px/1.2 var(--dowelify-sans);
  white-space: nowrap;
}
.capture-carousel-tile.is-ready { cursor: pointer; }
.capture-carousel-tile.is-selected {
  border-color: var(--dowelify-acid);
  color: var(--dowelify-ink);
  background: var(--dowelify-acid);
}
.capture-carousel-tile.is-preview {
  opacity: .55;
  cursor: default;
}
.capture-scale-band {
  padding: 8px 18px;
}
.capture-scale-band-control {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}
.capture-scale-band-option {
  min-width: 44px;
  min-height: 44px;
  border: 1px solid var(--dowelify-control-edge);
  border-radius: 0;
  background: var(--dowelify-field);
  color: var(--dowelify-cream);
  font: 650 11px/1 var(--dowelify-mono);
  letter-spacing: .04em;
  text-transform: lowercase;
  cursor: pointer;
}
.capture-scale-band-option.is-selected {
  border-color: var(--dowelify-acid);
  color: var(--dowelify-ink);
  background: var(--dowelify-acid);
}
.capture-scale-band-option.is-disabled,
.capture-scale-band-option:disabled {
  opacity: .42;
  cursor: default;
}
.capture-sibling-lighting {
  padding: 0 18px 8px;
}
.capture-sibling-lighting-copy {
  display: grid;
  gap: 4px;
}
.capture-sibling-hint {
  margin: 0;
  color: var(--dowelify-cream);
  font: 650 11px/1.4 var(--dowelify-sans);
}
.capture-sibling-lighting-copy small {
  color: var(--dowelify-muted);
  font: 650 10px/1.4 var(--dowelify-mono);
}
.capture-overlay-host,
.capture-overlay {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
}
.capture-overlay {
  display: grid;
  place-items: end center;
  padding: 12% 10% 14%;
}
.capture-overlay-marks {
  width: min(42%, 180px);
  overflow: visible;
}
.capture-overlay[data-scale-band="tiny"] .capture-overlay-marks {
  width: min(28%, 120px);
}
.capture-overlay[data-scale-band="hand"] .capture-overlay-marks {
  width: min(42%, 180px);
}
.capture-overlay[data-scale-band="equipment"] .capture-overlay-marks {
  width: min(58%, 240px);
}
.capture-overlay[data-scale-band="place"] .capture-overlay-marks {
  width: min(72%, 300px);
}
.capture-view-prompt {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 8px;
  margin: 8px 0 0;
  color: var(--dowelify-cream);
  font: 650 11px/1.35 var(--dowelify-mono);
}
.capture-view-step { opacity: .55; }
.capture-view-step.is-current {
  opacity: 1;
  color: var(--dowelify-acid);
}
.capture-view-step-sep { opacity: .4; }
.capture-view-instruction {
  flex: 1 1 100%;
  color: rgb(247 244 234 / .78);
}
.capture-overlay-coin,
.capture-overlay-scale,
.capture-overlay-thread,
.capture-overlay-context,
.capture-overlay-box,
.capture-overlay-nameplate {
  stroke: rgb(215 255 67 / .88);
  stroke-width: 1.1;
}
.capture-overlay-coin,
.capture-overlay-thread,
.capture-overlay-context,
.capture-overlay-box,
.capture-overlay-nameplate { stroke-dasharray: 3 3; }
.capture-overlay-copy {
  margin: 8px 0 0;
  color: rgb(247 244 234 / .78);
  font: 650 10px/1.35 var(--dowelify-mono);
  text-align: center;
}
.capture-qr-corner {
  position: absolute;
  z-index: 4;
  top: 10px;
  right: 10px;
  display: grid;
  justify-items: end;
  gap: 6px;
  max-width: 42%;
  pointer-events: none;
}
.capture-qr-corner-glyph {
  width: 28px;
  height: 28px;
  border: 1px solid rgb(247 244 234 / .55);
  background:
    linear-gradient(rgb(247 244 234 / .7), rgb(247 244 234 / .7)) 3px 3px / 6px 6px no-repeat,
    linear-gradient(rgb(247 244 234 / .7), rgb(247 244 234 / .7)) 19px 3px / 6px 6px no-repeat,
    linear-gradient(rgb(247 244 234 / .7), rgb(247 244 234 / .7)) 3px 19px / 6px 6px no-repeat;
}
.capture-qr-corner[data-qr-status="glyph_visible_unresolved"] .capture-qr-corner-glyph,
.capture-qr-corner-glyph.is-address-unresolved {
  border-style: dashed;
  border-color: rgb(247 244 234 / .88);
  background-color: transparent;
}
.capture-qr-corner p {
  margin: 0;
  color: rgb(247 244 234 / .82);
  font: 650 9px/1.35 var(--dowelify-mono);
  text-align: right;
}
@media (pointer: coarse) {
  .capture-qr-corner {
    top: 12px;
    right: 12px;
    max-width: 52%;
    gap: 8px;
  }
  .capture-qr-corner-glyph {
    width: 32px;
    height: 32px;
    background:
      linear-gradient(rgb(247 244 234 / .7), rgb(247 244 234 / .7)) 4px 4px / 7px 7px no-repeat,
      linear-gradient(rgb(247 244 234 / .7), rgb(247 244 234 / .7)) 21px 4px / 7px 7px no-repeat,
      linear-gradient(rgb(247 244 234 / .7), rgb(247 244 234 / .7)) 4px 21px / 7px 7px no-repeat;
  }
  .capture-qr-corner p {
    font-size: 10px;
  }
}

@media (hover: hover) and (pointer: fine) {
  .capture-carousel-tile.is-ready:hover,
  .capture-scale-band-option:hover { background: var(--dowelify-ink-3); }
  .capture-carousel-tile.is-selected:hover,
  .capture-scale-band-option.is-selected:hover { background: var(--dowelify-acid-hover); }
}

body.is-product-workspace-active .toast {
  border-color: var(--dowelify-control-edge);
  border-radius: 0;
  background: var(--dowelify-ink-3);
  color: var(--dowelify-cream);
}

body.is-product-workspace-active :is(
  .sheet-close,
  .spec-grid,
  .spec-cell,
  .alternative-card,
  .order-item,
  .garage-select-item,
  .feedback-option
) {
  border-radius: 0;
  box-shadow: none;
}

body.is-product-workspace-active .sheet-close {
  border: 1px solid var(--dowelify-control-edge);
  background: var(--dowelify-field);
  color: var(--dowelify-cream);
}

body.is-product-workspace-active .sheet-action.is-primary {
  border-color: var(--dowelify-acid);
  background: var(--dowelify-acid);
  color: var(--dowelify-ink);
}

body.is-product-workspace-active .spec-cell { background: var(--dowelify-field); }

body.is-product-workspace-active :is(
  .sheet-action,
  .workspace-tool-list > button,
  .rule-banner
) {
  border-radius: 0;
  box-shadow: none;
}

body.is-product-workspace-active .bottom-sheet :is(
  .sheet-action,
  .workspace-tool-list > button
) {
  border-color: var(--dowelify-control-edge);
  background: var(--dowelify-field);
  color: var(--dowelify-cream);
}

body.is-product-workspace-active .bottom-sheet .sheet-action.is-primary {
  border-color: var(--dowelify-acid);
  background: var(--dowelify-acid);
  color: var(--dowelify-ink);
  clip-path: var(--dowelify-chamfer);
}

body.is-product-workspace-active .bottom-sheet .sheet-field textarea,
body.is-product-workspace-active .bottom-sheet .garage-link-form input,
body.is-product-workspace-active .bottom-sheet .share-job-link input,
body.is-product-workspace-active .bottom-sheet .pilot-access-form input {
  min-height: 44px;
  border: 1px solid var(--dowelify-control-edge);
  border-radius: 0;
  background: var(--dowelify-field);
  color: var(--dowelify-cream);
}

body.is-product-workspace-active .bottom-sheet .sheet-field textarea { font-family: var(--dowelify-sans); }
body.is-product-workspace-active .bottom-sheet .garage-link-form input { font-family: var(--dowelify-mono); }

body.is-product-workspace-active .bottom-sheet .pilot-access-error {
  border-color: rgb(255 196 155 / .42);
  border-radius: 0;
  background: var(--shell-red-bg);
  color: var(--shell-red-text);
}

body.is-product-workspace-active .bottom-sheet :is(.research-request-boundary, .garage-sync-code) {
  border-radius: 0;
}

body.is-product-workspace-active .bottom-sheet .garage-sync-code {
  border: 1px solid var(--dowelify-control-edge);
  background: var(--dowelify-field);
  color: var(--dowelify-cream);
  font-family: var(--dowelify-mono);
}

.app-shell.is-product-workspace :is(
  .research-retry-card-body button,
  .measurement-conversation-card > button,
  .video-media-actions button.is-primary
),
.app-shell.is-product-workspace .visual-reference-actions > a:not(.is-secondary) {
  border-color: var(--dowelify-acid);
  background: var(--dowelify-acid);
  color: var(--dowelify-ink);
}

.app-shell.is-product-workspace :is(
  .research-retry-card-body button,
  .measurement-conversation-card > button,
  .video-media-actions button.is-primary
):focus-visible,
.app-shell.is-product-workspace .visual-reference-actions > a:not(.is-secondary):focus-visible {
  outline-color: var(--dowelify-ink);
  outline-offset: -4px;
}

/* Document navigation is application chrome; the open document remains paper-true. */
.app-shell.is-product-workspace :is(
  .ct-job-documents-toolbar button,
  .ct-job-documents-entry,
  .ct-job-documents-error button
) {
  border-radius: 0;
  box-shadow: none;
}

.app-shell.is-product-workspace .ct-job-documents-toolbar {
  border-bottom-color: var(--dowelify-rule);
  background: var(--dowelify-panel);
}

.app-shell.is-product-workspace :is(.ct-job-documents-toolbar button, .ct-job-documents-error button) {
  min-height: 44px;
  border-color: var(--dowelify-control-edge);
}

.app-shell.is-product-workspace .ct-job-documents-entry {
  border-color: var(--dowelify-rule);
  background: var(--dowelify-field);
  color: var(--dowelify-cream);
}

/* Help temporarily leaves product-workspace mode, so its exact component—not
   a broad global reset—owns the same token and type aliases. */
.onboarding-shell {
  --help-canvas: var(--dowelify-canvas);
  --help-panel: var(--dowelify-panel);
  --help-raised: var(--dowelify-ink-2);
  --help-field: var(--dowelify-field);
  --help-text: var(--dowelify-cream);
  --help-muted: var(--dowelify-muted);
  --help-acid: var(--dowelify-acid);
  --help-rule: var(--dowelify-rule);
  font-family: var(--dowelify-sans);
}

.onboarding-shell :is(
  .onboarding-progress,
  .onboarding-kicker
) {
  font-family: var(--dowelify-mono);
}

.app-shell.is-onboarding { min-height: 0; }

/* The fixed shell controls occupy the top rail; working content begins below
   it, while the entrance remains vertically centered by its own layout. */
.app-shell.is-product-workspace:not(.is-path-map-open)
  .intelligence-transcript:not(:has(> .application-front-door)) {
  padding-top: 54px;
  scroll-padding-top: 54px;
}

.app-shell.is-product-workspace.is-path-map-open .paths-revision-head {
  padding-top: 54px;
}

/* The inherited entrance hover moved on touch browsers. Movement is opt-in
   only for a genuine fine pointer below. */
.app-shell.is-product-workspace
  .application-front-door.is-new-job
  .front-door-capture-actions > .is-show:hover {
  transform: none;
}

@media (hover: hover) and (pointer: fine) {
  .app-shell.is-product-workspace
    .application-front-door.is-new-job
    .front-door-capture-actions > .is-show:hover {
    transform: translateY(-2px);
  }
}

@media (max-width: 760px) {
  .app-shell.is-product-workspace .application-front-door {
    width: 100%;
    padding: 26px 20px;
  }

  .app-shell.is-product-workspace .job-file-panel {
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
  }

  body.is-product-workspace-active .bottom-sheet {
    right: 0;
    bottom: 0;
    left: 0;
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
  }

}

@media (max-width: 1180px) {
  .app-shell.is-product-workspace .navigator-backdrop { z-index: 21; }
  .app-shell.is-product-workspace:not(.is-left-closed) .work-navigator,
  .app-shell.is-product-workspace:not(.is-right-closed) .job-navigator { z-index: 22; }

  .app-shell.is-product-workspace .app-header {
    z-index: 23;
    pointer-events: auto;
  }

  .app-shell.is-product-workspace .workspace-shell-controls { pointer-events: none; }
  .app-shell.is-product-workspace .workspace-shell-toggle { pointer-events: auto; }

  .app-shell.is-product-workspace:not(.is-left-closed) .workspace-shell-toggle:is(
    .is-job-file-sidebar,
    .is-paths-sidebar,
    .is-right-sidebar
  ) {
    visibility: hidden;
    pointer-events: none;
  }
}

@media (max-width: 600px) {
  .app-shell.is-product-workspace.is-path-map-open .paths-plan-jobname,
  .app-shell.is-product-workspace.is-path-map-open .paths-plan-toolbar .job-map-lenses {
    padding-left: 54px;
  }

  .app-shell.is-product-workspace.is-path-map-open .paths-plan-toolbar .job-map-lenses {
    scroll-padding-left: 54px;
  }

  .app-shell.is-product-workspace.is-path-map-open .paths-revision-empty {
    position: static;
    right: auto;
    bottom: auto;
    width: auto;
    min-width: 0;
    padding: 8px 2px;
    border: 0;
    background: transparent;
    box-shadow: none;
    pointer-events: none;
  }

  .app-shell.is-product-workspace.is-path-map-open .paths-revision-empty strong {
    writing-mode: vertical-rl;
    font-size: 7px;
    letter-spacing: .08em;
    text-transform: uppercase;
  }

  .app-shell.is-product-workspace.is-path-map-open .paths-revision-empty span { display: none; }

  .app-shell.is-product-workspace.is-path-map-open
    .job-map-projection.is-plan-view .job-map-list-fallback {
    box-sizing: border-box;
    position: sticky;
    left: 64px;
    width: calc(100vw - 140px);
    max-width: calc(100vw - 140px);
    min-width: 0;
  }
}

@media (max-width: 480px) {
  .app-shell.is-product-workspace .intelligence-workspace { padding-inline: 10px; }
  .app-shell.is-product-workspace .application-front-door { padding-inline: 18px; }
  .app-shell.is-product-workspace .job-file-content { padding: 11px; }

}

@media (prefers-reduced-motion: reduce) {
  .app-shell.is-product-workspace *,
  body.is-product-workspace-active .bottom-sheet,
  body.is-product-workspace-active .sheet-backdrop,
  body.is-product-workspace-active .bottom-sheet * {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
  }

  .app-shell.is-product-workspace :is(
    .navigator-new-job,
    .application-front-door.is-new-job .front-door-capture-actions > .is-show
  ):hover {
    transform: none !important;
  }
}

@media (forced-colors: active) {
  .app-shell.is-product-workspace :is(
    .work-navigator,
    .application-front-door,
    .job-file-panel,
    .intelligence-composer-row,
    .job-map-annotation
  ),
  body.is-product-workspace-active .bottom-sheet {
    border: 1px solid CanvasText;
  }

  .app-shell.is-product-workspace :is(
    .work-navigator,
    .application-front-door.is-new-job,
    .job-file-panel
  )::before,
  body.is-product-workspace-active .bottom-sheet::before {
    background: CanvasText;
  }

  .app-shell.is-product-workspace :is(
    .navigator-row.is-active,
    .navigator-job-row.is-active,
    .account-display-settings > button[aria-pressed="true"],
    .job-file-rail button.is-active,
    .job-map-lens[aria-pressed="true"]
  ) {
    outline: 2px solid Highlight;
    outline-offset: -2px;
  }
}

.guides-sops-candidates {
  margin: 0;
  padding-left: 1.1rem;
  min-width: 0;
}
.guides-sops-candidates li {
  margin: 0 0 0.55rem;
}
.guides-sops-candidates small {
  display: block;
  color: rgb(247 244 234 / .62);
}
.guides-sops-origin-fields {
  display: grid;
  gap: 0.7rem;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}
.guides-sops-origin-fields small,
.guides-sops-generate-copy,
.guides-sops-review-note {
  display: block;
  color: rgb(247 244 234 / .62);
}
.guides-sops-review-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.45rem;
}
