/* Onboarding (warsmith-webapp #7412, plan docs/plans/2026-09-24-onboarding.md): the tour's
   spotlight + tip card (#ob-layer), the hint dock (#ob-hint), the primer (#ob-primer) — all on
   document.body, outside #app — and the two pieces inside #app: the «Первые шаги» card
   (.ob-steps) and the «Обучение» settings tab (.ob-settings). Forge-Glass tokens, dark only.

   Stacking: the chat dock 12-13, #ob-hint 14 (under every sheet: it hides itself while one is
   open), .picker 20, the finder 22, the trade 23-27, #ob-primer 45, #ob-layer 60. */

.ob-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---- the spotlight overlay ---------------------------------------------------- */
.ob-layer {
  position: fixed;
  inset: 0;
  z-index: 60;
  pointer-events: none;
}
.ob-layer[hidden] {
  display: none;
}
.ob-block {
  position: fixed;
  background: rgba(6, 7, 10, 0.66);
  pointer-events: auto;
  transition: left 0.18s var(--ease), top 0.18s var(--ease), width 0.18s var(--ease), height 0.18s var(--ease);
}
.ob-block--hole {
  background: transparent;
}
.ob-ring {
  position: fixed;
  border: 2px solid var(--accent);
  border-radius: 12px;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.4), 0 0 18px var(--accent-glow);
  pointer-events: none;
  transition: left 0.18s var(--ease), top 0.18s var(--ease), width 0.18s var(--ease), height 0.18s var(--ease);
  animation: ob-pulse 1.6s var(--ease) infinite;
}
@keyframes ob-pulse {
  0%, 100% { box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.4), 0 0 10px var(--accent-glow); }
  50% { box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.4), 0 0 22px var(--accent-glow); }
}
.ob-tip {
  position: fixed;
  padding: 12px 14px;
  pointer-events: auto;
  color: var(--ink);
  background: rgba(20, 20, 24, 0.92);
  border-color: rgba(201, 162, 75, 0.45);
  animation: ob-in 0.18s var(--ease) both;
}
.ob-layer--busy .ob-tip {
  opacity: 0.7;
}
@keyframes ob-in {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: none; }
}
.ob-tip-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}
.ob-tip-title {
  font-family: var(--font-display);
  font-size: 15px;
  color: var(--accent-strong);
}
.ob-tip-count {
  font-size: 11px;
  color: var(--ink-muted);
  flex: 0 0 auto;
}
.ob-tip-text {
  margin: 6px 0 10px;
  font-size: 13px;
  line-height: 1.45;
}
.ob-tip-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}
.ob-tip-gap {
  flex: 1 1 auto;
}
.ob-skip {
  color: var(--ink-muted);
}

/* ---- the hint dock (above the tab bar and the chat line) ---------------------- */
.ob-hint {
  position: fixed;
  z-index: 14;
  left: 12px;
  right: 12px;
  bottom: calc(var(--dock-bottom, 64px) + var(--chat-dock-h, 0px) + 8px);
  max-width: 456px;
  margin: 0 auto;
  padding: 10px 12px 12px;
  color: var(--ink);
  background: rgba(20, 20, 24, 0.94);
  border-color: rgba(201, 162, 75, 0.45);
  animation: ob-in 0.2s var(--ease) both;
}
.ob-hint[hidden] {
  display: none;
}
/* #7504: while the card is up, the scroller ends with room for it (the height is measured by
   onboarding.js syncHintRoom), so the last row — the bag's bottom cells at 400 px — can be
   scrolled clear of the card instead of staying under it. */
html.ob-hint-room main.viewport::after {
  content: '';
  display: block;
  height: var(--ob-hint-room, 0px);
}
.ob-hint-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.ob-hint-tools {
  display: flex;
  gap: 2px;
}
.ob-icon {
  min-width: 32px;
  height: 28px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink-muted);
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
}
.ob-icon:hover,
.ob-icon[aria-expanded='true'] {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.06);
}
.ob-hint-text {
  margin: 4px 0 10px;
  font-size: 13px;
  line-height: 1.45;
}
.ob-hint-menu {
  margin: -4px 0 8px;
}
.ob-hint-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

/* ---- «Первые шаги» (inside #app) --------------------------------------------- */
.ob-steps {
  padding: 10px 12px;
  margin-bottom: 12px;
}
.ob-steps-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.ob-steps-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 4px 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  cursor: pointer;
}
.ob-chev {
  color: var(--ink-muted);
  font-size: 12px;
}
.ob-step-list {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ob-step {
  display: flex;
  align-items: center;
  gap: 10px;
}
.ob-check {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1.5px solid var(--glass-border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
}
.ob-step--done .ob-check {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--on-accent);
}
.ob-step-body {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.ob-step-body b {
  font-size: 13px;
}
.ob-step-text {
  font-size: 11.5px;
  line-height: 1.35;
  color: var(--ink-muted);
}
.ob-step--done .ob-step-body b {
  color: var(--ink-muted);
  text-decoration: line-through;
  text-decoration-color: rgba(201, 162, 75, 0.6);
}
.ob-step--done .ob-step-text {
  display: none;
}
.ob-step--locked {
  opacity: 0.55;
}
.ob-step .btn {
  flex: 0 0 auto;
}

/* ---- the «Обучение» settings tab (inside the settings sheet) ------------------ */
.ob-confirm {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 6px 0 4px;
  padding: 8px 10px;
  border: 1px solid rgba(201, 162, 75, 0.45);
  border-radius: 10px;
  background: rgba(201, 162, 75, 0.08);
  font-size: 13px;
}
.ob-confirm-actions {
  display: flex;
  gap: 8px;
}
.ob-store-note {
  margin-top: 4px;
}

/* ---- the primer (full screen, above the settings sheet) ------------------------ */
.ob-primer {
  position: fixed;
  inset: 0;
  z-index: 45;
  display: flex;
  justify-content: center;
  background: rgba(6, 7, 10, 0.6);
  padding-top: env(safe-area-inset-top, 0px);
}
.ob-primer[hidden] {
  display: none;
}
.ob-primer-sheet {
  width: 100%;
  max-width: 480px;
  height: 100%;
  display: flex;
  flex-direction: column;
  border-radius: 0;
  padding: 14px 14px 0;
  background: rgba(16, 16, 20, 0.96);
}
.ob-primer-head b {
  color: var(--accent-strong);
}
.ob-primer-body {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 6px 0 calc(18px + env(safe-area-inset-bottom, 0px));
}
.ob-primer-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ob-primer-row {
  text-align: left;
  cursor: pointer;
}
.ob-primer-n {
  flex: 0 0 auto;
  width: 22px;
  color: var(--accent);
  font-weight: 700;
}
.ob-primer-t {
  flex: 1 1 auto;
}
.ob-primer-back {
  border: 0;
  background: transparent;
  color: var(--accent-strong);
  font: inherit;
  font-size: 13px;
  padding: 4px 0;
  cursor: pointer;
}
.ob-primer-h {
  margin: 8px 0 6px;
  font-family: var(--font-display);
  font-size: 18px;
  color: var(--ink);
}
.ob-primer-lines {
  margin: 0;
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-size: 13.5px;
  line-height: 1.45;
}
.ob-primer-lines li::marker {
  color: var(--accent);
}
.ob-primer-where {
  margin-top: 12px;
}
.ob-primer-show {
  margin-top: 12px;
}

@media (prefers-reduced-motion: reduce) {
  .ob-ring,
  .ob-tip,
  .ob-hint {
    animation: none;
  }
  .ob-block,
  .ob-ring {
    transition: none;
  }
}
