/* FloorTalk nav redesign — premium hub groups (PREVIEW). Tokens from PREMIUM_DARK_UI. */
:root {
  --surface: var(--panel, #18181b);
  --surface-raised: var(--panel2, #1f1f23);
  --surface-inset: var(--bg2, #111113);
  --text-subtle: #d4d4d8;
  --border-strong: #3f3f46;
  --radius-md: 12px;
  --radius-lg: 16px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
}

/* 6-tab bottom bar: compact labels */
.bottom-nav.nav-v2 {
  gap: 0;
  padding: 4px 2px calc(4px + var(--safe-bottom, 0px));
}
.bottom-nav.nav-v2 .nav-item {
  position: relative;
  font-size: 10px;
  letter-spacing: -0.01em;
  min-height: 52px;
  padding: 4px 2px;
  gap: 2px;
  flex: 1 1 0;
  min-width: 0;
}
.bottom-nav.nav-v2 .nav-item .ico {
  font-size: 1.15rem;
  line-height: 1;
}
.bottom-nav.nav-v2 .nav-item .nav-label {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

.hub-greet h2 {
  font-size: 24px;
  font-weight: 650;
  letter-spacing: -0.02em;
  margin: 0 0 4px;
}
.hub-greet p {
  color: var(--muted);
  font-size: 14px;
  margin: 0;
}

.hub-section {
  margin-top: var(--space-6);
}
.hub-section-title {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: none;
  color: var(--muted);
  margin: 0 0 var(--space-3);
  padding: 0 2px;
}
.hub-section-title .hub-sec-note {
  font-weight: 450;
  color: var(--muted);
  opacity: 0.85;
}

.hub-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  text-align: left;
}
.hub-card strong {
  font-weight: 650;
  color: var(--text);
}
.hub-card.locked {
  opacity: 0.72;
}
.hub-card.locked .hub-lock {
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
}
.hub-card.primary-sos {
  grid-column: 1 / -1;
  background: var(--surface);
  border-color: rgba(239, 68, 68, 0.55);
  padding: 16px 18px;
  min-height: 72px;
}
.hub-card.primary-sos strong { font-size: 1.05rem; color: #fecaca; }
.hub-card.primary-sos span:not(.hub-ico) { color: #fca5a5; }

.hub-landing .hub-grid {
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.hub-landing .hub-grid.one-col { grid-template-columns: 1fr; }

.more-group {
  margin-top: var(--space-5);
}
.more-group:first-of-type { margin-top: 0; }
.more-group-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  margin: 0 0 8px;
  padding: 0 2px;
}
.more-group-title em {
  font-style: normal;
  font-weight: 450;
  opacity: 0.85;
}
.more-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.more-row {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}
.more-row .tag-diff {
  display: inline-block;
  font-size: 11px;
  font-weight: 550;
  padding: 1px 7px;
  border-radius: 999px;
  margin-left: 6px;
  vertical-align: middle;
}
.more-row .tag-diff.emergency { background: rgba(239,68,68,.15); color: #fca5a5; }
.more-row .tag-diff.urgent { background: rgba(245,158,11,.15); color: #fcd34d; }
.more-row .tag-diff.routine { background: rgba(45,212,191,.12); color: var(--accent); }

.home-strip {
  margin: var(--space-4) 0 0;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1px solid var(--border);
}
.home-strip.urgent {
  border-color: rgba(239,68,68,.5);
  background: rgba(239,68,68,.08);
}
.home-strip h3 {
  margin: 0 0 4px;
  font-size: 14px;
  font-weight: 650;
}
.home-strip p { margin: 0; font-size: 13px; color: var(--muted); }

/* Wide screens: hub grids denser; nav items stay compact bottom-bar style (see override below). */
@media (min-width: 900px) {
  .hub-landing .hub-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ---------------------------------------------------------------------------
   Nav redesign: keep the 6-tab bar at the BOTTOM on desktop too.
   Cause: ux.css @media (min-width: 900px) .ftf-ipad_layout .bottom-nav turns the
   bar into a left side rail (--rail-w: 232px). That matched the old 4–5 tab
   iPad layout; with 6 hub tabs (Home Talk Maintain Lines Library More) the
   phone screenshots are the source of truth, and a side rail on a desktop
   browser (localhost at ~1280px) looked wrong.
   Decision: bottom bar is primary at ALL widths. No side rail for nav-v2.
   (Wide content grids from ipad_layout stay; only the rail conversion is undone.)
   --------------------------------------------------------------------------- */
@media (min-width: 900px) {
  .ftf-ipad_layout body:has(#bottom-nav.nav-v2:not(.hidden)) {
    padding-left: 0;
    padding-bottom: calc(var(--nav-h, 64px) + var(--safe-bottom, 0px));
  }
  .ftf-ipad_layout body:has(#bottom-nav.nav-v2:not(.hidden)) .app-header {
    padding-left: 24px; /* keep content inset; do not reserve rail space */
  }
  .ftf-ipad_layout .bottom-nav.nav-v2 {
    top: auto;
    left: 0;
    right: 0;
    bottom: 0;
    width: auto;
    height: auto;
    flex-direction: row;
    justify-content: stretch;
    align-items: stretch;
    gap: 0;
    padding: 4px 2px calc(4px + var(--safe-bottom, 0px));
    border-top: 1px solid var(--border);
    border-right: 0;
    background: rgba(24, 24, 27, 0.96);
  }
  .ftf-ipad_layout .bottom-nav.nav-v2 .nav-item {
    flex: 1 1 0;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 2px;
    padding: 4px 2px;
    font-size: 11px;
    min-height: 52px;
    min-width: 0;
  }
  .ftf-ipad_layout .bottom-nav.nav-v2 .nav-item .ico {
    font-size: 1.15rem;
    width: auto;
    text-align: center;
  }
  .ftf-ipad_layout .bottom-nav.nav-v2 .nav-item .nav-label {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
  }
  .ftf-ipad_layout .bottom-nav.nav-v2 .nav-item .nav-badge {
    position: absolute;
    top: 4px;
    right: 8px;
    margin-left: 0;
  }
  .ftf-ipad_layout .toast {
    left: 50%; /* undo rail-centered toast offset */
  }
  /* SOS pill: do not pin the nav to the top (that was for the side rail) */
  html.sos-pill-on.ftf-ipad_layout .bottom-nav.nav-v2 {
    top: auto;
  }
}
