/* P04: a scoped, progressively disclosed workflow; existing workspace tokens and navigation stay intact. */
.p04-profile {
  --p04-bg: var(--panel, #fff);
  --p04-soft: #f5f7fb;
  --p04-text: #202b3e;
  --p04-muted: #58677d;
  --p04-line: #d9e0ea;
  --p04-blue: #245ee8;
  --p04-warning: #795315;
  --p04-warning-bg: #fff8e9;
  color: var(--p04-text);
  max-width: 1100px;
  margin: 0 auto;
  padding: 20px 4px calc(40px + env(safe-area-inset-bottom, 0px));
  font-size: 16px;
  line-height: 1.65;
  overflow-wrap: anywhere;
}
html[data-theme="dark"] .p04-profile {
  --p04-bg: #111e30;
  --p04-soft: #18283e;
  --p04-text: #e9eff9;
  --p04-muted: #b5c3d8;
  --p04-line: #40516b;
  --p04-blue: #245ee8;
  --p04-warning: #f4d18c;
  --p04-warning-bg: #352a1b;
}
.p04-profile * { box-sizing: border-box; }
#resumeProfileWorkspace [hidden] { display: none !important; }
.p04-profile h2, .p04-profile h3, .p04-profile p { color: inherit; margin: 0; }
.p04-profile h2 { font-size: clamp(24px, 4vw, 32px); letter-spacing: -.02em; }
.p04-profile h3 { font-size: 19px; }
.p04-profile .p04-muted { color: var(--p04-muted); }
.p04-header { display: flex; align-items: start; justify-content: space-between; gap: 20px; margin-bottom: 20px; }
.p04-header p { margin-top: 6px; }
.p04-steps { display: flex; list-style: none; padding: 0; gap: 10px; flex-wrap: wrap; margin: 0 0 20px; color: var(--p04-muted); }
.p04-steps li { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.p04-steps li + li::before { content: "›"; margin-right: 4px; }
.p04-steps [aria-current="step"] { color: var(--p04-text); font-weight: 700; }
.p04-card { background: var(--p04-bg); border: 1px solid var(--p04-line); border-radius: 16px; padding: 24px; margin-bottom: 16px; min-width: 0; }
.p04-card > * + * { margin-top: 16px; }
.p04-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; }
.p04-grid > * { min-width: 0; }
.p04-profile label { display: block; color: var(--p04-text); font-size: 15px; font-weight: 600; }
.p04-profile label > input, .p04-profile label > textarea, .p04-profile label > select { margin-top: 7px; }
.p04-profile :is(input:not([type="checkbox"]), textarea, select) {
  display: block; width: 100%; min-width: 0; min-height: 44px; border: 1px solid var(--p04-line);
  border-radius: 9px; background: var(--p04-bg); color: var(--p04-text); padding: 10px 12px; font: inherit;
}
.p04-profile textarea { resize: vertical; }
.p04-profile textarea::placeholder { color: var(--p04-muted); opacity: 1; }
.p04-profile input[type="file"] { font-size: 14px; }
.p04-profile input[type="checkbox"] { width: 18px; height: 18px; flex: 0 0 18px; accent-color: var(--p04-blue); margin: 3px 0 0; }
.p04-profile .p04-check { display: flex; align-items: start; gap: 10px; font-weight: 400; }
.p04-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.p04-profile .p04-button {
  appearance: none; min-height: 44px; padding: 10px 18px; border: 1px solid var(--p04-line); border-radius: 9px;
  background: var(--p04-bg); color: var(--p04-text); font: inherit; font-weight: 600; cursor: pointer;
  box-shadow: none; transform: none; white-space: normal; line-height: 1.5;
}
.p04-profile .p04-button.p04-primary { background: var(--p04-blue); color: #fff; border-color: var(--p04-blue); }
/* Existing v200 applies !important colors to every dark-theme button. Keep the
 * new workflow's single primary action white on blue (WCAG contrast > 5:1). */
html[data-theme="dark"] #resumeProfileWorkspace .p04-button.p04-primary {
  background: #245ee8 !important; color: #fff !important; border-color: #245ee8 !important;
}
.p04-profile .p04-button:hover:not(:disabled) { filter: brightness(.96); }
.p04-profile .p04-button:disabled { cursor: not-allowed; opacity: .6; }
.p04-profile :is(button, input, select, textarea, summary, a):focus-visible { outline: 3px solid #6e9eff; outline-offset: 3px; }
.p04-profile details { border-top: 1px solid var(--p04-line); padding-top: 14px; }
.p04-profile summary { cursor: pointer; color: var(--p04-muted); min-height: 36px; padding: 4px 0; }
.p04-profile details > :not(summary) { margin-top: 12px; }
.p04-fact { padding: 18px 0; border-top: 1px solid var(--p04-line); }
.p04-fact:first-of-type { margin-top: 12px; }
.p04-fact-text { white-space: pre-wrap; font-weight: 600; }
.p04-fact .p04-grid { margin-top: 12px; }
.p04-source { margin: 0; padding: 12px 16px; border-left: 3px solid var(--p04-line); background: var(--p04-soft); white-space: pre-wrap; color: var(--p04-text); }
.p04-notice { padding: 14px 16px; border-radius: 10px; background: var(--p04-soft); color: var(--p04-text); margin-bottom: 16px; }
.p04-notice[data-tone="warning"] { background: var(--p04-warning-bg); color: var(--p04-warning); }
.p04-notice .p04-actions { margin-top: 10px; }
.p04-state { display: inline-flex; align-items: center; padding: 4px 10px; border-radius: 7px; background: var(--p04-soft); color: var(--p04-muted); font-size: 14px; }
.p04-version-list { list-style: none; padding: 0; margin: 0; }
.p04-version-list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--p04-line); }
.p04-profile .p04-small { font-size: 14px; }
.p04-interview-entry { margin-bottom: 18px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.p04-interview-entry p { margin: 0; flex: 1; min-width: 180px; }
@media (max-width: 720px) {
  .p04-profile { padding-top: 12px; }
  .p04-header { flex-direction: column; gap: 10px; }
  .p04-card { padding: 18px 16px; border-radius: 12px; }
  .p04-grid { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .p04-actions .p04-primary { width: 100%; }
  .p04-version-list li { align-items: start; flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) { .p04-profile * { scroll-behavior: auto; transition: none; } }
