:root {
  --sakura: #b8a4f0;
  --sakura-deep: #9b87e8;
  --sakura-soft: #f0ebff;
  --mint: #5ec4b0;
  --mint-deep: #3aa894;
  --sky: #7ec8e8;
  --peach: #c4b5fd;
  --lavender: #ddd6fe;
  --ink: #3d3550;
  --muted: #8a7f96;
  --paper: rgba(255, 255, 255, 0.86);
  --paper-solid: #fcfbff;
  --line: rgba(155, 135, 232, 0.28);
  --shadow: 0 12px 32px rgba(139, 122, 224, 0.14);
  --shadow-soft: 0 8px 24px rgba(61, 53, 80, 0.08);
  --radius: 26px;
  --radius-sm: 18px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top: env(safe-area-inset-top, 0px);
  --font: "Nunito", system-ui, sans-serif;
  --font-display: "Fredoka", "Nunito", system-ui, sans-serif;
  --font-cute: "Yomogi", "Fredoka", cursive;
  --bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
  --smooth: cubic-bezier(0.22, 1, 0.36, 1);
  --touch: 48px;
}

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

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: var(--font);
  color: var(--ink);
  background: #f7f4ff;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

body {
  overflow-x: hidden;
}

button,
input,
textarea {
  font: inherit;
  -webkit-appearance: none;
  appearance: none;
}

button {
  touch-action: manipulation;
  user-select: none;
}

/* ── Atmosphere ── */

.app-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  background:
    radial-gradient(ellipse 90% 55% at 0% -5%, #e4d9ff 0%, transparent 55%),
    radial-gradient(ellipse 70% 50% at 100% 5%, #d4f5ef 0%, transparent 50%),
    radial-gradient(ellipse 60% 45% at 50% 110%, #ddd6fe 0%, transparent 55%),
    linear-gradient(168deg, #f7f4ff 0%, #f0fbff 42%, #faf5ff 100%);
}

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(40px);
  opacity: 0.55;
  animation: blobFloat 14s ease-in-out infinite alternate;
}

.blob-a {
  width: 220px;
  height: 220px;
  top: -40px;
  left: -50px;
  background: #c4b5fd;
  animation-duration: 16s;
}

.blob-b {
  width: 180px;
  height: 180px;
  top: 28%;
  right: -60px;
  background: #9fe8d8;
  animation-duration: 18s;
  animation-delay: -4s;
}

.blob-c {
  width: 260px;
  height: 200px;
  bottom: -50px;
  left: 20%;
  background: #a8d8f0;
  animation-duration: 20s;
  animation-delay: -8s;
}

@keyframes blobFloat {
  from {
    transform: translate(0, 0) scale(1);
  }
  to {
    transform: translate(18px, -22px) scale(1.08);
  }
}

.sparkle {
  position: absolute;
  color: var(--sakura);
  font-size: 0.85rem;
  opacity: 0.55;
  animation: twinkle 3.2s ease-in-out infinite;
  pointer-events: none;
}

.s1 {
  top: 12%;
  left: 18%;
  animation-delay: 0s;
}
.s2 {
  top: 22%;
  right: 14%;
  color: var(--mint);
  animation-delay: 0.8s;
  font-size: 1rem;
}
.s3 {
  bottom: 28%;
  left: 10%;
  color: var(--sky);
  animation-delay: 1.4s;
}
.s4 {
  top: 48%;
  right: 22%;
  color: var(--peach);
  animation-delay: 2s;
  font-size: 0.95rem;
}

@keyframes twinkle {
  0%,
  100% {
    opacity: 0.25;
    transform: scale(0.85) rotate(0deg);
  }
  50% {
    opacity: 0.85;
    transform: scale(1.15) rotate(12deg);
  }
}

.petal {
  position: absolute;
  width: 14px;
  height: 18px;
  background: radial-gradient(circle at 30% 30%, #d8ccff, #b8a4f0);
  border-radius: 70% 0 70% 0;
  opacity: 0.45;
  animation: petalFall 12s linear infinite;
  pointer-events: none;
}

.p1 {
  left: 12%;
  top: -20px;
  animation-duration: 14s;
}
.p2 {
  left: 55%;
  top: -30px;
  animation-duration: 17s;
  animation-delay: -5s;
  width: 11px;
  height: 14px;
}
.p3 {
  left: 78%;
  top: -25px;
  animation-duration: 15s;
  animation-delay: -9s;
  background: radial-gradient(circle at 30% 30%, #e9e0ff, #c4b5fd);
}

@keyframes petalFall {
  0% {
    transform: translateY(0) rotate(0deg) translateX(0);
    opacity: 0;
  }
  8% {
    opacity: 0.5;
  }
  100% {
    transform: translateY(110vh) rotate(360deg) translateX(40px);
    opacity: 0;
  }
}

/* ── Layout ── */

.app {
  max-width: 440px;
  margin: 0 auto;
  min-height: 100dvh;
  padding: calc(18px + var(--safe-top)) 16px calc(28px + var(--safe-bottom));
}

.screen {
  animation: popIn 0.45s var(--bounce);
}

@keyframes popIn {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ── Brand ── */

.brand {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 26px;
  text-align: center;
  padding-top: 8px;
}

.brand-mark {
  font-family: var(--font-cute);
  font-size: 1.05rem;
  color: var(--sakura-deep);
  letter-spacing: 0.02em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.brand-mark::before {
  content: "♡";
  animation: heartbeat 1.6s ease-in-out infinite;
  display: inline-block;
}

@keyframes heartbeat {
  0%,
  100% {
    transform: scale(1);
  }
  15% {
    transform: scale(1.22);
  }
  30% {
    transform: scale(1);
  }
  45% {
    transform: scale(1.14);
  }
}

.brand h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.85rem, 7.5vw, 2.35rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: var(--ink);
}

.brand p {
  margin: 4px auto 0;
  color: var(--muted);
  font-size: 0.98rem;
  line-height: 1.5;
  max-width: 28ch;
  font-weight: 600;
}

/* ── Top bar ── */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}

.topbar-user {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.topbar-user h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.28rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-user span {
  display: block;
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 2px;
  font-weight: 700;
}

.avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.05rem;
  flex-shrink: 0;
  box-shadow:
    0 6px 16px rgba(0, 0, 0, 0.12),
    inset 0 -3px 0 rgba(0, 0, 0, 0.08),
    0 0 0 3px rgba(255, 255, 255, 0.7);
  position: relative;
  overflow: hidden;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 50%;
}

.avatar.has-photo {
  box-shadow:
    0 6px 16px rgba(139, 122, 224, 0.2),
    0 0 0 3px rgba(255, 255, 255, 0.85);
}

.avatar.has-photo::after,
.avatar-btn .avatar::after {
  display: none;
}

.avatar::after {
  content: "";
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 14px;
  height: 14px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 0 0 2px var(--sakura-soft);
  background-image: radial-gradient(circle at 50% 55%, var(--sakura) 40%, transparent 42%);
}

.avatar-lg {
  width: 64px;
  height: 64px;
  font-size: 1.25rem;
}

.avatar-xl {
  width: 96px;
  height: 96px;
  font-size: 1.8rem;
  box-shadow:
    0 12px 28px rgba(139, 122, 224, 0.22),
    0 0 0 4px rgba(255, 255, 255, 0.9);
}

.avatar-wrap,
.avatar-btn {
  position: relative;
  display: inline-grid;
  place-items: center;
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
  flex-shrink: 0;
}

.avatar-btn {
  transition: transform 0.22s var(--bounce);
}

.avatar-btn:active {
  transform: scale(0.92);
}

.avatar-badge {
  position: absolute;
  bottom: -2px;
  right: -4px;
  z-index: 2;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: linear-gradient(145deg, #c4b5fd, var(--sakura-deep));
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  display: grid;
  place-items: center;
  box-shadow:
    0 4px 10px rgba(139, 122, 224, 0.35),
    0 0 0 2px #fff;
  pointer-events: none;
}

.avatar-editor {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}

.avatar-editor .photo-actions {
  width: 100%;
}

/* ── Profile grid ── */

.profile-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.profile-card-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  background: var(--paper);
  backdrop-filter: blur(14px);
  border-radius: var(--radius);
  padding: 18px 12px 14px;
  box-shadow: var(--shadow);
  border: 2px solid rgba(255, 255, 255, 0.9);
  transition:
    transform 0.25s var(--bounce),
    box-shadow 0.25s ease;
}

.profile-card-wrap:active {
  transform: scale(0.97);
}

.profile-card {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 4px 6px 0;
  text-align: center;
  cursor: pointer;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-height: auto;
  box-shadow: none;
}

.profile-card:hover {
  transform: none;
  box-shadow: none;
}

.profile-card:active {
  transform: none;
}

.profile-card .name {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.25;
  word-break: break-word;
}

.profile-hint {
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--sakura-deep);
  letter-spacing: 0.02em;
}

.profile-card .avatar {
  width: 56px;
  height: 56px;
  font-size: 1.2rem;
  transition: transform 0.3s var(--bounce);
}

.profile-card:active .avatar {
  transform: scale(1.08) rotate(-6deg);
}

.switch-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.switch-row .switch-item {
  flex: 1;
  margin: 0;
}

.switch-row .avatar-btn .avatar {
  width: 44px;
  height: 44px;
  font-size: 0.95rem;
}

/* ── Buttons ── */

.btn {
  appearance: none;
  border: 0;
  border-radius: 999px;
  padding: 14px 20px;
  min-height: var(--touch);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.98rem;
  cursor: pointer;
  transition:
    transform 0.22s var(--bounce),
    box-shadow 0.22s ease,
    background 0.2s ease,
    opacity 0.2s ease,
    filter 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  position: relative;
  overflow: hidden;
}

.btn::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    120deg,
    transparent 30%,
    rgba(255, 255, 255, 0.35) 50%,
    transparent 70%
  );
  transform: translateX(-120%);
  transition: transform 0.5s ease;
  pointer-events: none;
}

.btn:active::after {
  transform: translateX(120%);
}

.btn:active {
  transform: scale(0.94);
}

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

.btn-ghost {
  background: rgba(255, 255, 255, 0.72);
  color: var(--sakura-deep);
  border: 2px solid var(--line);
  box-shadow: var(--shadow-soft);
}

.btn-ghost:active {
  background: var(--sakura-soft);
}

.btn-primary {
  background: linear-gradient(145deg, #c4b5fd 0%, var(--sakura-deep) 100%);
  color: #fff;
  box-shadow:
    0 10px 24px rgba(139, 122, 224, 0.38),
    inset 0 -3px 0 rgba(0, 0, 0, 0.08);
}

.btn-primary:active {
  box-shadow: 0 4px 12px rgba(139, 122, 224, 0.3);
}

.btn-coral {
  background: linear-gradient(145deg, #d4c8ff 0%, var(--peach) 55%, #a78bfa 100%);
  color: #fff;
  box-shadow:
    0 10px 24px rgba(139, 122, 224, 0.35),
    inset 0 -3px 0 rgba(0, 0, 0, 0.08);
}

.btn-mint {
  background: linear-gradient(145deg, #7ed9c8 0%, var(--mint-deep) 100%);
  color: #fff;
  box-shadow:
    0 10px 24px rgba(58, 168, 148, 0.32),
    inset 0 -3px 0 rgba(0, 0, 0, 0.08);
}

.btn-block {
  width: 100%;
}

.btn-sm {
  min-height: 40px;
  padding: 10px 16px;
  font-size: 0.88rem;
}

/* ── FAB ── */

.fab {
  position: fixed;
  right: max(16px, calc(50% - 220px + 16px));
  bottom: calc(20px + var(--safe-bottom));
  width: 64px;
  height: 64px;
  border: 3px solid rgba(255, 255, 255, 0.85);
  border-radius: 50%;
  background: linear-gradient(145deg, #c4b5fd, var(--sakura-deep));
  color: #fff;
  font-size: 2.1rem;
  font-weight: 500;
  line-height: 1;
  box-shadow:
    0 14px 32px rgba(139, 122, 224, 0.42),
    inset 0 -4px 0 rgba(0, 0, 0, 0.1);
  cursor: pointer;
  z-index: 20;
  transition:
    transform 0.25s var(--bounce),
    box-shadow 0.25s ease;
  animation:
    fabIn 0.55s var(--bounce),
    fabPulse 2.8s ease-in-out infinite 0.8s;
  display: grid;
  place-items: center;
}

.fab:active {
  transform: scale(0.88) rotate(90deg);
  animation: none;
  box-shadow: 0 6px 16px rgba(139, 122, 224, 0.35);
}

@keyframes fabIn {
  from {
    opacity: 0;
    transform: translateY(28px) scale(0.5);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes fabPulse {
  0%,
  100% {
    box-shadow:
      0 14px 32px rgba(139, 122, 224, 0.42),
      inset 0 -4px 0 rgba(0, 0, 0, 0.1),
      0 0 0 0 rgba(155, 135, 232, 0.4);
  }
  50% {
    box-shadow:
      0 14px 32px rgba(139, 122, 224, 0.42),
      inset 0 -4px 0 rgba(0, 0, 0, 0.1),
      0 0 0 12px rgba(155, 135, 232, 0);
  }
}

/* ── Empty ── */

.empty {
  margin-top: 20px;
  padding: 36px 22px;
  text-align: center;
  background: var(--paper);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 2px solid rgba(255, 255, 255, 0.9);
  animation: popIn 0.45s var(--bounce);
}

.empty-illu {
  font-size: 2.8rem;
  line-height: 1;
  margin-bottom: 12px;
  display: block;
  animation: bounceSoft 2.4s ease-in-out infinite;
}

@keyframes bounceSoft {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-6px);
  }
}

.empty h2 {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
}

.empty p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
  font-weight: 600;
  font-size: 0.95rem;
}

/* ── Readings ── */

.readings {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-bottom: 96px;
}

.reading-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: start;
  background: var(--paper);
  backdrop-filter: blur(12px);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow-soft);
  border: 2px solid rgba(255, 255, 255, 0.95);
  animation: cardIn 0.4s var(--bounce) both;
  transition:
    transform 0.2s var(--bounce),
    box-shadow 0.2s ease;
}

.reading-card:active {
  transform: scale(0.98);
}

.reading-card:nth-child(1) {
  animation-delay: 0.04s;
}
.reading-card:nth-child(2) {
  animation-delay: 0.08s;
}
.reading-card:nth-child(3) {
  animation-delay: 0.12s;
}
.reading-card:nth-child(4) {
  animation-delay: 0.16s;
}
.reading-card:nth-child(5) {
  animation-delay: 0.2s;
}

@keyframes cardIn {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.bp-values {
  display: flex;
  align-items: baseline;
  gap: 6px;
  flex-wrap: wrap;
}

.bp-main {
  font-family: var(--font-display);
  font-size: 1.65rem;
  font-weight: 600;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, var(--sakura-deep), var(--mint-deep));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.bp-unit {
  font-size: 0.75rem;
  color: var(--muted);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.bp-meta {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 700;
  align-items: center;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--sakura-soft);
  color: var(--sakura-deep);
  font-weight: 800;
  font-size: 0.78rem;
}

.chip-pulse {
  background: rgba(155, 135, 232, 0.18);
  color: var(--sakura-deep);
}

.chip-time {
  background: rgba(255, 179, 138, 0.22);
  color: #c45c2a;
}

.chip-morning {
  background: rgba(255, 213, 128, 0.35);
  color: #b45309;
}

.chip-afternoon {
  background: rgba(126, 200, 232, 0.3);
  color: #0369a1;
}

.chip-evening {
  background: rgba(255, 179, 138, 0.32);
  color: #c2410c;
}

.chip-night {
  background: rgba(196, 181, 253, 0.35);
  color: #5b21b6;
}

.chip-date {
  background: rgba(94, 196, 176, 0.18);
  color: var(--mint-deep);
}

.tag-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.tag-pill {
  appearance: none;
  border: 2px solid var(--line);
  background: #f8f5ff;
  border-radius: 18px;
  padding: 14px 10px;
  min-height: var(--touch);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--ink);
  cursor: pointer;
  transition:
    background 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease,
    transform 0.22s var(--bounce),
    box-shadow 0.2s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.tag-pill .tag-ico {
  font-size: 1.15rem;
  line-height: 1;
  transition: transform 0.25s var(--bounce);
}

.tag-pill:active {
  transform: scale(0.94);
}

.tag-pill.selected {
  border-color: var(--sakura);
  background: linear-gradient(160deg, #f0ebff, #fff);
  color: var(--sakura-deep);
  box-shadow:
    0 0 0 3px rgba(155, 135, 232, 0.2),
    0 8px 18px rgba(139, 122, 224, 0.15);
}

.tag-pill.selected .tag-ico {
  transform: scale(1.2) rotate(-8deg);
}

.notes {
  margin-top: 10px;
  font-size: 0.92rem;
  line-height: 1.45;
  color: var(--ink);
  font-weight: 600;
  padding: 10px 12px;
  background: rgba(240, 235, 255, 0.45);
  border-radius: 14px;
}

.thumb {
  width: 76px;
  height: 76px;
  border-radius: 18px;
  object-fit: cover;
  background: var(--sakura-soft);
  border: 2px solid #fff;
  box-shadow: 0 6px 14px rgba(139, 122, 224, 0.18);
}

/* ── Sheets ── */

.sheet-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(61, 53, 80, 0.38);
  backdrop-filter: blur(6px);
  z-index: 40;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s ease;
}

.sheet-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.sheet {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translate(-50%, 110%);
  width: min(100%, 440px);
  max-height: min(90dvh, 760px);
  background: var(--paper-solid);
  border-radius: 32px 32px 0 0;
  box-shadow: 0 -16px 48px rgba(139, 122, 224, 0.18);
  z-index: 50;
  padding: 10px 18px calc(22px + var(--safe-bottom));
  overflow: auto;
  transition: transform 0.4s var(--bounce);
  border: 2px solid rgba(255, 255, 255, 0.95);
  border-bottom: 0;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.sheet.open {
  transform: translate(-50%, 0);
}

.sheet-handle {
  width: 44px;
  height: 5px;
  border-radius: 999px;
  background: linear-gradient(90deg, #d4c8ff, #c4b5fd);
  margin: 6px auto 16px;
}

.sheet h2 {
  margin: 0 0 4px;
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  text-align: center;
}

.sheet .sub {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 0.92rem;
  text-align: center;
  font-weight: 600;
}

.sheet-emoji {
  text-align: center;
  font-size: 2rem;
  margin-bottom: 6px;
  animation: bounceSoft 2.2s ease-in-out infinite;
  display: block;
}

/* ── Fields ── */

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.field label {
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--muted);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.field input,
.field textarea {
  width: 100%;
  border: 2px solid var(--line);
  background: #f8f5ff;
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  min-height: var(--touch);
  color: var(--ink);
  outline: none;
  font-weight: 700;
  font-size: 1.05rem;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    background 0.2s ease,
    transform 0.2s var(--bounce);
}

.field input:focus,
.field textarea:focus {
  border-color: var(--sakura);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(155, 135, 232, 0.18);
  transform: scale(1.01);
}

.field textarea {
  min-height: 92px;
  resize: vertical;
  font-size: 0.98rem;
  line-height: 1.45;
}

.row-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
}

.row-3 .field input {
  text-align: center;
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 600;
  padding: 14px 8px;
}

.row-3 .field label {
  text-align: center;
}

.switch-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}

.switch-item {
  appearance: none;
  width: 100%;
  border: 2px solid transparent;
  background: #f5f0ff;
  border-radius: 20px;
  padding: 12px 14px;
  min-height: var(--touch);
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  text-align: left;
  transition:
    background 0.2s ease,
    transform 0.22s var(--bounce),
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.switch-item:active {
  transform: scale(0.97);
}

.switch-item.active {
  background: linear-gradient(135deg, #f0ebff, #fff);
  border-color: var(--sakura);
  box-shadow: 0 0 0 3px rgba(155, 135, 232, 0.15);
}

.switch-item .name {
  font-family: var(--font-display);
  font-weight: 600;
  flex: 1;
  font-size: 1.02rem;
}

.switch-item .check {
  font-size: 1.1rem;
  opacity: 0;
  transform: scale(0.5);
  transition:
    opacity 0.2s ease,
    transform 0.25s var(--bounce);
}

.switch-item.active .check {
  opacity: 1;
  transform: scale(1);
}

.date-trigger {
  width: 100%;
  appearance: none;
  border: 2px solid var(--line);
  background: #f8f5ff;
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  min-height: var(--touch);
  text-align: left;
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  transition:
    border-color 0.2s ease,
    transform 0.22s var(--bounce),
    box-shadow 0.2s ease;
}

.date-trigger:active {
  transform: scale(0.98);
}

.date-trigger .chev {
  color: var(--sakura);
  font-size: 1.1rem;
  transition: transform 0.25s var(--bounce);
}

.date-trigger.open .chev {
  transform: rotate(180deg);
}

.calendar {
  margin-top: 10px;
  padding: 14px;
  border-radius: 22px;
  background: linear-gradient(160deg, #f5f0ff, #f0fbff);
  border: 2px solid var(--line);
  animation: popIn 0.3s var(--bounce);
}

.cal-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  gap: 8px;
}

.cal-nav strong {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
}

.cal-nav button {
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 50%;
  background: #fff;
  color: var(--sakura-deep);
  font-size: 1.25rem;
  cursor: pointer;
  box-shadow: var(--shadow-soft);
  transition: transform 0.22s var(--bounce);
  display: grid;
  place-items: center;
}

.cal-nav button:active {
  transform: scale(0.9);
}

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.cal-dow {
  text-align: center;
  font-size: 0.68rem;
  font-weight: 800;
  color: var(--muted);
  padding: 6px 0;
  text-transform: uppercase;
}

.cal-day {
  appearance: none;
  border: 0;
  background: transparent;
  border-radius: 50%;
  aspect-ratio: 1;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--ink);
  cursor: pointer;
  transition:
    transform 0.2s var(--bounce),
    background 0.15s ease,
    color 0.15s ease;
  min-height: 38px;
}

.cal-day:not(:disabled):active {
  transform: scale(0.9);
}

.cal-day:disabled {
  opacity: 0.2;
  cursor: default;
}

.cal-day.today {
  box-shadow: inset 0 0 0 2px var(--mint);
}

.cal-day.selected {
  background: linear-gradient(145deg, #c4b5fd, var(--sakura-deep));
  color: #fff;
  box-shadow: 0 4px 12px rgba(139, 122, 224, 0.35);
}

.photo-box {
  border: 2px dashed rgba(155, 135, 232, 0.45);
  border-radius: var(--radius-sm);
  padding: 14px;
  background: #f8f5ff;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.photo-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.photo-preview {
  position: relative;
  width: 100%;
  border-radius: 18px;
  overflow: hidden;
  background: var(--sakura-soft);
  border: 2px solid #fff;
}

.photo-preview img {
  display: block;
  width: 100%;
  max-height: 220px;
  object-fit: cover;
}

.photo-preview .remove {
  position: absolute;
  top: 10px;
  right: 10px;
  border: 0;
  border-radius: 999px;
  background: rgba(61, 53, 80, 0.72);
  color: #fff;
  padding: 8px 14px;
  min-height: 36px;
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s var(--bounce);
}

.photo-preview .remove:active {
  transform: scale(0.94);
}

.sheet-actions {
  display: flex;
  gap: 10px;
  margin-top: 10px;
  position: sticky;
  bottom: 0;
  padding-top: 8px;
  background: linear-gradient(to top, var(--paper-solid) 70%, transparent);
}

.sheet-actions .btn {
  flex: 1;
}

/* ── Toast ── */

.toast {
  position: fixed;
  left: 50%;
  top: calc(14px + var(--safe-top));
  transform: translate(-50%, -130%) scale(0.9);
  z-index: 80;
  max-width: min(92vw, 360px);
  background: linear-gradient(135deg, #4a3f5c, #3d3550);
  color: #fff;
  padding: 14px 18px;
  border-radius: 20px;
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 500;
  box-shadow: 0 14px 36px rgba(61, 53, 80, 0.28);
  opacity: 0;
  transition:
    transform 0.35s var(--bounce),
    opacity 0.28s ease;
  pointer-events: none;
  border: 2px solid rgba(255, 255, 255, 0.12);
  text-align: center;
}

.toast.show {
  transform: translate(-50%, 0) scale(1);
  opacity: 1;
}

/* ── Loading ── */

.loading {
  display: grid;
  place-items: center;
  min-height: 55dvh;
  color: var(--muted);
  gap: 14px;
  font-family: var(--font-display);
  font-weight: 600;
}

.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid rgba(155, 135, 232, 0.25);
  border-top-color: var(--sakura);
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}

.loading-heart {
  font-size: 2rem;
  animation: heartbeat 1.2s ease-in-out infinite;
  color: var(--sakura);
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.banner {
  background: linear-gradient(135deg, #f0ebff, #f5f0ff);
  color: #9a3412;
  border-radius: 18px;
  padding: 14px 16px;
  margin-bottom: 16px;
  font-size: 0.92rem;
  line-height: 1.45;
  font-weight: 700;
  border: 2px solid rgba(155, 135, 232, 0.25);
}

.hidden-file {
  display: none;
}

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

/* Small phones */
@media (max-width: 360px) {
  .app {
    padding-left: 12px;
    padding-right: 12px;
  }

  .row-3 {
    gap: 8px;
  }

  .row-3 .field input {
    font-size: 1.05rem;
  }

  .bp-main {
    font-size: 1.4rem;
  }
}
