:root {
  color-scheme: light;
  font-family: Inter, "Segoe UI", system-ui, sans-serif;
  color: #17212b;
  background: #f4f6f8;
}

* {
  box-sizing: border-box;
}

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

body {
  display: grid;
  grid-template-rows: 52px 1fr;
  overflow: hidden;
}

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 18px;
  color: #fff;
  background: #17212b;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

#help-button {
  width: auto;
  padding: 6px 10px;
  border-color: #718497;
  color: #fff;
  background: #263849;
  font-size: 12px;
}

.header-button {
  width: auto;
  padding: 6px 10px;
  border-color: #718497;
  color: #fff;
  background: #263849;
  font-size: 12px;
}

.header-button:hover {
  background: #0e579a;
}

#help-button:hover,
#help-button[aria-expanded="true"] {
  background: #0e579a;
}

h1 {
  margin: 0;
  font-size: 17px;
  font-weight: 650;
}

#app-status {
  overflow: hidden;
  max-width: 60vw;
  color: #cbd5df;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

main {
  position: relative;
  display: grid;
  min-height: 0;
  grid-template-columns: 290px 1fr;
}

body.shared-view main {
  grid-template-columns: 1fr;
}

body.shared-view #admin-panel,
body.shared-view #share-button,
body.shared-view #logout-button {
  display: none;
}

#client-share-button {
  border-color: #5c9ed8;
  background: #0e579a;
}

#client-share-button:hover {
  background: #126bb8;
}

#admin-panel-button,
#admin-panel-backdrop {
  display: none;
}

aside {
  z-index: 2;
  display: flex;
  min-height: 0;
  flex-direction: column;
  gap: 9px;
  padding: 16px;
  border-right: 1px solid #d9e0e6;
  background: #fff;
}

#admin-panel[hidden] {
  display: none;
}

form {
  display: grid;
  gap: 8px;
  margin-bottom: 10px;
  padding-bottom: 16px;
  border-bottom: 1px solid #e5e9ed;
}

label {
  font-size: 12px;
  font-weight: 650;
}

input,
select,
button {
  width: 100%;
  border: 1px solid #bec9d3;
  border-radius: 4px;
  font: inherit;
}

input,
select {
  padding: 8px;
  background: #fff;
}

input[type="file"] {
  padding: 6px;
  font-size: 12px;
}

.iam-summary {
  min-height: 38px;
  padding: 8px 10px;
  overflow: hidden;
  border: 1px solid #bec9d3;
  border-radius: 4px;
  color: #607080;
  background: #fff;
  font-size: 13px;
}

.iam-summary strong,
.iam-summary span {
  display: block;
}

.iam-summary strong {
  overflow-wrap: anywhere;
  color: #17212b;
}

.iam-summary span {
  margin-top: 2px;
  overflow: hidden;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.iam-picker {
  display: grid;
  gap: 7px;
  padding: 9px;
  border: 1px solid #91b9dc;
  border-radius: 5px;
  background: #f3f8fc;
}

.iam-picker[hidden] {
  display: none;
}

.iam-picker p {
  margin: 0;
  font-size: 12px;
  line-height: 1.35;
}

.iam-options {
  display: grid;
  max-height: 300px;
  gap: 5px;
  overflow: auto;
}

button.iam-option {
  display: block;
  padding: 8px 9px;
  border-color: #ccd6df;
  color: #17212b;
  background: #fff;
  text-align: left;
}

button.iam-option:hover,
button.iam-option:focus-visible {
  border-color: #1668b5;
  outline: 2px solid #acd3f4;
  background: #eaf4fc;
}

button.iam-option.selected {
  border-color: #1668b5;
  background: #dceefd;
}

.iam-option strong,
.iam-option span {
  display: block;
}

.iam-option strong {
  overflow-wrap: anywhere;
  font-size: 13px;
}

.iam-option span {
  margin-top: 3px;
  overflow: hidden;
  color: #607080;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

button {
  padding: 9px 12px;
  border-color: #1668b5;
  color: #fff;
  background: #1668b5;
  cursor: pointer;
}

button:hover {
  background: #0e579a;
}

button:disabled,
input:disabled,
select:disabled {
  cursor: wait;
  opacity: 0.6;
}

#models {
  min-height: 150px;
  flex: 1;
}

#models option {
  padding: 7px 5px;
}

.hint {
  margin: 4px 0 0;
  color: #607080;
  font-size: 12px;
  line-height: 1.4;
}

.share-result {
  margin: 0;
  padding: 9px;
  border: 1px solid #8fc5a5;
  border-radius: 4px;
  color: #155b32;
  background: #edf9f1;
  font-size: 12px;
  line-height: 1.35;
}

.share-result[hidden] {
  display: none;
}

.login-screen {
  position: fixed;
  inset: 52px 0 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 20px;
  background: #eef2f5;
}

.login-screen[hidden] {
  display: none;
}

form.login-card {
  width: min(390px, 100%);
  gap: 12px;
  margin: 0;
  padding: 26px;
  border: 1px solid #ccd6df;
  border-radius: 9px;
  background: #fff;
  box-shadow: 0 12px 32px rgba(23, 33, 43, 0.16);
}

.login-card h2,
.login-card p {
  margin: 0;
}

.login-card h2 {
  font-size: 20px;
}

.login-card > p {
  color: #607080;
  font-size: 13px;
  line-height: 1.45;
}

.login-card .login-error {
  color: #a3261a;
  font-weight: 650;
}

#viewer-shell,
#viewer {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 0;
}

#overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: grid;
  place-items: center;
  padding: 24px;
  color: #425466;
  background: #eef2f5;
  text-align: center;
}

#overlay[hidden] {
  display: none;
}

.visibility-warning {
  position: absolute;
  bottom: 78px;
  left: 50%;
  z-index: 7;
  width: max-content;
  max-width: min(620px, calc(100% - 32px));
  padding: 10px 16px;
  transform: translateX(-50%);
  border: 2px solid #d58a00;
  border-radius: 7px;
  color: #312000;
  background: #ffd86b;
  box-shadow: 0 4px 16px rgba(23, 33, 43, 0.28);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
  text-align: center;
  pointer-events: none;
}

.visibility-warning[hidden] {
  display: none;
}

.component-name-panel {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 9;
  display: flex;
  width: min(360px, calc(100% - 24px));
  min-height: 52px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 10px 10px 16px;
  border: 1px solid #c8d2dc;
  border-radius: 7px;
  color: #17212b;
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 5px 18px rgba(23, 33, 43, 0.24);
}

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

.component-name-panel h2 {
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 17px;
  font-weight: 500;
  line-height: 1.3;
}

#component-name-close {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  padding: 0;
  border: 0;
  color: #526474;
  background: transparent;
  font-size: 24px;
  font-weight: 300;
  line-height: 32px;
}

#component-name-close:hover {
  color: #17212b;
  background: #edf2f6;
}

.mobile-model-search[hidden] {
  display: none;
}

.model-structure-panel.app-model-search-active .adsk-searchbox {
  display: none !important;
}

.model-structure-panel.app-model-search-active > #ViewerModelStructurePanel-scroll-container {
  top: 88px !important;
}

.mobile-model-search:not([hidden]) {
  position: absolute;
  top: 47px;
  right: 0;
  left: 0;
  z-index: 15;
  display: block;
  max-height: calc(100% - 47px);
  overflow: hidden;
  background: #fff;
  box-shadow: 0 2px 6px rgba(23, 33, 43, 0.16);
}

.mobile-model-search-bar {
  display: flex;
  height: 42px;
  align-items: center;
  border-top: 1px solid #aebbc6;
  border-bottom: 1px solid #aebbc6;
}

#mobile-model-search-input {
  min-width: 0;
  height: 100%;
  flex: 1;
  padding: 7px 12px;
  border: 0;
  border-radius: 0;
  outline: 0;
  font-size: 14px;
}

#mobile-model-search-input::-webkit-search-cancel-button {
  display: none;
  appearance: none;
}

#mobile-model-search-clear {
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  padding: 0;
  border: 0;
  border-radius: 0;
  color: #526474;
  background: #fff;
  font-size: 22px;
  line-height: 38px;
}

#mobile-model-search-done {
  display: none;
  width: auto;
  height: 40px;
  flex: 0 0 auto;
  padding: 0 12px;
  border: 0;
  border-left: 1px solid #d5dde4;
  border-radius: 0;
  background: #1668b5;
  font-size: 13px;
}

.mobile-model-search-status {
  margin: 0;
  padding: 7px 12px;
  border-bottom: 1px solid #dce3e9;
  color: #607080;
  background: #f5f8fa;
  font-size: 12px;
}

.mobile-model-search-results {
  max-height: calc(100% - 72px);
  overflow: auto;
  overscroll-behavior: contain;
  background: #fff;
}

.mobile-model-search-result {
  display: block;
  width: 100%;
  padding: 9px 12px;
  border: 0;
  border-bottom: 1px solid #e3e8ed;
  border-radius: 0;
  color: #17212b;
  background: #fff;
  text-align: left;
}

.mobile-model-search-result:hover,
.mobile-model-search-result:focus-visible {
  background: #eaf5fb;
}

.mobile-model-search-result strong,
.mobile-model-search-result span {
  display: block;
}

.mobile-model-search-result strong {
  color: #08a7d8;
  font-size: 14px;
  font-weight: 600;
}

.mobile-model-search-result span {
  margin-top: 2px;
  overflow: hidden;
  color: #7c8b98;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.model-search-focused .mobile-model-search:not([hidden]) {
  position: fixed;
  top: var(--visible-top, 0);
  right: 0;
  left: 0;
  z-index: 1000;
  max-height: var(--visible-height, 100vh);
  border-bottom: 1px solid #aebbc6;
  box-shadow: 0 5px 18px rgba(23, 33, 43, 0.35);
}

body.model-search-focused #mobile-model-search-done {
  display: block;
}

body.model-search-focused .mobile-model-search-results {
  max-height: calc(var(--visible-height, 100vh) - 76px);
}

#toolbar-showAllTool.viewer-needs-attention {
  position: relative;
  color: #17212b !important;
  background: #ffd04f !important;
  animation: show-all-attention 1.25s ease-in-out infinite;
}

#toolbar-showAllTool.viewer-needs-attention .adsk-button-icon {
  color: #17212b !important;
}

#toolbar-showAllTool.viewer-needs-attention::after {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 8px;
  height: 8px;
  border: 1px solid #fff;
  border-radius: 50%;
  background: #d92d20;
  content: "";
}

@keyframes show-all-attention {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(255, 174, 0, 0.2);
  }

  50% {
    box-shadow: 0 0 0 6px rgba(255, 174, 0, 0.58);
  }
}

@media (prefers-reduced-motion: reduce) {
  #toolbar-showAllTool.viewer-needs-attention {
    animation: none;
  }
}

.viewer-guide {
  position: absolute;
  inset: 0;
  z-index: 8;
  pointer-events: none;
}

.viewer-guide[hidden] {
  display: none;
}

.guide-panel {
  position: absolute;
  top: 18px;
  left: 18px;
  width: min(390px, calc(100% - 36px));
  max-height: calc(100% - 110px);
  padding: 16px;
  overflow: auto;
  border: 1px solid #c8d2dc;
  border-radius: 8px;
  color: #17212b;
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 8px 28px rgba(23, 33, 43, 0.22);
  pointer-events: auto;
}

.guide-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.guide-heading h2 {
  margin: 0;
  font-size: 17px;
}

.guide-heading p {
  margin: 5px 0 0;
  color: #607080;
  font-size: 12px;
}

#guide-close {
  width: auto;
  padding: 6px 9px;
  font-size: 11px;
}

.guide-list {
  display: grid;
  gap: 8px;
  margin: 14px 0;
  padding-left: 0;
  list-style: none;
}

.guide-list li {
  padding: 8px 10px;
  border-radius: 5px;
  background: #f1f6fa;
}

.guide-list strong,
.guide-list span {
  display: block;
}

.guide-list strong {
  font-size: 12px;
}

.guide-list span {
  margin-top: 2px;
  color: #526474;
  font-size: 11px;
  line-height: 1.35;
}

.guide-tip {
  margin: 0;
  padding-top: 10px;
  border-top: 1px solid #dce3e9;
  color: #425466;
  font-size: 11px;
  line-height: 1.45;
}

.guide-tip + .guide-tip {
  margin-top: 10px;
}

.guide-marker {
  position: absolute;
  width: 26px;
  height: 26px;
  transform: translate(-50%, -100%);
  border: 2px solid #fff;
  border-radius: 50%;
  color: #fff;
  background: #e24b35;
  box-shadow: 0 2px 7px rgba(23, 33, 43, 0.35);
  font-size: 12px;
  font-weight: 700;
  line-height: 22px;
  text-align: center;
}

/* Hide the marked navigation controls. Section and Document Browser are not
   loaded at all, so their toolbar buttons are omitted as well. */
#toolbar-zoomTool,
#toolbar-beelineTool,
#toolbar-bimWalkTool,
#toolbar-cameraSubmenuTool,
#toolbar-sectionTool,
#toolbar-propertiesTool,
#ViewerPropertyPanel {
  display: none !important;
}

@media (max-width: 760px) {
  body {
    grid-template-rows: 48px minmax(0, 1fr);
    overflow: hidden;
  }

  header {
    min-width: 0;
    gap: 6px;
    padding: 0 8px;
  }

  h1 {
    min-width: 0;
    flex: 1;
    overflow: hidden;
    font-size: 14px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .header-actions {
    flex: 0 0 auto;
    gap: 5px;
  }

  .header-button,
  #help-button {
    min-height: 34px;
    padding: 6px 8px;
    font-size: 11px;
  }

  #admin-panel-button:not([hidden]) {
    display: block;
  }

  main {
    display: block;
    min-height: 0;
  }

  #viewer-shell {
    position: absolute;
    inset: 0;
  }

  #admin-panel {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 13;
    width: min(360px, calc(100vw - 34px));
    padding: 14px;
    overflow: auto;
    overscroll-behavior: contain;
    transform: translateX(-105%);
    border-right: 1px solid #d9e0e6;
    transition: transform 180ms ease;
  }

  body.admin-panel-open #admin-panel {
    transform: translateX(0);
    box-shadow: 10px 0 30px rgba(23, 33, 43, 0.3);
  }

  #admin-panel-backdrop:not([hidden]) {
    position: absolute;
    inset: 0;
    z-index: 12;
    display: block;
    width: 100%;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: rgba(23, 33, 43, 0.42);
  }

  #models {
    min-height: 120px;
    flex: 0 0 150px;
  }

  .login-screen {
    inset: 48px 0 0;
    padding: 14px;
  }

  form.login-card {
    padding: 20px;
  }

  .guide-panel {
    top: 8px;
    left: 8px;
    width: calc(100% - 16px);
    max-height: min(54%, 440px);
    padding: 13px;
  }

  .visibility-warning {
    bottom: 66px;
    max-width: calc(100% - 16px);
    padding: 8px 10px;
    font-size: 11px;
  }

  .component-name-panel {
    top: auto;
    right: 8px;
    bottom: 70px;
    left: 8px;
    width: auto;
  }

  .model-structure-panel {
    top: 8px !important;
    right: 8px !important;
    bottom: 62px !important;
    left: 8px !important;
    width: auto !important;
    height: auto !important;
    max-width: none !important;
  }

  .adsk-viewing-viewer .adsk-toolbar {
    max-width: calc(100% - 12px);
  }

  .adsk-viewing-viewer .adsk-control-group {
    margin-right: 3px;
    margin-left: 3px;
  }
}

@media (max-width: 1050px) {
  #app-status {
    display: none;
  }
}
