.carpool-page {
  max-width: 1120px;
  margin: 20px auto 48px;
  padding: 0 16px;
}

.carpool-hero {
  background: linear-gradient(135deg, #fff5ea 0%, #ffe8d2 100%);
  border: 1px solid #ffd7b0;
  border-radius: 18px;
  padding: 18px;
}

.carpool-hero h1 {
  margin: 0;
  color: #c75a00;
}

.carpool-hero p {
  margin: 6px 0 0;
  color: #7a4a1f;
}


.carpool-filters {
  margin-top: 14px;
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 10px;
}

.carpool-filters input,
.carpool-filters button {
  height: 42px;
  border-radius: 12px;
  border: 1px solid #e5d5c6;
  padding: 0 12px;
}

.carpool-filters button {
  min-width: 170px;
  border: none;
  background: #ff8c42;
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

.continent-bar-wrap {
  margin-top: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.continent-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.continent-tab {
  height: 36px;
  border-radius: 999px;
  border: 1px solid #e6c8aa;
  background: #fff;
  color: #7a4a1f;
  padding: 0 14px;
  cursor: pointer;
  font-weight: 700;
}

.continent-tab.active {
  border-color: #ff8c42;
  background: #ff8c42;
  color: #fff;
}

.add-line-btn {
  flex-shrink: 0;
  height: 36px;
  border-radius: 10px;
  border: 1px solid #ff8c42;
  background: #fff;
  color: #ff8c42;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  padding: 0 14px;
}

.carpool-list {
  margin-top: 16px;
  display: grid;
  gap: 12px;
}


.route-card {
  background: #fff;
  border: 1px solid #f2e5d8;
  border-radius: 14px;
  overflow: hidden;
}

.route-card.is-expanded {
  border-color: #ffcfaa;
  box-shadow: 0 6px 18px rgba(255, 140, 66, 0.14);
}

.route-row {
  display: grid;
  grid-template-columns: 1.9fr 0.7fr 0.6fr;
  gap: 10px;
  align-items: center;
  padding: 14px;
}

.route-card.is-expanded .route-row {
  background: linear-gradient(90deg, #fff8f2 0%, #fff 65%);
  border-bottom: 1px solid #f7ddc4;
  position: relative;
}

.route-card.is-expanded .route-row::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: #ff8c42;
}

.route-main {
  min-width: 0;
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
}

.route-title {
  font-size: 20px;
  line-height: 1.1;
  color: #2f2a26;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.route-country {
  font-weight: 700;
  font-size: 12px;
  color: #8a5a2b;
  background: #fff4e8;
  border: 1px solid #f2d4b7;
  border-radius: 999px;
  padding: 3px 10px;
  line-height: 1.2;
}
.route-sep {
  margin: 0 2px;
  color: #b8a28f;
  font-size: 14px;
}
.route-path {
  font-weight: 700;
  font-size: 20px;
}
.route-note {
  margin-left: 8px;
  font-size: 12px;
  color: #8f7d6c;
  font-weight: 500;
}

.expanded-flag {
  margin-left: 8px;
  font-size: 11px;
  font-weight: 700;
  color: #b45b16;
  background: #fff1e4;
  border: 1px solid #ffd1ac;
  border-radius: 999px;
  padding: 2px 8px;
}

.route-updated {
  font-size: 12px;
  color: #817364;
}

.route-price {
  font-size: 22px;
  font-weight: 800;
  text-align: right;
}

.route-price.up {
  color: #d63d31;
}

.route-price.down {
  color: #1b9a5f;
}

.route-price.flat {
  color: #a3682f;
}

.route-toggle-btn {
  justify-self: end;
  border: 1px solid #ff8c42;
  background: #fff;
  color: #ff8c42;
  border-radius: 10px;
  height: 34px;
  padding: 0 12px;
  font-weight: 700;
  cursor: pointer;
}

.route-card.is-expanded .route-toggle-btn {
  background: #ff8c42;
  color: #fff;
  border-color: #ff8c42;
}


.route-expand {
  border-top: 1px solid #f2e5d8;
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 12px;
  padding: 12px 14px 14px;
  background: #fffcf8;
  box-shadow: inset 0 0 0 1px #fde7d2;
}

.route-brief-panel {
  grid-column: 1 / -1;
  border: 1px solid #f0e3d4;
  border-radius: 12px;
  padding: 12px;
  background: #fff7ef;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.route-brief-left,
.route-brief-tip {
  border: 1px solid #f3ddc8;
  background: #fff;
  border-radius: 10px;
  padding: 10px;
}

.brief-title {
  font-size: 14px;
  font-weight: 700;
  color: #5f3f23;
}

.brief-price {
  margin-top: 6px;
  color: #ff7b26;
  font-size: 24px;
  font-weight: 800;
  line-height: 1.05;
}

.brief-avg {
  margin-top: 6px;
  display: inline-block;
  border: 1px solid #f5cfae;
  background: #fff5ec;
  color: #c46622;
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 16px;
  font-weight: 700;
}

.brief-tip-text {
  margin-top: 6px;
  color: #776355;
  font-size: 13px;
  line-height: 1.5;
}

.route-chart-panel,
.route-records-panel {
  border: 1px solid #f0e3d4;
  border-radius: 10px;
  padding: 10px;
  background: #fff;
}

.route-panel-title {
  font-size: 14px;
  font-weight: 700;
  color: #5f3f23;
  margin-bottom: 8px;
}

.route-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.route-update-btn {
  border: none;
  background: #ff8c42;
  color: #fff;
  border-radius: 8px;
  height: 30px;
  padding: 0 12px;
  font-weight: 700;
  cursor: pointer;
}

.route-chart {
  width: 100%;
  height: 240px;
}

.route-chart svg {
  width: 100%;
  height: 100%;
  display: block;
}

.route-record-list {
  display: grid;
  gap: 8px;
  max-height: 220px;
  overflow: auto;
}

.route-record-note {
  margin-top: 4px;
  font-size: 12px;
  color: #8d6c4e;
}

.route-record-item {
  border: 1px solid #f2e5d8;
  border-radius: 8px;
  padding: 8px;
  cursor: pointer;
}

.route-pool-panel {
  border: 1px solid #f0e3d4;
  border-radius: 10px;
  padding: 10px;
  background: #fff;
}

.route-pool-panel-main {
  grid-column: 1 / 2;
}

.route-side-stack {
  grid-column: 2 / 3;
  display: grid;
  gap: 12px;
  align-content: start;
}

.route-pool-panel-mobile {
  display: none;
}

.route-pool-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.pool-create-btn {
  border: none;
  background: #ff8c42;
  color: #fff;
  border-radius: 8px;
  height: 32px;
  padding: 0 12px;
  font-weight: 700;
  cursor: pointer;
}

.pool-list {
  display: grid;
  gap: 8px;
}

.pool-item {
  border: 1px solid #f2e5d8;
  border-radius: 12px;
  padding: 10px 12px;
  display: grid;
  grid-template-columns: 1.2fr 1.7fr auto;
  gap: 12px;
  align-items: center;
  background: #fff;
}

.pool-profile-col {
  min-width: 0;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 10px;
}

.pool-info-col {
  min-width: 0;
  border-left: 1px solid #f2e5d8;
  padding-left: 12px;
}

.pool-user {
  font-weight: 700;
  color: #4b3a2d;
  font-size: 20px;
  line-height: 1.1;
}

.pool-profile-meta {
  min-width: 0;
}

.pool-avatar {
  width: 62px;
  height: 62px;
  border-radius: 14px;
  object-fit: cover;
  border: 1px solid #f1decb;
}

.pool-user-score {
  margin-top: 4px;
  font-size: 13px;
  color: #c56a24;
  font-weight: 700;
  display: inline-block;
  border: 1px solid #f6cfae;
  background: #fff5ec;
  border-radius: 999px;
  padding: 2px 9px;
}

.pool-user-quote {
  margin-top: 6px;
  color: #8b7562;
  font-size: 12px;
  line-height: 1.25;
}

.pool-route {
  font-size: 20px;
  font-weight: 800;
  color: #3a2d24;
  line-height: 1.1;
}

.pool-meta {
  margin-top: 7px;
  font-size: 13px;
  color: #7d6a5b;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.pool-action-col {
  min-width: 150px;
  justify-self: end;
  text-align: right;
}

.pool-price {
  font-size: 22px;
  font-weight: 800;
  color: #ff8c42;
  line-height: 1;
  text-align: right;
}

.pool-price span {
  font-size: 14px;
  font-weight: 700;
  margin-left: 2px;
}

.pool-join-btn {
  margin-top: 8px;
  border: none;
  background: #ff8c42;
  color: #fff;
  border-radius: 10px;
  height: 38px;
  min-width: 104px;
  padding: 0 14px;
  font-weight: 700;
  cursor: pointer;
}

.pool-count-tag {
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 12px;
  background: #fff6ec;
  color: #c36a26;
  border: 1px solid #ffd6b6;
}

.driver-review-list {
  display: grid;
  gap: 8px;
}

.driver-review-item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  border: 1px solid #f2e5d8;
  border-radius: 10px;
  padding: 8px;
}

.driver-avatar {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  object-fit: cover;
  border: 1px solid #f1decb;
}

.driver-name {
  font-weight: 700;
  color: #4b3a2d;
}

.driver-score {
  margin-top: 2px;
  color: #c26a24;
  font-weight: 700;
  font-size: 13px;
}

.driver-comment {
  margin-top: 2px;
  font-size: 12px;
  color: #7f6b5b;
}

.care-tips {
  margin-top: 14px;
  display: grid;
  gap: 10px;
}

.care-hero {
  border: 1px solid #f2dec9;
  background: linear-gradient(135deg, #fff7ef 0%, #ffeedc 100%);
  border-radius: 14px;
  padding: 10px 12px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
}

.care-hero img {
  width: 150px;
  height: 60px;
  object-fit: cover;
  object-position: center;
  border-radius: 10px;
}

.care-copy h3 {
  margin: 0;
  color: #8a4b1a;
  font-size: 24px;
}

.care-copy p {
  margin: 4px 0 0;
  color: #856852;
  font-size: 12px;
}

.care-action {
  height: 36px;
  border: none;
  background: #ff8c42;
  color: #fff;
  border-radius: 10px;
  font-weight: 700;
  padding: 0 14px;
  cursor: pointer;
}

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

.care-card {
  border: 1px solid #f2e5d8;
  background: #fff;
  border-radius: 12px;
  padding: 10px 12px;
}

.care-card h4 {
  margin: 0;
  color: #86542b;
  font-size: 13px;
}

.care-card p {
  margin: 4px 0 0;
  color: #8a7a6d;
  font-size: 12px;
}

.route-record-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 13px;
  color: #4a392b;
}

.score-pill {
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 12px;
  background: #fff3e6;
  color: #b25a16;
  border: 1px solid #ffd2a9;
}

.muted-empty {
  color: #786b62;
  padding: 16px;
  background: #fff;
  border: 1px dashed #ead8c7;
  border-radius: 12px;
}

.route-modal-mask {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.35);
  z-index: 4000;
}

.route-modal-mask.open {
  display: flex;
}

.route-modal {
  width: min(660px, calc(100vw - 20px));
  max-height: calc(100vh - 24px);
  overflow: auto;
  background: #fff;
  border-radius: 14px;
  padding: 14px;
}

.route-modal h3 {
  margin: 0 0 10px;
  color: #35281f;
}

.route-modal-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.route-modal-cell {
  border: 1px solid #f2e5d8;
  border-radius: 8px;
  padding: 8px;
}

.route-modal-cell .k {
  font-size: 12px;
  color: #7b6f66;
}

.route-modal-cell .v {
  font-size: 14px;
  color: #31261f;
  margin-top: 2px;
  word-break: break-all;
}

.route-modal-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 10px;
}

.route-modal-actions button {
  border: none;
  border-radius: 8px;
  background: #ff8c42;
  color: #fff;
  font-weight: 700;
  height: 36px;
  padding: 0 14px;
  cursor: pointer;
}

.route-modal-actions button:disabled,
.pool-join-btn:disabled,
.pool-create-btn:disabled,
.route-update-btn:disabled,
.care-action:disabled {
  opacity: .62;
  cursor: not-allowed;
  filter: saturate(.78);
}

.route-modal-actions button[data-loading="1"],
.pool-join-btn[data-loading="1"] {
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.18);
}

.pool-type-modal {
  width: min(460px, calc(100vw - 20px));
}

.pool-type-pills {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.pool-type-pill {
  height: 44px;
  border: 1px solid #ff8c42;
  border-radius: 999px;
  background: #fff;
  color: #d16b26;
  font-weight: 800;
  font-size: 16px;
  cursor: pointer;
}

.pool-type-pill:hover {
  background: #ff8c42;
  color: #fff;
}

.cp-toast {
  position: fixed;
  right: 14px;
  top: 86px;
  z-index: 6000;
  max-width: min(88vw, 360px);
  min-width: 180px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #ffd2ae;
  background: #fff7ef;
  color: #7a471f;
  font-size: 14px;
  line-height: 1.35;
  box-shadow: 0 10px 28px rgba(138, 71, 31, 0.18);
  opacity: 0;
  transform: translateY(-8px);
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  transition: opacity .18s ease, transform .18s ease;
}

.cp-toast.show {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.cp-toast.success {
  border-color: #bde8d0;
  background: #edfdf5;
  color: #1b7b4b;
}

.cp-toast.error {
  border-color: #ffd2d2;
  background: #fff2f2;
  color: #a13030;
}

.cp-toast-text {
  min-width: 0;
}

.cp-toast-action {
  border: 1px solid currentColor;
  background: transparent;
  color: inherit;
  border-radius: 999px;
  height: 28px;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
}

.route-update-modal {
  width: min(760px, calc(100vw - 20px));
}

.route-update-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.route-update-modal input,
.route-update-modal select,
.route-update-modal textarea {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #e6d6c8;
  border-radius: 10px;
  padding: 10px;
}

.field-invalid {
  border-color: #e25555 !important;
  background: #fff5f5 !important;
  box-shadow: 0 0 0 2px rgba(226, 85, 85, 0.12);
}

.route-update-modal textarea {
  margin-top: 8px;
  min-height: 88px;
}

@media (max-width: 900px) {
  .cp-toast {
    right: 10px;
    left: 10px;
    top: 74px;
    max-width: none;
    min-width: 0;
  }

  .carpool-page {
    padding: 0 12px 20px;
    margin-top: 12px;
    overflow-x: hidden;
  }

  .carpool-hero {
    border-radius: 16px;
    padding: 14px;
    background: linear-gradient(145deg, #fff7ee 0%, #ffeeda 100%);
    box-shadow: 0 10px 24px rgba(145, 86, 33, 0.08);
  }

  .carpool-hero h1 {
    font-size: 40px;
    line-height: 1.12;
    letter-spacing: 0.2px;
  }

  .carpool-hero p {
    margin-top: 8px;
    font-size: 16px;
    line-height: 1.45;
    color: #7f542e;
  }

  .carpool-filters {
    margin-top: 12px;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
    gap: 6px;
  }

  .carpool-filters input,
  .carpool-filters button {
    min-width: 0;
    height: 42px;
    border-radius: 12px;
    font-size: 14px;
  }

  .carpool-filters button {
    width: auto;
    min-width: 92px;
    padding: 0 10px;
    box-shadow: 0 8px 14px rgba(255, 140, 66, 0.28);
  }

  .continent-bar-wrap {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    margin-top: 10px;
  }

  .continent-tabs {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    overflow-x: auto;
    white-space: nowrap;
    padding-bottom: 2px;
    scrollbar-width: none;
    max-width: 100%;
  }

  .continent-tabs::-webkit-scrollbar {
    display: none;
  }

  .continent-tab {
    height: 34px;
    padding: 0 12px;
    font-size: 14px;
    flex: 0 0 auto;
  }

  .add-line-btn {
    width: 100%;
    height: 40px;
    border-radius: 12px;
    font-size: 18px;
    font-weight: 800;
  }

  .route-row {
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
    align-items: start;
    padding: 12px 12px 10px;
    gap: 8px;
  }

  .route-main {
    grid-column: 1;
    grid-row: 1 / 3;
    gap: 6px;
    min-width: 0;
  }

  .route-title {
    font-size: 18px;
    line-height: 1.2;
  }

  .route-path {
    font-size: 18px;
  }

  .route-updated {
    font-size: 11px;
  }

  .route-price {
    grid-column: 2;
    grid-row: 1;
    font-size: 18px;
    justify-self: end;
    text-align: right;
    line-height: 1.1;
  }

  .route-toggle-btn {
    grid-column: 2;
    grid-row: 2;
    margin-top: 4px;
    justify-self: end;
    text-align: center;
    height: 30px;
    min-width: 66px;
    border-radius: 9px;
    font-size: 13px;
    padding: 0 10px;
  }

  .route-title,
  .route-path,
  .route-note {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .carpool-page,
  .carpool-hero,
  .route-card,
  .route-expand,
  .route-row,
  .continent-tabs,
  .add-line-btn {
    box-sizing: border-box;
    max-width: 100%;
  }

  .route-expand {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 10px 10px 12px;
  }

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

  .brief-price {
    font-size: 21px;
  }

  .route-pool-panel-main {
    display: none;
  }

  .route-side-stack {
    grid-column: auto;
  }

  .route-pool-panel-mobile {
    display: block;
  }

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

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

  .pool-item {
    grid-template-columns: 1fr;
  }

  .pool-price {
    font-size: 20px;
  }

  .pool-route {
    font-size: 18px;
  }

  .pool-user {
    font-size: 18px;
  }

  .pool-avatar {
    width: 54px;
    height: 54px;
  }

  .pool-meta {
    font-size: 14px;
    gap: 4px;
  }

  .pool-user-quote {
    font-size: 12px;
  }

  .care-hero {
    grid-template-columns: 1fr;
    text-align: left;
  }

  .care-hero img {
    width: 130px;
    height: 54px;
  }

  .care-cards {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .carpool-page {
    padding: 0 10px 18px;
  }

  .carpool-hero h1 {
    font-size: 34px;
  }

  .carpool-hero p {
    font-size: 15px;
  }

  .carpool-filters {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
    gap: 6px;
  }

  .carpool-filters input,
  .carpool-filters button {
    height: 40px;
    font-size: 13px;
    padding: 0 10px;
  }

  .carpool-filters button {
    min-width: 82px;
    padding: 0 8px;
  }

  .continent-tab {
    height: 32px;
    padding: 0 11px;
    font-size: 13px;
  }

  .route-card {
    border-radius: 12px;
  }

  .route-title,
  .route-path {
    font-size: 16px;
  }

  .route-country {
    font-size: 11px;
    padding: 2px 8px;
  }

  .route-price {
    font-size: 16px;
  }
}
