.history-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.history-export { display: flex; align-items: end; gap: 9px; flex-wrap: wrap; }
.history-export select { min-width: 160px; }
.history-help { font-size: 11px; color: var(--muted); margin: 0 0 19px; line-height: 1.7; }
.history-stats { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; margin: 20px 0; }
.history-stat { border: 1px solid var(--line); border-radius: 9px; padding: 15px; }
.history-stat small { display: block; color: var(--muted); font-size: 10px; margin-bottom: 8px; }
.history-stat strong { font-size: 24px; font-weight: 550; }
.flight-card { border: 1px solid var(--line); border-radius: 12px; padding: 20px; margin-bottom: 14px; background: #101c2b; }
.flight-card-heading { display: flex; justify-content: space-between; gap: 15px; align-items: start; }
.flight-card-heading > div { min-width: 0; }
.flight-card-heading h3 { margin: 0 0 7px; font-size: 15px; overflow-wrap: anywhere; }
.flight-card-heading code { color: var(--muted); font-size: 11px; }
.flight-facts { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 15px; margin: 20px 0; }
.flight-fact { min-width: 0; }
.flight-fact small { display: block; font-size: 10px; color: var(--muted); margin-bottom: 8px; }
.flight-fact strong { font-size: 12px; font-weight: 500; overflow-wrap: anywhere; line-height: 1.6; }
.flight-card-bottom { display: flex; justify-content: space-between; gap: 15px; align-items: center; }
.flight-card-bottom > span { font-size: 11px; }
.flight-card button { font-size: 11px; }
.history-pagination { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 13px; margin: 20px 0 3px; font-size: 11px; color: var(--muted); }
.history-empty { text-align: center; color: var(--muted); font-size: 13px; padding: 45px 15px; }
#flight-detail { margin-top: 25px; scroll-margin-top: 95px; }
#flight-detail-title { overflow-wrap: anywhere; }
#flight-summary { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 22px 16px; margin: 0 0 24px; }
#flight-map { width: 100%; height: auto; aspect-ratio: 56 / 39; background: #263e5b; border-radius: 10px; z-index: 1; }
#flight-map-note, #flight-legacy-note { font-size: 11px; line-height: 1.7; margin-top: 13px; }
#flight-legacy-note { padding: 12px; border: 1px solid #d1a15544; color: #e0c594; border-radius: 8px; }
.flight-messages { margin-top: 24px; border-top: 1px solid var(--line); padding-top: 18px; }
.flight-messages > summary { cursor: pointer; font-size: 13px; padding: 10px 0; }
.rid-json summary { cursor: pointer; color: var(--accent); }
.rid-json pre { max-width: 560px; max-height: 300px; white-space: pre-wrap; overflow: auto; overflow-wrap: anywhere; line-height: 1.6; font-size: 10px; padding: 12px; background: var(--bg); border-radius: 7px; }
@media(max-width:950px) { .flight-facts { grid-template-columns: repeat(2,minmax(0,1fr)); }  }
@media(max-width:720px) {
  .history-export { width: 100%; align-items: end; }
  .history-export label { flex: 1; min-width: 0; }
  .history-export select { min-width: 0; width: 100%; }
  .history-export button { width: 100%; }
  .history-stats { gap: 7px; }
  .history-stat { padding: 12px 9px; }
  .history-stat small { font-size: 9px; }
  .history-stat strong { font-size: 21px; }
  .flight-card { padding: 15px; }
  .flight-card-heading { flex-direction: column; gap: 10px; }
  .flight-card-bottom { flex-direction: column; align-items: stretch; }
  .flight-card-bottom .history-actions > button { flex: 1; }
  #flight-summary { grid-template-columns: repeat(2,minmax(0,1fr)); }
  #flight-map { width: 100%; height: auto; aspect-ratio: 56 / 39; }
  .history-pagination button { min-width: 100px; }
  .rid-json pre { max-width: 240px; }
}

.api-management{margin-top:30px;border-top:1px solid var(--line);padding-top:8px}.api-management code{overflow-wrap:anywhere}.api-management details{margin-top:20px}.api-management summary{cursor:pointer}.api-management #api-key-secret{padding:15px;border:1px solid var(--accent);border-radius:8px;margin-bottom:16px}.api-management #api-key-value{font-family:monospace}.api-management #api-key-hide{margin-top:10px}

#flight-map-legend [data-history-pin]{display:inline-block;width:16px;height:21px;flex-shrink:0}#flight-map-legend .rid-pin{width:16px;height:21px;filter:none}

.flight-detail-layout{display:grid;grid-template-columns:minmax(0,560px) minmax(230px,1fr);gap:22px;align-items:start;max-width:920px;margin:0 auto}.flight-detail-map,.flight-detail-info{min-width:0}.flight-detail-info{padding:4px 0}.flight-detail-info #flight-summary .flight-fact:first-child{grid-column:1 / -1}.flight-detail-info #flight-summary .flight-fact:first-child strong{font-size:28px;font-weight:650}.flight-detail-map .map-legend{gap:10px;padding:12px 0;font-size:9px}.flight-detail-map .map-legend span{line-height:1.6}.flight-detail-info #flight-map-note{margin-top:20px}@media(max-width:1000px){.flight-detail-layout{grid-template-columns:minmax(0,1fr);max-width:560px}.flight-detail-info #flight-summary{grid-template-columns:repeat(2,minmax(0,1fr))}.flight-detail-info #flight-summary .flight-fact:first-child{grid-column:auto}}
