/* Author profile dialog. Scoped to avoid changing dashboard cards or tables. */
#author-modal .modal-content {
  width: min(820px, calc(100vw - 40px));
  max-width: none;
  max-height: calc(100dvh - 72px);
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow-y: auto;
  background: var(--bg-card);
}
#author-modal .modal-close { top: 20px; right: 20px; z-index: 3; width: 32px; height: 32px; }
.author-profile { font-size: 13px; line-height: 1.5; color: var(--text); }
.author-profile *, .author-profile *::before, .author-profile *::after { box-sizing: border-box; }
.ap-header { display: flex; gap: 16px; padding: 28px 64px 22px 28px; align-items: center; }
.ap-avatar { width: 56px; height: 56px; flex: 0 0 56px; display: grid; place-items: center; border-radius: 15px; background: rgba(99,102,241,.1); color: var(--accent); font-size: 21px; }
.ap-heading { min-width: 0; }
.ap-eyebrow { margin: 0 0 3px; text-transform: uppercase; letter-spacing: .08em; font-size: 10px; font-weight: 600; color: var(--text-secondary); }
.author-profile h2 { margin: 0; font-size: 21px; font-weight: 700; line-height: 1.3; overflow-wrap: anywhere; }
.ap-affiliation { margin: 6px 0 3px; color: var(--text-secondary); font-size: 12px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ap-identity { margin: 0; color: var(--text-secondary); font-size: 11px; }
.ap-identity span { margin-left: 5px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.ap-tabs { display: flex; gap: 24px; padding: 0 28px; border-bottom: 1px solid var(--border); }
.ap-tabs button { appearance: none; background: none; border: 0; border-bottom: 2px solid transparent; padding: 11px 0; color: var(--text-secondary); font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.ap-tabs button[aria-selected="true"] { color: var(--accent); border-bottom-color: var(--accent); }
.ap-tabs button span { margin-left: 4px; padding: 1px 6px; border-radius: 5px; background: var(--bg-elevated); font-size: 10px; }
.author-profile button:focus-visible, .author-profile a:focus-visible, .author-profile summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.ap-panel { padding: 22px 28px 24px; }
.ap-panel[hidden] { display: none; }
.author-profile h3 { margin: 0; font-size: 13px; line-height: 1.5; font-weight: 650; }
.author-profile h3 small { font-weight: 400; font-size: 11px; color: var(--text-secondary); margin-left: 6px; }
.author-profile h4 { margin: 14px 0 7px; font-size: 12px; }
.ap-section-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.ap-caption { font-size: 11px; color: var(--text-secondary); margin: 0; }
.ap-metrics { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); border: 1px solid var(--border); border-radius: 10px; background: var(--bg-primary); margin: 0; padding: 14px 0; }
.ap-metric { min-width: 0; padding: 0 18px; border-right: 1px solid var(--border); }
.ap-metric:last-child { border-right: none; }
.ap-metric dt { font-size: 11px; color: var(--text-secondary); margin: 0 0 4px; }
.ap-metric dd { font-size: 23px; line-height: 1.25; letter-spacing: -.5px; font-weight: 650; font-variant-numeric: tabular-nums; margin: 0; color: var(--text); }
.ap-metrics-two { grid-template-columns: repeat(2,minmax(0,1fr)); max-width: 440px; }
.ap-section { margin-top: 22px; }
.ap-section > h3 { margin-bottom: 10px; }
.ap-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.ap-chip { padding: 4px 9px; background: var(--bg-elevated); border-radius: 5px; color: var(--text-secondary); font-size: 11px; overflow-wrap: anywhere; max-width: 100%; }
.ap-text-button { font: inherit; font-size: 11px; font-weight: 600; background: none; border: 0; padding: 0; color: var(--accent); cursor: pointer; }
.ap-works { margin: 0; padding: 0; list-style: none; }
.ap-works li { display: flex; gap: 18px; align-items: flex-start; padding: 12px 0; border-bottom: 1px solid var(--border); }
.ap-works li:first-child { padding-top: 0; }
.ap-works li:last-child { border-bottom: none; padding-bottom: 0; }
.ap-work-info { flex: 1; min-width: 0; }
.ap-work-title { font-size: 12px; font-weight: 550; line-height: 1.5; overflow-wrap: anywhere; }
.ap-works-compact .ap-work-title { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ap-work-meta { font-size: 10px; color: var(--text-secondary); margin-top: 4px; overflow-wrap: anywhere; }
.ap-work-meta a { color: var(--accent); text-decoration: none; }
.ap-work-cites { flex: 0 0 58px; text-align: right; }
.ap-work-cites b { display: block; font-size: 15px; font-weight: 600; color: var(--text); }
.ap-work-cites span { font-size: 10px; color: var(--text-secondary); }
.ap-details { margin-top: 18px; border-top: 1px solid var(--border); padding-top: 12px; color: var(--text-secondary); font-size: 12px; }
.ap-details summary { cursor: pointer; font-weight: 500; }
.ap-details > p { font-size: 11px; margin: 10px 0 0; line-height: 1.7; }
.ap-source-links { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 18px; }
.ap-source-links a { display: inline-flex; font-size: 11px; font-weight: 600; color: var(--accent); text-decoration: none; padding: 5px 10px; border: 1px solid var(--border); border-radius: 6px; }
.ap-source-links a:hover { background: var(--bg-elevated); }
.ap-source-label { color: var(--text-secondary); font-size: 11px; background: var(--bg-elevated); border-radius: 5px; padding: 2px 8px; }
.ap-global-note { margin-top: 8px; }
.ap-biography { margin: 0; color: var(--text-secondary); font-size: 12px; line-height: 1.7; overflow-wrap: anywhere; }
.ap-history { padding-left: 18px; margin: 10px 0; }
.ap-history li { padding-bottom: 8px; overflow-wrap: anywhere; }
.ap-history small { display: block; font-size: 10px; color: var(--text-secondary); }
.ap-coauthors > div { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; }
.ap-coauthors > div > span { flex-shrink: 0; font-size: 11px; }
.ap-footnote { color: var(--text-secondary); font-size: 10px; margin: 20px 0 0; }
.ap-notice { color: var(--text-secondary); font-size: 11px; margin: 8px 0; }
.ap-empty { text-align: center; padding: 28px 16px; color: var(--text-secondary); }
.ap-empty > i { font-size: 30px; color: var(--accent); margin-bottom: 12px; }
.ap-empty p { margin: 8px auto 0; max-width: 340px; font-size: 12px; }
@media (max-width: 600px) {
  #author-modal .modal-content { width: calc(100vw - 24px); max-height: calc(100dvh - 40px); }
  .ap-header { padding: 22px 52px 18px 18px; gap: 12px; }
  .ap-avatar { width: 42px; height: 42px; flex-basis: 42px; font-size: 17px; border-radius: 11px; }
  .author-profile h2 { font-size: 18px; }
  .ap-tabs { padding: 0 18px; gap: 20px; }
  .ap-panel { padding: 18px; }
  .ap-metrics { grid-template-columns: repeat(2,minmax(0,1fr)); row-gap: 16px; }
  .ap-metric:nth-child(2) { border-right: none; }
  .ap-metric { padding: 0 14px; }
  .ap-metric dd { font-size: 22px; }
  .author-profile h3 small { display: block; margin-left: 0; }
}
