:root {
  --bg: #fff8ef;
  --bg-2: #ffe4d6;
  --surface: rgba(255, 251, 247, 0.88);
  --surface-2: #fff1e6;
  --surface-3: #fff7f2;
  --line: rgba(88, 56, 39, 0.12);
  --text: #26170f;
  --muted: #7f6153;
  --hot: #ff7a59;
  --hot-2: #ff5b3d;
  --yellow: #ffd166;
  --pink: #ffb4c8;
  --mint: #bce5cc;
  --shadow: 0 20px 40px rgba(159, 92, 57, 0.13);
  --radius-xl: 30px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --container: 1180px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "DM Sans", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 15% 10%, rgba(255, 122, 89, 0.15), transparent 20%),
    radial-gradient(circle at 90% 18%, rgba(255, 209, 102, 0.24), transparent 24%),
    radial-gradient(circle at 72% 80%, rgba(255, 180, 200, 0.18), transparent 24%),
    linear-gradient(180deg, #fffaf5 0%, var(--bg) 50%, var(--bg-2) 100%);
}

body.landing-page {
  display: grid;
  align-items: center;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.hidden {
  display: none !important;
}

.app-shell,
.landing-shell {
  width: min(calc(100% - 28px), var(--container));
  margin: 0 auto;
  padding: 18px 0 42px;
}

.app-shell {
  position: relative;
  z-index: 1;
}

.landing-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.16fr) minmax(340px, 0.84fr);
  gap: 24px;
  align-items: stretch;
}

.floating-l-layer {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  user-select: none;
  z-index: 0;
}

.floating-l {
  position: absolute;
  font-family: "DM Sans", sans-serif;
  font-weight: 800;
  line-height: 1;
  opacity: 0.44;
  color: rgba(255, 255, 255, 1);
  text-shadow: 0 0 36px rgba(255, 255, 255, 0.28);
  will-change: transform, opacity;
}

.floating-l.l1 {
  top: 8%;
  left: -12%;
  font-size: clamp(5.4rem, 10vw, 8.8rem);
  animation: driftL1 16s ease-in-out infinite alternate;
}

.floating-l.l2 {
  top: 20%;
  left: 104%;
  font-size: clamp(6.2rem, 12vw, 10rem);
  animation: driftL2 20s ease-in-out infinite alternate;
}

.floating-l.l3 {
  top: 54%;
  left: -10%;
  font-size: clamp(4.8rem, 9vw, 7.6rem);
  animation: driftL3 14s ease-in-out infinite alternate;
}

.floating-l.l4 {
  top: 74%;
  left: 106%;
  font-size: clamp(5.6rem, 11vw, 9rem);
  animation: driftL4 22s ease-in-out infinite alternate;
}

.floating-l.l5 {
  top: 86%;
  left: -14%;
  font-size: clamp(7rem, 14vw, 11rem);
  animation: driftL5 24s ease-in-out infinite alternate;
}

.floating-l.l6 {
  top: -10%;
  left: 72%;
  font-size: clamp(4.6rem, 8vw, 7.2rem);
  animation: driftL6 17s ease-in-out infinite alternate;
}

.floating-l.l7 {
  top: 36%;
  left: 46%;
  font-size: clamp(3.6rem, 7vw, 5.8rem);
  animation: driftL7 19s ease-in-out infinite alternate;
}

.floating-l.l8 {
  top: 6%;
  left: 22%;
  font-size: clamp(5.8rem, 11vw, 9.4rem);
  animation: driftL8 21s ease-in-out infinite alternate;
}

.floating-l.l9 {
  top: 12%;
  left: 18%;
  font-size: clamp(3.2rem, 5vw, 4.8rem);
  animation: driftL9 13s ease-in-out infinite alternate;
}

.floating-l.l10 {
  top: 30%;
  left: 8%;
  font-size: clamp(3.6rem, 5.8vw, 5.2rem);
  animation: driftL10 15s ease-in-out infinite alternate;
}

.floating-l.l11 {
  top: 44%;
  left: 26%;
  font-size: clamp(2.8rem, 4.4vw, 4.2rem);
  animation: driftL11 12s ease-in-out infinite alternate;
}

.floating-l.l12 {
  top: 62%;
  left: 14%;
  font-size: clamp(3.3rem, 5.2vw, 4.8rem);
  animation: driftL12 18s ease-in-out infinite alternate;
}

.floating-l.l13 {
  top: 18%;
  left: 60%;
  font-size: clamp(3rem, 4.8vw, 4.4rem);
  animation: driftL13 16s ease-in-out infinite alternate;
}

.floating-l.l14 {
  top: 38%;
  left: 74%;
  font-size: clamp(3.8rem, 6vw, 5.6rem);
  animation: driftL14 19s ease-in-out infinite alternate;
}

.floating-l.l15 {
  top: 68%;
  left: 58%;
  font-size: clamp(2.8rem, 4.6vw, 4.2rem);
  animation: driftL15 14s ease-in-out infinite alternate;
}

.floating-l.l16 {
  top: 82%;
  left: 80%;
  font-size: clamp(3.4rem, 5.4vw, 5rem);
  animation: driftL16 17s ease-in-out infinite alternate;
}

.floating-l.l17 {
  top: 10%;
  left: 38%;
  font-size: clamp(4.2rem, 7vw, 6.4rem);
  animation: driftL17 18s ease-in-out infinite alternate;
}

.floating-l.l18 {
  top: 26%;
  left: 88%;
  font-size: clamp(3.6rem, 6vw, 5.4rem);
  animation: driftL18 16s ease-in-out infinite alternate;
}

.floating-l.l19 {
  top: 48%;
  left: 64%;
  font-size: clamp(5rem, 9vw, 7.8rem);
  animation: driftL19 22s ease-in-out infinite alternate;
}

.floating-l.l20 {
  top: 78%;
  left: 34%;
  font-size: clamp(4.4rem, 8vw, 6.8rem);
  animation: driftL20 19s ease-in-out infinite alternate;
}

.floating-l.l21 {
  top: 58%;
  left: 92%;
  font-size: clamp(3.2rem, 5.4vw, 5rem);
  animation: driftL21 15s ease-in-out infinite alternate;
}

.floating-l.l22 {
  top: 4%;
  left: 84%;
  font-size: clamp(2.8rem, 4.6vw, 4.2rem);
  animation: driftL22 14s ease-in-out infinite alternate;
}

.floating-l.l23 {
  top: 88%;
  left: 8%;
  font-size: clamp(3.8rem, 6.2vw, 5.8rem);
  animation: driftL23 17s ease-in-out infinite alternate;
}

.floating-l.l24 {
  top: 40%;
  left: 2%;
  font-size: clamp(4.8rem, 8.4vw, 7.2rem);
  animation: driftL24 20s ease-in-out infinite alternate;
}

.card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
  overflow: hidden;
}

.card::after {
  content: "";
  position: absolute;
  inset: auto auto 0 0;
  width: 120px;
  height: 120px;
  background: radial-gradient(circle, rgba(255, 209, 102, 0.12), transparent 70%);
  pointer-events: none;
}

.hero-card,
.auth-panel,
.form-card,
.reaction-card,
.history-top,
.chart-card {
  padding: 24px;
}

.hero-panel,
.auth-panel {
  min-height: 100%;
}

.hero-card {
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 26px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 122, 89, 0.14);
  border: 1px solid rgba(255, 122, 89, 0.16);
  color: var(--hot-2);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.03em;
}

.tagline {
  margin-top: 12px;
  color: var(--muted);
  font-size: 1rem;
  font-weight: 700;
}

h1,
h2,
h3,
strong {
  margin: 0;
  font-family: "DM Sans", sans-serif;
  font-weight: 800;
  letter-spacing: -0.04em;
}

h1 {
  margin-top: 12px;
  font-size: clamp(2.4rem, 7vw, 5.2rem);
  line-height: 0.93;
  text-wrap: balance;
}

h2 {
  font-size: clamp(1.35rem, 2.6vw, 2rem);
  line-height: 1.02;
  text-wrap: balance;
}

h3 {
  font-size: 1.15rem;
}

p {
  margin: 0;
}

.muted,
.hero-copy,
.tiny-note,
small,
.stack-item-meta,
.history-meta {
  color: var(--muted);
}

.hero-copy {
  margin-top: 14px;
  max-width: 38ch;
  font-size: 1.02rem;
  line-height: 1.65;
}

.hero-copy-stack {
  display: grid;
  justify-items: start;
  align-content: start;
  gap: 0;
  max-width: 42rem;
}

.hero-badges,
.mini-list,
.insights-summary,
.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.badge,
.insight-pill,
.pill,
.mini-list span {
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid rgba(88, 56, 39, 0.1);
  box-shadow: 0 10px 18px rgba(88, 56, 39, 0.06);
  font-size: 0.88rem;
}

.cat-spotlight {
  display: grid;
  grid-template-columns: minmax(245px, 315px) minmax(180px, 1fr);
  gap: 18px;
  align-items: center;
}

.cat-frame {
  position: relative;
  display: grid;
}

.hero-mascot-block {
  align-self: end;
}

.hero-caption {
  max-width: 236px;
  align-self: center;
  justify-self: start;
  margin: 0;
}

.cat-hero,
.cat-panel-image,
.hero-strip-cat img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 28px;
  border: 2px solid rgba(38, 23, 15, 0.06);
  background: linear-gradient(180deg, #fff4ec 0%, #ffe8db 100%);
  box-shadow: 0 18px 36px rgba(120, 69, 42, 0.14);
}

.speech-bubble {
  padding: 18px 18px 18px 20px;
  border-radius: 20px;
  background: linear-gradient(180deg, #fffdfa 0%, #fff0e5 100%);
  border: 1px solid rgba(88, 56, 39, 0.1);
  font-weight: 700;
  line-height: 1.55;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: start;
  margin-bottom: 16px;
}

.auth-panel {
  display: flex;
  align-items: stretch;
}

.auth-panel-inner {
  width: 100%;
  display: grid;
  align-content: center;
  gap: 18px;
  max-width: 440px;
  margin: 0 auto;
}

.auth-heading {
  gap: 20px;
  margin-bottom: 0;
  align-items: start;
}

.auth-heading .muted {
  max-width: 17ch;
  padding-top: 10px;
  line-height: 1.45;
}

.auth-tabs {
  display: inline-flex;
  gap: 6px;
  padding: 6px;
  width: fit-content;
  border-radius: 999px;
  background: rgba(255, 122, 89, 0.12);
}

.tab-button,
.top-nav a {
  border: 0;
  background: transparent;
  color: var(--muted);
  transition: transform 0.16s ease, background 0.16s ease, color 0.16s ease;
}

.tab-button {
  padding: 10px 16px;
  border-radius: 999px;
  font-weight: 700;
}

.tab-button.active {
  color: var(--text);
  background: white;
  box-shadow: 0 10px 18px rgba(88, 56, 39, 0.08);
}

.auth-form,
.form-grid,
.inline-form,
.filter-row {
  display: grid;
  gap: 14px;
}

.auth-form {
  gap: 13px;
}

.auth-form label,
.form-grid label,
.filter-row label {
  display: grid;
  gap: 8px;
}

label span {
  font-size: 0.88rem;
  font-weight: 800;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid rgba(88, 56, 39, 0.12);
  background: rgba(255, 255, 255, 0.92);
  border-radius: 16px;
  padding: 14px 15px;
  color: var(--text);
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

input::placeholder,
textarea::placeholder {
  color: rgba(127, 97, 83, 0.88);
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: rgba(255, 91, 61, 0.34);
  box-shadow: 0 0 0 4px rgba(255, 122, 89, 0.12);
}

.password-field {
  position: relative;
  display: grid;
  align-items: center;
}

.password-field input {
  padding-right: 52px;
}

.password-toggle {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 12px;
  background: rgba(255, 122, 89, 0.1);
  color: var(--hot-2);
  font-size: 1rem;
  line-height: 1;
  transition: background 0.16s ease, transform 0.16s ease;
}

.password-toggle-icon {
  width: 16px;
  height: 16px;
}

.password-toggle:hover {
  background: rgba(255, 122, 89, 0.18);
}

.password-toggle:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px rgba(255, 122, 89, 0.14);
}

textarea {
  resize: vertical;
}

.primary-button,
.ghost-button,
.danger-button {
  border: 0;
  border-radius: 16px;
  padding: 13px 18px;
  font-weight: 800;
  transition: transform 0.16s ease, box-shadow 0.16s ease, filter 0.16s ease;
}

.primary-button:hover,
.ghost-button:hover,
.danger-button:hover,
.top-nav a:hover {
  transform: translateY(-1px) rotate(-0.3deg);
}

.primary-button {
  background: linear-gradient(135deg, var(--hot) 0%, var(--hot-2) 100%);
  color: white;
  box-shadow: 0 14px 24px rgba(255, 91, 61, 0.22);
}

.auth-cta {
  margin-top: 2px;
}

.ghost-button {
  background: rgba(255, 255, 255, 0.84);
  border: 1px solid rgba(88, 56, 39, 0.1);
  color: var(--text);
}

.danger-button {
  background: rgba(255, 91, 61, 0.12);
  color: var(--hot-2);
}

.alert {
  padding: 14px 16px;
  border-radius: 16px;
  font-size: 0.94rem;
  line-height: 1.5;
}

.alert.success {
  background: rgba(188, 229, 204, 0.42);
  color: #214831;
  border: 1px solid rgba(33, 72, 49, 0.1);
}

.alert.error {
  background: rgba(255, 122, 89, 0.14);
  color: #7a2f1f;
  border: 1px solid rgba(122, 47, 31, 0.08);
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 0 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.brand strong,
.brand span {
  display: block;
}

.brand span:last-child {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.88rem;
}

.brand-mark {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 18px;
  background: linear-gradient(135deg, #ffd8b0 0%, #ff8f70 100%);
  border: 1px solid rgba(88, 56, 39, 0.08);
  box-shadow: 0 12px 24px rgba(255, 122, 89, 0.18);
}

.brand-mark-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.top-nav,
.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.top-nav a {
  padding: 11px 13px;
  border-radius: 14px;
  font-size: 0.92rem;
  font-weight: 700;
}

.top-nav a.active {
  background: rgba(255, 255, 255, 0.82);
  color: var(--text);
  box-shadow: 0 10px 20px rgba(88, 56, 39, 0.05);
}

.user-pill {
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.84);
  border: 1px solid rgba(88, 56, 39, 0.08);
  color: var(--muted);
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.header-actions .ghost-button,
.inline-form .primary-button,
.auth-cta,
.form-grid > .primary-button {
  min-height: 48px;
}

.page-grid,
.page-stack,
.dashboard-main,
.dashboard-side,
.stack-list,
.history-grid,
.insights-grid {
  display: grid;
  gap: 16px;
}

.page-stack {
  align-content: start;
}

.hero-strip {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 18px;
  align-items: center;
  padding: 24px;
}

.hero-strip h1 {
  font-size: clamp(2rem, 5vw, 3.6rem);
}

.hero-strip-cat {
  display: grid;
  gap: 12px;
  align-items: center;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
}

.stat-card {
  padding: 18px;
  transform: rotate(var(--tilt, 0deg));
}

.stat-card:nth-child(2) {
  --tilt: -0.5deg;
}

.stat-card:nth-child(3) {
  --tilt: 0.4deg;
}

.stat-card:nth-child(4) {
  --tilt: -0.35deg;
}

.stat-card:nth-child(5) {
  --tilt: 0.5deg;
}

.stat-card span {
  display: inline-block;
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 8px;
}

.stat-card strong {
  display: block;
  font-size: 1.5rem;
  line-height: 1.05;
}

.stat-card small {
  display: block;
  margin-top: 8px;
  font-size: 0.84rem;
  line-height: 1.4;
}

.reaction-stat {
  background: linear-gradient(180deg, rgba(255, 180, 200, 0.22), rgba(255, 255, 255, 0.86));
}

.dashboard-columns,
.content-split {
  display: grid;
  grid-template-columns: 1.35fr 0.95fr;
  gap: 18px;
}

.dashboard-side > .card {
  padding: 18px;
  height: 100%;
}

.dashboard-side > .card .section-heading {
  margin-bottom: 14px;
}

#habitList,
#recentLogs {
  align-content: start;
  min-height: 100%;
}

#habitList .stack-item,
#recentLogs .stack-item {
  min-height: 100%;
}

#habitList .stack-item,
#recentLogs .stack-item,
.history-card,
.insight-card {
  box-shadow: 0 10px 20px rgba(88, 56, 39, 0.05);
}

.stack-item,
.history-card,
.insight-card,
.cat-reaction-panel {
  padding: 18px;
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(88, 56, 39, 0.1);
}

.history-card,
.insight-card {
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

.stack-item-header,
.history-card-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
}

.stack-item p,
.history-card p,
.insight-card p,
.cat-reaction-panel p {
  margin-top: 10px;
  line-height: 1.55;
}

.inline-form {
  grid-template-columns: 1fr auto;
  margin-bottom: 12px;
}

.pill {
  color: var(--hot-2);
  background: rgba(255, 122, 89, 0.12);
}

.mini-list {
  margin-top: 12px;
}

.mini-list span {
  background: rgba(255, 255, 255, 0.72);
}

.form-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.full-width {
  grid-column: 1 / -1;
}

.reaction-card {
  align-self: start;
  background:
    radial-gradient(circle at top right, rgba(255, 209, 102, 0.2), transparent 25%),
    var(--surface);
}

.reaction-card .mini-list {
  flex-direction: column;
}

.suggestion-row {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: -6px;
}

.suggestion-chip {
  border: 0;
  border-radius: 999px;
  padding: 8px 12px;
  background: rgba(255, 122, 89, 0.12);
  color: var(--hot-2);
  font-weight: 700;
  box-shadow: 0 8px 16px rgba(88, 56, 39, 0.05);
  transition: transform 0.16s ease, background 0.16s ease;
}

.suggestion-chip:hover {
  transform: translateY(-1px);
  background: rgba(255, 122, 89, 0.18);
}

.filter-row {
  grid-template-columns: minmax(0, 1fr) minmax(0, 220px) auto;
  align-items: end;
}

.history-grid,
.insights-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  align-items: stretch;
}

.history-grid > .empty-state,
.insights-grid > .empty-state,
.history-grid > .card.empty-state,
.insights-grid > .card.empty-state {
  grid-column: 1 / -1;
  min-height: 100%;
}

.history-card {
  background: linear-gradient(180deg, rgba(255,255,255,0.88), rgba(255, 245, 238, 0.88));
}

.history-top {
  padding: 26px;
}

.history-top {
  display: grid;
  gap: 18px;
}

.history-top .section-heading {
  margin-bottom: 0;
}

.history-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
  font-size: 0.86rem;
}

.insights-page {
  gap: 18px;
}

.insights-top-row {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(320px, 0.92fr);
  gap: 18px;
  align-items: stretch;
}

.insights-hero-card {
  min-height: 320px;
  display: grid;
  align-content: space-between;
  gap: 20px;
  padding: 24px 24px 20px;
}

.insights-hero-heading {
  margin-bottom: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(156px, 210px);
  gap: 16px;
  align-items: start;
}

.insights-hero-copy {
  display: grid;
  align-content: start;
  gap: 10px;
}

.insights-hero-copy h1 {
  max-width: 5.6ch;
  font-size: clamp(3.8rem, 7vw, 5.2rem);
}

.insights-hero-note {
  max-width: 16ch;
  justify-self: end;
  margin-top: 6px;
  font-size: 0.95rem;
  line-height: 1.45;
  text-align: left;
}

.insights-cat-card {
  padding: 18px 20px 20px;
  min-height: 320px;
  display: grid;
  grid-template-rows: minmax(210px, auto) auto auto;
  align-content: start;
  gap: 10px;
}

.insights-cat-card img {
  width: 100%;
  max-width: 290px;
  margin: 0 auto;
  border-radius: 24px;
  align-self: center;
}

.insights-cat-card .section-heading {
  margin-top: 2px;
  margin-bottom: 0;
}

.insights-cat-card #insightsCatLine {
  margin-top: 0;
}

.insight-card {
  min-height: 190px;
  background: linear-gradient(180deg, rgba(255, 251, 247, 0.95), rgba(255, 238, 227, 0.86));
  padding: 16px 16px 14px;
  gap: 0;
  display: grid;
  grid-template-rows: auto auto auto 1fr;
}

.insight-card .eyebrow {
  width: fit-content;
  margin-bottom: 12px;
}

.insight-card h3 {
  font-size: 1.15rem;
}

.insight-card p {
  margin-top: 8px;
}

.insight-card .muted {
  margin-top: auto;
  padding-top: 12px;
}

.insights-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  align-items: stretch;
}

.empty-state {
  text-align: center;
  padding: 26px;
}

.empty-state img {
  width: min(220px, 100%);
  margin: 0 auto 14px;
}

.empty-state h3 {
  margin-bottom: 8px;
}

.chart-card canvas {
  margin-top: 8px;
}

.cat-reaction-panel {
  background:
    linear-gradient(180deg, rgba(255, 180, 200, 0.14), rgba(255,255,255,0.8)),
    white;
}

.auth-note {
  margin-top: 2px;
  padding-top: 4px;
}

.history-grid > .empty-state,
.insights-grid > .empty-state,
.history-grid > .card.empty-state,
.insights-grid > .card.empty-state {
  min-height: 280px;
  display: grid;
  place-items: center;
  align-content: center;
}

@media (max-width: 1080px) {
  .landing-shell,
  .hero-strip,
  .dashboard-columns,
  .content-split {
    grid-template-columns: 1fr;
  }

  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .history-grid,
  .insights-grid {
    grid-template-columns: 1fr;
  }

  .app-header {
    flex-wrap: wrap;
  }

  .auth-heading {
    display: grid;
    gap: 10px;
  }

  .auth-heading .muted {
    max-width: none;
    padding-top: 0;
  }

  .auth-panel-inner {
    max-width: none;
  }

  .hero-card {
    gap: 20px;
  }

  .cat-spotlight {
    grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
  }

  .history-top,
  .insights-hero-card {
    padding: 22px;
  }

  .insights-top-row {
    grid-template-columns: 1fr;
  }

  .insights-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .insights-hero-heading {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .insights-hero-card,
  .insights-cat-card {
    min-height: auto;
  }

  .insights-hero-note {
    justify-self: start;
    max-width: 28ch;
  }
}

@media (max-width: 760px) {
  .app-shell,
  .landing-shell {
    width: min(calc(100% - 18px), var(--container));
    padding-top: 12px;
    padding-bottom: 28px;
  }

  .hero-card,
  .auth-panel,
  .form-card,
  .reaction-card,
  .history-top,
  .chart-card,
  .stat-card {
    padding: 18px;
  }

  .cat-spotlight,
  .section-heading,
  .stack-item-header,
  .history-card-top,
  .top-nav,
  .header-actions,
  .form-grid,
  .filter-row,
  .inline-form {
    display: grid;
    grid-template-columns: 1fr;
  }

  .stats-grid,
  .history-grid,
  .insights-grid {
    grid-template-columns: 1fr;
  }

  .top-nav {
    width: 100%;
    overflow-x: auto;
    padding: 0 2px 6px;
    gap: 10px;
    scrollbar-width: none;
    -ms-overflow-style: none;
    scroll-snap-type: x proximity;
  }

  .top-nav::-webkit-scrollbar {
    display: none;
  }

  .top-nav a {
    flex: 0 0 auto;
    scroll-snap-align: start;
    white-space: nowrap;
  }

  .header-actions {
    width: 100%;
    gap: 10px;
  }

  .hero-copy {
    max-width: none;
    font-size: 0.98rem;
    line-height: 1.58;
  }

  .hero-caption {
    max-width: none;
    margin-bottom: 0;
  }

  .hero-card {
    gap: 18px;
  }

  .cat-spotlight {
    gap: 14px;
    align-items: start;
  }

  .suggestion-row {
    margin-top: 0;
  }

  h1 {
    font-size: clamp(2rem, 12vw, 3.3rem);
  }

  h2 {
    font-size: clamp(1.3rem, 6vw, 1.8rem);
  }

  .app-header {
    gap: 12px;
    padding: 6px 0 18px;
  }

  .brand {
    width: 100%;
    gap: 10px;
  }

  .brand-mark {
    width: 46px;
    height: 46px;
    border-radius: 16px;
  }

  .brand strong {
    font-size: 0.98rem;
  }

  .brand span:last-child {
    font-size: 0.8rem;
  }

  .user-pill,
  .header-actions .ghost-button {
    flex: 1 1 auto;
  }

  .user-pill {
    max-width: none;
    min-width: 0;
  }

  .hero-strip {
    gap: 16px;
    padding: 18px;
  }

  .hero-strip h1 {
    font-size: clamp(1.9rem, 10vw, 2.8rem);
  }

  .hero-strip-cat {
    gap: 10px;
  }

  .stats-grid {
    gap: 12px;
  }

  .stat-card {
    padding: 16px;
    transform: none;
  }

  .stat-card strong {
    font-size: 1.32rem;
  }

  .dashboard-columns,
  .content-split,
  .insights-top-row {
    gap: 14px;
  }

  .dashboard-side > .card,
  .chart-card,
  .history-top,
  .insights-hero-card,
  .insights-cat-card,
  .form-card,
  .reaction-card {
    padding: 18px;
  }

  .inline-form {
    gap: 10px;
  }

  .inline-form .primary-button {
    width: 100%;
  }

  .section-heading {
    gap: 10px;
    margin-bottom: 14px;
  }

  .section-heading > .muted,
  .section-heading p.muted {
    max-width: none;
  }

  .filter-row {
    gap: 12px;
  }

  .filter-button {
    width: 100%;
  }

  .history-top {
    gap: 14px;
  }

  .history-meta {
    gap: 6px;
  }

  .insights-hero-card {
    gap: 16px;
  }

  .insights-hero-copy h1 {
    max-width: none;
    font-size: clamp(2.6rem, 14vw, 4rem);
  }

  .insights-hero-note {
    font-size: 0.92rem;
    line-height: 1.5;
  }

  .insight-card {
    min-height: 0;
    padding: 16px;
  }

  .insight-card .muted {
    padding-top: 10px;
  }

  .auth-panel {
    align-items: start;
  }

  .auth-panel-inner {
    align-content: start;
    padding-top: 2px;
    gap: 16px;
  }

  .auth-heading {
    gap: 8px;
  }

  .auth-tabs {
    width: 100%;
    justify-content: space-between;
  }

  .tab-button {
    flex: 1 1 0;
    text-align: center;
  }

  .auth-form {
    gap: 12px;
  }

  .password-toggle {
    width: 36px;
    height: 36px;
  }

  body::before,
  body::after,
  .app-shell::before,
  .app-shell::after,
  .floating-l-layer {
    display: none;
  }
}

@media (max-width: 560px) {
  .app-shell,
  .landing-shell {
    width: min(calc(100% - 14px), var(--container));
    padding-top: 10px;
  }

  .card,
  .stack-item,
  .history-card,
  .insight-card,
  .cat-reaction-panel {
    border-radius: 22px;
  }

  .hero-card,
  .auth-panel,
  .form-card,
  .reaction-card,
  .history-top,
  .chart-card,
  .stat-card,
  .hero-strip,
  .dashboard-side > .card,
  .insights-hero-card,
  .insights-cat-card {
    padding: 16px;
  }

  .hero-copy-stack h1,
  .hero-strip h1 {
    letter-spacing: -0.05em;
  }

  .cat-spotlight {
    gap: 12px;
  }

  .hero-mascot-block,
  .hero-caption {
    width: 100%;
  }

  .hero-caption {
    padding: 16px 16px 15px;
    font-size: 0.96rem;
  }

  .badge,
  .insight-pill,
  .pill,
  .mini-list span,
  .suggestion-chip {
    font-size: 0.82rem;
  }

  input,
  select,
  textarea {
    padding: 13px 14px;
    font-size: 16px;
  }

  .password-field input {
    padding-right: 48px;
  }

  .top-nav a,
  .ghost-button,
  .primary-button,
  .danger-button,
  .tab-button {
    font-size: 0.94rem;
  }

  .top-nav a {
    padding: 10px 12px;
  }

  .user-pill {
    padding: 9px 12px;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .hero-strip-cat img,
  .cat-panel-image {
    max-width: 280px;
    margin: 0 auto;
  }

  .insights-grid {
    grid-template-columns: 1fr;
  }
}

@keyframes driftL1 {
  0% { transform: translate3d(-1vw, 0, 0) rotate(-18deg); opacity: 0.08; }
  50% { transform: translate3d(4vw, -2vh, 0) rotate(-8deg); opacity: 0.15; }
  100% { transform: translate3d(10vw, 3vh, 0) rotate(6deg); opacity: 0.1; }
}

@keyframes driftL2 {
  0% { transform: translate3d(1vw, 0, 0) rotate(14deg); opacity: 0.08; }
  50% { transform: translate3d(-6vw, 3vh, 0) rotate(8deg); opacity: 0.16; }
  100% { transform: translate3d(-12vw, -2vh, 0) rotate(-14deg); opacity: 0.11; }
}

@keyframes driftL3 {
  0% { transform: translate3d(-2vw, 1vh, 0) rotate(-10deg); opacity: 0.07; }
  50% { transform: translate3d(3vw, -4vh, 0) rotate(-2deg); opacity: 0.13; }
  100% { transform: translate3d(8vw, 2vh, 0) rotate(12deg); opacity: 0.09; }
}

@keyframes driftL4 {
  0% { transform: translate3d(0, -1vh, 0) rotate(12deg); opacity: 0.08; }
  50% { transform: translate3d(-5vw, 3vh, 0) rotate(18deg); opacity: 0.15; }
  100% { transform: translate3d(-11vw, -3vh, 0) rotate(6deg); opacity: 0.1; }
}

@keyframes driftL5 {
  0% { transform: translate3d(-1vw, 0, 0) rotate(-7deg); opacity: 0.08; }
  50% { transform: translate3d(5vw, -3vh, 0) rotate(-1deg); opacity: 0.16; }
  100% { transform: translate3d(12vw, 2vh, 0) rotate(9deg); opacity: 0.1; }
}

@keyframes driftL6 {
  0% { transform: translate3d(0, -2vh, 0) rotate(18deg); opacity: 0.08; }
  50% { transform: translate3d(-4vw, 4vh, 0) rotate(8deg); opacity: 0.15; }
  100% { transform: translate3d(3vw, 10vh, 0) rotate(-10deg); opacity: 0.1; }
}

@keyframes driftL7 {
  0% { transform: translate3d(0, 0, 0) rotate(-14deg); opacity: 0.07; }
  50% { transform: translate3d(4vw, -3vh, 0) rotate(-6deg); opacity: 0.12; }
  100% { transform: translate3d(-3vw, 4vh, 0) rotate(4deg); opacity: 0.09; }
}

@keyframes driftL8 {
  0% { transform: translate3d(0, -1vh, 0) rotate(10deg); opacity: 0.08; }
  50% { transform: translate3d(6vw, 3vh, 0) rotate(2deg); opacity: 0.16; }
  100% { transform: translate3d(-2vw, 8vh, 0) rotate(-8deg); opacity: 0.1; }
}

@keyframes driftL9 {
  0% { transform: translate3d(0, 0, 0) rotate(-8deg); opacity: 0.07; }
  50% { transform: translate3d(5vw, -2vh, 0) rotate(-1deg); opacity: 0.13; }
  100% { transform: translate3d(-2vw, 3vh, 0) rotate(7deg); opacity: 0.09; }
}

@keyframes driftL10 {
  0% { transform: translate3d(0, 0, 0) rotate(9deg); opacity: 0.08; }
  50% { transform: translate3d(-4vw, 2vh, 0) rotate(15deg); opacity: 0.13; }
  100% { transform: translate3d(3vw, -3vh, 0) rotate(-4deg); opacity: 0.09; }
}

@keyframes driftL11 {
  0% { transform: translate3d(0, 0, 0) rotate(-12deg); opacity: 0.07; }
  50% { transform: translate3d(3vw, 3vh, 0) rotate(-4deg); opacity: 0.12; }
  100% { transform: translate3d(-4vw, -2vh, 0) rotate(9deg); opacity: 0.09; }
}

@keyframes driftL12 {
  0% { transform: translate3d(0, 0, 0) rotate(8deg); opacity: 0.08; }
  50% { transform: translate3d(4vw, -4vh, 0) rotate(1deg); opacity: 0.13; }
  100% { transform: translate3d(-2vw, 2vh, 0) rotate(-7deg); opacity: 0.09; }
}

@keyframes driftL13 {
  0% { transform: translate3d(0, 0, 0) rotate(-10deg); opacity: 0.08; }
  50% { transform: translate3d(-4vw, 2vh, 0) rotate(-2deg); opacity: 0.13; }
  100% { transform: translate3d(2vw, -3vh, 0) rotate(8deg); opacity: 0.09; }
}

@keyframes driftL14 {
  0% { transform: translate3d(0, 0, 0) rotate(12deg); opacity: 0.08; }
  50% { transform: translate3d(4vw, -3vh, 0) rotate(18deg); opacity: 0.13; }
  100% { transform: translate3d(-3vw, 3vh, 0) rotate(-8deg); opacity: 0.09; }
}

@keyframes driftL15 {
  0% { transform: translate3d(0, 0, 0) rotate(-6deg); opacity: 0.07; }
  50% { transform: translate3d(-3vw, -2vh, 0) rotate(1deg); opacity: 0.12; }
  100% { transform: translate3d(4vw, 3vh, 0) rotate(7deg); opacity: 0.09; }
}

@keyframes driftL16 {
  0% { transform: translate3d(0, 0, 0) rotate(10deg); opacity: 0.08; }
  50% { transform: translate3d(-5vw, 2vh, 0) rotate(4deg); opacity: 0.13; }
  100% { transform: translate3d(2vw, -3vh, 0) rotate(-6deg); opacity: 0.09; }
}

@keyframes driftL17 {
  0% { transform: translate3d(0, 0, 0) rotate(-10deg); opacity: 0.12; }
  50% { transform: translate3d(5vw, -3vh, 0) rotate(-2deg); opacity: 0.24; }
  100% { transform: translate3d(-3vw, 4vh, 0) rotate(8deg); opacity: 0.14; }
}

@keyframes driftL18 {
  0% { transform: translate3d(0, 0, 0) rotate(12deg); opacity: 0.11; }
  50% { transform: translate3d(-4vw, 4vh, 0) rotate(18deg); opacity: 0.22; }
  100% { transform: translate3d(3vw, -2vh, 0) rotate(4deg); opacity: 0.14; }
}

@keyframes driftL19 {
  0% { transform: translate3d(0, 0, 0) rotate(-7deg); opacity: 0.12; }
  50% { transform: translate3d(6vw, 3vh, 0) rotate(2deg); opacity: 0.25; }
  100% { transform: translate3d(-4vw, -4vh, 0) rotate(-10deg); opacity: 0.15; }
}

@keyframes driftL20 {
  0% { transform: translate3d(0, 0, 0) rotate(9deg); opacity: 0.12; }
  50% { transform: translate3d(-5vw, -3vh, 0) rotate(15deg); opacity: 0.23; }
  100% { transform: translate3d(4vw, 2vh, 0) rotate(1deg); opacity: 0.14; }
}

@keyframes driftL21 {
  0% { transform: translate3d(0, 0, 0) rotate(-12deg); opacity: 0.11; }
  50% { transform: translate3d(-4vw, 3vh, 0) rotate(-3deg); opacity: 0.22; }
  100% { transform: translate3d(2vw, -4vh, 0) rotate(7deg); opacity: 0.14; }
}

@keyframes driftL22 {
  0% { transform: translate3d(0, 0, 0) rotate(8deg); opacity: 0.1; }
  50% { transform: translate3d(3vw, 2vh, 0) rotate(14deg); opacity: 0.2; }
  100% { transform: translate3d(-2vw, -3vh, 0) rotate(-2deg); opacity: 0.13; }
}

@keyframes driftL23 {
  0% { transform: translate3d(0, 0, 0) rotate(-9deg); opacity: 0.11; }
  50% { transform: translate3d(4vw, -2vh, 0) rotate(-1deg); opacity: 0.21; }
  100% { transform: translate3d(-3vw, 3vh, 0) rotate(6deg); opacity: 0.14; }
}

@keyframes driftL24 {
  0% { transform: translate3d(0, 0, 0) rotate(11deg); opacity: 0.12; }
  50% { transform: translate3d(5vw, 2vh, 0) rotate(5deg); opacity: 0.24; }
  100% { transform: translate3d(-4vw, -2vh, 0) rotate(-8deg); opacity: 0.15; }
}
