/* Navigator — shared base (layout shell + components) */

#view-navigator.tab-active {
  overflow: hidden !important;
  flex: 1 !important;
  min-height: 0 !important;
  display: flex !important;
  flex-direction: column !important;
}

#view-navigator .stud-nav-screen {
  padding: 0 !important;
  overflow: hidden !important;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  background: #e8eef4;
}

html.dark #view-navigator .stud-nav-screen {
  background: #0a0e14;
}

.stud-nav-stage {
  position: relative;
  flex: 1;
  min-height: 0;
  width: 100%;
  overflow: hidden;
  --nav-tabbar: 58px;
  --nav-ui-bottom: 58px;
  --nav-sheet-peek: 88px;
  --nav-explore-h: 48px;
}

.stud-nav-map-layer {
  position: absolute;
  inset: 0;
  z-index: 0;
}

#nav-canvas {
  position: absolute;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
  display: block;
  touch-action: none;
  cursor: grab;
}

#nav-canvas:active {
  cursor: grabbing;
}

.stud-nav-map-fallback {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  text-align: center;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-text-muted);
  background: rgba(232, 238, 244, 0.92);
  pointer-events: none;
}

html.dark .stud-nav-map-fallback {
  background: rgba(10, 14, 20, 0.92);
}

.stud-nav-map-layer::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.08) 0%, transparent 20%, transparent 70%, rgba(0, 0, 0, 0.06) 100%);
}

/* —— Trip editor (shared) —— */
.stud-nav-trip {
  display: flex;
  align-items: stretch;
  gap: 0;
  padding: 4px 4px 0 0;
  position: relative;
}

.stud-nav-trip-rail {
  position: absolute;
  left: 21px;
  top: 24px;
  bottom: 24px;
  width: 2px;
  background: linear-gradient(180deg, #34a853 0%, #34a853 6px, #dadce0 6px, #dadce0 calc(100% - 6px), #ea4335 calc(100% - 6px), #ea4335 100%);
  border-radius: 1px;
  pointer-events: none;
}

html.dark .stud-nav-trip-rail {
  background: linear-gradient(180deg, #34a853 0%, #34a853 6px, #4a5568 6px, #4a5568 calc(100% - 6px), #ea4335 calc(100% - 6px), #ea4335 100%);
}

.stud-nav-trip-fields {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding-left: 0;
}

.stud-nav-trip-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 6px 0 16px;
  min-height: 46px;
}

.stud-nav-trip-row + .stud-nav-trip-row {
  border-top: 1px solid var(--color-border);
}

.stud-nav-pin {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
  flex-shrink: 0;
  z-index: 1;
}

.stud-nav-pin--from { background: #34a853; }
.stud-nav-pin--via { background: #9aa0a6; }
.stud-nav-pin--to { background: #ea4335; }

.stud-nav-trip-input {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  padding: 12px 0;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--color-text);
}

.stud-nav-trip-input::placeholder {
  color: var(--color-text-muted);
  font-weight: 400;
}

.stud-nav-trip-input:focus { outline: none; }

.stud-nav-trip-clear {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.06);
  color: var(--color-text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
}

.stud-nav-trip-row.has-value .stud-nav-trip-clear {
  opacity: 1;
  pointer-events: auto;
}

.stud-nav-trip-remove {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 50%;
  background: rgba(234, 67, 53, 0.12);
  color: #ea4335;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 1;
  pointer-events: auto;
}

.stud-nav-trip-remove .icon {
  font-size: 14px;
}

.stud-nav-trip-swap {
  flex-shrink: 0;
  align-self: center;
  width: 34px;
  height: 34px;
  margin: 0 6px 0 0;
  border: none;
  border-radius: 50%;
  background: var(--color-surface);
  color: var(--color-brand);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.stud-nav-trip-swap .icon { font-size: 17px; }

.stud-nav-planner-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px 10px;
  border-top: 1px solid var(--color-border);
}

.stud-nav-text-btn {
  border: none;
  background: none;
  color: var(--color-brand);
  font-size: 0.8125rem;
  font-weight: 600;
  padding: 8px 2px;
  cursor: pointer;
}

.stud-nav-primary-btn {
  flex: 1;
  min-height: 42px;
  border: none;
  border-radius: 10px;
  background: var(--color-brand);
  color: #fff;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
}

/* —— Guidance HUD —— */
@keyframes stud-nav-hud-in {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

.stud-nav-guidance {
  position: absolute;
  z-index: 24;
  display: flex;
  align-items: stretch;
  border-radius: 14px;
  overflow: hidden;
  background: #1a73e8;
  color: #fff;
  box-shadow: 0 4px 20px rgba(26, 115, 232, 0.4);
  animation: stud-nav-hud-in 0.32s cubic-bezier(0.32, 0.72, 0, 1);
  pointer-events: auto;
}

.stud-nav-guidance[hidden] {
  display: none !important;
}

.stud-nav-guidance-icon {
  flex-shrink: 0;
  width: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.12);
}

.stud-nav-guidance-icon .icon { font-size: 32px; }

.stud-nav-guidance-copy {
  flex: 1;
  min-width: 0;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
}

.stud-nav-guidance-dist {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.stud-nav-guidance-text {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stud-nav-guidance-eta {
  flex-shrink: 0;
  padding: 10px 12px;
  text-align: right;
  display: flex;
  flex-direction: column;
  justify-content: center;
  border-left: 1px solid rgba(255, 255, 255, 0.2);
}

.stud-nav-guidance-eta > span { font-size: 1rem; font-weight: 700; }
.stud-nav-guidance-eta small { font-size: 0.72rem; opacity: 0.85; }

/* —— Directions list —— */
.stud-nav-directions {
  list-style: none;
  margin: 0;
  padding: 0 0 8px;
}

.stud-nav-directions li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 14px;
  font-size: 0.9rem;
  line-height: 1.4;
}

.stud-nav-directions li.is-current {
  background: rgba(26, 115, 232, 0.08);
}

.stud-nav-dir-icon {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--color-surface);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-brand);
}

.stud-nav-dir-icon .icon { font-size: 16px; }

.stud-nav-dir-text strong { display: block; font-weight: 600; }
.stud-nav-dir-text small { color: var(--color-text-muted); }

.stud-nav-sheet-steps-title {
  margin: 0;
  padding: 10px 14px 4px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-muted);
}

.stud-nav-go-nav-btn {
  width: 100%;
  min-height: 48px;
  border: none;
  border-radius: 12px;
  background: #34a853;
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
}

.stud-nav-go-nav-btn.is-active { background: #d93025; }

/* —— POI list —— */
.stud-nav-poi-list {
  list-style: none;
  margin: 0;
  padding: 0;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

.stud-nav-poi-list li { border-bottom: 1px solid var(--color-border); }

.stud-nav-poi-list button {
  width: 100%;
  border: none;
  background: none;
  text-align: left;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  color: var(--color-text);
}

.stud-nav-poi-list .icon { font-size: 22px; color: var(--color-brand); }
.stud-nav-poi-list strong { display: block; font-size: 0.95rem; font-weight: 600; }
.stud-nav-poi-list span span { display: block; font-size: 0.78rem; color: var(--color-text-muted); margin-top: 2px; }

/* State: hide non-interactive layers */
.stud-nav-stage.has-route .stud-nav-gesture-hint,
.stud-nav-stage.is-navigating .stud-nav-gesture-hint {
  display: none !important;
}

.stud-nav-map-legend {
  pointer-events: none;
}

.stud-nav-stage.has-route .stud-nav-planner-actions,
.stud-nav-stage.has-route .stud-nav-trip-row:not(:first-child):not(:last-child),
.stud-nav-stage.has-route .stud-nav-trip-swap {
  display: none !important;
}

.stud-nav-picker-wrap {
  position: relative;
}

.stud-nav-suggest {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  z-index: 30;
  list-style: none;
  margin: 0;
  padding: 6px;
  max-height: 200px;
  overflow: auto;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--color-border);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.14);
}

html.dark .stud-nav-suggest {
  background: rgba(22, 28, 36, 0.92);
}

.stud-nav-suggest-opt {
  display: block;
  width: 100%;
  text-align: left;
  border: none;
  background: transparent;
  padding: 10px 12px;
  font: inherit;
  color: var(--color-text);
  border-radius: 10px;
  min-height: 44px;
}

.stud-nav-suggest-opt:active {
  background: rgba(10, 77, 140, 0.1);
}

.stud-nav-suggest-empty {
  padding: 10px 12px;
  font-size: 0.82rem;
  color: var(--color-text-muted);
}
