:root {
  --bg: #f4f1eb;
  --bg-soft: #eeebe4;
  --surface: rgba(255, 255, 255, 0.82);
  --surface-strong: rgba(255, 255, 255, 0.94);
  --ink: #18222f;
  --muted: #6b7585;
  --line: rgba(24, 34, 47, 0.1);
  --line-strong: rgba(24, 34, 47, 0.18);
  --accent: #0e7a78;
  --accent-soft: rgba(14, 122, 120, 0.08);
  --accent-strong: #0b6664;
  --warm: #e07a52;
  --warm-soft: rgba(224, 122, 82, 0.1);
  --shadow: 0 20px 50px rgba(24, 34, 47, 0.08);
  --shadow-soft: 0 10px 24px rgba(24, 34, 47, 0.06);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: light;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Zen Maru Gothic", "Hiragino Sans", "Yu Gothic", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(14, 122, 120, 0.06), transparent 28%),
    radial-gradient(circle at top right, rgba(224, 122, 82, 0.07), transparent 24%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-soft) 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.22;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.22) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.22) 1px, transparent 1px);
  background-size: 28px 28px;
}

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

button {
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: white;
  padding: 0.88rem 1.18rem;
  cursor: pointer;
  transition: transform 160ms ease, background 180ms ease, box-shadow 180ms ease;
  box-shadow: 0 8px 24px rgba(14, 122, 120, 0.18);
}

button:hover,
button:focus-visible {
  background: var(--accent-strong);
  transform: translateY(-1px);
  box-shadow: 0 14px 28px rgba(14, 122, 120, 0.16);
}

.button-secondary {
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
  border: 1px solid var(--line);
  box-shadow: none;
}

.button-secondary:hover,
.button-secondary:focus-visible {
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow-soft);
}

input,
select,
textarea {
  width: 100%;
  margin-top: 0.45rem;
  border-radius: 14px;
  border: 1px solid rgba(24, 34, 47, 0.12);
  background: rgba(255, 255, 255, 0.9);
  padding: 0.95rem 1rem;
  color: var(--ink);
  outline: none;
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(14, 122, 120, 0.34);
  box-shadow: 0 0 0 4px rgba(14, 122, 120, 0.1);
  transform: translateY(-1px);
}

textarea {
  resize: vertical;
}

.app-shell {
  position: relative;
  z-index: 1;
  width: min(1140px, calc(100% - 1.15rem));
  margin: 0 auto;
  padding: max(1.25rem, env(safe-area-inset-top)) 0 max(1.6rem, env(safe-area-inset-bottom));
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.78fr);
  gap: 1rem;
  padding: 0.9rem 0.15rem 1rem;
  align-items: start;
}

.hero__copy {
  padding: 0.6rem 0.15rem 0;
}

.hero__aside {
  display: grid;
  gap: 0.8rem;
  align-content: start;
  justify-items: end;
}

.hero__aside-label,
.eyebrow,
.panel__kicker,
.route-card__eyebrow {
  margin: 0 0 0.45rem;
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero h1,
.panel h2,
.route-card h3 {
  margin: 0;
}

.hero h1 {
  font-family: "Zen Old Mincho", "Hiragino Mincho ProN", "Yu Mincho", serif;
  line-height: 1;
}

.panel h2,
.route-card h3,
.direction-card h4,
.week-column__header h3 {
  font-family: "Zen Maru Gothic", "Hiragino Sans", "Yu Gothic", sans-serif;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.hero h1 {
  font-size: clamp(2.7rem, 7vw, 4.4rem);
  letter-spacing: -0.03em;
  font-weight: 600;
}

.hero__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 1rem;
}

.hero-tag {
  display: inline-flex;
  align-items: center;
  min-height: 2rem;
  padding: 0.36rem 0.82rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(24, 34, 47, 0.08);
  color: var(--ink);
  font-weight: 500;
}

.dashboard {
  display: grid;
  gap: 1rem;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
  gap: 1rem;
}

.panel {
  position: relative;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  padding: 1.18rem;
  backdrop-filter: blur(18px);
}

.panel::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.24), transparent 42%);
}

.panel--hero,
.panel--overview,
.panel--notes {
  background: var(--surface);
}

.panel--focus {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(247, 250, 249, 0.84));
}

.panel--weekly {
  padding: 1.35rem;
}

.panel__header,
.route-card__header,
.direction-card__header,
.form-actions,
.meta-stack {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.9rem;
}

.panel__header,
.route-card__header {
  margin-bottom: 1.15rem;
}

.direction-card__header {
  margin-bottom: 0.75rem;
}

.meta-stack {
  flex-direction: column;
  align-items: flex-end;
}

.date-pill,
.route-badge {
  display: inline-flex;
  align-items: center;
  min-height: 2rem;
  border-radius: 999px;
  padding: 0.42rem 0.86rem;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(24, 34, 47, 0.05);
  color: var(--ink);
  font-size: 0.84rem;
  white-space: nowrap;
}

.route-badge--teal {
  background: var(--accent-soft);
  border-color: rgba(14, 122, 120, 0.16);
  color: var(--accent);
}

.meta-text,
.overview-note,
.source-line,
.notes-label,
.section-lead {
  margin: 0;
  color: var(--muted);
  font-size: 0.93rem;
  line-height: 1.65;
}

.section-lead {
  margin-bottom: 1rem;
  max-width: 44rem;
}

.source-line a {
  color: var(--accent);
  text-decoration: none;
}

.source-line a:hover,
.source-line a:focus-visible {
  text-decoration: underline;
}

.transit-grid,
.direction-grid,
.stats-grid,
.stack-form,
.form-row,
.weekly-board {
  display: grid;
  gap: 0.85rem;
}

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

.route-card {
  border-radius: 26px;
  padding: 1.08rem;
  background: var(--surface-strong);
  border: 1px solid rgba(24, 34, 47, 0.04);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.82),
    0 10px 24px rgba(24, 34, 47, 0.04);
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease, background 180ms ease;
}

.route-card:hover {
  transform: translateY(-1px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.86),
    0 16px 30px rgba(24, 34, 47, 0.06);
}

.route-card--jr {
  background:
    linear-gradient(180deg, rgba(31, 79, 121, 0.045), rgba(255, 255, 255, 0.94));
}

.route-card--hankyu {
  background:
    linear-gradient(180deg, rgba(224, 122, 82, 0.055), rgba(255, 255, 255, 0.94));
}

.route-card--bus {
  grid-column: 1 / -1;
  background:
    linear-gradient(180deg, rgba(14, 122, 120, 0.035), rgba(255, 255, 255, 0.95));
}

.route-card--collapsible {
  grid-column: 1 / -1;
  padding: 0;
  overflow: hidden;
}

.route-card__summary {
  list-style: none;
  cursor: pointer;
  padding: 1.08rem;
}

.route-card__summary .route-card__header {
  margin-bottom: 0;
}

.route-card__summary::-webkit-details-marker {
  display: none;
}

.route-card__summary-meta {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
}

.route-card__chevron {
  width: 0.72rem;
  height: 0.72rem;
  border-right: 1.5px solid rgba(24, 34, 47, 0.48);
  border-bottom: 1.5px solid rgba(24, 34, 47, 0.48);
  transform: rotate(45deg);
  transition: transform 180ms ease;
  margin-top: -0.15rem;
}

.route-card--collapsible[open] .route-card__chevron {
  transform: rotate(225deg);
  margin-top: 0.1rem;
}

.route-card__body {
  padding: 0 1.08rem 1.08rem;
  border-top: 1px solid rgba(24, 34, 47, 0.05);
}

.route-select {
  display: block;
  margin-bottom: 0.95rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.route-select select {
  margin-top: 0.4rem;
}

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

.bus-stop-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
}

.direction-card {
  padding: 1rem;
  border-radius: 20px;
  background: rgba(249, 250, 250, 0.92);
  border: 1px solid rgba(24, 34, 47, 0.04);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.direction-card h4,
.week-column__header h3 {
  margin: 0;
  font-size: 0.98rem;
}

.direction-card p,
.week-column__header p {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.bus-stop-card .departure-list {
  margin-top: 0.72rem;
}

.bus-stop-card .source-line {
  margin-top: 0.72rem;
}

.departure-list,
.agenda-list {
  list-style: none;
  margin: 0.85rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.7rem;
}

.departure-item,
.agenda-item,
.weekly-class,
.empty-state {
  border-radius: 18px;
  border: 1px solid rgba(24, 34, 47, 0.05);
  background: rgba(255, 255, 255, 0.9);
  padding: 0.94rem 1rem;
}

.departure-item,
.agenda-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.8rem;
  box-shadow: 0 6px 18px rgba(24, 34, 47, 0.035);
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.departure-item:hover,
.agenda-item:hover,
.weekly-class:hover {
  transform: translateY(-1px);
  border-color: rgba(14, 122, 120, 0.1);
  box-shadow: 0 10px 22px rgba(24, 34, 47, 0.05);
}

.departure-item__time {
  font-size: 1.38rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--ink);
}

.departure-item__meta {
  text-align: right;
  max-width: 58%;
}

.departure-item__type {
  display: block;
  font-size: 0.94rem;
  font-weight: 700;
  color: rgba(24, 34, 47, 0.92);
  line-height: 1.35;
}

.departure-item__destination,
.agenda-item span,
.weekly-class span {
  display: block;
  color: var(--muted);
  font-size: 0.87rem;
}

.focus-card {
  border-radius: var(--radius-lg);
  padding: 1.02rem 1.06rem;
}

.focus-card--light {
  background: rgba(14, 122, 120, 0.06);
  border: 1px solid rgba(14, 122, 120, 0.08);
}

.focus-card strong,
.focus-card p,
.agenda-item strong,
.weekly-class strong {
  margin: 0;
}

.focus-card p {
  margin-top: 0.45rem;
  color: var(--muted);
  line-height: 1.65;
}

.stats-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 1rem;
}

.stat-card {
  padding: 1rem;
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid rgba(24, 34, 47, 0.06);
}

.stat-card__label {
  display: block;
  color: var(--muted);
  font-size: 0.84rem;
  margin-bottom: 0.46rem;
}

.stat-card strong {
  font-size: clamp(1.28rem, 3.6vw, 1.72rem);
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.weekly-board {
  grid-template-columns: repeat(5, minmax(240px, 1fr));
  overflow-x: auto;
  padding: 0.2rem 0 0.4rem;
}

.week-column {
  min-width: 240px;
  display: grid;
  gap: 0.9rem;
}

.week-column__header {
  padding-bottom: 0.8rem;
  border-bottom: 1px solid var(--line);
}

.weekly-class {
  display: grid;
  gap: 0.3rem;
  min-height: 116px;
  align-content: start;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.weekly-class--active {
  background: var(--accent-soft);
  border-color: rgba(14, 122, 120, 0.18);
  box-shadow: 0 10px 20px rgba(14, 122, 120, 0.08);
}

.stack-form {
  margin-top: 0.35rem;
}

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

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

.form-actions {
  flex-wrap: wrap;
}

.empty-state {
  text-align: center;
  color: var(--muted);
  border-style: dashed;
}

.motion-panel {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 420ms ease, transform 420ms ease;
}

body.is-ready .motion-panel {
  opacity: 1;
  transform: translateY(0);
}

body.is-ready .motion-panel:nth-of-type(2) {
  transition-delay: 70ms;
}

body.is-ready .motion-panel:nth-of-type(3) {
  transition-delay: 120ms;
}

body.is-ready .motion-panel:nth-of-type(4) {
  transition-delay: 170ms;
}

body.is-ready .motion-panel:nth-of-type(5) {
  transition-delay: 220ms;
}

body.is-ready .motion-panel:nth-of-type(6) {
  transition-delay: 270ms;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }

  .motion-panel {
    opacity: 1;
    transform: none;
  }
}

@media (max-width: 980px) {
  .hero,
  .hero-grid,
  .transit-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .panel__header,
  .route-card__header,
  .direction-card__header {
    flex-direction: column;
  }

  .meta-stack {
    width: 100%;
    align-items: flex-start;
  }

  .direction-grid,
  .bus-stop-grid,
  .stats-grid,
  .form-row,
  .form-row--triple {
    grid-template-columns: 1fr;
  }

  .hero__aside {
    justify-items: start;
  }

  .panel--weekly {
    padding: 1rem 0.9rem;
  }

  .weekly-board {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0.45rem;
    overflow-x: visible;
    padding-bottom: 0;
  }

  .week-column {
    min-width: 0;
    gap: 0.45rem;
    align-content: start;
  }

  .week-column__header {
    padding-bottom: 0.45rem;
  }

  .week-column__header h3 {
    font-size: 0.92rem;
  }

  .week-column__header p {
    font-size: 0.72rem;
  }

  .weekly-class,
  .empty-state {
    min-height: 108px;
    padding: 0.82rem 0.58rem;
    border-radius: 16px;
  }

  .weekly-class strong {
    font-size: 0.82rem;
    line-height: 1.35;
  }

  .weekly-class span {
    font-size: 0.72rem;
    line-height: 1.35;
  }

  .empty-state {
    display: grid;
    place-items: center;
    font-size: 0.74rem;
    padding: 0.7rem 0.45rem;
  }
}
