/* ============================================================
   KAMI OS — CYCLE 5 CORE
   Mobile bottom tab bar + Command Center hero (orchestrator)
   ============================================================ */

/* ---------- Bottom tab bar (mobile only) ---------- */
.tabbar {
  display: none;
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 34;
  align-items: stretch;
  justify-content: space-around;
  height: calc(62px + env(safe-area-inset-bottom, 0px));
  padding: 0 6px env(safe-area-inset-bottom, 0px);
  background: rgba(7, 11, 18, 0.88);
  border-top: 1px solid var(--glass-border);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.tab-item {
  appearance: none;
  -webkit-appearance: none;
  background: none;
  border: none;
  padding: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-width: 44px;
  color: var(--text-faint);
  transition: color 0.15s var(--ease);
  -webkit-tap-highlight-color: transparent;
}

.tab-item svg { width: 22px; height: 22px; }

.tab-item span {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.tab-item.active { color: var(--accent); }
.tab-item.active svg { filter: drop-shadow(0 0 6px var(--accent-glow)); }

.tab-log {
  appearance: none;
  -webkit-appearance: none;
  border: none;
  flex: none;
  align-self: center;
  width: 52px; height: 52px;
  margin: 0 4px;
  display: grid; place-items: center;
  border-radius: 50%;
  font-size: 26px; font-weight: 700; line-height: 0;
  color: #00141a;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 22px -2px var(--accent-glow), 0 4px 14px rgba(0, 0, 0, 0.45);
  transform: translateY(-10px);
  transition: transform 0.12s var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.tab-log:active { transform: translateY(-10px) scale(0.92); }

@media (max-width: 880px) {
  .tabbar { display: flex; }
  .view { padding-bottom: 104px; }
  .toast-root { bottom: calc(78px + env(safe-area-inset-bottom, 0px)); }
}

/* ---------- Command Center hero ---------- */
.c5x-hero {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  padding: 18px;
  border: 1px solid var(--glass-border-hot);
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(0, 229, 255, 0.06), rgba(10, 16, 28, 0.4));
}

.c5x-ring-wrap { flex: none; position: relative; width: 128px; height: 128px; }
.c5x-ring-wrap svg { width: 128px; height: 128px; transform: rotate(-90deg); }
.c5x-ring-track { fill: none; stroke: rgba(255, 255, 255, 0.07); stroke-width: 9; }
.c5x-ring-fill {
  fill: none; stroke-width: 9; stroke-linecap: round;
  transition: stroke-dashoffset 0.6s var(--ease);
}
.c5x-ring-fill.good { stroke: var(--good); filter: drop-shadow(0 0 6px rgba(46, 230, 166, 0.5)); }
.c5x-ring-fill.mid { stroke: var(--accent); filter: drop-shadow(0 0 6px var(--accent-glow)); }
.c5x-ring-fill.low { stroke: var(--warn); filter: drop-shadow(0 0 6px rgba(255, 190, 60, 0.4)); }

.c5x-ring-center {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 1px;
}
.c5x-ring-pct { font-family: var(--font-display); font-size: 30px; font-weight: 700; color: var(--text); }
.c5x-ring-label { font-family: var(--font-mono); font-size: 8.5px; letter-spacing: 2px; color: var(--text-faint); text-transform: uppercase; }

.c5x-hero-right { flex: 1; min-width: 200px; display: flex; flex-direction: column; gap: 10px; }

.c5x-now {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(125, 211, 252, 0.28);
  background: rgba(125, 211, 252, 0.06);
  font-size: 13.5px;
  cursor: pointer;
}
.c5x-now .k {
  font-family: var(--font-mono); font-size: 9.5px; letter-spacing: 1.5px;
  color: #7dd3fc;
}
.c5x-now .t { font-weight: 600; color: var(--text); }
.c5x-now .sub { font-family: var(--font-mono); font-size: 11px; color: var(--text-dim); margin-left: auto; }
.c5x-now.live { border-color: rgba(74, 222, 128, 0.4); background: rgba(74, 222, 128, 0.07); }
.c5x-now.live .k { color: var(--good); }
.c5x-now.live .k::before {
  content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 6px;
  border-radius: 50%; background: var(--good); box-shadow: 0 0 8px var(--good);
  animation: c5xpulse 1.6s ease-in-out infinite;
}
.c5x-now.clear { border-color: rgba(46, 230, 166, 0.25); background: rgba(46, 230, 166, 0.05); }
.c5x-now.clear .k { color: var(--good); }
@keyframes c5xpulse { 50% { opacity: 0.35; } }

.c5x-chips { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.c5x-chip {
  display: flex; flex-direction: column; gap: 2px;
  min-height: 48px;
  padding: 8px 12px;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  background: var(--glass);
  cursor: pointer;
  transition: border-color 0.15s var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.c5x-chip:active, .c5x-chip:hover { border-color: var(--glass-border-hot); }
.c5x-chip .k { font-family: var(--font-mono); font-size: 8.5px; letter-spacing: 1.5px; color: var(--text-faint); text-transform: uppercase; }
.c5x-chip .v { font-family: var(--font-mono); font-size: 15px; font-weight: 700; color: var(--text); }
.c5x-chip .v.good { color: var(--good); }
.c5x-chip .v.warn { color: var(--warn); }
.c5x-chip .v.bad { color: var(--bad); }

.c5x-runway { width: 100%; margin-top: 4px; }
.c5x-runway .r-head {
  display: flex; justify-content: space-between; align-items: baseline; gap: 10px;
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.5px;
  color: var(--text-dim); margin-bottom: 6px;
}
.c5x-runway .r-head .pctv { color: var(--good); font-weight: 700; }
.c5x-runway .r-bar { height: 6px; border-radius: 4px; background: rgba(255, 255, 255, 0.06); overflow: hidden; }
.c5x-runway .r-fill {
  height: 100%; border-radius: 4px;
  background: linear-gradient(90deg, var(--good), var(--accent));
  box-shadow: 0 0 10px rgba(46, 230, 166, 0.4);
}

@media (max-width: 520px) {
  .c5x-hero { justify-content: center; }
  .c5x-hero-right { min-width: 100%; }
}

@media (min-width: 881px) {
  .c5x-hero { padding: 22px; gap: 26px; }
  .c5x-chips { grid-template-columns: repeat(4, 1fr); }
  .c5x-ring-wrap, .c5x-ring-wrap svg { width: 148px; height: 148px; }
}
