:root {
  --bg: #f7eaec;
  --paper: #fdf6f7;
  --ink: #26392d;
  --ink-soft: #5b6d60;
  --sage: #5f8268;
  --sage-pale: #dce8dc;
  --rose: #b0476a;
  --rose-soft: #e7a9b9;
  --rose-pale: #f4d6dd;
  --line: #e7cdd3;
  --busy: #9a4a3c;
  --focus: #b0476a;
  --display: 'Prata', Georgia, serif;
  --body: 'Manrope', system-ui, sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --bg: #18221c;
    --paper: #202d25;
    --ink: #f4e6e9;
    --ink-soft: #b7c6ba;
    --sage: #93b59b;
    --sage-pale: #2a3d31;
    --rose: #f0a0b6;
    --rose-soft: #9c5569;
    --rose-pale: #4a2d38;
    --line: #37483c;
    --busy: #e39c8e;
    --focus: #f0a0b6;
    color-scheme: dark;
  }
}

:root[data-theme='dark'] {
  --bg: #18221c;
  --paper: #202d25;
  --ink: #f4e6e9;
  --ink-soft: #b7c6ba;
  --sage: #93b59b;
  --sage-pale: #2a3d31;
  --rose: #f0a0b6;
  --rose-soft: #9c5569;
  --rose-pale: #4a2d38;
  --line: #37483c;
  --busy: #e39c8e;
  --focus: #f0a0b6;
  color-scheme: dark;
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 16px/1.55 var(--body);
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3 {
  font-family: var(--display);
  font-weight: 400;
  line-height: 1.15;
  margin: 0;
}

a {
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
  border-radius: 6px;
}

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

input[type='text'],
input[type='password'],
input[type='search'],
input[type='tel'],
input[type='url'],
input[type='number'],
input[type='date'],
textarea {
  width: 100%;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
  transition: border-color 0.15s;
}

input:focus,
textarea:focus {
  outline: none;
  border-color: var(--sage);
}

textarea {
  resize: vertical;
}

.hero {
  position: relative;
  overflow: hidden;
  background: var(--sage-pale);
  padding: 40px 16px 44px;
}

.hero-inner {
  position: relative;
  max-width: 880px;
  margin: 0 auto;
}

.hero-names {
  margin: 0 0 6px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--sage);
}

.hero-date {
  font-size: clamp(44px, 11vw, 104px);
  letter-spacing: -0.01em;
}

.hero-date span {
  display: block;
  font-size: 0.42em;
  letter-spacing: 0.3em;
  color: var(--ink-soft);
  margin-top: 6px;
}

.hero-countdown {
  margin: 18px 0 0;
  display: inline-block;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--rose-pale);
  font-weight: 600;
  font-size: 15px;
}

.hero-branch {
  position: absolute;
  right: max(-40px, calc(50% - 560px));
  bottom: -14px;
  width: clamp(160px, 34vw, 280px);
  height: auto;
  animation: sway 1.4s cubic-bezier(0.2, 0.7, 0.2, 1) both;
  transform-origin: 8% 96%;
}

.hero-branch .stem {
  fill: none;
  stroke: var(--sage);
  stroke-width: 3;
  stroke-linecap: round;
}

.hero-branch .leaf {
  fill: var(--sage);
  opacity: 0.85;
}

.hero-branch .leaf-alt {
  opacity: 0.55;
}

.hero-branch .bloom {
  fill: var(--rose-soft);
}

.hero-branch .bloom-core {
  fill: var(--rose);
}

@keyframes sway {
  from {
    transform: rotate(-9deg);
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-branch {
    animation: none;
  }
}

.app {
  max-width: 880px;
  margin: 0 auto;
  padding: 0 16px 80px;
}

.tabs {
  display: flex;
  gap: 4px;
  margin: -22px 0 28px;
  padding: 5px;
  background: var(--paper);
  border-radius: 999px;
  border: 1px solid var(--line);
  position: relative;
  overflow-x: auto;
  scrollbar-width: none;
}

.tab {
  flex: 0 0 auto;
  padding: 9px 16px;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 600;
  font-size: 15px;
  border: 0;
  background: none;
  cursor: pointer;
}

.tab[aria-current='page'] {
  background: var(--ink);
  color: var(--paper);
}

.tab-quiet {
  margin-left: auto;
  color: var(--ink-soft);
  font-weight: 500;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 11px 20px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--paper);
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}

.button-primary {
  background: var(--rose);
  border-color: var(--rose);
  color: var(--paper);
}

.button-primary:hover {
  filter: brightness(1.06);
}

.button-small {
  padding: 8px 14px;
  font-size: 14px;
}

.button-danger {
  justify-self: start;
  margin-top: 36px;
  color: var(--busy);
  border-color: currentColor;
  background: none;
}

.login {
  max-width: 380px;
  margin: 48px auto 0;
  display: grid;
  gap: 10px;
}

.login-title {
  font-size: 30px;
  margin-bottom: 14px;
}

.login label {
  font-weight: 600;
  font-size: 14px;
}

.form-error {
  margin: 0;
  min-height: 1.5em;
  color: var(--busy);
  font-size: 14px;
}

.add-form {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
}

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

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: none;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}

.chip[aria-pressed='true'] {
  background: var(--sage);
  border-color: var(--sage);
  color: var(--paper);
}

.chip-count {
  font-size: 12px;
  opacity: 0.7;
}

.venues {
  list-style: none;
  margin: 0;
  padding: 0;
  background: var(--paper);
  border-radius: 18px;
  border: 1px solid var(--line);
}

.venues li + li {
  border-top: 1px solid var(--line);
}

.venue {
  display: grid;
  gap: 6px;
  padding: 18px 20px;
  text-decoration: none;
  transition: background 0.15s;
}

.venue:hover {
  background: color-mix(in srgb, var(--rose-pale) 35%, transparent);
}

.venue-muted {
  opacity: 0.55;
}

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

.venue-name {
  font-family: var(--display);
  font-size: 22px;
  line-height: 1.2;
}

.venue-address {
  color: var(--ink-soft);
  font-size: 14px;
}

.venue-facts {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 14px;
  font-size: 14px;
}

.pill,
.date-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

.status-planned {
  background: var(--sage-pale);
}
.status-called {
  background: var(--rose-pale);
}
.status-visit {
  background: color-mix(in srgb, var(--sage) 30%, var(--paper));
}
.status-visited {
  background: color-mix(in srgb, var(--rose-soft) 55%, var(--paper));
}
.status-favorite {
  background: var(--rose);
  color: var(--paper);
}
.status-booked {
  background: var(--ink);
  color: var(--paper);
}
.status-rejected {
  background: none;
  border: 1px solid var(--line);
  color: var(--ink-soft);
}

.date-badge {
  padding-left: 0;
  font-weight: 600;
}
.date-unknown {
  color: var(--ink-soft);
}
.date-free {
  color: var(--sage);
}
.date-busy {
  color: var(--busy);
}

.hearts {
  color: var(--rose);
  letter-spacing: 2px;
}

.progress {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--ink-soft);
}

.progress-track {
  flex: 1;
  max-width: 220px;
  height: 5px;
  border-radius: 99px;
  background: var(--sage-pale);
  overflow: hidden;
}

.progress-fill {
  display: block;
  height: 100%;
  width: calc(var(--value, 0) * 100%);
  background: var(--sage);
  border-radius: inherit;
  transition: width 0.3s ease;
}

.empty {
  padding: 48px 20px;
  text-align: center;
  background: var(--paper);
  border: 1px dashed var(--rose-soft);
  border-radius: 18px;
  color: var(--ink-soft);
}

.empty p {
  margin: 0 0 10px;
  font-family: var(--display);
  font-size: 22px;
  color: var(--ink);
}

.editor {
  display: grid;
  gap: 22px;
}

.editor-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 10px 0;
  background: var(--bg);
}

.back {
  font-weight: 600;
  text-decoration: none;
}

.back::before {
  content: '‹ ';
}

.save-state {
  margin: 0;
  font-size: 13px;
  color: var(--ink-soft);
  text-align: right;
}

.save-state[data-state='saved'] {
  color: var(--sage);
}

.save-state[data-state='error'] {
  color: var(--busy);
  font-weight: 600;
}

input.editor-name {
  font-family: var(--display);
  font-size: clamp(28px, 6vw, 40px);
  padding: 4px 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: none;
}

.radio-group,
.rating,
.question-group {
  border: 0;
  margin: 0;
  padding: 0;
  min-width: 0;
}

.radio-group legend,
.rating legend,
.field-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-soft);
  margin-bottom: 8px;
  padding: 0;
}

.radio-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.radio-chip {
  position: relative;
  cursor: pointer;
}

.radio-chip input {
  position: absolute;
  opacity: 0;
  inset: 0;
  margin: 0;
  cursor: pointer;
}

.radio-chip span {
  display: inline-block;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-size: 14px;
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
}

.radio-chip input:focus-visible + span {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.radio-chip input:checked + span {
  border-color: transparent;
  font-weight: 600;
}

.status-planned input:checked + span,
.date-unknown input:checked + span {
  background: var(--sage-pale);
  color: var(--ink);
}
.status-called input:checked + span {
  background: var(--rose-pale);
}
.status-visit input:checked + span {
  background: color-mix(in srgb, var(--sage) 30%, var(--paper));
}
.status-visited input:checked + span {
  background: color-mix(in srgb, var(--rose-soft) 55%, var(--paper));
}
.status-favorite input:checked + span {
  background: var(--rose);
  color: var(--paper);
}
.status-booked input:checked + span {
  background: var(--ink);
  color: var(--paper);
}
.status-rejected input:checked + span {
  background: var(--line);
}
.date-free input:checked + span {
  background: var(--sage);
  color: var(--paper);
}
.date-busy input:checked + span {
  background: var(--busy);
  color: var(--paper);
}

.radio-chip.status-planned,
.radio-chip.status-called,
.radio-chip.status-visit,
.radio-chip.status-visited,
.radio-chip.status-favorite,
.radio-chip.status-booked,
.radio-chip.status-rejected,
.radio-chip.date-unknown,
.radio-chip.date-free,
.radio-chip.date-busy {
  background: none;
  border: 0;
  padding: 0;
  color: inherit;
}

.fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  padding: 20px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 18px;
}

.field {
  display: block;
  min-width: 0;
}

.field-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.field-suffix {
  color: var(--ink-soft);
  font-size: 14px;
  white-space: nowrap;
}

.rating {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
}

.rating legend {
  width: 100%;
}

.rating-heart {
  border: 0;
  background: none;
  padding: 2px 4px;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  color: var(--line);
  transition: color 0.15s, transform 0.15s;
}

.rating-heart[aria-pressed='true'] {
  color: var(--rose);
}

.rating-heart:active {
  transform: scale(0.88);
}

.questions {
  display: grid;
  gap: 24px;
}

.questions-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 8px 16px;
}

.questions-head h2 {
  font-size: 28px;
}

.questions-total {
  flex: 1;
  max-width: 320px;
}

.question-group legend {
  font-family: var(--display);
  font-size: 20px;
  padding: 0;
  margin-bottom: 10px;
}

.question {
  display: grid;
  gap: 8px;
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--paper);
  border: 1px solid var(--line);
  margin-bottom: 8px;
  transition: border-color 0.2s, background 0.2s;
}

.question[data-done='true'] {
  border-color: color-mix(in srgb, var(--sage) 45%, var(--line));
  background: color-mix(in srgb, var(--sage-pale) 45%, var(--paper));
}

.question-check {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  cursor: pointer;
}

.question-check input {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  margin: 2px 0 0;
  accent-color: var(--sage);
}

.question[data-done='true'] .question-check span {
  color: var(--ink-soft);
}

textarea.question-note {
  min-height: 42px;
  font-size: 15px;
  background: transparent;
  field-sizing: content;
}

.notes textarea {
  field-sizing: content;
  min-height: 120px;
}

.memo {
  display: grid;
  gap: 36px;
}

.memo-block h2 {
  font-size: 28px;
  margin-bottom: 14px;
}

.memo-script {
  margin: 0;
  padding: 22px 24px;
  border-radius: 18px;
  background: var(--rose-pale);
  font-family: var(--display);
  font-size: 20px;
  line-height: 1.6;
  max-width: 68ch;
}

.memo-steps,
.memo-tips {
  margin: 0;
  padding-left: 1.4em;
  display: grid;
  gap: 10px;
  max-width: 70ch;
}

.memo-steps li::marker {
  font-family: var(--display);
  color: var(--rose);
}

.memo-tips li::marker {
  color: var(--sage);
}

.memo-hint {
  margin: -4px 0 18px;
  color: var(--ink-soft);
  max-width: 70ch;
}

.memo-group {
  margin-bottom: 20px;
}

.memo-group h3 {
  font-size: 20px;
  margin-bottom: 8px;
}

.memo-group ul {
  margin: 0;
  padding-left: 1.2em;
  display: grid;
  gap: 6px;
  max-width: 70ch;
}

.memo-group li::marker {
  content: '♡  ';
  color: var(--rose);
}

@media (max-width: 560px) {
  .hero {
    padding-top: 28px;
  }
  .hero-branch {
    opacity: 0.55;
  }
  .add-form {
    flex-direction: column;
  }
  .tab {
    padding: 8px 13px;
  }
  .venue {
    padding: 16px;
  }
  .venue-head {
    flex-direction: column;
    gap: 6px;
  }
  .fields {
    padding: 16px;
  }
  .memo-script {
    font-size: 18px;
    padding: 18px;
  }
}
