/* mylanai.net - the hub's own styles on top of the vendored Bootstrap 5.3 (includes/ui.php). No inline styles
   anywhere (CSP default-src 'self'): every look lives here. Mobile-first: the bottom tab bar shows below 768 px. */

:root {
  --hub-accent: #0e5f6e;
  --hub-tabbar-h: 3.75rem;
}

[data-bs-theme="dark"] {
  --hub-accent: #5fb7c6;
}

body.hub {
  min-height: 100vh;
}

.hub-topbar .navbar-brand {
  color: var(--hub-accent);
}

.hub-topbar .nav-link.active {
  color: var(--hub-accent);
}

.hub-narrow {
  max-width: 28rem;
}

/* room for the fixed tab bar on phones */
@media (max-width: 767.98px) {
  body.hub-signed-in .hub-main {
    padding-bottom: calc(var(--hub-tabbar-h) + env(safe-area-inset-bottom, 0px) + 1rem) !important;
  }
}

.hub-tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1030;
  display: flex;
  justify-content: space-around;
  min-height: var(--hub-tabbar-h);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: var(--bs-body-bg);
}

.hub-tab {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.15rem;
  font-size: 0.72rem;
  color: var(--bs-secondary-color);
  text-decoration: none;
}

.hub-tab.active {
  color: var(--hub-accent);
  font-weight: 600;
}

.hub-icon {
  width: 1.4rem;
  height: 1.4rem;
}

.hub-card .card-footer {
  background: transparent;
}

/* the TOTP enrolment QR (drawn by assets/js/app.js with the vendored qrcodejs): always dark on white, whatever the
   theme - authenticator cameras read it best that way */
.hub-qr {
  display: inline-block;
  padding: 0.75rem;
  background: #fff;
  border-radius: 0.5rem;
  line-height: 0;
}

.hub-qr:empty {
  display: none;
}

.hub-qr img,
.hub-qr canvas {
  width: 200px;
  height: 200px;
}

.hub-secret {
  letter-spacing: 0.08em;
  word-break: break-all;
}

/* the Projects page's "At a glance" table on a phone (to-do #169): below Bootstrap's sm breakpoint each row is a
   two-line block - the name and its status badge, then the % bar, the Now dot and the main URL - so nothing scrolls
   sideways at 375 px; from sm up it is the ordinary table */
@media (max-width: 575.98px) {
  .projects-glance,
  .projects-glance tbody {
    display: block;
  }

  .projects-glance thead {
    display: none;
  }

  .projects-glance tr {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    column-gap: 0.75rem;
    row-gap: 0.25rem;
    padding: 0.45rem 0;
    border-bottom: var(--bs-border-width) solid var(--bs-border-color);
  }

  .projects-glance tr > th,
  .projects-glance tr > td {
    display: block;
    padding: 0;
    border-bottom: 0;
  }

  .projects-glance tr > th {
    flex: 1 0 calc(100% - 6.5rem);
    min-width: 0;
    white-space: normal;
  }

  .projects-glance tr > td:last-child {
    flex: 1 1 8rem;
    min-width: 0;
    white-space: normal;
    overflow-wrap: anywhere;
  }
}

/* the Projects page's views (includes/projects_views.php): the nav row's pills stay compact and wrap on a phone */
.hub-views-nav {
  gap: 0.25rem;
}

.hub-views-nav .nav-link {
  padding: 0.25rem 0.65rem;
}

/* a to-do list's column header shows from md up only: on a phone the first item keeps the box's top edge */
@media (max-width: 767.98px) {
  .hub-todo-list > .hub-todo-head + .list-group-item {
    border-top-width: var(--bs-list-group-border-width);
    border-top-left-radius: inherit;
    border-top-right-radius: inherit;
  }
}

/* By machine: an item on hold comes last in its project and is muted (the "on hold" badge says it in words) */
.hub-todo-held {
  color: var(--bs-secondary-color);
  background-color: var(--bs-tertiary-bg);
}

/* Session cost / Sessions (2a): a machine whose last report is late (the line also says "Late:" in words) */
.hub-usage-late {
  color: var(--bs-warning-text-emphasis);
  background-color: var(--bs-warning-bg-subtle);
  border-radius: var(--bs-border-radius-sm);
  padding: 0 0.25rem;
}

/* a project with no usage at all is muted, so the ones with numbers stand out */
.hub-usage-none {
  color: var(--bs-secondary-color);
}

/* the cost table's column header shows from lg up only: on a phone the first row keeps the box's top edge */
@media (max-width: 991.98px) {
  .hub-usage-list > .list-group-item.d-none + .list-group-item {
    border-top-width: var(--bs-list-group-border-width);
    border-top-left-radius: inherit;
    border-top-right-radius: inherit;
  }
}

/* Site performance (S4 K0): each card's label / value rows sit closer than a plain <dl class="row">, and a long
   value (a URL, an error) wraps inside its card instead of widening the page */
.hub-perf-dl > dt,
.hub-perf-dl > dd {
  margin-bottom: 0.3rem;
}

.hub-perf-dl > dd {
  min-width: 0;
}

/* Ground Control (batch 3a, includes/projects_views.php): the top line on every Projects view, the console ?view=gc.
 * The state is always in the words; these only colour it. Text that came from a machine (a title, an address, a
 * reason) wraps anywhere so a long one never widens the phone layout. */
.hub-gc-top {
  padding: 0.35rem 0.6rem;
  border-left: 3px solid var(--bs-success-border-subtle);
  background: var(--bs-tertiary-bg);
  overflow-wrap: anywhere;
}

.hub-gc-top.hub-gc-amber,
.hub-gc-amber {
  border-left: 3px solid var(--bs-warning);
  padding-left: 0.6rem;
}

.hub-gc-top[data-state="none"],
.hub-gc-top[data-state="unreadable"] {
  border-left-color: var(--bs-secondary-border-subtle);
}

.hub-gc-warn {
  color: var(--bs-warning-text-emphasis);
  font-weight: 600;
}

.hub-gc-data {
  overflow-wrap: anywhere;
}

.hub-gc-meter {
  width: 100%;
  max-width: 28rem;
  height: 1rem;
}

.hub-gc-switch {
  max-width: 28rem;
}

/* 3b: an instruction's text keeps its lines and wraps anywhere (a long word never widens the phone layout) */
.hub-gc-text {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* The Demos view (owner 2026-10-18): a project on hold is listed last, greyed (its badge says so in words). */
.hub-demos-hold {
  opacity: 0.6;
}

/* The header's brand (includes/ui.php UI_BRAND): "myLanai" as the Lanai mark in its grow variant - the eye on the
   final i and the ai -> AI / SI -> back animation both come from the shared piece (assets/lanai-brand/lanai-mark.css,
   .lanai-mark--grow, brand 1.1.0). Only the stacking is the hub's: the big letters pass over the bar. */
.hub-brand { position: relative; z-index: 2; }
/* While the next page loads (app.js sets .hub-busy on <html>) the header's eye blinks steadily; reduced motion: it
   dims instead. */
.hub-busy .hub-brand .lanai-eye { animation: hub-eye-busy 0.9s ease-in-out infinite; }
@keyframes hub-eye-busy {
  0%, 30%, 70%, 100% { transform: scaleY(1); }
  50% { transform: scaleY(0.1); }
}
@media (prefers-reduced-motion: reduce) {
  .hub-busy .hub-brand .lanai-eye { animation: none; opacity: 0.45; }
}

/* The foot of every page (includes/ui.php UI_BUILT_ON): "Built on Lanai", the mark at the text's own size. */
.hub-built-on { margin: 2.5rem 0 0.5rem; text-align: center; }
.hub-built-on .lanai-mark { font-weight: 600; color: var(--bs-body-color); }
