/* ==========================================================================
   SMART GLASSES DASHBOARD - APPLE LIGHT DESIGN SYSTEM
   Clean, Minimal, High-Clarity Interface (#F5F5F7 / #FFFFFF / #1D1D1F / #0071E3)
   ========================================================================== */

:root {
  /* Surface & Background */
  --bg-app: #F5F5F7;
  --bg-surface: #FFFFFF;
  --bg-surface-secondary: #F5F5F7;
  --bg-surface-inset: #EBEBF0;
  --bg-surface-card-hover: #FFFFFF;

  /* Typography Colors */
  --text-primary: #1D1D1F;
  --text-secondary: #86868B;
  --text-tertiary: #86868B;
  --text-inverse: #FFFFFF;

  /* Borders & Separators */
  --border-subtle: #D2D2D7;
  --border-medium: #D2D2D7;
  --border-strong: #B8B8BF;
  --separator: #E5E5EA;

  /* Apple System Colors */
  --color-blue: #0071E3;
  --color-blue-hover: #0077ED;
  --color-blue-active: #005BB5;
  --color-blue-tint: rgba(0, 113, 227, 0.10);

  --color-green: #1E8E3E;
  --color-green-tint: rgba(52, 199, 89, 0.14);

  --color-orange: #B25000;
  --color-orange-tint: rgba(255, 149, 0, 0.14);

  --color-red: #D70015;
  --color-red-hover: #B80012;
  --color-red-tint: rgba(255, 59, 48, 0.10);

  --color-gray: #86868B;
  --color-gray-tint: rgba(134, 134, 139, 0.12);

  /* Status Tokens */
  --color-success: var(--color-green);
  --color-warning: var(--color-orange);
  --color-danger: var(--color-red);
  --color-neutral: var(--color-gray);

  /* Hardware Simulation (OLED SSD1306) */
  --oled-bezel: #1D1D1F;
  --oled-screen: #000000;
  --oled-cyan: #5CE1E6;
  --oled-cyan-dim: rgba(92, 225, 230, 0.72);

  /* Radii (12px - 18px System) */
  --radius-sm: 12px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 18px;
  --radius-pill: 9999px;

  /* Very Subtle Shadows */
  --shadow-subtle: 0 1px 2px rgba(0, 0, 0, 0.03);
  --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.03), 0 4px 12px rgba(0, 0, 0, 0.02);
  --shadow-card-hover: 0 2px 6px rgba(0, 0, 0, 0.04), 0 6px 16px rgba(0, 0, 0, 0.03);
  --shadow-button: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-hero: 0 1px 3px rgba(0, 113, 227, 0.16);
  --shadow-hero-stop: 0 1px 3px rgba(215, 0, 21, 0.12);

  /* Typography */
  --font-system: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Inter", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: "SF Mono", ui-monospace, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;

  /* Transitions */
  --transition-fast: 0.14s ease;
  --transition-normal: 0.2s ease;
}

/* ==========================================================================
   RESET & BASE STYLES
   ========================================================================== */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-system);
  background-color: var(--bg-app);
  color: var(--text-primary);
  line-height: 1.5;
  min-height: 100vh;
  padding: 28px 20px 44px;
  overflow-x: hidden;
}

.mono-text {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.code-font {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  word-break: break-all;
  overflow-wrap: anywhere;
}

/* Keyboard Focus Accessibility */
.btn:focus-visible,
.btn-hero:focus-visible,
.alert-close:focus-visible,
.settings-summary:focus-visible {
  outline: 2px solid var(--color-blue);
  outline-offset: 2px;
}

/* ==========================================================================
   LAYOUT CONTAINER
   ========================================================================== */
.app-container {
  max-width: 1180px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* ==========================================================================
   HEADER
   ========================================================================== */
.app-header {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 20px 24px;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.header-brand h1 {
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.022em;
  color: var(--text-primary);
  line-height: 1.25;
}

.header-brand .subtitle {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-top: 4px;
  font-weight: 400;
}

.header-badges {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* Status Pill Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  background: var(--bg-surface-secondary);
  border: 1px solid var(--border-subtle);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-primary);
  user-select: none;
}

.badge-ws {
  background: var(--bg-surface-secondary);
  color: var(--text-secondary);
}

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

.dot-idle {
  background-color: #34C759;
}

.dot-active {
  background-color: #34C759;
  box-shadow: 0 0 0 3px var(--color-green-tint);
  animation: pulse-dot 1.8s infinite;
}

.dot-connecting {
  background-color: #FF9500;
  animation: pulse-dot 1.2s infinite;
}

.dot-error {
  background-color: #FF3B30;
}

@keyframes pulse-dot {
  0% {
    transform: scale(0.95);
    opacity: 0.85;
  }

  50% {
    transform: scale(1.15);
    opacity: 1;
  }

  100% {
    transform: scale(0.95);
    opacity: 0.85;
  }
}

/* ==========================================================================
   MOBILE ACCESS BANNER
   ========================================================================== */
.mobile-access-banner {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 14px 20px;
  box-shadow: var(--shadow-card);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.banner-content {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.banner-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background: var(--color-blue-tint);
  color: var(--color-blue);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.banner-text {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.banner-tag {
  background: var(--color-blue-tint);
  color: var(--color-blue);
  font-weight: 600;
  font-size: 0.75rem;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  letter-spacing: 0.01em;
}

.banner-desc {
  color: var(--text-secondary);
}

.banner-content code {
  font-family: var(--font-mono);
  background: var(--bg-surface-secondary);
  border: 1px solid var(--border-subtle);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-primary);
}

/* ==========================================================================
   GLOBAL ALERTS
   ========================================================================== */
.alert-box {
  background: #FFF5F5;
  border: 1px solid rgba(215, 0, 21, 0.25);
  border-radius: var(--radius-lg);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  box-shadow: var(--shadow-subtle);
}

.alert-hidden {
  display: none !important;
}

.alert-content {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--color-red);
  font-size: 0.875rem;
  font-weight: 500;
}

.alert-icon {
  flex-shrink: 0;
}

.alert-close {
  background: transparent;
  border: none;
  color: var(--color-red);
  cursor: pointer;
  padding: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
}

.alert-close:hover {
  background: var(--color-red-tint);
}

/* ==========================================================================
   STATUS GRID (4 KOTAK KESIAPAN SISTEM)
   ========================================================================== */
.status-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.status-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: box-shadow var(--transition-fast), border-color var(--transition-fast);
  overflow: hidden;
}

.status-card:hover {
  box-shadow: var(--shadow-card-hover);
  border-color: var(--border-strong);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  gap: 8px;
}

.card-title-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-icon {
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.015em;
}

/* Card Status Badges (Pills) */
.card-status-badge {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 3px 9px;
  border-radius: var(--radius-pill);
  flex-shrink: 0;
}

.badge-neutral {
  background: var(--color-gray-tint);
  color: var(--text-secondary);
}

.badge-success {
  background: var(--color-green-tint);
  color: var(--color-green);
}

.badge-warning {
  background: var(--color-orange-tint);
  color: var(--color-orange);
}

.badge-danger {
  background: var(--color-red-tint);
  color: var(--color-red);
}

.card-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex-grow: 1;
  justify-content: center;
}

/* Key-value Info Rows in Cards */
.info-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  font-size: 0.8125rem;
  gap: 8px;
  padding: 3px 0;
  min-width: 0;
}

.info-label {
  color: var(--text-secondary);
  font-weight: 400;
  flex-shrink: 0;
  padding-top: 1px;
}

.info-value {
  color: var(--text-primary);
  font-weight: 500;
  text-align: right;
  min-width: 0;
  word-break: break-word;
  overflow-wrap: anywhere;
  line-height: 1.35;
}

.badge-key {
  font-size: 0.75rem;
  background: var(--color-green-tint);
  color: var(--color-green);
  padding: 2px 9px;
  border-radius: var(--radius-pill);
  font-weight: 600;
}

/* ==========================================================================
   CARD 1: DETECTED MICROPHONE & VU METER
   ========================================================================== */
.mic-detected-card {
  background: var(--bg-surface-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.mic-device-detail {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

.mic-device-name {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mic-device-sub {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 1px;
}

.vu-meter-group {
  margin-top: 4px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.vu-meter-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.vu-meter-container {
  height: 6px;
  background: var(--bg-surface-inset);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill);
  overflow: hidden;
  position: relative;
}

.vu-meter-bar {
  height: 100%;
  background: #34C759;
  border-radius: var(--radius-pill);
  transition: width 0.08s ease-out;
}

/* ==========================================================================
   CARD 4: TELEMETRY STATS
   ========================================================================== */
.stats-body {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  text-align: center;
}

.stat-item {
  background: var(--bg-surface-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px 6px;
}

.stat-number {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.2;
}

.stat-title {
  font-size: 0.6875rem;
  color: var(--text-secondary);
  margin-top: 3px;
  font-weight: 500;
}

.card-actions {
  margin-top: 4px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.card-hint-msg {
  font-size: 0.75rem;
  line-height: 1.35;
  margin-top: 6px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  background: var(--bg-surface-secondary);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  transition: opacity var(--transition-fast);
}

.card-hint-msg.hint-error {
  background: var(--color-red-tint);
  border-color: rgba(215, 0, 21, 0.22);
  color: var(--color-danger);
}

.card-hint-msg.hint-success {
  background: var(--color-green-tint);
  border-color: rgba(30, 142, 62, 0.22);
  color: var(--color-green);
}

/* ==========================================================================
   HERO CONTROLS (MULAI & BERHENTI)
   ========================================================================== */
.main-controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.btn-hero {
  height: 54px;
  border-radius: var(--radius-lg);
  font-family: var(--font-system);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform var(--transition-fast), background-color var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
  user-select: none;
}

.btn-hero:active:not(:disabled) {
  transform: scale(0.985);
}

.btn-hero:disabled {
  opacity: 0.42;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-start {
  background-color: var(--color-blue);
  color: var(--text-inverse);
  box-shadow: var(--shadow-hero);
}

.btn-start:hover:not(:disabled) {
  background-color: var(--color-blue-hover);
}

.btn-start:active:not(:disabled) {
  background-color: var(--color-blue-active);
}

.btn-stop {
  background-color: var(--bg-surface);
  color: var(--color-red);
  border-color: var(--border-subtle);
  box-shadow: var(--shadow-card);
}

.btn-stop:hover:not(:disabled) {
  background-color: var(--color-red-tint);
  border-color: rgba(215, 0, 21, 0.35);
  box-shadow: var(--shadow-hero-stop);
}

.btn-hero-icon {
  flex-shrink: 0;
}

/* ==========================================================================
   BUTTONS (APPLE LIGHT STYLE)
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-family: var(--font-system);
  font-weight: 500;
  border-radius: var(--radius-md);
  cursor: pointer;
  border: 1px solid transparent;
  transition: background-color var(--transition-fast), border-color var(--transition-fast), transform var(--transition-fast);
  text-decoration: none;
  user-select: none;
}

.btn:active:not(:disabled) {
  transform: scale(0.975);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-sm {
  padding: 7px 13px;
  font-size: 0.8125rem;
  min-height: 34px;
}

.btn-xs {
  padding: 5px 11px;
  font-size: 0.75rem;
  min-height: 30px;
}

.btn-ghost {
  background: var(--bg-surface-secondary);
  border-color: var(--border-subtle);
  color: var(--text-primary);
}

.btn-ghost:hover:not(:disabled) {
  background: var(--bg-surface-inset);
  border-color: var(--border-strong);
}

.btn-icon-only {
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
}

.btn-icon-only:hover:not(:disabled) {
  color: var(--text-primary);
  background: var(--bg-surface-inset);
}

.btn-outline {
  background: var(--bg-surface);
  border-color: var(--border-subtle);
  color: var(--text-primary);
  box-shadow: var(--shadow-button);
}

.btn-outline:hover:not(:disabled) {
  background: var(--bg-surface-secondary);
  border-color: var(--border-strong);
}

.btn-secondary {
  background: var(--bg-surface-secondary);
  border-color: var(--border-subtle);
  color: var(--text-primary);
  padding: 8px 14px;
  font-size: 0.8125rem;
  min-height: 36px;
}

.btn-secondary:hover:not(:disabled) {
  background: var(--bg-surface-inset);
  border-color: var(--border-strong);
}

/* ==========================================================================
   CONTENT COLUMNS (2 EQUAL COLUMNS)
   ========================================================================== */
.content-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.col-live,
.col-history {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.panel {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 20px 24px;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  gap: 12px;
}

.panel-title-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.panel-title-group h2 {
  font-size: 1.0625rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--text-primary);
}

.panel-hint {
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-weight: 400;
}

.panel-controls {
  display: flex;
  gap: 8px;
}

/* ==========================================================================
   LIVE TRANSCRIPTION FEED
   ========================================================================== */
.live-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: var(--color-blue);
  box-shadow: 0 0 0 3px var(--color-blue-tint);
  display: none;
  animation: pulse-dot 1.5s infinite;
}

.live-feed-box {
  background: var(--bg-surface-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 20px;
  min-height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.live-placeholder {
  color: var(--text-secondary);
  font-size: 0.9375rem;
  text-align: center;
  line-height: 1.6;
}

.live-placeholder strong {
  color: var(--text-primary);
  font-weight: 600;
}

.live-text-stream {
  font-size: 1.25rem;
  font-weight: 500;
  line-height: 1.5;
  color: var(--text-primary);
  width: 100%;
}

/* ==========================================================================
   OLED HARDWARE SIMULATOR (SSD1306 128x64)
   ========================================================================== */
.oled-frame {
  background: var(--oled-bezel);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--shadow-card);
}

.oled-screen {
  background: var(--oled-screen);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  min-height: 88px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  font-family: var(--font-mono);
}

.oled-line {
  color: var(--oled-cyan);
  font-size: 1.0625rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.oled-line-0 {
  font-size: 0.8125rem;
  color: var(--oled-cyan-dim);
  opacity: 0.65;
  min-height: 1rem;
}

.oled-sub {
  font-size: 0.875rem;
  color: var(--oled-cyan-dim);
}

.oled-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 10px;
  font-size: 0.75rem;
}

.oled-spec {
  color: rgba(255, 255, 255, 0.55);
  font-family: var(--font-mono);
}

.oled-tx-status {
  font-weight: 600;
  color: #34C759;
  font-size: 0.75rem;
}

/* ==========================================================================
   HISTORY PANEL (GROUPED LIST)
   ========================================================================== */
.history-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 480px;
  overflow-y: auto;
  padding-right: 4px;
}

.history-list::-webkit-scrollbar {
  width: 6px;
}

.history-list::-webkit-scrollbar-track {
  background: transparent;
}

.history-list::-webkit-scrollbar-thumb {
  background: var(--border-subtle);
  border-radius: var(--radius-pill);
}

.history-empty {
  padding: 40px 16px;
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.875rem;
}

.history-item {
  background: var(--bg-surface-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: background-color var(--transition-fast), border-color var(--transition-fast);
}

.history-item:hover {
  background: var(--bg-surface);
  border-color: var(--border-strong);
}

.history-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.75rem;
}

.history-time {
  color: var(--text-secondary);
}

.history-badge {
  font-size: 0.6875rem;
  font-weight: 600;
  padding: 2px 9px;
  border-radius: var(--radius-pill);
}

.badge-oled-ok {
  background: var(--color-green-tint);
  color: var(--color-green);
}

.badge-oled-fail {
  background: var(--color-red-tint);
  color: var(--color-red);
}

.badge-oled-sending {
  background: var(--color-orange-tint);
  color: var(--color-orange);
}

.history-text {
  font-size: 0.9375rem;
  color: var(--text-primary);
  line-height: 1.45;
}

/* ==========================================================================
   SETTINGS ACCORDION
   ========================================================================== */
.settings-accordion {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

.settings-summary {
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  user-select: none;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-primary);
  list-style: none;
  transition: background-color var(--transition-fast);
}

.settings-summary::-webkit-details-marker {
  display: none;
}

.settings-summary:hover {
  background: var(--bg-surface-secondary);
}

.settings-summary-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.settings-summary-icon {
  color: var(--text-secondary);
}

.accordion-arrow {
  color: var(--text-secondary);
  transition: transform var(--transition-fast);
}

.settings-accordion[open] .accordion-arrow {
  transform: rotate(180deg);
}

.settings-body {
  padding: 0 24px 20px;
  border-top: 1px solid var(--separator);
}

.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 16px;
}

.settings-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.settings-label {
  display: flex;
  flex-direction: column;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-primary);
}

.settings-label small {
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--text-secondary);
  margin-top: 2px;
}

.input-with-button {
  display: flex;
  gap: 8px;
  align-items: center;
}

.form-input {
  flex: 1;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  padding: 8px 12px;
  min-height: 36px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  color: var(--text-primary);
  outline: none;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-input:focus {
  border-color: var(--color-blue);
  box-shadow: 0 0 0 3px var(--color-blue-tint);
}

.current-device-info {
  flex: 1;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-primary);
  background: var(--bg-surface-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 8px 12px;
  min-height: 36px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.setting-feedback {
  font-size: 0.75rem;
  color: var(--color-green);
  min-height: 1rem;
}

.setting-feedback.error {
  color: var(--color-red);
}

.setting-feedback.success {
  color: var(--color-green);
}

/* ==========================================================================
   FOOTER
   ========================================================================== */
.app-footer {
  text-align: center;
  padding: 16px 8px;
  color: var(--text-secondary);
  font-size: 0.75rem;
}

/* ==========================================================================
   REDUCED MOTION SUPPORT
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {

  .status-dot,
  .live-dot {
    animation: none;
  }

  * {
    transition-duration: 0.01ms !important;
  }
}

/* ==========================================================================
   RESPONSIVE DESIGN (TABLETS & MOBILE)
   ========================================================================== */
@media (max-width: 992px) {
  .status-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .content-columns {
    grid-template-columns: 1fr;
  }

  .settings-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  body {
    padding: 12px 10px 30px;
  }

  .app-header {
    padding: 16px;
  }

  .header-brand h1 {
    font-size: 1.25rem;
  }

  .status-grid {
    grid-template-columns: 1fr;
  }

  .main-controls {
    grid-template-columns: 1fr;
  }

  .btn-hero {
    height: 50px;
  }

  .btn-sm,
  .btn-secondary {
    min-height: 44px;
  }

  .panel {
    padding: 16px;
  }

  .input-with-button {
    flex-direction: column;
    align-items: stretch;
  }

  .settings-body {
    padding: 0 16px 16px;
  }
}