/* Operation and settings surfaces share semantic status without large fills. */
[data-status="success"] {
  --status-color: var(--color-success);
}
[data-status="warning"] {
  --status-color: var(--color-warning);
}
[data-status="danger"] {
  --status-color: var(--color-danger);
}
[data-status="unknown"] {
  --status-color: var(--muted);
}
.operation-summary {
  border-left: 4px solid var(--status-color);
  padding: 4px 14px;
  margin: 8px 0 22px;
  background: var(--surface-primary);
  border-radius: 0 var(--radius-control) var(--radius-control) 0;
}
.operation-summary h2 {
  color: var(--status-color);
  font-size: 1.375rem;
  margin: 8px 0;
}
.operation-summary p {
  font-size: var(--type-caption);
  color: var(--muted);
}
.operation-row.native-row {
  grid-template-columns: 28px minmax(0, 1fr) auto;
  gap: 10px;
}
.operation-indicator {
  width: 24px;
  height: 24px;
  border: 1.5px solid var(--status-color);
  border-radius: var(--radius-round);
  color: var(--status-color);
  display: grid;
  place-items: center;
  font-size: 0.875rem;
  font-weight: 800;
}
.saved-place-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: end;
}
.saved-place-controls button {
  margin-right: 0;
}
.quick-place-symbol,
.quick-symbol-options button {
  display: flex;
  align-items: center;
  gap: 12px;
}
.quick-place-symbol svg,
.quick-symbol-options svg {
  width: 22px;
  height: 22px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
}
.saved-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}
.saved-row .plain-action {
  margin-right: 8px;
}
/* iOS segmented control. */
.board-day-segments {
  display: flex;
  gap: 2px;
  margin: 12px 0;
  padding: 2px;
  border-radius: var(--radius-small);
  background: var(--fill-tertiary);
}
.board-day-segments button {
  flex: 1;
  min-height: 44px;
  border: 0;
  border-radius: var(--radius-compact);
  background: transparent;
  color: var(--text);
  font-size: var(--type-secondary);
  font-weight: 600;
}
.board-day-segments button[aria-pressed="true"] {
  background: var(--surface-segment-selected);
  box-shadow: var(--shadow-toggle);
}
.originating-badge {
  border: 1px solid currentColor;
  border-radius: var(--radius-tiny);
  padding: 1px 4px;
}
.operations-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 0.75rem;
}
.operations-updated {
  margin-left: 6px;
  font-variant-numeric: tabular-nums;
}
.operations-updated::before {
  content: "·";
  margin-right: 6px;
}
.operations-updated[data-stale] {
  color: var(--warning);
  font-weight: 600;
}
.operations-head [data-operations-refresh]:disabled {
  color: var(--muted);
  opacity: 1;
}
.operation-card {
  padding: 16px;
  margin-bottom: 12px;
}
.operation-title {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
}
.operation-title h2 {
  font-size: 1.0625rem;
  margin: 0;
}
.operation-card p {
  color: var(--muted);
  line-height: 1.45;
  margin: 10px 0;
}
.operation-routes {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.operation-routes span {
  background: var(--panel-2);
  border-radius: var(--radius-capsule);
  padding: 5px 8px;
  font-size: var(--type-caption);
  font-weight: 700;
}
.status-dot {
  width: 10px;
  height: 10px;
  border-radius: var(--radius-round);
  background: var(--muted);
}
.status-dot.normal {
  background: var(--green);
}
.status-dot.delay,
.status-dot.warning {
  background: var(--orange);
}
.status-dot.suspended,
.status-dot.error {
  background: var(--red);
}
.operation-notices {
  padding-left: 18px;
}
.operation-notices a {
  text-decoration: none;
}
.settings-section {
  margin-bottom: 22px;
}
.settings-section > h2 {
  font-size: 0.8125rem;
  color: var(--muted);
  margin: 0 8px 8px;
}
.settings-menu-row {
  /* The tile grows modestly with Dynamic Type, as in iOS Settings. */
  --tile-size: clamp(30px, 1.76em, 42px);
  position: relative;
  grid-template-columns: var(--tile-size) minmax(0, 1fr) auto;
  gap: 14px;
  border-bottom: 0;
}
/* Inset separator that starts at the title, as in iOS grouped lists. */
.settings-menu-row + .settings-menu-row::before {
  content: "";
  position: absolute;
  inset-block-start: 0;
  inset-inline: calc(16px + var(--tile-size) + 14px) 0;
  height: 1px;
  background: var(--separator);
  pointer-events: none;
}
.settings-menu-symbol {
  --tile: var(--tile-gray);
  --knock: var(--tile);
  display: grid;
  place-items: center;
  width: var(--tile-size);
  height: var(--tile-size);
  border-radius: var(--radius-marker);
  background: var(--tile);
  color: var(--tile-glyph);
  box-shadow: var(--shadow-tile);
  transition: transform 0.32s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.settings-menu-row:active .settings-menu-symbol {
  transform: scale(0.9);
  transition-duration: 0.12s;
  transition-timing-function: ease-out;
}
.settings-menu-symbol[data-tile="green"] { --tile: var(--tile-green); }
.settings-menu-symbol[data-tile="teal"] { --tile: var(--tile-teal); }
.settings-menu-symbol[data-tile="red"] { --tile: var(--tile-red); }
.settings-menu-symbol[data-tile="indigo"] { --tile: var(--tile-indigo); }
.settings-menu-symbol[data-tile="blue"] { --tile: var(--tile-blue); }
.settings-menu-symbol[data-tile="orange"] { --tile: var(--tile-orange); }
.settings-menu-symbol[data-tile="pink"] { --tile: var(--tile-pink); }
.settings-menu-symbol[data-tile="purple"] { --tile: var(--tile-purple); }
html[data-high-contrast="true"] .settings-menu-row + .settings-menu-row::before {
  background: var(--text);
}
@media (prefers-reduced-motion: reduce) {
  .settings-menu-symbol,
  .settings-menu-row:active .settings-menu-symbol {
    transition: none;
    transform: none;
  }
}
.settings-menu-symbol svg {
  width: 64%;
  height: 64%;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 15px;
  border-bottom: 1px solid var(--separator);
}
.setting-row:last-child {
  border-bottom: 0;
}
.setting-row b,
.source-list b,
.slider-card b {
  display: block;
}
.setting-row small,
.source-list small,
.slider-card small {
  display: block;
  color: var(--muted);
  font-size: var(--type-caption);
  margin-top: 2px;
  line-height: 1.35;
}
.setting-row input[type="checkbox"] {
  appearance: none;
  width: 48px;
  height: 28px;
  border-radius: var(--radius-capsule);
  background: var(--separator);
  position: relative;
  transition: 0.18s;
  flex: 0 0 auto;
}
.setting-row input[type="checkbox"]::after {
  content: "";
  position: absolute;
  width: 24px;
  height: 24px;
  left: 2px;
  top: 2px;
  border-radius: var(--radius-round);
  background: var(--color-on-accent);
  box-shadow: var(--shadow-toggle);
  transition: 0.18s;
}
.setting-row input[type="checkbox"]:checked {
  background: var(--green);
}
.setting-row input[type="checkbox"]:checked::after {
  transform: translateX(20px);
}
.pass-range {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 10px;
  align-items: end;
  padding: 16px;
}
.pass-range label,
.pass-expiry {
  display: grid;
  gap: 6px;
  min-width: 0;
  color: var(--muted);
  font-size: 0.75rem;
}
.pass-range > span {
  min-height: 44px;
  display: grid;
  place-items: center;
  color: var(--muted);
}
.pass-expiry {
  padding: 0 16px 16px;
}
.pass-range select,
.pass-expiry input {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 8px 10px;
  border: 1px solid var(--separator);
  border-radius: var(--radius-small);
  background: var(--panel-2);
  font: inherit;
  color: var(--text);
}
.setting-row:has(select) {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(5rem, auto);
  gap: 12px;
}
.setting-row select {
  min-width: 80px;
  max-width: 100%;
  min-height: 44px;
  padding: 8px 10px;
  border: 1px solid var(--separator);
  border-radius: var(--radius-option);
  background-color: var(--surface-secondary);
  padding-inline-end: 32px;
  color: var(--text);
  font: inherit;
}
.settings-card {
  container-type: inline-size;
}
@container (max-width:18rem) {
  .setting-row:has(select) {
    grid-template-columns: minmax(0, 1fr);
  }
  .pass-range {
    grid-template-columns: minmax(0, 1fr);
  }
  .pass-range > span {
    display: none;
  }
}
.source-list > div {
  padding: 13px 15px;
  border-bottom: 1px solid var(--separator);
}
.source-list > div:last-child {
  border-bottom: 0;
}
.slider-card {
  padding: 15px;
}
.slider-card label {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}
.slider-card input[type="range"] {
  min-height: 44px;
  grid-column: 1/-1;
  width: 100%;
  accent-color: var(--blue);
}
.sheet {
  width: min(calc(100% - 18px), 680px);
  max-height: min(82vh, 760px);
  padding: 0;
  border: 0;
  border-radius: var(--radius-glass) var(--radius-glass) var(--radius)
    var(--radius);
  background: var(--panel);
  color: var(--text);
  box-shadow: var(--shadow-sheet);
}
.sheet[data-detent] {
  position: fixed;
  inset: auto 0 var(--keyboard-bottom, 0px);
  margin: 0 auto;
  width: min(100%, 680px);
  max-width: 100%;
  max-height: calc(var(--app-height, 100dvh) * 0.9);
  border-radius: var(--radius-sheet) var(--radius-sheet) 0 0;
}
.sheet[data-detent="fit"] {
  height: auto;
}
.sheet[data-detent="fit"] .sheet-body {
  flex: 0 1 auto;
}
.sheet[data-detent="medium"],
.place-sheet[data-detent="medium"] {
  height: min(calc(var(--app-height, 100dvh) * 0.58), 560px);
}
.sheet[data-detent="large"],
.place-sheet[data-detent="large"] {
  height: min(calc(var(--app-height, 100dvh) * 0.9), 900px);
}
.sheet[data-detent] .sheet-body {
  flex: 1;
}
.sheet::backdrop {
  background: var(--material-backdrop);
  backdrop-filter: blur(3px);
}
.choice-icon svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.sheet-header {
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 18px 12px;
  background: var(--material-navigation);
  border-bottom: 1px solid var(--separator);
}
.sheet-header [data-save-place] {
  flex: none;
  white-space: nowrap;
}
.sheet-header h2 {
  min-width: 0;
  overflow-wrap: anywhere;
  margin: 0;
  font-size: 1.25rem;
}
.sheet-close,
.sheet-back {
  border: 0;
  background: transparent;
  color: var(--blue);
  font-weight: 700;
}
.sheet-close {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-round);
  background: var(--panel-2);
  display: grid;
  place-items: center;
}
.sheet-close svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
}
.sheet-body {
  padding: 16px 16px calc(20px + var(--safe-bottom));
  overflow: auto;
}
.sheet-intro {
  margin: 0 4px 14px;
  color: var(--muted);
  font-size: 0.8125rem;
  line-height: 1.45;
}
.choice-row {
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  padding: 14px 4px;
  border-bottom: 1px solid var(--separator);
}
.choice-row .choice-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-control-tight);
  background: var(--blue-soft);
  color: var(--blue);
  display: grid;
  place-items: center;
  font-weight: 900;
}
.choice-row b {
  display: block;
}
.choice-row small {
  display: block;
  color: var(--muted);
  font-size: var(--type-caption);
  margin-top: 3px;
}
.sheet-field {
  margin: 12px 0;
}
.fold-results article {
  padding: 12px 2px;
  border-bottom: 1px solid var(--separator);
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px 12px;
}
.fold-results article b {
  font-size: 1.125rem;
}
.fold-results article span {
  align-self: center;
}
.fold-results article small {
  grid-column: 1/-1;
  color: var(--muted);
}
.target-train {
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  padding: 12px 3px;
  border-bottom: 1px solid var(--separator);
}
.target-train b {
  font-size: 1.0625rem;
}
.target-train span {
  font-size: 0.8125rem;
}
.target-train small {
  color: var(--blue);
  font-size: var(--type-caption);
}
.target-result {
  border-radius: var(--radius-inset);
  padding: 16px;
  margin-top: 12px;
  background: var(--panel-2);
}
.target-result.ok span {
  color: var(--green);
  font-weight: 800;
}
.target-result.ng span {
  color: var(--red);
  font-weight: 800;
}
.target-result b {
  display: block;
  font-size: 1.3125rem;
  margin: 5px 0;
}
.target-result p {
  color: var(--muted);
  margin: 0;
  line-height: 1.5;
}
#toast {
  position: fixed;
  z-index: 80;
  left: 50%;
  bottom: calc(88px + var(--safe-bottom));
  transform: translate(-50%, 14px);
  max-width: calc(100% - 34px);
  background: color-mix(in srgb, var(--text) 88%, transparent);
  color: var(--bg);
  padding: 10px 14px;
  border-radius: var(--radius-control);
  font-size: 0.8125rem;
  font-weight: 700;
  opacity: 0;
  pointer-events: none;
  transition: 0.2s;
}
#toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}
@media (max-width: 430px) {
  main {
    padding-left: 10px;
    padding-right: 10px;
  }
  .topbar {
    padding-left: 16px;
    padding-right: 16px;
  }
  .topbar h1 {
    font-size: 2rem;
  }
  .hero-card {
    border-radius: var(--radius-sheet);
    padding: 21px 18px;
  }
  .hero-card h2 {
    font-size: 1.75rem;
  }
  .section-block {
    padding: 16px;
  }
  .next-stop-grid strong {
    font-size: 1.125rem;
  }
  .tabbar {
    width: calc(100% - 14px);
    bottom: calc(6px + var(--safe-bottom));
  }
}
@media (min-width: 800px) {
  .topbar {
    max-width: 800px;
    margin: 0 auto;
  }
  .hero-card {
    padding: 30px;
  }
  .hero-card h2 {
    font-size: 2.25rem;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
    animation: none !important;
    transition: none !important;
  }
}
