/* ===== Account Tab ===== */

.account-layout {
  display: grid;
  gap: 1.25rem;
  max-width: 900px;
  margin: 1.25rem auto 0;
}

/* Two short cards share a row; the token card below spans, because it carries a list */
.account-split { display: grid; gap: 1.25rem; }
@media (min-width: 680px) {
  .account-split { grid-template-columns: 1fr 1fr; align-items: start; }
}

.account-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.5rem 1.75rem;
  box-shadow: 0 1px 4px var(--shadow-sm);
}

/* ─── Identity strip ───────────────────────────────────────────────────────── */

.account-identity {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem 1.25rem;
  box-shadow: 0 1px 4px var(--shadow-sm);
}

.account-avatar {
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  border-radius: 50%;
  background: var(--primary);
  color: var(--surface);
  display: grid;
  place-items: center;
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.account-identity-who { min-width: 0; }
.account-identity-name { font-size: 1.05rem; font-weight: 600; color: var(--text); line-height: 1.25; }
.account-identity-sub  { font-size: 0.78rem; color: var(--text-muted); }

/* Pushed to the far edge so the strip reads name-left, state-right at any width */
.account-identity-chips {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-left: auto;
}

.account-card-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 1.1rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--border-light);
}

/* One line of scope under a card's rule — same muted treatment as the identity subtitle */
.account-card-note {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.account-field { margin-bottom: 0.9rem; }
.account-field-label {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.3rem;
}
.account-field-input {
  width: 100%;
  padding: 0.45rem 0.65rem;
}
.account-field-input:focus { outline: none; border-color: var(--primary); }

.account-pw-error   { font-size: 0.82rem; color: var(--danger);  min-height: 1.1rem; }
.account-pw-success { font-size: 0.82rem; color: var(--success); min-height: 1.1rem; }

/* Notification preferences grid */
.notif-prefs-header,
.notif-prefs-row {
  display: grid;
  grid-template-columns: 1fr 60px 60px;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0;
}

.notif-prefs-header {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  border-bottom: 1px solid var(--border-light);
}
.notif-prefs-header span:not(:first-child) {
  text-align: center;
}

.notif-prefs-row {
  border-bottom: 1px solid var(--border-light);
}
.notif-prefs-row:last-child { border-bottom: none; }

.notif-prefs-row-label {
  font-size: 0.875rem;
  color: var(--text);
}

.notif-prefs-row input[type="checkbox"] {
  justify-self: center;
  cursor: pointer;
}


/* ─── MCP access tokens ────────────────────────────────────────────────────── */

/* The plaintext, shown once after minting and never recoverable afterwards */
.acct-token-reveal {
  margin-top: 0.75rem;
  padding: 0.65rem 0.75rem;
  background: var(--warning-bg, var(--table-surface));
  border: 1px solid var(--border);
  border-left: 3px solid var(--primary);
}

.acct-token-reveal-title {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-sub);
  margin-bottom: 0.4rem;
}

.acct-token-plaintext {
  display: block;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 0.78rem;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border-light);
  padding: 0.4rem 0.5rem;
  /* a 51-character token must wrap rather than widen the card */
  word-break: break-all;
  margin-bottom: 0.45rem;
}

.account-token-form { display: grid; gap: 0.75rem; align-items: end; margin-bottom: 0.5rem; }
@media (min-width: 560px) {
  .account-token-form { grid-template-columns: 1fr 150px auto; }
  .account-token-form .account-field { margin-bottom: 0; }
}

.acct-token-list {
  margin-top: 0.85rem;
  border-top: 1px solid var(--border-light);
}

.acct-token-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border-light);
}
.acct-token-row:last-child { border-bottom: none; }

.acct-token-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  min-width: 0;
}

.acct-token-prefix {
  font-family: ui-monospace, Consolas, monospace;
  font-size: 0.8rem;
  color: var(--text);
}

/* A connected app's row leads with its name where a key's leads with its prefix */
.acct-app-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
}

.acct-token-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  overflow-wrap: anywhere;
}

.acct-token-empty {
  font-size: 0.85rem;
  color: var(--text-muted);
  padding: 0.5rem 0;
}

.btn-revoke {
  flex: 0 0 auto;
  font-size: 0.75rem;
  padding: 0.2rem 0.55rem;
  color: var(--danger);
  background: transparent;
  border: 1px solid var(--danger-border);
  border-radius: 2px;
  cursor: pointer;
}
.btn-revoke:hover  { background: var(--danger-bg); }
.btn-revoke:disabled { opacity: 0.5; cursor: default; }
