/* Web adapter for themeColors.ts borderStrong/background/textSecondary tokens.
   Native surfaces continue using the canonical React Native theme. */
:root {
  --workspace-scroll-thumb: #bfcad7;
  --workspace-scroll-hover: #667085;
  --workspace-scroll-track: #f2f3f5;
  scrollbar-color: var(--workspace-scroll-thumb) var(--workspace-scroll-track);
  scrollbar-width: auto;
}
*,
*::before,
*::after {
  box-sizing: border-box;
}
html,
body,
#root {
  min-width: 0;
}
body {
  overscroll-behavior-x: none;
}
* {
  scrollbar-color: var(--workspace-scroll-thumb) var(--workspace-scroll-track);
}
::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}
::-webkit-scrollbar-track {
  background: var(--workspace-scroll-track);
}
::-webkit-scrollbar-thumb {
  background: var(--workspace-scroll-thumb);
  border: 3px solid var(--workspace-scroll-track);
  border-radius: 12px;
}
::-webkit-scrollbar-thumb:hover,
::-webkit-scrollbar-thumb:active {
  background: var(--workspace-scroll-hover);
}
a,
button,
[role='button'],
[role='link'],
[role='tab'] {
  cursor: pointer;
}
[aria-disabled='true'],
:disabled {
  cursor: not-allowed;
}
:focus-visible {
  outline: 3px solid #805c00 !important;
  outline-offset: 3px;
}
[role='navigation'] {
  overflow-y: auto;
  scrollbar-gutter: stable;
}
[role='navigation'] a:hover {
  background-color: #f2f3f5;
}
[role='navigation'] a[aria-current='page']:hover {
  background-color: #fff4b8;
}
.maplibregl-ctrl-group button {
  width: 48px;
  height: 48px;
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
  }
}
@media (forced-colors: active) {
  * {
    scrollbar-color: auto;
  }
  :focus-visible {
    outline-color: Highlight !important;
  }
  [aria-current='page'] {
    outline: 2px solid Highlight;
    outline-offset: -2px;
  }
}
@media print {
  [data-testid='web-sidebar'] {
    display: none !important;
  }
}

/* Auth/shell presentation adapter. Color values originate in themeColors.ts. */
.panel-auth {
  display: grid;
  grid-template-columns: minmax(390px, 1.08fr) minmax(440px, 1fr);
  min-height: 100dvh;
  width: 100%;
  background: var(--panel-canvas);
  color: var(--panel-text);
}
.panel-auth-art {
  background: var(--panel-dark);
  color: var(--panel-surface);
  position: relative;
  overflow: hidden;
  padding: clamp(32px, 4.2vw, 72px);
  display: flex;
  flex-direction: column;
  min-height: 900px;
}
.panel-auth-brand,
.panel-auth-mobile-brand,
.panel-auth-home {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 21px;
  font-weight: 750;
  letter-spacing: -0.8px;
}
.panel-auth-brand,
.panel-auth-home {
  align-self: flex-start;
  min-height: 48px;
  color: inherit;
  text-decoration: none;
}
.panel-auth-statement {
  position: relative;
  z-index: 1;
  margin-top: 66px;
}
.panel-auth-eyebrow {
  font-size: 10px;
  letter-spacing: 2px;
  font-weight: 650;
  color: var(--panel-accent);
}
.panel-auth h1 {
  font-size: clamp(48px, 4.6vw, 76px);
  line-height: 1.04;
  letter-spacing: -3px;
  font-weight: 650;
  margin: 24px 0;
}
.panel-auth h1 em {
  font-style: normal;
  color: var(--panel-accent);
}
.panel-auth-statement > p:last-child {
  font-size: 15px;
  line-height: 1.65;
  opacity: 0.78;
  margin: 0;
}
.panel-auth-blueprint {
  position: relative;
  margin: -22px -52px -25px;
  flex: 1;
  display: flex;
  align-items: center;
  min-height: 315px;
}
.engineering-drawing {
  display: block;
  width: 100%;
  max-height: 430px;
  overflow: visible;
}
.panel-art-caption {
  position: absolute;
  bottom: 32px;
  left: 52px;
  font-size: 9px;
  letter-spacing: 2px;
  opacity: 0.6;
}
.panel-auth-process {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  border-top: 1px solid #ffffff30;
  padding-top: 24px;
  font-size: 11px;
  line-height: 1.5;
}
.panel-auth-process > [aria-hidden] {
  color: var(--panel-accent);
  /* Draw the decorative arrow without relying on an OS font glyph. */
  font-size: 0;
  width: 8px;
  height: 8px;
  position: relative;
  border-top: 1px solid currentColor;
  border-right: 1px solid currentColor;
}
.panel-auth-process > [aria-hidden]::before {
  content: '';
  position: absolute;
  width: 10px;
  height: 1px;
  top: -1px;
  right: 0;
  background: currentColor;
  transform: rotate(-45deg);
  transform-origin: right center;
}
.panel-auth-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding: 40px clamp(24px, 4vw, 64px) 24px;
}
.panel-auth-mobile-brand {
  display: none;
}
.panel-auth-form {
  display: flex;
  flex: 1;
  min-height: 0;
}
.panel-auth-form > div {
  flex: 1;
}
.panel-auth [data-testid='auth-brand'] {
  display: none;
}
.panel-auth [data-testid='auth-login-card'] {
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
}
.panel-auth [data-testid='auth-login-card'] > div:first-child {
  font-size: 34px;
  letter-spacing: -1.2px;
  line-height: 1.25;
}
.panel-auth [data-testid='auth-login-card'] > div:nth-child(2) {
  font-size: 15px;
  line-height: 1.6;
  margin-top: 12px;
  margin-bottom: 36px;
  color: var(--panel-muted);
}
.panel-auth [data-testid='auth-login-email'],
.panel-auth [data-testid='auth-login-password'] {
  font-size: 16px;
  min-width: 0;
}
.panel-auth [data-testid='auth-login-submit'] {
  transition:
    background-color 180ms ease,
    box-shadow 180ms ease,
    transform 180ms ease;
}
.panel-auth [data-testid='auth-login-submit']:hover:not([aria-disabled='true']) {
  box-shadow: 0 5px 0 var(--panel-dark);
  transform: translateY(-2px);
}
.panel-auth [data-testid='auth-login-submit']:active:not([aria-disabled='true']) {
  box-shadow: 0 1px 0 var(--panel-dark);
  transform: translateY(1px);
}
.panel-auth [data-testid='auth-login-submit'][aria-disabled='true'] {
  opacity: 0.7;
}
.panel-auth [data-testid='auth-login-reveal']:hover {
  background: var(--panel-canvas);
  border-radius: 10px;
}
.panel-auth input:focus {
  outline: none;
}
.panel-auth input:focus-visible {
  outline: none !important;
}
.panel-auth [data-testid='auth-login-card'] > div:has(> input:focus-visible) {
  border-color: var(--panel-dark);
  box-shadow: 0 0 0 2px var(--panel-accent);
}
.panel-auth input[aria-invalid='true'] {
  text-decoration: underline;
  text-decoration-style: dotted;
  text-underline-offset: 5px;
}
.panel-auth-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 16px;
  border-top: 1px solid var(--panel-border);
  padding-top: 20px;
  font-size: 11px;
  line-height: 1.5;
  color: var(--panel-muted);
}
.panel-auth-footer a {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  color: inherit;
  font-size: 13px;
  text-decoration: underline;
  text-underline-offset: 4px;
}
@media (prefers-reduced-motion: no-preference) {
  .panel-auth-statement {
    animation: panel-arrive 560ms cubic-bezier(0.2, 0.7, 0.2, 1) both;
  }
  .engineering-structure {
    animation: panel-arrive 700ms cubic-bezier(0.2, 0.7, 0.2, 1) both;
  }
  .engineering-trace {
    animation: panel-trace 5s linear 1;
  }
}
@keyframes panel-arrive {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes panel-trace {
  to {
    stroke-dashoffset: -100;
  }
}
@media (min-width: 1600px) {
  .panel-auth-art {
    padding-left: max(72px, calc((100vw - 1480px) / 2));
  }
  .panel-auth-main {
    padding-right: max(64px, calc((100vw - 1480px) / 2));
  }
}
@media (max-width: 1050px) {
  .panel-auth {
    grid-template-columns: minmax(330px, 0.9fr) minmax(400px, 1fr);
  }
  .panel-auth-art {
    padding: 32px;
  }
  .panel-auth h1 {
    font-size: 52px;
  }
  .panel-auth-main {
    padding-left: 16px;
    padding-right: 16px;
  }
  .panel-auth-process {
    gap: 8px;
  }
}
@media (max-width: 800px) {
  .panel-auth {
    display: block;
  }
  .panel-auth-art {
    display: none;
  }
  .panel-auth-main {
    min-height: 100dvh;
    padding: 24px 16px;
  }
  .panel-auth-mobile-brand {
    display: flex;
    padding: 0 8px 24px;
  }
  .panel-auth-mobile-brand > span,
  .panel-auth-home > span {
    font-size: 18px;
  }
  .panel-auth-product {
    margin-left: auto;
    font-size: 11px !important;
    font-weight: 500;
    letter-spacing: 0;
    color: var(--panel-muted);
  }
  .panel-auth-footer {
    margin-top: 24px;
  }
}
@media (max-width: 360px) {
  .panel-auth-product {
    display: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  .panel-auth *,
  [data-testid='web-sidebar'] * {
    animation: none !important;
    transition: none !important;
  }
}
@media (forced-colors: active) {
  .panel-auth input:focus-visible {
    outline: 2px solid Highlight !important;
  }
  .panel-auth-art {
    border-right: 1px solid CanvasText;
  }
}

[data-testid='web-sidebar'] a,
[data-testid='web-sidebar'] [role='button'] {
  transition:
    background-color 180ms ease,
    box-shadow 180ms ease;
}
[data-testid='web-sidebar'] a[aria-current='page'] {
  box-shadow: inset 3px 0 0 #ffd400;
}
[data-testid='web-sidebar'] a:active {
  background-color: #fff7cc;
}
[data-testid='workspace-structure'] .engineering-drawing {
  height: 158px;
  margin-top: -18px;
  transform: rotate(-5deg);
}
.engineering-drawing--compact .engineering-trace {
  animation: none;
}
@media (prefers-reduced-motion: reduce) {
  [data-testid='web-sidebar'] a,
  [data-testid='web-sidebar'] [role='button'] {
    transition: none;
  }
}

.panel-auth #auth-email-label,
.panel-auth #auth-password-label {
  font-size: 13px;
}

/* Web workspace: a bounded, scrollable navigation rail and canonical Modal command surface. */
[data-testid='web-sidebar'] {
  max-height: 100dvh;
  min-height: 0;
  overscroll-behavior-y: contain;
}
[data-testid='workspace-command-launcher'] {
  flex-shrink: 0;
}
[data-testid='workspace-command-dialog'] {
  animation: workspace-command-enter 160ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
[data-testid^='workspace-command-result-']:focus-visible {
  outline-offset: -3px;
  background: #fff4b8;
}
@keyframes workspace-command-enter {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@media (max-height: 760px) {
  [data-testid='workspace-structure'] {
    display: none;
  }
  [data-testid='workspace-sidebar-intro'] {
    padding-top: 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  [data-testid='workspace-command-dialog'] {
    animation: none;
  }
}

/* Orientation belongs to the shell; each screen retains its own scroll owner. */
.workspace-context {
  flex-shrink: 0;
  border-bottom: 1px solid var(--context-line);
  background: var(--context-surface);
  color: var(--context-ink);
  position: relative;
}
.workspace-context-row {
  min-height: 58px;
  padding: 8px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.workspace-context nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 13px;
  line-height: 1.5;
  min-width: 0;
}
.workspace-context nav a {
  color: var(--context-muted);
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  text-underline-offset: 4px;
}
.workspace-context nav a:hover {
  color: var(--context-ink);
}
.workspace-context [aria-current] {
  font-weight: 650;
}
.workspace-context-caption {
  color: var(--context-muted);
  font-size: 11px;
  flex-shrink: 0;
}
.workspace-connection {
  margin: 0;
  padding: 12px 28px;
  background: var(--context-warning);
  font-size: 13px;
  line-height: 1.6;
}
.workspace-skip {
  position: absolute;
  left: 16px;
  top: 4px;
  clip-path: inset(50%);
  width: 1px;
  height: 1px;
  overflow: hidden;
  background: var(--context-surface);
  color: var(--context-ink);
  min-height: 48px;
  padding: 14px 18px;
  z-index: 10;
}
.workspace-skip:focus {
  clip-path: none;
  width: auto;
  height: auto;
  overflow: visible;
}
#workspace-main:focus {
  outline: none;
}
@media (max-width: 1200px) {
  .workspace-context-caption {
    display: none;
  }
  .workspace-context-row {
    padding-inline: 20px;
  }
}
@media print {
  .workspace-context {
    display: none;
  }
}
