/* ============================================================================
 * Agent Onboarding v4 — "The Loop" (closed feedback)
 * Ported from src/onboarding-demo-v4.html, namespaced under `.aov4`,
 * colors adapted from the mockup's mint palette to the app's teal theme
 * (theme-sage.css --c-primary family). All selectors are scoped so the
 * mockup's generic class names (.card/.field/.input/.book…) never leak into
 * the rest of the app.
 *
 * Used as the content of the per-agent "Onboarding" tab in AgentDetailPanel.
 * ========================================================================== */

.aov4 {
  /* Teal-adapted tokens (was mint in the mockup) */
  --ink: #0f172a;
  --ink-soft: #334155;
  --muted: #64748b;
  --line: #e2e8f0;
  --line-soft: #f1f5f9;
  --mint: #5eead4;
  --mint-strong: #0d9488;
  --mint-bg: #f0fdfa;
  --mint-edge: #99f6e4;
  --soil: #ecfdf5;
  --soil-edge: #ccfbf1;
  --warn: #ea580c;
  --card: #ffffff;
  --radius-lg: 22px;
  --radius-md: 14px;
  --shadow: 0 26px 64px -22px rgba(15, 23, 42, .42), 0 4px 14px -8px rgba(15, 23, 42, .18);
  --ease: cubic-bezier(.22, .61, .36, 1);

  font-family: var(--font-sans, 'IBM Plex Sans', system-ui, -apple-system, sans-serif);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  width: 100%;
  padding: 28px 24px 40px;
}

.aov4 *,
.aov4 *::before,
.aov4 *::after {
  box-sizing: border-box;
}

/* In-panel: only the onboard card is used; show it as a centered card. */
.aov4 .card {
  background: var(--card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  display: none;
}
.aov4 .card.active {
  display: block;
}

/* No "Back" affordance inside the agent panel tab. */
.aov4.in-panel .ob-back {
  display: none;
}

.aov4 .label {
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--ink);
  margin-bottom: 9px;
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.aov4 .label .req {
  color: var(--mint-strong);
  font-weight: 800;
}
.aov4 .label .opt {
  color: var(--muted);
  font-weight: 700;
  text-transform: none;
  letter-spacing: 0;
  font-size: 13px;
}
.aov4 .field {
  width: 100%;
}
.aov4 .field + .field {
  margin-top: 22px;
}
.aov4 .input,
.aov4 .select {
  width: 100%;
  height: 56px;
  padding: 0 18px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 16px;
  color: var(--ink);
  background: #fff;
  transition: border-color .18s var(--ease), box-shadow .18s var(--ease);
}
.aov4 .input::placeholder {
  color: var(--muted);
}
.aov4 .input:focus,
.aov4 .select:focus {
  outline: none;
  border-color: var(--mint-strong);
  box-shadow: 0 0 0 4px rgba(13, 148, 136, .12);
}
.aov4 .select {
  appearance: none;
  color: var(--ink-soft);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='20' height='20' fill='none' stroke='%23334155' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M6 9l6 6 6-6'/></svg>");
  background-repeat: no-repeat;
  background-position: right 16px center;
}

/* ===================== ONBOARDING CARD ===================== */
.aov4 .card.onboard {
  width: 900px;
  max-width: 100%;
  padding: 0;
  overflow: hidden;
  background: linear-gradient(180deg, #ffffff 0%, #ffffff 52%, var(--mint-bg) 100%);
}
.aov4 .ob-wrap {
  position: relative;
}
.aov4 .ob-head {
  padding: 26px 32px 4px;
}
.aov4 .ob-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: none;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--ink-soft);
  cursor: pointer;
  padding: 0;
  margin-bottom: 14px;
}
.aov4 .ob-back:hover {
  color: var(--ink);
}
.aov4 .ob-h {
  font-size: 23px;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -.01em;
  margin-bottom: 5px;
}
.aov4 .ob-h .nm {
  color: var(--mint-strong);
}

.aov4 .ob-main {
  display: grid;
  grid-template-columns: 1fr 348px;
  gap: 0;
  padding: 18px 32px 6px;
}
.aov4 .ob-forces {
  padding-right: 30px;
}
.aov4 .q {
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: .03em;
  color: var(--ink);
  text-transform: uppercase;
  margin-bottom: 9px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.aov4 .q .opt {
  margin-left: auto;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0;
  text-transform: none;
}
.aov4 .q .qi {
  display: grid;
  place-items: center;
  color: var(--mint-strong);
}
.aov4 .q .qi svg {
  width: 17px;
  height: 17px;
}
.aov4 .force + .force {
  margin-top: 20px;
}
.aov4 .ob-chatbox {
  width: 100%;
  min-height: 70px;
  resize: vertical;
  padding: 13px 15px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 14.5px;
  line-height: 1.5;
  color: var(--ink);
  transition: border-color .18s, box-shadow .18s;
}
.aov4 .ob-chatbox::placeholder {
  color: var(--muted);
}
.aov4 .ob-chatbox:focus {
  outline: none;
  border-color: var(--mint-strong);
  box-shadow: 0 0 0 4px rgba(13, 148, 136, .12);
}

.aov4 .pace {
  padding: 4px 2px 0;
}
.aov4 .pace input[type=range] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--mint-edge), var(--mint));
  outline: none;
  cursor: pointer;
}
.aov4 .pace input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  border: 2.5px solid var(--mint-strong);
  cursor: pointer;
  box-shadow: 0 4px 10px -3px rgba(13, 148, 136, .5);
  transition: transform .15s var(--ease);
}
.aov4 .pace input[type=range]::-webkit-slider-thumb:hover {
  transform: scale(1.1);
}
.aov4 .pace input[type=range]::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  border: 2.5px solid var(--mint-strong);
  cursor: pointer;
  box-shadow: 0 4px 10px -3px rgba(13, 148, 136, .5);
}
.aov4 .pace-ticks {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--muted);
}
.aov4 .pace-ticks span {
  transition: color .2s, font-weight .2s;
}
.aov4 .pace-ticks span.on {
  color: var(--mint-strong);
  font-weight: 800;
}

.aov4 .cal-input {
  width: 100%;
  height: 50px;
  padding: 0 15px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 14px;
  color: var(--ink);
  transition: border-color .18s, box-shadow .18s;
}
.aov4 .cal-input::placeholder {
  color: var(--muted);
}
.aov4 .cal-input:focus {
  outline: none;
  border-color: var(--mint-strong);
  box-shadow: 0 0 0 4px rgba(13, 148, 136, .12);
}
.aov4 .cal-input.warn {
  border-color: var(--warn);
  box-shadow: 0 0 0 4px rgba(234, 88, 12, .13);
}

/* Right: inhabitant = a beating closed loop */
.aov4 .ob-habitat {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.aov4 .habitat-bar {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 14px;
}
.aov4 .ticks {
  display: flex;
  gap: 5px;
  margin-left: auto;
}
.aov4 .tk {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #d2dae2;
  transition: background .4s var(--ease), box-shadow .4s;
}
.aov4 .tk.on {
  background: var(--mint-strong);
  box-shadow: 0 0 0 3px rgba(13, 148, 136, .18);
}

.aov4 .being {
  position: relative;
  width: 300px;
  --formed: 0;
  --saturate: 0;
  --lap: 2.6s;
  --danger: 0;
  background: #fff;
  border-radius: 18px;
  padding: 16px 16px 14px;
  box-shadow: 0 calc(9px + var(--formed) * 13px) calc(22px + var(--formed) * 16px) -20px rgba(15, 23, 42, .42);
  transition: box-shadow .5s var(--ease);
}
.aov4 .being.closed {
  box-shadow: 0 22px 44px -22px rgba(13, 148, 136, .55), 0 0 0 1px rgba(13, 148, 136, .16);
}

.aov4 .bg-id-strip {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: center;
  margin-bottom: 2px;
}
.aov4 .avatar {
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  background: linear-gradient(140deg, #0d9488, #5eead4);
  filter: grayscale(calc(1 - var(--saturate))) opacity(calc(.55 + var(--saturate) * .45));
  transition: filter .5s var(--ease), transform .5s var(--ease);
}
.aov4 .bg-id {
  min-width: 0;
}
.aov4 .bg-name {
  font-size: 15px;
  font-weight: 800;
  line-height: 1.1;
}
.aov4 .bg-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 1px;
  font-size: 10.5px;
  font-weight: 700;
  color: var(--ink-soft);
}
.aov4 .bg-handle {
  color: var(--ink-soft);
  font-weight: 600;
}
.aov4 .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #c4ccd6;
  transition: background .4s;
}
.aov4 .being.online .dot {
  background: var(--mint-strong);
  box-shadow: 0 0 0 4px rgba(13, 148, 136, .18);
}
.aov4 .being.online .bg-status {
  color: var(--mint-strong);
}

.aov4 .ring-wrap {
  position: relative;
  width: 100%;
}
.aov4 #aov4-loopSvg {
  width: 100%;
  height: auto;
  display: block;
  overflow: visible;
}
.aov4 .arc {
  fill: none;
  stroke-width: 3;
  stroke-linecap: round;
  stroke: color-mix(in srgb, #c8d0da, var(--mint-strong) calc(var(--saturate) * 100%));
  transition: stroke .5s var(--ease);
}
.aov4 .being.unstable .arc {
  stroke: color-mix(in srgb, var(--mint-strong), var(--warn) calc(var(--danger) * 100%));
}
.aov4 #aov4-arcFeedback {
  fill: none;
  stroke: var(--mint-strong);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-dasharray: 100;
  stroke-dashoffset: 100;
  transition: stroke-dashoffset .55s var(--ease), stroke .4s;
}
.aov4 .being.closed #aov4-arcFeedback {
  stroke-dashoffset: 0;
}
.aov4 #aov4-arcFeedbackGhost {
  fill: none;
  stroke: var(--warn);
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-dasharray: 5 7;
  opacity: 0;
  transition: opacity .3s;
}
.aov4 .being.hasgoal:not(.closed) #aov4-arcFeedbackGhost {
  opacity: .34;
}

.aov4 .halo {
  fill: none;
  stroke: var(--mint-strong);
  stroke-width: 2;
  opacity: .3;
  transition: opacity .4s;
}
.aov4 .being:not(.hasgoal) .halo {
  stroke: #c8d0da;
  animation: aov4HaloSearch 2.4s ease-in-out infinite;
}
.aov4 .being.unstable .halo {
  animation: aov4HaloFlicker .3s ease-in-out infinite;
}
@keyframes aov4HaloSearch {
  0%, 100% { opacity: .18; }
  50% { opacity: .5; }
}
@keyframes aov4HaloFlicker {
  0%, 100% { opacity: .9; }
  50% { opacity: .35; }
}
.aov4 .halo-notch {
  stroke: var(--mint-strong);
  stroke-width: 3;
  stroke-linecap: round;
  opacity: 0;
  transition: opacity .4s;
}
.aov4 .being.hasgoal .halo-notch {
  opacity: 1;
}

.aov4 .node-disc {
  fill: #fff;
  stroke: var(--mint-strong);
  stroke-width: 2.4;
  transition: fill .4s, stroke .4s;
}
.aov4 .node-gly path {
  fill: none;
  stroke: var(--mint-strong);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: stroke .4s;
}
.aov4 .node-gly2 circle {
  fill: none;
  stroke: var(--mint-strong);
  stroke-width: 2;
  transition: stroke .4s;
}
.aov4 .node-lbl {
  font-family: inherit;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .12em;
  fill: var(--muted);
  text-anchor: middle;
}
.aov4 .being:not(.hasgoal) .node-disc {
  stroke: #c8d0da;
}
.aov4 .being:not(.hasgoal) .node-gly path,
.aov4 .being:not(.hasgoal) .node-gly2 circle {
  stroke: #c8d0da;
}
.aov4 .being.hasgoal #aov4-nodeGoal .node-disc,
.aov4 .being.hasgoal #aov4-nodeLoop .node-disc {
  fill: var(--mint-strong);
}
.aov4 .being.hasgoal #aov4-nodeGoal .node-gly path,
.aov4 .being.hasgoal #aov4-nodeLoop .node-gly path {
  stroke: #fff;
}
.aov4 .being.hasgoal:not(.closed) #aov4-nodeTest .node-disc {
  stroke: var(--warn);
  stroke-dasharray: 5 4;
}
.aov4 .being.hasgoal:not(.closed) #aov4-nodeTest .node-gly2 circle {
  stroke: var(--warn);
}
.aov4 .being.hasgoal:not(.closed) #aov4-nodeTest .node-lbl {
  fill: var(--warn);
}
.aov4 .being.closed #aov4-nodeTest .node-disc {
  fill: var(--mint-strong);
  stroke: var(--mint-strong);
}
.aov4 .being.closed #aov4-nodeTest .node-gly2 circle {
  stroke: #fff;
}

.aov4 #aov4-pulse {
  opacity: 0;
  transition: opacity .3s;
}
.aov4 #aov4-eject {
  opacity: 0;
  transform-box: fill-box;
  transform-origin: center;
}
.aov4 .eject-go {
  animation: aov4EjectTangent .5s ease-out;
}
@keyframes aov4EjectTangent {
  0% { opacity: 1; transform: translate(0, 0) scale(1.3); }
  100% { opacity: 0; transform: translate(-26px, 30px) scale(.55); }
}
.aov4 #aov4-passRing {
  fill: none;
  stroke: var(--mint-strong);
  stroke-width: 2.5;
  opacity: 0;
  transform-box: fill-box;
  transform-origin: center;
}
.aov4 .pass-go {
  animation: aov4PassFlash .5s var(--ease);
}
@keyframes aov4PassFlash {
  0% { opacity: .9; transform: scale(.7); }
  100% { opacity: 0; transform: scale(1.55); }
}

.aov4 .being.unstable #aov4-ringG {
  animation: aov4Oscillate .24s ease-in-out infinite;
  transform-box: fill-box;
  transform-origin: center;
}
@keyframes aov4Oscillate {
  0%, 100% { transform: rotate(-2.2deg); }
  50% { transform: rotate(2.2deg); }
}

.aov4 .gtick {
  fill: none;
  stroke: #dde4ec;
  stroke-width: 5;
  stroke-linecap: round;
  transition: stroke .4s;
}
.aov4 .gtick.on {
  stroke: var(--mint-strong);
}

.aov4 .ring-voice {
  position: absolute;
  left: 50%;
  top: 51%;
  transform: translate(-50%, -50%);
  width: 130px;
  text-align: center;
  font-size: 11.5px;
  line-height: 1.4;
  color: var(--ink);
  pointer-events: none;
}
.aov4 .ring-voice .hl {
  color: var(--mint-strong);
  font-weight: 700;
}
.aov4 .ring-voice .warn {
  color: var(--warn);
  font-weight: 700;
}
.aov4 .ring-voice .ph {
  color: var(--muted);
  font-style: italic;
}

.aov4 .cmd-rail {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.aov4 .cmd {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-mono, ui-monospace, Menlo, monospace);
  font-size: 11px;
  color: var(--ink-soft);
  background: var(--mint-bg);
  border: 1.4px dashed var(--mint-edge);
  border-radius: 999px;
  padding: 5px 11px;
  opacity: .42;
  transition: opacity .25s, border-color .25s;
}
.aov4 .cmd .sl {
  color: var(--mint-strong);
  font-weight: 800;
}
.aov4 .cmd .cmd-name {
  font-weight: 700;
  color: var(--ink);
}
.aov4 .cmd .cmd-det {
  color: var(--ink-soft);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.aov4 .cmd.on {
  opacity: 1;
  border-style: solid;
}
.aov4 .cmd.on::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  height: 2px;
  width: 100%;
  background: var(--mint-strong);
  transform: scaleX(0);
  transform-origin: left;
  animation: aov4InkUnderline .35s var(--ease) forwards;
}
.aov4 .cmd.warn {
  border-color: var(--warn);
}
.aov4 .cmd.warn .cmd-name,
.aov4 .cmd.warn .cmd-det {
  color: var(--warn);
}
.aov4 .cmd.warn::after {
  background: var(--warn);
}
@keyframes aov4InkUnderline {
  to { transform: scaleX(1); }
}
.aov4 .being.waking .cmd {
  animation: aov4CmdSettle .4s var(--ease) both;
}
.aov4 .being.waking .cmd:nth-child(2) { animation-delay: .07s; }
.aov4 .being.waking .cmd:nth-child(3) { animation-delay: .14s; }
@keyframes aov4CmdSettle {
  from { transform: translateY(5px); }
  to { transform: translateY(0); }
}

.aov4 .loop-warn {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 10px;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--warn);
  text-align: center;
  line-height: 1.3;
}
.aov4 .loop-warn.show {
  display: flex;
}
.aov4 .loop-warn svg {
  flex: 0 0 auto;
}

@keyframes aov4Solidify {
  0% { transform: scale(1); }
  45% { transform: scale(1.015); }
  100% { transform: scale(1); }
}
.aov4 .being.solidify {
  animation: aov4Solidify .6s var(--ease);
}
@keyframes aov4Wakepulse {
  0% { transform: scale(1); }
  45% { transform: scale(1.16); }
  100% { transform: scale(1); }
}
.aov4 .avatar.waking {
  animation: aov4Wakepulse .8s var(--ease);
}

/* Ground / CONTEXT bookshelf */
.aov4 .ob-ground {
  margin-top: 14px;
  padding: 20px 32px 22px;
  background: linear-gradient(180deg, var(--mint-bg) 0%, var(--soil) 100%);
  border-top: 1px solid var(--soil-edge);
}
.aov4 .ground-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 14px;
}
.aov4 .ground-title {
  font-size: 12.5px;
  font-weight: 800;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 8px;
}
.aov4 .ground-title svg {
  color: var(--mint-strong);
}
.aov4 .shelf {
  position: relative;
  padding: 0 4px;
}
.aov4 .books {
  display: flex;
  align-items: flex-end;
  gap: 18px;
}
.aov4 .book {
  position: relative;
  width: 64px;
  height: 142px;
  flex: 0 0 auto;
  cursor: pointer;
  font-family: inherit;
  border: none;
  border-radius: 7px 7px 3px 3px;
  color: #fff;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px 0 0;
  box-shadow: 0 8px 16px -10px rgba(15, 23, 42, .5);
  filter: saturate(.3) brightness(1.07);
  opacity: .88;
  transition: transform .22s var(--ease), filter .22s, box-shadow .22s, opacity .22s;
}
.aov4 .book::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(95deg, rgba(0, 0, 0, .22), transparent 20%, transparent 85%, rgba(255, 255, 255, .2));
}
.aov4 .book:hover {
  transform: translateY(-6px);
  opacity: 1;
}
.aov4 .book.on {
  filter: none;
  opacity: 1;
  transform: translateY(-15px);
  box-shadow: 0 22px 32px -12px rgba(13, 148, 136, .6);
}
.aov4 .b-play { background: #0d9488; }
.aov4 .b-domain { background: #14b8a6; }
.aov4 .b-norms { background: #0f766e; }
.aov4 .book-ico {
  display: grid;
  place-items: center;
}
.aov4 .book-ico svg {
  width: 18px;
  height: 18px;
}
.aov4 .book-spine {
  writing-mode: vertical-rl;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .02em;
  margin-top: 7px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .2);
}
.aov4 .book-tag {
  position: absolute;
  top: 7px;
  right: 6px;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: 999px;
  background: #fff;
  color: var(--mint-strong);
  font-size: 10px;
  font-weight: 800;
  display: none;
  place-items: center;
  box-shadow: 0 2px 6px -2px rgba(0, 0, 0, .3);
}
.aov4 .book.on .book-tag {
  display: grid;
}
.aov4 .book.add {
  background: #fff;
  color: var(--mint-strong);
  border: 1.6px dashed var(--mint-edge);
  filter: none;
  opacity: 1;
  box-shadow: none;
}
.aov4 .book.add::before {
  display: none;
}
.aov4 .book.add:hover {
  border-color: var(--mint-strong);
  transform: translateY(-6px);
}
.aov4 .book.add.on {
  border-style: solid;
  border-color: var(--mint-strong);
  background: linear-gradient(160deg, #f0fdfa, #ccfbf1);
  box-shadow: 0 20px 30px -14px rgba(13, 148, 136, .5);
  transform: translateY(-15px);
}
.aov4 .book.add .book-spine {
  color: var(--ink);
}
.aov4 .book.add .book-tag {
  color: #fff;
  background: var(--mint-strong);
}
.aov4 .shelf-plank {
  margin-top: -3px;
  height: 13px;
  border-radius: 5px;
  background: linear-gradient(180deg, #d7f0e9, #b8e4d8);
  box-shadow: 0 13px 24px -12px rgba(15, 23, 42, .42), inset 0 1px 0 rgba(255, 255, 255, .75);
}
.aov4 .shelf-note {
  margin-top: 11px;
  font-size: 11.5px;
  color: var(--mint-strong);
  font-weight: 700;
  display: none;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.aov4 .shelf-note.show {
  display: flex;
}
.aov4 .shelf-note svg {
  flex: 0 0 auto;
}

/* Completion footer */
.aov4 .ob-foot {
  padding: 18px 32px 26px;
  display: flex;
  align-items: center;
  gap: 18px;
}
.aov4 .foot-meter {
  flex: 1 1 auto;
  font-size: 12px;
  color: var(--ink-soft);
  line-height: 1.45;
}
.aov4 .foot-meter b {
  color: var(--mint-strong);
  font-weight: 800;
}
.aov4 .btn-wake {
  flex: 0 0 auto;
  height: 52px;
  padding: 0 26px;
  border-radius: 13px;
  border: none;
  cursor: not-allowed;
  font-family: inherit;
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  background: var(--mint);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  transition: transform .15s var(--ease), filter .15s, box-shadow .3s;
}
.aov4 .btn-wake.ready {
  cursor: pointer;
  background: var(--mint-strong);
  box-shadow: 0 0 0 0 rgba(13, 148, 136, .4);
  animation: aov4Breathe 2.4s ease-in-out infinite;
}
.aov4 .btn-wake.ready:hover {
  filter: brightness(1.06);
}
.aov4 .btn-wake:active {
  transform: scale(.98);
}
@keyframes aov4Breathe {
  0%, 100% { box-shadow: 0 0 0 0 rgba(13, 148, 136, .32); }
  50% { box-shadow: 0 0 0 7px rgba(13, 148, 136, 0); }
}

.aov4 .spark {
  position: absolute;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 30;
  opacity: 0;
  background: radial-gradient(circle, #ffffff 0%, #5eead4 45%, #0d9488 100%);
  filter: drop-shadow(0 0 6px rgba(13, 148, 136, .9));
}
@keyframes aov4SparkFly {
  0% { offset-distance: 0%; opacity: 0; transform: scale(.5); }
  12% { opacity: 1; }
  80% { opacity: 1; }
  100% { offset-distance: 100%; opacity: 0; transform: scale(1.1); }
}
.aov4 .ripple {
  position: absolute;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 29;
  border: 2px solid var(--mint-strong);
  transform: translate(-50%, -50%) scale(.3);
  opacity: .8;
}
@keyframes aov4RippleOut {
  to { transform: translate(-50%, -50%) scale(3.2); opacity: 0; }
}

/* Ground section header hint */
.aov4 .ground-hint {
  font-size: 11px;
  color: var(--muted);
  font-weight: 500;
  margin-left: auto;
}

/* Loading placeholder on shelf */
.aov4 .book-placeholder {
  width: 64px;
  height: 142px;
  flex: 0 0 auto;
  border-radius: 7px 7px 3px 3px;
  background: var(--line-soft);
  display: flex;
  align-items: center;
  justify-content: center;
}
.aov4 .book-ph-spin {
  display: block;
  width: 18px;
  height: 18px;
  border: 2px solid var(--mint-edge);
  border-top-color: var(--mint-strong);
  border-radius: 50%;
  animation: aov4Spin .8s linear infinite;
}
@keyframes aov4Spin {
  to { transform: rotate(360deg); }
}

/* Picker panel */
.aov4 .picker {
  display: none;
  flex-direction: column;
  margin-top: 14px;
  border: 1.5px solid var(--mint-edge);
  border-radius: var(--radius-md);
  background: var(--card);
  overflow: hidden;
  box-shadow: var(--shadow-1, 0 1px 4px rgba(15,23,42,.06));
  max-height: 0;
  transition: max-height .28s var(--ease);
}
.aov4 .picker.open {
  display: flex;
  max-height: 320px;
}
.aov4 .picker-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line-soft);
  background: var(--mint-bg);
  flex-shrink: 0;
}
.aov4 .picker-head-title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.aov4 .picker-close {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 14px;
  color: var(--muted);
  line-height: 1;
  padding: 2px 4px;
  border-radius: 4px;
  transition: background .15s;
}
.aov4 .picker-close:hover {
  background: var(--line-soft);
  color: var(--ink);
}
.aov4 .picker-body {
  overflow-y: auto;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.aov4 .picker-empty {
  padding: 16px 8px;
  text-align: center;
  font-size: 13px;
  color: var(--muted);
}
.aov4 .picker-empty.picker-err {
  color: var(--warn);
}
.aov4 .picker-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid transparent;
  transition: background .15s, border-color .15s;
}
.aov4 .picker-item:hover {
  background: var(--mint-bg);
  border-color: var(--mint-edge);
}
.aov4 .picker-spine {
  flex: 0 0 auto;
  width: 8px;
  height: 38px;
  border-radius: 3px;
}
.aov4 .picker-info {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.aov4 .picker-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.aov4 .picker-desc {
  font-size: 11.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.aov4 .picker-mount-btn {
  flex: 0 0 auto;
  height: 28px;
  padding: 0 12px;
  border-radius: 6px;
  border: 1.5px solid var(--mint-edge);
  background: var(--mint-bg);
  color: var(--mint-strong);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s, border-color .15s;
}
.aov4 .picker-mount-btn:hover:not(:disabled) {
  background: var(--mint-strong);
  border-color: var(--mint-strong);
  color: #fff;
}
.aov4 .picker-mount-btn:disabled {
  opacity: .55;
  cursor: not-allowed;
}

@media (max-width: 920px) {
  .aov4 .ob-main { grid-template-columns: 1fr; }
  .aov4 .ob-forces { padding-right: 0; margin-bottom: 22px; }
  .aov4 .ob-habitat { align-items: flex-start; }
  .aov4 .books { flex-wrap: wrap; gap: 14px; }
  .aov4 .ob-foot { flex-direction: column; align-items: stretch; }
}
