/* Explicit control-family owner. Only opted-in markup receives these faces.
 * Feature styles own layout; this file owns material, feedback and focus.
 * Reuses the map's relief tokens, with a functional flat-material fallback. */
:root {
  --action-paper: #fffaf0;
  --action-edge: #bcb3a3;
  --action-ink: #191815;
  --action-muted: #625d53;
  --action-radius: 8px;
  --action-contact: none;
  --action-inset: none;
  --action-lift: none;
}
html[data-material-prototype="relief"] {
  --action-contact: var(--relief-contact);
  --action-inset: var(--relief-inset);
  --action-lift: var(--relief-lift);
}
html body [data-atlas-control][data-atlas-control] {
  box-sizing: border-box;
  min-height: 44px;
  max-width: 100%;
  font-family: var(--font-ui, var(--font-main));
  font-size: 13px;
  font-weight: 650;
  font-style: normal;
  line-height: 1.4;
  letter-spacing: 0;
  text-transform: none;
  cursor: pointer;
  touch-action: manipulation;
  transition: background-color 140ms ease, border-color 140ms ease, box-shadow 140ms ease, transform 120ms ease;
}
html[data-material-prototype] body.is-map-active [data-atlas-control][data-atlas-control] {
  --control-face: var(--action-paper);
  border: 1px solid var(--action-edge);
  border-radius: var(--action-radius);
  padding: 10px 14px;
  background: var(--control-face);
  color: var(--action-ink);
  box-shadow: var(--action-contact);
  transform: none;
}
html[data-material-prototype] body.is-map-active [data-atlas-control="commit"][data-atlas-control] {
  --control-face: #191815;
  min-height: 48px;
  border-color: #191815;
  color: #fffaf0;
  font-weight: 750;
  background: linear-gradient(180deg, #292722, #191815);
  box-shadow: inset 0 1px 0 #ffffff32, var(--action-contact);
}
html[data-material-prototype] body.is-map-active [data-atlas-control="slip"][data-atlas-control] {
  border-radius: 5px;
  padding-inline: 12px;
  text-align: start;
  background: linear-gradient(180deg, #fffdf7, #f6f0e3);
}
html[data-material-prototype] body.is-map-active [data-atlas-control="slip"]::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-inline-end: 9px;
  border: 2px solid var(--accent, #b4422b);
  border-radius: 50%;
  vertical-align: 0;
}
html[data-material-prototype] body.is-map-active .home-finder-starter[data-atlas-control]::before,
html[data-material-prototype] body.is-map-active .search-result[data-atlas-control]::before { content: none; }
html[data-material-prototype] body.is-map-active :is([data-atlas-control="text"], [data-atlas-control="return"], [data-atlas-control="row"], [data-atlas-control="disclosure"])[data-atlas-control] {
  border: 0;
  border-radius: var(--action-radius);
  background: transparent;
  box-shadow: none;
  color: var(--ink, #191815);
  text-align: start;
  padding: 10px 4px;
}
html[data-material-prototype] body.is-map-active :is([data-atlas-control="text"], [data-atlas-control="return"])[data-atlas-control] {
  width: fit-content;
  text-decoration: underline;
  text-decoration-color: #9c9382;
  text-underline-offset: 4px;
  text-decoration-thickness: 1px;
}
html[data-material-prototype] body.is-map-active [data-atlas-control="return"][data-atlas-control] { padding-inline: 10px; }
html body [data-discovery-back]::before { content: "←"; margin-inline-end: 8px; }
html[data-material-prototype] body.is-map-active [data-atlas-control="row"][data-atlas-control] {
  width: 100%;
  padding: 11px 10px;
  border-bottom: 1px solid #bcb3a350;
  border-radius: 0;
}
html[data-material-prototype] body.is-map-active [data-atlas-control="disclosure"][data-atlas-control] {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  padding-inline: 3px 25px;
  list-style: none;
}
html body [data-atlas-control="disclosure"]::-webkit-details-marker { display: none; }
html body [data-atlas-control="disclosure"]::marker { content: ""; }
html[data-material-prototype] body.is-map-active [data-atlas-control="disclosure"]::after {
  content: "";
  position: absolute;
  right: 9px;
  top: calc(50% - 4px);
  width: 6px;
  height: 6px;
  border: solid currentColor;
  border-width: 0 1.5px 1.5px 0;
  transform: rotate(-45deg);
  transition: transform 140ms ease;
}
html[data-material-prototype] body.is-map-active details[open] > [data-atlas-control="disclosure"]::after { transform: rotate(45deg); }
html[data-material-prototype] body.is-map-active [data-atlas-control="dismiss"][data-atlas-control] {
  display: inline-grid;
  place-items: center;
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  padding: 0;
  font-size: 20px;
  font-weight: 400;
  border-radius: 8px;
  background: #fffaf080;
  box-shadow: none;
  border-color: #bcb3a360;
}
html[data-material-prototype] body.is-map-active [data-atlas-control="save"][data-atlas-control] {
  width: fit-content;
  min-width: 84px;
  border-radius: 5px;
  padding: 9px 12px;
}
html[data-material-prototype] body.is-map-active [data-atlas-control="save"][aria-pressed="true"] {
  color: #214e44;
  border-color: #7b988b;
  background: #edf0e6;
  box-shadow: var(--action-inset);
}
html[data-material-prototype] body.is-map-active [data-atlas-control="tab"][data-atlas-control] {
  position: relative;
  border-radius: 7px 7px 2px 2px;
  border-color: transparent;
  padding: 10px 12px;
  background: transparent;
  box-shadow: none;
  color: var(--action-muted);
}
html[data-material-prototype] body.is-map-active [data-atlas-control="tab"][aria-pressed="true"] {
  background: #fffcf4;
  border-color: #bcb3a380;
  color: var(--action-ink);
  box-shadow: var(--action-contact);
}
html[data-material-prototype] body.is-map-active [data-atlas-control="tab"][aria-pressed="true"]::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 12px;
  right: 12px;
  height: 2px;
  background: var(--accent, #b4422b);
}
html[data-material-prototype] body.is-map-active [data-atlas-control="key"][aria-pressed="true"] {
  background: #e9e2d5;
  border-color: #958a75;
  box-shadow: var(--action-inset);
}
@media (hover: hover) {
  html[data-material-prototype] body.is-map-active [data-atlas-control][data-atlas-control]:where(:not(:disabled):not([aria-disabled="true"])):hover {
    border-color: #8e816c;
    box-shadow: var(--action-lift);
    transform: none;
  }
  html[data-material-prototype] body.is-map-active :is([data-atlas-control="row"], [data-atlas-control="text"], [data-atlas-control="return"], [data-atlas-control="disclosure"])[data-atlas-control]:hover {
    background: #e9e2d54d;
    box-shadow: none;
  }
}
html[data-material-prototype] body.is-map-active [data-atlas-control][data-atlas-control]:where(:not(:disabled):not([aria-disabled="true"])):active {
  transform: translateY(1px);
  box-shadow: var(--action-inset);
}
html[data-material-prototype] body.is-map-active :is([data-atlas-control="row"], [data-atlas-control="text"], [data-atlas-control="return"], [data-atlas-control="disclosure"])[data-atlas-control]:active {
  transform: none;
  background: #e9e2d580;
  box-shadow: none;
}
html body [data-atlas-control][data-atlas-control]:focus-visible {
  outline: 2px solid var(--button-focus-ring, #a73527);
  outline-offset: 3px;
}
html[data-material-prototype] body.is-map-active [data-atlas-control][data-atlas-control]:is(:disabled, [aria-disabled="true"]) {
  opacity: .55;
  cursor: default;
  box-shadow: none;
  transform: none;
}
html body [data-atlas-control][aria-busy="true"] { cursor: progress; }
html body [data-atlas-control][hidden] { display: none; }
/* A category is a printed index; a comparison is a persistent latch. */
html[data-material-prototype] body.is-map-active [data-atlas-control="compare"][data-atlas-control] {
  border-radius: 5px;
  background: #fffaf0;
  text-align: start;
}
html body [data-atlas-control="compare"]::before {
  content: "";
  display: inline-block;
  width: 11px;
  height: 11px;
  border: 1.5px solid currentColor;
  border-radius: 2px;
  margin-inline-end: 8px;
  vertical-align: -1px;
}
html[data-material-prototype] body.is-map-active [data-atlas-control="compare"][aria-pressed="true"] {
  border-color: #7b988b;
  color: #214e44;
  background: #edf0e6;
  box-shadow: var(--action-inset);
}
html body [data-atlas-control="compare"][aria-pressed="true"]::before {
  background: currentColor;
  border: 0;
  clip-path: polygon(4% 48%,18% 34%,40% 56%,82% 8%,98% 22%,41% 88%);
}
html[data-material-prototype] body.is-map-active [data-atlas-control="destination"][data-atlas-control] {
  min-height: 44px;
  padding: 0 22px 0 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  text-align: start;
  font-size: 15px;
}
html[data-material-prototype] body.is-map-active [data-atlas-control="destination"][data-atlas-control]:is(:hover,:active) { transform: none; box-shadow: none; }
html[data-material-prototype] body.is-map-active [data-atlas-control="schedule"][data-atlas-control] {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  list-style: none;
  border-radius: 8px;
  background: linear-gradient(180deg,#fffdf7,#f4eedf);
}
html body [data-atlas-control="schedule"]::-webkit-details-marker { display: none; }
html body [data-atlas-control="schedule"]::before {
  content: "";
  flex: 0 0 14px;
  height: 14px;
  border: 1.5px solid currentColor;
  border-radius: 3px;
  background: linear-gradient(currentColor,currentColor) center 3px / 100% 1px no-repeat;
}
html body [data-atlas-control="schedule"]::after {
  content: "";
  flex: 0 0 6px;
  height: 6px;
  margin-inline-start: auto;
  border: solid currentColor;
  border-width: 0 1.5px 1.5px 0;
  transform: rotate(45deg);
}
html body details[open] > [data-atlas-control="schedule"]::after { transform: rotate(225deg); }
/* Compositions for the opted-in families: no map/chrome layout ownership. */
html body :is(.sf-schedule-controls,.walking-details) label:has(input[type="checkbox"]) { min-height: 44px; align-content: center; cursor: pointer; }
html body :is(.sf-schedule-controls,.walking-details) input[type="checkbox"] { accent-color: #285e54; }

/* Destination slips retain the paper material around the map. */
html body [data-network-origin-id] { margin: 3px 2px; }
html body .network-portrait nav { display: flex; gap: 6px; flex-wrap: wrap; }
html body .commute-fit-results-toolbar { display: flex; align-items: center; padding: 6px 0; border-bottom: 1px solid #bcb3a3; background: #f8f4e9; }
html[data-material-prototype] body.is-map-active .commute-fit-results-toolbar [data-atlas-control] { flex: 0 1 auto; padding-inline: 10px; }
html[data-material-prototype] body.is-map-active .commute-fit-results-toolbar [data-home-finder-compare-saved] { margin-inline-start: auto; }
html[data-material-prototype] body.is-map-active .plan-save-candidate[data-atlas-control] { display: inline-flex; align-items: center; margin: 0 12px 12px 44px; }
html body .commute-fit-candidate-select { border-radius: 5px; transition: background-color 140ms ease; }
html body .commute-fit-candidate-select:is(:hover,:focus-visible) { background-color: #ece6d866; }
html body .commute-fit-candidate-select .commute-fit-candidate-average > em { display: inline-block; margin-top: 10px; padding: 5px 0; color: #8c3c28; text-underline-offset: 4px; font-weight: 750; }
html body .commute-fit-candidate-select:focus-visible { outline: 2px solid var(--button-focus-ring); outline-offset: -2px; }
html[data-material-prototype] body.is-map-active .home-finder-place-editor > [data-atlas-control] { padding-inline: 0; padding-right: 0; }
html body .home-finder-place-editor > [data-atlas-control]::after { display: none; }
html body .home-finder-place-editor > [data-atlas-control] > span:first-child { flex: 1; }
html body .home-finder-starter-rail { flex-shrink: 0; }
html[data-material-prototype] body.is-map-active [data-commute-fit-select-home][data-atlas-control][aria-pressed="true"] { opacity: 1; color: #214e44; background: #e6ecdf; box-shadow: inset 3px 0 #285e54; }
html body [data-commute-fit-select-home][aria-pressed="true"] > strong::before { content: "✓ "; }
html[data-material-prototype] body.is-map-active :is([data-home-finder-map-pick],[data-commute-map-pick])[aria-pressed="true"] { color: #fffaf0; background: #ad422e; border-color: #853520; box-shadow: var(--action-inset); }
html body .commute-fit-dossier-actions { align-items: center; gap: 8px 14px; }

/* A paired-arrow symbol belongs to the endpoint exchange, never the form. */
html body :is(#routeSwapButton,#mobileRouteSwapButton)::before { content: ""; display: inline-block; width: 15px; height: 12px; margin-inline-end: 7px; vertical-align: -1px; background: currentColor; clip-path: polygon(0 25%,75% 25%,75% 0,100% 35%,75% 60%,75% 40%,0 40%,0 25%,25% 60%,25% 80%,100% 80%,100% 95%,25% 95%,25% 100%,0 70%); }
html body .route-form > :last-child { gap: 8px; }

/* Quiet source index with one optical close-key family across dialogs. */
html body .method-modal-nav { gap: 4px 16px; }
html body .method-modal-nav a { min-height: 44px; display: inline-flex; align-items: center; padding: 8px 0; border: 0; background: transparent; text-underline-offset: 4px; }
html body .method-section > summary { min-height: 48px; }
html body [data-method-open] { min-height: 44px; display: inline-flex; align-items: center; }
html body .origin-fact header > span::after { content: " ⓘ"; font: 500 12px var(--font-ui); color: #766c59; }
html body .route-alternative { min-height: 48px; border-radius: 4px; }
html body .route-alternative[aria-pressed="true"] { box-shadow: inset 3px 0 var(--accent); }
html body .route-alternative[aria-pressed="true"] > strong::before { content: "● "; color: var(--accent); font-size: 9px; }
html body .line-chain-stop[data-atlas-control], html body .hub-chip[data-atlas-control] { width: auto; }

@media (max-width: 760px), (max-width: 980px) and (orientation: portrait), (max-width:980px) and (max-height:599px) {
  html body .commute-fit-results-toolbar { gap: 4px; }
  html[data-material-prototype] body.is-map-active .commute-fit-results-toolbar [data-atlas-control] { min-width: 0; flex: 1 1 auto; font-size: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  html body [data-atlas-control][data-atlas-control] { transition: none; animation: none; }
  html[data-material-prototype] body.is-map-active [data-atlas-control][data-atlas-control]:active { transform: none; }
  html body [data-atlas-control]::after { transition: none; }
}
@media (forced-colors: active) {
  html[data-material-prototype] body.is-map-active [data-atlas-control][data-atlas-control] {
    border: 1px solid ButtonText;
    box-shadow: none;
    color: ButtonText;
    background: ButtonFace;
  }
  html[data-material-prototype] body.is-map-active [data-atlas-control]:is([aria-pressed="true"], [aria-selected="true"]) { border: 2px solid Highlight; }
  html body [data-atlas-control][data-atlas-control]:focus-visible { outline-color: Highlight; }
}

/* Desktop command bar: three materials, all lit from above. A track is a
 * recessed well holding a set of choices (the modes; settings with language);
 * an open segment rises out of it as paper. A key is one raised paper face
 * (Make a poster). Explore's sentence is one recessed paper well whose
 * clauses are divided by hairlines. Wells take 12px corners; keys and the
 * segments inside a track take the 8px action radius. */
html body :is(.sf-schedule-kicker, .sf-schedule-compact) { display: none; }
@media (min-width: 981px), (min-width: 761px) and (max-width: 980px) and (min-height: 600px) and (orientation: landscape) {
  html body.is-map-active {
    --bar-track: rgba(226, 217, 201, 0.52);
    --bar-paper: #fffdf7;
    --bar-edge: rgba(55, 45, 31, 0.18);
    --bar-rule: linear-gradient(rgba(55, 45, 31, 0.16), rgba(55, 45, 31, 0.16)) left center / 1px calc(100% - 20px) no-repeat;
  }
  html body.is-map-active .command-mast .command-utility-tray {
    border: 1px solid var(--bar-edge);
    border-radius: 12px;
    background: var(--bar-track);
    box-shadow: var(--action-inset);
  }
  html body.is-map-active .command-mast .command-utility-tray :is(#layersToggle, .language-select) {
    height: 100%;
    border: 0;
    border-radius: 8px;
    color: rgba(22, 20, 15, 0.72);
    transition: background-color 140ms ease, box-shadow 140ms ease;
  }
  html body.is-map-active .command-mast .command-utility-tray :is(#layersToggle, .language-select):hover { background-color: #fffdf78c; }
  html body.is-map-active .command-mast .command-utility-tray #layersToggle[aria-expanded="true"] {
    background-color: var(--bar-paper);
    box-shadow: var(--action-contact);
    color: var(--ink, #191815);
  }
  html body.is-map-active .command-mast .mast-language-toggle { position: relative; padding-left: 5px; }
  html body.is-map-active .command-mast .mast-language-toggle::before {
    content: "";
    position: absolute;
    inset: 9px auto 9px 0;
    width: 1px;
    background: rgba(55, 45, 31, 0.16);
  }
  html body.is-map-active .command-mast .mast-language-toggle .language-select {
    appearance: none;
    padding: 0 27px 0 10px;
    background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='m2.25 4.25 3.75 3.5 3.75-3.5' fill='none' stroke='%2316140f' stroke-opacity='.72' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 9px center / 12px;
    font: 800 12px/1 var(--font-ui, var(--font-main));
    letter-spacing: 0.06em;
    text-transform: uppercase;
    cursor: pointer;
  }
  html body.is-map-active .command-mast #shareButton.share-button {
    height: 100%;
    min-height: 0;
    border: 1px solid var(--bar-edge);
    border-radius: var(--action-radius);
  }
  html body.is-map-active .command-mast #shareButton.share-button:not(:disabled) {
    background-color: var(--bar-paper);
    box-shadow: var(--action-contact);
  }
  html body.is-map-active .command-mast #shareButton.share-button:not(:disabled):hover { box-shadow: var(--action-lift); }
  html body.is-map-active .command-mast #shareButton.share-button:not(:disabled):active { box-shadow: var(--action-inset); transform: translateY(1px); }
  html body.is-map-active .command-mast #shareButton.share-button:disabled { border-color: rgba(55, 45, 31, 0.1); }

  /* The edge is an inset ring rather than a border so each clause keeps the
     shared 52px control height and fills the well exactly. */
  html body.is-map-active.is-reach-mode .panel-header .command-sentence {
    border: 0;
    border-radius: 12px;
    background: var(--bar-paper);
    box-shadow: inset 0 0 0 1px var(--bar-edge), var(--relief-inset, 0 0 transparent);
  }
  html body.is-map-active.is-reach-mode .panel-header .command-sentence :is(#stationSearch, .explore-line-picker > summary, #desktopReachTimeControl) {
    border-color: transparent;
    background-color: transparent;
    box-shadow: none;
  }
  html body.is-map-active.is-reach-mode .panel-header .command-sentence > :is(#desktopLinePickerHost, #desktopReachTimeControl, .sf-schedule-controls) { background: var(--bar-rule); }
  html body.is-map-active.is-reach-mode .panel-header .command-sentence :is(label[for="stationSearch"], .explore-line-picker > summary small, #desktopReachTimeControl > span:first-child) {
    font: 820 11px/1 var(--font-ui, var(--font-main));
    letter-spacing: 0.12em;
    color: rgba(22, 20, 15, 0.62);
  }

  html body.is-map-active .command-sentence > .sf-schedule-controls.is-sentence-control {
    position: relative;
    inset: auto;
    z-index: auto;
    max-width: none;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0 12px 12px 0;
    box-shadow: none;
  }
  html body.is-map-active .command-sentence > .sf-schedule-controls.is-sentence-control > summary[data-atlas-control] {
    position: relative;
    display: block;
    height: 100%;
    min-height: 0;
    padding: 23px 30px 0 38px;
    overflow: hidden;
    border: 0;
    border-radius: inherit;
    background: transparent;
    box-shadow: none;
    transform: none;
    color: var(--ink, #191815);
    font: 640 0.95rem/1.2 var(--font-ui, var(--font-main));
    letter-spacing: 0.01em;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  html body.is-map-active .command-sentence > .sf-schedule-controls.is-sentence-control > summary[data-atlas-control]:is(:hover, :active) {
    border-color: transparent;
    background: #e9e2d559;
    box-shadow: none;
    transform: none;
  }
  html body.is-map-active .command-sentence > .sf-schedule-controls.is-sentence-control > summary::before {
    position: absolute;
    top: calc(50% - 7px);
    left: 14px;
    width: 14px;
  }
  html body.is-map-active .command-sentence > .sf-schedule-controls.is-sentence-control > summary::after {
    position: absolute;
    top: calc(50% - 5px);
    right: 14px;
    width: 6px;
  }
  html body.is-map-active .command-sentence > .sf-schedule-controls.is-sentence-control :is(.sf-schedule-kicker, .sf-service-date-notice) {
    position: absolute;
    top: 9px;
    right: 30px;
    left: 38px;
    display: block;
    margin: 0;
    overflow: hidden;
    color: rgba(22, 20, 15, 0.62);
    font: 820 11px/1 var(--font-ui, var(--font-main));
    letter-spacing: 0.12em;
    text-overflow: ellipsis;
    text-transform: uppercase;
    white-space: nowrap;
  }
  html body.is-map-active .command-sentence > .sf-schedule-controls.is-sentence-control .sf-service-date-notice {
    color: var(--accent, #b4422b);
    letter-spacing: 0.02em;
    text-transform: none;
  }
  html body.is-map-active .command-sentence > .sf-schedule-controls.is-sentence-control > summary:has(.sf-service-date-notice) .sf-schedule-kicker,
  html body.is-map-active .command-sentence > .sf-schedule-controls.is-sentence-control .sf-schedule-full { display: none; }
  html body.is-map-active .command-sentence > .sf-schedule-controls.is-sentence-control .sf-schedule-compact { display: inline; }
  html body.is-map-active .command-sentence > .sf-schedule-controls.is-sentence-control > form {
    padding: 14px;
    overflow: auto;
    border: 1px solid rgba(55, 45, 31, 0.22);
    border-radius: 16px;
    background: #fbfaf4;
    box-shadow: 0 7px 18px rgba(55, 45, 31, 0.106), 0 2px 4px rgba(55, 45, 31, 0.067);
  }
}

/* Below 1321px the travel-time ruler is the sentence's second row. */
@media (min-width: 981px) and (max-width: 1320px), (min-width: 761px) and (max-width: 980px) and (min-height: 600px) and (orientation: landscape) {
  html body.is-map-active.is-reach-mode .panel-header .command-sentence > #desktopReachTimeControl {
    background: linear-gradient(rgba(55, 45, 31, 0.16), rgba(55, 45, 31, 0.16)) center top / calc(100% - 24px) 1px no-repeat;
  }
}

@media (min-width:761px) and (max-width:980px) and (min-height:600px) and (orientation:landscape) {
  html body.is-map-active .command-mast .mode-control-lenses { grid-template-columns: 1fr 1.4fr .85fr; }
  html body.is-map-active .command-mast .mode-control-lenses .mode-button strong[data-compact-en] { font-size: 0; }
  html body.is-map-active .command-mast .mode-control-lenses .mode-button strong[data-compact-en]::after { font-size: 11px; letter-spacing: 0; white-space: normal; }
}
