*, *::before, *::after {
  box-sizing: border-box;
}

:root {
  --bg: #05060d;
  --bg-soft: #0b0e19;
  --surface: rgba(12, 16, 28, 0.84);
  --surface-strong: #111729;
  --surface-soft: rgba(255, 255, 255, 0.04);
  --surface-border: rgba(255, 236, 206, 0.08);
  --surface-border-strong: rgba(214, 170, 101, 0.22);
  --text: #f3ede2;
  --text-muted: #b7ae9d;
  --text-soft: rgba(243, 237, 226, 0.7);
  --accent: #d6aa65;
  --accent-hover: #ebbc73;
  --danger: #d76868;
  --success: #76c08b;
  --shadow-lg: 0 28px 80px rgba(0, 0, 0, 0.48);
  --shadow-md: 0 18px 42px rgba(0, 0, 0, 0.28);
  --font-sans: "Avenir Next", "Segoe UI", ui-sans-serif, system-ui, sans-serif;
  --font-serif: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", "URW Palladio L", Georgia, serif;
  --font-mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

html {
  height: 100%;
  min-height: 100%;
  overflow: hidden;
  scroll-behavior: smooth;
}

body {
  height: 100%;
  min-height: 100vh;
  margin: 0;
  overflow: hidden;
  background:
    radial-gradient(circle at 20% 20%, rgba(198, 152, 82, 0.16), transparent 34%),
    radial-gradient(circle at 80% 18%, rgba(114, 131, 196, 0.12), transparent 30%),
    radial-gradient(circle at 50% 80%, rgba(81, 115, 101, 0.16), transparent 34%),
    linear-gradient(180deg, #070910 0%, #04050b 100%);
  color: var(--text);
  font-family: var(--font-sans);
}

body.panel-open {
  overflow: hidden;
}

#stars {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

#sky {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

#sky::before,
#sky::after {
  content: "";
  position: absolute;
  border-radius: 999px;
  filter: blur(50px);
  opacity: 0.55;
}

#sky::before {
  width: 280px;
  height: 280px;
  top: 12%;
  left: -60px;
  background: radial-gradient(circle, rgba(214, 170, 101, 0.26) 0%, transparent 68%);
}

#sky::after {
  width: 340px;
  height: 340px;
  right: -90px;
  bottom: 18%;
  background: radial-gradient(circle, rgba(110, 144, 132, 0.22) 0%, transparent 72%);
}

#header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  padding: 1.25rem 1rem 1rem;
  background: linear-gradient(180deg, rgba(5, 6, 13, 0.92), rgba(5, 6, 13, 0.35), transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  pointer-events: none;
}

#brand {
  color: var(--accent);
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: 0.04em;
}

#tagline {
  color: var(--text-muted);
  font-family: var(--font-serif);
  font-size: 0.72rem;
  font-style: italic;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

#app-shell {
  position: relative;
  z-index: 2;
  width: min(1180px, calc(100vw - 2.5rem));
  height: 100vh;
  margin: 0 auto;
  padding: 0;
  pointer-events: none;
}

.panel-view {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 1rem;
}

.panel-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 5, 12, 0.76);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.panel-shell {
  position: relative;
  z-index: 1;
  width: min(1120px, calc(100vw - 1.5rem));
  max-height: 92vh;
  overflow-y: auto;
  padding: 1.15rem;
  border-radius: 30px;
  border: 1px solid rgba(255, 236, 206, 0.08);
  background: linear-gradient(180deg, rgba(9, 12, 21, 0.96), rgba(6, 9, 16, 0.96));
  box-shadow: 0 40px 110px rgba(0, 0, 0, 0.48);
}

.panel-topbar {
  position: sticky;
  top: 0;
  z-index: 4;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.1rem;
  padding-bottom: 1rem;
  background: linear-gradient(180deg, rgba(9, 12, 21, 0.98), rgba(9, 12, 21, 0.78), transparent);
}

.panel-back-btn,
.panel-switch,
.panel-compose-btn,
.trail-orb {
  border: 1px solid var(--surface-border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.panel-back-btn,
.panel-compose-btn {
  padding: 0.7rem 1rem;
  font-size: 0.84rem;
}

.panel-compose-btn {
  border-color: rgba(255, 236, 206, 0.2);
  background: linear-gradient(135deg, var(--accent) 0%, #f0c57e 100%);
  color: #171109;
  font-weight: 700;
}

.panel-switcher {
  display: inline-flex;
  gap: 0.5rem;
  padding: 0.3rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.03);
}

.panel-switch {
  padding: 0.66rem 1rem;
  font-size: 0.84rem;
}

.panel-switch.active,
.panel-back-btn:hover,
.panel-switch:hover,
.panel-compose-btn:hover,
.trail-orb:hover {
  transform: translateY(-1px);
  border-color: rgba(235, 188, 115, 0.4);
  background: rgba(214, 170, 101, 0.12);
}

.panel-switch.active {
  color: var(--accent-hover);
}

.panel-tab {
  padding: 0.5rem 0;
}

.panel-head {
  margin-bottom: 1.05rem;
}

.panel-head h2 {
  margin: 0.1rem 0 0.25rem;
  font-family: var(--font-serif);
  font-size: 2rem;
}

.panel-head .section-copy {
  margin: 0;
  max-width: 42rem;
}

#landing-shell {
  position: relative;
  min-height: 100vh;
  height: 100%;
  display: flex;
  align-items: end;
  padding: 6.5rem 0 5.5rem;
  overflow: hidden;
  pointer-events: none;
}

.landing-overlay,
.empty-state,
.modal-card,
.loading-card {
  background: linear-gradient(180deg, rgba(17, 23, 41, 0.92), rgba(10, 14, 25, 0.92));
  border: 1px solid var(--surface-border);
  border-radius: 28px;
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.landing-overlay {
  width: min(760px, 100%);
  padding: 2rem 2.1rem;
  pointer-events: none;
}

.landing-kicker,
.section-kicker,
.compose-eyebrow,
.aftercare-kicker {
  display: inline-block;
  margin-bottom: 0.8rem;
  color: var(--accent);
  font-size: 0.75rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.landing-overlay h1 {
  margin: 0;
  max-width: 18ch;
  font-family: var(--font-serif);
  font-size: clamp(2.3rem, 4vw, 3.9rem);
  line-height: 0.98;
  letter-spacing: -0.03em;
}

#landing-summary,
.section-copy,
.landing-focus-copy,
.modal-hint,
.loading-card {
  color: var(--text-muted);
  font-family: var(--font-serif);
  font-style: italic;
  line-height: 1.7;
}

#landing-summary {
  margin: 1rem 0 1.8rem;
  max-width: 46rem;
  font-size: 1.05rem;
}

.landing-actions,
.aftercare-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
}

.landing-subnav {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.landing-actions .btn,
#landing-emotion-chips,
#landing-emotion-chips .emotion-chip {
  pointer-events: auto;
}

.emotion-chip-row,
.compose-emotion-picker,
.prompt-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.emotion-chip,
.compose-emotion-chip,
.prompt-chip,
.btn,
.hash-copy-btn {
  border: 1px solid var(--surface-border-strong);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.emotion-chip,
.compose-emotion-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.68rem 0.95rem;
  font-size: 0.88rem;
}

.emotion-chip-label {
  font-weight: 600;
}

.emotion-chip-count {
  color: var(--text-muted);
  font-size: 0.8rem;
}

.emotion-chip.active,
.compose-emotion-chip.active,
.prompt-chip:hover,
.emotion-chip:hover,
.compose-emotion-chip:hover,
.hash-copy-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(235, 188, 115, 0.5);
  background: rgba(214, 170, 101, 0.12);
  color: var(--accent-hover);
  box-shadow: 0 16px 30px rgba(0, 0, 0, 0.18);
}

.landing-focus-copy {
  margin: 0;
  min-height: 2.2rem;
}

.panel-tab-values {
  margin-top: 1rem;
}

.discovery-spotlight,
.bubble-cloud-shell,
.side-trail-shell {
  margin-top: 1rem;
}

#empty-hint {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: grid;
  place-items: center;
  text-align: center;
  color: var(--text-muted);
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.1rem;
  line-height: 1.8;
  pointer-events: none;
}

@keyframes floatUp {
  0% {
    transform: translateY(0) translateX(0);
    opacity: 0;
  }
  6% {
    opacity: 1;
  }
  86% {
    opacity: 1;
  }
  100% {
    transform: translateY(calc(-100vh - 180px)) translateX(var(--drift, 0px));
    opacity: 0;
  }
}

@keyframes bubbleExplode {
  0% {
    transform: scale(1);
    opacity: 1;
    filter: brightness(1) blur(0);
  }
  15% {
    transform: scale(1.18);
    opacity: 1;
    filter: brightness(2.2) blur(0);
    border-color: rgba(214, 170, 101, 0.9);
    box-shadow: 0 0 40px rgba(214, 170, 101, 0.6), 0 0 80px rgba(214, 170, 101, 0.25);
  }
  40% {
    transform: scale(1.35);
    opacity: 0.7;
    filter: brightness(1.4) blur(1px);
  }
  100% {
    transform: scale(2.1);
    opacity: 0;
    filter: brightness(0.4) blur(8px);
  }
}

.bubble.exploding {
  animation: bubbleExplode 0.65s cubic-bezier(0.22, 1, 0.36, 1) forwards !important;
  pointer-events: none;
  z-index: 50;
}

.bubble {
  position: absolute;
  bottom: -160px;
  pointer-events: all;
  cursor: pointer;
  display: block;
  appearance: none;
  border: 1px solid rgba(214, 170, 101, 0.16);
  border-radius: 18px;
  padding: 0.9rem 1.05rem;
  max-width: 240px;
  min-width: 120px;
  background: rgba(11, 14, 24, 0.92);
  box-shadow:
    0 0 0 1px rgba(214, 170, 101, 0.04),
    0 4px 24px rgba(0, 0, 0, 0.5),
    0 0 40px rgba(214, 170, 101, 0.04);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: floatUp linear forwards;
  transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
  user-select: none;
  -webkit-user-select: none;
  color: inherit;
  text-align: left;
}

.bubble:hover {
  border-color: rgba(214, 170, 101, 0.4);
  box-shadow:
    0 0 0 1px rgba(214, 170, 101, 0.08),
    0 4px 24px rgba(0, 0, 0, 0.5),
    0 0 50px rgba(214, 170, 101, 0.12);
}

.bubble-text {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 0.95rem;
  line-height: 1.55;
  color: rgba(243, 237, 226, 0.9);
  white-space: pre-wrap;
  word-break: break-word;
}

.bubble-emotion {
  margin-bottom: 0.45rem;
}

.bubble.sm {
  max-width: 180px;
}

.bubble.md {
  max-width: 230px;
}

.bubble.lg {
  max-width: 280px;
}

.bubble-reactions {
  display: flex;
  gap: 0.3rem;
  flex-wrap: wrap;
  margin-top: 0.6rem;
}

.bubble-ttl {
  margin-top: 0.45rem;
  color: var(--text-muted);
  font-size: 0.68rem;
  opacity: 0.8;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 1rem;
  margin-bottom: 1rem;
}

.section-head h2 {
  margin: 0.1rem 0 0;
  font-family: var(--font-serif);
  font-size: 2rem;
}

.section-copy {
  max-width: 28rem;
  margin: 0;
  font-size: 0.95rem;
}

.values-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.9rem;
}

.value-card {
  padding: 1rem;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.04);
}

.value-icon {
  display: block;
  margin-bottom: 0.6rem;
  font-size: 1.35rem;
}

.value-card h3 {
  margin: 0 0 0.35rem;
  color: var(--accent);
  font-size: 0.96rem;
}

.value-card p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.84rem;
  line-height: 1.6;
}

.spotlight-card,
.bubble-cloud-shell,
.side-trail-shell,
.cloud-bubble,
.trail-orb,
.spotlight-echo {
  position: relative;
  overflow: hidden;
}

.spotlight-card,
.bubble-cloud-shell,
.side-trail-shell {
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 30px;
  background: linear-gradient(180deg, rgba(13, 17, 30, 0.88), rgba(8, 11, 21, 0.92));
  box-shadow: var(--shadow-md);
}

.spotlight-card {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(260px, 0.78fr);
  gap: 1rem;
  padding: 1.2rem;
}

.spotlight-card::before,
.bubble-cloud-shell::before,
.side-trail-shell::before,
.cloud-bubble::before,
.trail-orb::before,
.spotlight-echo::before {
  content: "";
  position: absolute;
  pointer-events: none;
  border-radius: 999px;
  background: radial-gradient(circle, color-mix(in srgb, var(--tone, var(--accent)) 20%, transparent) 0%, transparent 72%);
  opacity: 0.9;
}

.spotlight-card::before {
  width: 260px;
  height: 260px;
  right: -110px;
  top: -90px;
}

.bubble-cloud-shell::before,
.side-trail-shell::before {
  width: 220px;
  height: 220px;
  right: -80px;
  top: -90px;
}

.spotlight-copy,
.spotlight-echo,
.bubble-cloud-head,
.bubble-cloud {
  position: relative;
  z-index: 1;
}

.spotlight-kicker,
.spotlight-echo-label,
.bubble-cloud-kicker {
  display: inline-block;
  color: var(--accent);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.spotlight-card h3 {
  margin: 0.25rem 0 0.5rem;
  font-family: var(--font-serif);
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  line-height: 1.02;
}

.spotlight-card p {
  margin: 0;
  max-width: 34rem;
  color: var(--text-muted);
  font-family: var(--font-serif);
  font-style: italic;
  line-height: 1.7;
}

.spotlight-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  margin-top: 1.1rem;
}

.spotlight-stat {
  padding: 0.9rem 0.95rem;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.04);
}

.spotlight-stat strong {
  display: block;
  color: var(--text);
  font-size: 1.1rem;
}

.spotlight-stat span {
  display: block;
  margin-top: 0.2rem;
  color: var(--text-muted);
  font-size: 0.76rem;
  line-height: 1.45;
}

.spotlight-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.1rem;
}

.spotlight-echo {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  min-height: 100%;
  padding: 1rem;
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid rgba(214, 170, 101, 0.16);
  border-radius: 28px 28px 22px 28px;
  background: rgba(8, 11, 20, 0.88);
  box-shadow:
    0 0 0 1px rgba(214, 170, 101, 0.04),
    0 14px 36px rgba(0, 0, 0, 0.28);
  text-align: left;
  color: inherit;
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.spotlight-echo::before,
.cloud-bubble::before,
.trail-orb::before {
  width: 140px;
  height: 140px;
  right: -34px;
  top: -36px;
}

.spotlight-echo:hover,
.cloud-bubble:hover,
.trail-orb:hover {
  border-color: rgba(214, 170, 101, 0.34);
  box-shadow:
    0 0 0 1px rgba(214, 170, 101, 0.08),
    0 18px 42px rgba(0, 0, 0, 0.34),
    0 0 50px rgba(214, 170, 101, 0.1);
}

.spotlight-echo:hover {
  transform: translateY(-4px);
}

.spotlight-echo-text {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.02rem;
  line-height: 1.68;
  color: rgba(243, 237, 226, 0.92);
}

.spotlight-echo-meta {
  margin-top: auto;
  color: var(--text-soft);
  font-size: 0.78rem;
}

.bubble-cloud-shell,
.side-trail-shell {
  padding: 1.15rem;
}

.bubble-cloud-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 1rem;
  margin-bottom: 1rem;
}

.bubble-cloud-head.compact {
  margin-bottom: 0.8rem;
}

.bubble-cloud-head h3 {
  margin: 0.18rem 0 0;
  font-family: var(--font-serif);
  font-size: 1.35rem;
}

.bubble-cloud-copy {
  max-width: 24rem;
  margin: 0;
  color: var(--text-muted);
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 0.9rem;
  line-height: 1.65;
}

.bubble-cloud {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 1rem;
  padding: 0.15rem 0 0.35rem;
}

.cloud-bubble {
  width: clamp(190px, 21vw, 270px);
  padding: 1rem;
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid rgba(214, 170, 101, 0.14);
  border-radius: 28px 28px 22px 28px;
  background: rgba(11, 14, 24, 0.9);
  box-shadow:
    0 0 0 1px rgba(214, 170, 101, 0.04),
    0 10px 34px rgba(0, 0, 0, 0.32),
    0 0 40px rgba(214, 170, 101, 0.04);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  min-height: 185px;
  text-align: left;
  color: inherit;
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  transform: rotate(var(--tilt, 0deg));
}

.cloud-bubble:hover {
  transform: translateY(-4px) rotate(0deg);
}

.cloud-bubble.size-0 {
  width: clamp(220px, 24vw, 290px);
  margin-top: 0.5rem;
}

.cloud-bubble.size-1 {
  width: clamp(180px, 19vw, 230px);
  margin-top: 2rem;
}

.cloud-bubble.size-2 {
  width: clamp(200px, 22vw, 250px);
  margin-top: 0;
}

.cloud-bubble.size-3 {
  width: clamp(230px, 25vw, 300px);
  margin-top: 1.4rem;
}

.side-trail-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.85rem;
}

.trail-orb {
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
  min-height: 142px;
  padding: 1rem 1.05rem;
  appearance: none;
  -webkit-appearance: none;
  border-radius: 28px 28px 18px 28px;
  text-align: left;
  justify-content: end;
}

.trail-orb-kicker {
  color: var(--text-soft);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.trail-orb strong {
  font-family: var(--font-serif);
  font-size: 1.08rem;
  color: var(--text);
}

.trail-orb span:last-child {
  color: var(--text-muted);
  font-size: 0.8rem;
}

.emotion-badge,
.confession-ttl,
.bubble-reaction-pip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  font-size: 0.74rem;
}

.emotion-badge {
  padding: 0.3rem 0.65rem;
  background: rgba(214, 170, 101, 0.12);
  border: 1px solid rgba(214, 170, 101, 0.24);
  color: var(--accent);
  text-transform: lowercase;
}

.emotion-badge.neutral {
  color: var(--text-soft);
  border-color: rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
}

.confession-ttl {
  color: var(--text-muted);
}

.detail-text {
  margin-top: 0.9rem;
  font-family: var(--font-serif);
  font-size: 1.04rem;
  line-height: 1.72;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
}

.confession-card-meta,
.detail-meta {
  margin-top: 0.85rem;
  color: var(--text-soft);
  font-size: 0.78rem;
}

.confession-card-reactions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.8rem;
}

.bubble-reaction-pip {
  padding: 0.2rem 0.45rem;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
}

.loading-card,
.empty-state {
  padding: 1.5rem;
  text-align: center;
}

.empty-state {
  margin-top: 1rem;
}

.empty-state .btn {
  margin-top: 1rem;
}

.hidden {
  display: none !important;
}

.btn {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 0.45rem;
  min-height: 46px;
  padding: 0 1.3rem;
  font-size: 0.92rem;
  font-weight: 600;
}

.btn.primary {
  background: linear-gradient(135deg, var(--accent) 0%, #f0c57e 100%);
  border-color: rgba(255, 236, 206, 0.28);
  color: #171109;
}

.btn.primary:hover {
  background: linear-gradient(135deg, var(--accent-hover) 0%, #f6cc88 100%);
}

.btn.primary.cooldown-active {
  border-color: rgba(215, 104, 104, 0.32);
  background: linear-gradient(135deg, #7b2430 0%, #ba4252 100%);
  color: #fff4f4;
}

.btn.secondary {
  color: var(--text);
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 1rem;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 5, 12, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.modal-card {
  position: relative;
  z-index: 1;
  width: min(720px, calc(100vw - 1.5rem));
  max-height: 88vh;
  overflow-y: auto;
  padding: 2rem;
}

.compose-card {
  width: min(760px, calc(100vw - 1.5rem));
}

.detail-card {
  width: min(640px, calc(100vw - 1.5rem));
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease;
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

.modal-card h2 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 2rem;
  color: var(--accent);
}

.modal-hint {
  margin: 0.7rem 0 1.2rem;
  font-size: 0.9rem;
}

.compose-emotion-picker {
  margin-top: 1.1rem;
}

.prompt-panel {
  margin: 1rem 0 1.2rem;
  padding: 1rem;
  border-radius: 22px;
  border: 1px solid rgba(214, 170, 101, 0.16);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(214, 170, 101, 0.05));
}

.prompt-panel-head {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-bottom: 0.75rem;
}

.prompt-label {
  color: var(--text-soft);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.prompt-headline {
  font-family: var(--font-serif);
  color: var(--text);
  font-size: 1.02rem;
}

.prompt-chip {
  padding: 0.58rem 0.82rem;
  font-size: 0.84rem;
}

.modal-card textarea,
.hash-input {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.modal-card textarea {
  min-height: 180px;
  padding: 1rem 1.1rem;
  resize: vertical;
  font-family: var(--font-serif);
  font-size: 1.05rem;
  line-height: 1.7;
}

.hash-input {
  padding: 0.95rem 1rem;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.9rem;
  letter-spacing: 0.04em;
}

.modal-card textarea:focus,
.hash-input:focus {
  outline: none;
  border-color: rgba(214, 170, 101, 0.38);
  box-shadow: 0 0 0 3px rgba(214, 170, 101, 0.08);
}

.modal-card textarea::placeholder,
.hash-input::placeholder {
  color: var(--text-muted);
}

.compose-meta-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  margin: 0.65rem 0 1rem;
}

.compose-selected-tone {
  color: var(--text-muted);
  font-size: 0.84rem;
}

.char-count {
  color: var(--text-muted);
  font-size: 0.76rem;
}

.compose-error {
  margin-top: 0.9rem;
  padding: 0.8rem 1rem;
  border-radius: 16px;
  border: 1px solid rgba(215, 104, 104, 0.26);
  background: rgba(215, 104, 104, 0.12);
  color: #f1b1b1;
  font-size: 0.86rem;
  line-height: 1.55;
}

#submit-btn,
#find-submit-btn {
  width: 100%;
}

#find-submit-btn {
  margin-top: 1rem;
}

.compose-error[data-cooldown-auto="1"] {
  font-variant-numeric: tabular-nums;
}

.status-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 1rem;
  border-radius: 18px;
  font-size: 0.86rem;
  line-height: 1.5;
}

.status-badge.pending {
  margin: 1rem 0 1.1rem;
  border: 1px solid rgba(214, 170, 101, 0.2);
  background: rgba(214, 170, 101, 0.08);
  color: #e7be82;
}

.aftercare-glow {
  width: 92px;
  height: 92px;
  margin: 0 auto 1rem;
  border-radius: 999px;
  background:
    radial-gradient(circle, rgba(255, 255, 255, 0.72) 0%, rgba(214, 170, 101, 0.3) 30%, rgba(214, 170, 101, 0.04) 72%, transparent 100%);
  box-shadow: 0 0 40px rgba(214, 170, 101, 0.18);
}

.aftercare-copy {
  max-width: 34rem;
  margin: 0.85rem auto 0;
  color: var(--text-muted);
  font-family: var(--font-serif);
  font-style: italic;
  text-align: center;
  line-height: 1.7;
}

.aftercare-ritual {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  margin: 1.35rem 0 1rem;
}

.aftercare-step {
  padding: 0.95rem;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: var(--text-soft);
  text-align: center;
  font-size: 0.84rem;
}

.hash-box {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  margin-top: 1rem;
  padding: 0.85rem 1rem;
  border-radius: 18px;
  border: 1px solid rgba(214, 170, 101, 0.24);
  background: rgba(214, 170, 101, 0.08);
}

.hash-value {
  flex: 1;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.86rem;
  word-break: break-all;
  letter-spacing: 0.03em;
}

.hash-copy-btn {
  padding: 0.62rem 0.95rem;
  font-size: 0.82rem;
}

.hash-copy-btn.copied {
  border-color: rgba(118, 192, 139, 0.34);
  background: rgba(118, 192, 139, 0.12);
  color: var(--success);
}

.hash-copy-status {
  margin: 0.7rem 0 0;
  color: var(--text-muted);
  font-family: var(--font-serif);
  font-size: 0.85rem;
  font-style: italic;
}

.detail-emotion {
  margin-bottom: 0.9rem;
}

.detail-divider {
  margin: 1.3rem 0;
  border: none;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.reactions-label {
  margin-bottom: 0.75rem;
  color: var(--text-soft);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.reactions-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.reaction-btn {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  cursor: pointer;
  padding: 0.42rem 0.8rem;
  font-size: 0.98rem;
  transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

.reaction-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(214, 170, 101, 0.3);
  background: rgba(214, 170, 101, 0.08);
}

.reaction-btn.active {
  border-color: rgba(214, 170, 101, 0.54);
  background: rgba(214, 170, 101, 0.14);
  color: var(--accent-hover);
}

.reaction-btn .count {
  color: var(--text-muted);
  font-size: 0.76rem;
}

#compose-btn,
#find-btn-fixed,
#values-btn {
  position: fixed;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0 1rem;
  height: 46px;
  border-radius: 999px;
  cursor: pointer;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

#compose-btn {
  right: 1.5rem;
  bottom: 1.5rem;
  border: 1px solid rgba(255, 236, 206, 0.2);
  background: linear-gradient(135deg, var(--accent) 0%, #f0c57e 100%);
  color: #171109;
}

#compose-btn:hover,
#find-btn-fixed:hover,
#values-btn:hover {
  transform: translateY(-2px);
}

#compose-btn.cooldown-active {
  background: linear-gradient(135deg, #7b2430 0%, #ba4252 100%);
  color: #fff4f4;
}

#find-btn-fixed,
#values-btn {
  border: 1px solid var(--surface-border);
  background: rgba(10, 14, 25, 0.82);
  color: var(--text-muted);
}

#find-btn-fixed {
  left: 1.5rem;
  bottom: 1.5rem;
}

#values-btn {
  left: 1.5rem;
  bottom: 5rem;
  height: 40px;
}

.fab-label {
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

#first-visit-hint {
  position: fixed;
  right: 1.5rem;
  bottom: 5rem;
  z-index: 31;
  display: flex;
  align-items: start;
  gap: 0.55rem;
  width: min(280px, calc(100vw - 2rem));
  padding: 0.8rem 0.9rem;
  border-radius: 18px;
  background: rgba(214, 170, 101, 0.12);
  border: 1px solid rgba(214, 170, 101, 0.2);
  color: var(--accent-hover);
  font-family: var(--font-serif);
  font-style: italic;
  line-height: 1.5;
  box-shadow: var(--shadow-md);
}

.hint-dismiss {
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
}

.modal-card::-webkit-scrollbar {
  width: 5px;
}

.modal-card::-webkit-scrollbar-thumb {
  background: rgba(214, 170, 101, 0.22);
  border-radius: 999px;
}

[data-tone="culpa"] {
  --tone: #df8d72;
}

[data-tone="saudade"] {
  --tone: #8ba7c9;
}

[data-tone="medo"] {
  --tone: #7ab0a9;
}

[data-tone="alivio"] {
  --tone: #8cc98b;
}

[data-tone="recomeco"] {
  --tone: #f0b985;
}

.emotion-chip[data-tone],
.compose-emotion-chip[data-tone],
.prompt-panel[data-tone],
.emotion-badge[data-tone] {
  border-color: color-mix(in srgb, var(--tone, var(--accent)) 28%, transparent);
}

.spotlight-card[data-tone],
.spotlight-echo[data-tone],
.cloud-bubble[data-tone],
.trail-orb[data-tone] {
  border-color: color-mix(in srgb, var(--tone, var(--accent)) 22%, rgba(255, 255, 255, 0.04));
}

.spotlight-card[data-tone] .spotlight-kicker,
.spotlight-echo[data-tone] .spotlight-echo-label,
.trail-orb[data-tone] .trail-orb-kicker,
.bubble-cloud-kicker {
  color: color-mix(in srgb, var(--tone, var(--accent)) 76%, white 24%);
}

.emotion-chip[data-tone].active,
.compose-emotion-chip[data-tone].active,
.prompt-panel[data-tone] {
  background: color-mix(in srgb, var(--tone, var(--accent)) 12%, rgba(255, 255, 255, 0.03));
}

.emotion-badge[data-tone] {
  color: var(--tone, var(--accent));
  background: color-mix(in srgb, var(--tone, var(--accent)) 14%, rgba(255, 255, 255, 0.02));
}

@media (max-width: 980px) {
  .values-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .panel-topbar {
    flex-direction: column;
    align-items: stretch;
  }

  .section-head,
  .bubble-cloud-head {
    flex-direction: column;
    align-items: start;
  }

  .spotlight-card {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 720px) {
  body {
    background:
      radial-gradient(circle at 18% 14%, rgba(214, 170, 101, 0.24), transparent 32%),
      radial-gradient(circle at 82% 18%, rgba(111, 146, 196, 0.18), transparent 28%),
      radial-gradient(circle at 50% 62%, rgba(92, 134, 118, 0.16), transparent 34%),
      linear-gradient(180deg, #08101d 0%, #05070f 52%, #04050b 100%);
  }

  #sky {
    background:
      radial-gradient(circle at 50% 12%, rgba(112, 145, 197, 0.12), transparent 28%),
      linear-gradient(180deg, rgba(111, 145, 197, 0.08) 0%, rgba(7, 10, 18, 0) 34%, rgba(4, 5, 11, 0.18) 100%);
  }

  #sky::before {
    width: 320px;
    height: 320px;
    top: 7%;
    left: -110px;
    opacity: 0.72;
  }

  #sky::after {
    width: 380px;
    height: 380px;
    right: -140px;
    bottom: 26%;
    opacity: 0.64;
  }

  #header {
    padding: 1rem 0.9rem 0.65rem;
    background: linear-gradient(180deg, rgba(5, 6, 13, 0.84), rgba(5, 6, 13, 0.18), transparent);
  }

  #brand {
    font-size: 1.32rem;
  }

  #tagline {
    font-size: 0.65rem;
    letter-spacing: 0.12em;
  }

  #app-shell {
    width: min(100vw - 1rem, 100%);
    height: 100svh;
    padding-top: 0;
  }

  .landing-overlay,
  .modal-card,
  .spotlight-card,
  .bubble-cloud-shell,
  .side-trail-shell {
    border-radius: 24px;
  }

  .landing-overlay,
  .modal-card,
  .empty-state,
  .loading-card {
    padding: 1.25rem;
  }

  #landing-shell {
    min-height: 100svh;
    height: 100%;
    align-items: center;
    padding-top: 5.5rem;
    padding-bottom: 4.75rem;
  }

  .landing-overlay {
    width: min(100%, 31rem);
    margin-inline: auto;
    padding: 1.15rem 1.1rem 1.2rem;
    border-color: rgba(255, 236, 206, 0.06);
    background: linear-gradient(180deg, rgba(8, 11, 20, 0.12), rgba(8, 11, 20, 0.48) 18%, rgba(8, 11, 20, 0.9) 100%);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.26);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
  }

  .landing-overlay h1 {
    font-size: 2.4rem;
    max-width: 13ch;
  }

  #landing-summary {
    margin: 0.8rem 0 1.2rem;
    max-width: 32rem;
    font-size: 0.98rem;
  }

  .values-grid,
  .aftercare-ritual {
    grid-template-columns: 1fr;
  }

  .spotlight-stats,
  .side-trail-row {
    grid-template-columns: 1fr;
  }

  .bubble-cloud {
    gap: 0.75rem;
  }

  .cloud-bubble,
  .cloud-bubble.size-0,
  .cloud-bubble.size-1,
  .cloud-bubble.size-2,
  .cloud-bubble.size-3 {
    width: min(100%, 320px);
    margin-top: 0;
    transform: none;
  }

  .compose-meta-row {
    flex-direction: column;
    align-items: start;
  }
}

@media (max-width: 560px) {
  #app-shell {
    width: min(calc(100vw - 2.5rem), 24rem);
    height: 100svh;
  }

  #header {
    padding-top: calc(0.8rem + env(safe-area-inset-top, 0px));
  }

  #tagline {
    display: none;
  }

  #compose-btn,
  #find-btn-fixed {
    bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
    height: 44px;
  }

  #compose-btn {
    right: 1rem;
  }

  #find-btn-fixed {
    left: 1rem;
  }

  #values-btn {
    left: 1rem;
    bottom: calc(4.25rem + env(safe-area-inset-bottom, 0px));
  }

  #first-visit-hint {
    right: 1rem;
    bottom: calc(4.25rem + env(safe-area-inset-bottom, 0px));
    width: calc(100vw - 2rem);
  }

  .fab-label {
    display: none;
  }

  #landing-shell {
    align-items: center;
    padding-top: calc(5.25rem + env(safe-area-inset-top, 0px));
    padding-bottom: calc(4.75rem + env(safe-area-inset-bottom, 0px));
  }

  .landing-kicker {
    margin-bottom: 0.55rem;
    font-size: 0.66rem;
    letter-spacing: 0.18em;
  }

  .landing-overlay {
    width: 100%;
    padding: 0.95rem 0.9rem 1rem;
    border-radius: 22px;
    background: linear-gradient(180deg, rgba(8, 11, 20, 0.08), rgba(8, 11, 20, 0.38) 16%, rgba(8, 11, 20, 0.88) 100%);
  }

  .landing-overlay h1 {
    font-size: clamp(2rem, 9vw, 2.55rem);
    line-height: 1;
  }

  #landing-summary {
    margin-bottom: 1rem;
    font-size: 0.92rem;
    line-height: 1.62;
  }

  .landing-actions {
    justify-content: center;
    gap: 0.6rem;
  }

  .landing-actions .btn {
    min-height: 42px;
  }

  .landing-actions .btn.primary {
    width: 100%;
  }

  .landing-actions .btn.secondary,
  .landing-subnav,
  #values-btn,
  #first-visit-hint {
    display: none !important;
  }

  .landing-actions .btn.secondary {
    flex: 1 1 calc(50% - 0.3rem);
    padding-inline: 0.9rem;
    background: rgba(255, 255, 255, 0.03);
  }

  .landing-subnav {
    margin-top: 0.85rem;
    padding-top: 0.8rem;
    border-top-color: rgba(255, 255, 255, 0.04);
  }

  .landing-focus-copy {
    min-height: 0;
    font-size: 0.88rem;
    line-height: 1.55;
  }

  #landing-emotion-chips {
    flex-wrap: nowrap;
    gap: 0.5rem;
    overflow-x: auto;
    padding-bottom: 0.3rem;
    scrollbar-width: none;
    mask-image: linear-gradient(90deg, transparent 0, black 6%, black 94%, transparent 100%);
    -webkit-mask-image: linear-gradient(90deg, transparent 0, black 6%, black 94%, transparent 100%);
  }

  #landing-emotion-chips::-webkit-scrollbar {
    display: none;
  }

  #landing-emotion-chips .emotion-chip {
    flex: 0 0 auto;
    padding: 0.6rem 0.82rem;
    font-size: 0.83rem;
    background: rgba(255, 255, 255, 0.03);
  }

  .bubble {
    bottom: -140px;
    min-width: 0;
    border-radius: 20px;
    background: rgba(10, 13, 23, 0.74);
    border-color: rgba(214, 170, 101, 0.2);
    box-shadow:
      0 0 0 1px rgba(214, 170, 101, 0.05),
      0 12px 30px rgba(0, 0, 0, 0.34),
      0 0 56px rgba(111, 145, 197, 0.08);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
  }

  .bubble.sm {
    max-width: 56vw;
  }

  .bubble.md {
    max-width: 68vw;
  }

  .bubble.lg {
    max-width: 78vw;
  }

  .bubble-text {
    font-size: 0.9rem;
    line-height: 1.5;
  }

  .panel-switcher {
    width: 100%;
    justify-content: space-between;
  }

  .panel-switch {
    flex: 1;
  }
}
