/*
 * Profile page styles — 6 sub-tabs, 2-column grid, inline-edit cells.
 * Extracted from specs/v2-profile-prototype-APR-23.html (profile block).
 * Brand tokens come from tokens.css; radii, Border Fawn dividers, and the
 * Accent Teal highlight follow brand/us-grant-guide-brand-guidelines.md v0.2.
 */

.pf-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}
.pf-header h1 {
  margin: 0 0 0.25rem;
  font-size: 1.875rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ugf-ink);
}
.pf-header p {
  margin: 0;
  color: var(--ugf-slate);
  font-size: 0.9375rem;
}
.pf-header-right { flex-shrink: 0; }

.completeness-card {
  min-width: 220px;
  background: var(--ugf-surface);
  border: 1px solid var(--ugf-border);
  border-radius: var(--ugf-radius-md);
  padding: 0.75rem 0.875rem;
}
.completeness-row1 {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 0.75rem;
  color: var(--ugf-slate);
  font-weight: 500;
  margin-bottom: 0.3rem;
}
.pct-big {
  color: var(--ugf-accent);
  font-size: 0.9375rem;
  font-weight: 700;
}
.progress-bar {
  height: 5px;
  background: var(--ugf-surface-muted);
  border-radius: 999px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: var(--ugf-accent);
  transition: width 180ms ease-out;
}

.profile-tabs {
  display: flex;
  gap: 2px;
  border-bottom: 1px solid var(--ugf-border);
  margin: 1rem 0;
  overflow-x: auto;
}
.ptab {
  padding: 0.625rem 0.875rem;
  background: transparent;
  border: none;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--ugf-slate);
  cursor: pointer;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.ptab:hover { color: var(--ugf-ink); }
.ptab.ptab-active {
  color: var(--ugf-accent);
  border-bottom-color: var(--ugf-accent);
  font-weight: 600;
}
.ptab-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.75rem;
  padding: 0.05rem 0.4rem;
  background: var(--ugf-surface-muted);
  color: var(--ugf-slate);
  border-radius: 999px;
  font-size: 0.6875rem;
  font-weight: 500;
  font-family: var(--gf-font-mono);
}
.ptab-active .ptab-count {
  background: var(--ugf-accent-tint);
  color: var(--ugf-accent);
}

.ptab-content { display: none; }
.ptab-content.ptab-active { display: block; }

.pf-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem 0.75rem;
}

.pf-cell {
  position: relative;
  padding: 0.625rem 0.75rem;
  background: var(--ugf-surface);
  border: 1px solid var(--ugf-border);
  border-radius: 7px;
  cursor: pointer;
  transition: border-color 120ms, background-color 120ms;
}
.pf-cell:hover,
.pf-cell:focus-visible {
  border-color: var(--ugf-accent);
  background: var(--ugf-accent-tint);
  outline: none;
}
.pf-cell:hover .pf-action,
.pf-cell:focus-visible .pf-action { opacity: 1; }
.pf-cell:hover .pf-prov,
.pf-cell:focus-visible .pf-prov { display: block; }

.pf-empty {
  background: transparent;
  border-style: dashed;
}
.pf-empty:hover,
.pf-empty:focus-visible {
  background: var(--ugf-surface-muted);
}

.pf-label {
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--ugf-slate);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.pf-value {
  font-size: 0.875rem;
  color: var(--ugf-ink);
  margin-top: 0.15rem;
  line-height: 1.35;
  word-wrap: break-word;
}
.pf-unanswered {
  color: var(--ugf-text-soft);
  font-style: italic;
}
.pf-prov {
  font-size: 0.6875rem;
  color: var(--ugf-text-soft);
  margin-top: 0.25rem;
  display: none;
}
.pf-action {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  font-size: 0.6875rem;
  font-weight: 500;
  color: var(--ugf-accent);
  opacity: 0;
  transition: opacity 120ms;
}

/* Editing state — cell expands, input takes over. */
.pf-cell.pf-editing {
  cursor: default;
  background: var(--ugf-surface);
  border-color: var(--ugf-accent);
  border-style: solid;
  padding: 0.75rem;
  grid-column: span 1;
}
.pf-input {
  margin-top: 0.4rem;
  width: 100%;
  padding: 0.4rem 0.5rem;
  font-family: inherit;
  font-size: 0.875rem;
  color: var(--ugf-ink);
  background: var(--ugf-surface);
  border: 1px solid var(--ugf-border-strong);
  border-radius: var(--ugf-radius-sm);
}
.pf-input:focus {
  outline: 2px solid var(--ugf-accent-tint);
  border-color: var(--ugf-accent);
}
.pf-multi {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.75rem;
  margin-top: 0.4rem;
}
.pf-multi-opt {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.8125rem;
  color: var(--ugf-ink);
}
.pf-partner {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  margin-top: 0.4rem;
}
.pf-partner .pf-input { margin-top: 0; }

.pf-edit-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.625rem;
}
.pf-save,
.pf-cancel {
  padding: 0.35rem 0.75rem;
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 500;
  border-radius: var(--ugf-radius-sm);
  cursor: pointer;
  border: 1px solid var(--ugf-border-strong);
}
.pf-save {
  background: var(--ugf-accent);
  color: var(--ugf-surface);
  border-color: var(--ugf-accent);
}
.pf-save:hover { background: var(--ugf-accent-ink); }
.pf-cancel {
  background: var(--ugf-surface);
  color: var(--ugf-slate);
}
.pf-cancel:hover { color: var(--ugf-ink); }

/* Projects tab (T10) -- list of project cards + inline editor. */
.projects-pane { display: flex; flex-direction: column; gap: 0.75rem; }
.projects-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 0.625rem;
}
.projects-add-row { display: flex; justify-content: flex-start; }
.projects-add-btn {
  padding: 0.45rem 0.875rem;
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 500;
  border-radius: var(--ugf-radius-sm);
  cursor: pointer;
}
.btn-ghost.projects-add-btn {
  background: transparent;
  color: var(--ugf-accent);
  border: 1px dashed var(--ugf-accent);
}
.btn-ghost.projects-add-btn:hover { background: var(--ugf-accent-tint); }

.proj-card {
  position: relative;
  padding: 0.875rem;
  background: var(--ugf-surface);
  border: 1px solid var(--ugf-border);
  border-radius: var(--ugf-radius-md);
  cursor: pointer;
  transition: border-color 120ms, background-color 120ms;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.proj-card:hover,
.proj-card:focus-visible {
  border-color: var(--ugf-accent);
  background: var(--ugf-accent-tint);
  outline: none;
}
.proj-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
.proj-badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  background: var(--ugf-surface-muted);
  color: var(--ugf-slate);
}
.proj-badge-research      { background: var(--ugf-accent-tint); color: var(--ugf-accent); }
.proj-badge-development   { background: #FFF4E5; color: #A05A00; }
.proj-badge-translational { background: #EFE7FB; color: #5B3AA5; }
.proj-badge-clinical      { background: #E6F4EA; color: #1E7C3A; }
.proj-badge-other         { background: var(--ugf-surface-muted); color: var(--ugf-slate); }

.proj-name {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--ugf-ink);
  line-height: 1.3;
  word-wrap: break-word;
}
.proj-excerpt {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--ugf-slate);
  line-height: 1.4;
}
.proj-excerpt-empty { color: var(--ugf-text-soft); font-style: italic; }
.proj-meta {
  font-size: 0.75rem;
  color: var(--ugf-text-soft);
  font-family: var(--gf-font-mono);
}
.proj-edit-btn {
  background: transparent;
  border: none;
  color: var(--ugf-accent);
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  padding: 0.2rem 0.4rem;
}
.proj-edit-btn:hover { text-decoration: underline; }

/* Empty state */
.projects-empty {
  padding: 1.75rem 1rem;
  text-align: center;
  border: 1px dashed var(--ugf-border);
  border-radius: var(--ugf-radius-md);
  background: var(--ugf-surface-muted);
}
.projects-empty-title {
  margin: 0 0 0.375rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--ugf-ink);
}
.projects-empty-body {
  margin: 0 auto 0.875rem;
  max-width: 420px;
  font-size: 0.875rem;
  color: var(--ugf-slate);
  line-height: 1.4;
}

/* Inline editor header (one project opened). */
.proj-editor { display: flex; flex-direction: column; gap: 0.875rem; }
.proj-editor-header {
  display: grid;
  grid-template-columns: auto 1fr auto auto auto;
  align-items: end;
  gap: 0.75rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--ugf-border);
}
.proj-back-btn {
  grid-column: 1 / -1;
  justify-self: start;
  background: transparent;
  border: none;
  color: var(--ugf-accent);
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  padding: 0;
  margin-bottom: 0.25rem;
}
.proj-back-btn:hover { text-decoration: underline; }
.proj-sublabel {
  display: block;
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--ugf-slate);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 0.2rem;
}
.proj-name-input,
.proj-type-select {
  width: 100%;
  padding: 0.4rem 0.55rem;
  font-family: inherit;
  font-size: 0.9375rem;
  color: var(--ugf-ink);
  background: var(--ugf-surface);
  border: 1px solid var(--ugf-border-strong);
  border-radius: var(--ugf-radius-sm);
}
.proj-name-input:focus,
.proj-type-select:focus {
  outline: 2px solid var(--ugf-accent-tint);
  border-color: var(--ugf-accent);
}
.proj-editor-meta {
  font-size: 0.75rem;
  color: var(--ugf-text-soft);
  font-family: var(--gf-font-mono);
  white-space: nowrap;
  padding-bottom: 0.45rem;
}
.proj-remove-btn {
  padding: 0.35rem 0.6rem;
  font-family: inherit;
  font-size: 0.75rem;
  color: var(--ugf-slate);
  background: transparent;
  border: 1px solid var(--ugf-border-strong);
  border-radius: var(--ugf-radius-sm);
  cursor: pointer;
}
.proj-remove-btn:hover { color: #b3261e; border-color: #b3261e; }

@media (max-width: 640px) {
  .proj-editor-header { grid-template-columns: 1fr; }
  .proj-editor-meta, .proj-remove-btn { justify-self: start; }
  .projects-list { grid-template-columns: 1fr; }
}

/* Projects drop zone (T13) -- compact upload surface above the project list.
   Kept visually less prominent than the wizard's focal drop zone so this
   maintenance surface does not steal attention on the Projects tab. */
.project-dropzone {
  border: 1px dashed var(--ugf-border-strong);
  border-radius: var(--ugf-radius-md);
  padding: 0.75rem 0.875rem;
  background: var(--ugf-surface);
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.project-dropzone-reupload {
  border-color: var(--ugf-accent);
  background: var(--ugf-accent-tint);
}
.pdz-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}
.pdz-header-text { display: flex; flex-direction: column; gap: 0.1rem; min-width: 0; }
.pdz-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--ugf-ink);
}
.pdz-subtitle {
  font-size: 0.75rem;
  color: var(--ugf-slate);
}
.pdz-cancel-reupload {
  background: transparent;
  border: none;
  color: var(--ugf-slate);
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  padding: 0.2rem 0.4rem;
  align-self: flex-start;
}
.pdz-cancel-reupload:hover { color: #b3261e; text-decoration: underline; }

.pdz-surface {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.625rem 0.875rem;
  border: 1px dashed var(--ugf-border);
  border-radius: var(--ugf-radius-sm);
  background: var(--ugf-surface-muted);
  transition: border-color 120ms, background-color 120ms;
}
.pdz-surface-drop { cursor: pointer; }
.pdz-surface-drop:hover,
.pdz-surface-drop:focus-visible,
.pdz-surface-hot {
  border-color: var(--ugf-accent);
  background: var(--ugf-accent-tint);
  outline: none;
}
.pdz-surface-busy { opacity: 0.75; cursor: progress; }
.pdz-drop-icon {
  font-size: 0.9375rem;
  color: var(--ugf-accent);
  font-weight: 700;
}
.pdz-drop-hint {
  font-size: 0.8125rem;
  color: var(--ugf-slate);
  flex: 1;
}
.pdz-pick-btn,
.pdz-paste-toggle,
.pdz-submit-paste {
  padding: 0.35rem 0.75rem;
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 500;
  border-radius: var(--ugf-radius-sm);
  cursor: pointer;
  border: 1px solid var(--ugf-border-strong);
  background: var(--ugf-surface);
  color: var(--ugf-ink);
}
.pdz-pick-btn:hover,
.pdz-paste-toggle:hover { border-color: var(--ugf-accent); color: var(--ugf-accent); }
.pdz-paste-toggle {
  background: transparent;
  border-style: dashed;
  color: var(--ugf-slate);
}
.pdz-submit-paste {
  background: var(--ugf-accent);
  color: var(--ugf-surface);
  border-color: var(--ugf-accent);
}
.pdz-submit-paste:hover { background: var(--ugf-accent-ink); }
.pdz-submit-paste:disabled { opacity: 0.6; cursor: wait; }
.pdz-file-input {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}
.pdz-surface-paste {
  flex-direction: column;
  align-items: stretch;
  cursor: default;
  background: var(--ugf-surface);
}
.pdz-textarea {
  width: 100%;
  min-height: 96px;
  padding: 0.5rem 0.625rem;
  font-family: inherit;
  font-size: 0.875rem;
  color: var(--ugf-ink);
  background: var(--ugf-surface);
  border: 1px solid var(--ugf-border-strong);
  border-radius: var(--ugf-radius-sm);
  resize: vertical;
}
.pdz-textarea:focus {
  outline: 2px solid var(--ugf-accent-tint);
  border-color: var(--ugf-accent);
}
.pdz-paste-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  justify-content: flex-end;
}
.pdz-status {
  font-size: 0.75rem;
  padding: 0.35rem 0.6rem;
  border-radius: var(--ugf-radius-sm);
}
.pdz-status-error {
  background: #FBEAEA;
  color: #b3261e;
  border: 1px solid #F3C3C3;
}
.pdz-status-busy {
  background: var(--ugf-accent-tint);
  color: var(--ugf-accent);
  border: 1px solid var(--ugf-accent);
}

/* Per-project action row (T13) -- Edit, Re-upload, Delete. */
.proj-actions {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-top: 0.15rem;
}
.proj-action {
  padding: 0.3rem 0.55rem;
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 500;
  border-radius: var(--ugf-radius-sm);
  border: 1px solid var(--ugf-border);
  background: var(--ugf-surface);
  color: var(--ugf-slate);
  cursor: pointer;
  transition: border-color 120ms, color 120ms, background-color 120ms;
}
.proj-action:hover { border-color: var(--ugf-accent); color: var(--ugf-accent); }
.proj-action-edit:hover { background: var(--ugf-accent-tint); }
.proj-action-reupload:hover { background: var(--ugf-accent-tint); }
.proj-action-delete:hover { border-color: #b3261e; color: #b3261e; }

.proj-source {
  font-size: 0.6875rem;
  color: var(--ugf-text-soft);
  font-family: var(--gf-font-mono);
  background: var(--ugf-surface-muted);
  border-radius: 999px;
  padding: 0.15rem 0.55rem;
  align-self: flex-start;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.projects-empty-cta {
  padding: 0.45rem 0.875rem;
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 500;
  border-radius: var(--ugf-radius-sm);
  cursor: pointer;
  background: transparent;
  color: var(--ugf-accent);
  border: 1px dashed var(--ugf-accent);
}
.projects-empty-cta:hover { background: var(--ugf-accent-tint); }

/* Privacy strip — residency info is captured but never shown. */
.privacy-strip {
  background: var(--ugf-surface-muted);
  border: 1px solid var(--ugf-border);
  border-radius: 7px;
  padding: 0.625rem 0.875rem;
  margin-top: 1rem;
  font-size: 0.75rem;
  color: var(--ugf-slate);
}
.privacy-strip em { font-style: italic; }

@media (max-width: 640px) {
  .pf-grid { grid-template-columns: 1fr; }
  .pf-header { flex-direction: column; }
  .completeness-card { min-width: 0; width: 100%; }
}
