/* CTBone workspace: demo-specific styles */

/* ---- App Title Header ---- */
.app-title {
  padding: 18px 0 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.app-title h1 {
  font-size: 26px;
  letter-spacing: -.6px;
  font-weight: 600;
  color: var(--ink);
  margin: 0;
}

.app-title .eyebrow {
  margin-bottom: 4px;
}

/* ---- Demo region selector ---- */
.demo-selector {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 0 0 18px;
}

.demo-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: white;
  border: 1.5px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  transition: border-color .15s, background .15s, transform .12s, box-shadow .15s;
  text-align: left;
}

.demo-btn:hover {
  border-color: var(--green);
  background: #f9fafc;
  transform: translateY(-1px);
}

.demo-btn.active {
  border-color: var(--green);
  background: #f0f2f7;
  box-shadow: 0 3px 10px -2px rgba(36, 108, 85, 0.2);
}

.demo-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -.2px;
}

.demo-sub {
  font-size: 10px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .6px;
  padding: 3px 8px;
  border-radius: 4px;
  background: #eceef2;
}

.demo-btn.active .demo-sub {
  background: #d5dced;
  color: #1c2d52;
}

/* ---- Workspace grid (viewer + measurements) ---- */
#viewer-section.workspace {
  display: grid;
  grid-template-columns: 460px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
  margin-bottom: 32px;
}

/* ---- Viewer styling ---- */
.viewer {
  background: #0d121c;
  border-radius: 12px;
  color: #dce0e8;
  overflow: hidden;
  box-shadow: 0 10px 30px -8px rgba(13, 29, 27, 0.22);
}

.viewer-bar {
  padding: 12px 16px;
  border-bottom: 1px solid #1f2533;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.viewer-title {
  font-size: 13px;
  font-weight: 600;
  color: #dfe4ef;
}

.viewer-meta {
  font: 11px ui-monospace, monospace;
  color: #8b92a3;
}

.viewer-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  max-height: 460px;
  display: grid;
  place-items: center;
  background: #070a12;
  overflow: hidden;
}

.viewer-stage canvas {
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
}

.viewer-corner {
  position: absolute;
  top: 14px;
  left: 16px;
  white-space: pre;
  font: 10px/1.6 ui-monospace, monospace;
  color: #b0b8c9;
  pointer-events: none;
  background: rgba(7, 18, 16, 0.7);
  padding: 4px 8px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.viewer-tools {
  display: flex;
  gap: 8px;
  padding: 10px 14px;
  background: #131927;
  border-top: 1px solid #1f2533;
  flex-wrap: wrap;
}

.viewer-tools button {
  padding: 6px 12px;
  font-size: 12px;
  background: #1d2536;
  border: 1.5px solid #2f3950;
  color: #dce0e8;
  border-radius: 6px;
  cursor: pointer;
  transition: all .15s;
}

.viewer-tools button:hover:not(:disabled) {
  background: #252f46;
  color: white;
  border-color: #4a5775;
}

.viewer-tools button.is-on {
  background: var(--mint);
  color: var(--ink);
  border-color: var(--mint);
  font-weight: 600;
}

.viewer-foot {
  padding: 6px 14px 10px;
  font-size: 10px;
  color: #788091;
  font-family: ui-monospace, monospace;
}

/* ---- Measurements panel ---- */
.measurements.panel {
  padding: 18px 20px;
}

.meas-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.meas-header h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
}

.meas-placeholder {
  padding: 20px 0;
  text-align: center;
}

#features {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin: 10px 0;
}

.feature-row {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  padding: 8px 10px;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  transition: background .12s, border-color .12s;
}

.feature-row:hover {
  background: #f0f2f6;
  border-color: #d1d5de;
}

.feature-row > span {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.feature-row > strong {
  font: 12.5px/1.2 ui-monospace, monospace;
  color: var(--ink);
  font-weight: 600;
}

.meas-footer {
  margin-top: 10px;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.meas-footer p {
  font-size: 11px;
  line-height: 1.45;
  color: var(--muted);
  margin: 0;
}

/* ---- Fracture badge ---- */
.fracture-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .8px;
  text-transform: uppercase;
  border-radius: 20px;
  padding: 4px 10px;
  margin-bottom: 8px;
}

.fracture-badge.is-fractured {
  background: #fde8e8;
  color: #a33;
  border: 1px solid #f5bcbc;
}

.fracture-badge.is-intact {
  background: #e8ecf5;
  color: #245bdb;
  border: 1px solid #b0bdd9;
}

/* ---- Stat warning callout ---- */
.stat-warning {
  margin-top: 18px;
  border-color: #E8A84C;
  background: #FFF8F0;
  color: #7a5500;
}

.stat-warning strong {
  color: #5a3e00;
}

/* ---- Responsive ---- */
@media (max-width: 960px) {
  #viewer-section.workspace {
    grid-template-columns: 1fr;
  }

  .viewer-stage {
    max-width: 480px;
    margin: 0 auto;
  }

  .demo-selector {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 650px) {
  .demo-selector {
    grid-template-columns: 1fr;
  }

  #features {
    grid-template-columns: 1fr;
  }

  .meas-header {
    flex-direction: column;
    align-items: flex-start;
  }
}
