/* Hubleep mailbox setup hub — v8 */

body.page-webmail-hub {
  display: block;
  margin: 0;
  padding: 0;
  min-height: 100dvh;
  font-family: "Sora", system-ui, sans-serif;
  color: var(--text);
  background-color: var(--bg);
  background-image:
    radial-gradient(ellipse 80% 50% at 0% -20%, var(--grad-1), transparent),
    radial-gradient(ellipse 60% 40% at 100% 0%, var(--grad-2), transparent),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-end) 100%);
  overflow-x: hidden;
}

body.page-webmail-hub .theme-toggle {
  display: none;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.hub-app {
  width: 100%;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

/* ── Header ── */
.hub-topbar {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0  clamp(1rem, 3vw, 2.25rem);
  min-height: 3.25rem;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.8) inset, 0 4px 24px rgba(15, 23, 42, 0.06);
  position: sticky;
  top: 0;
  z-index: 100;
  box-sizing: border-box;
}

html[data-theme="dark"] .hub-topbar {
  background: var(--bg-card);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset, 0 8px 32px rgba(0, 0, 0, 0.35);
}

.hub-topbar-start,
.hub-topbar-end {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
}

.hub-topbar-end {
  margin-left: auto;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

/* Topbar action cluster — compact */
.hub-topbar-cluster {
  display: inline-flex;
  align-items: center;
  gap: 0.125rem;
  padding: 0.125rem;
  border-radius: 999px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

html[data-theme="dark"] .hub-topbar-cluster {
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.hub-topbar-divider {
  width: 1px;
  height: 1.25rem;
  margin: 0 0.05rem;
  background: var(--border);
  flex-shrink: 0;
}

.hub-user-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  max-width: min(14.5rem, 38vw);
  margin: 0;
  padding: 0.125rem 0.35rem 0.125rem 0.125rem;
  font-family: inherit;
  text-align: left;
  color: var(--text);
  background: transparent;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  transition: background 0.15s ease;
}

.hub-user-chip:hover {
  background: color-mix(in srgb, var(--brand-indigo) 7%, transparent);
}

.hub-user-chip:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--brand-indigo) 45%, transparent);
  outline-offset: 2px;
}

.hub-user-chip[hidden] {
  display: none !important;
}

.hub-user-chip__avatar-wrap {
  position: relative;
  flex-shrink: 0;
  width: 1.75rem;
  height: 1.75rem;
}

.hub-user-chip__status {
  position: absolute;
  right: -1px;
  bottom: -1px;
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 999px;
  background: #22c55e;
  border: 1.5px solid var(--bg-card);
}

.hub-user-chip__chev {
  display: none;
}

.hub-topbar-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  height: 1.875rem;
  margin: 0;
  padding: 0 0.55rem;
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1;
  color: var(--text);
  background: transparent;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  transition: background 0.15s, color 0.15s;
}

.hub-topbar-pill:hover {
  color: var(--brand-indigo);
  background: color-mix(in srgb, var(--brand-indigo) 8%, transparent);
}

.hub-topbar-pill--icon {
  width: 1.875rem;
  min-width: 1.875rem;
  padding: 0;
}

.hub-topbar-pill--icon .material-symbols-outlined {
  font-size: 1.05rem;
  line-height: 1;
}

.hub-topbar-pill--logout .material-symbols-outlined {
  font-size: 0.95rem !important;
}

.hub-topbar-pill-label {
  white-space: nowrap;
}

.hub-brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.65rem 0;
  text-decoration: none;
  color: inherit;
  min-width: 0;
}

.hub-brand:hover .hub-brand-name {
  color: var(--brand-indigo);
}

/* Logo only — no box, no gradient behind image */
.hub-brand-logo {
  display: block;
  width: 3.1rem;
  height: auto;
  max-height: 1.9rem;
  flex-shrink: 0;
  object-fit: contain;
}

.hub-brand-logo--dark { display: none; }

html[data-theme="dark"] .hub-brand-logo--light { display: none; }
html[data-theme="dark"] .hub-brand-logo--dark { display: block; }

.hub-brand-text {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.1rem;
  min-width: 0;
}

.hub-brand-name {
  font-family: "Bricolage Grotesque", sans-serif;
  font-weight: 800;
  font-size: 1.125rem;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--text);
  transition: color 0.15s ease;
}

.hub-brand-tag {
  display: block;
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  line-height: 1.2;
}

.hub-account-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 0;
  min-width: 0;
  line-height: 1.1;
}

.hub-account-name {
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
  max-width: 8.5rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hub-account-email {
  font-size: 0.625rem;
  font-weight: 500;
  line-height: 1.15;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 8.5rem;
}

/* Legacy hub-icon-btn / hub-btn--header — other pages may still use them */
.hub-icon-btn {
  width: 2.5rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 0.6rem;
  background: var(--input-bg);
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.hub-icon-btn:hover {
  border-color: var(--brand-indigo);
  color: var(--brand-indigo);
  background: rgba(79, 70, 229, 0.06);
}

.hub-btn--header {
  padding: 0 1rem;
  height: 2.5rem;
  font-size: 0.8125rem;
  border-radius: 0.6rem;
  background: var(--input-bg);
  border: 1px solid var(--border);
}

.hub-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: 0.65rem;
  border: none;
  cursor: pointer;
  transition: transform 0.1s, box-shadow 0.2s;
}

.hub-btn:active { transform: scale(0.98); }

.hub-btn--ghost {
  background: var(--bg-card);
  color: var(--text);
  border: 1px solid var(--border);
}

.hub-btn--ghost:hover {
  border-color: var(--brand-indigo);
}

.hub-btn--soft {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text);
}

.hub-btn--soft:hover {
  border-color: var(--brand-indigo);
  color: var(--brand-indigo);
}

.hub-btn--primary {
  background: linear-gradient(135deg, #4f46e5, #6366f1 45%, #0ea5e9);
  color: #fff;
  box-shadow: 0 4px 20px rgba(79, 70, 229, 0.45);
}

.hub-btn--primary:hover {
  box-shadow: 0 6px 26px rgba(79, 70, 229, 0.55);
}

.hub-btn--lg {
  padding: 0.75rem 1.35rem;
  font-size: 0.95rem;
}

/* ── Welcome ── */
.hub-welcome {
  position: relative;
  width: 100%;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
  background: var(--bg-card);
}

.hub-welcome-glow {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 55% 120% at 0% 50%, rgba(79, 70, 229, 0.14), transparent 58%),
    radial-gradient(ellipse 40% 90% at 100% 20%, rgba(14, 165, 233, 0.1), transparent 55%);
  pointer-events: none;
}

.hub-welcome-inner {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.15rem 2rem;
  padding: 1.35rem clamp(1rem, 3vw, 2.25rem) 1.45rem;
  box-sizing: border-box;
}

.hub-welcome-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0 0 0.55rem;
  padding: 0.28rem 0.65rem 0.28rem 0.5rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #15803d;
  background: color-mix(in srgb, #22c55e 12%, var(--bg-card));
  border: 1px solid color-mix(in srgb, #22c55e 28%, var(--border));
}

html[data-theme="dark"] .hub-welcome-badge {
  color: #86efac;
}

.hub-welcome-badge-dot {
  width: 0.42rem;
  height: 0.42rem;
  border-radius: 999px;
  background: #22c55e;
  box-shadow: 0 0 0 3px color-mix(in srgb, #22c55e 22%, transparent);
}

.hub-welcome h1 {
  margin: 0 0 0.35rem;
  font-family: "Bricolage Grotesque", sans-serif;
  font-size: clamp(1.45rem, 2.4vw, 1.95rem);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.12;
}

.hub-welcome-sub {
  margin: 0;
  max-width: 36rem;
  font-size: 0.92rem;
  color: var(--muted);
  line-height: 1.55;
}

.hub-welcome-cta {
  flex-shrink: 0;
  min-height: 2.75rem;
  padding-inline: 1.35rem;
}

/* ── Layout ── */
.hub-shell {
  width: 100%;
  flex: 1;
  display: grid;
  grid-template-columns: minmax(15.5rem, 20rem) minmax(0, 1fr);
  min-height: calc(100dvh - 10.5rem);
}

/* ── Sidebar navigation ── */
.hub-tabs {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 1.25rem clamp(0.85rem, 1.5vw, 1.15rem) 1.5rem;
  background:
    linear-gradient(180deg, rgba(79, 70, 229, 0.04) 0%, transparent 28%),
    var(--input-bg);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  overflow-x: hidden;
}

html[data-theme="dark"] .hub-tabs {
  background:
    linear-gradient(180deg, rgba(99, 102, 241, 0.08) 0%, transparent 35%),
    var(--input-bg);
}

.hub-tabs-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.hub-tabs-label {
  margin: 0 0 0.5rem 0.15rem;
  padding: 0 0.35rem;
  font-size: 0.62rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  opacity: 0.85;
}

.hub-tabs-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.hub-tabs-divider {
  height: 1px;
  margin: 1rem 0.25rem;
  background: linear-gradient(90deg, transparent, var(--border) 20%, var(--border) 80%, transparent);
}

.hub-tab {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.65rem 0.7rem 0.65rem 0.65rem;
  border: 1px solid transparent;
  border-radius: 0.75rem;
  background: transparent;
  color: var(--text);
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  transition:
    background 0.18s ease,
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    transform 0.12s ease;
}

.hub-tab::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%) scaleY(0);
  width: 3px;
  height: 55%;
  border-radius: 0 4px 4px 0;
  background: linear-gradient(180deg, var(--brand-indigo), var(--brand-blue));
  transition: transform 0.2s ease, height 0.2s ease;
}

.hub-tab:hover {
  background: rgba(255, 255, 255, 0.65);
  border-color: rgba(79, 70, 229, 0.12);
}

html[data-theme="dark"] .hub-tab:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(129, 140, 248, 0.2);
}

.hub-tab:hover .hub-tab-icon-wrap {
  background: rgba(79, 70, 229, 0.1);
  color: var(--brand-indigo);
}

.hub-tab:focus-visible {
  outline: 2px solid var(--brand-indigo);
  outline-offset: 2px;
}

.hub-tab.is-active {
  background: var(--bg-card);
  border-color: rgba(79, 70, 229, 0.22);
  box-shadow:
    0 1px 2px rgba(15, 23, 42, 0.04),
    0 6px 20px rgba(79, 70, 229, 0.12);
}

.hub-tab.is-active::before {
  transform: translateY(-50%) scaleY(1);
  height: 70%;
}

html[data-theme="dark"] .hub-tab.is-active {
  border-color: rgba(129, 140, 248, 0.35);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.25);
}

.hub-tab-icon-wrap {
  flex-shrink: 0;
  width: 2.35rem;
  height: 2.35rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.6rem;
  background: rgba(15, 23, 42, 0.05);
  color: var(--muted);
  transition: background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

html[data-theme="dark"] .hub-tab-icon-wrap {
  background: rgba(255, 255, 255, 0.06);
}

.hub-tab-icon {
  font-size: 1.2rem;
  font-variation-settings: "FILL" 0, "wght" 500;
}

.hub-tab.is-active .hub-tab-icon-wrap {
  background: linear-gradient(145deg, var(--brand-indigo), #6366f1);
  color: #fff;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.35);
}

.hub-tab.is-active .hub-tab-icon {
  font-variation-settings: "FILL" 1, "wght" 500;
}

.hub-tab-text {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
  flex: 1;
}

.hub-tab-label {
  font-size: 0.84rem;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.hub-tab.is-active .hub-tab-label {
  color: var(--brand-indigo);
}

html[data-theme="dark"] .hub-tab.is-active .hub-tab-label {
  color: #c7d2fe;
}

.hub-tab-desc {
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--muted);
  line-height: 1.2;
}

.hub-tab.is-active .hub-tab-desc {
  color: rgba(79, 70, 229, 0.75);
}

html[data-theme="dark"] .hub-tab.is-active .hub-tab-desc {
  color: rgba(165, 180, 252, 0.75);
}

.hub-panel {
  background:
    linear-gradient(180deg, rgba(79, 70, 229, 0.03) 0%, transparent 12rem),
    var(--input-bg);
  overflow-y: auto;
}

html[data-theme="dark"] .hub-panel {
  background:
    linear-gradient(180deg, rgba(99, 102, 241, 0.06) 0%, transparent 14rem),
    var(--input-bg);
}

.hub-pane {
  display: none;
  padding: clamp(1.25rem, 2vw, 1.75rem) clamp(1rem, 2.5vw, 2rem) 2.75rem;
  animation: hub-in 0.25s ease;
}

.hub-pane-inner {
  max-width: none;
  width: 100%;
}

.hub-pane.is-active { display: block; }

.hub-pane--wide,
.hub-pane--full,
.hub-pane[data-pane="credentials"] {
  max-width: none;
}

@keyframes hub-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.hub-pane-head { margin-bottom: 1.5rem; }

.hub-pane-eyebrow {
  margin: 0 0 0.35rem;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--brand-indigo);
}

html[data-theme="dark"] .hub-pane-eyebrow {
  color: #a5b4fc;
}

.hub-pane-head--toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.25rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
}

.hub-pane-toolbar-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  flex-shrink: 0;
  padding: 0.35rem;
  border-radius: 0.75rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
}

.hub-pane-head h2 {
  margin: 0 0 0.4rem;
  font-family: "Bricolage Grotesque", sans-serif;
  font-size: clamp(1.3rem, 1.8vw, 1.65rem);
  font-weight: 800;
  letter-spacing: -0.02em;
}

.hub-pane-head p {
  margin: 0;
  font-size: 0.95rem;
  color: var(--muted);
  line-height: 1.55;
}

.hub-pane-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.2rem 0.6rem;
  margin-bottom: 0.5rem;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-radius: 999px;
  background: rgba(79, 70, 229, 0.12);
  color: var(--brand-indigo);
}

.hub-pane-card {
  padding: 1.35rem 1.5rem;
  border-radius: 0.9rem;
  background: var(--input-bg);
  border: 1px solid var(--border);
}

.hub-pane-card--guide {
  padding: 1.5rem 1.65rem;
  background: var(--bg-card);
  border-radius: 1rem;
  box-shadow: 0 4px 24px rgba(15, 23, 42, 0.06);
}

/* App setup guides — steps + credentials */
.hub-guide-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  gap: 1.15rem;
  align-items: start;
}

/* Quick setup — full width */
.hub-pane[data-pane="qr-setup"] .hub-pane-inner {
  width: 100%;
  max-width: none;
}

.hub-pane[data-pane="qr-setup"] .hub-pane-head {
  margin-bottom: 1.25rem;
}

.hub-qr-page {
  width: 100%;
  max-width: none;
  padding: clamp(1.35rem, 2vw, 2rem) clamp(1.25rem, 2.5vw, 2.25rem);
  border-radius: 1.125rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  box-shadow:
    0 1px 2px rgba(15, 23, 42, 0.04),
    0 8px 32px rgba(15, 23, 42, 0.06);
  box-sizing: border-box;
}

html[data-theme="dark"] .hub-qr-page {
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
}

.hub-qr-segment {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.4rem;
  margin-bottom: 1.75rem;
  padding: 0.35rem;
  border-radius: 0.85rem;
  background: var(--input-bg);
  border: 1px solid var(--border);
}

.hub-qr-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.7rem 0.75rem;
  border: none;
  border-radius: 0.65rem;
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, box-shadow 0.15s;
}

.hub-qr-tab-icon {
  font-size: 1.2rem;
  line-height: 1;
}

.hub-qr-tab:hover {
  color: var(--text);
  background: rgba(79, 70, 229, 0.05);
}

.hub-qr-tab.is-active {
  color: var(--brand-indigo);
  background: var(--bg-card);
  box-shadow: 0 2px 10px rgba(79, 70, 229, 0.12);
}

.hub-qr-tab.is-active[data-qr-tab="android"] {
  color: #16a34a;
  box-shadow: 0 2px 10px rgba(22, 163, 74, 0.12);
}

.hub-qr-tab.is-active[data-qr-tab="windows"] {
  color: #2563eb;
  box-shadow: 0 2px 10px rgba(37, 99, 235, 0.12);
}

.hub-qr-panels {
  min-height: 12rem;
}

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

.hub-qr-panel.is-active {
  display: block;
  animation: hub-qr-fade 0.22s ease;
}

@keyframes hub-qr-fade {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Setup content */
.hub-setup {
  width: 100%;
}

.hub-setup__top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem 2rem;
  padding-bottom: 1.5rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.hub-setup__intro {
  display: flex;
  gap: 1rem;
  align-items: center;
  min-width: 0;
  flex: 1 1 20rem;
}

.hub-setup__icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3.25rem;
  height: 3.25rem;
  font-size: 1.65rem;
  color: var(--brand-indigo);
  border-radius: 0.85rem;
  background: rgba(79, 70, 229, 0.1);
}

.hub-setup--windows .hub-setup__icon {
  color: #2563eb;
  background: rgba(37, 99, 235, 0.1);
}

.hub-setup__title {
  margin: 0 0 0.3rem;
  font-family: "Bricolage Grotesque", sans-serif;
  font-size: clamp(1.15rem, 1.5vw, 1.35rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--text);
}

.hub-setup__lead {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--muted);
  max-width: 40rem;
}

.hub-setup__btn {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.75rem 1.35rem;
  font-size: 0.9rem;
  text-decoration: none;
  border-radius: 0.65rem;
}

.hub-setup__steps {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.85rem;
}

.hub-setup__steps li {
  margin: 0;
  padding: 1rem 1.1rem 1rem 2.75rem;
  font-size: 0.875rem;
  line-height: 1.55;
  color: var(--text);
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  position: relative;
  counter-increment: hubstep;
}

.hub-setup {
  counter-reset: hubstep;
}

.hub-setup__steps li::before {
  content: counter(hubstep);
  position: absolute;
  left: 1rem;
  top: 1rem;
  width: 1.35rem;
  height: 1.35rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 800;
  border-radius: 50%;
  background: rgba(79, 70, 229, 0.14);
  color: var(--brand-indigo);
}

.hub-setup--windows .hub-setup__steps li::before {
  background: rgba(37, 99, 235, 0.14);
  color: #2563eb;
}

.hub-setup__meta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
  margin-top: 1.25rem;
  padding-top: 1.15rem;
  border-top: 1px solid var(--border);
}

.hub-setup__note {
  margin: 0;
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--muted);
  flex: 1 1 14rem;
}

.hub-setup__foot {
  margin: 0;
  font-size: 0.75rem;
  color: var(--muted);
  white-space: nowrap;
}

/* Phone / QR layout */
.hub-setup--phone .hub-setup__grid {
  display: grid;
  grid-template-columns: minmax(13.5rem, 17rem) minmax(0, 1fr);
  gap: clamp(1.5rem, 3vw, 2.75rem);
  align-items: start;
}

.hub-setup--phone .hub-setup__top {
  display: none;
}

.hub-setup__qr {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  padding: 1.25rem;
  border-radius: 0.85rem;
  background: var(--input-bg);
  border: 1px solid var(--border);
}

.hub-setup__qr-label {
  margin: 0;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.hub-qr-wrap {
  padding: 0.65rem;
  border-radius: 0.65rem;
  background: #fff;
  border: 1px solid var(--border);
  line-height: 0;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.05);
}

.hub-setup--android .hub-qr-wrap {
  border-color: rgba(22, 163, 74, 0.2);
}

.hub-qr-canvas {
  display: block;
  width: 210px !important;
  height: 210px !important;
  border-radius: 0.35rem;
}

.hub-setup__body {
  min-width: 0;
  padding-top: 0.15rem;
}

.hub-setup--phone .hub-setup__title {
  margin: 0 0 0.35rem;
  font-family: "Bricolage Grotesque", sans-serif;
  font-size: clamp(1.2rem, 1.6vw, 1.4rem);
  font-weight: 800;
  letter-spacing: -0.02em;
}

.hub-setup--phone .hub-setup__lead {
  margin: 0 0 1.25rem;
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--muted);
  max-width: none;
}

.hub-setup--phone .hub-setup__steps {
  grid-template-columns: 1fr;
  gap: 0.55rem;
  margin-bottom: 1.15rem;
}

.hub-setup--phone .hub-setup__steps li {
  padding: 0.7rem 1rem 0.7rem 2.5rem;
}

.hub-setup--phone .hub-setup__steps li::before {
  top: 0.65rem;
  left: 0.85rem;
}

.hub-setup--phone .hub-setup__meta-row {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.hub-setup__link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 1rem;
  padding: 0.55rem 1rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--brand-indigo);
  text-decoration: none;
  border-radius: 0.6rem;
  border: 1px solid rgba(79, 70, 229, 0.22);
  background: var(--bg-card);
  transition: background 0.15s, border-color 0.15s;
}

.hub-setup__link:hover {
  background: rgba(79, 70, 229, 0.06);
  border-color: var(--brand-indigo);
  text-decoration: none;
}

.hub-setup__link .material-symbols-outlined {
  font-size: 1.05rem;
}

.hub-qr-loading,
.hub-qr-fail {
  padding: 2rem 1rem;
  text-align: center;
  font-size: 0.875rem;
  color: var(--muted);
}

.hub-qr-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

/* Mobile setup page (Android / Windows QR destination) */
body.page-setup-mobile {
  margin: 0;
  min-height: 100dvh;
  font-family: "Sora", system-ui, sans-serif;
  color: var(--text);
  background-color: var(--bg);
  background-image:
    radial-gradient(ellipse 80% 50% at 50% -15%, rgba(79, 70, 229, 0.14), transparent),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-end, var(--bg)) 100%);
}

.setup-m {
  width: 100%;
  max-width: 32rem;
  margin: 0 auto;
  padding: max(1.25rem, env(safe-area-inset-top)) 1rem max(2rem, env(safe-area-inset-bottom));
  box-sizing: border-box;
}

.setup-m-top {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  margin-bottom: 1rem;
}

.setup-m-top__logo {
  flex-shrink: 0;
  width: 56px;
  height: auto;
}

.setup-m-top__badge {
  display: inline-block;
  margin-bottom: 0.35rem;
  padding: 0.2rem 0.5rem;
  font-size: 0.62rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--brand-indigo);
  background: rgba(79, 70, 229, 0.1);
  border-radius: 0.35rem;
}

.setup-m-top h1 {
  margin: 0 0 0.25rem;
  font-family: "Bricolage Grotesque", sans-serif;
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.setup-m-top p {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--muted);
}

.setup-m-notice {
  display: flex;
  gap: 0.65rem;
  align-items: flex-start;
  margin-bottom: 1rem;
  padding: 0.85rem 0.9rem;
  border-radius: 0.75rem;
  background: rgba(79, 70, 229, 0.06);
  border: 1px solid rgba(79, 70, 229, 0.14);
}

.setup-m-notice--win {
  background: rgba(37, 99, 235, 0.06);
  border-color: rgba(37, 99, 235, 0.14);
}

.setup-m-notice .material-symbols-outlined {
  flex-shrink: 0;
  font-size: 1.15rem;
  color: var(--brand-indigo);
  margin-top: 0.05rem;
}

.setup-m-notice p {
  margin: 0;
  font-size: 0.8125rem;
  line-height: 1.55;
  color: var(--text);
}

.setup-m-apps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.4rem;
  margin-bottom: 1rem;
}

.setup-m-apps__btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  padding: 0.6rem 0.35rem;
  font-family: inherit;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--muted);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 0.65rem;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, box-shadow 0.15s;
}

.setup-m-apps__btn .material-symbols-outlined {
  font-size: 1.2rem;
}

.setup-m-apps__btn.is-active {
  color: var(--brand-indigo);
  border-color: rgba(79, 70, 229, 0.35);
  box-shadow: 0 2px 10px rgba(79, 70, 229, 0.12);
}

.setup-m-guide {
  margin-bottom: 1rem;
  padding: 0.9rem 0;
}

.setup-m-guide__title {
  margin: 0 0 0.65rem;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.setup-m-guide__steps {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.setup-m-guide__steps li {
  display: grid;
  grid-template-columns: 1.5rem minmax(0, 1fr);
  gap: 0.65rem;
  align-items: start;
  font-size: 0.8125rem;
  line-height: 1.5;
}

.setup-m-step__n {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  font-size: 0.7rem;
  font-weight: 800;
  border-radius: 50%;
  background: rgba(79, 70, 229, 0.12);
  color: var(--brand-indigo);
}

.setup-m-copy-all {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  width: 100%;
  margin-bottom: 1rem;
  padding: 0.75rem 1rem;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, #4f46e5, #6366f1);
  border: none;
  border-radius: 0.65rem;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(79, 70, 229, 0.3);
}

.setup-m-copy-all.is-copied {
  background: #16a34a;
  box-shadow: 0 4px 16px rgba(22, 163, 74, 0.3);
}

.setup-m-block {
  margin-bottom: 0.75rem;
  border-radius: 0.85rem;
  border: 1px solid var(--border);
  background: var(--bg-card);
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(15, 23, 42, 0.04);
}

.setup-m-block__title {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
  padding: 0.65rem 0.85rem;
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
  background: var(--input-bg);
  border-bottom: 1px solid var(--border);
}

.setup-m-block__title .material-symbols-outlined {
  font-size: 1rem;
  color: var(--brand-indigo);
}

.setup-m-row {
  display: grid;
  grid-template-columns: 4.75rem minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.35rem 0.4rem;
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid var(--border);
}

.setup-m-row--secret {
  grid-template-columns: 4.75rem minmax(0, 1fr) auto auto;
}

.setup-m-row:last-child {
  border-bottom: none;
}

.setup-m-row__label {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--muted);
}

.setup-m-row__value {
  font-size: 0.84rem;
  font-weight: 600;
  word-break: break-all;
  color: var(--text);
}

.setup-m-row__value--secret {
  letter-spacing: 0.12em;
}

.setup-m-row__copy,
.setup-m-row__reveal {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.1rem;
  height: 2.1rem;
  padding: 0;
  border: none;
  border-radius: 0.45rem;
  background: rgba(79, 70, 229, 0.1);
  color: var(--brand-indigo);
  cursor: pointer;
}

.setup-m-row__reveal {
  background: var(--input-bg);
  border: 1px solid var(--border);
}

.setup-m-row__copy.is-copied {
  background: rgba(22, 163, 74, 0.15);
  color: #16a34a;
}

.setup-m-err,
.setup-m-loading {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

.setup-toast {
  position: fixed;
  bottom: max(1.25rem, env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  padding: 0.6rem 1.15rem;
  border-radius: 2rem;
  background: #0f172a;
  color: #fff;
  font-size: 0.82rem;
  font-weight: 600;
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
  z-index: 50;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.setup-toast.is-visible {
  opacity: 1;
}

@media (max-width: 900px) {
  .hub-qr-segment {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hub-setup__steps {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .hub-qr-page {
    padding: 1.15rem 1rem;
  }

  .hub-qr-tab {
    flex-direction: column;
    gap: 0.2rem;
    font-size: 0.72rem;
    padding: 0.55rem 0.4rem;
  }

  .hub-setup__top {
    flex-direction: column;
    align-items: stretch;
  }

  .hub-setup__btn {
    width: 100%;
    justify-content: center;
  }

  .hub-setup--phone .hub-setup__grid {
    grid-template-columns: 1fr;
  }

  .hub-setup__qr {
    width: 100%;
    max-width: 16rem;
    margin: 0 auto;
  }

  .hub-setup__meta-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .hub-setup__foot {
    white-space: normal;
  }
}

.hub-guide-steps-card {
  padding: 1.25rem 1.35rem;
  border-radius: 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  box-shadow: 0 4px 20px rgba(15, 23, 42, 0.05);
}

.hub-guide-steps-title {
  margin: 0 0 0.85rem;
  font-family: "Bricolage Grotesque", sans-serif;
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.hub-guide-steps {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: guidebrief;
}

.hub-guide-steps li {
  position: relative;
  padding-left: 1.85rem;
  margin-bottom: 0.65rem;
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--text);
  counter-increment: guidebrief;
}

.hub-guide-steps li:last-child {
  margin-bottom: 0;
}

.hub-guide-steps li::before {
  content: counter(guidebrief);
  position: absolute;
  left: 0;
  top: 0.12rem;
  width: 1.35rem;
  height: 1.35rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 800;
  border-radius: 50%;
  background: rgba(79, 70, 229, 0.12);
  color: var(--brand-indigo);
}

.hub-guide-tip {
  margin: 0.85rem 0 0;
  padding: 0.65rem 0.75rem;
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--muted);
  border-radius: 0.55rem;
  background: var(--input-bg);
  border: 1px dashed var(--border);
}

.hub-guide-creds-card {
  padding: 1.15rem 1.25rem;
  border-radius: 1rem;
  background: var(--bg-card);
  border: 1px solid rgba(79, 70, 229, 0.18);
  box-shadow: 0 6px 28px rgba(79, 70, 229, 0.08);
}

.hub-guide-creds-head {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  margin-bottom: 0.9rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.hub-guide-creds-head .material-symbols-outlined {
  font-size: 1.35rem;
  color: var(--brand-indigo);
}

.hub-guide-creds-head h3 {
  margin: 0 0 0.15rem;
  font-family: "Bricolage Grotesque", sans-serif;
  font-size: 1rem;
  font-weight: 800;
}

.hub-guide-creds-head p {
  margin: 0;
  font-size: 0.8rem;
  color: var(--muted);
}

.hub-guide-account {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 0.75rem;
}

.hub-guide-pw-miss {
  margin: 0;
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.45;
}

.hub-guide-server-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.55rem;
  margin-bottom: 0.85rem;
}

.hub-guide-server-box h4 {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  margin: 0 0 0.4rem;
  padding: 0.45rem 0.55rem;
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
  background: var(--input-bg);
  border-radius: 0.45rem 0.45rem 0 0;
}

.hub-guide-server-box h4 .material-symbols-outlined {
  font-size: 0.95rem;
  color: var(--brand-indigo);
}

.hub-guide-kv-list {
  border: 1px solid var(--border);
  border-radius: 0 0 0.45rem 0.45rem;
  overflow: hidden;
}

.hub-guide-kv {
  display: grid;
  grid-template-columns: 4.5rem minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 0.5rem;
  border-bottom: 1px solid var(--border);
  background: var(--input-bg);
}

.hub-guide-kv:last-child {
  border-bottom: none;
}

.hub-guide-kv-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted);
}

.hub-guide-kv-value {
  font-size: 0.8125rem;
  font-weight: 600;
  word-break: break-all;
}

.hub-guide-kv-copy {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 0.35rem;
  background: var(--bg-card);
  color: var(--muted);
  cursor: pointer;
}

.hub-guide-kv-copy:hover {
  border-color: var(--brand-indigo);
  color: var(--brand-indigo);
}

.hub-guide-kv-copy .material-symbols-outlined {
  font-size: 0.9rem;
}

.hub-guide-kv-copy.is-copied {
  border-color: #16a34a;
  color: #16a34a;
}

.hub-guide-copy-all {
  width: 100%;
  justify-content: center;
}

.hub-guide-creds-mount:empty::before {
  content: "Loading credentials…";
  display: block;
  padding: 2rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
  border: 1px dashed var(--border);
  border-radius: 1rem;
}

.hub-pane-card--cta {
  display: flex;
  align-items: center;
  gap: 2rem;
  padding: 1.75rem 2rem;
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.09), rgba(14, 165, 233, 0.05));
  border-color: rgba(79, 70, 229, 0.22);
}

.hub-cta-visual {
  width: 5rem;
  height: 5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 1rem;
  background: linear-gradient(145deg, var(--brand-indigo), var(--brand-blue));
  color: #fff;
  box-shadow: 0 10px 28px rgba(79, 70, 229, 0.35);
  flex-shrink: 0;
}

.hub-cta-visual .material-symbols-outlined { font-size: 2.5rem; }

.hub-pane-card--cta h3 {
  margin: 0 0 0.3rem;
  font-size: 1.15rem;
}

.hub-pane-card--cta p {
  margin: 0 0 1rem;
  font-size: 0.9rem;
  color: var(--muted);
}

/* Steps */
.hub-steps {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: hubstep;
}

.hub-steps li {
  position: relative;
  padding-left: 2.5rem;
  margin-bottom: 0.85rem;
  font-size: 0.95rem;
  line-height: 1.65;
  counter-increment: hubstep;
}

.hub-steps li::before {
  content: counter(hubstep);
  position: absolute;
  left: 0;
  top: 0.1rem;
  width: 1.65rem;
  height: 1.65rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand-indigo), #6366f1);
  color: #fff;
}

.hub-checklist {
  margin: 0;
  padding-left: 1.2rem;
  line-height: 1.7;
}

.hub-checklist li + li { margin-top: 0.5rem; }

.hub-callout {
  margin-top: 1rem;
  padding: 0.9rem 1rem;
  border-radius: 0.65rem;
  font-size: 0.88rem;
  color: var(--muted);
  background: var(--bg-card);
  border: 1px dashed var(--border);
}

.hub-link-btn {
  padding: 0;
  border: none;
  background: none;
  font: inherit;
  font-weight: 600;
  color: var(--brand-indigo);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ── Credentials board ── */
.hub-creds-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  min-height: 12rem;
  padding: 2rem;
  color: var(--muted);
  font-size: 0.95rem;
  border-radius: 1rem;
  background: var(--bg-card);
  border: 1px dashed var(--border);
}

.hub-creds-loading[hidden] { display: none; }

.hub-creds-wrap[hidden] { display: none; }

.hub-creds-board {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.hub-board-section {
  padding: 1.35rem 1.4rem 1.4rem;
  border-radius: 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  box-shadow: 0 4px 28px rgba(15, 23, 42, 0.06);
}

html[data-theme="dark"] .hub-board-section {
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.22);
}

.hub-board-section-head {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  margin-bottom: 1.15rem;
}

.hub-board-section-icon {
  flex-shrink: 0;
  width: 2.5rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.65rem;
  background: linear-gradient(145deg, rgba(79, 70, 229, 0.14), rgba(14, 165, 233, 0.1));
  color: var(--brand-indigo);
}

.hub-board-section-icon--dns {
  background: linear-gradient(145deg, rgba(14, 165, 233, 0.14), rgba(79, 70, 229, 0.08));
}

.hub-board-section-icon .material-symbols-outlined {
  font-size: 1.25rem;
}

.hub-board-section-title {
  margin: 0 0 0.2rem;
  font-family: "Bricolage Grotesque", sans-serif;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.hub-board-section-desc {
  margin: 0;
  font-size: 0.84rem;
  color: var(--muted);
  line-height: 1.45;
}

.hub-account-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.hub-acct-card {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 1.05rem 1.1rem;
  border-radius: 0.8rem;
  background: var(--input-bg);
  border: 1px solid var(--border);
  min-width: 0;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.hub-acct-card:hover {
  border-color: rgba(79, 70, 229, 0.28);
  box-shadow: 0 4px 16px rgba(79, 70, 229, 0.08);
}

.hub-acct-card-icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 0.65rem;
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.12), rgba(14, 165, 233, 0.08));
  color: var(--brand-indigo);
}

.hub-acct-card-icon .material-symbols-outlined {
  font-size: 1.35rem;
}

.hub-acct-card-icon--pw {
  background: linear-gradient(135deg, rgba(234, 88, 12, 0.1), rgba(245, 158, 11, 0.08));
  color: #c2410c;
}

html[data-theme="dark"] .hub-acct-card-icon--pw {
  color: #fb923c;
}

.hub-acct-card-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.hub-acct-card-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
}

.hub-acct-card-value {
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  word-break: break-all;
  line-height: 1.4;
  color: var(--text);
  letter-spacing: -0.01em;
}

.hub-acct-card-hint {
  margin-top: 0.15rem;
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.4;
}

.hub-acct-card-miss {
  margin: 0;
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.5;
}

.hub-acct-card-miss strong {
  color: var(--text);
}

.hub-pw-field {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.1rem;
}

.hub-pw-value {
  display: inline-block;
  padding: 0.35rem 0.65rem;
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--text);
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: 0.45rem;
  min-width: 7.5rem;
}

.hub-pw-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.hub-acct-btn {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 0.45rem;
  background: var(--input-bg);
  color: var(--muted);
  cursor: pointer;
  transition: border-color 0.12s, color 0.12s, background 0.12s;
}

.hub-acct-btn:hover {
  border-color: var(--brand-indigo);
  color: var(--brand-indigo);
  background: rgba(79, 70, 229, 0.06);
}

.hub-acct-btn .material-symbols-outlined {
  font-size: 1.15rem;
}

.hub-acct-btn.is-copied,
.hub-kv-copy.is-copied {
  border-color: #16a34a;
  color: #16a34a;
  background: rgba(22, 163, 74, 0.1);
}

/* IMAP / SMTP panels */
.hub-server-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
}

.hub-server-panel {
  border-radius: 0.8rem;
  border: 1px solid var(--border);
  background: var(--input-bg);
  overflow: hidden;
}

.hub-server-panel-title {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
  padding: 0.65rem 0.9rem;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  background: rgba(15, 23, 42, 0.03);
  border-bottom: 1px solid var(--border);
}

html[data-theme="dark"] .hub-server-panel-title {
  background: rgba(255, 255, 255, 0.04);
}

.hub-server-panel-title .material-symbols-outlined {
  font-size: 1rem;
  color: var(--brand-indigo);
}

.hub-server-panel--imap .hub-server-panel-title .material-symbols-outlined {
  color: #2563eb;
}

.hub-server-panel--smtp .hub-server-panel-title .material-symbols-outlined {
  color: #7c3aed;
}

.hub-kv-list {
  display: flex;
  flex-direction: column;
}

.hub-kv-row {
  display: grid;
  grid-template-columns: 6.5rem minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.5rem 0.65rem;
  padding: 0.65rem 0.85rem;
  border-bottom: 1px solid var(--border);
}

.hub-kv-row:last-child {
  border-bottom: none;
}

.hub-kv-row:hover {
  background: rgba(79, 70, 229, 0.04);
}

.hub-kv-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  line-height: 1.3;
}

.hub-kv-mid {
  min-width: 0;
}

.hub-kv-value {
  display: block;
  width: 100%;
  padding: 0.3rem 0.5rem;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 0.4rem;
  word-break: break-all;
  box-sizing: border-box;
}

.hub-kv-copy {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 0.4rem;
  background: var(--bg-card);
  color: var(--muted);
  cursor: pointer;
  transition: border-color 0.12s, color 0.12s, background 0.12s;
}

.hub-kv-copy:hover {
  border-color: var(--brand-indigo);
  color: var(--brand-indigo);
}

.hub-kv-copy .material-symbols-outlined {
  font-size: 1rem;
}

.hub-email-banner {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  margin-bottom: 1.25rem;
  border-radius: 0.85rem;
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.1), rgba(14, 165, 233, 0.06));
  border: 1px solid rgba(79, 70, 229, 0.2);
}

.hub-email-banner > .material-symbols-outlined {
  font-size: 2rem;
  color: var(--brand-indigo);
}

.hub-email-banner-label {
  display: block;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 0.15rem;
}

.hub-email-banner-value {
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  word-break: break-all;
}

.hub-email-banner .hub-cred-copy--banner {
  margin-left: auto;
  flex-shrink: 0;
}

.hub-table-scroll {
  border-radius: 0.85rem;
  border: 1px solid var(--border);
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(15, 23, 42, 0.04);
}

.hub-data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.hub-data-table thead {
  background: linear-gradient(180deg, var(--input-bg), var(--bg-card));
}

.hub-data-table th {
  padding: 0.75rem 1rem;
  text-align: left;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
}

.hub-data-table th.hub-th-action {
  width: 5.5rem;
  text-align: center;
}

.hub-data-table tbody tr:not(.hub-tr-section):hover {
  background: rgba(79, 70, 229, 0.04);
}

.hub-tr-section td {
  padding: 0.65rem 1rem;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--brand-indigo);
  background: var(--input-bg);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

html[data-theme="dark"] .hub-tr-section td {
  color: #a5b4fc;
}

.hub-tr-section:first-child td {
  border-top: none;
}

.hub-data-table tbody th[scope="row"] {
  width: 11rem;
  padding: 0.7rem 1rem;
  font-weight: 600;
  font-size: 0.84rem;
  color: var(--muted);
  text-align: left;
  vertical-align: middle;
  border-bottom: 1px solid var(--border);
  background: transparent;
}

.hub-data-table tbody td {
  padding: 0.7rem 1rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.hub-data-table tbody tr:last-child th,
.hub-data-table tbody tr:last-child td {
  border-bottom: none;
}

.hub-val {
  display: inline-block;
  padding: 0.2rem 0.45rem;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 0.35rem;
  word-break: break-all;
}

.hub-pw-cell {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.hub-val--pw {
  flex: 1;
  min-width: 8rem;
}

.hub-pw-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 0.4rem;
  background: var(--bg-card);
  color: var(--muted);
  cursor: pointer;
}

.hub-pw-toggle:hover {
  border-color: var(--brand-indigo);
  color: var(--brand-indigo);
}

.hub-pw-toggle .material-symbols-outlined {
  font-size: 1.1rem;
}

.hub-pw-missing {
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.5;
}

.hub-pw-missing a {
  color: var(--brand-indigo);
  font-weight: 600;
}

.hub-td-action {
  text-align: center;
  width: 5.5rem;
}

.hub-cred-copy {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  padding: 0.35rem 0.55rem;
  font-size: 0.72rem;
  font-weight: 600;
  font-family: inherit;
  border-radius: 0.4rem;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--muted);
  cursor: pointer;
  transition: all 0.12s;
}

.hub-cred-copy .material-symbols-outlined {
  font-size: 1rem;
}

.hub-cred-copy-txt {
  line-height: 1;
}

.hub-cred-copy:hover {
  border-color: var(--brand-indigo);
  color: var(--brand-indigo);
}

.hub-cred-copy.is-copied {
  border-color: #16a34a;
  color: #16a34a;
  background: rgba(22, 163, 74, 0.08);
}

/* Loading / toast */
.hub-loading {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  background: var(--bg);
  z-index: 200;
  color: var(--muted);
}

.hub-loading.hidden { display: none; }

.hub-spinner {
  width: 2.5rem;
  height: 2.5rem;
  border: 3px solid var(--border);
  border-top-color: var(--brand-indigo);
  border-radius: 50%;
  animation: hub-spin 0.7s linear infinite;
}

.hub-spinner--sm {
  width: 1.25rem;
  height: 1.25rem;
  border-width: 2px;
}

@keyframes hub-spin {
  to { transform: rotate(360deg); }
}

.hub-toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%) translateY(6px);
  padding: 0.7rem 1.2rem;
  border-radius: 0.65rem;
  background: var(--text);
  color: var(--bg-card);
  font-size: 0.875rem;
  font-weight: 500;
  z-index: 300;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.2);
}

.hub-toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@media (min-width: 1280px) {
  .hub-shell { grid-template-columns: 21rem 1fr; }
}

@media (max-width: 768px) {
  .hub-user-chip {
    max-width: 11rem;
    padding-right: 0.35rem;
  }

  .hub-user-chip__chev {
    display: none;
  }

  .hub-account-email {
    display: none;
  }

  .hub-topbar-pill-label {
    display: none;
  }

  .hub-topbar-pill--logout {
    width: 1.875rem;
    min-width: 1.875rem;
    padding: 0;
  }

  .hub-welcome-inner {
    flex-direction: column;
    align-items: stretch;
  }

  .hub-welcome .hub-btn--primary { width: 100%; }

  .hub-shell {
    grid-template-columns: 1fr;
  }

  .hub-tabs {
    flex-direction: column;
    padding: 0.75rem;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  .hub-tabs-divider { display: none; }

  .hub-tabs-list {
    flex-direction: row;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 0.4rem;
    padding-bottom: 0.25rem;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .hub-tabs-list::-webkit-scrollbar { display: none; }

  .hub-tabs-label {
    margin-bottom: 0.35rem;
    font-size: 0.58rem;
  }

  .hub-tab {
    flex: 0 0 auto;
    width: auto;
    min-width: 7.5rem;
    padding: 0.5rem 0.65rem;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.35rem;
  }

  .hub-tab::before { display: none; }

  .hub-tab-desc { display: none; }

  .hub-tab-icon-wrap {
    width: 2.1rem;
    height: 2.1rem;
  }

  .hub-tab-label { font-size: 0.72rem; }

  .hub-pane { max-width: none !important; padding: 1.15rem 1rem 1.75rem; }

  .hub-account-cards,
  .hub-server-grid,
  .hub-guide-layout,
  .hub-guide-server-grid,
  .hub-setup__grid {
    grid-template-columns: 1fr;
  }

  .hub-guide-layout {
    gap: 1rem;
  }

  .hub-kv-row {
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
    gap: 0.35rem 0.5rem;
  }

  .hub-kv-label {
    grid-column: 1 / -1;
  }

  .hub-kv-mid {
    grid-column: 1;
  }

  .hub-kv-copy {
    grid-column: 2;
    grid-row: 2;
    align-self: center;
  }

  .hub-pane-card--cta {
    flex-direction: column;
    text-align: center;
  }

  .hub-data-table tbody th[scope="row"] {
    width: auto;
    display: block;
    padding-bottom: 0.25rem;
    border-bottom: none;
  }

  .hub-data-table tbody td {
    display: block;
    padding-top: 0;
  }

  .hub-data-table tbody tr:not(.hub-tr-section) {
    display: block;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border);
  }

  .hub-td-action {
    display: block;
    text-align: left;
    padding-top: 0.5rem;
  }
}

@media (max-width: 480px) {
  .hub-brand-tag { display: none; }
}

/* Reset password modal */
.hub-modal[hidden] {
  display: none !important;
}

.hub-modal {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
}

.hub-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(4px);
}

.hub-modal-dialog {
  position: relative;
  width: min(100%, 26rem);
  padding: 1.5rem 1.5rem 1.35rem;
  border-radius: 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  box-shadow: 0 24px 48px rgba(15, 23, 42, 0.2);
}

.hub-modal-dialog--info {
  width: min(100%, 32rem);
}

.hub-modal-body {
  margin: 0 0 1.25rem;
}

.hub-modal-body p {
  margin: 0 0 0.85rem;
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--text);
}

.hub-modal-body p:last-child {
  margin-bottom: 0;
}

.hub-modal-dialog--info .hub-modal-actions .hub-btn--primary {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.hub-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.35rem;
}

.hub-modal-head h2 {
  margin: 0;
  font-family: "Bricolage Grotesque", sans-serif;
  font-size: 1.2rem;
  font-weight: 800;
}

.hub-modal-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: none;
  border-radius: 0.5rem;
  background: var(--input-bg);
  color: var(--muted);
  cursor: pointer;
}

.hub-modal-close:hover {
  color: var(--text);
}

.hub-modal-sub {
  margin: 0 0 1.15rem;
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.5;
}

.hub-modal-form {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.hub-field label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
}

.hub-field input {
  width: 100%;
  box-sizing: border-box;
  padding: 0.65rem 0.85rem;
  font-family: inherit;
  font-size: 0.9rem;
  border: 1px solid var(--border);
  border-radius: 0.6rem;
  background: var(--input-bg);
  color: var(--text);
}

.hub-field input:focus {
  outline: 2px solid rgba(79, 70, 229, 0.35);
  border-color: var(--brand-indigo);
}

.hub-modal-err {
  margin: 0;
  font-size: 0.85rem;
  color: var(--error, #dc2626);
}

.hub-modal-err[hidden] {
  display: none;
}

.hub-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 0.35rem;
}

/* User chip avatar */
.hub-account-avatar {
  width: 100%;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--brand-indigo), #6366f1);
  color: #fff;
  font-size: 0.58rem;
  font-weight: 700;
  display: grid;
  place-items: center;
  overflow: hidden;
  background-size: cover;
  background-position: center;
}

.hub-account-avatar.has-photo {
  color: transparent;
}

/* ── Email profile pane ── */
.hub-pane--profile .hub-pane-inner--full {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.hub-pane--profile .hub-pane-head--profile {
  width: 100%;
  max-width: 52rem;
  margin-inline: auto;
  margin-bottom: 1.35rem;
  text-align: center;
}

.hub-pane--profile .hub-pane-head--profile .hub-pane-hint {
  margin-inline: auto;
}

.hub-profile-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  width: 100%;
  max-width: 52rem;
  margin-inline: auto;
  min-height: 12rem;
  font-size: 0.9rem;
  color: var(--muted);
}

.hub-profile {
  width: 100%;
  max-width: 52rem;
  margin-inline: auto;
}

.hub-profile-shell {
  position: relative;
  border-radius: 1.15rem;
  border: 1px solid color-mix(in srgb, var(--brand-indigo) 14%, var(--border));
  background: var(--bg-card);
  box-shadow:
    0 4px 28px rgba(15, 23, 42, 0.07),
    0 1px 0 rgba(255, 255, 255, 0.65) inset;
  overflow: hidden;
}

html[data-theme="dark"] .hub-profile-shell {
  box-shadow:
    0 12px 40px rgba(0, 0, 0, 0.35),
    0 1px 0 rgba(255, 255, 255, 0.04) inset;
}

.hub-profile-shell__glow {
  position: absolute;
  inset: -40% -20% auto;
  height: 55%;
  background: radial-gradient(
    ellipse 70% 80% at 50% 0%,
    rgba(79, 70, 229, 0.14),
    rgba(14, 165, 233, 0.06) 45%,
    transparent 72%
  );
  pointer-events: none;
}

.hub-profile-layout {
  position: relative;
  display: grid;
  gap: 1.75rem;
  padding: 1.65rem 1.5rem 1.25rem;
}

@media (min-width: 768px) {
  .hub-profile-layout {
    grid-template-columns: 13.5rem minmax(0, 1fr);
    gap: 2rem 2.25rem;
    padding: 1.85rem 1.85rem 1.35rem;
    align-items: start;
  }
}

/* Photo column */
.hub-profile-aside {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.hub-profile-aside-label {
  margin: 0 0 0.85rem;
  width: 100%;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.hub-profile-photo-stage {
  position: relative;
  width: 7.5rem;
  height: 7.5rem;
  margin-bottom: 1rem;
}

.hub-profile-photo-ring {
  position: absolute;
  inset: -5px;
  border-radius: 999px;
  background: linear-gradient(135deg, #4f46e5, #0ea5e9 55%, #a855f7);
  opacity: 0.85;
  animation: hub-profile-ring 4s ease-in-out infinite;
}

@keyframes hub-profile-ring {
  0%, 100% { transform: rotate(0deg) scale(1); opacity: 0.82; }
  50% { transform: rotate(6deg) scale(1.02); opacity: 1; }
}

.hub-profile__avatar {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(145deg, #4f46e5, #7c3aed);
  color: #fff;
  font-family: "Bricolage Grotesque", sans-serif;
  font-size: 1.85rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  display: grid;
  place-items: center;
  background-size: cover;
  background-position: center;
  border: 3px solid var(--bg-card);
  box-shadow: 0 12px 32px rgba(79, 70, 229, 0.28);
}

.hub-profile__avatar.has-photo {
  color: transparent;
  background-color: var(--input-bg);
}

.hub-profile-photo-overlay {
  position: absolute;
  z-index: 2;
  inset: 0;
  border-radius: 999px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.15rem;
  font-size: 0.72rem;
  font-weight: 700;
  color: #fff;
  background: rgba(15, 23, 42, 0.52);
  opacity: 0;
  cursor: pointer;
  transition: opacity 0.2s ease;
  backdrop-filter: blur(2px);
}

.hub-profile-photo-stage:hover .hub-profile-photo-overlay,
.hub-profile-photo-overlay:focus-within {
  opacity: 1;
}

.hub-profile-photo-overlay .material-symbols-outlined {
  font-size: 1.35rem !important;
}

.hub-profile-photo-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.45rem;
  width: 100%;
}

.hub-profile-chip-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.48rem 0.85rem;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--brand-indigo) 22%, var(--border));
  background: color-mix(in srgb, var(--brand-indigo) 6%, var(--bg-card));
  font-family: inherit;
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--brand-indigo);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, transform 0.15s;
}

.hub-profile-chip-btn:hover {
  border-color: var(--brand-indigo);
  background: color-mix(in srgb, var(--brand-indigo) 12%, var(--bg-card));
  transform: translateY(-1px);
}

.hub-profile-chip-btn--ghost {
  color: var(--muted);
  background: var(--input-bg);
  border-color: var(--border);
}

.hub-profile-chip-btn--ghost:hover {
  color: #dc2626;
  border-color: color-mix(in srgb, #dc2626 35%, var(--border));
  background: color-mix(in srgb, #dc2626 6%, var(--bg-card));
}

.hub-profile-chip-btn .material-symbols-outlined {
  font-size: 0.95rem !important;
}

.hub-profile-photo-hint {
  margin: 0.65rem 0 0;
  font-size: 0.72rem;
  color: var(--muted);
  line-height: 1.4;
}

/* Fields column */
.hub-profile-fields {
  display: grid;
  gap: 1.1rem;
}

@media (min-width: 640px) {
  .hub-profile-fields {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .hub-profile-field--readonly {
    grid-column: 1 / -1;
  }
}

.hub-profile-field label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.45rem;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text);
}

.hub-profile-field label .material-symbols-outlined {
  font-size: 1rem !important;
  color: var(--brand-indigo);
}

.hub-profile-field input {
  width: 100%;
  box-sizing: border-box;
  padding: 0.72rem 0.9rem;
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 500;
  border: 1px solid var(--border);
  border-radius: 0.7rem;
  background: var(--input-bg);
  color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.hub-profile-field input:focus {
  outline: none;
  border-color: color-mix(in srgb, var(--brand-indigo) 45%, var(--border));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-indigo) 14%, transparent);
}

.hub-profile-readonly {
  position: relative;
}

.hub-profile-readonly input {
  padding-right: 4.5rem;
  color: var(--muted);
  background: color-mix(in srgb, var(--input-bg) 88%, var(--border));
  cursor: default;
}

.hub-profile-readonly-badge {
  position: absolute;
  right: 0.65rem;
  top: 50%;
  transform: translateY(-50%);
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  background: var(--bg-card);
  border: 1px solid var(--border);
}

.hub-profile-field-hint {
  margin: 0.4rem 0 0;
  font-size: 0.76rem;
  color: var(--muted);
  line-height: 1.45;
}

.hub-profile-field-hint em {
  font-style: normal;
  font-weight: 600;
  color: var(--text);
}

/* Sync cards */
.hub-profile-sync {
  margin-top: 1.35rem;
  padding-top: 1.35rem;
  border-top: 1px dashed color-mix(in srgb, var(--border) 85%, var(--brand-indigo));
}

.hub-profile-sync-title {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0 0 0.85rem;
  font-family: "Bricolage Grotesque", sans-serif;
  font-size: 0.92rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
}

.hub-profile-sync-title .material-symbols-outlined {
  font-size: 1.1rem !important;
  color: var(--brand-indigo);
}

.hub-profile-sync-grid {
  display: grid;
  gap: 0.65rem;
}

@media (min-width: 640px) {
  .hub-profile-sync-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.hub-profile-sync-card {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.85rem 0.9rem;
  border-radius: 0.8rem;
  border: 1px solid var(--border);
  background: linear-gradient(
    165deg,
    color-mix(in srgb, var(--brand-indigo) 4%, var(--bg-card)),
    var(--input-bg)
  );
  transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
}

.hub-profile-sync-card:hover {
  border-color: color-mix(in srgb, var(--brand-indigo) 28%, var(--border));
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(79, 70, 229, 0.1);
}

.hub-profile-sync-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  margin-bottom: 0.25rem;
  border-radius: 0.55rem;
  background: linear-gradient(145deg, rgba(79, 70, 229, 0.14), rgba(14, 165, 233, 0.1));
  color: var(--brand-indigo);
}

.hub-profile-sync-icon--send {
  background: linear-gradient(145deg, rgba(14, 165, 233, 0.16), rgba(79, 70, 229, 0.08));
}

.hub-profile-sync-icon--phone {
  background: linear-gradient(145deg, rgba(168, 85, 247, 0.14), rgba(79, 70, 229, 0.08));
  color: #7c3aed;
}

.hub-profile-sync-icon .material-symbols-outlined {
  font-size: 1.05rem !important;
}

.hub-profile-sync-card strong {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text);
}

.hub-profile-sync-card span:last-child {
  font-size: 0.74rem;
  color: var(--muted);
  line-height: 1.35;
}

/* Footer / save */
.hub-profile-footer {
  padding: 1rem 1.5rem 1.25rem;
  border-top: 1px solid var(--border);
  background: color-mix(in srgb, var(--input-bg) 55%, var(--bg-card));
}

@media (min-width: 768px) {
  .hub-profile-footer {
    padding: 1.1rem 1.85rem 1.35rem;
  }
}

.hub-profile-footer-row {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  align-items: stretch;
}

@media (min-width: 640px) {
  .hub-profile-footer-row {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 1.25rem;
  }
}

.hub-profile-footer-note {
  display: flex;
  align-items: flex-start;
  gap: 0.45rem;
  margin: 0;
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.5;
  max-width: 26rem;
}

.hub-profile-footer-note .material-symbols-outlined {
  flex-shrink: 0;
  font-size: 1.05rem !important;
  color: #22c55e;
  margin-top: 0.1rem;
}

.hub-profile-save {
  flex-shrink: 0;
  min-width: 10.5rem;
  justify-content: center;
}

@media (max-width: 639px) {
  .hub-profile-save {
    width: 100%;
  }
}

.hub-profile__err {
  margin: 0 0 0.65rem;
  padding: 0.55rem 0.75rem;
  border-radius: 0.55rem;
  font-size: 0.84rem;
  font-weight: 600;
  color: #b91c1c;
  background: color-mix(in srgb, #dc2626 8%, var(--bg-card));
  border: 1px solid color-mix(in srgb, #dc2626 22%, var(--border));
}

.hub-profile__err[hidden] {
  display: none;
}

@media (max-width: 767px) {
  .hub-profile-aside {
    padding-bottom: 0.25rem;
    border-bottom: 1px dashed var(--border);
    margin-bottom: 0.25rem;
  }
  .hub-profile-sync {
    margin-top: 1rem;
    padding-top: 1rem;
  }
}

.hub-mail-client-note,
.hub-guide-mail-note {
  margin: 0 0 1rem;
  padding: 0.75rem 1rem;
  border-radius: 10px;
  background: #fef7e0;
  border: 1px solid #f9d67a;
  color: #5f4200;
  font-size: 0.9rem;
  line-height: 1.45;
}
