.account-sign-in { display:flex; gap:24px; align-items:flex-start; padding:32px; margin:24px 0; }
/* Selected-server workspace: primary modules first, utility routes at the foot. */
.account-workspace .sidebar > .brand { order: 0; font-size: 22px; margin: 0 2px; }
.account-workspace .sidebar > .brand img { width: 36px; height: 36px; }
.account-workspace .sidebar > .brand small { display: none; }
.account-workspace #server-nav { order: 1; border: 0; padding: 0; margin: 22px 0 20px; }
.account-workspace #server-nav .account-sidebar-server { display: flex; align-items: center; gap: 9px; margin: 0 0 25px; padding: 9px; min-height: 50px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); color: var(--ink); font-size: 12px; }
.account-workspace .account-sidebar-server .account-server-icon { width: 28px; height: 28px; border-radius: 6px; font-size: 11px; }
.account-workspace .account-sidebar-server > span:last-of-type { min-width: 0; overflow-wrap: anywhere; }
.account-workspace .account-sidebar-server > svg { width: 14px; height: 14px; flex: 0 0 auto; margin-left: auto; }
.account-workspace #server-nav .sidebar-label { font-size: 9px; margin: 0 10px 10px; }
.account-workspace .sidebar .side-link { border: 0; box-shadow: none; background: transparent; padding: 9px 10px; margin: 3px 0; min-height: 38px; gap: 10px; font-size: 12px; font-weight: 500; color: var(--muted); border-radius: 5px; }
.account-workspace .sidebar .side-link svg { width: 16px; height: 16px; flex-shrink: 0; }
.account-workspace .sidebar .side-link:hover { background: var(--surface-2); color: var(--ink); }
.account-workspace .sidebar .side-link.active { background: var(--accent-soft); color: var(--accent-text); box-shadow: inset 3px 0 var(--accent); font-weight: 700; }
.account-workspace .sidebar .side-link:focus-visible,.account-workspace .account-sidebar-server:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.account-workspace .workspace-nav { order: 3; margin-top: auto; padding: 16px 0 0; border: 0; }
.account-workspace .sidebar-local-tools { order: 4; }
.account-workspace .sidebar-local-tools .sidebar-label { margin: 10px; }
.account-workspace .sidebar-bottom { order: 5; margin-top: 0; padding-top: 6px; }
.account-workspace .sidebar-bottom .preview-note { display: none; }
@media(min-width:761px) {
  #dashboard-view.account-workspace .sidebar { width: 216px; padding: 25px 12px 14px; }
  #dashboard-view.account-workspace .dashboard-body { margin-left: 216px; }
}
@media(max-width:760px) {
  .account-workspace .sidebar .side-link { min-height: 44px; }
  .account-workspace .sidebar { padding-bottom: calc(var(--module-action-rail-offset,0px) + 76px); }
}
.account-sign-in h2 { font-size:24px; margin-bottom:12px; }
.account-sign-in p { color:var(--muted); margin-bottom:20px; }
.account-sign-in .field-hint { margin:12px 0 0; max-width:580px; }
.account-local-server, .account-preview-link { display:flex; justify-content:space-between; align-items:center; gap:24px; padding:28px; margin-top:24px; }
.account-local-server h2 { margin:12px 0; display:flex; gap:12px; align-items:center; flex-wrap:wrap; font-size:26px; }
.account-sign-in h2, .account-local-server h2, .account-preview-link h2 { letter-spacing:-.025em; }
.account-local-server .badge, .account-module .badge, #local-voice-state .badge, #local-save-state .badge { letter-spacing:normal; }
.account-local-server p, .account-preview-link p { color:var(--muted); margin-top:10px; }
.account-preview-link { border-top:1px solid var(--line); padding:28px 0; }
.account-preview-link h2 { font-size:18px; }
.account-directory-tools { margin:0 0 20px; justify-content:flex-end; }
.account-server-icon { display:grid; place-items:center; width:64px; height:64px; flex:0 0 auto; border-radius:16px; color:var(--accent-text); background:var(--accent-soft); font-weight:700; font-size:20px; }
.account-server-card .server-card-heading h3 { overflow-wrap:anywhere; }
.account-server-card .server-card-heading p { color:var(--muted); margin-top:8px; font-size:12px; }
.account-module { padding:24px; display:flex; flex-direction:column; align-items:flex-start; gap:14px; }
.account-module h2 { font-size:22px; }
.account-module p { color:var(--muted); line-height:1.7; }
.account-module .button { margin-top:auto; }
.account-notice { padding:24px; margin-top:24px; }
.account-notice p { margin:12px 0; color:var(--muted); }
.account-notice h2 { font-size:21px; letter-spacing:-.025em; }
.account-setup-panel { padding:clamp(22px, 4vw, 32px); margin-bottom:24px; }
.account-setup-panel h2 { font-size:clamp(22px, 2.4vw, 28px); line-height:1.2; margin:10px 0 12px; }
.account-setup-panel > p { color:var(--muted); line-height:1.6; max-width:65ch; }
.account-setup-panel form { margin-top:24px; }
.account-setup-choice { display:grid; gap:9px; max-width:540px; }
.account-setup-choice label { font-weight:650; }
.account-setup-choice select, .account-setup-choice input:not([type="hidden"]) { width:100%; min-height:46px; padding:10px 12px; color:var(--text); background:var(--bg); border:1px solid var(--line); border-radius:8px; }
.account-setup-profile { display:grid; gap:5px; padding:14px 16px; border:1px solid var(--line); border-radius:8px; background:var(--bg); }
.account-setup-profile span { color:var(--muted); font-size:13px; }
.account-setup-panel .field-hint { color:var(--muted); font-size:13px; line-height:1.5; margin:10px 0 0; }
.account-setup-error:not([hidden]) { color:var(--warning); margin:14px 0; }
.account-setup-actions { display:flex; align-items:center; flex-wrap:wrap; gap:12px; margin-top:22px; }
.account-feedback { padding:16px 20px; border:1px solid var(--line); border-radius:8px; margin-bottom:20px; }
.local-hub-footer details { font-size:12px; color:var(--muted); }
.local-hub-footer details summary { cursor:pointer; }
@media(max-width:650px) {
  .account-server-card { display:flex; flex-direction:column; }
  .account-server-card .server-state-lines { margin:16px 0 0; }
  .account-server-card .button.full { width:100%; height:auto; min-height:44px; padding:12px; font-size:13px; gap:8px; margin-top:16px; }
  .account-sign-in, .account-local-server, .account-preview-link { flex-direction:column; padding:20px; align-items:flex-start; }
  .account-preview-link { padding:20px 0; }
  .account-sign-in h2 { font-size:21px; }
  .account-directory-tools .search-field { width:100%; }
  .topbar-profile { max-width:190px; }
  .topbar-profile .link-button { font-size:11px; }
  .account-setup-actions { align-items:stretch; flex-direction:column; }
  .account-setup-actions .button { width:100%; justify-content:center; }
}

/* Real-account pages: compact artwork and server-owned imagery. */
#dashboard-main:has(> .account-page),
#dashboard-main:has(> .voice-settings-page) {
  max-width: 1660px;
  padding: 28px clamp(18px, 2.4vw, 40px) 32px;
}
.account-page { min-width: 0; }
.dashboard-body:has(.account-page, .voice-settings-page) #breadcrumbs { min-width: 0; }
.dashboard-body:has(.account-page, .voice-settings-page) #breadcrumbs > a:not(:first-child) { min-width: 0; overflow-wrap: anywhere; }
.dashboard-body:has(.account-page, .voice-settings-page) #breadcrumbs > a:first-child,
.dashboard-body:has(.account-page, .voice-settings-page) #breadcrumbs > strong,
.dashboard-body:has(.account-page, .voice-settings-page) #breadcrumbs > svg,
.dashboard-body:has(.account-page, .voice-settings-page) .topbar-actions { flex-shrink: 0; }
.account-page .badge { font-size: 12px; padding: 5px 9px; letter-spacing: normal; }
.account-page .badge.warning { color: var(--warning); background: var(--warning-bg); border-color: transparent; }
.account-hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #0b1b24;
  min-height: 204px;
  display: flex;
  align-items: center;
  margin-bottom: 26px;
  color: #f5f7f9;
}
.account-hero-art { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: right center; z-index: -2; }
.account-module-page .account-hero-art { left: auto; width: 75%; object-position: right center; }
.account-hero::after { content: ''; position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, #091721f2 0%, #091721d9 33%, #09172126 72%, transparent); }
.account-hero-copy { padding: 30px 36px; max-width: 58%; }
.account-hero h1 { font-size: clamp(30px, 3vw, 42px); line-height: 1.16; letter-spacing: -.035em; }
.account-hero p { color: #d3e3eb; font-size: 16px; line-height: 1.6; margin-top: 12px; max-width: 43ch; }
.account-test-scope { display: flex; align-items: flex-start; gap: 12px; padding: 16px 20px; margin-bottom: 22px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.account-test-scope > svg { margin-top: 3px; color: var(--accent-text); }
.account-test-scope > div { min-width: 0; }
.account-test-scope strong { font-size: 14px; }
.account-test-scope p { font-size: 14px; line-height: 1.6; margin-top: 3px; overflow-wrap: anywhere; }
.account-page .account-directory-tools { justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.account-page .search-field { width: min(560px, 75%); min-height: 48px; padding: 12px 15px; }
.account-page .search-field input { font-size: 15px; }
#account-server-count { font-size: 14px; color: var(--muted); white-space: nowrap; }
.account-server-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 285px), 1fr)); gap: 22px; }
.account-page .account-server-card { padding: 0; overflow: hidden; border-radius: 13px; display: flex; flex-direction: column; }
.account-server-cover { position: relative; overflow: hidden; height: 130px; flex: 0 0 auto; background: linear-gradient(140deg, #123d4a, #1c293b 55%, #263d41); }
.account-server-tone-1 { background: linear-gradient(135deg, #214f47, #27313d 60%, #1b3d49); }
.account-server-tone-2 { background: linear-gradient(135deg, #263455, #273d46 55%, #3b424b); }
.account-server-tone-3 { background: linear-gradient(135deg, #443844, #283644 55%, #174453); }
.account-server-tone-4 { background: linear-gradient(135deg, #354c52, #334046 55%, #293644); }
.account-server-cover::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 40%, #07131a4d); pointer-events: none; }
.account-server-banner { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.account-server-cover-icon { width: 100%; height: 100%; object-fit: cover; filter: blur(20px) saturate(.8); transform: scale(1.25); opacity: .58; }
.account-page .account-server-body { display: flex; flex: 1; flex-direction: column; align-items: center; padding: 0 22px 22px; text-align: center; }
.account-server-icon { position: relative; overflow: hidden; }
.account-server-icon img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
.account-page .account-server-body > .account-server-icon { width: 80px; height: 80px; border-radius: 50%; margin: -40px 0 14px; z-index: 1; border: 4px solid var(--surface); font-size: 24px; }
.account-page .account-server-card .server-card-heading { display: block; width: 100%; }
.account-page .account-server-card h2 { font-size: 21px; line-height: 1.3; letter-spacing: -.025em; overflow-wrap: anywhere; }
.account-page .account-server-card .server-card-heading p { font-size: 14px; margin-top: 8px; }
.account-page .account-server-card .server-state-lines { margin: 14px 0 18px; }
.account-page .account-server-card .server-state-lines p { margin: 0; display: block; white-space: normal; }
.account-page .account-server-card .badge { margin: 0; }
.account-page .account-server-card .button.full { min-height: 46px; font-size: 14px; padding: 10px 14px; margin: auto 0 0; gap: 10px; }
.account-page .account-server-card .button.full svg { display: block; width: 18px; height: 18px; }
.account-selected-server { display: flex; align-items: center; gap: 16px; margin-bottom: 22px; min-width: 0; }
.account-selected-server > .account-server-icon { width: 64px; height: 64px; border-radius: 14px; font-size: 21px; }
.account-selected-copy { min-width: 0; }
.account-install { display:grid; gap:18px; min-width:0; }
.account-install fieldset { border:1px solid var(--line); border-radius:10px; min-width:0; padding:16px; display:grid; gap:12px; }
.account-install legend { padding:0 8px; font-weight:650; }
.account-install label { display:flex; gap:10px; align-items:flex-start; font-size:14px; overflow-wrap:anywhere; }
.account-install input { flex-shrink:0; width:18px; height:18px; accent-color:var(--accent); }
.account-install details > label { margin-top:14px; }
.account-install .button { justify-self:start; white-space:normal; }
.account-install [role=status] { overflow-wrap:anywhere; }
.account-selected-copy .eyebrow { font-size: 10px; letter-spacing: .1em; color: var(--accent-text); }
.account-selected-copy strong { display: block; font-size: 26px; line-height: 1.25; letter-spacing: -.025em; overflow-wrap: anywhere; margin-top: 4px; }
.account-selected-copy p { font-size: 13px; margin-top: 5px; }
.account-change-server { margin-left: auto; }
.account-modules { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.account-page .account-module { padding: 0; overflow: hidden; gap: 0; border-radius: 13px; display: flex; align-items: stretch; }
.account-module-art { width: 100%; height: auto; aspect-ratio: 3 / 1; object-fit: cover; background: #11212a; }
.account-module-body { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; flex: 1; padding: 24px; }
.account-module-heading { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; width: 100%; }
.account-module-heading h2 { flex: 1; font-size: 25px; line-height: 1.25; letter-spacing: -.025em; }
.account-page .account-module p { font-size: 15px; line-height: 1.65; }
.account-page .account-module .account-module-status { font-size: 14px; }
.account-module-body > .button { margin-top: auto; min-height: 44px; font-size: 14px; }
.account-module-access .badge { font-size: 11px; }
.account-module-note { display: flex; align-items: flex-start; gap: 10px; margin-top: 22px; padding: 16px 0; border-top: 1px solid var(--line); }
.account-module-note svg { flex: 0 0 auto; margin-top: 3px; color: var(--muted); }
.account-module-note p { font-size: 13px; line-height: 1.7; }
#server-nav:has(.account-sidebar-server) { border-top: 1px solid var(--line); padding-top: 14px; margin-top: 14px; }
.account-sidebar-server { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 8px 10px 14px; }
.account-sidebar-server .account-server-icon { width: 36px; height: 36px; font-size: 12px; border-radius: 9px; }
.account-sidebar-server > span:last-child { min-width: 0; overflow-wrap: anywhere; font-size: 14px; font-weight: 600; line-height: 1.4; }
#server-nav .side-link { font-size: 14px; min-height: 44px; }
.account-page .account-local-server { margin-top: 30px; padding: 22px; }
.account-page .account-local-server h2 { font-size: 22px; }
.account-page .account-local-server p, .account-page .account-preview-link p { font-size: 14px; }
.account-page .empty-state { margin-top: 22px; padding: 30px 20px; }
.account-page .empty-state h2 { font-size: 25px; letter-spacing: -.025em; }
.account-page .empty-state p { font-size: 15px; margin-top: 10px; }
@media (min-width: 1800px) { .account-server-cover { height: 150px; } }
@media (max-width: 1100px) {
  .account-hero-copy { max-width: 64%; padding: 28px; }
  .account-hero p { font-size: 15px; }
  .account-selected-server { flex-wrap: wrap; }
}
@media (max-width: 760px) {
  .account-module-page .account-hero-art { width: 100%; }
  .account-hero { min-height: 180px; margin-bottom: 20px; }
  .account-hero::after { background: linear-gradient(90deg, #091721f5, #091721c7 60%, #09172166); }
  .account-hero-copy { max-width: 82%; padding: 25px 22px; }
  .account-hero-art { object-position: 65% center; }
  .account-hero h1 { font-size: 32px; }
  .account-hero p { font-size: 15px; }
  .account-modules { grid-template-columns: 1fr; gap: 20px; }
  .account-module-body { padding: 22px; }
  .account-selected-server { gap: 12px; }
  .account-selected-server > .badge { margin-left: 0; }
  .account-change-server { margin-left: 0; }
  .account-selected-copy strong { font-size: 23px; }
  .account-test-scope { padding: 14px 16px; }
}
@media (max-width: 520px) {
  .account-hero { min-height: 174px; }
  .account-hero-copy { max-width: 90%; padding: 24px 20px; }
  .account-page .account-directory-tools { flex-wrap: wrap; gap: 10px; }
  .account-page .search-field { width: 100%; }
  .account-server-grid { gap: 20px; }
  .account-server-cover { height: 130px; }
  .account-selected-server > .account-server-icon { width: 52px; height: 52px; }
  .account-selected-server > .badge { margin-right: auto; }
  .account-change-server { width: 100%; }
  .account-page .account-sign-in { gap: 16px; }
  .account-page .account-sign-in .module-symbol { display: none; }
  .dashboard-body:has(.account-page, .voice-settings-page) .dashboard-topbar { gap: 9px; padding-inline: 14px; }
  .dashboard-body:has(.account-page, .voice-settings-page) #breadcrumbs { font-size: 12px; line-height: 1.4; gap: 5px; max-width: none; }
  .dashboard-body:has(.account-page, .voice-settings-page) #breadcrumbs > a:not(:first-child),
  .dashboard-body:has(.account-page, .voice-settings-page) #breadcrumbs > svg:first-of-type { display: none; }
  .dashboard-body:has(.account-page, .voice-settings-page) .topbar-actions { gap: 7px; }
  .dashboard-body:has(.account-page, .voice-settings-page) .topbar-profile { gap: 7px; padding-left: 8px; font-size: 12px; max-width: 135px; }
  .dashboard-body:has(.account-page, .voice-settings-page) .topbar-profile small { display: none; }
  .dashboard-body:has(.account-page, .voice-settings-page) .topbar-profile .avatar { width: 28px; height: 28px; }
  .dashboard-body:has(.account-page, .voice-settings-page) .topbar-profile .link-button { font-size: 12px; }
}

/* Keep account and owner navigation usable when the signed-in header grows. */
.dashboard-body:has(.topbar-profile > a[href="/account/foundation/"]) { min-width: 0; }
.dashboard-body:has(.topbar-profile > a[href="/account/foundation/"]) .dashboard-topbar { min-width: 0; width: 100%; max-width: 100%; }
.dashboard-body:has(.topbar-profile > a[href="/account/foundation/"]) .topbar-actions { min-width: 0; }
.dashboard-body:has(.topbar-profile > a[href="/account/foundation/"]) .topbar-profile > span:nth-child(2) {
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dashboard-body:has(.topbar-profile > a[href="/account/foundation/"]) .topbar-profile .link-button { white-space: nowrap; }
@media (max-width: 1100px) {
  .dashboard-body:has(.topbar-profile > a[href="/account/foundation/"]) .dashboard-topbar {
    height: auto;
    min-height: 76px;
    flex-wrap: wrap;
    padding-block: 12px;
  }
  .dashboard-body:has(.topbar-profile > a[href="/account/foundation/"]) .topbar-actions { margin-left: auto; max-width: 100%; flex-wrap: wrap; justify-content: flex-end; }
  .dashboard-body:has(.topbar-profile > a[href="/account/foundation/"]) .topbar-profile { gap: 10px; min-width: 0; max-width: none; flex-wrap: wrap; }
}
@media (max-width: 760px) {
  .dashboard-body:has(.topbar-profile > a[href="/account/foundation/"]) { width: 100%; max-width: 100%; }
}
@media (max-width: 520px) {
  .dashboard-body:has(.topbar-profile > a[href="/account/foundation/"]) .dashboard-topbar {
    display: grid;
    grid-template-columns: 32px minmax(0, 1fr);
    gap: 6px 10px;
  }
  .dashboard-body:has(.topbar-profile > a[href="/account/foundation/"]) .topbar-actions {
    grid-column: 1 / -1;
    width: 100%;
    margin-left: 0;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: nowrap;
  }
  .dashboard-body:has(.topbar-profile > a[href="/account/foundation/"]) .topbar-profile {
    flex: 1 1 0;
    width: 0;
    justify-content: flex-end;
    min-width: 0;
    max-width: none;
    border-left: 0;
    padding-left: 0;
    gap: 10px;
    flex-wrap: wrap;
  }
  .dashboard-body:has(.topbar-profile > a[href="/account/foundation/"]) .topbar-profile > span:nth-child(2) { display: none; }
  .dashboard-body:has(.topbar-profile > a[href="/account/foundation/"]) .topbar-profile .avatar { flex-shrink: 0; }
  .dashboard-body:has(.topbar-profile > a[href="/account/foundation/"]) .topbar-profile .link-button {
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    font-size: 12px;
  }
}
