:root {
  --page: #f4f5f3;
  --surface: #ffffff;
  --surface-2: #eceeeb;
  --ink: #1d2528;
  --muted: #677176;
  --line: #d8ddda;
  --line-strong: #aeb8b6;
  --oxide: #a54d3e;
  --oxide-dark: #743529;
  --teal: #147b78;
  --teal-soft: #d8ece9;
  --mustard: #b18435;
  --blueprint: #426d85;
  --roof: #454b4e;
  --pending: #c58a28;
  --header-h: 58px;
  --toolbar-h: 50px;
  --status-h: 32px;
  --inspector-w: 350px;
  --mobile-tabs-h: 58px;
  --mobile-sheet: min(55svh, 430px);
  color-scheme: light;
}

* {
  box-sizing: border-box;
  letter-spacing: 0;
}

[hidden] {
  display: none !important;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
}

body {
  background: var(--page);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.45;
}

button,
select,
input {
  color: inherit;
  font: inherit;
}

button,
select,
label {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
select:focus-visible,
input:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid rgba(20, 123, 120, 0.34);
  outline-offset: 2px;
}

button {
  border: 0;
}

.topbar {
  position: relative;
  z-index: 30;
  height: var(--header-h);
  display: grid;
  grid-template-columns: minmax(250px, 1fr) auto auto auto;
  align-items: center;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  padding: 0 16px;
}

.brand-block {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 11px;
}

.brand-mark {
  width: 4px;
  height: 34px;
  flex: 0 0 auto;
  background: var(--oxide);
}

.brand-block h1,
.brand-block p {
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.brand-block h1 {
  font-size: 15px;
  font-weight: 720;
  line-height: 1.2;
}

.brand-block p {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.mode-tabs {
  display: flex;
  align-items: stretch;
}

.desktop-tabs {
  height: 100%;
  gap: 4px;
}

.mode-tab {
  position: relative;
  min-width: 76px;
  min-height: 44px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 13px;
  font-weight: 650;
}

.mode-tab::after {
  position: absolute;
  right: 12px;
  bottom: 0;
  left: 12px;
  height: 3px;
  background: transparent;
  content: "";
}

.mode-tab:hover {
  color: var(--ink);
}

.mode-tab.is-active {
  color: var(--ink);
}

.mode-tab.is-active::after {
  background: var(--oxide);
}

.top-counts {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

.top-counts strong {
  color: var(--ink);
  font-size: 13px;
}

.top-counts > span {
  width: 1px;
  height: 18px;
  margin: 0 4px;
  background: var(--line);
}

.atlas-search-trigger {
  min-height: 34px;
  justify-self: end;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface);
  padding: 0 8px 0 10px;
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
}

.atlas-search-trigger:hover {
  border-color: var(--line-strong);
  color: var(--ink);
}

.atlas-search-trigger b {
  font-size: 11px;
  font-weight: 650;
}

.atlas-search-trigger kbd,
.atlas-search-field kbd {
  min-width: 22px;
  border: 1px solid var(--line);
  border-bottom-color: var(--line-strong);
  border-radius: 3px;
  background: var(--surface-2);
  padding: 2px 5px;
  color: var(--muted);
  font-family: inherit;
  font-size: 9px;
  text-align: center;
}

.workspace {
  height: calc(100svh - var(--header-h));
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--inspector-w);
  overflow: hidden;
}

.viewport {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: var(--toolbar-h) minmax(0, 1fr) var(--status-h);
  background: #eef0ed;
}

.view-toolbar {
  position: relative;
  z-index: 12;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(250, 251, 249, 0.96);
  padding: 0 12px;
}

.atlas-mode-controls,
.atlas-control-group {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.floor-button,
.facade-family-button {
  min-width: 52px;
  border-right: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  padding: 0 10px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 720;
  white-space: nowrap;
}

.facade-family-button {
  min-width: 38px;
}

.floor-button:last-child,
.facade-family-button:last-child {
  border-right: 0;
}

.floor-button small {
  margin-left: 3px;
  color: currentColor;
  font-size: 8px;
  opacity: 0.72;
}

.floor-button:hover,
.floor-button.is-active,
.facade-family-button:hover,
.facade-family-button.is-active {
  background: var(--ink);
  color: #fff;
}

.direction-control,
.toolbar-actions {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.toolbar-label {
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
  text-transform: uppercase;
}

.segmented {
  height: 32px;
  display: flex;
  align-items: stretch;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  overflow: hidden;
  background: var(--surface);
}

.direction-button {
  min-width: 36px;
  border-right: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  font-weight: 720;
}

.direction-button:last-child {
  border-right: 0;
}

.direction-button:hover,
.direction-button.is-active {
  background: var(--ink);
  color: #fff;
}

.axon-button {
  min-width: 60px;
}

.layer-toggle {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.layer-toggle input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.layer-toggle > span {
  position: relative;
  width: 28px;
  height: 16px;
  flex: 0 0 auto;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface-2);
}

.layer-toggle > span::after {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--muted);
  content: "";
  transition: transform 160ms ease, background 160ms ease;
}

.layer-toggle input:checked + span {
  border-color: var(--teal);
  background: var(--teal-soft);
}

.layer-toggle input:checked + span::after {
  background: var(--teal);
  transform: translateX(12px);
}

.command-button {
  min-height: 34px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: var(--surface);
  padding: 0 11px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 650;
  white-space: nowrap;
}

.command-button:hover {
  border-color: var(--ink);
}

.view-stack {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.view-panel {
  position: absolute;
  inset: 0;
  min-width: 0;
  min-height: 0;
  background: #eef0ed;
}

.view-panel[hidden] {
  display: none;
}

.technical-svg {
  width: 100%;
  height: 100%;
  display: block;
  background: #f7f8f6;
  touch-action: none;
}

.technical-svg text {
  fill: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
}

.technical-svg .minor-label {
  fill: var(--muted);
  font-size: 0.9px;
}

.technical-svg .major-label {
  font-size: 1.25px;
  font-weight: 720;
}

.technical-svg .dimension-label {
  fill: var(--muted);
  font-size: 0.72px;
  font-weight: 620;
}

.view-key {
  position: absolute;
  right: 14px;
  bottom: 14px;
  display: flex;
  align-items: center;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.94);
  padding: 8px 10px;
  color: var(--muted);
  font-size: 10px;
}

.view-key span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.key-line {
  width: 22px;
  height: 0;
  border-top: 2px solid var(--ink);
}

.key-line.registry {
  border-color: var(--oxide);
  border-top-width: 3px;
}

.key-line.inferred {
  border-color: var(--mustard);
  border-top-style: dashed;
}

.elevation-caption {
  position: absolute;
  right: 14px;
  bottom: 14px;
  max-width: 380px;
  border-left: 3px solid var(--mustard);
  background: rgba(255, 255, 255, 0.94);
  padding: 8px 10px;
  color: var(--muted);
  font-size: 10px;
}

.three-panel {
  overflow: hidden;
  background: #dfe3df;
}

#threeCanvas {
  width: 100%;
  height: 100%;
  display: block;
  cursor: grab;
  outline: 0;
  touch-action: none;
}

#threeCanvas:active {
  cursor: grabbing;
}

.scene-labels {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.scene-label {
  position: absolute;
  max-width: 150px;
  border-left: 3px solid var(--label-color, var(--oxide));
  background: rgba(255, 255, 255, 0.92);
  padding: 5px 7px;
  color: var(--ink);
  font-size: 10px;
  line-height: 1.25;
  opacity: 0;
  transform: translate(-50%, -100%);
  transition: opacity 140ms ease;
}

.scene-label.is-visible {
  opacity: 1;
}

.scene-label b,
.scene-label span {
  display: block;
}

.scene-label span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 9px;
}

.model-stamp {
  position: absolute;
  top: 14px;
  left: 14px;
  border-left: 3px solid var(--oxide);
  background: rgba(255, 255, 255, 0.9);
  padding: 7px 9px;
  pointer-events: none;
}

.model-stamp b,
.model-stamp span {
  display: block;
}

.model-stamp b {
  font-size: 11px;
}

.model-stamp span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 9px;
}

.loading-state {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: #e4e7e3;
  color: var(--muted);
  font-size: 12px;
  transition: opacity 180ms ease;
}

.loading-state.is-ready {
  opacity: 0;
  pointer-events: none;
}

.segment-panel {
  overflow: auto;
  background: var(--surface);
}

.table-tools {
  position: sticky;
  top: 0;
  z-index: 6;
  min-height: 66px;
  display: grid;
  grid-template-columns: minmax(210px, 1fr) repeat(3, minmax(128px, auto));
  align-items: end;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.97);
  padding: 9px 14px 10px;
}

.table-heading h2,
.table-heading p {
  margin: 0;
}

.table-heading h2 {
  font-size: 15px;
}

.table-heading p {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
}

.table-tools label {
  display: grid;
  gap: 3px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 720;
  text-transform: uppercase;
}

.table-tools select {
  height: 32px;
  min-width: 128px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  background: var(--surface);
  padding: 0 28px 0 8px;
  font-size: 11px;
  text-transform: none;
}

.table-wrap {
  min-width: 0;
}

.segment-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 11px;
}

.segment-table th,
.segment-table td {
  border-bottom: 1px solid var(--line);
  padding: 9px 11px;
  text-align: left;
  vertical-align: middle;
}

.segment-table th {
  position: sticky;
  top: 66px;
  z-index: 5;
  background: #f0f2ef;
  color: var(--muted);
  font-size: 9px;
  font-weight: 750;
  text-transform: uppercase;
}

.segment-table th:nth-child(1) { width: 16%; }
.segment-table th:nth-child(2) { width: 27%; }
.segment-table th:nth-child(3) { width: 13%; }
.segment-table th:nth-child(4) { width: 15%; }
.segment-table th:nth-child(5) { width: 17%; }
.segment-table th:nth-child(6) { width: 12%; }

.segment-table tbody tr {
  cursor: pointer;
}

.segment-table tbody tr:hover {
  background: #f6f7f5;
}

.segment-table tbody tr.is-selected {
  background: var(--teal-soft);
  box-shadow: inset 3px 0 var(--teal);
}

.segment-code {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 720;
}

.system-swatch {
  width: 7px;
  height: 20px;
  flex: 0 0 auto;
  background: var(--swatch, var(--oxide));
}

.confidence-badge {
  display: inline-flex;
  min-height: 22px;
  align-items: center;
  border: 1px solid currentColor;
  border-radius: 3px;
  padding: 0 6px;
  color: var(--blueprint);
  font-size: 9px;
  font-weight: 760;
}

.confidence-badge.kabul,
.confidence-badge.bekliyor {
  color: #95661b;
}

.confidence-badge.saha {
  color: var(--teal);
}

.statusbar {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 18px;
  overflow: hidden;
  border-top: 1px solid var(--line);
  background: #fafbf9;
  padding: 0 12px;
  color: var(--muted);
  font-size: 9px;
  white-space: nowrap;
}

.statusbar span {
  position: relative;
}

.statusbar span + span::before {
  position: absolute;
  top: 50%;
  left: -10px;
  width: 2px;
  height: 2px;
  border-radius: 50%;
  background: var(--line-strong);
  content: "";
}

.statusbar b {
  color: var(--ink);
}

.inspector {
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  border-left: 1px solid var(--line);
  background: var(--surface);
}

.sheet-handle {
  display: none;
}

.inspector-body {
  height: 100%;
  overflow: auto;
  overscroll-behavior: contain;
  padding: 18px 16px 22px;
}

.inspector-heading {
  padding-bottom: 15px;
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--oxide);
  font-size: 9px;
  font-weight: 780;
}

.inspector-heading h2,
.inspector-heading > p:last-child {
  margin: 0;
}

.inspector-heading h2 {
  max-width: 300px;
  font-size: 20px;
  line-height: 1.15;
}

.inspector-heading > p:last-child {
  margin-top: 8px;
  color: var(--muted);
  font-size: 11px;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.metric {
  min-height: 64px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 9px;
}

.metric b,
.metric span {
  display: block;
}

.metric b {
  font-size: 16px;
  line-height: 1.2;
}

.metric span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 9px;
}

.inspector-section {
  margin-top: 21px;
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.section-title h3,
.section-title span {
  margin: 0;
}

.section-title h3 {
  font-size: 11px;
  font-weight: 760;
  text-transform: uppercase;
}

.section-title span {
  color: var(--muted);
  font-size: 9px;
}

.mass-list {
  border-top: 1px solid var(--line);
}

.mass-row {
  width: 100%;
  min-height: 54px;
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  border-bottom: 1px solid var(--line);
  background: transparent;
  padding: 6px 2px 6px 0;
  text-align: left;
  cursor: pointer;
}

.mass-row:hover,
.mass-row.is-selected {
  background: #f5f6f4;
}

.mass-row > i {
  width: 4px;
  height: 32px;
  justify-self: center;
  background: var(--mass-color);
}

.mass-row b,
.mass-row small {
  display: block;
  min-width: 0;
}

.mass-row b {
  overflow: hidden;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mass-row small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 9px;
}

.mass-row > span {
  color: var(--muted);
  font-size: 10px;
  white-space: nowrap;
}

.detail-copy {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
}

.detail-list {
  margin: 11px 0 0;
  border-top: 1px solid var(--line);
}

.detail-list > div {
  min-height: 34px;
  display: grid;
  grid-template-columns: 42% 58%;
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding: 5px 0;
}

.detail-list dt,
.detail-list dd {
  margin: 0;
  font-size: 10px;
}

.detail-list dt {
  color: var(--muted);
}

.detail-list dd {
  overflow-wrap: anywhere;
  text-align: right;
  font-weight: 650;
}

.photo-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
}

.photo-strip figure {
  min-width: 0;
  margin: 0;
}

.photo-strip img {
  width: 100%;
  aspect-ratio: 4 / 3;
  display: block;
  border: 1px solid var(--line);
  background: var(--surface-2);
  object-fit: cover;
}

.photo-strip figcaption {
  margin-top: 3px;
  overflow: hidden;
  color: var(--muted);
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.limitation-note {
  margin-top: 22px;
  border-left: 3px solid var(--pending);
  background: #fbf7ed;
  padding: 10px 11px;
}

.limitation-note b,
.limitation-note p {
  margin: 0;
}

.limitation-note b {
  font-size: 10px;
  text-transform: uppercase;
}

.limitation-note p {
  margin-top: 5px;
  color: #6f624b;
  font-size: 10px;
}

.atlas-panel {
  display: grid;
  grid-template-rows: 60px minmax(0, 1fr) 36px;
  overflow: hidden;
  background: #f7f8f6;
}

.facades-panel {
  grid-template-rows: 60px minmax(0, 1fr) 48px;
}

.atlas-panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
  padding: 8px 16px;
}

.atlas-panel-heading h2,
.atlas-panel-heading p,
.atlas-panel-heading .eyebrow {
  margin: 0;
}

.atlas-panel-heading h2 {
  margin-top: 2px;
  font-size: 16px;
  line-height: 1.1;
}

.atlas-panel-heading > p {
  max-width: 390px;
  color: var(--muted);
  font-size: 10px;
  text-align: right;
}

.eyebrow {
  color: var(--oxide);
  font-size: 9px;
  font-weight: 780;
  letter-spacing: 0.08em;
}

.atlas-summary-button {
  min-height: 34px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  background: var(--surface);
  padding: 0 11px;
  cursor: pointer;
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}

.atlas-summary-button:hover {
  border-color: var(--teal);
  color: var(--teal);
}

.atlas-svg-wrap {
  position: relative;
  min-height: 0;
  overflow: hidden;
  background-color: #f7f8f6;
  background-image:
    linear-gradient(rgba(29, 37, 40, 0.032) 1px, transparent 1px),
    linear-gradient(90deg, rgba(29, 37, 40, 0.032) 1px, transparent 1px);
  background-size: 24px 24px;
}

.atlas-svg {
  background: transparent;
}

.atlas-map-tip {
  position: absolute;
  right: 12px;
  bottom: 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
  padding: 6px 8px;
  color: var(--muted);
  font-size: 9px;
  pointer-events: none;
}

.atlas-map-tip span {
  color: var(--teal);
}

.atlas-legend,
.facade-live-summary {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 18px;
  border-top: 1px solid var(--line);
  background: var(--surface);
  padding: 0 14px;
  color: var(--muted);
  font-size: 9px;
  overflow-x: auto;
  white-space: nowrap;
}

.atlas-legend span,
.facade-live-summary span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.atlas-swatch {
  width: 16px;
  height: 8px;
  border: 1px solid var(--line-strong);
  background: #eef0ed;
}

.atlas-swatch.exterior {
  border-color: var(--oxide);
  background: rgba(165, 77, 62, 0.2);
}

.atlas-swatch.structural {
  border-style: dashed;
  border-color: var(--mustard);
  background: rgba(177, 132, 53, 0.12);
}

.atlas-swatch.material {
  width: 7px;
  height: 7px;
  border: 0;
  border-radius: 50%;
  background: var(--teal);
}

.room-hit,
.facade-hit {
  cursor: pointer;
}

.room-hit:hover .room-shape,
.room-hit:focus .room-shape,
.room-hit.is-selected .room-shape,
.room-shape:focus {
  fill: rgba(20, 123, 120, 0.28);
  stroke: var(--teal);
  stroke-width: 5;
}

.room-hit:hover .room-label,
.room-hit:focus .room-label,
.room-hit.is-selected .room-label,
.facade-hit:hover text,
.facade-hit:focus text,
.facade-hit.is-selected text {
  fill: var(--ink);
  font-weight: 780;
}

.facade-hit:hover .facade-shape,
.facade-hit:focus .facade-shape,
.facade-hit.is-selected .facade-shape,
.facade-shape:focus {
  fill: rgba(20, 123, 120, 0.34);
  stroke: var(--teal);
  stroke-width: 2.6;
}

.atlas-context {
  display: grid;
  gap: 7px;
}

.atlas-context-card {
  width: 100%;
  display: grid;
  grid-template-columns: 5px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface);
  padding: 8px;
  text-align: left;
  cursor: pointer;
}

.atlas-context-card:hover {
  border-color: var(--teal);
}

.atlas-context-card > i {
  width: 5px;
  height: 28px;
  background: var(--oxide);
}

.atlas-context-card.facade > i {
  background: var(--teal);
}

.atlas-context-card.summary > i {
  background: var(--mustard);
}

.atlas-context-card span {
  min-width: 0;
}

.atlas-context-card b,
.atlas-context-card small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.atlas-context-card b {
  font-size: 10px;
}

.atlas-context-card small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 8px;
}

.atlas-context-card > em {
  color: var(--teal);
  font-size: 13px;
  font-style: normal;
}

.atlas-context-note {
  margin: 0;
  border-left: 3px solid var(--mustard);
  background: #faf5e9;
  padding: 8px 9px;
  color: #6f624b;
  font-size: 9px;
}

.atlas-search-dialog {
  width: min(680px, calc(100vw - 28px));
  max-height: min(720px, calc(100dvh - 40px));
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--surface);
  padding: 0;
  color: var(--ink);
  box-shadow: 0 24px 80px rgba(20, 28, 31, 0.24);
}

.atlas-search-dialog::backdrop {
  background: rgba(20, 27, 30, 0.48);
  backdrop-filter: blur(2px);
}

.atlas-search-shell {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  max-height: inherit;
}

.atlas-search-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px 10px;
}

.atlas-search-heading h2,
.atlas-search-heading p {
  margin: 0;
}

.atlas-search-heading h2 {
  margin-top: 3px;
  font-size: 18px;
}

.icon-button {
  width: 36px;
  height: 36px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface);
  color: var(--ink);
  text-decoration: none;
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
}

.icon-button:hover {
  border-color: var(--ink);
}

.atlas-search-field {
  min-height: 48px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  margin: 0 18px 10px;
  border: 1px solid var(--teal);
  background: #fbfdfc;
  padding: 0 10px;
}

.atlas-search-field > span {
  color: var(--teal);
  font-size: 20px;
}

.atlas-search-field input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 14px;
}

.atlas-search-results {
  min-height: 120px;
  overflow-y: auto;
  border-top: 1px solid var(--line);
  padding: 8px 10px 14px;
}

.atlas-search-result {
  width: 100%;
  min-height: 54px;
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--line);
  background: transparent;
  padding: 7px 8px;
  text-align: left;
  cursor: pointer;
}

.atlas-search-result:hover,
.atlas-search-result.is-active {
  background: #f0f5f3;
}

.atlas-search-result > b {
  color: var(--oxide);
  font-size: 10px;
}

.atlas-search-result span b,
.atlas-search-result span small {
  display: block;
}

.atlas-search-result span b {
  font-size: 11px;
}

.atlas-search-result span small,
.atlas-search-result > small {
  color: var(--muted);
  font-size: 8px;
}

.atlas-empty-state {
  padding: 30px 14px;
  color: var(--muted);
  text-align: center;
  font-size: 11px;
}

.document-backdrop {
  position: fixed;
  z-index: 70;
  inset: 0;
  background: rgba(20, 27, 30, 0.44);
  opacity: 0;
  transition: opacity 180ms ease;
}

.document-backdrop.is-visible {
  opacity: 1;
}

.document-drawer {
  position: fixed;
  z-index: 80;
  top: var(--header-h);
  right: 0;
  bottom: 0;
  width: min(860px, calc(100vw - 180px));
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  border-left: 1px solid var(--line-strong);
  background: var(--surface);
  box-shadow: -18px 0 54px rgba(20, 28, 31, 0.18);
  transform: translateX(102%);
  visibility: hidden;
  transition: transform 200ms ease, visibility 0s linear 200ms;
}

.document-drawer.is-open {
  transform: translateX(0);
  visibility: visible;
  transition-delay: 0s;
}

.document-drawer-header {
  min-height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  padding: 10px 14px 10px 18px;
}

.document-drawer-header h2,
.document-drawer-header p {
  margin: 0;
}

.document-drawer-header h2 {
  margin-top: 2px;
  font-size: 17px;
}

.document-drawer-header #documentDrawerMeta {
  margin-top: 3px;
  color: var(--muted);
  font-size: 9px;
}

.document-drawer-actions {
  display: flex;
  gap: 7px;
}

.document-alert {
  border-bottom: 1px solid #ddcda7;
  background: #faf5e9;
  padding: 8px 18px;
  color: #6f624b;
  font-size: 9px;
}

.document-frame-state {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: -1;
  color: var(--muted);
  font-size: 11px;
  transform: translate(-50%, -50%);
}

.document-frame-state.is-error {
  z-index: 1;
  color: var(--oxide-dark);
}

.document-drawer iframe {
  width: 100%;
  height: 100%;
  border: 0;
  background: #fff;
}

.atlas-toast {
  position: fixed;
  z-index: 120;
  right: 18px;
  bottom: 18px;
  max-width: 360px;
  border-left: 4px solid var(--teal);
  background: var(--ink);
  padding: 10px 12px;
  color: #fff;
  box-shadow: 0 10px 32px rgba(20, 28, 31, 0.25);
  font-size: 10px;
}

.mobile-tabs {
  display: none;
}

@media (max-width: 1050px) {
  :root {
    --inspector-w: 310px;
  }

  .topbar {
    grid-template-columns: minmax(210px, 1fr) auto auto;
  }

  .top-counts {
    display: none;
  }

  .atlas-search-trigger b,
  .atlas-search-trigger kbd {
    display: none;
  }

  .atlas-search-trigger {
    width: 36px;
    justify-content: center;
    padding: 0;
  }

  .layer-toggle {
    font-size: 0;
  }

  .table-tools {
    grid-template-columns: minmax(170px, 1fr) repeat(3, 112px);
  }
}

@media (max-width: 780px) {
  :root {
    --header-h: 52px;
    --toolbar-h: 48px;
    --status-h: 30px;
  }

  html,
  body {
    overflow: hidden;
  }

  .topbar {
    grid-template-columns: minmax(0, 1fr) auto;
    padding: 0 12px;
  }

  .brand-block {
    gap: 9px;
  }

  .brand-mark {
    height: 30px;
  }

  .brand-block h1 {
    font-size: 14px;
  }

  .brand-block p {
    font-size: 10px;
  }

  .desktop-tabs,
  .top-counts {
    display: none;
  }

  .atlas-search-trigger {
    width: 38px;
    min-height: 38px;
  }

  .workspace {
    height: calc(100svh - var(--header-h) - var(--mobile-tabs-h));
    display: block;
  }

  .viewport {
    width: 100%;
    height: 100%;
    transition: padding-bottom 180ms ease;
  }

  body.sheet-open .viewport {
    padding-bottom: var(--mobile-sheet);
  }

  .view-toolbar {
    gap: 8px;
    justify-content: flex-start;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
  }

  .view-toolbar::-webkit-scrollbar {
    display: none;
  }

  .toolbar-label {
    display: none;
  }

  .direction-control,
  .toolbar-actions,
  .atlas-mode-controls,
  .atlas-control-group {
    flex: 0 0 auto;
    gap: 5px;
  }

  .floor-button {
    min-width: 58px;
    padding: 0 7px;
  }

  .facade-family-button {
    min-width: 37px;
    padding: 0 7px;
  }

  .segmented {
    height: 34px;
  }

  .direction-button {
    min-width: 32px;
  }

  .axon-button {
    min-width: 48px;
  }

  .layer-toggle {
    min-width: 42px;
    justify-content: center;
  }

  #openingsToggleLabel::after,
  #uncertaintyToggleLabel::after,
  #rooflessToggleLabel::after {
    font-size: 9px;
    font-weight: 700;
  }

  #openingsToggleLabel::after {
    content: "Aç.";
  }

  #uncertaintyToggleLabel::after {
    content: "Bel.";
  }

  #rooflessToggleLabel::after {
    content: "Çatı";
  }

  .command-button {
    min-height: 36px;
  }

  #resetButton {
    display: none;
  }

  .view-key {
    right: 8px;
    bottom: 8px;
    max-width: calc(100% - 16px);
    gap: 9px;
    overflow-x: auto;
  }

  .elevation-caption {
    right: 8px;
    bottom: 8px;
    left: 8px;
    max-width: none;
  }

  .model-stamp {
    top: 8px;
    left: 8px;
  }

  .atlas-panel {
    grid-template-rows: 52px minmax(0, 1fr) 32px;
  }

  .facades-panel {
    grid-template-rows: 52px minmax(0, 1fr) 44px;
  }

  .atlas-panel-heading {
    gap: 10px;
    padding: 6px 10px;
  }

  .atlas-panel-heading h2 {
    font-size: 13px;
  }

  .atlas-panel-heading > p {
    display: none;
  }

  .atlas-summary-button {
    min-height: 32px;
    padding: 0 8px;
    font-size: 9px;
  }

  .atlas-map-tip {
    right: 7px;
    bottom: 7px;
  }

  .atlas-legend,
  .facade-live-summary {
    gap: 12px;
    padding: 0 9px;
  }

  .statusbar {
    gap: 16px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .statusbar::-webkit-scrollbar {
    display: none;
  }

  .inspector {
    position: fixed;
    z-index: 25;
    right: 0;
    bottom: var(--mobile-tabs-h);
    left: 0;
    height: 44px;
    border-top: 1px solid var(--line-strong);
    border-left: 0;
    background: var(--surface);
    box-shadow: 0 -8px 24px rgba(34, 42, 44, 0.09);
    transition: height 180ms ease;
  }

  .inspector.is-open {
    height: var(--mobile-sheet);
  }

  .sheet-handle {
    width: 100%;
    height: 44px;
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr);
    align-items: center;
    gap: 6px;
    border-bottom: 1px solid var(--line);
    background: var(--surface);
    padding: 0 12px;
    text-align: left;
    cursor: pointer;
  }

  .sheet-handle > span {
    width: 28px;
    height: 3px;
    border-radius: 2px;
    background: var(--line-strong);
  }

  .sheet-handle b {
    overflow: hidden;
    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .inspector-body {
    height: calc(100% - 44px);
    padding: 15px 14px 24px;
  }

  .inspector-heading h2 {
    font-size: 18px;
  }

  .mobile-tabs {
    position: fixed;
    z-index: 40;
    right: 0;
    bottom: 0;
    left: 0;
    height: var(--mobile-tabs-h);
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    border-top: 1px solid var(--line-strong);
    background: rgba(255, 255, 255, 0.98);
    padding-bottom: env(safe-area-inset-bottom);
  }

  .mobile-tabs .mode-tab {
    min-width: 0;
    min-height: 48px;
    font-size: 10px;
  }

  .mobile-tabs .mode-tab::after {
    top: 0;
    right: 18px;
    bottom: auto;
    left: 18px;
  }

  .table-tools {
    min-height: 104px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 7px;
    padding: 8px 9px;
  }

  .table-heading {
    grid-column: 1 / -1;
    display: flex;
    align-items: baseline;
    justify-content: space-between;
  }

  .table-heading h2 {
    font-size: 13px;
  }

  .table-tools select {
    width: 100%;
    min-width: 0;
    padding-right: 18px;
    font-size: 10px;
  }

  .segment-table,
  .segment-table tbody,
  .segment-table tr,
  .segment-table td {
    display: block;
    width: 100%;
  }

  .segment-table {
    table-layout: auto;
  }

  .segment-table thead {
    display: none;
  }

  .segment-table tbody tr {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 4px 10px;
    border-bottom: 1px solid var(--line);
    padding: 10px 12px;
  }

  .segment-table td {
    border: 0;
    padding: 0;
  }

  .segment-table td::before {
    margin-right: 5px;
    color: var(--muted);
    content: attr(data-label);
    font-size: 8px;
    text-transform: uppercase;
  }

  .segment-table td:nth-child(1) {
    grid-column: 1;
    grid-row: 1;
  }

  .segment-table td:nth-child(1)::before,
  .segment-table td:nth-child(2)::before {
    display: none;
  }

  .segment-table td:nth-child(2) {
    grid-column: 1 / -1;
    grid-row: 2;
    overflow: hidden;
    color: var(--muted);
    font-size: 9px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .segment-table td:nth-child(3),
  .segment-table td:nth-child(4),
  .segment-table td:nth-child(5) {
    grid-column: 1;
    font-size: 10px;
  }

  .segment-table td:nth-child(6) {
    position: absolute;
    top: 10px;
    right: 12px;
    width: auto;
  }

  .segment-table td:nth-child(6)::before {
    display: none;
  }

  .document-drawer {
    z-index: 100;
    top: 0;
    bottom: 0;
    width: 100vw;
    border-left: 0;
  }

  .document-drawer-header {
    min-height: 64px;
    padding: 8px 9px 8px 12px;
  }

  .document-drawer-header h2 {
    max-width: calc(100vw - 118px);
    overflow: hidden;
    font-size: 14px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .document-alert {
    padding: 7px 12px;
  }

  .atlas-search-dialog {
    width: calc(100vw - 16px);
    max-height: calc(100dvh - 16px);
  }

  .atlas-search-heading {
    padding: 12px 12px 8px;
  }

  .atlas-search-field {
    margin: 0 12px 8px;
  }

  .atlas-search-result {
    grid-template-columns: 42px minmax(0, 1fr) auto;
  }

  .atlas-toast {
    right: 9px;
    bottom: calc(var(--mobile-tabs-h) + 9px);
    left: 9px;
    max-width: none;
  }
}

@media (max-width: 390px) {
  .brand-block p span {
    display: none;
  }

  .axon-button {
    min-width: 46px;
  }

  .photo-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .floor-button {
    min-width: 54px;
  }

  .facade-family-button {
    min-width: 34px;
  }

  .atlas-summary-button {
    max-width: 104px;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
