* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  background: #fff;
  color: #000;
  min-height: 100vh;
}
.portal-card {
  max-width: 400px;
  margin: 12vh auto;
  padding: 32px 28px;
  background: #fff;
  border: none;
}
.portal-logo {
  display: block;
  width: 112px;
  height: auto;
  margin: 0 auto 16px;
  object-fit: contain;
}
.portal-card h1 {
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}
.lead {
  color: #444;
  font-size: 0.9rem;
  line-height: 1.55;
  margin-bottom: 28px;
}
.auth-block label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.7rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #000;
  margin-bottom: 14px;
}
.auth-block input {
  width: 100%;
  max-width: 100%;
  padding: 10px 12px;
  min-height: 44px;
  border: none;
  border-radius: 6px;
  background: #f0f0f0;
  color: #000;
  font-size: 1rem;
}
.portal-password-wrap {
  position: relative;
  display: block;
  width: 100%;
}
.portal-password-wrap input {
  padding-right: 4.5rem;
}
.portal-password-toggle {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  min-height: 32px;
  padding: 4px 10px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: #444;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
}
.portal-password-toggle:hover {
  color: #000;
  background: rgba(0, 0, 0, 0.06);
}
.portal-password-toggle:focus-visible {
  outline: 2px solid #000;
  outline-offset: 1px;
}
.auth-block input:focus {
  outline: 2px solid #000;
  outline-offset: 1px;
}
.or {
  text-align: center;
  color: #666;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 22px 0 14px;
}
.portal-google-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  min-height: 44px;
}
.portal-google-wrap > div {
  display: flex;
  justify-content: center;
}
.btn-primary,
.btn-muted {
  border: none;
  border-radius: 8px;
  padding: 11px 16px;
  font-weight: 600;
  cursor: pointer;
  font-size: 0.9rem;
  background: #f0f0f0;
  color: #000;
}
.btn-primary {
  background: #000;
  color: #fff;
  width: 100%;
  margin-top: 6px;
}
.btn-primary:hover { background: #222; }
.btn-muted:hover { background: #f5f5f5; }
.status {
  margin-top: 18px;
  font-size: 0.85rem;
  min-height: 1.2em;
  color: #000;
}
#portalStatus:empty {
  display: none;
  margin: 0;
  min-height: 0;
}
.status.err { color: #000; font-weight: 500; }

.hub-body {
  padding: 32px 24px 48px;
  max-width: 1040px;
  margin: 0 auto;
}
.hub-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}
.hub-logo {
  width: 52px;
  height: auto;
  flex-shrink: 0;
  object-fit: contain;
}
.hub-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  margin-bottom: 32px;
  padding-bottom: 20px;
  border-bottom: none;
}
.hub-header h1 {
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.hub-header .lead { margin-bottom: 0; }
.hub-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.hub-tools-link {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}
.hub-user { font-size: 0.8rem; color: #444; }
.hub-filter { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; }
.hub-filter button {
  padding: 6px 14px;
  border-radius: 6px;
  border: none;
  background: #f0f0f0;
  color: #000;
  cursor: pointer;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.hub-filter button:hover { background: #f5f5f5; }
.hub-filter button.active {
  background: #000;
  color: #fff;
}
.hub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}
.hub-card {
  display: block;
  padding: 16px;
  background: #f5f5f5;
  border: none;
  border-radius: 8px;
  text-decoration: none;
  color: inherit;
  transition: background 0.12s;
}
.hub-card:hover {
  background: #ebebeb;
}
.hub-card-featured {
  background: #ebebeb;
}
.hub-star {
  color: #c9a227;
  font-size: 0.95em;
  letter-spacing: 0;
}
.hub-card h2 {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 8px;
  color: #000;
}
.hub-card p {
  font-size: 0.85rem;
  color: #444;
  line-height: 1.5;
}
.hub-card .cat {
  display: inline-block;
  margin-top: 12px;
  font-size: 0.65rem;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* Login + hub: phones and notched screens */
@media (max-width: 480px) {
  .portal-card {
    margin: max(6vh, env(safe-area-inset-top, 0px)) auto 24px;
    padding: 24px 20px max(24px, env(safe-area-inset-bottom, 0px));
    width: 100%;
    max-width: none;
  }
  .portal-card h1 {
    font-size: 1.15rem;
  }
  .hub-body {
    padding: 20px 16px max(32px, env(safe-area-inset-bottom, 0px));
  }
  .hub-header {
    align-items: flex-start;
  }
  .hub-actions {
    width: 100%;
    justify-content: space-between;
  }
  .hub-grid {
    grid-template-columns: 1fr;
  }
  .hub-filter button {
    min-height: 40px;
  }
  .btn-primary,
  .btn-muted {
    min-height: 44px;
  }
}
