:root {
  color-scheme: light;
  --paper: #faf9f7;
  --card: #ffffff;
  --ink: #1a1a17;
  --muted: #716f68;
  --soft: #f4f2ec;
  --line: #e7e5df;
  --green: #0a7d3f;
  --green-dark: #075f31;
  --green-soft: #e8f5ec;
  --blue: #2a6fd6;
  --blue-soft: #eaf1fb;
  --amber: #a86f0b;
  --amber-soft: #fff4d9;
  --red: #b83e35;
  --red-soft: #fbeae8;
  --shadow: 0 18px 50px rgba(30, 42, 34, 0.08);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  background: var(--paper);
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  min-width: 320px;
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", sans-serif;
  font-size: 15px;
  line-height: 1.5;
}

button,
select,
a {
  font: inherit;
}

button,
select {
  color: inherit;
}

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

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 100;
  transform: translateY(-80px);
  border-radius: 9px;
  background: var(--ink);
  color: #fff;
  padding: 11px 14px;
  font-weight: 700;
  text-decoration: none;
  transition: transform 160ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  border-bottom: 1px solid rgba(231, 229, 223, 0.9);
  background: rgba(250, 249, 247, 0.92);
  backdrop-filter: blur(16px);
}

.topbar-inner {
  display: flex;
  min-height: 68px;
  max-width: 1320px;
  margin: 0 auto;
  padding: 10px 24px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.brand {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-weight: 800;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 10px;
  background: var(--green);
  color: #fff;
  font-size: 16px;
  font-weight: 900;
}

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

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.back-link,
.book-link {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  padding: 9px 13px;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

.back-link {
  color: var(--muted);
}

.back-link:hover {
  color: var(--green);
}

.book-link {
  background: var(--green);
  color: #fff;
}

.book-link:hover {
  background: var(--green-dark);
}

.language-switch {
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card);
}

.language-switch button {
  min-width: 48px;
  min-height: 44px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
}

.language-switch button[aria-pressed="true"] {
  background: var(--green-soft);
  color: var(--green-dark);
}

.dashboard {
  max-width: 1320px;
  margin: 0 auto;
  padding: 38px 24px 72px;
}

.intro {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 22px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

h1 {
  max-width: 760px;
  margin: 0;
  font-size: clamp(28px, 4.4vw, 48px);
  line-height: 1.05;
  letter-spacing: -0.035em;
}

.intro-copy {
  max-width: 650px;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 16px;
}

.property-chip {
  flex: none;
  min-width: 260px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
  padding: 14px 16px;
  box-shadow: 0 8px 28px rgba(30, 42, 34, 0.04);
}

.property-chip strong,
.property-chip span {
  display: block;
}

.property-chip strong {
  margin-bottom: 3px;
  font-size: 14px;
}

.property-chip span {
  color: var(--muted);
  font-size: 12px;
}

.demo-label {
  display: inline-flex !important;
  margin-top: 9px;
  border-radius: 99px;
  background: var(--soft);
  color: var(--muted) !important;
  padding: 4px 8px;
  font-size: 11px !important;
  font-weight: 700;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.kpi-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
  padding: 15px 16px;
}

.kpi-label,
.kpi-note {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.kpi-value {
  display: block;
  margin: 3px 0 1px;
  color: var(--green);
  font-size: clamp(22px, 3vw, 30px);
  font-weight: 800;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}

.toolbar {
  display: flex;
  min-height: 64px;
  margin-bottom: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
  padding: 8px 10px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.month-control,
.toolbar-right,
.legend {
  display: flex;
  align-items: center;
}

.month-control {
  gap: 6px;
}

.icon-button {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--card);
  cursor: pointer;
  font-size: 21px;
}

.icon-button:hover:not(:disabled) {
  border-color: #b7cbbd;
  background: var(--green-soft);
  color: var(--green-dark);
}

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

#month-title {
  min-width: 150px;
  margin: 0;
  text-align: center;
  font-size: 17px;
  font-weight: 800;
}

.toolbar-right {
  gap: 14px;
}

.legend {
  flex-wrap: wrap;
  gap: 8px 14px;
  color: var(--muted);
  font-size: 12px;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.legend-swatch {
  width: 9px;
  height: 9px;
  border-radius: 3px;
  background: var(--green);
}

.legend-swatch.booked {
  border: 1px solid #c9c6bd;
  background: repeating-linear-gradient(135deg, #e1dfd8 0 3px, #f7f6f2 3px 6px);
}

.legend-swatch.event {
  background: var(--amber);
}

.apply-all {
  min-height: 44px;
  border: 0;
  border-radius: 9px;
  background: var(--green);
  color: #fff;
  padding: 10px 15px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.apply-all:hover {
  background: var(--green-dark);
}

.apply-all:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  align-items: start;
  gap: 14px;
}

.calendar-card,
.detail-panel,
.method-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
}

.calendar-card {
  min-width: 0;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.month-note {
  display: flex;
  min-height: 46px;
  margin: 0;
  border-bottom: 1px solid var(--line);
  background: var(--amber-soft);
  color: #624608;
  padding: 11px 14px;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 650;
}

.month-note::before {
  width: 8px;
  height: 8px;
  flex: none;
  border-radius: 99px;
  background: var(--amber);
  content: "";
}

.weekday-row,
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.weekday-row {
  border-bottom: 1px solid var(--line);
  background: #fcfbf9;
}

.weekday {
  padding: 9px 4px;
  color: var(--muted);
  text-align: center;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.calendar-grid {
  background: var(--line);
  gap: 1px;
}

.calendar-empty {
  min-height: 112px;
  background: #fcfbf9;
}

.day-button {
  position: relative;
  display: flex;
  min-width: 0;
  min-height: 112px;
  overflow: hidden;
  border: 0;
  background: var(--card);
  padding: 9px;
  flex-direction: column;
  align-items: stretch;
  text-align: left;
  cursor: pointer;
}

.day-button:hover {
  z-index: 2;
  background: #fbfdfb;
  box-shadow: inset 0 0 0 2px #b8dac6;
}

.day-button.weekend {
  background: var(--soft);
}

.day-button.booked {
  background: repeating-linear-gradient(135deg, #f7f6f2 0 7px, #efede7 7px 14px);
}

.day-button.event::before {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 4px;
  background: var(--amber);
  content: "";
}

.day-button[aria-pressed="true"] {
  z-index: 3;
  background: var(--green-soft);
  box-shadow: inset 0 0 0 3px var(--green);
}

.day-button.applied::after {
  position: absolute;
  right: 7px;
  bottom: 7px;
  display: grid;
  width: 18px;
  height: 18px;
  place-items: center;
  border-radius: 99px;
  background: var(--green);
  color: #fff;
  content: "✓";
  font-size: 11px;
  font-weight: 900;
}

.day-top,
.cell-price,
.cell-current {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 5px;
}

.day-top {
  min-height: 22px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.min-stay,
.state-badge,
.cell-delta {
  border-radius: 99px;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}

.min-stay {
  background: var(--blue-soft);
  color: #245a9b;
  padding: 4px 5px;
}

.min-stay.long {
  background: var(--amber-soft);
  color: #805509;
}

.cell-price {
  margin-top: 9px;
  color: var(--green-dark);
  font-size: clamp(15px, 1.4vw, 19px);
  font-weight: 850;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
}

@media (max-width: 1180px) and (min-width: 761px) {
  .cell-price {
    align-items: flex-start;
    flex-direction: column;
    justify-content: flex-start;
    gap: 4px;
  }
}

.cell-delta {
  background: var(--green-soft);
  color: var(--green-dark);
  padding: 4px 5px;
}

.cell-delta.down {
  background: var(--red-soft);
  color: var(--red);
}

.cell-delta.same {
  background: var(--soft);
  color: var(--muted);
}

.cell-current {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.cell-reason {
  margin-top: auto;
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.booked-copy {
  margin: auto 0;
  color: var(--muted);
  text-align: center;
  font-size: 12px;
  font-weight: 800;
}

.detail-panel {
  position: sticky;
  top: 82px;
  min-width: 0;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.detail-head {
  border-bottom: 1px solid var(--line);
  padding: 17px 18px 15px;
}

.detail-kicker {
  margin: 0 0 5px;
  color: var(--green);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.detail-head h2 {
  margin: 0;
  font-size: 20px;
  line-height: 1.2;
}

.detail-status {
  display: inline-flex;
  margin-top: 9px;
  border-radius: 99px;
  background: var(--green-soft);
  color: var(--green-dark);
  padding: 5px 8px;
  font-size: 11px;
  font-weight: 800;
}

.detail-status.booked {
  background: var(--soft);
  color: var(--muted);
}

.detail-body {
  padding: 16px 18px 18px;
}

.recommendation {
  border-radius: 11px;
  background: var(--green-soft);
  padding: 13px 14px;
}

.recommendation-label {
  display: block;
  color: var(--green-dark);
  font-size: 12px;
  font-weight: 750;
}

.recommendation-value {
  display: block;
  margin: 2px 0;
  color: var(--green-dark);
  font-size: 32px;
  font-weight: 900;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
}

.recommendation-impact {
  display: block;
  color: #386449;
  font-size: 12px;
  font-weight: 650;
}

.price-list {
  margin: 12px 0 0;
}

.price-row {
  display: flex;
  min-height: 35px;
  border-bottom: 1px solid var(--line);
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 12px;
}

.price-row dt {
  color: var(--muted);
}

.price-row dd {
  margin: 0;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.price-row dd.sold-out {
  color: var(--red);
}

.reason-block {
  margin-top: 15px;
}

.reason-block h3,
.signal-block h3 {
  margin: 0 0 7px;
  font-size: 13px;
}

.reason-block p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.event-link {
  display: inline-flex;
  min-height: 44px;
  margin-top: 7px;
  align-items: center;
  color: var(--blue);
  font-size: 12px;
  font-weight: 750;
  text-decoration: none;
}

.event-link:hover {
  text-decoration: underline;
}

.signal-block {
  margin-top: 15px;
}

.signal-list {
  display: grid;
  gap: 7px;
}

.signal-row {
  display: flex;
  min-width: 0;
  border-radius: 8px;
  background: var(--soft);
  padding: 8px 9px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 11px;
}

.signal-row span:first-child {
  min-width: 0;
  color: var(--muted);
}

.signal-row strong {
  flex: none;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.detail-actions {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  margin-top: 16px;
}

.apply-day,
.reset-day {
  min-height: 46px;
  border-radius: 9px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
}

.apply-day {
  border: 0;
  background: var(--green);
  color: #fff;
  padding: 10px 14px;
}

.apply-day:hover:not(:disabled) {
  background: var(--green-dark);
}

.apply-day:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.reset-day {
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--muted);
  padding: 10px 12px;
}

.reset-day[hidden] {
  display: none;
}

.month-strip {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
  margin-top: 14px;
}

.month-chip {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card);
  padding: 10px;
  cursor: pointer;
  text-align: left;
}

.month-chip:hover,
.month-chip[aria-current="true"] {
  border-color: #9cc9ad;
  background: var(--green-soft);
}

.month-chip span,
.month-chip strong {
  display: block;
}

.month-chip span {
  color: var(--muted);
  font-size: 11px;
}

.month-chip strong {
  margin-top: 2px;
  color: var(--green-dark);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.method-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 18px;
}

.method-card {
  min-width: 0;
  padding: 0;
  overflow: hidden;
}

.method-card summary {
  min-height: 50px;
  padding: 15px 16px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
}

.method-card p,
.method-card ul {
  margin: 0;
  border-top: 1px solid var(--line);
  color: var(--muted);
  padding: 13px 16px 15px;
  font-size: 12px;
  line-height: 1.65;
}

.method-card ul {
  padding-left: 32px;
}

.footer-cta {
  display: flex;
  margin-top: 18px;
  border-radius: 14px;
  background: #073d24;
  color: #fff;
  padding: 20px 22px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.footer-cta strong,
.footer-cta span {
  display: block;
}

.footer-cta strong {
  font-size: 18px;
}

.footer-cta span {
  margin-top: 3px;
  color: #cfe8d8;
  font-size: 12px;
}

.footer-cta a {
  display: inline-flex;
  min-height: 48px;
  flex: none;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  background: #fff;
  color: #073d24;
  padding: 11px 16px;
  font-size: 13px;
  font-weight: 850;
  text-decoration: none;
}

.footer-note {
  margin: 13px 0 0;
  color: var(--muted);
  text-align: center;
  font-size: 11px;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 80;
  max-width: min(360px, calc(100vw - 36px));
  transform: translateY(110px);
  border-radius: 10px;
  background: var(--ink);
  color: #fff;
  padding: 12px 15px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.25);
  font-size: 13px;
  font-weight: 700;
  opacity: 0;
  transition: transform 180ms ease, opacity 180ms ease;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

.loading,
.error-state {
  display: grid;
  grid-column: 1 / -1;
  min-height: 480px;
  place-items: center;
  color: var(--muted);
  text-align: center;
}

.error-state button {
  min-height: 44px;
  margin-top: 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--card);
  padding: 9px 14px;
  cursor: pointer;
}

:focus-visible {
  outline: 3px solid #4da875;
  outline-offset: 3px;
}

@media (max-width: 980px) {
  .kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .detail-panel {
    position: static;
  }

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

@media (max-width: 760px) {
  .topbar-inner {
    min-height: 62px;
    padding: 7px 12px;
  }

  .brand-copy small,
  .back-link,
  .topbar .book-link {
    display: none;
  }

  .topbar-actions {
    gap: 7px;
  }

  .language-switch button {
    min-width: 44px;
  }

  .dashboard {
    padding: 24px 12px 50px;
  }

  .intro {
    display: block;
    margin-bottom: 16px;
  }

  .intro-copy {
    font-size: 14px;
  }

  .property-chip {
    min-width: 0;
    margin-top: 16px;
  }

  .kpi-grid {
    gap: 8px;
  }

  .kpi-card {
    padding: 12px;
  }

  .kpi-value {
    font-size: 22px;
  }

  .toolbar {
    display: block;
    padding: 8px;
  }

  .month-control {
    justify-content: space-between;
  }

  .toolbar-right {
    margin-top: 8px;
    justify-content: space-between;
  }

  .legend {
    gap: 8px;
  }

  .apply-all {
    padding: 9px 11px;
  }

  .month-note {
    min-height: 42px;
    padding: 9px 11px;
    font-size: 12px;
  }

  .weekday {
    padding: 7px 2px;
    font-size: 11px;
  }

  .calendar-empty,
  .day-button {
    min-height: 72px;
  }

  .day-button {
    padding: 5px 4px;
  }

  .day-top {
    min-height: 18px;
    font-size: 11px;
  }

  .min-stay {
    padding: 3px;
    font-size: 9px;
  }

  .cell-price {
    margin-top: 6px;
    font-size: clamp(11px, 3.2vw, 13px);
  }

  .cell-current,
  .cell-delta,
  .cell-reason {
    display: none;
  }

  .booked-copy {
    font-size: 10px;
  }

  .day-button.applied::after {
    right: 4px;
    bottom: 4px;
    width: 15px;
    height: 15px;
    font-size: 9px;
  }

  .detail-head,
  .detail-body {
    padding-right: 14px;
    padding-left: 14px;
  }

  .month-strip {
    display: flex;
    margin-right: -12px;
    margin-left: -12px;
    overflow-x: auto;
    padding: 0 12px 5px;
    scroll-snap-type: x proximity;
  }

  .month-chip {
    min-width: 112px;
    flex: none;
    scroll-snap-align: start;
  }

  .footer-cta {
    display: block;
    padding: 18px;
  }

  .footer-cta a {
    width: 100%;
    margin-top: 14px;
  }
}

@media (max-width: 380px) {
  .dashboard {
    padding-right: 8px;
    padding-left: 8px;
  }

  .calendar-card {
    margin-right: -8px;
    margin-left: -8px;
    border-right: 0;
    border-left: 0;
    border-radius: 0;
  }

  .month-strip {
    margin-right: -8px;
    margin-left: -8px;
    padding-right: 8px;
    padding-left: 8px;
  }

  .calendar-empty,
  .day-button {
    min-height: 66px;
  }

  .day-button {
    padding-right: 3px;
    padding-left: 3px;
  }

  .toolbar-right {
    align-items: flex-end;
  }

  .legend {
    display: grid;
    grid-template-columns: auto auto;
    gap: 5px 10px;
  }

  .apply-all {
    max-width: 118px;
    white-space: normal;
  }
}

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

@media print {
  .topbar,
  .toolbar-right,
  .detail-actions,
  .footer-cta,
  .method-grid {
    display: none !important;
  }

  .dashboard {
    max-width: none;
    padding: 0;
  }

  .workspace {
    grid-template-columns: 1fr 290px;
  }
}
