.becke-shell {
  width: 100%;
  color: #122029;
}

.becke-scope {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.75fr);
  gap: 16px;
  padding: 16px;
  border: 1px solid rgba(17, 24, 39, 0.12);
  border-radius: 8px;
  background: linear-gradient(135deg, #effaf6, #dbeee9 58%, #f5eddc);
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.1);
}

.becke-viewer {
  position: relative;
  min-height: 380px;
  overflow: hidden;
  border-radius: 8px;
  background: #13202a;
  box-shadow: inset 0 0 0 12px rgba(18, 32, 41, 0.82);
}

.becke-viewer canvas {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 380px;
}

.becke-reticle {
  position: absolute;
  inset: 12%;
  pointer-events: none;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 50%;
}

.becke-reticle::before,
.becke-reticle::after {
  position: absolute;
  content: "";
  background: rgba(255, 255, 255, 0.24);
}

.becke-reticle::before {
  top: 50%;
  left: 8%;
  width: 84%;
  height: 1px;
}

.becke-reticle::after {
  top: 8%;
  left: 50%;
  width: 1px;
  height: 84%;
}

.becke-badge {
  position: absolute;
  right: 18px;
  bottom: 18px;
  display: grid;
  gap: 2px;
  min-width: 112px;
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(18, 32, 41, 0.82);
  color: #f8fafc;
}

.becke-material-chip {
  position: absolute;
  top: 18px;
  left: 18px;
  max-width: min(68%, 360px);
  padding: 8px 11px;
  border-radius: 8px;
  background: rgba(18, 32, 41, 0.76);
  color: #f8fafc;
  font-size: 0.86rem;
  font-weight: 800;
  line-height: 1.15;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.becke-badge span,
.becke-readouts span {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0;
}

.becke-badge strong {
  font-size: 1.7rem;
  line-height: 1;
}

.becke-controls {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.becke-unit-toggle,
.becke-focus {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 5px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
}

.becke-unit-toggle button,
.becke-focus button {
  min-height: 42px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #334155;
  cursor: pointer;
  font-size: 0.96rem;
  font-weight: 750;
  line-height: 1.1;
}

.becke-unit-toggle button[data-active="true"],
.becke-focus button[data-active="true"] {
  background: #122029;
  color: #f8fafc;
}

.becke-field,
.becke-slider {
  display: grid;
  gap: 8px;
  padding: 14px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
}

.becke-field span,
.becke-slider span {
  color: #263746;
  font-size: 0.9rem;
  font-weight: 800;
}

.becke-choice {
  position: relative;
}

.becke-choice-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 44px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 6px;
  padding: 0 12px 0 14px;
  color: #122029;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(246, 250, 248, 0.94));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85);
  text-align: left;
  cursor: pointer;
  font-size: 0.96rem;
  font-weight: 750;
  line-height: 1.2;
}

.becke-choice-trigger:focus-visible,
.becke-choice-menu button:focus-visible {
  outline: 3px solid rgba(232, 93, 4, 0.34);
  outline-offset: 2px;
}

.becke-choice-icon {
  flex: 0 0 auto;
  width: 10px;
  height: 10px;
  margin-left: 10px;
  border-right: 2px solid currentcolor;
  border-bottom: 2px solid currentcolor;
  transform: translateY(-2px) rotate(45deg);
}

.becke-choice-menu {
  position: absolute;
  z-index: 5;
  top: calc(100% - 8px);
  right: 14px;
  left: 14px;
  display: grid;
  gap: 5px;
  padding: 7px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 18px 34px rgba(15, 23, 42, 0.18);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-4px);
  transition: opacity 140ms ease, transform 140ms ease;
}

.becke-choice-menu.is-open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.becke-choice-menu button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 40px;
  border: 0;
  border-radius: 6px;
  padding: 0 10px;
  color: #263746;
  background: transparent;
  text-align: left;
  cursor: pointer;
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.15;
}

.becke-choice-menu button:hover,
.becke-choice-menu button[aria-selected="true"] {
  background: #122029;
  color: #f8fafc;
}

.becke-choice-menu button[aria-selected="true"]::after {
  content: "";
  width: 7px;
  height: 12px;
  margin-left: 10px;
  border-right: 2px solid currentcolor;
  border-bottom: 2px solid currentcolor;
  transform: rotate(45deg);
}

.becke-slider strong {
  color: #122029;
  font-size: 1.7rem;
  line-height: 1;
}

.becke-slider input {
  width: 100%;
  accent-color: #e85d04;
}

.becke-readouts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
}

.becke-readouts div {
  display: grid;
  gap: 5px;
  min-width: 0;
  padding: 11px;
  border-radius: 8px;
  background: rgba(18, 32, 41, 0.92);
  color: #f8fafc;
}

.becke-readouts strong {
  font-size: 1.06rem;
  overflow-wrap: anywhere;
}

.becke-interpretation,
.becke-disclaimer {
  margin: 0;
  line-height: 1.55;
}

.becke-interpretation {
  padding: 14px;
  border-left: 4px solid #e85d04;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  color: #122029;
  font-weight: 650;
}

.becke-disclaimer {
  grid-column: 1 / -1;
  padding: 12px 14px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.58);
  color: #475569;
  font-size: 0.9rem;
}

.theme-dark .becke-shell {
  color: #e5edf2;
}

.theme-dark .becke-scope {
  border-color: rgba(255, 255, 255, 0.12);
  background: linear-gradient(135deg, #111b22, #1b2a31 55%, #302817);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.36);
}

.theme-dark .becke-unit-toggle,
.theme-dark .becke-focus,
.theme-dark .becke-field,
.theme-dark .becke-slider,
.theme-dark .becke-interpretation {
  background: rgba(15, 23, 32, 0.76);
}

.theme-dark .becke-unit-toggle button,
.theme-dark .becke-focus button {
  color: #dbe7ee;
}

.theme-dark .becke-unit-toggle button[data-active="true"],
.theme-dark .becke-focus button[data-active="true"] {
  background: #f8fafc;
  color: #122029;
}

.theme-dark .becke-choice-trigger {
  border-color: rgba(255, 255, 255, 0.16);
  color: #f8fafc;
  background: linear-gradient(180deg, rgba(22, 34, 43, 0.98), rgba(13, 23, 31, 0.96));
}

.theme-dark .becke-choice-menu {
  border-color: rgba(255, 255, 255, 0.14);
  background: rgba(12, 22, 30, 0.98);
  box-shadow: 0 18px 34px rgba(0, 0, 0, 0.42);
}

.theme-dark .becke-choice-menu button {
  color: #e5edf2;
}

.theme-dark .becke-choice-menu button:hover,
.theme-dark .becke-choice-menu button[aria-selected="true"] {
  background: #f8fafc;
  color: #122029;
}

.theme-dark .becke-field span,
.theme-dark .becke-slider span,
.theme-dark .becke-slider strong,
.theme-dark .becke-interpretation {
  color: #f8fafc;
}

.theme-dark .becke-readouts div,
.theme-dark .becke-badge,
.theme-dark .becke-material-chip {
  background: rgba(0, 0, 0, 0.58);
}

.theme-dark .becke-disclaimer {
  background: rgba(15, 23, 32, 0.62);
  color: #b8c5cf;
}

@media (max-width: 820px) {
  .becke-scope {
    grid-template-columns: 1fr;
    padding: 10px;
  }

  .becke-viewer,
  .becke-viewer canvas {
    min-height: 320px;
  }

  .becke-readouts {
    grid-template-columns: 1fr;
  }
}
