/* Transitica Wiki track map */
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; font-family: -apple-system, "Segoe UI", Roboto, "Helvetica Neue", "Microsoft YaHei", sans-serif; color: #202122; }
body { display: flex; flex-direction: column; }
a { color: #3366cc; text-decoration: none; }
.tm-top { display: flex; align-items: center; gap: 14px; padding: 6px 14px; border-bottom: 1px solid #dadde1; background: #fff; z-index: 5; flex-wrap: wrap; }
.tm-brand { display: flex; align-items: center; gap: 8px; color: #202122; font-family: 'Linux Libertine', Georgia, serif; font-size: 1.1rem; }
.tm-brand b { font-weight: 400; }
.tm-title { font-weight: 600; font-size: .95rem; padding-left: 14px; border-left: 1px solid #dadde1; }
.tm-search { position: relative; flex: 1; max-width: 380px; min-width: 160px; margin: 0; }
.tm-search input { width: 100%; padding: 6px 10px; border: 1px solid #a2a9b1; border-radius: 3px; font: inherit; font-size: .9rem; }
.tm-search input:focus { outline: none; border-color: #3366cc; box-shadow: inset 0 0 0 1px #3366cc; }
.tm-suggest { display: none; position: absolute; top: 100%; left: 0; right: 0; margin: 2px 0 0; padding: 0; list-style: none; background: #fff; border: 1px solid #a2a9b1; box-shadow: 0 2px 6px rgba(0,0,0,.15); max-height: 60vh; overflow: auto; z-index: 20; }
.tm-suggest.open { display: block; }
.tm-suggest a { display: flex; align-items: center; gap: 6px; padding: 6px 10px; color: #202122; }
.tm-suggest a:hover { background: #eaf3ff; }
.tm-suggest small { margin-left: auto; color: #72777d; }
.tm-dim { font: inherit; font-size: .85rem; padding: 4px; }
.tm-updated { margin-left: auto; font-size: .8rem; color: #54595d; }
.tm-map { position: relative; flex: 1; overflow: hidden; background: #f7f7f4; touch-action: none; }
.tm-map canvas { display: block; cursor: grab; touch-action: none; }
.tm-tip { position: absolute; pointer-events: none; background: #fff; border: 1px solid #c8ccd1; border-radius: 4px; box-shadow: 0 2px 8px rgba(0,0,0,.18); padding: 7px 10px; font-size: .82rem; max-width: 280px; z-index: 6; line-height: 1.45; }
.tm-tip small, .muted { color: #72777d; }
.tip-lines { margin-top: 4px; }
.chip { display: inline-block; width: 18px; height: 6px; border-radius: 3px; margin-right: 6px; vertical-align: middle; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; border: 2px solid #222; background: #fff; margin-right: 6px; }
.tm-controls { position: absolute; right: 12px; top: 12px; display: flex; flex-direction: column; box-shadow: 0 1px 4px rgba(0,0,0,.2); border-radius: 4px; overflow: hidden; }
.tm-controls button { width: 36px; height: 36px; border: 0; border-bottom: 1px solid #eaecf0; background: #fff; font-size: 18px; cursor: pointer; color: #202122; }
.tm-controls button:last-child { border-bottom: 0; }
.tm-controls button:hover { background: #f1f3f5; }
.tm-legend { position: absolute; left: 12px; bottom: 12px; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; background: rgba(255,255,255,.92); border: 1px solid #dadde1; border-radius: 4px; padding: 5px 10px; font-size: .78rem; color: #3a3d40; max-width: calc(100% - 24px); }
.tm-legend label { display: flex; align-items: center; gap: 4px; cursor: pointer; user-select: none; }
.tm-coords { color: #72777d; font-variant-numeric: tabular-nums; min-width: 120px; }
.tm-status { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #54595d; font-size: .95rem; pointer-events: none; padding: 20px; text-align: center; }
.tm-status.error { color: #b32424; }
.tm-highlight { position: absolute; left: 50%; top: 12px; transform: translateX(-50%); background: #fff; border: 1px solid #c8ccd1; border-radius: 16px; padding: 4px 6px 4px 12px; font-size: .85rem; box-shadow: 0 1px 4px rgba(0,0,0,.15); display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.tm-highlight button { border: 0; background: #eaecf0; border-radius: 50%; width: 22px; height: 22px; cursor: pointer; font-size: 14px; line-height: 1; }
@media (max-width: 640px) {
	.tm-title, .tm-brand b { display: none; }
	.tm-updated { width: 100%; margin: 0; order: 9; font-size: .72rem; }
	.tm-coords { display: none; }
}

/* legend swatches */
.sw { display: inline-block; width: 22px; height: 6px; border-radius: 3px; }
.sw-unused { height: 3px; background: radial-gradient(circle, #a9adb2 1.4px, transparent 1.6px) 0 50% / 6px 3px repeat-x; }
.sw-siding { background: repeating-linear-gradient(90deg, #8f959b 0 6px, transparent 6px 10px); }

/* dark mode */
:root[data-theme="dark"] { color-scheme: dark; }
[data-theme="dark"] body { color: #e8eaed; background: #15181c; }
[data-theme="dark"] a { color: #8ab4f8; }
[data-theme="dark"] .tm-top { background: #1d2126; border-bottom-color: #343a41; }
[data-theme="dark"] .tm-brand { color: #e8eaed; }
[data-theme="dark"] .tm-title { border-left-color: #343a41; }
[data-theme="dark"] .tm-search input, [data-theme="dark"] .tm-dim { background: #15181c; color: #e8eaed; border-color: #4a5058; }
[data-theme="dark"] .tm-suggest { background: #1d2126; border-color: #4a5058; }
[data-theme="dark"] .tm-suggest a { color: #e8eaed; }
[data-theme="dark"] .tm-suggest a:hover { background: #2a3038; }
[data-theme="dark"] .tm-updated, [data-theme="dark"] .tm-status { color: #aab0b7; }
[data-theme="dark"] .tm-map { background: #15181c; }
[data-theme="dark"] .tm-tip, [data-theme="dark"] .tm-highlight { background: #1d2126; border-color: #4a5058; color: #e8eaed; }
[data-theme="dark"] .tm-tip small, [data-theme="dark"] .muted, [data-theme="dark"] .tm-coords { color: #9aa0a6; }
[data-theme="dark"] .tm-controls button { background: #1d2126; color: #e8eaed; border-bottom-color: #343a41; }
[data-theme="dark"] .tm-controls button:hover { background: #2a3038; }
[data-theme="dark"] .tm-legend { background: rgba(29,33,38,.92); border-color: #343a41; color: #d5d8dc; }
[data-theme="dark"] .tm-highlight button { background: #343a41; color: #e8eaed; }
[data-theme="dark"] .dot { border-color: #e8eaed; background: #15181c; }
[data-theme="dark"] .sw-unused { background: radial-gradient(circle, #8a9099 1.4px, transparent 1.6px) 0 50% / 6px 3px repeat-x; }
[data-theme="dark"] .sw-siding { background: repeating-linear-gradient(90deg, #6f767e 0 6px, transparent 6px 10px); }
.sw-free { height: 4px; border-radius: 0; background: repeating-linear-gradient(90deg, #3366cc 0 7px, transparent 7px 11px); }
.tm-key { display: flex; align-items: center; gap: 4px; }

.tm-legend-toggle { margin-left: 2px; font: inherit; font-size: .75rem; padding: 1px 8px; border: 1px solid #a2a9b1; border-radius: 3px; background: transparent; color: inherit; cursor: pointer; }
.tm-legend-toggle:hover { background: rgba(0,0,0,.06); }
.tm-legend.collapsed { padding: 3px 4px; gap: 0; }
.tm-legend.collapsed > :not(.tm-legend-toggle) { display: none; }
.tm-legend.collapsed .tm-legend-toggle { margin-left: 0; }
.sw-arrow { font-size: .7rem; line-height: 1; color: #202122; -webkit-text-stroke: 0; }
[data-theme="dark"] .sw-arrow { color: #eaecf0; }
[data-theme="dark"] .tm-legend-toggle:hover { background: rgba(255,255,255,.08); }
