/* === Tokens === */
:root {
  --bg: #0a0a0f;
  --surface: #12121a;
  --surface-2: #1a1a25;
  --border: #2a2a3a;
  --border-light: #3a3a4a;
  --fg: #e4e4ed;
  --fg-muted: #7a7a8a;
  --accent: #6366f1;
  --accent-2: #8b5cf6;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;

  --radius: clamp(8px, 1vw, 12px);
  --radius-sm: clamp(6px, 0.7vw, 8px);

  --touch-min: clamp(36px, 4.5vh, 44px);
  --header-h: clamp(48px, 8vh, 60px);
  --gap: clamp(8px, 1.2vw, 14px);

  /* Fluid font sizing */
  --fs-xs: clamp(10px, 0.95vw, 11px);
  --fs-sm: clamp(11px, 1.05vw, 13px);
  --fs-md: clamp(12px, 1.15vw, 14px);
  --fs-lg: clamp(14px, 1.3vw, 16px);
  --fs-xl: clamp(16px, 1.7vw, 20px);
}

/* === Reset === */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
}

body {
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  font-size: var(--fs-md);
  line-height: 1.45;
  color: var(--fg);
  background-color: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow: hidden;
}

button, input {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

input[type="text"],
input[type="number"] {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--fg);
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  outline: none;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: var(--fs-sm);
}

input[type="text"]:focus,
input[type="number"]:focus {
  border-color: var(--accent);
}

input:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: var(--fs-xs);
  color: var(--fg-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 500;
}

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-light); }

/* === Header === */
.header {
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(12px, 1.5vw, 20px);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.brand {
  display: flex;
  align-items: center;
  gap: clamp(8px, 1vw, 12px);
  min-width: 0;
}

.brand-icon {
  width: clamp(26px, 3vw, 32px);
  height: clamp(26px, 3vw, 32px);
  border-radius: 8px;
  background: var(--accent);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: var(--fs-xs);
  color: #fff;
  flex-shrink: 0;
}

.brand-text {
  font-size: var(--fs-lg);
  font-weight: 700;
}

.brand-tag {
  font-size: var(--fs-xs);
  color: var(--fg-muted);
  padding: 2px 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

.btn-fullscreen {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 clamp(8px, 1vw, 14px);
  height: clamp(30px, 4.5vh, 36px);
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--fg);
  border-radius: var(--radius-sm);
  font-size: var(--fs-sm);
  font-weight: 500;
  white-space: nowrap;
}
.btn-fullscreen:hover {
  border-color: var(--border-light);
}
.btn-fullscreen svg {
  width: 14px;
  height: 14px;
}

/* === Dashboard Layout === */
.dashboard-main {
  padding: var(--gap);
  /* Md ve üzeri: viewport'a sığacak yükseklik */
  height: calc(100vh - var(--header-h));
  overflow: hidden;
}

.dashboard-row {
  height: 100%;
  margin: 0 !important;
}

/* Bootstrap col padding'i row gap'i ile çakışmasın */
.dashboard-row > [class*="col-"] {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  min-height: 0;
  min-width: 0;
  width: 100%;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
}

/* VNC kolonu: md ve üstünde row yüksekliğini doldurur */
.vnc-col { height: 100%; }
.ros-col { height: 100%; }

/* xs (<576): alt alta dizilsin, sayfa scroll açık */
@media (max-width: 575.98px) {
  body { overflow: auto; }
  .dashboard-main {
    height: auto;
    min-height: calc(100vh - var(--header-h));
    overflow: visible;
  }
  .dashboard-row { height: auto; }
  .vnc-col {
    height: auto;
    min-height: 280px;
    aspect-ratio: 16 / 9;
  }
  .ros-col { height: auto; }
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  min-height: 0;
  min-width: 0;
}

/* === VNC Panel === */
:root {
  --vnc-chrome-h: 28px;
}

.vnc-panel {
  padding: 0;
  /* flex zincirinin sonu — kolonu doldur */
  flex: 1 1 auto;
  min-height: 0;
}

.screen-container {
  flex: 1;
  display: block;
  position: relative;
  background: #000;
  overflow: hidden;
  min-width: 0;
  min-height: 0;
}

#vnc-container {
  position: absolute;
  inset: 0;
  display: block;
}

/* iframe boyut ve konumu JS (fitVncCover) tarafından set ediliyor.
   Default değerler — JS yüklenmediğinde de görünür kalsın diye. */
#vnc-container iframe {
  position: absolute;
  left: 0;
  top: calc(var(--vnc-chrome-h) * -1);
  width: 100%;
  height: calc(100% + var(--vnc-chrome-h));
  border: 0;
  display: block;
  background: #000;
}

#vnc-container canvas {
  width: 100%;
  height: 100%;
  display: block;
}

#vnc-container > .offline-message {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.offline-message {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  color: var(--fg-muted);
  padding: 16px;
  text-align: center;
}

.offline-icon {
  width: clamp(32px, 5vw, 44px);
  height: clamp(32px, 5vw, 44px);
  border-radius: 50%;
  border: 2px dashed var(--border-light);
  position: relative;
}
.offline-icon::after {
  content: '';
  position: absolute;
  inset: 25%;
  border-radius: 50%;
  background: var(--warning);
  opacity: 0.7;
}

.offline-text {
  font-size: var(--fs-sm);
}

/* === ROS Panel === */
.ros-panel {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
}

.ros-panel-inner {
  overflow-y: auto;
  padding: clamp(6px, 0.8vw, 10px);
  flex: 1;
  min-height: 0;
}

.ros-section {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.ros-section > summary {
  cursor: pointer;
  padding: clamp(7px, 1vh, 10px) clamp(10px, 1.2vw, 14px);
  font-weight: 600;
  font-size: var(--fs-sm);
  display: flex;
  align-items: center;
  gap: 10px;
  user-select: none;
  list-style: none;
}
.ros-section > summary::-webkit-details-marker {
  display: none;
}
.ros-section > summary::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}
.ros-section > summary::after {
  content: '';
  margin-left: auto;
  width: 6px;
  height: 6px;
  border-right: 2px solid var(--fg-muted);
  border-bottom: 2px solid var(--fg-muted);
  transform: rotate(45deg);
  flex-shrink: 0;
}
.ros-section[open] > summary::after {
  transform: rotate(-135deg);
}
.ros-section > summary:hover {
  background: rgba(255, 255, 255, 0.02);
}

.ros-section-body {
  padding: clamp(8px, 1vw, 12px);
  display: flex;
  flex-direction: column;
  gap: clamp(6px, 0.8vw, 10px);
  border-top: 1px solid var(--border);
}

/* === Connection === */
.ros-connection-status {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: var(--fs-sm);
  font-weight: 500;
}

.ros-connection-status .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--warning);
  flex-shrink: 0;
}

.ros-connection-status[data-state="connected"] .dot { background: var(--success); }
.ros-connection-status[data-state="connecting"] .dot {
  background: var(--accent);
  animation: blink 1s ease-in-out infinite;
}
.ros-connection-status[data-state="error"] .dot,
.ros-connection-status[data-state="disconnected"] .dot { background: var(--danger); }

@keyframes blink {
  50% { opacity: 0.35; }
}

.ros-connection-status .label { flex: 1; min-width: 0; }

.ros-connection-status .spinner {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.ros-status-live {
  font-size: var(--fs-xs);
  color: var(--fg-muted);
  min-height: 12px;
}

/* === Buttons === */
.btn-primary {
  height: var(--touch-min);
  padding: 0 14px;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  font-size: var(--fs-sm);
}
.btn-primary:hover:not(:disabled) {
  background: var(--accent-2);
}

/* === Mission === */
.mission-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
}

.btn-mission {
  height: var(--touch-min);
  padding: 0 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--fg);
  border-radius: var(--radius-sm);
  font-weight: 500;
  font-size: var(--fs-sm);
}
.btn-mission:hover:not(:disabled) {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.btn-mission.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25);
}
.btn-mission.is-active::after {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-left: 8px;
  border-radius: 50%;
  background: #fff;
  vertical-align: middle;
  animation: blink 1s ease-in-out infinite;
}
#mission-stop:hover:not(:disabled) {
  background: var(--danger);
  border-color: var(--danger);
}

/* === Goal wait overlay === */
.goal-wait-overlay {
  position: fixed;
  top: 80px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 900;
  pointer-events: none;
  animation: modal-fade 0.18s ease-out;
}

.goal-wait-card {
  pointer-events: auto;
  background: var(--surface);
  border: 1px solid var(--accent);
  border-left-width: 3px;
  border-radius: var(--radius);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
  max-width: 92vw;
}

.goal-wait-pulse {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  position: relative;
  flex-shrink: 0;
}
.goal-wait-pulse::before,
.goal-wait-pulse::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.5;
  animation: pulse-ring 1.6s ease-out infinite;
}
.goal-wait-pulse::after {
  animation-delay: 0.8s;
}

@keyframes pulse-ring {
  0%   { transform: scale(1);   opacity: 0.5; }
  80%  { transform: scale(2.6); opacity: 0;   }
  100% { transform: scale(2.6); opacity: 0;   }
}

.goal-wait-text {
  display: flex;
  flex-direction: column;
  line-height: 1.3;
}
.goal-wait-text strong {
  font-size: 13px;
  color: var(--fg);
  font-weight: 600;
}
.goal-wait-text span {
  font-size: 11px;
  color: var(--fg-muted);
}

.goal-wait-cancel {
  height: 30px;
  padding: 0 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--fg-muted);
  font-size: 12px;
  font-weight: 500;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}
.goal-wait-cancel:hover {
  background: var(--danger);
  border-color: var(--danger);
  color: #fff;
}

/* === Velocity / D-Pad === */
.speed-controls {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.speed-value {
  color: var(--accent);
  font-family: 'JetBrains Mono', monospace;
  font-weight: 600;
  font-size: var(--fs-sm);
  text-transform: none;
  letter-spacing: 0;
}

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  outline: none;
  margin-top: 3px;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
}
input[type="range"]::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  border: none;
  cursor: pointer;
}
input[type="range"]:disabled { opacity: 0.5; }

.dpad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-auto-rows: var(--touch-min);
  gap: 4px;
  margin-top: 2px;
}

.dpad-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--fg);
  border-radius: var(--radius-sm);
  font-weight: 500;
  font-size: var(--fs-xs);
  user-select: none;
}
.dpad-btn:hover:not(:disabled) {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.dpad-up    { grid-column: 2; grid-row: 1; }
.dpad-left  { grid-column: 1; grid-row: 2; }
.dpad-stop  { grid-column: 2; grid-row: 2; background: var(--danger); border-color: var(--danger); color: #fff; }
.dpad-stop:hover:not(:disabled) { background: #dc2626; border-color: #dc2626; }
.dpad-right { grid-column: 3; grid-row: 2; }
.dpad-down  { grid-column: 2; grid-row: 3; }

/* === Goal Pose === */
.goal-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.goal-grid > button {
  grid-column: 1 / -1;
}

/* === Goal List === */
.goallist-count {
  margin-left: auto;
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  padding: 1px 8px;
  border-radius: 999px;
  min-width: 20px;
  text-align: center;
  font-family: 'JetBrains Mono', monospace;
}
.ros-section[data-section="goallist"] > summary::after {
  display: none;
}

.goallist {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 220px;
  overflow-y: auto;
  min-width: 0;
}

/* Hedef listesi alt aksiyon barı */
.goallist-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}
.goallist-actions .btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 14px;
  flex-shrink: 0;
}
.goallist-actions .btn-primary svg {
  width: 14px;
  height: 14px;
}
.goals-save-status {
  font-size: 11px;
  color: var(--fg-muted);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: 'JetBrains Mono', monospace;
}

.goallist-empty {
  color: var(--fg-muted);
  font-size: 12px;
  text-align: center;
  padding: 8px 4px;
  font-style: italic;
}

.goal-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px 6px 6px 8px;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-family: 'JetBrains Mono', monospace;
  animation: goal-in 0.2s ease-out;
  min-width: 0;
  white-space: nowrap;
}

.goal-item-coords {
  display: flex;
  flex: 1 1 auto;
  flex-wrap: nowrap;
  min-width: 0;
  gap: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.goal-item-coords span {
  white-space: nowrap;
}

.goal-item-coords b {
  color: var(--fg-muted);
  font-weight: 500;
  margin-right: 2px;
}

.goal-item-remove {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: var(--danger);
  border: 1px solid var(--danger);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  padding: 0;
  cursor: pointer;
  transition: background 0.12s ease, border-color 0.12s ease,
              color 0.12s ease, transform 0.05s ease;
}
.goal-item-remove svg {
  width: 12px;
  height: 12px;
  display: block;
}
.goal-item-remove:hover {
  background: #dc2626;
  border-color: #dc2626;
}
.goal-item-remove:active {
  transform: scale(0.92);
}
.goal-item-remove:focus-visible {
  outline: 2px solid var(--danger);
  outline-offset: 1px;
}

@keyframes goal-in {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

.goal-item-index {
  background: var(--accent);
  color: #fff;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 600;
  font-size: 10px;
  flex-shrink: 0;
}

/* === Modal === */
.jv-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 16px;
  animation: modal-fade 0.15s ease-out;
}
.jv-modal-backdrop[hidden] { display: none; }

@keyframes modal-fade {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.jv-modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
  animation: modal-pop 0.18s cubic-bezier(0.2, 0.9, 0.3, 1.1);
}

@keyframes modal-pop {
  from { opacity: 0; transform: translateY(8px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0)   scale(1); }
}

.jv-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}
.jv-modal-header h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.jv-modal-close {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--fg-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  transition: background 0.12s, color 0.12s;
}
.jv-modal-close:hover {
  background: var(--surface-2);
  color: var(--fg);
}
.jv-modal-close svg {
  width: 14px;
  height: 14px;
}

.jv-modal-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.jv-modal-coords {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--fg-muted);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  letter-spacing: 0.02em;
}
.jv-modal-coords b {
  color: var(--fg);
  font-weight: 600;
  margin-right: 4px;
}

.jv-modal-body input[type="text"] {
  font-family: inherit;
  font-size: 14px;
  padding: 10px 12px;
}

.jv-modal-error {
  margin: 0;
  font-size: 12px;
  color: var(--danger);
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  line-height: 1.3;
}
.jv-modal-body input[type="text"].invalid {
  border-color: var(--danger);
}

.jv-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
}

.jv-modal-footer .btn-mission,
.jv-modal-footer .btn-primary {
  height: 38px;
  padding: 0 16px;
}

/* Hedef satırında isim alanı */
.goal-item-name {
  flex-shrink: 0;
  max-width: 40%;
  color: var(--accent);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* === cmd_vel === */
.cmdvel-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.cmdvel-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  text-align: center;
  min-width: 0;
}

.cmdvel-label {
  font-size: 10px;
  color: var(--fg-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 500;
  white-space: nowrap;
}

.cmdvel-value {
  font-family: 'JetBrains Mono', monospace;
  font-size: clamp(14px, 1.4vw, 18px);
  font-weight: 600;
  color: var(--fg);
  font-variant-numeric: tabular-nums;
}

.cmdvel-card.active .cmdvel-value {
  color: var(--accent);
}

.cmdvel-unit {
  font-size: 9px;
  color: var(--fg-muted);
  font-family: 'JetBrains Mono', monospace;
}

/* Çok dar (col-sm-3 gibi) alanlarda alt alta */
@media (max-width: 991.98px) {
  .cmdvel-grid { grid-template-columns: 1fr; }
}

/* === Telemetry === */
.telemetry-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.telemetry-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  position: relative;
  min-height: clamp(56px, 9vh, 76px);
}

.telemetry-label {
  font-size: var(--fs-xs);
  color: var(--fg-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 500;
}

.telemetry-value {
  font-family: 'JetBrains Mono', monospace;
  font-size: var(--fs-xl);
  font-weight: 600;
}

.telemetry-time {
  font-size: var(--fs-xs);
  color: var(--fg-muted);
  font-family: 'JetBrains Mono', monospace;
}

.telemetry-low {
  font-size: 9px;
  color: var(--danger);
  font-weight: 600;
  text-transform: uppercase;
}

.telemetry-indicator {
  position: absolute;
  right: 8px;
  top: 8px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--success);
}
.battery-card[data-level="low"] .telemetry-indicator    { background: var(--danger); }
.battery-card[data-level="medium"] .telemetry-indicator { background: var(--warning); }

/* === Toast System === */
.toast-container {
  position: fixed;
  bottom: 12px;
  right: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  z-index: 100;
  pointer-events: none;
  max-width: min(360px, calc(100vw - 24px));
}

.toast {
  pointer-events: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left-width: 3px;
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  font-size: var(--fs-sm);
}
.toast.info    { border-left-color: var(--accent); }
.toast.success { border-left-color: var(--success); }
.toast.warning { border-left-color: var(--warning); }
.toast.error   { border-left-color: var(--danger); }

/* === Responsive (özel ek kurallar — Bootstrap grid'in üstünde) === */

/* xs (<576): brand-tag ve fs button etiketi gizli — Bootstrap d-none d-sm-inline ile zaten yönetiliyor */

/* xs/sm: alt başlıklardaki iç gridler tek kolona insin */
@media (max-width: 575.98px) {
  .mission-grid,
  .goal-grid,
  .telemetry-grid { grid-template-columns: 1fr; }
  .btn-fullscreen { padding: 0 8px; }
}

/* Kısa ekran (1024x576 gibi gömülü paneller): kompakt yap */
@media (max-height: 620px) {
  .ros-section-body { gap: 6px; padding: 8px; }
  .telemetry-value { font-size: 16px; }
  .telemetry-card { min-height: 56px; padding: 6px 8px; }
  .ros-status-live { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
