﻿.drills-main {
  max-width: 1320px;
  margin: 18px auto;
  padding: 0 20px;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.row-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.row-head h2 { margin: 0; }

.planet-pick {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
}

.planet-pick select {
  padding: 6px 8px;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--text);
  font: inherit;
}

.map {
  --grid: #1b242d;
  position: relative;
  aspect-ratio: 1 / 1;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  background-color: #0e1318;
  cursor: crosshair;
  user-select: none;
  touch-action: none;
}

.map.planet-olympus { background-color: #0f1713; --grid: #1d2a22; }
.map.planet-styx { background-color: #11121c; --grid: #20223a; }
.map.planet-prometheus { background-color: #1a1010; --grid: #33201d; }
.map.planet-elysium { background-color: #0e1a18; --grid: #18302b; }

.map-inner {
  position: absolute;
  inset: 0;
  transform-origin: 0 0;
}

.zoom-bar {
  position: absolute;
  right: 10px;
  bottom: 10px;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 6px;
  border-radius: 8px;
  background: #0b0f13cc;
  border: 1px solid var(--line);
}

.zoom-bar button {
  padding: 1px 7px;
  font-size: 13px;
  line-height: 1.5;
  background: #141a21;
}

.zoom-bar #zoom-level {
  min-width: 40px;
  text-align: center;
  font-size: 11px;
  color: var(--muted);
}

.map-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: fill;
  opacity: 0.85;
  pointer-events: none;
}

.grid-lines {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(#ffffff20 1px, transparent 1px),
    linear-gradient(90deg, #ffffff20 1px, transparent 1px);
  background-size: 6.25% 6.25%;
}

.grid {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: repeat(16, 1fr);
  grid-template-rows: repeat(16, 1fr);
  pointer-events: none;
}

.grid span {
  align-self: start;
  justify-self: start;
  margin: 1px;
  padding: 0 2px;
  font-size: 8px;
  line-height: 1.45;
  color: #eef4fa;
  background: #00000055;
  border-radius: 2px;
  white-space: nowrap;
  opacity: 0.85;
  text-shadow: 0 1px 1px #000;
}

.markers { position: absolute; inset: 0; }

.marker {
  position: absolute;
  width: calc(100% / 48 - 1.5px);
  height: calc(100% / 48 - 1.5px);
  padding: 0;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  background: #0b0f13;
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  cursor: grab;
  overflow: hidden;
}

.marker:active { cursor: grabbing; }
.marker img { width: 100%; height: 100%; object-fit: contain; pointer-events: none; }
.marker.ok { border-color: var(--good); }
.marker.warn { border-color: var(--accent); }
.marker.bad { border-color: #d9605a; box-shadow: 0 0 0 2px #d9605a55; }

.drill-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }

.drill-card {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  padding: 10px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-left: 3px solid var(--line);
  border-radius: 9px;
}

.drill-card.ok { border-left-color: var(--good); }
.drill-card.warn { border-left-color: var(--accent); }
.drill-card.bad { border-left-color: #d9605a; }
.drill-card { cursor: pointer; }
.drill-card.hot { background: #1e2732; box-shadow: inset 0 0 0 1px var(--accent); }
.drill-card .card-actions button { cursor: pointer; }

.drill-card .icon { width: 32px; height: 32px; }
.drill-card .top { display: flex; align-items: baseline; gap: 8px; }
.drill-card .title { font-weight: 600; }
.drill-card .where { font-size: 12px; color: var(--muted); }

.drill-card .rate { font-size: 12px; color: var(--accent); }

#form input[readonly] {
  color: var(--muted);
  background: #10151a;
  cursor: default;
}
.drill-card .status { font-size: 13px; margin-top: 2px; }
.drill-card .status.bad { color: #e08a86; }
.drill-card .status.warn { color: var(--accent); }
.drill-card .status.ok { color: var(--good); }

.bar {
  height: 4px;
  margin-top: 6px;
  border-radius: 3px;
  background: #0b0f13;
  overflow: hidden;
}

.bar i { display: block; height: 100%; background: var(--accent); }

.card-actions { display: flex; gap: 6px; margin-top: 8px; }
.card-actions button { padding: 4px 9px; font-size: 12px; }
.card-actions button.danger { color: #e08a86; border-color: #4a2f2f; }
.card-actions .del { margin-left: auto; color: #6d7d90; border-color: transparent; background: transparent; }

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 14px;
  font-size: 12px;
  color: var(--muted);
}

.trash {
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px solid #202932;
}

.trash summary {
  cursor: pointer;
  font-size: 12px;
  color: var(--muted);
}

.trash-list {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  display: grid;
  gap: 6px;
  max-height: 220px;
  overflow: auto;
}

.trash-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  padding: 5px 6px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #121820;
}

.trash-item .icon { width: 22px; height: 22px; }

.trash-main {
  display: grid;
  gap: 1px;
  min-width: 0;
}

.trash-main span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.trash-item button {
  margin-left: auto;
  padding: 3px 8px;
  font-size: 11px;
}

.trash-actions {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}

.trash-actions button {
  padding: 4px 9px;
  font-size: 12px;
}

.legend span { display: flex; align-items: center; gap: 6px; }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.dot.ok { background: var(--good); }
.dot.warn { background: var(--accent); }
.dot.bad { background: #d9605a; }

dialog {
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0;
  width: min(640px, 92vw);
  max-height: 90vh;
}

dialog::backdrop { background: #000b; }

#form {
  padding: 20px 22px;
  max-height: 90vh;
  overflow: auto;
}

#form h2 {
  margin: 0 0 4px;
  text-transform: none;
  letter-spacing: 0.3px;
  font-size: 17px;
  color: var(--text);
}

.form-group {
  margin-top: 14px;
  padding: 16px 0 2px;
  border-top: 1px solid #202932;
}

.form-group h3 {
  margin: 0 0 10px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.1px;
  text-transform: uppercase;
  color: var(--muted);
}

.form-group .row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

#form label {
  display: grid;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
}

#form label.wide { margin-bottom: 12px; }
#form label.wide:last-child { margin-bottom: 0; }

#form input, #form select {
  width: 100%;
  padding: 8px 10px;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--text);
  font: inherit;
}

.pos {
  margin: 16px 0 0;
  padding-top: 14px;
  border-top: 1px solid #202932;
  font-size: 12px;
}

.hint { margin: 8px 0 0; font-size: 12px; }

.dialog-actions {
  position: sticky;
  bottom: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 18px -22px -20px;
  padding: 12px 22px;
  background: var(--panel);
  border-top: 1px solid var(--line);
}

.dialog-actions .spacer { flex: 1; }
button.primary { background: var(--accent); color: #201603; border-color: var(--accent); font-weight: 600; }
button.danger { color: #e08a86; border-color: #4a2f2f; }
button.danger[hidden] { display: none; }

.toasts {
  position: fixed;
  right: 18px;
  bottom: 18px;
  display: grid;
  gap: 8px;
  z-index: 50;
  max-width: 320px;
}

.toast {
  padding: 10px 12px;
  border-radius: 9px;
  background: #202a34;
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  box-shadow: 0 12px 30px #0008;
  font-size: 13px;
}

@media (max-width: 900px) {
  .drills-main { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
  .form-group .row { grid-template-columns: 1fr; }
}
