:root {
  --bg: #eef3f7;
  --bg-soft: #f8fafc;
  --surface: rgba(255, 255, 255, 0.78);
  --surface-strong: rgba(255, 255, 255, 0.92);
  --paper: #ffffff;
  --line: rgba(122, 141, 160, 0.26);
  --line-strong: rgba(85, 105, 125, 0.48);
  --text: #17212c;
  --muted: #617283;
  --success: #1e6a50;
  --warning: #ae6a1f;
  --danger: #a14545;
  --shadow: 0 24px 55px rgba(15, 23, 35, 0.12);
  --shadow-soft: 0 12px 28px rgba(15, 23, 35, 0.08);
  --radius-xl: 30px;
  --radius-lg: 24px;
  --radius-md: 18px;
  --radius-sm: 14px;
  --cv-body-font: "Source Sans 3", sans-serif;
  --cv-heading-font: "Source Sans 3", sans-serif;
  --cv-scale: 1;
  --cv-copy-weight: 400;
  --cv-strong-weight: 700;
  --cv-heading-weight: 700;
}

body[data-accent="ink"] {
  --accent: #245d8a;
  --accent-strong: #143b57;
  --accent-soft: #dceaf6;
  --accent-glow: rgba(36, 93, 138, 0.2);
}

body[data-accent="forest"] {
  --accent: #256f64;
  --accent-strong: #144740;
  --accent-soft: #dbefeb;
  --accent-glow: rgba(37, 111, 100, 0.2);
}

body[data-accent="ember"] {
  --accent: #b95d2e;
  --accent-strong: #743616;
  --accent-soft: #f7e4d8;
  --accent-glow: rgba(185, 93, 46, 0.2);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  position: relative;
  isolation: isolate;
  font-family: "Manrope", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.95), transparent 26%),
    radial-gradient(circle at top right, rgba(255, 255, 255, 0.6), transparent 24%),
    linear-gradient(180deg, #f6f9fc 0%, #ecf1f5 46%, #e7edf2 100%);
  transition: background 180ms ease, color 180ms ease;
}

body[data-theme="dark"] {
  --text: #ecf3fa;
  --muted: #9caec1;
  --line: rgba(115, 138, 161, 0.26);
  --line-strong: rgba(132, 155, 177, 0.44);
  --shadow: 0 22px 50px rgba(0, 0, 0, 0.28);
  --shadow-soft: 0 10px 24px rgba(0, 0, 0, 0.18);
  background:
    radial-gradient(circle at top left, rgba(56, 88, 120, 0.16), transparent 24%),
    radial-gradient(circle at top right, rgba(19, 32, 46, 0.65), transparent 24%),
    linear-gradient(180deg, #0d1520 0%, #101a26 46%, #0f1822 100%);
}

body::before,
body::after {
  content: "";
  position: fixed;
  border-radius: 999px;
  pointer-events: none;
  z-index: -1;
  filter: blur(10px);
}

body::before {
  top: -120px;
  left: -90px;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, var(--accent-glow), transparent 68%);
}

body::after {
  right: -120px;
  bottom: 40px;
  width: 320px;
  height: 320px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.85), transparent 68%);
}

body[data-theme="dark"]::after {
  background: radial-gradient(circle, rgba(53, 74, 98, 0.28), transparent 68%);
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

a {
  color: inherit;
}

.app-shell {
  display: grid;
  grid-template-columns: minmax(300px, 360px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
  padding: 18px;
}

.panel {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(250, 252, 255, 0.8)),
    var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
  transition: background 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

body[data-theme="dark"] .panel {
  background:
    linear-gradient(180deg, rgba(19, 29, 42, 0.94), rgba(15, 24, 35, 0.84)),
    rgba(12, 19, 28, 0.76);
  border-color: rgba(116, 138, 160, 0.12);
}

.panel::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  border: 1px solid var(--line);
  pointer-events: none;
}

.editor-pane {
  position: sticky;
  top: 16px;
  height: calc(100vh - 32px);
  overflow: auto;
  padding-right: 8px;
  scrollbar-width: thin;
  scrollbar-color: var(--accent) transparent;
}

.workspace-pane {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 18px;
  min-height: 0;
  height: auto;
  overflow: visible;
}

.workspace-topbar {
  display: grid;
  grid-template-columns: minmax(280px, 400px) minmax(0, 1fr);
  gap: 16px;
  min-height: 0;
  align-items: stretch;
}

.workspace-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 395px;
  gap: 20px;
  min-height: 0;
  align-items: start;
}

.brand-card,
.quick-tools-panel,
.add-section-panel,
.score-card,
.ats-controls,
.ai-panel,
.chat-panel,
.tips-panel,
.insights-panel,
.keywords-panel {
  padding: 20px;
}

.quick-tools-panel,
.add-section-panel,
.score-card,
.ats-controls,
.ai-panel,
.chat-panel,
.tips-panel,
.insights-panel,
.keywords-panel {
  display: grid;
  gap: 14px;
}

.brand-card {
  background:
    radial-gradient(circle at top right, rgba(255, 255, 255, 0.9), transparent 35%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(243, 248, 252, 0.82));
}

body[data-theme="dark"] .brand-card {
  background:
    radial-gradient(circle at top right, rgba(58, 84, 110, 0.26), transparent 35%),
    linear-gradient(145deg, rgba(19, 29, 42, 0.98), rgba(14, 22, 33, 0.9));
}

.brand-card::before {
  content: "";
  position: absolute;
  right: -50px;
  bottom: -70px;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--accent-glow), transparent 68%);
  pointer-events: none;
}

.brand-card h1,
.panel-heading h2,
.preview-header h2,
.score-copy h2 {
  margin: 0;
  line-height: 1.14;
}

.panel-heading h2,
.preview-header h2,
.score-copy h2 {
  font-size: clamp(1.08rem, 1.6vw, 1.34rem);
}

.panel-heading > div,
.preview-header > div,
.score-copy {
  display: grid;
  gap: 4px;
}

.brand-card h1 {
  margin-top: 8px;
  font-size: clamp(1.4rem, 2.1vw, 1.85rem);
  max-width: 11ch;
}

.supporting-text,
.muted-note,
.section-meta,
.empty-copy,
.field span,
.item-caption,
.stat-label,
.preset-button span,
.keyword-label {
  color: var(--muted);
}

.supporting-text,
.muted-note {
  font-size: 0.96rem;
  line-height: 1.58;
}

.eyebrow {
  margin: 0;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.72rem;
  font-weight: 800;
}

.feature-pills,
.preview-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.feature-pills {
  margin-top: 16px;
}

.feature-pill,
.preview-badge,
.keyword-chip,
.cv-contact-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  border: 1px solid transparent;
}

.feature-pill,
.preview-badge {
  padding: 0.46rem 0.78rem;
  font-size: 0.76rem;
  font-weight: 700;
}

.feature-pill {
  background: rgba(255, 255, 255, 0.78);
  border-color: rgba(255, 255, 255, 0.85);
  box-shadow: var(--shadow-soft);
}

body[data-theme="dark"] .feature-pill {
  background: rgba(21, 33, 47, 0.92);
  border-color: rgba(115, 138, 161, 0.16);
  box-shadow: none;
}

.preview-badge {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

body[data-theme="dark"] .preview-badge {
  background: rgba(36, 93, 138, 0.18);
  color: #d7e9f8;
}

.sections-stack {
  display: grid;
  gap: 14px;
  margin-top: 14px;
  padding-bottom: 14px;
}

.editor-card {
  padding: 18px;
}

.editor-card-header,
.panel-heading,
.preview-header,
.topbar-actions,
.section-actions,
.item-header,
.entry-row,
.cv-entry-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.panel-heading {
  margin-bottom: 2px;
}

.editor-card-header {
  align-items: flex-start;
  margin-bottom: 14px;
}

.editor-card-title {
  display: grid;
  gap: 6px;
}

.editor-card-title h3 {
  margin: 0;
  font-size: 1.04rem;
}

.section-meta {
  font-size: 0.82rem;
  margin: 0;
}

.section-actions,
.topbar-actions,
.item-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.button,
.ghost-button,
.preset-button {
  border-radius: 999px;
  padding: 0.68rem 0.92rem;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.76);
  color: var(--text);
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    background 160ms ease,
    box-shadow 160ms ease;
}

body[data-theme="dark"] .button,
body[data-theme="dark"] .ghost-button,
body[data-theme="dark"] .preset-button {
  background: rgba(17, 28, 40, 0.92);
  border-color: rgba(115, 138, 161, 0.18);
  color: var(--text);
}

.button:hover,
.ghost-button:hover,
.preset-button:hover {
  transform: translateY(-1px);
  border-color: rgba(36, 93, 138, 0.35);
  box-shadow: 0 10px 24px rgba(15, 23, 35, 0.08);
}

.button.primary {
  border-color: transparent;
  background: linear-gradient(135deg, var(--accent-strong), var(--accent));
  color: #ffffff;
  box-shadow: 0 16px 28px var(--accent-glow);
}

.button.small,
.ghost-button.small {
  padding: 0.42rem 0.72rem;
  font-size: 0.8rem;
}

.ghost-button.danger {
  color: var(--danger);
}

.preset-grid,
.toolbar-grid,
.insight-stats,
.keyword-columns {
  display: grid;
  gap: 12px;
}

.preset-grid {
  grid-template-columns: 1fr;
  margin-bottom: 14px;
  align-items: stretch;
}

.preset-button {
  display: grid;
  gap: 8px;
  align-content: start;
  min-height: 0;
  padding: 1rem 0.95rem;
  border-radius: var(--radius-md);
  text-align: left;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(248, 250, 252, 0.82)),
    var(--surface-strong);
}

body[data-theme="dark"] .preset-button {
  background:
    linear-gradient(180deg, rgba(20, 31, 44, 0.96), rgba(15, 24, 35, 0.92)),
    rgba(16, 26, 37, 0.94);
}

.preset-button strong {
  display: block;
  font-size: 0.95rem;
  line-height: 1.2;
}

.preset-button span {
  display: block;
  line-height: 1.35;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.toolbar-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 0;
}

.full-span {
  grid-column: 1 / -1;
}

.save-status {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 0;
  padding: 10px 12px;
  border: 1px dashed rgba(36, 93, 138, 0.25);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.6);
  color: var(--muted);
  font-weight: 600;
}

body[data-theme="dark"] .save-status {
  background: rgba(15, 24, 35, 0.72);
  border-color: rgba(86, 127, 165, 0.3);
}

.status-dot {
  width: 10px;
  height: 10px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 6px rgba(30, 106, 80, 0.12);
}

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

.field-grid.compact {
  margin-bottom: 0;
}

.field.full,
.item-card .field.full {
  grid-column: 1 / -1;
}

.field {
  display: grid;
  gap: 8px;
}

.field span,
.item-caption,
.keyword-label {
  font-size: 0.85rem;
  font-weight: 700;
}

.field input,
.field textarea,
.field select {
  width: 100%;
  border: 1px solid rgba(122, 141, 160, 0.22);
  border-radius: 14px;
  padding: 0.74rem 0.88rem;
  background: rgba(255, 255, 255, 0.88);
  color: var(--text);
  resize: vertical;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.field input::placeholder,
.field textarea::placeholder {
  color: #8a98a7;
}

.ai-actions,
.ai-review-results,
.ai-bullet-stack {
  display: grid;
  gap: 10px;
}

.chat-composer,
.chat-quick-actions,
.chat-toolbar,
.chat-messages {
  display: grid;
  gap: 10px;
}

.chat-quick-actions,
.chat-toolbar,
.chat-update-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.chat-messages {
  min-height: 170px;
  max-height: 360px;
  overflow: auto;
  padding-right: 4px;
  scrollbar-width: thin;
  scrollbar-color: var(--accent) transparent;
}

.chat-message {
  display: grid;
  gap: 6px;
}

.chat-message.user {
  justify-items: end;
}

.chat-role {
  margin: 0;
  font-size: 0.77rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.chat-bubble {
  width: min(100%, 34ch);
  padding: 12px 14px;
  border-radius: 18px;
  border: 1px solid rgba(122, 141, 160, 0.18);
  background: rgba(255, 255, 255, 0.82);
  box-shadow: var(--shadow-soft);
}

.chat-message.user .chat-bubble {
  background: linear-gradient(135deg, var(--accent-strong), var(--accent));
  border-color: transparent;
  color: #ffffff;
}

.chat-bubble.typing {
  border-style: dashed;
}

.chat-bubble p {
  margin: 0;
  line-height: 1.55;
}

.chat-update-stack {
  display: grid;
  gap: 8px;
}

.chat-update-label {
  margin: 0;
  font-size: 0.77rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.chat-update-list {
  display: grid;
  gap: 8px;
}

.chat-update-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.38rem 0.7rem;
  border-radius: 999px;
  border: 1px solid rgba(36, 93, 138, 0.18);
  background: rgba(255, 255, 255, 0.68);
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 700;
}

.ai-actions .button {
  width: 100%;
}

.ai-review-results {
  min-height: 64px;
}

.ai-review-card,
.ai-bullet-card {
  border: 1px solid rgba(122, 141, 160, 0.18);
  border-radius: 16px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.78);
}

body[data-theme="dark"] .ai-review-card,
body[data-theme="dark"] .ai-bullet-card {
  background: rgba(17, 28, 40, 0.88);
  border-color: rgba(115, 138, 161, 0.16);
}

body[data-theme="dark"] .chat-bubble {
  background: rgba(17, 28, 40, 0.92);
  border-color: rgba(115, 138, 161, 0.16);
}

body[data-theme="dark"] .chat-update-chip {
  background: rgba(17, 28, 40, 0.88);
  border-color: rgba(115, 138, 161, 0.16);
}

.ai-review-copy,
.ai-bullet-source,
.ai-bullet-improved {
  margin: 0;
  line-height: 1.55;
}

.ai-list {
  margin: 0;
  padding-left: 1.15rem;
  display: grid;
  gap: 8px;
}

.ai-list li {
  line-height: 1.5;
}

.ai-bullet-source {
  color: var(--muted);
  font-size: 0.9rem;
}

.ai-bullet-improved {
  margin-top: 6px;
  font-weight: 600;
}

body[data-theme="dark"] .field input,
body[data-theme="dark"] .field textarea,
body[data-theme="dark"] .field select {
  background: rgba(12, 20, 30, 0.88);
  border-color: rgba(115, 138, 161, 0.18);
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  outline: none;
  border-color: var(--accent);
  background: #ffffff;
  box-shadow: 0 0 0 4px var(--accent-glow);
}

.item-stack {
  display: grid;
  gap: 12px;
}

.item-card {
  border: 1px solid rgba(122, 141, 160, 0.16);
  border-radius: 18px;
  padding: 14px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(250, 252, 255, 0.82)),
    rgba(255, 255, 255, 0.78);
  box-shadow: var(--shadow-soft);
  transition: border-color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

body[data-theme="dark"] .item-card {
  background:
    linear-gradient(180deg, rgba(20, 31, 44, 0.94), rgba(15, 24, 35, 0.9)),
    rgba(16, 26, 37, 0.92);
  border-color: rgba(115, 138, 161, 0.16);
}

.item-card:focus-within {
  transform: translateY(-1px);
  border-color: rgba(36, 93, 138, 0.26);
  box-shadow: 0 18px 28px rgba(15, 23, 35, 0.09);
}

.item-header {
  margin-bottom: 14px;
  align-items: flex-start;
}

.item-label {
  font-weight: 800;
}

.item-actions {
  display: flex;
  gap: 8px;
}

.ats-controls {
  display: grid;
  gap: 14px;
}

.ats-controls .field-grid {
  grid-template-columns: 1fr;
}

.score-card {
  display: grid;
  justify-items: center;
  align-content: start;
  gap: 18px;
  text-align: center;
  min-height: 220px;
}

.score-ring {
  --score-angle: 0deg;
  --score-color: var(--success);
  width: 96px;
  aspect-ratio: 1;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background:
    radial-gradient(circle at center, #ffffff 58%, transparent 59%),
    conic-gradient(var(--score-color) var(--score-angle), rgba(208, 220, 230, 0.8) 0deg);
  box-shadow: inset 0 0 0 8px rgba(255, 255, 255, 0.65);
}

body[data-theme="dark"] .score-ring {
  background:
    radial-gradient(circle at center, #0f1722 58%, transparent 59%),
    conic-gradient(var(--score-color) var(--score-angle), rgba(63, 81, 98, 0.72) 0deg);
  box-shadow: inset 0 0 0 8px rgba(10, 18, 28, 0.55);
}

.score-ring span {
  font-size: 1.1rem;
  font-weight: 800;
}

.score-copy {
  display: grid;
  gap: 6px;
  justify-items: center;
  text-align: center;
  max-width: 16rem;
}

.score-copy p,
.score-copy h2 {
  margin: 0;
}

.topbar-actions {
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 2px;
}

.ats-controls .topbar-actions {
  flex-direction: column;
  align-items: flex-start;
}

.topbar-actions .muted-note {
  margin: 0;
  flex: 1 1 auto;
  width: auto;
  max-width: 52ch;
}

.topbar-actions .button {
  flex-shrink: 0;
  min-width: 168px;
}

.ats-controls .topbar-actions .button {
  min-width: 210px;
}

.preview-stage {
  min-height: 0;
  height: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow: visible;
  padding-right: 6px;
}

.insight-pane {
  position: sticky;
  top: 16px;
  align-self: start;
  min-height: 0;
  max-height: calc(100vh - 32px);
  height: calc(100vh - 32px);
  overflow: auto;
  display: grid;
  gap: 18px;
  grid-auto-rows: max-content;
  align-content: start;
  padding-right: 8px;
  scrollbar-width: thin;
  scrollbar-color: var(--accent) transparent;
}

.ai-panel,
.chat-panel,
.tips-panel,
.insights-panel,
.keywords-panel {
  align-content: start;
}

.add-section-panel > .button,
.ats-controls .topbar-actions,
.quick-tools-panel .save-status {
  align-self: start;
}

.preview-header {
  padding: 0 6px;
  flex-shrink: 0;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
}

.preview-header .preview-badges {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  width: 100%;
  max-width: 100%;
}

#printRoot {
  display: grid;
  flex: 1 1 auto;
  min-height: 0;
  justify-items: center;
  align-content: start;
  padding: 2px 8px 18px;
}

.cv-sheet {
  position: relative;
  overflow: hidden;
  width: min(210mm, 100%);
  min-height: 297mm;
  padding: 16mm 14mm 16mm;
  background:
    linear-gradient(180deg, #ffffff 0%, #fcfdff 100%);
  border-radius: 26px;
  box-shadow: 0 22px 54px rgba(15, 23, 35, 0.12);
  border: 1px solid rgba(122, 141, 160, 0.2);
  font-family: var(--cv-body-font);
  color: #1f2730;
}

body[data-theme="dark"] .cv-sheet {
  box-shadow: 0 22px 54px rgba(0, 0, 0, 0.28);
}

.cv-sheet::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 8px;
  background: linear-gradient(90deg, var(--accent-strong), var(--accent), rgba(255, 255, 255, 0.9));
}

.cv-header {
  position: relative;
  text-align: center;
  padding-bottom: 14px;
}

.cv-header::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0;
  width: min(220px, 46%);
  height: 2px;
  transform: translateX(-50%);
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
}

.cv-name {
  margin: 0;
  font-family: var(--cv-heading-font);
  font-size: clamp(calc(1.8rem * var(--cv-scale)), 3.6vw, calc(2.4rem * var(--cv-scale)));
  font-weight: var(--cv-heading-weight);
  letter-spacing: -0.03em;
}

.cv-role {
  margin: 6px 0 10px;
  font-family: var(--cv-heading-font);
  font-size: calc(1.08rem * var(--cv-scale));
  font-weight: var(--cv-strong-weight);
  color: var(--accent-strong);
}

.cv-placeholder-copy {
  color: #8a98a7;
  font-weight: var(--cv-copy-weight);
}

.cv-header-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  font-size: calc(0.98rem * var(--cv-scale));
}

.cv-contact-chip {
  padding: 0.28rem 0.68rem;
  background: rgba(255, 255, 255, 0.96);
  border-color: rgba(122, 141, 160, 0.22);
  color: #455565;
  text-decoration: none;
}

.preview-section {
  margin-top: 16px;
}

.preview-section-title {
  margin: 0 0 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line-strong);
  font-family: var(--cv-heading-font);
  font-size: calc(1.04rem * var(--cv-scale));
  font-weight: var(--cv-heading-weight);
  letter-spacing: 0.07em;
  color: #263443;
  text-transform: uppercase;
}

.summary-paragraph {
  margin: 0;
  font-size: calc(0.98rem * var(--cv-scale));
  font-weight: var(--cv-copy-weight);
  line-height: 1.52;
}

.summary-paragraph + .summary-paragraph {
  margin-top: 10px;
}

.cv-entry {
  position: relative;
  display: grid;
  gap: 5px;
  margin-top: 12px;
  padding-left: 12px;
  break-inside: avoid;
}

.cv-entry::before {
  content: "";
  position: absolute;
  top: 6px;
  bottom: 6px;
  left: 0;
  width: 3px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--accent), rgba(255, 255, 255, 0));
  opacity: 0.6;
}

.cv-entry:first-of-type {
  margin-top: 0;
}

.cv-entry-heading {
  align-items: baseline;
}

.cv-entry-title {
  margin: 0;
  font-family: var(--cv-heading-font);
  font-size: calc(1.02rem * var(--cv-scale));
  font-weight: var(--cv-strong-weight);
}

.cv-entry-date,
.cv-entry-link {
  color: #536272;
  font-size: calc(0.92rem * var(--cv-scale));
}

.cv-entry-link {
  color: var(--accent);
  text-decoration: none;
  white-space: nowrap;
}

.cv-entry-subtitle {
  margin: 0;
  font-size: calc(0.94rem * var(--cv-scale));
  font-weight: var(--cv-strong-weight);
  color: #2b323a;
}

.cv-entry-meta,
.cv-tech-line,
.language-line {
  margin: 0;
  color: #4d5762;
  font-size: calc(0.92rem * var(--cv-scale));
  font-weight: var(--cv-copy-weight);
}

.cv-bullets {
  margin: 0;
  padding-left: 1.15rem;
}

.cv-bullets li {
  margin: 0.16rem 0;
  font-size: calc(0.94rem * var(--cv-scale));
  font-weight: var(--cv-copy-weight);
  line-height: 1.45;
}

.skill-group {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 16px;
  background: rgba(246, 249, 252, 0.95);
  border: 1px solid rgba(122, 141, 160, 0.16);
}

.skill-group:first-of-type {
  margin-top: 0;
}

.skill-group-title {
  margin: 0 0 4px;
  font-family: var(--cv-heading-font);
  font-size: calc(0.98rem * var(--cv-scale));
  font-weight: var(--cv-strong-weight);
}

.skill-group-copy {
  margin: 0;
  font-size: calc(0.94rem * var(--cv-scale));
  font-weight: var(--cv-copy-weight);
  line-height: 1.45;
}

.preview-placeholder {
  border: 1px dashed rgba(122, 141, 160, 0.36);
  border-radius: 18px;
  padding: 14px 16px;
  background: rgba(236, 242, 247, 0.72);
}

body[data-theme="dark"] .preview-placeholder {
  background: rgba(17, 28, 40, 0.78);
  border-color: rgba(115, 138, 161, 0.22);
}

body[data-theme="dark"] .field input::placeholder,
body[data-theme="dark"] .field textarea::placeholder {
  color: #7f93a8;
}

.tips-list {
  margin: 0;
  padding-left: 1.15rem;
  display: grid;
  gap: 10px;
}

.tips-list li {
  line-height: 1.55;
}

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

.stat-card {
  border: 1px solid rgba(122, 141, 160, 0.18);
  border-radius: 16px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.84);
}

body[data-theme="dark"] .stat-card {
  background: rgba(17, 28, 40, 0.9);
  border-color: rgba(115, 138, 161, 0.16);
}

.stat-value {
  display: block;
  font-size: 1.14rem;
  font-weight: 800;
  margin-bottom: 4px;
}

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

.keyword-group {
  display: grid;
  gap: 10px;
}

.keyword-label {
  margin: 0;
}

.keyword-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.keyword-chip {
  padding: 0.42rem 0.74rem;
  font-size: 0.76rem;
  font-weight: 700;
  background: var(--accent-soft);
  color: var(--accent-strong);
}

body[data-theme="dark"] .keyword-chip {
  background: rgba(36, 93, 138, 0.18);
  color: #d7e9f8;
}

.keyword-chip.missing {
  background: rgba(238, 171, 116, 0.18);
  color: #8b4c15;
}

.keyword-empty {
  color: var(--muted);
  line-height: 1.6;
}

.site-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 12px 18px;
  padding: 12px 24px 28px;
  color: var(--muted);
  font-size: 0.95rem;
}

.site-footer p {
  margin: 0;
}

.site-footer a {
  text-decoration: none;
  color: var(--accent);
  font-weight: 700;
}

body[data-layout="executive"] .cv-sheet {
  padding-top: 16mm;
}

body[data-layout="executive"] .cv-header {
  text-align: left;
  padding-bottom: 20px;
}

body[data-layout="executive"] .cv-header::after {
  left: 0;
  width: 190px;
  transform: none;
  background: linear-gradient(90deg, var(--accent-strong), rgba(255, 255, 255, 0));
}

body[data-layout="executive"] .cv-header-links {
  justify-content: flex-start;
}

body[data-layout="executive"] .preview-section-title {
  font-size: 1.08rem;
  letter-spacing: 0.12em;
}

body[data-layout="executive"] .cv-entry {
  padding-left: 0;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(122, 141, 160, 0.18);
}

body[data-layout="executive"] .cv-entry::before {
  display: none;
}

body[data-layout="compact"] .cv-sheet {
  padding: 14mm 14mm 15mm;
}

body[data-layout="compact"] .cv-name {
  font-size: clamp(1.9rem, 3vw, 2.45rem);
}

body[data-layout="compact"] .cv-role {
  margin-bottom: 10px;
  font-size: 1.14rem;
}

body[data-layout="compact"] .preview-section {
  margin-top: 16px;
}

body[data-layout="compact"] .preview-section-title {
  margin-bottom: 10px;
  padding-bottom: 8px;
  font-size: 1.02rem;
}

body[data-layout="compact"] .summary-paragraph,
body[data-layout="compact"] .cv-entry-meta,
body[data-layout="compact"] .cv-tech-line,
body[data-layout="compact"] .language-line,
body[data-layout="compact"] .cv-bullets li {
  font-size: 0.96rem;
}

body[data-layout="compact"] .cv-entry {
  margin-top: 12px;
  gap: 4px;
}

body[data-layout="compact"] .skill-group {
  margin-top: 10px;
  padding: 10px 12px;
}

body[data-layout="editorial"] .cv-sheet {
  padding: 18mm 16mm 17mm;
  background:
    linear-gradient(180deg, #fffdf8 0%, #ffffff 26%, #fbfcff 100%);
}

body[data-layout="editorial"] .cv-header {
  text-align: left;
  padding: 0 0 18px;
}

body[data-layout="editorial"] .cv-header::after {
  left: 0;
  width: 180px;
  transform: none;
  background: linear-gradient(90deg, var(--accent-strong), rgba(255, 255, 255, 0));
}

body[data-layout="editorial"] .cv-header-links {
  justify-content: flex-start;
}

body[data-layout="editorial"] .cv-name,
body[data-layout="editorial"] .preview-section-title {
  font-family: "Merriweather", serif;
}

body[data-layout="editorial"] .preview-section-title {
  border-bottom: 0;
  padding-bottom: 0;
  letter-spacing: 0.04em;
}

body[data-layout="editorial"] .cv-entry {
  padding-left: 18px;
}

body[data-layout="editorial"] .cv-entry::before {
  width: 5px;
  opacity: 0.82;
}

body[data-layout="spotlight"] .cv-sheet {
  padding-top: 0;
}

body[data-layout="spotlight"] .cv-sheet::before {
  height: 0;
}

body[data-layout="spotlight"] .cv-header {
  margin: 0 -14mm 18px;
  padding: 18mm 14mm 16px;
  border-radius: 0 0 30px 30px;
  background:
    linear-gradient(135deg, var(--accent-strong), var(--accent)),
    linear-gradient(180deg, rgba(255, 255, 255, 0.2), transparent);
  color: #ffffff;
}

body[data-layout="spotlight"] .cv-header::after {
  display: none;
}

body[data-layout="spotlight"] .cv-role,
body[data-layout="spotlight"] .cv-entry-link,
body[data-layout="spotlight"] .cv-contact-chip {
  color: #ffffff;
}

body[data-layout="spotlight"] .cv-contact-chip {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.24);
}

body[data-layout="spotlight"] .preview-section-title {
  display: inline-flex;
  align-items: center;
  padding: 0.36rem 0.9rem;
  border-radius: 999px;
  border-bottom: 0;
  background: rgba(36, 93, 138, 0.1);
}

body[data-layout="spotlight"] .cv-entry,
body[data-layout="spotlight"] .skill-group {
  padding: 14px 14px 14px 18px;
  border-radius: 18px;
  background: rgba(246, 249, 252, 0.8);
  border: 1px solid rgba(122, 141, 160, 0.12);
}

body[data-theme="dark"][data-layout="spotlight"] .cv-entry,
body[data-theme="dark"][data-layout="spotlight"] .skill-group {
  background: rgba(19, 29, 42, 0.58);
  border-color: rgba(115, 138, 161, 0.18);
}

body[data-layout="minimal"] .cv-sheet {
  padding: 15mm 14mm 15mm;
  border-radius: 22px;
  background: #ffffff;
}

body[data-layout="minimal"] .cv-sheet::before,
body[data-layout="minimal"] .cv-entry::before {
  display: none;
}

body[data-layout="minimal"] .cv-header {
  text-align: left;
  padding-bottom: 14px;
}

body[data-layout="minimal"] .cv-header::after {
  left: 0;
  width: 120px;
  transform: none;
  background: rgba(122, 141, 160, 0.42);
}

body[data-layout="minimal"] .cv-header-links {
  justify-content: flex-start;
}

body[data-layout="minimal"] .preview-section-title {
  border-bottom-color: rgba(122, 141, 160, 0.24);
  letter-spacing: 0.12em;
}

body[data-layout="minimal"] .cv-entry,
body[data-layout="minimal"] .skill-group {
  padding-left: 0;
  padding-right: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
}

@media (max-width: 1440px) {
  .workspace-grid {
    grid-template-columns: minmax(0, 1fr) 340px;
  }
}

@media (max-width: 1240px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .editor-pane,
  .workspace-pane,
  .preview-stage,
  .insight-pane {
    position: static;
    height: auto;
    min-height: 0;
    overflow: visible;
    padding-right: 0;
  }

  .workspace-pane {
    display: grid;
    grid-template-rows: auto auto;
    height: auto;
    min-height: 0;
    overflow: visible;
  }

  .workspace-topbar,
  .workspace-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 920px) {
  .app-shell,
  .site-footer {
    padding-left: 16px;
    padding-right: 16px;
  }

  .field-grid,
  .preset-grid,
  .toolbar-grid,
  .insight-stats,
  .workspace-topbar,
  .workspace-grid {
    grid-template-columns: 1fr;
  }

  .panel-heading,
  .preview-header,
  .topbar-actions,
  .section-actions,
  .item-header,
  .editor-card-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .preview-badges,
  .section-actions,
  .item-actions {
    justify-content: flex-start;
  }

  .chat-quick-actions,
  .chat-toolbar {
    grid-template-columns: 1fr;
  }

  .topbar-actions .muted-note,
  .topbar-actions .button,
  .chat-quick-actions,
  .chat-toolbar {
    width: 100%;
    max-width: none;
  }

  .score-ring {
    width: 102px;
  }
}

@media (max-width: 680px) {
  .app-shell {
    padding-top: 16px;
    padding-bottom: 16px;
  }

  .brand-card,
  .quick-tools-panel,
  .add-section-panel,
  .score-card,
  .ats-controls,
  .ai-panel,
  .chat-panel,
  .tips-panel,
  .insights-panel,
  .keywords-panel,
  .editor-card {
    padding: 18px;
  }

  .cv-sheet {
    width: 100%;
    min-height: auto;
    padding: 18mm 12mm 18mm;
    border-radius: 24px;
  }

  body[data-layout="spotlight"] .cv-header {
    margin-left: -12mm;
    margin-right: -12mm;
    padding-left: 12mm;
    padding-right: 12mm;
  }

  .cv-header-links {
    justify-content: flex-start;
  }
}

@media print {
  @page {
    size: A4;
    margin: 14mm 12mm;
  }

  body {
    background: #ffffff;
    margin: 0;
  }

  body::before,
  body::after,
  .screen-only {
    display: none !important;
  }

  .app-shell {
    display: block;
    padding: 0;
  }

  .workspace-pane,
  .workspace-grid,
  .preview-stage,
  #printRoot {
    display: block;
    padding: 0;
    margin: 0;
    height: auto;
    overflow: visible;
  }

  .cv-sheet {
    width: auto;
    min-height: auto;
    margin: 0;
    padding: 0;
    position: static;
    overflow: visible;
    border: 0;
    border-radius: 0;
    box-shadow: none !important;
    background: #ffffff;
    box-decoration-break: clone;
    -webkit-box-decoration-break: clone;
  }

  .cv-sheet::before,
  .cv-header::after {
    display: none;
  }

  .cv-sheet,
  .cv-sheet::before,
  .cv-sheet::after,
  .cv-sheet *,
  .cv-sheet *::before,
  .cv-sheet *::after {
    box-shadow: none !important;
    filter: none !important;
    text-shadow: none !important;
    backdrop-filter: none !important;
  }

  .cv-header,
  .preview-section-title {
    break-after: avoid;
    page-break-after: avoid;
  }

  .cv-contact-chip {
    padding: 0;
    border: 0;
    background: transparent;
  }

  .preview-section {
    break-inside: auto;
    page-break-inside: auto;
  }

  .cv-entry,
  .skill-group {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .preview-placeholder {
    display: none !important;
  }
}
