:root {
  --bg0: #05080d;
  --bg1: #07131c;
  --bg2: #101827;

  --panel: rgba(13, 22, 34, 0.88);
  --panel-soft: rgba(18, 30, 46, 0.72);
  --panel-strong: rgba(9, 15, 24, 0.94);

  --text: #eef5ff;
  --muted: #9fb0c7;
  --soft: #c8d6e8;

  --line: rgba(255,255,255,0.10);
  --line-strong: rgba(255,255,255,0.18);

  --accent: #73d7ff;
  --accent2: #b79cff;
  --accent3: #72f0bf;

  --danger: #ff8f9b;
  --warning: #ffd27d;
  --ok: #9cffc9;

  --radius-xl: 28px;
  --radius-lg: 20px;
  --shadow: 0 24px 80px rgba(0,0,0,0.34);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg0);
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    Arial,
    sans-serif;
  background:
    radial-gradient(circle at 12% 0%, rgba(115, 215, 255, 0.18), transparent 34rem),
    radial-gradient(circle at 84% 12%, rgba(183, 156, 255, 0.14), transparent 32rem),
    radial-gradient(circle at 50% 100%, rgba(114, 240, 191, 0.08), transparent 34rem),
    linear-gradient(135deg, var(--bg0), var(--bg1) 48%, var(--bg2));
  background-attachment: fixed;
}

a {
  color: inherit;
}

.mbw-topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 0.85rem max(1rem, calc((100vw - 1180px) / 2));
  border-bottom: 1px solid var(--line);
  background: rgba(4, 9, 15, 0.78);
  backdrop-filter: blur(18px);
}

.mbw-brand {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  min-width: 0;
  color: var(--text);
  text-decoration: none;
}

.mbw-brand-mark {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  border-radius: 15px;
  color: #06111d;
  font-weight: 950;
  letter-spacing: -0.04em;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  box-shadow: 0 12px 34px rgba(115, 215, 255, 0.18);
}

.mbw-brand strong {
  display: block;
  font-size: 1.03rem;
  letter-spacing: -0.02em;
}

.mbw-brand small {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  margin-top: 0.05rem;
}

.mbw-nav {
  display: flex;
  align-items: center;
  gap: 0.95rem;
  flex-wrap: wrap;
  justify-content: flex-end;
  font-size: 0.95rem;
}

.mbw-nav a {
  color: var(--muted);
  text-decoration: none;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.mbw-nav a:hover {
  color: var(--text);
}

.mbw-user {
  color: var(--accent3);
  font-weight: 700;
}

.mbw-login-btn,
.mbw-primary,
.mbw-secondary,
button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 0.72rem 1rem;
  color: var(--text);
  text-decoration: none;
  background: rgba(255,255,255,0.075);
  cursor: pointer;
  font: inherit;
  line-height: 1;
}

.mbw-login-btn:hover,
.mbw-secondary:hover {
  background: rgba(255,255,255,0.12);
}

.mbw-primary,
button {
  border: 0;
  color: #06111d;
  font-weight: 850;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  box-shadow: 0 14px 32px rgba(115, 215, 255, 0.16);
}

.mbw-primary:hover,
button:hover {
  filter: brightness(1.05);
}

.mbw-page {
  width: min(1180px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 3rem 0 4rem;
}

.mbw-hero,
.mbw-card,
.mbw-login-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.045), rgba(255,255,255,0.018)),
    var(--panel);
  box-shadow: var(--shadow);
}

.mbw-hero {
  position: relative;
  overflow: hidden;
  padding: 1.4rem 1.6rem;
  margin-bottom: .8rem;
}

.mbw-hero::after {
  content: "";
  position: absolute;
  inset: auto -8rem -11rem auto;
  width: 26rem;
  height: 26rem;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(115, 215, 255, 0.13), transparent 64%);
  pointer-events: none;
}

.mbw-kicker {
  margin: 0 0 .4rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.76rem;
  font-weight: 900;
}

h1 {
  max-width: 900px;
  margin: 0 0 1rem;
  font-size: 1.25rem;
  line-height: 1.15;
  letter-spacing: -0.03em;
}

h2 {
  margin: 0 0 0.7rem;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
}

p {
  margin: 0.5rem 0 0;
  color: var(--muted);
  line-height: 1.68;
}

.mbw-hero p {
  max-width: 780px;
  color: var(--soft);
  font-size: .93rem;
}

.mbw-actions {
  display: flex;
  gap: 0.9rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}

.mbw-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin: 1rem 0;
}

.mbw-card {
  padding: 1.35rem;
}

.mbw-wide {
  margin-top: 1rem;
}

.mbw-big {
  margin: 0.25rem 0;
  color: var(--text);
  font-size: 1.5rem;
  line-height: 1;
  font-weight: 950;
  letter-spacing: -0.06em;
}

.mbw-ok {
  color: var(--ok);
  font-weight: 850;
}

.mbw-bad {
  color: var(--danger);
  font-weight: 850;
}

pre {
  overflow: auto;
  margin: 1rem 0 0;
  padding: 1rem;
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: var(--radius-lg);
  color: #ffd8dc;
  background: rgba(0,0,0,0.28);
  white-space: pre-wrap;
}

.mbw-login-panel {
  width: min(560px, 100%);
  margin: 2.4rem auto;
  padding: 1.4rem 1.6rem;
}

.mbw-login-panel h1 {
  font-size: 1.15rem;
  line-height: 1.15;
  letter-spacing: -0.03em;
}

.mbw-form {
  display: grid;
  gap: 1rem;
  margin-top: 1.4rem;
}

.mbw-form label {
  display: grid;
  gap: 0.45rem;
  color: var(--soft);
  font-weight: 650;
}

.mbw-form input {
  width: 100%;
  min-height: 52px;
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  padding: 0.9rem 1rem;
  color: var(--text);
  background: rgba(0,0,0,0.24);
  outline: none;
  font: inherit;
}

.mbw-form input:focus {
  border-color: rgba(115, 215, 255, 0.75);
  box-shadow: 0 0 0 4px rgba(115, 215, 255, 0.12);
}

.mbw-form button {
  width: fit-content;
  min-width: 150px;
  margin-top: 0.25rem;
}

.mbw-alert {
  margin: 1.1rem 0 0;
  padding: 0.9rem 1rem;
  border: 1px solid rgba(255, 143, 155, 0.38);
  border-radius: 16px;
  color: #ffd7dc;
  background: rgba(255, 143, 155, 0.12);
}

@media (max-width: 860px) {
  .mbw-topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .mbw-nav {
    justify-content: flex-start;
  }

  .mbw-grid {
    grid-template-columns: 1fr;
  }

  .mbw-page {
    width: min(100% - 1rem, 1180px);
    padding-top: 1rem;
  }

  .mbw-hero,
  .mbw-card,
  .mbw-login-panel {
    border-radius: 22px;
  }
}

/* mbweb user-space additions */
.mbw-list {
  display: grid;
  gap: 0.7rem;
  margin-top: 1rem;
}

.mbw-list-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  padding: 0.85rem 1rem;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255,255,255,0.045);
}

.mbw-list-row span {
  color: var(--muted);
}

/* mbweb step3 profile channels */
.mbw-kv {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .75rem;
  margin-top: 1rem;
}

.mbw-kv.small {
  grid-template-columns: 1fr;
  gap: .45rem;
}

.mbw-kv div {
  padding: .85rem 1rem;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255,255,255,.045);
}

.mbw-kv span {
  display: block;
  color: var(--muted);
  font-size: .82rem;
  margin-bottom: .25rem;
}

.mbw-kv strong {
  color: var(--text);
  overflow-wrap: anywhere;
}

.mbw-channel-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.mbw-channel-card {
  padding: 1.1rem;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255,255,255,.045);
}

.mbw-channel-card header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: baseline;
  margin-bottom: .5rem;
}

.mbw-channel-card h3 {
  margin: 0;
  font-size: 1.15rem;
}

.mbw-channel-card header span {
  color: var(--accent);
  font-size: .85rem;
}

@media (max-width: 820px) {
  .mbw-kv,
  .mbw-channel-grid {
    grid-template-columns: 1fr;
  }
}

/* mbweb fix: readable key/value profile blocks */
.mbw-kv div {
  display: grid;
  grid-template-columns: minmax(130px, 0.35fr) minmax(0, 1fr);
  align-items: baseline;
  column-gap: 1rem;
  row-gap: 0.25rem;
}

.mbw-kv span {
  margin: 0;
  color: var(--muted);
  font-weight: 650;
}

.mbw-kv strong {
  display: block;
  color: var(--text);
  font-weight: 850;
  overflow-wrap: anywhere;
}

.mbw-kv.small div {
  grid-template-columns: minmax(95px, 0.4fr) minmax(0, 1fr);
}

@media (max-width: 640px) {
  .mbw-kv div,
  .mbw-kv.small div {
    grid-template-columns: 1fr;
  }
}

/* mbweb step4 radio */
.mbw-card a {
  color: var(--accent);
  text-decoration: none;
}

.mbw-card a:hover {
  text-decoration: underline;
}

/* mbweb step5 channel detail */
.mbw-user-table {
  display: grid;
  gap: .55rem;
  margin-top: 1rem;
}

.mbw-user-table-head,
.mbw-user-table-row {
  display: grid;
  grid-template-columns: 1.4fr 1fr .8fr .8fr 1.6fr;
  gap: .75rem;
  align-items: center;
  padding: .8rem 1rem;
  border: 1px solid var(--line);
  border-radius: 14px;
}

.mbw-user-table-head {
  color: var(--muted);
  background: rgba(255,255,255,.035);
  font-size: .85rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.mbw-user-table-row {
  background: rgba(255,255,255,.05);
}

.mbw-user-table-row small {
  display: block;
  color: var(--muted);
  margin-top: .15rem;
}

.mbw-taglist {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-top: 1rem;
}

.mbw-taglist span {
  padding: .45rem .7rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--soft);
  background: rgba(255,255,255,.045);
  font-size: .9rem;
}

@media (max-width: 900px) {
  .mbw-user-table-head {
    display: none;
  }

  .mbw-user-table-row {
    grid-template-columns: 1fr;
  }
}

/* mbweb step6 users */
.mbw-user-table.users .mbw-user-table-head,
.mbw-user-table.users .mbw-user-table-row {
  grid-template-columns: 1.25fr 1fr .55fr .65fr .9fr 1.35fr;
}

@media (max-width: 1000px) {
  .mbw-user-table.users .mbw-user-table-head {
    display: none;
  }

  .mbw-user-table.users .mbw-user-table-row {
    grid-template-columns: 1fr;
  }
}

/* mbweb users dashboard cleanup */
.mbw-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: .8rem;
}

.mbw-section-head h2 {
  margin-bottom: .25rem;
}

.mbw-section-head p {
  margin: 0;
}

.mbw-count-badge {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: .45rem .8rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--accent);
  background: rgba(115, 215, 255, .08);
  font-weight: 800;
}

.mbw-role-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .85rem;
  margin-top: 1rem;
}

.mbw-role-pill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .8rem;
  padding: .9rem 1rem;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255,255,255,.045);
}

.mbw-role-pill span {
  color: var(--muted);
  font-weight: 750;
}

.mbw-role-pill strong {
  color: var(--text);
  font-size: 1.05rem;
  line-height: 1;
}

.mbw-users-dashboard {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .9rem;
}

.mbw-user-card {
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 20px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.045), rgba(255,255,255,.02)),
    rgba(255,255,255,.035);
}

.mbw-user-card header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: .85rem;
  margin-bottom: .9rem;
}

.mbw-user-card h3 {
  margin: 0;
  font-size: 1.15rem;
  letter-spacing: -.025em;
}

.mbw-user-card header p {
  margin: .15rem 0 0;
  font-size: .9rem;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.mbw-role-chip {
  flex: 0 0 auto;
  padding: .38rem .62rem;
  border: 1px solid rgba(115, 215, 255, .28);
  border-radius: 999px;
  color: var(--accent);
  background: rgba(115, 215, 255, .08);
  font-size: .82rem;
  font-weight: 850;
}

.mbw-user-meta {
  display: grid;
  grid-template-columns: .55fr .55fr 1fr 1.65fr;
  gap: .55rem;
}

.mbw-user-meta div {
  min-width: 0;
  padding: .65rem .7rem;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 14px;
  background: rgba(0,0,0,.14);
}

.mbw-user-meta span {
  display: block;
  color: var(--muted);
  font-size: .76rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-bottom: .25rem;
}

.mbw-user-meta strong {
  display: block;
  color: var(--text);
  font-size: .92rem;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

@media (max-width: 1100px) {
  .mbw-users-dashboard {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .mbw-section-head {
    flex-direction: column;
  }

  .mbw-role-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .mbw-user-meta {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 520px) {
  .mbw-role-grid,
  .mbw-user-meta {
    grid-template-columns: 1fr;
  }

  .mbw-user-card header {
    flex-direction: column;
  }
}

/* mbweb users real table v3 */
.mbw-table-wrap {
  width: 100%;
  overflow-x: auto;
  margin-top: 1rem;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(0,0,0,.18);
}

.mbw-data-table {
  width: 100%;
  min-width: 1050px;
  border-collapse: collapse;
  font-size: .95rem;
}

.mbw-data-table thead {
  background: rgba(255,255,255,.075);
}

.mbw-data-table th {
  padding: .9rem 1rem;
  color: var(--muted);
  text-align: left;
  font-size: .78rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .065em;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

.mbw-data-table td {
  padding: .85rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,.075);
  vertical-align: middle;
}

.mbw-data-table tbody tr:nth-child(even) {
  background: rgba(255,255,255,.03);
}

.mbw-data-table tbody tr:hover {
  background: rgba(115, 215, 255, .07);
}

.mbw-data-table tbody tr:last-child td {
  border-bottom: 0;
}

.mbw-user-main strong {
  display: block;
  color: var(--text);
  font-size: 1rem;
  font-weight: 900;
}

.mbw-user-main small {
  display: block;
  margin-top: .18rem;
  color: var(--muted);
  font-size: .78rem;
}

.mbw-muted-cell {
  color: var(--soft);
  overflow-wrap: anywhere;
}

.mbw-number-cell {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 850;
}

.mbw-date-cell {
  color: var(--soft);
  white-space: nowrap;
  font-size: .9rem;
}

.mbw-status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 48px;
  padding: .32rem .55rem;
  border-radius: 999px;
  font-size: .78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.mbw-status-pill.ok {
  color: #062015;
  background: var(--ok);
}

.mbw-status-pill.bad {
  color: #2b0810;
  background: var(--danger);
}

.mbw-users-table .mbw-role-chip {
  white-space: nowrap;
}

/* mbweb step7 dashboard roles */
.mbw-dashboard-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .9rem;
  margin-top: 1rem;
}

.mbw-dashboard-tile {
  display: block;
  min-height: 128px;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 20px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,.02)),
    rgba(255,255,255,.035);
  color: var(--text);
  text-decoration: none;
  transition: transform .12s ease, border-color .12s ease, background .12s ease;
}

.mbw-dashboard-tile:hover {
  transform: translateY(-1px);
  border-color: rgba(115,215,255,.32);
  background: rgba(115,215,255,.07);
  text-decoration: none;
}

.mbw-dashboard-tile strong {
  display: block;
  margin-bottom: .45rem;
  color: var(--text);
  font-size: 1.15rem;
  font-weight: 900;
}

.mbw-dashboard-tile span {
  display: block;
  color: var(--muted);
  line-height: 1.45;
}

.mbw-dashboard-tile.elevated {
  border-color: rgba(183,156,255,.28);
}

.mbw-dashboard-tile.owner {
  border-color: rgba(114,240,191,.28);
}

@media (max-width: 920px) {
  .mbw-dashboard-grid {
    grid-template-columns: 1fr;
  }
}

/* mbweb navbar polish */
.mbw-topbar {
  min-height: 86px;
}

.mbw-nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 1rem;
  flex-wrap: wrap;
}

.mbw-nav-links,
.mbw-nav-session {
  display: flex;
  align-items: center;
  gap: .55rem;
  flex-wrap: wrap;
}

.mbw-nav-links {
  padding: .35rem;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 999px;
  background: rgba(255,255,255,.035);
}

.mbw-nav-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: .55rem .82rem;
  border: 1px solid transparent;
  border-radius: 999px;
  color: var(--muted);
  text-decoration: none;
  font-weight: 750;
  line-height: 1;
  transition: background .15s ease, color .15s ease, border-color .15s ease, transform .12s ease;
}

.mbw-nav-pill:hover {
  color: var(--text);
  background: rgba(255,255,255,.075);
  border-color: rgba(255,255,255,.10);
  text-decoration: none;
  transform: translateY(-1px);
}

.mbw-nav-pill.elevated {
  color: var(--accent);
  background: rgba(115,215,255,.07);
  border-color: rgba(115,215,255,.16);
}

.mbw-nav-session {
  padding: .35rem;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 999px;
  background: rgba(0,0,0,.16);
}

.mbw-user-badge,
.mbw-role-badge,
.mbw-logout-btn,
.mbw-login-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  border-radius: 999px;
  line-height: 1;
  white-space: nowrap;
}

.mbw-user-badge {
  gap: .45rem;
  padding: .55rem .82rem;
  color: var(--text);
  background: rgba(255,255,255,.065);
  border: 1px solid rgba(255,255,255,.10);
}

.mbw-user-badge strong {
  font-weight: 900;
}

.mbw-user-dot {
  width: .52rem;
  height: .52rem;
  border-radius: 999px;
  background: var(--accent3);
  box-shadow: 0 0 0 4px rgba(114,240,191,.12);
}

.mbw-role-badge {
  padding: .55rem .78rem;
  font-size: .84rem;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: .045em;
  border: 1px solid rgba(255,255,255,.10);
}

.mbw-role-badge.owner {
  color: #06180f;
  background: linear-gradient(135deg, var(--accent3), #c4ffe3);
  border-color: rgba(114,240,191,.55);
}

.mbw-role-badge.master {
  color: #10091f;
  background: linear-gradient(135deg, var(--accent2), #e2d4ff);
  border-color: rgba(183,156,255,.55);
}

.mbw-role-badge.admin {
  color: #06111d;
  background: linear-gradient(135deg, var(--accent), #c9f1ff);
  border-color: rgba(115,215,255,.55);
}

.mbw-role-badge.user {
  color: var(--text);
  background: rgba(255,255,255,.08);
  border-color: rgba(255,255,255,.14);
}

.mbw-logout-btn {
  min-height: 38px;
  padding: .55rem .9rem;
  border: 1px solid rgba(255,255,255,.13);
  color: var(--muted);
  background: rgba(255,255,255,.045);
  text-decoration: none;
  font-weight: 800;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}

.mbw-logout-btn:hover {
  color: var(--text);
  background: rgba(255,255,255,.09);
  border-color: rgba(255,255,255,.20);
  text-decoration: none;
}

@media (max-width: 980px) {
  .mbw-topbar {
    align-items: flex-start;
  }

  .mbw-nav {
    width: 100%;
    justify-content: flex-start;
  }

  .mbw-nav-links,
  .mbw-nav-session {
    border-radius: 22px;
  }
}

@media (max-width: 560px) {
  .mbw-nav-links,
  .mbw-nav-session {
    width: 100%;
    justify-content: flex-start;
  }

  .mbw-nav-pill,
  .mbw-user-badge,
  .mbw-role-badge,
  .mbw-logout-btn,
  .mbw-login-btn {
    min-height: 36px;
    padding: .52rem .7rem;
  }
}

/* mbweb channels real table */
.mbw-channels-table {
  min-width: 1120px;
}

.mbw-channel-main strong {
  display: block;
  color: var(--accent);
  font-size: 1rem;
  font-weight: 950;
}

.mbw-channel-main small {
  display: block;
  margin-top: .18rem;
  color: var(--muted);
  font-size: .78rem;
}

.mbw-channel-desc {
  max-width: 420px;
  color: var(--soft);
  overflow-wrap: anywhere;
  line-height: 1.35;
}

.mbw-table-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: .42rem .72rem;
  border: 1px solid rgba(115,215,255,.24);
  border-radius: 999px;
  color: var(--accent);
  background: rgba(115,215,255,.08);
  text-decoration: none;
  font-weight: 850;
  white-space: nowrap;
}

.mbw-table-action:hover {
  border-color: rgba(115,215,255,.44);
  background: rgba(115,215,255,.14);
  text-decoration: none;
}

.mbw-channels-table th:nth-child(3),
.mbw-channels-table th:nth-child(5),
.mbw-channels-table th:nth-child(7),
.mbw-channels-table td:nth-child(3),
.mbw-channels-table td:nth-child(5),
.mbw-channels-table td:nth-child(7) {
  text-align: center;
}

@media (max-width: 760px) {
  .mbw-channels-table {
    min-width: 1050px;
  }
}

/* mbweb radio real table */
.mbw-table-wrap.compact {
  margin-top: .8rem;
}

.mbw-radio-table {
  min-width: 1080px;
}

.mbw-radio-current-table {
  min-width: 1080px;
}

.mbw-radio-main strong {
  display: block;
  color: var(--accent);
  font-size: 1rem;
  font-weight: 950;
  white-space: nowrap;
}

.mbw-radio-main small {
  display: block;
  margin-top: .18rem;
  color: var(--muted);
  font-size: .78rem;
  overflow-wrap: anywhere;
}

.mbw-radio-title {
  max-width: 420px;
  color: var(--text);
  font-weight: 800;
  overflow-wrap: anywhere;
  line-height: 1.35;
}

.mbw-radio-table th:nth-child(3),
.mbw-radio-table th:nth-child(4),
.mbw-radio-table th:nth-child(5),
.mbw-radio-table td:nth-child(3),
.mbw-radio-table td:nth-child(4),
.mbw-radio-table td:nth-child(5),
.mbw-radio-current-table th:nth-child(4),
.mbw-radio-current-table th:nth-child(5),
.mbw-radio-current-table th:nth-child(6),
.mbw-radio-current-table td:nth-child(4),
.mbw-radio-current-table td:nth-child(5),
.mbw-radio-current-table td:nth-child(6) {
  text-align: center;
}

@media (max-width: 760px) {
  .mbw-radio-table,
  .mbw-radio-current-table {
    min-width: 1000px;
  }
}

/* mbweb home dashboard table */
.mbw-home-session-table {
  min-width: 1050px;
}

.mbw-home-channels-table {
  min-width: 1050px;
}

.mbw-home-system-table {
  min-width: 760px;
}

.mbw-home-session-table th:nth-child(4),
.mbw-home-session-table th:nth-child(5),
.mbw-home-session-table td:nth-child(4),
.mbw-home-session-table td:nth-child(5),
.mbw-home-channels-table th:nth-child(3),
.mbw-home-channels-table th:nth-child(5),
.mbw-home-channels-table td:nth-child(3),
.mbw-home-channels-table td:nth-child(5),
.mbw-home-system-table th:nth-child(2),
.mbw-home-system-table td:nth-child(2) {
  text-align: center;
}

.mbw-table-wrap.compact .mbw-data-table td {
  padding-top: .75rem;
  padding-bottom: .75rem;
}

@media (max-width: 760px) {
  .mbw-home-session-table,
  .mbw-home-channels-table {
    min-width: 980px;
  }

  .mbw-home-system-table {
    min-width: 720px;
  }
}


/* ═══════════════════════════════════════════════════════════════════════════
   Filter bar — used on /commands, /quotes, future listing pages
   ═══════════════════════════════════════════════════════════════════════════ */

.mbw-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
  align-items: center;
  padding: .2rem 0;
}

.mbw-search-input {
  flex: 1 1 220px;
  min-width: 160px;
  padding: .55rem .9rem;
  background: var(--bg2);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  color: var(--text);
  font-size: .93rem;
  outline: none;
  transition: border-color .15s;
}

.mbw-search-input:focus {
  border-color: var(--accent);
}

.mbw-search-input::placeholder {
  color: var(--muted);
}

.mbw-select {
  padding: .52rem .8rem;
  background: var(--bg2);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  color: var(--text);
  font-size: .93rem;
  cursor: pointer;
  outline: none;
}

.mbw-select:focus {
  border-color: var(--accent);
}

.mbw-btn-primary {
  padding: .52rem 1.1rem;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: .9rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  transition: opacity .15s;
}

.mbw-btn-primary:hover { opacity: .85; }

.mbw-btn-secondary {
  padding: .52rem 1.1rem;
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  font-size: .9rem;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  transition: border-color .15s, color .15s;
}

.mbw-btn-secondary:hover {
  border-color: var(--accent);
  color: var(--text);
}

/* ═══════════════════════════════════════════════════════════════════════════
   Commands table
   ═══════════════════════════════════════════════════════════════════════════ */

.mbw-commands-table {
  min-width: 900px;
}

.mbw-cmd-action {
  font-family: ui-monospace, 'Cascadia Code', monospace;
  font-size: .82rem;
  color: var(--muted);
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ═══════════════════════════════════════════════════════════════════════════
   Quotes list
   ═══════════════════════════════════════════════════════════════════════════ */

.mbw-quotes-list {
  display: flex;
  flex-direction: column;
  gap: .9rem;
  margin-top: .6rem;
}

.mbw-quote-card {
  background: var(--bg2);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: .9rem 1.1rem;
}

.mbw-quote-body {
  font-size: .97rem;
  color: var(--text);
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}

.mbw-quote-meta {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-top: .5rem;
  font-size: .78rem;
  color: var(--muted);
}

.mbw-quote-id {
  font-weight: 700;
  color: var(--accent);
}

.mbw-quote-channel {
  background: var(--bg1);
  padding: .1rem .45rem;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
}

.mbw-quote-author  { color: var(--soft); }
.mbw-quote-date    { margin-left: auto; }

/* ═══════════════════════════════════════════════════════════════════════════
   Pagination bar
   ═══════════════════════════════════════════════════════════════════════════ */

.mbw-pagination {
  display: flex;
  align-items: center;
  gap: .6rem;
  justify-content: center;
  margin: .8rem 0;
}

.mbw-page-btn {
  padding: .4rem .85rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  color: var(--text);
  text-decoration: none;
  font-size: .88rem;
  transition: border-color .15s;
}

.mbw-page-btn:hover:not(.disabled) { border-color: var(--accent); }
.mbw-page-btn.disabled { color: var(--muted); cursor: default; }

.mbw-page-info {
  font-size: .88rem;
  color: var(--muted);
}

/* ═══════════════════════════════════════════════════════════════════════════
   Metrics grid (dashboard bot status)
   ═══════════════════════════════════════════════════════════════════════════ */

.mbw-metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: .6rem;
  margin: .8rem 0 .6rem;
}

.mbw-metric-tile {
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: .7rem .9rem;
  display: flex;
  flex-direction: column;
  gap: .25rem;
}

.mbw-metric-tile span {
  font-size: .75rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .04em;
}

.mbw-metric-tile strong {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.mbw-metric-tile.ok  { border-color: var(--success, #2ea043); }
.mbw-metric-tile.ok strong { color: var(--success, #3fb950); }

.mbw-metric-tile.bad { border-color: var(--danger, #da3633); }
.mbw-metric-tile.bad strong { color: var(--danger, #f85149); }

.mbw-metric-tile.warn { border-color: var(--warn, #d29922); }
.mbw-metric-tile.warn strong { color: var(--warn, #e3b341); }

.mbw-muted-small {
  font-size: .8rem;
  color: var(--muted);
  margin-top: .3rem;
}

.mbw-muted-small a {
  color: var(--accent);
  text-decoration: none;
}

.mbw-count-badge.ok  { background: rgba(46,160,67,.18); color: #3fb950; }
.mbw-count-badge.bad { background: rgba(218,54,51,.18); color: #f85149; }

/* =============================================================================
   Network topology page
   ============================================================================= */

.mbw-network-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1rem;
  margin-top: .8rem;
}

.mbw-network-card {
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.mbw-network-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .75rem 1rem;
  background: var(--bg1);
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
  gap: .4rem;
}

.mbw-network-header h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}

.mbw-server-list {
  padding: .5rem 0;
}

.mbw-server-row {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .45rem 1rem;
  border-bottom: 1px solid var(--line);
  font-size: .88rem;
}

.mbw-server-row:last-child { border-bottom: none; }

.mbw-server-host {
  font-family: ui-monospace, 'Cascadia Code', monospace;
  color: var(--text);
  font-weight: 600;
  flex: 1;
}

.mbw-server-port {
  font-family: ui-monospace, 'Cascadia Code', monospace;
  color: var(--accent);
  font-size: .82rem;
}

.mbw-server-id {
  color: var(--muted);
  font-size: .78rem;
  margin-left: auto;
}

/* Error stack trace (dev mode only) */
.mbw-error-stack {
  margin-top: 1rem;
  padding: .8rem 1rem;
  background: var(--bg1);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  font-family: ui-monospace, 'Cascadia Code', monospace;
  font-size: .78rem;
  color: var(--danger, #f85149);
  white-space: pre-wrap;
  word-break: break-all;
  max-height: 300px;
  overflow-y: auto;
}

/* ---------------------------------------------------------------------------
   Readability compact pass — 2026-05-10
   Keep the visual identity, but reduce oversized text/padding in dashboards
   and dense tables.
--------------------------------------------------------------------------- */

body {
  font-size: 15px;
}

.mbw-page {
  padding: 2.1rem 0 3rem;
}

.mbw-topbar {
  padding-top: 0.65rem;
  padding-bottom: 0.65rem;
}

.mbw-brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 13px;
}

.mbw-nav {
  font-size: 0.88rem;
  gap: 0.65rem;
}

.mbw-login-btn,
.mbw-primary,
.mbw-secondary,
button {
  min-height: 38px;
  padding: 0.58rem 0.85rem;
}

.mbw-hero {
  padding: 1.1rem 1.25rem;
}

h1 {
  font-size: 1.12rem;
  margin-bottom: 0.7rem;
}

h2 {
  font-size: 1.02rem;
}

p {
  line-height: 1.55;
}

.mbw-card {
  padding: 1.05rem;
}

.mbw-big {
  font-size: 1.28rem;
}

.mbw-data-table {
  font-size: 0.86rem;
  min-width: 920px;
}

.mbw-data-table th {
  padding: 0.66rem 0.78rem;
  font-size: 0.70rem;
}

.mbw-data-table td {
  padding: 0.62rem 0.78rem;
}

.mbw-user-main strong,
.mbw-radio-main strong {
  font-size: 0.9rem;
}

.mbw-user-main small,
.mbw-radio-main small,
.mbw-muted-cell,
.mbw-date-cell {
  font-size: 0.76rem;
}

.mbw-role-chip,
.mbw-status-pill,
.mbw-count-badge,
.mbw-table-action {
  font-size: 0.74rem;
}

.mbw-form input,
.mbw-search-input,
.mbw-select {
  min-height: 40px;
  padding: 0.62rem 0.75rem;
  font-size: 0.86rem;
}

.mbw-metric-tile {
  padding: 0.55rem 0.7rem;
}

.mbw-metric-tile strong {
  font-size: 1rem;
}

.mbw-metric-tile span {
  font-size: 0.68rem;
}
