:root,
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f6f8fb;
  --bg-soft: #eef4fb;
  --surface: #ffffff;
  --surface-soft: #f8fbff;
  --surface-muted: #f3f7fc;
  --border: #e4eaf2;
  --border-strong: #cbd8e8;
  --text: #0f172a;
  --text-soft: #334155;
  --muted: #64748b;
  --muted-light: #94a3b8;
  --muted-2: #94a3b8;
  --primary: #005eb8;
  --primary-strong: #004b9b;
  --primary-hover: #0052a3;
  --primary-soft: #eaf3ff;
  --primary-line: #b8d8ff;
  --success: #22c55e;
  --success-soft: #dcfce7;
  --warning: #f59e0b;
  --warning-soft: #fffbeb;
  --danger: #ef4444;
  --danger-soft: #fef2f2;
  --shadow-card: 0 14px 34px rgba(15, 23, 42, 0.055);
  --shadow-button: 0 10px 22px rgba(0, 94, 184, 0.18);
  --shadow: var(--shadow-card);
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 18px;
  --radius-xl: 22px;
  --radius: var(--radius-lg);
  --focus-ring: 0 0 0 3px rgba(0, 94, 184, 0.12);
  --ring-bg: #e8eef6;
  --brand-gradient: linear-gradient(140deg, #006fc9 0%, #005eb8 58%, #004b9b 100%);
  --button-gradient: linear-gradient(135deg, #006fc9 0%, #005eb8 100%);
  --button-gradient-hover: linear-gradient(135deg, #0078d7 0%, #0052a3 100%);
  --shell-bg: linear-gradient(180deg, #fbfdff 0%, var(--bg) 50%, #f8fbff 100%);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "SF Pro Display", "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b1220;
  --bg-soft: #0f172a;
  --surface: #111827;
  --surface-soft: #162033;
  --surface-muted: #1b2638;
  --border: #263348;
  --border-strong: #34445c;
  --text: #e5edf8;
  --text-soft: #cbd5e1;
  --muted: #93a4bb;
  --muted-light: #71839b;
  --muted-2: #71839b;
  --primary: #4da3ff;
  --primary-strong: #2b7fd3;
  --primary-hover: #68b2ff;
  --primary-soft: rgba(77, 163, 255, 0.14);
  --primary-line: rgba(77, 163, 255, 0.36);
  --success: #4ade80;
  --success-soft: rgba(74, 222, 128, 0.14);
  --warning: #fbbf24;
  --warning-soft: rgba(251, 191, 36, 0.13);
  --danger: #fb7185;
  --danger-soft: rgba(251, 113, 133, 0.14);
  --shadow-card: 0 18px 42px rgba(0, 0, 0, 0.28);
  --shadow-button: 0 12px 28px rgba(77, 163, 255, 0.18);
  --shadow: var(--shadow-card);
  --focus-ring: 0 0 0 3px rgba(77, 163, 255, 0.17);
  --ring-bg: #243047;
  --brand-gradient: linear-gradient(140deg, #4da3ff 0%, #2b7fd3 65%, #1c5fa4 100%);
  --button-gradient: linear-gradient(135deg, #3d96ee 0%, #2b7fd3 100%);
  --button-gradient-hover: linear-gradient(135deg, #56a9ff 0%, #337fc7 100%);
  --shell-bg: linear-gradient(180deg, #0b1220 0%, #0d1526 48%, #0b1220 100%);
}

* {
  box-sizing: border-box;
}

html {
  height: 100%;
  overflow-x: hidden;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  height: 100%;
  min-width: 320px;
  overflow: hidden;
  color: var(--text);
  background: var(--shell-bg);
}

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

button {
  border: 0;
  cursor: pointer;
}

button:focus,
button:focus-visible,
input:focus,
input:focus-visible,
textarea:focus,
textarea:focus-visible,
select:focus,
select:focus-visible {
  outline: 2px solid var(--primary-line);
  outline-offset: 2px;
}

a {
  color: var(--primary);
  text-decoration: none;
}

.app-shell {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 18px;
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
  padding: 28px 28px 22px;
}

.sidebar {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  padding: 2px 14px 2px 0;
  border-right: 1px solid var(--border);
}

.brand {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  margin-bottom: 36px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  color: #fff;
  border-radius: var(--radius-sm);
  background: var(--brand-gradient);
  box-shadow: var(--shadow-button);
}

.brand-mark svg {
  width: 19px;
  height: 19px;
}

[data-icon] {
  display: inline-grid;
  place-items: center;
}

.brand h1 {
  margin: 0;
  font-size: 16px;
  line-height: 1.2;
  letter-spacing: 0;
}

.brand p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 10px;
}

.nav-list {
  display: grid;
  gap: 7px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  color: var(--text-soft);
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  text-align: left;
  font-size: 13px;
  font-weight: 680;
}

.nav-item svg {
  width: 17px;
  height: 17px;
  color: var(--muted);
}

.nav-item:hover {
  color: var(--primary);
  background: var(--primary-soft);
}

.nav-item.active {
  color: var(--primary);
  background: var(--primary-soft);
  border-color: transparent;
}

.nav-item.active svg,
.nav-item:hover svg {
  color: var(--primary);
}

.quota-card {
  margin-top: auto;
  padding: 18px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
}

.quota-label {
  margin: 0 0 12px;
  font-size: 12px;
  color: var(--text);
  font-weight: 700;
}

.quota-card strong {
  display: block;
  margin-bottom: 10px;
  font-size: 22px;
}

.quota-card p:not(.quota-label) {
  margin: 12px 0 14px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.65;
}

.input-column,
.view-root {
  gap: 18px;
  min-width: 0;
}

.input-column {
  display: grid;
  align-content: start;
}

.view-root {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.page-content,
.view-container {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding-bottom: 24px;
  scrollbar-gutter: stable;
}

.page-content {
  display: grid;
  align-content: start;
  gap: 18px;
}

.page-content.final-resume-content {
  align-content: stretch;
  grid-template-rows: auto auto minmax(0, 1fr);
}

.panel,
.result-panel,
.export-row,
.summary-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}

.panel {
  padding: 18px;
}

.panel:hover,
.result-panel:hover,
.export-row:hover,
.summary-card:hover,
.insight-card:hover,
.version-card:hover,
.interview-card:hover {
  border-color: var(--primary-line);
}

.panel-heading,
.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.panel-heading.split {
  align-items: baseline;
}

.panel-heading h2,
.section-heading h2 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 17px;
  line-height: 1.25;
}

.panel-heading h2 span {
  color: var(--primary);
  font-weight: 800;
}

.panel-heading a {
  white-space: nowrap;
  font-size: 12px;
  font-weight: 700;
}

.section-heading {
  margin-bottom: 18px;
}

.section-heading h2 {
  font-size: 18px;
}

.section-heading p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.hint-button,
.icon-button {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.hint-button:hover,
.icon-button:hover {
  color: var(--primary);
  background: var(--primary-soft);
  border-color: var(--primary-line);
}

.hint-button {
  position: relative;
  width: 30px;
  height: 30px;
  color: var(--muted);
  border: 0;
  background: transparent;
  overflow: visible;
}

.panel-heading > .hint-button,
.section-heading > .hint-button {
  align-self: flex-start;
  margin-top: -2px;
}

.hint-button::before {
  content: "?";
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  color: currentColor;
  border: 2px solid currentColor;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 850;
  line-height: 1;
}

.hint-button [data-icon] {
  display: none;
}

.hint-button[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  z-index: 30;
  top: calc(100% + 10px);
  right: 0;
  width: min(280px, calc(100vw - 44px));
  padding: 10px 12px;
  color: #ffffff;
  background: rgba(51, 65, 85, 0.94);
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 10px;
  box-shadow: 0 12px 26px rgba(15, 23, 42, 0.16);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.55;
  text-align: left;
  white-space: normal;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-4px);
  transition: opacity 140ms ease, transform 140ms ease;
}

.hint-button[data-tooltip]:hover::after,
.hint-button[data-tooltip]:focus::after,
.hint-button[data-tooltip]:focus-visible::after,
.hint-button[data-tooltip].is-tooltip-visible::after {
  opacity: 1;
  transform: translateY(0);
}

.hint-button svg,
.icon-button svg {
  width: 16px;
  height: 16px;
}

.segmented-control {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin-bottom: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--surface-soft);
}

.segmented-control.two {
  grid-template-columns: repeat(2, 1fr);
}

.segmented-control button {
  min-height: 34px;
  color: var(--text-soft);
  background: transparent;
  border-right: 1px solid var(--border);
  font-size: 13px;
  font-weight: 700;
}

.segmented-control button:last-child {
  border-right: 0;
}

.segmented-control button.active {
  color: #fff;
  background: var(--button-gradient);
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

.upload-zone {
  display: grid;
  place-items: center;
  min-height: 146px;
  padding: 18px;
  color: var(--text-soft);
  background: var(--surface-soft);
  border: 1px dashed var(--primary-line);
  border-radius: var(--radius-md);
  text-align: center;
}

.upload-zone.small {
  min-height: 118px;
}

.upload-zone input {
  display: none;
}

.upload-zone strong {
  display: block;
  margin-top: 8px;
  font-size: 13px;
}

.upload-zone small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 11px;
}

.upload-icon svg {
  width: 32px;
  height: 32px;
  color: var(--primary);
}

.file-row {
  display: grid;
  grid-template-columns: 34px 1fr 18px;
  gap: 12px;
  align-items: center;
  margin-top: 12px;
  padding: 12px;
  background: var(--surface-soft);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
}

.file-row strong {
  display: block;
  font-size: 12px;
}

.file-row small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.file-badge {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  color: var(--danger);
  background: var(--danger-soft);
  border-radius: 8px;
}

.success-dot svg {
  color: var(--success);
  width: 18px;
  height: 18px;
}

textarea,
input,
select {
  width: 100%;
  color: var(--text);
  background: var(--surface-soft);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  outline: none;
}

textarea {
  min-height: 152px;
  max-height: 320px;
  padding: 14px;
  resize: vertical;
  overflow-y: auto;
  line-height: 1.6;
  font-size: 13px;
}

textarea:focus,
input:focus,
select:focus {
  border-color: var(--primary);
  box-shadow: var(--focus-ring);
}

.textarea-wrap {
  position: relative;
}

.field-footer {
  margin-top: 8px;
  color: var(--muted);
  text-align: right;
  font-size: 11px;
}

.sample-box {
  padding: 14px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.sample-box h3 {
  margin: 0 0 8px;
  font-size: 14px;
}

.sample-box p {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.ocr-panel {
  display: grid;
  gap: 12px;
  margin: 14px 0 0;
  padding: 14px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.ocr-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.ocr-meta div {
  min-width: 0;
  padding: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.ocr-meta span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

.ocr-meta strong {
  display: block;
  overflow-wrap: anywhere;
  font-size: 12px;
}

.ocr-textarea {
  max-height: 260px;
}

.field-label {
  display: block;
  margin: 16px 0 8px;
  font-size: 12px;
  font-weight: 750;
}

.password-field {
  position: relative;
}

.password-field input,
select {
  height: 38px;
  padding: 0 40px 0 12px;
  font-size: 13px;
}

.password-field button {
  position: absolute;
  top: 4px;
  right: 5px;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  color: var(--muted);
  background: transparent;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 12px;
}

.checkbox-row input {
  width: 14px;
  height: 14px;
  accent-color: var(--primary);
}

.status-line {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 16px 0;
  color: var(--muted);
  font-size: 13px;
}

.status-line svg {
  width: 14px;
  height: 14px;
}

.status-line[data-state="success"] {
  color: var(--success);
}

.status-line[data-state="error"] {
  color: var(--danger);
}

.status-line[data-state="mock"] {
  color: var(--warning);
}

.button-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.primary-button,
.secondary-button,
.ghost-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 700;
}

.primary-button {
  color: #fff;
  background: var(--button-gradient);
  box-shadow: var(--shadow-button);
}

.primary-button:hover {
  background: var(--button-gradient-hover);
}

.primary-button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}

.secondary-button,
.ghost-button {
  color: var(--primary);
  background: var(--surface);
  border: 1px solid var(--border-strong);
}

.secondary-button:hover,
.ghost-button:hover {
  background: var(--primary-soft);
  border-color: var(--primary-line);
}

.compact {
  min-height: 34px;
}

.app-main {
  display: flex;
  flex-direction: column;
  gap: 16px;
  height: 100%;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
}

.workspace {
  display: grid;
  align-content: start;
  gap: 16px;
  min-width: 0;
}

.topbar {
  display: flex;
  flex: 0 0 auto;
  justify-content: space-between;
  align-items: center;
  min-height: 50px;
}

.workflow-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.workflow-status svg {
  color: var(--primary);
  width: 16px;
  height: 16px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.app-footer {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 24px;
  color: var(--muted);
  background: var(--bg-soft);
  background: color-mix(in srgb, var(--bg) 88%, var(--surface) 12%);
  border-top: 1px solid var(--border);
  font-size: 12px;
  text-align: center;
}

.app-footer span {
  white-space: nowrap;
}

.theme-toggle {
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
}

.avatar {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  color: var(--primary);
  background: var(--primary-soft);
  border: 1px solid var(--primary-line);
  border-radius: 999px;
  font-weight: 800;
}

.result-panel {
  padding: 20px;
  min-width: 0;
}

.page-heading {
  display: flex;
  flex: 0 0 auto;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  min-height: 82px;
  min-width: 0;
}

.page-heading h2 {
  margin: 0;
  font-size: 26px;
  line-height: 1.15;
}

.page-heading p:not(.eyebrow) {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.page-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--primary);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.summary-card {
  display: grid;
  align-content: start;
  gap: 10px;
  min-height: 148px;
  min-width: 0;
  padding: 18px;
}

.summary-card h3,
.list-row h3 {
  margin: 0;
  font-size: 14px;
}

.summary-card p {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
  line-height: 1.35;
}

.summary-card small,
.list-row small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.two-column {
  display: grid;
  grid-template-columns: minmax(300px, 0.9fr) minmax(0, 1.1fr);
  gap: 16px;
  min-width: 0;
}

.detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: 18px;
}

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

.info-grid div {
  padding: 14px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.info-grid span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.info-grid strong {
  display: block;
  font-size: 17px;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 9px;
  color: var(--primary);
  background: var(--primary-soft);
  border: 1px solid var(--primary-line);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 750;
}

.mock-tag {
  color: var(--primary);
  background: var(--primary-soft);
  border-color: var(--primary-line);
}

.inline-note {
  margin-top: 10px;
  color: var(--muted);
  font-size: 12px;
}

.muted-copy,
.large-copy {
  color: var(--text-soft);
  line-height: 1.7;
}

.muted-copy {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.large-copy {
  margin: 0;
  font-size: 15px;
}

.empty-state {
  display: grid;
  place-items: center;
  gap: 10px;
  min-height: 150px;
  max-height: 220px;
  padding: 20px;
  color: var(--muted);
  background: var(--surface-soft);
  border: 1px dashed var(--primary-line);
  border-radius: var(--radius-md);
  text-align: center;
}

.empty-state svg {
  width: 28px;
  height: 28px;
  color: var(--primary);
}

.empty-state p {
  margin: 0;
  font-size: 13px;
  line-height: 1.65;
}

.empty-state.compact {
  min-height: 120px;
  max-height: 160px;
}

.empty-state.large {
  min-height: 180px;
  max-height: 240px;
}

.scroll-panel,
.scroll-panel-lg,
.code-panel,
.json-panel,
.json-preview,
.resume-preview-panel,
.interview-panel,
.page-content,
.modal-body {
  scrollbar-color: var(--primary-line) transparent;
  scrollbar-width: thin;
}

.scroll-panel::-webkit-scrollbar,
.scroll-panel-lg::-webkit-scrollbar,
.code-panel::-webkit-scrollbar,
.json-panel::-webkit-scrollbar,
.json-preview::-webkit-scrollbar,
.resume-preview-panel::-webkit-scrollbar,
.interview-panel::-webkit-scrollbar,
.page-content::-webkit-scrollbar,
.modal-body::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.scroll-panel::-webkit-scrollbar-thumb,
.scroll-panel-lg::-webkit-scrollbar-thumb,
.code-panel::-webkit-scrollbar-thumb,
.json-panel::-webkit-scrollbar-thumb,
.json-preview::-webkit-scrollbar-thumb,
.resume-preview-panel::-webkit-scrollbar-thumb,
.interview-panel::-webkit-scrollbar-thumb,
.page-content::-webkit-scrollbar-thumb,
.modal-body::-webkit-scrollbar-thumb {
  background: var(--primary-line);
  border-radius: 999px;
}

.scroll-panel,
.scroll-panel-lg,
.code-panel,
.json-panel,
.resume-preview-panel,
.interview-panel {
  min-height: 0;
  overflow-y: auto;
}

.scroll-panel {
  max-height: 360px;
}

.scroll-panel-lg {
  max-height: 480px;
}

.code-panel,
.json-panel {
  max-height: 420px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

.resume-preview-panel {
  max-height: 460px;
}

.interview-panel {
  max-height: 360px;
}

.list-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.list-row + .list-row {
  margin-top: 10px;
}

.active-row {
  border-color: var(--primary-line);
  background: var(--surface-soft);
}

.list-row strong {
  display: block;
  margin-bottom: 5px;
  font-size: 14px;
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.danger-text {
  color: var(--danger);
}

.json-preview {
  max-height: 420px;
  overflow: auto;
  margin: 0;
  padding: 14px;
  color: var(--text-soft);
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  line-height: 1.55;
  white-space: pre-wrap;
}

.data-table {
  display: grid;
  gap: 8px;
}

.table-row {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr) 150px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.table-row span {
  color: var(--text-soft);
  font-size: 13px;
  line-height: 1.45;
}

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

.score-card {
  display: grid;
  grid-template-columns: 122px 74px repeat(3, minmax(110px, 1fr));
  gap: 18px;
  align-items: center;
  padding: 18px 20px;
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
}

.score-ring {
  --ring-value: calc(var(--score) * 1%);
  display: grid;
  place-items: center;
  width: 106px;
  height: 106px;
  margin: 0 auto;
  border-radius: 999px;
  background:
    radial-gradient(circle, var(--surface) 58%, transparent 60%),
    conic-gradient(var(--primary) var(--ring-value), var(--ring-bg) 0);
}

.score-ring strong {
  margin-top: 16px;
  font-size: 32px;
  line-height: 1;
}

.score-ring span {
  margin-top: -28px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.quality-pill {
  justify-self: center;
  align-self: end;
  padding: 7px 12px;
  color: var(--success);
  background: var(--success-soft);
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 800;
}

.metric {
  padding-left: 20px;
  border-left: 1px solid var(--border);
  min-width: 0;
}

.metric p {
  margin: 0 0 12px;
  color: var(--text-soft);
  font-size: 13px;
  font-weight: 700;
}

.metric strong {
  display: block;
  margin-bottom: 12px;
  font-size: 30px;
  letter-spacing: 0;
}

.metric small {
  display: block;
  margin-top: 10px;
  color: var(--muted);
  font-size: 11px;
}

.progress-track {
  height: 8px;
  overflow: hidden;
  background: var(--surface-muted);
  border-radius: 999px;
}

.progress-track span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--primary-strong));
  border-radius: inherit;
}

.insight-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 16px;
}

.insight-card,
.version-card,
.interview-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
}

.insight-card {
  padding: 20px;
}

.insight-card h3,
.version-card h3,
.export-history h3 {
  margin: 0 0 16px;
  font-size: 15px;
}

.insight-card ul,
.version-card ul {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.insight-card li,
.version-card li {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  color: var(--text-soft);
  font-size: 13px;
  line-height: 1.45;
}

.list-icon {
  display: inline-grid;
  place-items: center;
  flex: 0 0 16px;
  width: 16px;
  height: 16px;
  margin-top: 1px;
  border-radius: 999px;
}

.check-list .list-icon {
  color: var(--success);
  background: var(--success-soft);
}

.warn-list .list-icon {
  color: var(--warning);
  background: var(--warning-soft);
}

.danger-list .list-icon {
  color: var(--danger);
  background: var(--danger-soft);
}

.list-icon svg {
  width: 12px;
  height: 12px;
}

.version-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.version-card {
  display: flex;
  flex-direction: column;
  min-height: 226px;
  min-width: 0;
  padding: 18px;
}

.version-card.selected {
  border-color: var(--primary-line);
  background: var(--surface-soft);
}

.version-card header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.version-card h3 {
  margin-bottom: 0;
}

.recommend-tag {
  padding: 4px 8px;
  color: var(--primary);
  background: var(--primary-soft);
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 800;
}

.version-card p {
  min-height: 38px;
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.version-content {
  max-height: 170px;
  margin: 12px 0 14px;
  padding: 12px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.version-content ul {
  gap: 9px;
}

.version-card .button-row {
  margin-top: auto;
}

.optimized-preview {
  display: grid;
  gap: 14px;
}

.optimized-preview section {
  display: grid;
  gap: 8px;
}

.optimized-preview h4,
.optimized-experience h4,
.optimized-project h4 {
  margin: 0;
  color: var(--text);
  font-size: 13px;
}

.optimized-experience h4 small {
  margin-left: 6px;
  color: var(--muted);
  font-weight: 600;
}

.optimized-preview p {
  margin: 0;
  color: var(--text-soft);
  font-size: 12px;
  line-height: 1.6;
}

.optimized-bullets {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.optimized-bullets li {
  display: grid;
  gap: 5px;
  color: var(--text-soft);
  font-size: 12px;
  line-height: 1.55;
}

.evidence-tag {
  justify-self: start;
  padding: 3px 7px;
  border-radius: 999px;
  font-size: 10px;
  font-style: normal;
  font-weight: 800;
}

.evidence-original {
  color: var(--success);
  background: var(--success-soft);
}

.evidence-inferred,
.evidence-expanded {
  color: var(--primary);
  background: var(--primary-soft);
}

.evidence-confirm {
  color: var(--warning);
  background: var(--warning-soft);
}

.export-control-panel {
  display: grid;
  gap: 14px;
}

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

.export-meta div {
  padding: 13px 14px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.export-meta span {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

.export-meta strong {
  display: block;
  overflow-wrap: anywhere;
  font-size: 13px;
}

.selected-export-tag {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 9px;
  color: var(--primary);
  background: var(--primary-soft);
  border: 1px solid var(--primary-line);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
}

.interview-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  align-items: stretch;
}

.interview-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  min-height: 260px;
  max-height: 320px;
  min-width: 0;
  overflow: hidden;
}

.interview-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}

.interview-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  color: var(--primary);
  background: var(--primary-soft);
  border-radius: var(--radius-sm);
}

.interview-card h3 {
  margin: 0;
  font-size: 13px;
}

.interview-card-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding-right: 4px;
  scrollbar-color: var(--primary-line) transparent;
  scrollbar-width: thin;
}

.interview-card-body > ul {
  margin: 0;
}

.interview-card p {
  margin: 0 0 9px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.interview-card button {
  padding: 0;
  color: var(--primary);
  background: transparent;
  font-size: 12px;
  font-weight: 800;
}

.interview-detail-button {
  margin-top: 8px;
}

.export-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  gap: 18px;
  align-items: center;
  padding: 16px 20px;
  min-width: 0;
}

.export-history h3 {
  margin-bottom: 8px;
}

.export-history p,
.export-history small {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.export-history small {
  display: block;
  margin-top: 8px;
}

.export-button {
  justify-content: space-between;
  width: 100%;
  min-height: 58px;
  text-align: left;
}

.export-button small {
  display: block;
  margin-top: 3px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 11px;
}

.final-document-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  padding: 12px 14px;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  font-size: 12px;
  font-weight: 700;
}

.final-document-meta span {
  position: relative;
}

.final-document-meta span:not(:last-child)::after {
  content: "";
  position: absolute;
  right: -9px;
  top: 50%;
  width: 1px;
  height: 12px;
  background: var(--border-strong);
  transform: translateY(-50%);
}

.final-preview-meta span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.final-resume-layout {
  display: grid;
  grid-template-columns: 318px minmax(0, 1fr);
  gap: 22px;
  align-items: stretch;
  min-height: 0;
  height: 100%;
}

.final-controls,
.a4-preview-panel {
  min-width: 0;
}

.final-controls {
  display: grid;
  align-content: start;
  gap: 14px;
  min-height: 0;
  max-height: 100%;
  overflow-y: auto;
  padding: 2px 4px 4px 0;
  background: transparent;
  border-right: 0;
  scrollbar-gutter: stable;
}

.final-control-section {
  display: grid;
  gap: 10px;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}

.final-control-section:last-child {
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.final-control-section h3 {
  margin: 0 0 2px;
  color: var(--text);
  font-size: 13px;
  line-height: 1.25;
}

.choice-list,
.template-grid {
  display: grid;
  gap: 9px;
}

.choice-list {
  grid-auto-rows: 1fr;
}

.choice-option,
.template-card {
  width: 100%;
  padding: 11px 12px;
  color: var(--text-soft);
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-left: 3px solid transparent;
  border-radius: var(--radius-sm);
  text-align: left;
  cursor: pointer;
  transition: border-color 140ms ease, background 140ms ease, box-shadow 140ms ease;
}

.choice-option {
  display: grid;
  align-content: center;
  min-height: 96px;
}

.choice-option:hover,
.template-card:hover,
.segmented-options button:hover {
  color: var(--primary);
  background: color-mix(in srgb, var(--primary-soft) 58%, transparent);
}

.choice-option.selected,
.template-card.selected,
.segmented-options button.active {
  color: var(--primary);
  background: color-mix(in srgb, var(--primary-soft) 78%, var(--surface) 22%);
  border-color: var(--primary-line);
  border-left-color: var(--primary);
  box-shadow: 0 8px 20px rgba(0, 94, 184, 0.08);
}

.choice-option strong,
.choice-option span,
.template-card strong,
.template-card small,
.template-card em,
.template-card span {
  display: block;
}

.choice-option strong,
.template-card strong {
  margin-bottom: 4px;
  font-size: 13px;
}

.choice-option span,
.template-card small,
.template-card em,
.template-card span {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.template-card em {
  margin: 4px 0;
  font-style: normal;
}

.template-card .template-thumb {
  display: grid;
}

.template-thumb {
  display: grid;
  gap: 4px;
  width: 50px;
  height: 64px;
  margin-bottom: 8px;
  padding: 8px;
  background: #ffffff;
  border: 1px solid #d8e2ee;
  border-radius: 6px;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
}

.template-thumb i {
  display: block;
  height: 4px;
  background: #d8e2ee;
  border-radius: 999px;
}

.template-thumb.template-medtech-blue i:first-child {
  background: #005eb8;
}

.template-thumb.template-executive-marketing i:first-child {
  background: #1f2937;
}

.segmented-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  padding: 4px;
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.segmented-options button {
  min-height: 32px;
  color: var(--muted);
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: color 140ms ease, background 140ms ease, border-color 140ms ease;
}

.section-toggle-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 7px;
}

.final-control-section .checkbox-row {
  margin-top: 0;
  padding: 8px 10px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.filename-box {
  overflow-wrap: anywhere;
  padding: 10px 11px;
  color: var(--text-soft);
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 12px;
  line-height: 1.55;
}

.a4-preview-panel {
  padding: 20px;
  min-height: 0;
  height: 100%;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}

.a4-preview-panel > .section-heading {
  flex: 0 0 auto;
  margin-bottom: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.final-preview-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin-bottom: 14px;
  padding: 10px 12px;
  color: var(--muted);
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 12px;
}

.final-preview-meta strong {
  color: var(--warning);
  font-size: 12px;
}

.a4-preview-shell {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding: 34px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.26), rgba(255, 255, 255, 0)),
    #eef2f7;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  scrollbar-gutter: stable;
}

:root[data-theme="dark"] .a4-preview-shell,
:root[data-theme="dark"] .print-preview-shell {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0)),
    #0f172a;
}

.resume-page-preview {
  width: min(100%, 794px);
  margin: 0 auto 24px;
}

.resume-page-preview.zoom-fixed {
  width: 794px;
  zoom: var(--preview-zoom);
}

.resume-page-preview.zoom-fit .resume-print {
  width: min(100%, 794px);
}

.warning-panel {
  padding: 14px 16px;
  border-color: rgba(245, 158, 11, 0.4);
  background: color-mix(in srgb, var(--warning) 10%, var(--surface) 90%);
}

.warning-panel strong {
  display: block;
  margin-bottom: 6px;
  color: var(--text);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.upload-photo-button {
  justify-content: center;
  cursor: pointer;
}

.photo-preview {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.photo-preview img {
  width: 54px;
  height: 54px;
  object-fit: cover;
  border-radius: 12px;
}

.photo-preview span,
.compact-copy {
  color: var(--muted);
  font-size: 12px;
}

.final-editor-panel {
  gap: 12px;
}

.editor-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.editor-heading span {
  padding: 3px 7px;
  color: var(--primary);
  background: var(--primary-soft);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
}

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

.editor-grid label,
.final-editor-panel label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.editor-grid .wide {
  grid-column: 1 / -1;
}

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

.editor-item {
  display: grid;
  gap: 10px;
  padding: 12px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.tabs-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.tabs-bar button {
  min-height: 32px;
  padding: 0 11px;
  color: var(--muted);
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.tabs-bar button.active {
  color: var(--primary);
  background: var(--primary-soft);
  border-color: var(--primary-line);
}

.tab-panel {
  padding: 14px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.collapsible-block {
  margin: 10px 0;
  padding: 10px 12px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.collapsible-block summary {
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.compact-scroll {
  max-height: 220px;
  margin-top: 10px;
}

.star-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.star-item {
  display: grid;
  gap: 5px;
  padding: 10px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.star-item-title {
  color: var(--text);
  font-size: 12px;
  line-height: 1.45;
}

.star-item p {
  margin: 0;
}

.star-field {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.star-detail-panel {
  max-height: 520px;
}

.guide-star-list {
  display: grid;
  gap: 10px;
}

.guide-star-item {
  display: grid;
  gap: 5px;
}

.guide-star-item h3 {
  margin: 0 0 2px;
  color: #111827;
  font-size: 12px;
}

.guide-star-item p {
  margin: 0;
  color: #1f2937;
}

.full-width-action {
  width: 100%;
  margin-top: 10px;
  justify-content: center;
}

.export-file-name {
  display: block;
  max-width: min(720px, 100%);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.type-tag {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 0 7px;
  color: var(--primary);
  background: var(--primary-soft);
  border: 1px solid var(--primary-line);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
}

.resume-preview-toolbar .page-actions {
  align-items: center;
}

.resume-preview-toolbar .segmented-options {
  min-width: 260px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

#print-root {
  display: none;
}

.print-preview-shell {
  overflow: auto;
  padding: 18px;
  background: #eef2f7;
  border-radius: var(--radius-md);
}

.resume-print,
.guide-print {
  width: min(100%, 794px);
  margin: 0 auto;
  color: #111827;
  background: #ffffff;
  box-shadow: 0 16px 42px rgba(15, 23, 42, 0.12);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
}

.resume-print {
  padding: 42px 48px;
  line-height: 1.42;
}

.guide-print {
  padding: 34px 38px;
  line-height: 1.58;
}

.final-resume-template {
  min-height: 1122px;
}

.resume-print.density-compact {
  padding: 34px 42px;
  line-height: 1.34;
}

.resume-print.density-standard {
  padding: 42px 48px;
  line-height: 1.42;
}

.resume-print.density-relaxed {
  padding: 48px 54px;
  line-height: 1.5;
}

.guide-print header {
  position: relative;
  padding-bottom: 14px;
  border-bottom: 2px solid #0b5ea8;
}

.professional-cv .cv-header {
  position: relative;
  padding-bottom: 14px;
  border-bottom: 2px solid #005eb8;
}

.resume-print.has-photo.photo-top-right header {
  padding-right: 98px;
}

.resume-print.has-photo.photo-top-left header {
  padding-left: 98px;
}

.resume-photo {
  position: absolute;
  top: 0;
  width: 78px;
  height: 78px;
  object-fit: cover;
  border: 1px solid #d8e2ee;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.12);
}

.photo-top-right .resume-photo {
  right: 0;
}

.photo-top-left .resume-photo {
  left: 0;
}

.photo-circle .resume-photo {
  border-radius: 50%;
}

.photo-rounded .resume-photo {
  border-radius: 14px;
}

.professional-cv h1,
.guide-print h1 {
  margin: 0;
  color: #0f172a;
  font-size: 30px;
  line-height: 1.15;
  font-weight: 800;
}

.professional-cv .print-subtitle,
.guide-print .print-subtitle {
  margin: 7px 0 0;
  color: #334155;
  font-size: 13.5px;
  font-weight: 700;
}

.professional-cv .print-contact {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  margin: 10px 0 0;
  color: #475569;
  font-size: 11px;
}

.professional-cv .print-contact span {
  display: inline-flex;
  align-items: center;
}

.professional-cv .print-contact span:not(:last-child)::after {
  content: "|";
  margin: 0 9px;
  color: #94a3b8;
}

.resume-section {
  break-inside: avoid;
  page-break-inside: avoid;
  padding: 14px 0 0;
}

.guide-print h2 {
  margin: 0 0 9px;
  padding-bottom: 5px;
  color: #004b9b;
  border-bottom: 1px solid #dbe7f5;
  font-size: 14px;
  letter-spacing: 0.02em;
}

.professional-cv .resume-section h2 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 9px;
  padding: 0;
  color: #0f172a;
  border: 0;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.03em;
}

.professional-cv .resume-section h2::before {
  content: "";
  width: 4px;
  height: 15px;
  background: #005eb8;
  display: inline-block;
}

.resume-section h3 {
  margin: 0;
  color: #111827;
  font-size: 11.5px;
}

.professional-cv .cv-entry-head h3 span {
  color: #64748b;
  font-weight: 700;
}

.resume-section p,
.guide-print p,
.resume-section li,
.guide-print li {
  color: #1f2937;
  font-size: 10.7px;
}

.resume-section p,
.guide-print p {
  margin: 0 0 6px;
}

.resume-section ul,
.guide-print ul {
  display: grid;
  gap: 3px;
  margin: 0;
  padding-left: 15px;
}

.experience-item,
.project-item {
  break-inside: avoid;
  page-break-inside: avoid;
  margin-bottom: 8px;
}

.cv-competencies {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 3px 18px;
  margin: 0;
  padding-left: 15px;
}

.cv-skill-groups {
  display: grid;
  gap: 4px;
}

.cv-skill-groups p {
  margin: 0;
  color: #1f2937;
  font-size: 10.7px;
}

.cv-skill-groups strong {
  color: #0f172a;
}

.cv-entry-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: baseline;
  margin-bottom: 4px;
}

.cv-entry-head > p,
.cv-entry-head > span {
  margin: 0;
  color: #475569;
  font-size: 10.5px;
  font-weight: 700;
  text-align: right;
  white-space: nowrap;
}

.cv-entry-head > strong {
  color: #111827;
  font-size: 11px;
}

.cv-experience-item ul,
.cv-project-item ul {
  padding-left: 15px;
}

.cv-education-item {
  margin-bottom: 7px;
}

.confirm-preview-only {
  color: #475569;
  border-top: 1px dashed #cbd5e1;
}

.print-footer {
  margin-top: 18px;
  padding-top: 10px;
  color: #64748b;
  border-top: 1px solid #e5edf7;
  font-size: 10px;
}

.modal {
  width: min(880px, calc(100vw - 32px));
  padding: 0;
  border: 0;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}

.modal::backdrop {
  background: rgba(15, 23, 42, 0.42);
  backdrop-filter: blur(4px);
}

.modal-card {
  max-height: min(760px, calc(100vh - 48px));
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  background: var(--surface);
}

.modal-card header,
.modal-card footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
}

.modal-card footer {
  border-top: 1px solid var(--border);
  border-bottom: 0;
  justify-content: flex-end;
}

#modal-print {
  display: none;
}

.modal-card h2 {
  margin: 0;
  font-size: 20px;
}

.modal-body {
  overflow: auto;
  padding: 22px;
  line-height: 1.65;
}

.modal-body h3 {
  margin: 18px 0 8px;
  font-size: 15px;
}

.modal-body p,
.modal-body li {
  color: var(--text-soft);
  font-size: 14px;
}

.modal-body pre {
  white-space: pre-wrap;
  color: var(--text-soft);
  font-size: 13px;
  line-height: 1.7;
  font-family: inherit;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 20;
  transform: translateY(16px);
  opacity: 0;
  pointer-events: none;
  max-width: 360px;
  padding: 12px 14px;
  color: var(--surface);
  background: var(--text);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-card);
  transition: 180ms ease;
  font-size: 13px;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

.loading {
  position: relative;
  overflow: hidden;
}

.loading::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.6), transparent);
  animation: shimmer 1.2s infinite;
}

@keyframes shimmer {
  from {
    transform: translateX(-100%);
  }
  to {
    transform: translateX(100%);
  }
}

@media (max-width: 1180px) {
  .app-shell {
    grid-template-columns: 164px minmax(0, 1fr);
    padding: 22px;
  }

  .score-card {
    grid-template-columns: 132px repeat(3, minmax(120px, 1fr));
  }

  .quality-pill {
    grid-column: 1;
    align-self: center;
  }
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr);
  }

  .sidebar {
    height: auto;
    max-height: 310px;
    overflow-y: auto;
    padding-right: 0;
    border-right: 0;
  }

  .nav-list {
    grid-template-columns: repeat(4, minmax(130px, 1fr));
  }

  .quota-card {
    margin-top: 16px;
  }

  .score-card,
  .insight-grid,
  .version-grid,
  .interview-grid,
  .export-row,
  .export-meta,
  .final-resume-layout,
  .ocr-meta,
  .summary-grid,
  .two-column,
  .detail-grid,
  .info-grid,
  .expanded,
  .table-row {
    grid-template-columns: 1fr;
  }

  .metric {
    padding-left: 0;
    border-left: 0;
  }

  .a4-preview-shell {
    min-height: 520px;
  }
}

@media (max-width: 960px) {
  .app-footer {
    min-height: 56px;
    padding: 8px 18px;
  }

  .app-footer span {
    white-space: normal;
  }
}

@media (max-width: 620px) {
  .app-shell {
    grid-template-rows: auto minmax(0, 1fr);
    padding: 10px;
    gap: 10px;
  }

  .sidebar {
    display: grid;
    gap: 10px;
    max-height: none;
    overflow: visible;
    padding: 0 0 10px;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .brand {
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 10px;
    margin-bottom: 0;
  }

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

  .brand h1 {
    font-size: 15px;
  }

  .brand p {
    margin-top: 2px;
    font-size: 10px;
  }

  .nav-list {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .nav-list::-webkit-scrollbar {
    display: none;
  }

  .nav-item {
    flex: 0 0 auto;
    width: auto;
    min-height: 38px;
    padding: 0 10px;
    font-size: 13px;
    white-space: nowrap;
  }

  .quota-card {
    display: grid;
    grid-template-columns: auto auto minmax(0, 1fr) auto;
    gap: 6px;
    align-items: center;
    margin-top: 0;
    padding: 8px 10px;
  }

  .quota-label,
  .quota-card strong,
  .quota-card p:not(.quota-label) {
    margin: 0;
  }

  .quota-card strong {
    font-size: 15px;
    line-height: 1.25;
    white-space: nowrap;
  }

  .quota-card p:not(.quota-label) {
    font-size: 10px;
    line-height: 1.25;
  }

  .quota-card .ghost-button {
    grid-column: 4;
    grid-row: 1;
    min-height: 32px;
    padding: 0 10px;
    white-space: nowrap;
  }

  .app-main {
    gap: 10px;
  }

  .view-root {
    min-height: 0;
  }

  .page-content,
  .view-container {
    gap: 12px;
    padding-bottom: 14px;
    scrollbar-gutter: auto;
  }

  .page-content.final-resume-content {
    grid-template-rows: auto auto auto;
  }

  .topbar,
  .panel-heading,
  .section-heading,
  .page-heading,
  .list-row {
    align-items: flex-start;
    flex-direction: column;
    display: flex;
    gap: 10px;
  }

  .topbar {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    min-height: auto;
    gap: 8px;
  }

  .topbar-actions {
    width: auto;
    max-width: 58%;
    justify-content: flex-start;
    gap: 8px;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 2px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .topbar-actions::-webkit-scrollbar {
    display: none;
  }

  .workflow-status {
    flex: 1 1 auto;
    min-width: 0;
    max-width: 100%;
    line-height: 1.35;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
  }

  .topbar-actions .secondary-button,
  .topbar-actions .icon-button,
  .topbar-actions .avatar {
    flex: 0 0 auto;
  }

  .page-heading h2 {
    font-size: 22px;
  }

  .page-actions,
  .row-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .row-actions > button,
  .button-row > button {
    flex: 1 1 140px;
  }

  .page-actions {
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 2px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .page-actions::-webkit-scrollbar {
    display: none;
  }

  .page-actions > button {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  .panel,
  .summary-card,
  .insight-card,
  .version-card,
  .interview-card,
  .export-row {
    padding: 14px;
    border-radius: var(--radius-md);
  }

  .summary-card {
    min-height: 126px;
  }

  .summary-card p {
    font-size: 16px;
  }

  .score-card {
    gap: 12px;
    padding: 14px;
  }

  .score-ring {
    width: 92px;
    height: 92px;
  }

  .score-ring strong {
    font-size: 28px;
  }

  .metric strong {
    font-size: 24px;
  }

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

  .segmented-options {
    display: flex;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .segmented-options::-webkit-scrollbar {
    display: none;
  }

  .segmented-options button {
    flex: 1 0 92px;
  }

  .textarea-wrap textarea,
  textarea {
    min-height: 132px;
    max-height: 250px;
  }

  .table-row,
  .export-row {
    gap: 10px;
  }

  .table-row span,
  .export-history p,
  .export-history small,
  .filename-box,
  .json-preview {
    overflow-wrap: anywhere;
  }

  .interview-card {
    min-height: 220px;
    max-height: 300px;
  }

  .version-card {
    min-height: 0;
  }

  .version-content,
  .scroll-panel,
  .interview-panel {
    max-height: 260px;
  }

  .scroll-panel-lg,
  .resume-preview-panel {
    max-height: 340px;
  }

  .final-resume-layout {
    height: auto;
  }

  .final-controls {
    max-height: none;
    overflow: visible;
    padding: 0 0 14px;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .a4-preview-panel {
    min-height: 0;
  }

  .a4-preview-shell {
    min-height: 430px;
    padding: 10px;
  }

  .resume-page-preview.zoom-fit,
  .resume-page-preview.zoom-fixed {
    width: 794px;
  }

  .resume-page-preview.zoom-fit {
    zoom: 0.68;
  }

  .modal {
    width: calc(100vw - 16px);
  }

  .modal-card {
    max-height: calc(100dvh - 16px);
  }

  .modal-card header,
  .modal-card footer {
    padding: 14px;
  }

  .modal-card footer {
    flex-wrap: wrap;
  }

  .modal-card footer button {
    flex: 1 1 140px;
  }

  .modal-body {
    padding: 14px;
  }

  .app-footer {
    min-height: 40px;
    padding: 6px 10px;
    font-size: 10.5px;
    line-height: 1.3;
  }

  .app-footer span {
    white-space: nowrap;
  }
}

@media (max-width: 480px) {
  .resume-page-preview.zoom-fit {
    zoom: 0.52;
  }
}

@media (max-width: 420px) {
  .resume-page-preview.zoom-fit {
    zoom: 0.43;
  }
}

@media (max-width: 340px) {
  .app-shell {
    padding: 8px;
  }

  .quota-card {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .quota-label,
  .quota-card strong,
  .quota-card p:not(.quota-label) {
    grid-column: 1;
  }

  .quota-card .ghost-button {
    grid-column: 2;
    grid-row: 1 / span 3;
  }

  .app-footer span {
    white-space: normal;
  }

  .resume-page-preview.zoom-fit {
    zoom: 0.37;
  }
}

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

  html,
  body {
    height: auto;
    overflow: visible;
    background: #fff;
    color: #111827;
  }

  body * {
    visibility: hidden;
  }

  #print-root,
  #print-root * {
    visibility: visible;
  }

  #print-root {
    display: block;
    position: absolute;
    inset: 0 auto auto 0;
    width: 100%;
    background: #ffffff;
    color: #111827;
  }

  #print-root .resume-print,
  #print-root .guide-print {
    width: auto;
    min-height: auto;
    margin: 0;
    padding: 0;
    color: #111827;
    background: #ffffff;
    box-shadow: none;
  }

#print-root .resume-section,
#print-root .experience-item,
#print-root .project-item,
#print-root .guide-star-item {
  break-inside: avoid;
  page-break-inside: avoid;
}

  .app-shell,
  .app-footer,
  .sidebar,
  .topbar,
  .modal,
  .toast {
    display: none !important;
  }

  .confirm-preview-only {
    display: none !important;
  }

  .loading::after {
    display: none;
    animation: none;
  }
}
