/* FTJ Mobile Cockpit — base tokens + global resets.
 * Dark-first. FTJ palette (deep blue/black, accent green). */

:root {
  --bg: #0a0e14;
  --bg-elev: #131923;
  --panel: #1a2230;
  --border: #1f2a3a;
  --fg: #d8dee9;
  --fg-dim: #8b95a5;
  --fg-muted: #5a6678;
  --accent: #3ddc97;        /* FTJ green */
  --accent-dim: #2c9e6f;
  --danger: #ff5c5c;
  --warn: #f7b955;
  --link: #6ec1ff;

  --radius: 10px;
  --radius-sm: 6px;
  --touch: 44px;             /* Apple HIG minimum touch target */

  --shadow-1: 0 1px 2px rgba(0,0,0,0.4);
  --shadow-2: 0 4px 12px rgba(0,0,0,0.5);

  --font-sys: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--fg);
  font: 16px/1.45 var(--font-sys);
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
}
html { height: 100dvh; }

body {
  /* dvh adapts when the mobile keyboard opens — vh doesn't. */
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;          /* tab panels manage their own scroll */
}

button, input, textarea {
  font: inherit;
  color: inherit;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.6em 0.9em;
  min-height: var(--touch);
  outline: none;
}

button {
  cursor: pointer;
  background: var(--panel);
}

button:active { transform: translateY(1px); }

input, textarea {
  background: var(--bg-elev);
  width: 100%;
}

textarea { resize: vertical; }

a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 { margin: 0 0 0.5em; font-weight: 600; }
h1 { font-size: 1.25rem; }
h2 { font-size: 1.1rem; }
p { margin: 0 0 0.6em; }

code, pre { font-family: var(--font-mono); font-size: 0.92em; }
pre {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.7em 0.9em;
  overflow-x: auto;
}

#boot-splash {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  height: 100dvh;
  background: var(--bg);
}
.boot-logo {
  font-size: 3rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--accent);
}
.boot-status {
  margin-top: 1em;
  color: var(--fg-dim);
}

#toast-host {
  position: fixed;
  left: 50%;
  bottom: calc(env(safe-area-inset-bottom, 0) + 84px);
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 0.5em;
  pointer-events: none;
  z-index: 1000;
}
.toast {
  background: var(--panel);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  padding: 0.6em 0.9em;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-2);
  pointer-events: auto;
  max-width: 90vw;
}
.toast.error { border-left-color: var(--danger); }
.toast.warn  { border-left-color: var(--warn); }

/* Persistent top banner (online/offline + sustained errors).
 * Sits above the tab content; pushes everything down 1 row. */
#banner-host {
  position: sticky;
  top: 0;
  z-index: 900;
}
.banner {
  padding: 0.5em 1em;
  font-size: 0.9rem;
  text-align: center;
  background: var(--bg-elev);
  border-bottom: 1px solid var(--border);
  color: var(--fg);
}
.banner.warn  { background: rgba(247, 185, 85, 0.12); border-color: var(--warn); color: var(--warn); }
.banner.error { background: rgba(255, 92, 92, 0.12); border-color: var(--danger); color: var(--danger); }

/* Skeleton row shown while a tab is initializing. */
.tab-skeleton {
  padding: 1.5em 1em;
  text-align: center;
  color: var(--fg-muted);
  font-size: 0.95rem;
}
