﻿.schedule-toggle {
  position: fixed;
  z-index: 8;
  right: 0;
  top: max(24px, env(safe-area-inset-top));
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px max(14px, env(safe-area-inset-right)) 10px 14px;
  border: 1px solid #244d69;
  border-right: 0;
  border-radius: 6px 0 0 6px;
  background: #244d69;
  color: #fff;
  font-size: 12px;
  font-weight: 500;
}
.schedule-toggle[hidden] { display: none; }
.schedule-toggle:hover { background: #193c55; }
.schedule-toggle:focus-visible { outline-offset: -4px; }
.schedule-modal {
  width: min(740px, calc(100% - 48px));
  max-width: none;
  max-height: calc(100dvh - 48px);
  padding: 0;
  border: 1px solid #d4d4d4;
  border-radius: 8px;
  background: #fff;
  color: #243746;
  box-shadow: 0 12px 40px #0002;
  overflow: hidden;
}
.schedule-modal[open] { display: flex; flex-direction: column; }
.schedule-modal::backdrop { background: #0006; }
.schedule-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 20px 6px;
  flex-shrink: 0;
}
.schedule-title-row { display: flex; align-items: baseline; gap: 16px; }
.schedule-heading h2 { margin: 0; font-size: 20px; font-weight: 600; letter-spacing: -.35px; line-height: 1.3; }
.schedule-hours { color: #52718a; font-size: 12px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.schedule-heading .icon-button { width: 36px; height: 36px; flex-shrink: 0; border-radius: 4px; color: #525252; }
.schedule-heading .icon-button:hover { background: #f5f5f5; }
.schedule-heading .icon-button svg { width: 18px; height: 18px; }
.schedule-filters {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 10px 20px 16px;
  border-bottom: 1px solid #e5e5e5;
  flex-shrink: 0;
}
.schedule-filter {
  --group-color: #244d69;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 64px;
  padding: 10px;
  border: 1px solid color-mix(in srgb, var(--group-color) 75%, #172b3a);
  border-radius: 5px;
  background: color-mix(in srgb, var(--group-color) 78%, #172b3a);
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
}
.schedule-filter:hover { background: color-mix(in srgb, var(--group-color) 62%, #172b3a); }
.schedule-filter[aria-pressed="true"] { outline: 2px solid var(--group-color); outline-offset: 3px; }
.schedule-filter:focus-visible { outline: 3px solid #243746; outline-offset: 3px; }
.schedule-filter-copy { display: grid; gap: 2px; text-align: left; }
.schedule-avatar { display: grid; place-items: center; width: 42px; height: 42px; flex-shrink: 0; overflow: hidden; border: 1px solid #ffffff70; border-radius: 50%; background: #ffffff22; color: #fff; font-size: 13px; font-weight: 600; }
.schedule-avatar img { width: 100%; height: 100%; object-fit: cover; object-position: center 24%; }
.schedule-avatar svg { width: 65%; height: 65%; fill: currentColor; stroke: none; }
.schedule-scroll {
  padding: 20px;
  overflow: auto;
  min-height: 0;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  outline-offset: -3px;
}
.schedule-scroll:focus-visible { outline: 2px solid #737373; }
.schedule-status { margin: 12px 0; color: #525252; font-size: 14px; }
.schedule-groups { display: grid; grid-template-columns: minmax(0, 1fr); }
.schedule-group { min-width: 0; }
.schedule-group-heading { padding: 0 0 12px; }
.schedule-identity { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; padding: 12px; border-radius: 4px; color: #fff; background: color-mix(in srgb, var(--group-color) 78%, #172b3a); }
.schedule-identity .schedule-avatar { width: 52px; height: 52px; font-size: 15px; }
.schedule-leader { min-width: 0; }
.schedule-identity h3 { margin: 0; font-size: 15px; font-weight: 600; }
.schedule-director, .schedule-companions { margin: 3px 0; font-size: 12px; line-height: 1.5; }
.schedule-companions { padding: 0 10px; }
.schedule-companions { color: #637381; }
.schedule-table { width: 100%; border-collapse: collapse; font-size: 13px; line-height: 1.45; }
.schedule-table th { padding: 7px 10px; text-align: left; color: #526675; font-size: 11px; font-weight: 500; border-bottom: 1px solid color-mix(in srgb, var(--group-color) 30%, #e5e9ed); }
.schedule-table td { padding: 6px 10px; border-bottom: 1px solid #e8edf0; vertical-align: top; }
.schedule-table th:first-child, .schedule-table td:first-child { padding-right: 14px; }
.schedule-time { width: 1%; white-space: nowrap; font-variant-numeric: tabular-nums; }
.schedule-stop { background: color-mix(in srgb, var(--group-color) 6%, white); }
.schedule-stop .schedule-time { color: color-mix(in srgb, var(--group-color) 68%, #172b3a); box-shadow: inset 2px 0 var(--group-color); }
.schedule-stop td:last-child { font-weight: 500; }
.schedule-transfer { color: #637381; }
.schedule-table tbody tr:hover { background: color-mix(in srgb, var(--group-color) 12%, white); }
.schedule-place { cursor: pointer; }
.schedule-place-button { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; padding: 0; border: 0; background: none; color: inherit; font: inherit; text-align: left; }
.schedule-place-button::after { content: "↗"; flex-shrink: 0; color: color-mix(in srgb, var(--group-color) 68%, #172b3a); }
.schedule-place:hover .schedule-place-button { text-decoration: underline; text-underline-offset: 3px; }
.schedule-place-button:focus-visible { outline: 2px solid var(--group-color); outline-offset: 3px; }
.schedule-transfer-button::after { content: "→"; }
.schedule-route { position: fixed; z-index: 20; left: 50%; bottom: max(84px, calc(env(safe-area-inset-bottom) + 76px)); transform: translateX(-50%); display: flex; align-items: center; gap: 16px; width: max-content; max-width: calc(100vw - 32px); padding: 12px 14px 12px 18px; border: 1px solid #dce4e8; border-radius: 12px; background: #fffffff2; color: #243746; box-shadow: 0 5px 24px #24374618; }
.schedule-route[hidden] { display: none; }
.schedule-route > div { display: grid; gap: 4px; min-width: 0; }
.schedule-route strong { font-size: 13px; font-weight: 500; line-height: 1.4; }
.schedule-route span { font-size: 12px; color: #637381; }
.schedule-route .icon-button { flex-shrink: 0; width: 32px; height: 32px; font-size: 24px; }
@media (max-width: 700px), (max-width: 1000px) and (pointer: coarse) {
  body.building-card-open .schedule-toggle {
    top: max(14px, env(safe-area-inset-top));
    right: calc(max(14px, env(safe-area-inset-right)) + 58px);
    width: 46px;
    height: 46px;
    justify-content: center;
    padding: 0;
    border-right: 1px solid #244d69;
    border-radius: 6px;
  }
  body.building-card-open .schedule-toggle span { display: none; }
}
@media (max-width: 600px) {
  .schedule-toggle { top: max(16px, env(safe-area-inset-top)); padding-right: max(12px, env(safe-area-inset-right)); }
  .schedule-toggle span { display: none; }
  .schedule-modal { width: calc(100% - 16px); max-height: calc(100dvh - 32px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); border-radius: 6px; }
  .schedule-heading { padding: 12px 14px 4px; gap: 4px; align-items: flex-start; }
  .schedule-title-row { display: block; }
  .schedule-heading h2 { font-size: 18px; }
  .schedule-hours { display: block; margin-top: 4px; }
  .schedule-filters { gap: 9px; padding: 10px 14px 14px; }
  .schedule-filter { flex-direction: column; gap: 6px; font-size: 12px; padding: 9px 4px; }
  .schedule-filter-copy { text-align: center; }
  .schedule-filter .schedule-avatar { width: 34px; height: 34px; font-size: 11px; }
  .schedule-scroll { padding: 18px 14px; }
  .schedule-table th:first-child, .schedule-table td:first-child { padding-right: 12px; }
  .schedule-table th, .schedule-table td { padding-left: 8px; padding-right: 8px; }
  .schedule-table td { padding-top: 8px; padding-bottom: 8px; }
}
