:root {
  --ink: #173f37;
  --ink-soft: #526d64;
  --muted: #80928b;
  --green: #1d5d4e;
  --green-deep: #143d34;
  --green-soft: #e6f0eb;
  --gold: #e9b678;
  --gold-deep: #c88645;
  --warm-soft: #faeee2;
  --red: #b95346;
  --surface: #ffffff;
  --canvas: #f3f6f2;
  --line: #e2ebe5;
  --shadow: 0 18px 48px rgba(26, 66, 56, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 90% 0%, rgba(120, 179, 154, 0.18), transparent 440px),
    radial-gradient(circle at 0% 55%, rgba(233, 182, 120, 0.1), transparent 420px),
    var(--canvas);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  line-height: 1.5;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

button::after {
  border: 0;
}

.hidden {
  display: none !important;
}

.account-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 20px 0 14px;
}

.account-brand {
  display: inline-flex;
  align-items: center;
  color: var(--ink);
  font-size: 17px;
  font-weight: 800;
  text-decoration: none;
}

.brand-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  margin-right: 10px;
  color: #fff;
  background: var(--green);
  border-radius: 12px;
  font-size: 16px;
  box-shadow: 0 8px 20px rgba(29, 93, 78, 0.18);
}

.account-user {
  display: flex;
  align-items: center;
  gap: 9px;
}

.user-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 35px;
  height: 35px;
  color: #fff;
  background: var(--green);
  border-radius: 50%;
  font-size: 13px;
  font-weight: 800;
}

.user-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.user-meta strong {
  max-width: 130px;
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-meta span {
  color: var(--muted);
  font-size: 9px;
}

.text-button,
.link-button {
  padding: 6px 8px;
  color: #6a8179;
  background: transparent;
  border: 0;
  font-size: 11px;
}

.account-shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 10px 0 52px;
}

.auth-view {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(340px, 0.75fr);
  gap: 42px;
  align-items: center;
  min-height: calc(100vh - 120px);
}

.auth-intro {
  padding: 50px 20px;
}

.auth-kicker,
.dashboard-kicker {
  color: #4c8876;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 2.5px;
}

.auth-intro h1 {
  margin: 20px 0 14px;
  color: var(--green-deep);
  font-size: clamp(42px, 6vw, 70px);
  line-height: 1.08;
  letter-spacing: -3.5px;
}

.auth-intro p {
  max-width: 560px;
  margin: 0;
  color: #6f847c;
  font-size: 15px;
  line-height: 1.8;
}

.auth-feature-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 30px;
}

.auth-feature-row span {
  padding: 7px 12px;
  color: #4a7165;
  background: rgba(255, 255, 255, 0.66);
  border: 1px solid #dde9e2;
  border-radius: 999px;
  font-size: 11px;
}

.auth-card {
  padding: 30px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 28px;
  box-shadow: 0 28px 70px rgba(25, 63, 53, 0.12);
}

.auth-tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: #f0f4f1;
  border-radius: 14px;
}

.auth-tab {
  flex: 1;
  min-height: 38px;
  color: #70867e;
  background: transparent;
  border: 0;
  border-radius: 11px;
  font-size: 12px;
  font-weight: 700;
}

.auth-tab.active {
  color: var(--green);
  background: #fff;
  box-shadow: 0 5px 15px rgba(35, 76, 64, 0.08);
}

.auth-form {
  margin-top: 24px;
}

.auth-form h2 {
  margin: 0;
  font-size: 25px;
  letter-spacing: -1px;
}

.auth-form > p {
  margin: 5px 0 18px;
  color: var(--muted);
  font-size: 11px;
}

.field {
  display: block;
  margin-top: 13px;
}

.field > span {
  display: block;
  margin-bottom: 5px;
  color: #6f847c;
  font-size: 10px;
}

.field input {
  width: 100%;
  min-height: 46px;
  padding: 0 13px;
  color: var(--ink);
  background: #f7faf8;
  border: 1px solid #e0e9e3;
  border-radius: 13px;
  font-size: 13px;
  outline: none;
}

.field input:focus {
  background: #fff;
  border-color: #69a58f;
  box-shadow: 0 0 0 3px rgba(69, 139, 115, 0.11);
}

.code-input {
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.primary-button,
.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 18px;
  color: #fff;
  background: var(--green);
  border: 1px solid var(--green);
  border-radius: 13px;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}

.primary-button {
  width: 100%;
  margin-top: 18px;
}

.primary-button.compact {
  width: auto;
  min-height: 42px;
  margin-top: 0;
  padding: 0 16px;
}

.secondary-button {
  color: var(--green);
  background: #e7f0eb;
  border-color: #d8e6de;
}

.auth-form .link-button {
  display: block;
  margin: 9px auto 0;
}

.form-note {
  color: #8ea099 !important;
  font-size: 9px !important;
  text-align: center;
}

.dashboard-view {
  padding-top: 24px;
}

.dashboard-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  padding: 20px 4px 28px;
}

.dashboard-heading h1 {
  margin: 8px 0 4px;
  color: var(--green-deep);
  font-size: clamp(34px, 5vw, 48px);
  letter-spacing: -2.2px;
}

.dashboard-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.create-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 8px;
}

.route-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.route-card {
  position: relative;
  overflow: hidden;
  padding: 22px;
  background: #fff;
  border: 1px solid rgba(31, 75, 64, 0.08);
  border-radius: 22px;
  box-shadow: 0 13px 36px rgba(26, 66, 56, 0.065);
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.route-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 20px 46px rgba(26, 66, 56, 0.1);
}

.route-card::before {
  position: absolute;
  top: -50px;
  right: -45px;
  width: 150px;
  height: 150px;
  background: radial-gradient(circle, rgba(91, 157, 135, 0.13), transparent 68%);
  content: "";
}

.route-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.route-days {
  padding: 5px 9px;
  color: #34735f;
  background: #e7f1eb;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 800;
}

.share-state {
  color: #95a49e;
  font-size: 9px;
}

.route-card h2 {
  min-height: 52px;
  margin: 18px 0 12px;
  font-size: 20px;
  line-height: 1.35;
  letter-spacing: -0.8px;
}

.route-stats {
  display: flex;
  gap: 16px;
  padding: 13px 0;
  border-top: 1px solid #edf1ee;
  border-bottom: 1px solid #edf1ee;
}

.route-stat {
  min-width: 0;
}

.route-stat span {
  display: block;
  color: var(--muted);
  font-size: 9px;
}

.route-stat strong {
  display: block;
  margin-top: 1px;
  color: #31594e;
  font-size: 13px;
}

.route-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 14px;
}

.route-updated {
  color: #8b9b95;
  font-size: 9px;
}

.route-actions {
  display: flex;
  gap: 4px;
}

.route-action {
  padding: 5px 7px;
  color: #647b72;
  background: #f3f6f4;
  border: 0;
  border-radius: 8px;
  font-size: 9px;
}

.route-action.danger {
  color: #ae6259;
  background: #fbefec;
}

.empty-routes {
  padding: 70px 20px;
  background: rgba(255, 255, 255, 0.66);
  border: 1px dashed #c9d9d0;
  border-radius: 24px;
  text-align: center;
}

.empty-symbol {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 62px;
  height: 62px;
  margin: 0 auto 16px;
  color: var(--green);
  background: var(--green-soft);
  border-radius: 20px;
  font-size: 21px;
  font-weight: 800;
}

.empty-routes h2 {
  margin: 0;
  font-size: 22px;
}

.empty-routes p {
  margin: 5px 0 18px;
  color: var(--muted);
  font-size: 11px;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(14, 38, 32, 0.54);
  backdrop-filter: blur(5px);
}

.modal-card {
  position: relative;
  z-index: 1;
  width: min(460px, 100%);
  max-height: calc(100vh - 40px);
  padding: 27px;
  overflow-y: auto;
  background: #fff;
  border-radius: 22px;
  box-shadow: 0 28px 80px rgba(11, 37, 30, 0.24);
}

.modal-card h2 {
  margin: 0 34px 8px 0;
  font-size: 22px;
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  color: #8b9b95;
  background: #f3f6f4;
  border: 0;
  border-radius: 50%;
  font-size: 21px;
}

.modal-copy {
  margin: 0 0 17px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.7;
}

.recovery-code {
  padding: 18px;
  margin: 12px 0;
  color: var(--green);
  background: #eff6f2;
  border: 1px solid #dce9e1;
  border-radius: 15px;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 25px;
  font-weight: 800;
  letter-spacing: 4px;
  text-align: center;
}

.modal-actions {
  display: flex;
  gap: 8px;
  margin-top: 16px;
}

.modal-actions .primary-button,
.modal-actions .secondary-button {
  flex: 1;
  width: auto;
  margin-top: 0;
}

.share-link {
  display: flex;
  gap: 7px;
  margin-top: 12px;
}

.share-link input {
  flex: 1;
  min-width: 0;
  height: 42px;
  padding: 0 11px;
  background: #f7faf8;
  border: 1px solid #e0e9e3;
  border-radius: 12px;
  font-size: 10px;
}

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  z-index: 200;
  max-width: calc(100% - 40px);
  padding: 10px 17px;
  color: #fff;
  background: rgba(20, 55, 46, 0.94);
  border-radius: 999px;
  box-shadow: 0 12px 34px rgba(20, 55, 46, 0.22);
  font-size: 12px;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 12px);
  transition: opacity 170ms ease, transform 170ms ease;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

@media (max-width: 880px) {
  .auth-view {
    grid-template-columns: 1fr;
    gap: 10px;
    min-height: auto;
    padding-top: 16px;
  }

  .auth-intro {
    padding: 28px 10px;
  }

  .auth-intro h1 {
    font-size: 45px;
    letter-spacing: -2.6px;
  }

  .auth-card {
    width: min(480px, 100%);
    margin: 0 auto;
  }

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

@media (max-width: 600px) {
  .account-topbar,
  .account-shell {
    width: calc(100% - 24px);
  }

  .account-brand {
    font-size: 15px;
  }

  .user-meta span {
    display: none;
  }

  .auth-intro {
    padding: 22px 4px 16px;
  }

  .auth-intro h1 {
    margin-top: 14px;
    font-size: 38px;
  }

  .auth-intro p {
    font-size: 13px;
  }

  .auth-feature-row {
    margin-top: 20px;
  }

  .auth-card {
    padding: 22px 18px;
    border-radius: 23px;
  }

  .dashboard-view {
    padding-top: 12px;
  }

  .dashboard-heading {
    align-items: flex-start;
    flex-direction: column;
    padding-bottom: 20px;
  }

  .dashboard-heading h1 {
    font-size: 35px;
  }

  .create-actions {
    width: 100%;
  }

  .create-actions button {
    flex: 1;
  }

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

  .route-card h2 {
    min-height: auto;
  }
}
