:root {
  color-scheme: dark;
  --bg: #0b1220;
  --sidebar: #0d1729;
  --panel: #121f35;
  --input: #0b1527;
  --line: #2b4163;
  --text: #eff5ff;
  --muted: #9eafc8;
  --blue: #7caeff;
  --blue-strong: #3d79df;
  --green: #65d0a8;
  --amber: #f3c56c;
  --red: #ff8b95;
}

* { box-sizing: border-box; }
html, body { height: 100%; }

body {
  margin: 0;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.55 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button, input, textarea, select { color: var(--text); font: inherit; }

button {
  border: 0;
  border-radius: 8px;
  background: var(--blue-strong);
  padding: 9px 13px;
  font-weight: 700;
  cursor: pointer;
}

button:hover { background: #4b89f2; }
button:disabled { cursor: not-allowed; opacity: .48; }

input, textarea, select {
  width: 100%;
  border: 1px solid #385176;
  border-radius: 9px;
  background: var(--input);
  padding: 10px 12px;
}

textarea { min-height: 72px; resize: vertical; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 3px; font-size: 1.35rem; }
h2 { margin-bottom: 0; font-size: 1.1rem; }

.eyebrow {
  margin-bottom: 4px;
  color: var(--blue);
  font-size: .68rem;
  font-weight: 750;
  letter-spacing: .12em;
}

.app-shell {
  display: grid;
  grid-template-columns: 282px minmax(0, 1fr);
  height: 100dvh;
}

.sidebar {
  display: flex;
  min-height: 0;
  flex-direction: column;
  border-right: 1px solid var(--line);
  background: var(--sidebar);
}

.sidebar-top { padding: 21px 17px 14px; }

.new-chat-button {
  width: 100%;
  margin-top: 14px;
  background: #274b7c;
  text-align: left;
}

.new-chat-button:hover { background: #32629c; }

.sidebar-label {
  padding: 9px 17px;
  color: var(--muted);
  font-size: .7rem;
  font-weight: 750;
  letter-spacing: .1em;
}

.room-list {
  display: grid;
  min-height: 0;
  flex: 1;
  align-content: start;
  gap: 3px;
  overflow-y: auto;
  padding: 0 9px 14px;
}

.room-item {
  display: grid;
  gap: 3px;
  width: 100%;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  padding: 10px 9px;
  text-align: left;
}

.room-item:hover { background: #15233a; }
.room-item.active { border-color: #365889; background: #1a3153; }

.room-item-top {
  display: flex;
  min-width: 0;
  align-items: center;
}

.room-item-title {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 700;
}

.room-item-preview, .room-item-time {
  overflow: hidden;
  color: var(--muted);
  font-size: .76rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.room-item-time { font-size: .68rem; }

.sidebar-footer {
  border-top: 1px solid var(--line);
  padding: 14px 17px;
  color: var(--muted);
  font-size: .78rem;
}

.sidebar-footer p { margin: 10px 0 0; }
.health { color: var(--muted); font-size: .78rem; }
.health.healthy { color: var(--green); }
.health.unhealthy { color: var(--red); }

.conversation-shell {
  display: grid;
  min-width: 0;
  min-height: 0;
  grid-template-rows: auto minmax(0, 1fr) auto;
  background: radial-gradient(circle at 45% 0%, #152950 0%, var(--bg) 42rem);
}

.conversation-header {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  padding: 17px 26px 14px;
}

.room-heading { min-width: 0; }

.room-title-row {
  display: flex;
  min-width: 0;
  align-items: center;
}

.room-title-row h2 {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.room-name { cursor: text; }
.room-name:hover { color: var(--blue); }

.room-name-input {
  width: min(520px, 100%);
  min-width: 0;
  border: 1px solid #527cb6;
  border-radius: 6px;
  background: var(--input);
  padding: 3px 7px;
  color: var(--text);
  font-size: 1.1rem;
  font-weight: 700;
}

.conversation-note {
  margin: 0;
  color: var(--muted);
  font-size: .8rem;
  white-space: nowrap;
}

.forum-view {
  min-height: 0;
  overflow-y: auto;
}

.transcript {
  display: grid;
  width: min(920px, 100%);
  margin: 0 auto;
  gap: 13px;
  padding: 25px max(24px, 4vw) 34px;
}

.message {
  border-left: 4px solid var(--line);
  background: color-mix(in srgb, var(--panel) 92%, transparent);
}

.message.moderator { border-left-color: var(--amber); }
.message.qwen { border-left-color: var(--blue); }
.message.deepseek { border-left-color: var(--green); }
.message.error { border-left-color: var(--red); }

.message-inner { padding: 17px 19px; }

.message-meta {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: .79rem;
  font-weight: 750;
}

.message-content { overflow-wrap: anywhere; line-height: 1.65; }

.composer-panel {
  border-top: 1px solid var(--line);
  background: color-mix(in srgb, var(--sidebar) 94%, transparent);
  padding: 12px max(20px, 4vw) 16px;
}

.composer-panel form, .composer-hint {
  width: min(920px, 100%);
  margin-right: auto;
  margin-left: auto;
}

.composer-panel form { display: grid; gap: 9px; }

.composer-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 13px;
}

.mode-label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: .82rem;
  white-space: nowrap;
}

.mode-label select {
  width: auto;
  min-width: 245px;
  padding: 7px 9px;
}

.composer-hint {
  margin-top: 0;
  margin-bottom: 0;
  color: var(--muted);
  font-size: .74rem;
}

@media (max-width: 780px) {
  body { overflow: auto; }
  .app-shell { display: block; height: auto; min-height: 100dvh; }
  .sidebar { min-height: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .sidebar-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
  .new-chat-button { width: auto; margin-top: 0; white-space: nowrap; }
  .room-list { display: flex; overflow-x: auto; padding-bottom: 11px; }
  .room-item { min-width: 180px; }
  .sidebar-footer { display: none; }
  .conversation-shell { min-height: calc(100dvh - 180px); grid-template-rows: auto minmax(400px, 1fr) auto; }
  .conversation-header { align-items: flex-start; flex-direction: column; padding: 14px 18px; }
  .conversation-note { white-space: normal; }
  .transcript { padding: 18px; }
  .composer-panel { padding: 12px 18px; }
  .composer-footer { align-items: stretch; flex-direction: column; }
  .mode-label, .mode-label select, .composer-footer button { width: 100%; }
}

.room-item {
  position: relative;
  display: flex;
  min-width: 0;
  align-items: stretch;
  gap: 2px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  padding: 2px;
}

.room-item:hover {
  background: #15233a;
}

.room-item.active {
  border-color: #365889;
  background: #1a3153;
}

.room-open-button {
  display: grid;
  min-width: 0;
  flex: 1;
  gap: 3px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  padding: 8px 7px;
  color: inherit;
  text-align: left;
}

.room-open-button:hover,
.room-open-button:focus-visible {
  background: transparent;
}

.room-menu-button {
  width: 30px;
  min-width: 30px;
  align-self: stretch;
  border: 0;
  border-radius: 7px;
  background: transparent;
  padding: 0;
  color: var(--muted);
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1;
}

.room-menu-button:hover,
.room-menu-button:focus-visible {
  background: #274b7c;
  color: var(--text);
}

.room-context-menu {
  position: fixed;
  z-index: 20;
  display: grid;
  min-width: 154px;
  overflow: hidden;
  border: 1px solid #385176;
  border-radius: 8px;
  background: #101d31;
  box-shadow: 0 12px 28px rgba(0, 0, 0, .38);
  padding: 4px;
}

.room-context-menu button {
  border-radius: 5px;
  background: transparent;
  padding: 7px 9px;
  color: var(--text);
  font-size: .84rem;
  font-weight: 650;
  text-align: left;
}

.room-context-menu button:hover,
.room-context-menu button:focus-visible {
  background: #274b7c;
}

.room-context-menu button.danger {
  color: var(--red);
}

.room-context-menu button.danger:hover,
.room-context-menu button.danger:focus-visible {
  background: rgba(190, 55, 68, .24);
}

@media (max-width: 780px) {
  .room-item {
    min-width: 180px;
  }
}

.auth-page {
  display: grid;
  min-height: 100dvh;
  place-items: center;
  overflow: auto;
  background: radial-gradient(circle at 50% 0%, #152950 0%, var(--bg) 42rem);
}

.auth-shell {
  width: min(100%, 460px);
  padding: 24px;
}

.auth-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: color-mix(in srgb, var(--panel) 96%, transparent);
  box-shadow: 0 20px 55px rgba(0, 0, 0, .28);
  padding: 28px;
}

.auth-card h1 {
  margin-bottom: 8px;
  font-size: 1.45rem;
}

.auth-copy,
.auth-help {
  color: var(--muted);
}

.auth-copy {
  margin-bottom: 22px;
}

.auth-help {
  margin: -2px 0 0;
  font-size: .8rem;
}

.auth-form {
  display: grid;
  gap: 15px;
}

.auth-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: .84rem;
  font-weight: 700;
}

.auth-form input {
  color: var(--text);
}

.auth-form button {
  margin-top: 4px;
}

.auth-error {
  margin: 0;
  border: 1px solid rgba(255, 139, 149, .5);
  border-radius: 8px;
  background: rgba(190, 55, 68, .16);
  padding: 9px 10px;
  color: var(--red);
  font-size: .85rem;
}

.logout-form {
  margin-top: 12px;
}

.logout-button {
  width: 100%;
  background: transparent;
  border: 1px solid #385176;
  color: var(--muted);
  font-size: .8rem;
  font-weight: 700;
}

.logout-button:hover {
  background: #15233a;
  color: var(--text);
}

.users-button {
  display: block;
  width: 100%;
  margin-top: 12px;
  border: 1px solid #385176;
  border-radius: 8px;
  padding: 8px 10px;
  color: var(--muted);
  font-size: .8rem;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
}

.users-button:hover {
  background: #15233a;
  color: var(--text);
}

.admin-page {
  min-height: 100dvh;
  overflow: auto;
  background: radial-gradient(circle at 50% 0%, #152950 0%, var(--bg) 42rem);
}

.admin-shell {
  width: min(100% - 32px, 920px);
  margin: 0 auto;
  padding: 28px 0 48px;
}

.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 20px;
}

.admin-header h1 {
  margin-bottom: 0;
}

.admin-back {
  color: var(--blue);
  font-weight: 700;
  text-decoration: none;
}

.admin-card {
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: color-mix(in srgb, var(--panel) 96%, transparent);
  padding: 20px;
}

.admin-card h2 {
  margin-bottom: 6px;
}

.admin-card > p {
  color: var(--muted);
}

.admin-list {
  display: grid;
  gap: 7px;
}

.admin-row {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) auto minmax(150px, auto);
  align-items: center;
  gap: 14px;
  border: 1px solid #2b4163;
  border-radius: 8px;
  padding: 9px 11px;
  color: var(--muted);
  font-size: .84rem;
}

.admin-row > span:first-child {
  color: var(--text);
  font-weight: 700;
}

.admin-status {
  color: var(--blue);
  font-weight: 700;
}

.admin-revoke {
  background: transparent;
  border: 1px solid rgba(255, 139, 149, .5);
  color: var(--red);
  font-size: .76rem;
  padding: 5px 8px;
}

.admin-revoke:hover {
  background: rgba(190, 55, 68, .18);
}

.invite-result {
  display: grid;
  gap: 9px;
  margin-top: 17px;
  border-top: 1px solid var(--line);
  padding-top: 17px;
}

.invite-result p {
  margin: 0;
  color: var(--amber);
  font-size: .84rem;
}

.invite-result input {
  font-size: .8rem;
}

@media (max-width: 620px) {
  .admin-shell {
    width: min(100% - 24px, 920px);
    padding-top: 18px;
  }

  .admin-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .admin-row {
    grid-template-columns: 1fr;
    gap: 3px;
  }

  .admin-revoke {
    width: 100%;
    margin-top: 5px;
  }
}

.sidebar-toggle,
.sidebar-backdrop {
  display: none;
}

.invite-url-row {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
}

.invite-url-row input {
  min-width: 0;
  flex: 1;
}

#copyInvite {
  width: auto;
  flex: 0 0 auto;
  margin: 0;
  padding: 8px 10px;
  font-size: .78rem;
  white-space: nowrap;
}

@media (max-width: 780px) {
  body {
    overflow: hidden;
  }

  .app-shell {
    display: block;
    height: 100dvh;
    min-height: 100dvh;
  }

  .conversation-shell {
    min-height: 100dvh;
    grid-template-rows: auto minmax(0, 1fr) auto;
  }

  .sidebar-toggle {
    display: inline-grid;
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    place-items: center;
    border: 1px solid #385176;
    border-radius: 8px;
    background: #15233a;
    padding: 0;
    color: var(--text);
    font-size: 1.2rem;
    line-height: 1;
  }

  .sidebar-toggle:hover,
  .sidebar-toggle:focus-visible {
    background: #274b7c;
  }

  .sidebar {
    position: fixed;
    z-index: 30;
    top: 0;
    bottom: 0;
    left: 0;
    display: flex;
    width: min(86vw, 330px);
    min-height: 100dvh;
    transform: translateX(-105%);
    transition: transform .18s ease;
    border-right: 1px solid var(--line);
    border-bottom: 0;
    box-shadow: 16px 0 38px rgba(0, 0, 0, .34);
  }

  .sidebar.mobile-open {
    transform: translateX(0);
  }

  .sidebar-backdrop {
    position: fixed;
    z-index: 20;
    inset: 0;
    display: block;
    background: rgba(0, 0, 0, .52);
  }

  .sidebar-backdrop[hidden] {
    display: none;
  }

  .sidebar-top {
    display: block;
    padding: 21px 17px 14px;
  }

  .new-chat-button {
    width: 100%;
    margin-top: 14px;
    white-space: normal;
  }

  .room-list {
    display: grid;
    overflow-x: hidden;
    overflow-y: auto;
    padding-bottom: 14px;
  }

  .room-item {
    min-width: 0;
  }

  .sidebar-footer {
    display: block;
  }

  .conversation-header {
    align-items: center;
    flex-direction: row;
    padding: 13px 16px;
  }

  .room-heading {
    flex: 1;
  }

  .conversation-note {
    display: none;
  }

  .transcript {
    padding: 18px;
  }

  .composer-panel {
    padding: 12px 18px;
  }

  .composer-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .mode-label,
  .mode-label select,
  .composer-footer button {
    width: 100%;
  }

  .invite-url-row {
    align-items: stretch;
  }

  #copyInvite {
    min-width: 66px;
  }
}

.sidebar-toggle,
.sidebar-backdrop {
  display: none;
}

@media (max-width: 780px) {
  body {
    overflow: hidden;
  }

  .app-shell {
    display: block;
    height: 100dvh;
    min-height: 100dvh;
  }

  .conversation-shell {
    min-height: 100dvh;
    grid-template-rows: auto minmax(0, 1fr) auto;
  }

  .sidebar-toggle {
    display: inline-grid;
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    place-items: center;
    border: 1px solid #385176;
    border-radius: 8px;
    background: #15233a;
    padding: 0;
    color: var(--text);
    font-size: 1.2rem;
    line-height: 1;
  }

  .sidebar-toggle:hover,
  .sidebar-toggle:focus-visible {
    background: #274b7c;
  }

  .sidebar {
    position: fixed;
    z-index: 30;
    top: 0;
    bottom: 0;
    left: 0;
    display: flex;
    width: min(86vw, 330px);
    min-height: 100dvh;
    transform: translateX(-105%);
    transition: transform .18s ease;
    border-right: 1px solid var(--line);
    border-bottom: 0;
    box-shadow: 16px 0 38px rgba(0, 0, 0, .34);
  }

  .sidebar.mobile-open {
    transform: translateX(0);
  }

  .sidebar-backdrop {
    position: fixed;
    z-index: 20;
    inset: 0;
    display: block;
    background: rgba(0, 0, 0, .52);
  }

  .sidebar-backdrop[hidden] {
    display: none;
  }

  .sidebar-top {
    display: block;
    padding: 21px 17px 14px;
  }

  .new-chat-button {
    width: 100%;
    margin-top: 14px;
    white-space: normal;
  }

  .room-list {
    display: grid;
    overflow-x: hidden;
    overflow-y: auto;
    padding-bottom: 14px;
  }

  .room-item {
    min-width: 0;
  }

  .sidebar-footer {
    display: block;
  }

  .conversation-header {
    align-items: center;
    flex-direction: row;
    padding: 13px 16px;
  }

  .room-heading {
    flex: 1;
  }

  .conversation-note {
    display: none;
  }

  .transcript {
    padding: 18px;
  }

  .composer-panel {
    padding: 12px 18px;
  }

  .composer-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .mode-label,
  .mode-label select,
  .composer-footer button {
    width: 100%;
  }
}


/*
 * Mobile chat layout.
 * The actual middle grid child is .forum-view, not .transcript.
 * It owns scrolling; header and composer remain normal grid rows.
 */
@media (max-width: 780px) {
  html,
  body {
    width: 100%;
    height: 100%;
    min-height: 100%;
    margin: 0;
    overflow: hidden !important;
  }

  body {
    position: fixed;
    inset: 0;
  }

  .app-shell {
    display: block !important;
    width: 100%;
    height: 100dvh !important;
    min-height: 100dvh !important;
    max-height: 100dvh !important;
    overflow: hidden !important;
  }

  .conversation-shell {
    display: grid !important;
    width: 100%;
    height: 100% !important;
    min-height: 0 !important;
    max-height: 100% !important;
    grid-template-rows: auto minmax(0, 1fr) auto !important;
    overflow: hidden !important;
  }

  .conversation-header {
    grid-row: 1;
    min-height: 0;
  }

  .forum-view {
    display: block !important;
    grid-row: 2;
    min-height: 0 !important;
    height: auto !important;
    max-height: none !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    overscroll-behavior-y: contain;
    -webkit-overflow-scrolling: touch;
  }

  .transcript {
    display: grid;
    width: min(920px, 100%);
    min-height: min-content;
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
    margin: 0 auto;
    padding: 18px 18px 32px !important;
  }

  .composer-panel {
    display: block !important;
    grid-row: 3;
    position: static !important;
    inset: auto !important;
    width: auto !important;
    min-width: 0;
    min-height: 0;
    height: auto !important;
    max-height: none !important;
    margin: 0;
    overflow: visible !important;
    z-index: auto !important;
    padding:
      12px
      18px
      calc(12px + env(safe-area-inset-bottom, 0px)) !important;
  }
}

/* Mobile admin users page: bounded viewport with scrollable content. */
@media (max-width: 780px) {
  .admin-page,
  .admin-shell {
    width: 100%;
    height: 100dvh;
    min-height: 100dvh;
    max-height: 100dvh;
    overflow: hidden !important;
  }

  .admin-header {
    position: sticky !important;
    top: 0 !important;
    z-index: 5 !important;
    min-height: 0 !important;
    background: var(--bg);
  }

  .admin-content,
  .admin-shell {
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain;
  }
}

/* Account settings panel */
.settings-panel {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  background: var(--bg);
}

.settings-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  padding: 16px 20px;
  background: var(--surface);
}

.settings-header h2 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: .08em;
}

.settings-close {
  border: 1px solid #385176;
  border-radius: 8px;
  background: #15233a;
  color: var(--text);
  width: 36px;
  height: 36px;
  font-size: 1.2rem;
  line-height: 1;
}

.settings-content {
  overflow-y: auto;
  padding: 20px;
}

#accountForm {
  width: min(100%, 520px);
  margin: 0 auto;
  display: grid;
  gap: 14px;
}

.settings-field {
  display: grid;
  gap: 6px;
}

.settings-field label {
  font-size: .82rem;
  font-weight: 700;
  color: var(--muted);
}

.settings-field input {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid #385176;
  border-radius: 8px;
  background: #0f1b2c;
  color: var(--text);
  font-size: .95rem;
}

.settings-meta {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: .8rem;
}

.settings-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 6px;
}

.settings-actions button {
  border: 1px solid #385176;
  border-radius: 8px;
  background: #274b7c;
  color: #fff;
  padding: 8px 14px;
  font-weight: 700;
  font-size: .9rem;
}

.settings-status {
  margin: 0;
  color: var(--muted);
  font-size: .8rem;
}

@media (max-width: 780px) {
  .settings-panel {
    inset: 0;
  }
}

/* Show-password toggle */
.password-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.password-row input {
  flex: 1;
}

.password-row button {
  border: 1px solid #385176;
  border-radius: 8px;
  background: #15233a;
  color: var(--text);
  padding: 6px 9px;
  font-size: .8rem;
  font-weight: 700;
  white-space: nowrap;
}

/* Account settings panel */
.settings-panel {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  background: var(--bg);
}

.settings-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  padding: 16px 20px;
  background: var(--surface);
}

.settings-header h2 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: .08em;
}

.settings-close {
  border: 1px solid #385176;
  border-radius: 8px;
  background: #15233a;
  color: var(--text);
  width: 36px;
  height: 36px;
  font-size: 1.2rem;
  line-height: 1;
}

.settings-content {
  overflow-y: auto;
  padding: 20px;
}

#accountForm {
  width: min(100%, 520px);
  margin: 0 auto;
  display: grid;
  gap: 14px;
}

.settings-field {
  display: grid;
  gap: 6px;
}

.settings-field label {
  font-size: .82rem;
  font-weight: 700;
  color: var(--muted);
}

.settings-field input {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid #385176;
  border-radius: 8px;
  background: #0f1b2c;
  color: var(--text);
  font-size: .95rem;
}

.settings-meta {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: .8rem;
}

.settings-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 6px;
}

.settings-actions button {
  border: 1px solid #385176;
  border-radius: 8px;
  background: #274b7c;
  color: #fff;
  padding: 8px 14px;
  font-weight: 700;
  font-size: .9rem;
}

.settings-status {
  margin: 0;
  color: var(--muted);
  font-size: .8rem;
}

.password-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.password-row input {
  flex: 1;
}

.password-row button {
  border: 1px solid #385176;
  border-radius: 8px;
  background: #15233a;
  color: var(--text);
  padding: 6px 9px;
  font-size: .8rem;
  font-weight: 700;
  white-space: nowrap;
}
.settings-panel[hidden] { display: none !important; }
