/* Page-scoped additions; global site typography, navigation and footer are shared. */
.tm-body { min-width: 0; }
#content > .tm-page { margin-left: 0; }
@media (min-width: 737px) {
  .tm-body .container { max-width: calc(100% - 40px); }
  .tm-body #page-footer { overflow-wrap: anywhere; }
}
@media (min-width: 737px) and (max-width: 1000px) {
  .tm-body #page-header h1 { text-align: center; }
  .tm-body #page-header nav { position: static; text-align: center; margin-top: 1rem; }
  .tm-body #page-header nav > ul { margin-bottom: 0; }
  .tm-body #search > span { position: static; display: block; padding-left: 0; margin-bottom: 1rem; }
}
.tm-page { --tm-green: #234e43; --tm-amber: #775414; --tm-purple: #664775; }
.tm-page [hidden] { display: none !important; }
.tm-page .tm-breadcrumb { font: .9rem var(--font-sans); margin-bottom: 1.5rem; }
.tm-page .tm-kicker { color: var(--color-accent); font: 700 .8rem/1.4 var(--font-sans); letter-spacing: .12em; text-transform: uppercase; margin: 0 0 .6rem; }
#content .tm-page .tm-intro h2 { font-size: clamp(2rem, 4.3vw, 3.5rem); margin: 0 0 1rem; }
.tm-intro > p:last-child { max-width: 76ch; font-size: 1.15rem; }
.tm-legend { display: flex; align-items: center; flex-wrap: wrap; gap: .45rem .7rem; font: .88rem/1.5 var(--font-sans); }
.tm-legend > span:nth-child(even) { margin-right: 1rem; }
.tm-status { display: inline-block; border: 1px solid currentColor; border-radius: 4px; padding: .12rem .5rem; font: 700 .76rem/1.5 var(--font-sans); white-space: nowrap; }
.tm-certain { color: var(--tm-green); background: #eff5f1; }
.tm-probable { color: var(--tm-amber); background: #fff9e9; border-style: dashed; }
.tm-disputed { color: var(--tm-purple); background: #f6effa; border-style: dotted; border-width: 2px; }
.tm-page .tm-note, .tm-page .tm-map-caption { font: .88rem/1.55 var(--font-sans); margin: .8rem 0 1.5rem; }
.tm-toolbar { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; border: 1px solid var(--color-rule); background: var(--color-paper); padding: 1rem; border-radius: var(--panel-radius) var(--panel-radius) 0 0; }
.tm-page button, .tm-page select { font: 600 .9rem/1.4 var(--font-sans); min-height: 44px; border: 1px solid #aaa; border-radius: 5px; background: white; color: var(--color-ink); padding: .6rem .8rem; cursor: pointer; }
.tm-page button:hover { border-color: var(--color-accent); color: var(--color-accent); }
.tm-page button:disabled { opacity: .45; cursor: default; }
.tm-step-buttons { display: flex; gap: .5rem; }
#content .tm-toolbar label { display: flex; align-items: center; gap: .65rem; flex: 1; font: .88rem var(--font-sans); min-width: 0; letter-spacing: normal; margin: 0; }
.tm-toolbar select { width: 100%; min-width: 0; flex: 1; }
#tm-progress { font: 600 .85rem var(--font-sans); }
.tm-page .tm-map-help { font: .82rem/1.5 var(--font-sans); padding: .65rem 1rem; margin: 0; background: #f6f3eb; }
.tm-map-scroll { overflow-x: auto; overscroll-behavior-x: contain; border: 1px solid #a89c79; background: #d9c897; }
.tm-map { position: relative; width: 100%; min-width: 900px; aspect-ratio: 1000 / 520; isolation: isolate; }
.tm-map-art { display: block; width: 100%; height: 100%; }
.tm-map-label { position: absolute; font: 600 12px var(--font-sans); color: #273c32; background: #f8efcdde; padding: 2px 5px; border-radius: 2px; pointer-events: none; }
.tm-route { fill: none; stroke: #603e35; stroke-width: 1.4; opacity: .32; }
.tm-route.uncertain { stroke-dasharray: 5 5; }
.tm-route.active { stroke: #990909; color: #990909; stroke-width: 3; opacity: .95; marker-end: url(#tm-arrow); }
.tm-leader { stroke: #373d30; stroke-width: 1; opacity: .65; }
.tm-anchor { fill: #252e25; }
.tm-marker-wrap { position: absolute; transform: translate(-50%, -50%); z-index: 2; }
.tm-marker-wrap:hover, .tm-marker-wrap:focus-within { z-index: 5; }
.tm-page .tm-marker { display: block; width: 44px; height: 44px; padding: 0; border-radius: 50%; background: var(--tm-green); border: 2px solid #fff9e8; color: white; font: 700 16px var(--font-sans); box-shadow: 0 2px 5px #0005; }
.tm-page .tm-marker.tm-probable { background: #fff6db; color: #67440a; border: 2px dashed #775414; }
.tm-page .tm-marker.tm-disputed { background: #f4e9fb; color: #553168; border: 3px dotted #664775; border-radius: 9px; }
.tm-page .tm-marker[aria-pressed="true"] { outline: 4px solid var(--color-accent); outline-offset: 3px; }
.tm-page :focus-visible { outline: 3px solid var(--color-accent); outline-offset: 4px; }
.tm-tooltip { display: none; position: absolute; left: 50%; bottom: calc(100% + 10px); transform: translateX(-50%); width: 190px; border-radius: 5px; background: #fffdf6; box-shadow: 0 2px 12px #0004; color: #333; padding: .6rem; font: .8rem/1.4 var(--font-sans); text-align: center; }
.tm-tooltip::after { content: ''; position: absolute; inset: -12px 0; z-index: -1; }
.tm-marker-wrap:hover .tm-tooltip, .tm-marker-wrap:focus-within .tm-tooltip { display: block; }
.tm-marker-wrap.tip-below .tm-tooltip { top: calc(100% + 10px); bottom: auto; }
.tm-marker-wrap.tip-left .tm-tooltip { left: auto; right: -10px; transform: none; }
.tm-marker-wrap.tip-right .tm-tooltip { left: -10px; transform: none; }
.tm-marker-wrap.tip-dismissed .tm-tooltip { display: none; }
.tm-detail { background: #faf8f2; border: 1px solid #d6cdbb; border-left: 4px solid var(--color-accent); border-radius: var(--panel-radius); padding: 1.5rem 2rem; margin: 0 0 3rem; }
.tm-detail-top { display: flex; justify-content: space-between; gap: 1rem; align-items: baseline; font: .85rem var(--font-sans); margin-bottom: .75rem; }
#content .tm-page .tm-detail h3 { font-size: 1.65rem; margin: 0 0 .65rem; }
.tm-page .tm-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; font: .9rem/1.5 var(--font-sans); margin: .7rem 0 1rem; }
.tm-page h4 { font-size: 1.08rem; margin: 0 0 .7rem; }
.tm-page .tm-evidence { font-size: .95rem; }
.tm-page .tm-citations { font: .85rem/1.5 var(--font-sans); margin-bottom: 0; }
.tm-page .tm-citations a { text-decoration: underline; }
.tm-page .tm-itinerary-section h2, .tm-page .tm-sources h2 { font-size: 1.8rem; margin-bottom: .8rem; }
#content .tm-itinerary { list-style: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; padding: 0; margin: 1.5rem 0 3rem; }
.tm-itinerary > li { padding: 1.3rem; border: 1px solid var(--color-rule); border-top: 3px solid var(--tm-green); border-radius: 5px; scroll-margin-top: 1.5rem; }
.tm-itinerary > li[data-status="probable"] { border-top: 3px dashed var(--tm-amber); }
.tm-itinerary > li[data-status="disputed"] { border-top: 3px dotted var(--tm-purple); }
.tm-itinerary > li.is-current { background: #faf6ec; box-shadow: inset 0 0 0 2px var(--color-accent); }
#content .tm-page .tm-itinerary h3 { font-size: 1.2rem; margin: 0; }
.tm-stop-link { display: flex; gap: .8rem; align-items: baseline; min-height: 44px; }
.tm-number { font: 700 1rem var(--font-sans); color: #777; }
.tm-itinerary .tm-copy p { font-size: .96rem; }
.tm-sources { border-top: 1px solid var(--color-rule); padding-top: 2rem; }
.tm-sources ul { padding-left: 1.2rem; list-style: disc; }
.tm-sources li { margin-bottom: .85rem; scroll-margin-top: 1rem; }
.tm-related { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 2rem; }
@media (max-width: 900px) {
  .tm-legend { display: grid; grid-template-columns: max-content 1fr; }
  .tm-legend .tm-status { justify-self: start; }
}
@media (max-width: 736px) {
  #content .tm-itinerary { grid-template-columns: 1fr; }
  .tm-toolbar { gap: .75rem; padding: .8rem; }
  #content .tm-toolbar label { flex-basis: 100%; flex-direction: column; align-items: stretch; order: 3; }
  #tm-progress { margin-left: auto; }
  .tm-legend { display: grid; grid-template-columns: max-content 1fr; }
  .tm-legend .tm-status { justify-self: start; }
  .tm-detail { padding: 1.2rem; }
  .tm-detail-top { flex-wrap: wrap; }
  #tm-explorer { scroll-margin-top: 54px; }
  .tm-page .tm-intro > p:last-child { font-size: 1.03rem; }
}
@media print {
  #tm-explorer, .tm-related, .tm-breadcrumb { display: none !important; }
  #content .tm-itinerary { display: block; }
  .tm-itinerary > li { break-inside: avoid; margin-bottom: 1rem; }
}
