:root {
  color-scheme: dark;
  --ink: #effff9;
  --muted: #88aaa0;
  --paper: #07100e;
  --panel: rgba(6, 18, 16, 0.8);
  --line: rgba(141, 255, 223, 0.2);
  --aqua-1: #d8fff4;
  --aqua-2: #bdfce9;
  --aqua-3: #95f3d7;
  --aqua-4: #6de8c8;
  --aqua-5: #40d9b7;
  --button: #8dffdf;
  --button-ink: #03120f;
  --danger: #ff6f91;
  --bubble-glow: rgba(0, 220, 229, 0.15);
  --shadow: 0 0 40px rgba(0, 220, 229, 0.15);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  min-height: 100vh;
  margin: 0;
  font-family: Inter, "Segoe UI Variable Display", "Aptos Display", system-ui, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at center, #1a1a1a 0%, #131313 46%, #0d0e0f 100%);
  overflow: hidden;
}

.material-symbols-outlined {
  font-variation-settings: "FILL" 0, "wght" 300, "GRAD" 0, "opsz" 24;
}

body[data-theme="ember"] {
  --ink: #fff8ef;
  --muted: #bca994;
  --panel: rgba(22, 12, 7, 0.82);
  --line: rgba(255, 194, 102, 0.24);
  --aqua-1: #fff2c7;
  --aqua-2: #ffe19c;
  --aqua-3: #ffc96f;
  --aqua-4: #ffae55;
  --aqua-5: #ff8f5a;
  --button: #ffc266;
  --button-ink: #1b0b03;
  --danger: #ff6b6b;
  --bubble-glow: rgba(255, 174, 85, 0.18);
  --shadow: 0 0 40px rgba(255, 174, 85, 0.16);
  background:
    radial-gradient(circle at center, #1b1511 0%, #13100d 48%, #0d0a08 100%);
}

button,
input {
  font: inherit;
}

.app-shell {
  position: relative;
  width: 100%;
  min-height: 100vh;
  margin: 0 auto;
  padding: 96px 24px 160px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  overflow: hidden;
  transition: filter 500ms ease, opacity 500ms ease;
}

body.clear-modal-open .app-shell {
  filter: blur(8px);
}

body.clear-modal-open .thought-form {
  opacity: 0;
  pointer-events: none;
}

.app-ambient {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.void-glow {
  position: absolute;
  border-radius: 999px;
  filter: blur(120px);
  pointer-events: none;
}

.void-glow-main {
  top: 50%;
  left: 50%;
  width: 800px;
  height: 800px;
  background: rgba(0, 220, 229, 0.11);
  animation: void-pulse 8s infinite alternate ease-in-out;
}

.void-glow-side {
  top: 24%;
  right: 24%;
  width: 400px;
  height: 400px;
  background: rgba(177, 197, 255, 0.07);
  animation: empty-drift 6s infinite alternate ease-in-out;
}

.app-header {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 20;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 16px clamp(24px, 5vw, 64px);
  background: transparent;
}

.app-brand {
  color: var(--button);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(1.65rem, 2.4vw, 2.4rem);
  line-height: 1;
  letter-spacing: 0;
  text-transform: uppercase;
  font-weight: 800;
  color: #dffff6;
  text-shadow: 0 0 22px rgba(141, 255, 223, 0.34);
}

.auth-screen {
  position: relative;
  width: 100%;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 96px 24px;
}

.auth-ambient {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.signal-glow {
  position: absolute;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  filter: blur(120px);
  background: radial-gradient(circle, rgba(0, 220, 229, 0.15) 0%, rgba(0, 220, 229, 0) 70%);
  opacity: 0.38;
  animation: ambient-drift 20s infinite alternate ease-in-out;
}

.glow-one {
  top: 18%;
  left: -120px;
}

.glow-two {
  right: -110px;
  bottom: 16%;
  width: 500px;
  height: 500px;
  opacity: 0.3;
  animation-delay: -5s;
}

.auth-header {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 4;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px clamp(24px, 5vw, 64px);
}

.auth-brand {
  color: var(--button);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.auth-icon-button {
  width: 36px;
  height: 36px;
  border: 0;
  color: var(--muted);
  background: transparent;
  cursor: default;
}

.auth-card {
  position: relative;
  z-index: 2;
  width: min(448px, 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 32px;
  padding: 40px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  border-left: 1px solid rgba(255, 255, 255, 0.1);
  border-right: 1px solid rgba(0, 0, 0, 0.2);
  border-bottom: 1px solid rgba(0, 0, 0, 0.2);
  border-radius: 8px;
  background: rgba(31, 32, 33, 0.1);
  backdrop-filter: blur(20px);
}

.auth-card-icon {
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(177, 197, 255, 0.3);
  border-radius: 999px;
  color: #b1c5ff;
  background: rgba(177, 197, 255, 0.05);
  box-shadow: 0 0 30px rgba(0, 220, 229, 0.1);
}

.auth-card-icon .material-symbols-outlined {
  font-size: 2rem;
  font-variation-settings: "FILL" 1, "wght" 300, "GRAD" 0, "opsz" 24;
}

.auth-card-copy {
  text-align: center;
}

.auth-card-copy h1 {
  margin: 0 0 8px;
  color: var(--button);
  font-family: "Noto Serif", serif;
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1.3;
  text-transform: none;
  text-shadow: none;
}

.auth-card-copy p {
  margin: 0;
  color: rgba(195, 198, 213, 0.8);
  line-height: 1.6;
}

.signin-form {
  width: 100%;
  display: grid;
  gap: 16px;
}

.signin-form label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.signin-row {
  display: grid;
  gap: 16px;
}

.signin-row input {
  height: 56px;
  border: 0;
  border-radius: 2px;
  padding: 0 24px;
  color: var(--button);
  background: rgba(13, 14, 15, 0.4);
  font-size: 1rem;
  font-weight: 500;
}

.signin-row input::placeholder {
  color: var(--muted);
}

.signin-row button,
#sign-out {
  border: 0;
  border-radius: 8px;
  color: var(--button-ink);
  background: var(--button);
  cursor: pointer;
  font-weight: 900;
}

.signin-row button {
  position: relative;
  min-height: 56px;
  overflow: hidden;
  border: 1px solid rgba(177, 197, 255, 0.5);
  border-radius: 2px;
  color: var(--button);
  background: transparent;
  transition: letter-spacing 500ms ease, transform 160ms ease, opacity 160ms ease;
}

.signin-row button:hover {
  letter-spacing: 0.14em;
}

.signin-row button:active {
  transform: scale(0.98);
}

.signin-row button span {
  position: relative;
  z-index: 1;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.signin-row button::before {
  position: absolute;
  inset: 0;
  content: "";
  background: rgba(177, 197, 255, 0.05);
  opacity: 0;
  transition: opacity 300ms ease;
}

.signin-row button:hover::before {
  opacity: 1;
}

.auth-message {
  min-height: 22px;
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.45;
  text-align: center;
}

.auth-secure-note {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.auth-secure-note span {
  width: 32px;
  height: 1px;
  background: rgba(141, 255, 223, 0.22);
}

.auth-secure-note p {
  margin: 0;
}

.account-bar {
  display: flex;
  align-items: center;
  gap: 24px;
  color: var(--muted);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.theme-switcher {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
}

.theme-switcher label {
  cursor: pointer;
}

.theme-switcher input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
}

.theme-switcher span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0;
  color: var(--muted);
  font-size: 0.75rem;
  transition: color 300ms ease, letter-spacing 300ms ease;
}

.control-text {
  display: inline;
}

.theme-switcher input:checked + span {
  color: var(--button);
  background: transparent;
}

.theme-switcher span:hover {
  letter-spacing: 0.16em;
}

.theme-switcher .material-symbols-outlined,
.account-email .material-symbols-outlined,
#sign-out .material-symbols-outlined {
  font-size: 1.15rem;
}

.theme-switcher input:checked + span .material-symbols-outlined {
  font-variation-settings: "FILL" 1, "wght" 300, "GRAD" 0, "opsz" 24;
}

.account-email {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  text-transform: lowercase;
}

#sign-out {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 0;
  padding: 0;
  color: var(--muted);
  background: transparent;
  text-transform: uppercase;
  transition: color 300ms ease, letter-spacing 300ms ease;
}

#sign-out:hover {
  color: var(--button);
  letter-spacing: 0.16em;
}

#sign-out:hover .material-symbols-outlined {
  color: var(--danger);
}

.thought-form {
  position: fixed;
  left: 50%;
  bottom: max(64px, env(safe-area-inset-bottom));
  z-index: 30;
  width: min(672px, calc(100% - 48px));
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  align-items: center;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}

.thought-form[hidden] {
  display: none;
}

.thought-form label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.input-row {
  min-width: 0;
  display: grid;
  grid-template-columns: 1fr 44px;
  gap: 16px;
  align-items: center;
  padding: 20px 32px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 999px;
  border-top-color: rgba(255, 255, 255, 0.1);
  border-left-color: rgba(255, 255, 255, 0.1);
  background: rgba(31, 32, 33, 0.2);
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
  transition: box-shadow 300ms ease, transform 300ms ease, border-color 300ms ease;
}

.input-row:focus-within {
  border-color: rgba(177, 197, 255, 0.3);
  box-shadow: 0 0 50px rgba(0, 220, 229, 0.25);
  transform: scale(1.02);
}

input {
  width: 100%;
  height: 28px;
  border: 0;
  border-radius: 0;
  padding: 0;
  color: var(--button);
  background: transparent;
  outline: none;
  font-size: 1rem;
  font-weight: 500;
}

input:focus {
  box-shadow: none;
}

input::placeholder {
  color: var(--muted);
}

.input-row button {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 999px;
  color: #b1c5ff;
  background: transparent;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: transform 160ms ease, opacity 160ms ease;
}

.input-row button:hover {
  transform: scale(1.1);
}

.input-row button:active {
  transform: translateY(0);
}

.input-row button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
  transform: none;
}

.input-row button span {
  font-size: 1.65rem;
  line-height: 1;
  font-variation-settings: "FILL" 1, "wght" 300, "GRAD" 0, "opsz" 24;
}

.form-meta {
  min-height: 32px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  color: var(--muted);
  font-size: 0.84rem;
  padding: 0 20px;
}

.form-meta .is-warning {
  color: #ffd166;
}

.form-meta .is-capped {
  color: var(--danger);
}

.thought-status {
  min-width: 0;
  max-width: 220px;
  overflow: hidden;
  color: var(--button);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.limit-lock {
  display: none;
}

.thought-form.is-limit-reached .input-row {
  position: relative;
  grid-template-columns: 1fr auto;
  overflow: hidden;
  opacity: 0.9;
}

.thought-form.is-limit-reached .input-row::after {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 4px;
  content: "";
  background: #42474b;
}

.thought-form.is-limit-reached .limit-lock {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--muted);
}

.thought-form.is-limit-reached input {
  display: none;
}

.thought-form.is-limit-reached .input-row button {
  display: inline-flex;
  width: auto;
  min-width: 72px;
  gap: 8px;
  color: #b1c5ff;
  opacity: 1;
}

.thought-form.is-limit-reached .input-row button::before {
  content: "PRO";
  font-family: "JetBrains Mono", monospace;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
}

.clear-button {
  position: fixed;
  right: clamp(24px, 5vw, 64px);
  bottom: 128px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 12px 24px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.03);
  cursor: pointer;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transition: border-color 300ms ease, color 300ms ease, letter-spacing 300ms ease, opacity 160ms ease;
}

.clear-button:not(:disabled):hover {
  border-color: var(--button);
  color: var(--button);
  letter-spacing: 0.16em;
}

.clear-button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.coffee-link {
  position: fixed;
  left: 50%;
  bottom: 64px;
  z-index: 11;
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0;
  border: 0;
  color: var(--muted);
  background: transparent;
  box-shadow: none;
  text-decoration: none;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transform: translateX(-50%);
  transition: color 300ms ease;
}

.coffee-link:hover {
  color: var(--button);
}

.coffee-link .material-symbols-outlined {
  font-size: 1rem;
}

.coffee-arrow {
  opacity: 0;
  transform: translateX(-6px);
  transition: opacity 250ms ease, transform 250ms ease;
}

.coffee-link:hover .coffee-arrow {
  opacity: 1;
  transform: translateX(0);
}

.bubble-board {
  position: relative;
  z-index: 1;
  flex: 1;
  min-height: calc(100vh - 226px);
  display: grid;
  place-items: center;
  overflow: hidden;
}

.limit-banner {
  position: absolute;
  top: 0;
  left: 50%;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: calc(100% - 32px);
  padding: 12px 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  border-left: 1px solid rgba(255, 255, 255, 0.1);
  border-right: 1px solid rgba(0, 0, 0, 0.1);
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 999px;
  color: #dfe3e8;
  background: rgba(255, 255, 255, 0.03);
  box-shadow: 0 0 40px rgba(0, 220, 229, 0.12);
  backdrop-filter: blur(20px);
  transform: translateX(-50%);
  animation: limit-pulse 2.4s ease-in-out infinite;
}

.limit-banner .material-symbols-outlined {
  color: #42474b;
}

.limit-banner span:not(.material-symbols-outlined) {
  overflow: hidden;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.limit-banner button {
  border: 0;
  padding: 0;
  color: var(--button);
  background: transparent;
  cursor: pointer;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-decoration: underline;
  text-underline-offset: 4px;
  text-transform: uppercase;
}

.thought-list {
  position: relative;
  width: 100%;
  height: clamp(520px, calc(100vh - 220px), 760px);
  min-height: 520px;
}

.thought-bubble {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 192px;
  margin: 0;
  transform-origin: 50% 50%;
  --x: 0px;
  --y: 0px;
  transform: translate(calc(-50% + var(--x)), calc(-50% + var(--y)));
  will-change: transform;
  cursor: grab;
}

.thought-bubble.is-entering {
  animation: center-pop 840ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.thought-bubble.is-removing {
  animation: bubble-exit 260ms ease both;
  pointer-events: none;
}

.thought-bubble.is-clearing {
  animation: bubble-exit 320ms ease both;
  animation-delay: calc(var(--clear-index, 0) * 32ms);
  pointer-events: none;
}

.bubble-surface {
  position: relative;
  min-height: 176px;
  padding: 28px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(0, 220, 229, 0.22);
  border-radius: 45% 55% 60% 40% / 50% 40% 60% 50%;
  background: linear-gradient(135deg, rgba(0, 245, 255, 0.08) 0%, rgba(0, 245, 255, 0) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(20px);
  animation: liquid 15s ease-in-out infinite alternate;
  transition: border-color 300ms ease, box-shadow 300ms ease, background 300ms ease, transform 300ms ease;
}

.limit-badge {
  position: absolute;
  top: -12px;
  right: 32px;
  display: none;
  padding: 4px 12px;
  border: 1px solid rgba(66, 71, 75, 0.5);
  border-radius: 999px;
  color: #42474b;
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(20px);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.thought-bubble.is-limit-bubble .bubble-surface {
  border-color: #42474b;
  background: linear-gradient(135deg, rgba(66, 71, 75, 0.2), rgba(66, 71, 75, 0.04));
  box-shadow: 0 0 50px rgba(254, 183, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.thought-bubble.is-limit-bubble .limit-badge {
  display: block;
}

.thought-bubble:hover .bubble-surface,
.thought-bubble:focus-within .bubble-surface {
  border-color: rgba(0, 220, 229, 0.52);
  background: linear-gradient(135deg, rgba(0, 245, 255, 0.15) 0%, rgba(0, 245, 255, 0.05) 100%);
  box-shadow: 0 0 40px var(--bubble-glow), inset 0 1px 0 rgba(255, 255, 255, 0.14);
  transform: scale(1.05);
}

.thought-bubble:nth-child(2n) {
  width: 256px;
}

.thought-bubble:nth-child(2n) .bubble-surface {
  min-height: 224px;
  border-radius: 55% 45% 40% 60% / 40% 60% 40% 60%;
  animation-duration: 18s;
  animation-direction: alternate-reverse;
}

.thought-bubble:nth-child(3n) {
  width: 288px;
}

.thought-bubble:nth-child(3n) .bubble-surface {
  min-height: 208px;
  border-radius: 40% 60% 55% 45% / 60% 40% 60% 40%;
  animation-duration: 22s;
}

.thought-bubble:nth-child(4n) {
  width: 160px;
}

.thought-bubble:nth-child(4n) .bubble-surface {
  min-height: 160px;
  border-radius: 50%;
}

.thought-bubble:nth-child(5n) {
  width: 224px;
}

.thought-bubble:nth-child(5n) .bubble-surface {
  min-height: 224px;
  border-radius: 60% 40% 50% 50% / 50% 50% 60% 40%;
}

.thought-bubble p {
  margin: 0;
  max-width: 14ch;
  overflow-wrap: anywhere;
  text-align: center;
  font-size: 1.05rem;
  line-height: 1.25;
  font-weight: 500;
  color: var(--button);
}

.thought-bubble button {
  position: absolute;
  top: 8px;
  right: 10px;
  width: 26px;
  height: 26px;
  border: 0;
  border-radius: 50%;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  opacity: 0;
  transform: scale(0.84);
  pointer-events: none;
  transition: opacity 150ms ease, transform 150ms ease;
}

.thought-bubble button .material-symbols-outlined {
  font-size: 1rem;
}

.thought-bubble button:hover {
  color: var(--danger);
}

.thought-bubble:hover button,
.thought-bubble:focus-within button {
  opacity: 1;
  transform: scale(1);
  pointer-events: auto;
}

.empty-state {
  min-height: 320px;
  display: grid;
  place-items: center;
  gap: 16px;
  color: var(--muted);
  text-align: center;
}

.confirm-dialog {
  width: min(448px, calc(100% - 32px));
  border: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  border-left: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 0;
  color: var(--ink);
  background: rgba(32, 31, 31, 0.4);
  box-shadow: 0 32px 100px rgba(0, 0, 0, 0.48);
  backdrop-filter: blur(40px);
}

.confirm-dialog[open] {
  animation: dialog-pop 300ms ease both;
}

.confirm-dialog::backdrop {
  background: rgba(18, 19, 20, 0.8);
  backdrop-filter: blur(4px);
}

.confirm-dialog form {
  padding: 40px;
  text-align: center;
}

.dialog-icon {
  position: relative;
  width: 72px;
  height: 72px;
  display: grid;
  place-items: center;
  margin: 0 auto 32px;
  color: var(--danger);
}

.dialog-icon::before {
  position: absolute;
  inset: 0;
  content: "";
  border-radius: 999px;
  background: rgba(255, 111, 145, 0.1);
  filter: blur(22px);
}

.dialog-icon .material-symbols-outlined {
  position: relative;
  font-size: 4rem;
  font-variation-settings: "FILL" 0, "wght" 300, "GRAD" 0, "opsz" 48;
}

.confirm-dialog h2 {
  margin: 0 0 16px;
  color: var(--button);
  font-family: "Noto Serif", serif;
  font-size: 1.5rem;
  font-weight: 600;
}

.confirm-dialog p {
  margin: 0 0 40px;
  color: var(--muted);
  line-height: 1.65;
}

.dialog-actions {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.ghost-button,
.danger-button {
  width: 100%;
  min-height: 54px;
  border-radius: 999px;
  cursor: pointer;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transition: color 300ms ease, letter-spacing 300ms ease, border-color 300ms ease;
}

.ghost-button {
  border: 0;
  color: var(--muted);
  background: transparent;
}

.danger-button {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 111, 145, 0.5);
  color: var(--danger);
  background: transparent;
}

.danger-button::before {
  position: absolute;
  inset: 0;
  content: "";
  background: rgba(255, 111, 145, 0.05);
  opacity: 0;
  transition: opacity 300ms ease;
}

.danger-button:hover::before {
  opacity: 1;
}

.ghost-button:hover,
.danger-button:hover {
  letter-spacing: 0.16em;
}

.empty-state h2 {
  margin: 0;
  color: var(--button);
  font-family: Sora, Inter, sans-serif;
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 600;
  letter-spacing: 0.2em;
  line-height: 1.1;
  opacity: 0.8;
  text-transform: uppercase;
}

.empty-state p {
  margin: 0;
  text-align: center;
  color: var(--muted);
  font-family: "Noto Serif", serif;
  font-size: 1.5rem;
  font-weight: 400;
  letter-spacing: 0.04em;
  line-height: 1.35;
}

.empty-beam {
  width: 1px;
  height: 96px;
  margin-top: 44px;
  background: linear-gradient(to bottom, rgba(177, 197, 255, 0.42), transparent);
}

.empty-state.is-hidden {
  display: none;
}

@keyframes center-pop {
  from {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.08);
  }
  68% {
    opacity: 1;
    transform: translate(calc(-50% + var(--x)), calc(-50% + var(--y))) scale(1.045);
  }
  to {
    opacity: 1;
    transform: translate(calc(-50% + var(--x)), calc(-50% + var(--y))) scale(1);
  }
}

@keyframes bubble-exit {
  from {
    opacity: 1;
    transform: translate(calc(-50% + var(--x)), calc(-50% + var(--y))) scale(1);
  }
  to {
    opacity: 0;
    transform: translate(calc(-50% + var(--x)), calc(-50% + var(--y))) scale(0.72);
  }
}

@keyframes liquid {
  0% {
    border-radius: 52% 48% 54% 46% / 48% 54% 46% 52%;
    transform: translate(0, 0) rotate(-0.35deg) scale(1);
  }
  35% {
    border-radius: 46% 54% 43% 57% / 58% 44% 56% 42%;
    transform: translate(1px, -3px) rotate(0.45deg) scale(1.012);
  }
  70% {
    border-radius: 56% 44% 52% 48% / 42% 58% 45% 55%;
    transform: translate(-2px, 2px) rotate(-0.4deg) scale(0.995);
  }
  100% {
    border-radius: 48% 52% 58% 42% / 52% 46% 54% 48%;
    transform: translate(2px, -1px) rotate(0.25deg) scale(1.008);
  }
}

@keyframes empty-drift {
  from {
    transform: translateY(-6px) scale(0.98);
  }
  to {
    transform: translateY(8px) scale(1.03);
  }
}

@keyframes dialog-pop {
  from {
    opacity: 0;
    transform: scale(0.96);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes limit-pulse {
  0%,
  100% {
    opacity: 0.82;
  }
  50% {
    opacity: 1;
  }
}

@keyframes void-pulse {
  from {
    opacity: 0.1;
    transform: translate(-50%, -50%) scale(1);
  }
  to {
    opacity: 0.25;
    transform: translate(-50%, -50%) scale(1.1);
  }
}

@keyframes ambient-drift {
  from {
    transform: translate(-10%, -10%);
  }
  to {
    transform: translate(10%, 10%);
  }
}

@keyframes signal-float {
  from {
    transform: translateY(-8px) scale(0.98);
  }
  to {
    transform: translateY(10px) scale(1.03);
  }
}

@media (prefers-reduced-motion: reduce) {
  .thought-bubble,
  .bubble-surface {
    animation: none;
    transition: none;
  }
}

@media (max-width: 760px) {
  body {
    min-height: max(884px, 100dvh);
    --button: #f9e37a;
    --button-ink: #211b00;
    --muted: #8d909e;
    --bubble-glow: rgba(254, 183, 0, 0.15);
    --shadow: 0 0 40px rgba(254, 183, 0, 0.15);
    background: radial-gradient(circle at 50% 50%, #1a1a1a 0%, #0e0e0e 100%);
  }

  .auth-screen {
    min-height: 100vh;
    padding: 88px 24px 112px;
  }

  .auth-header {
    padding-inline: 24px;
  }

  .auth-card {
    padding: 32px 24px;
    gap: 28px;
  }

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

  .signin-row button {
    min-height: 52px;
  }

  .intro {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }

  .account-bar {
    width: auto;
    justify-content: flex-end;
    gap: 16px;
  }

  #user-email {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
  }

  .app-shell {
    min-height: max(884px, 100dvh);
    padding: 84px 24px 188px;
    overflow: hidden;
  }

  .app-header {
    padding: 16px 24px;
  }

  .app-brand {
    color: #b1c5ff;
  }

  .void-glow-main {
    top: 25%;
    left: -80px;
    width: 320px;
    height: 320px;
    background: rgba(66, 71, 75, 0.18);
    filter: blur(100px);
  }

  .void-glow-side {
    right: -80px;
    bottom: 32%;
    top: auto;
    width: 384px;
    height: 384px;
    background: rgba(194, 199, 204, 0.08);
    filter: blur(120px);
  }

  .bubble-board {
    min-height: calc(100dvh - 252px);
    place-items: center;
  }

  .limit-banner {
    top: 8px;
    width: min(100%, 360px);
    padding: 10px 14px;
    gap: 8px;
  }

  .limit-banner span:not(.material-symbols-outlined),
  .limit-banner button {
    font-size: 0.62rem;
  }

  .thought-list {
    width: min(100%, 390px);
    height: min(640px, calc(100dvh - 242px));
    min-height: 560px;
  }

  .thought-bubble {
    width: 104px;
  }

  .bubble-surface {
    min-height: 104px;
    padding: 16px;
    border-color: rgba(255, 255, 255, 0.06);
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(66, 71, 75, 0.2), rgba(66, 71, 75, 0));
    box-shadow: 0 0 40px -10px var(--bubble-glow), inset 0 1px 0 rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(8px);
    animation-duration: 12s;
  }

  .thought-bubble:nth-child(1) {
    width: 136px;
  }

  .thought-bubble:nth-child(1) .bubble-surface {
    min-height: 136px;
    background: linear-gradient(135deg, rgba(66, 71, 75, 0.24), rgba(66, 71, 75, 0));
  }

  .thought-bubble:nth-child(2n) {
    width: 104px;
  }

  .thought-bubble:nth-child(2n) .bubble-surface {
    min-height: 104px;
    border-radius: 50%;
    animation-duration: 15s;
  }

  .thought-bubble:nth-child(3n) {
    width: 110px;
  }

  .thought-bubble:nth-child(3n) .bubble-surface {
    min-height: 110px;
    border-radius: 50%;
    animation-duration: 10s;
  }

  .thought-bubble:nth-child(4n),
  .thought-bubble:nth-child(5n) {
    width: 104px;
  }

  .thought-bubble:nth-child(4n) .bubble-surface,
  .thought-bubble:nth-child(5n) .bubble-surface {
    min-height: 104px;
    border-radius: 50%;
  }

  .thought-bubble p {
    color: #dfe3e8;
    font-size: 0.95rem;
    font-weight: 500;
  }

  .thought-form {
    grid-template-columns: 1fr;
    bottom: max(64px, env(safe-area-inset-bottom));
    width: min(448px, calc(100% - 48px));
  }

  .thought-form::after {
    content: "Capture";
    justify-self: center;
    color: #d9e2ff;
    font-size: 1rem;
    font-weight: 500;
  }

  .input-row {
    grid-template-columns: 1fr 48px;
    gap: 12px;
    padding: 8px;
    border-top-color: rgba(255, 255, 255, 0.1);
    border-left-color: rgba(255, 255, 255, 0.1);
    border-right-color: rgba(255, 255, 255, 0.04);
    border-bottom-color: rgba(255, 255, 255, 0.04);
    background: rgba(31, 32, 33, 0.2);
    box-shadow: var(--shadow);
  }

  .input-row input {
    height: 48px;
    padding-inline: 16px;
    color: #e3e2e3;
  }

  .input-row button {
    width: 48px;
    height: 48px;
    color: #4a3f00;
    background: #42474b;
  }

  .clear-button {
    right: 18px;
    bottom: 148px;
    padding: 10px 16px;
    background: rgba(31, 32, 33, 0.28);
  }

  .form-meta {
    min-height: 0;
    justify-content: center;
    padding-inline: 8px;
  }

  .form-meta > span {
    display: none;
  }

  .thought-form.is-limit-reached::after {
    content: "";
  }

  .thought-form.is-limit-reached .input-row {
    grid-template-columns: 1fr auto;
  }

  .thought-form.is-limit-reached .limit-lock {
    font-size: 0.9rem;
  }

  .coffee-link {
    bottom: 40px;
  }
}

@media (max-width: 420px) {
  .theme-switcher {
    order: 3;
    width: 100%;
    justify-content: space-between;
  }

  .control-text,
  #sign-out span:last-child {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
  }

  .theme-switcher span {
    width: auto;
  }

  .input-row {
    grid-template-columns: 1fr 44px;
    padding: 8px;
  }

  .input-row button {
    width: 44px;
  }
}
