:root {
  --text: #222;
  --muted: #6f6f6f;
  --background: #f7f7f5;
  --white: #fff;
  --accent: #ce514b;
  --accent-dark: #ad403b;
  --accent-light: #fff1f0;
  --border: #dededb;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--text);
  background: var(--background);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
}

body.modal-open {
  overflow: hidden;
}

button,
input,
textarea {
  font: inherit;
}

.topbar {
  position: fixed;
  inset: 0 0 auto;
  z-index: 40;
  display: flex;
  height: 58px;
  align-items: center;
  padding: 0 max(20px, calc((100vw - 900px) / 2));
  border-bottom: 1px solid var(--border);
  background: rgba(247, 247, 245, 0.96);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 50%;
  color: var(--white);
  background: var(--accent);
}

main {
  min-height: 100vh;
}

.screen {
  display: none;
  min-height: 100vh;
  padding: 100px 20px 60px;
}

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

.hero-screen.is-active {
  display: grid;
  place-items: center;
}

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

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1,
h2 {
  margin-bottom: 18px;
  line-height: 1.08;
  letter-spacing: -0.035em;
}

h1 {
  font-size: clamp(3rem, 7vw, 5.4rem);
  font-weight: 700;
}

h2 {
  font-size: clamp(2.25rem, 5vw, 3.6rem);
}

h1 em,
h2 em {
  color: var(--accent);
  font-weight: inherit;
}

.hero-lead,
.section-heading > p,
.success-lead {
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.6;
}

.hero-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 30px;
}

.btn {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 0 20px;
  border: 1px solid var(--text);
  border-radius: 8px;
  color: var(--text);
  cursor: pointer;
  background: transparent;
  font-weight: 600;
}

.btn:hover {
  background: var(--white);
}

.btn-primary {
  border-color: var(--accent);
  color: var(--white);
  background: var(--accent);
}

.btn-primary:hover {
  border-color: var(--accent-dark);
  background: var(--accent-dark);
}

.btn-big {
  min-height: 52px;
  padding: 0 25px;
}

.full-width {
  width: 100%;
}

.btn:focus-visible,
.icon-button:focus-visible,
.calendar-day:focus-visible,
.choice-card:focus-within,
.idea-card:focus-within,
.time-option:focus-within {
  outline: 3px solid rgba(206, 81, 75, 0.22);
  outline-offset: 2px;
}

.section-heading,
.plan-form {
  width: min(780px, 100%);
  margin-right: auto;
  margin-left: auto;
}

.section-heading {
  margin-bottom: 38px;
}

.choice-group,
.time-fieldset {
  min-width: 0;
  margin: 0 0 32px;
  padding: 0;
  border: 0;
}

.choice-group legend,
.time-fieldset legend {
  width: 100%;
  margin-bottom: 12px;
  font-size: 0.9rem;
  font-weight: 700;
}

.choice-grid,
.idea-grid {
  display: grid;
  gap: 9px;
}

.city-grid {
  grid-template-columns: repeat(3, 1fr);
}

.vibe-grid {
  grid-template-columns: repeat(3, 1fr);
}

.idea-grid {
  grid-template-columns: 1fr;
}

.choice-card,
.idea-card {
  position: relative;
  display: flex;
  min-width: 0;
  min-height: 60px;
  align-items: center;
  gap: 11px;
  padding: 12px 42px 12px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  background: var(--white);
}

.choice-card:hover,
.idea-card:hover {
  border-color: #aaa;
}

.choice-card:has(input:checked),
.idea-card:has(input:checked),
.time-option:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-light);
}

.choice-card input,
.idea-card input,
.time-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.choice-check {
  position: absolute;
  top: 50%;
  right: 13px;
  display: grid;
  width: 20px;
  height: 20px;
  place-items: center;
  border: 1px solid #ccc;
  border-radius: 50%;
  color: transparent;
  background: var(--white);
  font-size: 0.65rem;
  transform: translateY(-50%);
}

.choice-card:has(input:checked) .choice-check,
.idea-card:has(input:checked) .choice-check {
  border-color: var(--accent);
  color: var(--white);
  background: var(--accent);
}

.choice-emoji {
  flex: 0 0 auto;
  font-size: 1.25rem;
}

.choice-card strong,
.idea-card strong {
  overflow: hidden;
  font-size: 0.88rem;
  text-overflow: ellipsis;
}

.idea-group {
  transition: opacity 0.15s ease;
}

.idea-group:disabled {
  opacity: 0.4;
}

.field-hint {
  display: none;
}

.form-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.form-error {
  min-height: 19px;
  margin: 0;
  color: var(--accent-dark);
  font-size: 0.8rem;
  font-weight: 600;
}

.processing-screen.is-active {
  display: grid;
  place-items: center;
}

.processing-card {
  width: min(760px, 100%);
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--white);
}

.video-frame {
  position: relative;
  overflow: hidden;
  background: #111;
}

.youtube-slot,
.youtube-slot iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

.techno-frame {
  aspect-ratio: 16 / 9;
}

.processing-copy {
  padding: 23px;
}

.processing-copy h2 {
  margin-bottom: 7px;
  font-size: 1.8rem;
}

.loading-dots {
  display: inline-block;
  width: 0.8em;
  overflow: hidden;
  vertical-align: bottom;
  animation: dots 1.2s steps(4, end) infinite;
}

@keyframes dots {
  from { width: 0; }
  to { width: 0.8em; }
}

.progress-track {
  height: 4px;
  overflow: hidden;
  border-radius: 4px;
  background: #e7e7e4;
}

.progress-bar {
  width: 0;
  height: 100%;
  background: var(--accent);
}

.progress-bar.is-running {
  width: 100%;
  transition: width 15s linear;
}

.processing-time {
  display: flex;
  justify-content: flex-end;
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.75rem;
}

.date-heading {
  width: min(900px, 100%);
  margin-bottom: 30px;
  text-align: center;
}

.date-heading > p {
  margin-bottom: 0;
}

.date-layout {
  display: grid;
  grid-template-columns: minmax(440px, 1.3fr) minmax(290px, 0.7fr);
  gap: 14px;
  width: min(900px, 100%);
  margin: 0 auto;
}

.calendar-card,
.date-details {
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--white);
}

.calendar-card {
  padding: 25px;
}

.calendar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
}

.calendar-header h3 {
  margin: 0;
  font-size: 1.1rem;
  text-transform: capitalize;
}

.icon-button {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 7px;
  cursor: pointer;
  background: var(--white);
}

.icon-button:hover:not(:disabled) {
  border-color: #aaa;
}

.icon-button:disabled {
  cursor: not-allowed;
  opacity: 0.35;
}

.weekdays,
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 5px;
}

.weekdays {
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.68rem;
  text-align: center;
}

.calendar-day {
  position: relative;
  display: grid;
  aspect-ratio: 1;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 7px;
  cursor: pointer;
  background: transparent;
  font-size: 0.85rem;
}

.calendar-day:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--accent);
}

.calendar-day.is-selected {
  color: var(--white);
  background: var(--accent);
}

.calendar-day.is-today::after {
  position: absolute;
  bottom: 3px;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: currentColor;
  content: "";
}

.calendar-day:disabled {
  cursor: not-allowed;
  color: #aaa;
  background: #f0f0ee;
  text-decoration: line-through;
}

.calendar-empty {
  aspect-ratio: 1;
}

.date-details {
  padding: 18px;
}

.ticket {
  display: flex;
  min-height: 70px;
  align-items: center;
  margin-bottom: 22px;
  padding: 15px;
  border-left: 3px solid var(--accent);
  border-radius: 6px;
  background: var(--accent-light);
}

.ticket strong {
  font-size: 0.95rem;
  line-height: 1.35;
}

.time-fieldset {
  display: grid;
  gap: 7px;
  margin-bottom: 20px;
}

.time-option {
  position: relative;
  display: grid;
  grid-template-columns: 25px 1fr auto;
  align-items: center;
  gap: 7px;
  padding: 11px 12px;
  border: 1px solid var(--border);
  border-radius: 7px;
  cursor: pointer;
}

.time-option strong {
  font-size: 0.8rem;
}

.time-option small {
  color: var(--muted);
  font-size: 0.66rem;
}

.note-field {
  display: block;
  margin-bottom: 17px;
}

.note-field > span {
  display: block;
  margin-bottom: 7px;
  font-size: 0.78rem;
  font-weight: 600;
}

.note-field > span small {
  color: var(--muted);
  font-weight: 400;
}

.note-field textarea {
  width: 100%;
  min-height: 76px;
  resize: vertical;
  padding: 11px;
  border: 1px solid var(--border);
  border-radius: 7px;
  outline: none;
  color: var(--text);
  background: var(--white);
}

.note-field textarea:focus {
  border-color: var(--accent);
}

.success-screen.is-active {
  display: grid;
  place-items: center;
}

.success-grid {
  display: grid;
  grid-template-columns: minmax(260px, 0.8fr) minmax(360px, 1.2fr);
  gap: 45px;
  align-items: center;
  width: min(850px, 100%);
}

.cat-frame {
  aspect-ratio: 9 / 12;
  max-height: 500px;
  border-radius: 8px;
}

.success-copy h2 {
  font-size: clamp(2.2rem, 5vw, 3.5rem);
}

.summary-card {
  margin: 25px 0 16px;
  border-top: 1px solid var(--border);
}

.summary-row {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 15px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.84rem;
}

.summary-row span {
  color: var(--muted);
}

.summary-row strong {
  text-align: right;
}

.save-status {
  min-height: 25px;
  margin-bottom: 13px;
  color: var(--muted);
  font-size: 0.74rem;
}

.save-status.is-saved {
  color: #34704f;
}

.save-status.is-warning {
  color: #8a651c;
}

.save-pulse {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 6px;
  border-radius: 50%;
  background: var(--accent);
}

.meme-modal[hidden] {
  display: none;
}

.meme-modal {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  padding: 18px;
  place-items: center;
}

.meme-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
}

.meme-dialog {
  position: relative;
  width: min(560px, 100%);
  padding: 18px;
  border-radius: 10px;
  background: var(--white);
  text-align: center;
}

.meme-dialog h2 {
  margin-bottom: 15px;
  font-size: clamp(1.8rem, 6vw, 2.7rem);
}

.nuh-frame {
  width: 100%;
  aspect-ratio: 16 / 9;
  margin-bottom: 15px;
  border-radius: 7px;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 100;
  max-width: calc(100vw - 36px);
  padding: 11px 14px;
  border-radius: 7px;
  opacity: 0;
  color: var(--white);
  background: var(--text);
  font-size: 0.8rem;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 0.2s, transform 0.2s;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 760px) {
  .date-layout {
    grid-template-columns: 1fr;
    max-width: 620px;
  }

  .success-grid {
    grid-template-columns: 1fr;
    max-width: 560px;
  }

  .success-video-wrap {
    order: 2;
  }

  .cat-frame {
    width: min(340px, 100%);
    margin: 0 auto;
  }
}

@media (max-width: 560px) {
  .topbar {
    height: 54px;
    padding: 0 16px;
  }

  .brand span:last-child {
    display: none;
  }

  .screen {
    padding: 82px 16px 45px;
  }

  h1 {
    font-size: clamp(2.7rem, 13vw, 4rem);
  }

  h2 {
    font-size: 2.15rem;
  }

  .hero-actions {
    flex-direction: column;
  }

  .hero-actions .btn {
    width: 100%;
  }

  .city-grid,
  .vibe-grid {
    grid-template-columns: 1fr;
  }

  .form-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .form-footer .btn {
    width: 100%;
  }

  .processing-copy {
    padding: 18px;
  }

  .calendar-card {
    padding: 17px 10px;
  }

  .weekdays,
  .calendar-grid {
    gap: 3px;
  }

  .calendar-day {
    font-size: 0.8rem;
  }

  .date-details {
    padding: 15px;
  }

  .time-option {
    grid-template-columns: 24px 1fr;
  }

  .time-option small {
    display: none;
  }

  .summary-row {
    grid-template-columns: 80px 1fr;
  }
}

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