/* #root {
  max-width: 1280px;
  margin: 0 auto;
  padding: 2rem;
  text-align: center;
}
 */

:root {
  /* Typography */
  font-family: Inter, system-ui, Arial;
  font-size: 15px;
  line-height: 1.45;

  /* Core background */
  --bg-main:
    radial-gradient(
      900px 520px at 86% 20%,
      rgba(209, 118, 69, 0.12) 0%,
      rgba(23, 27, 34, 0.35) 55%,
      rgba(12, 15, 20, 0.0) 100%
    ),
    radial-gradient(
      900px 560px at 12% 86%,
      rgba(96, 122, 155, 0.14) 0%,
      rgba(18, 23, 30, 0.35) 55%,
      rgba(12, 15, 20, 0.0) 100%
    ),
    linear-gradient(180deg, #151a22 0%, #10141a 100%);

  --bg-surface: rgba(255, 255, 255, 0.14);
  --bg-surface-hover: rgba(255, 255, 255, 0.2);
  --bg-surface-active: rgba(255, 255, 255, 0.26);

  /* Text */
  --text-main: #f1f5f9;
  --text-muted: #9aa4b2;

  /* Accents */
  --accent-primary: #dd8250;   /* copper (slightly brighter) */
  --accent-secondary: #f3b886; /* warm copper (slightly brighter) */
  --accent-success: #43c59e;
  --accent-danger: #f37f7f;

  /* Borders */
  --border-soft: rgba(255, 255, 255, 0.11);
  --border-strong: rgba(255, 255, 255, 0.24);

  background: var(--bg-main);
  color: var(--text-main);
}

@keyframes logo-spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: no-preference) {
  a:nth-of-type(2) .logo {
    animation: logo-spin infinite 20s linear;
  }
}

.card {
  padding: 2em;
}

.read-the-docs {
  color: #888;
}
/* =========================================================
   BraceFlow AppShell (isolated styles) — uses bf-* classes
   ========================================================= */

.bf-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.bf-header {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 16px;
  flex-wrap: wrap;
  align-content: center;

  background: linear-gradient(
    180deg,
    rgba(249, 115, 22, 0.18),
    rgba(15, 23, 42, 0.65)
  );

  border-bottom: 1px solid var(--border-soft);
  backdrop-filter: blur(12px);
  box-shadow:
    0 14px 40px rgba(8, 12, 18, 0.55),
    0 0 48px rgba(210, 225, 255, 0.08);
}

.bf-left {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0; /* allows nav to shrink properly */
}

.bf-brand {
  font-weight: 800;
  font-size: 19px;
  letter-spacing: 0.2px;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  color: var(--text-main);
  transition: background 120ms ease, border-color 120ms ease;
}

.bf-brand-accent {
  color: var(--accent-primary);
  font-weight: 800;
}

.bf-brand:hover {
  color: var(--text-main);
}

.bf-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
  white-space: nowrap;
}

.bf-nav-item {
  padding: 6px 8px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 600;

  cursor: pointer;
  outline: none;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  transition: background 120ms ease, border-color 120ms ease, transform 80ms ease;
}

.bf-nav-item:hover:not(:disabled) {
  color: var(--text-main);
  background: rgba(209, 118, 69, 0.10);
  border-color: rgba(209, 118, 69, 0.3);
}

.bf-nav-item:active:not(:disabled) {
  transform: translateY(1px);
}

.bf-nav-item.is-active {
  color: var(--text-main);
  background: rgba(249, 115, 22, 0.16);
  border-color: rgba(249, 115, 22, 0.45);
}

.bf-nav-item:disabled,
.bf-nav-item.is-disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.bf-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.bf-case-context {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-right: 4px;
}

.bf-case-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 10px;
  border: 1px solid var(--border-soft);
  background: var(--bg-surface);
  color: var(--text-main);
  max-width: 240px;
  white-space: nowrap;
}

.bf-case-badge.is-empty {
  background: transparent;
  color: var(--text-muted);
}

.bf-case-label {
  flex: 0 0 auto;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.35px;
  color: var(--text-muted);
  margin-top: 1px;
}

.bf-case-id {
  flex: 1 1 auto;
  min-width: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono",
    "Courier New", monospace;
  font-weight: 800;
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bf-case-input {
  height: 32px;
  width: 150px;
  padding: 0 10px;
  border-radius: 8px;

  border: 1px solid var(--border-soft);
  background: rgba(0, 0, 0, 0.22);

  color: var(--text-main);
  font-size: 13px;

  outline: none;
}

.bf-case-input::placeholder {
  color: rgba(255, 255, 255, 0.35);
}

.bf-case-input:focus {
  border-color: var(--accent-primary);
  background: rgba(0, 0, 0, 0.28);
  box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.25);
}

.bf-go {
  height: 32px;
  padding: 0 12px;
  border-radius: 8px;

  border: 1px solid var(--border-soft);
  background: var(--bg-surface);

  color: var(--text-main);
  font-size: 13px;
  font-weight: 700;

  cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease;
}

.bf-go:hover:not(:disabled) {
  background: rgba(209, 118, 69, 0.14);
  border-color: rgba(209, 118, 69, 0.35);
}

.bf-go:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.bf-stepper {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1 1 auto;
  min-width: 0;
  padding: 4px 8px;
  margin: 0 4px;
  overflow-x: auto;
}

.bf-step {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: color 120ms ease, background 120ms ease, border-color 120ms ease;
}

.bf-step:hover:not(:disabled) {
  color: var(--text-main);
  background: rgba(209, 118, 69, 0.10);
  border-color: rgba(209, 118, 69, 0.3);
}

.bf-step.is-active {
  color: var(--text-main);
  background: rgba(249, 115, 22, 0.16);
  border-color: rgba(249, 115, 22, 0.45);
}

.bf-step.is-complete {
  color: var(--text-main);
}

.bf-step.is-disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.bf-step-dot {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-soft);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-main);
  font-size: 12px;
  font-weight: 800;
}

.bf-step.is-active .bf-step-dot {
  background: var(--accent-primary);
  border-color: transparent;
  color: #0b1020;
  box-shadow: 0 8px 18px rgba(249, 115, 22, 0.35);
}

.bf-step.is-complete .bf-step-dot {
  background: var(--accent-primary);
  border-color: transparent;
  color: #0b1020;
}

.bf-step-label {
  font-size: 13px;
}

.bf-step-connector {
  width: 26px;
  height: 2px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  flex: 0 0 auto;
}

.bf-step-connector.is-complete {
  background: rgba(249, 115, 22, 0.65);
}

.bf-content {
  flex: 1;
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.bf-content--landing {
  padding: 0;
  overflow: hidden;
  align-items: stretch;
  justify-content: center;
}

.bf-content--fade-in {
  animation: bf-content-fade-in 560ms ease both;
}

@keyframes bf-content-fade-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Editor page needs less padding to maximize space */
.bf-content:has(.shell-editor-page) {
  padding: 8px 12px;
}

/* Keep the Rigo shell page aligned with the standard page spacing */
.bf-content:has(.rigo-shell-page) {
  padding: 20px 24px;
}

/* Optional: on small screens, keep header usable */
@media (max-width: 720px) {
  .bf-case-input {
    width: 150px;
  }
  .bf-nav {
    gap: 6px;
  }
  .bf-nav-item {
    padding: 0 10px;
  }
}

@media (max-width: 1024px) {
  .bf-left {
    flex: 1 1 100%;
    order: 1;
  }

  .bf-right {
    flex: 1 1 100%;
    order: 2;
    justify-content: flex-start;
  }

  .bf-stepper {
    flex: 1 1 100%;
    order: 3;
    flex-wrap: wrap;
    justify-content: flex-start;
    overflow-x: visible;
    padding: 6px 0 0;
    margin: 0;
  }

  .bf-step-connector {
    display: none;
  }
}

.app { min-height: 100vh; }
.header { padding: 18px 24px; border-bottom: 1px solid rgba(255,255,255,0.08); display:flex; gap:12px; align-items: baseline; }
.brand { font-weight: 700; letter-spacing: 0.3px; }
.subtitle { opacity: 0.7; }
.container { padding: 24px; max-width: 1200px; margin: 0 auto; }

.card {
  background: var(--bg-surface);
  border: 1px solid var(--border-soft);
  border-radius: 14px;
  padding: 18px;
  box-shadow:
    0 10px 30px rgba(10, 15, 35, 0.35),
    0 0 32px rgba(210, 225, 255, 0.08);
}
.row { display:flex; align-items:center; }
.row.space { justify-content: space-between; }
.row.right { justify-content: flex-end; }
.row.gap { gap: 10px; }

.input {
  flex:1;
  padding: 12px 12px;
  border-radius: 10px;
  border: 1px solid var(--border-soft);
  background: rgba(0,0,0,0.25);
  color: var(--text-main);
}

.input:focus {
  outline: none;
  border-color: var(--border-strong);
  background: rgba(0,0,0,0.32);
}

.btn {
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid var(--border-soft);
  background: rgba(255,255,255,0.10);
  color: var(--text-main);
  font-weight: 600;
  cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease, transform 80ms ease;
}

.btn:hover:not(:disabled) {
  background: rgba(209, 118, 69, 0.14);
  border-color: rgba(209, 118, 69, 0.35);
}

.btn:active:not(:disabled) {
  transform: translateY(1px);
}

.btn:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
}

.btn.primary {
  background: var(--accent-primary);
  border-color: transparent;
  color: #0b1020;
  font-weight: 800;
}

.btn.primary:hover:not(:disabled) {
  background: var(--accent-secondary);
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn.secondary { background: transparent; }

.muted { opacity: 0.7; margin-top: 8px; }
.error { margin-top: 12px; padding: 10px; border-radius: 10px; background: rgba(255,0,0,0.12); border: 1px solid rgba(255,0,0,0.25); }
.notice { margin-top: 12px; padding: 10px; border-radius: 10px; background: rgba(0,170,255,0.12); border: 1px solid rgba(0,170,255,0.25); }

.landmark-layout { display:grid; grid-template-columns: 320px 1fr; gap: 14px; margin-top: 14px; }
.panel { background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.08); border-radius: 14px; padding: 14px; }
.list { margin: 10px 0 0; padding-left: 18px; }
.list li { margin: 10px 0; }
.list li.active .label { font-weight: 700; }
.label { margin-bottom: 4px; }
.meta { opacity: 0.7; font-size: 12px; }
.pill { opacity: 0.8; font-size: 12px; padding: 6px 10px; border-radius: 999px; border: 1px solid rgba(255,255,255,0.12); }

.canvasWrap { background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.08); border-radius: 14px; padding: 12px; }
.imgWrap { position: relative; display: inline-block; cursor: crosshair; }
.xray { max-width: 100%; border-radius: 12px; display:block; }
.overlay { position:absolute; inset:0; width:100%; height:100%; pointer-events:none; }
.hint { margin-top: 8px; opacity: 0.7; font-size: 12px; }

.table { width:100%; border-collapse: collapse; margin-top: 14px; }
.table th, .table td { text-align:left; padding: 10px 8px; border-bottom: 1px solid rgba(255,255,255,0.08); }
.summary { display:flex; gap: 20px; margin-top: 12px; flex-wrap: wrap; }

.tag { padding: 4px 10px; border-radius: 999px; border: 1px solid rgba(255,255,255,0.10); font-size: 12px; }
.tag.pending { opacity: 0.8; }
.tag.running { border-color: rgba(0,170,255,0.35); background: rgba(0,170,255,0.10); }
.tag.done { border-color: rgba(0,255,140,0.35); background: rgba(0,255,140,0.10); }
.tag.waiting_for_landmarks { border-color: rgba(255,200,0,0.35); background: rgba(255,200,0,0.10); }



/* =========================================================
   BraceFlow - Slide-in Drawer (Artifacts)
   ========================================================= */

.bf-drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease;
  z-index: 90;
}

.bf-drawer-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}

.bf-drawer {
  position: fixed;
  top: 0;
  right: 0;
  height: 100vh;
  width: min(560px, 92vw);
  background: rgba(15, 23, 42, 0.92);
  border-left: 1px solid var(--border-soft);
  backdrop-filter: blur(16px);
  transform: translateX(100%);
  transition: transform 180ms ease;
  z-index: 100;
  display: flex;
  flex-direction: column;
}

.bf-drawer.is-open { transform: translateX(0); }

.bf-drawer-header {
  padding: 14px 14px 10px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.bf-drawer-title { font-weight: 900; letter-spacing: 0.2px; }
.bf-drawer-subtitle { opacity: 0.7; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.bf-tabs {
  padding: 10px 12px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.bf-tab {
  height: 32px;
  min-width: 38px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.92);
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease;
}

.bf-tab:hover { background: rgba(209, 118, 69, 0.12); border-color: rgba(209, 118, 69, 0.32); }
.bf-tab.is-active { background: rgba(255,255,255,0.16); border-color: rgba(255,255,255,0.35); }

.bf-drawer-body { flex: 1; padding: 14px; overflow: auto; }


/* =========================================================
   Landmark Capture – Thumbnail + Fixed Canvas
   ========================================================= */

.lc-imageRow {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  flex-wrap: wrap;
}

.lc-thumbCol {
  width: 160px;
}

.lc-thumbBox {
  width: 140px;
  height: 140px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(0,0,0,0.25);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lc-thumbBox img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.lc-landmarkBox {
  width: 250px;
  height: 250px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(0,0,0,0.22);
  padding: 8px;
}

/* Force LandmarkCanvas to respect size */
.fixed-250 {
  width: 250px;
  height: 250px;
}

.fixed-250 img,
.fixed-250 svg {
  width: 100%;
  height: 100%;
}

.imgWrap.fixed-250 {
  position: relative;
  cursor: crosshair;
}

.imgWrap.fixed-250 img {
  display: block;
  border-radius: 10px;
}

.imgWrap.fixed-250 .overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
}


/* =========================================================
   Landmark Capture page – Thumbnail top, Workspace below
   ========================================================= */

.lc-stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Thumbnail row (top) */
.lc-thumbRow {
  display: flex;
  justify-content: flex-start;
}

.lc-thumbCol {
  width: 170px;
}

.lc-thumbBox {
  width: 140px;
  height: 140px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(0,0,0,0.22);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lc-thumbBox img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.lc-thumbActions {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}

/* Workspace (below thumbnail) */
.lc-workspace {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  padding: 14px;
}

.lc-workspace-title {
  margin-bottom: 10px;
  font-weight: 700;
  letter-spacing: 0.2px;
}

.lc-workspace-body {
  /* just spacing wrapper */
}

/* ---------------------------------------------------------
   IMPORTANT: Fix the "ruined" layout by letting LandmarkCanvas
   keep its own grid, but constrain ONLY the image holder.
   LandmarkCanvas uses:
     .landmark-layout (grid)
     .panel (left)
     .canvasWrap (right)
     .imgWrap (image container)
--------------------------------------------------------- */

.lc-workspace .landmark-layout {
  grid-template-columns: 340px 1fr;   /* nicer proportion */
  align-items: start;
  gap: 16px;
  margin-top: 0;
}

@media (max-width: 900px) {
  .lc-workspace .landmark-layout {
    grid-template-columns: 1fr;
  }
}

/* Constrain ONLY the DCM/image holder (not the whole component) */
.lc-workspace .canvasWrap {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.lc-workspace .imgWrap {
  width: 250px;
  height: 250px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(0,0,0,0.18);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Make image + overlay fill that 250x250 cleanly */
.lc-workspace .xray {
  width: 100%;
  height: 100%;
  object-fit: contain; /* keeps anatomy proportions */
  border-radius: 14px;
}

.lc-workspace .overlay {
  width: 100%;
  height: 100%;
}

/* Make the landmarks panel feel aligned with the 250 box */
.lc-workspace .panel {
  border-radius: 16px;
  
}


