/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 */
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #222;
  background: #fff;
}

/* ========================================
   Header
======================================== */
.header {
  width: 100%;
  background: #fff;
  border-bottom: 1px solid #e5e5e5;
}

.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 960px;
  min-height: 72px;
  margin: 0 auto;
  padding: 0 24px;
  box-sizing: border-box;
}

.header__logo {
  color: #222;
  font-size: 22px;
  font-weight: 700;
  text-decoration: none;
}

.header__nav {
  display: flex;
  align-items: center;
  gap: 24px;
}

.header__user-name {
  font-size: 14px;
}

.header__link {
  color: #222;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}

.header__login,
.header__logout {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 18px;
  border: 1px solid #222;
  border-radius: 6px;
  background: #fff;
  color: #222;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
}

.header__logout {
  appearance: none;
}

.top-hero {
  padding: 96px 24px 72px;
  background: #f7f8fa;
}

.top-hero__inner,
.top-about__inner {
  max-width: 960px;
  margin: 0 auto;
}

.top-hero__service-name {
  margin-bottom: 16px;
  font-size: 16px;
  font-weight: 700;
}

.top-hero__title {
  margin: 0;
  font-size: clamp(40px, 7vw, 72px);
  line-height: 1.2;
  letter-spacing: 0.02em;
}

.top-hero__description {
  margin-top: 32px;
  font-size: 18px;
  line-height: 1.9;
}

.top-hero__actions {
  display: flex;
  gap: 16px;
  margin-top: 36px;
}

.top-hero__button,
.top-hero__login {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 180px;
  padding: 14px 24px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 700;
}

.top-hero__button {
  background: #222;
  color: #fff;
}

.top-hero__login {
  border: 1px solid #222;
  color: #222;
  background: #fff;
}

.top-about {
  padding: 80px 24px;
}

.top-about__title {
  margin: 0 0 32px;
  font-size: 32px;
}

.top-about__description {
  max-width: 760px;
  margin: 0 0 16px;
  font-size: 17px;
  line-height: 1.9;
}

@media (max-width: 767px) {
  .header__inner {
    min-height: 64px;
    padding: 0 20px;
  }

  .header__logo {
    font-size: 20px;
  }

  .header__nav {
    gap: 12px;
  }

  .header__user-name {
    display: none;
  }

  .header__link {
    font-size: 13px;
  }

  .header__login,
  .header__logout {
    padding: 9px 12px;
    font-size: 13px;
  }

  .top-hero {
    padding: 64px 20px 56px;
  }

  .top-hero__title {
    font-size: 40px;
  }

  .top-hero__description {
    font-size: 16px;
  }

  .top-hero__actions {
    flex-direction: column;
  }

  .top-hero__button,
  .top-hero__login {
    width: 100%;
    box-sizing: border-box;
  }

  .top-about {
    padding: 56px 20px;
  }

  .top-about__title {
    font-size: 26px;
  }

  .top-about__description {
    font-size: 16px;
  }
}

/* ========================================
   Flash Message
======================================== */
.flash-message {
  width: 100%;
  padding: 14px 24px;
  box-sizing: border-box;
  font-size: 14px;
  font-weight: 600;
  text-align: center;
}

.flash-message--notice {
  color: #166534;
  background: #dcfce7;
}

.flash-message--alert {
  color: #991b1b;
  background: #fee2e2;
}

/* ========================================
   My Page
======================================== */
.my-page {
  padding: 72px 24px 96px;
  background: #f7f8fa;
}

.my-page__inner {
  max-width: 960px;
  margin: 0 auto;
}

.my-page__header {
  margin-bottom: 56px;
}

.my-page__label {
  margin: 0 0 12px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.my-page__title {
  margin: 0;
  font-size: 40px;
  line-height: 1.3;
}

.my-page__welcome {
  margin: 20px 0 0;
  font-size: 17px;
  line-height: 1.8;
}

.my-page__section + .my-page__section {
  margin-top: 48px;
}

.my-page__section-title {
  margin: 0 0 20px;
  font-size: 24px;
}

.my-page__user-card,
.my-page__empty {
  padding: 32px;
  border: 1px solid #e5e5e5;
  border-radius: 12px;
  background: #fff;
  box-sizing: border-box;
}

.my-page__user-list {
  margin: 0;
}

.my-page__user-item {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 24px;
  padding: 20px 0;
  border-bottom: 1px solid #e5e5e5;
}

.my-page__user-item:first-child {
  padding-top: 0;
}

.my-page__user-item:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.my-page__user-item dt {
  font-size: 14px;
  font-weight: 700;
}

.my-page__user-item dd {
  margin: 0;
  font-size: 16px;
  overflow-wrap: anywhere;
}

.my-page__empty {
  text-align: center;
}

.my-page__empty-title {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
}

.my-page__empty-text {
  margin: 12px 0 0;
  color: #666;
  font-size: 14px;
  line-height: 1.7;
}

@media (max-width: 767px) {
  .my-page {
    padding: 48px 20px 64px;
  }

  .my-page__header {
    margin-bottom: 40px;
  }

  .my-page__title {
    font-size: 32px;
  }

  .my-page__welcome {
    font-size: 16px;
  }

  .my-page__section + .my-page__section {
    margin-top: 40px;
  }

  .my-page__section-title {
    font-size: 22px;
  }

  .my-page__user-card,
  .my-page__empty {
    padding: 24px 20px;
  }

  .my-page__user-item {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 18px 0;
  }
}
/* ========================================
   Usual Routes
======================================== */
.usual-routes {
  min-height: calc(100vh - 72px);
  padding: 72px 24px 96px;
  background: #f7f8fa;
  box-sizing: border-box;
}

.usual-routes__inner {
  max-width: 960px;
  margin: 0 auto;
}

.usual-routes__header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 48px;
}

.usual-routes__label {
  margin: 0 0 12px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.usual-routes__title {
  margin: 0;
  font-size: 40px;
  line-height: 1.3;
}

.usual-routes__new-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 24px;
  border-radius: 8px;
  color: #fff;
  background: #111;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  box-sizing: border-box;
}

.usual-routes__filters {
  display: inline-flex;
  gap: 4px;
  margin-bottom: 20px;
  padding: 4px;
  border: 1px solid #e5e5e5;
  border-radius: 10px;
  background: #fff;
}

.usual-routes__filter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 80px;
  min-height: 40px;
  padding: 0 16px;
  border-radius: 7px;
  color: #555;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  box-sizing: border-box;
  transition:
    background-color 0.2s,
    color 0.2s;
}

.usual-routes__filter:hover {
  background: #f1f3f5;
  color: #111;
}

.usual-routes__filter.is-active {
  background: #111;
  color: #fff;
}

.usual-routes__list {
  display: grid;
  gap: 20px;
}

.usual-routes__card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 28px 32px;
  border: 1px solid #e5e5e5;
  border-radius: 12px;
  background: #fff;
  box-sizing: border-box;
}

.usual-routes__card-content {
  min-width: 0;
}

.usual-routes__order {
  display: flex;
  flex-shrink: 0;
  gap: 8px;
}

.usual-routes__order-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid #ddd;
  border-radius: 8px;
  background: #fff;
  color: #111;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
}

.usual-routes__order-button:hover {
  background: #f1f3f5;
}

.usual-routes__favorite-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 12px;
  padding: 7px 12px;
  border: 1px solid #ddd;
  border-radius: 999px;
  background: #fff;
  color: #555;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  transition:
    background-color 0.2s,
    border-color 0.2s,
    color 0.2s;
}

.usual-routes__favorite-button:hover {
  background: #f7f7f7;
}

.usual-routes__favorite-button.is-favorite {
  border-color: #e0b84c;
  background: #fff8df;
  color: #8a6500;
}

.usual-routes__favorite-button.is-favorite:hover {
  background: #fff2c2;
}

.usual-routes__name {
  margin: 0 0 20px;
  font-size: 22px;
}

.usual-routes__places {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 16px;
  line-height: 1.7;
}

.usual-routes__arrow {
  color: #666;
}

.usual-routes__empty {
  padding: 48px 32px;
  border: 1px solid #e5e5e5;
  border-radius: 12px;
  background: #fff;
  text-align: center;
  box-sizing: border-box;
}

.usual-routes__empty p {
  margin: 0 0 20px;
  font-size: 17px;
  font-weight: 700;
}

.usual-routes__empty a {
  color: #111;
  font-weight: 700;
}

@media (max-width: 767px) {
  .usual-routes {
    padding: 48px 20px 64px;
  }

  .usual-routes__header {
    align-items: stretch;
    flex-direction: column;
    margin-bottom: 32px;
  }

  .usual-routes__title {
    font-size: 32px;
  }

  .usual-routes__new-link {
    width: 100%;
  }

  .usual-routes__filters {
    display: flex;
    width: 100%;
  }

  .usual-routes__filter {
    flex: 1;
    min-width: 0;
    padding: 0 12px;
  }
  .usual-routes__card {
    align-items: flex-start;
    flex-direction: column;
    gap: 20px;
    padding: 24px 20px;
  }

  .usual-routes__order {
    width: 100%;
  }

  .usual-routes__order form {
    flex: 1;
  }

  .usual-routes__order-button {
    width: 100%;
  }

  .usual-routes__name {
    font-size: 20px;
  }

  .usual-routes__places {
    gap: 10px;
    font-size: 15px;
  }

  .usual-routes__empty {
    padding: 40px 20px;
  }
}

/* ========================================
   Usual Route Detail
======================================== */
.usual-route-detail {
  min-height: calc(100vh - 72px);
  padding: 72px 24px 96px;
  background: #f7f8fa;
  box-sizing: border-box;
}

.usual-route-detail__inner {
  max-width: 960px;
  margin: 0 auto;
}

.usual-route-detail__header {
  margin-bottom: 48px;
}

.usual-route-detail__label {
  margin: 0 0 12px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.usual-route-detail__title {
  margin: 0;
  font-size: 40px;
  line-height: 1.3;
}

.usual-route-detail__card {
  padding: 8px 32px;
  border: 1px solid #e5e5e5;
  border-radius: 12px;
  background: #fff;
  box-sizing: border-box;
}

.usual-route-detail__item {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 24px;
  padding: 24px 0;
  border-bottom: 1px solid #e5e5e5;
}

.usual-route-detail__item:last-child {
  border-bottom: 0;
}

.usual-route-detail__item-label {
  margin: 0;
  color: #666;
  font-size: 14px;
  font-weight: 700;
}

.usual-route-detail__item-value {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.7;
}

.usual-route-detail__actions {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 32px;
}

.usual-route-detail__timetable-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 24px;
  border: 1px solid #111;
  border-radius: 8px;
  color: #111;
  background: #fff;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  box-sizing: border-box;
  transition:
    color 0.2s ease,
    background-color 0.2s ease,
    border-color 0.2s ease;
}

.usual-route-detail__timetable-link:hover {
  color: #fff;
  background: #111;
}

.usual-route-detail__timetable-link:focus-visible {
  outline: 2px solid #111;
  outline-offset: 3px;
}

.usual-route-detail__edit-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 24px;
  border: 1px solid #111;
  border-radius: 8px;
  color: #fff;
  background: #111;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  box-sizing: border-box;
}

.usual-route-detail__delete-button {
  min-height: 48px;
  padding: 0 24px;
  border: 1px solid #dc2626;
  border-radius: 8px;
  color: #dc2626;
  background: #fff;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  box-sizing: border-box;
}

.usual-route-detail__back-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 24px;
  border: 1px solid #111;
  border-radius: 8px;
  color: #111;
  background: #fff;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  box-sizing: border-box;
}

/* ========================================
   Usual Route Detail - Next Departure
======================================== */
.usual-route-detail__next-departure {
  margin-top: 40px;
}

.usual-route-detail__next-header {
  margin-bottom: 20px;
}

.usual-route-detail__next-label {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.usual-route-detail__next-title {
  margin: 0;
  font-size: 28px;
  line-height: 1.3;
}

.usual-route-detail__next-card {
  padding: 28px 32px;
  border: 1px solid #e5e5e5;
  border-radius: 12px;
  background: #fff;
  box-sizing: border-box;
}

.usual-route-detail__next-caption {
  margin: 0 0 4px;
  color: #555;
  font-size: 13px;
  font-weight: 700;
}

.usual-route-detail__next-time {
  margin: 0;
  font-size: 44px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.02em;
}

.usual-route-detail__next-countdown {
  display: inline-block;
  margin: 8px 0 0;
  padding: 6px 12px;
  border-radius: 999px;
  background: #f1f3f5;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.4;
}

.usual-route-detail__next-note {
  margin: 12px 0 0;
  color: #555;
  font-size: 14px;
  line-height: 1.7;
}

.usual-route-detail__next-status {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.7;
}

.usual-route-detail__next-status + .usual-route-detail__next-status {
  margin-top: 8px;
}

.usual-route-detail__next-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  margin-top: 20px;
  padding: 0 24px;
  border: 1px solid #111;
  border-radius: 8px;
  color: #fff;
  background: #111;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  box-sizing: border-box;
}

@media (max-width: 767px) {
  .usual-route-detail {
    padding: 48px 20px 64px;
  }

  .usual-route-detail__header {
    margin-bottom: 32px;
  }

  .usual-route-detail__title {
    font-size: 32px;
  }

  .usual-route-detail__card {
    padding: 4px 20px;
  }

  .usual-route-detail__item {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 20px 0;
  }

  .usual-route-detail__next-departure {
    margin-top: 32px;
  }

  .usual-route-detail__next-title {
    font-size: 24px;
  }

  .usual-route-detail__next-card {
    padding: 24px 20px;
  }

  .usual-route-detail__next-time {
    font-size: 40px;
  }

  .usual-route-detail__next-link {
    width: 100%;
  }

  .usual-route-detail__actions {
    align-items: stretch;
    flex-direction: column;
  }

  .usual-route-detail__actions form {
    width: 100%;
  }

  .usual-route-detail__timetable-link,
  .usual-route-detail__edit-link,
  .usual-route-detail__delete-button,
  .usual-route-detail__back-link {
    width: 100%;
  }
}
/* ========================================
   Usual Route Edit
======================================== */
.usual-route-edit {
  min-height: calc(100vh - 72px);
  padding: 72px 24px 96px;
  background: #f7f8fa;
  box-sizing: border-box;
}

.usual-route-edit__inner {
  max-width: 960px;
  margin: 0 auto;
}

.usual-route-edit__header {
  margin-bottom: 48px;
}

.usual-route-edit__label {
  margin: 0 0 12px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.usual-route-edit__title {
  margin: 0;
  font-size: 40px;
  line-height: 1.3;
}

.usual-route-edit__errors {
  margin-bottom: 24px;
  padding: 20px 24px;
  border: 1px solid #fecaca;
  border-radius: 8px;
  color: #991b1b;
  background: #fef2f2;
  box-sizing: border-box;
}

.usual-route-edit__errors ul {
  margin: 0;
  padding-left: 20px;
}

.usual-route-edit__form {
  padding: 32px;
  border: 1px solid #e5e5e5;
  border-radius: 12px;
  background: #fff;
  box-sizing: border-box;
}

.usual-route-edit__field + .usual-route-edit__field {
  margin-top: 28px;
}

.usual-route-edit__field-label {
  display: block;
  margin-bottom: 10px;
  font-size: 14px;
  font-weight: 700;
}

.usual-route-edit__input {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  background: #fff;
  font: inherit;
  box-sizing: border-box;
}

.usual-route-edit__input:focus {
  border-color: #111;
  outline: none;
}

.usual-route-edit__actions {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 36px;
}

.usual-route-edit__submit,
.usual-route-edit__cancel {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 24px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
  box-sizing: border-box;
}

.usual-route-edit__submit {
  border: 1px solid #111;
  color: #fff;
  background: #111;
  cursor: pointer;
}

.usual-route-edit__cancel {
  border: 1px solid #111;
  color: #111;
  background: #fff;
  text-decoration: none;
}

@media (max-width: 767px) {
  .usual-route-edit {
    padding: 48px 20px 64px;
  }

  .usual-route-edit__header {
    margin-bottom: 32px;
  }

  .usual-route-edit__title {
    font-size: 32px;
  }

  .usual-route-edit__form {
    padding: 24px 20px;
  }

  .usual-route-edit__actions {
    align-items: stretch;
    flex-direction: column;
  }

  .usual-route-edit__submit,
  .usual-route-edit__cancel {
    width: 100%;
  }
}
/* ========================================
   Timetable
======================================== */
.timetable-new,
.timetable-edit,
.timetable-index {
  min-height: calc(100vh - 72px);
  padding: 72px 24px 96px;
  background: #f7f8fa;
  box-sizing: border-box;
}

.timetable-new__inner,
.timetable-edit__inner,
.timetable-index__inner {
  max-width: 960px;
  margin: 0 auto;
}

/* ----------------------------------------
   New / Edit
---------------------------------------- */
.timetable-new__title,
.timetable-edit__title {
  margin: 0 0 32px;
  font-size: 40px;
  line-height: 1.3;
}

.timetable-new__route,
.timetable-edit__route {
  margin-bottom: 32px;
  padding: 24px;
  border: 1px solid #e5e5e5;
  border-radius: 12px;
  background: #fff;
  box-sizing: border-box;
}

.timetable-new__route-name,
.timetable-edit__route-name {
  margin: 0 0 8px;
  font-size: 20px;
  font-weight: 700;
}

.timetable-new__route-path,
.timetable-edit__route-path {
  margin: 0;
  color: #555;
  font-size: 15px;
}

.timetable-form {
  padding: 32px;
  border: 1px solid #e5e5e5;
  border-radius: 12px;
  background: #fff;
  box-sizing: border-box;
}

.timetable-form__errors {
  margin-bottom: 24px;
  padding: 20px 24px;
  border: 1px solid #fecaca;
  border-radius: 8px;
  color: #991b1b;
  background: #fef2f2;
  box-sizing: border-box;
}

.timetable-form__errors p {
  margin: 0 0 8px;
  font-weight: 700;
}

.timetable-form__errors ul {
  margin: 0;
  padding-left: 20px;
}

.timetable-form__field {
  min-width: 0;
}

.timetable-form__label,
.timetable-form__sub-label {
  display: block;
  margin-bottom: 10px;
  font-size: 14px;
  font-weight: 700;
}

.timetable-form__select,
.timetable-form__time,
.timetable-form__input {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  background: #fff;
  font: inherit;
  box-sizing: border-box;
}

.timetable-form__select:focus,
.timetable-form__time:focus,
.timetable-form__input:focus {
  border-color: #111;
  outline: none;
}

.timetable-form__departures {
  margin-top: 32px;
}

.timetable-form__departure {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 20px;
  padding: 20px 0;
  border-bottom: 1px solid #e5e5e5;
}

.timetable-form__departure:first-of-type {
  border-top: 1px solid #e5e5e5;
}

.timetable-form__actions {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 36px;
}

.timetable-form__submit,
.timetable-form__back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 24px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
  box-sizing: border-box;
}

.timetable-form__submit {
  border: 1px solid #111;
  color: #fff;
  background: #111;
  cursor: pointer;
}

.timetable-form__back {
  border: 1px solid #111;
  color: #111;
  background: #fff;
  text-decoration: none;
}
.timetable-form__remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid #dc2626;
  border-radius: 8px;
  color: #dc2626;
  background: #fff;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  box-sizing: border-box;
  transition:
    color 0.2s ease,
    background-color 0.2s ease,
    border-color 0.2s ease;
}

.timetable-form__remove:hover {
  color: #fff;
  background: #dc2626;
}

.timetable-form__remove:focus-visible {
  outline: 2px solid #dc2626;
  outline-offset: 3px;
}
/* ----------------------------------------
   Index
---------------------------------------- */
.timetable-index__header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 32px;
}

.timetable-index__label {
  margin: 0 0 12px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.timetable-index__title {
  margin: 0;
  font-size: 40px;
  line-height: 1.3;
}

.timetable-index__new-link,
.timetable-index__edit-link,
.timetable-index__back-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 24px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  box-sizing: border-box;
}

.timetable-index__delete-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 18px;
  border: 1px solid #dc2626;
  border-radius: 8px;
  color: #dc2626;
  background: #fff;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  box-sizing: border-box;
  transition:
    color 0.2s ease,
    background-color 0.2s ease,
    border-color 0.2s ease;
}

.timetable-index__delete-button:hover {
  color: #fff;
  background: #dc2626;
}

.timetable-index__delete-button:focus-visible {
  outline: 2px solid #dc2626;
  outline-offset: 3px;
}
.timetable-index__card-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.timetable-index__card-actions form {
  margin: 0;
}

.timetable-index__new-link {
  border: 1px solid #111;
  color: #fff;
  background: #111;
}

.timetable-index__route {
  margin-bottom: 32px;
  padding: 24px;
  border: 1px solid #e5e5e5;
  border-radius: 12px;
  background: #fff;
}

.timetable-index__route-name {
  margin: 0 0 8px;
  font-size: 20px;
  font-weight: 700;
}

.timetable-index__route-path {
  margin: 0;
  color: #555;
  font-size: 15px;
}

.timetable-index__list {
  display: grid;
  gap: 24px;
}

.timetable-index__card {
  padding: 28px 32px;
  border: 1px solid #e5e5e5;
  border-radius: 12px;
  background: #fff;
}

.timetable-index__card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid #e5e5e5;
}

.timetable-index__day-type {
  margin: 0;
  font-size: 22px;
}

.timetable-index__edit-link {
  min-height: 40px;
  padding: 0 18px;
  border: 1px solid #111;
  color: #111;
  background: #fff;
}

.timetable-index__departures {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.timetable-index__departure {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 18px 0;
  border-bottom: 1px solid #eee;
}

.timetable-index__departure:last-child {
  border-bottom: 0;
}

.timetable-index__time {
  min-width: 72px;
  font-size: 20px;
  font-weight: 700;
}

.timetable-index__note {
  color: #555;
  font-size: 14px;
}

.timetable-index__empty {
  padding: 32px;
  border: 1px solid #e5e5e5;
  border-radius: 12px;
  background: #fff;
}

.timetable-index__empty p {
  margin-top: 0;
}

.timetable-index__footer {
  margin-top: 32px;
}

.timetable-index__back-link {
  border: 1px solid #111;
  color: #111;
  background: #fff;
}
/* ＋ 時刻を追加 */
.timetable-form__add {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  margin-top: 16px;
  padding: 0 18px;
  border: 1px solid #111;
  border-radius: 8px;
  color: #111;
  background: #fff;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  box-sizing: border-box;
  transition:
    color 0.2s ease,
    background-color 0.2s ease,
    border-color 0.2s ease;
}

.timetable-form__add:hover {
  color: #fff;
  background: #111;
}

.timetable-form__add:focus-visible {
  outline: 2px solid #111;
  outline-offset: 3px;
}

/* 時刻表全体を削除 */
.timetable-edit__delete {
  margin-top: 24px;
}

.timetable-edit__delete form {
  margin: 0;
}

.timetable-edit__delete-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 24px;
  border: 1px solid #dc2626;
  border-radius: 8px;
  color: #dc2626;
  background: #fff;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  box-sizing: border-box;
  transition:
    color 0.2s ease,
    background-color 0.2s ease,
    border-color 0.2s ease;
}

.timetable-edit__delete-button:hover {
  color: #fff;
  background: #dc2626;
}

.timetable-edit__delete-button:focus-visible {
  outline: 2px solid #dc2626;
  outline-offset: 3px;
}
/* ----------------------------------------
   Responsive
---------------------------------------- */
@media (max-width: 767px) {
  .timetable-new,
  .timetable-edit,
  .timetable-index {
    padding: 48px 20px 64px;
  }

  .timetable-new__title,
  .timetable-edit__title,
  .timetable-index__title {
    font-size: 32px;
  }

  .timetable-new__route,
  .timetable-edit__route,
  .timetable-index__route {
    padding: 20px;
  }

  .timetable-form {
    padding: 24px 20px;
  }

  .timetable-form__departure {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .timetable-form__actions {
    align-items: stretch;
    flex-direction: column;
  }

  .timetable-form__submit,
  .timetable-form__back {
    width: 100%;
  }

  .timetable-form__add,
  .timetable-edit__delete-button {
    width: 100%;
  }

  .timetable-edit__delete form {
    width: 100%;
  }

  .timetable-index__header {
    align-items: stretch;
    flex-direction: column;
  }

  .timetable-index__new-link {
    width: 100%;
  }

  .timetable-index__card {
    padding: 24px 20px;
  }

  .timetable-index__card-header {
    align-items: flex-start;
  }

  .timetable-index__departure {
    gap: 16px;
  }

  .timetable-index__footer {
    margin-top: 24px;
  }

  .timetable-index__back-link {
    width: 100%;
  }
}
/* ========================================
   Next Departures
======================================== */
.next-departures {
  min-height: calc(100vh - 72px);
  padding: 72px 24px 96px;
  background: #f7f8fa;
  box-sizing: border-box;
}

.next-departures__inner {
  max-width: 960px;
  margin: 0 auto;
}

.next-departures__header {
  margin-bottom: 40px;
}

.next-departures__label {
  margin: 0 0 12px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.next-departures__title {
  margin: 0;
  font-size: 40px;
  line-height: 1.3;
}

.next-departures__description {
  margin: 16px 0 0;
  color: #555;
  font-size: 15px;
  line-height: 1.8;
}

.next-departures__list {
  display: grid;
  gap: 24px;
}

.next-departures__card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 32px;
  padding: 32px;
  border: 1px solid #e5e5e5;
  border-radius: 12px;
  background: #fff;
  box-sizing: border-box;
}

.next-departures__route {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.next-departures__route-name {
  margin: 0;
  font-size: 22px;
  line-height: 1.4;
}

.next-departures__route-path {
  margin: 12px 0 0;
  color: #555;
  font-size: 15px;
}

.next-departures__route-path span {
  margin: 0 8px;
}

.next-departures__result {
  padding-left: 32px;
  border-left: 1px solid #e5e5e5;
}

.next-departures__next-label {
  margin: 0 0 4px;
  color: #555;
  font-size: 13px;
  font-weight: 700;
}

.next-departures__time {
  margin: 0;
  font-size: 44px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.02em;
}

.next-departures__countdown {
  display: inline-block;
  margin: 8px 0 0;
  padding: 6px 12px;
  border-radius: 999px;
  background: #f1f3f5;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.4;
}

.next-departures__note {
  margin: 8px 0 0;
  color: #555;
  font-size: 14px;
}

.next-departures__status {
  margin: 0 0 20px;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.6;
}

.next-departures__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  margin-top: 20px;
  padding: 0 18px;
  border: 1px solid #111;
  border-radius: 8px;
  color: #111;
  background: #fff;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  box-sizing: border-box;
}

.next-departures__empty {
  padding: 40px 32px;
  border: 1px solid #e5e5e5;
  border-radius: 12px;
  background: #fff;
  text-align: center;
  box-sizing: border-box;
}

.next-departures__empty-title {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
}

.next-departures__empty-text {
  margin: 12px 0 0;
  color: #555;
  font-size: 14px;
}

.next-departures__empty-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  margin-top: 24px;
  padding: 0 24px;
  border: 1px solid #111;
  border-radius: 8px;
  color: #fff;
  background: #111;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  box-sizing: border-box;
}

.next-departures__actions {
  margin-top: 32px;
}

.next-departures__back-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 24px;
  border: 1px solid #111;
  border-radius: 8px;
  color: #111;
  background: #fff;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  box-sizing: border-box;
}

.next-departures__favorite {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  margin: 8px 0 0;
  padding: 6px 10px;
  border-radius: 999px;
  background: #fff8df;
  color: #8a6500;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
}
/* ========================================
   My Page - Route Actions
======================================== */
.my-page__route-actions {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
}

.my-page__next-departures-link,
.my-page__routes-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 24px;
  border: 1px solid #111;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  box-sizing: border-box;
}

.my-page__next-departures-link {
  color: #fff;
  background: #111;
}

.my-page__routes-link {
  color: #111;
  background: #fff;
}

.my-page__route-list {
  display: grid;
  gap: 16px;
}

.my-page__route-item {
  padding: 24px 28px;
  border: 1px solid #e5e5e5;
  border-radius: 12px;
  background: #fff;
  box-sizing: border-box;
}

.my-page__route-name {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
}

.my-page__route-path {
  margin: 10px 0 0;
  color: #555;
  font-size: 14px;
}

/* ========================================
   Next Departures / My Page Responsive
======================================== */
@media (max-width: 767px) {
  .next-departures {
    padding: 48px 20px 64px;
  }

  .next-departures__header {
    margin-bottom: 32px;
  }

  .next-departures__title {
    font-size: 32px;
  }

  .next-departures__card {
    grid-template-columns: 1fr;
    gap: 24px;
    padding: 24px 20px;
  }

  .next-departures__result {
    padding: 24px 0 0;
    border-top: 1px solid #e5e5e5;
    border-left: 0;
  }

  .next-departures__time {
    font-size: 40px;
  }

  .next-departures__link {
    width: 100%;
  }

  .next-departures__empty {
    padding: 32px 20px;
  }

  .next-departures__empty-link,
  .next-departures__back-link {
    width: 100%;
  }

  .my-page__route-actions {
    flex-direction: column;
  }

  .my-page__next-departures-link,
  .my-page__routes-link {
    width: 100%;
  }

  .my-page__route-item {
    padding: 20px;
  }
}
/* ========================================
   Top - Next Departures
======================================== */
.top-next-departures {
  padding: 72px 24px 80px;
  background: #f7f8fa;
  box-sizing: border-box;
}

.top-next-departures__inner {
  max-width: 960px;
  margin: 0 auto;
}

.top-next-departures__header {
  margin-bottom: 32px;
}

.top-next-departures__label {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.top-next-departures__title {
  margin: 0;
  font-size: 32px;
  line-height: 1.3;
}

.top-next-departures__list {
  display: grid;
  gap: 16px;
}

.top-next-departures__card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 240px;
  gap: 28px;
  padding: 28px 32px;
  border: 1px solid #e5e5e5;
  border-radius: 12px;
  background: #fff;
  box-sizing: border-box;
}

.top-next-departures__route {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.top-next-departures__route-heading {
  display: flex;
  align-items: center;
  gap: 12px;
}

.top-next-departures__route-name {
  margin: 0;
  font-size: 20px;
  line-height: 1.4;
}

.top-next-departures__direction {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  padding: 5px 10px;
  border-radius: 999px;
  background: #f1f3f5;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
}

.top-next-departures__route-path {
  margin: 12px 0 0;
  color: #555;
  font-size: 14px;
}

.top-next-departures__route-path span {
  margin: 0 8px;
}

.top-next-departures__result {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-left: 28px;
  border-left: 1px solid #e5e5e5;
}

.top-next-departures__next-label {
  margin: 0 0 4px;
  color: #555;
  font-size: 13px;
  font-weight: 700;
}

.top-next-departures__time {
  margin: 0;
  font-size: 40px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.02em;
}

.top-next-departures__countdown {
  width: fit-content;
  margin: 8px 0 0;
  padding: 6px 12px;
  border-radius: 999px;
  background: #f1f3f5;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.4;
}

.top-next-departures__status {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.6;
}

.top-next-departures__actions {
  margin-top: 24px;
  text-align: right;
}

.top-next-departures__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 24px;
  border: 1px solid #111;
  border-radius: 8px;
  color: #fff;
  background: #111;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  box-sizing: border-box;
}

.top-next-departures__empty {
  padding: 40px 32px;
  border: 1px solid #e5e5e5;
  border-radius: 12px;
  background: #fff;
  text-align: center;
  box-sizing: border-box;
}

.top-next-departures__empty p {
  margin: 0;
  color: #555;
  font-size: 15px;
  line-height: 1.8;
}

.top-next-departures__empty .top-next-departures__link {
  margin-top: 24px;
}

@media (max-width: 767px) {
  .top-next-departures {
    padding: 48px 20px 64px;
  }

  .top-next-departures__header {
    margin-bottom: 24px;
  }

  .top-next-departures__title {
    font-size: 28px;
  }

  .top-next-departures__card {
    grid-template-columns: 1fr;
    gap: 20px;
    padding: 24px 20px;
  }

  .top-next-departures__route-heading {
    flex-wrap: wrap;
  }

  .top-next-departures__result {
    padding: 20px 0 0;
    border-top: 1px solid #e5e5e5;
    border-left: 0;
  }

  .top-next-departures__time {
    font-size: 38px;
  }

  .top-next-departures__actions {
    text-align: left;
  }

  .top-next-departures__link {
    width: 100%;
  }

  .top-next-departures__empty {
    padding: 32px 20px;
  }
}
/* ========================================
   Authentication
======================================== */
.auth-page {
  min-height: calc(100vh - 72px);
  padding: 72px 24px 96px;
  background: #f7f8fa;
  box-sizing: border-box;
}

.auth-page__inner {
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
}

.auth-page__header {
  margin-bottom: 32px;
}

.auth-page__label {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.1em;
}

.auth-page__title {
  margin: 0;
  font-size: 40px;
  line-height: 1.3;
}

.auth-page__description {
  margin: 16px 0 0;
  color: #666;
  font-size: 14px;
  line-height: 1.8;
}

.auth-page__card {
  padding: 36px;
  border: 1px solid #e5e5e5;
  border-radius: 12px;
  background: #fff;
  box-sizing: border-box;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.auth-form__field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.auth-form__label {
  font-size: 14px;
  font-weight: 700;
}

.auth-form__input {
  width: 100%;
  min-height: 52px;
  padding: 0 16px;
  border: 1px solid #d5d5d5;
  border-radius: 8px;
  background: #fff;
  font: inherit;
  font-size: 16px;
  outline: none;
  box-sizing: border-box;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.auth-form__input:focus {
  border-color: #111;
  box-shadow: 0 0 0 2px rgb(17 17 17 / 8%);
}

.auth-form__actions {
  margin-top: 8px;
}

.auth-form__submit {
  width: 100%;
  min-height: 52px;
  padding: 0 24px;
  border: 1px solid #111;
  border-radius: 8px;
  color: #fff;
  background: #111;
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  box-sizing: border-box;
}

.auth-form__submit:hover {
  opacity: 0.85;
}

.auth-page__register {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 28px;
  padding-top: 28px;
  border-top: 1px solid #e5e5e5;
}

.auth-page__register-text {
  margin: 0;
  color: #666;
  font-size: 13px;
}

.auth-page__register-link {
  color: #111;
  font-size: 13px;
  font-weight: 700;
  text-underline-offset: 3px;
}

@media (max-width: 767px) {
  .auth-page {
    padding: 48px 20px 64px;
  }

  .auth-page__header {
    margin-bottom: 24px;
  }

  .auth-page__title {
    font-size: 32px;
  }

  .auth-page__card {
    padding: 28px 20px;
  }

  .auth-page__register {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }
}

.auth-form__errors {
  margin-bottom: 28px;
  padding: 16px 18px;
  border: 1px solid #dc2626;
  border-radius: 8px;
  background: #fff7f7;
}

.auth-form__errors-title {
  margin: 0 0 8px;
  color: #b91c1c;
  font-size: 14px;
  font-weight: 700;
}

.auth-form__errors-list {
  margin: 0;
  padding-left: 20px;
  color: #b91c1c;
  font-size: 13px;
  line-height: 1.7;
}

/* ========================================
   Error Page
======================================== */
.error-page {
  display: flex;
  align-items: center;
  min-height: calc(100vh - 72px);
  padding: 72px 24px 96px;
  background: #f7f8fa;
  box-sizing: border-box;
}

.error-page__inner {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 56px 48px;
  border: 1px solid #e5e5e5;
  border-radius: 16px;
  background: #fff;
  text-align: center;
  box-sizing: border-box;
}

.error-page__code {
  margin: 0 0 12px;
  color: #666;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.error-page__title {
  margin: 0;
  font-size: 32px;
  line-height: 1.4;
}

.error-page__text {
  margin: 20px 0 0;
  color: #555;
  font-size: 15px;
  line-height: 1.8;
}

.error-page__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  margin-top: 32px;
  padding: 0 28px;
  border-radius: 8px;
  color: #fff;
  background: #111;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  box-sizing: border-box;
}

.error-page__link:hover {
  opacity: 0.85;
}

@media (max-width: 767px) {
  .error-page {
    align-items: flex-start;
    padding: 48px 20px 64px;
  }

  .error-page__inner {
    padding: 40px 20px;
  }

  .error-page__title {
    font-size: 26px;
  }

  .error-page__text {
    font-size: 14px;
  }

  .error-page__link {
    width: 100%;
  }
}

/* ========================================
   Norutoki — fresh green visual theme
   Existing BEM hooks and behavior remain unchanged.
======================================== */
:root {
  --color-primary: #38b76b;
  --color-primary-dark: #187a45;
  --color-primary-light: #eaf8ef;
  --color-background: #f8fbf8;
  --color-surface: #fff;
  --color-text: #202522;
  --color-text-sub: #66706a;
  --color-accent: #ffd85a;
  --color-danger: #dc2626;
  --color-border: #dce8df;
  /* White button text needs a deeper green than the illustration accent. */
  --color-action: #21834b;
  --radius-card: 20px;
  --radius-control: 12px;
  --shadow-card: 0 6px 24px rgb(26 78 46 / 5%);
  --shadow-hover: 0 10px 28px rgb(26 78 46 / 10%);
}

*, *::before, *::after { box-sizing: border-box; }
body {
  color: var(--color-text);
  background: var(--color-background);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Kaku Gothic ProN", "Noto Sans JP", Meiryo, sans-serif;
  line-height: 1.7;
  overflow-wrap: anywhere;
}
a { color: var(--color-primary-dark); text-underline-offset: 4px; }
button, input, select, textarea { font-family: inherit; }
button, input[type="submit"] { cursor: pointer; }
form.button_to { margin: 0; }
main { min-width: 0; }
:focus-visible {
  outline: 3px solid var(--color-primary-dark);
  outline-offset: 4px;
}
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.header { border-color: var(--color-border); box-shadow: 0 2px 12px rgb(26 78 46 / 3%); }
.header__inner { max-width: 1120px; gap: 16px; }
.header__logo { color: var(--color-primary-dark); font-size: 26px; letter-spacing: -1px; }
.header__nav { gap: 20px; min-width: 0; }
.header__user-name { color: var(--color-text-sub); }
.header__link { display: inline-flex; align-items: center; min-height: 44px; color: var(--color-primary-dark); }
.header__login, .header__logout { min-height: 44px; border-color: var(--color-border); border-radius: 999px; color: var(--color-primary-dark); line-height: 1.4; }

/* Full illustration: preserve both the lettering and the bus at every width. */
.top-hero { padding: 32px 24px 48px; background: var(--color-background); }
.top-hero__inner { max-width: 1072px; }
.top-hero__visual { overflow: hidden; border-radius: 28px; background: #edf9f4; box-shadow: var(--shadow-card); }
.top-hero__image { display: block; width: 100%; height: auto; aspect-ratio: 1672 / 941; object-fit: contain; object-position: center; }
.top-hero__content { display: flex; align-items: center; justify-content: space-between; gap: 28px; padding: 28px 8px 0; }
.top-hero__description { margin: 0; color: var(--color-text-sub); font-size: 15px; line-height: 1.9; }
.top-hero__description br { display: none; }
.top-hero__actions { flex-shrink: 0; gap: 12px; margin: 0; }
.top-hero__button, .top-hero__login { min-width: 148px; min-height: 52px; padding: 12px 20px; }
.top-about { padding: 64px 24px 80px; background: var(--color-surface); border-top: 1px solid var(--color-border); }
.top-about__inner { max-width: 960px; padding-left: 28px; border-left: 4px solid var(--color-primary); }
.top-about__title { font-size: clamp(24px, 3vw, 32px); margin-bottom: 24px; }
.top-about__description { color: var(--color-text-sub); font-size: 16px; }

.my-page, .usual-routes, .usual-route-detail, .usual-route-edit,
.timetable-new, .timetable-edit, .timetable-index, .next-departures, .auth-page, .error-page {
  background: var(--color-background);
  padding-top: 52px;
}
.my-page__header, .usual-routes__header, .usual-route-detail__header, .usual-route-edit__header { margin-bottom: 32px; }
.my-page__title, .usual-routes__title, .usual-route-detail__title, .usual-route-edit__title,
.timetable-new__title, .timetable-edit__title, .timetable-index__title, .next-departures__title, .auth-page__title {
  font-size: clamp(28px, 4vw, 36px); letter-spacing: .01em;
}
.my-page__label, .usual-routes__label, .usual-route-detail__label, .usual-route-edit__label,
.timetable-index__label, .next-departures__label, .auth-page__label,
.top-next-departures__label, .usual-route-detail__next-label {
  color: var(--color-primary-dark); font-size: 12px; letter-spacing: .16em;
}
.my-page__label::before, .usual-routes__label::before, .usual-route-detail__label::before,
.usual-route-edit__label::before, .timetable-index__label::before, .next-departures__label::before,
.auth-page__label::before, .top-next-departures__label::before, .usual-route-detail__next-label::before {
  content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 9px;
  border-radius: 50%; background: var(--color-primary);
}

/* Surfaces follow existing information groups. */
.my-page__user-card, .my-page__empty, .my-page__route-item,
.usual-routes__card, .usual-routes__empty, .usual-route-detail__card, .usual-route-detail__next-card,
.usual-route-edit__form, .timetable-form, .timetable-new__route, .timetable-edit__route,
.timetable-index__route, .timetable-index__card, .timetable-index__empty,
.next-departures__card, .next-departures__empty, .top-next-departures__card,
.top-next-departures__empty, .auth-page__card, .error-page__inner, .timetable-new__complete {
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: var(--radius-card); box-shadow: var(--shadow-card);
}
.my-page__user-item, .usual-route-detail__item, .timetable-index__card-header, .timetable-index__departure { border-color: var(--color-border); }
.my-page__user-item dt, .usual-route-detail__item-label { color: var(--color-text-sub); }
.my-page__route-item { border-left: 4px solid var(--color-primary); }
.my-page__route-name { font-size: 20px; }
.my-page__route-path { font-size: 15px; }
.usual-routes__card { border-left: 4px solid var(--color-primary); }
.usual-routes__name { margin-bottom: 12px; }
.usual-routes__name-link { color: var(--color-text); text-decoration: none; }
.usual-routes__name-link:hover { color: var(--color-primary-dark); text-decoration: underline; }
.usual-routes__places { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); padding-top: 12px; }
.usual-routes__places > span { min-width: 0; }
.usual-routes__arrow, .top-next-departures__route-path span, .next-departures__route-path span { color: var(--color-primary-dark); font-weight: 700; }
.usual-routes__arrow { display: grid; place-items: center; width: 32px; height: 32px; background: var(--color-primary-light); border-radius: 50%; }
.usual-routes__direction, .next-departures__direction, .top-next-departures__direction {
  display: inline-flex; width: fit-content; align-items: center; flex-shrink: 0;
  margin: 0 0 12px; padding: 5px 12px; min-height: 28px; border-radius: 999px;
  background: var(--color-primary-light); color: var(--color-primary-dark); font-size: 12px; font-weight: 700; line-height: 1.5;
}
.next-departures__direction { margin-top: 12px; margin-bottom: 0; }
.top-next-departures__direction { margin: 0; }
.usual-routes__filters { border-color: var(--color-border); border-radius: 14px; }
.usual-routes__filter { min-height: 44px; border-radius: 10px; }
.usual-routes__filter.is-active { background: var(--color-primary-dark); }
.usual-routes__favorite-button { min-height: 44px; border-color: var(--color-border); line-height: 1.4; }
.usual-routes__favorite-button.is-favorite, .next-departures__favorite { background: #fff6d4; color: #795600; border-color: var(--color-accent); }
.next-departures__favorite { line-height: 1.5; }
.usual-routes__order-button { border-color: var(--color-border); color: var(--color-primary-dark); border-radius: var(--radius-control); }

/* Next departure is the strongest information after the hero. */
.top-next-departures { padding: 48px 24px 64px; background: var(--color-primary-light); border-top: 1px solid #d6ecde; }
.top-next-departures__title { font-size: clamp(26px, 3.5vw, 32px); }
.top-next-departures__card, .next-departures__card { border-top: 3px solid var(--color-primary); }
.top-next-departures__route-heading { flex-wrap: wrap; }
.top-next-departures__route-name, .next-departures__route-name { font-size: 22px; }
.top-next-departures__route-path, .next-departures__route-path { font-size: 16px; line-height: 1.9; }
.top-next-departures__result, .next-departures__result { border-color: var(--color-border); }
.top-next-departures__time, .next-departures__time, .usual-route-detail__next-time {
  color: var(--color-primary-dark); font-size: clamp(48px, 6vw, 60px); line-height: 1.15;
  letter-spacing: -.035em; font-variant-numeric: tabular-nums;
}
.top-next-departures__countdown, .next-departures__countdown, .usual-route-detail__next-countdown {
  max-width: 100%; padding: 7px 16px; background: var(--color-accent); color: #493b0a; font-size: 19px;
}
.usual-route-detail__next-card { border-left: 4px solid var(--color-primary); }
.usual-route-detail__actions { flex-wrap: wrap; gap: 12px; }

/* Buttons: deeper green ensures legibility of white labels. */
.top-hero__button, .top-hero__login, .usual-routes__new-link,
.usual-route-detail__timetable-link, .usual-route-detail__edit-link, .usual-route-detail__next-link,
.usual-route-detail__delete-button, .usual-route-detail__back-link, .usual-route-edit__submit, .usual-route-edit__cancel,
.timetable-form__submit, .timetable-form__back, .timetable-form__add, .timetable-form__remove,
.timetable-index__new-link, .timetable-index__edit-link, .timetable-index__delete-button, .timetable-index__back-link,
.timetable-edit__delete-button, .next-departures__link, .next-departures__empty-link, .next-departures__back-link,
.my-page__next-departures-link, .my-page__routes-link, .top-next-departures__link, .auth-form__submit, .error-page__link {
  min-height: 48px; border-radius: var(--radius-control); line-height: 1.5;
  border: 1px solid var(--color-primary-dark); background: var(--color-surface); color: var(--color-primary-dark);
  text-align: center; padding-top: 10px; padding-bottom: 10px;
}
.top-hero__button, .usual-routes__new-link, .usual-route-detail__timetable-link:first-child,
.usual-route-detail__next-link, .usual-route-edit__submit, .timetable-form__submit,
.timetable-index__new-link, .next-departures__empty-link, .my-page__next-departures-link,
.top-next-departures__link, .auth-form__submit, .error-page__link {
  background: var(--color-action); border-color: var(--color-action); color: white;
  box-shadow: 0 3px 8px rgb(24 122 69 / 12%);
}
.usual-route-detail__back-link, .usual-route-edit__cancel, .timetable-form__back,
.timetable-index__back-link, .next-departures__back-link { border-color: var(--color-border); color: var(--color-text-sub); }
.usual-route-detail__delete-button, .timetable-index__delete-button, .timetable-edit__delete-button, .timetable-form__remove {
  border-color: var(--color-danger); color: var(--color-danger); background: var(--color-surface);
}

/* Form geometry also applies to rows inserted by the existing JS template. */
.usual-route-edit__inner, .timetable-new__inner, .timetable-edit__inner { max-width: 800px; }
.usual-route-edit__input, .timetable-form__select, .timetable-form__time, .timetable-form__input, .auth-form__input {
  min-width: 0; max-width: 100%; min-height: 50px; border-radius: var(--radius-control);
  border-color: #bccfc2; background: #fcfefc; color: var(--color-text); font-size: 16px;
}
textarea.usual-route-edit__input { height: auto; min-height: 128px; padding: 12px 14px; resize: vertical; }
.usual-route-edit__input:focus, .timetable-form__select:focus, .timetable-form__time:focus,
.timetable-form__input:focus, .auth-form__input:focus {
  border-color: var(--color-primary); outline: 2px solid var(--color-primary-dark); outline-offset: 3px; box-shadow: none;
}
.timetable-form__departure { grid-template-columns: minmax(0, 160px) minmax(0, 1fr) auto; align-items: end; gap: 16px; border-color: var(--color-border); }
.timetable-form__departure:first-of-type { border-color: var(--color-border); }
.timetable-form__remove { margin-bottom: 1px; }
.timetable-form__time { font-variant-numeric: tabular-nums; }
.timetable-new__complete { padding: 24px; }
.timetable-index__card { border-top: 4px solid var(--color-primary); }
.timetable-index__day-type { display: inline-flex; padding: 6px 16px; border-radius: 999px; color: var(--color-primary-dark); background: var(--color-primary-light); font-size: 18px; }
.timetable-index__card--day-1 { border-top-color: #4c85b0; }
.timetable-index__card--day-1 .timetable-index__day-type { color: #285d86; background: #edf5fc; }
.timetable-index__card--day-2 { border-top-color: #d79a49; }
.timetable-index__card--day-2 .timetable-index__day-type { color: #885619; background: #fff5e6; }
.timetable-index__card-actions { flex-wrap: wrap; }
.timetable-index__time { min-width: 88px; color: var(--color-primary-dark); font-size: 26px; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.timetable-index__departure { padding: 16px 8px; }
.timetable-index__departure:nth-child(even) { background: #f5faf6; }
.auth-page__register-link { display: inline-flex; align-items: center; min-height: 44px; color: var(--color-primary-dark); }

/* Interaction without new JavaScript. */
a, button, input[type="submit"] { transition: background-color .18s ease, color .18s ease, border-color .18s ease, transform .18s ease, box-shadow .18s ease; }
.usual-routes__card { transition: transform .2s ease, box-shadow .2s ease; }
.top-hero__content { animation: norutoki-fade-up .5s ease-out both; }
@keyframes norutoki-fade-up { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
@media (hover: hover) {
  .usual-routes__card:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); }
  a[class]:hover, button:hover, input[type="submit"]:hover { transform: translateY(-1px); }
  .top-hero__login:hover, .header__login:hover, .header__logout:hover,
  .usual-route-detail__timetable-link:hover, .usual-route-detail__edit-link:hover,
  .my-page__routes-link:hover, .timetable-index__edit-link:hover, .timetable-form__add:hover, .next-departures__link:hover {
    background: var(--color-primary-light); color: var(--color-primary-dark);
  }
  .top-hero__button:hover, .usual-routes__new-link:hover, .usual-route-detail__timetable-link:first-child:hover,
  .usual-route-detail__next-link:hover, .usual-route-edit__submit:hover, .timetable-form__submit:hover,
  .timetable-index__new-link:hover, .next-departures__empty-link:hover, .my-page__next-departures-link:hover,
  .top-next-departures__link:hover, .auth-form__submit:hover, .error-page__link:hover {
    background: var(--color-primary-dark); color: white; opacity: 1;
  }
}
.usual-route-detail__delete-button:hover, .timetable-index__delete-button:hover,
.timetable-edit__delete-button:hover, .timetable-form__remove:hover { background: var(--color-danger); color: white; }
/* Override legacy component outlines while preserving keyboard focus. */
a:focus-visible, button:focus-visible, input[type="submit"]:focus-visible { outline: 3px solid var(--color-primary-dark); outline-offset: 4px; }

@media (max-width: 900px) {
  .top-hero__content { flex-direction: column; text-align: center; gap: 20px; }
  .top-hero__description { max-width: 560px; }
  .timetable-form__departure { grid-template-columns: minmax(0, 140px) minmax(0, 1fr); }
  .timetable-form__remove { grid-column: 2; justify-self: end; }
}
@media (max-width: 767px) {
  .header__inner { padding: 10px 16px; min-height: 68px; flex-wrap: wrap; gap: 8px 12px; }
  .header__logo { font-size: 23px; }
  .header__nav { gap: 10px; }
  .header__user-name { display: inline; max-width: 105px; font-size: 12px; }
  .header__login, .header__logout { padding: 8px 12px; }
  .top-hero { padding: 20px 16px 32px; }
  .top-hero__visual { border-radius: 18px; }
  .top-hero__content { padding: 20px 4px 0; text-align: left; align-items: stretch; }
  .top-hero__actions { width: 100%; gap: 10px; }
  .top-hero__button, .top-hero__login { min-height: 50px; }
  .top-about { padding: 40px 20px 48px; }
  .top-about__inner { padding-left: 18px; }
  .top-about__description { font-size: 15px; }
  .my-page, .usual-routes, .usual-route-detail, .usual-route-edit,
  .timetable-new, .timetable-edit, .timetable-index, .next-departures, .auth-page, .error-page { padding: 32px 20px 56px; }
  .top-next-departures { padding: 32px 20px 40px; }
  .top-next-departures__card, .next-departures__card { padding: 24px 20px; gap: 20px; }
  .top-next-departures__result, .next-departures__result { padding: 20px 0 0; }
  .top-next-departures__time, .next-departures__time, .usual-route-detail__next-time { font-size: 52px; }
  .top-next-departures__route-name, .next-departures__route-name { font-size: 20px; }
  .my-page__route-actions, .usual-route-detail__actions { gap: 10px; }
  .usual-routes__card-content { width: 100%; }
  .usual-routes__filters { width: 100%; }
  .usual-route-detail__actions > *, .usual-route-detail__actions button { width: 100%; }
  .timetable-form__departure { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .timetable-form__remove { grid-column: auto; justify-self: stretch; }
  .timetable-index__card-header { flex-direction: column; align-items: stretch; gap: 16px; }
  .timetable-index__day-type { align-self: flex-start; }
  .timetable-index__card-actions > * { flex: 1; }
  .timetable-index__card-actions button { width: 100%; }
  .timetable-index__note { min-width: 0; }
  .timetable-new__complete .timetable-form__back { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  a[class]:hover, button:hover, input[type="submit"]:hover, .usual-routes__card:hover { transform: none; }
}

/* Clickable route card */
.usual-routes__card[data-route-card] {
  cursor: pointer;
}

.usual-routes__card[data-route-card]:focus-visible {
  outline: 3px solid var(--color-primary-dark);
  outline-offset: 4px;
}

/* Prevent iOS Safari time input overflow */
@media (max-width: 767px) {
  .timetable-form__departure,
  .timetable-form__field,
  .timetable-form__time-wrapper {
    min-width: 0;
    max-width: 100%;
  }

  .timetable-form__time-wrapper {
    display: flex;
    align-items: center;
    width: 100%;
    height: 48px;
    padding: 0 14px;
    overflow: hidden;
    border: 1px solid #ccc;
    border-radius: 8px;
    background: #fff;
    box-sizing: border-box;
  }

  input[type="time"].timetable-form__time {
    display: block;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    height: 100%;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-sizing: border-box;
    font: inherit;
    text-align: center;
    -webkit-appearance: none;
    appearance: none;
  }
}
