:root {
  color-scheme: light;
  --mist: #f1f5f2;
  --paper: #fffdf8;
  --paper-soft: #faf6ef;
  --ink: #3c413d;
  --muted: #7f867e;
  --line: rgba(110, 124, 113, 0.15);
  --moss: #789684;
  --sage: #e7f0e9;
  --lavender: #efedf8;
  --sky: #e9f4f6;
  --peach: #f8e9e3;
  --rose: #c48781;
  --ochre: #b89a63;
  --shadow: 0 24px 54px rgba(72, 78, 72, 0.1);
  --radius: 8px;
  --sans: ui-rounded, -apple-system, BlinkMacSystemFont, "PingFang TC", "Noto Sans TC", "Hiragino Sans", "Microsoft JhengHei", sans-serif;
  --serif: ui-rounded, -apple-system, BlinkMacSystemFont, "PingFang TC", "Noto Sans TC", "Hiragino Sans", "Microsoft JhengHei", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--mist);
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  font-family: var(--sans);
  letter-spacing: 0;
  background:
    linear-gradient(128deg, rgba(231, 240, 233, 0.76), transparent 38%),
    linear-gradient(252deg, rgba(239, 237, 248, 0.72), transparent 42%),
    linear-gradient(0deg, rgba(248, 233, 227, 0.46), transparent 58%),
    #f7f8f3;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.2) 0 1px, transparent 1px 14px),
    linear-gradient(90deg, rgba(120, 150, 132, 0.05), transparent 34%, rgba(196, 135, 129, 0.04));
  mix-blend-mode: multiply;
}

button,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

button:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(120, 150, 132, 0.2);
  outline-offset: 3px;
}

[hidden] {
  display: none !important;
}

.fractal-field {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.fractal-field span,
.fractal-field i {
  position: absolute;
  display: block;
}

.fractal-stem,
.fractal-stem::before,
.fractal-stem::after {
  position: absolute;
  display: block;
  width: 1px;
  height: 220px;
  content: "";
  border-radius: 999px;
  background: linear-gradient(to bottom, transparent, rgba(120, 150, 132, 0.18), transparent);
  transform-origin: bottom center;
}

.fractal-stem::before {
  right: 0;
  bottom: 44%;
  height: 92px;
  transform: rotate(38deg);
}

.fractal-stem::after {
  left: 0;
  bottom: 28%;
  height: 74px;
  transform: rotate(-42deg);
}

.stem-a {
  left: 8%;
  bottom: -3%;
  transform: rotate(-10deg);
}

.stem-b {
  right: 11%;
  top: 8%;
  height: 260px;
  transform: rotate(16deg);
}

.stem-c {
  left: 66%;
  bottom: 3%;
  height: 180px;
  transform: rotate(28deg);
}

.fractal-orbit {
  width: 152px;
  height: 152px;
  border: 1px solid rgba(120, 150, 132, 0.24);
  border-radius: 38% 62% 48% 52%;
}

.fractal-orbit::before,
.fractal-orbit::after {
  position: absolute;
  content: "";
  border: 1px solid rgba(120, 150, 132, 0.2);
  border-radius: inherit;
}

.fractal-orbit::before {
  inset: 20px;
  transform: rotate(18deg);
}

.fractal-orbit::after {
  inset: 42px;
  transform: rotate(-24deg);
}

.fractal-orbit i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(231, 240, 233, 0.82);
  box-shadow: 0 0 0 1px rgba(120, 150, 132, 0.24);
}

.fractal-orbit i:nth-child(1) {
  top: 24px;
  left: 33px;
}

.fractal-orbit i:nth-child(2) {
  right: 26px;
  top: 62px;
  width: 7px;
  height: 7px;
}

.fractal-orbit i:nth-child(3) {
  left: 78px;
  bottom: 27px;
  width: 5px;
  height: 5px;
}

.orbit-a {
  left: 20%;
  top: 19%;
  transform: rotate(16deg);
}

.orbit-b {
  right: 20%;
  bottom: 18%;
  width: 124px;
  height: 124px;
  transform: rotate(-22deg);
}

.leaf-sprig {
  width: 76px;
  height: 150px;
  opacity: 1;
}

.leaf-sprig::before {
  position: absolute;
  left: 37px;
  bottom: 0;
  width: 1px;
  height: 142px;
  content: "";
  border-radius: 999px;
  background: linear-gradient(to bottom, transparent, rgba(120, 150, 132, 0.48));
  transform: rotate(4deg);
}

.leaf-sprig i {
  width: 28px;
  height: 15px;
  border: 1px solid rgba(120, 150, 132, 0.34);
  border-radius: 80% 20% 80% 20%;
  background: rgba(198, 224, 207, 0.58);
}

.leaf-sprig i:nth-child(1) {
  left: 12px;
  top: 28px;
  transform: rotate(-28deg);
}

.leaf-sprig i:nth-child(2) {
  right: 8px;
  top: 48px;
  transform: scaleX(-1) rotate(-24deg);
}

.leaf-sprig i:nth-child(3) {
  left: 7px;
  top: 78px;
  transform: rotate(-18deg) scale(0.86);
}

.leaf-sprig i:nth-child(4) {
  right: 12px;
  top: 100px;
  transform: scaleX(-1) rotate(-12deg) scale(0.78);
}

.sprig-a {
  left: 5%;
  top: 38%;
  transform: rotate(-11deg);
}

.sprig-b {
  right: 6%;
  bottom: 28%;
  transform: rotate(13deg) scale(0.9);
}

.flower-cluster {
  width: 76px;
  height: 76px;
}

.flower-cluster::before {
  position: absolute;
  left: 32px;
  top: 32px;
  width: 12px;
  height: 12px;
  content: "";
  border-radius: 50%;
  background: rgba(184, 154, 99, 0.72);
}

.flower-cluster i {
  left: 30px;
  top: 15px;
  width: 18px;
  height: 26px;
  border: 1px solid rgba(196, 135, 129, 0.28);
  border-radius: 70% 30% 70% 30%;
  background: rgba(246, 205, 196, 0.72);
  transform-origin: 8px 24px;
}

.flower-cluster i:nth-child(2) {
  transform: rotate(72deg);
}

.flower-cluster i:nth-child(3) {
  transform: rotate(144deg);
}

.flower-cluster i:nth-child(4) {
  transform: rotate(216deg);
}

.flower-cluster i:nth-child(5) {
  transform: rotate(288deg);
}

.flower-a {
  left: 17%;
  bottom: 18%;
  transform: rotate(-9deg);
}

.flower-b {
  right: 31%;
  top: 12%;
  transform: scale(0.72) rotate(18deg);
}

.butterfly {
  width: 70px;
  height: 52px;
  opacity: 0.92;
}

.butterfly::before {
  position: absolute;
  left: 34px;
  top: 13px;
  width: 3px;
  height: 26px;
  content: "";
  border-radius: 999px;
  background: rgba(120, 150, 132, 0.52);
}

.butterfly i {
  border: 1px solid rgba(120, 150, 132, 0.24);
  background: rgba(218, 213, 244, 0.78);
}

.butterfly i:nth-child(1),
.butterfly i:nth-child(2) {
  top: 6px;
  width: 27px;
  height: 21px;
  border-radius: 70% 30% 72% 28%;
}

.butterfly i:nth-child(1) {
  left: 10px;
  transform: rotate(-22deg);
}

.butterfly i:nth-child(2) {
  right: 9px;
  transform: scaleX(-1) rotate(-22deg);
}

.butterfly i:nth-child(3),
.butterfly i:nth-child(4) {
  top: 25px;
  width: 22px;
  height: 17px;
  border-radius: 28% 72% 30% 70%;
  background: rgba(196, 230, 238, 0.76);
}

.butterfly i:nth-child(3) {
  left: 14px;
  transform: rotate(18deg);
}

.butterfly i:nth-child(4) {
  right: 12px;
  transform: scaleX(-1) rotate(18deg);
}

.butterfly-a {
  left: 38%;
  top: 9%;
  transform: rotate(-8deg);
}

.butterfly-b {
  right: 13%;
  top: 43%;
  transform: scale(0.76) rotate(14deg);
}

.soft-bird {
  width: 84px;
  height: 54px;
  opacity: 0.9;
}

.soft-bird::before {
  position: absolute;
  left: 18px;
  top: 18px;
  width: 44px;
  height: 25px;
  content: "";
  border: 1px solid rgba(120, 150, 132, 0.26);
  border-radius: 60% 42% 50% 52%;
  background: rgba(255, 253, 248, 0.82);
}

.soft-bird i:nth-child(1) {
  left: 40px;
  top: 9px;
  width: 26px;
  height: 22px;
  border: 1px solid rgba(120, 150, 132, 0.26);
  border-radius: 50%;
  background: rgba(198, 224, 207, 0.68);
}

.soft-bird i:nth-child(2) {
  right: 10px;
  top: 20px;
  width: 0;
  height: 0;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  border-left: 10px solid rgba(184, 154, 99, 0.78);
}

.soft-bird i:nth-child(3) {
  left: 24px;
  top: 23px;
  width: 28px;
  height: 17px;
  border-radius: 72% 28% 72% 28%;
  background: rgba(196, 230, 238, 0.72);
  transform: rotate(-18deg);
}

.bird-a {
  right: 29%;
  bottom: 8%;
  transform: rotate(-4deg);
}

.tiny-snail {
  width: 84px;
  height: 44px;
  opacity: 0.9;
}

.tiny-snail::before {
  position: absolute;
  left: 20px;
  bottom: 8px;
  width: 48px;
  height: 17px;
  content: "";
  border-radius: 999px 999px 55% 55%;
  background: rgba(198, 224, 207, 0.68);
  box-shadow: 0 0 0 1px rgba(120, 150, 132, 0.26);
}

.tiny-snail i:nth-child(1) {
  left: 16px;
  bottom: 14px;
  width: 28px;
  height: 28px;
  border: 1px solid rgba(120, 150, 132, 0.3);
  border-radius: 50%;
  background:
    radial-gradient(circle at center, transparent 0 34%, rgba(196, 135, 129, 0.34) 35% 43%, transparent 44%),
    rgba(246, 205, 196, 0.72);
}

.tiny-snail i:nth-child(2) {
  right: 10px;
  bottom: 22px;
  width: 14px;
  height: 16px;
  border-top: 1px solid rgba(120, 150, 132, 0.46);
  border-right: 1px solid rgba(120, 150, 132, 0.46);
  border-radius: 0 12px 0 0;
}

.snail-a {
  left: 31%;
  bottom: 9%;
}

.petal {
  position: absolute;
  width: 92px;
  height: 168px;
  border: 1px solid rgba(120, 150, 132, 0.2);
  border-radius: 70% 30% 68% 32%;
  background: transparent;
}

.petal-a {
  left: 10%;
  top: 12%;
  transform: rotate(18deg);
}

.petal-b {
  right: 18%;
  top: 18%;
  width: 76px;
  height: 136px;
  border-color: rgba(196, 135, 129, 0.22);
  transform: rotate(34deg);
}

.petal-c {
  right: 8%;
  bottom: 12%;
  width: 118px;
  height: 190px;
  border-color: rgba(157, 167, 203, 0.24);
  transform: rotate(-28deg);
}

.petal-d {
  left: 28%;
  bottom: 7%;
  width: 64px;
  height: 118px;
  border-color: rgba(184, 154, 99, 0.24);
  transform: rotate(-8deg);
}

.space-shell {
  position: relative;
  z-index: 1;
  min-height: 100vh;
}

.landing-page {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 32px;
  text-align: center;
}

.landing-page::before {
  content: "";
  position: absolute;
  width: min(70vw, 760px);
  height: min(42vw, 360px);
  border: 1px solid rgba(120, 150, 132, 0.11);
  border-radius: 46% 54% 52% 48%;
  background:
    linear-gradient(135deg, rgba(255, 253, 248, 0.42), rgba(231, 240, 233, 0.2)),
    linear-gradient(45deg, rgba(239, 237, 248, 0.16), transparent 70%);
}

.landing-page > * {
  position: relative;
}

.landing-kicker,
.space-kicker,
.space-footer p {
  margin: 0;
  color: var(--moss);
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0;
  text-transform: uppercase;
}

.space-kicker {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  padding: 10px 20px;
  border: 1px solid rgba(157, 167, 203, 0.34);
  border-radius: 18px;
  color: #4f5878;
  font-size: clamp(19px, 2.2vw, 25px);
  font-weight: 800;
  line-height: 1;
  background: linear-gradient(135deg, rgba(239, 237, 248, 0.96), rgba(223, 239, 244, 0.82));
  box-shadow: 0 10px 24px rgba(157, 167, 203, 0.2);
  text-transform: none;
}

.landing-page h1 {
  margin: 12px 0 14px;
  font-family: var(--serif);
  font-size: clamp(34px, 6vw, 70px);
  font-weight: 500;
  line-height: 1.15;
}

.landing-words {
  margin: 0 0 44px;
  color: var(--muted);
  font-family: var(--serif);
  font-size: clamp(16px, 2vw, 23px);
  font-weight: 400;
}

.start-button,
.send-button,
.back-button {
  min-height: 50px;
  border: 1px solid rgba(120, 150, 132, 0.28);
  border-radius: 999px;
  color: #ffffff;
  font-weight: 650;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.18), transparent),
    #7f9d8e;
  box-shadow: 0 12px 26px rgba(120, 150, 132, 0.18);
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.start-button {
  padding: 0 28px;
}

.landing-actions {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}

.secondary-button,
.record-button,
.mini-button {
  min-height: 42px;
  border: 1px solid rgba(120, 150, 132, 0.22);
  border-radius: 999px;
  color: #59645d;
  font-weight: 700;
  background: rgba(255, 253, 248, 0.68);
  box-shadow: 0 10px 20px rgba(120, 150, 132, 0.1);
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease;
}

.secondary-button {
  padding: 0 24px;
}

.record-button {
  padding: 0 16px;
  font-size: 14px;
}

.mini-button {
  min-height: 36px;
  padding: 0 14px;
  font-size: 13px;
  box-shadow: none;
}

.secondary-button:hover,
.record-button:hover,
.mini-button:hover {
  transform: translateY(-1px);
  border-color: rgba(120, 150, 132, 0.34);
  background: rgba(231, 240, 233, 0.82);
}

.mini-button.primary {
  color: #ffffff;
  border-color: rgba(120, 150, 132, 0.26);
  background: #7f9d8e;
}

.mini-button.danger:hover {
  border-color: rgba(196, 135, 129, 0.3);
  background: rgba(248, 233, 227, 0.86);
}

.start-button:hover,
.send-button:hover,
.back-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 30px rgba(120, 150, 132, 0.22);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.2), transparent),
    #739485;
}

.writing-page {
  display: grid;
  grid-template-rows: auto auto auto auto minmax(0, 1fr) auto;
  gap: 14px;
  min-height: 100vh;
  padding: 18px clamp(18px, 4vw, 58px) 28px;
}

.global-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  max-width: 1120px;
  width: 100%;
  margin: 0 auto;
}

.space-header {
  display: flex;
  justify-content: space-between;
  gap: 28px;
  align-items: start;
  max-width: 1120px;
  width: 100%;
  margin: 0 auto;
}

.space-header h2 {
  max-width: 760px;
  margin: 8px 0 12px;
  font-family: var(--serif);
  font-size: clamp(28px, 4.5vw, 52px);
  font-weight: 500;
  line-height: 1.18;
}

.page-prompt {
  max-width: 650px;
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.9;
}

.icon-button {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid rgba(110, 124, 113, 0.18);
  border-radius: 999px;
  color: var(--ink);
  font-size: 19px;
  line-height: 1;
  background: rgba(255, 253, 248, 0.58);
  backdrop-filter: blur(8px);
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease;
}

.icon-button:hover {
  transform: translateY(-1px);
  border-color: rgba(120, 150, 132, 0.3);
  background: rgba(231, 240, 233, 0.72);
}

.danger-lite:hover {
  border-color: rgba(196, 135, 129, 0.28);
  background: rgba(248, 233, 227, 0.72);
}

.progress-ribbon {
  position: relative;
  max-width: 1120px;
  width: 100%;
  height: 3px;
  margin: 0 auto;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(110, 124, 113, 0.1);
}

.progress-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, #9bb9a9, #b8bddf, #e4bbb4, #d5bf89);
  transition: width 260ms ease;
}

.safety-strip {
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: 10px;
  align-items: start;
  max-width: 1120px;
  width: 100%;
  margin: 0 auto;
  padding: 12px 14px;
  border: 1px solid rgba(184, 154, 99, 0.16);
  border-radius: var(--radius);
  background: rgba(255, 253, 248, 0.42);
}

.safety-icon {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  color: #ffffff;
  font-size: 13px;
  font-weight: 900;
  background: #c5a977;
}

.safety-strip p {
  margin: 0;
  color: #6a604f;
  font-size: 12px;
  line-height: 1.72;
}

.writing-sheet {
  position: relative;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  max-width: 1120px;
  width: 100%;
  min-height: 520px;
  margin: 0 auto;
  overflow: hidden;
  border: 1px solid rgba(110, 124, 113, 0.15);
  border-radius: var(--radius);
  background:
    linear-gradient(90deg, transparent 0 38px, rgba(196, 135, 129, 0.1) 38px 39px, transparent 39px 100%),
    repeating-linear-gradient(to bottom, rgba(255, 253, 248, 0.94) 0 37px, rgba(110, 124, 113, 0.07) 37px 38px),
    var(--paper);
  box-shadow: var(--shadow);
}

.view-panel {
  animation: spaceShift 360ms ease both;
}

@keyframes spaceShift {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.992);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.chat-log {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 16px;
  min-height: 0;
  padding: clamp(30px, 5vw, 64px) clamp(22px, 5vw, 68px) 30px;
  overflow-y: auto;
  scroll-behavior: smooth;
}

.guide-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: flex-end;
  padding: 0 clamp(22px, 5vw, 68px) clamp(24px, 4vw, 38px);
}

.guide-write-button {
  min-width: min(220px, 100%);
}

.writing-pad {
  max-width: 1120px;
  width: 100%;
  margin: 0 auto;
  padding: clamp(22px, 4vw, 38px);
  border: 1px solid rgba(110, 124, 113, 0.13);
  border-radius: var(--radius);
  background: rgba(255, 253, 248, 0.5);
  box-shadow: var(--shadow);
}

.message {
  display: grid;
  gap: 9px;
  max-width: min(760px, 100%);
}

.message.assistant,
.message.report-message {
  align-self: center;
  width: min(960px, 100%);
}

.message-meta {
  display: inline-flex;
  width: fit-content;
  gap: 14px;
  align-items: center;
  min-height: 58px;
  margin-bottom: 14px;
  padding: 13px 22px;
  border: 1px solid rgba(157, 167, 203, 0.34);
  border-radius: 18px;
  color: #4f5878;
  font-size: clamp(20px, 2.4vw, 28px);
  font-weight: 850;
  background: linear-gradient(135deg, rgba(239, 237, 248, 0.96), rgba(223, 239, 244, 0.82));
  box-shadow: 0 12px 26px rgba(157, 167, 203, 0.2);
}

.message-meta span + span {
  position: relative;
  padding-left: 14px;
}

.message-meta span + span::before {
  position: absolute;
  left: 0;
  top: 50%;
  width: 4px;
  height: 4px;
  content: "";
  border-radius: 50%;
  background: rgba(120, 150, 132, 0.5);
  transform: translateY(-50%);
}

.message-bubble {
  padding: 30px 34px;
  border: 1px solid rgba(110, 124, 113, 0.12);
  border-radius: var(--radius);
  color: var(--ink);
  background: rgba(255, 253, 248, 0.66);
  box-shadow: 0 10px 22px rgba(72, 78, 72, 0.045);
  white-space: pre-wrap;
  font-size: 18px;
  line-height: 1.62;
}

.message.system .message-bubble {
  background: linear-gradient(135deg, rgba(231, 240, 233, 0.5), rgba(255, 253, 248, 0.68));
}

.message.alert .message-bubble {
  border-color: rgba(196, 135, 129, 0.22);
  background: rgba(248, 233, 227, 0.64);
}

.report {
  display: grid;
  gap: 6px;
}

.report h3 {
  margin: 0 0 2px;
  font-family: var(--serif);
  font-size: clamp(24px, 3.5vw, 36px);
  font-weight: 500;
}

.report-section {
  padding: 7px 12px 8px;
  border-left: 3px solid #9bb9a9;
  border-radius: 0 var(--radius) var(--radius) 0;
  background: rgba(255, 253, 248, 0.55);
}

.report-section:nth-child(3) {
  border-left-color: #b8bddf;
}

.report-section:nth-child(4) {
  border-left-color: #e4bbb4;
}

.report-section:nth-child(5) {
  border-left-color: #d5bf89;
}

.report-section h4 {
  margin: 0 0 2px;
  font-size: 15px;
  line-height: 1.4;
}

.report-section p {
  margin: 0;
  color: #555b54;
  line-height: 1.56;
}

.report-section p + p {
  margin-top: 3px;
}

.report-empty {
  color: var(--muted);
}

.composer-wrap {
  border-top: 0;
  background: transparent;
  backdrop-filter: none;
}

.starter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  min-height: 0;
  padding: 0 0 26px;
}

.starter-chip {
  min-height: 58px;
  padding: 12px 24px;
  border: 1px solid rgba(110, 124, 113, 0.18);
  border-radius: 999px;
  color: #59645d;
  font-size: clamp(17px, 2.1vw, 24px);
  font-weight: 650;
  background: rgba(255, 253, 248, 0.72);
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease;
}

.starter-chip:hover {
  transform: translateY(-1px);
  border-color: rgba(120, 150, 132, 0.28);
  background: rgba(231, 240, 233, 0.72);
}

.composer {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 26px;
  padding: 0;
}

textarea {
  width: 100%;
  min-height: clamp(360px, 45vh, 520px);
  max-height: 620px;
  resize: vertical;
  border: 1px solid rgba(110, 124, 113, 0.18);
  border-radius: var(--radius);
  padding: clamp(22px, 3vw, 34px) clamp(24px, 4vw, 46px);
  color: var(--ink);
  background:
    repeating-linear-gradient(to bottom, rgba(255, 253, 248, 0.98) 0 67px, rgba(110, 124, 113, 0.07) 67px 68px),
    var(--paper);
  font-size: clamp(20px, 3vw, 31px);
  line-height: 2.05;
}

textarea::placeholder {
  color: #969b92;
}

textarea:focus {
  outline: none;
  border-color: rgba(120, 150, 132, 0.45);
  box-shadow: 0 0 0 3px rgba(120, 150, 132, 0.1);
}

.flow-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: flex-end;
}

.send-button,
.back-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 112px;
  padding: 0 18px;
}

.writing-pad .send-button,
.writing-pad .back-button {
  min-height: 58px;
  font-size: clamp(17px, 2.2vw, 22px);
}

.writing-pad .send-button {
  flex: 0 0 min(260px, 55%);
}

.back-button {
  margin-right: auto;
  color: #59645d;
  border-color: rgba(120, 150, 132, 0.24);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.2), transparent),
    rgba(255, 253, 248, 0.76);
  box-shadow: none;
}

.back-button:hover {
  color: #4b6255;
  background: rgba(231, 240, 233, 0.84);
  box-shadow: 0 10px 20px rgba(120, 150, 132, 0.13);
}

.send-button:disabled,
.back-button:disabled {
  cursor: not-allowed;
  transform: none;
  border-color: rgba(87, 98, 88, 0.18);
  color: #747970;
  background: #e8ebe5;
  box-shadow: none;
}

body.is-summary .writing-page {
  grid-template-rows: auto auto minmax(0, 1fr) auto;
}

body.is-summary .safety-strip,
body.is-summary .composer-wrap,
body.is-summary .guide-actions {
  display: none;
}

body.is-summary .chat-log {
  justify-content: start;
  padding-top: clamp(34px, 5vw, 62px);
}

.space-footer {
  max-width: 1120px;
  width: 100%;
  margin: 0 auto;
  text-align: right;
}

body.records-open {
  overflow: hidden;
}

.records-panel {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: stretch end;
}

.records-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(60, 65, 61, 0.18);
  backdrop-filter: blur(4px);
}

.records-drawer {
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: min(560px, calc(100vw - 24px));
  height: calc(100vh - 24px);
  margin: 12px;
  overflow: hidden;
  border: 1px solid rgba(110, 124, 113, 0.16);
  border-radius: var(--radius);
  background:
    linear-gradient(90deg, transparent 0 30px, rgba(196, 135, 129, 0.08) 30px 31px, transparent 31px 100%),
    repeating-linear-gradient(to bottom, rgba(255, 253, 248, 0.98) 0 40px, rgba(110, 124, 113, 0.055) 40px 41px),
    var(--paper);
  box-shadow: 0 28px 80px rgba(60, 65, 61, 0.18);
  animation: recordsIn 220ms ease both;
}

@keyframes recordsIn {
  from {
    opacity: 0;
    transform: translateX(18px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.records-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  padding: 24px 24px 18px 42px;
  border-bottom: 1px solid rgba(110, 124, 113, 0.1);
  background: rgba(255, 253, 248, 0.58);
}

.records-kicker {
  margin: 0 0 6px;
  color: var(--moss);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.records-header h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(24px, 4vw, 34px);
  font-weight: 500;
}

.records-content {
  min-height: 0;
  padding: 18px 18px 24px 42px;
  overflow: auto;
}

.records-finder {
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
}

.records-search {
  display: block;
}

.records-search input {
  width: 100%;
  min-height: 46px;
  border: 1px solid rgba(110, 124, 113, 0.14);
  border-radius: 999px;
  padding: 0 18px;
  color: var(--ink);
  font: inherit;
  font-size: 15px;
  background: rgba(255, 253, 248, 0.78);
  box-shadow: 0 8px 18px rgba(72, 78, 72, 0.045);
}

.records-search input::placeholder {
  color: #9aa096;
}

.records-search input:focus {
  outline: none;
  border-color: rgba(120, 150, 132, 0.42);
  box-shadow: 0 0 0 3px rgba(120, 150, 132, 0.1);
}

.records-filter-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.records-calendar {
  padding: 14px;
  border: 1px solid rgba(110, 124, 113, 0.12);
  border-radius: var(--radius);
  background: rgba(255, 253, 248, 0.58);
  box-shadow: 0 10px 22px rgba(72, 78, 72, 0.04);
}

.calendar-nav {
  display: grid;
  grid-template-columns: 42px 1fr 42px;
  gap: 8px;
  align-items: center;
  margin-bottom: 12px;
}

.calendar-nav strong {
  text-align: center;
  color: #4f5878;
  font-size: 17px;
}

.calendar-weekdays,
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
}

.calendar-weekdays {
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}

.calendar-day {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 44px;
  border: 1px solid rgba(110, 124, 113, 0.1);
  border-radius: var(--radius);
  color: #5c645d;
  background: rgba(255, 253, 248, 0.62);
  box-shadow: none;
  transition: transform 140ms ease, background 140ms ease, border-color 140ms ease;
}

.calendar-day span {
  font-size: 14px;
  font-weight: 750;
}

.calendar-day small {
  position: absolute;
  right: 5px;
  bottom: 4px;
  display: grid;
  place-items: center;
  min-width: 16px;
  height: 16px;
  border-radius: 999px;
  color: #ffffff;
  font-size: 10px;
  font-weight: 850;
  background: #8fae9b;
}

.calendar-day:hover:not(:disabled) {
  transform: translateY(-1px);
  border-color: rgba(120, 150, 132, 0.28);
  background: rgba(231, 240, 233, 0.76);
}

.calendar-day.has-record {
  border-color: rgba(120, 150, 132, 0.26);
  background: rgba(231, 240, 233, 0.76);
}

.calendar-day.is-selected {
  border-color: rgba(79, 88, 120, 0.3);
  color: #ffffff;
  background: #829b8d;
}

.calendar-day.is-selected small {
  color: #4f5878;
  background: rgba(255, 253, 248, 0.88);
}

.calendar-day.is-today::before {
  position: absolute;
  top: 5px;
  width: 5px;
  height: 5px;
  content: "";
  border-radius: 50%;
  background: #d2a49e;
}

.calendar-day.is-outside {
  opacity: 0.28;
}

.calendar-day:disabled {
  cursor: default;
}

.records-result-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 4px 0 10px;
  color: #59645d;
}

.records-result-head strong {
  font-size: 15px;
}

.records-result-head span {
  color: var(--muted);
  font-size: 13px;
}

.records-empty {
  display: grid;
  gap: 8px;
  padding: 34px 20px;
  border: 1px solid rgba(110, 124, 113, 0.12);
  border-radius: var(--radius);
  background: rgba(255, 253, 248, 0.54);
}

.records-empty.compact {
  padding: 22px 18px;
}

.records-empty p {
  margin: 0;
  font-size: 18px;
  font-weight: 750;
}

.records-empty span {
  color: var(--muted);
  line-height: 1.7;
}

.records-list {
  display: grid;
  gap: 12px;
}

.record-item {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid rgba(110, 124, 113, 0.12);
  border-radius: var(--radius);
  background: rgba(255, 253, 248, 0.68);
  box-shadow: 0 10px 22px rgba(72, 78, 72, 0.045);
}

.record-main {
  display: grid;
  gap: 5px;
}

.record-main time,
.record-detail-head time {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.record-main h3,
.record-detail-head h3 {
  margin: 0;
  font-size: 18px;
  line-height: 1.45;
}

.record-main p {
  margin: 0;
  color: #626961;
  line-height: 1.68;
}

.record-actions,
.records-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
}

.records-toolbar {
  justify-content: space-between;
  margin-bottom: 14px;
}

.record-detail {
  display: grid;
  gap: 14px;
}

.record-detail-head {
  display: grid;
  gap: 4px;
  padding: 0 2px;
}

.record-report .report {
  gap: 8px;
}

.record-report .report h3 {
  font-size: 24px;
}

.record-report .report-section {
  padding: 10px 12px;
}

.record-editor {
  display: grid;
  gap: 14px;
}

.record-field {
  display: grid;
  gap: 7px;
}

.record-field span {
  color: #4f5878;
  font-size: 15px;
  font-weight: 800;
}

.record-field small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.record-field textarea {
  min-height: 112px;
  max-height: 220px;
  padding: 14px 16px;
  font-size: 16px;
  line-height: 1.75;
  background:
    repeating-linear-gradient(to bottom, rgba(255, 253, 248, 0.98) 0 34px, rgba(110, 124, 113, 0.06) 34px 35px),
    var(--paper);
}

.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;
}

@media (max-width: 760px) {
  .orbit-a,
  .orbit-b,
  .bird-a,
  .snail-a,
  .flower-b {
    display: none;
  }

  .sprig-a {
    left: -2%;
    top: 35%;
    transform: scale(0.78) rotate(-12deg);
  }

  .sprig-b {
    right: -5%;
    bottom: 22%;
    transform: scale(0.68) rotate(14deg);
  }

  .flower-a {
    left: 5%;
    bottom: 7%;
    transform: scale(0.74) rotate(-9deg);
  }

  .butterfly-a {
    left: 68%;
    top: 13%;
    transform: scale(0.68) rotate(-8deg);
  }

  .butterfly-b {
    right: -2%;
    top: 55%;
    transform: scale(0.56) rotate(14deg);
  }

  .landing-page {
    padding: 22px;
  }

  .landing-page::before {
    width: 88vw;
    height: 58vw;
  }

  .landing-actions {
    width: 100%;
  }

  .landing-actions .start-button,
  .landing-actions .secondary-button {
    flex: 1 1 150px;
  }

  .writing-page {
    padding: 20px 14px 18px;
  }

  .space-header {
    flex-direction: column;
    gap: 14px;
  }

  .global-actions {
    justify-content: flex-end;
    gap: 6px;
  }

  .record-button {
    min-height: 40px;
    padding: 0 12px;
    font-size: 13px;
  }

  .safety-strip {
    grid-template-columns: 1fr;
  }

  .safety-icon {
    display: none;
  }

  .writing-sheet {
    min-height: 430px;
    background:
      linear-gradient(90deg, transparent 0 22px, rgba(196, 135, 129, 0.09) 22px 23px, transparent 23px 100%),
      repeating-linear-gradient(to bottom, rgba(255, 253, 248, 0.94) 0 37px, rgba(110, 124, 113, 0.07) 37px 38px),
      var(--paper);
  }

  .writing-pad {
    padding: 18px;
  }

  .starter-row {
    gap: 10px;
    padding-bottom: 18px;
  }

  .starter-chip {
    min-height: 46px;
    padding: 9px 15px;
    font-size: 15px;
  }

  .chat-log {
    justify-content: start;
    padding: 28px 16px 22px 34px;
  }

  .message-bubble {
    padding: 22px 18px;
    font-size: 16px;
  }

  .message-meta {
    min-height: 42px;
    margin-bottom: 8px;
    padding: 9px 14px;
    font-size: 18px;
  }

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

  .flow-actions {
    gap: 10px;
  }

  .send-button,
  .back-button {
    min-width: 0;
    flex: 0 1 auto;
    padding: 0 14px;
  }

  .back-button {
    margin-right: 0;
  }

  .send-button {
    min-height: 50px;
  }

  textarea {
    min-height: 320px;
    font-size: 18px;
  }

  .space-footer {
    text-align: left;
  }

  .records-panel {
    place-items: end stretch;
  }

  .records-drawer {
    width: calc(100vw - 16px);
    height: min(88vh, 720px);
    margin: 8px;
  }

  .records-header {
    padding: 18px 16px 14px 30px;
  }

  .records-content {
    padding: 14px 14px 20px 30px;
  }

  .records-calendar {
    padding: 10px;
  }

  .calendar-weekdays,
  .calendar-grid {
    gap: 4px;
  }

  .calendar-day {
    min-height: 38px;
  }

  .calendar-day span {
    font-size: 13px;
  }

  .record-actions,
  .records-toolbar {
    justify-content: flex-start;
  }

  .record-field textarea {
    min-height: 96px;
    font-size: 15px;
  }
}
