:root {
  color-scheme: light;
  font-family: "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  background: #fdf7f1;
  color: #302c29;
  line-height: 1.5;
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  margin: 0;
  background:
    radial-gradient(circle at top left, rgb(255 219 188 / 65%), transparent 33rem),
    radial-gradient(circle at bottom right, rgb(191 223 211 / 70%), transparent 30rem),
    #fdf7f1;
}

button,
input {
  font: inherit;
}

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

button {
  cursor: pointer;
}

button:disabled {
  cursor: wait;
  opacity: 0.65;
}

button:focus-visible,
input:focus-visible,
a:focus-visible {
  outline: 3px solid #2b7263;
  outline-offset: 3px;
}

.site-shell {
  width: min(100% - 2rem, 1000px);
  margin: 0 auto;
  padding: clamp(1.5rem, 5vw, 4.5rem) 0;
}

.panel {
  padding: clamp(1.25rem, 4vw, 2.5rem);
  border: 1px solid rgb(81 52 38 / 12%);
  border-radius: 1.5rem;
  background: rgb(255 253 250 / 88%);
  box-shadow: 0 1.25rem 4rem rgb(93 59 42 / 12%);
}

.flow-header,
.dashboard-header,
.field-heading,
.summary-actions,
.step-navigation,
.filter-row,
.dashboard-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.flow-header,
.dashboard-header {
  justify-content: space-between;
  margin-bottom: 1rem;
}

.flow-header h1,
.dashboard-header h1,
.login-panel h1,
.welcome-panel h1 {
  margin: 0;
  font-size: clamp(1.75rem, 5vw, 2.75rem);
  letter-spacing: -0.04em;
}

.eyebrow,
.step-counter {
  margin: 0 0 0.35rem;
  color: #886c5b;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.11em;
}

.step-counter {
  margin: 0;
  color: #2b7263;
}

.step-copy,
.loading-copy,
.welcome-copy {
  margin: 0.55rem 0 1.25rem;
  color: #635951;
}

.field-block {
  margin: 1.5rem 0;
}

.field-heading {
  justify-content: space-between;
  margin-bottom: 0.65rem;
}

.field-label,
.field-heading h2 {
  display: block;
  margin: 0;
  color: #403831;
  font-size: 0.97rem;
  font-weight: 800;
}

.field-help {
  margin: 0.45rem 0 0;
  color: #786c62;
  font-size: 0.88rem;
}

.text-input,
.date-time-input {
  width: 100%;
  min-height: 3rem;
  padding: 0.68rem 0.85rem;
  border: 1px solid #d6c6b8;
  border-radius: 0.8rem;
  background: #fffefa;
  color: #302c29;
}

.text-input:focus,
.date-time-input:focus {
  border-color: #2b7263;
}

.filter-row {
  flex-wrap: wrap;
}

.filter-button,
.tag-toggle,
.secondary-button,
.link-button,
.export-button {
  min-height: 2.4rem;
  padding: 0.45rem 0.75rem;
  border: 1px solid #dac9ba;
  border-radius: 999px;
  background: #fffefa;
  color: #54463d;
  font-weight: 700;
}

.filter-button[aria-pressed="true"],
.tag-toggle[aria-pressed="true"] {
  border-color: #2b7263;
  background: #dff1ea;
  color: #135a4b;
}

.option-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(10.5rem, 1fr));
  gap: 0.7rem;
  margin-top: 1rem;
}

.choice-card {
  display: grid;
  gap: 0.55rem;
  min-height: 5rem;
  padding: 0.85rem;
  border: 1px solid #dfd0c4;
  border-radius: 1rem;
  background: #fffefa;
  color: #382e28;
  text-align: left;
}

.choice-card:hover {
  border-color: #ad8c78;
  transform: translateY(-1px);
}

.choice-card[aria-pressed="true"] {
  border-color: #2b7263;
  background: #e4f3ed;
  box-shadow: inset 0 0 0 1px #2b7263;
}

.choice-label {
  font-weight: 800;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.tag-chip {
  display: inline-flex;
  width: fit-content;
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  background: #f2e8de;
  color: #795b49;
  font-size: 0.76rem;
  font-weight: 700;
}

.empty-state {
  grid-column: 1 / -1;
  margin: 0;
  padding: 1.2rem;
  border: 1px dashed #d7c5b6;
  border-radius: 1rem;
  color: #786c62;
  text-align: center;
}

.step-navigation,
.summary-actions {
  flex-wrap: wrap;
  justify-content: space-between;
  margin-top: 2rem;
}

.summary-actions {
  justify-content: flex-start;
}

.primary-button {
  min-height: 2.9rem;
  padding: 0.68rem 1rem;
  border: 0;
  border-radius: 0.85rem;
  background: #1f6e5d;
  color: #fff;
  font-weight: 800;
  box-shadow: 0 0.5rem 1.2rem rgb(31 110 93 / 20%);
}

.primary-button:hover {
  background: #165649;
}

.secondary-button {
  border-radius: 0.85rem;
}

.wide-button {
  width: 100%;
  margin-top: 1rem;
}

.status-message {
  min-height: 1.5rem;
  margin: 1rem 0 0;
  color: #635951;
  font-weight: 700;
}

.status-message.is-error {
  color: #a2392c;
}

.status-message.is-success {
  color: #176a55;
}

.welcome-panel {
  max-width: 42rem;
  margin: 8vh auto 0;
  text-align: center;
}

.welcome-stage {
  position: relative;
  min-height: 7rem;
  margin-top: 1.5rem;
}

.welcome-stage .primary-button {
  position: absolute;
  top: 0.8rem;
  left: calc(50% - 8.5rem);
}

.welcome-stage .decline-button {
  position: absolute;
  top: 0.8rem;
  right: calc(50% - 8.5rem);
}

.itinerary {
  display: grid;
  grid-template-columns: minmax(5rem, 0.3fr) 1fr;
  gap: 0.75rem 1rem;
  margin: 1.5rem 0;
  padding: 1.15rem;
  border-radius: 1rem;
  background: #f8eee5;
}

.itinerary dt {
  color: #795b49;
  font-weight: 800;
}

.itinerary dd {
  margin: 0;
  font-weight: 700;
}

.login-panel {
  width: min(100%, 28rem);
  margin: 10vh auto 0;
}

.dashboard-filters {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
  margin: 1.25rem 0;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid #eadfd5;
  border-radius: 1rem;
}

.response-table {
  width: 100%;
  min-width: 43rem;
  border-collapse: collapse;
  background: #fffefa;
}

.response-table th,
.response-table td {
  padding: 0.85rem;
  border-bottom: 1px solid #efe5dc;
  text-align: left;
  vertical-align: top;
}

.response-table th {
  background: #f8eee5;
  color: #6b5141;
  font-size: 0.82rem;
}

.response-table tr:last-child td {
  border-bottom: 0;
}

.export-button {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

@media (max-width: 640px) {
  .site-shell {
    width: min(100% - 1rem, 1000px);
    padding: 0.75rem 0 2rem;
  }

  .panel {
    border-radius: 1.15rem;
  }

  .flow-header,
  .dashboard-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .welcome-stage .primary-button {
    left: 0.5rem;
  }

  .welcome-stage .decline-button {
    right: 0.5rem;
  }

  .dashboard-filters {
    grid-template-columns: 1fr;
  }
}
