:root {
  color-scheme: light;
  --bg: #f7f5ef;
  --surface: #ffffff;
  --surface-strong: #f0f6f2;
  --text: #22312b;
  --muted: #66736d;
  --line: #d9e0db;
  --brand: #147d64;
  --brand-dark: #0d5547;
  --accent: #d97a3a;
  --shadow: 0 18px 45px rgba(34, 49, 43, 0.11);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: linear-gradient(180deg, #eaf3ee 0%, var(--bg) 38%);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

button {
  border: 0;
  border-radius: 8px;
  background: var(--brand);
  color: #fff;
  cursor: pointer;
  font-weight: 700;
  padding: 0.8rem 1rem;
}

button:hover {
  background: var(--brand-dark);
}

button.secondary,
.tab,
.view-tab {
  background: transparent;
  color: var(--text);
}

.topbar {
  align-items: flex-end;
  display: flex;
  gap: 2rem;
  justify-content: space-between;
  margin: 0 auto;
  max-width: 1180px;
  padding: 2.5rem 1.25rem 1.5rem;
}

.eyebrow {
  color: var(--accent);
  font-size: 0.9rem;
  font-weight: 800;
  letter-spacing: 0;
  margin: 0 0 0.35rem;
  text-transform: uppercase;
}

h1 {
  font-size: clamp(2rem, 5vw, 4.5rem);
  letter-spacing: 0;
  line-height: 0.95;
  margin: 0;
  max-width: 820px;
}

.session {
  align-items: center;
  display: flex;
  gap: 0.75rem;
  min-height: 44px;
}

.session strong {
  white-space: nowrap;
}

.app-shell {
  margin: 0 auto;
  max-width: 1180px;
  padding: 0 1.25rem 3rem;
}

.auth-panel,
.workspace {
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.auth-panel {
  max-width: 460px;
  padding: 1rem;
}

.tabs,
.view-tabs {
  background: var(--surface-strong);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 0.3rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding: 0.3rem;
}

.view-tabs {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 1.25rem;
}

.tab.active,
.view-tab.active {
  background: var(--surface);
  box-shadow: 0 5px 16px rgba(34, 49, 43, 0.08);
  color: var(--brand-dark);
}

.auth-form,
.view {
  display: none;
}

.auth-form.active,
.view.active {
  display: block;
}

form {
  display: grid;
  gap: 1rem;
}

label {
  color: var(--muted);
  display: grid;
  font-size: 0.88rem;
  font-weight: 700;
  gap: 0.45rem;
}

input,
select,
textarea {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  min-height: 44px;
  padding: 0.75rem;
  width: 100%;
}

textarea {
  resize: vertical;
}

.hint {
  color: var(--muted);
  margin: 1rem 0 0;
}

.hidden {
  display: none;
}

.workspace {
  padding: 1.25rem;
}

.filters,
.form-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: 2fr 1fr 1fr;
  margin-bottom: 1.25rem;
}

.form-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.route-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.route-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 12px 28px rgba(34, 49, 43, 0.08);
  display: grid;
  gap: 1rem;
  padding: 1rem;
}

.card-head {
  align-items: start;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
}

.route-card h2 {
  font-size: 1.2rem;
  line-height: 1.2;
  margin: 0 0 0.35rem;
}

.meta,
.description,
.reviews p,
.empty-state {
  color: var(--muted);
  margin: 0;
}

.score {
  background: #fff4db;
  border: 1px solid #f1d99a;
  border-radius: 999px;
  color: #8d5b00;
  flex: 0 0 auto;
  font-weight: 800;
  padding: 0.45rem 0.65rem;
}

.stops {
  display: grid;
  gap: 0.35rem;
  margin: 0;
  padding-left: 1.2rem;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.tag {
  background: #e7f1ed;
  border-radius: 999px;
  color: var(--brand-dark);
  font-size: 0.8rem;
  font-weight: 800;
  padding: 0.35rem 0.55rem;
}

.review-form {
  align-items: end;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 0.7rem;
  grid-template-columns: 84px 1fr auto;
  padding-top: 1rem;
}

.reviews {
  display: grid;
  gap: 0.5rem;
}

.reviews p {
  background: #f8faf8;
  border-left: 3px solid var(--brand);
  border-radius: 4px;
  padding: 0.6rem;
}

.profile-summary {
  background: var(--surface-strong);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 0.35rem;
  margin-bottom: 1rem;
  padding: 1rem;
}

.profile-summary h2 {
  margin: 0;
}

@media (max-width: 760px) {
  .topbar {
    align-items: stretch;
    flex-direction: column;
  }

  .session {
    justify-content: space-between;
  }

  .filters,
  .form-grid,
  .review-form {
    grid-template-columns: 1fr;
  }
}
