/* Structure only. Colors come from app/static/themes/<theme>.css. */
body {
  background-color: var(--hub-page);
  background-image: var(--hub-bg-layers, none);
  background-attachment: fixed;
  background-repeat: repeat;
  color-scheme: var(--hub-color-scheme, light);
  padding-bottom: env(safe-area-inset-bottom);
}

.btn-primary {
  --bs-btn-bg: var(--hub-brand);
  --bs-btn-border-color: var(--hub-brand);
  --bs-btn-hover-bg: var(--hub-brand-dark);
  --bs-btn-hover-border-color: var(--hub-brand-dark);
  --bs-btn-active-bg: var(--hub-brand-dark);
  --bs-btn-color: var(--hub-brand-fg);
  --bs-btn-hover-color: var(--hub-brand-fg);
  background-image: var(--hub-brand-image, none);
  box-shadow: var(--hub-brand-glow, none);
}
.btn-primary:hover { background-image: var(--hub-brand-image, none); }

a { color: var(--hub-link); }
.card { background: var(--hub-surface); border-color: var(--hub-border); }
.form-control,
.form-control:focus {
  background: var(--hub-input-bg, var(--hub-surface));
  border-color: var(--hub-border);
}
.form-control:focus,
.form-check-input:focus,
.btn:focus-visible {
  border-color: var(--hub-brand);
  box-shadow: 0 0 0 .25rem color-mix(in srgb, var(--hub-brand) 30%, transparent);
}
.form-check-input:checked {
  background-color: var(--hub-brand);
  border-color: var(--hub-brand);
}

.hub-nav {
  background: var(--hub-nav-bg);
  padding-top: calc(.5rem + env(safe-area-inset-top));
}
.hub-nav .navbar-brand,
.hub-nav .nav-link,
.hub-nav .text-body-secondary { color: #fff !important; }

/* Auth pages */
.auth-page main { max-width: 26rem; padding-top: 3rem; }
.auth-card {
  background: var(--hub-surface);
  border-radius: 1rem;
  padding: 2rem;
  border: 1px solid var(--hub-border);
  box-shadow: 0 1px 3px rgba(0,0,0,.08), 0 12px 32px rgba(var(--hub-shadow), .10),
              var(--hub-surface-glow, 0 0 0 rgba(0,0,0,0));
}
.auth-mark { font-size: 2.5rem; color: var(--hub-brand); }

/* Hub tiles */
.tile {
  display: flex;
  align-items: center;
  gap: 1rem;
  height: 100%;
  padding: 1.25rem;
  background: var(--hub-surface);
  border-radius: 1rem;
  text-decoration: none;
  color: inherit;
  border: 1px solid var(--hub-border);
  box-shadow: 0 1px 2px rgba(0,0,0,.06),
              var(--hub-surface-glow, 0 0 0 rgba(0,0,0,0));
  transition: transform .12s ease, box-shadow .12s ease;
}
a.tile:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(var(--hub-shadow), .18); }
.tile-soon { opacity: .7; }
.tile-icon { font-size: 1.75rem; color: var(--hub-brand); }
.tile-name { font-weight: 600; }
.tile-blurb { font-size: .875rem; color: var(--hub-muted); }
.tile-badge {
  margin-left: auto;
  background: var(--hub-accent);
  color: var(--hub-accent-ink);
  align-self: flex-start;
}

/* Mobile bottom tab bar */
.tabbar {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  display: flex;
  background: var(--hub-surface);
  border-top: 1px solid var(--hub-border);
  padding-bottom: env(safe-area-inset-bottom);
  z-index: 1030;
}
.tabbar a {
  flex: 1;
  padding: .5rem 0;
  text-align: center;
  text-decoration: none;
  color: var(--hub-muted);
  font-size: .7rem;
}
.tabbar a i { display: block; font-size: 1.25rem; }
.has-tabbar { padding-bottom: 5rem !important; }
@media (min-width: 992px) { .has-tabbar { padding-bottom: 1.5rem !important; } }

.install-prompt {
  position: fixed;
  left: 1rem; right: 1rem;
  bottom: calc(4.5rem + env(safe-area-inset-bottom));
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .75rem 1rem;
  border-radius: .75rem;
  background: var(--hub-nav-bg);
  color: #fff;
  font-size: .875rem;
  z-index: 1040;
}

/* Theme preview bar - only rendered when the dev server is in debug mode. */
.theme-switch {
  position: fixed;
  bottom: .5rem; left: .5rem;
  display: flex;
  gap: .25rem;
  padding: .25rem;
  border-radius: 2rem;
  background: rgba(0,0,0,.55);
  z-index: 1050;
}
.theme-switch a {
  padding: .2rem .6rem;
  border-radius: 2rem;
  font-size: .7rem;
  text-decoration: none;
  color: #fff;
}
.theme-switch a.active { background: #fff; color: #111; }

/* Only the login wordmark takes a theme tint. Page headings keep Bootstrap's
   default so body copy and headings stay a matched pair in every theme. */
.auth-card h1 { color: var(--hub-heading, inherit); }

/* Themes may set a headline face; the rest stay on the system stack. */
h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6,
.navbar-brand, .tile-name {
  font-family: var(--hub-headline-font, inherit);
  font-weight: var(--hub-headline-weight, inherit);
}
