:root {
  color-scheme: light;
  --cream: #fffaf3;
  --cream-deep: #f8eddf;
  --rose: #d75986;
  --rose-deep: #a83b67;
  --rose-soft: #f7dbe6;
  --lilac: #d9c1e5;
  --lilac-deep: #8a669d;
  --ink: #4d3541;
  --muted: #866e79;
  --white: #ffffff;
  --shadow: 0 14px 36px rgba(95, 57, 78, 0.11);
  --radius: 24px;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--cream);
}

body {
  min-width: 320px;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 3% 13%, rgba(217, 193, 229, 0.35), transparent 26rem),
    radial-gradient(circle at 97% 24%, rgba(247, 219, 230, 0.54), transparent 28rem),
    var(--cream);
  font-family: ui-rounded, "SF Pro Rounded", "Avenir Next", Avenir, system-ui, sans-serif;
  line-height: 1.45;
}

button,
input,
textarea {
  font: inherit;
}

button {
  color: inherit;
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(168, 59, 103, 0.25);
  outline-offset: 2px;
}

.page-shell {
  width: min(100% - 28px, 1080px);
  margin: 0 auto;
}

.site-header {
  position: relative;
  display: grid;
  overflow: hidden;
  min-height: 300px;
  place-items: center;
  padding: 54px 20px 44px;
  text-align: center;
}

.header-copy {
  position: relative;
  z-index: 1;
}

.eyebrow,
.section-kicker {
  margin: 0;
  color: var(--rose-deep);
  font-size: 0.77rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1 {
  margin: 12px 0 10px;
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(3.1rem, 13vw, 6.8rem);
  font-weight: 500;
  letter-spacing: -0.06em;
  line-height: 0.78;
}

h1 span {
  color: var(--rose-deep);
  font-style: italic;
  font-weight: 400;
}

.intro {
  margin: 22px 0 0;
  color: var(--muted);
  font-size: 1.02rem;
}

.floral {
  position: absolute;
  color: rgba(168, 59, 103, 0.18);
  font-family: Georgia, serif;
  font-size: clamp(5rem, 18vw, 10rem);
  line-height: 1;
  user-select: none;
}

.floral-left {
  top: 34px;
  left: -28px;
  transform: rotate(-18deg);
}

.floral-right {
  right: -22px;
  bottom: 18px;
  color: rgba(138, 102, 157, 0.17);
  transform: rotate(22deg) scale(0.8);
}

.toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 20px;
}

.sync-copy {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.button {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 0;
  border-radius: 999px;
  padding: 11px 18px;
  cursor: pointer;
  font-weight: 750;
  transition: transform 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button-primary {
  color: var(--white);
  background: var(--rose-deep);
  box-shadow: 0 8px 20px rgba(168, 59, 103, 0.2);
}

.button-primary:hover {
  background: #932e58;
}

.button-quiet {
  color: var(--ink);
  background: var(--cream-deep);
}

.button-danger {
  color: var(--white);
  background: #9f315a;
}

.category-grid {
  display: grid;
  gap: 16px;
}

.category-card {
  overflow: hidden;
  border: 1px solid rgba(168, 59, 103, 0.11);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.86);
  box-shadow: var(--shadow);
  transition: transform 180ms ease, opacity 180ms ease, box-shadow 180ms ease;
}

.category-card:nth-child(3n + 2) {
  border-color: rgba(138, 102, 157, 0.17);
  background: rgba(253, 249, 255, 0.9);
}

.category-card.is-new,
.entry.is-new {
  animation: arrive 330ms ease both;
}

.category-card.is-deleting,
.entry.is-deleting {
  opacity: 0;
  transform: scale(0.98) translateY(5px);
}

.category-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 20px 18px;
}

.category-toggle {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 12px;
  border: 0;
  padding: 0;
  text-align: left;
  background: transparent;
  cursor: pointer;
}

.category-symbol {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 15px;
  color: var(--rose-deep);
  background: var(--rose-soft);
  font-family: Georgia, serif;
  font-size: 1.25rem;
}

.category-card:nth-child(3n + 2) .category-symbol {
  color: var(--lilac-deep);
  background: #eee4f3;
}

.category-title {
  overflow: hidden;
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.25rem;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.category-count {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.category-chevron {
  margin-left: auto;
  color: var(--muted);
  transition: transform 220ms ease;
}

.category-card.is-open .category-chevron {
  transform: rotate(180deg);
}

.entry-actions {
  display: flex;
  align-items: center;
  gap: 2px;
}

.icon-button {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font-size: 1.15rem;
  transition: color 150ms ease, background 150ms ease;
}

.icon-button:hover {
  color: var(--rose-deep);
  background: var(--rose-soft);
}

.category-body {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  transition: grid-template-rows 240ms ease, opacity 180ms ease;
}

.category-card.is-open .category-body {
  grid-template-rows: 1fr;
  opacity: 1;
}

.category-body-inner {
  overflow: hidden;
}

.entry-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 2px 18px 8px;
  list-style: none;
}

.entry {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: start;
  border-radius: 18px;
  padding: 14px;
  background: var(--cream);
  transition: opacity 180ms ease, transform 180ms ease;
}

.entry-title {
  margin: 0;
  font-weight: 750;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.entry-note {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.entry-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 9px;
  color: var(--rose-deep);
  font-size: 0.86rem;
  font-weight: 750;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.empty-state {
  margin: 0 18px 10px;
  border: 1px dashed rgba(168, 59, 103, 0.22);
  border-radius: 18px;
  padding: 18px;
  color: var(--muted);
  text-align: center;
}

.add-entry-button {
  width: calc(100% - 36px);
  margin: 8px 18px 18px;
  color: var(--rose-deep);
  background: var(--rose-soft);
}

.status-banner {
  margin-bottom: 16px;
  border-radius: 16px;
  padding: 12px 15px;
  color: #7a324e;
  background: #fde4eb;
  font-size: 0.91rem;
}

footer {
  padding: 36px 8px 44px;
  color: var(--muted);
  text-align: center;
  font-size: 0.85rem;
}

.modal {
  width: min(calc(100% - 28px), 520px);
  border: 0;
  border-radius: 26px;
  padding: 0;
  color: var(--ink);
  background: var(--white);
  box-shadow: 0 24px 80px rgba(61, 35, 49, 0.28);
}

.modal::backdrop {
  background: rgba(63, 38, 50, 0.46);
  backdrop-filter: blur(3px);
}

.modal[open] {
  animation: modal-in 190ms ease both;
}

.modal form {
  padding: 22px;
}

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

.modal h2 {
  margin: 4px 0 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.75rem;
}

.modal label {
  display: block;
  margin: 16px 0 6px;
  font-size: 0.88rem;
  font-weight: 800;
}

.modal label span {
  color: var(--muted);
  font-weight: 500;
}

.modal input,
.modal textarea {
  width: 100%;
  border: 1px solid #e5d8de;
  border-radius: 15px;
  padding: 12px 13px;
  color: var(--ink);
  background: #fffcf8;
  resize: vertical;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 24px;
}

.confirm-copy {
  margin: 0;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.toast {
  position: fixed;
  z-index: 20;
  right: 16px;
  bottom: 18px;
  left: 16px;
  width: fit-content;
  max-width: calc(100% - 32px);
  margin: auto;
  border-radius: 999px;
  padding: 11px 17px;
  color: var(--white);
  background: var(--ink);
  box-shadow: var(--shadow);
  font-size: 0.9rem;
  font-weight: 700;
  animation: toast-in 180ms ease both;
}

@keyframes arrive {
  from { opacity: 0; transform: translateY(9px) scale(0.99); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes modal-in {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(7px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (min-width: 720px) {
  .page-shell {
    width: min(100% - 56px, 1080px);
  }

  .site-header {
    min-height: 380px;
    padding-top: 68px;
  }

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

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