/* ApplyGrove workspace surfaces. Shared tokens and navigation live in theme.css.
   The résumé document, its print styles, and iframe content are intentionally
   outside this stylesheet: only the surrounding editor and preview chrome change. */

html,
body {
  background: var(--ag-bg);
  color: var(--ag-text);
  font-family: var(--ag-font);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

button,
.upload-pill,
.rb-import-button {
  border-color: var(--ag-border);
  border-radius: 9px;
  background: var(--ag-panel);
  color: var(--ag-text);
  font-family: var(--ag-font);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  transition: background .16s ease, border-color .16s ease, box-shadow .16s ease;
}

button:hover:not(:disabled),
.rb-import-button:hover,
.preview-edit-btn:hover:not(:disabled) {
  background: var(--ag-subtle);
  border-color: #c7cee0;
  color: var(--ag-text);
}

button.primary,
.upload-pill,
.preview-download-btn {
  background: var(--ag-primary);
  border-color: var(--ag-primary);
  color: #fff;
  box-shadow: 0 4px 10px #465ee614;
}

button.primary:hover:not(:disabled),
.upload-pill:hover,
.preview-download-btn:hover:not(:disabled) {
  background: var(--ag-primary-hover);
  border-color: var(--ag-primary-hover);
  color: #fff;
  opacity: 1;
}

button.danger,
button.danger-action {
  color: #ad504c;
}

button.danger:hover:not(:disabled),
button.danger-action:hover:not(:disabled) {
  border-color: #eed8d4;
  background: #fff3f0;
  color: #963e39;
}

button.ghost {
  background: transparent;
  color: var(--ag-muted);
  border-color: var(--ag-border);
}

button.ghost:hover:not(:disabled) {
  border-color: #c7cee0;
  background: var(--ag-subtle);
  color: var(--ag-text);
}

button:focus-visible,
a:focus-visible,
.upload-pill:focus-within,
.rb-import-button:focus-within {
  outline: 3px solid #a7b2fb;
  outline-offset: 3px;
}

input,
select,
textarea {
  background: var(--ag-panel);
  border-color: #dce2ed;
  border-radius: 8px;
  color: var(--ag-text);
  font-family: var(--ag-font);
  font-size: 16px;
  line-height: 1.5;
  padding: 10px 12px;
  transition: border-color .16s ease, box-shadow .16s ease;
}

input::placeholder,
textarea::placeholder {
  color: #7a8699;
  opacity: 1;
}

input:focus,
select:focus,
textarea:focus {
  border-color: #8092ef;
  box-shadow: 0 0 0 3px #465ee610;
  outline: none;
}

input[type="checkbox"],
input[type="radio"] {
  accent-color: var(--ag-primary);
}

input:disabled,
select:disabled,
textarea:disabled {
  background: #f0f3f8;
  color: #7c889d;
}

.field {
  gap: 7px;
  min-width: 0;
}

.field label,
.home-jd-label,
.quick-jd-company-check > label,
.rb-control-label {
  color: #526076;
  font-size: 14px;
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
  line-height: 1.45;
}

.grid-2,
.grid-3,
.grid-4 {
  gap: 16px;
}

.container {
  max-width: 1320px;
  padding: 28px 40px;
}

.container.home-container {
  max-width: 1320px;
  padding-top: 24px;
}

.container.jobs-container {
  max-width: 1480px;
  padding-top: 24px;
}

.container.builder-container {
  max-width: 1680px;
  padding: 24px;
}

.panel,
.home-quick-card,
.jobs-side-panel,
.quick-jd-sidebar-card,
.builder-nav,
.builder-document-panel,
.builder-card,
.rb-form {
  background: var(--ag-panel);
  border-color: var(--ag-border);
  border-radius: var(--ag-radius);
  box-shadow: var(--ag-shadow);
}

.panel {
  padding: 24px;
  margin-bottom: 22px;
}

.panel > h3,
.builder-nav > h3,
.builder-card > h3 {
  color: #526076;
  font-family: var(--ag-heading);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -.2px;
  text-transform: none;
  margin-bottom: 16px;
}

/* Sign-in and first-run setup. */
.auth-shell,
.setup-shell {
  padding: 42px 24px;
  background: radial-gradient(ellipse at 50% 0, #eef2ff 0, transparent 55%), var(--ag-bg);
}

.auth-card,
.setup-card {
  width: min(470px, 100%);
  background: var(--ag-panel);
  border-color: var(--ag-border);
  border-radius: 18px;
  padding: 34px;
  box-shadow: 0 12px 42px #24365b09;
}

.setup-card {
  width: min(520px, 100%);
}

.auth-brand {
  font-family: var(--ag-heading);
  font-size: 24px;
  letter-spacing: -.9px;
  margin-bottom: 25px;
}

.auth-brand span {
  color: var(--ag-brand);
}

.auth-card h1,
.setup-card h1 {
  font-family: var(--ag-heading);
  font-size: 30px;
  font-weight: 750;
  line-height: 1.25;
  letter-spacing: -1px;
  margin-bottom: 12px;
}

.auth-muted {
  color: var(--ag-muted);
  font-size: 16px;
  line-height: 1.75;
  margin-bottom: 24px;
}

.auth-card .field,
.setup-card .field {
  margin-bottom: 18px;
}

.auth-submit {
  min-height: 46px;
  margin-top: 8px;
}

.auth-switch {
  background: transparent;
  color: var(--ag-primary);
  border-color: transparent;
  font-size: 14px;
  margin-top: 14px;
}

.auth-switch:hover:not(:disabled) {
  background: #f1f3fe;
  border-color: #e0e6fb;
  color: var(--ag-primary-hover);
}

.auth-divider,
.auth-google-fallback {
  font-size: 12px;
  color: var(--ag-muted);
}

.auth-divider {
  margin: 19px 0;
}

.auth-error,
.settings-inline-error,
.settings-inline-status {
  font-size: 14px;
  line-height: 1.65;
}

.auth-error,
.settings-inline-error {
  color: #ad504c;
}

/* Account dropdowns and the legacy profile menu. */
.profile-circle,
.profile-panel-avatar {
  background: #eef1fc;
  border-color: #dce2f2;
  color: #5667a7;
  box-shadow: none;
  font-size: 12px;
}

.profile-circle:hover,
.profile-circle[aria-expanded="true"] {
  background: #e9edfc;
  border-color: #bdc8ed;
  transform: none;
}

.profile-dropdown {
  min-width: 280px;
  padding: 9px;
  border-color: var(--ag-border);
  border-radius: 13px;
  background: var(--ag-panel);
  box-shadow: 0 12px 36px #273b6020;
}

.profile-dropdown::before {
  border-color: var(--ag-border);
  background: var(--ag-panel);
}

.profile-dropdown-user,
.profile-panel-name {
  color: var(--ag-text);
  font-size: 14px;
  font-weight: 600;
}

.profile-dropdown-meta,
.profile-panel-email,
.profile-panel-value,
.profile-panel-label,
.header-meta,
.credit-warn {
  color: var(--ag-muted);
  font-size: 12px;
}

.profile-dropdown-action,
.profile-panel-action {
  min-height: 40px;
  padding: 10px;
  border-radius: 8px;
  color: #526076;
  font-size: 14px;
}

.profile-dropdown-action:hover:not(:disabled),
.profile-dropdown-action[aria-expanded="true"],
.profile-panel-action:hover:not(:disabled),
.profile-panel-action[aria-expanded="true"] {
  border-color: transparent;
  background: #eef1fd;
  color: var(--ag-primary);
}

.profile-status-action.good {
  color: #477864;
}

.profile-status-action.warn {
  color: #946b28;
}

.profile-status-action.bad {
  color: #ad504c;
}

.jobs-side-brand {
  font-family: var(--ag-heading);
  color: var(--ag-text);
  letter-spacing: -.9px;
}

.jobs-side-brand span {
  color: var(--ag-brand);
}

.profile-panel-section {
  padding-top: 18px;
}

/* Quick JD Match landing page and its smaller sidebar counterpart. */
.home-screen {
  padding-top: 8px;
}

.home-quick-card {
  padding: 30px;
}

.home-quick-intro {
  margin-bottom: 28px;
  gap: 24px;
}

.home-quick-intro h1 {
  font-family: var(--ag-heading);
  font-size: clamp(28px, 3vw, 38px);
  font-weight: 750;
  line-height: 1.2;
  letter-spacing: -1.2px;
  margin: 5px 0 13px;
}

.home-quick-intro p {
  color: var(--ag-muted);
  font-size: 16px;
  line-height: 1.75;
}

.home-quick-grid {
  gap: 22px;
}

.home-quick-inputs,
.home-quick-results {
  padding: 22px;
  border-color: var(--ag-border);
  border-radius: 12px;
  background: #fcfcff;
}

.home-quick-results {
  background: linear-gradient(150deg, #f6f8ff, #fcfcff 60%);
}

.home-quick-textarea {
  min-height: 370px;
  max-height: none;
  font-size: 16px;
  line-height: 1.75;
}

.home-result-empty {
  align-content: center;
  min-height: 290px;
  gap: 12px;
  padding: 28px;
}

.home-result-empty strong {
  color: var(--ag-text);
  font-family: var(--ag-heading);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -.45px;
}

.home-result-empty span {
  color: var(--ag-muted);
  font-size: 14px;
  line-height: 1.75;
  max-width: 310px;
}

.quick-jd-card {
  border-color: #dce2f3;
  border-radius: 14px;
  background: var(--ag-panel);
  box-shadow: var(--ag-shadow);
  backdrop-filter: none;
}

.quick-jd-sidebar-card {
  padding: 22px;
}

.quick-jd-sidebar-card .quick-jd-card {
  background: transparent;
  box-shadow: none;
}

.quick-jd-head strong,
.quick-jd-kicker,
.settings-page-kicker,
.builder-kicker,
.builder-doc-label,
.rb-kicker {
  font-size: 12px;
  letter-spacing: .8px;
  font-weight: 650;
  color: var(--ag-muted);
}

.quick-jd-company-check,
.quick-jd-profile-field {
  margin-bottom: 18px;
}

.quick-jd-profile-field select,
.quick-jd-company-control input {
  min-height: 42px;
  height: 42px;
  font-size: 16px;
}

.quick-jd-company-control {
  grid-template-columns: minmax(0, 1fr) 78px;
  gap: 9px;
}

.quick-jd-company-btn {
  width: 78px;
  height: 42px;
  font-size: 14px;
  color: var(--ag-brand);
}

.quick-jd-textarea:not(.home-quick-textarea) {
  font-size: 16px;
  line-height: 1.7;
  min-height: 180px;
}

.quick-jd-result-table {
  background: var(--ag-panel);
  border-color: var(--ag-border);
  border-radius: 10px;
  font-size: 14px;
}

.quick-jd-result-table th,
.quick-jd-result-table td {
  padding: 13px 14px;
  border-color: var(--ag-border);
  line-height: 1.6;
}

.quick-jd-result-table th {
  color: #667085;
  background: #f6f8fc;
  font-size: 12px;
  letter-spacing: .25px;
  font-weight: 600;
  text-transform: none;
}

.quick-jd-result-table td {
  color: var(--ag-text);
  font-weight: 550;
}

.quick-jd-result-toggle:hover th,
.quick-jd-result-toggle:hover td,
.quick-jd-result-toggle:focus th,
.quick-jd-result-toggle:focus td {
  background: #edf1fd;
}

.quick-jd-skill-panel {
  gap: 15px;
  padding: 17px;
  border-color: var(--ag-border);
  border-radius: 10px;
  background: #f8f9fd;
}

.quick-jd-status,
.quick-jd-result-chevron {
  font-size: 12px;
  color: var(--ag-muted);
}

.quick-jd-actions {
  gap: 10px;
  margin-top: 18px;
}

.quick-jd-action-btn,
.quick-jd-action-btn.primary {
  min-width: 44px;
  min-height: 44px;
  width: 44px;
  height: 44px;
  font-size: 16px;
}

.home-quick-files {
  gap: 10px;
  margin-top: 18px;
}

.home-file-action {
  min-height: 44px;
  font-size: 14px;
  font-weight: 600;
}

/* Account and settings cards. */
.settings-screen {
  max-width: 940px;
  padding-top: 16px;
}

.settings-page-head {
  align-items: center;
  gap: 18px;
  margin-bottom: 25px;
}

.settings-page-head h1 {
  font-family: var(--ag-heading);
  font-size: 30px;
  font-weight: 750;
  line-height: 1.25;
  letter-spacing: -.9px;
  margin-top: 5px;
}

.settings-page-panel {
  padding: 0;
  overflow: hidden;
}

.settings-body {
  padding: 27px 30px 30px;
}

.settings-user-note {
  padding: 13px 16px;
  border: 1px solid #e2e7f4;
  border-radius: 9px;
  background: #f4f6fc;
  color: #667085;
  font-size: 14px;
  line-height: 1.7;
  margin-bottom: 16px;
}

.settings-section {
  border-color: var(--ag-border);
  padding: 26px 0;
}

.settings-section-head {
  align-items: flex-start;
  gap: 15px;
  margin-bottom: 18px;
}

.settings-section-head h3 {
  color: var(--ag-text);
  font-family: var(--ag-heading);
  font-size: 18px;
  font-weight: 700;
  text-transform: none;
  letter-spacing: -.3px;
}

.settings-section-head span {
  color: var(--ag-muted);
  font-size: 14px;
  line-height: 1.65;
}

.settings-check-grid {
  gap: 14px;
}

.settings-check {
  padding: 17px;
  border-color: var(--ag-border);
  border-radius: 10px;
  background: #f9fafd;
}

.settings-check:has(input:checked) {
  border-color: #cbd5f6;
  background: #f3f5fe;
}

.settings-check input {
  width: 17px;
  height: 17px;
  flex: none;
  margin-top: 4px;
}

.settings-check strong {
  color: #526076;
  font-size: 14px;
  font-weight: 600;
}

.settings-check small {
  color: var(--ag-muted);
  font-size: 12px;
  line-height: 1.65;
  margin-top: 6px;
}

.settings-actions {
  gap: 12px;
  padding-top: 22px;
}

.settings-actions button {
  min-height: 43px;
}

.settings-actions.inline {
  padding-top: 17px;
}

/* Existing jobs feed and applied-history tables. */
.jobs-page-layout {
  gap: 24px;
}

.jobs-side-panel {
  padding: 24px;
}

.jobs-side-panel::before {
  display: none;
}

.job-source-tabs {
  border-color: var(--ag-border);
  border-radius: 9px;
  background: #f5f7fb;
  gap: 4px;
  margin-bottom: 22px;
}

.job-source-tabs button {
  font-size: 14px;
  font-weight: 600;
  min-height: 38px;
  height: auto;
  padding: 8px 15px;
  border-radius: 6px;
  color: var(--ag-muted);
  background: transparent;
}

.job-source-tabs button.active {
  color: var(--ag-primary);
  background: var(--ag-panel);
  box-shadow: 0 1px 5px #1d2e5510, inset 0 0 0 1px #dde3f2;
}

.job-source-tabs button:hover:not(.active) {
  color: var(--ag-primary);
  background: #ebeffb;
}

.jobs-config-bar,
.jobs-config-bar.query-mode {
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 17px 16px;
}

.jobs-config-bar.query-mode .jobs-query-field {
  grid-column: span 2;
}

.jobs-config-bar .field > label:first-child {
  height: auto;
  min-height: 21px;
  line-height: 1.5;
  white-space: normal;
}

.jobs-config-bar .field > input,
.jobs-config-bar .field > select,
.jobs-config-actions button,
.place-combobox input {
  height: 43px;
  min-height: 43px;
}

.place-suggestions {
  border-color: var(--ag-border);
  border-radius: 10px;
  background: var(--ag-panel);
  box-shadow: 0 12px 28px #24365b17;
}

.place-suggestions button {
  padding: 10px;
  min-height: 40px;
  font-size: 14px;
  color: #526076;
}

.place-suggestions button:hover,
.place-suggestions button[aria-selected="true"] {
  background: #edf1fd;
  color: var(--ag-primary);
}

.inline-check {
  height: auto;
  min-height: 43px;
  background: #f9fafd;
  border-color: var(--ag-border);
  font-size: 14px;
  color: #526076;
}

.inline-check input[type="checkbox"] {
  width: 17px;
  height: 17px;
}

.resume-search-summary,
.scrape-inline-status {
  font-size: 12px;
  color: var(--ag-muted);
  line-height: 1.7;
  white-space: normal;
}

.jobs-toolbar {
  gap: 16px;
  margin-bottom: 19px;
}

.jobs-toolbar > h3 {
  font-family: var(--ag-heading);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -.4px;
  color: var(--ag-text);
  text-transform: none;
}

.jobs-sort-control,
.jobs-sort-control span {
  font-size: 12px;
  color: var(--ag-muted);
  text-transform: none;
  letter-spacing: 0;
}

.jobs-sort-control select {
  min-height: 38px;
  width: 195px;
  font-size: 14px;
}

.applied-link-btn,
.scrape-btn,
.upload-pill {
  min-height: 40px;
  font-size: 14px;
  border-radius: 9px;
}

.applied-link-btn {
  background: var(--ag-panel);
  padding: 9px 12px;
}

.applied-link-btn:hover {
  background: #edf1fd;
  border-color: #c8d1f0;
  color: var(--ag-primary);
}

.applied-link-count {
  font-size: 12px;
  background: #edf1fd;
  color: var(--ag-primary);
}

.jobs-card-feed {
  gap: 18px;
  padding-right: 0;
}

.ag-job-card {
  min-height: 0;
  border-color: var(--ag-border);
  border-radius: 13px;
  background: var(--ag-panel);
  box-shadow: var(--ag-shadow);
}

.ag-job-card:hover {
  border-color: #c7d1ea;
  background: var(--ag-panel);
  box-shadow: 0 6px 20px #24365b08;
}

.ag-job-card.expanded {
  border-color: #bdcaed;
  background: var(--ag-panel);
}

.ag-job-card-main {
  padding: 26px;
  gap: 26px;
}

.ag-job-card .job-title {
  font-family: var(--ag-heading);
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -.5px;
  line-height: 1.4;
}

.ag-job-card-meta,
.hiring-manager-meta {
  color: var(--ag-muted);
  font-size: 14px;
  line-height: 1.75;
}

.ag-job-card-meta strong {
  font-weight: 550;
  color: #526076;
}

.job-meta {
  font-size: 12px;
  color: var(--ag-muted);
  line-height: 1.65;
}

.ag-job-card-profile,
.ag-job-card-check,
.ag-job-card-files {
  border-color: var(--ag-border);
  border-radius: 9px;
  background: #f9fafd;
  color: #526076;
  font-size: 14px;
  font-weight: 550;
  text-transform: none;
  letter-spacing: 0;
}

.ag-job-card-profile select {
  min-height: 35px;
  height: auto;
  font-size: 14px;
  background: var(--ag-panel);
}

.ag-job-files-toggle,
.ag-job-file-name {
  font-size: 14px;
  font-weight: 550;
  text-transform: none;
  letter-spacing: 0;
  color: #526076;
}

.ag-job-files-toggle:hover:not(:disabled),
.ag-job-file-open:hover:not(:disabled),
.ag-job-file-open:focus-visible:not(:disabled) {
  background: #edf1fd;
  color: var(--ag-primary);
}

.ag-job-card-breakdown {
  padding: 22px 26px;
  background: #f7f9fd;
  border-color: var(--ag-border);
}

.job-skill-section {
  grid-template-columns: 98px minmax(0, 1fr);
  gap: 12px;
}

.job-skill-label {
  font-size: 12px;
  color: var(--ag-muted);
  letter-spacing: .2px;
}

.skill-chip,
.matched-skills .pill,
.pill-mini,
.visa-badge,
.quick-jd-sponsorship {
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.5;
  letter-spacing: 0;
}

.skill-chip.required,
.pill-req {
  background: #edf1fd;
  border-color: #dfe5fa;
  color: #5069b8;
}

.skill-chip.available,
.pill-pref,
.visa-badge.yes,
.quick-jd-sponsorship.yes,
.pill-mini.on {
  background: #edf5f0;
  border-color: #d9e9df;
  color: #477864;
}

.skill-chip.missing,
.pill-miss,
.pill-miss-full,
.visa-badge.no,
.quick-jd-sponsorship.no {
  background: #fdf0ed;
  border-color: #f0dcd5;
  color: #a56252;
}

.skill-chip.more,
.pill-mini.off,
.visa-badge.unknown,
.quick-jd-sponsorship.unknown {
  background: #f0f3f8;
  color: var(--ag-muted);
}

.skill-empty,
.empty-inline {
  font-size: 12px;
  color: var(--ag-muted);
  white-space: normal;
  line-height: 1.65;
}

.score {
  border-radius: 8px;
  font-size: 16px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.score.good {
  background: #eaf4ed;
  color: #477864;
}

.score.warn {
  background: #fbf3e3;
  color: #926d2c;
}

.score.bad {
  background: #fcefeb;
  color: #a96253;
}

.factor,
.factor-pct,
.breakdown-missing,
.breakdown-missing strong,
.breakdown-expl,
.tailored-loading {
  font-size: 12px;
}

.factor {
  grid-template-columns: minmax(110px, 1fr) minmax(40px, 1fr) 42px;
}

.factor-bar {
  height: 5px;
  background: #e8edf6;
}

.factor-fill {
  background: #899cda;
}

.breakdown-expl {
  line-height: 1.8;
  padding-top: 14px;
}

.jobs-table-wrap,
.jobs-table {
  background: var(--ag-panel);
  border-color: var(--ag-border);
  border-radius: 12px;
  box-shadow: var(--ag-shadow);
}

.jobs-table th,
.jobs-table td {
  padding: 16px;
  line-height: 1.6;
  font-size: 14px;
  border-color: var(--ag-border);
}

.jobs-table th {
  background: #f6f8fc;
  color: #667085;
  font-size: 12px;
  text-transform: none;
  letter-spacing: .1px;
  font-weight: 600;
}

.job-row:hover {
  background: #f8f9fd;
}

.job-row.expanded {
  background: #f0f3fe;
}

.file-segmented {
  background: var(--ag-panel);
  border-color: var(--ag-border);
  border-radius: 8px;
}

.file-btn {
  font-size: 14px;
  min-height: 34px;
}

.file-btn:hover:not(:disabled) {
  background: #edf1fd;
  color: var(--ag-primary);
}

.fix-resume-btn,
.download-resume-btn {
  width: 30px;
  height: 30px;
  min-width: 30px;
  min-height: 30px;
  border-radius: 7px;
}

.pagination {
  gap: 8px;
  margin-top: 24px;
}

.pagination button {
  min-width: 36px;
  min-height: 36px;
  font-size: 14px;
  border-radius: 8px;
}

.pagination button.current {
  background: var(--ag-primary);
  border-color: var(--ag-primary);
  color: #fff;
}

.pagination .info {
  font-size: 12px;
  color: var(--ag-muted);
}

/* Structured profile builder. Existing sizing calculations remain intact. */
.rb-form {
  padding: 22px;
}

.rb-editor-head {
  gap: 15px;
  padding-bottom: 18px;
  margin-bottom: 20px;
}

.rb-name-input,
.rb-name-static,
.resume-title-input {
  font-family: var(--ag-heading);
  font-size: 23px;
  font-weight: 700;
  letter-spacing: -.55px;
  line-height: 1.35;
  color: var(--ag-text);
}

.rb-name-input,
.resume-title-input {
  background: transparent;
}

.rb-name-input:focus,
.resume-title-input:focus {
  background: #fafbfe;
  box-shadow: 0 0 0 3px #465ee610;
}

.rb-back-button,
.rb-new-profile-button {
  height: auto;
  min-height: 40px;
}

.rb-profile-row,
.rb-document-bar,
.rb-combine-panel,
.rb-format-section {
  padding: 16px;
  border-color: var(--ag-border);
  border-radius: 10px;
  background: #f7f9fd;
}

.rb-profile-row {
  grid-template-columns: minmax(240px, 1fr) auto;
}

.rb-profile-select-field select {
  height: 42px;
  font-size: 16px;
  background: var(--ag-panel);
}

.rb-profile-actions {
  flex-wrap: wrap;
  min-width: 0;
  gap: 8px;
}

.rb-default-profile,
.rb-delete-profile {
  height: auto;
  min-height: 40px;
  font-size: 14px;
}

.rb-combine-head h3 {
  font-family: var(--ag-heading);
  font-size: 18px;
  letter-spacing: -.3px;
  color: var(--ag-text);
  text-transform: none;
}

.rb-combine-head p {
  color: var(--ag-muted);
  font-size: 14px;
  line-height: 1.7;
}

.rb-combine-list {
  padding: 10px;
  background: var(--ag-panel);
  border-color: var(--ag-border);
  border-radius: 8px;
}

.rb-combine-option {
  padding: 7px 4px;
  font-size: 14px;
  line-height: 1.6;
  color: #526076;
}

.rb-document-actions {
  gap: 8px;
  flex-wrap: wrap;
}

.rb-document-actions button,
.rb-document-actions .rb-import-button {
  height: auto;
  min-height: 40px;
}

.rb-save-status {
  padding: 7px 11px;
  min-height: 34px;
  border-color: var(--ag-border);
  border-radius: 7px;
  background: var(--ag-panel);
  font-size: 12px;
  font-weight: 550;
  color: var(--ag-muted);
}

.rb-status-dot {
  width: 6px;
  height: 6px;
}

.rb-save-status.is-editing {
  color: #536fc0;
  background: #f0f3fe;
}

.rb-save-status.is-saving {
  color: #956d2f;
  background: #fff8e9;
}

.rb-save-status.is-saved {
  color: #477864;
  background: #edf5f0;
}

.rb-save-status.is-error {
  color: #ad504c;
  background: #fff1ee;
}

.rb-section {
  padding-bottom: 24px;
  margin-bottom: 24px;
  border-color: var(--ag-border);
}

.rb-section h3 {
  color: var(--ag-text);
  font-family: var(--ag-heading);
  font-size: 18px;
  font-weight: 700;
  text-transform: none;
  letter-spacing: -.35px;
  margin-bottom: 15px;
}

.rb-section-header {
  gap: 12px;
  margin-bottom: 17px;
}

.rb-section-header h3 {
  margin: 0;
}

.rb-grid-2 {
  gap: 14px;
  margin-bottom: 14px;
}

.rb-role-card,
.rb-edu-card {
  background: #f8fafd;
  border-color: var(--ag-border);
  border-radius: 10px;
  padding: 18px;
  margin-bottom: 16px;
}

.rb-role-number {
  color: #526076;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0;
}

.rb-role-tools {
  gap: 6px;
}

.rb-role-tools button {
  min-height: 30px;
  min-width: 30px;
  font-size: 14px;
}

.rb-bullet-row {
  gap: 7px;
  margin-bottom: 10px;
}

.rb-bullet-row textarea {
  font-size: 16px;
  line-height: 1.65;
  min-height: 74px;
  padding: 10px 12px;
  background: var(--ag-panel);
}

.rb-bullet-include {
  background: #f1f4fa;
  border-color: var(--ag-border);
}

.rb-bullet-include input,
.rb-inline-check input,
.rb-combine-option input[type="checkbox"] {
  width: 16px;
  height: 16px;
}

.rb-bullet-tools button {
  min-height: 28px;
}

.rb-bullet-row.drag-over {
  background: #edf1fd;
  outline-color: #8b9feb;
}

.rb-format-section .rb-section-header h3 {
  font-size: 16px;
}

.rb-preset-row {
  gap: 12px;
  grid-template-columns: minmax(150px, 1fr) minmax(180px, 1fr) auto auto;
}

.rb-format-grid {
  grid-template-columns: repeat(auto-fit, minmax(126px, 1fr));
  gap: 13px;
}

.rb-margin-grid {
  grid-template-columns: repeat(auto-fit, minmax(95px, 1fr));
  gap: 12px;
}

.rb-preset-row select,
.rb-preset-row input,
.rb-format-grid select,
.rb-format-grid input,
.rb-margin-grid input,
.rb-preset-button {
  height: 40px;
  font-size: 14px;
}

.rb-margin-head h4,
.rb-inline-check {
  font-size: 14px;
  font-weight: 550;
  text-transform: none;
  letter-spacing: 0;
  color: #526076;
}

.rb-scroll-sections {
  padding-right: 8px;
  scrollbar-color: #cbd3e2 transparent;
}

.rb-scroll-sections::-webkit-scrollbar-thumb {
  background: #cbd3e2;
}

.rb-preview-pane {
  border-radius: 12px;
  background: #eef1f7;
  box-shadow: var(--ag-shadow);
}

.rb-preview-iframe {
  border-color: #dce2ec;
  border-radius: 12px;
}

/* Legacy résumé editor chrome; no selectors inside .resume-preview. */
.builder-nav,
.builder-card {
  padding: 18px;
}

.builder-document-panel {
  padding: 20px;
}

.builder-section-btn {
  min-height: 43px;
  padding: 10px;
  background: #f7f9fd;
  font-size: 14px;
}

.builder-section-btn small {
  font-size: 12px;
}

.builder-section-editor textarea {
  background: var(--ag-panel);
  border-color: #dce2ed;
  color: var(--ag-text);
  font-size: 16px;
  line-height: 1.7;
}

.builder-doc-header {
  font-size: 14px;
  line-height: 1.6;
  margin-bottom: 18px;
}

.builder-page {
  background: #edf1f7;
  border-color: #dde4ee;
  border-radius: 9px;
}

.builder-score-meta,
.draft-status {
  font-size: 12px;
  color: var(--ag-muted);
}

/* Preview dialog chrome, notices, and loading/empty states. */
.preview-overlay {
  background: #17223966;
  backdrop-filter: blur(4px);
}

.preview-modal {
  background: var(--ag-panel);
  border-color: var(--ag-border);
  border-radius: 15px;
  box-shadow: 0 24px 80px #172a4833;
}

.preview-modal-header {
  padding: 17px 21px;
  background: var(--ag-panel);
  border-color: var(--ag-border);
  gap: 18px;
}

.preview-modal-title {
  font-family: var(--ag-heading);
  font-size: 16px;
  font-weight: 650;
  color: var(--ag-text);
}

.preview-modal-actions {
  gap: 9px;
  flex-wrap: wrap;
}

.preview-profile-select,
.preview-relevant-toggle {
  min-height: 39px;
  background: #f7f9fd;
  border-color: var(--ag-border);
  border-radius: 8px;
  font-size: 14px;
  color: #526076;
}

.preview-profile-select select {
  min-height: 30px;
  height: auto;
  font-size: 14px;
  background: var(--ag-panel);
}

.preview-relevant-toggle input {
  width: 16px;
  height: 16px;
}

.preview-relevant-toggle:has(input:checked) {
  border-color: #c3cff2;
  background: #eef2ff;
  color: #5069b8;
}

.preview-download-btn,
.preview-edit-btn,
.preview-close-btn {
  min-height: 39px;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 14px;
}

.preview-close-btn {
  min-width: 39px;
  color: var(--ag-muted);
}

.preview-modal-body {
  background: #eef1f7;
}

.preview-loading,
.preview-error {
  font-size: 16px;
  line-height: 1.7;
  padding: 25px;
}

.preview-error {
  color: #ad504c;
}

.ai-enrich-btn {
  min-height: 32px;
  min-width: 32px;
  border-radius: 8px;
  font-size: 14px;
}

.ai-enrich-btn:hover:not(:disabled),
.ai-enrich-btn.active {
  background: #edf1fd;
  border-color: #c9d3f0;
  color: var(--ag-primary);
}

.preview-ai-enrich-btn {
  width: 39px;
  min-width: 39px;
  min-height: 39px;
}

.toast {
  background: var(--ag-panel);
  color: var(--ag-text);
  border-color: var(--ag-border);
  border-radius: 10px;
  box-shadow: 0 8px 30px #24365b20;
  padding: 15px 19px;
  font-size: 14px;
  line-height: 1.65;
  max-width: min(430px, calc(100vw - 32px));
}

.toast.success {
  border-left-color: #6f9780;
}

.toast.error {
  border-left-color: #c1766b;
}

.warn-banner {
  background: #fff8e8;
  color: #946b28;
  border-color: #eedfba;
  border-radius: 9px;
  padding: 14px 17px;
  font-size: 14px;
  line-height: 1.7;
}

.quick-jd-error {
  background: #fff3f0;
  border-color: #eedbd5;
  color: #a95249;
  font-size: 14px;
  line-height: 1.65;
  padding: 12px 14px;
}

.empty {
  padding: 54px 25px;
  font-size: 16px;
  line-height: 1.8;
  color: var(--ag-muted);
}

.kbd {
  font-size: 12px;
  color: #667085;
  background: #f2f4f9;
}

.primary .spin,
.preview-download-btn .spin,
.upload-pill .spin {
  border-color: #ffffff66;
  border-top-color: #fff;
}

@media (max-width: 1280px) {
  .container,
  .container.home-container,
  .container.jobs-container {
    padding-left: 28px;
    padding-right: 28px;
  }

  .rb-profile-row,
  .rb-document-bar {
    grid-template-columns: 1fr;
  }

  .rb-profile-actions,
  .rb-document-actions {
    justify-content: flex-start;
  }

  .rb-preset-row {
    grid-template-columns: 1fr 1fr;
  }

  .rb-preset-select,
  .rb-preset-name {
    min-width: 0;
  }

  .breakdown-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 980px) {
  .home-quick-card {
    padding: 25px;
  }

  .home-quick-grid {
    grid-template-columns: 1fr;
  }

  .home-quick-textarea {
    min-height: 280px;
  }

  .home-result-empty {
    min-height: 230px;
  }

  .home-quick-files {
    grid-template-columns: 1fr 1fr auto;
  }

  .settings-body {
    padding: 24px;
  }

  .nested-password-grid {
    grid-template-columns: 1fr;
  }

  .preview-modal-header {
    flex-wrap: wrap;
  }

  .preview-modal-title {
    max-width: 100%;
  }

  .preview-modal-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 760px) {
  .container,
  .container.home-container,
  .container.jobs-container,
  .container.builder-container {
    padding: 18px;
  }

  .panel,
  .jobs-side-panel,
  .home-quick-card,
  .rb-form,
  .quick-jd-sidebar-card {
    padding: 20px;
  }

  .home-quick-inputs,
  .home-quick-results {
    padding: 18px;
  }

  .home-quick-intro h1 {
    font-size: 30px;
  }

  .home-quick-intro {
    gap: 17px;
    margin-bottom: 23px;
  }

  .settings-page-head h1 {
    font-size: 27px;
  }

  .settings-page-panel {
    padding: 0;
  }

  .settings-section-head {
    flex-direction: column;
    gap: 5px;
  }

  .settings-check-grid {
    grid-template-columns: 1fr;
  }

  .jobs-config-bar,
  .jobs-config-bar.query-mode {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
  }

  .jobs-config-actions {
    grid-column: 1 / -1;
  }

  .jobs-config-actions button {
    width: auto;
    min-width: 160px;
  }

  .ag-job-card-main {
    padding: 21px;
    gap: 21px;
  }

  .ag-job-card .job-title {
    font-size: 20px;
  }

  .ag-job-card-breakdown {
    padding: 20px;
  }

  .job-skill-section {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .breakdown-grid {
    grid-template-columns: 1fr;
  }

  .rb-header-main,
  .rb-profile-row,
  .rb-document-bar {
    grid-template-columns: 1fr;
  }

  .rb-header-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .rb-name-static,
  .rb-name-input,
  .resume-title-input {
    font-size: 21px;
  }

  .rb-profile-actions,
  .rb-document-actions {
    flex-wrap: wrap;
  }

  .rb-role-card,
  .rb-edu-card {
    padding: 15px;
  }

  .rb-section-header {
    flex-wrap: wrap;
  }

  .rb-margin-head {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .rb-format-grid,
  .rb-margin-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .builder-topbar {
    flex-wrap: wrap;
  }

  .builder-top-actions {
    justify-content: flex-start;
  }

  .builder-doc-header {
    flex-wrap: wrap;
  }

  .preview-overlay {
    padding: 12px;
  }

  .preview-modal {
    border-radius: 12px;
  }

  .preview-modal-header {
    padding: 15px;
    gap: 13px;
  }

  .preview-modal-actions {
    gap: 8px;
  }

  .preview-profile-select {
    max-width: 100%;
  }
}

@media (max-width: 520px) {
  .container,
  .container.home-container,
  .container.jobs-container,
  .container.builder-container {
    padding: 15px;
  }

  .auth-shell,
  .setup-shell {
    padding: 20px;
  }

  .auth-card,
  .setup-card {
    padding: 25px;
    border-radius: 14px;
  }

  .auth-card h1,
  .setup-card h1 {
    font-size: 27px;
  }

  .panel,
  .home-quick-card,
  .jobs-side-panel,
  .rb-form,
  .quick-jd-sidebar-card {
    padding: 17px;
  }

  .home-quick-inputs,
  .home-quick-results {
    padding: 15px;
  }

  .home-quick-intro h1 {
    font-size: 28px;
  }

  .home-quick-files,
  .grid-2,
  .rb-grid-2,
  .settings-check-grid {
    grid-template-columns: 1fr;
  }

  .home-result-empty {
    min-height: 210px;
    padding: 20px 10px;
  }

  .home-quick-textarea {
    min-height: 240px;
  }

  .home-result-table th {
    width: 92px;
  }

  .quick-jd-result-table th,
  .quick-jd-result-table td {
    padding: 11px 10px;
  }

  .settings-page-panel {
    padding: 0;
  }

  .settings-body {
    padding: 19px;
  }

  .settings-page-head {
    gap: 12px;
    margin-bottom: 19px;
  }

  .settings-page-head h1 {
    font-size: 24px;
  }

  .settings-section {
    padding: 23px 0;
  }

  .settings-section-head h3 {
    font-size: 17px;
  }

  .jobs-config-bar,
  .jobs-config-bar.query-mode {
    grid-template-columns: 1fr;
  }

  .jobs-config-bar.query-mode .jobs-query-field {
    grid-column: auto;
  }

  .jobs-config-actions button {
    width: 100%;
  }

  .jobs-toolbar-right {
    justify-content: flex-start;
  }

  .jobs-sort-control {
    flex-wrap: wrap;
    white-space: normal;
  }

  .jobs-sort-control select {
    max-width: 100%;
  }

  .ag-job-card-main,
  .ag-job-card-breakdown {
    padding: 18px;
  }

  .ag-job-card-profile {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .pagination {
    flex-wrap: wrap;
  }

  .rb-profile-row,
  .rb-document-bar,
  .rb-combine-panel,
  .rb-format-section {
    padding: 13px;
  }

  .rb-profile-actions,
  .rb-document-actions {
    gap: 7px;
  }

  .rb-profile-actions button,
  .rb-document-actions button,
  .rb-document-actions .rb-import-button {
    padding: 9px 11px;
  }

  .rb-profile-select-field select,
  .rb-bullet-row textarea {
    font-size: 16px;
  }

  .rb-role-header {
    gap: 10px;
    flex-wrap: wrap;
  }

  .rb-bullet-row {
    flex-wrap: wrap;
    gap: 6px;
  }

  .rb-bullet-row textarea {
    flex-basis: calc(100% - 76px);
    min-width: 0;
  }

  .rb-bullet-tools {
    flex-direction: row;
    margin-left: auto;
  }

  .rb-bullet-tools button {
    min-height: 28px;
  }

  .rb-section h3 {
    font-size: 17px;
  }

  .builder-document-panel,
  .builder-card,
  .builder-nav {
    padding: 16px;
  }

  .builder-page {
    padding: 14px;
  }

  .preview-overlay {
    padding: 6px;
  }

  .preview-modal-header {
    padding: 13px;
  }

  .preview-modal-title {
    font-size: 14px;
  }

  .preview-modal-actions {
    width: 100%;
  }

  .preview-profile-select {
    flex: 1 1 100%;
    justify-content: space-between;
  }

  .preview-profile-select select {
    width: auto;
    max-width: 75%;
    flex: 1;
  }

  .preview-close-btn {
    margin-left: auto;
  }

  .toast {
    left: 16px;
    right: 16px;
    bottom: 16px;
    max-width: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  button,
  input,
  select,
  textarea,
  .ag-job-card,
  .rb-bullet-row,
  .factor-fill {
    transition: none;
  }
}

/* Application history uses the same page-heading rhythm as settings. */
.applied-screen { padding-top: 16px; }
.applied-page-head { display: flex; flex-wrap: wrap; }
.applied-page-head h1 { margin-bottom: 0; }
.applied-page-stats { display: flex; gap: 8px; margin-left: auto; flex-wrap: wrap; }
.applied-screen > .panel { overflow-x: auto; }
.applied-table { min-width: 660px; }
@media (max-width: 600px) {
  .applied-page-stats { margin-left: 0; flex-basis: 100%; }
}

.ag-job-card-actions .application-queue-action { grid-column: 1 / -1; color: var(--ag-primary); border-color: #cfd6f5; background: #f6f7ff; min-height: 40px; }
