/* The tailor page: the resume and job on top, then the cards on the left and the scores, actions and tailored resume
   on the right. A phone takes them in one column: scores, cards, then the result. Tokens only (tokens.css). */
.tp { padding-block: 28px 0; }
.tp-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 20px; margin-bottom: 20px; }
.tp-title { margin: 0; font-size: var(--text-32); font-weight: var(--weight-500); letter-spacing: var(--track-display); line-height: 1.15; }
.tp-lead { margin: 0; font-size: var(--text-15); color: var(--ink-2); }

.tp-inputs { display: grid; gap: 12px 20px; padding: 16px 20px; border-radius: 14px; background: var(--card); box-shadow: var(--shadow-card); }
@media (min-width: 760px) { .tp-inputs { grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); } .tp-inputs > .tp-paste, .tp-inputs > .row, .tp-inputs > .error { grid-column: 1 / -1; } }
.tp-field { display: grid; gap: 6px; min-width: 0; }
.tp-resume-row { display: flex; align-items: center; gap: 8px; min-width: 0; }
.tp-resume-row .tp-select { flex: 1 1 auto; min-width: 0; }
.btn.tp-file { position: relative; flex: none; min-height: 46px; padding-block: 10px; padding-inline: 16px; font-size: var(--text-14); overflow: hidden; cursor: pointer; }
.btn.tp-file input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.tp-label { display: grid; gap: 6px; font-size: var(--text-14); color: var(--ink-2); }
.tp-search-box { display: grid; gap: 6px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.tp-job-results { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; max-height: 240px; overflow-y: auto; }
.tp-job-results:empty { display: none; }
.tp-job-opt { display: grid; gap: 1px; width: 100%; min-height: 44px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); color: var(--ink); font: inherit; text-align: left; cursor: pointer; }
.tp-job-opt:hover { border-color: var(--ink-3); }
.tp-job-opt b { font-weight: var(--weight-500); font-size: var(--text-14); }
.tp-job-opt span { font-size: var(--text-13); color: var(--ink-2); }
/* Safari draws a native select at its own height whatever min-height says, so the box is drawn here, chevron and all. */
.tp-select { position: relative; display: block; }
.tp-select select { -webkit-appearance: none; appearance: none; min-height: 44px; padding-right: 40px; line-height: 1.35; cursor: pointer; }
.tp-select::after { content: "" / ""; position: absolute; right: 16px; top: 50%; width: 7px; height: 7px; border-right: 1.5px solid var(--ink-2); border-bottom: 1.5px solid var(--ink-2); transform: translateY(-70%) rotate(45deg); pointer-events: none; }
.tp-job { display: flex; align-items: center; gap: 12px; min-height: 44px; }
.tp-job-name { flex: 1 1 auto; min-width: 0; margin: 0; font-weight: var(--weight-500); line-height: 1.35; overflow-wrap: anywhere; }
.tp-job-logo { margin-right: 6px; vertical-align: -3px; }
.tp-job .btn { flex: none; min-height: 44px; }
.tp-paste { display: grid; gap: 8px; }
.tp-pair { display: grid; gap: 12px; }
@media (min-width: 640px) { .tp-pair { grid-template-columns: 1fr 1fr; } }
.tp-inputs .row { margin-top: 0; }
.tp-inputs .error { margin: 0; }

.tp-grid { display: grid; gap: 20px; margin-top: 20px; }
@media (min-width: 960px) {
  .tp-grid { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); grid-template-areas: "cards score" "cards result"; grid-template-rows: auto 1fr; column-gap: 28px; align-items: start; }
  .tp-score { grid-area: score; }
  .tp-cards { grid-area: cards; }
  .tp-result { grid-area: result; position: sticky; top: 84px; }
  .tp-sheet { max-height: calc(100vh - 360px); max-height: calc(100dvh - 360px); min-height: 240px; overflow-y: auto; overscroll-behavior: contain; }
}

/* Scores: before and after, side by side. */
.tp-score { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px 32px; padding: 16px 20px; border-radius: 14px; background: var(--card); box-shadow: var(--shadow-card); }
.tp-meter { display: grid; gap: 2px; }
.tp-meter-label { font-size: var(--text-14); color: var(--ink-2); }
.tp-meter-nums { display: flex; align-items: baseline; gap: 8px; font-size: var(--text-26); font-weight: var(--weight-500); letter-spacing: var(--track-display); line-height: 1.1; font-variant-numeric: tabular-nums; }
.tp-was-num { color: var(--ink-3); }
.tp-arrow { font-size: var(--text-18); color: var(--ink-3); }
.tp-now-num.up { color: var(--good); }
.tp-score .tp-note { flex: 1 1 100%; margin: 0; }
.tp-note { margin: 0 0 8px; font-size: var(--text-13); color: var(--ink-2); }

/* Cards, section by section. */
.tp-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-bottom: 4px; }
.tp-bar h2 { margin: 0; }
.tp-count { font-size: var(--text-14); color: var(--ink-2); font-variant-numeric: tabular-nums; }
.tp-bulk { display: flex; gap: 8px; margin-left: auto; }
.tp-bulk .btn { min-height: 44px; }
/* Disabled Accept All / Clear All read as quiet ghost controls, never filled grey pills (judge finding). */
.tp-bulk .btn:disabled { background: transparent; color: var(--ink-3); border-color: var(--line); }
.tp-section h3 { margin: 20px 0 8px; font-size: var(--text-15); font-weight: var(--weight-500); color: var(--ink-2); }
.tp-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.tp-card { padding: 6px 16px 14px; border-radius: 12px; background: var(--card); box-shadow: var(--shadow-card); font-size: var(--text-14); }
.tp-toggle { display: flex; align-items: center; gap: 10px; min-height: 44px; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.tp-toggle input { flex: none; width: 20px; height: 20px; margin: 0; padding: 0; accent-color: var(--cta); }
.tp-card-label { font-weight: var(--weight-500); font-size: var(--text-15); }
.tp-where { margin: 0 0 2px; color: var(--ink-2); font-size: var(--text-13); overflow-wrap: anywhere; }
.tp-card .was, .tp-card .now { white-space: pre-line; overflow-wrap: anywhere; }
.tp-card .was mark.d-del { background: var(--low-soft); color: var(--low); border-radius: 3px; font-weight: var(--weight-500); }
.tp-card .now mark.d-add { background: var(--good-soft); color: var(--good); border-radius: 3px; font-weight: var(--weight-500); }
.tp-card.off .now mark.d-add, .tp-card.off .was mark.d-del { background: transparent; color: inherit; font-weight: inherit; }
.tp-card.off .now { background: var(--surface); color: var(--ink-3); }
.tp-card.off .was { background: var(--surface); text-decoration: none; color: var(--ink); }
.tp-offers { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.tp-offer { min-height: 44px; padding-block: 8px; padding-inline: 12px; border: 1px solid var(--line-2); border-radius: 999px; background: var(--card); cursor: pointer; }
.tp-offer input { width: 18px; height: 18px; margin: 0; accent-color: var(--cta); }
.tp-empty { margin-top: 12px; font-size: var(--text-15); }

/* The result: actions, next-step kit, then the tailored resume as a sheet. */
.tp-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.tp-actions .btn { flex: 1 1 auto; white-space: nowrap; }
.tp-actions .btn.primary { flex-basis: 100%; }
.tp-next { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 4px; }
.tp-next .btn { min-height: 44px; flex: 1 1 auto; }
.tp-status { min-height: 1.4em; margin: 6px 0 0; font-size: var(--text-14); color: var(--good); }
.tp-result-title { margin: 4px 0 8px; font-size: var(--text-15); color: var(--ink-2); }
.tp-sheet { padding: 20px 22px; font-size: var(--text-13); line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.tp-line { display: block; padding-inline: 4px; margin-inline: -4px; border-radius: 4px; }
.tp-line.changed { background: var(--accent-soft); }

/* Delete My Data in Tailor footer. */
.delete-confirm { flex: 1 1 100%; padding: 16px; border-radius: 12px; background: var(--low-soft); color: var(--ink); }
.delete-confirm p { margin: 0; }
.delete-confirm .row { margin-top: 10px; }
.btn.danger { color: var(--low); border-color: var(--low); }
.delete-note { flex: 1 1 100%; margin: 0; color: var(--good); }
.foot-delete { font-size: inherit; color: var(--low); }
.foot-delete:hover { color: var(--low); text-decoration: underline; text-underline-offset: 3px; }

@media (max-width: 520px) {
  .tp { padding-top: 20px; }
  .tp-title { font-size: var(--text-26); }
  .tp-inputs, .tp-score { padding: 14px 16px; }
  .tp-score { gap: 8px 24px; }
  .tp-bulk { margin-left: 0; flex: 1 1 100%; }
  .tp-bulk .btn { flex: 1 1 0; }
  .tp-sheet { padding: 16px; }
  .foot nav a, .foot .linkish { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; }
}

/* Deep Polish with AI: one optional button above the cards, its privacy line beside it. */
.tp-polish { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 4px 0 12px; }
.tp-polish .btn { min-height: 44px; }
.tp-polish .tp-note { margin: 0; flex: 1 1 220px; }
/* On a phone the polish button spans the row under Accept All and Clear All, so it never sits alone in half a grid. */
@media (max-width: 520px) { .tp-polish .btn { flex: 1 1 100%; } }
