/* Hide FRA contract/salary info block by default */
#fraContractSalaryInfoSidebar {
  display: none;
}
/* FRA Contract Period and Salary info block */
.cv-fra-info {
  margin: 1.5em 0 1em 0;
  padding: 1em 1.5em;
  background: #f7f7fa;
  border-left: 4px solid #204d8d;
  font-size: 1.08em;
  color: #222;
  display: flex;
  gap: 2em;
  flex-wrap: wrap;
}
/* Section divider for builder */
.section-divider {
  margin: 2em 0;
}
:root {
  --bg: #f5f6f8;
  --panel: #ffffff;
  --ink: #1f2937;
  --muted: #667085;
  --line: #e5e8ee;
  --brand: #4d66e8;
  --brand-2: #5a67f2;
  --accent-soft: #eef2ff;
  --bg-a: #f8fafc;
  --bg-b: #f2f4f7;
  --fs-ui-label: 0.95rem;
  --fs-ui-input: 0.95rem;
  --cv-font-scale: 1;
  --fs-doc: calc(11px * var(--cv-font-scale));
  --fs-doc-head: calc(13px * var(--cv-font-scale));
  --cv-font-brand-title: calc(16.5px * var(--cv-font-scale));
  --cv-font-brand-copy: calc(11px * var(--cv-font-scale));
  --cv-font-brand-ar: calc(10px * var(--cv-font-scale));
  --cv-font-brand-title-compact: calc(14.2px * var(--cv-font-scale));
  --cv-font-brand-copy-compact: calc(9.4px * var(--cv-font-scale));
  --cv-font-footer: calc(10.5px * var(--cv-font-scale));
  --cv-font-footer-icon: calc(9px * var(--cv-font-scale));
  --cv-font-preview-section: calc(12px * var(--cv-font-scale));
  --cv-font-preview-brand-title: calc(15px * var(--cv-font-scale));
  --cv-font-preview-brand-copy: calc(10px * var(--cv-font-scale));
  --cv-font-preview-brand-ar: calc(9px * var(--cv-font-scale));
  --cv-font-preview-footer: calc(9.5px * var(--cv-font-scale));
  --cv-font-preview-footer-icon: calc(8px * var(--cv-font-scale));
  --cv-font-preview-stars: calc(12px * var(--cv-font-scale));
  --cv-font-fra-brand-title: calc(18px * var(--cv-font-scale));
  --cv-font-fra-copy: calc(9px * var(--cv-font-scale));
  --cv-font-fra-contact-strong: calc(10px * var(--cv-font-scale));
  --cv-font-fra-contact: calc(9px * var(--cv-font-scale));
  --cv-font-fra-section-head: calc(9px * var(--cv-font-scale));
  --cv-font-fra-table: calc(9px * var(--cv-font-scale));
  --cv-font-fra-table-top: calc(10px * var(--cv-font-scale));
  --cv-font-fra-remarks: calc(9px * var(--cv-font-scale));
  --local-accent: #5e78e8;
  --local-accent-dark: #4d57c9;
  --doc-line: #847db2;
  --doc-line-soft: #d4ceeb;
  --doc-fill: #fbf8ff;
  --agency-header-bg-start: #f9fbff;
  --agency-header-bg-end: #f3f7ff;
  --agency-header-accent: #2b5fb8;
  --agency-header-text: #183a67;
  --agency-header-panel: #ffffff;
  --app-font-family: "Manrope", "IBM Plex Sans", Arial, sans-serif;
  --app-heading-font-family: "Sora", "Manrope", "IBM Plex Sans", Arial, sans-serif;
  --doc-a4-width: 210mm;
  --doc-a4-height: 297mm;
  --doc-paper-print-edge-gap: 0;
}


* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--app-font-family);
  color: var(--ink);
  background:
    radial-gradient(rgba(71, 84, 103, 0.12) 0.8px, transparent 0.8px),
    linear-gradient(180deg, #f9fafb 0%, var(--bg) 100%);
  background-size: 16px 16px, 100% 100%;
}

body[data-theme="classic"] {
  --bg: #edf3fa;
  --ink: #142039;
  --muted: #5b6b86;
  --line: #b8c3d7;
  --brand: #153f90;
  --brand-2: #0d2b66;
  --accent-soft: #eaf0ff;
  --bg-a: #d9e7ff;
  --bg-b: #dff7f2;
}

body[data-theme="desert"] {
  --bg: #f7f1e8;
  --ink: #2f2619;
  --muted: #7a664a;
  --line: #cfbe9f;
  --brand: #9a5f13;
  --brand-2: #72420b;
  --accent-soft: #fff2de;
  --bg-a: #ffe4c2;
  --bg-b: #f2e7d7;
}

body[data-theme="emerald"] {
  --bg: #ebf4f3;
  --ink: #102d2a;
  --muted: #4b6f6b;
  --line: #a9c8c4;
  --brand: #0d7a66;
  --brand-2: #085748;
  --accent-soft: #dbf6f1;
  --bg-a: #cdf3ea;
  --bg-b: #d8efff;
}

body[data-theme="royal"] {
  --bg: #eef1ff;
  --ink: #131f45;
  --muted: #4f5f92;
  --line: #b8c2ef;
  --brand: #2b3fb3;
  --brand-2: #1f2f88;
  --accent-soft: #e8ecff;
  --bg-a: #dae1ff;
  --bg-b: #e4f0ff;
}

body[data-theme="sunrise"] {
  --bg: #fff3ed;
  --ink: #3c2019;
  --muted: #805044;
  --line: #e2b7a8;
  --brand: #bf5a31;
  --brand-2: #8f3f21;
  --accent-soft: #ffe8de;
  --bg-a: #ffd8c7;
  --bg-b: #ffe8c9;
}

body[data-theme="slate"] {
  --bg: #eff2f6;
  --ink: #1f2735;
  --muted: #5a667a;
  --line: #c0c8d8;
  --brand: #3a4b68;
  --brand-2: #2c3950;
  --accent-soft: #e5ebf5;
  --bg-a: #dce4f2;
  --bg-b: #e9edf5;
}

body[data-theme="ruby"] {
  --bg: #fff0f3;
  --ink: #3e1b25;
  --muted: #7f4a59;
  --line: #e3b5c2;
  --brand: #b53b58;
  --brand-2: #8e2a43;
  --accent-soft: #ffe4ea;
  --bg-a: #ffd3de;
  --bg-b: #ffe5f0;
}

body[data-theme="midnight"] {
  --bg: #eaf0fb;
  --ink: #16223f;
  --muted: #4f618f;
  --line: #b5c3e5;
  --brand: #2a4d9b;
  --brand-2: #1f3b79;
  --accent-soft: #e1e9ff;
  --bg-a: #cfdcff;
  --bg-b: #dce9ff;
}

body[data-theme="ocean"] {
  --bg: #e8f5f6;
  --ink: #123338;
  --muted: #4a7075;
  --line: #a6cfd3;
  --brand: #127f8c;
  --brand-2: #0d616d;
  --accent-soft: #dbf3f6;
  --bg-a: #c9eef2;
  --bg-b: #d7f6ea;
}

body[data-theme="carbon"] {
  --bg: #eef1f4;
  --ink: #1f232b;
  --muted: #59606f;
  --line: #c5ccd8;
  --brand: #4a5568;
  --brand-2: #353d4d;
  --accent-soft: #e6eaf0;
  --bg-a: #dfe4ec;
  --bg-b: #e8edf4;
}

body[data-local-accent="blue"] {
  --local-accent: #1f4f94;
  --local-accent-dark: #183f75;
}

body[data-local-accent="emerald"] {
  --local-accent: #177a63;
  --local-accent-dark: #10634f;
}

body[data-local-accent="maroon"] {
  --local-accent: #8a2c46;
  --local-accent-dark: #6f2338;
}

body[data-local-accent="teal"] {
  --local-accent: #1a6f86;
  --local-accent-dark: #125b6d;
}

body[data-local-accent="violet"] {
  --local-accent: #5c4ca5;
  --local-accent-dark: #4a3c88;
}

.app-header {
  padding: 1rem;
}

.header-main {
  max-width: 1600px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(240px, 340px) minmax(680px, 1fr);
  align-items: start;
  gap: 1rem;
}

.header-title {
  text-align: left;
}

.app-header h1 {
  margin: 0;
  font-size: 2rem;
}

.app-header p {
  margin: 0.3rem 0 0;
  font-size: 1.05rem;
  color: var(--muted);
}

.header-right {
  display: grid;
  gap: 0.55rem;
}

.header-meta {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.builder-toolbar-tip {
  margin: 0.55rem 0 0;
  max-width: 360px;
  padding: 0.55rem 0.68rem;
  border: 1px solid #c9d8ef;
  border-radius: 10px;
  background: linear-gradient(180deg, #f8fbff, #eef5ff);
  color: #31527f;
  font-size: 0.8rem;
  line-height: 1.45;
}

.header-actions {
  display: flex;
  gap: 0.55rem;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.builder-statusbar {
  display: flex;
  justify-content: flex-end;
}

.draft-sync-status {
  display: inline-flex;
  align-items: center;
  gap: 0.38rem;
  border-radius: 999px;
  border: 1px solid #d6cff3;
  background: rgba(251, 248, 255, 0.94);
  color: #5a5399;
  padding: 0.34rem 0.62rem;
  font-size: 0.78rem;
  font-weight: 700;
}

.draft-sync-status::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #9b91d4;
}

.draft-sync-status[data-state="pending"]::before,
.draft-sync-status[data-state="saving"]::before {
  background: #d38a18;
}

.draft-sync-status[data-state="saved"]::before {
  background: #0f8b65;
}

.draft-sync-status[data-state="error"]::before {
  background: #b44357;
}

.toast-stack {
  position: fixed;
  left: 50%;
  right: auto;
  bottom: 1rem;
  transform: translateX(-50%);
  z-index: 90;
  display: grid;
  gap: 0.6rem;
  justify-items: center;
  width: min(420px, calc(100% - 2rem));
}

.toast {
  width: 100%;
  border-radius: 14px;
  border: 1px solid #d6cff3;
  background: rgba(255, 255, 255, 0.98);
  color: #2d3263;
  padding: 0.8rem 0.92rem;
  box-shadow: 0 18px 36px rgba(49, 35, 98, 0.18);
  text-align: center;
}

.toast[data-tone="success"] {
  border-color: #9fd8c2;
  background: #effaf5;
  color: #14553f;
}

.toast[data-tone="error"] {
  border-color: #e3b4be;
  background: #fff4f6;
  color: #7a1f2b;
}

.toast[data-tone="info"] {
  border-color: #bfd0e7;
  background: #f8fbff;
  color: #17406f;
}

.mobile-nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  justify-self: end;
  min-width: 210px;
  background: linear-gradient(180deg, var(--brand), var(--brand-2));
  border-color: var(--brand-2);
  color: #fff;
}

.mobile-nav-sheet {
  display: none;
}

.assistant-toggle-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
  margin: 0 0 0.85rem;
}

.assistant-toggle-chip,
.assistant-hide-btn {
  min-width: 0;
  border-radius: 999px;
  border: 1px solid #bfd0e7;
  background: linear-gradient(180deg, #ffffff, #f3f7ff);
  color: #1d4778;
  box-shadow: none;
}

.assistant-toggle-link {
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  color: #2f5889;
  font-size: 0.92rem;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.assistant-toggle-link:hover,
.assistant-toggle-link:focus-visible,
.assistant-toggle-chip:hover,
.assistant-hide-btn:hover {
  color: #1a4373;
}

.usage-chip {
  background: #f1ebff;
  border: 1px solid #d5cbf5;
  color: #514d95;
  border-radius: 999px;
  padding: 0.38rem 0.72rem;
  font-size: 0.84rem;
  font-weight: 700;
}

.theme-control {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--brand-2);
}

.theme-control.hidden-by-template {
  display: none;
}

.theme-control select {
  border: 1px solid #cdc5ef;
  border-radius: 8px;
  padding: 0.42rem 0.5rem;
  font: inherit;
  color: var(--ink);
  background: linear-gradient(180deg, #fff, #f7f2ff);
}

.theme-control-toggle {
  border: 1px solid #d8d2f1;
  border-radius: 10px;
  padding: 0.42rem 0.62rem;
  background: linear-gradient(180deg, #ffffff, #f7f2ff);
}

.theme-control-toggle input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--brand);
  cursor: pointer;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(320px, 460px) minmax(760px, 1fr);
  gap: 1rem;
  align-items: start;
  max-width: 1600px;
  margin: 0 auto;
  padding: 1rem;
}

.editor {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1rem;
  position: static;
  max-height: none;
  overflow: visible;
  box-shadow: 0 18px 48px rgba(15, 27, 53, 0.1);
}

.editor h2 {
  margin: 1rem 0 0.7rem;
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--brand-2);
  border-bottom: 1px solid #dde3ee;
  padding-bottom: 0.35rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.editor-note {
  margin-bottom: 0.9rem;
  padding: 0.7rem 0.75rem;
  border: 1px solid #cfd9ea;
  border-radius: 10px;
  background: #f3f7ff;
  color: #2a3d5f;
  font-size: 0.9rem;
  line-height: 1.35;
}

.builder-guide,
.builder-inline-tip,
#builderTopControls,
#builderActionBar {
  scroll-margin-top: 1rem;
}

.builder-guide {
  margin: 0 0 0.9rem;
  padding: 0.95rem;
  border: 1px solid #c6d7ef;
  border-radius: 16px;
  background:
    radial-gradient(120% 160% at 100% 0, rgba(84, 125, 198, 0.12), transparent 58%),
    linear-gradient(180deg, #fafdff, #eff5ff);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.builder-guide h2 {
  margin: 0;
  padding: 0;
  border: 0;
  font-size: 1.12rem;
  text-transform: none;
  letter-spacing: 0;
  color: #17396a;
}

.builder-guide-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 0.9rem;
}

.builder-guide-actions {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.builder-guide-kicker {
  margin: 0 0 0.2rem;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #5876a5;
}

.builder-guide-copy {
  margin: 0.35rem 0 0;
  max-width: 720px;
  color: #496483;
  font-size: 0.9rem;
  line-height: 1.45;
}

.builder-guide-toggle {
  min-width: 170px;
  padding-inline: 0.9rem;
  background: linear-gradient(180deg, #1f5db2, #18498a);
  border-color: #173f77;
  color: #ffffff;
  text-shadow: 0 1px 0 rgba(10, 27, 53, 0.18);
}

.builder-guide-toggle:hover,
.builder-guide-toggle:focus-visible,
.builder-guide-toggle:active {
  color: #ffffff;
}

.builder-guide-summary {
  margin: 0.9rem 0 0;
  padding: 0.78rem 0.85rem;
  border: 1px solid #c7d8ef;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.82);
  color: #274363;
  font-size: 0.9rem;
  line-height: 1.45;
}

.builder-guide-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-top: 0.85rem;
}

.builder-guide-step {
  display: grid;
  gap: 0.75rem;
  padding: 0.85rem;
  border: 1px solid #d3dff2;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.88);
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.builder-guide-step.is-current {
  border-color: #4d7fd1;
  box-shadow: 0 12px 24px rgba(37, 81, 145, 0.14);
  transform: translateY(-1px);
}

.builder-guide-step.is-complete {
  border-color: #9fd1bc;
  background: linear-gradient(180deg, #ffffff, #f3fbf7);
}

.builder-guide-step-head {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.72rem;
  align-items: start;
}

.builder-guide-step-head h3 {
  margin: 0;
  font-size: 0.98rem;
  color: #17365f;
}

.builder-guide-step-head p {
  margin: 0.28rem 0 0;
  color: #56708f;
  font-size: 0.84rem;
  line-height: 1.45;
}

.builder-guide-step-index {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 10px;
  background: linear-gradient(180deg, #e6eefc, #dce8fb);
  color: #21416b;
  font-size: 0.88rem;
  font-weight: 800;
}

.builder-guide-step-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.builder-guide-status {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  background: #edf3ff;
  color: #33537d;
  font-size: 0.8rem;
  font-weight: 800;
}

.builder-guide-step.is-complete .builder-guide-status {
  background: #e9f8f0;
  color: #166245;
}

.builder-guide-step.is-current .builder-guide-status {
  background: #e7f1ff;
  color: #174c88;
}

.builder-guide-jump {
  min-width: 0;
  padding: 0.44rem 0.7rem;
  border-radius: 10px;
  background: #fff;
  color: #21416b;
  border-color: #c7d8ef;
  box-shadow: none;
}

.builder-inline-tip {
  margin: 0.2rem 0 0.8rem;
  padding: 0.68rem 0.78rem;
  border-radius: 12px;
  border: 1px solid #c7d8ef;
  background: linear-gradient(180deg, #f8fbff, #f1f6ff);
  color: #37557d;
  font-size: 0.86rem;
  line-height: 1.45;
}

.builder-inline-tip-soft {
  background: linear-gradient(180deg, #f9fcff, #f5f9ff);
}

.builder-inline-tip-muted {
  background: linear-gradient(180deg, #fcfcff, #f6f7fb);
  border-color: #d9deeb;
  color: #5b6780;
}

.hidden {
  display: none !important;
}

.subscription-notice {
  margin: 0 0 0.9rem;
  padding: 0.85rem 0.95rem;
  border: 1px solid #d6d4ec;
  border-radius: 12px;
  background: linear-gradient(180deg, #fffef8, #f8f5ff);
  color: #2d3459;
  font-size: 0.9rem;
  line-height: 1.45;
}

.subscription-notice[data-tone="warning"] {
  border-color: #e6cf9b;
  background: linear-gradient(180deg, #fff8e8, #fffdf8);
}

.subscription-notice[data-tone="info"] {
  border-color: #bfd1ef;
  background: linear-gradient(180deg, #f5f9ff, #f8fbff);
}

.subscription-notice strong {
  display: block;
  margin-bottom: 0.2rem;
}

.subscription-notice-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 0.7rem;
}

.subscription-notice-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0.5rem 0.8rem;
  border-radius: 10px;
  border: 1px solid #cdc5ef;
  background: #fff;
  color: var(--brand-2);
  font-size: 0.86rem;
  font-weight: 700;
  text-decoration: none;
}

.input-grid {
  display: grid;
  gap: 0.6rem;
  margin-bottom: 0.55rem;
}

.input-grid.two {
  grid-template-columns: 1fr 1fr;
}

.input-grid.three {
  grid-template-columns: 1fr 1fr 1fr;
}

.input-grid.one {
  grid-template-columns: 1fr;
}

.past-experience-grid .span-2,
.past-experience-grid button {
  grid-column: 1 / -1;
}

.past-experience-grid button {
  width: 100%;
}

.local-mode-panel {
  display: none;
  border: 1px solid #c5d2e8;
  border-radius: 12px;
  padding: 0.85rem 0.8rem;
  margin: 0.2rem 0 0.8rem;
  background: linear-gradient(180deg, #f8fbff, #edf3ff);
}

body[data-market="ph-local"] .local-mode-panel {
  display: block;
}

body[data-market="ph-local"] .gcc-form-fields {
  display: block;
}

.photo-adjust label {
  font-size: 0.82rem;
}

.doc-adjust-grid label {
  font-size: 0.84rem;
}

.doc-select-control {
  position: relative;
}

.doc-select-control select {
  appearance: none;
  width: 100%;
  margin-top: 0.3rem;
  border: 1px solid #9db7df;
  border-radius: 10px;
  padding: 0.5rem 2rem 0.5rem 0.65rem;
  background:
    linear-gradient(180deg, #f7faff, #edf3ff);
  font: inherit;
  font-weight: 700;
  color: #17396a;
  box-shadow: 0 6px 16px rgba(20, 51, 95, 0.12);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.doc-select-control::after {
  content: "";
  position: absolute;
  right: 0.75rem;
  top: 2rem;
  width: 10px;
  height: 10px;
  border-right: 2px solid #2b4f82;
  border-bottom: 2px solid #2b4f82;
  transform: rotate(45deg);
  pointer-events: none;
}

.doc-select-control select:focus {
  outline: none;
  border-color: #5f8fcc;
  box-shadow: 0 0 0 3px #d4e4fb, 0 10px 22px rgba(32, 71, 126, 0.16);
}

label {
  display: block;
  font-size: var(--fs-ui-label);
  font-weight: 600;
}

body.is-beginner-mode label.builder-key-field:not(.upload-tile) {
  padding: 0.68rem;
  border: 1px solid #c8d9f0;
  border-radius: 12px;
  background:
    radial-gradient(110% 150% at 100% 0, rgba(108, 146, 214, 0.1), transparent 60%),
    linear-gradient(180deg, #fbfdff, #f1f6ff);
}

body.is-beginner-mode .upload-tile.builder-key-field {
  padding: 0.32rem;
  border: 1px solid #c8d9f0;
  border-radius: 16px;
  background:
    radial-gradient(110% 150% at 100% 0, rgba(108, 146, 214, 0.08), transparent 62%),
    linear-gradient(180deg, #fbfdff, #f4f8ff);
}

body.is-beginner-mode label.builder-key-field input,
body.is-beginner-mode label.builder-key-field textarea,
body.is-beginner-mode label.builder-key-field select {
  margin-top: 0.4rem;
}

body:not(.is-beginner-mode) .builder-toolbar-tip,
body:not(.is-beginner-mode) .builder-inline-tip {
  display: none;
}

.upload-tile {
  position: relative;
  display: grid;
  gap: 0.35rem;
}

.upload-label {
  display: block;
}

.upload-visual {
  border: 1px dashed #90aed9;
  border-radius: 14px;
  background:
    radial-gradient(120% 120% at 100% 0, rgba(94, 129, 196, 0.09), transparent 66%),
    linear-gradient(180deg, #f9fcff, #edf3ff);
  min-height: 120px;
  padding: 0.76rem 0.62rem;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 0.28rem;
  text-align: center;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.upload-glyph {
  width: 44px;
  height: 44px;
  border: 1px solid #95afd8;
  border-radius: 10px;
  background: #fff;
  position: relative;
}

.upload-glyph::before {
  content: "";
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 8px;
  height: 14px;
  background:
    linear-gradient(135deg, transparent 46%, #b0c5e8 47%, #b0c5e8 64%, transparent 65%),
    linear-gradient(45deg, transparent 42%, #8fa9d8 43%, #8fa9d8 68%, transparent 69%);
}

.upload-glyph::after {
  content: "";
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  top: 9px;
  right: 9px;
  background: #7d9fd4;
}

.upload-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: #243f69;
}

.upload-file-name {
  max-width: 100%;
  font-size: 0.78rem;
  color: #546b8e;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.upload-tile:hover .upload-visual {
  border-color: #5e90dc;
  box-shadow: 0 10px 22px rgba(33, 72, 128, 0.15);
  transform: translateY(-2px);
}

.upload-tile.has-file .upload-visual {
  border-color: #5a9f7a;
  background:
    radial-gradient(110% 110% at 100% 0, rgba(42, 133, 95, 0.12), transparent 70%),
    linear-gradient(180deg, #f5fff9, #e8f7ef);
}

.upload-tile.has-file .upload-file-name {
  color: #1f6a47;
  font-weight: 700;
}

.upload-tile input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
}

input,
textarea {
  width: 100%;
  margin-top: 0.28rem;
  font: inherit;
  font-size: var(--fs-ui-input);
  padding: 0.5rem 0.55rem;
  border: 1px solid #c3cfdf;
  border-radius: 8px;
  background: #ffffff;
}

textarea {
  resize: vertical;
}

.cv-rating-input-grid {
  align-items: start;
}

.cv-rating-select {
  width: 100%;
  margin-top: 0.28rem;
  font: inherit;
  font-size: var(--fs-ui-input);
  font-weight: 700;
  padding: 0.5rem 0.55rem;
  border: 1px solid #c3cfdf;
  border-radius: 8px;
  background: #ffffff;
}

.cv-rating-input-grid textarea {
  min-height: 72px;
}

.level-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem 0.9rem;
  align-items: center;
  margin-bottom: 0.7rem;
  padding: 0.5rem;
  border: 1px solid #cad6e6;
  border-radius: 8px;
  background: var(--accent-soft);
}

.level-picker span {
  font-weight: 700;
  margin-right: 0.3rem;
}

.level-picker label {
  font-weight: 500;
  margin: 0;
}

.local-mode-panel select {
  appearance: none;
  width: 100%;
  border: 1px solid #9bb3d8;
  border-radius: 10px;
  padding: 0.48rem 2rem 0.48rem 0.65rem;
  background:
    linear-gradient(180deg, #ffffff, #f2f7ff);
  font: inherit;
  font-weight: 700;
  color: #1f3f70;
  box-shadow: 0 8px 18px rgba(33, 61, 111, 0.14);
}

.inline-editable {
  border-radius: 4px;
  outline: 1px solid transparent;
  transition: background 0.15s ease, outline-color 0.15s ease;
  cursor: text;
}

.level-picker input {
  width: auto;
  margin: 0 0.25rem 0 0;
}

.actions {
  display: flex;
  gap: 0.65rem;
  margin-top: 1rem;
  position: sticky;
  bottom: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0), #fff 36%);
  padding-top: 1rem;
}

.cv-history-panel {
  margin-top: 1rem;
  border: 1px solid #cad6e8;
  border-radius: 10px;
  padding: 0.75rem;
  background: #f8fbff;
}

.cv-history-panel h2 {
  margin-top: 0;
}

#cvHistoryStatus {
  margin: 0.2rem 0 0.5rem;
  font-size: 0.84rem;
  color: #4e6283;
}

.cv-history-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.45rem;
}

.cv-history-item {
  border: 1px solid #d5deeb;
  border-radius: 8px;
  padding: 0.45rem 0.55rem;
  background: #fff;
}

.cv-history-item strong {
  display: block;
  font-size: 0.88rem;
  color: #1c355d;
}

.cv-history-item span {
  display: block;
  font-size: 0.76rem;
  color: #566c8f;
}

.cv-history-link {
  margin-top: 0.35rem;
  text-decoration: none;
}

.icon-mini-btn {
  display: inline-grid;
  justify-items: center;
  align-content: center;
  gap: 0.2rem;
  min-width: 78px;
  padding: 0.22rem 0.34rem;
  border-radius: 12px;
  color: #2f3f52;
}

.icon-mini-glyph {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(160deg, #3b82f6, #2563eb);
  box-shadow:
    0 9px 18px rgba(26, 64, 128, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.icon-mini-glyph svg {
  width: 17px;
  height: 17px;
  stroke: #fff;
  stroke-width: 1.9;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-mini-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.icon-mini-btn:hover {
  transform: translateY(-1px);
}

.cv-history-open {
  margin-top: 0.55rem;
  display: inline-block;
  font-size: 0.84rem;
  font-weight: 700;
  color: #1f4f94;
  text-decoration: none;
}

.cv-history-open:hover {
  text-decoration: underline;
}

button {
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 0.62rem 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.16s ease, filter 0.16s ease;
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.12);
}

button:hover {
  transform: translateY(-1px);
  filter: brightness(1.03);
}

button:active {
  transform: translateY(0);
}

[data-action] {
  min-width: 90px;
  padding: 0.24rem 0.38rem;
  border-radius: 12px;
  display: inline-grid;
  justify-items: center;
  align-content: center;
  gap: 0.34rem;
  text-align: center;
  position: relative;
  overflow: hidden;
  border-color: transparent;
  background: transparent;
  box-shadow: none;
  color: #2f3f52;
  filter: none;
}

[data-action]:hover {
  transform: translateY(-2px);
  filter: none;
}

.action-btn-icon {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--dock-tone, #2563eb) 10%, #ffffff);
  border: 1px solid color-mix(in srgb, var(--dock-tone, #2563eb) 18%, #dbe3ef);
  display: grid;
  place-items: center;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.92);
  position: relative;
  overflow: hidden;
}

.action-btn-icon svg {
  width: 22px;
  height: 22px;
  stroke: var(--dock-tone, #2563eb);
  stroke-width: 1.85;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.action-btn-label {
  font-size: 0.9rem;
  letter-spacing: 0.01em;
  text-transform: none;
  font-weight: 700;
  line-height: 1.1;
  color: var(--dock-label, #2f3f52);
}

[data-action="home"] {
  --dock-tone: #475569;
  --dock-label: #2f3f52;
}

[data-action="reset"] {
  --dock-tone: #047857;
}

[data-action="print"] {
  --dock-tone: #334155;
}

[data-action="history"] {
  --dock-tone: #0f766e;
}

[data-action="assistance"] {
  --dock-tone: #2563eb;
}

[data-action="application-form"] {
  --dock-tone: #0369a1;
}

[data-action="letterhead"] {
  --dock-tone: #4f46e5;
}

[data-action="profile"] {
  --dock-tone: #2563eb;
}

[data-action="save-record"] {
  --dock-tone: #047857;
}

[data-action="a4-check"] {
  --dock-tone: #0f766e;
}

[data-action="logout"] {
  --dock-tone: #64748b;
}


@keyframes dock-bob {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-2px);
  }
}

.preview-wrap {
  position: sticky;
  top: 84px;
  align-self: start;
  max-height: calc(100vh - 94px);
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 0;
  -ms-overflow-style: none;
}

.preview-wrap::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

.preview-stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-bottom: 0;
  align-items: center;
}

.paper {
  background: #fff;
  width: var(--doc-a4-width);
  height: var(--doc-a4-height);
  min-height: var(--doc-a4-height);
  margin: 0 auto;
  padding: 0.5px;
  box-shadow: 0 18px 44px rgba(18, 34, 61, 0.16);
  overflow: hidden;
  position: relative;
  box-sizing: border-box;
  aspect-ratio: 210 / 297;
}

body.has-subscription-watermark .paper::after {
  content: attr(data-watermark);
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transform: rotate(-28deg);
  font-size: 44px;
  font-weight: 900;
  letter-spacing: 0.12em;
  color: rgba(121, 24, 49, 0.15);
  text-transform: uppercase;
  pointer-events: none;
  -webkit-user-select: none;
  user-select: none;
  white-space: nowrap;
  z-index: 40;
}

.photo-card p {
  margin: 5px 0 0;
  font-size: 11px;
  font-weight: 700;
  color: #2b486f;
  letter-spacing: 0.01em;
}

.agency-footer {
  position: relative;
  overflow: hidden;
  margin-top: 8px;
  border: 1px solid #c3d0e6;
  border-radius: 10px;
  padding: 7px 8px 6px;
  display: grid;
  gap: 4px;
  background:
    radial-gradient(140% 140% at 100% 0%, rgba(53, 88, 149, 0.1), transparent 62%),
    linear-gradient(180deg, #f9fbff 0%, #f2f6ff 100%);
}

.agency-footer::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
  opacity: 0.9;
}

.supporting-page .agency-footer {
  margin-top: 6px;
  padding-top: 6px;
  padding-bottom: 5px;
  flex-shrink: 0;
}

.footer-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  font-size: var(--cv-font-footer);
  font-weight: 600;
  position: relative;
  z-index: 1;
  align-items: stretch;
}

.footer-row + .footer-row {
  border-top: 1px dashed #cfdaf0;
  padding-top: 4px;
}

.footer-row span {
  display: inline-flex;
  align-items: flex-start;
  gap: 6px;
  width: 100%;
  min-width: 0;
  min-height: 20px;
  padding: 2px 5px;
  border-radius: 8px;
  border: 1px solid #d6e0f1;
  background: rgba(255, 255, 255, 0.82);
  color: #2a3f63;
  line-height: 1.2;
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.footer-row span::before {
  content: "";
  width: 15px;
  height: 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #a9bbd9;
  background: var(--accent-soft);
  border-radius: 999px;
  color: var(--brand-2);
  font-size: var(--cv-font-footer-icon);
  line-height: 1;
  flex: 0 0 15px;
  margin-top: 0;
}

.footer-row span[id*="AgencyPhone"]::before {
  content: "☎";
}

.footer-row span[id*="AgencyEmail"]::before {
  content: "✉";
}

.footer-row span[id*="AgencyWebsite"]::before {
  content: "W";
}

.footer-row span[id*="AgencySocial1"]::before {
  content: "@";
}

.footer-row span[id*="AgencySocial2"]::before {
  content: "f";
}

.footer-row span[id*="AgencyAddress"]::before {
  content: "⌖";
}

.single-doc-wrap {
  margin-top: 8px;
}

.doc-card {
  border: 1px solid #111;
  padding: 6px;
}

.doc-frame {
  border: 1px solid #9ca8bf;
  background: #eef2fa;
  overflow: hidden;
}

.doc-card img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  transform-origin: center center;
  will-change: transform;
}

.doc-card.large .doc-frame {
  height: 260px;
}

.full-page-doc .doc-frame {
  height: 610px;
}

.doc-card p {
  margin: 4px 0 0;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
}

/* Default mode: keep only one-page CV visible/printable */
.supporting-page {
  display: none;
}

.supporting-page.page-two-visible {
  display: block;
}

.has-supporting-pages .supporting-page {
  display: block;
}

/* Passport page: keep passport copy visually large (around half A4 area) */
.has-supporting-pages #passportPage {
  display: flex;
  flex-direction: column;
}

.has-supporting-pages #passportPage .single-doc-wrap {
  flex: 1 1 auto;
  display: flex;
  min-height: 0;
}

.has-supporting-pages #passportPage .doc-card.full-page-doc {
  width: 100%;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.has-supporting-pages #passportPage .full-page-doc .doc-frame {
  flex: 1 1 auto;
  min-height: 0;
  height: auto;
}

/* Make supporting document pages use available A4 space */
.has-supporting-pages .supporting-page .agency-head.small {
  margin-bottom: 6px;
  padding: 7px 9px;
}

.preview-stack > .supporting-page .agency-head,
.preview-stack > .supporting-page .agency-head.small,
.preview-stack > .supporting-page .agency-footer,
.preview-stack > #pastExperiencePage .agency-head,
.preview-stack > #passportPage .agency-head,
.preview-stack > #passportPage .agency-footer {
  display: none !important;
}

.has-supporting-pages .supporting-page .paper-head {
  padding: 7px 10px;
  min-height: 34px;
  background: linear-gradient(120deg, var(--brand-2) 0%, var(--brand) 58%, var(--brand-2) 100%);
  color: #ffffff;
  border: 0;
  box-shadow: none;
}

.preview-stack > .supporting-page .paper-head::after {
  content: "";
}

.has-supporting-pages .supporting-page .single-doc-wrap {
  margin-top: 6px;
}

.has-supporting-pages .supporting-page .doc-card {
  padding: 5px;
}

.has-supporting-pages .supporting-page .doc-card p {
  margin-top: 3px;
  font-size: 11px;
}

.has-supporting-pages .supporting-page .agency-footer {
  margin-top: 5px;
  padding: 5px 7px 4px;
}

.has-supporting-pages #certificate1Page,
.has-supporting-pages #certificate2Page,
.has-supporting-pages #certificate3Page,
.has-supporting-pages #idPage {
  display: flex;
  flex-direction: column;
}

.has-supporting-pages #certificate1Page .single-doc-wrap,
.has-supporting-pages #certificate2Page .single-doc-wrap,
.has-supporting-pages #certificate3Page .single-doc-wrap,
.has-supporting-pages #idPage .single-doc-wrap {
  flex: 1 1 auto;
  display: flex;
  min-height: 0;
}

.has-supporting-pages #certificate1Page .doc-card.full-page-doc,
.has-supporting-pages #certificate2Page .doc-card.full-page-doc,
.has-supporting-pages #certificate3Page .doc-card.full-page-doc,
.has-supporting-pages #idPage .doc-card.full-page-doc {
  width: 100%;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.has-supporting-pages #certificate1Page .full-page-doc .doc-frame,
.has-supporting-pages #certificate2Page .full-page-doc .doc-frame,
.has-supporting-pages #certificate3Page .full-page-doc .doc-frame,
.has-supporting-pages #idPage .full-page-doc .doc-frame {
  flex: 1 1 auto;
  min-height: 0;
  height: auto;
}

@media screen and (max-width: 1100px) {
  .workspace {
    grid-template-columns: 1fr;
    padding: 0.85rem;
  }

  .editor {
    position: static;
    max-height: none;
  }

  .preview-wrap {
    position: static;
    max-height: none;
    overflow: visible;
    padding-right: 0;
  }

  .header-main {
    grid-template-columns: 1fr;
  }

  .header-title {
    text-align: center;
  }

  .header-right {
    width: 100%;
  }

  .header-meta,
  .header-actions {
    justify-content: center;
  }

  .builder-statusbar {
    justify-content: center;
  }
}

@media screen and (max-width: 900px) {
  :root {
    --fs-doc: 12px;
    --fs-doc-head: 14px;
  }

  .workspace {
    padding: 0.75rem;
    gap: 0.85rem;
  }

  .editor {
    padding: 0.9rem;
  }

  .paper {
    width: 100%;
    padding: 4mm;
    box-shadow: 0 14px 32px rgba(18, 34, 61, 0.12);
  }

  .header-right {
    justify-items: center;
    width: 100%;
  }

  .header-meta {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.55rem;
    align-items: stretch;
  }

  .theme-control {
    display: grid;
    gap: 0.35rem;
    align-items: stretch;
    padding: 0.72rem 0.78rem;
    border: 1px solid #d7dff1;
    border-radius: 12px;
    background: linear-gradient(180deg, #ffffff, #f5f8ff);
    box-shadow: 0 8px 18px rgba(20, 37, 68, 0.08);
  }

  .theme-control select {
    width: 100%;
    min-height: 46px;
    padding: 0.56rem 0.62rem;
    border-radius: 10px;
  }

  .theme-control-toggle {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.65rem;
  }

  .builder-toolbar-tip {
    margin-inline: auto;
    max-width: 560px;
  }

  .builder-guide-head {
    flex-direction: column;
  }

  .builder-guide-toggle {
    width: 100%;
    align-self: stretch;
  }

  .builder-guide-grid {
    grid-template-columns: 1fr;
  }

  .header-actions {
    display: none;
  }

  .builder-statusbar {
    width: 100%;
    justify-content: center;
  }

  .mobile-nav-toggle {
    display: inline-flex;
    width: 100%;
    min-width: 0;
    max-width: 560px;
  }

  .mobile-nav-sheet {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 95;
    pointer-events: none;
  }

  .mobile-nav-sheet.is-open {
    pointer-events: auto;
  }

  .mobile-nav-backdrop {
    position: absolute;
    inset: 0;
    border: 0;
    background: rgba(7, 15, 29, 0.48);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    box-shadow: none;
  }

  .mobile-nav-sheet.is-open .mobile-nav-backdrop {
    opacity: 1;
    pointer-events: auto;
  }

  .mobile-nav-card {
    position: absolute;
    left: 0.75rem;
    right: 0.75rem;
    bottom: 0.75rem;
    border: 1px solid #bfd0e7;
    border-radius: 14px;
    background: linear-gradient(180deg, #f9fcff, #eef4ff);
    box-shadow: 0 22px 42px rgba(10, 24, 45, 0.32);
    padding: 0.85rem;
    transform: translateY(108%);
    transition: transform 0.22s ease;
  }

  .mobile-nav-sheet.is-open .mobile-nav-card {
    transform: translateY(0);
  }

  .mobile-nav-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
    margin-bottom: 0.4rem;
  }

  .mobile-nav-head h2 {
    margin: 0;
    font-size: 1rem;
    color: var(--brand-2);
  }

  .mobile-nav-close {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    border: 1px solid #c6d5eb;
    background: #fff;
    color: #1e3f6b;
    font-size: 1.1rem;
    line-height: 1;
    box-shadow: none;
    padding: 0;
  }

  .mobile-nav-note {
    margin: 0 0 0.55rem;
    font-size: 0.82rem;
    color: #4f6589;
  }

  .mobile-nav-grid {
    display: grid;
    gap: 0.48rem;
    grid-template-columns: 1fr 1fr;
  }

  .mobile-nav-grid button {
    width: 100%;
    box-shadow: 0 8px 18px rgba(20, 37, 68, 0.17);
    min-width: 0;
    padding: 0.42rem 0.45rem;
  }

  .input-grid.two,
  .input-grid.three {
    grid-template-columns: 1fr;
  }

  input,
  textarea,
  .cv-rating-select {
    font-size: 16px;
  }

  .mid-layout {
    grid-template-columns: 1fr;
  }

  body[data-layout="ph-local"] #cvPreview .ph-local-resume {
    grid-template-columns: 1fr;
  }

  body[data-layout="ph-modern"] #cvPreview .ph-local-resume {
    grid-template-columns: 1fr;
    grid-template-areas:
      "head"
      "photo"
      "contact"
      "education"
      "skills"
      "experience"
      "reference";
  }

  body[data-layout="ph-modern"] #cvPreview .ph-card-contact {
    grid-template-columns: 1fr;
  }

  .mid-right {
    display: flex;
  }

  .photo-card.full img {
    height: 220px;
  }

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

  .full-page-doc .doc-frame {
    height: 320px;
  }

  .has-supporting-pages #passportPage .full-page-doc .doc-frame {
    height: auto;
    min-height: 0;
  }
}

@media screen and (max-width: 560px) {
  .app-header {
    padding: 0.75rem;
  }

  .workspace {
    padding: 0.55rem;
  }

  .editor {
    padding: 0.75rem;
  }

  .builder-guide,
  .builder-inline-tip,
  .editor-note,
  .subscription-notice {
    padding-inline: 0.75rem;
  }

  .header-meta {
    grid-template-columns: 1fr;
  }

  .theme-control {
    padding: 0.68rem;
  }

  .paper {
    padding: 3mm;
  }

  .mobile-nav-grid {
    grid-template-columns: 1fr;
  }
}

@media screen {
  .preview-wrap {
    position: static;
    top: auto;
    align-self: stretch;
    max-height: none;
    overflow: visible;
  }

  .preview-stack {
    align-items: stretch;
  }

  .paper {
    height: auto;
    min-height: var(--doc-a4-height);
    margin: 0;
    padding: 0.5px;
    box-shadow: none;
    overflow: visible;
    aspect-ratio: auto;
  }
}
