:root { --f1: #440154; --f2: #3b528b; --f3: #21918c; --f4: #5ec962; --f5: #fde725; --fnone: #9aa1ab; --fcase: #1a1a19; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --fnone: #5b616b; --fcase: #e9e9e6; }
}
:root[data-theme="dark"] { --fnone: #5b616b; --fcase: #e9e9e6; }

.fq {
  position: fixed; z-index: 1000; top: 12px; left: 12px; width: 380px; max-width: calc(100vw - 24px);
  background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow);
  display: flex; flex-direction: column; max-height: calc(100vh - 24px); overflow: hidden;
}
.fq-head { display: flex; align-items: center; gap: 6px; padding: 10px 12px 6px 6px; }
.fq-head h1 { font-size: 1.05em; margin: 0; flex: 1; }
.fq-head .back { padding: 6px; }
.fq-toggle { display: none; border: 0; background: var(--surface-2); border-radius: 8px; width: 32px; height: 32px; cursor: pointer; font-size: 16px; }
.fq-body { padding: 0 14px 14px; overflow: auto; display: flex; flex-direction: column; gap: 10px; }
.fq-time { display: flex; align-items: center; gap: 10px; }
.play { width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--accent); color: #fff; font-size: 15px; cursor: pointer; flex-shrink: 0; }
.play.on { background: var(--text); color: var(--surface); }
.fq-slider { flex: 1; min-width: 0; }
.fq-label { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-variant-numeric: tabular-nums; }
.fq-label b { font-size: 1.15em; }
.fq-label span { font-size: .8em; }
#t { width: 100%; accent-color: var(--accent); margin: 6px 0 0; }
.fq-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.fq-row select { font: inherit; font-size: .88em; padding: 6px 8px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--text); }
.legend { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: .8em; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.legend i { display: inline-block; width: 22px; height: 0; border-top: 4px solid; border-radius: 2px; box-shadow: 0 0 0 1px color-mix(in srgb, var(--fcase) 45%, transparent); }
.legend i.dash { border-top-style: dashed; border-top-width: 3px; }
.legend i.none { border-top: 3px dotted var(--fnone); }
.fq-hint { font-size: .8em; margin: 0; line-height: 1.45; }
.fq-sum { font-size: .82em; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 12px; }
.fq-sum b { color: var(--text); }
.seg-pop { font-size: 13px; line-height: 1.45; min-width: 210px; }
.seg-pop h4 { margin: 0 0 4px; font-size: 14px; }
.seg-pop .kvs { display: grid; grid-template-columns: auto auto; gap: 0 12px; margin: 6px 0; }
.seg-pop .kvs b { font-variant-numeric: tabular-nums; text-align: right; }
.seg-pop .ln { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 4px; }
.seg-pop .ln span { display: inline-flex; align-items: center; gap: 3px; font-size: 12px; color: var(--muted); }
.seg-pop .times { margin-top: 6px; color: var(--muted); font-variant-numeric: tabular-nums; word-spacing: 3px; max-width: 260px; }
.leaflet-popup-content-wrapper, .leaflet-popup-tip { background: var(--surface); color: var(--text); }
.leaflet-popup-content-wrapper { border-radius: 12px; box-shadow: var(--shadow); }

@media (max-width: 720px) {
  .fq { top: auto; bottom: 0; left: 0; right: 0; width: auto; max-width: none; border-radius: 18px 18px 0 0; max-height: 62vh; padding-bottom: env(safe-area-inset-bottom); }
  .fq-toggle { display: block; }
  .fq.collapsed .fq-body > :not(.fq-time) { display: none; }
  .leaflet-bottom.leaflet-right { bottom: 60px; }
}

.chk { display: flex; align-items: center; gap: 8px; font-size: .85em; color: var(--muted); cursor: pointer; }
.chk input { accent-color: var(--accent); width: 16px; height: 16px; }
