/* QPal focused sidebar refinements: profile account row, Quick Tips accent,
   About the Developer spacing, and Mock Board History table. */

/* Restore only the About the Developer eyebrow/title gap that preceded the
   universal sidebar spacing. Existing colors and typography are untouched. */
.about-author-dialog .about-author-eyebrow {
  margin-bottom: 12px !important;
}

.about-author-dialog .about-author-app-header h2 {
  margin-top: 0 !important;
}

/* Replace the previous yellow quote rule with the standard QPal orange. */
.quick-tip-popup-dialog .quick-tip-popup-quote {
  border-left-color: var(--accent) !important;
}

/* Standard account-style profile identity row. */
.user-profile-dialog > .user-profile-identity[data-profile-identity] {
  display: grid !important;
  grid-template-columns: 58px minmax(0, 1fr) !important;
  align-items: center !important;
  gap: 14px !important;
  width: 100% !important;
  margin: 16px 0 0 !important;
  padding: 14px !important;
  box-sizing: border-box !important;
  border: 1px solid var(--border-subtle) !important;
  border-radius: 14px !important;
  background: var(--surface-muted) !important;
  box-shadow: var(--inner-highlight) !important;
}

.user-profile-avatar {
  display: grid;
  width: 58px;
  height: 58px;
  place-items: center;
  color: var(--accent-contrast);
  background: var(--accent);
  border: 2px solid color-mix(in srgb, var(--surface-elevated) 85%, transparent);
  border-radius: 50%;
  box-shadow: 0 8px 18px color-mix(in srgb, var(--accent) 28%, transparent);
  font-size: 23px;
  font-weight: 900;
  line-height: 1;
  text-transform: uppercase;
}

.user-profile-account-copy {
  min-width: 0;
}

.user-profile-name-row {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.user-profile-name {
  min-width: 0;
  overflow: hidden;
  color: var(--text-primary);
  font-size: 24px;
  font-weight: 900;
  line-height: 1.12;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-profile-dialog > .user-profile-identity[data-profile-identity]
  .user-profile-edit-button.user-profile-edit-button-compact {
  display: inline-grid !important;
  width: 32px !important;
  min-width: 32px !important;
  height: 32px !important;
  min-height: 32px !important;
  margin: 0 !important;
  padding: 0 !important;
  place-items: center !important;
  flex: 0 0 32px;
  color: var(--text-secondary);
  background: var(--surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 50%;
  box-shadow: none;
}

.user-profile-dialog > .user-profile-identity[data-profile-identity]
  .user-profile-edit-button.user-profile-edit-button-compact:hover:not(:disabled),
.user-profile-dialog > .user-profile-identity[data-profile-identity]
  .user-profile-edit-button.user-profile-edit-button-compact:focus-visible {
  color: var(--accent);
  border-color: var(--accent-border);
  outline: 3px solid var(--focus-ring);
  outline-offset: 1px;
}

.user-profile-edit-button-compact svg {
  width: 15px;
  height: 15px;
}

.user-profile-email {
  margin: 4px 0 0;
  overflow: hidden;
  color: var(--text-secondary);
  font-size: 11px;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-profile-dialog .user-profile-greeting,
.user-profile-dialog .user-profile-membership-since {
  display: none !important;
}

/* Compact three-column Mock Board attempt table. */
.qpal-mock-history-list {
  display: block;
  min-width: 0;
}

.qpal-mock-history-table {
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  background: var(--surface-elevated);
  box-shadow: var(--inner-highlight);
}

.qpal-mock-history-table-head,
.qpal-mock-history-row {
  display: grid;
  grid-template-columns: minmax(88px, .9fr) minmax(120px, 1.25fr) minmax(105px, 1fr);
  align-items: center;
  gap: 12px;
}

.qpal-mock-history-table-head {
  padding: 11px 14px;
  color: var(--text-muted);
  background: var(--surface-muted);
  border-bottom: 1px solid var(--border-subtle);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.qpal-mock-history-table-head span:last-child {
  text-align: right;
}

.qpal-mock-history-rows {
  display: grid;
}

.qpal-mock-history-row {
  min-height: 74px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-subtle);
}

.qpal-mock-history-row:last-child {
  border-bottom: 0;
}

.qpal-mock-history-row > div {
  min-width: 0;
}

.qpal-mock-history-completed,
.qpal-mock-history-attempt-copy,
.qpal-mock-history-result {
  display: grid;
  gap: 4px;
}

.qpal-mock-history-completed strong,
.qpal-mock-history-attempt-copy strong,
.qpal-mock-history-result > strong {
  min-width: 0;
  color: var(--text-primary);
  font-size: 11px;
  font-weight: 850;
  line-height: 1.3;
}

.qpal-mock-history-completed small,
.qpal-mock-history-attempt-copy span,
.qpal-mock-history-result small {
  min-width: 0;
  color: var(--text-secondary);
  font-size: 9px;
  line-height: 1.35;
}

.qpal-mock-history-attempt-copy span {
  color: var(--accent);
  font-weight: 900;
  letter-spacing: .06em;
}

.qpal-mock-history-completed strong,
.qpal-mock-history-attempt-copy strong,
.qpal-mock-history-result small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.qpal-mock-history-result {
  text-align: right;
}

.qpal-mock-history-result > strong {
  display: flex;
  align-items: baseline;
  justify-content: flex-end;
  gap: 7px;
  white-space: nowrap;
}

.qpal-mock-history-result b {
  font-weight: 850;
}

.qpal-mock-history-result em {
  font-size: 13px;
  font-style: normal;
  font-weight: 900;
}

.qpal-mock-history-result em.is-excellent {
  color: var(--success);
}

.qpal-mock-history-result em.is-improving {
  color: var(--warning);
}

.qpal-mock-history-result em.is-practice {
  color: var(--danger);
}

@media (max-width: 480px) {
  .user-profile-dialog > .user-profile-identity[data-profile-identity] {
    grid-template-columns: 52px minmax(0, 1fr) !important;
    gap: 12px !important;
    margin-top: 12px !important;
    padding: 12px !important;
  }

  .user-profile-avatar {
    width: 52px;
    height: 52px;
    font-size: 20px;
  }

  .user-profile-name {
    font-size: 21px;
  }

  .user-profile-email {
    font-size: 10px;
  }

  .qpal-mock-history-table-head,
  .qpal-mock-history-row {
    grid-template-columns: minmax(75px, .85fr) minmax(105px, 1.2fr) minmax(90px, 1fr);
    gap: 8px;
  }

  .qpal-mock-history-table-head {
    padding: 9px 10px;
    font-size: 8px;
  }

  .qpal-mock-history-row {
    min-height: 68px;
    padding: 10px;
  }

  .qpal-mock-history-completed strong,
  .qpal-mock-history-attempt-copy strong,
  .qpal-mock-history-result > strong {
    font-size: 9.5px;
  }

  .qpal-mock-history-completed small,
  .qpal-mock-history-attempt-copy span,
  .qpal-mock-history-result small {
    font-size: 8px;
  }

  .qpal-mock-history-result > strong {
    gap: 5px;
  }

  .qpal-mock-history-result em {
    font-size: 11px;
  }
}

@media (max-width: 350px) {
  .qpal-mock-history-table-head,
  .qpal-mock-history-row {
    grid-template-columns: minmax(68px, .8fr) minmax(96px, 1.15fr) minmax(82px, 1fr);
    gap: 6px;
    padding-inline: 8px;
  }
}
