.app-shell {
  /* Premium Design Tokens (DrukPlus Palette) */
  --bg: #f8fafc;
  --panel: #ffffff;
  --surface: #ffffff;
  --surface-soft: #f1f5f9;
  --ink: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  
  --bus: #ff6b1a; /* DrukPlus Coral/Orange */
  --bus-soft: #fff3eb;
  --bus-deep: #ea580c;
  
  --trolley: #2676bb; /* DrukPlus Blue */
  --trolley-soft: #eff6ff;
  --trolley-deep: #1d4ed8;
  
  --blue: #2676bb;
  --blue-soft: #eff6ff;
  --danger: #ef4444;
  --shadow: 0 10px 30px -5px rgba(15, 23, 42, 0.08), 0 4px 12px -2px rgba(15, 23, 42, 0.03);
  --shadow-soft: 0 4px 8px -2px rgba(15, 23, 42, 0.04);
  
  width: min(100%, 460px);
  min-height: 80vh;
  margin: 0 auto;
  background: var(--panel);
  box-shadow: var(--shadow);
  color: var(--ink);
  font-family: 'Onest', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  border-radius: 20px;
  border: 1px solid var(--line);
  overflow: hidden;
  transition: box-shadow 0.3s ease;
}

@media (max-width: 480px) {
  .app-shell {
    border-radius: 0;
    min-height: 100vh;
    border: none;
    box-shadow: none;
  }
}

.app-shell button,
.app-shell input {
  font: inherit;
}

.app-shell button {
  -webkit-tap-highlight-color: transparent;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.app-shell button:active {
  transform: scale(0.97);
}

.topbar {
  position: relative;
  z-index: 10;
  display: grid;
  grid-template-columns: 42px 1fr 42px;
  gap: 12px;
  align-items: center;
  min-height: 80px;
  padding: 14px 20px;
  background: rgba(255, 255, 255, 0.90);
  border-bottom: 1px solid rgba(226, 232, 240, 0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.topbar-title-container {
  text-align: center;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  min-width: 0;
}

.topbar-text-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 0;
}

.header-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 0;
  height: 28px;
  opacity: 0;
  transform: scale(0.6);
  pointer-events: none;
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  flex-shrink: 0;
  overflow: hidden;
}

.is-main-screen .header-icon {
  width: 28px;
  opacity: 1;
  transform: scale(1);
}

.is-main-screen .header-icon-bus {
  margin-right: 12px;
  color: var(--bus);
}

.is-main-screen .header-icon-trolley {
  margin-left: 12px;
  color: var(--trolley);
}

@keyframes gentleSway {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-4px);
  }
}

.is-main-screen .header-icon-bus {
  animation: gentleSway 3s ease-in-out infinite;
}

.is-main-screen .header-icon-trolley {
  animation: gentleSway 3s ease-in-out infinite 1.5s;
}


.home-button,
.back-button {
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-soft);
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.home-button svg,
.back-button svg {
  display: block;
}

.home-button.is-visible,
.back-button.is-visible {
  opacity: 1;
  pointer-events: auto;
}

@keyframes pulseBackGlow {
  0% {
    box-shadow: 0 0 0 0 rgba(38, 118, 187, 0.35);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(38, 118, 187, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(38, 118, 187, 0);
  }
}

.back-button.is-visible {
  animation: pulseBackGlow 2s infinite;
  border-color: rgba(38, 118, 187, 0.4);
  color: var(--blue);
}

.back-button:hover {
  background: var(--blue-soft);
  color: var(--blue);
  border-color: var(--blue);
  transform: translateX(-3px);
}

.home-button:hover {
  background: var(--blue-soft);
  color: var(--blue);
  border-color: var(--blue);
  transform: translateY(-2px);
}

.back-button:active,
.home-button:active {
  transform: scale(0.95);
}

.eyebrow {
  margin: 0 0 2px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.app-shell h1,
.app-shell h2,
.app-shell h3,
.app-shell p {
  margin-top: 0;
}

.app-shell h1 {
  margin-bottom: 0;
  font-size: 26px;
  font-weight: 800;
  line-height: 1.15;
  color: var(--ink);
}

.screen {
  display: none;
  padding: 24px 20px 32px;
}

.screen.is-active {
  display: block;
  animation: shellFadeIn 0.35s ease-out;
}

@keyframes shellFadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.transport-section {
  margin-bottom: 30px;
}

.transport-section h3 {
  font-weight: 700;
  color: var(--ink);
}

.transport-section h3::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 20px;
  border-radius: 99px;
  background: var(--bus);
  margin-right: 10px;
  vertical-align: -3px;
}

.transport-section + .transport-section h3::before {
  background: var(--trolley);
}

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

/* Large and spacious buttons for mobile tapping */
.route-button {
  position: relative;
  min-height: 84px;
  padding: 10px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-soft);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.route-button::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 6px;
  background: var(--bus);
}

.route-button-trolley::before {
  background: var(--trolley);
}

.route-number {
  display: block;
  font-size: 32px;
  font-weight: 800;
  line-height: 1.1;
  color: var(--ink);
}

.route-button:hover {
  transform: translateY(-2px);
  border-color: var(--muted);
  box-shadow: var(--shadow);
}

.route-button:active {
  transform: translateY(1px);
}

.route-heading {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  margin-bottom: 20px;
}

.route-heading h2 {
  margin-bottom: 6px;
  font-size: 26px;
  font-weight: 800;
  line-height: 1.15;
}

.route-heading p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 14px;
}

.directions {
  margin-top: 10px;
}

.direction-block {
  margin-bottom: 18px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.direction-block h3 {
  margin: 0;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-soft);
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
}

.stop-list {
  display: grid;
}

.stop-button {
  display: grid;
  grid-template-columns: 1fr 24px;
  gap: 12px;
  align-items: center;
  width: 100%;
  min-height: 56px; /* Larger row height for mobile */
  border: 0;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  text-align: left;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.3;
  padding: 16px 20px;
}

.stop-button:last-child {
  border-bottom: 0;
}

.stop-button span:last-child {
  color: var(--muted);
  font-size: 22px;
  text-align: right;
}

.stop-button:hover,
.stop-button:focus {
  background: var(--blue-soft);
  color: var(--blue);
  outline: none;
}

.arrival-summary {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  padding: 16px 20px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.arrival-summary p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.arrival-summary time {
  display: block;
  font-size: 32px;
  font-weight: 900;
  line-height: 1;
  color: var(--blue);
}

.time-control {
  display: grid;
  grid-template-columns: 1fr 140px;
  gap: 16px;
  align-items: center;
  margin-bottom: 18px;
  padding: 14px 20px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-soft);
  color: var(--ink);
  font-size: 15px;
  font-weight: 600;
}

.time-control input {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  padding: 8px 12px;
  color: var(--ink);
  font-weight: 700;
  font-size: 16px;
  outline: none;
  transition: border-color 0.2s;
}

.time-control input:focus {
  border-color: var(--blue);
}

.selected-stop {
  margin-bottom: 16px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.selected-stop p {
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.selected-stop h2 {
  margin-bottom: 8px;
  color: var(--ink);
  font-size: 24px;
  font-weight: 800;
  line-height: 1.2;
}

.arrival-card {
  display: grid;
  gap: 12px;
}

.arrival-time {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 16px;
  min-height: 80px;
  padding: 16px 20px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  transition: transform 0.2s, border-color 0.2s;
}

.arrival-time:hover {
  transform: translateY(-1px);
  border-color: rgba(38, 118, 187, 0.4);
}

.arrival-time strong {
  color: var(--blue);
  font-size: 38px;
  font-weight: 800;
  line-height: 1;
}

.arrival-time span {
  justify-self: end;
  padding: 8px 14px;
  border-radius: 30px;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
}

.empty-state {
  margin: 0;
  padding: 30px 20px;
  border: 1px dashed var(--line);
  border-radius: 14px;
  background: var(--surface-soft);
  color: var(--muted);
  text-align: center;
  font-size: 16px;
  font-weight: 600;
}

/* SMART STOP BOARD STYLING */
.other-routes-container {
  margin-top: 30px;
  padding-top: 24px;
  border-top: 2px dashed var(--line);
}

.other-routes-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--ink);
  margin-bottom: 16px;
  padding-left: 4px;
}

.other-arrivals-list {
  display: grid;
  gap: 10px;
}

.other-arrival-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-soft);
  transition: background-color 0.2s;
  gap: 16px;
}

.other-arrival-item:hover {
  background: var(--panel);
}

.other-arrival-left {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-width: 0;
}

.other-route-badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  border-radius: 10px;
  font-size: 18px;
  font-weight: 700;
  width: fit-content;
}

.other-route-badge-bus {
  background: var(--bus-soft);
  color: var(--bus-deep);
  border: 1px solid rgba(255, 107, 26, 0.2);
}

.other-route-badge-trolley {
  background: var(--trolley-soft);
  color: var(--trolley-deep);
  border: 1px solid rgba(38, 118, 187, 0.2);
}

.other-arrival-direction {
  display: none !important;
}

.other-arrival-right {
  text-align: right;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  flex-shrink: 0;
}

.other-arrival-time {
  font-size: 28px;
  font-weight: 800;
  color: var(--ink);
  line-height: 1.1;
}

.other-arrival-wait {
  font-size: 14px;
  color: var(--muted);
  font-weight: 600;
}

.other-routes-empty {
  padding: 20px;
  border: 1px dashed var(--line);
  border-radius: 12px;
  color: var(--muted);
  text-align: center;
  font-size: 14px;
  font-weight: 500;
}

@media (max-width: 390px) {
  .topbar {
    min-height: 72px;
    padding: 10px 16px;
  }

  .app-shell h1 {
    font-size: 22px;
  }

  .screen {
    padding: 16px 14px 28px;
  }

  .route-grid {
    gap: 10px;
  }

  .route-button {
    min-height: 76px;
  }

  .route-number {
    font-size: 28px;
  }

  .direction-block h3 {
    font-size: 15px;
    padding: 14px 16px;
  }

  .stop-button {
    font-size: 15px;
    padding: 14px 16px;
  }

  .arrival-time strong {
    font-size: 32px;
  }

  .time-control {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 12px 16px;
  }
}

.feedback-note {
  margin-top: 36px;
  text-align: center;
  font-size: 14px;
  color: var(--muted);
  font-weight: 500;
}

.feedback-note a {
  color: var(--blue);
  text-decoration: none;
  font-weight: 600;
  border-bottom: 1px dashed rgba(38, 118, 187, 0.4);
  transition: border-color 0.2s, color 0.2s;
}

.feedback-note a:hover {
  color: var(--trolley-deep);
  border-bottom-color: var(--trolley-deep);
}

