/* The floor assistant: a launcher, a panel, and the highlight ring that makes
   guide mode worth having. Deliberately additive - it is injected into every
   screen and must never disturb the layout beneath it. */

.assist-launch {
  position: fixed; right: 18px; bottom: 18px; z-index: 40;
  display: flex; align-items: center; gap: 8px;
  background: var(--accent); color: #06121f;
  border: none; border-radius: 999px;
  padding: 10px 16px; font: inherit; font-weight: 600; font-size: 14px;
  cursor: pointer; box-shadow: 0 6px 20px rgba(0, 0, 0, .35);
}
.assist-launch:hover { filter: brightness(1.08); }
.assist-launch:focus-visible { outline: 2px solid var(--text); outline-offset: 3px; }

.assist-panel {
  position: fixed; right: 18px; bottom: 18px; z-index: 41;
  width: min(380px, calc(100vw - 36px));
  max-height: min(560px, calc(100vh - 36px));
  display: flex; flex-direction: column;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 12px; box-shadow: 0 12px 40px rgba(0, 0, 0, .45);
  overflow: hidden;
}
.assist-head {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px; border-bottom: 1px solid var(--line);
  background: var(--panel-2);
}
.assist-head strong { font-size: 14px; }
.assist-head .spacer { flex: 1; }
.assist-head button {
  background: transparent; border: 1px solid var(--line); color: var(--muted);
  border-radius: 6px; padding: 2px 9px; cursor: pointer; font: inherit; font-size: 13px;
}
.assist-head button:hover { color: var(--text); }

.assist-log { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.assist-msg { font-size: 13.5px; line-height: 1.55; }
.assist-msg.you { color: var(--muted); }
.assist-msg.you::before { content: "you "; font-family: var(--mono); font-size: 11px; }
.assist-msg.bot { color: var(--text); white-space: pre-wrap; }
.assist-msg.thinking { color: var(--muted); font-style: italic; }

.assist-suggest { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 12px 10px; }
.assist-suggest button {
  background: var(--panel-2); border: 1px solid var(--line); color: var(--muted);
  border-radius: 999px; padding: 4px 11px; font: inherit; font-size: 12px; cursor: pointer;
}
.assist-suggest button:hover { color: var(--text); border-color: var(--accent); }

.assist-ask { display: flex; gap: 6px; padding: 10px 12px; border-top: 1px solid var(--line); }
.assist-ask input {
  flex: 1; background: var(--panel-2); border: 1px solid var(--line);
  color: var(--text); border-radius: 8px; padding: 8px 10px; font: inherit; font-size: 13.5px;
}
.assist-ask button {
  background: var(--accent); color: #06121f; border: none;
  border-radius: 8px; padding: 8px 14px; font: inherit; font-weight: 600; cursor: pointer;
}

/* ---------- guide mode ---------- */

.assist-ring {
  position: fixed; z-index: 60; pointer-events: none;
  border: 2px solid var(--accent); border-radius: 10px;
  box-shadow: 0 0 0 9999px rgba(4, 8, 14, .55), 0 0 22px rgba(74, 158, 255, .55);
  transition: all .28s cubic-bezier(.4, 0, .2, 1);
}
@media (prefers-reduced-motion: reduce) { .assist-ring { transition: none; } }

.assist-coach {
  position: fixed; z-index: 61;
  width: min(320px, calc(100vw - 24px));
  background: var(--panel); border: 1px solid var(--accent);
  border-radius: 10px; padding: 12px 14px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .5);
}
.assist-coach .step {
  font-family: var(--mono); font-size: 11px; letter-spacing: .08em;
  text-transform: uppercase; color: var(--accent); margin-bottom: 4px;
}
.assist-coach h4 { margin: 0 0 5px; font-size: 15px; }
.assist-coach p { margin: 0 0 10px; font-size: 13px; line-height: 1.55; color: var(--muted); }
.assist-coach .row { display: flex; gap: 6px; align-items: center; }
.assist-coach button {
  background: var(--accent); color: #06121f; border: none;
  border-radius: 7px; padding: 6px 13px; font: inherit; font-weight: 600;
  font-size: 13px; cursor: pointer;
}
.assist-coach button.ghost {
  background: transparent; color: var(--muted); border: 1px solid var(--line); font-weight: 400;
}
.assist-coach .spacer { flex: 1; }

/* ---------- the agent ---------- */

.assist-brain {
  font-family: var(--mono); font-size: 11px; color: var(--muted);
  border: 1px solid var(--line); border-radius: 999px; padding: 1px 8px;
}
.assist-brain.on { color: var(--accent); border-color: var(--accent); }

.assist-trace { font-size: 12px; color: var(--muted); }
.assist-trace summary { cursor: pointer; }
.assist-trace .trace-row { display: flex; flex-direction: column; gap: 1px; padding: 4px 0 4px 10px; border-left: 2px solid var(--line); margin-top: 4px; }
.assist-trace .trace-row code { font-family: var(--mono); font-size: 11px; color: var(--text); word-break: break-all; }
.assist-trace .trace-row.bad { border-left-color: var(--down); }

.assist-card {
  border: 1px solid var(--accent); border-radius: 10px; padding: 10px 12px;
  background: var(--panel-2);
}
.assist-card .kicker {
  font-family: var(--mono); font-size: 11px; letter-spacing: .08em;
  text-transform: uppercase; color: var(--accent); margin-bottom: 4px;
}
.assist-card h4 { margin: 0 0 8px; font-size: 14px; }
.assist-card dl { display: grid; grid-template-columns: max-content 1fr; gap: 2px 10px; margin: 0 0 8px; font-size: 12.5px; }
.assist-card dt { color: var(--muted); font-family: var(--mono); font-size: 11px; }
.assist-card dd { margin: 0; color: var(--text); }
.assist-card .note { margin: 0 0 10px; font-size: 12px; color: var(--muted); line-height: 1.5; }
.assist-card .row { display: flex; gap: 6px; align-items: center; }
.assist-card .spacer { flex: 1; }
.assist-card button {
  background: var(--accent); color: #06121f; border: none;
  border-radius: 7px; padding: 6px 13px; font: inherit; font-weight: 600;
  font-size: 13px; cursor: pointer;
}
.assist-card button.ghost {
  background: transparent; color: var(--muted); border: 1px solid var(--line); font-weight: 400;
}
.assist-card button:disabled { opacity: .5; cursor: default; }
.assist-card.settled { border-color: var(--line); }
.assist-card .verdict { margin-top: 8px; font-size: 12px; color: var(--muted); font-style: italic; }

/* ---------- provenance on a recorded walk ---------- */

.assist-coach .dots { display: flex; gap: 4px; margin: -4px 0 10px; }
.assist-coach .dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--line); }
.assist-coach .dots i.done { background: var(--muted); }
.assist-coach .dots i.on { background: var(--accent); }
.assist-coach .meta {
  font-family: var(--mono); font-size: 10.5px; color: var(--muted);
  margin: 0 0 8px; letter-spacing: .02em;
}

/* ---------- the recorder ---------- */

.rec-hud {
  position: fixed; top: 10px; left: 50%; transform: translateX(-50%); z-index: 70;
  display: flex; align-items: center; gap: 10px;
  background: var(--panel); border: 1px solid var(--down); border-radius: 999px;
  padding: 6px 10px 6px 14px; box-shadow: 0 8px 26px rgba(0, 0, 0, .45);
  font-size: 13px; max-width: calc(100vw - 40px);
}
.rec-hud .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--down); animation: rec-pulse 1.2s infinite; }
@keyframes rec-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .rec-hud .dot { animation: none; } }
.rec-hud strong { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 32vw; }
.rec-hud .count { font-family: var(--mono); font-size: 11px; color: var(--muted); white-space: nowrap; }
.rec-hud .count.bad { color: var(--down); }
.rec-hud .flash { font-size: 12px; color: var(--idle); white-space: nowrap; }
.rec-hud button {
  background: var(--accent); color: #06121f; border: none; border-radius: 999px;
  padding: 5px 12px; font: inherit; font-weight: 600; font-size: 12.5px; cursor: pointer;
}
.rec-hud button.ghost { background: transparent; color: var(--muted); border: 1px solid var(--line); font-weight: 400; }

.rec-badge {
  position: fixed; z-index: 69; pointer-events: none;
  min-width: 20px; height: 20px; padding: 0 5px; border-radius: 999px;
  background: var(--panel); color: var(--down); border: 1.5px solid var(--down);
  font-family: var(--mono); font-size: 11px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .4);
}

.rec-coach { border-color: var(--down); }
.rec-coach .step { color: var(--down); }
.rec-coach input, .rec-coach textarea {
  width: 100%; box-sizing: border-box; background: var(--panel-2); border: 1px solid var(--line);
  color: var(--text); border-radius: 7px; padding: 7px 9px; font: inherit; font-size: 13px; margin-bottom: 8px;
}
.rec-coach input.rec-title { font-weight: 600; }
.rec-coach textarea { resize: vertical; }
.rec-coach .row + .row { margin-top: 8px; }
.rec-prefill { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); }

.rec-review {
  position: fixed; inset: 0; z-index: 80; background: rgba(4, 8, 14, .6);
  display: flex; align-items: flex-start; justify-content: center; overflow-y: auto; padding: 30px 12px;
}
.rec-review-box {
  width: min(720px, 100%); background: var(--panel); border: 1px solid var(--line);
  border-radius: 12px; padding: 18px 20px; box-shadow: 0 16px 50px rgba(0, 0, 0, .5);
}
.rec-review-box h3 { margin: 0 0 6px; }
.rec-review-box p.muted { margin: 0 0 14px; font-size: 13px; line-height: 1.5; }
.rec-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; margin-bottom: 14px; }
.rec-meta .field { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
.rec-meta .field:nth-child(3) { grid-column: 1 / -1; }
.rec-meta input, .rec-meta textarea, .rec-meta select {
  background: var(--panel-2); border: 1px solid var(--line); color: var(--text);
  border-radius: 7px; padding: 7px 9px; font: inherit; font-size: 13px;
}
.rec-steps { list-style: none; padding: 0; margin: 0 0 14px; display: flex; flex-direction: column; gap: 10px; counter-reset: step; }
.rec-steps li { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: var(--panel-2); counter-increment: step; }
.rec-steps li.muted { border-style: dashed; }
.rec-steps .head { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
.rec-steps .head::before { content: counter(step); font-family: var(--mono); font-size: 11px; font-weight: 700; color: var(--accent); min-width: 18px; }
.rec-steps .head code { font-family: var(--mono); font-size: 11px; color: var(--muted); }
.rec-steps .head .spacer { flex: 1; }
.rec-steps .head button { background: transparent; border: 1px solid var(--line); color: var(--muted); border-radius: 6px; padding: 1px 7px; font: inherit; font-size: 12px; cursor: pointer; }
.rec-steps .head button.danger { color: var(--down); }
.rec-steps .head button:disabled { opacity: .35; cursor: default; }
.rec-steps input, .rec-steps textarea {
  width: 100%; box-sizing: border-box; background: var(--panel); border: 1px solid var(--line); color: var(--text);
  border-radius: 7px; padding: 6px 8px; font: inherit; font-size: 13px; margin-bottom: 6px;
}
.rec-steps input { font-weight: 600; }
.rec-unkept { border: 1px solid var(--idle); border-radius: 10px; padding: 10px 12px; margin-bottom: 14px; font-size: 13px; }
.rec-unkept p { margin: 4px 0 6px; }
.rec-unkept ul { margin: 0; padding-left: 18px; color: var(--muted); font-size: 12.5px; }
.rec-error { color: var(--down); font-size: 13px; margin: 0 0 10px; }
.rec-review-box .row { display: flex; gap: 8px; align-items: center; }
.rec-review-box .row .spacer { flex: 1; }
.rec-review-box .row button {
  background: var(--accent); color: #06121f; border: none; border-radius: 8px;
  padding: 8px 14px; font: inherit; font-weight: 600; cursor: pointer;
}
.rec-review-box .row button.ghost { background: transparent; color: var(--muted); border: 1px solid var(--line); font-weight: 400; }
.rec-review-box .row button.danger { color: var(--down); }
.rec-review-box .row button:disabled { opacity: .5; cursor: default; }

.rec-start { display: flex; gap: 6px; margin-top: 4px; }
.rec-start input { flex: 1; background: var(--panel-2); border: 1px solid var(--line); color: var(--text); border-radius: 8px; padding: 8px 10px; font: inherit; font-size: 13px; }
.rec-start button { background: var(--panel-2); color: var(--down); border: 1px solid var(--down); border-radius: 8px; padding: 8px 12px; font: inherit; font-weight: 600; cursor: pointer; }
