:root {
  --ink: #172033;
  --muted: #647084;
  --line: #d9e1ec;
  --soft: #f6f9fc;
  --green: #0f766e;
  --green-dark: #115e59;
  --blue: #315a8c;
  --blue-dark: #24476f;
  --blue-soft: #eef5fb;
  --gold: #b7791f;
  --shadow: 0 20px 60px rgba(23, 32, 51, 0.13);
}

* {
  box-sizing: border-box;
}

html {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

body {
  width: 100%;
  max-width: 100%;
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background: #f4f7fb;
  font-family: Arial, Helvetica, sans-serif;
  overflow-x: hidden;
  overflow-y: scroll;
  scrollbar-gutter: stable;
}

button,
input,
select {
  font: inherit;
}

.page-shell {
  width: 100%;
  max-width: 100vw;
  min-height: 100vh;
  display: grid;
  place-items: start center;
  padding: clamp(56px, 12vh, 110px) 18px 40px;
}

.search-home {
  width: min(760px, calc(100vw - 24px));
  max-width: 100%;
  min-width: 0;
  text-align: center;
}

.utility-row {
  display: flex;
  justify-content: flex-end;
  width: 100%;
  min-width: 0;
  margin-bottom: 18px;
}

.language-control {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  min-width: 0;
  color: var(--muted);
  font-size: 13px;
}

.language-control select {
  min-width: 0;
  min-height: 34px;
  max-width: min(56vw, 190px);
  padding: 0 30px 0 10px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
}

.brand-lockup {
  display: grid;
  justify-items: center;
  gap: 16px;
}

.brand-mark {
  display: grid;
  width: 72px;
  height: 72px;
  place-items: center;
  color: white;
  background: linear-gradient(135deg, #0f766e, #2563eb);
  border-radius: 12px;
  box-shadow: 0 16px 35px rgba(37, 99, 235, 0.2);
  font-size: 42px;
  font-weight: 800;
}

h1 {
  margin: 0;
  font-size: clamp(40px, 7vw, 70px);
  font-weight: 500;
  letter-spacing: 0;
}

.tagline {
  margin: 18px 0 30px;
  color: var(--ink);
  font-size: 20px;
  font-weight: 800;
}

.upload-box {
  display: grid;
  grid-template-columns: auto 1fr;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  align-items: center;
  gap: 12px;
  min-height: 58px;
  padding: 8px 10px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: 0 8px 25px rgba(23, 32, 51, 0.08);
}

.upload-box:focus-within,
.upload-box:hover {
  box-shadow: var(--shadow);
}

#cvFile {
  display: none;
}

#chooseFileBtn,
#downloadBtn,
#copyBtn,
#startOverBtn {
  min-height: 42px;
  padding: 0 18px;
  color: white;
  background: var(--blue);
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 700;
}

#chooseFileBtn:hover,
#downloadBtn:hover,
#copyBtn:hover,
#startOverBtn:hover {
  background: var(--blue-dark);
}

#chooseFileBtn {
  background: #334155;
}

#chooseFileBtn:hover {
  background: #1f2937;
}

#fileName {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.consent-line {
  display: inline-grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: start;
  gap: 8px;
  max-width: 620px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
  text-align: left;
}

.consent-line input {
  margin-top: 1px;
}

.status-line {
  min-height: 24px;
  margin: 18px 0 26px;
  color: var(--muted);
  font-size: 15px;
}

.status-line.is-working {
  color: var(--blue);
}

.status-line.is-error {
  color: #b3261e;
}

.result-panel {
  width: 100%;
  min-width: 0;
  margin-top: 28px;
  overflow: hidden;
  background: white;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
  text-align: left;
}

.result-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 22px;
  border-bottom: 1px solid var(--line);
}

.mini-label {
  margin: 0 0 4px;
  color: var(--blue);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

h2 {
  margin: 0;
  font-size: 24px;
  font-weight: 700;
}

.edit-note {
  padding: 12px 22px;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}

#cvPreview {
  --cv-name-align: center;
  --cv-name-color: #202124;
  --cv-name-size: 20px;
  --cv-contact-size: 13px;
  --cv-heading-color: #202124;
  --cv-heading-bg: transparent;
  --cv-heading-border: 1px solid #999;
  --cv-heading-left: 0;
  --cv-heading-padding: 0 0 4px;
  --cv-body-size: 14px;
  --cv-bullet-indent: 24px;
  --cv-line-gap: 5px;
  --cv-line-height: 1.45;
  max-height: 420px;
  margin: 0;
  padding: 24px;
  overflow: auto;
  overflow-wrap: anywhere;
  background: #f8fafc;
  color: #2b2f31;
  outline: none;
  font-family: Arial, Helvetica, sans-serif;
  font-size: var(--cv-body-size);
  line-height: var(--cv-line-height);
  white-space: normal;
  -webkit-overflow-scrolling: touch;
}

#cvPreview:focus {
  box-shadow: inset 0 0 0 2px rgba(26, 115, 232, 0.35);
}

.cv-name {
  min-height: calc(var(--cv-name-size) * 1.2);
  line-height: 1.2;
  text-align: var(--cv-name-align);
  color: var(--cv-name-color);
  font-size: var(--cv-name-size);
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}

.cv-contact {
  min-height: calc(var(--cv-contact-size) * 1.35);
  line-height: 1.35;
  margin: 5px 0 10px;
  text-align: var(--cv-name-align);
  color: var(--muted);
  font-size: var(--cv-contact-size);
  overflow-wrap: anywhere;
}

.cv-heading {
  min-height: calc(13px * var(--cv-line-height));
  line-height: var(--cv-line-height);
  margin: 10px 0 5px;
  padding: var(--cv-heading-padding);
  border-bottom: var(--cv-heading-border);
  border-left: var(--cv-heading-left);
  background: var(--cv-heading-bg);
  color: var(--cv-heading-color);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

.cv-line {
  min-height: calc(var(--cv-body-size) * var(--cv-line-height));
  line-height: var(--cv-line-height);
  margin: 0 0 var(--cv-line-gap);
  text-align: left;
  overflow-wrap: anywhere;
}

.cv-experience-meta {
  min-height: calc(var(--cv-body-size) * var(--cv-line-height));
  line-height: var(--cv-line-height);
  margin: 0 0 6px var(--cv-bullet-indent);
  font-weight: 800;
  text-align: left;
  overflow-wrap: anywhere;
}

.cv-bullet {
  min-height: calc(var(--cv-body-size) * var(--cv-line-height));
  padding-left: 14px;
  text-indent: -14px;
  line-height: var(--cv-line-height);
  margin: 0 0 var(--cv-line-gap) var(--cv-bullet-indent);
  text-align: left;
  overflow-wrap: anywhere;
}

.cv-separator {
  height: 1px;
  margin: 14px 0;
  background: #c9d3ce;
}

.cv-blank {
  margin-bottom: 3px;
}

.qa-panel {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.qa-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 22px 10px;
}

.qa-header h2 {
  font-size: 19px;
}

#runChecksBtn {
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--ink);
  font-weight: 700;
  cursor: pointer;
}

.qa-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 0 22px 20px;
}

.qa-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 13px;
  background: var(--soft);
}

.qa-card h3 {
  margin: 0 0 8px;
  font-size: 14px;
}

.qa-card ul {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.qa-card li {
  margin: 3px 0;
}

.qa-pass h3 {
  color: var(--green);
}

.qa-warn h3 {
  color: #8a5a00;
}

.qa-fail h3 {
  color: #b3261e;
}

.preview-area {
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
}

.preview-area p {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 14px;
}

.preview-options {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.preview-option {
  min-width: 0;
  display: grid;
  grid-template-columns: 20px 1fr;
  gap: 10px;
  align-items: center;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
}

.preview-option:has(input:checked) {
  border-color: var(--blue);
  background: var(--blue-soft);
  box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.12);
}

.preview-option strong,
.preview-option small {
  display: block;
  overflow-wrap: anywhere;
}

.preview-option small {
  color: var(--muted);
  margin-top: 2px;
}

.preview-classic {
  background: var(--soft);
}

.preview-compact {
  --cv-name-align: left;
  --cv-name-size: 18px;
  --cv-contact-size: 12px;
  --cv-heading-color: #202124;
  --cv-heading-border: 1px solid #c7c7c7;
  --cv-heading-padding: 0 0 2px;
  --cv-body-size: 13px;
  --cv-bullet-indent: 18px;
  --cv-line-gap: 3px;
  --cv-line-height: 1.4;
  background: #fbfbfb;
}

.preview-modern {
  --cv-name-align: center;
  --cv-name-color: #0f766e;
  --cv-name-size: 21px;
  --cv-heading-color: #0f766e;
  --cv-heading-bg: #eef9f7;
  --cv-heading-border: 0;
  --cv-heading-left: 4px solid #0f766e;
  --cv-heading-padding: 5px 8px;
  --cv-bullet-indent: 24px;
  background: #f7fbf8;
}

.preview-industrial {
  --cv-name-align: left;
  --cv-name-color: #26352b;
  --cv-name-size: 20px;
  --cv-heading-color: #26352b;
  --cv-heading-bg: #f3f7f1;
  --cv-heading-border: 1px solid #8aa28e;
  --cv-heading-left: 5px solid #5f7f66;
  --cv-heading-padding: 5px 8px;
  --cv-bullet-indent: 26px;
  background: #fbfcf9;
}

.preview-industrial .cv-heading {
  border-bottom-color: #8aa28e;
}

.preview-technical {
  --cv-name-align: left;
  --cv-name-color: #164b7a;
  --cv-name-size: 20px;
  --cv-heading-color: #164b7a;
  --cv-heading-border: 2px solid #9fb9d3;
  --cv-heading-padding: 0 0 5px;
  --cv-bullet-indent: 24px;
  background: #f8fbff;
}

.preview-technical .cv-heading {
  border-bottom-color: #9fb9d3;
}

.download-area {
  padding: 20px 22px 4px;
  border-top: 1px solid var(--line);
}

.download-area p {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 14px;
}

.download-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.format-option {
  min-width: 0;
  display: grid;
  grid-template-columns: 20px 1fr;
  gap: 10px;
  align-items: center;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
}

.format-option:has(input:checked) {
  border-color: var(--blue);
  background: var(--blue-soft);
  box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.12);
}

.format-option strong,
.format-option small {
  display: block;
  overflow-wrap: anywhere;
}

.format-option small {
  color: var(--muted);
  margin-top: 2px;
}

.result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 16px 22px 22px;
}

#copyBtn,
#startOverBtn {
  color: var(--ink);
  background: #eef3f8;
}

.help-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(max-content, 1fr));
  gap: 10px;
  min-height: 42px;
  margin: 10px 0 28px;
  overflow-x: auto;
  padding-bottom: 2px;
  color: var(--muted);
  font-size: 14px;
}

.help-row span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  min-height: 40px;
  padding: 8px 12px;
  background: #eaf0f7;
  border-radius: 999px;
  white-space: nowrap;
}

.privacy-note {
  width: min(760px, 100%);
  margin-top: 22px;
  padding: 14px 16px;
  color: var(--muted);
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 12px;
  line-height: 1.45;
  text-align: center;
  box-shadow: 0 8px 25px rgba(23, 32, 51, 0.06);
}

.privacy-note strong {
  color: var(--ink);
}

@media (max-width: 620px) {
  .page-shell {
    place-items: start center;
    padding: 16px 10px 28px;
  }

  .utility-row {
    justify-content: center;
    margin-bottom: 14px;
  }

  .language-control {
    width: 100%;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    justify-content: stretch;
    font-size: 12px;
  }

  .language-control select {
    width: 100%;
    max-width: none;
  }

  .brand-mark {
    width: 54px;
    height: 54px;
    font-size: 32px;
  }

  h1 {
    font-size: clamp(32px, 9vw, 44px);
  }

  .tagline {
    max-width: 25rem;
    margin: 12px auto 18px;
    font-size: 16px;
    line-height: 1.35;
  }

  .search-home {
    width: 100%;
  }

  .upload-box,
  .result-header {
    grid-template-columns: 1fr;
    border-radius: 18px;
  }

  .upload-box {
    display: grid;
    justify-items: stretch;
    gap: 10px;
    min-height: auto;
    padding: 10px;
  }

  #chooseFileBtn {
    width: 100%;
    min-width: 0;
    min-height: 48px;
    white-space: normal;
  }

  #fileName {
    padding: 0 10px 8px;
    text-align: center;
    white-space: normal;
  }

  .status-line {
    margin: 14px 0 16px;
    font-size: 14px;
  }

  .result-panel {
    margin-top: 18px;
    border-radius: 10px;
    box-shadow: 0 12px 32px rgba(23, 32, 51, 0.1);
  }

  .result-header {
    display: grid;
    padding: 16px;
  }

  h2 {
    font-size: 20px;
  }

  .preview-area,
  .download-area {
    padding: 16px;
  }

  .edit-note {
    padding: 11px 16px;
  }

  #downloadBtn {
    width: 100%;
    min-height: 48px;
  }

  .help-row {
    grid-template-columns: none;
    grid-auto-flow: column;
    grid-auto-columns: minmax(104px, max-content);
    justify-content: start;
    gap: 8px;
    margin-bottom: 18px;
    font-size: 12.5px;
    width: 100%;
    max-width: 100%;
    overscroll-behavior-x: contain;
    scroll-snap-type: x proximity;
  }

  .help-row span {
    min-width: 0;
    height: 38px;
    min-height: 38px;
    padding: 8px 10px;
    scroll-snap-align: start;
  }

  .download-options {
    grid-template-columns: 1fr;
  }

  .qa-header {
    align-items: stretch;
    display: grid;
  }

  #runChecksBtn {
    width: 100%;
  }

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

  .preview-options {
    grid-template-columns: 1fr;
  }

  .preview-option,
  .format-option {
    grid-template-columns: 18px minmax(0, 1fr);
    gap: 9px;
    padding: 12px;
  }

  #cvPreview {
    --cv-name-size: 18px;
    --cv-contact-size: 12px;
    --cv-body-size: 13px;
    --cv-bullet-indent: 16px;
    --cv-line-gap: 4px;
    max-height: 62vh;
    padding: 16px 12px;
  }

  .result-actions {
    display: grid;
    padding: 14px 16px 16px;
  }

  #copyBtn,
  #startOverBtn {
    width: 100%;
    min-height: 46px;
  }

  .consent-line {
    width: 100%;
  }

  .privacy-note {
    text-align: left;
  }
}

@media (max-width: 380px) {
  .page-shell {
    padding-inline: 8px;
  }

  .tagline {
    font-size: 15px;
  }

  .help-row {
    grid-auto-columns: minmax(92px, max-content);
    font-size: 12px;
  }

  .help-row span {
    padding-inline: 8px;
  }
}
