:root {
  --bg-base: #060919;
  --bg-deep: #09102a;
  --bg-panel: rgba(8, 15, 46, 0.78);
  --bg-panel-strong: rgba(9, 18, 56, 0.92);
  --bg-panel-soft: rgba(12, 20, 62, 0.62);
  --bg-field: rgba(16, 25, 74, 0.74);
  --line: rgba(130, 145, 255, 0.28);
  --line-strong: rgba(142, 157, 255, 0.46);
  --text-main: #f5f1ff;
  --text-soft: #9da7d7;
  --text-faint: #7480be;
  --accent: #7480ff;
  --accent-strong: #8d96ff;
  --accent-warm: #c2b6ff;
  --shadow: 0 28px 80px rgba(0, 0, 0, 0.48);
  --glow: 0 0 30px rgba(116, 128, 255, 0.45);
  --radius-xl: 34px;
  --radius-lg: 28px;
  --radius-md: 22px;
  --radius-sm: 18px;
  --radius-full: 999px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: "Aptos", "Segoe UI", "Trebuchet MS", Arial, sans-serif;
  background:
    radial-gradient(circle at 18% 16%, rgba(71, 88, 196, 0.28), transparent 24%),
    radial-gradient(circle at 76% 18%, rgba(123, 78, 224, 0.34), transparent 28%),
    radial-gradient(circle at 62% 66%, rgba(46, 83, 201, 0.2), transparent 30%),
    linear-gradient(180deg, #030612 0%, #05081a 22%, #08102a 58%, #060a1d 100%);
  color: var(--text-main);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at 80% 10%, rgba(161, 167, 255, 0.1) 0 1px, transparent 1px) 0 0 / 180px 180px,
    radial-gradient(circle at 15% 40%, rgba(255, 255, 255, 0.16) 0 1px, transparent 1px) 0 0 / 140px 140px,
    radial-gradient(circle at 55% 78%, rgba(130, 145, 255, 0.12) 0 1px, transparent 1px) 0 0 / 220px 220px;
  opacity: 0.9;
  pointer-events: none;
}

body.editor-open {
  overflow: hidden;
}

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

button {
  border: 0;
}

.app-shell {
  position: relative;
  min-height: 100vh;
  max-width: 520px;
  margin: 0 auto;
  padding: 38px 22px 180px;
  overflow: hidden;
}

.app-cosmos {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.stars,
.moon-glow,
.haze {
  position: absolute;
}

.stars {
  inset: 0;
  background:
    radial-gradient(circle at 18% 8%, rgba(255, 255, 255, 0.65) 0 1.4px, transparent 1.8px),
    radial-gradient(circle at 84% 19%, rgba(162, 175, 255, 0.7) 0 1.6px, transparent 2px),
    radial-gradient(circle at 72% 31%, rgba(255, 255, 255, 0.5) 0 1px, transparent 1.6px),
    radial-gradient(circle at 33% 22%, rgba(190, 202, 255, 0.46) 0 1px, transparent 1.6px),
    radial-gradient(circle at 91% 43%, rgba(200, 187, 255, 0.54) 0 1px, transparent 1.6px);
  opacity: 0.9;
}

.moon-glow {
  top: -190px;
  right: -118px;
  width: 430px;
  height: 430px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 36% 36%, rgba(120, 131, 255, 0.98) 0%, rgba(79, 96, 248, 0.76) 30%, rgba(54, 69, 179, 0.48) 56%, rgba(18, 23, 59, 0) 64%),
    radial-gradient(circle at 30% 34%, rgba(222, 226, 255, 0.7) 0%, rgba(222, 226, 255, 0) 44%);
  filter: blur(0.6px);
  box-shadow:
    inset -28px -36px 70px rgba(0, 0, 0, 0.34),
    0 0 80px rgba(114, 125, 255, 0.24);
}

.moon-glow::after {
  content: "";
  position: absolute;
  inset: 18px;
  border-radius: 50%;
  border: 1px solid rgba(214, 219, 255, 0.3);
  opacity: 0.55;
}

.haze {
  border-radius: 50%;
  filter: blur(18px);
  opacity: 0.8;
}

.haze-left {
  top: 310px;
  left: -90px;
  width: 220px;
  height: 220px;
  background: radial-gradient(circle, rgba(88, 104, 241, 0.46), rgba(88, 104, 241, 0));
}

.haze-right {
  top: 500px;
  right: -120px;
  width: 250px;
  height: 250px;
  background: radial-gradient(circle, rgba(178, 93, 255, 0.26), rgba(178, 93, 255, 0));
}

.app-header,
.app-main,
.action-dock {
  position: relative;
  z-index: 1;
}

.app-header {
  display: grid;
  gap: 12px;
  margin-bottom: 28px;
  padding-top: 16px;
}

.eyebrow {
  margin: 0;
  color: var(--accent);
  font-size: 0.82rem;
  letter-spacing: 0.34em;
  text-transform: uppercase;
}

.app-header h1 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(4rem, 15vw, 6.2rem);
  font-weight: 500;
  line-height: 0.94;
  letter-spacing: -0.06em;
  text-wrap: balance;
}

.hero-subtitle {
  margin: 0;
  color: rgba(213, 217, 250, 0.72);
  font-size: 0.96rem;
  line-height: 1.5;
}

.app-main {
  display: grid;
  gap: 24px;
}

.reminder-button,
.inline-add-button,
.editor-topbar-button,
.input-mode-button,
.action-button,
.recording-stop-button {
  cursor: pointer;
}

.reminder-button,
.reminder-panel,
.dream-feed,
.editor-sheet-inner,
.editor-surface,
.reminder-section,
.dream-card,
.reminder-log-card,
.action-dock {
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.reminder-button,
.reminder-panel,
.dream-feed {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(140, 152, 255, 0.08), rgba(255, 255, 255, 0) 32%),
    var(--bg-panel);
  backdrop-filter: blur(18px);
}

.reminder-button::before,
.reminder-panel::before,
.dream-feed::before,
.editor-sheet-inner::before,
.editor-surface::before,
.reminder-section::before,
.dream-card::before,
.reminder-log-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0));
  pointer-events: none;
}

.reminder-button {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 16px;
  width: 100%;
  padding: 20px 22px;
  border-radius: var(--radius-lg);
  color: var(--text-main);
  text-align: left;
}

.reminder-leading,
.reminder-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.reminder-leading {
  width: 56px;
  height: 56px;
  background:
    radial-gradient(circle at 35% 35%, rgba(165, 176, 255, 0.4), rgba(82, 96, 201, 0) 56%),
    rgba(19, 29, 83, 0.8);
  border: 1px solid rgba(131, 145, 255, 0.22);
  box-shadow: inset 0 0 24px rgba(141, 150, 255, 0.12);
}

.reminder-leading-core {
  color: var(--accent-strong);
  font-size: 1.4rem;
}

.reminder-copy {
  display: grid;
  gap: 6px;
}

.reminder-copy > span:first-child,
.section-heading p,
.reminder-log-card h2,
.reminder-field-label,
.editor-meta p {
  font-family: Georgia, "Times New Roman", serif;
}

.reminder-copy > span:first-child {
  font-size: 1.1rem;
}

.reminder-summary,
.reminder-field-help,
.section-heading span,
.dream-time,
.dream-preview,
.editor-meta span,
.voice-status,
.voice-preview-label,
.time-field,
.hero-subtitle {
  font-family: "Aptos", "Segoe UI", "Trebuchet MS", Arial, sans-serif;
}

.reminder-summary,
.reminder-field-help,
.section-heading span,
.dream-time,
.dream-preview,
.editor-meta span,
.voice-status,
.voice-preview-label,
.time-field {
  color: var(--text-soft);
}

.reminder-summary,
.reminder-field-help,
.section-heading span,
.editor-meta span,
.voice-status,
.voice-preview-label,
.time-field {
  font-size: 0.84rem;
}

.reminder-icon {
  width: 70px;
  height: 70px;
  background:
    radial-gradient(circle at 38% 35%, rgba(191, 199, 255, 0.55), rgba(133, 145, 255, 0.12) 34%, rgba(64, 77, 183, 0.86) 72%),
    rgba(22, 31, 94, 0.98);
  color: #e6e9ff;
  font-size: 2.3rem;
  line-height: 1;
  box-shadow:
    inset 0 0 26px rgba(193, 199, 255, 0.22),
    0 0 22px rgba(125, 136, 255, 0.4);
}

.reminder-panel,
.dream-feed {
  padding: 22px;
  border-radius: var(--radius-xl);
}

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

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

.section-heading p,
.section-heading span,
.dream-card h2,
.dream-card p,
.editor-meta p,
.editor-meta span,
.voice-preview-label,
.voice-preview-text,
.hero-subtitle {
  margin: 0;
}

.section-heading p {
  font-size: 1.1rem;
  margin-bottom: 6px;
}

.inline-add-button {
  flex-shrink: 0;
  min-width: 96px;
  min-height: 56px;
  padding: 0 24px;
  border-radius: 20px;
  background:
    linear-gradient(180deg, rgba(116, 128, 255, 0.34), rgba(116, 128, 255, 0.16)),
    rgba(34, 44, 112, 0.92);
  color: #d9deff;
  border: 1px solid rgba(131, 145, 255, 0.34);
  box-shadow: inset 0 0 18px rgba(149, 160, 255, 0.12);
}

.reminder-log,
.feed-scroll {
  display: grid;
}

.reminder-log {
  gap: 12px;
}

.feed-scroll {
  gap: 18px;
  max-height: 760px;
  overflow-y: auto;
  padding-right: 6px;
}

.feed-scroll::-webkit-scrollbar {
  width: 8px;
}

.feed-scroll::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(119, 132, 255, 0.92), rgba(98, 112, 247, 0.5));
  border-radius: var(--radius-full);
}

.feed-scroll::-webkit-scrollbar-track {
  background: rgba(21, 28, 71, 0.22);
  border-radius: var(--radius-full);
}

.dream-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.28fr) minmax(150px, 0.92fr);
  gap: 18px;
  align-items: stretch;
  padding: 18px;
  border-radius: var(--radius-lg);
  background:
    linear-gradient(90deg, rgba(13, 22, 63, 0.98) 0%, rgba(8, 14, 44, 0.95) 100%);
  overflow: hidden;
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    border-color 180ms ease;
}

.dream-card[role="button"] {
  cursor: pointer;
}

.dream-card:hover,
.dream-card:focus-visible {
  transform: translateY(-2px);
  box-shadow:
    0 30px 70px rgba(0, 0, 0, 0.42),
    0 0 0 1px rgba(147, 160, 255, 0.24);
  border-color: var(--line-strong);
  outline: none;
}

.dream-card-copy {
  position: relative;
  z-index: 1;
  display: grid;
  align-content: start;
  gap: 12px;
  min-width: 0;
}

.dream-card-empty {
  grid-template-columns: 1fr;
  background:
    radial-gradient(circle at top right, rgba(108, 120, 255, 0.22), transparent 24%),
    linear-gradient(180deg, rgba(15, 24, 67, 0.98), rgba(8, 14, 44, 0.95));
}

.dream-card-empty .dream-card-art {
  display: none;
}

.dream-time {
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
}

.dream-card h2,
.reminder-log-card h2 {
  font-weight: 500;
}

.dream-card h2 {
  font-size: clamp(1.6rem, 5.8vw, 2.3rem);
  line-height: 1.06;
}

.dream-preview {
  font-size: 0.98rem;
  line-height: 1.55;
}

.dream-card-art {
  position: relative;
  min-height: 192px;
  border-radius: 26px;
  overflow: hidden;
  align-self: stretch;
}

.dream-card-art-frame {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background:
    radial-gradient(circle at 64% 24%, rgba(173, 182, 255, 0.9) 0 6px, rgba(173, 182, 255, 0.12) 7px, transparent 24px),
    linear-gradient(180deg, rgba(16, 27, 79, 0.1), rgba(5, 11, 34, 0.84)),
    linear-gradient(135deg, rgba(34, 59, 149, 0.68), rgba(10, 17, 50, 0.92));
  border: 1px solid rgba(121, 136, 255, 0.18);
}

.dream-card-art-frame::before,
.dream-card-art-frame::after {
  content: "";
  position: absolute;
  inset: auto;
}

.dream-card-art-frame::before {
  left: 18%;
  right: 18%;
  bottom: 0;
  height: 58%;
  background:
    linear-gradient(90deg, transparent 0 7%, rgba(12, 25, 74, 0.86) 7% 12%, transparent 12% 21%, rgba(12, 25, 74, 0.86) 21% 26%, transparent 26% 35%, rgba(12, 25, 74, 0.86) 35% 42%, transparent 42% 52%, rgba(12, 25, 74, 0.86) 52% 58%, transparent 58% 68%, rgba(12, 25, 74, 0.86) 68% 74%, transparent 74% 84%, rgba(12, 25, 74, 0.86) 84% 90%, transparent 90% 100%);
  opacity: 0.7;
}

.dream-card-art-frame::after {
  left: 50%;
  top: 16%;
  width: 40%;
  height: 68%;
  transform: translateX(-50%);
  border-radius: 50% 50% 12px 12px;
  border: 1px solid rgba(151, 165, 255, 0.42);
  background:
    linear-gradient(180deg, rgba(15, 26, 85, 0.18), rgba(8, 14, 44, 0.62)),
    radial-gradient(circle at 50% 14%, rgba(181, 189, 255, 0.94) 0 7px, rgba(181, 189, 255, 0.16) 8px, transparent 20px);
  box-shadow: 0 0 26px rgba(120, 132, 255, 0.18);
}

.dream-card-art-orb,
.dream-card-art-columns,
.dream-card-art-glow {
  position: absolute;
}

.dream-card-art-orb {
  right: 16%;
  top: 14%;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, #f8f6ff 0%, #b7c1ff 42%, rgba(183, 193, 255, 0.08) 72%);
  box-shadow: 0 0 18px rgba(198, 206, 255, 0.48);
}

.dream-card-art-columns {
  inset: 0;
  background:
    linear-gradient(90deg, rgba(5, 11, 34, 0) 0 8%, rgba(5, 11, 34, 0.72) 8% 14%, rgba(5, 11, 34, 0) 14% 23%, rgba(5, 11, 34, 0.72) 23% 29%, rgba(5, 11, 34, 0) 29% 72%, rgba(5, 11, 34, 0.7) 72% 79%, rgba(5, 11, 34, 0) 79% 87%, rgba(5, 11, 34, 0.74) 87% 94%, rgba(5, 11, 34, 0) 94% 100%);
  opacity: 0.48;
}

.dream-card-art-glow {
  left: 50%;
  bottom: 10%;
  width: 44%;
  height: 18%;
  transform: translateX(-50%);
  background: radial-gradient(circle, rgba(136, 149, 255, 0.42), rgba(136, 149, 255, 0));
}

.dream-card[data-visual="city"] .dream-card-art-frame {
  background:
    radial-gradient(circle at 55% 78%, rgba(255, 184, 126, 0.24), transparent 24%),
    linear-gradient(180deg, rgba(26, 23, 81, 0.2), rgba(8, 14, 44, 0.94)),
    linear-gradient(135deg, rgba(44, 39, 112, 0.9), rgba(10, 17, 50, 0.94));
}

.dream-card[data-visual="city"] .dream-card-art-frame::before {
  left: 8%;
  right: 8%;
  bottom: 0;
  height: 54%;
  background:
    linear-gradient(90deg, transparent 0 6%, rgba(9, 14, 45, 0.94) 6% 15%, transparent 15% 20%, rgba(9, 14, 45, 0.94) 20% 29%, transparent 29% 35%, rgba(9, 14, 45, 0.94) 35% 47%, transparent 47% 54%, rgba(9, 14, 45, 0.94) 54% 63%, transparent 63% 71%, rgba(9, 14, 45, 0.94) 71% 83%, transparent 83% 89%, rgba(9, 14, 45, 0.94) 89% 96%, transparent 96% 100%);
}

.dream-card[data-visual="city"] .dream-card-art-frame::after {
  top: auto;
  bottom: 14%;
  width: 64%;
  height: 10%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(219, 172, 255, 0.42), rgba(219, 172, 255, 0));
  border: 0;
  box-shadow: none;
}

.dream-card[data-visual="city"] .dream-card-art-orb {
  left: 50%;
  top: auto;
  bottom: 24%;
  transform: translateX(-50%);
  width: 18px;
  height: 18px;
}

.dream-card[data-visual="city"] .dream-card-art-columns {
  background:
    linear-gradient(180deg, rgba(255, 199, 148, 0.22), rgba(255, 199, 148, 0) 18%) 20% 48% / 2px 22px no-repeat,
    linear-gradient(180deg, rgba(255, 199, 148, 0.2), rgba(255, 199, 148, 0) 18%) 28% 44% / 2px 26px no-repeat,
    linear-gradient(180deg, rgba(255, 199, 148, 0.2), rgba(255, 199, 148, 0) 18%) 47% 38% / 2px 34px no-repeat,
    linear-gradient(180deg, rgba(255, 199, 148, 0.2), rgba(255, 199, 148, 0) 18%) 58% 30% / 2px 44px no-repeat,
    linear-gradient(180deg, rgba(255, 199, 148, 0.2), rgba(255, 199, 148, 0) 18%) 71% 36% / 2px 36px no-repeat,
    linear-gradient(180deg, rgba(255, 199, 148, 0.2), rgba(255, 199, 148, 0) 18%) 80% 42% / 2px 24px no-repeat;
  opacity: 0.9;
}

.dream-card[data-visual="garden"] .dream-card-art-frame {
  background:
    radial-gradient(circle at 52% 48%, rgba(250, 203, 149, 0.18), rgba(250, 203, 149, 0) 28%),
    linear-gradient(180deg, rgba(43, 32, 96, 0.42), rgba(9, 14, 44, 0.94)),
    linear-gradient(135deg, rgba(40, 46, 126, 0.92), rgba(10, 17, 50, 0.94));
}

.dream-card[data-visual="garden"] .dream-card-art-frame::before {
  left: 50%;
  right: auto;
  bottom: 20%;
  width: 45%;
  height: 45%;
  transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(circle at 50% 50%, rgba(13, 21, 70, 0.1) 42%, rgba(175, 138, 255, 0.72) 44% 45%, rgba(12, 20, 62, 0) 48%);
  opacity: 0.9;
}

.dream-card[data-visual="garden"] .dream-card-art-frame::after {
  left: 50%;
  top: auto;
  bottom: 8%;
  width: 68%;
  height: 28%;
  transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(145, 121, 255, 0.22), rgba(145, 121, 255, 0));
  border: 0;
  box-shadow: none;
}

.dream-card[data-visual="garden"] .dream-card-art-orb {
  left: 50%;
  right: auto;
  top: auto;
  bottom: 31%;
  transform: translateX(-50%);
  width: 14px;
  height: 14px;
  background: radial-gradient(circle at 40% 35%, #fff4e8 0%, #f4d0b0 46%, rgba(244, 208, 176, 0.08) 74%);
}

.dream-card[data-visual="garden"] .dream-card-art-columns {
  inset: 10% 10% 8%;
  background:
    radial-gradient(circle at 14% 70%, rgba(132, 118, 221, 0.48) 0 5%, transparent 6%),
    radial-gradient(circle at 82% 74%, rgba(132, 118, 221, 0.48) 0 5%, transparent 6%),
    linear-gradient(30deg, rgba(118, 102, 210, 0.44), rgba(118, 102, 210, 0)) 12% 72% / 38% 2px no-repeat,
    linear-gradient(152deg, rgba(118, 102, 210, 0.44), rgba(118, 102, 210, 0)) 58% 74% / 30% 2px no-repeat,
    linear-gradient(85deg, rgba(118, 102, 210, 0.36), rgba(118, 102, 210, 0)) 20% 34% / 2px 46% no-repeat,
    linear-gradient(95deg, rgba(118, 102, 210, 0.36), rgba(118, 102, 210, 0)) 78% 36% / 2px 42% no-repeat;
  opacity: 0.92;
}

.dream-card[data-visual="train"] .dream-card-art-frame {
  background:
    radial-gradient(circle at 50% 20%, rgba(168, 175, 255, 0.18), rgba(168, 175, 255, 0) 20%),
    linear-gradient(180deg, rgba(28, 40, 110, 0.22), rgba(7, 12, 37, 0.94)),
    linear-gradient(145deg, rgba(17, 28, 79, 0.98), rgba(7, 12, 37, 0.94));
}

.dream-card[data-visual="train"] .dream-card-art-frame::before {
  left: 16%;
  right: 16%;
  bottom: 0;
  height: 66%;
  background:
    linear-gradient(90deg, rgba(6, 10, 31, 0.9), rgba(18, 28, 82, 0.18) 22%, rgba(18, 28, 82, 0.18) 78%, rgba(6, 10, 31, 0.92)),
    linear-gradient(180deg, rgba(135, 148, 255, 0.16), rgba(135, 148, 255, 0));
  clip-path: polygon(22% 0, 78% 0, 100% 100%, 0 100%);
}

.dream-card[data-visual="train"] .dream-card-art-frame::after {
  left: 50%;
  top: 24%;
  width: 56%;
  height: 56%;
  transform: translateX(-50%);
  border-radius: 50% 50% 12px 12px;
  border: 1px solid rgba(145, 159, 255, 0.2);
  background:
    linear-gradient(180deg, rgba(18, 29, 89, 0.3), rgba(7, 12, 37, 0.72)),
    repeating-linear-gradient(90deg, rgba(115, 130, 255, 0.16) 0 2px, transparent 2px 18px);
}

.dream-card[data-visual="train"] .dream-card-art-orb {
  right: auto;
  left: 50%;
  top: 32%;
  transform: translateX(-50%);
  width: 12px;
  height: 12px;
}

.dream-card[data-visual="train"] .dream-card-art-columns {
  inset: auto 20% 10% 20%;
  height: 16%;
  background: radial-gradient(circle, rgba(126, 140, 255, 0.26), rgba(126, 140, 255, 0));
}

.reminder-log-card {
  position: relative;
  display: grid;
  gap: 8px;
  padding: 16px 18px;
  border-radius: var(--radius-md);
  background:
    linear-gradient(180deg, rgba(113, 127, 255, 0.08), rgba(255, 255, 255, 0)),
    var(--bg-panel-soft);
  overflow: hidden;
}

.reminder-log-card-empty {
  background:
    radial-gradient(circle at top right, rgba(108, 120, 255, 0.24), transparent 28%),
    var(--bg-panel-soft);
}

.reminder-log-card h2,
.reminder-log-card p {
  margin: 0;
}

.reminder-log-card h2 {
  font-size: 1.08rem;
}

.reminder-log-card p {
  font-size: 0.94rem;
  line-height: 1.55;
}

.action-dock {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  width: min(calc(100% - 32px), 340px);
  padding: 10px;
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(146, 156, 255, 0.08), rgba(255, 255, 255, 0)),
    rgba(8, 14, 44, 0.88);
  backdrop-filter: blur(18px);
  z-index: 4;
}

.action-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 72px;
  padding: 0 22px;
  border-radius: var(--radius-full);
  background: transparent;
  color: rgba(234, 236, 255, 0.86);
  border: 1px solid rgba(131, 145, 255, 0.12);
}

.action-button-primary {
  background:
    linear-gradient(180deg, rgba(116, 128, 255, 0.44), rgba(116, 128, 255, 0.18)),
    rgba(34, 45, 115, 0.96);
  color: #f3f4ff;
  border-color: rgba(131, 145, 255, 0.34);
  box-shadow: inset 0 0 24px rgba(170, 178, 255, 0.12), var(--glow);
}

.action-button-icon {
  color: var(--accent-strong);
  font-size: 1.15rem;
}

.action-button-icon-grid {
  color: var(--text-soft);
}

.editor-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(2, 4, 14, 0.56);
  backdrop-filter: blur(14px);
  z-index: 20;
}

.editor-sheet {
  position: fixed;
  inset: auto 0 0;
  display: flex;
  justify-content: center;
  z-index: 21;
}

.editor-sheet-inner {
  position: relative;
  width: min(100%, 520px);
  max-height: calc(100vh - 18px);
  padding: 18px 18px 24px;
  border-radius: 34px 34px 0 0;
  background:
    linear-gradient(180deg, rgba(136, 148, 255, 0.12), rgba(255, 255, 255, 0) 20%),
    rgba(7, 13, 39, 0.96);
  overflow: hidden;
}

.editor-topbar {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  margin-bottom: 18px;
}

.editor-topbar-button {
  min-height: 44px;
  padding: 0 16px;
  border-radius: var(--radius-full);
  background: rgba(28, 38, 101, 0.74);
  color: var(--text-soft);
  border: 1px solid rgba(131, 145, 255, 0.18);
}

.editor-topbar-button:disabled {
  opacity: 0.7;
  cursor: wait;
}

.editor-topbar-button-strong {
  background:
    linear-gradient(180deg, rgba(116, 128, 255, 0.42), rgba(116, 128, 255, 0.18)),
    rgba(34, 45, 115, 0.98);
  color: #eef0ff;
}

.editor-meta {
  text-align: center;
}

.editor-meta p {
  font-size: 1rem;
}

.editor-surface {
  position: relative;
  display: grid;
  gap: 16px;
  min-height: min(72vh, 640px);
  padding: 22px 20px;
  border-radius: 28px;
  background:
    linear-gradient(180deg, rgba(136, 148, 255, 0.08), rgba(255, 255, 255, 0) 120px),
    rgba(9, 16, 48, 0.9);
  overflow: hidden;
}

.reminder-surface {
  min-height: auto;
  max-height: calc(100vh - 140px);
  gap: 18px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.reminder-section {
  position: relative;
  display: grid;
  gap: 10px;
  padding: 16px;
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(117, 130, 255, 0.06), rgba(255, 255, 255, 0)),
    rgba(15, 24, 67, 0.84);
  overflow: hidden;
}

.reminder-status-card {
  align-items: start;
}

.reminder-field-label {
  margin: 0;
  font-size: 1rem;
}

.reminder-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.switch {
  position: relative;
  display: inline-flex;
  width: 58px;
  height: 34px;
  flex-shrink: 0;
}

.switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.switch-track {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 999px;
  background: rgba(63, 76, 156, 0.68);
  border: 1px solid rgba(131, 145, 255, 0.2);
  transition: background 160ms ease;
}

.switch-track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: linear-gradient(180deg, #fcfdff, #d8ddff);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.28);
  transition: transform 160ms ease;
}

.switch input:checked + .switch-track {
  background: rgba(110, 124, 255, 0.98);
}

.switch input:checked + .switch-track::after {
  transform: translateX(24px);
}

.reminder-select,
.reminder-time-input,
.voice-preview-text {
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid rgba(131, 145, 255, 0.22);
  border-radius: 16px;
  background: var(--bg-field);
  color: var(--text-main);
  outline: none;
}

.quiet-hours-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.time-field {
  display: grid;
  gap: 8px;
}

.editor-input-modes {
  display: inline-flex;
  gap: 8px;
  padding: 6px;
  width: fit-content;
  border-radius: var(--radius-full);
  background: rgba(24, 34, 89, 0.84);
  border: 1px solid rgba(131, 145, 255, 0.18);
}

.input-mode-button {
  min-width: 82px;
  min-height: 42px;
  padding: 0 18px;
  border-radius: var(--radius-full);
  background: transparent;
  color: var(--text-soft);
}

.input-mode-button-active {
  background:
    linear-gradient(180deg, rgba(116, 128, 255, 0.42), rgba(116, 128, 255, 0.18)),
    rgba(34, 45, 115, 0.98);
  color: #eef0ff;
}

.voice-status {
  min-height: 1em;
  opacity: 0;
  transition: opacity 160ms ease;
}

.voice-status-visible {
  opacity: 1;
}

.recording-indicator {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  width: fit-content;
  padding: 8px 12px;
  border-radius: var(--radius-full);
  background: rgba(100, 36, 83, 0.18);
  color: #ffc6e8;
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: 1px solid rgba(235, 125, 197, 0.22);
}

.recording-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ff7ab9;
  box-shadow: 0 0 0 4px rgba(255, 122, 185, 0.16);
}

.recording-stop-button {
  min-height: 30px;
  padding: 0 12px;
  border-radius: var(--radius-full);
  background: rgba(255, 122, 185, 0.16);
  color: #ffd8ed;
}

.voice-preview {
  display: grid;
  gap: 10px;
  padding: 14px;
  border-radius: 20px;
  background: rgba(21, 31, 83, 0.72);
  border: 1px solid rgba(131, 145, 255, 0.18);
}

.voice-preview-text {
  width: 100%;
  min-height: 120px;
  padding: 12px 14px;
  font-size: 0.95rem;
  line-height: 1.55;
  resize: vertical;
}

.voice-preview-text::placeholder,
.editor-title-input::placeholder,
.editor-body-input::placeholder {
  color: rgba(157, 167, 215, 0.68);
}

.voice-preview-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.editor-title-input,
.editor-body-input {
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--text-main);
  outline: none;
  resize: none;
}

.editor-title-input {
  padding: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.8rem, 6vw, 2.4rem);
  font-weight: 500;
  line-height: 1.05;
}

.editor-title-input-readonly {
  cursor: default;
}

.editor-body-input {
  min-height: 42vh;
  padding: 0;
  font-size: 1rem;
  line-height: 2rem;
}

.hidden {
  display: none;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.action-button:focus-visible,
.reminder-button:focus-visible,
.inline-add-button:focus-visible,
.editor-topbar-button:focus-visible,
.input-mode-button:focus-visible,
.reminder-select:focus-visible,
.reminder-time-input:focus-visible,
.voice-preview-text:focus-visible,
.editor-title-input:focus-visible,
.editor-body-input:focus-visible,
.switch input:focus-visible + .switch-track {
  outline: 2px solid rgba(154, 167, 255, 0.78);
  outline-offset: 3px;
}

@media (max-width: 520px) {
  .app-shell {
    padding-inline: 18px;
  }

  .moon-glow {
    right: -172px;
    width: 430px;
    height: 430px;
  }

  .dream-card {
    grid-template-columns: minmax(0, 1fr);
  }

  .dream-card-art {
    min-height: 166px;
  }
}

@media (max-width: 420px) {
  .app-shell {
    padding: 28px 16px 170px;
  }

  .app-header h1 {
    font-size: clamp(3.3rem, 19vw, 4.8rem);
  }

  .reminder-button,
  .reminder-panel,
  .dream-feed {
    padding: 18px;
  }

  .reminder-button {
    grid-template-columns: auto 1fr;
  }

  .reminder-icon {
    grid-column: 1 / -1;
    justify-self: end;
    width: 60px;
    height: 60px;
    font-size: 2rem;
  }

  .action-dock {
    width: min(calc(100% - 24px), 340px);
    padding: 8px;
  }

  .action-button {
    min-width: 0;
    min-height: 66px;
    flex: 1;
  }

  .editor-sheet-inner {
    padding: 14px 14px 22px;
  }

  .editor-surface {
    min-height: min(74vh, 640px);
    padding: 20px 16px;
  }

  .quiet-hours-grid,
  .reminder-toggle-row {
    grid-template-columns: 1fr;
    display: grid;
  }

  .editor-topbar {
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "meta meta"
      "close save";
  }

  .editor-meta {
    grid-area: meta;
  }

  #close-editor-button,
  #close-reminder-button {
    grid-area: close;
  }

  #save-entry-button,
  #save-reminder-button {
    grid-area: save;
  }
}
