/* Phone first, big targets, high contrast: mum uses this one-handed while holding a box. */

/* Space Grotesk, for headings and box numbers: SIL Open Font License 1.1 (fonts/OFL-SpaceGrotesk.txt),
   latin subset (covers á é í ó ú ñ ¿ ¡), weights 500 to 700 in one variable file. */
@font-face {
  font-family: "Space Grotesk";
  src: url("/fonts/space-grotesk-latin.woff2") format("woff2");
  font-weight: 500 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #fff;
  --card: #f1f3f2;
  --wool: #f6f0e7;
  --display: "Space Grotesk", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --body: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --ink: #17201c;
  --muted: #59625e;
  --line: #e2e6e3;
  --field: #c9d2cc;
  --chip: #e1e7e2;
  --teal: #0c5a62;
  --gold: #e3b23c;
  --hl: #ffdf85;
  --red: #b42318;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 17px/1.4 var(--body);
  -webkit-tap-highlight-color: transparent;
}
body.busy { cursor: progress; }
#app {
  max-width: 560px;
  margin: 0 auto;
  padding: calc(14px + env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px))
    calc(48px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
}
h1, h2 { margin: 0 0 8px; font-family: var(--display); font-weight: 700; line-height: 1.2; letter-spacing: -0.01em; text-wrap: balance; }
h2 { font-size: 21px; }
a { color: var(--teal); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--teal); outline-offset: 2px; }
[hidden] { display: none !important; }

.muted { color: var(--muted); }
.small { font-size: 14px; }
.center { text-align: center; }
.grow { flex: 1; min-width: 0; }

.top { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.logo { margin: 0; font-family: var(--display); font-size: 25px; font-weight: 700; letter-spacing: -0.02em; color: var(--ink); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ic { flex: none; width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.iconbtn { flex: none; display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; background: var(--card); color: var(--ink); }
.iconbtn.dark { background: var(--ink); color: #fff; }
.iconbtn .ic { stroke-width: 2.4; }
.search { display: flex; align-items: center; gap: 10px; height: 52px; margin-bottom: 16px; padding: 0 16px; border-radius: 16px; background: var(--card); color: var(--muted); }
.search:focus-within { box-shadow: 0 0 0 3px var(--teal); }
.search input { flex: 1; min-width: 0; height: 100%; padding: 0; border: 0; outline: 0; background: none; font-size: 17px; color: var(--ink); }
.yarn { flex: none; display: block; width: 24px; height: 24px; overflow: visible; }
.yarns { display: flex; flex-wrap: wrap; gap: 4px; }

.input {
  width: 100%;
  min-height: 50px;
  padding: 12px 14px;
  border: 1.5px solid var(--field);
  border-radius: 12px;
  background: #fff;
}
textarea.input { resize: vertical; line-height: 1.35; }
.label { display: block; margin: 22px 0 8px; font-family: var(--body); font-size: 13px; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase; color: var(--muted); }

.row { display: flex; gap: 10px; margin: 12px 0; align-items: stretch; }
.stack { display: grid; gap: 10px; }

.btn {
  flex: 1;
  min-height: 52px;
  padding: 12px 14px;
  border: 0;
  border-radius: 14px;
  background: var(--teal);
  color: #fff;
  font-weight: 650;
  text-align: center;
}
.btn.ghost { background: #fff; color: var(--teal); box-shadow: inset 0 0 0 1.5px var(--teal); }
.btn.red { background: var(--red); }
.btn.sq { flex: none; }
.btn:disabled { opacity: 0.45; cursor: default; }
.link { padding: 8px 0; border: 0; background: none; color: var(--teal); font-weight: 650; text-decoration: underline; text-underline-offset: 3px; }
.link.red { color: var(--red); }
.back { display: inline-block; padding: 6px 0 12px; font-weight: 650; text-decoration: none; }

.card {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 10px;
  padding: 12px;
  border-radius: 18px;
  background: var(--card);
  color: inherit;
  text-decoration: none;
}
.card .yarns { margin-top: 6px; }
.hit .yarn { width: 22px; height: 22px; }
.boxicon { flex: none; display: block; overflow: visible; }
.boxicon text { font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; font-variant-numeric: tabular-nums; }
.boxicon.md { width: 58px; height: 54px; }
.boxicon.lg { width: 92px; height: 86px; }
.boxicon.xs { width: 28px; height: 26px; }
.where { display: block; font-weight: 650; }
.where.lg { font-size: 19px; }
.hit { display: flex; gap: 8px; align-items: center; margin-top: 4px; }
mark { padding: 0 3px; border-radius: 4px; background: var(--hl); color: inherit; }
.empty { padding: 16px; border: 1.5px dashed #b7c2bb; border-radius: 14px; background: var(--card); text-align: center; color: var(--muted); }

.boxhead { display: flex; gap: 16px; align-items: center; margin-bottom: 14px; }
.boxhead h1 { margin: 0 0 8px; font-size: 32px; letter-spacing: -0.02em; }
/* Where the box is: the place, and under it the spot inside the place (both open "Mover") */
.crumbs { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.crumbs a { padding: 6px 12px; border-radius: 99px; background: var(--card); color: var(--ink); font-size: 15px; font-weight: 700; text-decoration: none; }
.crumbs a.spot { font-weight: 600; color: var(--muted); }
.photo { position: relative; display: block; margin-top: 4px; }
.photo span { position: absolute; left: 10px; bottom: 10px; padding: 4px 10px; border-radius: 99px; background: rgba(23, 32, 28, 0.72); color: #fff; font-size: 13px; font-weight: 600; }
.photo img, .thumb { display: block; width: 100%; max-height: 220px; object-fit: cover; border-radius: 18px; background: #cbbfa8; }
.thumb { margin-bottom: 12px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: 22px 0 8px; }
.section-head .label { margin: 0; }
/* The list of what's in a box: one rounded card, a hairline between rows */
.items { display: grid; border-radius: 20px; background: var(--card); overflow: hidden; }
.items:has(> .empty) { background: none; }
.item { display: flex; gap: 12px; align-items: center; padding: 12px 12px 12px 14px; border-bottom: 1px solid var(--line); }
.item:last-child { border-bottom: 0; }
.item > .yarn { width: 40px; height: 40px; }
.item .name { display: grid; gap: 2px; padding: 4px 0; border: 0; background: none; text-align: left; }
.item.out .name > span:first-child { color: var(--muted); text-decoration: line-through; }
.item.edit { display: block; }
.item.check { cursor: pointer; }
.item.check input { flex: none; width: 22px; height: 22px; accent-color: var(--teal); }
.step { display: flex; flex: none; gap: 8px; }
.step button { display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; background: #fff; color: var(--ink); }
.step .ic { width: 20px; height: 20px; stroke-width: 2.6; }

/* Box page: history and notes fold away; the three common actions sit in a bar at the bottom */
.more { margin-top: 16px; border-top: 1px solid var(--line); }
.more > summary { display: flex; align-items: center; gap: 8px; min-height: 52px; padding: 0 4px; font-weight: 700; cursor: pointer; list-style: none; }
.more > summary::-webkit-details-marker { display: none; }
.more-title { flex: 1; display: flex; align-items: center; gap: 10px; }
.more-title .ic, .more > summary > .ic { color: var(--muted); }
.more > summary > .ic { width: 18px; height: 18px; transition: transform 0.2s; }
.more[open] > summary > .ic { transform: rotate(90deg); }
.actionbar { position: fixed; z-index: 6; left: 50%; bottom: 0; width: min(560px, 100%); transform: translateX(-50%); display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; padding: 10px 16px calc(12px + env(safe-area-inset-bottom, 0px)); background: #fff; box-shadow: 0 -1px 0 var(--line); }
.actionbar button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 62px; padding: 6px; border: 0; border-radius: 16px; background: var(--card); color: var(--ink); font-size: 14px; font-weight: 700; }
.actionbar .primary { background: var(--teal); color: #fff; }
.actionbar .ic { width: 24px; height: 24px; }
body.has-bar #app { padding-bottom: calc(100px + env(safe-area-inset-bottom, 0px)); }
body.has-bar #app.with-fab { padding-bottom: calc(200px + env(safe-area-inset-bottom, 0px)); }
body.has-bar .fab { bottom: calc(100px + env(safe-area-inset-bottom, 0px)); }
body.has-bar .toast { bottom: calc(204px + env(safe-area-inset-bottom, 0px)); }

/* Home: "Buscá por color" (every family she has, as big yarn balls) above the rooms */
.colors { margin: 0 0 4px; padding: 14px 6px 10px; border-radius: 22px; background: var(--wool); }
.colors-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 0 10px 8px; }
.colors-head h2 { margin: 0; font-size: 20px; }
.colors-head span { font-size: 14px; font-weight: 600; color: #6b5f4f; }
.color-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 4px 2px; }
.color { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 0; padding: 6px 0; border: 0; border-radius: 14px; background: none; color: var(--ink); font-size: 13px; font-weight: 700; }
.color .yarn { width: 46px; height: 46px; }
.color span { white-space: nowrap; letter-spacing: -0.01em; }
.color.on { background: #fff; box-shadow: inset 0 0 0 2.5px var(--ring); }
.color-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 16px; padding: 6px 6px 6px 16px; border-radius: 16px; background: var(--c); color: #fff; }
.color-bar b { font-family: var(--display); font-size: 18px; }
.color-bar button { min-height: 44px; padding: 0 14px; border: 0; border-radius: 12px; background: rgba(255, 255, 255, 0.16); color: inherit; font-weight: 700; }
.color-bar.light { color: var(--ink); box-shadow: inset 0 0 0 1.5px rgba(23, 32, 28, 0.16); }
.color-bar.light button { background: rgba(23, 32, 28, 0.08); }
.room { margin-top: 18px; }
.room-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 44px; margin-bottom: 6px; }
.room-head h2 { margin: 0; font-size: 20px; }
.room-head h2 span { font-family: var(--body); font-size: 14px; font-weight: 600; letter-spacing: 0; color: var(--muted); }
.room-head .link { padding: 10px 0; text-decoration: none; }
.tiles { display: flex; gap: 10px; margin: 0 -16px; padding: 0 16px 4px; overflow-x: auto; scroll-snap-type: x proximity; scroll-padding: 0 16px; scrollbar-width: none; }
.tiles::-webkit-scrollbar { display: none; }
.tiles.open { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); margin: 0; padding: 0; overflow: visible; }
.tile { flex: none; width: 132px; display: flex; flex-direction: column; gap: 8px; padding: 12px; border-radius: 18px; background: var(--card); color: var(--ink); text-decoration: none; scroll-snap-align: start; }
.tiles.open .tile { width: auto; }
.tile .boxicon.md { width: 50px; height: 47px; }
.tile-spot { font-size: 14px; font-weight: 600; line-height: 1.3; color: var(--muted); }
.tile .yarns { margin-top: auto; }
.hitcard { display: flex; align-items: center; gap: 14px; padding: 12px; border-radius: 18px; background: var(--card); color: var(--ink); text-decoration: none; }
.hitcard + .hitcard { margin-top: 8px; }
.hitcard .grow { display: grid; gap: 2px; }
.hitcard > .ic { color: var(--muted); }
.hitline { display: flex; align-items: center; gap: 8px; font-size: 17px; }
.hitline .yarn { width: 30px; height: 30px; }
.none { margin: 14px 0 0; }

.big {
  display: block;
  width: 100%;
  min-height: 56px;
  margin-bottom: 10px;
  padding: 14px 16px;
  border: 0;
  border-radius: 14px;
  background: var(--card);
  text-align: left;
  font-weight: 650;
  box-shadow: inset 0 0 0 1.5px var(--line);
}
.big.current { box-shadow: inset 0 0 0 2.5px var(--teal); }
.plain { padding: 6px 0; border: 0; border-bottom: 1.5px dashed #b7c2bb; background: none; font-weight: 650; }

.history { margin: 0; padding: 0; list-style: none; }
.history li { display: flex; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.history b { flex: none; width: 48px; color: var(--muted); font-weight: 600; font-variant-numeric: tabular-nums; }

.danger { margin-top: 28px; }
.foot { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 6px 22px; margin-top: 28px; }
.foot a, .foot .link { padding: 8px 0; font-weight: 600; line-height: 1.4; }
.login { display: grid; align-content: center; gap: 8px; min-height: 70vh; }
.login .lead { margin: 0; font-size: 19px; line-height: 1.35; }
.login > .link { justify-self: center; }
/* Signed out: the phone shows a QR for a signed-in phone to scan and approve */
.pairing { justify-items: center; text-align: center; }
.pairing .row { width: 100%; }
.ovis.login-sheep { width: 96px; height: 96px; }
.pair-qr { display: grid; place-items: center; width: min(260px, 74vw); aspect-ratio: 1; margin: 6px 0 2px; padding: 10px; border-radius: 18px; background: #fff; box-shadow: 0 1px 0 #d6ddd7, 0 10px 28px rgba(23, 32, 28, 0.1); }
.pair-qr svg { display: block; width: 100%; height: 100%; }
.pair-qr.dim svg { opacity: 0.12; }
.pair-status { display: inline-flex; align-items: center; gap: 8px; margin: 0; color: var(--muted); font-weight: 650; }

.spin { width: 36px; height: 36px; margin: 40px auto 12px; border: 4px solid #cdd5cf; border-top-color: var(--teal); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spin { animation-duration: 2.4s; } }

.toast {
  position: fixed;
  z-index: 10;
  left: 50%;
  bottom: calc(18px + env(safe-area-inset-bottom, 0px));
  width: min(528px, calc(100% - 32px));
  transform: translateX(-50%);
  padding: 13px 16px;
  border-radius: 14px;
  background: var(--ink);
  color: #fff;
  font-size: 15px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.18);
}

/* ---------- Ovis, the sheep */

.ovis { display: block; overflow: visible; }

.ovis .ov-thought, .ovis .ov-waves, .ovis .ov-mouth { opacity: 0; transition: opacity 0.2s; }
.ovis .ov-ears { transition: transform 0.2s; }
.ovis .ov-eyes { transform-box: fill-box; transform-origin: center; animation: ov-blink 5s infinite; }
.ovis.is-idle { animation: ov-bob 3.2s ease-in-out infinite; }
.ovis.is-listening .ov-ears { transform: translateY(-3px); }
.ovis.is-thinking .ov-thought, .ovis.is-preparing .ov-thought { opacity: 1; }
.ovis.is-thinking .ov-thought circle, .ovis.is-preparing .ov-thought circle { animation: ov-dot 1.2s infinite; }
.ovis .ov-thought circle:nth-child(2) { animation-delay: 0.2s; }
.ovis .ov-thought circle:nth-child(3) { animation-delay: 0.4s; }
.ovis.is-talking .ov-waves { opacity: 1; animation: ov-pulse 0.9s ease-in-out infinite; }
.ovis.is-talking .ov-smile { opacity: 0; }
.ovis.is-talking .ov-mouth { opacity: 1; transform-box: fill-box; transform-origin: center; animation: ov-talk 0.22s ease-in-out infinite alternate; }
@keyframes ov-blink { 0%, 93%, 100% { transform: scaleY(1); } 96% { transform: scaleY(0.12); } }
@keyframes ov-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }
@keyframes ov-dot { 0%, 100% { opacity: 0.25; } 50% { opacity: 1; } }
@keyframes ov-pulse { 0%, 100% { opacity: 0.35; } 50% { opacity: 1; } }
@keyframes ov-talk { from { transform: scaleY(0.35); } to { transform: scaleY(1); } }

/* Voice status in the subtitles' label: a spinner while the voice loads, bars while Ovis talks */
.loader { width: 14px; height: 14px; border: 2.5px solid rgba(12, 90, 98, 0.22); border-top-color: var(--teal); border-radius: 50%; animation: spin 0.8s linear infinite; }
.waves { display: inline-flex; align-items: center; gap: 2px; height: 16px; }
.waves i { width: 3px; height: 5px; border-radius: 2px; background: currentColor; animation: ov-bar 0.9s ease-in-out infinite; }
.waves i:nth-child(2) { animation-delay: 0.15s; }
.waves i:nth-child(3) { animation-delay: 0.3s; }
.waves i:nth-child(4) { animation-delay: 0.45s; }
@keyframes ov-bar { 0%, 100% { height: 4px; } 50% { height: 16px; } }
@media (prefers-reduced-motion: reduce) {
  .ovis, .ovis *, .waves i { animation: none !important; }
  .loader { animation-duration: 2.4s; }
}

/* ---------- The floating button: just Ovis, animated, bottom right (thumb side) */
.fab {
  position: fixed;
  z-index: 5;
  right: max(16px, env(safe-area-inset-right, 0px));
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  display: grid;
  place-items: center;
  width: 92px;
  height: 92px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 10px 28px rgba(23, 32, 28, 0.28), 0 0 0 3px rgba(12, 90, 98, 0.14);
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}
.fab::after { content: ''; position: absolute; inset: 0; border-radius: 50%; pointer-events: none; animation: fab-halo 2.8s ease-out infinite; }
.fab .ovis { width: 78px; height: 78px; margin-top: 6px; }
.fab:active { transform: scale(0.95); }
.fab-bubble {
  position: absolute;
  right: calc(100% + 12px);
  bottom: 56px;
  width: max-content;
  max-width: 190px;
  padding: 10px 14px;
  border-radius: 16px 16px 4px 16px;
  background: var(--ink);
  color: #fff;
  font-size: 15px;
  font-weight: 650;
  line-height: 1.3;
  box-shadow: 0 6px 18px rgba(23, 32, 28, 0.22);
  animation: fab-bubble 6s ease forwards;
}
@keyframes fab-halo { 0% { box-shadow: 0 0 0 0 rgba(12, 90, 98, 0.38); } 70%, 100% { box-shadow: 0 0 0 18px rgba(12, 90, 98, 0); } }
@keyframes fab-bubble {
  0% { opacity: 0; transform: translateY(6px) scale(0.92); }
  8%, 85% { opacity: 1; transform: none; }
  100% { opacity: 0; visibility: hidden; }
}
@keyframes fab-fade { 0%, 85% { opacity: 1; } 100% { opacity: 0; visibility: hidden; } }
#app.with-fab { padding-bottom: calc(126px + env(safe-area-inset-bottom, 0px)); }
body.has-fab .toast { bottom: calc(124px + env(safe-area-inset-bottom, 0px)); }
@media (prefers-reduced-motion: reduce) {
  .fab::after { animation: none; }
  .fab-bubble { animation: fab-fade 6s linear forwards; }
}

/* ---------- Ovis "Brillo": the screen edges glow and her words show up as big subtitles at the bottom */
body.ovis-open { overflow: hidden; }
body.ovis-open .fab { visibility: hidden; }
body.ovis-open .toast { z-index: 30; top: calc(66px + env(safe-area-inset-top, 0px)); bottom: auto; }
#ovis.open { animation: fade-in 0.2s ease; }
.ov-catch { position: fixed; inset: 0; z-index: 20; padding: 0; border: 0; background: transparent; cursor: default; touch-action: none; }
.glow { position: fixed; inset: 0; z-index: 24; pointer-events: none; }
.glow.is-live { box-shadow: inset 0 0 0 3px rgba(12, 90, 98, 0.9), inset 0 0 44px 8px rgba(227, 178, 60, 0.55); animation: glow 1.6s ease-in-out infinite; }
.glow.is-soft { box-shadow: inset 0 0 0 2px rgba(12, 90, 98, 0.7), inset 0 0 30px 4px rgba(12, 90, 98, 0.22); }
@keyframes glow { 0%, 100% { opacity: 0.65; } 50% { opacity: 1; } }

/* The top fade hides the page header behind the buttons; taps on it still reach the page (and close Ovis). */
.ov-top { position: fixed; z-index: 23; top: 0; left: 0; right: 0; display: flex; align-items: center; gap: 8px; padding: calc(12px + env(safe-area-inset-top, 0px)) 12px 28px; background: linear-gradient(var(--bg) 62%, rgba(255, 255, 255, 0)); pointer-events: none; }
.ov-top > * { pointer-events: auto; }
.ov-pill { min-height: 40px; padding: 8px 14px; border: 0; border-radius: 99px; background: #fff; font-size: 14px; font-weight: 650; box-shadow: 0 4px 14px rgba(23, 32, 28, 0.16); }
.ov-x { margin-left: auto; width: 44px; height: 44px; border: 0; border-radius: 50%; background: #fff; font-size: 26px; line-height: 1; box-shadow: 0 4px 14px rgba(23, 32, 28, 0.16); }

/* The fade lets taps through to the page (which closes Ovis); the subtitles themselves catch them. */
.captions { position: fixed; z-index: 21; left: 0; right: 0; bottom: 0; display: flex; flex-direction: column; text-align: center; pointer-events: none; }
.captions::before { content: ''; flex: none; height: 88px; background: linear-gradient(rgba(255, 255, 255, 0), var(--bg)); }
.cap-live { display: flex; flex-direction: column; }
.cap-body, .cap-foot, .cap-form { pointer-events: auto; background: var(--bg); padding-inline: max(22px, calc((100% - 520px) / 2)); }
.cap-body { display: flex; flex-direction: column; align-items: center; gap: 12px; max-height: calc(100vh - 360px); max-height: calc(100dvh - 360px - env(safe-area-inset-top, 0px)); overflow-y: auto; overscroll-behavior: contain; }
.cap-foot { display: flex; flex-direction: column; align-items: center; gap: 10px; padding-top: 14px; padding-bottom: calc(14px + env(safe-area-inset-bottom, 0px)); }
.cap-form { margin: 0; padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px)); }
.captions p { margin: 0; }
.cap-head { display: flex; align-items: center; gap: 10px; min-height: 34px; }
.cap-label { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--teal); }
.cap-replay { display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 4px 12px 4px 10px; border: 0; border-radius: 99px; background: var(--chip); color: var(--teal); font-size: 14px; font-weight: 700; }
.cap-replay svg { width: 18px; height: 18px; }
.cap-user { font-size: 15px; color: var(--muted); }
.cap-text { font-size: 23px; font-weight: 700; line-height: 1.3; white-space: pre-line; overflow-wrap: anywhere; }
.cap-text.cap-big { font-size: 26px; font-weight: 750; line-height: 1.25; }
.cap-heard { font-size: 21px; font-weight: 700; color: var(--teal); }
.cap-text.placeholder, .cap-heard.placeholder { color: var(--muted); font-weight: 650; }
.cap-text.err { color: #8a1c12; }
/* Karaoke: the words Ovis hasn't said yet are grey, and darken as she says them */
.cap-text.reading .w { color: #7b8681; transition: color 0.12s; }
.cap-text.reading .w.on { color: var(--ink); }
.cap-example { font-size: 16px; color: var(--muted); }
.cap-todo { padding: 8px 14px; border-radius: 12px; background: #fff6dc; font-size: 15px; font-weight: 600; }
.cap-status { font-size: 15px; font-weight: 700; color: var(--teal); }
.cap-actions { display: flex; gap: 10px; width: 100%; }
.cap-hint { font-size: 13px; color: var(--muted); }
.refs { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.ref { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px 4px 8px; border-radius: 99px; background: var(--chip); color: inherit; font-size: 15px; font-weight: 600; text-decoration: none; }

.ov-orb { position: relative; display: grid; place-items: center; width: 92px; height: 92px; padding: 0; border: 0; border-radius: 50%; background: #fff; box-shadow: 0 10px 28px rgba(23, 32, 28, 0.25); }
.ov-orb .ovis { width: 78px; height: 78px; margin-top: 6px; }
.ov-orb:active { transform: scale(0.95); }
.ov-orb.live::after { content: ''; position: absolute; inset: 0; border-radius: 50%; pointer-events: none; animation: orb-ring 1.4s ease-out infinite; }
@keyframes orb-ring { from { box-shadow: 0 0 0 0 rgba(12, 90, 98, 0.45); } to { box-shadow: 0 0 0 20px rgba(12, 90, 98, 0); } }
@keyframes fade-in { from { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  #ovis.open, .glow.is-live, .ov-orb.live::after { animation: none; }
}

/* ---------- Agregar: a short menu (Ovis or photos, plus one-tap shortcuts), then a screen per way */
.ask-how { margin: 6px 0 12px; font-family: var(--display); font-size: 19px; font-weight: 600; line-height: 1.25; }
.way { display: flex; gap: 16px; align-items: center; width: 100%; min-height: 150px; margin-bottom: 12px; padding: 18px; border: 0; border-radius: 22px; text-align: left; }
.way:active { transform: scale(0.98); }
.way.voice { background: var(--teal); color: #fff; }
.way.foto { background: var(--gold); color: var(--ink); }
.way-ic { flex: none; display: grid; place-items: center; width: 92px; height: 92px; border-radius: 50%; background: #fff; color: var(--ink); }
.way-ic .ovis { width: 78px; height: 78px; margin-top: 6px; }
.way-ic .ic { width: 44px; height: 44px; stroke-width: 1.8; }
.way-text { display: grid; gap: 6px; min-width: 0; }
.way-text b { font-family: var(--display); font-size: 23px; line-height: 1.15; }
.way-text > span { font-size: 15px; line-height: 1.3; }
.way.voice .way-text > span { color: rgba(255, 255, 255, 0.9); }
.way.foto .way-text > span { color: #3b3320; }
.way-text .unsaved { justify-self: start; padding: 2px 10px; border-radius: 99px; background: #fff; color: var(--ink) !important; font-size: 13px; font-weight: 700; }
.quick { display: flex; flex-wrap: wrap; gap: 8px; }
.quick button { display: flex; gap: 8px; align-items: center; min-height: 48px; padding: 6px 14px 6px 8px; border: 0; border-radius: 14px; background: var(--card); font-size: 15px; text-align: left; }
.quick button:active { background: var(--chip); }
.quick .yarn { flex: none; width: 30px; height: 30px; }

/* The list being built: rows say what they'll add, and whether it joins yarn the box already has */
.chip { display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 99px; font-size: 13px; font-weight: 650; line-height: 1.5; }
.chip.ok { background: #d6e7e5; color: var(--teal); }
.chip.wait { background: #fff3cc; color: #6b5310; }
.item .keep { flex: none; width: 22px; height: 22px; margin: 0; accent-color: var(--teal); }
.write { margin: 12px 0 0; }
.btn.soft { background: #e6efee; color: var(--teal); }

/* Bottom docks: Ovis listening (voice) and the save bar (photos) */
.dock { position: fixed; z-index: 6; left: 50%; bottom: 0; width: min(560px, 100%); transform: translateX(-50%); padding: 16px max(16px, env(safe-area-inset-right, 0px)) calc(16px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px)); background: #fff; }
.dock.dictation { display: grid; gap: 8px; border-radius: 26px 26px 0 0; box-shadow: 0 -8px 30px rgba(23, 32, 28, 0.12); }
.dock.savebar { display: grid; gap: 4px; padding-top: 12px; box-shadow: 0 -1px 0 var(--line); }
.dock .muted.small, .dock p.small { margin: 0; }
.dock .link { justify-self: center; }
.dock .row { margin: 4px 0 0; }
.dict-heard { margin: 0; font-family: var(--display); font-size: 22px; font-weight: 600; line-height: 1.25; overflow-wrap: anywhere; }
.dict-heard.placeholder { color: var(--muted); }
.dict-foot { display: flex; gap: 14px; align-items: center; margin-top: 4px; }
.dict-save { display: grid; gap: 6px; }
.dict-save .cap-hint { text-align: center; }
body.has-dictation #app { padding-bottom: calc(300px + env(safe-area-inset-bottom, 0px)); }
body.has-savebar #app { padding-bottom: calc(140px + env(safe-area-inset-bottom, 0px)); }
body.has-dictation .toast { bottom: calc(290px + env(safe-area-inset-bottom, 0px)); }
body.has-savebar .toast { bottom: calc(132px + env(safe-area-inset-bottom, 0px)); }

/* Photos taken so far, and Ovis saying what she's doing */
.shots { display: flex; gap: 10px; overflow-x: auto; margin: 2px 0 12px; padding-bottom: 2px; }
.shot { position: relative; flex: none; width: 76px; height: 76px; border-radius: 14px; overflow: hidden; background: #cbbfa8; }
.shot img { display: block; width: 100%; height: 100%; object-fit: cover; }
.shot span { position: absolute; left: 6px; bottom: 6px; padding: 2px 8px; border-radius: 99px; background: rgba(23, 32, 28, 0.78); color: #fff; font-size: 12px; font-weight: 650; }
.shot.busy img { opacity: 0.45; }
.shot.busy::after { content: ''; position: absolute; top: 50%; left: 50%; width: 22px; height: 22px; margin: -18px 0 0 -11px; border: 3px solid rgba(255, 255, 255, 0.5); border-top-color: #fff; border-radius: 50%; animation: spin 0.8s linear infinite; }
button.shot.add { display: grid; place-items: center; align-content: center; gap: 2px; padding: 0; border: 0; background: var(--gold); color: var(--ink); font-size: 13px; font-weight: 700; }
button.shot.add .ic { width: 26px; height: 26px; }
.ovis-says { display: flex; gap: 10px; align-items: center; margin-bottom: 4px; }
.ovis-says .ovis { flex: none; width: 52px; height: 52px; }
.ovis-says p { margin: 0; padding: 10px 14px; border-radius: 16px 16px 16px 4px; background: #e6efee; font-size: 15px; line-height: 1.35; }

/* A toast with a button (Deshacer) */
.toast.with-action { display: flex; align-items: center; gap: 12px; padding-block: 6px; }
.toast.with-action span { flex: 1; min-width: 0; padding-block: 7px; }
.toast button { flex: none; min-height: 44px; padding: 0 4px; border: 0; background: none; color: var(--hl); font-weight: 750; text-decoration: underline; text-underline-offset: 3px; }
@media (prefers-reduced-motion: reduce) {
  .shot.busy::after { animation-duration: 2.4s; }
  .way:active { transform: none; }
}
