/* Hippo brand on top of Bootstrap 5.3 */
[data-bs-theme="light"] {
  --hippo-brand: #5b4b8a;
  --hippo-brand-rgb: 91, 75, 138;
  --bs-primary: var(--hippo-brand);
  --bs-primary-rgb: var(--hippo-brand-rgb);
  --bs-link-color: var(--hippo-brand);
  --bs-link-color-rgb: var(--hippo-brand-rgb);
  --bs-link-hover-color: #463a6b;
  --bs-body-bg: #f7f6f3;
}
[data-bs-theme="dark"] {
  --hippo-brand: #a594e0;
  --hippo-brand-rgb: 165, 148, 224;
  --bs-primary: var(--hippo-brand);
  --bs-primary-rgb: var(--hippo-brand-rgb);
  --bs-link-color: var(--hippo-brand);
  --bs-link-color-rgb: var(--hippo-brand-rgb);
  --bs-link-hover-color: #c3b8ee;
}
.btn-primary {
  --bs-btn-bg: var(--hippo-brand); --bs-btn-border-color: var(--hippo-brand);
  --bs-btn-hover-bg: #4b3e73; --bs-btn-hover-border-color: #4b3e73;
  --bs-btn-active-bg: #463a6b; --bs-btn-disabled-bg: var(--hippo-brand);
}
[data-bs-theme="dark"] .btn-primary { --bs-btn-color: #16161a; --bs-btn-hover-color: #16161a; --bs-btn-hover-bg: #b8aae8; }
.btn-outline-primary {
  --bs-btn-color: var(--hippo-brand); --bs-btn-border-color: var(--hippo-brand);
  --bs-btn-hover-bg: var(--hippo-brand); --bs-btn-hover-border-color: var(--hippo-brand);
}
.navbar-brand { font-weight: 700; color: var(--hippo-brand) !important; }
.nav-link.active { font-weight: 600; }
.form-check-input:checked { background-color: var(--hippo-brand); border-color: var(--hippo-brand); }
.private-notes { border-style: dashed !important; }
.pre-wrap { white-space: pre-wrap; }
.notification-unread { font-weight: 600; }
.badge-dot { font-size: .65rem; }

/* ---- Charts ---------------------------------------------------------------
   Categorical slots validated with the dataviz palette checker (light and dark).
   Light slots 3 and 4 sit below 3:1 on the surface, so every bar carries a
   visible value label and each chart has a table view. */
[data-bs-theme="light"] {
  --series-1: var(--std-1); --series-2: var(--std-2); --series-3: var(--std-3); --series-4: var(--std-4);
  --series-5: var(--std-5); --series-6: var(--std-6); --series-7: var(--std-7); --series-8: var(--std-8);
  --chart-single: var(--hippo-brand);
  --chart-track: #ecebe6;
}
[data-bs-theme="dark"] {
  --series-1: var(--std-1); --series-2: var(--std-2); --series-3: var(--std-3); --series-4: var(--std-4);
  --series-5: var(--std-5); --series-6: var(--std-6); --series-7: var(--std-7); --series-8: var(--std-8);
  --chart-single: var(--hippo-brand);
  --chart-track: #2b2b29;
}
.bar-chart { display: grid; grid-template-columns: minmax(6rem, 38%) 1fr; gap: .35rem .75rem; align-items: center; }
.bar-chart .bar-label { font-size: .875rem; color: var(--bs-body-color); overflow-wrap: anywhere; }
.bar-chart .bar-cell { display: flex; flex-direction: column; gap: 2px; }   /* 2px gap between grouped bars */
.bar-row { display: flex; align-items: center; gap: .4rem; position: relative; }
.bar { height: 14px; min-width: 2px; border-radius: 0 4px 4px 0; background: var(--chart-single); }
.bar-chart.grouped .bar { height: 10px; }
.bar-value { font-size: .8rem; color: var(--bs-secondary-color); font-variant-numeric: tabular-nums; white-space: nowrap; }
.bar-hit { position: absolute; inset: -3px 0; cursor: default; }          /* hit target larger than the mark */
.bar-hit:hover + .bar, .bar-hit:focus-visible + .bar { filter: brightness(1.12); }
.bar-tip { display: none; position: absolute; left: 0; bottom: 100%; margin-bottom: 4px; z-index: 5; max-width: 100%; white-space: normal;
  background: var(--bs-body-bg); color: var(--bs-body-color); border: 1px solid var(--bs-border-color);
  border-radius: 6px; padding: .2rem .45rem; font-size: .8rem; box-shadow: 0 2px 6px rgba(0,0,0,.12); }
.bar-row:hover .bar-tip, .bar-hit:focus-visible ~ .bar-tip { display: block; }
.chart-legend { display: flex; flex-wrap: wrap; gap: .25rem 1rem; font-size: .85rem; margin-bottom: .5rem; }
.chart-legend .swatch { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: .35rem; vertical-align: middle; }
.s-1 { background: var(--series-1) !important; }
.s-2 { background: var(--series-2) !important; }
.s-3 { background: var(--series-3) !important; }
.s-4 { background: var(--series-4) !important; }
.s-5 { background: var(--series-5) !important; }
.s-6 { background: var(--series-6) !important; }
.s-7 { background: var(--series-7) !important; }
.s-8 { background: var(--series-8) !important; }

/* ---- Hippo coach ---------------------------------------------------------- */
.coach { display: flex; gap: .9rem; align-items: flex-start; }
.coach-hippo { position: relative; flex: 0 0 auto; width: 4.75rem; height: 4.75rem; border-radius: 50%;
  display: grid; place-items: center; font-size: 1.75rem; color: var(--hippo-brand);
  background: rgba(var(--hippo-brand-rgb), .12); }
.coach-bubble { position: relative; flex: 1; background: var(--bs-body-bg); border: 1px solid var(--bs-border-color);
  border-radius: .9rem; padding: .7rem .9rem; }
.coach-bubble::before { content: ""; position: absolute; left: -7px; top: 1.2rem; width: 12px; height: 12px;
  background: inherit; border-left: 1px solid var(--bs-border-color); border-bottom: 1px solid var(--bs-border-color);
  transform: rotate(45deg); }
.coach-zzz { position: absolute; top: -.35rem; right: -.1rem; font-weight: 700; font-size: .9rem; color: var(--bs-secondary-color); }
.coach-sparkle { position: absolute; top: -.3rem; right: -.25rem; font-size: .8rem; color: #eda100; }
.mood-asleep { opacity: .65; }
.mood-concerned > i, .mood-concerned > svg { transform: rotate(-8deg); }
@media (prefers-reduced-motion: no-preference) {
  .mood-happy > i, .mood-happy > svg { animation: hippo-bob 2.4s ease-in-out infinite; }
  .mood-celebrating > i, .mood-celebrating > svg { animation: hippo-bounce 1s ease-in-out infinite; }
  .mood-waiting > i, .mood-waiting > svg { animation: hippo-wiggle 3s ease-in-out infinite; }
  .mood-asleep .coach-zzz { animation: hippo-zzz 2.5s ease-in-out infinite; }
  .mood-concerned > i, .mood-concerned > svg { animation: hippo-sigh 3s ease-in-out infinite; }
  .mood-proud > i, .mood-proud > svg { animation: hippo-bob 3s ease-in-out infinite; }
  .mood-laughing > i, .mood-laughing > svg { animation: hippo-wiggle .6s ease-in-out infinite; }
  .mood-shocked > i, .mood-shocked > svg { animation: hippo-bounce 1.6s ease-in-out 1; }
  .mood-thinking > i, .mood-thinking > svg { animation: hippo-wiggle 4s ease-in-out infinite; }
}
.mood-sad { opacity: .8; }
.mood-sad > i, .mood-sad > svg { transform: rotate(-6deg) translateY(2px); }
.mood-thinking > i, .mood-thinking > svg { transform: rotate(8deg); }
@keyframes hippo-bob { 50% { transform: translateY(-3px); } }
@keyframes hippo-bounce { 30% { transform: translateY(-7px) rotate(-6deg); } 60% { transform: translateY(0) rotate(4deg); } }
@keyframes hippo-wiggle { 0%, 80%, 100% { transform: rotate(0); } 85% { transform: rotate(-10deg); } 90% { transform: rotate(10deg); } 95% { transform: rotate(-6deg); } }
@keyframes hippo-zzz { 0% { opacity: 0; transform: translate(0, 4px); } 50% { opacity: 1; } 100% { opacity: 0; transform: translate(4px, -6px); } }
@keyframes hippo-sigh { 0%, 100% { transform: rotate(-8deg); } 50% { transform: rotate(-8deg) translateY(2px); } }

/* Lottie hippo replaces the icon fallback once it has loaded */
.coach-lottie { position: absolute; inset: 0; }
.coach-lottie svg { width: 100% !important; height: 100% !important; }
.coach-hippo.lottie-ready > i, .coach-hippo.lottie-ready > svg, .coach-hippo.lottie-ready .coach-zzz, .coach-hippo.lottie-ready .coach-sparkle { display: none; }

/* ---- Activity heatmap ----------------------------------------------------
   On/off per day: one brand purple for "logged", taken from the validated
   ordinal ramp for each mode, well clear of the empty-square colour. */
[data-bs-theme="light"] { --hm-0: #ecebe6; --hm-1: #6553bd; }
[data-bs-theme="dark"]  { --hm-0: #2f3237; --hm-1: #988ae6; }
.heatmap { position: relative; margin: 0; }
.heatmap-scroll { overflow-x: auto; padding-bottom: .25rem; scrollbar-width: thin; }
.heatmap-grid { --cell: 12px; --gap: 3px; display: grid; grid-template-columns: 2rem auto; grid-template-rows: auto auto;
  gap: 4px 6px; width: max-content; }
.heatmap-months { grid-column: 2; display: grid; grid-template-columns: repeat(var(--weeks), var(--cell)); column-gap: var(--gap);
  font-size: .7rem; color: var(--bs-secondary-color); height: 1rem; }
.heatmap-months span { white-space: nowrap; }
.heatmap-days { grid-column: 1; grid-row: 2; display: grid; grid-template-rows: repeat(7, var(--cell)); row-gap: var(--gap);
  font-size: .65rem; line-height: var(--cell); color: var(--bs-secondary-color);
  position: sticky; left: 0; z-index: 1; background: var(--bs-card-bg, var(--bs-body-bg)); padding-right: 4px; }
.heatmap-cells { grid-column: 2; grid-row: 2; display: grid; grid-auto-flow: column; grid-template-rows: repeat(7, var(--cell));
  grid-auto-columns: var(--cell); gap: var(--gap); }
.hm-cell { display: inline-block; width: var(--cell, 12px); height: var(--cell, 12px); border-radius: 3px; background: var(--hm-0); }
.hm-1 { background: var(--hm-1); }
.hm-future { background: transparent; box-shadow: inset 0 0 0 1px var(--hm-0); }
.hm-outside { background: transparent; }
.heatmap-cells .hm-today { box-shadow: 0 0 0 2px var(--bs-body-bg), 0 0 0 3px var(--bs-secondary-color); }
.heatmap-cells .hm-cell[data-tip]:hover { outline: 2px solid var(--bs-body-color); outline-offset: 1px; }
.heatmap-legend { display: inline-flex; align-items: center; gap: 4px; }
.heatmap-legend .hm-cell { --cell: 11px; }
.heatmap-tip { position: absolute; z-index: 5; pointer-events: none; transform: translate(-50%, -100%); white-space: nowrap;
  background: var(--bs-body-bg); color: var(--bs-body-color); border: 1px solid var(--bs-border-color);
  border-radius: 6px; padding: .2rem .45rem; font-size: .8rem; box-shadow: 0 2px 6px rgba(0,0,0,.12); }
/* Keep the Mon/Wed/Fri labels in view while the year scrolls on phones */

/* ---- Icons: avatars, entry icons and the picker ------------------------- */
.avatar { display: inline-grid; place-items: center; flex: 0 0 auto; width: 2rem; height: 2rem; border-radius: 50%;
  font-size: 1.2rem; }  /* colours: see Avatar colours below */
.avatar-lg { width: 3rem; height: 3rem; font-size: 1.8rem; }
.avatar-sm { width: 1.5rem; height: 1.5rem; font-size: .9rem; }
.entry-icon { display: inline-grid; place-items: center; flex: 0 0 auto; width: 1.9rem; height: 1.9rem; border-radius: .5rem;
  background: rgba(var(--hippo-brand-rgb), .12); color: var(--hippo-brand); font-size: .9rem; margin-right: .5rem; vertical-align: middle; }
.icon-picker > summary { cursor: pointer; list-style: none; }
.icon-picker > summary::-webkit-details-marker { display: none; }
.icon-picker-current { display: inline-grid; place-items: center; width: 2.75rem; height: 2.75rem; border-radius: .8rem;
  background: rgba(var(--hippo-brand-rgb), .12); color: var(--hippo-brand); font-size: 1.25rem; }
.icon-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(2.75rem, 1fr)); gap: .35rem; }
.icon-tile { position: relative; display: grid; place-items: center; height: 2.75rem; border-radius: .5rem; cursor: pointer;
  border: 1px solid var(--bs-border-color); color: var(--bs-body-color); font-size: 1.15rem; }
.icon-tile[hidden], .icon-grid[hidden], .icon-group[hidden] { display: none; }
.icon-tile input { position: absolute; opacity: 0; pointer-events: none; }
.icon-tile:hover { border-color: var(--hippo-brand); color: var(--hippo-brand); }
.icon-tile:has(input:checked) { background: var(--hippo-brand); border-color: var(--hippo-brand); color: #fff; }
[data-bs-theme="dark"] .icon-tile:has(input:checked) { color: #16161a; }
.icon-tile:has(input:focus-visible) { outline: 2px solid var(--hippo-brand); outline-offset: 2px; }

/* "What Hippo sees" */
.coach-context { white-space: pre-wrap; word-break: break-word; background: var(--bs-tertiary-bg); max-height: 50vh; overflow: auto; }
.coach-info { width: 1.9rem; height: 1.9rem; padding: 0; display: inline-grid; place-items: center; }

/* Standards picker: collapsed frameworks, quiet disclosures for detail */
.standards-fw > summary { list-style: none; cursor: pointer; }
.standards-fw > summary::-webkit-details-marker { display: none; }
.standards-fw .standards-chevron { transition: transform .15s ease; }
.standards-fw[open] .standards-chevron { transform: rotate(180deg); }
.std-more > summary { cursor: pointer; width: fit-content; }
.std-more[open] > summary { margin-bottom: .25rem; }

/* Standards pills: a coloured dot and tint per domain (palette validated for colour-blind
   separation in light and dark; the text label always carries the meaning). */
[data-bs-theme="light"] {
  --std-1: #2a78d6; --std-2: #eb6834; --std-3: #1baf7a; --std-4: #eda100;
  --std-5: #e87ba4; --std-6: #008300; --std-7: #6250d6; --std-8: #e34948;
}
[data-bs-theme="dark"] {
  --std-1: #3987e5; --std-2: #d95926; --std-3: #199e70; --std-4: #c98500;
  --std-5: #d55181; --std-6: #008300; --std-7: #9085e9; --std-8: #e66767;
}
[data-slot="1"] { --std-c: var(--std-1); } [data-slot="2"] { --std-c: var(--std-2); }
[data-slot="3"] { --std-c: var(--std-3); } [data-slot="4"] { --std-c: var(--std-4); }
[data-slot="5"] { --std-c: var(--std-5); } [data-slot="6"] { --std-c: var(--std-6); }
[data-slot="7"] { --std-c: var(--std-7); } [data-slot="8"] { --std-c: var(--std-8); }
.std-pill {
  display: inline-flex; align-items: center; gap: .35em; margin: 0 .25rem .2rem 0;
  padding: .15em .55em; border-radius: 999px; font-size: .75em; font-weight: 600; line-height: 1.3;
  color: var(--bs-body-color); background: var(--bs-tertiary-bg); border: 1px solid var(--bs-border-color);
  white-space: nowrap; vertical-align: middle;
}
.std-pill[data-slot] {
  background: color-mix(in srgb, var(--std-c) 14%, var(--bs-body-bg));
  border-color: color-mix(in srgb, var(--std-c) 55%, var(--bs-body-bg));
}
.std-pill[data-slot]::before, .std-dot {
  content: ""; display: inline-block; width: .6em; height: .6em; border-radius: 50%; flex: none;
  background: var(--std-c, var(--bs-secondary-color));
}
.std-dot:not([data-slot]) { background: transparent; box-shadow: inset 0 0 0 1px var(--bs-secondary-color); }
.std-swatches { display: flex; flex-wrap: wrap; gap: .35rem; }
.std-swatch input { position: absolute; opacity: 0; pointer-events: none; }
.std-swatch span {
  display: inline-flex; width: 1.75rem; height: 1.75rem; border-radius: 50%; cursor: pointer; align-items: center; justify-content: center;
  background: var(--std-c, transparent); box-shadow: inset 0 0 0 1px var(--bs-border-color);
}
.std-swatch input:checked + span { box-shadow: 0 0 0 2px var(--bs-body-bg), 0 0 0 4px var(--bs-body-color); }
.std-swatch input:focus-visible + span { outline: 2px solid var(--bs-primary); outline-offset: 3px; }
.std-swatch .none { background: repeating-linear-gradient(135deg, transparent 0 4px, var(--bs-border-color) 4px 5px); }

/* Entry cards: the whole card is the link to the entry */
[data-bs-theme="light"] { --entry-card-bg: #ffffff; --entry-card-border: rgba(40, 32, 70, .07); --entry-card-shadow: 0 1px 2px rgba(40, 32, 70, .05), 0 4px 14px rgba(40, 32, 70, .05); }
[data-bs-theme="dark"]  { --entry-card-bg: #2a2e34; --entry-card-border: rgba(255, 255, 255, .06); --entry-card-shadow: 0 1px 2px rgba(0, 0, 0, .3); }
.entry-list { display: flex; flex-direction: column; gap: .6rem; }
.entry-card {
  display: flex; align-items: flex-start; gap: .85rem; padding: .9rem 1rem;
  border-radius: 1.1rem; background: var(--entry-card-bg); border: 1px solid var(--entry-card-border);
  box-shadow: var(--entry-card-shadow); color: var(--bs-body-color); text-decoration: none;
  transition: transform .12s ease, box-shadow .12s ease;
}
.entry-card:hover { color: var(--bs-body-color); transform: translateY(-1px);
  box-shadow: var(--entry-card-shadow), 0 6px 18px rgba(40, 32, 70, .08); }
.entry-card:active { transform: none; }
.entry-card:focus-visible { outline: 2px solid var(--bs-primary); outline-offset: 2px; }
.entry-card .entry-icon { margin: .05rem 0 0; flex: none; width: 2.4rem; height: 2.4rem; border-radius: .8rem; font-size: 1.05rem; }
.entry-card-body { display: flex; flex-direction: column; gap: .2rem; min-width: 0; flex: 1; }
.entry-card-title { font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; }
.entry-card-meta, .entry-card-details { font-size: .85rem; color: var(--bs-secondary-color); }
.entry-card-details { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.entry-card-badges .badge { margin-right: .25rem; }
.entry-card-pills { margin-top: .15rem; }
.entry-card-chevron { color: var(--bs-secondary-color); align-self: center; flex: none; }
.entry-empty { padding: 1rem; border-radius: 1.1rem; border: 1px dashed var(--bs-border-color); color: var(--bs-secondary-color); }
@media (prefers-reduced-motion: reduce) { .entry-card { transition: none; } .entry-card:hover { transform: none; } }

/* ---- Design: cards rather than lines, buttons rather than underlined links ---- */
a { text-decoration: none; }
a:not([class]) { font-weight: 500; }
a:not([class]):hover { text-decoration: underline; text-underline-offset: .2em; }
.btn { --bs-btn-border-radius: .8rem; --bs-btn-font-weight: 500; }
.btn-sm { --bs-btn-border-radius: .65rem; }
.form-control, .form-select, .input-group-text { border-radius: .75rem; }
.input-group > :not(:first-child) { border-top-left-radius: 0; border-bottom-left-radius: 0; }
.input-group > :not(:last-child) { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.btn-soft {
  --bs-btn-color: var(--hippo-brand); --bs-btn-bg: rgba(var(--hippo-brand-rgb), .1); --bs-btn-border-color: transparent;
  --bs-btn-hover-color: var(--hippo-brand); --bs-btn-hover-bg: rgba(var(--hippo-brand-rgb), .18); --bs-btn-hover-border-color: transparent;
  --bs-btn-active-color: var(--hippo-brand); --bs-btn-active-bg: rgba(var(--hippo-brand-rgb), .26); --bs-btn-active-border-color: transparent;
  --bs-btn-focus-shadow-rgb: var(--hippo-brand-rgb);
}

/* Cards: soft, rounded, shadow instead of a hard border; headers without a rule */
.card {
  --bs-card-border-radius: 1.1rem; --bs-card-inner-border-radius: calc(1.1rem - 1px);
  --bs-card-border-color: var(--entry-card-border); --bs-card-bg: var(--entry-card-bg); --bs-card-cap-bg: transparent;
  box-shadow: var(--entry-card-shadow);
}
.card-header { border-bottom: 0; padding-bottom: 0; }
.card .card { box-shadow: none; }

/* Lists become stacks of separate cards; lists inside a card lose their rules */
.list-group:not(.list-group-flush) { display: flex; flex-direction: column; gap: .6rem; }
.list-group:not(.list-group-flush) > .list-group-item {
  border: 1px solid var(--entry-card-border); border-radius: 1.1rem; background: var(--entry-card-bg);
  box-shadow: var(--entry-card-shadow); padding: .85rem 1rem;
}
.list-group:not(.list-group-flush) > .list-group-item + .list-group-item { border-top-width: 1px; }
.list-group:not(.list-group-flush) > .list-group-item-action { transition: transform .12s ease, box-shadow .12s ease; }
.list-group:not(.list-group-flush) > .list-group-item-action:hover {
  background: var(--entry-card-bg); transform: translateY(-1px); box-shadow: var(--entry-card-shadow), 0 6px 18px rgba(40, 32, 70, .08);
}
.list-group-flush > .list-group-item { border: 0; background: transparent; padding: .45rem 1rem; }
@media (prefers-reduced-motion: reduce) {
  .list-group:not(.list-group-flush) > .list-group-item-action { transition: none; }
  .list-group:not(.list-group-flush) > .list-group-item-action:hover { transform: none; }
}

/* Navbar: a shadow, not a rule; Settings sections as pills that scroll sideways on phones */
.app-navbar { box-shadow: 0 1px 0 rgba(40, 32, 70, .04), 0 2px 10px rgba(40, 32, 70, .04); }
.settings-nav { position: relative; flex-wrap: nowrap; overflow-x: auto; gap: .35rem; padding-bottom: .25rem; scrollbar-width: none; }
.settings-nav::-webkit-scrollbar { display: none; }
.settings-nav .nav-link { white-space: nowrap; border-radius: 999px; background: rgba(var(--hippo-brand-rgb), .08); color: var(--hippo-brand); padding: .35rem .9rem; }
.settings-nav .nav-link.active { background: var(--hippo-brand); color: var(--bs-body-bg); }

/* Comments as bubbles rather than ruled rows */
.comment-bubble { background: var(--bs-tertiary-bg); border-radius: .9rem; padding: .6rem .75rem; }

/* Avatar colours: a solid circle from the same 8-colour palette as standards pills (or the
   brand lilac by default), with a white glyph in light mode and a near-black one in dark mode. */
[data-bs-theme="light"] { --avatar-ink: #fff; }
[data-bs-theme="dark"]  { --avatar-ink: #16161a; }
.avatar { background: var(--hippo-brand); color: var(--avatar-ink); }
.avatar[data-slot] { background: var(--std-c); }
.avatar-default-swatch { background: var(--hippo-brand) !important; }
/* Small trash button on your own comments */
.comment-delete {
  display: inline-grid; place-items: center; width: 1.75rem; height: 1.75rem; padding: 0; border: 0;
  border-radius: 50%; background: transparent; color: var(--bs-secondary-color); font-size: .8rem;
}
.comment-delete:hover, .comment-delete:focus-visible { background: rgba(var(--bs-danger-rgb), .12); color: var(--bs-danger); }

.min-w-0 { min-width: 0; }

/* Poking the hippo */
.coach-hippo[role="button"] { cursor: pointer; -webkit-tap-highlight-color: transparent; }
.coach-hippo[role="button"]:focus-visible { outline: 2px solid var(--bs-primary); outline-offset: 3px; }
@media (prefers-reduced-motion: no-preference) {
  .poked-happy > i, .poked-happy > svg { animation: hippo-bounce .6s ease-in-out 1; }
  .poked-angry > i, .poked-angry > svg { animation: hippo-shake .5s ease-in-out 1; color: #e34948; }
}
@keyframes hippo-shake { 0%, 100% { transform: translateX(0); } 20%, 60% { transform: translateX(-4px); } 40%, 80% { transform: translateX(4px); } }

/* Development needs on entry forms: wide selectable cards */
.need-options { display: flex; flex-direction: column; gap: .5rem; }
.need-option {
  display: flex; align-items: center; gap: .75rem; padding: .7rem .9rem; margin: 0; cursor: pointer;
  border-radius: 1rem; border: 1px solid var(--bs-border-color); background: var(--entry-card-bg);
  transition: border-color .12s ease, background-color .12s ease;
}
.need-option:hover { border-color: rgba(var(--hippo-brand-rgb), .5); }
.need-option-input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.need-option-check {
  flex: none; display: inline-grid; place-items: center; width: 1.6rem; height: 1.6rem; border-radius: 50%;
  border: 2px solid var(--bs-border-color); color: transparent; font-size: .8rem;
}
.need-option:has(.need-option-input:checked) { border-color: var(--hippo-brand); background: rgba(var(--hippo-brand-rgb), .08); }
.need-option:has(.need-option-input:checked) .need-option-check { background: var(--hippo-brand); border-color: var(--hippo-brand); color: var(--bs-body-bg); }
.need-option:has(.need-option-input:focus-visible) { outline: 2px solid var(--hippo-brand); outline-offset: 2px; }
.need-option-body { display: flex; flex-direction: column; min-width: 0; }
.need-option-title { font-weight: 600; overflow-wrap: anywhere; }
.need-option-meta { font-size: .8rem; color: var(--bs-secondary-color); display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; }
.need-option-meta:empty { display: none; }
.need-option-new { border-style: dashed; cursor: text; }
.need-option-new .need-option-check { color: var(--hippo-brand); border-color: rgba(var(--hippo-brand-rgb), .4); }
.need-option-new .form-control { border: 0; background: transparent; box-shadow: none; padding-left: 0; }
@media (prefers-reduced-motion: reduce) { .need-option { transition: none; } }

/* Navigation menus: soft, rounded dropdowns in the card style */
.app-nav .dropdown-menu {
  --bs-dropdown-border-color: var(--entry-card-border); --bs-dropdown-border-radius: 1rem;
  --bs-dropdown-link-active-bg: rgba(var(--hippo-brand-rgb), .12); --bs-dropdown-link-active-color: var(--hippo-brand);
  box-shadow: var(--entry-card-shadow), 0 8px 24px rgba(40, 32, 70, .1); padding: .4rem;
}
.app-nav .dropdown-item { border-radius: .65rem; padding: .45rem .75rem; }
.app-nav .dropdown-item i, .app-nav .dropdown-item svg { width: 1.1em; text-align: center; }
@media (max-width: 767.98px) {
  /* In the collapsed menu, groups open in place without the floating card look. */
  .app-nav .dropdown-menu { box-shadow: none; border: 0; background: transparent; padding: 0 0 0 1.25rem; }
}

/* Learning types: a grid of cards */
.type-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: .6rem; }
.type-card {
  display: flex; align-items: center; gap: .7rem; padding: .7rem .8rem; border-radius: 1rem;
  background: var(--entry-card-bg); border: 1px solid var(--entry-card-border); box-shadow: var(--entry-card-shadow);
}
.type-card .entry-icon { margin: 0; flex: none; }
.type-card-body { flex: 1; min-width: 0; }
.type-card-name { font-weight: 600; line-height: 1.25; overflow-wrap: anywhere; }
.type-card-meta { font-size: .78rem; color: var(--bs-secondary-color); }
.type-card-actions { display: flex; gap: .3rem; flex: none; }
.type-card.is-archived { box-shadow: none; background: transparent; border-style: dashed; }
.type-card.is-archived .type-card-name, .type-card.is-archived .entry-icon { opacity: .6; }

/* Icon pickers: tap the icon box (or avatar) itself; a small pencil shows it can change */
.icon-picker-trigger { position: relative; display: inline-block; border-radius: .9rem; }
.icon-picker-trigger .avatar { display: grid; }
.icon-picker-trigger:focus-visible { outline: 2px solid var(--hippo-brand); outline-offset: 3px; }
.icon-picker-edit {
  position: absolute; right: -.35rem; bottom: -.35rem; display: grid; place-items: center;
  width: 1.3rem; height: 1.3rem; border-radius: 50%; font-size: .6rem;
  background: var(--hippo-brand); color: var(--bs-body-bg); box-shadow: 0 0 0 2px var(--bs-body-bg);
}
.icon-picker[open] .icon-picker-edit { background: var(--bs-secondary-color); }
.avatar-settings { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1rem; }
.avatar-settings .icon-picker { margin-bottom: 0 !important; }
.avatar-settings .icon-picker[open] { flex-basis: 100%; }

/* Clinical log builder: one card-row per question */
.log-fields { display: flex; flex-direction: column; gap: .5rem; margin-bottom: .75rem; }
.log-field { display: grid; grid-template-columns: 1fr auto; gap: .4rem .5rem; align-items: start;
  padding: .6rem; border: 1px solid var(--bs-border-color); border-radius: .9rem; background: var(--bs-body-bg); }
.log-field-main { display: grid; grid-template-columns: 1fr minmax(9rem, 13rem); gap: .4rem; }
.log-field-options { grid-column: 1; }
.log-field-actions { grid-column: 2; grid-row: 1 / span 2; display: flex; gap: .25rem; }
@media (max-width: 575.98px) {
  .log-field { grid-template-columns: 1fr; }
  .log-field-main { grid-template-columns: 1fr; }
  .log-field-actions { grid-column: 1; grid-row: auto; justify-content: flex-end; }
}

/* Landing page (signed out): hero and features, with sign-in always in view */
.landing { display: grid; gap: 2rem; grid-template-areas: "hero" "signin" "features"; }
.landing-hero { grid-area: hero; }
.landing-signin { grid-area: signin; }
.landing-features { grid-area: features; }
@media (min-width: 992px) {
  .landing { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); grid-template-areas: "hero signin" "features signin";
             column-gap: 3rem; align-items: start; }
  .landing-signin { position: sticky; top: 1.5rem; }
  .landing-hero { padding-top: 1rem; }
}
.landing-eyebrow { display: inline-flex; align-items: center; font-size: .85rem; font-weight: 600; color: var(--hippo-brand);
                   background: rgba(var(--hippo-brand-rgb), .1); border-radius: 999px; padding: .3rem .8rem; margin-bottom: 1rem; }
.landing-title { font-size: clamp(2rem, 5vw, 3.1rem); font-weight: 700; letter-spacing: -.02em; line-height: 1.1; margin-bottom: 1rem; }
.landing-lead { font-size: 1.15rem; color: var(--bs-secondary-color); max-width: 38rem; margin-bottom: 1.25rem; }
.landing-regulators { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: .4rem; }
.landing-regulators li { font-size: .8rem; font-weight: 600; padding: .25rem .65rem; border-radius: 999px;
                         background: var(--entry-card-bg); border: 1px solid var(--entry-card-border); }
.feature-grid { display: grid; gap: .75rem; grid-template-columns: 1fr; }
@media (min-width: 576px) { .feature-grid { grid-template-columns: 1fr 1fr; } }
.feature-card { display: flex; gap: .75rem; align-items: flex-start; padding: 1rem; border-radius: 1rem;
                background: var(--entry-card-bg); border: 1px solid var(--entry-card-border); box-shadow: var(--entry-card-shadow); }
.feature-title { font-size: 1rem; font-weight: 600; margin-bottom: .25rem; }
.feature-text { font-size: .9rem; color: var(--bs-secondary-color); margin: 0; }
.landing-private { font-size: .9rem; color: var(--bs-secondary-color); margin: 1rem 0 0; }
.landing-tagline { font-size: clamp(1.1rem, 2.4vw, 1.35rem); font-weight: 600; font-style: italic; color: var(--hippo-brand);
                   letter-spacing: -.01em; margin-bottom: .25rem; }
.landing-gloss { font-size: .9rem; color: var(--bs-secondary-color); margin-bottom: 1.25rem; }
#frameworks.frameworks-off .row { opacity: .45; pointer-events: none; }
/* Review badges beside a page title: normal badge size, a little apart from the title and each other */
.title-badges { display: inline-flex; align-items: center; gap: .4rem; margin-left: .25rem; font-size: 1rem; font-weight: 400; line-height: 1; }
.title-badges:empty { display: none; }
.title-badges .badge { font-size: .75rem; font-weight: 600; padding: .35em .6em; }
