/* Job Autopilot V7.2 Resume area: Resume Studio (RES-01, CMP-30), Versions (RES-02), Profile details (RES-03).
   Loaded after v7-shell.css. Tokens only: no raw colours, no gradients, no animation, no uppercase text. */

:root {
  --w-dock: 400px;
  --h-top-bar: 52px;
  --h-bottom-bar: 68px;
}

/* ---- Resume Studio page: the paper fills the column under the 52px top bar ---- */
.main-content.v7-resume-page {
  max-width: none;
  padding: var(--sp-3) var(--sp-4) var(--sp-3);
}

.resume-workspace.v7-resume-workspace-wide {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  gap: 0;
}

.v7-preview-panel {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--rule);
  border-radius: var(--r-box);
  background: var(--wash);
}

.v7-paper-scroll {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: var(--sp-3) var(--sp-4) 0;
}

.v7-preview-panel .assistant-preview-toolbar {
  padding-bottom: var(--sp-2);
  border-bottom: 1px solid var(--rule);
}

.v7-preview-panel .assistant-preview-scroll {
  padding: var(--sp-3) 0 var(--sp-4);
}

/* Page 1 and page 2 as one continuous scroll. */
.v7-paper-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-4);
  width: 100%;
}

.v7-paper-page {
  width: 100%;
  max-width: 740px;
  scroll-margin-top: var(--sp-3);
}

.v7-paper-page .resume-page-img {
  display: block;
  width: 100%;
  background: var(--page);
  border: 1px solid var(--rule);
  box-shadow: var(--shadow-sheet);
}

.assistant-zoom-1 .v7-paper-page,
.assistant-zoom-2 .v7-paper-page,
.assistant-zoom-3 .v7-paper-page {
  max-width: none;
}

.app-shell.has-right-dock .v7-paper-page {
  max-width: 680px;
}

/* The small Comment buttons for an exact section or role, at the top of the paper. */
.v7-paper-comments {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-1) 6px;
  max-width: 740px;
  margin: 0 auto var(--sp-3);
}

.v7-paper-comments-label {
  margin-right: var(--sp-1);
}

.rp-inline-comment-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  min-height: 28px;
  padding: 2px 10px;
  border: 1px solid var(--rule);
  border-radius: calc(var(--r-box) * 99);
  background: var(--page);
  color: var(--ink-2);
  font-family: var(--font-sans);
  font-size: 12px;
  line-height: 16px;
  font-weight: 500;
  cursor: pointer;
}

.rp-inline-comment-btn:hover,
.rp-inline-comment-btn:focus-visible {
  border-color: var(--navy);
  color: var(--navy);
  background: var(--navy-wash);
}

.rp-inline-comment-btn:focus-visible {
  outline: 2px solid var(--navy);
  outline-offset: 2px;
}

.rp-inline-comment-btn:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.v7-proposal-indicator,
.v7-count {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: calc(var(--r-box) * 99);
  background: var(--wash);
  color: var(--ink-2);
  font-size: 12px;
  line-height: 16px;
  white-space: nowrap;
}

.v7-proposal-indicator {
  background: var(--caution-wash);
  color: var(--caution);
  font-weight: 600;
}

/* ---- The assistant dock: full height, 400px, beside the main column ---- */
.v7-right-dock {
  display: none;
}

.v7-right-dock.is-open {
  display: flex;
  flex: 0 0 var(--w-dock);
  width: var(--w-dock);
  height: 100vh;
  height: 100dvh;
  position: sticky;
  top: 0;
  z-index: 30;
  border-left: 1px solid var(--rule);
  background: var(--page);
}

.v7-controls-panel {
  display: flex;
  flex-direction: column;
  width: 100%;
  min-height: 0;
  overflow: hidden;
  /* The dock fills its column edge to edge. The generic `.v7-panel` card style (border, radius, padding) that other
     screens define must not apply here, or the header sits 16px below the top bar's line. */
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

/* Exactly 52px, so its bottom border lines up with the top bar's. */
.v7-controls-head {
  flex: 0 0 var(--h-top-bar);
  height: var(--h-top-bar);
  min-height: var(--h-top-bar);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-2);
  padding: 0 var(--sp-3) 0 14px;
  border-bottom: 1px solid var(--rule);
  box-sizing: border-box;
}

.v7-controls-title-row {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--navy);
  min-width: 0;
}

.v7-controls-title-row h2 {
  margin: 0;
  font-size: 15px;
  line-height: 20px;
  font-weight: 600;
  color: var(--ink);
}

.v7-controls-head-actions {
  display: flex;
  align-items: center;
  gap: 2px;
}

.v7-resume-mode-tabs {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-bottom: 1px solid var(--rule);
}

.v7-resume-mode-tabs button {
  min-height: 40px;
  padding: 0 var(--sp-3);
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--ink-2);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}

.v7-resume-mode-tabs button.is-active {
  color: var(--navy);
  border-bottom-color: var(--navy);
  font-weight: 600;
}

.v7-resume-mode-tabs button:focus-visible {
  outline: 2px solid var(--navy);
  outline-offset: -2px;
}

/* The slim one-row target strip: what is being edited. */
.v7-slim-target {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: 7px 14px;
  border-bottom: 1px solid var(--rule);
  background: var(--wash);
}

.v7-slim-target .v7-version-select {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  margin: 0;
}

.v7-slim-target .select {
  width: 100%;
  min-width: 0;
  min-height: 32px;
  height: 32px;
  padding-top: 2px;
  padding-bottom: 2px;
  font-size: 12px;
  background: var(--page);
}

.v7-target-notice {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  padding: var(--sp-1) var(--sp-2);
  border: 1px solid var(--rule);
  border-radius: calc(var(--r-box) * 99);
  background: var(--navy-wash);
  color: var(--navy);
  font-size: 11px;
  line-height: 14px;
  white-space: nowrap;
}

.v7-target-notice.is-version {
  background: var(--page);
  color: var(--ink-2);
}

.v7-dock-body {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

/* Inside the dock the panel loses its own frame; its heading stays for screen readers and focus only. */
.v7-right-dock .assistant-panel {
  border: 0;
  border-radius: 0;
}

.v7-right-dock .assistant-header {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* The message box is the last thing in the dock, flush with the bottom; the note on what is sent sits just above it. */
.v7-right-dock .assistant-composer {
  order: 3;
}

.v7-right-dock .assistant-privacy {
  order: 2;
  padding: var(--sp-1) 14px var(--sp-2);
  font-size: 12px;
  line-height: 17px;
}

/* Edit sections: the log gives way to the section view; the message box stays pinned below both. */
.v7-right-dock.is-edit-mode .assistant-log {
  display: none;
}

.v7-edit-sections {
  order: -1; /* the section view comes first in Edit sections; proposals and the saved notice follow it */
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.v7-section-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin: 0 14px;
  padding: var(--sp-2) 0;
  border-bottom: 1px solid var(--rule);
}

.v7-section-tab,
.v7-role-chip {
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid var(--rule);
  border-radius: calc(var(--r-box) * 99);
  background: var(--page);
  color: var(--ink-2);
  font-family: var(--font-sans);
  font-size: 12px;
  line-height: 16px;
  cursor: pointer;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.v7-section-tab.is-active,
.v7-role-chip.is-active {
  border-color: var(--navy);
  background: var(--navy-wash);
  color: var(--navy);
  font-weight: 600;
}

.v7-section-tab:focus-visible,
.v7-role-chip:focus-visible {
  outline: 2px solid var(--navy);
  outline-offset: 2px;
}

/* Company chips wrap: never a horizontal scrollbar. */
.v7-role-switcher {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  overflow: visible;
}

.v7-section-body {
  padding: var(--sp-3) 14px var(--sp-1);
}

.v7-rs-section-title {
  margin: 0;
  font-size: 14px;
  line-height: 20px;
}

.v7-fact-card {
  display: grid;
  gap: 6px;
  padding: 10px var(--sp-3);
  border: 1px solid var(--rule);
  border-left: 3px solid var(--good);
  border-radius: var(--r-box);
  background: var(--page);
}

.v7-fact-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-2);
}

.v7-source-tag {
  color: var(--good);
  font-size: 11px;
  line-height: 14px;
  font-weight: 600;
}

.v7-fact-text {
  margin: 0;
  max-width: none;
  font-size: 13px;
  line-height: 19px;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.v7-fact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.v7-fact-actions:empty {
  display: none;
}

.v7-source-note {
  margin: var(--sp-1) 0 0;
  font-size: 12px;
  line-height: 17px;
}

.v7-section-empty {
  padding: var(--sp-2) 0;
}

/* A proposal (or the person's own unsaved edit) is visibly not a source fact. */
.v7-proposal-card {
  display: grid;
  gap: var(--sp-2);
  padding: 11px var(--sp-3);
  border: 1px solid var(--navy);
  border-radius: var(--r-box);
  background: var(--navy-wash);
}

.v7-proposal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--sp-2);
}

.v7-proposal-head h3 {
  margin: 0;
  font-size: 14px;
  line-height: 20px;
}

.v7-rs-kicker {
  display: block;
  color: var(--navy);
  font-size: 11px;
  line-height: 14px;
  font-weight: 600;
}

.v7-proposal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
}

.v7-edit-textarea {
  width: 100%;
  min-height: 96px;
  background: var(--page);
}

.v7-rs-text-link {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--navy);
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

.v7-saved-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-2);
  margin-top: var(--sp-2);
  padding: var(--sp-2) var(--sp-3);
  border: 1px solid var(--good);
  border-radius: var(--r-box);
  background: var(--good-wash);
  color: var(--ink);
  font-size: 13px;
  line-height: 18px;
}

/* An assistant card names where its wording comes from. */
.assistant-source-line {
  margin: 0;
  font-size: 12px;
  line-height: 17px;
}

.assistant-source-kind {
  color: var(--navy);
  font-weight: 600;
}

.assistant-save-hint {
  margin: var(--sp-1) 0 0;
  font-size: 12px;
  line-height: 17px;
}

/* ---- The message box: pinned flush at the bottom in both modes, Send inside it ---- */
.v7-composer-dock.assistant-composer {
  display: grid;
  gap: 6px;
  padding: 10px var(--sp-3) var(--sp-3);
  border-top: 1px solid var(--rule);
  background: var(--page);
}

.v7-comment-context {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-2);
  padding: 6px 10px;
  border: 1px solid var(--rule);
  border-radius: var(--r-box);
  background: var(--navy-wash);
  color: var(--navy);
  font-size: 12px;
  line-height: 16px;
}

.v7-composer-box {
  position: relative;
  display: flex;
  align-items: flex-end;
  border: 1px solid var(--field-border);
  border-radius: var(--r-box);
  background: var(--wash);
}

.v7-composer-box:focus-within {
  border-color: var(--navy);
  background: var(--page);
  outline: 2px solid var(--navy-wash);
}

.v7-composer-input.assistant-input {
  flex: 1 1 auto;
  width: 100%;
  min-height: 54px;
  max-height: 7.5rem;
  padding: 10px 48px 10px var(--sp-3);
  border: 0;
  border-radius: var(--r-box);
  background: transparent;
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 13px;
  line-height: 19px;
  resize: none;
  outline: none;
  overflow-y: auto;
  box-sizing: border-box;
}

.v7-composer-input::placeholder {
  color: var(--ink-3);
}

.v7-composer-input:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* The circular arrow-up Send icon inside the box. */
.v7-send-icon-btn {
  position: absolute;
  right: 7px;
  bottom: 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: calc(var(--r-box) * 99);
  background: var(--navy);
  color: var(--on-navy);
  cursor: pointer;
}

.v7-send-icon-btn:hover:not(:disabled) {
  background: var(--navy-press);
}

.v7-send-icon-btn:focus-visible {
  outline: 2px solid var(--navy);
  outline-offset: 2px;
}

.v7-send-icon-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.v7-composer-dock .assistant-send-row:has(.assistant-count.hidden) {
  display: none;
}

/* ---- Versions (RES-02) ---- */
.v7-versions-meta {
  flex-wrap: wrap;
  gap: var(--sp-2);
}

.v7-version-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.v7-version-card {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  min-width: 0;
  padding: 15px;
  border: 1px solid var(--rule);
  border-radius: var(--r-box);
  background: var(--page);
}

.v7-version-card-top {
  display: flex;
  gap: var(--sp-3);
  min-width: 0;
}

.v7-version-card .version-thumb {
  flex: 0 0 88px;
  width: 88px;
  height: auto;
  border: 1px solid var(--rule);
}

.v7-version-card .resume-placeholder.version-thumb {
  min-height: 112px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: var(--wash);
}

.v7-version-card-text {
  min-width: 0;
}

.v7-version-card-title {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  min-width: 0;
}

.v7-version-card-title h3 {
  margin: 0;
  font-size: 15px;
  line-height: 21px;
  overflow-wrap: anywhere;
}

.v7-version-summary {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 0;
}

.v7-version-date {
  font-size: 12px;
}

.v7-version-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--sp-2);
  margin-top: auto;
  padding-top: var(--sp-2);
  border-top: 1px solid var(--rule);
}

/* ---- Profile details (RES-03): pill role switcher above the form ---- */
.v7-details-roles {
  padding: var(--sp-1) 0;
}

.v7-studio-off {
  max-width: var(--w-form);
}

/* ---- Phone: the dock starts closed and opens as a bottom sheet above the bottom bar ---- */
@media (max-width: 899px) {
  .main-content.v7-resume-page {
    padding: var(--sp-2) var(--sp-3) var(--sp-3);
  }

  .v7-paper-scroll {
    padding: var(--sp-2) var(--sp-2) 0;
  }

  .v7-right-dock.is-open {
    position: fixed;
    top: auto;
    right: 0;
    bottom: calc(var(--h-bottom-bar) + env(safe-area-inset-bottom));
    left: 0;
    z-index: 35;
    width: 100%;
    height: 78vh;
    height: 78dvh;
    max-height: calc(100dvh - var(--h-bottom-bar) - var(--sp-12));
    border-left: 0;
    border-top: 1px solid var(--rule);
    border-radius: var(--r-box) var(--r-box) 0 0;
    box-shadow: var(--shadow-sheet);
  }

  .v7-controls-head {
    height: auto;
    min-height: var(--h-top-bar);
  }

  .v7-resume-mode-tabs button,
  .v7-section-tab,
  .v7-role-chip,
  .rp-inline-comment-btn,
  .v7-slim-target .select,
  .v7-rs-text-link {
    min-height: 44px;
  }

  .v7-slim-target .select {
    height: 44px;
  }

  .v7-controls-head-actions .btn-icon-only {
    width: 44px;
    min-width: 44px;
    height: 44px;
    min-height: 44px;
  }

  .v7-send-icon-btn {
    width: 44px;
    height: 44px;
    right: 5px;
    bottom: 5px;
  }

  .v7-composer-input.assistant-input {
    min-height: 56px;
    padding-right: 56px;
    font-size: 16px;
  }

  .v7-version-grid {
    grid-template-columns: 1fr;
  }

  .v7-version-card-foot .btn {
    min-height: 44px;
  }
}
