/* sparrow: cozy-companion kawaii
 * soft dawn palette, rounded everything, a sparrow who keeps your
 * thoughts and flutters them back. self-contained (no styles.css).
 */

:root {
  --sky-top:  #fbeede;   /* pale apricot dawn */
  --sky-bot:  #e9eef0;   /* pale morning sky */
  --card:     #fffdf8;   /* soft warm white */
  --card-2:   #fef6ec;   /* faint peach panel */
  --ink:      #4a3f3a;   /* cozy warm near-black */
  --ink-soft: #9a8a82;   /* secondary */
  --line:     rgba(74,63,58,0.10);
  --coral:    #ef9b7a;   /* primary warm accent */
  --coral-deep:#e07f5c;
  --sky:      #9fc4d4;   /* secondary accent */
  --blush:    #f4a6a0;
  --shadow:   24px 24px 60px rgba(120,90,70,0.12);
  --font: "Nunito", -apple-system, BlinkMacSystemFont, "SF Pro Rounded", system-ui, sans-serif;

  /* the sparrow mascot, reused everywhere */
  --bird: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><polygon points='64,50 96,32 80,52' fill='%235b7a93'/><polygon points='64,58 96,72 80,60' fill='%235b7a93'/><ellipse cx='42' cy='54' rx='26' ry='22' fill='%235b7a93'/><circle cx='26' cy='44' r='12' fill='%235b7a93'/><ellipse cx='37' cy='62' rx='16' ry='16' fill='%23fdf3e7'/><ellipse cx='25' cy='50' rx='6' ry='4' fill='%23d9824a'/><polygon points='46,40 64,52 56,66' fill='%233f5e7a'/><polygon points='14,42 2,46 14,50' fill='%23eba35c'/><circle cx='14' cy='52' r='4' fill='%23f4a6a0' opacity='0.55'/><circle cx='22' cy='44' r='5' fill='%232a1f15'/><circle cx='24' cy='42' r='1.6' fill='%23ffffff'/><path d='M36 76 L34 92 M50 76 L52 92' stroke='%23eba35c' stroke-width='3' stroke-linecap='round'/></svg>");
}

@media (prefers-color-scheme: dark) {
  :root {
    --sky-top:  #2a2530;
    --sky-bot:  #1f2530;
    --card:     #322c33;
    --card-2:   #38313a;
    --ink:      #f3e9e2;
    --ink-soft: #b3a39c;
    --line:     rgba(243,233,226,0.12);
    --coral:    #f0a585;
    --coral-deep:#f2b89e;
    --sky:      #9fc4d4;
    --blush:    #f4a6a0;
    --shadow:   24px 24px 60px rgba(0,0,0,0.35);
  }
}

* { box-sizing: border-box; margin: 0; padding: 0; }

.app-body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  color: var(--ink);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  background: linear-gradient(170deg, var(--sky-top) 0%, var(--sky-bot) 70%);
  background-attachment: fixed;
  overflow-x: hidden;
}
.app-header, .catalog, .app-footer { position: relative; z-index: 2; }

/* a tiny sparrow flies across now and then */
.flyby {
  position: fixed;
  top: 18vh;
  left: -90px;
  width: 34px; height: 34px;
  background: var(--bird) no-repeat center/contain;
  z-index: 1;
  pointer-events: none;
  opacity: 0;
  transform: scaleX(-1);
  animation: flyby 34s linear infinite;
}
@keyframes flyby {
  0%   { opacity: 0; transform: translate(0, 0) scaleX(-1) rotate(-4deg); }
  3%   { opacity: 0.85; }
  6%   { transform: translate(14vw, -5vh) scaleX(-1) rotate(6deg); }
  12%  { transform: translate(34vw, 3vh) scaleX(-1) rotate(-5deg); }
  18%  { transform: translate(58vw, -4vh) scaleX(-1) rotate(6deg); }
  24%  { opacity: 0.85; transform: translate(82vw, 2vh) scaleX(-1) rotate(-4deg); }
  27%  { opacity: 0; transform: translate(102vw, -2vh) scaleX(-1); }
  100% { opacity: 0; transform: translate(102vw, -2vh) scaleX(-1); }
}

/* a meadow strip along the foot of the page */
.ground {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: 64px;
  z-index: 1;
  pointer-events: none;
  opacity: 0.9;
  background-repeat: repeat-x;
  background-position: bottom left;
  background-size: 1200px 60px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 60'><g fill='none' stroke='%238fae7e' stroke-width='4' stroke-linecap='round'><path d='M50 60 C48 42 44 34 40 26'/><path d='M62 60 C62 40 60 28 58 16'/><path d='M76 60 C78 40 80 30 86 20'/><path d='M240 60 C238 42 234 32 232 24'/><path d='M252 60 C252 38 250 26 250 14'/><path d='M266 60 C268 38 272 28 278 20'/><path d='M460 60 C458 44 456 32 454 22'/><path d='M472 60 C474 40 478 30 486 18'/><path d='M488 60 C486 42 482 30 478 20'/><path d='M700 60 C698 44 696 32 694 22'/><path d='M712 60 C712 38 710 26 710 14'/><path d='M726 60 C728 40 732 28 740 20'/><path d='M930 60 C928 42 924 30 920 22'/><path d='M944 60 C944 38 942 28 942 16'/><path d='M956 60 C958 40 962 30 968 22'/><path d='M1110 60 C1108 42 1104 32 1100 22'/><path d='M1122 60 C1122 38 1120 26 1120 14'/><path d='M1136 60 C1138 40 1142 30 1148 22'/></g></svg>");
}

/* the growing meadow: one flower per kept thought, positions derived from save id */
.meadow {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: 90px;
  z-index: 1;
  pointer-events: none;
}
.meadow svg { width: 100%; height: 100%; display: block; }
.meadow-flower {
  transform-origin: bottom center;
  transform-box: fill-box;
}
.meadow-flower.is-new { animation: sprout 720ms cubic-bezier(.2,.9,.3,1.4) backwards; }
@keyframes sprout {
  0%   { transform: scaleY(0.05) scaleX(0.6); opacity: 0; }
  40%  { opacity: 1; }
  70%  { transform: scaleY(1.08) scaleX(1.04); }
  100% { transform: scaleY(1) scaleX(1); opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .meadow-flower.is-new { animation: none; }
}

/* drifting clouds in the upper sky */
.cloud {
  position: fixed;
  top: 12vh;
  left: -180px;
  width: 150px; height: 56px;
  z-index: 1;
  pointer-events: none;
  opacity: 0.55;
  background: no-repeat center/contain;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 130 60'><g fill='%23ffffff'><ellipse cx='30' cy='38' rx='22' ry='15'/><ellipse cx='58' cy='30' rx='26' ry='18'/><ellipse cx='88' cy='34' rx='24' ry='17'/><ellipse cx='110' cy='42' rx='16' ry='12'/></g></svg>");
  animation: drift 95s linear infinite;
}
.cloud.cloud-b { top: 26vh; width: 190px; height: 70px; opacity: 0.45; animation-duration: 130s; animation-delay: -40s; }
.cloud.cloud-c { top: 5vh;  width: 110px; height: 42px; opacity: 0.5;  animation-duration: 78s;  animation-delay: -22s; }
@keyframes drift {
  0%   { transform: translateX(0); }
  100% { transform: translateX(calc(100vw + 240px)); }
}
/* a happy toad dozing by the grass */
.toad {
  position: fixed;
  bottom: 4px; left: 126px;
  width: 60px; height: 46px;
  z-index: 3;
  cursor: pointer;
  background: no-repeat bottom center/contain;
  transform-origin: 50% 100%;
  animation: critter-breathe 4.2s ease-in-out infinite;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 90 66'><ellipse cx='45' cy='46' rx='35' ry='19' fill='%238fae7e'/><ellipse cx='45' cy='52' rx='23' ry='11' fill='%23cfe1b2'/><ellipse cx='20' cy='60' rx='9' ry='5' fill='%238fae7e'/><ellipse cx='70' cy='60' rx='9' ry='5' fill='%238fae7e'/><circle cx='30' cy='22' r='11' fill='%238fae7e'/><circle cx='60' cy='22' r='11' fill='%238fae7e'/><circle cx='30' cy='22' r='5.5' fill='%232f3a2a'/><circle cx='60' cy='22' r='5.5' fill='%232f3a2a'/><circle cx='32' cy='20' r='1.8' fill='%23fff'/><circle cx='62' cy='20' r='1.8' fill='%23fff'/><path d='M26 40 Q45 58 64 40' fill='none' stroke='%232f3a2a' stroke-width='3' stroke-linecap='round'/><circle cx='19' cy='42' r='4' fill='%23f4a6a0' opacity='0.5'/><circle cx='71' cy='42' r='4' fill='%23f4a6a0' opacity='0.5'/></svg>");
}

/* a fox curled asleep in the far corner */
.fox {
  position: fixed;
  bottom: 0; right: 16px;
  width: 154px; height: 112px;
  z-index: 3;
  cursor: pointer;
  opacity: 0.92;
  background: no-repeat bottom right/contain;
  transform-origin: 80% 100%;
  animation: critter-breathe 6s ease-in-out infinite;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 130 96'><path d='M70 86 Q120 84 116 50 Q112 28 92 30 Q108 52 96 74 Q86 88 70 86 Z' fill='%23d9824a'/><ellipse cx='96' cy='74' rx='10' ry='8' fill='%23f7e7d2'/><ellipse cx='62' cy='64' rx='44' ry='30' fill='%23d9824a'/><circle cx='40' cy='62' r='23' fill='%23d9824a'/><path d='M26 44 L33 56 L20 56 Z' fill='%23d9824a'/><path d='M50 42 L56 56 L42 55 Z' fill='%23d9824a'/><path d='M26 46 L31 54 L23 54 Z' fill='%23b5632f'/><ellipse cx='34' cy='70' rx='17' ry='12' fill='%23f7e7d2'/><path d='M27 61 Q33 66 39 61' fill='none' stroke='%233a2a20' stroke-width='2.4' stroke-linecap='round'/><circle cx='19' cy='69' r='3.2' fill='%233a2a20'/><circle cx='30' cy='74' r='3.4' fill='%23f4a6a0' opacity='0.45'/></svg>");
}
@keyframes critter-breathe {
  0%,100% { transform: scale(1); }
  50%     { transform: scale(1.035); }
}

/* pat wiggle */
.toad.is-pat, .fox.is-pat { animation: critter-pat 520ms cubic-bezier(.2,.9,.3,1.4); }
@keyframes critter-pat {
  0%   { transform: scale(1) rotate(0); }
  20%  { transform: scale(1.08, 0.92) rotate(-4deg); }
  55%  { transform: scale(0.96, 1.06) rotate(3deg); }
  100% { transform: scale(1) rotate(0); }
}
.toad:hover, .fox:hover { filter: brightness(1.04) drop-shadow(0 4px 8px rgba(120,90,70,0.18)); }

/* hearts floating up from a pat */
.heart {
  position: fixed;
  width: 22px; height: 22px;
  pointer-events: none;
  z-index: 60;
  --dx: 0px;
  background: no-repeat center/contain;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 22'><path d='M12 21 C2 14 2 5 7 4 C10 3 11 5 12 7 C13 5 14 3 17 4 C22 5 22 14 12 21 Z' fill='%23f4a6a0'/></svg>");
  animation: heart-rise 1200ms cubic-bezier(.3,.2,.5,1) forwards;
}
@keyframes heart-rise {
  0%   { opacity: 0; transform: translate(0, 0) scale(0.5) rotate(-8deg); }
  15%  { opacity: 1; transform: translate(calc(var(--dx) * 0.3), -10px) scale(1.1) rotate(4deg); }
  100% { opacity: 0; transform: translate(var(--dx), -90px) scale(0.9) rotate(-6deg); }
}
@media (prefers-reduced-motion: reduce) {
  .heart { animation: none; opacity: 0; }
  .toad.is-pat, .fox.is-pat { animation: none; }
}

@media (prefers-reduced-motion: reduce) {
  .flyby, .cloud { display: none; }
  .toad, .fox { animation: none; }
}
@media (max-width: 560px) {
  .grass { width: 96px; height: 42px; left: 8px; opacity: 0.7; }
  .toad  { left: 92px; width: 48px; height: 38px; }
  .fox   { width: 104px; height: 78px; opacity: 0.8; }
}

/* ───────── header ───────── */
.app-header {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 22px;
  padding: 18px 30px;
}

.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand-mark {
  width: 38px; height: 38px;
  background: var(--bird) no-repeat center/contain;
  filter: drop-shadow(0 3px 4px rgba(120,90,70,0.18));
  transform-origin: 60% 80%;
  animation: bird-bob 4.5s ease-in-out infinite;
}
@keyframes bird-bob {
  0%,100% { transform: translateY(0) rotate(-3deg); }
  50%     { transform: translateY(-3px) rotate(2deg); }
}
.brand-mark.is-happy { animation: spx-hop 640ms cubic-bezier(.2,.9,.3,1.5); }
.brand-name { font-weight: 800; font-size: 22px; letter-spacing: -0.5px; }
.brand-sub  { font-size: 11px; font-weight: 600; color: var(--ink-soft); letter-spacing: 0.3px; }

.app-search {
  display: flex; align-items: center; gap: 8px;
  max-width: 360px; width: 100%; justify-self: center;
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: 999px;
  padding: 0 16px;
  box-shadow: 0 2px 10px rgba(120,90,70,0.06);
  transition: border-color 160ms ease, box-shadow 160ms ease;
}
.app-search:focus-within { border-color: var(--coral); box-shadow: 0 4px 16px rgba(239,155,122,0.18); }
.search-tag { font-size: 14px; }
.search-tag::before { content: "🔍"; filter: grayscale(0.2); }
.search-input {
  flex: 1; border: 0; outline: 0; background: transparent;
  font-family: var(--font); font-size: 14px; font-weight: 600; color: var(--ink);
  padding: 10px 4px;
}
.search-input::placeholder { color: var(--ink-soft); font-weight: 600; }
.search-input::-webkit-search-cancel-button { -webkit-appearance: none; }

.app-header-right { display: flex; align-items: center; gap: 14px; }
.save-count { font-size: 12px; font-weight: 700; color: var(--ink-soft); white-space: nowrap; }
.catch-button {
  background: var(--coral);
  border: 0;
  border-radius: 999px;
  color: #fff;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.2px;
  padding: 10px 18px;
  cursor: pointer;
  display: inline-flex; align-items: center; gap: 8px;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(239,155,122,0.35);
  transition: transform 120ms cubic-bezier(.2,.9,.3,1.4), background 120ms ease;
}
.catch-button:hover { background: var(--coral-deep); transform: translateY(-2px); }
.catch-button:active { transform: translateY(0) scale(0.97); }
kbd {
  font-family: var(--font);
  font-size: 10px; font-weight: 800;
  color: #fff;
  background: rgba(255,255,255,0.22);
  padding: 2px 6px;
  border-radius: 6px;
}
kbd[data-key="catch"]::before { content: "Ctrl+Shift+S"; }
.is-mac kbd[data-key="catch"]::before { content: "\2318\21E7S"; }
kbd[data-key="search"]::before { content: "Ctrl+F"; }
.is-mac kbd[data-key="search"]::before { content: "\2318F"; }
.footer-hint kbd, .capture-foot kbd { color: var(--ink-soft); background: rgba(74,63,58,0.08); }

/* ───────── catalog / river ───────── */
.catalog {
  flex: 1; width: 100%;
  max-width: 600px; margin: 0 auto;
  padding: 26px 22px 60px;
}

/* compose */
.compose-card {
  position: relative;
  background: var(--card);
  border-radius: 24px;
  box-shadow: var(--shadow);
  padding: 24px 24px 18px;
  margin-bottom: 30px;
  border: 1.5px solid var(--line);
  transition: border-color 200ms ease, transform 200ms ease;
}
.compose-card:focus-within { border-color: var(--coral); transform: translateY(-2px); }
.card-tab, .card-margin { display: none; }   /* killed: catalog leftovers */

.river-compose {
  display: block; width: 100%;
  background: transparent; border: 0; outline: 0; resize: none;
  color: var(--ink);
  font-family: var(--font);
  font-size: 20px; font-weight: 600; line-height: 1.55;
  caret-color: var(--coral);
  overflow: hidden;
  min-height: 96px;
  padding-bottom: 6px;
}
.river-compose::placeholder { color: var(--ink-soft); font-weight: 600; }

.card-foot {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-top: 14px; padding-top: 12px;
  border-top: 1.5px dashed var(--line);
}
.card-stamp { font-size: 11px; font-weight: 700; color: var(--ink-soft); transition: color 200ms ease; }
.card-stamp.stamp-happy { color: var(--coral-deep); font-weight: 800; }
.compose-save {
  background: var(--coral); color: #fff;
  border: 0; border-radius: 999px;
  font-family: var(--font); font-size: 13px; font-weight: 800;
  padding: 9px 22px; cursor: pointer;
  box-shadow: 0 4px 12px rgba(239,155,122,0.35);
  opacity: 0; visibility: hidden; transform: scale(0.8);
  transition: opacity 160ms ease, transform 200ms cubic-bezier(.2,.9,.3,1.5), visibility 0s linear 160ms, background 120ms ease;
}
.compose-save.is-ready { opacity: 1; visibility: visible; transform: scale(1); transition: opacity 160ms ease, transform 200ms cubic-bezier(.2,.9,.3,1.5), visibility 0s, background 120ms ease; }
.compose-save:hover { background: var(--coral-deep); }
.compose-save:active { transform: scale(0.94); }

/* divider */
.now-label { display: flex; align-items: center; gap: 12px; margin: 8px 4px 22px; }
.drawer-line { flex: 1; height: 0; border-top: 1.5px solid var(--line); }
.drawer-name {
  font-size: 11px; font-weight: 800; letter-spacing: 1.5px;
  color: var(--ink-soft); text-transform: lowercase;
}

/* the stack */
.river { display: flex; flex-direction: column; gap: 16px; }
.river-save {
  position: relative;
  background: var(--card);
  border-radius: 20px;
  border: 1.5px solid var(--line);
  box-shadow: 0 6px 18px rgba(120,90,70,0.07);
  padding: 18px 20px;
  cursor: default;
  transition: transform 180ms cubic-bezier(.2,.9,.3,1.2), box-shadow 180ms ease, border-color 180ms ease;
}
.river-save::before, .river-save::after { content: none; }   /* killed catalog tab/margin */
.river-save:hover { transform: translateY(-3px) rotate(-0.4deg); box-shadow: 0 12px 26px rgba(120,90,70,0.13); border-color: rgba(239,155,122,0.4); }

.river-save .save-body {
  display: block;
  font-family: var(--font);
  font-size: 17px; font-weight: 600; line-height: 1.55;
  color: var(--ink);
  white-space: pre-wrap; word-wrap: break-word;
}
.river-save.is-link { cursor: pointer; }
.river-save.is-link:hover .save-body { color: var(--coral-deep); }

.river-save .save-meta {
  display: flex; align-items: center; gap: 8px;
  margin-top: 12px;
  font-size: 11.5px; font-weight: 700; color: var(--ink-soft);
}
.river-save .meta-time::before { content: "🕊 "; }
.river-save .meta-host {
  background: var(--card-2);
  color: var(--coral-deep);
  padding: 2px 9px; border-radius: 999px;
  font-weight: 800;
}
.river-save .meta-sep { display: none; }
.river-save .meta-delete {
  margin-left: auto;
  background: transparent; border: 0;
  color: var(--ink-soft);
  font-family: var(--font); font-size: 11px; font-weight: 800;
  cursor: pointer; padding: 4px 10px; border-radius: 999px;
  opacity: 0; transition: opacity 160ms ease, background 160ms ease, color 160ms ease;
}
.river-save:hover .meta-delete { opacity: 0.65; }
.river-save .meta-delete:hover { opacity: 1; color: var(--coral-deep); background: var(--card-2); }

@keyframes flutter-in {
  0%   { opacity: 0; transform: translateY(-16px) rotate(-4deg) scale(0.96); }
  60%  { opacity: 1; }
  80%  { transform: translateY(0) rotate(1.2deg) scale(1.01); }
  100% { transform: translateY(0) rotate(0) scale(1); }
}
.river-save.is-fresh { animation: flutter-in 320ms cubic-bezier(.2,.9,.3,1.3) backwards; }
@media (prefers-reduced-motion: reduce) {
  .river-save.is-fresh, .brand-mark { animation: none; }
  .river-save:hover, .catch-button:hover { transform: none; }
}

.no-match {
  font-size: 15px; font-weight: 700; color: var(--ink-soft);
  text-align: center; padding: 40px 0;
}

/* ───────── empty state: sparrow waiting ───────── */
.empty-state { display: none; flex-direction: column; align-items: center; gap: 14px; padding: 26px 20px; text-align: center; }
.empty-state.show { display: flex; }
.empty-headline { font-size: 21px; font-weight: 800; color: var(--ink); }
.empty-body { font-size: 14px; font-weight: 600; line-height: 1.6; color: var(--ink-soft); max-width: 420px; }
.empty-examples { display: flex; flex-direction: column; gap: 10px; width: 100%; align-items: center; margin-top: 4px; }
.empty-example {
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: 16px;
  padding: 12px 18px;
  font-family: var(--font); font-size: 15px; font-weight: 600;
  color: var(--ink); cursor: pointer; max-width: 100%; text-align: left;
  box-shadow: 0 4px 12px rgba(120,90,70,0.07);
  transition: transform 140ms cubic-bezier(.2,.9,.3,1.3), border-color 140ms ease;
}
.empty-example:hover { transform: translateY(-2px) rotate(-0.6deg); border-color: var(--coral); }
.empty-hint { font-size: 12px; font-weight: 700; color: var(--ink-soft); }

.downstream {
  margin-top: 36px; text-align: center;
  font-size: 12px; font-weight: 700; color: var(--ink-soft);
  opacity: 0.7;
}

/* ───────── capture modal ───────── */
.capture-overlay {
  position: fixed; inset: 0;
  background: rgba(74,63,58,0.32);
  backdrop-filter: blur(8px) saturate(115%);
  -webkit-backdrop-filter: blur(8px) saturate(115%);
  display: none; align-items: flex-start; justify-content: center;
  padding-top: 16vh; z-index: 100; opacity: 0;
  transition: opacity 150ms ease;
}
.capture-overlay.open { display: flex; opacity: 1; }
.capture-card {
  position: relative;
  width: 560px; max-width: calc(100vw - 32px);
  background: var(--card);
  border-radius: 26px;
  box-shadow: 0 30px 80px rgba(120,90,70,0.30);
  padding: 26px 26px 18px;
  transform: scale(0.94);
  transition: transform 200ms cubic-bezier(.2,.9,.3,1.4);
}
.capture-overlay.open .capture-card { transform: scale(1); }
.capture-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 12px;
  font-size: 12px; font-weight: 700; color: var(--ink-soft);
}
.capture-promise { font-weight: 700; }
.capture-chip {
  display: flex; align-items: center; gap: 12px;
  background: var(--card-2);
  border-radius: 16px; padding: 12px 14px; margin-bottom: 12px;
}
.chip-square {
  width: 34px; height: 34px;
  background: var(--coral); color: #fff;
  font-weight: 800; font-size: 16px;
  display: flex; align-items: center; justify-content: center;
  text-transform: uppercase; border-radius: 12px;
}
.chip-meta { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.chip-title { font-size: 14px; font-weight: 700; color: var(--ink); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.chip-url { font-size: 12px; font-weight: 600; color: var(--ink-soft); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.chip-stamp { font-size: 10px; font-weight: 800; color: var(--ink-soft); }
.capture-field {
  width: 100%; background: transparent; border: 0; outline: 0; resize: none;
  color: var(--ink); font-family: var(--font);
  font-size: 21px; font-weight: 600; line-height: 1.45;
  caret-color: var(--coral);
  min-height: 50px; max-height: 300px; overflow-y: auto;
}
.capture-field::placeholder { color: var(--ink-soft); font-weight: 600; }
.capture-foot {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 14px; padding-top: 12px;
  border-top: 1.5px dashed var(--line);
  font-size: 12px; font-weight: 700; color: var(--ink-soft);
}

/* ───────── idle resurface: the sparrow brings one back ───────── */
.idle-card {
  position: fixed; bottom: 26px; right: 26px;
  width: 330px; max-width: calc(100vw - 48px);
  background: var(--card);
  border-radius: 22px;
  box-shadow: 0 24px 60px rgba(120,90,70,0.28);
  padding: 30px 22px 18px;
  opacity: 0; transform: translateY(20px) scale(0.92);
  pointer-events: none;
  transition: opacity 320ms ease, transform 420ms cubic-bezier(.2,.9,.3,1.3);
  z-index: 50;
}
.idle-card.show { opacity: 1; transform: translateY(0) scale(1); pointer-events: auto; }
.idle-stamp { font-size: 12px; font-weight: 800; color: var(--coral-deep); margin-bottom: 8px; padding-left: 4px; }
.idle-body { font-size: 16px; font-weight: 600; line-height: 1.5; color: var(--ink); margin-bottom: 14px; }
.idle-actions { display: flex; gap: 8px; padding-top: 12px; border-top: 1.5px dashed var(--line); }
.idle-actions button {
  background: var(--card-2); border: 0; border-radius: 999px;
  font-family: var(--font); font-size: 12px; font-weight: 800;
  color: var(--ink-soft); cursor: pointer; padding: 7px 14px;
  transition: background 140ms ease, color 140ms ease;
}
.idle-actions button:hover { background: var(--coral); color: #fff; }

/* ───────── footer ───────── */
.app-footer {
  position: relative;
  z-index: 5;                       /* above the meadow critters (z=3) */
  pointer-events: none;             /* let clicks fall through the padding to the toad/fox behind */
  display: flex; justify-content: center; align-items: center;
  gap: 14px; flex-wrap: wrap;
  padding: 22px 28px 130px;         /* enough bottom-padding to lift the text above the fox (112px tall) */
  font-size: 12px; font-weight: 700; color: var(--ink-soft);
}
.app-footer > * { pointer-events: auto; }  /* but the actual text/links stay clickable */
.app-footer a { color: var(--ink); text-decoration: none; }
.app-footer a:hover { color: var(--coral-deep); }
.footer-hint { display: inline-flex; align-items: center; gap: 6px; }
.dot-sep { opacity: 0.4; }

/* ───────── the sparrow, as a character ───────── */
.spx { display: block; overflow: visible; }
.spx-b {
  transform-box: fill-box;
  transform-origin: 50% 95%;
  animation: spx-bob 4.2s ease-in-out infinite;
}
@keyframes spx-bob {
  0%,100% { transform: translateY(0) rotate(-3deg); }
  50%     { transform: translateY(-3px) rotate(3deg); }
}
/* periodic blink */
.spx-eye {
  transform-box: fill-box;
  transform-origin: 50% 50%;
  animation: spx-blink 5.4s ease-in-out infinite;
}
@keyframes spx-blink {
  0%, 90%, 100% { transform: scaleY(1); }
  94%           { transform: scaleY(0.12); }
}
/* head-tilt curiosity on hover of its card */
.compose-card:focus-within .spx-peek .spx-b,
.spx:hover .spx-b { animation: spx-tilt 1.6s ease-in-out infinite; }
@keyframes spx-tilt {
  0%,100% { transform: rotate(-5deg); }
  50%     { transform: rotate(7deg); }
}
/* happy hop (triggered on keep) */
.spx.is-happy .spx-b { animation: spx-hop 620ms cubic-bezier(.2,.9,.3,1.5); }
@keyframes spx-hop {
  0%   { transform: translateY(0) scaleY(1) scaleX(1); }
  25%  { transform: translateY(2px) scaleY(0.86) scaleX(1.14); }
  55%  { transform: translateY(-16px) scaleY(1.12) scaleX(0.92); }
  78%  { transform: translateY(0) scaleY(0.95) scaleX(1.05); }
  100% { transform: translateY(0) scaleY(1) scaleX(1); }
}
.spx.is-happy .spx-cheek { opacity: 0.85 !important; }
/* sleepy (idle, before it perks up) */
.spx.is-sleepy .spx-eye { animation: none; transform: scaleY(0.12); }
.spx.is-sleepy .spx-b { animation: spx-snooze 3s ease-in-out infinite; }
@keyframes spx-snooze {
  0%,100% { transform: rotate(-8deg) translateY(0); }
  50%     { transform: rotate(-8deg) translateY(-2px); }
}

.spx-lg { width: 116px; height: 116px; filter: drop-shadow(0 6px 8px rgba(120,90,70,0.18)); }
.spx-peek {
  position: absolute; top: -42px; right: 28px;
  width: 72px; height: 72px;
  filter: drop-shadow(0 5px 7px rgba(120,90,70,0.22));
}
.spx-deliver {
  position: absolute; top: -40px; left: 18px;
  width: 66px; height: 66px;
  filter: drop-shadow(0 5px 7px rgba(120,90,70,0.22));
}

/* speech bubble */
.spx-says {
  position: relative;
  background: var(--card);
  color: var(--ink);
  font-size: 13px; font-weight: 700;
  padding: 9px 15px;
  border-radius: 14px;
  box-shadow: 0 4px 14px rgba(120,90,70,0.12);
  max-width: 280px;
}
.spx-says::after {
  content: "";
  position: absolute; top: -7px; left: 50%;
  width: 14px; height: 14px;
  background: var(--card);
  transform: translateX(-50%) rotate(45deg);
  border-radius: 3px;
}

/* a feather drifts when a thought is kept */
.feather {
  position: fixed;
  width: 26px; height: 26px;
  pointer-events: none;
  z-index: 60;
  background: no-repeat center/contain;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M20 4 C10 6 5 13 4 21 L7 21 C8 15 12 9 20 6 Z M9 17 C12 12 15 9 19 7' fill='%23eba35c' stroke='%23cf9a72' stroke-width='0.6'/></svg>");
  animation: feather-fall 1500ms cubic-bezier(.3,.1,.5,1) forwards;
}
@keyframes feather-fall {
  0%   { opacity: 0; transform: translate(0,-10px) rotate(-10deg); }
  15%  { opacity: 1; }
  100% { opacity: 0; transform: translate(36px, 150px) rotate(140deg); }
}
@media (prefers-reduced-motion: reduce) {
  .spx-b, .spx-eye, .feather { animation: none !important; }
}

/* ───────── small screens ───────── */
@media (max-width: 560px) {
  .app-header { grid-template-columns: 1fr; gap: 12px; padding: 14px 18px; }
  .app-search { max-width: 100%; }
  .catalog { padding: 20px 14px 44px; }
}
