/* Fly — map editor + course library (same identity as the menu: dark OSD panels, amber accent). */
.ed { position: fixed; inset: 0; z-index: 40; pointer-events: none; font: 13px/1.4 var(--sans); color: var(--text); }
.ed.hidden { display: none; }
.ed > * { pointer-events: auto; }
.ed button, .lib button, .ed select, .ed input, .ed textarea, .lib select, .lib input {
  font: inherit; color: var(--text); background: rgba(255, 255, 255, 0.05); border: 1px solid var(--line); border-radius: 6px; padding: 5px 9px;
}
.ed button, .lib button { cursor: pointer; white-space: nowrap; }
.ed button:hover, .lib button:hover { border-color: rgba(255, 138, 31, 0.5); }
.ed button.on, .lib button.on { background: var(--amber-soft); border-color: var(--amber); color: #fff; }
.ed button.go, .lib button.go { background: var(--amber); border-color: var(--amber); color: #111; font-weight: 600; }
.ed button:disabled { opacity: 0.4; cursor: default; }
.ed button.link, .lib button.link { background: none; border: 0; color: var(--muted); text-decoration: underline; padding: 4px; }
.ed button.x, .lib button.x { background: none; border: 0; font-size: 16px; color: var(--muted); }
.ed .btn { display: inline-block; cursor: pointer; padding: 5px 9px; border: 1px solid var(--line); border-radius: 6px; background: rgba(255, 255, 255, 0.05); }
.ed small, .lib small, .ed .muted, .lib .muted { color: var(--muted); }
.ed h4 { margin: 12px 0 6px; font: 600 11px/1 var(--display); letter-spacing: 0.08em; text-transform: uppercase; color: var(--amber); }
.ed h4 small { text-transform: none; letter-spacing: 0; font-family: var(--sans); font-weight: 400; }
.ed kbd { font-family: var(--mono); font-size: 11px; padding: 1px 5px; border: 1px solid var(--line); border-radius: 4px; }

.ed-top { position: absolute; top: 0; left: 0; right: 0; display: flex; gap: 10px; align-items: center; padding: 8px 12px; background: var(--panel); border-bottom: 1px solid var(--line); backdrop-filter: blur(8px); flex-wrap: wrap; }
.ed-brand { font: 700 18px/1 var(--display); letter-spacing: 0.04em; margin-right: 6px; }
.ed-brand span { color: var(--amber); }
.ed-brand b { font: 600 13px var(--display); margin-left: 6px; letter-spacing: 0.06em; text-transform: uppercase; }
.ed-tools, .ed-actions { display: flex; gap: 5px; align-items: center; flex-wrap: wrap; }
.ed-actions { margin-left: auto; }
.ed .sep { width: 1px; height: 22px; background: var(--line); margin: 0 3px; }
.ed-snap { display: flex; gap: 4px; align-items: center; }

.ed-left, .ed-right { position: absolute; top: 52px; bottom: 30px; overflow-y: auto; background: var(--panel); border: 1px solid var(--line); backdrop-filter: blur(8px); padding: 4px 12px 12px; }
.ed-left { left: 0; width: 214px; border-left: 0; }
.ed-right { right: 0; width: 300px; border-right: 0; }
.pals { display: flex; flex-direction: column; gap: 4px; }
.pals.brushes { flex-direction: row; flex-wrap: wrap; }
.pal { text-align: left; display: flex; align-items: center; gap: 7px; }
.pal .sw { width: 10px; height: 10px; border-radius: 2px; flex: none; }
.ed .f { display: flex; flex-direction: column; gap: 3px; margin: 6px 0; font-size: 12px; color: var(--muted); }
.ed .f input, .ed .f select, .ed .f textarea { color: var(--text); width: 100%; box-sizing: border-box; }
.ed .f output { color: var(--text); font-family: var(--mono); }
.ed input[type=color] { padding: 1px; height: 28px; }
.ed .check { display: flex; gap: 6px; align-items: center; font-size: 12px; margin: 6px 0; }
.ed .g2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ed .g3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.ed .row { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin: 6px 0; }
.ed-sec { border-bottom: 1px solid var(--line); padding-bottom: 8px; }

.ed-order { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 3px; }
.ed-order li { display: flex; align-items: center; gap: 6px; padding: 4px 6px; border: 1px solid var(--line); border-radius: 6px; cursor: grab; background: rgba(255, 255, 255, 0.03); }
.ed-order li.sel { border-color: var(--amber); background: var(--amber-soft); }
.ed-order li.over { border-top: 2px solid var(--amber); }
.ed-order li.empty { cursor: default; color: var(--muted); }
.ed-order .n { font: 700 12px var(--mono); color: var(--amber); width: 30px; }
.ed-order .t { flex: 1; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ed-order button { padding: 1px 6px; font-size: 10px; }
.ed .chip { font-size: 11px; padding: 2px 8px; margin: 2px; border-radius: 12px; }
.ed-checks { list-style: none; margin: 0; padding: 0; font-size: 12px; }
.ed-checks li { padding: 4px 6px 4px 22px; position: relative; border-radius: 4px; cursor: default; }
.ed-checks li[data-item] { cursor: pointer; }
.ed-checks li::before { position: absolute; left: 5px; top: 4px; font-weight: 700; }
.ed-checks li.error { color: #ffb4a8; } .ed-checks li.error::before { content: '✕'; color: var(--bad); }
.ed-checks li.warn { color: #ffd9a8; } .ed-checks li.warn::before { content: '!'; color: var(--amber); }
.ed-checks li.info { color: var(--muted); } .ed-checks li.info::before { content: '✓'; color: var(--good); }

.ed-status { position: absolute; bottom: 0; left: 0; right: 0; height: 30px; display: flex; gap: 18px; align-items: center; padding: 0 12px; background: var(--panel); border-top: 1px solid var(--line); font: 12px var(--mono); color: var(--muted); }
.ed-status #ed-hint { color: var(--text); font-family: var(--sans); flex: 1; }
.ed-toast { position: absolute; top: 64px; left: 50%; transform: translateX(-50%); background: rgba(12, 14, 18, 0.94); border: 1px solid var(--amber); color: var(--text); padding: 8px 14px; border-radius: 8px; opacity: 0; transition: opacity 0.2s; pointer-events: none; max-width: 60vw; }
.ed-toast.on { opacity: 1; }
.ed-toast.bad { border-color: var(--bad); }

.ed-modal { position: fixed; inset: 0; z-index: 60; background: rgba(0, 0, 0, 0.55); display: flex; align-items: center; justify-content: center; pointer-events: auto; font: 13px/1.45 var(--sans); color: var(--text); }
.ed-modal.hidden { display: none; }
.ed-dialog { position: relative; background: #111419; border: 1px solid var(--line); border-radius: 10px; padding: 16px 20px; max-width: min(560px, 92vw); max-height: 84vh; overflow: auto; }
.ed-dialog.wide { width: min(900px, 94vw); max-width: none; }
.ed-dialog h3 { margin: 0 0 10px; font: 700 18px var(--display); }
.ed-dialog .x { position: absolute; top: 10px; right: 12px; }
.ed-keys td { padding: 3px 10px 3px 0; }
.lib-tabs { display: flex; gap: 6px; margin-bottom: 10px; }
.lib-bar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; }
.lib-bar input[type=search] { flex: 1; min-width: 180px; }
.lib .btn { display: inline-block; cursor: pointer; padding: 5px 9px; border: 1px solid var(--line); border-radius: 6px; }
.lib-t { width: 100%; border-collapse: collapse; }
.lib-t th { text-align: left; font: 600 11px var(--display); color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; padding: 6px; border-bottom: 1px solid var(--line); }
.lib-t td { padding: 7px 6px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.lib-t .acts { display: flex; gap: 5px; justify-content: flex-end; flex-wrap: wrap; }
.lib-off { padding: 14px; border: 1px solid var(--line); border-radius: 8px; background: rgba(255, 138, 31, 0.06); }
.lib-off p { margin: 6px 0 0; color: var(--muted); }
.pill { font-size: 10px; padding: 1px 7px; border-radius: 9px; border: 1px solid var(--line); text-transform: uppercase; }
.pill.pending { color: #ffd9a8; border-color: rgba(255, 138, 31, 0.5); }
.pill.hidden { color: #ffb4a8; border-color: rgba(255, 91, 74, 0.5); }

/* menu: course row on the Fly tab */
.course-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 8px 0; }
.course-row .course-cur { color: var(--muted); font-size: 12px; }
.course-row .course-cur b { color: var(--text); }

@media (max-width: 900px) {
  .ed-left { width: 170px; }
  .ed-right { width: 240px; }
}
