/* =============================================================================
   primitives.css — 20 agent UI demos, High-end restyle
   ============================================================================= */

button, input, select, textarea {
  font: inherit;
  color: inherit;
}
button { cursor: pointer; }
button:focus-visible,
input:focus-visible {
  outline: 2px solid var(--acid);
  outline-offset: 3px;
}

.seg {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border-radius: 999px;
  background: var(--plate);
  box-shadow: 0 0 0 1px var(--hair);
}
.seg button {
  border: 0;
  background: transparent;
  border-radius: 999px;
  padding: 0.38rem 0.8rem;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--ink-soft);
  transition: transform var(--duration) var(--ease), background var(--duration) var(--ease), color var(--duration) var(--ease);
}
.seg button[aria-pressed="true"],
.seg button.is-on {
  background: var(--ink-page);
  color: var(--ink);
}
.seg button:hover { color: var(--ink-page); }
.seg button[aria-pressed="true"]:hover { color: var(--ink); }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.28rem 0.65rem;
  border-radius: 999px;
  background: var(--plate);
  box-shadow: 0 0 0 1px var(--hair);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.chip-mono {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-radius: 6px;
}

.pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border: 0;
  border-radius: 999px;
  padding: 0.62rem 1.1rem;
  background: var(--ink-page);
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.02em;
  transition: transform var(--duration) var(--ease), opacity var(--duration) var(--ease);
}
.pill-btn:hover { transform: translateY(-1px); }
.pill-btn:active { transform: scale(0.98); }
.pill-btn.ghost {
  background: transparent;
  color: var(--ink-page);
  box-shadow: inset 0 0 0 1px var(--hair-strong);
}
.pill-btn.ghost:hover { background: var(--plate); }

.meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.9rem;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

/* ========== 01 loading ==================================================== */
.loading-stage {
  display: grid;
  place-items: center;
  min-height: 148px;
}
.loading-dots {
  display: flex;
  gap: 8px;
}
.loading-dots span {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--ink-page);
  opacity: 0.22;
  animation: dots 1.05s var(--ease) infinite;
}
.loading-dots span:nth-child(2) { animation-delay: 120ms; }
.loading-dots span:nth-child(3) { animation-delay: 240ms; }
@keyframes dots {
  0%, 100% { opacity: 0.22; transform: translateY(0); }
  40% { opacity: 1; transform: translateY(-5px); }
}

.loading-orbit {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1.5px var(--hair-strong);
  position: relative;
}
.loading-orbit::after {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: 50%;
  border: 2px solid transparent;
  border-top-color: var(--ink-page);
  animation: spin 900ms linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.loading-grid {
  display: grid;
  grid-template-columns: repeat(5, 10px);
  gap: 5px;
}
.loading-grid i {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  background: var(--ink-page);
  opacity: 0.12;
  animation: pix 1.4s var(--ease) infinite;
}
.loading-grid i:nth-child(3n) { animation-delay: 80ms; }
.loading-grid i:nth-child(5n) { animation-delay: 160ms; }
.loading-grid i:nth-child(7n) { animation-delay: 240ms; }
.loading-grid i:nth-child(odd) { animation-delay: 110ms; }
@keyframes pix {
  0%, 100% { opacity: 0.12; }
  35% { opacity: 1; }
}

.loading-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 0.35rem;
}

/* ========== 02 thinking =================================================== */
.think {
  background: var(--plate);
  border-radius: 16px;
  box-shadow: 0 0 0 1px var(--hair);
  overflow: hidden;
}
.think-head {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1rem;
  border: 0;
  background: transparent;
  text-align: left;
}
.think-head strong {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.think-head span {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.think-body { padding: 0 0.7rem 0.7rem; display: grid; gap: 0.45rem; }
.think details {
  border-radius: 12px;
  background: var(--plate-recess);
  box-shadow: inset 0 0 0 1px var(--hair);
  padding: 0.15rem 0.2rem;
}
.think summary {
  list-style: none;
  cursor: pointer;
  padding: 0.55rem 0.7rem;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.think summary::-webkit-details-marker { display: none; }
.think summary::after {
  content: "+";
  float: right;
  font-family: var(--font-mono);
  color: var(--ink-soft);
}
.think details[open] summary::after { content: "–"; }
.think ol, .think p {
  margin: 0;
  padding: 0 0.7rem 0.75rem 1.6rem;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.55;
}
.think ol { display: grid; gap: 0.35rem; }
.think li.done { color: var(--ink-page); }
.think li.active { color: var(--ink-page); font-weight: 600; }
.think .pulse {
  display: inline-block;
  width: 6px; height: 6px;
  margin-right: 6px;
  border-radius: 999px;
  background: var(--ink-page);
  animation: blink 1s var(--ease) infinite;
}
@keyframes blink {
  0%, 100% { opacity: 0.25; }
  50% { opacity: 1; }
}

/* ========== 03 streaming ================================================== */
.stream {
  min-height: 7.5rem;
  font-size: 16px;
  line-height: 1.6;
  letter-spacing: -0.02em;
  color: var(--ink-page);
}
.stream .caret {
  display: inline-block;
  width: 7px;
  height: 1.05em;
  margin-left: 2px;
  background: var(--ink-page);
  vertical-align: text-bottom;
  animation: blink 1s steps(1) infinite;
}
.stream-sources {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 1rem;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity var(--duration) var(--ease), transform var(--duration) var(--ease);
}
.stream-sources.is-in { opacity: 1; transform: none; }

/* ========== 04 approval (invert) ========================================== */
.approval {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 1rem;
}
.approval h3 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.04em;
}
.approval p {
  margin: 0;
  color: var(--contact-muted);
  font-size: 15px;
  line-height: 1.5;
}
.approval-action {
  display: grid;
  gap: 4px;
  padding: 0.85rem 1rem;
  border-radius: 14px;
  background: rgba(16, 17, 13, 0.07);
  box-shadow: inset 0 0 0 1px var(--line-on-acid);
}
.approval-action small {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--eyebrow-on-acid);
}
.approval-action code {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
}
.approval-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 0.25rem;
}
.approval .pill-btn {
  background: var(--on-acid);
  color: var(--ink);
}
.approval .pill-btn.ghost {
  background: transparent;
  color: var(--on-acid);
  box-shadow: inset 0 0 0 1px var(--line-on-acid);
}
.approval .status {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  min-height: 1.2em;
}

/* ========== 05 tool chips ================================================= */
.tools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 2.4rem;
}
.tool {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.75rem 0.45rem 0.55rem;
  border-radius: 999px;
  background: var(--plate);
  box-shadow: 0 0 0 1px var(--hair);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.02em;
  opacity: 0;
  transform: translateY(8px);
  animation: chip-in var(--duration) var(--ease) forwards;
}
.tool i {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: var(--plate-recess);
  font-family: var(--font-mono);
  font-size: 9px;
  font-style: normal;
  letter-spacing: 0;
}
.tool .st {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
  font-weight: 500;
}
@keyframes chip-in {
  to { opacity: 1; transform: none; }
}

/* ========== 06 task rows ================================================== */
.tasks { display: grid; gap: 0; }
.task {
  display: grid;
  grid-template-columns: 18px 1fr auto;
  gap: 0.75rem;
  align-items: center;
  padding: 0.78rem 0.15rem;
  box-shadow: inset 0 -1px 0 var(--hair);
}
.task:last-child { box-shadow: none; }
.task .mark {
  width: 16px;
  height: 16px;
  border-radius: 5px;
  box-shadow: inset 0 0 0 1.5px var(--hair-strong);
  display: grid;
  place-items: center;
}
.task.is-done .mark {
  background: var(--ink-page);
  box-shadow: none;
}
.task.is-done .mark::after {
  content: "";
  width: 8px;
  height: 4px;
  border-left: 1.5px solid var(--ink);
  border-bottom: 1.5px solid var(--ink);
  transform: rotate(-45deg) translateY(-1px);
}
.task.is-run .mark {
  border-radius: 999px;
  box-shadow: inset 0 0 0 1.5px var(--ink-page);
  animation: spin 1.1s linear infinite;
  background:
    conic-gradient(from 90deg, var(--ink-page), transparent 70%);
  mask: radial-gradient(circle 5px, transparent 96%, #000);
}
.task .name {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.task .sub {
  display: block;
  margin-top: 2px;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 400;
}
.task .st {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

/* ========== 07 chat ======================================================= */
.chat {
  display: grid;
  gap: 0.7rem;
}
.bubble {
  max-width: 86%;
  padding: 0.75rem 0.95rem;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.5;
  letter-spacing: -0.02em;
}
.bubble small {
  display: block;
  margin-bottom: 0.3rem;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.bubble-user {
  justify-self: end;
  background: var(--ink-page);
  color: var(--ink);
  border-bottom-right-radius: 6px;
}
.bubble-user small { color: rgba(243, 242, 238, 0.55); }
.bubble-agent {
  justify-self: start;
  background: var(--plate);
  box-shadow: 0 0 0 1px var(--hair);
  border-bottom-left-radius: 6px;
}

/* ========== 08 prompt bar ================================================= */
.prompt {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.4rem 0.4rem 0.4rem 0.95rem;
  border-radius: 999px;
  background: var(--plate);
  box-shadow: 0 0 0 1px var(--hair), 0 10px 28px -18px rgba(var(--ambient), 0.18);
}
.prompt input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  padding: 0.55rem 0;
  font-size: 14px;
  outline: none;
}
.prompt input::placeholder { color: var(--ink-soft); }
.icon-btn {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--ink-page);
  display: grid;
  place-items: center;
  transition: transform var(--duration) var(--ease), background var(--duration) var(--ease);
}
.icon-btn:hover { background: var(--plate-recess); }
.icon-btn.send {
  background: var(--ink-page);
  color: var(--ink);
}
.icon-btn.send:hover { background: var(--ink-page); transform: translateY(-1px); }
.icon-btn svg { width: 15px; height: 15px; }

/* ========== 09 recommendation ============================================= */
.reco {
  display: grid;
  gap: 0.85rem;
  padding: 1rem 1.05rem 1.05rem;
  border-radius: 16px;
  background: var(--plate);
  box-shadow: 0 0 0 1px var(--hair);
}
.reco h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.035em;
}
.reco p { margin: 0; color: var(--ink-soft); font-size: 14px; line-height: 1.5; }
.meter {
  height: 4px;
  border-radius: 999px;
  background: var(--hair-strong);
  overflow: hidden;
}
.meter span {
  display: block;
  height: 100%;
  width: 78%;
  background: var(--ink-page);
  border-radius: inherit;
}
.reco-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.reco-conf {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

/* ========== 10 context cards ============================================== */
.ctx {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.7rem;
}
.ctx article {
  padding: 0.95rem 1rem;
  border-radius: 16px;
  background: var(--plate);
  box-shadow: 0 0 0 1px var(--hair);
  display: grid;
  gap: 0.45rem;
}
.ctx h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.03em;
}
.ctx p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.5;
}
.ctx footer {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-top: 0.25rem;
}

/* ========== 11–13 tables ================================================== */
.table-wrap { overflow: auto; border-radius: 14px; background: var(--plate); box-shadow: 0 0 0 1px var(--hair); }
table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
table.data th,
table.data td {
  padding: 0.7rem 0.85rem;
  text-align: left;
  border-bottom: 1px solid var(--hair);
  vertical-align: middle;
}
table.data th {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
table.data tr:last-child td { border-bottom: 0; }
table.data .was { color: var(--ink-soft); text-decoration: line-through; }
table.data .now { font-weight: 600; }
.diff-add { box-shadow: inset 3px 0 0 var(--ink-page); }
.diff-del td { color: var(--ink-soft); }

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 0.75rem;
}
.filters button {
  border: 0;
  border-radius: 999px;
  padding: 0.35rem 0.75rem;
  background: var(--plate);
  box-shadow: 0 0 0 1px var(--hair);
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-soft);
  transition: transform var(--duration) var(--ease), background var(--duration) var(--ease), color var(--duration) var(--ease);
}
.filters button[aria-pressed="true"] {
  background: var(--ink-page);
  color: var(--ink);
  box-shadow: none;
}

/* ========== 14 sidebar nav demo =========================================== */
.side-demo {
  display: grid;
  grid-template-columns: 198px minmax(0, 1fr);
  min-height: 220px;
  border-radius: 16px;
  overflow: hidden;
  background: var(--plate);
  box-shadow: 0 0 0 1px var(--hair);
}
.side-rail {
  padding: 0.85rem 0.7rem;
  background: var(--plate-recess);
  box-shadow: inset -1px 0 0 var(--hair);
  display: grid;
  align-content: start;
  gap: 2px;
}
.side-rail p {
  margin: 0 0.4rem 0.45rem;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.side-rail a,
.side-rail button {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
  padding: 0.45rem 0.55rem;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--ink-soft);
  transition: background var(--duration) var(--ease), color var(--duration) var(--ease), transform var(--duration) var(--ease);
}
.side-rail a.is-on,
.side-rail button.is-on {
  background: var(--plate);
  color: var(--ink-page);
  box-shadow: 0 0 0 1px var(--hair);
}
.side-rail a:hover,
.side-rail button:hover { color: var(--ink-page); }
.side-pane {
  padding: 1.15rem 1.2rem;
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.55;
}
.side-pane strong { color: var(--ink-page); }

/* ========== 15 search ===================================================== */
.search {
  display: grid;
  gap: 0.55rem;
}
.search-field {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.55rem 0.85rem;
  border-radius: 14px;
  background: var(--plate);
  box-shadow: 0 0 0 1px var(--hair);
}
.search-field svg { width: 15px; height: 15px; flex: none; color: var(--ink-soft); }
.search-field input {
  flex: 1;
  border: 0;
  background: transparent;
  outline: none;
  font-size: 14px;
  padding: 0.25rem 0;
}
.search-field kbd {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  padding: 0.18rem 0.4rem;
  border-radius: 6px;
  background: var(--plate-recess);
  color: var(--ink-soft);
  box-shadow: 0 0 0 1px var(--hair);
}
.search-results {
  list-style: none;
  margin: 0;
  padding: 0.25rem;
  border-radius: 14px;
  background: var(--plate);
  box-shadow: 0 0 0 1px var(--hair);
}
.search-results li button,
.search-results li {
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
  padding: 0.6rem 0.7rem;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.search-results li button:hover,
.search-results li.is-hit {
  background: var(--plate-recess);
}
.search-results .hint {
  display: block;
  margin-top: 2px;
  font-weight: 400;
  color: var(--ink-soft);
  font-size: 12px;
}
.search-empty {
  padding: 0.9rem;
  text-align: center;
  color: var(--ink-soft);
  font-size: 13px;
}

/* ========== 16 insights =================================================== */
.insights {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.7rem;
}
.insight {
  padding: 1rem 1.05rem 1.05rem;
  border-radius: 16px;
  background: var(--plate);
  box-shadow: 0 0 0 1px var(--hair);
  display: grid;
  gap: 0.35rem;
}
.insight small {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.insight strong {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.06em;
  line-height: 1;
}
.insight span {
  color: var(--ink-soft);
  font-size: 12px;
}

/* ========== 17 code ======================================================= */
.code {
  border-radius: 16px;
  overflow: hidden;
  background: var(--plate);
  box-shadow: 0 0 0 1px var(--hair);
}
.code-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.55rem 0.75rem;
  box-shadow: inset 0 -1px 0 var(--hair);
}
.code-bar span {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.code-bar button {
  border: 0;
  background: transparent;
  border-radius: 999px;
  padding: 0.3rem 0.7rem;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-page);
}
.code-bar button:hover { background: var(--plate-recess); }
.code pre {
  margin: 0;
  padding: 1rem 1.1rem 1.15rem;
  overflow: auto;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.65;
  color: var(--ink-page);
}
.code .kw { font-weight: 500; }
.code .cm { color: var(--ink-soft); }

/* ========== 18 fine-tune ================================================== */
.tune {
  display: grid;
  gap: 1rem;
  padding: 0.2rem 0.15rem;
}
.tune label {
  display: grid;
  gap: 0.4rem;
}
.tune .row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.tune .row span {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  color: var(--ink-soft);
}
.tune input[type="range"] {
  width: 100%;
  appearance: none;
  height: 4px;
  border-radius: 999px;
  background: var(--hair-strong);
  outline: none;
}
.tune input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 999px;
  background: var(--ink-page);
  box-shadow: 0 4px 10px -4px rgba(var(--ambient), 0.4);
  cursor: pointer;
}

/* ========== 19 selection ================================================== */
.sel-bar {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
  margin-bottom: 0.7rem;
  padding: 0.45rem 0.55rem 0.45rem 0.9rem;
  border-radius: 999px;
  background: var(--ink-page);
  color: var(--ink);
  min-height: 44px;
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity var(--duration) var(--ease), transform var(--duration) var(--ease);
}
.sel-bar.is-on {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}
.sel-bar strong {
  font-size: 13px;
  font-weight: 600;
  margin-right: auto;
}
.sel-bar button {
  border: 0;
  border-radius: 999px;
  padding: 0.4rem 0.8rem;
  background: rgba(216, 255, 62, 0.14);
  color: var(--acid);
  font-size: 12px;
  font-weight: 600;
  transition: transform var(--duration) var(--ease);
}
.sel-bar button:hover { transform: translateY(-1px); }
.sel-bar button.quiet {
  background: transparent;
  color: var(--ink);
}
table.data input[type="checkbox"] {
  width: 14px;
  height: 14px;
  accent-color: var(--ink-page);
}

/* ========== 20 flowchart ================================================== */
.flow {
  position: relative;
  padding: 0.6rem 0.2rem 0.4rem;
}
.flow svg { width: 100%; height: auto; display: block; }
.flow-node {
  fill: var(--plate);
  stroke: rgba(22, 23, 28, 0.1);
  stroke-width: 1;
}
.flow g.is-now .flow-node {
  fill: var(--ink-page);
}
.flow-label {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  fill: var(--ink-page);
}
.flow-node.is-now + .flow-label,
.flow g.is-now .flow-label { fill: var(--ink); }
.flow-kicker {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  fill: var(--ink-soft);
}
.flow-edge {
  stroke: rgba(22, 23, 28, 0.18);
  stroke-width: 1.25;
  fill: none;
}
.flow g.is-now .flow-kicker { fill: rgba(243, 242, 238, 0.55); }

@media (prefers-reduced-motion: reduce) {
  .loading-dots span,
  .loading-orbit::after,
  .loading-grid i,
  .task.is-run .mark,
  .stream .caret,
  .think .pulse { animation: none; }
  .tool { animation: none; opacity: 1; transform: none; }
  .sel-bar { transition: none; }
}

@media (max-width: 767px) {
  .ctx,
  .insights,
  .side-demo { grid-template-columns: 1fr; }
  .side-rail { box-shadow: inset 0 -1px 0 var(--hair); }
  .bubble { max-width: 94%; }
  .reco-conf { margin-left: 0; }
}
