:root {
  --cream: #fff8f5;
  --paper: #fffdfb;
  --paper-strong: #ffffff;
  --ink: #513944;
  --muted: #8c747d;
  --line: rgba(104, 72, 83, 0.12);
  --rose: #e8899d;
  --rose-dark: #a54f66;
  --rose-soft: #fbe3e8;
  --sage: #c9e2d6;
  --sage-dark: #527b69;
  --butter: #f7e4ae;
  --butter-dark: #8d7135;
  --lilac: #ddd1ed;
  --lilac-dark: #6f5a8c;
  --sky: #c6e4ec;
  --sky-dark: #527d87;
  --peach: #f5cfb9;
  --peach-dark: #97664b;
  --shadow: 0 20px 60px rgba(90, 51, 64, 0.09), 0 2px 10px rgba(90, 51, 64, 0.05);
  --shadow-small: 0 8px 24px rgba(90, 51, 64, 0.08);
  --radius-xl: 32px;
  --radius-lg: 24px;
  --radius-md: 18px;
  --font: ui-rounded, "Avenir Next", "Segoe UI", "Helvetica Neue", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  background: var(--cream);
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 9% 5%, rgba(251, 224, 229, 0.72), transparent 23rem),
    radial-gradient(circle at 92% 28%, rgba(206, 231, 220, 0.55), transparent 27rem),
    linear-gradient(180deg, #fffaf7 0%, #fff8f5 56%, #fdf7f3 100%);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.boot-screen {
  display: grid;
  min-height: 100vh;
  place-content: center;
  gap: 10px;
  color: var(--rose-dark);
  text-align: center;
}

.boot-screen p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.boot-heart {
  font-size: 42px;
  animation: boot-heart 1.2s ease-in-out infinite;
}

@keyframes boot-heart { 50% { transform: scale(1.14); } }

body:has(.modal-backdrop) {
  overflow: hidden;
}

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

button,
a,
input,
textarea,
select {
  -webkit-tap-highlight-color: transparent;
}

button,
a {
  touch-action: manipulation;
}

button {
  border: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 3px solid rgba(165, 79, 102, 0.28);
  outline-offset: 3px;
}

button:disabled {
  cursor: not-allowed;
  filter: grayscale(0.2);
  opacity: 0.52;
}

button:not(:disabled),
select {
  cursor: pointer;
}

::selection {
  color: var(--ink);
  background: var(--rose-soft);
}

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

.app-shell {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
}

.background-doodles {
  position: fixed;
  z-index: 0;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.background-doodles i {
  position: absolute;
  display: block;
  width: 9px;
  height: 9px;
  border: 2px solid rgba(215, 128, 148, 0.18);
  border-radius: 50%;
}

.background-doodles i::before,
.background-doodles i::after {
  position: absolute;
  display: block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(215, 128, 148, 0.13);
  content: "";
}

.background-doodles i::before { transform: translate(-16px, 20px); }
.background-doodles i::after { transform: translate(22px, 32px); }
.background-doodles i:nth-child(1) { top: 23%; left: 3%; }
.background-doodles i:nth-child(2) { top: 62%; right: 4%; border-color: rgba(94, 136, 118, 0.18); transform: scale(1.4); }
.background-doodles i:nth-child(2)::before,
.background-doodles i:nth-child(2)::after { background: rgba(94, 136, 118, 0.13); }
.background-doodles i:nth-child(3) { top: 86%; left: 8%; transform: scale(0.8); }

.site-header {
  position: relative;
  z-index: 20;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  width: min(1180px, calc(100% - 48px));
  min-height: 92px;
  margin: 0 auto;
}

.brand {
  display: flex;
  align-items: center;
  justify-self: start;
  gap: 12px;
  padding: 7px 8px 7px 4px;
  text-align: left;
  background: transparent;
  border-radius: 16px;
}

.brand-mark {
  position: relative;
  display: grid;
  width: 44px;
  height: 48px;
  place-items: center;
  color: #fff;
  filter: drop-shadow(0 6px 9px rgba(158, 75, 97, 0.18));
}

.brand-mark::before {
  position: absolute;
  width: 38px;
  height: 38px;
  background: linear-gradient(145deg, var(--rose), #d66b85);
  border-radius: 50% 50% 50% 8px;
  content: "";
  transform: rotate(-45deg);
}

.brand-mark::after {
  position: absolute;
  bottom: 0;
  width: 5px;
  height: 10px;
  border-radius: 10px;
  background: #c26078;
  content: "";
}

.brand-mark span {
  position: relative;
  z-index: 1;
  font-size: 16px;
  transform: translateY(-2px);
}

.brand-copy {
  display: grid;
  gap: 2px;
}

.brand-copy strong {
  color: #47313a;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.brand-copy small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}

.desktop-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 5px;
  border: 1px solid rgba(98, 65, 77, 0.08);
  border-radius: 999px;
  background: rgba(255, 253, 251, 0.75);
  box-shadow: 0 5px 20px rgba(84, 48, 60, 0.04);
  backdrop-filter: blur(16px);
}

.nav-button {
  display: flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 16px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  background: transparent;
  border-radius: 999px;
  transition: background 180ms ease, color 180ms ease, transform 180ms ease;
}

.nav-button:hover { color: var(--ink); }
.nav-button.is-active {
  color: var(--rose-dark);
  background: var(--rose-soft);
  box-shadow: inset 0 0 0 1px rgba(203, 103, 125, 0.07);
}

.nav-button.is-active span:first-child { transform: rotate(-8deg); }

.sync-pill {
  display: flex;
  min-height: 40px;
  align-items: center;
  justify-self: end;
  gap: 8px;
  padding: 0 13px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  background: rgba(255, 253, 251, 0.7);
  border: 1px solid rgba(98, 65, 77, 0.08);
  border-radius: 999px;
  backdrop-filter: blur(12px);
}

.sync-pill:hover { background: var(--paper); }

.sync-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border: 2px solid #fff;
  border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(78, 54, 63, 0.12);
}

.sync-dot--server { background: #70ae8f; }
.sync-dot--local { background: #e7b355; }
.sync-dot--offline { background: #d45f72; }
.sync-dot--loading {
  background: var(--rose);
  animation: sync-pulse 1.2s ease-in-out infinite;
}

@keyframes sync-pulse { 50% { opacity: 0.35; transform: scale(0.8); } }

.shared-warning {
  position: relative;
  z-index: 19;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 13px;
  width: min(1120px, calc(100% - 48px));
  margin: 4px auto -10px;
  padding: 13px 15px;
  color: #884654;
  background: rgba(255, 238, 239, 0.94);
  border: 1px solid rgba(175, 72, 93, 0.13);
  border-radius: 18px;
  box-shadow: var(--shadow-small);
  backdrop-filter: blur(14px);
}

.shared-warning__icon {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  color: #fff;
  font-size: 18px;
  font-weight: 900;
  background: #c85c72;
  border-radius: 50%;
}

.shared-warning > div {
  display: grid;
  gap: 3px;
}

.shared-warning strong { font-size: 12px; }
.shared-warning small { color: #9c6d76; font-size: 10px; line-height: 1.4; }
.shared-warning .secondary-button { min-height: 40px; padding: 0 15px; color: #8f4656; }

.site-main {
  position: relative;
  z-index: 2;
  width: min(1120px, calc(100% - 48px));
  margin: 0 auto;
  padding: 36px 0 88px;
}

.view {
  display: none;
  animation: view-in 360ms ease both;
}

.view.is-active { display: block; }

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

.hero-copy {
  width: min(680px, 100%);
  margin: 4px auto 34px;
  text-align: center;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 11px;
  color: var(--rose-dark);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.eyebrow span {
  font-size: 10px;
  animation: tiny-heart 2.6s ease-in-out infinite;
}

.eyebrow--small {
  margin-bottom: 5px;
  font-size: 9px;
  letter-spacing: 0.14em;
}

@keyframes tiny-heart { 50% { transform: scale(1.18); } }

.hero-copy h1,
.section-heading h1 {
  margin: 0;
  color: #443039;
  font-size: clamp(40px, 5.2vw, 68px);
  font-weight: 800;
  letter-spacing: -0.065em;
  line-height: 0.98;
}

.hero-copy h1 em {
  position: relative;
  color: var(--rose-dark);
  font-family: "Snell Roundhand", "Segoe Script", cursive;
  font-size: 0.96em;
  font-weight: 500;
  letter-spacing: -0.045em;
}

.hero-copy h1 em::after {
  position: absolute;
  right: 8%;
  bottom: -5px;
  left: 2%;
  height: 7px;
  background: linear-gradient(90deg, transparent, rgba(230, 137, 157, 0.22) 12%, rgba(230, 137, 157, 0.22) 88%, transparent);
  border-radius: 50%;
  content: "";
  transform: rotate(-1deg);
}

.hero-copy > p,
.section-heading p {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.6;
}

.paper-card {
  border: 1px solid rgba(102, 72, 82, 0.09);
  background: rgba(255, 253, 251, 0.88);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.wheel-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.07fr) minmax(340px, 0.83fr);
  align-items: stretch;
  gap: 24px;
}

.wheel-card {
  position: relative;
  display: grid;
  min-width: 0;
  align-content: center;
  justify-items: center;
  padding: clamp(28px, 4vw, 46px);
  border-radius: var(--radius-xl);
}

.tape {
  position: absolute;
  top: -12px;
  width: 68px;
  height: 28px;
  background: rgba(247, 223, 168, 0.62);
  box-shadow: 0 1px 1px rgba(113, 77, 42, 0.06);
  transform: rotate(-4deg);
}

.tape--left { left: 46px; }
.tape--right { right: 46px; transform: rotate(5deg); }

.wheel-stage {
  position: relative;
  width: min(100%, 460px);
  aspect-ratio: 1;
}

#place-wheel {
  display: block;
  width: 100%;
  height: 100%;
}

.wheel-pointer {
  position: absolute;
  z-index: 5;
  top: -4px;
  left: 50%;
  display: grid;
  width: 52px;
  height: 60px;
  place-items: center;
  color: #fff;
  filter: drop-shadow(0 5px 7px rgba(118, 52, 71, 0.2));
  transform: translateX(-50%);
}

.wheel-pointer::before {
  position: absolute;
  inset: 0 4px 12px;
  background: linear-gradient(145deg, #b85d74, #93445a);
  border: 4px solid #fffaf7;
  border-radius: 50% 50% 50% 8px;
  content: "";
  transform: rotate(45deg);
}

.wheel-pointer span {
  position: relative;
  z-index: 1;
  font-size: 14px;
  transform: translateY(-6px);
}

.wheel-center {
  position: absolute;
  z-index: 4;
  top: 50%;
  left: 50%;
  display: grid;
  width: 88px;
  height: 88px;
  place-content: center;
  color: var(--rose-dark);
  text-align: center;
  background: #fffaf7;
  border: 5px solid rgba(255, 255, 255, 0.84);
  border-radius: 50%;
  box-shadow: 0 5px 20px rgba(97, 49, 62, 0.12);
  transform: translate(-50%, -50%);
}

.wheel-center span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.wheel-center strong { font-size: 23px; line-height: 1; }

.wheel-action {
  display: grid;
  justify-items: center;
  gap: 12px;
  width: min(100%, 350px);
  margin-top: 20px;
}

.eligible-count {
  color: var(--sage-dark);
  font-size: 12px;
  font-weight: 800;
}

.eligible-count.is-empty { color: var(--muted); }

.primary-button,
.secondary-button {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 20px;
  font-size: 13px;
  font-weight: 800;
  border-radius: 999px;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.primary-button {
  color: #fff;
  background: linear-gradient(135deg, #bc637a, #9f4c63);
  box-shadow: 0 10px 22px rgba(157, 70, 94, 0.23), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.primary-button:not(:disabled):hover {
  box-shadow: 0 13px 26px rgba(157, 70, 94, 0.29), inset 0 1px 0 rgba(255, 255, 255, 0.25);
  transform: translateY(-2px);
}

.primary-button:not(:disabled):active,
.secondary-button:active { transform: translateY(1px) scale(0.99); }

.spin-button {
  width: 100%;
  min-height: 58px;
  font-size: 15px;
}

.spin-button span { font-size: 18px; }

.secondary-button {
  color: var(--ink);
  background: #fff;
  border: 1px solid rgba(97, 66, 77, 0.12);
  box-shadow: 0 5px 15px rgba(78, 48, 58, 0.05);
}

.secondary-button:hover { background: #fff9f7; transform: translateY(-1px); }
.secondary-button--warm { color: var(--rose-dark); background: var(--rose-soft); border-color: rgba(192, 94, 119, 0.11); }

.text-button,
.mini-link {
  min-height: 38px;
  padding: 0 5px;
  color: var(--rose-dark);
  font-size: 12px;
  font-weight: 800;
  background: transparent;
}

.text-button:hover,
.mini-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.text-button--danger,
.mini-link--danger { color: #aa5262; }

.icon-button {
  display: inline-grid;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  place-items: center;
  color: var(--muted);
  font-size: 18px;
  font-weight: 800;
  background: rgba(255, 255, 255, 0.76);
  border: 1px solid rgba(91, 63, 73, 0.09);
  border-radius: 50%;
  transition: background 160ms ease, color 160ms ease, transform 160ms ease;
}

.icon-button:hover { color: var(--rose-dark); background: var(--rose-soft); transform: rotate(4deg); }

.filter-card {
  min-width: 0;
  padding: 28px;
  border-radius: var(--radius-xl);
}

.card-heading,
.field-label-row,
.modal-header,
.section-heading,
.modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.card-heading { align-items: flex-start; }

.card-heading h2,
.timeline-heading h2,
.modal-header h2 {
  margin: 0;
  color: #47323a;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.035em;
}

.filter-group {
  margin-top: 25px;
}

.field-label,
.field > span,
.tag-fieldset legend {
  display: block;
  margin-bottom: 10px;
  color: #624b54;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.field-label-row .field-label { margin: 0; }

.choice-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.choice-pill {
  display: inline-flex;
  min-height: 39px;
  align-items: center;
  gap: 7px;
  padding: 0 13px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  background: #fff;
  border: 1px solid rgba(92, 62, 72, 0.1);
  border-radius: 999px;
  transition: all 160ms ease;
}

.choice-pill:hover { color: var(--ink); border-color: rgba(165, 79, 102, 0.22); }
.choice-pill.is-selected { color: var(--rose-dark); background: var(--rose-soft); border-color: rgba(182, 83, 109, 0.13); }

.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-cloud--empty {
  padding: 12px 0;
  color: var(--muted);
  font-size: 12px;
}

.tag-chip {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  gap: 6px;
  padding: 0 11px;
  font-size: 10px;
  font-weight: 800;
  border: 1px solid transparent;
  border-radius: 999px;
  transition: transform 150ms ease, box-shadow 150ms ease, border-color 150ms ease;
}

.tag-chip:hover { transform: translateY(-1px) rotate(-0.5deg); }
.tag-chip.is-selected { border-color: currentColor; box-shadow: 0 0 0 2px #fff, 0 0 0 3px currentColor; }
.tag-chip--rose { color: var(--rose-dark); background: var(--rose-soft); }
.tag-chip--sage { color: var(--sage-dark); background: #e5f1eb; }
.tag-chip--butter { color: var(--butter-dark); background: #fbf1d6; }
.tag-chip--lilac { color: var(--lilac-dark); background: #eee7f6; }
.tag-chip--sky { color: var(--sky-dark); background: #e2f1f5; }
.tag-chip--peach { color: var(--peach-dark); background: #fae8de; }
.tag-chip__remove { margin-left: 2px; font-size: 14px; line-height: 1; }

.filter-options {
  display: grid;
  gap: 15px;
  margin-top: 27px;
  padding-top: 22px;
  border-top: 1px dashed rgba(99, 68, 79, 0.14);
}

.segment-control {
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 4px;
  background: #f6efeb;
  border-radius: 12px;
}

.segment-control button {
  min-height: 35px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  background: transparent;
  border-radius: 9px;
}

.segment-control button.is-active {
  color: var(--ink);
  background: #fff;
  box-shadow: 0 3px 10px rgba(76, 49, 59, 0.06);
}

.switch-row {
  position: relative;
  display: flex;
  min-height: 48px;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  cursor: pointer;
}

.switch-row > span:first-child { display: grid; gap: 2px; }
.switch-row strong { font-size: 11px; }
.switch-row small { color: var(--muted); font-size: 10px; }
.switch-row input { position: absolute; opacity: 0; pointer-events: none; }

.switch {
  position: relative;
  width: 43px;
  height: 25px;
  flex: 0 0 auto;
  background: #ded4d1;
  border-radius: 999px;
  transition: background 180ms ease;
}

.switch::after {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 19px;
  height: 19px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 2px 5px rgba(68, 43, 52, 0.17);
  content: "";
  transition: transform 180ms ease;
}

.switch-row input:checked + .switch { background: var(--rose); }
.switch-row input:checked + .switch::after { transform: translateX(18px); }
.switch-row input:focus-visible + .switch { outline: 3px solid rgba(165, 79, 102, 0.25); outline-offset: 3px; }

.tiny-note {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-top: 22px;
  padding: 12px 14px;
  color: var(--sage-dark);
  background: rgba(221, 239, 231, 0.66);
  border: 1px solid rgba(84, 126, 108, 0.08);
  border-radius: 14px;
}

.tiny-note > span {
  display: grid;
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  place-items: center;
  background: #fff;
  border-radius: 50%;
}

.tiny-note p { margin: 0; font-size: 10px; line-height: 1.45; }

.section-heading {
  align-items: flex-end;
  margin: 16px 0 32px;
}

.section-heading h1 { font-size: clamp(42px, 5vw, 62px); }
.section-heading > .primary-button { flex: 0 0 auto; }

.list-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  margin-bottom: 22px;
  padding: 12px;
  border-radius: 20px;
}

.search-box,
.sort-box {
  display: flex;
  min-height: 48px;
  align-items: center;
  gap: 10px;
  padding: 0 15px;
  background: #fff;
  border: 1px solid rgba(91, 62, 72, 0.09);
  border-radius: 14px;
}

.search-box > span:first-child { color: var(--rose-dark); font-size: 20px; }

.search-box input,
.sort-box select {
  width: 100%;
  height: 100%;
  padding: 0;
  background: transparent;
  border: 0;
  outline: 0;
}

.search-box input { min-width: 0; font-size: 13px; }
.search-box input::placeholder { color: #ae9da4; }

.sort-box { min-width: 195px; }
.sort-box > span { color: var(--muted); font-size: 10px; font-weight: 800; }
.sort-box select { color: var(--ink); font-size: 12px; font-weight: 800; }

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

.place-card {
  display: grid;
  align-content: start;
  gap: 16px;
  min-width: 0;
  padding: 22px;
  border-radius: var(--radius-lg);
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.place-card:hover { transform: translateY(-3px); box-shadow: 0 25px 60px rgba(90, 51, 64, 0.12); }

.place-card__top {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
}

.place-pin {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  color: var(--rose-dark);
  font-size: 19px;
  background: var(--rose-soft);
  border-radius: 14px 14px 14px 5px;
  transform: rotate(-2deg);
}

.place-card__title { min-width: 0; }
.place-card__title h2 {
  overflow: hidden;
  margin: 0;
  color: #47323a;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.025em;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.place-card__title p { overflow: hidden; margin: 4px 0 0; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }

.favorite-button {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  color: #d8cbce;
  font-size: 21px;
  background: transparent;
  border-radius: 50%;
  transition: color 150ms ease, transform 150ms ease, background 150ms ease;
}

.favorite-button:hover { color: #cf9a38; background: #fff6dc; transform: scale(1.08) rotate(5deg); }
.favorite-button.is-favorite { color: #d7a13e; text-shadow: 0 3px 8px rgba(177, 119, 25, 0.18); }

.place-card__tags { display: flex; flex-wrap: wrap; gap: 6px; }
.place-card__tags .tag-chip { min-height: 29px; padding: 0 9px; font-size: 9px; }

.place-note {
  margin: 0;
  padding: 12px 14px;
  color: #755964;
  font-family: "Segoe Print", "Bradley Hand", cursive;
  font-size: 11px;
  line-height: 1.55;
  background: #fff7e7;
  border-radius: 4px 14px 14px 14px;
  transform: rotate(-0.35deg);
}

.place-card__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 13px;
  border-top: 1px dashed rgba(96, 66, 76, 0.13);
}

.place-card__meta > div:first-child {
  display: flex;
  align-items: center;
  gap: 8px;
}

.place-card__meta > div:first-child > span:last-child { display: grid; gap: 1px; font-size: 10px; }
.place-card__meta small { color: var(--muted); font-size: 8px; }

.meta-icon {
  display: grid;
  width: 29px;
  height: 29px;
  place-items: center;
  color: var(--sage-dark);
  background: #e7f2ed;
  border-radius: 50%;
}

.rating { display: flex; gap: 1px; }
.rating button {
  width: 23px;
  height: 30px;
  padding: 0;
  color: #ddd1d4;
  font-size: 16px;
  background: transparent;
  transition: color 130ms ease, transform 130ms ease;
}
.rating button:hover { color: #e79aac; transform: translateY(-2px); }
.rating button.is-active { color: var(--rose); }

.place-card__actions {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 8px;
}
.place-card__actions .secondary-button { min-height: 42px; padding: 0 12px; font-size: 11px; }
.place-card__actions .icon-button { width: 42px; height: 42px; font-size: 15px; }

.empty-state,
.search-empty {
  display: grid;
  justify-items: center;
  width: min(620px, 100%);
  margin: 28px auto;
  padding: 58px 28px;
  text-align: center;
  border-radius: var(--radius-xl);
}

.empty-state h2,
.search-empty strong {
  margin: 3px 0 10px;
  color: #47323a;
  font-size: 27px;
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.12;
}

.empty-state p {
  max-width: 440px;
  margin: 0 0 22px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.empty-doodle {
  position: relative;
  display: grid;
  width: 84px;
  height: 84px;
  margin-bottom: 13px;
  place-items: center;
  color: var(--rose-dark);
  font-size: 23px;
  background: var(--rose-soft);
  border-radius: 50% 50% 45% 55%;
  transform: rotate(-4deg);
}

.empty-doodle::before,
.empty-doodle::after,
.empty-doodle i {
  position: absolute;
  width: 7px;
  height: 7px;
  background: var(--butter);
  border-radius: 50%;
  content: "";
}
.empty-doodle::before { top: -8px; right: 4px; }
.empty-doodle::after { right: -13px; bottom: 14px; }
.empty-doodle i { bottom: -7px; left: 2px; }

.search-empty { box-shadow: none; }
.search-empty > span { color: var(--rose); font-size: 36px; }
.search-empty small { color: var(--muted); font-size: 11px; }
.search-empty[hidden] { display: none; }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 15px;
  margin-bottom: 22px;
}

.stat-card {
  position: relative;
  display: grid;
  min-height: 132px;
  align-content: center;
  justify-items: center;
  overflow: hidden;
  border-radius: var(--radius-lg);
}

.stat-card > span {
  position: absolute;
  top: 15px;
  right: 17px;
  font-size: 18px;
  opacity: 0.55;
  transform: rotate(8deg);
}

.stat-card strong { color: #463139; font-size: 36px; letter-spacing: -0.05em; }
.stat-card small { color: var(--muted); font-size: 10px; font-weight: 800; }
.stat-card--rose { background: rgba(252, 232, 236, 0.88); }
.stat-card--sage { background: rgba(228, 242, 235, 0.9); }
.stat-card--butter { background: rgba(252, 243, 217, 0.9); }
.stat-card--lilac { background: rgba(240, 234, 247, 0.9); }

.timeline {
  padding: 28px;
  border-radius: var(--radius-xl);
}

.timeline-heading { margin-bottom: 12px; }

.timeline-item {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 17px 0;
  border-bottom: 1px dashed rgba(96, 66, 76, 0.13);
}

.timeline-item:last-child { border-bottom: 0; }
.timeline-item::before {
  position: absolute;
  top: 52px;
  bottom: -17px;
  left: 19px;
  width: 1px;
  background: rgba(157, 95, 113, 0.13);
  content: "";
}
.timeline-item:last-child::before { display: none; }

.timeline-icon {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  color: var(--rose-dark);
  background: var(--rose-soft);
  border-radius: 50%;
}
.timeline-icon--visit { color: var(--sage-dark); background: #e4f1ea; }
.timeline-copy { min-width: 0; }
.timeline-copy small { color: var(--muted); font-size: 9px; }
.timeline-copy p { margin: 4px 0 0; font-size: 12px; line-height: 1.45; }
.timeline-item > a { display: grid; width: 36px; height: 36px; place-items: center; color: var(--rose-dark); background: #fff; border: 1px solid var(--line); border-radius: 50%; }

.empty-state--compact { margin-top: 20px; padding: 46px 24px; }
.empty-state--compact h2 { font-size: 24px; }

.bottom-nav { display: none; }

.modal-backdrop {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  align-items: end;
  justify-items: center;
  padding: 30px;
  background: rgba(67, 43, 52, 0.34);
  backdrop-filter: blur(9px);
  animation: backdrop-in 180ms ease both;
}

@keyframes backdrop-in { from { opacity: 0; } }

.modal-sheet {
  width: min(780px, 100%);
  max-height: min(90vh, 900px);
  overflow: auto;
  padding: 28px;
  background: var(--paper);
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 30px;
  box-shadow: 0 35px 100px rgba(69, 38, 49, 0.28);
  animation: sheet-in 320ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
  overscroll-behavior: contain;
}

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

.modal-handle { display: none; }
.modal-header { align-items: flex-start; margin-bottom: 24px; }
.modal-header h2 { font-size: 27px; }

.place-form,
.settings-form { display: grid; gap: 22px; }

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
}

.field {
  display: grid;
  gap: 0;
}

.field--wide { grid-column: 1 / -1; }
.field > span { margin-bottom: 8px; }

.field input,
.field textarea,
.new-tag-row input {
  width: 100%;
  border: 1px solid rgba(96, 65, 76, 0.13);
  background: #fff;
  border-radius: 14px;
  box-shadow: inset 0 1px 1px rgba(78, 49, 59, 0.03);
  outline: 0;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.field input { min-height: 49px; padding: 0 14px; font-size: 12px; }
.field textarea { min-height: 88px; padding: 13px 14px; font-size: 12px; line-height: 1.5; resize: vertical; }
.field input:focus,
.field textarea:focus,
.new-tag-row input:focus { border-color: rgba(177, 83, 108, 0.4); box-shadow: 0 0 0 4px rgba(232, 137, 157, 0.1); }
.field input::placeholder,
.field textarea::placeholder,
.new-tag-row input::placeholder { color: #b5a5aa; }

.maps-preview {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 13px 15px;
  color: var(--sage-dark);
  background: #eaf4ef;
  border: 1px solid rgba(80, 124, 105, 0.08);
  border-radius: 15px;
}
.maps-preview > span:first-child { display: grid; width: 35px; height: 35px; place-items: center; background: #fff; border-radius: 50%; }
.maps-preview > span:nth-child(2) { display: grid; gap: 2px; min-width: 0; }
.maps-preview strong { font-size: 11px; }
.maps-preview small { overflow: hidden; color: #739181; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.maps-preview b { font-size: 17px; }

.tag-fieldset {
  min-width: 0;
  margin: 0;
  padding: 18px;
  border: 1px dashed rgba(98, 66, 77, 0.17);
  border-radius: 18px;
}
.tag-fieldset legend { padding: 0 8px; margin-left: -8px; }
.tag-fieldset legend small { margin-left: 5px; color: var(--muted); font-size: 9px; font-weight: 600; }

.new-tag-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 9px;
  margin-top: 15px;
}
.new-tag-row input { min-height: 44px; padding: 0 13px; font-size: 11px; }
.new-tag-row .secondary-button { min-height: 44px; }

.form-note {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  padding: 12px 14px;
  background: #f6efeb;
  border-radius: 14px;
}
.form-note > span { display: grid; width: 30px; height: 30px; place-items: center; color: var(--sage-dark); background: #fff; border-radius: 50%; }
.form-note p { margin: 0; font-size: 10px; line-height: 1.4; }

.modal-footer {
  padding-top: 19px;
  border-top: 1px solid var(--line);
}
.modal-footer > div { display: flex; gap: 9px; }
.modal-footer--end { justify-content: flex-end; }

.settings-section {
  padding-bottom: 21px;
  border-bottom: 1px dashed rgba(95, 65, 76, 0.14);
}
.settings-section h3 { margin: 0 0 15px; font-size: 14px; }
.settings-help { margin: -5px 0 14px; color: var(--muted); font-size: 11px; line-height: 1.5; }

.tag-manager { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.tag-manager > div {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  padding: 9px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
}
.tag-manager > div > span:nth-child(2) { display: grid; min-width: 0; }
.tag-manager strong { overflow: hidden; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.tag-manager small { color: var(--muted); font-size: 8px; }
.tag-manager .icon-button { width: 32px; height: 32px; font-size: 14px; }

.tag-dot { display: grid; width: 32px; height: 32px; place-items: center; border-radius: 10px; }
.tag-dot--rose { color: var(--rose-dark); background: var(--rose-soft); }
.tag-dot--sage { color: var(--sage-dark); background: #e5f1eb; }
.tag-dot--butter { color: var(--butter-dark); background: #fbf1d6; }
.tag-dot--lilac { color: var(--lilac-dark); background: #eee7f6; }
.tag-dot--sky { color: var(--sky-dark); background: #e2f1f5; }
.tag-dot--peach { color: var(--peach-dark); background: #fae8de; }

.backup-actions { display: flex; flex-wrap: wrap; gap: 9px; }
.file-button { position: relative; overflow: hidden; cursor: pointer; }
.file-button input { position: absolute; width: 1px; height: 1px; opacity: 0; }

.danger-zone {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  padding: 14px 16px;
  background: #fff1f1;
  border: 1px solid rgba(170, 82, 98, 0.1);
  border-radius: 15px;
}
.danger-zone > div { display: grid; gap: 2px; }
.danger-zone strong { color: #97505c; font-size: 11px; }
.danger-zone small { color: #a57e85; font-size: 9px; }

.modal-backdrop--result {
  align-items: center;
  background: rgba(67, 43, 52, 0.42);
}

.result-card {
  position: relative;
  display: grid;
  width: min(470px, 100%);
  max-height: 90vh;
  justify-items: center;
  overflow: auto;
  padding: 42px 36px 31px;
  text-align: center;
  background:
    radial-gradient(circle at 50% 0, rgba(251, 225, 231, 0.8), transparent 16rem),
    #fffdfb;
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 34px;
  box-shadow: 0 35px 100px rgba(64, 35, 46, 0.32);
  animation: result-in 520ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes result-in {
  from { opacity: 0; transform: scale(0.78) rotate(-2deg); }
  to { opacity: 1; transform: scale(1) rotate(0); }
}

.result-close { position: absolute; top: 16px; right: 16px; }
.result-kicker { color: var(--rose-dark); font-size: 10px; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; }
.result-pin {
  position: relative;
  display: grid;
  width: 74px;
  height: 81px;
  margin: 14px 0 8px;
  place-items: center;
  color: #fff;
}
.result-pin::before {
  position: absolute;
  inset: 4px 6px 16px;
  background: linear-gradient(145deg, var(--rose), #b65770);
  border-radius: 50% 50% 50% 10px;
  box-shadow: 0 10px 25px rgba(166, 75, 99, 0.22);
  content: "";
  transform: rotate(-45deg);
}
.result-pin::after { position: absolute; bottom: 5px; width: 6px; height: 16px; background: #b65770; border-radius: 10px; content: ""; }
.result-pin span { position: relative; z-index: 1; font-size: 20px; transform: translateY(-6px); }
.result-card h2 { max-width: 100%; margin: 0; color: #453039; font-size: 34px; font-weight: 800; letter-spacing: -0.05em; line-height: 1.06; overflow-wrap: anywhere; }
.result-card > p { margin: 8px 0 0; color: var(--muted); font-size: 12px; }
.result-tags { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 16px; }
.result-tags .tag-chip { cursor: default; }
.result-card blockquote { width: 100%; margin: 18px 0 0; padding: 12px; color: #765963; font-family: "Segoe Print", "Bradley Hand", cursive; font-size: 11px; background: #fff6df; border-radius: 4px 14px 14px; }
.result-actions { display: grid; width: 100%; gap: 9px; margin: 22px 0 9px; }
.result-note { max-width: 330px; margin-top: 15px; color: #af959f; font-family: "Segoe Print", "Bradley Hand", cursive; font-size: 9px; line-height: 1.5; }

.floating-heart { position: absolute; color: var(--rose); font-size: 18px; opacity: 0; animation: float-heart 2.4s ease-out 0.25s both; }
.heart-one { top: 24%; left: 8%; }
.heart-two { top: 16%; right: 12%; animation-delay: 0.4s; }
.heart-three { top: 41%; right: 8%; color: #c8b04f; animation-delay: 0.6s; }
@keyframes float-heart {
  0% { opacity: 0; transform: translateY(12px) scale(0.5) rotate(-10deg); }
  25% { opacity: 0.8; }
  100% { opacity: 0; transform: translateY(-42px) scale(1.2) rotate(12deg); }
}

.toast {
  position: fixed;
  z-index: 200;
  bottom: 24px;
  left: 50%;
  max-width: min(420px, calc(100% - 32px));
  padding: 12px 17px;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  text-align: center;
  background: rgba(68, 47, 56, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  box-shadow: 0 15px 35px rgba(49, 29, 37, 0.25);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 18px);
  transition: opacity 180ms ease, transform 180ms ease;
}
.toast--visible { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 900px) {
  .site-header { grid-template-columns: 1fr auto; }
  .desktop-nav { display: none; }
  .wheel-layout { grid-template-columns: 1fr; }
  .wheel-card { order: 1; }
  .filter-card { order: 2; }
  .place-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .bottom-nav {
    position: fixed;
    z-index: 60;
    right: 16px;
    bottom: max(14px, env(safe-area-inset-bottom));
    left: 16px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 3px;
    padding: 6px;
    background: rgba(255, 253, 251, 0.88);
    border: 1px solid rgba(94, 63, 74, 0.09);
    border-radius: 20px;
    box-shadow: 0 15px 45px rgba(75, 46, 57, 0.18);
    backdrop-filter: blur(20px);
  }
  .bottom-nav .nav-button { display: grid; min-height: 48px; gap: 2px; padding: 5px; font-size: 9px; border-radius: 15px; }
  .bottom-nav .nav-button span:first-child { font-size: 17px; }
  .site-main { padding-bottom: 112px; }
  .toast { bottom: 88px; }
}

@media (max-width: 620px) {
  .site-header {
    width: calc(100% - 28px);
    min-height: 78px;
  }
  .brand { gap: 8px; padding-left: 0; }
  .brand-mark { width: 39px; height: 43px; transform: scale(0.9); transform-origin: left center; }
  .brand-copy strong { max-width: 155px; overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
  .brand-copy small { display: none; }
  .sync-pill { min-height: 36px; padding: 0 10px; }
  .sync-pill span:last-child { max-width: 92px; overflow: hidden; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
  .site-main { width: calc(100% - 28px); padding-top: 27px; }
  .shared-warning {
    grid-template-columns: auto minmax(0, 1fr);
    width: calc(100% - 28px);
    margin: 2px auto 0;
  }
  .shared-warning .secondary-button { grid-column: 1 / -1; width: 100%; }
  .hero-copy { margin-bottom: 25px; }
  .hero-copy h1 { font-size: clamp(39px, 13vw, 54px); }
  .hero-copy > p { max-width: 280px; margin: 15px auto 0; font-size: 13px; }
  .wheel-card { padding: 27px 15px 25px; border-radius: 26px; }
  .wheel-stage { width: min(100%, 390px); }
  .wheel-center { width: 71px; height: 71px; border-width: 4px; }
  .wheel-center strong { font-size: 18px; }
  .wheel-pointer { width: 46px; height: 53px; }
  .wheel-action { width: min(100%, 320px); margin-top: 15px; }
  .filter-card { padding: 23px 18px; border-radius: 26px; }
  .choice-grid,
  .tag-cloud { flex-wrap: nowrap; overflow-x: auto; margin-right: -18px; padding: 3px 18px 8px 1px; scroll-snap-type: x proximity; scrollbar-width: none; }
  .choice-grid::-webkit-scrollbar,
  .tag-cloud::-webkit-scrollbar { display: none; }
  .choice-pill,
  .tag-chip { flex: 0 0 auto; scroll-snap-align: start; }
  .section-heading { display: grid; align-items: start; margin-top: 5px; }
  .section-heading h1 { font-size: 45px; }
  .section-heading p { margin-top: 12px; font-size: 13px; }
  .section-heading > .primary-button { width: 100%; }
  .list-toolbar { grid-template-columns: 1fr; padding: 9px; }
  .sort-box { min-width: 0; }
  .place-card { padding: 18px; border-radius: 22px; }
  .place-card:hover { transform: none; }
  .place-card__meta { align-items: flex-start; }
  .rating button { width: 21px; }
  .place-card__actions { grid-template-columns: 1fr 1fr auto; }
  .stats-grid { gap: 10px; }
  .stat-card { min-height: 105px; }
  .stat-card strong { font-size: 30px; }
  .timeline { padding: 20px 17px; }
  .timeline-item { gap: 10px; }
  .timeline-copy p { font-size: 11px; }
  .modal-backdrop { padding: 0; }
  .modal-sheet {
    width: 100%;
    max-height: 92vh;
    padding: 20px 18px calc(24px + env(safe-area-inset-bottom));
    border-radius: 28px 28px 0 0;
    animation-name: mobile-sheet-in;
  }
  @keyframes mobile-sheet-in { from { opacity: 0.6; transform: translateY(100%); } to { opacity: 1; transform: translateY(0); } }
  .modal-handle { display: block; width: 42px; height: 4px; margin: -7px auto 16px; background: #ddd1ce; border-radius: 999px; }
  .modal-header { margin-bottom: 20px; }
  .modal-header h2 { font-size: 24px; }
  .form-grid { grid-template-columns: 1fr; }
  .field--wide { grid-column: auto; }
  .maps-preview small { max-width: 220px; }
  .tag-fieldset .tag-cloud { flex-wrap: wrap; overflow: visible; margin: 0; padding: 0; }
  .new-tag-row { grid-template-columns: 1fr; }
  .modal-footer { align-items: stretch; }
  .modal-footer > div { flex: 1; }
  .modal-footer > div .secondary-button { display: none; }
  .modal-footer > div .primary-button { width: 100%; }
  .form-note { grid-template-columns: auto 1fr; }
  .form-note .mini-link { grid-column: 1 / -1; justify-self: start; }
  .tag-manager { grid-template-columns: 1fr; }
  .backup-actions { display: grid; }
  .danger-zone { align-items: flex-start; flex-direction: column; }
  .modal-backdrop--result { padding: 14px; }
  .result-card { max-height: calc(100vh - 28px); padding: 38px 22px 25px; border-radius: 28px; }
  .result-card h2 { font-size: 31px; }
}

@media (max-width: 390px) {
  .brand-copy strong { max-width: 125px; }
  .sync-pill span:last-child { max-width: 72px; }
  .place-card__actions .secondary-button { padding: 0 8px; font-size: 10px; }
  .place-card__meta { flex-direction: column; }
  .rating button { width: 28px; }
}

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

@media print {
  .site-header,
  .bottom-nav,
  .filter-card,
  .place-card__actions,
  .list-toolbar { display: none !important; }
  body { background: #fff; }
  .site-main { width: 100%; padding: 0; }
  .view { display: none !important; }
  [data-view-panel="places"] { display: block !important; }
  .place-grid { grid-template-columns: repeat(2, 1fr); }
  .paper-card { box-shadow: none; backdrop-filter: none; }
}
