/* Profile dashboard surface: copied/adapted from bentogrid/base.css + theme-dark.css. */
:root,
:root[data-theme="dark"] {
  --bg: #0e0e0e;
  --card-bg: transparent;
  --card-bg-elevated: rgba(255, 255, 255, 0.04);
  --text: #d4d4d4;
  --text-muted: rgba(212, 212, 212, 0.45);
  --border: rgba(212, 212, 212, 0.12);
  --border-strong: rgba(212, 212, 212, 0.22);
  --accent: #d4d4d4;
  --accent-text: #0e0e0e;
  --status: #9aa39a;
  --card-radius: 0;
  --card-padding: 22px;
  --shadow: none;
  --font-ui: "DM Mono", "VT323", "Courier New", ui-monospace, monospace;
  --font-mono: "DM Mono", "Courier New", ui-monospace, monospace;
  --letter-spacing: 0.02em;
  --texture: repeating-linear-gradient(0deg, transparent 0px, transparent 2px, rgba(255, 255, 255, 0.022) 2px, rgba(255, 255, 255, 0.022) 3px);
}

.profile-dashboard-page {
  min-height: 100vh;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 14px;
  line-height: 1.5;
  letter-spacing: var(--letter-spacing);
  overflow: auto;
  position: relative;
}

.profile-dashboard-page::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: var(--texture);
}

.profile-dashboard-page::after { display: none; }

.profile-dashboard-page button,
.profile-dashboard-page input,
.profile-dashboard-page textarea {
  font: inherit;
}

.profile-dashboard-page button {
  background: none;
  border: none;
  color: inherit;
  cursor: pointer;
}

.profile-dashboard-page .layout-bar,
.profile-dashboard-page .account-mark,
.profile-dashboard-page .account-shell,
.profile-dashboard-page .grid {
  position: relative;
  z-index: 1;
}

.profile-dashboard-page .layout-bar {
  position: fixed;
  top: 20px;
  left: 20px;
  z-index: 100;
  display: flex;
  gap: 4px;
  padding: 4px;
  max-width: calc(100vw - 40px);
  background: transparent;
  border: 1px solid var(--border-strong);
  border-radius: 0;
  box-shadow: none;
}

.profile-dashboard-page .layout-btn,
.profile-dashboard-page .btn,
.profile-dashboard-page .account-button,
.profile-dashboard-page .account-copy-button,
.profile-dashboard-page .account-text-button {
  min-height: 30px;
  width: auto;
  padding: 6px 14px;
  border: 1px solid var(--border-strong);
  border-radius: 0;
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  transition: color 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.profile-dashboard-page .layout-btn:hover,
.profile-dashboard-page .btn:hover,
.profile-dashboard-page .account-button:hover,
.profile-dashboard-page .account-copy-button:hover,
.profile-dashboard-page .account-text-button:hover {
  color: var(--text);
  border-color: var(--text);
}

.profile-dashboard-page .layout-btn[aria-pressed="true"],
.profile-dashboard-page .btn--primary,
.profile-dashboard-page .account-button {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
}

.profile-dashboard-page .btn--ghost,
.profile-dashboard-page .account-text-button,
.profile-dashboard-page .account-copy-button {
  background: transparent;
  color: var(--text);
}

.profile-dashboard-page .account-shell {
  width: 100%;
  min-height: 100vh;
  margin: 0;
  padding: 80px 0 0;
  display: block;
}

.profile-dashboard-page .account-mark {
  max-width: var(--station-shell-width, 1200px);
  margin: 0 auto;
  padding: 0 24px 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.profile-dashboard-page .account-mark img {
  width: 44px;
  height: 44px;
  border: 1px solid var(--border-strong);
  object-fit: contain;
}

.profile-dashboard-page .account-panel[hidden] { display: none; }

.profile-dashboard-page .account-panel,
.profile-dashboard-page .profile-panel {
  max-width: var(--station-shell-width, 1200px);
  margin: 0 auto;
  padding: 16px 24px 80px;
  border: 0;
  background: transparent;
  backdrop-filter: none;
}

.profile-dashboard-page [data-profile-empty] {
  display: grid;
  gap: 18px;
  padding-top: 16px;
}

.profile-dashboard-page .profile-bento-grid {
  --grid-columns: 8;
  --grid-row-height: 180px;
  --grid-gap: 16px;
  max-width: var(--station-shell-width, 1200px);
  width: auto;
  min-height: 0;
  margin: 0 auto;
  padding: 0;
  position: relative;
  display: grid;
  grid-template-columns: repeat(var(--grid-columns), minmax(0, 1fr));
  grid-auto-rows: var(--grid-row-height);
  gap: var(--grid-gap);
  align-content: start;
  overflow: visible;
}

.profile-dashboard-page .grid-guide,
.profile-dashboard-page .grid-drop-preview {
  position: absolute;
  pointer-events: none;
  opacity: 0;
}

.profile-dashboard-page .grid-guide {
  z-index: 3;
  display: grid;
  transition: opacity 0.15s ease;
}

.profile-dashboard-page .grid-guide-cell {
  min-width: 0;
  min-height: 0;
  border: 1px dashed color-mix(in srgb, var(--border-strong) 65%, transparent);
  background: color-mix(in srgb, var(--card-bg) 42%, transparent);
  border-radius: 0;
}

.profile-dashboard-page .grid-drop-preview {
  z-index: 4;
  border: 1px solid var(--accent);
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  border-radius: 0;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 35%, transparent);
  transition: opacity 0.12s ease, border-color 0.12s ease, background 0.12s ease;
}

.profile-dashboard-page .grid.is-layout-dragging .grid-guide,
.profile-dashboard-page .grid.is-layout-dragging .grid-drop-preview {
  opacity: 1;
}

.profile-dashboard-page .grid-drop-preview.is-invalid {
  border-color: var(--status);
  background: color-mix(in srgb, var(--status) 12%, transparent);
}

.profile-dashboard-page .card,
.profile-dashboard-page .profile-hero,
.profile-dashboard-page .profile-stat,
.profile-dashboard-page .credential-panel,
.profile-dashboard-page .mcp-client-card,
.profile-dashboard-page .profile-action-card {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
  min-height: 0;
  padding: var(--card-padding);
  overflow: hidden;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: 0;
  box-shadow: none;
  -webkit-backdrop-filter: blur(6px) brightness(1.06);
  backdrop-filter: blur(6px) brightness(1.06);
  opacity: 1;
  transform: none;
  transition: transform 0.25s ease, border-color 0.25s ease, background 0.25s ease;
}

.profile-dashboard-page .card:hover { border-color: var(--border-strong); }
.profile-dashboard-page .card.is-drag-source,
.profile-dashboard-page .bento-card.is-drag-source { opacity: 0.28; }

.profile-dashboard-page .profile-hero {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 18px;
}

.profile-dashboard-page .profile-avatar {
  width: 76px;
  height: 76px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  border: 1px solid var(--border-strong);
  border-radius: 0;
  background: transparent;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 32px;
  letter-spacing: 0;
  text-transform: uppercase;
}

.profile-dashboard-page .profile-identity-info {
  min-width: 0;
  display: grid;
  gap: 8px;
}

.profile-dashboard-page .card-title,
.profile-dashboard-page .account-kicker,
.profile-dashboard-page .account-label,
.profile-dashboard-page .card-subtitle,
.profile-dashboard-page small {
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.profile-dashboard-page .card-title::before,
.profile-dashboard-page .account-label::before {
  content: "> ";
  color: var(--text);
}

.profile-dashboard-page .profile-email,
.profile-dashboard-page .account-title {
  max-width: 100%;
  margin: 0;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: clamp(24px, 4vw, 52px);
  font-weight: 400;
  line-height: 1;
  letter-spacing: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-dashboard-page .profile-subtitle,
.profile-dashboard-page .account-copy,
.profile-dashboard-page .account-status {
  max-width: 38rem;
  margin: 0;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.55;
}

.profile-dashboard-page .profile-stat {
  justify-content: space-between;
}

.profile-dashboard-page .profile-stat--primary {
  border-color: var(--border);
  background: rgba(255, 255, 255, 0.03);
}

.profile-dashboard-page .profile-stat-value {
  color: var(--text);
  font-family: var(--font-mono);
  font-size: clamp(24px, 4vw, 44px);
  font-weight: 400;
  line-height: 1;
}

.profile-dashboard-page .credential-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: stretch;
  gap: 8px;
  min-height: 0;
}

.profile-dashboard-page .credential-input,
.profile-dashboard-page .account-input,
.profile-dashboard-page .account-textarea {
  width: 100%;
  min-width: 0;
  min-height: 42px;
  border: 1px solid var(--border-strong);
  border-radius: 0;
  background: transparent;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.45;
  padding: 10px 12px;
  outline: none;
  resize: none;
}

.profile-dashboard-page .credential-input:focus,
.profile-dashboard-page .account-input:focus,
.profile-dashboard-page .account-textarea:focus {
  border-color: var(--text);
}

.profile-dashboard-page .mcp-config-box {
  min-height: 100%;
  overflow: auto;
}

.profile-dashboard-page .profile-action-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
}

.profile-dashboard-page .account-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.profile-dashboard-page .account-status[data-tone="success"] { color: var(--text); }
.profile-dashboard-page .account-status[data-tone="error"] { color: #ff5a3d; }

.profile-dashboard-page .card-drag-handle,
.profile-dashboard-page .card-resize-handle {
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  border: 1px solid var(--border-strong);
  border-radius: 50%;
  color: var(--text-muted);
  width: 28px;
  height: 28px;
  z-index: 6;
}

.profile-dashboard-page .grid.is-layout-editing .card-drag-handle,
.profile-dashboard-page .grid.is-layout-editing .card-resize-handle {
  display: inline-flex;
}

.profile-dashboard-page .card-drag-handle::before {
  content: "";
  width: 14px;
  height: 14px;
  background-image: radial-gradient(currentColor 1.3px, transparent 1.4px);
  background-size: 7px 7px;
  background-position: 0 0;
}

.profile-dashboard-page .layout-drag-proxy {
  position: fixed;
  z-index: 250;
  pointer-events: none;
  opacity: 0.92;
  box-shadow: none;
}

.profile-dashboard-page.is-layout-dragging,
body.is-layout-dragging {
  cursor: grabbing;
  user-select: none;
}

@media (min-width: 1400px) {
  .profile-dashboard-page .account-mark,
  .profile-dashboard-page .account-panel,
  .profile-dashboard-page .profile-panel,
  .profile-dashboard-page .profile-bento-grid {
    --station-shell-width: min(calc(100vw - 80px), 1600px);
  }
}

@media (max-width: 1100px) {
  .profile-dashboard-page .layout-bar { display: none; }
  .profile-dashboard-page .profile-bento-grid {
    --grid-columns: 4;
    grid-auto-rows: minmax(170px, auto);
  }
  .profile-dashboard-page .profile-bento-grid > .card {
    grid-column: span 2 !important;
    grid-row: span 2 !important;
  }
  .profile-dashboard-page .profile-bento-grid > .profile-stat,
  .profile-dashboard-page .profile-bento-grid > .credential-panel {
    grid-row: span 1 !important;
  }
}

@media (max-width: 680px) {
  .profile-dashboard-page .account-shell { padding-top: 24px; }
  .profile-dashboard-page .account-mark,
  .profile-dashboard-page .account-panel,
  .profile-dashboard-page .profile-panel {
    padding-left: 16px;
    padding-right: 16px;
  }
  .profile-dashboard-page .profile-bento-grid {
    --grid-columns: 1;
    grid-template-columns: 1fr;
    grid-auto-rows: minmax(160px, auto);
  }
  .profile-dashboard-page .profile-bento-grid > .card {
    grid-column: span 1 !important;
    grid-row: auto !important;
    min-height: 180px;
  }
  .profile-dashboard-page .profile-hero,
  .profile-dashboard-page .profile-action-card,
  .profile-dashboard-page .credential-row {
    grid-template-columns: 1fr;
  }
  .profile-dashboard-page .profile-email,
  .profile-dashboard-page .account-title {
    white-space: normal;
    overflow-wrap: anywhere;
  }
}