/* Annotation tour uses the neutral editor palette; mint is reserved for focus. */
/* Layering: leader 40 < pins 41 < card 43 < panel 44 — numbers never float over panels. */
.annotation-tour-host{position:relative}
.annotation-tour-panel{position:absolute;right:16px;top:16px;z-index:var(--layer-stack-44);width:min(300px,calc(100% - 32px));max-height:calc(100% - 96px);overflow:auto;padding:var(--space-3) var(--space-4);border:1px solid var(--n-200);border-radius:14px;background:color-mix(in srgb,var(--surface) 94%,transparent);color:var(--n-900);box-shadow:0 12px 30px var(--shadow-ink);font:12px/1.45 var(--font-ui,Inter,sans-serif);backdrop-filter:blur(10px)}
.annotation-tour-panel[hidden]{display:none}
.annotation-tour-panel.is-collapsed{width:auto;padding:var(--space-2) var(--space-2) var(--space-2) var(--space-3);border-radius:999px}
.annotation-tour-panel.is-collapsed .annotation-tour-head{margin:0}
.annotation-tour-head{display:flex;align-items:center;gap:var(--space-2);margin-bottom:var(--space-2);font-size:14px}
.annotation-tour-head strong{white-space:nowrap}
.annotation-tour-head [data-annotation-count]{margin-left:auto;color:var(--n-500);font-size:12px;white-space:nowrap}
.annotation-tour-toggle{min-height:30px;padding:var(--space-1) var(--space-2);border:1px solid var(--n-200);border-radius:999px;background:var(--surface);color:var(--n-800);font-size:12px;cursor:pointer;white-space:nowrap}
.annotation-tour-body[hidden]{display:none}
.annotation-tour-status{margin:0 0 var(--space-2);color:var(--n-600)}
.annotation-tour-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:var(--space-2)}
.annotation-tour-actions button,.annotation-tour-card-nav button{min-height:30px;padding:var(--space-2) var(--space-2);border:1px solid var(--n-200);border-radius:8px;background:var(--surface);color:var(--n-800);cursor:pointer}
.annotation-tour-actions button:hover,.annotation-tour-actions button:focus-visible,.annotation-tour-toggle:focus-visible,.annotation-tour-card-nav button:focus-visible,.annotation-tour-edit:focus-visible{border-color:var(--focus-ring,var(--accent-mint));outline:2px solid color-mix(in srgb,var(--focus-ring,var(--accent-mint)) 34%,transparent);outline-offset:1px}
.annotation-tour-actions button:disabled,.annotation-tour-card-nav button:disabled{cursor:default;opacity:.45}
.annotation-tour-actions .annotation-tour-primary{grid-column:1/-1;background:var(--btn-primary-bg);border-color:var(--btn-primary-bg);color:var(--ink)}
.annotation-tour-list{display:grid;gap:var(--space-1);margin:var(--space-2) 0 0;padding:0;list-style:none;max-height:150px;overflow:auto}
.annotation-tour-list li{display:flex;align-items:center;gap:var(--space-1)}
.annotation-tour-step{display:block;flex:1;min-width:0;padding:var(--space-2) var(--space-2);border:0;border-radius:7px;background:transparent;color:inherit;text-align:left;cursor:pointer;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.annotation-tour-step:hover,.annotation-tour-step.is-active{background:var(--state-active-bg);color:var(--n-900)}
.annotation-tour-edit{flex:none;min-height:28px;padding:var(--space-1) var(--space-2);border:1px solid var(--n-200);border-radius:7px;background:transparent;color:var(--n-700);font-size:11px;cursor:pointer}
.annotation-tour-pin{position:absolute;z-index:var(--layer-stack-41);width:24px;height:24px;padding:0;border:1px solid var(--n-500);border-radius:50%;background:var(--n-0);color:var(--n-900);font-size:11px;font-weight:700;line-height:22px;box-shadow:0 2px 8px var(--shadow-ink);transform:translate(-50%,-50%);cursor:pointer}
.annotation-tour-pin[hidden]{display:none}
.annotation-tour-pin:not(.is-active){opacity:.68;transform:translate(-50%,-50%) scale(.9)}
.annotation-tour-pin.is-active{border:2px solid var(--focus-ring,var(--accent-mint));box-shadow:0 0 0 2px color-mix(in srgb,var(--focus-ring,var(--accent-mint)) 32%,transparent),0 2px 8px var(--shadow-ink)}
.annotation-tour-pin.is-occluded{opacity:.5}
.annotation-tour-pin.is-active.is-occluded{opacity:.56}
.annotation-tour-leader{position:absolute;inset:0;z-index:var(--layer-stack-40);width:100%;height:100%;overflow:visible;pointer-events:none}
.annotation-tour-leader[hidden]{display:none}
.annotation-tour-leader line{stroke:var(--n-500);stroke-width:1.25;stroke-dasharray:4 3;opacity:.8;vector-effect:non-scaling-stroke}
.annotation-tour-inline-math{display:inline-block;vertical-align:-0.16em;margin:0 .08em;white-space:nowrap}
.annotation-tour-inline-math mjx-container{display:inline-block!important;margin:0!important}
.annotation-tour-actions .annotation-tour-primary:hover,.annotation-tour-actions .annotation-tour-primary:focus-visible{border-color:var(--n-700);outline:2px solid var(--n-400);outline-offset:2px;box-shadow:none}
.annotation-tour-card{position:absolute;z-index:var(--layer-stack-43);width:min(260px,calc(100% - 32px));padding:var(--space-3) var(--space-4);border:1px solid var(--n-200);border-radius:12px;background:var(--surface);color:var(--n-900);box-shadow:0 10px 28px var(--shadow-ink);pointer-events:none}
.annotation-tour-card[hidden]{display:none}
.annotation-tour-card-kicker{margin-bottom:var(--space-1);color:var(--n-500);font-size:11px}
.annotation-tour-card h3{margin:0 0 var(--space-1);font-size:15px}
.annotation-tour-card p{margin:0;line-height:1.6;color:var(--n-700)}
.annotation-tour-card-nav{display:grid;grid-template-columns:1fr 1.3fr 1fr;gap:var(--space-2);margin-top:var(--space-2)}
.annotation-tour-card-nav[hidden]{display:none}
.annotation-tour-editor{width:440px}
.annotation-tour-editor label>span{flex:none;font-weight:600}
.annotation-tour-editor input[data-editor-title]{flex:1}
.annotation-tour-editor textarea{display:block;margin-top:var(--space-2);resize:vertical;font:13px/1.6 var(--font-ui,Inter,sans-serif)}
.annotation-tour-editor .annotation-tour-editor-check{justify-content:flex-start}
.annotation-tour-editor-preview{min-height:24px;padding:var(--space-2) var(--space-2);border:1px dashed var(--ws-line);border-radius:8px;font-size:13px;line-height:1.6}
.annotation-tour-editor-preview:empty{display:none}
.annotation-tour-editor-actions{display:flex;gap:var(--space-2);margin-top:var(--space-4)}
.annotation-tour-editor-actions span{flex:1}
.annotation-tour-editor-actions [data-editor-delete][hidden]{display:none}
.annotation-tour-editor-actions [data-editor-save]{background:var(--btn-primary-bg)!important;border-color:var(--btn-primary-bg)!important;color:var(--btn-primary-fg)!important}
html body:not(.theme-light) .annotation-tour-panel{background:var(--surface)!important;color:var(--ink)!important;border-color:var(--line)!important}
html body:not(.theme-light) .annotation-tour-panel .annotation-tour-status{color:var(--muted)!important}
html body:not(.theme-light) .annotation-tour-panel .annotation-tour-actions button,html body:not(.theme-light) .annotation-tour-panel .annotation-tour-toggle,html body:not(.theme-light) .annotation-tour-panel .annotation-tour-edit,html body:not(.theme-light) .annotation-tour-card-nav button{background:var(--surface-hover)!important;color:var(--muted)!important;border-color:var(--line)!important}
html body:not(.theme-light) .annotation-tour-panel .annotation-tour-actions button:disabled{color:var(--muted)!important;opacity:.9}
html body:not(.theme-light) .annotation-tour-panel .annotation-tour-actions .annotation-tour-primary{background:var(--btn-primary-bg)!important;color:var(--btn-primary-fg)!important;border-color:var(--btn-primary-border)!important}
html body:not(.theme-light) .annotation-tour-panel .annotation-tour-step:hover,html body:not(.theme-light) .annotation-tour-panel .annotation-tour-step.is-active{background:var(--surface-hover)!important;color:var(--ink)!important}
@media(max-width:640px){
  /* Phones: a small entry chip under the 3D bar; the full manager opens on demand as a
     bottom sheet that replaces the step card, so the model and numbered points stay clear. */
  .annotation-tour-panel{top:62px;right:8px;width:auto;max-height:none}
  .annotation-tour-panel.is-sheet{position:fixed;left:10px;right:10px;top:auto;bottom:calc(var(--command-bottom,108px) + 64px);z-index:var(--layer-stack-80);width:auto;max-height:36vh;padding:var(--space-3);border-radius:14px;display:flex;flex-direction:column;overflow:hidden}
  .annotation-tour-panel.is-sheet .annotation-tour-head{flex:none}
  .annotation-tour-panel.is-sheet .annotation-tour-body{display:flex;flex-direction:column;min-height:0}
  .annotation-tour-panel.is-sheet .annotation-tour-status,.annotation-tour-panel.is-sheet .annotation-tour-actions{flex:none}
  .annotation-tour-panel.is-sheet .annotation-tour-list{max-height:none;min-height:0;overflow:auto}
  .annotation-tour-actions button,.annotation-tour-card-nav button,.annotation-tour-toggle{min-height:40px}
  /* Compact phone card: step controls first, the step number lives in the middle button,
     description clamps to two lines so the card stays well below the model. */
  .annotation-tour-card{position:fixed;left:10px!important;right:10px;bottom:calc(var(--command-bottom,108px) + 64px);top:auto!important;width:auto;display:flex;flex-direction:column;padding:var(--space-2) var(--space-2) var(--space-2);z-index:var(--layer-stack-80);pointer-events:auto}
  .annotation-tour-card .annotation-tour-card-kicker{display:none}
  .annotation-tour-card-nav{order:-1;margin:0 0 var(--space-2)}
  .annotation-tour-card-nav button{min-height:36px;padding:var(--space-1) var(--space-2)}
  .annotation-tour-card h3{margin:0 0 var(--space-1);font-size:14px}
  .annotation-tour-card p{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;font-size:13px;line-height:1.5}
  .annotation-tour-editor{padding:var(--space-4)}
}
