:root {
  --bg: #fff9fb;
  --bg-soft: #fff3f7;
  --surface: rgba(255, 255, 255, 0.8);
  --surface-strong: #ffffff;
  --surface-accent: #fff0f6;
  --line: rgba(130, 72, 101, 0.12);
  --text: #3d2b39;
  --text-soft: #7a6170;
  --primary: #d98daf;
  --primary-deep: #b8698e;
  --lavender: #dfd5ff;
  --ivory: #fffaf4;
  --mint: #dff3ea;
  --warning: #f4d4de;
  --shadow: 0 22px 60px rgba(161, 111, 140, 0.12);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 18px;
  --radius-sm: 14px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at top left, rgba(236, 199, 221, 0.5), transparent 32%),
    linear-gradient(180deg, #fffafc 0%, #fff5f8 45%, #fef8fb 100%);
  color: var(--text);
  font-family: "Pretendard", sans-serif;
}

body {
  display: flex;
  justify-content: center;
}

button,
input,
textarea {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

input {
  font: inherit;
}

.app-shell {
  width: 100%;
  max-width: 460px;
  min-height: 100vh;
  position: relative;
  padding: 18px 16px 104px;
}

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

.eyebrow {
  margin: 0 0 4px;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-soft);
}

.brand {
  margin: 0;
  font-family: "Noto Serif KR", serif;
  font-size: 28px;
  font-weight: 700;
}

.icon-button {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.68);
  color: var(--primary-deep);
  box-shadow: var(--shadow);
}

.screen {
  display: grid;
  gap: 16px;
  animation: fade-up 360ms ease;
}

.hero-card,
.card,
.panel,
.premium-card,
.entry-card,
.trend-card,
.preview-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: var(--surface);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
}

.hero-card {
  padding: 24px;
  background:
    linear-gradient(160deg, rgba(255, 243, 247, 0.98), rgba(255, 255, 255, 0.82)),
    linear-gradient(135deg, rgba(223, 213, 255, 0.22), rgba(217, 141, 175, 0.12));
}

.hero-title,
.section-title,
.card-title {
  margin: 0;
  font-family: "Noto Serif KR", serif;
}

.hero-title {
  font-size: 30px;
  line-height: 1.28;
}

.hero-copy,
.subtle,
.section-copy,
.card-copy,
.list-copy {
  margin: 0;
  color: var(--text-soft);
  line-height: 1.6;
}

.hero-actions,
.inline-actions,
.tag-list,
.tag-entry,
.chip-row,
.emotion-grid,
.insight-grid,
.premium-list,
.settings-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.primary-button,
.secondary-button,
.ghost-button {
  min-height: 48px;
  padding: 0 18px;
  border-radius: 999px;
  font-weight: 600;
}

.primary-button {
  background: linear-gradient(135deg, #d98daf, #c77ca0);
  color: #fff;
  box-shadow: 0 16px 30px rgba(200, 120, 160, 0.28);
}

.secondary-button {
  background: rgba(255, 255, 255, 0.82);
  color: var(--primary-deep);
  border: 1px solid rgba(184, 105, 142, 0.12);
}

.ghost-button {
  background: transparent;
  color: var(--text-soft);
  border: 1px solid var(--line);
}

.danger-button {
  color: #c14c62;
  border-color: rgba(193, 76, 98, 0.2);
}

.card,
.panel,
.premium-card,
.entry-card,
.trend-card,
.preview-card {
  padding: 18px;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.section-head > *:first-child {
  min-width: 0;
}

.section-title {
  font-size: 20px;
}

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

.stat-card {
  padding: 16px;
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(255, 244, 247, 0.88));
  border: 1px solid rgba(184, 105, 142, 0.1);
}

.stat-label {
  margin: 0 0 8px;
  color: var(--text-soft);
  font-size: 13px;
}

.stat-value {
  margin: 0;
  font-size: 24px;
  font-weight: 700;
}

.stat-value-message {
  font-size: 15px;
  line-height: 1.65;
  font-weight: 600;
  white-space: normal;
  word-break: keep-all;
  overflow-wrap: anywhere;
}

.gradient-pill,
.tag,
.filter-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.76);
  border: 1px solid rgba(184, 105, 142, 0.12);
  color: var(--text);
  font-size: 13px;
}

.removable-tag span {
  color: var(--primary-deep);
  font-weight: 700;
}

.gradient-pill {
  background: linear-gradient(135deg, rgba(255, 240, 246, 1), rgba(223, 213, 255, 0.82));
}

.filter-pill.is-active {
  background: linear-gradient(135deg, rgba(255, 240, 246, 1), rgba(223, 213, 255, 0.72));
  border-color: rgba(184, 105, 142, 0.2);
  color: var(--primary-deep);
}

.auth-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.auth-form {
  margin-top: 4px;
}

.auth-feedback {
  color: var(--primary-deep);
}

.emotion-option,
.tag-option {
  flex: 1 1 calc(33.333% - 8px);
  min-width: 92px;
  min-height: 80px;
  padding: 14px 10px;
  border-radius: 22px;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.74);
  color: var(--text);
  display: grid;
  place-items: center;
  gap: 6px;
  text-align: center;
}

.emotion-option.is-selected,
.tag-option.is-selected,
.nav-item.is-active {
  background: linear-gradient(135deg, rgba(255, 240, 246, 1), rgba(223, 213, 255, 0.72));
  border-color: rgba(184, 105, 142, 0.2);
  color: var(--primary-deep);
}

.emotion-option strong,
.tag-option strong {
  font-size: 14px;
}

.journal-box {
  width: 100%;
  min-height: 172px;
  padding: 16px;
  border-radius: 22px;
  border: 1px solid rgba(184, 105, 142, 0.14);
  background: rgba(255, 255, 255, 0.84);
  resize: vertical;
  color: var(--text);
}

.title-input {
  width: 100%;
  min-height: 48px;
  padding: 0 16px;
  border-radius: 16px;
  border: 1px solid rgba(184, 105, 142, 0.14);
  background: rgba(255, 255, 255, 0.84);
  color: var(--text);
}

.title-button {
  flex: 1 1 auto;
  min-width: 0;
  padding: 0;
  background: transparent;
  color: var(--text);
  font-family: "Noto Serif KR", serif;
  font-size: 20px;
  font-weight: 700;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.inline-actions {
  flex: 0 0 auto;
  flex-wrap: nowrap;
  align-items: center;
}

.form-meta {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  color: var(--text-soft);
  font-size: 13px;
}

.result-stack,
.entries-stack,
.premium-list,
.settings-list {
  display: grid;
  gap: 12px;
}

.result-bar {
  display: grid;
  gap: 8px;
}

.bar-track {
  width: 100%;
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(217, 141, 175, 0.12);
}

.bar-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #e6a6c2, #c9b4ff);
}

.entry-head,
.premium-head,
.timeline-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.entry-day,
.small-label {
  color: var(--text-soft);
  font-size: 12px;
}

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

.calendar-strip {
  display: grid;
  gap: 10px;
}

.calendar-strip-free {
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.calendar-strip-premium {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.calendar-day {
  min-height: 92px;
  padding: 10px 6px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(184, 105, 142, 0.12);
  display: grid;
  align-content: space-between;
  justify-items: center;
  color: var(--text);
}

.calendar-day.has-entry {
  background: linear-gradient(180deg, rgba(255, 247, 250, 0.95), rgba(245, 240, 255, 0.92));
}

.calendar-day.is-empty {
  opacity: 0.58;
}

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

.calendar-weekday,
.calendar-number {
  line-height: 1;
}

.calendar-weekday {
  font-size: 12px;
  color: var(--text-soft);
}

.calendar-number {
  font-size: 16px;
}

.calendar-emoji {
  font-size: 18px;
  letter-spacing: -0.08em;
}

.calendar-count {
  min-height: 16px;
  font-size: 11px;
  color: var(--primary-deep);
  font-weight: 700;
}

.timeline-day {
  padding: 12px 8px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.7);
  text-align: center;
  border: 1px solid rgba(184, 105, 142, 0.1);
}

.timeline-day strong {
  display: block;
  margin-top: 8px;
  font-size: 12px;
}

.timeline-dot {
  width: 10px;
  height: 10px;
  margin: 8px auto 0;
  border-radius: 50%;
  background: #e2adc5;
}

.locked-card {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255, 247, 250, 0.96), rgba(250, 244, 255, 0.96));
}

.locked-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.68));
  pointer-events: none;
}

.lock-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(184, 105, 142, 0.12);
  color: var(--primary-deep);
  font-size: 12px;
  font-weight: 600;
}

.premium-card {
  background:
    radial-gradient(circle at top right, rgba(223, 213, 255, 0.5), transparent 28%),
    linear-gradient(180deg, rgba(255, 244, 248, 0.98), rgba(255, 255, 255, 0.9));
}

.price {
  margin: 8px 0 0;
  font-size: 28px;
  font-weight: 700;
}

.muted-box {
  padding: 14px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.58);
  color: var(--text-soft);
}

.muted-box pre {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: "Pretendard", sans-serif;
  font-size: 13px;
  line-height: 1.65;
}

.settings-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 16px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.72);
}

.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  width: min(428px, calc(100% - 24px));
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  padding: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(184, 105, 142, 0.14);
  box-shadow: 0 18px 40px rgba(133, 94, 115, 0.18);
  backdrop-filter: blur(16px);
}

.nav-item {
  min-height: 48px;
  border-radius: 999px;
  background: transparent;
  color: var(--text-soft);
  font-size: 13px;
  font-weight: 600;
}

.hidden {
  display: none !important;
}

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (min-width: 768px) {
  .app-shell {
    max-width: 1080px;
    padding-left: 24px;
    padding-right: 24px;
  }

  .screen {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
  }

  .screen > .hero-card,
  .screen > .panel:first-child,
  .screen > .card.full-span,
  .screen > .premium-card,
  .screen > .preview-card {
    grid-column: 1 / -1;
  }

  .bottom-nav {
    width: min(560px, calc(100% - 32px));
  }

  .calendar-strip-premium {
    grid-template-columns: repeat(10, minmax(0, 1fr));
  }
}
