/* Mosaics: the New mosaic page, the open mosaic's map in the sidebar, and
 * the cards a mosaic puts in its talk (js/mosaics.js).
 *
 * The same room as Chat: its capsule, its chips, its type. Tiles are the one
 * ornament, and they mean progress: a gold tile is something you said is
 * done, an amber one is where you are, an outlined one is still to come.
 */

/* Small tiles, set on their points. */
.mz-tiles { display: inline-flex; align-items: center; gap: 3px; flex: none; }
.mz-tiles .tile { width: 7px; height: 7px; border-radius: 1.5px; transform: rotate(45deg); }

/* ==== the New mosaic page =============================================== */
.mz-new {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  scrollbar-gutter: stable;
  display: flex;
}
.mz-new-inner {
  width: min(760px, 100%);
  margin: auto;
  padding: 48px 32px 64px;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.mz-hero { display: flex; flex-direction: column; align-items: center; text-align: center; }
/* The mark: four tiles setting into a diamond, once, as the page arrives. */
.mz-mark {
  display: grid;
  grid-template-columns: repeat(2, 13px);
  gap: 3px;
  margin-bottom: 22px;
  transform: rotate(45deg);
}
.mz-mark .tile {
  width: 13px;
  height: 13px;
  border-radius: 3px;
  animation: mz-tile-in 520ms var(--ease-spring) both;
  animation-delay: calc(60ms + var(--i, 0) * 70ms);
}
@keyframes mz-tile-in {
  from { opacity: 0; transform: translateY(-8px) scale(0.5); }
  to { opacity: 1; transform: none; }
}
.mz-hero h1 {
  margin: 0 0 10px;
  font-family: var(--display);
  font-size: clamp(28px, 3.2vw, 40px);
  font-weight: 480;
  letter-spacing: -0.02em;
  line-height: 1.12;
  color: var(--text);
  font-variation-settings: "SOFT" 50, "WONK" 0;
  animation: rise-in 520ms var(--ease-out) 80ms both;
}
.mz-hero p {
  margin: 0;
  max-width: 54ch;
  color: var(--text2);
  font-size: 15.5px;
  line-height: 1.55;
  animation: rise-in 520ms var(--ease-out) 140ms both;
}

/* Chat's capsule, with the place its files go where the model would be. */
.mz-capsule {
  position: relative;
  width: 100%;
  margin-top: 30px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 12px 9px 16px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-xl);
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  box-shadow: 0 1px 2px var(--shadow-soft), 0 10px 32px -10px var(--shadow-cast);
  cursor: text;
  animation: rise-in 520ms var(--ease-out) 200ms both;
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease), opacity var(--dur) var(--ease);
}
html.light .mz-capsule { border-color: var(--border); }
.mz-capsule:focus-within {
  border-color: color-mix(in srgb, var(--border-strong) 55%, var(--text3));
  box-shadow: 0 1px 2px var(--shadow-soft), 0 14px 40px -12px var(--shadow-cast);
}
.mz-capsule .line { display: flex; }
.mz-field {
  flex: 1;
  min-width: 0;
  min-height: 30px;
  max-height: 200px;
  margin: 0;
  padding: 4px 0 6px;
  border: 0;
  outline: 0;
  resize: none;
  background: transparent;
  color: var(--text);
  font-family: var(--font-sans, var(--ui));
  font-size: 17px;
  line-height: 1.45;
  overflow-y: auto;
}
.mz-field::placeholder { color: var(--text3); }
.mz-capsule .tools { display: flex; align-items: center; gap: 2px; margin-left: -6px; cursor: default; }
.mz-capsule .tools .grow { flex: 1; min-width: 8px; }
.mz-place { max-width: 70%; }
.mz-held { display: flex; flex-wrap: wrap; gap: 6px; }
.mz-held[hidden] { display: none; }
.mz-file {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  height: 28px;
  padding: 0 2px 0 9px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--card);
  font-size: var(--chrome);
}
.mz-file > .icon { width: 14px; height: 14px; color: var(--text3); flex: none; }
.mz-file .name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mz-file .x { display: inline-grid; place-items: center; width: 22px; height: 22px; border: 0; border-radius: 6px;
  background: transparent; color: var(--text3); cursor: pointer; }
.mz-file .x:hover { color: var(--text); background: var(--card-hover); }
.mz-file .x .icon { width: 12px; height: 12px; }
.mz-place .label { color: var(--text2); }
.mz-place.active .label { color: inherit; }
.mz-capsule.starting { opacity: 0.85; }
.mz-capsule.starting .mz-field { color: var(--text2); }
.mz-capsule .send .star-loader { width: 16px; height: 16px; }

.mz-examples {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 22px;
}
/* Chat's chips. */
.mz-examples .chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 34px;
  padding: 0 13px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font-size: var(--ui-size);
  box-shadow: 0 1px 1px var(--shadow-soft);
  animation: rise-in 480ms var(--ease-out) both;
  transition: background var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease),
    transform var(--dur) var(--ease-spring), box-shadow var(--dur) var(--ease);
}
.mz-examples .chip .icon { width: 15px; height: 15px; color: var(--text2); }
.mz-examples .chip:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
  box-shadow: 0 8px 18px -10px var(--shadow-cast);
}
.mz-examples .chip:active { transform: translateY(0) scale(0.98); }

/* How a mosaic goes, said once, on the first one. */
.mz-how {
  display: flex;
  justify-content: center;
  gap: 28px;
  margin: 44px 0 0;
  padding: 0;
  list-style: none;
  animation: fade-in 600ms var(--ease) 420ms both;
}
.mz-how[hidden] { display: none; }
.mz-how li {
  position: relative;
  display: grid;
  grid-template-columns: auto;
  justify-items: center;
  gap: 3px;
  max-width: 170px;
  text-align: center;
}
.mz-how li + li::before {
  content: "";
  position: absolute;
  top: 6px;
  left: -21px;
  width: 14px;
  height: 1px;
  background: var(--border-strong);
}
.mz-how .mz-tiles { height: 14px; margin-bottom: 4px; }
.mz-how b { font-size: 12.5px; font-weight: 600; color: var(--text2); }
.mz-how span:not(.tile):not(.mz-tiles) { font-size: 12px; color: var(--text3); line-height: 1.4; }

/* ==== the map, in the sidebar ============================================ */
/* The list of mosaics and the open one's map share one place: one slides
   out as the other slides in. Hidden only once it has faded. */
.side-panes > .side-map,
.side-panes.mapped > .side-scroll {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 200ms var(--ease), transform var(--dur-slow) var(--ease-out), visibility 0s linear var(--dur-slow);
}
.side-panes > .side-map { transform: translateX(28px); }
.side-panes.mapped > .side-scroll { transform: translateX(-28px); }
.side-panes > .side-scroll,
.side-panes.mapped > .side-map {
  opacity: 1;
  visibility: visible;
  transform: none;
  pointer-events: auto;
  transition: opacity var(--dur-slow) var(--ease-out), transform var(--dur-slow) var(--ease-out), visibility 0s linear 0s;
}

.side-map { display: flex; flex-direction: column; min-width: 0; }
.map-scroll {
  flex: 1;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 0 4px 18px 10px;
  scrollbar-gutter: stable;
  /* Words fade out above the foot, as the list's do above the strip. */
  -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 20px), transparent);
  mask-image: linear-gradient(to bottom, #000 calc(100% - 20px), transparent);
}
.map-scroll::-webkit-scrollbar { width: 8px; }

.map-back {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 26px;
  margin: 2px 0 4px;
  padding: 0 9px 0 5px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text3);
  font-size: 12.5px;
  font-weight: 550;
  transition: color var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease);
}
.map-back .icon { width: 14px; height: 14px; transition: transform var(--dur) var(--ease-out); }
.map-back:hover { color: var(--text); background: var(--surface-hover); }
.map-back:hover .icon { transform: translateX(-2px); }

.map-goal {
  display: flex;
  flex-direction: column;
  gap: 5px;
  width: 100%;
  padding: 8px 10px 10px;
  border: 0;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--text);
  text-align: left;
  transition: background var(--dur-fast) var(--ease);
}
.map-goal:hover { background: var(--surface-hover); }
html.light .map-goal:hover { background: color-mix(in srgb, var(--text) 5%, transparent); }
.map-goal .kicker,
.map-now .kicker {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 10.5px;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text3);
}
.map-goal .text {
  display: -webkit-box;
  -webkit-line-clamp: 5;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-family: var(--display);
  font-size: 16.5px;
  font-weight: 480;
  line-height: 1.32;
  letter-spacing: -0.01em;
  font-variation-settings: "SOFT" 50, "WONK" 0;
}
.map-goal.missing .text { font-family: var(--ui); font-size: 13px; line-height: 1.45; color: var(--text3); letter-spacing: 0; }

.map-section {
  display: flex;
  align-items: center;
  gap: 7px;
  height: 32px;
  padding: 12px 10px 2px;
  color: var(--text3);
  font-size: 12px;
  font-weight: 600;
}
.map-section[hidden] { display: none; }
.map-section .count { font-weight: 500; font-variant-numeric: tabular-nums; }
.map-track { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.map-track .cell {
  width: 7px;
  height: 7px;
  border-radius: 1.5px;
  transform: rotate(45deg);
  box-shadow: inset 0 0 0 1px var(--border-strong);
  transition: background var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.map-track .cell.done { background: var(--tile-gold); box-shadow: none; }
.map-track .cell.current { box-shadow: inset 0 0 0 1.5px var(--accent); }

.map-milestones,
.ms-steps { position: relative; list-style: none; margin: 0; padding: 0; }
.ms { position: relative; }
:is(.ms, .st).leaving { position: absolute; left: 0; pointer-events: none; }

.ms-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-height: 34px;
  padding: 7px 4px 7px 10px;
  border-radius: var(--radius-sm);
  cursor: default;
  transition: background var(--dur-fast) var(--ease);
}
.ms-row:hover { background: var(--surface-hover); }
html.light .ms-row:hover { background: color-mix(in srgb, var(--text) 6%, transparent); }
.ms-row:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.ms-mark { display: grid; place-items: center; width: 16px; height: 20px; flex: none; }
.ms-tile {
  display: grid;
  place-items: center;
  width: 11px;
  height: 11px;
  border-radius: 2.5px;
  transform: rotate(45deg);
  box-shadow: inset 0 0 0 1.5px var(--border-strong);
  transition: background var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.ms-tile .icon { width: 8px; height: 8px; transform: rotate(-45deg); color: var(--accent-text); opacity: 0; transition: opacity var(--dur) var(--ease); }
.ms-tile .icon svg { stroke-width: 3.4; }
.ms.done .ms-tile { background: var(--tile-gold); box-shadow: none; }
.ms.done .ms-tile .icon { opacity: 1; }
.ms.current .ms-tile {
  background: color-mix(in srgb, var(--accent) 24%, transparent);
  box-shadow: inset 0 0 0 2px var(--accent);
}
.ms-title {
  flex: 1;
  min-width: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  overflow-wrap: anywhere;
  font-size: var(--ui-size);
  line-height: 20px;
}
.ms.current .ms-title { font-weight: 600; }
.ms.done .ms-title { color: var(--text2); }
.ms-count {
  flex: none;
  line-height: 20px;
  font-size: 11.5px;
  color: var(--text3);
  font-variant-numeric: tabular-nums;
}
.ms-count:empty { display: none; }
:is(.ms-row, .st) .more {
  flex: none;
  width: 22px;
  height: 22px;
  margin: -1px 0 -1px -4px;
  opacity: 0;
  color: var(--text2);
  transition: opacity var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease);
}
:is(.ms-row, .st) .more .icon { width: 14px; height: 14px; }
:is(.ms-row, .st):is(:hover, :focus-within) .more, :is(.ms-row, .st) .more.open { opacity: 1; }
.ms-row:hover .ms-count, .ms-row:focus-within .ms-count { display: none; }
:is(.ms-row, .st) .more:hover { background: var(--surface-pressed); }

.ms-body { padding: 0 0 8px; }
.ms-body[hidden] { display: none; }
/* The steps hang from their milestone's tile on a thread. */
.ms-steps { margin-left: 17px; padding-left: 3px; border-left: 1px solid var(--border); }
.ms.current .ms-steps { border-left-color: color-mix(in srgb, var(--accent) 40%, var(--border)); }
.ms-steps.empty { display: none; }
.st {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 1px 0;
  padding: 5px 4px 5px 5px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  line-height: 18px;
  transition: background var(--dur-fast) var(--ease);
}
.st:hover { background: var(--surface-hover); }
html.light .st:hover { background: color-mix(in srgb, var(--text) 6%, transparent); }
.st.current { background: var(--accent-wash); }
html.light .st.current { background: var(--accent-wash); }
.st-check {
  display: grid;
  place-items: center;
  width: 16px;
  height: 16px;
  margin-top: 1px;
  padding: 0;
  flex: none;
  border: 1.5px solid var(--border-strong);
  border-radius: 50%;
  background: transparent;
  color: transparent;
  transition: background var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}
.st-check .icon { width: 10px; height: 10px; }
.st-check .icon svg { stroke-width: 3.2; }
.st-check:hover { border-color: var(--accent); color: color-mix(in srgb, var(--accent) 75%, transparent); }
.st-check:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.st.current .st-check { border-color: var(--accent); }
.st.done .st-check { background: var(--tile-gold); border-color: var(--tile-gold); color: var(--accent-text); }
.st.done .st-check:hover { filter: brightness(1.05); }
.st-title { flex: 1; min-width: 0; overflow-wrap: anywhere; color: var(--text); transition: color var(--dur) var(--ease); }
.st.current .st-title { font-weight: 550; }
.st.done .st-title { color: var(--text3); }

/* + Add a step, + Add a milestone, and the fields they become. */
.mz-add {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  height: 28px;
  padding: 0 8px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text3);
  font-size: 12.5px;
  text-align: left;
  transition: color var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease);
}
.mz-add .icon { width: 13px; height: 13px; flex: none; }
.mz-add:hover { color: var(--text); background: var(--surface-hover); }
.mz-add[hidden] { display: none; }
.ms-body .mz-adder { padding-left: 22px; }
.ms-body .mz-add { gap: 10px; padding-left: 5px; }
.map-milestones + .mz-adder { margin-top: 2px; }
.mz-add-field {
  width: 100%;
  height: 28px;
  padding: 0 8px;
  border: 1px solid color-mix(in srgb, var(--accent) 55%, var(--border-strong));
  border-radius: var(--radius-sm);
  outline: 0;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 16%, transparent);
}
.mz-add-field::placeholder { color: var(--text3); }
:is(.ms-row, .st) .inline-rename { flex: 1; min-width: 0; margin: -2px 0; }

.map-empty {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 14px 4px 0;
  padding: 12px 12px 13px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-md);
  color: var(--text3);
  font-size: 12.5px;
  line-height: 1.45;
}
.map-empty[hidden] { display: none; }
.map-empty b { color: var(--text2); font-weight: 600; }

/* The one thing to do next, always in reach. */
.map-foot {
  flex: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 12px 8px;
  border-top: 1px solid var(--border);
}
.map-now { display: flex; flex-direction: column; gap: 3px; padding: 0 2px; }
.map-now .kicker .tile { width: 7px; height: 7px; border-radius: 1.5px; transform: rotate(45deg); }
.map-now .text {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 13px;
  line-height: 1.4;
  color: var(--text);
}
.map-now .text:empty { display: none; }
.map-now.finished .text { font-family: var(--display); font-size: 15px; }
.map-next { height: 34px; gap: 8px; border-radius: 10px; }
.map-next[hidden] { display: none; }
.map-next .icon { width: 15px; height: 15px; }
.map-page {
  display: flex;
  align-items: center;
  gap: 7px;
  height: 26px;
  margin: 0 -4px;
  padding: 0 6px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text3);
  font-size: 12px;
  text-align: left;
  transition: color var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease);
}
.map-page .icon { width: 14px; height: 14px; }
.map-page:hover { color: var(--text); background: var(--surface-hover); }

/* ==== in the talk ======================================================== */
/* Milestones or a rough plan to shape: every line can be edited. */
#view-agent .mcard {
  margin: 14px 0 6px;
  padding: 14px 16px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--card);
  box-shadow: 0 1px 2px var(--shadow-soft), 0 14px 30px -20px var(--shadow-cast);
  animation: rise-in 420ms var(--ease-out) both;
  transition: background var(--dur) var(--ease), box-shadow var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
#view-agent :is(.mcard, .mmark, .mitem).quiet { animation: none; }
.mcard-top { display: flex; align-items: center; gap: 8px; min-height: 22px; }
.mcard-top .kicker {
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text2);
}
.mcard-top .for {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12.5px;
  color: var(--text3);
}
.mcard-top .for::before { content: "·"; margin-right: 8px; }
.mcard-top .verdict {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-left: auto;
  flex: none;
  font-size: 12px;
  color: var(--text3);
}
.mcard-top .verdict .icon { width: 13px; height: 13px; }
.mcard.accepted .verdict { color: var(--accent-ink); }
.mcard-note { margin: 8px 0 0; color: var(--text2); font-size: 14px; line-height: 1.55; }
.mcard-goal {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin: 12px 0 2px;
  padding: 8px 12px 6px;
  border-radius: var(--radius-md);
  background: var(--surface);
}
.mcard-goal .label { font-size: 11.5px; font-weight: 600; color: var(--text3); }
.mcard-goal-field {
  width: 100%;
  min-height: 26px;
  margin: 0;
  padding: 0;
  border: 0;
  outline: 0;
  resize: none;
  overflow: hidden;
  background: transparent;
  color: var(--text);
  font-family: var(--display);
  font-size: 16.5px;
  line-height: 1.4;
  font-variation-settings: "SOFT" 50, "WONK" 0;
}
.mcard-goal.plain { flex-direction: row; align-items: baseline; gap: 8px; padding: 0; margin: 8px 0 0; background: transparent; font-size: 13.5px; color: var(--text2); }
.mcard-done { display: flex; align-items: flex-start; gap: 7px; margin: 10px 0 0; font-size: 12.5px; line-height: 1.45; color: var(--text3); }
.mcard-done .icon { width: 13px; height: 13px; margin-top: 2px; color: var(--tile-gold); flex: none; }

.mcard-items { position: relative; counter-reset: mitem; list-style: none; margin: 10px 0 2px; padding: 0; }
.mitem {
  position: relative;
  counter-increment: mitem;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 2px 4px 2px 2px;
  border-radius: var(--radius-sm);
  animation: rise-in 380ms var(--ease-out) both;
  animation-delay: calc(120ms + var(--i, 0) * 45ms);
  transition: background var(--dur-fast) var(--ease);
}
.mitem:not(.plain):hover, .mitem:not(.plain):focus-within { background: var(--surface-hover); }
html.light .mitem:not(.plain):is(:hover, :focus-within) { background: color-mix(in srgb, var(--text) 5%, transparent); }
.mitem.leaving { position: absolute; left: 0; pointer-events: none; }
.mitem-mark { position: relative; display: grid; place-items: center; flex: none; }
/* A milestone carries its number on an outlined tile. */
.mcard.milestones .mitem-mark { width: 24px; height: 28px; font-size: 11px; font-weight: 650; color: var(--text2); font-variant-numeric: tabular-nums; }
.mcard.milestones .mitem-mark::before {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  border-radius: 3.5px;
  transform: rotate(45deg);
  box-shadow: inset 0 0 0 1.5px var(--border-strong);
  background: var(--card);
}
.mcard.milestones .mitem-mark::after { content: counter(mitem); position: relative; }
.mcard.milestones.accepted .mitem-mark::before { box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--accent) 60%, var(--border-strong)); }
/* A step, the round mark it will be checked off with. */
.mcard.steps .mitem-mark { width: 24px; height: 28px; }
.mcard.steps .mitem-mark::before {
  content: "";
  width: 13px;
  height: 13px;
  border: 1.5px solid var(--border-strong);
  border-radius: 50%;
}
.mitem-text {
  flex: 1;
  min-width: 0;
  min-height: 28px;
  margin: 0;
  padding: 4px 0;
  border: 0;
  outline: 0;
  resize: none;
  overflow: hidden;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 14.5px;
  line-height: 20px;
}
.mitem-text::placeholder { color: var(--text3); }
.mitem-words { flex: 1; min-width: 0; padding: 4px 0; font-size: 14.5px; line-height: 20px; color: var(--text); }
.mcard.dismissed .mitem-words, .mcard.revised .mitem-words { color: var(--text2); }
.mitem-x {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  margin-top: 2px;
  padding: 0;
  flex: none;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text3);
  opacity: 0;
  transition: opacity var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}
.mitem-x .icon { width: 14px; height: 14px; }
.mitem:is(:hover, :focus-within) .mitem-x { opacity: 1; }
.mitem-x:hover { background: var(--surface-pressed); color: var(--text); }
.mcard-items.single .mitem-x { visibility: hidden; }
.mcard-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin: 2px 0 0 4px; }
.mcard-add { width: auto; }
.mcard-hint {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  margin-left: auto;
  padding-right: 6px;
  font-size: 11.5px;
  color: var(--text3);
  opacity: 0;
  transition: opacity var(--dur) var(--ease);
}
.mcard-hint kbd { height: 18px; padding: 0 5px; font-size: 10.5px; }
.mcard-hint kbd + span { margin-right: 6px; }
.mcard:focus-within .mcard-hint { opacity: 1; }
.mcard-actions,
.mcard-revise {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.mcard-actions[hidden], .mcard-revise[hidden] { display: none; }
.mcard-actions .grow, .mcard-revise .grow { flex: 1; }
.mcard-actions .aside { color: var(--text3); }
.mcard-revise { flex-direction: column; align-items: stretch; gap: 8px; }
.mcard-revise .row { display: flex; align-items: center; gap: 6px; }
.mcard-revise-field {
  width: 100%;
  min-height: 62px;
  padding: 8px 10px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  outline: 0;
  resize: vertical;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 14px;
  line-height: 1.5;
  transition: border-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
}
.mcard-revise-field:focus {
  border-color: color-mix(in srgb, var(--accent) 55%, var(--border-strong));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 16%, transparent);
}
/* Answered: what was agreed, as plain words, without the card's weight. */
#view-agent .mcard.resolved { padding: 10px 14px 10px; background: transparent; box-shadow: none; }
#view-agent .mcard.resolved .mitem { animation: none; padding: 0 2px; }
.mcard.folded > :not(.mcard-top) { display: none; }
.mcard.dismissed .mcard-top { cursor: pointer; }
.mcard.dismissed .mcard-top:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 4px; }

/* Questions to answer with a tap, or in the person's own words. */
.mq { margin-top: 12px; }
.mq-q { margin: 0; font-size: 14.5px; line-height: 1.5; color: var(--text); }
.mq-options { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.mq-option {
  min-height: 30px;
  padding: 4px 12px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 13.5px;
  line-height: 1.4;
  text-align: left;
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}
.mq-option:hover { background: var(--surface-hover); }
.mq-option:active { transform: scale(0.97); }
.mq-option:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.mq-option[aria-checked="true"] {
  border-color: color-mix(in srgb, var(--accent) 60%, var(--border-strong));
  background: var(--accent-wash);
  color: var(--accent-ink);
}
.mq-own {
  display: block;
  width: 100%;
  margin-top: 8px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  outline: 0;
  resize: none;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 14px;
  line-height: 1.5;
  transition: border-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
}
.mq-own:focus {
  border-color: color-mix(in srgb, var(--accent) 55%, var(--border-strong));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 16%, transparent);
}
.mq-a { margin: 4px 0 0; padding-left: 10px; border-left: 2px solid color-mix(in srgb, var(--accent) 45%, transparent); font-size: 14px; line-height: 1.5; color: var(--text2); }
.mcard.question.answered .verdict { color: var(--accent-ink); }
.mcard.question.resolved .mq { margin-top: 8px; }

/* A decision to check: the decision, what it rested on and what changed, on the goal panel's look. */
.mdec { margin: 10px 0 2px; padding: 8px 12px; border-radius: var(--radius-md); background: var(--surface); }
.mdec-decision { margin: 0; font-size: 14.5px; line-height: 1.5; color: var(--text); }
.mdec-when { margin-left: 8px; font-size: 12px; color: var(--text3); }
.mdec-why { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; margin: 6px 0 0; font-size: 13.5px; line-height: 1.5; }
.mdec-why dt { color: var(--text3); }
.mdec-why dd { margin: 0; color: var(--text2); }
/* Kept: the reason that changed no longer holds the decision up. */
.mcard.keystone.kept .mdec-why dd:first-of-type { text-decoration: line-through; color: var(--text3); }

/* The person said something is done: a line across the talk. */
#view-agent .mmark {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 16px 0 12px;
  color: var(--text3);
  font-size: 12.5px;
  animation: rise-in 360ms var(--ease-out) both;
}
.mmark .rule { flex: 1; min-width: 16px; height: 1px; background: var(--border); }
.mmark .words { max-width: 80%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mmark .words b { font-weight: 600; color: var(--text2); }
.mmark .tick {
  display: inline-grid;
  place-items: center;
  width: 16px;
  height: 16px;
  margin-right: 8px;
  vertical-align: -3px;
  border-radius: 50%;
  background: var(--tile-gold);
  color: var(--accent-text);
}
.mmark .tick .icon { width: 10px; height: 10px; }
.mmark .tick .icon svg { stroke-width: 3.2; }
/* A milestone done is a bigger moment: its tiles drop into place. */
#view-agent .mmark.milestone { flex-direction: column; gap: 6px; margin: 26px 0 18px; text-align: center; }
.mmark.milestone .mz-tiles { gap: 5px; margin-bottom: 4px; }
.mmark.milestone .mz-tiles .tile { width: 10px; height: 10px; animation: mz-set 560ms var(--ease-spring) both; }
.mmark.milestone .mz-tiles .tile:nth-child(2) { animation-delay: 70ms; }
.mmark.milestone .mz-tiles .tile:nth-child(3) { animation-delay: 140ms; }
.mmark.milestone .mz-tiles .tile:nth-child(4) { animation-delay: 210ms; }
.mmark.milestone .mz-tiles .tile:nth-child(5) { animation-delay: 280ms; }
.mmark.milestone.quiet .mz-tiles .tile { animation: none; }
@keyframes mz-set {
  from { opacity: 0; transform: translateY(-12px) rotate(0deg) scale(0.5); }
  to { opacity: 1; transform: rotate(45deg); }
}
.mmark.milestone .kicker {
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-ink);
}
.mmark.milestone .title {
  max-width: 90%;
  font-family: var(--display);
  font-size: 21px;
  font-weight: 480;
  line-height: 1.25;
  color: var(--text);
  font-variation-settings: "SOFT" 50, "WONK" 0;
}

/* Where you are: what happened since you were last here, and what is next. */
#view-agent .recap {
  margin: 18px 0 8px;
  padding: 14px 16px 15px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--card);
  box-shadow: 0 1px 2px var(--shadow-soft), 0 14px 30px -20px var(--shadow-cast);
  animation: rise-in 480ms var(--ease-out) 160ms both;
}
.recap-top { display: flex; align-items: center; gap: 10px; min-height: 24px; }
.recap-top .kicker {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text2);
}
.recap-top .kicker .tile { width: 7px; height: 7px; border-radius: 1.5px; transform: rotate(45deg); }
.recap-top .away { font-size: 12px; color: var(--text3); }
.recap-close { margin-left: auto; margin-right: -6px; color: var(--text3); }
.recap-track { display: flex; gap: 4px; margin: 12px 0 11px; }
.recap-track .cell {
  flex: 1;
  max-width: 64px;
  height: 6px;
  border-radius: 2px;
  background: var(--surface-pressed);
  transform-origin: left center;
  animation: recap-cell 520ms var(--ease-out) both;
  animation-delay: calc(240ms + var(--i, 0) * 60ms);
}
.recap-track .cell.done { background: var(--tile-gold); }
.recap-track .cell.current { overflow: hidden; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 55%, transparent); }
.recap-track .cell .fill {
  display: block;
  height: 100%;
  background: var(--accent);
  transform-origin: left center;
  transform: scaleX(var(--share, 0));
  animation: recap-fill 700ms var(--ease-out) both;
  animation-delay: calc(520ms + var(--i, 0) * 60ms);
}
@keyframes recap-cell { from { opacity: 0; transform: scaleX(0.3); } to { opacity: 1; transform: none; } }
@keyframes recap-fill { from { transform: scaleX(0); } }
.recap-headline {
  font-family: var(--display);
  font-size: 19px;
  font-weight: 480;
  line-height: 1.3;
  color: var(--text);
  font-variation-settings: "SOFT" 50, "WONK" 0;
}
.recap-steps { margin-top: 3px; font-size: 12.5px; color: var(--text3); }
.recap-since { margin: 10px 0 0; padding: 0 0 0 18px; color: var(--text2); font-size: 14px; line-height: 1.55; }
.recap-since li::marker { color: var(--text3); }
.recap-next { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 14px; }
.recap-next .btn { gap: 7px; }
.recap-what { min-width: 0; font-size: 13px; color: var(--text3); }
.recap-what b { font-weight: 600; color: var(--text2); }

/* ==== a mosaic in the list =============================================== */
.row.mosaic { height: 34px; }
.row.mosaic .mosaic-mark {
  display: grid;
  grid-template-columns: repeat(2, 6px);
  grid-template-rows: repeat(2, 6px);
  gap: 1.5px;
  width: 14px;
  height: 14px;
  margin-right: 10px;
  flex: none;
  place-content: center;
  transform: rotate(45deg);
  transition: transform var(--dur) var(--ease-spring), opacity var(--dur) var(--ease);
}
.row.mosaic .mosaic-mark span { border-radius: 1.5px; }
.row.mosaic:hover .mosaic-mark, .row.mosaic.selected .mosaic-mark { transform: rotate(135deg); }
.row.mosaic.archived { color: var(--text2); }
.row.mosaic.archived .mosaic-mark { opacity: 0.4; filter: grayscale(0.6); }

.reduced-motion .side-panes > * { transition: none; }

/* ---- Settings › Mosaics -------------------------------------------------------- */
.mz-folder-row { display: flex; align-items: center; gap: 8px; min-width: 0; }
.mz-folder-row .field { flex: 1; min-width: 0; font-family: var(--font-mono); font-size: 12.5px; }
.mz-folder-row .btn { flex: none; }
