/* ═══════════════════════════════════════════════════════════════
   HelmHero v1 — screens.css
   Screen-specific layout and upload flow styles.
   ═══════════════════════════════════════════════════════════════ */

/* ── Upload steps breadcrumb ───────────────────────────────────── */
.upload-steps {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 8px 14px;
  background: var(--hh-navy);
  border-bottom: 1px solid rgba(255,255,255,.08);
  overflow-x: auto;
  scrollbar-width: none;
  flex-shrink: 0;
}
.upload-steps::-webkit-scrollbar { display: none; }

.upload-step {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: var(--r-pill);
  background: rgba(255,255,255,.06);
  border: none;
  cursor: default;
  white-space: nowrap;
}
.upload-step.active {
  background: rgba(20,126,251,.18);
  border: 1px solid rgba(20,126,251,.35);
}
.upload-step.done {
  cursor: pointer;
  background: rgba(255,255,255,.1);
}
.upload-step.done:hover { background: rgba(255,255,255,.16); }

.step-num {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: rgba(255,255,255,.15);
  color: rgba(255,255,255,.4);
  font-size: 9px;
  font-weight: 700;
  font-family: var(--mono);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.upload-step.active .step-num {
  background: #fff;
  color: var(--hh-navy);
}
.upload-step.done .step-num {
  background: var(--hh-aqua-deep);
  color: #fff;
}

.step-lbl {
  font-family: var(--display);
  font-size: 10px;
  font-weight: 600;
  color: rgba(255,255,255,.35);
}
.upload-step.active .step-lbl { color: #fff; font-weight: 700; }
.upload-step.done .step-lbl   { color: rgba(255,255,255,.7); }

.step-arrow {
  color: rgba(255,255,255,.25);
  font-size: 11px;
  flex-shrink: 0;
}

/* ── Drop zone ─────────────────────────────────────────────────── */
.drop-zone {
  border: 2px dashed var(--hh-border);
  border-radius: var(--r-lg);
  padding: 32px 20px;
  text-align: center;
  cursor: pointer;
  background: var(--hh-surface);
  box-shadow: var(--shadow-sm);
  transition: border-color .2s, background .2s;
  margin-bottom: 16px;
  outline: none;
}
.drop-zone:hover,
.drop-zone:focus,
.drop-zone.drag {
  border-color: var(--hh-blue);
  background: var(--hh-tint-blue);
}

.drop-icon {
  width: 36px;
  height: 36px;
  margin: 0 auto 10px;
  color: var(--hh-muted);
}

.drop-lbl {
  font-family: var(--display);
  font-size: 14px;
  font-weight: 700;
  color: var(--hh-ink);
  margin-bottom: 5px;
}

.drop-hint {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--hh-muted);
  line-height: 1.6;
}

/* ── File confirmed bar ────────────────────────────────────────── */
.file-ok {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--hh-tint-green);
  border: 1px solid rgba(0,168,132,.3);
  border-radius: var(--r-md);
  padding: 11px 14px;
  margin-bottom: 16px;
}
.file-ok svg {
  width: 18px;
  height: 18px;
  color: var(--hh-aqua-deep);
  flex-shrink: 0;
}
.file-ok-info { flex: 1; min-width: 0; }
.file-ok-name {
  font-family: var(--display);
  font-weight: 700;
  font-size: 13px;
  color: var(--hh-ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.file-ok-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 3px;
}
.file-ok-rows {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--hh-muted);
}
.file-change-btn {
  font-size: 11px;
  font-weight: 600;
  color: var(--hh-blue);
  background: none;
  border: none;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  padding: 0;
}
.file-change-btn:hover { text-decoration: underline; }

/* ── Field layout helpers ──────────────────────────────────────── */
.field-row-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
  margin-bottom: 16px;
}
.field-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
/* Wind row: direction gets less space than speed+button */
.wind-row-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
@media (max-width: 600px) {
  .field-row-3 { grid-template-columns: 1fr; }
  .field-row-2 { grid-template-columns: 1fr; }
}

.field-label-sub {
  font-size: 9px;
  letter-spacing: .5px;
  margin-bottom: 5px;
}

.inp-mono { font-family: var(--mono); }

.inp-with-btn {
  display: flex;
  gap: 8px;
  align-items: stretch;
}
.inp-with-btn .inp { flex: 1; min-width: 0; }
.btn-inline {
  padding: 9px 12px;
  font-size: 11px;
  flex-shrink: 0;
  border-radius: var(--r-sm);
}

/* ── Gun time field ────────────────────────────────────────────── */
.gun-time-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.gun-time-hint {
  font-size: 11px;
  color: var(--hh-muted);
  line-height: 1.45;
  flex: 1;
}

/* ── Loading screen ────────────────────────────────────────────── */
.loading-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 70vh;
  gap: 16px;
  text-align: center;
}

.hh-mark-lg {
  width: 56px;
  height: 56px;
  margin: 0 auto;
  display: block;
}

.loading-msg {
  font-family: var(--sans);
  font-size: 14px;
  color: var(--hh-muted);
}

.loading-detail {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--hh-border);
  max-width: 280px;
}

.dots { display: flex; gap: 5px; }
.dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--hh-blue);
  animation: pulse 1.2s ease-in-out infinite;
}
.dot:nth-child(2) { animation-delay: .2s; }
.dot:nth-child(3) { animation-delay: .4s; }
@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: .3; }
  50%       { transform: scale(1.5); opacity: 1; }
}

/* ── Course validate layout ────────────────────────────────────── */
#cv-layout {
  display: flex;
  flex: 1;
  overflow: hidden;
  height: calc(100dvh - 50px - 42px); /* minus header and steps bar */
}

#cv-sidebar-wrap {
  width: 320px;
  flex-shrink: 0;
  background: var(--hh-surface);
  border-right: 1px solid var(--hh-border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#cv-sidebar-content {
  overflow-y: auto;
  flex: 1;
}

#cv-sidebar-footer {
  flex-shrink: 0;
  border-top: 1px solid var(--hh-border);
  padding: 10px 12px;
  background: var(--hh-surface);
}

.cv-validation-msg {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--hh-muted);
  text-align: center;
  padding: 0 0 7px;
  min-height: 18px;
}

#cv-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

#cv-map { flex: 1; position: relative; overflow: hidden; }

@media (max-width: 600px) {
  #cv-layout { flex-direction: column; height: auto; }
  #cv-main   { flex: 0 0 auto; }
  #cv-map    { height: 50vh; min-height: 280px; }
  #cv-sidebar-wrap {
    width: 100%;
    flex: 1;
    border-right: none;
    border-top: 1px solid var(--hh-border);
    min-height: 0;
  }
}

/* ── Flow progress pills ──────────────────────────────────────── */
.flow-pills {
  background: var(--hh-navy);
  border-top: 1px solid rgba(255,255,255,.06);
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px 16px 8px;
  overflow-x: auto;
  scrollbar-width: none;
  flex-shrink: 0;
}
.flow-pills::-webkit-scrollbar { display: none; }

.flow-pill {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: var(--r-pill);
  font-family: var(--display);
  font-size: 10px;
  font-weight: 600;
  white-space: nowrap;
  border: none;
  cursor: default;
  flex-shrink: 0;
}

/* Current step */
.flow-pill.current {
  background: rgba(20,126,251,.2);
  border: 1px solid rgba(20,126,251,.4);
  color: #fff;
}

/* Future step — disabled */
.flow-pill.future {
  background: rgba(255,255,255,.06);
  color: rgba(255,255,255,.3);
}

/* Done — reversible, tappable */
button.flow-pill.done {
  background: rgba(255,255,255,.1);
  color: rgba(255,255,255,.7);
  cursor: pointer;
}
button.flow-pill.done:hover {
  background: rgba(255,255,255,.18);
  color: #fff;
}

/* Done — irreversible, explains on tap */
button.flow-pill.irreversible {
  background: rgba(0,210,166,.08);
  color: rgba(0,210,166,.5);
  cursor: pointer;
}
button.flow-pill.irreversible:hover {
  background: rgba(0,210,166,.13);
}

.pill-num {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  font-size: 8px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.flow-pill.current .pill-num { background: #fff; color: var(--hh-navy); }
.flow-pill.future .pill-num  { background: rgba(255,255,255,.12); color: rgba(255,255,255,.3); }
button.flow-pill.done .pill-num { background: rgba(0,210,166,.3); color: #19E8C2; font-size: 9px; }
button.flow-pill.irreversible .pill-num { background: rgba(0,210,166,.15); color: rgba(0,210,166,.5); font-size: 9px; }

.pill-arrow {
  color: rgba(255,255,255,.25);
  font-size: 11px;
  flex-shrink: 0;
}

/* Course-validate layout: subtract header + tab bar + pills from height */
#cv-layout {
  height: calc(100dvh - 50px - 38px - 40px);
}

/* ═══════════════════════════════════════════════════════════════
   Course-validate sidebar + map overlay CSS
   Ported verbatim from v8 index.html lines 670-777
   ═══════════════════════════════════════════════════════════════ */

.cv-wind-row { display:flex; align-items:center; gap:7px; padding:7px 10px; background:#fffbf0; border-bottom:1px solid var(--pb2); font-family:var(--mono); }
.cv-wind-row .lbl { font-size:9px; color:#7a5c0a; text-transform:uppercase; font-weight:700; letter-spacing:.4px; font-family:var(--display); }
.cv-wind-row .val { font-size:12px; font-weight:700; color:var(--navy); }
.cv-wind-row .sub { font-size:11px; color:var(--muted); }

.cv-witi { margin:8px 10px 0; }

.cv-section { padding:6px 10px 8px; border-bottom:1px solid var(--pb2); }
.cv-section-hdr { display:flex; align-items:center; justify-content:space-between; padding:4px 0 5px; position:relative; }
.cv-section-title { font-family:var(--display); font-size:9.5px; font-weight:700; text-transform:uppercase; letter-spacing:1.2px; color:var(--muted); padding-left:8px; position:relative; }
.cv-section-title::before { content:''; position:absolute; left:0; top:2px; bottom:2px; width:3px; border-radius:2px; background:var(--hh-grad); }
.cv-section-count { font-size:9px; color:var(--faint); font-family:var(--mono); }

.cv-markset-row { display:none; } /* deprecated — replaced by cv-markset-picker */
.cv-markset-picker { display:flex; align-items:center; gap:7px; padding:5px 8px; background:var(--panel); border:1px solid var(--pb); border-radius:6px; cursor:pointer; transition:border-color .15s; }
.cv-markset-picker:hover { border-color:var(--accent); }
.cv-markset-picker svg { color:var(--muted); flex-shrink:0; }
.cv-markset-picker .cv-ms-name { flex:1; }
.cv-ms-label { font-size:8px; color:var(--muted); text-transform:uppercase; letter-spacing:.4px; font-family:var(--display); font-weight:700; }
.cv-ms-name { font-size:11px; font-weight:700; color:var(--navy); font-family:var(--mono); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }

.cv-pool-grid { display:flex; flex-wrap:wrap; gap:4px; }
.cv-pool-mark { display:inline-flex; align-items:center; gap:5px; padding:3px 7px; background:var(--panel); border:1px solid var(--pb); border-radius:14px; cursor:grab; font-size:11px; transition:border-color .15s, opacity .15s; }
.cv-pool-mark:hover { border-color:var(--accent); }
.cv-pool-mark.in-use { cursor:default; }
.cv-pool-mark.dragging { opacity:0.4; }
.cv-pool-dot { width:9px; height:9px; border-radius:50%; flex-shrink:0; border:1px solid rgba(0,0,0,0.12); }
.cv-pool-name { font-weight:700; color:var(--navy); font-family:var(--mono); }
.cv-pool-used { font-size:8px; color:var(--muted); font-family:var(--mono); margin-left:1px; }
.cv-kebab { background:none; border:none; cursor:pointer; color:var(--muted); padding:2px 6px; font-size:14px; line-height:1; min-width:24px; min-height:24px; display:flex; align-items:center; justify-content:center; }
.cv-kebab:hover { color:var(--accent); }

.cv-pool-actions { display:flex; gap:5px; margin-top:6px; }
.cv-pool-action-btn { flex:1; padding:5px 6px; font-size:10px; border:1px dashed var(--pb); border-radius:6px; cursor:pointer; background:transparent; color:var(--muted); display:flex; align-items:center; justify-content:center; gap:4px; font-family:var(--sans); }
.cv-pool-action-btn:hover { color:var(--accent); border-color:var(--accent); }
.cv-pool-action-btn.active { color:var(--red); border-color:var(--red); border-style:solid; background:#fff5f5; }

.cv-drop-zone { padding:10px 8px; border:1.5px dashed var(--pb); border-radius:6px; background:var(--hh-surface-2); text-align:center; font-size:10px; color:var(--faint); font-style:italic; transition:background .15s, border-color .15s; }
.cv-drop-zone.drag-over { background:var(--hh-tint-blue); border-color:var(--accent); color:var(--accent); border-style:solid; }
.cv-drop-zone.drop-below { margin-top:4px; padding:7px 8px; min-height:0; }

.cv-line-mark { display:flex; align-items:center; gap:6px; padding:5px 7px; background:#fffbf0; border:1px solid #f0d78a; border-radius:6px; margin-bottom:3px; }
.cv-line-mark .dot { width:10px; height:10px; border-radius:50%; background:#d4820a; flex-shrink:0; }
.cv-line-mark .name { font-size:11px; font-weight:700; color:#7a5c0a; flex:1; font-family:var(--mono); }
.cv-bp-toggle { display:flex; border:1px solid #d4820a; border-radius:4px; overflow:hidden; }
.cv-bp-btn { padding:2px 6px; font-size:9px; font-weight:700; border:none; background:transparent; color:#7a5c0a; cursor:pointer; font-family:var(--mono); }
.cv-bp-btn.active { background:#d4820a; color:#fff; }
.cv-finish-same { display:flex; align-items:center; gap:6px; padding:6px 8px; background:var(--hh-surface-2); border:1px solid var(--pb2); border-radius:6px; font-size:10.5px; color:var(--muted); }
.cv-finish-same svg { flex-shrink:0; color:var(--muted); }

.cv-leg-meta { padding:1px 5px 1px 28px; font-size:9px; color:var(--muted); font-family:var(--mono); line-height:1.3; }
.cv-leg-type-up { color:#147EFB; font-weight:700; }
.cv-leg-type-dw { color:#00A884; font-weight:700; }
.cv-leg-type-rc { color:#d4820a; font-weight:700; }

.cv-course-entry { display:flex; align-items:center; gap:4px; padding:4px 5px; background:var(--panel); border:1px solid var(--pb); border-radius:6px; margin-bottom:3px; }
.cv-course-entry.drag-over { border-color:var(--accent); background:var(--hh-tint-blue); }
.cv-course-entry.dragging { opacity:0.5; }
.cv-drag-handle { color:var(--faint); cursor:grab; display:flex; align-items:center; padding:0; }
.cv-drag-handle:active { cursor:grabbing; }
.cv-course-num { width:16px; height:16px; border-radius:50%; background:var(--hh-surface-2); color:var(--muted); font-size:8.5px; font-weight:700; display:flex; align-items:center; justify-content:center; font-family:var(--mono); flex-shrink:0; }
.cv-course-mark { width:20px; height:20px; border-radius:50%; display:flex; align-items:center; justify-content:center; font-size:10px; font-weight:700; color:#fff; flex-shrink:0; font-family:var(--mono); }
.cv-course-mark.port { background:var(--red); }
.cv-course-mark.stbd { background:var(--green); }
.cv-course-name { font-size:11px; font-weight:700; color:var(--navy); flex:1; font-family:var(--mono); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }

.cv-leave-toggle { display:flex; border-radius:4px; overflow:hidden; border:1px solid var(--pb); flex-shrink:0; }
.cv-leave-btn { padding:2px 5px; font-size:9px; font-weight:700; border:none; cursor:pointer; background:transparent; color:var(--muted); font-family:var(--mono); }
.cv-leave-btn.active.port { background:var(--red); color:#fff; }
.cv-leave-btn.active.stbd { background:var(--green); color:#fff; }
.cv-leave-btn:hover:not(.active) { background:var(--hh-surface-2); }

.cv-x-btn { background:none; border:none; cursor:pointer; color:var(--faint); padding:1px 2px; line-height:0; display:flex; align-items:center; }
.cv-x-btn:hover { color:var(--red); }

.cv-finish-mode-row { display:flex; gap:4px; margin-bottom:5px; }
.cv-finish-mode-btn { flex:1; padding:5px 4px; font-size:10px; font-weight:600; border:1px solid var(--pb); border-radius:5px; cursor:pointer; background:var(--panel); color:var(--muted); font-family:var(--sans); }
.cv-finish-mode-btn.active { background:var(--hh-tint-blue); color:var(--accent); border-color:var(--accent); }

.cv-validation-msg { font-size:10px; color:var(--muted); text-align:center; padding:0 0 6px; }

/* Map overlays */
.cv-wind-overlay { position:absolute; top:10px; right:10px; background:rgba(255,255,255,0.95); border:1px solid rgba(0,0,0,0.08); border-radius:6px; padding:6px 9px; display:flex; align-items:center; gap:8px; box-shadow:0 2px 8px rgba(0,0,0,0.06); z-index:500; }
.cv-wind-overlay .lbl { font-size:9px; color:#7a5c0a; text-transform:uppercase; letter-spacing:.5px; font-family:var(--display); font-weight:700; }
.cv-wind-overlay .val { font-size:13px; font-weight:700; font-family:var(--mono); color:var(--navy); }
.cv-wind-overlay #cv-wind-rose { width:34px; height:34px; flex-shrink:0; }

.cv-tools-overlay { position:absolute; top:60px; right:10px; display:flex; gap:5px; z-index:500; }
.cv-tool-pill { background:rgba(255,255,255,0.95); border:1px solid rgba(0,0,0,0.08); border-radius:5px; padding:5px 8px; font-size:10px; font-family:var(--sans); font-weight:600; cursor:pointer; color:var(--navy); display:flex; align-items:center; gap:4px; box-shadow:0 2px 8px rgba(0,0,0,0.06); }
.cv-tool-pill:hover { background:#fff; border-color:var(--accent); color:var(--accent); }
.cv-tool-pill.active { background:var(--accent); color:#fff; border-color:var(--accent); }

.cv-legend-overlay { position:absolute; bottom:10px; right:10px; background:rgba(255,255,255,0.95); border:1px solid rgba(0,0,0,0.08); border-radius:5px; padding:6px 9px; font-size:9px; font-family:var(--mono); display:flex; flex-direction:column; gap:2px; z-index:500; box-shadow:0 2px 8px rgba(0,0,0,0.06); }
.cv-legend-row { display:flex; align-items:center; gap:5px; color:var(--navy); }
.cv-legend-sw { width:14px; height:3px; border-radius:2px; }
.cv-legend-dot { width:9px; height:9px; border-radius:50%; }

.cv-kebab-menu { position:absolute; background:var(--panel); border:1px solid var(--pb); border-radius:6px; box-shadow:0 4px 16px rgba(0,0,0,0.12); padding:3px 0; font-size:11px; z-index:1000; min-width:140px; }
.cv-kebab-item { padding:5px 12px; cursor:pointer; display:flex; align-items:center; gap:6px; color:var(--navy); font-family:var(--sans); }
.cv-kebab-item:hover { background:var(--hh-surface-2); }
.cv-kebab-item.danger { color:var(--red); }

/* ── Mode banner (add/move active indicator at top of sidebar) ── */
.cv-mode-banner {
  padding: 7px 10px;
  font-size: 11px;
  font-weight: 600;
  font-family: var(--sans);
  display: flex;
  align-items: center;
  gap: 6px;
}
.cv-mode-add { background: #E1F5EE; color: #085041; }
.cv-mode-move { background: #E6F1FB; color: #0C447C; }

/* ── Track toggle button (top-right, below wind overlay) ─────── */
.cv-track-btn {
  background: rgba(255,255,255,0.95);
  border: 1.5px solid rgba(0,0,0,0.15);
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 11px;
  font-family: var(--sans);
  font-weight: 600;
  cursor: pointer;
  color: var(--navy);
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  transition: all .15s;
}
.cv-track-btn:hover {
  background: #fff;
  border-color: var(--accent);
  color: var(--accent);
}
