:root {
  color-scheme: dark;
  --paper: #014b92;
  --paper-strong: #0b5aa0;
  --ink: #ffffff;
  --muted: #ffffff;
  --line: rgba(255, 255, 255, 0.72);
  --accent: #ffe083;
  --danger: #ff8f8f;
  --shadow: rgba(0, 0, 0, 0.32);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  font-family: "Segoe UI", Arial, sans-serif;
  background: #071015;
  color: #ffffff;
}

button,
input,
select {
  font: inherit;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(310px, 430px) minmax(0, 1fr);
  gap: 0;
}

.side-panel {
  display: flex;
  flex-direction: column;
  height: 100vh;
  min-height: 0;
  border-right: 1px solid rgba(255, 255, 255, 0.72);
  background: linear-gradient(180deg, #0b5aa0 0%, #014b92 52%, #003f7f 100%);
  overflow: hidden;
}

.brand {
  padding: 22px 22px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.5);
}

.brand h1 {
  margin: 0;
  font-size: 24px;
  letter-spacing: 0;
}

.brand p {
  margin: 8px 0 0;
  color: #ffffff;
  font-size: 13px;
  line-height: 1.4;
}

.filters {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 150px;
  gap: 10px;
  padding: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.5);
}

.filters input,
.filters select {
  min-width: 0;
  height: 36px;
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 0;
  background: rgba(0, 33, 70, 0.28);
  color: #ffffff;
  padding: 0 10px;
}

.prop-list {
  min-height: 0;
  overflow: auto;
  padding: 10px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(156px, 1fr));
  grid-auto-rows: 184px;
  align-items: stretch;
  gap: 10px;
  scrollbar-color: rgba(255, 255, 255, 0.86) rgba(1, 75, 146, 0.5);
  scrollbar-width: thin;
}

.prop-list::-webkit-scrollbar {
  width: 12px;
}

.prop-list::-webkit-scrollbar-track {
  background: rgba(1, 75, 146, 0.5);
  border-left: 1px solid rgba(255, 255, 255, 0.35);
}

.prop-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.86);
  border: 3px solid rgba(1, 75, 146, 0.5);
}

.prop-list::-webkit-scrollbar-thumb:hover {
  background: #ffffff;
}

.prop-card {
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.68);
  border-radius: 0;
  height: 100%;
  min-height: 0;
  background: rgba(0, 33, 70, 0.2);
  color: #ffffff;
  padding: 0;
  display: block;
  cursor: pointer;
  text-align: left;
  box-shadow: 0 8px 18px var(--shadow);
  overflow: hidden;
  contain: paint;
}

.prop-card:hover,
.prop-card:focus-visible {
  border-color: var(--accent);
  outline: none;
}

.thumb {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: linear-gradient(180deg, #0b5aa0 0%, #014b92 52%, #003f7f 100%);
  overflow: hidden;
}

.thumb-canvas {
  position: absolute;
  left: 8px;
  top: 8px;
  width: calc(100% - 16px);
  height: calc(100% - 76px);
  display: block;
}

.thumb-missing {
  color: #ffffff;
  font-size: 12px;
}

.prop-card-label {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  min-height: 58px;
  padding: 20px 8px 7px;
  background: linear-gradient(transparent, rgba(0, 33, 70, 0.24) 36%, rgba(0, 33, 70, 0.46));
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.9);
}

.prop-name {
  font-weight: 700;
  font-size: 13px;
  line-height: 1.2;
  min-height: 0;
  overflow-wrap: anywhere;
}

.prop-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: #ffffff;
  font-size: 12px;
  margin-top: 4px;
}

.prop-card.is-invalid {
  border-color: rgba(255, 143, 143, 0.38);
}

.blueprint-panel {
  position: relative;
  position: sticky;
  top: 0;
  height: 100vh;
  min-height: 0;
  overflow: hidden;
  background: linear-gradient(180deg, #0b5aa0 0%, #014b92 52%, #003f7f 100%);
}

.camera-stage {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.scene-canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%) translateY(22px);
  opacity: 0;
  pointer-events: none;
  background: #0e2029;
  color: #ffffff;
  border: 1px solid rgba(255, 224, 131, 0.66);
  border-radius: 0;
  padding: 10px 14px;
  box-shadow: 0 10px 24px var(--shadow);
  transition: opacity 160ms ease, transform 160ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@media (max-width: 860px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .side-panel {
    height: 46vh;
    min-height: 0;
    max-height: 56vh;
    border-right: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.72);
  }

  .blueprint-panel {
    min-height: 54vh;
  }

  .camera-stage {
    inset: 0;
  }
}
