/* ── Palette — matches Android exactly ───────────────────────────────────── */
:root {
  --bg:       #060C18;
  --bg2:      #0D1526;
  --surface:  #132040;
  --border:   #1C2B4A;
  --fg:       #C2D0E8;
  --muted:    #4A6080;
  --primary:  #4797F8;
  --teal:     #00D9C0;
  --red:      #F07178;
  --yellow:   #FFCB6B;
  --green:    #21B568;
  --idle:     #FFB86C;
  --topbar-h: 48px;
  --vkeys-h:  44px;
  --input-h:  56px;
}
body.light {
  --bg:       #F0F4FA;
  --bg2:      #E8EEF8;
  --surface:  #FFFFFF;
  --border:   #DDE3EF;
  --fg:       #0F172A;
  --muted:    #64748B;
  --primary:  #2563EB;
  --teal:     #0891B2;
  --red:      #DC2626;
  --yellow:   #D97706;
  --green:    #21B568;
  --idle:     #D97706;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--fg);
  font-family: 'JetBrains Mono', 'Courier New', monospace;
  font-size: 14px;
  overflow: hidden;
}

/* Material Symbols */
.material-symbols-rounded {
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
  user-select: none;
  line-height: 1;
  display: inline-block;
  vertical-align: middle;
}

/* ── Views ───────────────────────────────────────────────────────────────── */
.view {
  position: fixed;
  top: env(safe-area-inset-top);
  bottom: env(safe-area-inset-bottom);
  left: env(safe-area-inset-left);
  right: env(safe-area-inset-right);
  display: flex;
  flex-direction: column;
}
.hidden { display: none !important; }

/* ── LOGIN ───────────────────────────────────────────────────────────────── */
#view-login {
  align-items: center;
  justify-content: center;
  overflow-y: auto;
  padding: 32px 20px;
  background: linear-gradient(160deg, #F0F4FA 0%, #E4EDFF 50%, #F0F4FA 100%);
}
/* Dark mode login bg */
body:not(.light) #view-login {
  background: linear-gradient(160deg, #060C18 0%, #0A1428 50%, #060C18 100%);
}
/* Ambient glow (dark only) */
body:not(.light) #view-login::before {
  content: '';
  position: fixed;
  top: 0; left: 50%;
  transform: translateX(-50%);
  width: 420px;
  height: 300px;
  background: radial-gradient(ellipse at top, rgba(71,151,248,0.08) 0%, transparent 65%);
  pointer-events: none;
}

/* Theme button — top-right corner */
.theme-btn-abs {
  position: fixed;
  top: max(14px, env(safe-area-inset-top));
  right: 14px;
  z-index: 20;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  color: var(--muted);
  border-radius: 10px;
  display: flex;
  align-items: center;
}
.theme-btn-abs .material-symbols-rounded { font-size: 22px; }
.theme-btn-abs:hover { color: var(--fg); }

/* Login card */
.login-card {
  width: min(360px, 94vw);
  padding: 40px 28px 32px;
  border-radius: 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  /* Dark */
  background: rgba(13, 21, 38, 0.90);
  border: 1px solid rgba(28, 43, 74, 0.80);
  box-shadow: 0 24px 64px rgba(0,0,0,0.45), 0 4px 20px rgba(71,151,248,0.06);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}
body.light .login-card {
  background: rgba(255,255,255,0.92);
  border: 1px solid rgba(220,230,245,0.60);
  box-shadow: 0 20px 60px rgba(0,0,0,0.08), 0 2px 12px rgba(0,0,0,0.04);
}

/* Logo icon box */
.logo-icon {
  width: 72px; height: 72px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--teal) 100%);
  border-radius: 18px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 10px 28px rgba(71,151,248,0.42);
  margin-bottom: 8px;
  flex-shrink: 0;
}
body.light .logo-icon { box-shadow: 0 10px 28px rgba(37,99,235,0.28); }
.logo-terminal-icon {
  font-size: 34px;
  color: #fff;
  font-variation-settings: 'FILL' 1, 'wght' 500, 'GRAD' 0, 'opsz' 24;
}

/* Logo text */
.logo-text {
  font-family: 'JetBrains Mono', monospace;
  font-size: 30px;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: 2px;
  line-height: 1.1;
}
.cursor {
  color: var(--teal);
  font-weight: 300;
  animation: cursor-blink 1.06s step-end infinite;
}
@keyframes cursor-blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }

.logo-sub {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 2.5px;
  color: var(--muted);
  margin-bottom: 20px;
  text-transform: lowercase;
}

/* Error banner on login */
#error-login {
  width: 100%;
  border-radius: 10px;
  background: rgba(240,113,120,0.10);
  border: 1px solid rgba(240,113,120,0.35);
  color: var(--red);
  font-size: 12px;
  padding: 10px 14px;
  text-align: center;
  margin-bottom: 4px;
}

/* ── Custom Google Sign-In button ────────────────────────────────────────── */
.btn-google {
  width: 100%;
  height: 52px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 14px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.3px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 4px;
  transition: opacity 0.15s;
  position: relative;
}
.btn-google:hover { opacity: 0.88; }
.btn-google:active { opacity: 0.78; }
.btn-google:disabled { opacity: 0.55; cursor: default; }
.google-g { width: 18px; height: 18px; flex-shrink: 0; }
.google-btn-spinner {
  width: 18px; height: 18px;
  border: 2px solid rgba(255,255,255,0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
}
/* Hidden GSI fallback */
#google-signin-btn { width: 100%; display: flex; justify-content: center; margin-top: 6px; }

/* ── Advanced section ────────────────────────────────────────────────────── */
.advanced-section { width: 100%; margin-top: 10px; }
.advanced-toggle {
  width: 100%;
  background: none; border: none;
  color: var(--muted);
  font-size: 12px; letter-spacing: 0.5px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 4px;
  padding: 6px 0;
  font-family: 'JetBrains Mono', monospace;
}
.advanced-toggle:hover { color: var(--fg); }
.adv-chevron { font-size: 18px; transition: transform 0.2s ease; }
.adv-chevron.open { transform: rotate(180deg); }

.advanced-content { padding-top: 10px; display: flex; flex-direction: column; gap: 8px; }
.adv-subheading {
  font-size: 11px; color: var(--muted); letter-spacing: 0.5px;
  text-align: center; font-family: 'JetBrains Mono', monospace;
}

.relay-input-row {
  display: flex; align-items: center; gap: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 4px 8px 4px 12px;
}
.relay-input-row:focus-within { border-color: var(--primary); }
.relay-input {
  flex: 1; background: none; border: none;
  color: var(--fg); font-family: 'JetBrains Mono', monospace;
  font-size: 12px; padding: 8px 0; min-width: 0;
}
.relay-input:focus { outline: none; }
.relay-input::placeholder { color: var(--muted); }
.relay-status-dot {
  width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
  background: var(--muted); transition: background 0.2s;
}
.relay-status-dot.relay-online  { background: var(--teal); }
.relay-status-dot.relay-offline { background: var(--red); }
.relay-health-btn {
  background: none; border: none; cursor: pointer;
  padding: 4px; color: var(--muted);
  display: flex; align-items: center;
}
.relay-health-btn:hover { color: var(--fg); }
.relay-health-btn .material-symbols-rounded { font-size: 18px; }
.relay-health-btn .material-symbols-rounded.spinning { animation: spin 0.7s linear infinite; }

.adv-actions { display: flex; gap: 10px; }
.btn-relay-save {
  flex: 1;
  background: rgba(71,151,248,0.12);
  color: var(--primary);
  border: none; border-radius: 10px;
  padding: 10px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px; font-weight: 600; cursor: pointer;
}
.btn-relay-save:hover { background: rgba(71,151,248,0.20); }
.btn-relay-reset {
  background: none; color: var(--muted); border: none;
  border-radius: 10px; padding: 10px 16px;
  font-family: 'JetBrains Mono', monospace; font-size: 13px; cursor: pointer;
}
.btn-relay-reset:hover { color: var(--fg); }

/* ── Topbar ───────────────────────────────────────────────────────────────── */
.topbar, .term-topbar {
  height: var(--topbar-h);
  min-height: var(--topbar-h);
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center;
  padding: 0 4px;
  gap: 0;
  flex-shrink: 0;
  width: 100%;
}
.topbar-title {
  flex: 1;
  font-size: 18px; font-weight: 700;
  color: var(--primary);
  letter-spacing: 1.5px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  padding: 0 6px;
  font-family: 'JetBrains Mono', monospace;
}
.term-title {
  flex: 1;
  font-size: 15px; font-weight: 600;
  color: var(--fg);
  letter-spacing: 0.3px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  padding: 0 6px;
  font-family: 'JetBrains Mono', monospace;
}

.btn-back {
  background: none; border: none;
  color: var(--primary); cursor: pointer;
  padding: 10px 8px;
  min-height: 44px; min-width: 44px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 10px; flex-shrink: 0;
}
.btn-back .material-symbols-rounded { font-size: 22px; }
.btn-back:hover { background: rgba(71,151,248,0.10); }

.btn-icon {
  background: none; border: none;
  color: var(--muted); cursor: pointer;
  padding: 10px;
  min-width: 40px; min-height: 44px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 10px; flex-shrink: 0;
}
.btn-icon .material-symbols-rounded { font-size: 22px; }
.btn-icon:hover { background: rgba(71,151,248,0.10); color: var(--fg); }
.btn-icon-red { color: rgba(240,113,120,0.7); }
.btn-icon-red:hover { color: var(--red); background: rgba(240,113,120,0.10); }

/* ── Working dir bar ──────────────────────────────────────────────────────── */
.working-dir-bar {
  display: flex; align-items: center; gap: 6px;
  padding: 7px 14px;
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--muted);
}
.wd-folder-icon {
  font-size: 13px;
  opacity: 0.6;
  font-variation-settings: 'FILL' 0, 'wght' 300, 'GRAD' 0, 'opsz' 20;
}
.wd-label { color: var(--muted); white-space: nowrap; }
.wd-path {
  flex: 1; color: rgba(194,208,232,0.70); white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}
body.light .wd-path { color: rgba(15,23,42,0.60); }
.wd-access { white-space: nowrap; color: var(--muted); }
.wd-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--green); flex-shrink: 0;
  box-shadow: 0 0 4px rgba(33,181,104,0.6);
}

/* ── Banners ──────────────────────────────────────────────────────────────── */
.error-banner {
  background: rgba(240,113,120,0.12);
  border-bottom: 1px solid rgba(240,113,120,0.30);
  color: var(--red);
  font-size: 12px;
  padding: 8px 16px;
  flex-shrink: 0;
  font-family: 'JetBrains Mono', monospace;
}
.conn-lost-banner {
  background: var(--red);
  color: white;
  font-size: 12px; font-weight: 500;
  font-family: 'JetBrains Mono', monospace;
  padding: 6px 16px;
  text-align: center; flex-shrink: 0;
}

/* ── List container ───────────────────────────────────────────────────────── */
.list-container {
  flex: 1; overflow-y: auto;
  padding: 14px; padding-bottom: 84px; /* FAB clearance */
  display: flex; flex-direction: column; gap: 10px;
  -webkit-overflow-scrolling: touch;
}

/* ── Device cards ─────────────────────────────────────────────────────────── */
.device-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 16px;
  display: flex; align-items: center; gap: 14px;
}
.device-card.online { border-color: rgba(33,181,104,0.45); cursor: pointer; }
.device-card.online:hover, .device-card.online:active { background: var(--surface); }
.device-info { flex: 1; min-width: 0; }
.device-name {
  font-size: 14px; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  color: var(--fg);
}
.device-name.offline { color: rgba(194,208,232,0.40); }
body.light .device-name.offline { color: rgba(15,23,42,0.40); }
.device-meta { font-size: 11px; font-weight: 500; margin-top: 3px; }
.device-icon-right .material-symbols-rounded { font-size: 20px; color: var(--border); }
.device-icon-offline .material-symbols-rounded {
  font-size: 16px; color: rgba(74,96,128,0.45);
}

/* ── Session cards ────────────────────────────────────────────────────────── */
.session-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  display: flex; align-items: center; gap: 14px;
  cursor: pointer;
}
.session-card:hover, .session-card:active { background: var(--surface); }
.session-card[data-status="active"]  { border-color: rgba(33,181,104,0.50); }
.session-card[data-status="idle"]    { border-color: rgba(255,184,108,0.50); }
.session-card[data-status="crashed"] { border-color: rgba(240,113,120,0.50); }

.session-info { flex: 1; min-width: 0; }
.session-name {
  font-size: 14px; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  color: var(--fg);
}
.session-dir {
  display: flex; align-items: center; gap: 3px;
  font-size: 11px; color: var(--muted);
  margin-top: 3px; overflow: hidden;
}
.session-dir .material-symbols-rounded {
  font-size: 12px; flex-shrink: 0;
  font-variation-settings: 'FILL' 0, 'wght' 300, 'GRAD' 0, 'opsz' 20;
}
.session-dir-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.session-time { font-size: 10px; color: var(--muted); margin-top: 3px; opacity: 0.75; }

/* Status dots */
.dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.dot-online  { background: var(--green); animation: pulse-dot 1.3s ease-in-out infinite; }
.dot-offline { background: var(--muted); }
.dot-idle    { background: var(--idle); }
.dot-crashed { background: var(--red); }
@keyframes pulse-dot {
  0%, 100% { transform: scale(0.75); box-shadow: 0 0 0 0 rgba(33,181,104,0); }
  50%       { transform: scale(1.2);  box-shadow: 0 0 6px 2px rgba(33,181,104,0.55); }
}

/* Stop button — active sessions (filled red circle) */
.btn-stop {
  background: none; border: none; cursor: pointer;
  padding: 6px; color: #FF5370; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  min-width: 44px; min-height: 44px; flex-shrink: 0;
}
.btn-stop:hover { background: rgba(240,113,120,0.12); }
.btn-stop .material-symbols-rounded {
  font-size: 30px;
  font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}

/* Close button — non-active sessions */
.btn-terminate {
  background: none;
  border: 1px solid var(--border);
  color: var(--red);
  border-radius: 8px; padding: 8px;
  font-size: 12px; cursor: pointer;
  min-width: 36px; min-height: 36px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.btn-terminate .material-symbols-rounded { font-size: 16px; }
.btn-terminate:hover { background: rgba(240,113,120,0.10); }

/* ── Sessions actions bar ─────────────────────────────────────────────────── */
.sessions-actions {
  padding: 8px 14px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.new-session-row { display: flex; align-items: center; gap: 8px; }
.dir-input {
  flex: 1;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  color: var(--fg); font-family: 'JetBrains Mono', monospace;
  font-size: 12px; padding: 8px 10px; min-width: 0; min-height: 38px;
}
.dir-input:focus { outline: none; border-color: var(--primary); }
.dir-input::placeholder { color: var(--muted); }
.skip-label {
  display: flex; align-items: center; gap: 4px;
  font-size: 12px; color: var(--muted);
  white-space: nowrap; cursor: pointer;
  user-select: none; padding: 4px 0;
  font-family: 'JetBrains Mono', monospace;
}

/* ── FAB ──────────────────────────────────────────────────────────────────── */
/* FAB is position:absolute inside the fixed view — no position:relative override needed */
#view-sessions { position: fixed; }
.fab {
  position: absolute; bottom: 20px; right: 20px;
  width: 56px; height: 56px;
  border-radius: 16px;
  background: var(--primary);
  border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 16px rgba(71,151,248,0.45);
  z-index: 10;
  transition: transform 0.15s, opacity 0.15s;
}
body.light .fab { box-shadow: 0 4px 16px rgba(37,99,235,0.30); }
.fab .material-symbols-rounded {
  font-size: 28px; color: white;
  font-variation-settings: 'FILL' 1, 'wght' 500, 'GRAD' 0, 'opsz' 24;
}
.fab:hover  { transform: scale(1.05); }
.fab:active { transform: scale(0.96); opacity: 0.88; }
.fab:disabled { opacity: 0.35; cursor: default; transform: none; pointer-events: none; }

/* ── Empty states ─────────────────────────────────────────────────────────── */
.empty-state-wrap {
  display: flex; flex-direction: column; align-items: center;
  gap: 12px; padding: 48px 20px;
}
.empty-icon-box {
  width: 72px; height: 72px;
  background: var(--surface); border-radius: 18px;
  display: flex; align-items: center; justify-content: center;
}
.empty-icon-box .material-symbols-rounded {
  font-size: 34px; color: var(--muted);
  font-variation-settings: 'FILL' 0, 'wght' 300, 'GRAD' 0, 'opsz' 24;
}
.empty-title { font-size: 15px; font-weight: 500; color: var(--fg); opacity: 0.85; text-align: center; }
.empty-sub   { font-size: 12px; color: var(--muted); opacity: 0.75; text-align: center; }

/* ── Terminal ─────────────────────────────────────────────────────────────── */
#view-terminal { background: var(--bg); }
#terminal-container {
  position: relative;
  flex: 1 1 0;
  min-height: 0;
  min-width: 0;
  overflow: hidden;   /* clip xterm canvas to container bounds */
  background: var(--bg);
}
.xterm { width: 100%; height: 100%; }
.xterm-viewport { overflow-y: scroll !important; -webkit-overflow-scrolling: touch; }

/* ── Terminal loading overlay ─────────────────────────────────────────────── */
.term-loading-overlay {
  position: absolute;
  top: var(--topbar-h); left: 0; right: 0; bottom: 0;
  background: #21222C; /* Dracula */
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  z-index: 20;
}
body.light .term-loading-overlay { background: #FDF6E3; }

.tlo-spinner-wrap {
  position: relative; width: 72px; height: 72px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 28px;
}
.tlo-spinner {
  position: absolute; inset: 0; border-radius: 50%;
  border: 3px solid rgba(71,151,248,0.20);
  border-top-color: var(--primary);
  animation: spin 1.1s linear infinite;
}
.tlo-spinner-inner {
  width: 50px; height: 50px;
  background: var(--surface); border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px; font-weight: 700; color: var(--primary);
}
.tlo-message {
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px; color: var(--fg); margin-bottom: 8px;
}
.tlo-sub { font-family: 'JetBrains Mono', monospace; font-size: 12px; color: var(--muted); }
.tlo-dots::after {
  content: '';
  animation: dots-anim 1.4s steps(4, end) infinite;
}
@keyframes dots-anim { 0%{content:'';} 25%{content:'.';} 50%{content:'..';} 75%{content:'...';} 100%{content:'';} }

/* ── Virtual keyboard ─────────────────────────────────────────────────────── */
#vkeyboard {
  height: var(--vkeys-h); min-height: var(--vkeys-h);
  background: var(--surface);
  border-top: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-evenly;
  padding: 0 8px; gap: 4px;
  overflow-x: auto; scrollbar-width: none;
  flex-shrink: 0; -webkit-overflow-scrolling: touch;
}
#vkeyboard::-webkit-scrollbar { display: none; }
.vkey {
  background: var(--border); color: var(--fg);
  border: none; border-radius: 4px;
  padding: 6px 8px; font-size: 12px;
  font-family: 'JetBrains Mono', monospace;
  cursor: pointer; white-space: nowrap; flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
  user-select: none; min-height: 32px;
}
.vkey:active { background: var(--primary); color: white; }
.vkey-arrow { padding: 6px 12px; font-size: 14px; }

/* ── Input bar ────────────────────────────────────────────────────────────── */
#input-bar {
  min-height: var(--input-h);
  background: var(--bg); border-top: 1px solid var(--border);
  display: flex; align-items: flex-end;
  padding: 6px 8px;
  padding-bottom: max(6px, env(safe-area-inset-bottom));
  gap: 6px; flex-shrink: 0;
}
#input-text {
  flex: 1;
  background: var(--surface); border: 1px solid var(--border); border-radius: 6px;
  color: var(--fg); font-size: 13px;
  font-family: 'JetBrains Mono', monospace;
  padding: 8px 10px; resize: none;
  min-height: 40px; max-height: 100px; overflow-y: auto; line-height: 1.4;
}
#input-text::placeholder { color: var(--muted); }
#input-text:focus { outline: none; border-color: var(--primary); }
.btn-send {
  background: var(--primary); color: #060C18;
  border: none; border-radius: 6px;
  padding: 10px 14px; font-size: 13px; font-weight: 600;
  font-family: 'JetBrains Mono', monospace;
  cursor: pointer; white-space: nowrap; min-height: 40px; flex-shrink: 0;
}
body.light .btn-send { color: white; }
.btn-send:active { opacity: 0.82; }

/* ── Spinner ──────────────────────────────────────────────────────────────── */
.spinner-wrap { display: flex; justify-content: center; padding: 48px; }
.spinner {
  width: 28px; height: 28px;
  border: 3px solid var(--border); border-top-color: var(--primary);
  border-radius: 50%; animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Responsive ───────────────────────────────────────────────────────────── */
@media (min-width: 960px) {
  :root { --topbar-h: 52px; }
}
@media (hover: none) and (pointer: coarse) {
  .device-card, .session-card { padding: 16px; }
  .btn-icon, .btn-back { min-height: 48px; }
}
@media (max-width: 360px) {
  .new-session-row { flex-wrap: wrap; }
  .dir-input { min-width: 100%; }
}
