:root {
  --ink: #223530;
  --muted: #5c6f68;
  --paper: #f8fbf1;
  --mist: #edf8f4;
  --sage: #b8dec8;
  --mint: #c7e6e2;
  --sky: #bfd7ea;
  --lavender: #d9d0f0;
  --butter: #e6dc8f;
  --lichen: #d7e8ba;
  --line: #b8c9c0;
  --deep: #28433c;
  --shadow: rgba(39, 67, 60, 0.14);
  --radius: 8px;
  color-scheme: light;
}

html[data-theme="dark"] {
  --ink: #edf8f4;
  --muted: #aebfb8;
  --paper: #101916;
  --mist: #172520;
  --sage: #86c7a1;
  --mint: #80c9c0;
  --sky: #79a9cf;
  --lavender: #aaa0d5;
  --butter: #d6c969;
  --lichen: #a4c984;
  --line: #315149;
  --deep: #dff3eb;
  --shadow: rgba(0, 0, 0, 0.32);
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  min-height: 100%;
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background-color: var(--paper);
  overflow-x: hidden;
  background-image:
    linear-gradient(90deg, rgba(184, 222, 200, 0.18) 1px, transparent 1px),
    linear-gradient(rgba(191, 215, 234, 0.16) 1px, transparent 1px),
    linear-gradient(145deg, #f8fbf1 0%, #edf8f4 46%, #eff1d3 100%);
  background-size: 34px 34px, 34px 34px, auto;
  letter-spacing: 0;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.42;
  background-image:
    linear-gradient(115deg, transparent 0 23%, rgba(40, 67, 60, 0.08) 23% 24%, transparent 24% 100%),
    linear-gradient(65deg, transparent 0 72%, rgba(40, 67, 60, 0.07) 72% 73%, transparent 73% 100%);
  background-size: 180px 180px, 210px 210px;
  animation: accentDrift 32s linear infinite;
  z-index: -1;
}

html[data-theme="dark"] body {
  background-color: var(--paper);
  background-image:
    linear-gradient(90deg, rgba(128, 201, 192, 0.08) 1px, transparent 1px),
    linear-gradient(rgba(170, 160, 213, 0.07) 1px, transparent 1px),
    linear-gradient(145deg, #101916 0%, #172520 52%, #202617 100%);
}

html[data-theme="dark"] body::before {
  opacity: 0.28;
  filter: invert(1);
}

@keyframes accentDrift {
  from {
    background-position: 0 0, 0 0;
  }
  to {
    background-position: 180px 180px, -210px 210px;
  }
}

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

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

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

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid rgba(40, 67, 60, 0.12);
  background: rgba(248, 251, 241, 0.92);
  backdrop-filter: blur(18px);
}

html[data-theme="dark"] .topbar {
  border-bottom-color: rgba(223, 243, 235, 0.13);
  background: rgba(16, 25, 22, 0.88);
}

.nav-inner {
  width: min(1240px, calc(100% - 24px));
  min-height: 60px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
}

.brand {
  display: inline-flex;
  align-items: center;
  font-weight: 800;
  width: 184px;
}

.brand-logo {
  width: 184px;
  height: auto;
}

html[data-theme="dark"] .brand-logo {
  background: rgba(248, 251, 241, 0.9);
  border-radius: var(--radius);
  padding: 3px;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border: 1px solid rgba(40, 67, 60, 0.24);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, transparent 0 42%, rgba(230, 220, 143, 0.85) 42% 58%, transparent 58%),
    linear-gradient(45deg, var(--sky), var(--sage));
  box-shadow: 0 8px 18px var(--shadow);
  position: relative;
  overflow: hidden;
}

.brand-mark::before,
.brand-mark::after {
  content: "";
  position: absolute;
  border: 1px solid rgba(40, 67, 60, 0.28);
  background: rgba(248, 251, 241, 0.74);
}

.brand-mark::before {
  width: 17px;
  height: 17px;
  left: 5px;
  top: 6px;
  transform: rotate(18deg);
}

.brand-mark::after {
  width: 14px;
  height: 14px;
  right: 6px;
  bottom: 7px;
  border-radius: 50%;
}

.brand span:last-child {
  display: block;
  max-width: 150px;
  line-height: 1.05;
}

.nav-links {
  display: flex;
  justify-content: center;
  gap: 4px;
  flex-wrap: wrap;
  min-width: 0;
}

.nav-links a,
.account-actions a,
.account-actions button,
.button,
.icon-button,
.chip,
.segmented button {
  min-height: 38px;
  border: 1px solid rgba(40, 67, 60, 0.18);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.42);
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 12px;
  cursor: pointer;
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.nav-links a,
.account-actions a,
.account-actions button,
.theme-toggle {
  min-height: 34px;
  padding: 0 10px;
  font-size: 0.9rem;
}

.theme-toggle {
  border: 1px solid rgba(40, 67, 60, 0.18);
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(191, 215, 234, 0.55), rgba(230, 220, 143, 0.42));
  color: var(--ink);
  cursor: pointer;
}

html[data-theme="dark"] .theme-toggle {
  border-color: rgba(223, 243, 235, 0.18);
  background: linear-gradient(135deg, rgba(128, 201, 192, 0.2), rgba(170, 160, 213, 0.2));
  color: #edf8f4;
}

html[data-theme="dark"] .nav-links a,
html[data-theme="dark"] .account-actions a,
html[data-theme="dark"] .account-actions button,
html[data-theme="dark"] .chip,
html[data-theme="dark"] .segmented button,
html[data-theme="dark"] .icon-button {
  background: rgba(223, 243, 235, 0.1);
  border-color: rgba(223, 243, 235, 0.22);
  color: #edf8f4;
}

.nav-links a:hover,
.account-actions a:hover,
.account-actions button:hover,
.button:hover,
.icon-button:hover,
.chip:hover,
.segmented button:hover {
  transform: translateY(-1px);
  border-color: rgba(40, 67, 60, 0.36);
  box-shadow: 0 8px 18px var(--shadow);
}

.nav-links a.active,
.segmented button.active,
.chip.active {
  background: var(--deep);
  color: #f8fbf1;
  border-color: var(--deep);
}

html[data-theme="dark"] .nav-links a.active,
html[data-theme="dark"] .segmented button.active,
html[data-theme="dark"] .chip.active {
  background: #dff3eb;
  border-color: #dff3eb;
  color: #101916;
  text-shadow: none;
}

.account-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
}

.avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid rgba(40, 67, 60, 0.26);
  background:
    linear-gradient(45deg, rgba(217, 208, 240, 0.88), rgba(199, 230, 226, 0.88)),
    var(--mist);
  color: var(--deep);
  display: inline-grid;
  place-items: center;
  font-weight: 800;
  overflow: hidden;
  flex: 0 0 auto;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar.large {
  width: 96px;
  height: 96px;
  font-size: 1.7rem;
}

.page-shell {
  width: min(1240px, calc(100% - 24px));
  margin: 14px auto 32px;
}

.page-head {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 12px;
  margin: 0 0 14px;
}

.flow-hero {
  --flow-a: #c7e6e2;
  --flow-b: #e6dc8f;
  --flow-ink: #28433c;
  --flow-speed: 7s;
  --flow-lift: 33px;
  --flow-lift-strong: 39px;
  --flow-lift-bright: 51px;
  --flow-lift-soft: 27px;
  min-height: 380px;
  margin: 0 0 18px;
  padding: clamp(18px, 4vw, 34px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.56fr);
  gap: clamp(18px, 4vw, 42px);
  align-items: stretch;
  border: 1px solid rgba(40, 67, 60, 0.14);
  border-radius: var(--radius);
  background:
    repeating-linear-gradient(90deg, rgba(40, 67, 60, 0.07) 0 1px, transparent 1px 72px),
    linear-gradient(135deg, rgba(248, 251, 241, 0.92), rgba(199, 230, 226, 0.72) 50%, rgba(245, 194, 231, 0.32)),
    var(--paper);
  box-shadow: 0 28px 70px rgba(39, 67, 60, 0.13);
  overflow: hidden;
}

html[data-theme="dark"] .flow-hero {
  border-color: rgba(223, 243, 235, 0.18);
  background:
    repeating-linear-gradient(90deg, rgba(223, 243, 235, 0.07) 0 1px, transparent 1px 72px),
    linear-gradient(135deg, rgba(16, 25, 22, 0.94), rgba(24, 43, 37, 0.9) 56%, rgba(128, 201, 192, 0.18)),
    var(--paper);
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.32);
}

.flow-copy {
  min-width: 0;
  display: grid;
  align-content: center;
  gap: 14px;
}

.flow-copy h1 {
  max-width: 760px;
  font-size: clamp(2.35rem, 5vw, 5.1rem);
  letter-spacing: 0;
}

.flow-copy .lede {
  max-width: 660px;
  font-size: 1.03rem;
}

.hero-actions,
.flow-tuner-head {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.flow-tuner {
  min-width: 0;
  padding: 14px;
  display: grid;
  align-content: space-between;
  gap: 16px;
  border: 1px solid rgba(40, 67, 60, 0.16);
  border-radius: var(--radius);
  background: rgba(248, 251, 241, 0.66);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.34);
}

html[data-theme="dark"] .flow-tuner {
  border-color: rgba(223, 243, 235, 0.18);
  background: rgba(223, 243, 235, 0.08);
}

.flow-tuner-head {
  justify-content: space-between;
  align-items: flex-start;
}

.flow-tuner-head h2 {
  margin-bottom: 0;
}

.flow-lines {
  min-height: 128px;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 9px;
  align-items: end;
}

.flow-lines span {
  display: block;
  height: calc(38px + var(--flow-lift));
  border-radius: 6px 6px 2px 2px;
  background: linear-gradient(180deg, var(--flow-a), var(--flow-b));
  border: 1px solid rgba(40, 67, 60, 0.14);
  box-shadow: 0 14px 26px rgba(39, 67, 60, 0.12);
  animation: flowPulse var(--flow-speed) ease-in-out infinite;
}

.flow-lines span:nth-child(2) {
  height: calc(60px + var(--flow-lift-strong));
  animation-delay: 120ms;
}

.flow-lines span:nth-child(3) {
  height: calc(48px + var(--flow-lift-bright));
  background: linear-gradient(180deg, #b8dec8, #bfd7ea);
  animation-delay: 240ms;
}

.flow-lines span:nth-child(4) {
  height: calc(74px + var(--flow-lift-soft));
  background: linear-gradient(180deg, #f5c2e7, #d9d0f0);
  animation-delay: 360ms;
}

.flow-lines span:nth-child(5) {
  height: calc(42px + var(--flow-lift-bright));
  animation-delay: 480ms;
}

@keyframes flowPulse {
  0%,
  100% {
    transform: scaleY(0.94);
    filter: saturate(0.98);
  }
  50% {
    transform: scaleY(1.03);
    filter: saturate(1.16);
  }
}

.flow-controls {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.flow-controls label {
  min-width: 0;
  padding: 10px;
  border: 1px solid rgba(40, 67, 60, 0.12);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.48);
}

html[data-theme="dark"] .flow-controls label {
  border-color: rgba(223, 243, 235, 0.16);
  background: rgba(16, 25, 22, 0.42);
}

.flow-controls input[type="range"] {
  padding: 0;
  accent-color: var(--deep);
}

.flow-suggestion {
  min-height: 54px;
  margin: 0;
  padding: 12px;
  border-left: 4px solid var(--flow-b);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.48);
  color: var(--deep);
  line-height: 1.45;
}

html[data-theme="dark"] .flow-suggestion {
  background: rgba(16, 25, 22, 0.42);
  color: #edf8f4;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  font-weight: 800;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 6px;
  font-size: 2rem;
  line-height: 1.05;
}

h2 {
  margin-bottom: 10px;
  font-size: 1.22rem;
}

h3 {
  margin-bottom: 8px;
  font-size: 1.05rem;
}

.lede,
.muted {
  color: var(--muted);
}

.lede {
  max-width: 720px;
  font-size: 0.98rem;
  line-height: 1.55;
}

.grid-two,
.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
  gap: 18px;
  align-items: start;
}

.dashboard-grid {
  margin-bottom: 18px;
}

.panel,
.post-card,
.auth-panel {
  border: 1px solid rgba(40, 67, 60, 0.14);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.58);
  box-shadow: 0 18px 40px rgba(39, 67, 60, 0.1);
}

html[data-theme="dark"] .panel,
html[data-theme="dark"] .post-card,
html[data-theme="dark"] .auth-panel {
  border-color: rgba(223, 243, 235, 0.18);
  background: rgba(24, 43, 37, 0.9);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.28);
}

.panel {
  padding: 13px;
}

.mood-board {
  min-height: 310px;
  display: grid;
  grid-template-columns: 1fr 250px;
  gap: 16px;
}

.mood-canvas-wrap,
.canvas-wrap,
.sound-stage,
.journal-stage {
  border: 1px solid rgba(40, 67, 60, 0.15);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(199, 230, 226, 0.7), rgba(191, 215, 234, 0.55) 50%, rgba(230, 220, 143, 0.42)),
    #f8fbf1;
  overflow: hidden;
}

#moodCanvas {
  width: 100%;
  height: 310px;
}

.mood-controls {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mood-controls button {
  min-height: 48px;
  justify-content: flex-start;
}

.profile-strip {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: center;
  margin-bottom: 16px;
}

.profile-strip strong {
  display: block;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.stat {
  min-height: 74px;
  padding: 12px;
  border-radius: var(--radius);
  background: rgba(237, 248, 244, 0.78);
  border: 1px solid rgba(40, 67, 60, 0.12);
}

html[data-theme="dark"] .stat {
  background: rgba(223, 243, 235, 0.12);
  border-color: rgba(223, 243, 235, 0.22);
}

.stat strong {
  display: block;
  font-size: 1.45rem;
}

html[data-theme="dark"] .stat strong {
  color: #f4fff9;
}

html[data-theme="dark"] .stat .muted {
  color: #d7e8df;
}

.feed-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 14px 0 10px;
}

.feed-controls {
  display: grid;
  grid-template-columns: minmax(180px, 240px) 150px auto auto auto;
  gap: 7px;
  align-items: center;
}

.feature-rail {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin: 18px 0;
}

.feature-rail a {
  min-height: 132px;
  border: 1px solid rgba(40, 67, 60, 0.14);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.58);
  box-shadow: 0 18px 40px rgba(39, 67, 60, 0.08);
  padding: 16px;
  display: grid;
  align-content: center;
  gap: 9px;
  transition: transform 160ms ease, box-shadow 160ms ease;
  overflow: hidden;
}

html[data-theme="dark"] .feature-rail a {
  background: rgba(223, 243, 235, 0.1);
  border-color: rgba(223, 243, 235, 0.2);
  color: #edf8f4;
}

html[data-theme="dark"] .feature-rail span {
  color: #d7e8df;
}

.feature-rail a:hover {
  transform: translateY(-2px);
  box-shadow: 0 22px 42px rgba(39, 67, 60, 0.13);
}

.feature-rail strong {
  font-size: 1.08rem;
}

.feature-rail span {
  color: var(--muted);
  line-height: 1.45;
}

.segmented {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.feed-grid,
.clip-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 270px), 1fr));
  gap: 14px;
}

.feed-grid.list-view {
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
}

.feed-grid.list-view .post-card {
  min-height: 0;
}

.feed-grid.list-view .art-preview,
.feed-grid.list-view .sound-preview,
.feed-grid.list-view .scroll-preview {
  height: 76px;
}

.post-card {
  min-height: 0;
  padding: 12px 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: relative;
  overflow: hidden;
  animation: cardDrift 420ms ease both;
  animation-delay: calc(min(var(--i, 0), 12) * 22ms);
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.post-card:hover {
  transform: translateY(-3px);
  border-color: rgba(40, 67, 60, 0.28);
  box-shadow: 0 20px 42px rgba(39, 67, 60, 0.14);
}

html[data-theme="dark"] .post-card:hover {
  border-color: rgba(223, 243, 235, 0.22);
}

@keyframes cardDrift {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.post-card::before {
  content: "";
  height: 4px;
  background: var(--post-color, var(--sage));
  position: absolute;
  inset: 0 0 auto;
}

.post-meta {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  margin-top: 2px;
}

.author-link {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  min-width: 0;
}

.author-link .avatar {
  width: 32px;
  height: 32px;
  font-size: 0.78rem;
}

.author-link span {
  display: grid;
  gap: 1px;
  overflow: hidden;
  min-width: 0;
}

.author-link strong,
.author-link small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.author-link small {
  font-size: 0.72rem;
  font-weight: 650;
}

.type-pill {
  min-width: 104px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(199, 230, 226, 0.78);
  border: 1px solid rgba(40, 67, 60, 0.15);
  color: var(--deep);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

.post-card h3 {
  min-height: 0;
  margin-bottom: 5px;
  line-height: 1.18;
}

.post-body {
  color: #38504a;
  line-height: 1.48;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

html[data-theme="dark"] .post-body {
  color: #cfddd8;
}

html[data-theme="dark"] .post-card h3 {
  color: #f4fff9;
}

html[data-theme="dark"] .type-pill {
  background: #dff3eb;
  border-color: rgba(223, 243, 235, 0.72);
  color: #101916;
}

.source-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  width: fit-content;
  max-width: 100%;
  border: 1px solid rgba(40, 67, 60, 0.13);
  border-radius: 999px;
  padding: 0 9px;
  color: var(--muted);
  background: rgba(248, 251, 241, 0.55);
  font-size: 0.78rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

html[data-theme="dark"] .source-pill {
  background: rgba(223, 243, 235, 0.08);
  border-color: rgba(223, 243, 235, 0.24);
  color: #d7e8df;
}

.scroll-preview {
  min-height: 102px;
  padding: 18px;
  border: 1px solid rgba(40, 67, 60, 0.14);
  border-radius: var(--radius);
  background:
    linear-gradient(115deg, rgba(248, 251, 241, 0.84), rgba(230, 220, 143, 0.42)),
    linear-gradient(45deg, var(--post-color, var(--butter)), var(--mint));
}

.scroll-preview span {
  display: block;
  height: 9px;
  margin: 11px 0;
  border-radius: 999px;
  background: rgba(40, 67, 60, 0.18);
}

.scroll-preview span:nth-child(2) {
  width: 74%;
}

.scroll-preview span:nth-child(3) {
  width: 48%;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.tag-row span {
  border: 1px solid rgba(40, 67, 60, 0.13);
  border-radius: 999px;
  padding: 4px 8px;
  background: rgba(248, 251, 241, 0.7);
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.25;
}

html[data-theme="dark"] .tag-row span {
  background: rgba(223, 243, 235, 0.12);
  border-color: rgba(223, 243, 235, 0.23);
  color: #dcebe6;
}

.post-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
}

.post-actions > .muted {
  min-width: 0;
  font-size: 0.82rem;
  line-height: 1.35;
}

.icon-button {
  width: 42px;
  padding: 0;
}

.mini-actions {
  display: flex;
  gap: 6px;
  flex: 0 0 auto;
}

.mini-actions .icon-button {
  width: auto;
  min-width: 54px;
  padding: 0 10px;
  font-size: 0.85rem;
}

.save-button.saved {
  background: var(--butter);
  border-color: rgba(40, 67, 60, 0.34);
}

.reaction-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.reaction-row .chip {
  min-height: 30px;
  padding: 0 8px;
  font-size: 0.78rem;
}

.echo-panel {
  border-top: 1px solid rgba(40, 67, 60, 0.12);
  padding-top: 12px;
}

.echo-list {
  display: grid;
  gap: 8px;
  margin-bottom: 10px;
}

.echo-item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px;
  align-items: start;
  padding: 9px;
  border-radius: var(--radius);
  background: rgba(237, 248, 244, 0.72);
}

.echo-item .avatar {
  width: 30px;
  height: 30px;
  font-size: 0.75rem;
}

.echo-item p {
  margin: 0;
  line-height: 1.4;
}

.echo-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.art-preview {
  height: 112px;
  border-radius: var(--radius);
  border: 1px solid rgba(40, 67, 60, 0.14);
  overflow: hidden;
  background:
    linear-gradient(130deg, rgba(255, 255, 255, 0.58) 0 18%, transparent 18% 100%),
    linear-gradient(45deg, var(--post-color, var(--sage)), var(--sky));
  position: relative;
}

html[data-theme="dark"] .art-preview,
html[data-theme="dark"] .sound-preview,
html[data-theme="dark"] .scroll-preview {
  border-color: rgba(223, 243, 235, 0.22);
}

.art-preview::before {
  content: "";
  position: absolute;
  width: 82px;
  height: 82px;
  left: 18px;
  top: 20px;
  border-radius: 44% 56% 47% 53%;
  background: rgba(248, 251, 241, 0.64);
  border: 1px solid rgba(40, 67, 60, 0.18);
}

.art-preview::after {
  content: "";
  position: absolute;
  width: 118px;
  height: 2px;
  right: 18px;
  bottom: 34px;
  background: rgba(40, 67, 60, 0.32);
  box-shadow: 0 -17px rgba(40, 67, 60, 0.18), 0 -34px rgba(40, 67, 60, 0.12);
}

.art-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.art-preview.generated::before,
.art-preview.generated::after,
.art-preview.uploaded::before,
.art-preview.uploaded::after {
  display: none;
}

.generated-canvas-art {
  width: 100%;
  height: 100%;
  display: block;
}

.sound-preview {
  height: 76px;
  display: grid;
  grid-template-columns: repeat(9, 1fr);
  gap: 5px;
  align-items: end;
  padding: 13px;
  border: 1px solid rgba(40, 67, 60, 0.14);
  border-radius: var(--radius);
  background: rgba(237, 248, 244, 0.82);
}

.sound-preview span {
  display: block;
  min-height: 18px;
  border-radius: 999px 999px 2px 2px;
  background: var(--post-color, var(--sky));
  border: 1px solid rgba(40, 67, 60, 0.12);
}

.sound-preview span:nth-child(2n) {
  background: var(--lavender);
}

.sound-preview span:nth-child(3n) {
  background: var(--butter);
}

.form-grid,
.auth-form,
.profile-form {
  display: grid;
  gap: 12px;
}

.form-grid.two {
  grid-template-columns: 1fr 1fr;
}

.composer-panel {
  position: relative;
}

.composer-panel.is-primed {
  border-color: rgba(40, 67, 60, 0.32);
  box-shadow: 0 24px 52px rgba(39, 67, 60, 0.16);
}

.composer-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.composer-head h2 {
  margin-bottom: 0;
}

.composer-count {
  min-width: 74px;
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(40, 67, 60, 0.12);
  border-radius: var(--radius);
  background: rgba(237, 248, 244, 0.78);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

html[data-theme="dark"] .composer-count {
  border-color: rgba(223, 243, 235, 0.2);
  background: rgba(223, 243, 235, 0.12);
  color: #d7e8df;
}

.quick-prompts {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.quick-prompts button {
  min-height: 34px;
  border: 1px solid rgba(40, 67, 60, 0.14);
  border-radius: var(--radius);
  background: rgba(237, 248, 244, 0.72);
  color: var(--deep);
  cursor: pointer;
  font-weight: 800;
  padding: 0 10px;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.quick-prompts button:hover {
  transform: translateY(-1px);
  border-color: rgba(40, 67, 60, 0.28);
  background: rgba(199, 230, 226, 0.74);
}

html[data-theme="dark"] .quick-prompts button {
  border-color: rgba(223, 243, 235, 0.2);
  background: rgba(223, 243, 235, 0.1);
  color: #edf8f4;
}

.composer-hint {
  margin: -2px 0 0;
  font-size: 0.86rem;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-weight: 700;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid rgba(40, 67, 60, 0.22);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.74);
  color: var(--ink);
  padding: 11px 12px;
  outline: none;
}

html[data-theme="dark"] input,
html[data-theme="dark"] textarea,
html[data-theme="dark"] select {
  border-color: rgba(223, 243, 235, 0.26);
  background: rgba(16, 25, 22, 0.72);
  color: #edf8f4;
}

html[data-theme="dark"] input::placeholder,
html[data-theme="dark"] textarea::placeholder {
  color: rgba(237, 248, 244, 0.58);
}

textarea {
  min-height: 140px;
  resize: vertical;
  line-height: 1.5;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--deep);
  box-shadow: 0 0 0 3px rgba(199, 230, 226, 0.7);
}

.button {
  background: var(--deep);
  color: var(--paper);
  border-color: var(--deep);
  font-weight: 800;
}

html[data-theme="dark"] .button {
  background: #dff3eb;
  color: #101916;
  border-color: #dff3eb;
}

.button.secondary {
  background: rgba(248, 251, 241, 0.72);
  color: var(--ink);
  border-color: rgba(40, 67, 60, 0.2);
}

html[data-theme="dark"] .button.secondary {
  background: rgba(223, 243, 235, 0.1);
  color: #edf8f4;
  border-color: rgba(223, 243, 235, 0.24);
}

.button.full {
  width: 100%;
}

.notice {
  border-radius: var(--radius);
  border: 1px solid rgba(40, 67, 60, 0.14);
  background: rgba(230, 220, 143, 0.33);
  padding: 12px;
  color: var(--deep);
}

html[data-theme="dark"] .notice {
  background: rgba(214, 201, 105, 0.16);
  color: var(--ink);
}

.notice.error {
  background: rgba(191, 215, 234, 0.46);
}

.canvas-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 18px;
  align-items: start;
}

.canvas-wrap {
  min-height: 560px;
  padding: 14px;
}

#paintCanvas {
  width: 100%;
  aspect-ratio: 4 / 3;
  border: 1px solid rgba(40, 67, 60, 0.18);
  border-radius: var(--radius);
  background: #f8fbf1;
  touch-action: none;
}

html[data-theme="dark"] #paintCanvas {
  border-color: rgba(223, 243, 235, 0.28);
  background: #edf8f4;
  box-shadow: inset 0 0 0 1px rgba(16, 25, 22, 0.18);
}

.tool-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 12px 0 0;
}

.palette-bank {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.palette-card {
  min-height: 74px;
  border: 1px solid rgba(40, 67, 60, 0.16);
  border-radius: var(--radius);
  background: rgba(248, 251, 241, 0.74);
  color: var(--ink);
  padding: 10px;
  text-align: left;
  cursor: pointer;
  display: grid;
  gap: 8px;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.palette-card:hover,
.palette-card:focus-visible,
.palette-card.active {
  transform: translateY(-2px);
  border-color: rgba(40, 67, 60, 0.36);
  box-shadow: 0 14px 30px rgba(39, 67, 60, 0.16);
  outline: none;
}

.palette-card strong {
  font-size: 0.86rem;
}

.palette-card span,
.swatch-tray,
.stamp-tray,
.canvas-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
}

.palette-card i {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--c);
  border: 1px solid rgba(40, 67, 60, 0.2);
}

.studio-toolbar,
.creative-toolbar,
.remix-toolbar {
  margin-top: 12px;
  padding: 10px;
  border: 1px solid rgba(40, 67, 60, 0.14);
  border-radius: var(--radius);
  background: rgba(248, 251, 241, 0.62);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.creative-toolbar {
  display: grid;
  grid-template-columns: auto auto auto auto minmax(180px, 1fr) auto;
}

.studio-toolbar .segmented {
  flex: 1 1 320px;
}

.studio-toolbar .segmented button {
  min-height: 38px;
}

.select-inline {
  min-height: 38px;
  display: inline-grid;
  grid-template-columns: auto minmax(128px, 1fr);
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(40, 67, 60, 0.16);
  border-radius: var(--radius);
  padding: 0 10px;
  background: rgba(255, 255, 255, 0.54);
  color: var(--ink);
}

.select-inline select {
  min-height: 30px;
  border: 0;
  background: transparent;
  padding: 0;
}

.color-inline,
.toggle-inline,
.text-inline {
  min-height: 38px;
  display: inline-grid;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(40, 67, 60, 0.16);
  border-radius: var(--radius);
  padding: 0 10px;
  background: rgba(255, 255, 255, 0.54);
  color: var(--ink);
}

.color-inline {
  grid-template-columns: auto 38px;
}

.color-inline input {
  width: 34px;
  height: 30px;
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
}

.toggle-inline {
  grid-template-columns: auto auto;
}

.toggle-inline input {
  width: 18px;
  height: 18px;
}

.text-inline {
  grid-template-columns: auto minmax(120px, 1fr);
  min-width: 0;
}

.text-inline input {
  min-width: 0;
  min-height: 30px;
  border: 0;
  background: transparent;
  padding: 0;
}

.stamp-tray button {
  min-height: 36px;
  border: 1px solid rgba(40, 67, 60, 0.16);
  border-radius: 999px;
  background: rgba(248, 251, 241, 0.8);
  color: var(--ink);
  cursor: pointer;
  padding: 0 12px;
  font-weight: 800;
}

.stamp-tray button.active,
.stamp-tray button:hover,
.stamp-tray button:focus-visible {
  background: var(--deep);
  border-color: var(--deep);
  color: var(--paper);
  outline: none;
}

.canvas-actions {
  margin-left: auto;
}

.canvas-actions .button,
.remix-toolbar .button {
  min-height: 36px;
  padding: 0 12px;
}

.range-inline {
  min-height: 38px;
  display: inline-grid;
  grid-template-columns: auto 120px 28px;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(40, 67, 60, 0.16);
  border-radius: var(--radius);
  padding: 0 10px;
  background: rgba(255, 255, 255, 0.54);
  color: var(--ink);
}

.swatch {
  width: 38px;
  height: 38px;
  border-radius: var(--radius);
  border: 2px solid rgba(40, 67, 60, 0.18);
  padding: 0;
}

.swatch.active {
  border-color: var(--deep);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.78), 0 0 0 5px rgba(40, 67, 60, 0.2);
}

html[data-theme="dark"] .palette-card,
html[data-theme="dark"] .studio-toolbar,
html[data-theme="dark"] .creative-toolbar,
html[data-theme="dark"] .remix-toolbar,
html[data-theme="dark"] .range-inline,
html[data-theme="dark"] .select-inline,
html[data-theme="dark"] .color-inline,
html[data-theme="dark"] .toggle-inline,
html[data-theme="dark"] .text-inline,
html[data-theme="dark"] .stamp-tray button {
  background: rgba(223, 243, 235, 0.1);
  border-color: rgba(223, 243, 235, 0.22);
  color: var(--ink);
}

.sound-stage {
  min-height: 420px;
  padding: 18px;
  display: grid;
  gap: 14px;
}

.sound-garden {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.playlist-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.playlist-card {
  min-height: 92px;
  border: 1px solid rgba(40, 67, 60, 0.24);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(248, 251, 241, 0.82), rgba(255, 255, 255, 0.12)),
    var(--post-color, var(--sky));
  box-shadow: 0 12px 28px rgba(39, 67, 60, 0.14);
  color: #1a302a;
  cursor: pointer;
  text-align: left;
  padding: 14px;
  position: relative;
  overflow: hidden;
  transition: transform 170ms ease, box-shadow 170ms ease, border-color 170ms ease, filter 170ms ease;
}

.playlist-card::after {
  content: "";
  position: absolute;
  inset: auto 14px 12px;
  height: 3px;
  border-radius: 999px;
  background: rgba(40, 67, 60, 0.2);
  box-shadow: 18px 0 0 rgba(248, 251, 241, 0.5), 44px 0 0 rgba(40, 67, 60, 0.14);
}

.playlist-card:hover,
.playlist-card:focus-visible,
.playlist-card.is-playing {
  transform: translateY(-2px);
  border-color: rgba(40, 67, 60, 0.42);
  box-shadow: 0 18px 38px rgba(39, 67, 60, 0.22), 0 0 0 4px rgba(199, 230, 226, 0.55);
  outline: none;
}

.playlist-card.is-playing {
  filter: saturate(1.08);
}

.playlist-card strong,
.playlist-card span,
.playlist-card small {
  display: block;
  position: relative;
  z-index: 1;
}

.playlist-card strong {
  font-size: 0.98rem;
  margin-bottom: 5px;
}

.playlist-card span {
  color: #2f4a42;
  font-weight: 800;
}

.playlist-card small {
  margin-top: 8px;
  color: #486058;
  font-weight: 750;
  line-height: 1.25;
}

html[data-theme="dark"] .playlist-card {
  background:
    linear-gradient(135deg, rgba(237, 248, 244, 0.92), rgba(237, 248, 244, 0.18)),
    var(--post-color, var(--sky));
  border-color: rgba(223, 243, 235, 0.35);
  color: #101916;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.34);
}

html[data-theme="dark"] .playlist-card:hover,
html[data-theme="dark"] .playlist-card:focus-visible,
html[data-theme="dark"] .playlist-card.is-playing {
  border-color: rgba(223, 243, 235, 0.88);
  box-shadow: 0 20px 44px rgba(0, 0, 0, 0.42), 0 0 0 4px rgba(223, 243, 235, 0.22), inset 0 0 0 1px rgba(16, 25, 22, 0.22);
}

html[data-theme="dark"] .playlist-card span,
html[data-theme="dark"] .playlist-card small {
  color: #213a33;
}

.note-pad {
  min-height: 92px;
  border-radius: var(--radius);
  border: 1px solid rgba(40, 67, 60, 0.18);
  background: rgba(248, 251, 241, 0.72);
  color: #1a302a;
  cursor: pointer;
  font-weight: 900;
  box-shadow: 0 12px 26px rgba(39, 67, 60, 0.12);
  transition: transform 160ms ease, background 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.note-pad:hover,
.note-pad.playing {
  transform: translateY(-2px);
  background: var(--butter);
  border-color: rgba(40, 67, 60, 0.36);
  box-shadow: 0 16px 34px rgba(39, 67, 60, 0.2), 0 0 0 4px rgba(248, 251, 241, 0.56);
}

html[data-theme="dark"] .note-pad {
  background: rgba(237, 248, 244, 0.88);
  border-color: rgba(223, 243, 235, 0.34);
  color: #101916;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.28);
}

html[data-theme="dark"] .note-pad:hover,
html[data-theme="dark"] .note-pad.playing {
  background: #e6dc8f;
  border-color: rgba(223, 243, 235, 0.82);
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.38), 0 0 0 4px rgba(223, 243, 235, 0.2);
}

.range-row {
  display: grid;
  grid-template-columns: 120px 1fr 44px;
  align-items: center;
  gap: 10px;
}

.wave-line {
  height: 94px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.wave-line span {
  width: 9px;
  min-height: 18px;
  margin: 0 4px;
  border-radius: 999px;
  background: var(--sky);
  animation: pulse 1.4s ease-in-out infinite;
}

.wave-line span:nth-child(2n) {
  background: var(--sage);
  animation-delay: 120ms;
}

.wave-line span:nth-child(3n) {
  background: var(--lavender);
  animation-delay: 240ms;
}

@keyframes pulse {
  0%,
  100% {
    height: 22px;
  }
  50% {
    height: 76px;
  }
}

.dj-console {
  margin-top: 18px;
  border: 1px solid rgba(40, 67, 60, 0.16);
  border-radius: var(--radius);
  background:
    radial-gradient(circle at 18% 18%, rgba(199, 230, 226, 0.72), transparent 28%),
    radial-gradient(circle at 82% 18%, rgba(217, 208, 240, 0.72), transparent 26%),
    linear-gradient(145deg, rgba(16, 25, 22, 0.94), rgba(40, 67, 60, 0.9));
  color: #edf8f4;
  padding: 18px;
  box-shadow: 0 24px 62px rgba(39, 67, 60, 0.22);
  overflow: hidden;
}

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

.dj-heading h2 {
  color: #f4fff9;
  margin-top: 4px;
}

.dj-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 0.72fr) minmax(0, 1fr);
  gap: 14px;
}

.dj-deck,
.dj-mixer {
  border: 1px solid rgba(223, 243, 235, 0.18);
  border-radius: var(--radius);
  background: rgba(237, 248, 244, 0.08);
  box-shadow: inset 0 0 0 1px rgba(16, 25, 22, 0.18);
  padding: 14px;
  display: grid;
  gap: 12px;
}

.dj-deck.is-cued,
.dj-mixer.is-cued,
.dj-console.is-live .dj-mixer {
  border-color: rgba(199, 230, 226, 0.62);
  box-shadow: 0 0 0 4px rgba(199, 230, 226, 0.12), inset 0 0 0 1px rgba(223, 243, 235, 0.22);
}

.deck-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: baseline;
}

.deck-top span,
.dj-slider {
  color: rgba(237, 248, 244, 0.74);
  font-weight: 800;
}

.deck-top strong {
  color: #f8fbf1;
}

.deck-platter {
  aspect-ratio: 1;
  width: min(210px, 76%);
  justify-self: center;
  border-radius: 50%;
  border: 12px solid rgba(237, 248, 244, 0.14);
  background:
    radial-gradient(circle, #f8fbf1 0 11%, transparent 12%),
    repeating-radial-gradient(circle, rgba(237, 248, 244, 0.22) 0 4px, transparent 5px 18px),
    linear-gradient(145deg, #84dcc6, #b8a7ff);
  color: #101916;
  cursor: pointer;
  font-weight: 950;
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.28);
  transition: transform 180ms ease, filter 180ms ease;
}

.deck-platter.alt {
  background:
    radial-gradient(circle, #f8fbf1 0 11%, transparent 12%),
    repeating-radial-gradient(circle, rgba(237, 248, 244, 0.22) 0 4px, transparent 5px 18px),
    linear-gradient(145deg, #f5c2e7, #8cb9d9);
}

.deck-platter:hover,
.deck-platter.is-playing {
  transform: rotate(3deg) scale(1.02);
  filter: saturate(1.15);
}

.deck-pads {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.deck-pads button,
.dj-mixer .button {
  border: 1px solid rgba(223, 243, 235, 0.2);
  border-radius: var(--radius);
  background: rgba(237, 248, 244, 0.12);
  color: #edf8f4;
  cursor: pointer;
  font-weight: 900;
  min-height: 46px;
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease;
}

.deck-pads button:hover,
.deck-pads button.is-playing,
.dj-mixer .button:hover,
.dj-mixer .button.is-playing {
  transform: translateY(-2px);
  background: rgba(199, 230, 226, 0.22);
  border-color: rgba(223, 243, 235, 0.5);
}

.dj-slider {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
}

.dj-slider input {
  grid-column: 1 / -1;
  width: 100%;
}

.dj-slider output {
  color: #f8fbf1;
}

.mixer-vu {
  min-height: 118px;
  display: flex;
  justify-content: center;
  align-items: end;
  gap: 9px;
}

.mixer-vu span {
  width: 18px;
  height: 42px;
  border-radius: 999px 999px 6px 6px;
  background: linear-gradient(#f5c2e7, #84dcc6);
  animation: pulse 1.25s ease-in-out infinite;
}

.mixer-vu span:nth-child(2n) {
  animation-delay: 180ms;
}

.mixer-vu span:nth-child(3n) {
  animation-delay: 320ms;
}

.journal-stage {
  padding: 18px;
}

.prompt-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  margin-bottom: 14px;
}

.prompt-card {
  min-height: 76px;
  border-radius: var(--radius);
  border: 1px solid rgba(40, 67, 60, 0.14);
  background: rgba(248, 251, 241, 0.8);
  padding: 14px;
  font-weight: 800;
  line-height: 1.45;
}

.prompt-stack {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}

.prompt-stack .chip {
  justify-content: flex-start;
  min-height: 46px;
  text-align: left;
  white-space: normal;
}

.word-meter {
  height: 8px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(40, 67, 60, 0.1);
}

.word-meter span {
  display: block;
  width: 0%;
  height: 100%;
  background: var(--deep);
  transition: width 180ms ease;
}

.auth-shell {
  min-height: calc(100vh - 150px);
  width: min(960px, calc(100% - 32px));
  margin: 36px auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  align-items: stretch;
}

.auth-visual {
  min-height: 520px;
  border-radius: var(--radius);
  border: 1px solid rgba(40, 67, 60, 0.14);
  background:
    linear-gradient(135deg, rgba(191, 215, 234, 0.78), rgba(184, 222, 200, 0.72) 48%, rgba(230, 220, 143, 0.5)),
    #edf8f4;
  position: relative;
  overflow: hidden;
}

.auth-visual::before {
  content: "";
  position: absolute;
  left: 12%;
  right: 12%;
  top: 14%;
  bottom: 14%;
  border: 1px solid rgba(40, 67, 60, 0.18);
  background:
    linear-gradient(90deg, transparent 0 48%, rgba(40, 67, 60, 0.16) 48% 51%, transparent 51%),
    linear-gradient(180deg, transparent 0 54%, rgba(40, 67, 60, 0.16) 54% 56%, transparent 56%),
    rgba(248, 251, 241, 0.48);
  transform: rotate(-3deg);
}

.auth-visual::after {
  content: "";
  position: absolute;
  width: 220px;
  height: 220px;
  right: 9%;
  bottom: 11%;
  border-radius: 42% 58% 48% 52%;
  border: 1px solid rgba(40, 67, 60, 0.2);
  background: rgba(217, 208, 240, 0.66);
}

.auth-panel {
  padding: 22px;
}

.tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 16px 0;
}

.tabs button {
  min-height: 42px;
  border-radius: var(--radius);
  border: 1px solid rgba(40, 67, 60, 0.18);
  background: rgba(255, 255, 255, 0.52);
  cursor: pointer;
  font-weight: 800;
}

.tabs button.active {
  background: var(--deep);
  color: var(--paper);
}

.hidden {
  display: none !important;
}

.clip-card {
  min-height: 0;
}

.load-more {
  margin-top: 14px;
}

.clip-note {
  min-height: 82px;
}

.clip-wrap {
  display: grid;
  gap: 10px;
}

.clip-editor {
  padding: 12px;
}

.profile-layout {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  gap: 18px;
}

.profile-card {
  display: grid;
  gap: 14px;
}

.avatar-upload {
  display: grid;
  gap: 12px;
  justify-items: start;
}

.footer {
  min-height: 92px;
  border-top: 1px solid rgba(40, 67, 60, 0.12);
  display: grid;
  place-items: center;
  color: var(--muted);
  background: rgba(237, 248, 244, 0.7);
}

.footer strong {
  color: var(--deep);
}

.mobile-tabbar {
  display: none;
}

.empty-state {
  grid-column: 1 / -1;
  min-height: 210px;
  display: grid;
  place-items: center;
  text-align: center;
  border: 1px dashed rgba(40, 67, 60, 0.28);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.42);
  padding: 24px;
}

.mood-picks {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.color-rune {
  height: 110px;
  border: 1px solid rgba(40, 67, 60, 0.16);
  border-radius: var(--radius);
  background: #b8dec8;
  position: relative;
  overflow: hidden;
}

.color-rune::before,
.color-rune::after {
  content: "";
  position: absolute;
  inset: 18px;
  border: 1px solid rgba(40, 67, 60, 0.2);
  transform: rotate(4deg);
}

.color-rune::after {
  inset: 31px;
  transform: rotate(-7deg);
  background: rgba(248, 251, 241, 0.34);
}

.mood-logs {
  display: grid;
  gap: 9px;
}

.mood-log {
  border-left: 7px solid var(--post-color, var(--sage));
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.58);
  border-top: 1px solid rgba(40, 67, 60, 0.12);
  border-right: 1px solid rgba(40, 67, 60, 0.12);
  border-bottom: 1px solid rgba(40, 67, 60, 0.12);
  padding: 11px;
}

.mood-log strong,
.mood-log span {
  display: block;
}

.potion-stage {
  min-height: 520px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 390px;
  gap: 18px;
  align-items: stretch;
  min-width: 0;
}

.potion-lab {
  min-height: 520px;
  display: grid;
  grid-template-rows: auto 56px 1fr;
  gap: 12px;
  min-width: 0;
  border-radius: var(--radius);
  border: 1px solid rgba(40, 67, 60, 0.14);
  background:
    linear-gradient(90deg, rgba(40, 67, 60, 0.12) 1px, transparent 1px),
    linear-gradient(rgba(40, 67, 60, 0.1) 1px, transparent 1px),
    linear-gradient(145deg, rgba(191, 215, 234, 0.78), rgba(199, 230, 226, 0.76) 54%, rgba(230, 220, 143, 0.58));
  background-size: 28px 28px, 28px 28px, auto;
  position: relative;
  overflow: hidden;
  padding: clamp(14px, 2.8vw, 24px);
}

.beaker-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  align-items: end;
}

.beaker-card {
  min-width: 0;
  display: grid;
  gap: 8px;
  border: 1px solid rgba(40, 67, 60, 0.16);
  border-radius: var(--radius);
  background: rgba(248, 251, 241, 0.72);
  padding: 12px;
  box-shadow: 0 14px 32px rgba(39, 67, 60, 0.1);
}

.beaker-card strong {
  color: var(--deep);
  font-size: 0.92rem;
}

.beaker-card input {
  min-width: 0;
  width: 100%;
  min-height: 42px;
  border-radius: 8px;
  background: #fff;
}

.beaker-visual {
  width: 100%;
  height: 92px;
  border: 2px solid rgba(40, 67, 60, 0.22);
  border-radius: 0 0 24px 24px;
  border-top: 0;
  background: rgba(248, 251, 241, 0.48);
  position: relative;
  overflow: hidden;
}

.beaker-visual::before {
  content: "";
  position: absolute;
  inset: auto 10px 8px;
  height: 52%;
  border-radius: 18px 18px 22px 22px;
  background: linear-gradient(145deg, var(--a, #8cb9d9), var(--b, #c7e6e2));
  transition: height 220ms ease, filter 220ms ease;
}

.beaker-card:focus-within .beaker-visual::before {
  height: 68%;
  filter: saturate(1.16);
}

.beaker-visual.mood {
  --a: #d9d0f0;
  --b: #8cb9d9;
}

.beaker-visual.subject {
  --a: #c7e6e2;
  --b: #7dbfa2;
}

.beaker-visual.style {
  --a: #e6dc8f;
  --b: #f5c2e7;
}

.beaker-visual i {
  position: absolute;
  left: 50%;
  bottom: 28px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(248, 251, 241, 0.72);
  box-shadow: -28px 12px 0 rgba(248, 251, 241, 0.5), 30px 7px 0 rgba(248, 251, 241, 0.42);
}

.brew-channel {
  justify-self: center;
  width: min(520px, 86%);
  display: flex;
  justify-content: space-around;
  align-items: center;
  pointer-events: none;
}

.brew-channel span {
  width: 4px;
  height: 48px;
  border-radius: 999px;
  background: linear-gradient(#f8fbf1, rgba(40, 67, 60, 0.24));
  opacity: 0.62;
  transform-origin: top;
}

.potion-lab.is-brewing .brew-channel span {
  animation: pourPotion 860ms ease-in-out infinite;
}

.potion-lab.is-brewing .brew-channel span:nth-child(2n) {
  animation-delay: 110ms;
}

.potion-lab.is-brewing .brew-channel span:nth-child(3n) {
  animation-delay: 220ms;
}

.potion-flask {
  width: min(460px, 92%);
  min-height: 368px;
  min-width: 0;
  justify-self: center;
  align-self: stretch;
  display: grid;
  grid-template-rows: 56px 1fr;
  place-items: center;
  position: relative;
}

.flask-neck {
  width: 92px;
  height: 70px;
  border: 2px solid rgba(40, 67, 60, 0.26);
  border-bottom: 0;
  border-radius: 18px 18px 4px 4px;
  background: rgba(248, 251, 241, 0.52);
  z-index: 2;
}

.flask-body {
  width: 100%;
  min-height: 318px;
  min-width: 0;
  clip-path: polygon(38% 0, 62% 0, 91% 82%, 82% 100%, 18% 100%, 9% 82%);
  border-radius: 0 0 38px 38px;
  background: rgba(248, 251, 241, 0.62);
  border: 2px solid rgba(40, 67, 60, 0.24);
  position: relative;
  overflow: hidden;
}

.flask-liquid {
  position: absolute;
  inset: auto 0 0;
  height: 62%;
  background:
    radial-gradient(circle at 28% 24%, rgba(255, 255, 255, 0.5), transparent 14%),
    linear-gradient(145deg, rgba(199, 230, 226, 0.86), rgba(217, 208, 240, 0.82), rgba(230, 220, 143, 0.72));
  transition: filter 240ms ease, transform 240ms ease;
}

.potion-lab.is-brewing .flask-liquid {
  animation: liquidBrew 860ms ease-in-out infinite;
}

.potion-panel {
  display: grid;
  align-content: center;
  gap: 14px;
}

.potion-prompt {
  position: absolute;
  top: 158px;
  left: 50%;
  bottom: 50px;
  transform: translateX(-50%);
  width: min(74%, 360px);
  min-height: 0;
  border: 1px solid rgba(40, 67, 60, 0.18);
  border-radius: 18px;
  background: rgba(248, 251, 241, 0.82);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
  padding: 18px;
  z-index: 3;
  overflow: visible;
  box-shadow: 0 18px 40px rgba(39, 67, 60, 0.14);
  box-sizing: border-box;
}

html[data-theme="dark"] .potion-prompt {
  border-color: rgba(223, 243, 235, 0.24);
  background: rgba(223, 243, 235, 0.1);
}

.potion-prompt span {
  color: var(--muted);
  text-transform: uppercase;
  font-weight: 800;
  letter-spacing: 0.1em;
  font-size: 0.72rem;
}

.potion-prompt strong {
  font-size: clamp(0.92rem, 1.8vw, 1.12rem);
  line-height: 1.24;
  overflow-wrap: anywhere;
}

.potion-custom-input {
  min-height: 132px;
  line-height: 1.5;
}

.potion-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.bubble {
  position: absolute;
  bottom: 54px;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: rgba(248, 251, 241, 0.76);
  z-index: 3;
  opacity: 0;
}

.bubble.one {
  left: 32%;
}

.bubble.two {
  left: 50%;
  width: 11px;
  height: 11px;
}

.bubble.three {
  left: 65%;
}

.potion-lab.is-brewing .bubble {
  animation: potionBubble 860ms ease-in-out infinite;
}

.potion-lab.is-brewing .bubble.two {
  animation-delay: 180ms;
}

.potion-lab.is-brewing .bubble.three {
  animation-delay: 310ms;
}

@keyframes pourPotion {
  0%,
  100% {
    transform: scaleY(0.48);
    opacity: 0.35;
  }
  50% {
    transform: scaleY(1.12);
    opacity: 0.9;
  }
}

@keyframes liquidBrew {
  0%,
  100% {
    filter: hue-rotate(0deg) saturate(1);
    transform: translateY(0);
  }
  50% {
    filter: hue-rotate(35deg) saturate(1.24);
    transform: translateY(-8px);
  }
}

@keyframes potionBubble {
  0% {
    transform: translateY(0) scale(0.7);
    opacity: 0;
  }
  35% {
    opacity: 0.82;
  }
  100% {
    transform: translateY(-120px) scale(1.1);
    opacity: 0;
  }
}

.quest-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.quest-card {
  min-height: 280px;
  border: 1px solid rgba(40, 67, 60, 0.14);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.58);
  box-shadow: 0 18px 40px rgba(39, 67, 60, 0.1);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.quest-card p {
  line-height: 1.5;
}

.quest-card .button {
  margin-top: auto;
}

.spotlight-card {
  margin-bottom: 12px;
}

.glow-card {
  min-height: 330px;
}

@media (max-width: 980px) {
  .nav-inner,
  .page-head,
  .flow-hero,
  .grid-two,
  .dashboard-grid,
  .mood-board,
  .canvas-layout,
  .auth-shell,
  .profile-layout {
    grid-template-columns: 1fr;
  }

  .potion-stage {
    grid-template-columns: 1fr;
  }

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

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

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

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

  .nav-inner {
    padding: 12px 0;
  }

  .nav-links {
    justify-content: flex-start;
  }

  .account-actions {
    justify-content: flex-start;
  }

  .feed-controls {
    grid-template-columns: 1fr 1fr;
    width: 100%;
  }

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

  .feature-rail {
    grid-template-columns: 1fr;
  }

  .flow-controls {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  body {
    padding-bottom: calc(76px + env(safe-area-inset-bottom));
    background-size: 28px 28px, 28px 28px, auto;
  }

  .page-shell,
  .nav-inner,
  .auth-shell {
    width: min(1180px, calc(100% - 16px));
  }

  .topbar {
    position: sticky;
    top: 0;
  }

  .nav-inner {
    min-height: 0;
    gap: 9px;
    padding: 9px 0 7px;
  }

  h1 {
    font-size: 1.48rem;
    overflow-wrap: anywhere;
  }

  .flow-hero {
    min-height: 0;
    margin-top: 8px;
    padding: 13px;
    box-shadow: 0 18px 44px rgba(39, 67, 60, 0.12);
  }

  .flow-copy h1 {
    font-size: 1.95rem;
  }

  .flow-copy {
    gap: 10px;
  }

  .hero-actions,
  .flow-tuner-head,
  .composer-head {
    align-items: stretch;
    flex-direction: column;
  }

  .hero-actions .button,
  .flow-tuner-head .button {
    width: 100%;
  }

  .flow-lines {
    min-height: 74px;
    gap: 7px;
  }

  h2 {
    font-size: 1.12rem;
  }

  .brand,
  .brand-logo {
    width: 146px;
  }

  .nav-links {
    display: none;
  }

  .mobile-tabbar {
    position: fixed;
    left: 8px;
    right: 8px;
    bottom: max(8px, env(safe-area-inset-bottom));
    z-index: 35;
    min-height: 64px;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 6px;
    padding: 7px;
    border: 1px solid rgba(40, 67, 60, 0.14);
    border-radius: 18px;
    background: rgba(248, 251, 241, 0.92);
    backdrop-filter: blur(18px);
    box-shadow: 0 18px 46px rgba(39, 67, 60, 0.2);
  }

  html[data-theme="dark"] .mobile-tabbar {
    border-color: rgba(223, 243, 235, 0.18);
    background: rgba(16, 25, 22, 0.9);
    box-shadow: 0 18px 46px rgba(0, 0, 0, 0.34);
  }

  .mobile-tabbar a {
    min-width: 0;
    min-height: 50px;
    display: grid;
    place-items: center;
    gap: 2px;
    border-radius: 14px;
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 800;
  }

  .mobile-tabbar span {
    width: 26px;
    height: 24px;
    display: grid;
    place-items: center;
    border-radius: 9px;
    background: rgba(199, 230, 226, 0.62);
    color: var(--deep);
    font-size: 0.8rem;
  }

  .mobile-tabbar strong {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1;
  }

  .mobile-tabbar a.active {
    color: var(--deep);
    background: rgba(199, 230, 226, 0.46);
  }

  html[data-theme="dark"] .mobile-tabbar a.active {
    color: #edf8f4;
    background: rgba(223, 243, 235, 0.12);
  }

  .account-actions {
    display: flex;
    justify-content: flex-end;
    gap: 6px;
    width: auto;
  }

  .account-actions a,
  .account-actions button {
    justify-content: center;
    min-width: 0;
    width: auto;
    min-height: 34px;
    padding: 0 9px;
  }

  .theme-toggle {
    width: auto;
  }

  .feed-grid,
  .clip-grid,
  .form-grid.two,
  .stat-grid,
  .sound-garden {
    grid-template-columns: 1fr;
  }

  .playlist-grid,
  .palette-bank,
  .quest-grid {
    grid-template-columns: 1fr;
  }

  .beaker-row,
  .creative-toolbar {
    grid-template-columns: 1fr;
  }

  .potion-lab {
    min-height: 0;
    grid-template-rows: auto 42px auto;
    padding: 12px;
  }

  .beaker-visual {
    height: 72px;
  }

  .potion-flask {
    width: 100%;
    min-height: 372px;
  }

  .flask-body {
    min-height: 318px;
  }

  .potion-prompt {
    top: 160px;
    bottom: 44px;
    width: min(78%, 330px);
    min-height: 0;
    padding: 12px 14px;
    gap: 6px;
  }

  .potion-prompt span {
    font-size: 0.64rem;
  }

  .potion-prompt strong {
    font-size: clamp(0.8rem, 3.2vw, 0.94rem);
    line-height: 1.18;
  }

  .dj-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .deck-pads {
    grid-template-columns: 1fr;
  }

  .studio-toolbar,
  .remix-toolbar {
    align-items: stretch;
  }

  .studio-toolbar .segmented,
  .canvas-actions,
  .stamp-tray {
    width: 100%;
  }

  .canvas-actions .button,
  .remix-toolbar .button {
    flex: 1 1 98px;
  }

  .echo-form {
    grid-template-columns: 1fr;
  }

  .post-actions {
    grid-template-columns: 1fr;
    align-items: flex-start;
  }

  .panel {
    padding: 12px;
  }

  .post-card {
    padding: 10px;
    gap: 9px;
  }

  .post-meta {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 7px;
  }

  .type-pill {
    min-width: 78px;
    height: 28px;
    font-size: 0.55rem;
  }

  .lede {
    max-width: 100%;
    overflow-wrap: anywhere;
  }

  .art-preview {
    height: 98px;
  }

  .sound-preview {
    height: 70px;
  }

  .feed-controls {
    grid-template-columns: 1fr;
  }

  .feed-grid.list-view {
    grid-template-columns: 1fr;
  }

  .feed-controls input,
  .feed-controls select,
  .feed-controls .button {
    min-height: 42px;
  }

  .feed-toolbar,
  .prompt-row {
    align-items: stretch;
    flex-direction: column;
    display: flex;
  }

  .potion-actions {
    grid-template-columns: 1fr;
  }

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

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 1ms !important;
  }
}
