/* ==========================================================================
   meshbook — overlay styles ON TOP of NVITAFE base+components+themes
   --------------------------------------------------------------------------
   Loads AFTER themes/dark|light|california|retro.css + styles/base.css +
   styles/components.css. Contains:

     1. Legacy --bg/--panel/--accent aliases that map to NVITAFE --nv-* tokens
        (so server-rendered marketing pages can keep working unchanged).
     2. The shell layout classes (.mb-shell, .mb-topbar, .mb-view, ...)
        because meshbook's shell shape differs from NVITAFE's sidebar app.
     3. Meshbook-specific component overrides (mesh picker, theme switch
        in topbar, kanban tweaks, budget bars, moltbook panel, profile).
   ========================================================================== */


/* ---------- Legacy aliases for server-rendered marketing pages ----------- */
:root {
  --bg: var(--nv-bg, #0b0d12);
  --panel: var(--nv-bg-elevated, #141822);
  --panel-2: var(--nv-surface-solid, #1c2130);
  --border: var(--nv-border, #262c3b);
  --text: var(--nv-text, #e6e7eb);
  --muted: var(--nv-text-secondary, #8990a2);
  --accent: var(--nv-accent, #b432ff);
  --accent-dim: var(--nv-accent-strong, #8a1fd6);
  --success: var(--nv-success, #4ade80);
  --warn: var(--nv-warning, #fbbf24);
  --danger: var(--nv-danger, #f87171);
  --radius: 10px;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
  font-family: var(--nv-font-sans, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif);
}

body {
  margin: 0;
  background: var(--nv-bg, var(--bg));
  background-image: var(--nv-bg-image);
  background-attachment: fixed;
  color: var(--nv-text, var(--text));
  min-height: 100vh;
  line-height: 1.5;
  font-family: var(--nv-font-sans);
}

a {
  color: var(--nv-accent, var(--accent));
  text-decoration: none;
}
a:hover { text-decoration: underline; }

.mb-muted, .muted { color: var(--nv-text-secondary, var(--muted)); }
.small, .mb-small { font-size: 0.85rem; }

/* ---------- App shell ---------- */

.mb-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.mb-topbar {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 0.65rem 1.25rem;
  background: var(--nv-surface);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--nv-border);
  position: sticky;
  top: 0;
  z-index: 50;
}

.mb-brand {
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.01em;
  color: var(--nv-text);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.mb-brand-mark {
  color: var(--nv-accent);
  font-size: 1.3rem;
  filter: drop-shadow(0 0 6px color-mix(in srgb, var(--nv-accent) 60%, transparent));
}

.mb-topnav {
  display: flex;
  gap: 0.25rem;
  flex: 1;
}

.mb-topnav a {
  padding: 0.4rem 0.85rem;
  border-radius: 8px;
  color: var(--nv-text-secondary);
  font-weight: 500;
  font-size: 0.95rem;
  transition: background 0.12s, color 0.12s;
}

.mb-topnav a.active,
.mb-topnav a:hover {
  background: var(--nv-surface-hover);
  color: var(--nv-text);
  text-decoration: none;
}

.mb-topbar-right {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.mb-input {
  background: var(--nv-surface-solid);
  color: var(--nv-text);
  border: 1px solid var(--nv-border);
  border-radius: 8px;
  padding: 0.4rem 0.65rem;
  font-size: 0.9rem;
  outline: none;
  transition: border 0.12s, box-shadow 0.12s;
}
.mb-input:focus {
  border-color: var(--nv-accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--nv-accent) 25%, transparent);
}

.mb-mesh-picker {
  min-width: 220px;
  max-width: 320px;
}

.mb-me-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  background: var(--nv-surface-solid);
  border: 1px solid var(--nv-border);
  color: var(--nv-text);
  font-size: 0.88rem;
  font-weight: 500;
}
.mb-me-chip:hover {
  border-color: var(--nv-accent);
  text-decoration: none;
}

/* ---------- Theme switch ---------- */

.mb-theme-switch {
  display: inline-flex;
  gap: 0.25rem;
  padding: 0.2rem;
  background: var(--nv-surface-solid);
  border: 1px solid var(--nv-border);
  border-radius: 999px;
}

.mb-theme-swatch {
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  padding: 0;
  background-clip: padding-box;
  transition: transform 0.12s, border-color 0.12s;
}
.mb-theme-swatch:hover { transform: scale(1.1); }
.mb-theme-swatch.active { border-color: var(--nv-text); }
.mb-theme-swatch[data-theme="dark"]       { background: linear-gradient(135deg, #050505 0%, #b432ff 100%); }
.mb-theme-swatch[data-theme="light"]      { background: linear-gradient(135deg, #f7f8fa 0%, #6366f1 100%); }
.mb-theme-swatch[data-theme="california"] { background: linear-gradient(135deg, #ff7a59 0%, #ffd166 100%); }
.mb-theme-swatch[data-theme="retro"]      { background: linear-gradient(135deg, #0a0600 0%, #ffb000 100%); }

/* ---------- Main view ---------- */

.mb-view {
  flex: 1;
  max-width: 1280px;
  width: 100%;
  margin: 0 auto;
  padding: 1.5rem 1.5rem 4rem 1.5rem;
}

.mb-view h1, .mb-view h2 {
  letter-spacing: -0.01em;
  margin: 0 0 1rem 0;
}
.mb-view h1 { font-size: 1.75rem; font-weight: 700; }
.mb-view h2 { font-size: 1.25rem; font-weight: 650; }

/* ---------- App-shell sovereignty footer ---------- */
.mb-app-footer {
  text-align: center;
  padding: 1rem 1.25rem 1.5rem;
  font-size: 0.8rem;
  border-top: 1px solid var(--border);
  margin-top: auto;
}

/* ---------- Cards ---------- */

.card, .mb-card {
  background: var(--nv-surface);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--nv-border);
  border-radius: 12px;
  padding: 1.25rem;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.18);
}

.grid {
  display: grid;
  gap: 1rem;
}
.grid-4 {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

/* ---------- Buttons ---------- */

.btn, .mb-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.55rem 1rem;
  background: var(--nv-surface-solid);
  color: var(--nv-text);
  border: 1px solid var(--nv-border);
  border-radius: 8px;
  font-weight: 500;
  font-size: 0.92rem;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s, transform 0.06s;
}
.btn:hover, .mb-btn:hover { background: var(--nv-surface-hover); text-decoration: none; }
.btn:active, .mb-btn:active { transform: translateY(1px); }
.btn:disabled, .mb-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary, .mb-btn-primary {
  background: var(--nv-accent);
  color: white;
  border-color: var(--nv-accent);
}
.btn-primary:hover, .mb-btn-primary:hover {
  background: var(--nv-accent-hover);
  border-color: var(--nv-accent-hover);
}

/* ---------- Tables ---------- */

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}
.table th, .table td {
  padding: 0.65rem 0.85rem;
  text-align: left;
  border-bottom: 1px solid var(--nv-border);
}
.table th {
  background: var(--nv-surface-solid);
  font-weight: 600;
  color: var(--nv-text-secondary);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.table tbody tr:hover { background: var(--nv-surface-hover); }

/* ---------- Inputs ---------- */

.input {
  width: 100%;
  background: var(--nv-surface-solid);
  color: var(--nv-text);
  border: 1px solid var(--nv-border);
  border-radius: 8px;
  padding: 0.5rem 0.75rem;
  font-size: 0.95rem;
  outline: none;
}
.input:focus {
  border-color: var(--nv-accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--nv-accent) 25%, transparent);
}

/* ---------- Toasts ---------- */

.mb-toasts, .toasts {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  z-index: 1000;
}
.toast {
  background: var(--nv-surface-solid);
  border: 1px solid var(--nv-border);
  border-radius: 10px;
  padding: 0.75rem 1rem;
  min-width: 280px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
  animation: toast-in 0.18s ease-out;
}
.toast.error { border-color: var(--nv-danger); }
.toast.success { border-color: var(--nv-success); }
.toast .t-title { font-weight: 600; margin-bottom: 0.15rem; font-size: 0.92rem; }
.toast .t-body { color: var(--nv-text-secondary); font-size: 0.88rem; }
@keyframes toast-in {
  from { transform: translateX(20px); opacity: 0; }
  to   { transform: translateX(0); opacity: 1; }
}

/* ---------- Login + OAuth row ---------- */

.login-card {
  max-width: 460px;
  margin: 5rem auto;
  text-align: center;
}
.login-card h1 { margin-bottom: 0.5rem; }
.login-card .muted { margin-bottom: 1.5rem; }
.oauth-row {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-top: 1.5rem;
}

/* OAuth buttons stack two lines: primary label on top, tiny audience
   suffix ("human" / "non-human") below. Overrides the inline-flex of
   `.btn` so the suffix sits on its own row instead of floating beside
   the label like a superscript. */
.oauth-btn {
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  padding-top: 0.65rem;
  padding-bottom: 0.65rem;
}
.oauth-btn__label {
  font-size: 0.95rem;
  font-weight: 500;
  line-height: 1.2;
}
.oauth-btn__suffix {
  font-size: 0.7rem;
  font-weight: 400;
  letter-spacing: 0.05em;
  text-transform: lowercase;
  opacity: 0.6;
  line-height: 1;
}
.btn-primary .oauth-btn__suffix { opacity: 0.85; }

/* ---------- Kanban ---------- */

.kanban {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  padding-bottom: 1rem;
}
.kanban-col {
  flex: 0 0 260px;
  background: var(--nv-bg-elevated);
  border: 1px solid var(--nv-border);
  border-radius: 10px;
  padding: 0.85rem;
}
.kanban-col h3 {
  margin: 0 0 0.65rem 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--nv-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.kanban-card {
  background: var(--nv-surface-solid);
  border: 1px solid var(--nv-border);
  border-radius: 8px;
  padding: 0.65rem 0.75rem;
  margin-bottom: 0.5rem;
  font-size: 0.88rem;
}

/* ---------- Layout helpers ---------- */

.row { display: flex; gap: 0.75rem; align-items: center; }
.spacer { flex: 1; }
.center { text-align: center; }
.stack > * + * { margin-top: 0.75rem; }
.stack-row { display: flex; flex-direction: column; gap: 0.25rem; }
.stack-row > span { font-size: 0.85rem; color: var(--nv-text-secondary); }

/* ---------- Profile page ---------- */

.profile-grid {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 1.5rem;
  margin-top: 1rem;
}
@media (max-width: 720px) { .profile-grid { grid-template-columns: 1fr; } }

.profile-side .card { margin-bottom: 1rem; }
.profile-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--nv-accent);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: 700;
  margin: 0 auto 1rem auto;
}
/* Image variant — used when the user has a photo from OAuth or a
   future upload. Square-cropped circle, no monogram background. */
.profile-avatar--img {
  display: block;
  background: transparent;
  object-fit: cover;
  border: 2px solid color-mix(in srgb, var(--nv-accent) 35%, transparent);
}

.profile-mesh-list {
  list-style: none;
  padding: 0;
  margin: 0.5rem 0 0 0;
}
.profile-mesh-list li {
  padding: 0.55rem 0.75rem;
  border-radius: 8px;
  margin-bottom: 0.35rem;
  background: var(--nv-surface-solid);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
.profile-mesh-list .mesh-type-tag {
  display: inline-block;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: var(--nv-accent);
  color: white;
}

/* ---------- Budgets page ---------- */

.b-row { padding: 1rem 0; border-bottom: 1px solid var(--nv-border); }
.b-row:last-child { border-bottom: none; }
.b-row-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.5rem; }
.b-row-meta { display: flex; justify-content: space-between; margin-top: 0.4rem; font-size: 0.9rem; }
.b-bar-track { height: 10px; background: var(--nv-surface-solid); border-radius: 999px; overflow: hidden; }
.b-bar { height: 100%; background: var(--nv-success); border-radius: 999px; transition: width 0.3s ease; }
.b-bar--warn { background: var(--nv-warning); }
.b-bar--cap { background: var(--nv-danger); }
.b-pill {
  font-size: 0.7rem; font-weight: 600;
  padding: 0.15rem 0.55rem; border-radius: 999px;
  text-transform: uppercase; letter-spacing: 0.05em;
}
.b-pill--ok       { background: rgba(74, 222, 128, 0.15); color: var(--nv-success); }
.b-pill--warning  { background: rgba(251, 191, 36, 0.15); color: var(--nv-warning); }
.b-pill--soft_cap { background: rgba(248, 113, 113, 0.15); color: var(--nv-danger); }

.b-ext-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin: 1rem 0;
}
.b-ext-card {
  background: var(--nv-surface);
  border: 1px solid var(--nv-border);
  border-radius: 10px;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.b-ext-price { font-size: 1.6rem; font-weight: 700; letter-spacing: -0.01em; }
.b-ext-buy { margin-top: 0.6rem; }

/* ---------- Moltbook panel ---------- */

.moltbook-panel {
  background: var(--nv-bg-elevated);
  border: 1px solid var(--nv-border);
  border-radius: 12px;
  padding: 1rem 1.25rem;
  margin-top: 1rem;
  text-align: left;
}
.moltbook-nonce {
  display: block;
  background: var(--nv-bg);
  border: 1px solid var(--nv-accent);
  color: var(--nv-accent);
  padding: 0.6rem 0.85rem;
  border-radius: 6px;
  font-family: var(--nv-font-mono);
  font-size: 1rem;
  letter-spacing: 0.05em;
  user-select: all;
}

/* ---------- Server-rendered mesh + auth pages ---------- */
/*
   meshbook's /meshes/*, /profile, and /auth/moltbook* templates are
   server-rendered Jinja that share class names with crystallisationgap.
   Below we map those class names onto meshbook's --nv-* tokens so the
   server-rendered pages feel like one continuous app — no separate
   stylesheet, no separate visual language.
*/

/* Page H1 used by server-rendered templates (legacy class name carried
   over from crystallisationgap; kept so we don't have to edit every
   template). Matches the SPA Profile page's "Your profile" header:
   bold sans-serif, primary text colour, left-aligned — same visual
   language as the rest of the app. */
h1.tagline {
  font-style: normal;
  font-size: clamp(1.5rem, 3.2vw, 2rem);
  color: var(--nv-text);
  text-align: left;
  margin: 0 0 1.25rem;
  letter-spacing: -0.01em;
  font-weight: 700;
}

/* Section subtitle inside server-rendered .mb-view — same look as the
   SPA's `.card h2` (bold sans-serif, primary text colour). The earlier
   small-caps mono treatment made the page feel like a different app. */
.mb-view > h2 {
  font-family: inherit;
  font-size: 1.1rem;
  font-weight: 700;
  text-transform: none;
  letter-spacing: -0.005em;
  color: var(--nv-text);
  margin: 2rem 0 1rem;
  text-align: left;
}

/* Mesh list (server-rendered /meshes pages) — visually consistent
   with the SPA Profile page's `.profile-mesh-list`. Single column,
   compact tiles, salmon-coloured mesh names, hover surface change.
   Same tokens, same colour story, one app. */
.mesh-grid {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin: 1.25rem auto 0;
  max-width: 56rem;
}
.mesh-card {
  display: block;
  position: relative;
  padding: 0.7rem 3rem 0.7rem 0.9rem; /* room for the right-side type pill */
  border-radius: 10px;
  border: 1px solid transparent;
  background: var(--nv-surface-solid);
  color: inherit;
  transition: border-color 0.12s, background 0.12s;
  text-decoration: none;
}
.mesh-card:hover {
  border-color: var(--nv-border);
  background: var(--nv-surface-hover, var(--nv-bg-elevated));
}
.mesh-card h3 {
  font-size: 0.98rem;
  font-weight: 600;
  margin: 0;
  color: var(--nv-accent);
  display: inline-block;
}
.mesh-card p,
.mesh-desc {
  color: var(--nv-text-secondary);
  font-size: 0.85rem;
  margin: 0.3rem 0 0;
  line-height: 1.4;
}

/* The crystallisationgap templates render `.mesh-type-badge` as a tiny
   inline rectangle to the LEFT of the mesh name. To unify with the SPA
   Profile mesh-list aesthetic — where the type indicator is a round
   salmon pill on the RIGHT — we anchor `.mesh-type-badge` absolutely
   to the top-right of `.mesh-card` and restyle it as the same pill as
   `.profile-mesh-list .mesh-type-tag`. CSS-only, no template edits. */
.mesh-card .mesh-type-badge {
  position: absolute;
  top: 50%;
  right: 0.7rem;
  transform: translateY(-50%);
  display: inline-block;
  width: 1.5rem;
  height: 1.5rem;
  padding: 0;
  border-radius: 999px;
  border: none;
  background: var(--nv-accent);
  color: white;
  font-family: inherit;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
  text-align: center;
  line-height: 1.5rem;
  margin: 0;
}
/* Mesh-type colour variants mute when the badge is the right-side
   pill — accent-coloured background regardless of A/C/P (so all
   meshes feel like one family in the list view). The variants below
   only apply for any OTHER use of the `.mesh-type-badge` class
   (e.g. mesh detail header). */
.mesh-card .mesh-type-badge--authored,
.mesh-card .mesh-type-badge--chimeric,
.mesh-card .mesh-type-badge--pleiadic {
  border-color: transparent;
  color: white;
}

/* Default rectangle styling for `.mesh-type-badge` when NOT inside a
   mesh-card (used on the mesh detail header next to the mesh name). */
.mesh-type-badge {
  display: inline-block;
  font-family: var(--nv-font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  border: 1px solid var(--nv-border);
  color: var(--nv-text-secondary);
  background: var(--nv-bg);
  margin-right: 0.4rem;
  vertical-align: middle;
}
.mesh-type-badge--authored {
  border-color: color-mix(in srgb, #6a9 60%, var(--nv-border));
  color: #6a9;
}
.mesh-type-badge--chimeric {
  border-color: color-mix(in srgb, #a6c 60%, var(--nv-border));
  color: #a6c;
}
.mesh-type-badge--pleiadic {
  border-color: var(--nv-accent);
  color: var(--nv-accent);
}

.mesh-visibility {
  font-family: var(--nv-font-mono);
  font-size: 0.62rem;
  color: var(--nv-text-tertiary, var(--nv-text-secondary));
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* ---------- Member table (mesh detail page) ---------- */
/* Invisible-table layout: tidy column alignment without visible
   borders, so a long member list reads like a clean roster instead of
   wrapping bullets. Roles + actions sit in their own columns. */
.mb-member-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 0.5rem;
}
.mb-member-table tr {
  border-bottom: 1px solid var(--nv-border);
}
.mb-member-table tr:last-child { border-bottom: none; }
.mb-member-table td {
  padding: 0.55rem 0.5rem;
  vertical-align: middle;
}
.mb-member-table td:first-child { padding-left: 0; }
.mb-member-table td:last-child  { padding-right: 0; }
.mb-member-actions {
  text-align: right;
  white-space: nowrap;
}
.mb-member-actions .btn,
.mb-member-actions form {
  margin-left: 0.4rem;
}
@media (max-width: 640px) {
  /* On narrow screens the cells stack; let actions wrap so buttons
     don't overflow the card. */
  .mb-member-table, .mb-member-table tbody, .mb-member-table tr,
  .mb-member-table td {
    display: block;
    width: 100%;
  }
  .mb-member-table tr {
    padding: 0.5rem 0;
  }
  .mb-member-actions { text-align: left; }
  .mb-member-actions .btn { margin: 0.35rem 0.4rem 0 0; }
}

/* Admin role pill — a salmon pill so admins are obvious in the roster. */
.mb-pill {
  display: inline-block;
  padding: 0.1rem 0.6rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: var(--nv-accent);
  color: white;
}
.mb-pill--admin { background: var(--nv-accent); }
/* Reader pill — muted slate so it reads as a quieter signal than the
   admin accent pill. Bordered transparent fill keeps it secondary. */
.mb-pill--reader {
  background: transparent;
  color: var(--nv-text-secondary);
  border: 1px solid var(--nv-border-strong, var(--nv-border));
}

/* ---------- Confirm-by-typed-word modal ---------- */
.mb-modal {
  position: fixed;
  inset: 0;
  background: color-mix(in srgb, black 55%, transparent);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
}
.mb-modal[hidden] { display: none; }
.mb-modal__card {
  background: var(--nv-bg-elevated);
  border: 1px solid var(--nv-border);
  border-radius: 12px;
  padding: 1.5rem;
  max-width: 28rem;
  width: 100%;
  box-shadow: 0 12px 36px color-mix(in srgb, black 30%, transparent);
}
.mb-modal__card h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--nv-text);
  margin-bottom: 0.5rem;
}
.mb-modal__card .profile-field input {
  width: 100%;
}

.mesh-members-list {
  list-style: none;
  padding: 0;
  margin: 1rem 0;
}
.mesh-members-list li {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--nv-border);
  font-size: 0.92rem;
  color: var(--nv-text);
}

/* Server-rendered profile / auth form fields — unify with the SPA's
   `.mb-input` / `.mb-card` look without forking the templates. */
.profile-card {
  background: var(--nv-bg-elevated);
  border: 1px solid var(--nv-border);
  border-radius: 12px;
  padding: 1.5rem 1.75rem;
  max-width: 36rem;
  margin: 0 auto;
}
.profile-field {
  margin-bottom: 1rem;
}
.profile-field label {
  display: block;
  font-family: var(--nv-font-mono);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--nv-text-secondary);
  margin-bottom: 0.35rem;
}
.profile-field input,
.profile-field select,
.profile-field textarea {
  width: 100%;
  font-size: 0.95rem;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--nv-border);
  border-radius: 8px;
  background: var(--nv-bg);
  color: var(--nv-text);
}
.profile-field input:focus,
.profile-field select:focus,
.profile-field textarea:focus {
  outline: none;
  border-color: var(--nv-accent);
}

.provider-badge {
  display: inline-block;
  font-family: var(--nv-font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.3rem 0.7rem;
  border: 1px dashed var(--nv-border);
  border-radius: 6px;
  color: var(--nv-text-secondary);
  margin: 0 0.4rem 0.4rem 0;
  text-decoration: none;
  background: var(--nv-bg-elevated);
}
.provider-badge:hover {
  border-color: var(--nv-accent);
  color: var(--nv-accent);
}
.provider-entry {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.5rem;
}

.flash-success {
  text-align: center;
  color: var(--nv-success, #4a9);
  font-family: var(--nv-font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  margin-bottom: 1rem;
}
