body.plan-page {
  background: var(--paper);
  min-height: 100dvh;
}

.plan-page .lb-nav .btn-quiet {
  color: var(--cream);
  border-color: rgba(247, 241, 230, 0.28);
  background: transparent;
}

.plan-wrap {
  padding-bottom: 3rem;
}

.plan-hero {
  padding: 1.8rem var(--space) 1.7rem;
  background: linear-gradient(180deg, var(--forest) 0%, var(--forest-deep) 100%);
  color: var(--cream);
}

.plan-hero .lb-kicker {
  color: var(--gold-pale);
}

.plan-hero h1 {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(2rem, 6vw, 3.2rem);
  letter-spacing: -0.04em;
  margin-bottom: 0.4rem;
}

.plan-lede {
  max-width: 34rem;
  color: color-mix(in srgb, var(--cream) 78%, var(--gold-pale));
}

.plan-card {
  width: min(46rem, calc(100% - 2 * var(--space)));
  margin: -0.4rem auto 0;
  background: var(--paper);
  border: 1px solid var(--line);
  box-shadow: 0 18px 40px rgba(19, 37, 30, 0.12);
  padding: 1.2rem 1.15rem 1.25rem;
  position: relative;
  z-index: 1;
}

.plan-steps {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.35rem;
  margin-bottom: 1.25rem;
}

.plan-steps button {
  width: 100%;
  display: grid;
  justify-items: start;
  gap: 0.2rem;
  padding: 0.5rem 0.35rem 0.55rem;
  border-bottom: 2px solid var(--line);
  text-align: left;
}

.plan-steps button small {
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.plan-steps button strong {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 0.9rem;
  line-height: 1.15;
}

.plan-steps button.is-on {
  border-bottom-color: var(--forest);
}

.plan-steps button.is-on small {
  color: var(--forest);
}

.plan-steps button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.plan-switch {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 0.95rem;
  margin-bottom: 1.05rem;
  background: var(--cream);
  border: 1px solid var(--line);
  cursor: pointer;
}

.plan-switch span {
  display: grid;
  gap: 0.12rem;
}

.plan-switch strong {
  font-weight: 600;
}

.plan-switch small {
  color: var(--ink-soft);
  font-size: 0.86rem;
}

.switch {
  width: 2.9rem;
  height: 1.7rem;
  flex-shrink: 0;
  border-radius: 999px;
  background: color-mix(in srgb, var(--ink) 18%, var(--cream));
  position: relative;
  transition: background 0.16s ease;
}

.switch::after {
  content: "";
  position: absolute;
  top: 0.18rem;
  left: 0.18rem;
  width: 1.32rem;
  height: 1.32rem;
  border-radius: 50%;
  background: var(--paper);
  box-shadow: 0 1px 4px rgba(26, 20, 16, 0.2);
  transition: transform 0.16s ease;
}

.switch[aria-checked="true"] {
  background: var(--forest);
}

.switch[aria-checked="true"]::after {
  transform: translateX(1.2rem);
}

.stop-card {
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--cream) 55%, var(--paper));
  padding: 1.05rem 1rem 1.1rem;
  margin-bottom: 0.95rem;
}

.stop-card.is-origin {
  background: var(--paper);
  border-color: color-mix(in srgb, var(--forest) 28%, var(--line));
  box-shadow: 0 8px 22px rgba(19, 37, 30, 0.06);
}

.stop-card.is-destination {
  background: color-mix(in srgb, var(--cream) 70%, var(--paper));
}

.plan-period.is-invalid {
  border-color: var(--brick);
  color: var(--brick);
  background: color-mix(in srgb, var(--brick) 10%, var(--paper));
}

.stop-card.is-issue {
  border-color: var(--brick);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--brick) 40%, transparent);
}

.plan-field.is-invalid .plan-label {
  color: var(--brick);
}

.plan-field.is-invalid input,
.plan-field.is-invalid .combo input {
  border-color: var(--brick);
  background: color-mix(in srgb, var(--brick) 10%, var(--paper));
}

.plan-field.is-city-unknown input,
.plan-field.is-city-unknown .combo input {
  border-color: color-mix(in srgb, var(--gold) 70%, var(--line));
  background: color-mix(in srgb, var(--gold-pale) 35%, var(--paper));
}

.city-unknown-hint {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.78rem;
  font-weight: 500;
  line-height: 1.35;
  color: color-mix(in srgb, var(--gold) 55%, var(--ink));
}

.stop-card header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 0.6rem;
  margin-bottom: 0.95rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--line);
}

.stop-kicker {
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 0.15rem;
}

.stop-card header strong {
  display: block;
  font-family: var(--serif);
  font-weight: 500;
  font-size: 1.35rem;
  letter-spacing: -0.02em;
}

.stop-fields {
  display: grid;
  gap: 0.9rem;
}

.plan-field {
  display: grid;
  gap: 0.38rem;
  font-size: 0.82rem;
  font-weight: 500;
}

.plan-label {
  display: block;
  color: var(--ink);
}

.plan-field input,
.plan-field select,
.plan-field .plan-period {
  width: 100%;
  min-height: var(--tap);
  padding: 0.45rem 0.75rem;
  background: var(--paper);
  border: 1px solid var(--line);
  text-align: left;
}

.plan-field input:focus,
.plan-field select:focus,
.plan-field .plan-period:focus {
  outline: 2px solid var(--forest);
  outline-offset: 1px;
}

.plan-field .hint {
  font-weight: 400;
  color: var(--ink-soft);
  font-size: 0.78rem;
}

.plan-period {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  font-weight: 400;
  font-size: 1rem;
}

.plan-period:hover {
  border-color: var(--gold);
}

.plan-period.is-empty {
  color: var(--ink-soft);
}

.combo {
  position: relative;
}

.combo-list {
  position: absolute;
  z-index: 6;
  left: 0;
  right: 0;
  top: calc(100% + 0.25rem);
  max-height: 14rem;
  overflow: auto;
  background: var(--paper);
  border: 1px solid var(--line);
  box-shadow: 0 12px 28px rgba(19, 37, 30, 0.14);
}

.combo-list button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.55rem 0.75rem;
  min-height: 2.4rem;
}

.combo-list button:hover,
.combo-list button.is-active {
  background: var(--cream);
}

.time-row {
  display: grid;
  gap: 0.75rem;
}

.plan-add {
  width: 100%;
  margin-top: 0.15rem;
}

.who-list {
  display: grid;
  gap: 0.55rem;
  margin-bottom: 0.85rem;
}

.who-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.45rem;
  align-items: center;
}

.who-row input {
  width: 100%;
  min-height: var(--tap);
  padding: 0.45rem 0.75rem;
  background: var(--cream);
  border: 1px solid var(--line);
}

.review-block {
  display: grid;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.review-stop {
  padding: 0.85rem 0.9rem;
  background: var(--cream);
  border: 1px solid var(--line);
}

.review-stop p {
  color: var(--ink-soft);
  font-size: 0.92rem;
  margin-top: 0.2rem;
}

.review-theme {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-top: 0.35rem;
}

.review-theme span {
  width: 0.85rem;
  height: 0.85rem;
  border-radius: 999px;
  border: 1px solid var(--line);
}

.plan-error {
  color: var(--brick);
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.4;
  margin: 0.7rem 0 0.2rem;
  padding: 0.75rem 0.9rem;
  border: 1.5px solid var(--brick);
  background: color-mix(in srgb, var(--brick) 16%, var(--cream));
}

.plan-warn {
  color: var(--brick);
  font-size: 0.88rem;
  font-weight: 500;
  line-height: 1.35;
  margin: 0.45rem 0 0;
}

.plan-nav {
  display: flex;
  justify-content: space-between;
  gap: 0.6rem;
  margin-top: 1.15rem;
}

.plan-nav .btn-solid {
  background: var(--forest);
  color: var(--cream);
  border-color: var(--forest);
}

.cal-dialog {
  width: min(42rem, calc(100vw - 1.4rem));
  border: 1px solid var(--line);
  background: var(--paper);
  padding: 1rem 0.95rem 1.05rem;
  box-shadow: 0 24px 50px rgba(19, 37, 30, 0.28);
  overflow: auto;
}

.cal-dialog::backdrop {
  background: rgba(19, 37, 30, 0.55);
}

.cal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  margin-bottom: 0.7rem;
}

.cal-head h2 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 1.25rem;
}

.cal-head p {
  color: var(--ink-soft);
  font-size: 0.88rem;
}

.cal-months {
  display: grid;
  gap: 1rem;
}

.cal-month-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.45rem;
  font-weight: 600;
}

.cal-week {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.15rem;
  margin-bottom: 0.25rem;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
  text-align: center;
}

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.15rem;
}

.cal-grid button {
  min-height: 2.4rem;
  border-radius: 999px;
  font-variant-numeric: tabular-nums;
  display: grid;
  place-items: center;
  line-height: 1.05;
  padding: 0.15rem 0;
}

.cal-grid button small {
  display: block;
  font-size: 0.58rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.cal-grid button:hover:not(:disabled) {
  background: color-mix(in srgb, var(--forest) 16%, var(--paper));
}

.cal-grid button:disabled.is-pad {
  color: transparent;
  cursor: default;
  background: transparent;
}

.cal-grid button.is-past,
.cal-grid button.is-outside {
  color: color-mix(in srgb, var(--ink-soft) 40%, var(--paper));
  text-decoration: line-through;
  cursor: not-allowed;
}

.cal-grid button.is-taken:not(:disabled) {
  cursor: pointer;
}

.cal-grid button.is-in {
  background: color-mix(in srgb, var(--gold-pale) 55%, var(--paper));
  border-radius: 0;
}

.cal-grid button.is-start,
.cal-grid button.is-end {
  background: var(--forest);
  color: var(--cream);
  border-radius: 999px;
}

.cal-grid button.is-taken {
  border-radius: 0;
  cursor: not-allowed;
}

.cal-grid button.is-taken.taken-1 {
  background: color-mix(in srgb, var(--lotus) 42%, var(--paper));
  color: #7a3030;
}

.cal-grid button.is-taken.taken-2 {
  background: color-mix(in srgb, var(--dusk) 38%, var(--paper));
  color: #3d2f42;
}

.cal-grid button.is-taken.taken-3 {
  background: color-mix(in srgb, var(--gold) 38%, var(--paper));
  color: #5c4310;
}

.cal-grid button.is-taken-start {
  border-top-left-radius: 999px;
  border-bottom-left-radius: 999px;
}

.cal-grid button.is-taken-end {
  border-top-right-radius: 999px;
  border-bottom-right-radius: 999px;
}

.cal-grid button.is-gap {
  background: repeating-linear-gradient(
    -45deg,
    color-mix(in srgb, var(--line) 55%, var(--paper)),
    color-mix(in srgb, var(--line) 55%, var(--paper)) 4px,
    var(--paper) 4px,
    var(--paper) 8px
  );
  color: var(--ink-soft);
  cursor: not-allowed;
}

.cal-legend {
  list-style: none;
  display: grid;
  gap: 0.4rem;
  margin: 0.85rem 0 0;
  padding: 0.7rem 0.75rem;
  background: var(--cream);
  border: 1px solid var(--line);
  font-size: 0.82rem;
}

.cal-legend li {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 0.5rem;
}

.cal-legend b {
  display: grid;
  place-items: center;
  width: 1.15rem;
  height: 1.15rem;
  border-radius: 999px;
  font-size: 0.72rem;
}

.cal-legend small {
  color: var(--ink-soft);
}

.cal-legend .is-past-key span {
  color: var(--ink-soft);
}

.cal-legend .taken-1 b {
  background: color-mix(in srgb, var(--lotus) 42%, var(--paper));
  color: #7a3030;
}

.cal-legend .taken-2 b {
  background: color-mix(in srgb, var(--dusk) 38%, var(--paper));
  color: #3d2f42;
}

.cal-legend .taken-3 b {
  background: color-mix(in srgb, var(--gold) 38%, var(--paper));
  color: #5c4310;
}

.cal-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.55rem;
  margin-top: 0.85rem;
}

.cal-foot .btn-solid {
  background: var(--forest);
  color: var(--cream);
  border-color: var(--forest);
}

.cover-fields {
  display: grid;
  gap: 0.9rem;
  margin-bottom: 1.2rem;
}

.cover-pair {
  display: grid;
  gap: 0.75rem;
  align-items: start;
}

.cover-pair .plan-field {
  grid-template-rows: auto auto;
}

.cover-pair .plan-label {
  min-height: 1.2rem;
  line-height: 1.2;
  font-weight: 500;
}

.theme-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.7rem 1rem;
}

.theme-swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.theme-swatch {
  width: 2.15rem;
  height: 2.15rem;
  border-radius: 999px;
  border: 2px solid rgba(247, 241, 230, 0.4);
  box-shadow: inset 0 0 0 1px rgba(26, 20, 16, 0.18);
}

.theme-swatch.is-on {
  outline: 2px solid var(--forest);
  outline-offset: 3px;
}

.theme-pick {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-weight: 400;
  color: var(--ink-soft);
  font-size: 0.82rem;
}

.theme-pick input[type="color"] {
  width: 2.15rem;
  height: 2.15rem;
  min-height: 2.15rem;
  padding: 0;
  border: 1px solid var(--line);
  background: transparent;
  cursor: pointer;
}

.cover-preview {
  position: relative;
  isolation: isolate;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 0.35rem;
  min-height: 22rem;
  padding: 2rem 1.2rem 1.5rem;
  color: var(--cream);
  text-align: center;
  overflow: hidden;
  border: 1px solid var(--line);
}

.cover-preview .welcome-sky,
.cover-preview .welcome-brand,
.cover-preview .welcome-mark,
.cover-preview .welcome-kicker,
.cover-preview .welcome-title,
.cover-preview .welcome-line {
  animation: none;
}

.cover-preview .welcome-brand {
  margin-bottom: 0.75rem;
}

.cover-preview .welcome-mark {
  width: 3.6rem;
}

@media (min-width: 40rem) {
  .plan-card {
    padding: 1.4rem 1.4rem 1.45rem;
  }

  .time-row {
    grid-template-columns: 1fr 1fr;
  }

  .cover-pair {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }

  .cal-months {
    grid-template-columns: 1fr 1fr;
  }
}

/* mobile layout pass */
@media (max-width: 39.99rem) {
  .plan-card {
    padding: 1.05rem 0.95rem 1.15rem;
  }

  .plan-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .plan-actions .btn-solid,
  .plan-actions .btn-quiet {
    width: 100%;
    text-align: center;
  }

  .time-row,
  .cover-pair,
  .cal-months {
    grid-template-columns: 1fr;
  }
}
