:root {
  color-scheme: light;
  --bg: #f4f6f5;
  --surface: #ffffff;
  --surface-subtle: #f8faf9;
  --ink: #18201e;
  --muted: #65716d;
  --muted-2: #8a9591;
  --line: #dfe5e2;
  --line-strong: #cbd4d0;
  --primary: #176b5d;
  --primary-hover: #11594e;
  --primary-soft: #e4f1ed;
  --primary-ink: #0f5549;
  --coral: #e96a4b;
  --coral-soft: #fff0eb;
  --amber: #a56a05;
  --amber-soft: #fff6db;
  --blue: #356b96;
  --blue-soft: #eaf2f8;
  --danger: #b63e3e;
  --danger-soft: #fff0f0;
  --shadow-sm: 0 1px 2px rgba(22, 38, 32, 0.06);
  --shadow-md: 0 10px 28px rgba(22, 38, 32, 0.10);
  --sidebar-width: 236px;
  --topbar-height: 64px;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  font-size: 15px;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  min-height: 100%;
  margin: 0;
  background: var(--bg);
  color: var(--ink);
}

body {
  min-width: 320px;
}

main:focus {
  outline: none;
}

button,
input,
select,
textarea {
  font: inherit;
  letter-spacing: 0;
}

button {
  color: inherit;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(23, 107, 93, 0.18);
  outline-offset: 2px;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 22px 16px 16px;
  border-right: 1px solid var(--line);
  background: #fbfcfb;
  z-index: 30;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 8px;
  min-height: 38px;
}

.brand-mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  background: var(--primary);
  color: #ffffff;
  font-weight: 500;
  box-shadow: inset 0 -7px 0 rgba(0, 0, 0, 0.08);
}

.brand-mark::after {
  content: "";
  position: absolute;
  width: 10px;
  height: 10px;
  right: -2px;
  top: -2px;
  background: #f0b43c;
  transform: rotate(45deg);
}

.brand-word {
  font-size: 18px;
  font-weight: 500;
}

.main-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-item {
  width: 100%;
  min-height: 42px;
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  padding: 8px 10px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  text-align: left;
  cursor: pointer;
}

.nav-item:hover {
  background: #f0f3f2;
  color: var(--ink);
}

.nav-item.is-active {
  background: var(--primary-soft);
  color: var(--primary-ink);
  font-weight: 500;
}

.nav-item svg,
.icon-button svg,
.button svg,
.account svg,
.inline-icon svg,
.ai-action svg,
.check-item svg,
.project-icon svg {
  width: 17px;
  height: 17px;
  stroke-width: 1.8;
}

.nav-meta {
  font-size: 12px;
  color: var(--muted-2);
}

.sidebar-spacer {
  flex: 1;
}

.quota-block {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.quota-label-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
}

.quota-label-row strong {
  color: var(--primary-ink);
  font-weight: 500;
}

.quota-track {
  height: 5px;
  margin: 11px 0 9px;
  overflow: hidden;
  border-radius: 3px;
  background: #e8ecea;
}

.quota-track span {
  display: block;
  width: 100%;
  height: 100%;
  background: var(--primary);
  transition: width 220ms ease;
}

.quota-block p {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.text-button {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--primary);
  font-size: 12px;
  cursor: pointer;
}

.text-button:hover {
  text-decoration: underline;
}

.account {
  min-height: 54px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 16px;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.account:hover {
  background: #f0f3f2;
}

.avatar {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--coral-soft);
  color: #b4472d;
  font-weight: 500;
  overflow: hidden;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.account-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.account-copy strong {
  overflow: hidden;
  font-size: 13px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-copy small {
  color: var(--muted-2);
  font-size: 11px;
}

.app-area {
  min-width: 0;
}

.topbar {
  height: var(--topbar-height);
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 0 32px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
}

.topbar-crumb {
  font-weight: 500;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.icon-button {
  width: 38px;
  height: 38px;
  display: inline-grid;
  place-items: center;
  position: relative;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  cursor: pointer;
}

.icon-button:hover {
  border-color: var(--line-strong);
  background: var(--surface-subtle);
}

.notice-dot {
  width: 6px;
  height: 6px;
  position: absolute;
  right: 8px;
  top: 7px;
  border: 1px solid #fff;
  border-radius: 50%;
  background: var(--coral);
}

.mobile-menu {
  display: none;
}

.button {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 15px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: var(--surface);
  color: var(--ink);
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
}

.button:disabled {
  cursor: wait;
  opacity: 0.78;
}

.button:hover {
  background: var(--surface-subtle);
}

.button-primary {
  border-color: var(--primary);
  background: var(--primary);
  color: #ffffff;
}

.button-primary:hover {
  background: var(--primary-hover);
}

.button-ghost {
  border-color: transparent;
  background: transparent;
  color: var(--muted);
}

.button-ghost:hover {
  background: #edf1ef;
  color: var(--ink);
}

.button-danger {
  border-color: #f0caca;
  background: var(--danger-soft);
  color: var(--danger);
}

.button-compact {
  min-height: 38px;
  padding: 8px 13px;
}

.button-block {
  width: 100%;
}

.main-content {
  width: min(100%, 1460px);
  margin: 0 auto;
  padding: 32px;
}

.page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 26px;
}

.page-header h1 {
  margin: 0 0 7px;
  font-size: 25px;
  font-weight: 500;
  letter-spacing: 0;
}

.page-header p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.eyebrow {
  margin-bottom: 7px;
  color: var(--primary);
  font-size: 12px;
  font-weight: 500;
}

.metric-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  margin-bottom: 30px;
}

.metric {
  min-width: 0;
  padding: 19px 24px 18px 0;
}

.metric + .metric {
  padding-left: 24px;
  border-left: 1px solid var(--line);
}

.metric-label {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
}

.metric-value {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 26px;
  font-weight: 500;
}

.metric-value small {
  color: var(--muted-2);
  font-size: 12px;
  font-weight: 400;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.48fr) minmax(280px, 0.72fr);
  gap: 22px;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 13px;
}

.section-heading h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 500;
}

.section-heading p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.quick-create {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) auto;
  align-items: center;
  gap: 15px;
  margin-bottom: 24px;
  padding: 18px;
  border-color: #c7ded8;
  background: #f6fbf9;
}

.quick-icon {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--primary);
  color: #fff;
}

.quick-icon svg {
  width: 21px;
  height: 21px;
}

.quick-create h2 {
  margin: 0 0 4px;
  font-size: 16px;
  font-weight: 500;
}

.quick-create p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.project-list {
  overflow: hidden;
}

.project-empty {
  min-height: 150px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 7px;
  padding: 24px;
  color: var(--muted);
  text-align: center;
}

.project-empty svg {
  width: 24px;
  height: 24px;
  margin-bottom: 2px;
  color: var(--muted-2);
}

.project-empty strong {
  color: var(--ink);
  font-size: 13px;
  font-weight: 500;
}

.project-empty span {
  max-width: 360px;
  font-size: 11px;
  line-height: 1.6;
}

.project-row {
  width: 100%;
  display: grid;
  grid-template-columns: 42px minmax(180px, 1.2fr) minmax(120px, 0.65fr) 100px 122px 30px;
  align-items: center;
  gap: 14px;
  padding: 15px 18px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  text-align: left;
  cursor: pointer;
}

.project-row:last-child {
  border-bottom: 0;
}

.project-row:hover {
  background: var(--surface-subtle);
}

.project-icon {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  background: var(--blue-soft);
  color: var(--blue);
}

.project-icon.is-coral {
  background: var(--coral-soft);
  color: #b34c33;
}

.project-main {
  min-width: 0;
}

.project-main strong {
  display: block;
  margin-bottom: 3px;
  overflow: hidden;
  font-size: 14px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-main span,
.project-cell {
  color: var(--muted);
  font-size: 12px;
}

.status {
  width: fit-content;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 99px;
  background: var(--amber-soft);
  color: #805000;
  font-size: 11px;
  white-space: nowrap;
}

.status::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}

.status.is-success {
  background: var(--primary-soft);
  color: var(--primary-ink);
}

.more-cell {
  color: var(--muted-2);
  text-align: right;
}

.side-column {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.profile-progress {
  padding: 18px;
}

.progress-ring-row {
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr);
  align-items: center;
  gap: 15px;
}

.progress-ring {
  width: 62px;
  height: 62px;
  display: grid;
  place-items: center;
  position: relative;
  border-radius: 50%;
  background: #e8ecea;
}

.progress-ring::after {
  content: "";
  width: 48px;
  height: 48px;
  position: absolute;
  border-radius: 50%;
  background: var(--surface);
}

.progress-ring strong {
  position: relative;
  z-index: 1;
  font-size: 14px;
  font-weight: 500;
}

.progress-copy h3 {
  margin: 0 0 5px;
  font-size: 14px;
  font-weight: 500;
}

.progress-copy p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.missing-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 15px;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface-subtle);
  color: var(--muted);
  font-size: 11px;
}

.tag.is-match {
  border-color: #c9e1da;
  background: var(--primary-soft);
  color: var(--primary-ink);
}

.tag.is-missing {
  border-color: #efd2c9;
  background: var(--coral-soft);
  color: #a8452e;
}

.activity-list {
  padding: 4px 18px;
}

.activity-empty {
  min-height: 116px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  color: var(--muted);
  text-align: center;
}

.activity-empty svg {
  width: 21px;
  height: 21px;
  color: var(--muted-2);
}

.activity-empty span {
  max-width: 250px;
  font-size: 11px;
  line-height: 1.55;
}

.activity-item {
  display: grid;
  grid-template-columns: 9px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
}

.activity-item:last-child {
  border-bottom: 0;
}

.activity-dot {
  width: 7px;
  height: 7px;
  margin-top: 5px;
  border-radius: 50%;
  background: var(--primary);
}

.activity-item:nth-child(2) .activity-dot {
  background: var(--coral);
}

.activity-item strong {
  display: block;
  margin-bottom: 3px;
  font-size: 12px;
  font-weight: 500;
}

.activity-item span {
  color: var(--muted);
  font-size: 11px;
}

.activity-item time {
  color: var(--muted-2);
  font-size: 11px;
}

/* Creation flow */
.flow-page {
  padding-top: 8px;
}

.flow-header {
  max-width: 1000px;
  margin: 0 auto 22px;
}

.flow-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.flow-title-row h1 {
  margin: 0 0 5px;
  font-size: 22px;
  font-weight: 500;
}

.flow-title-row p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.stepper {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
}

.step {
  display: flex;
  align-items: center;
  gap: 9px;
  position: relative;
  color: var(--muted-2);
  font-size: 12px;
}

.step::after {
  content: "";
  height: 1px;
  flex: 1;
  margin-right: 9px;
  background: var(--line);
}

.step:last-child::after {
  display: none;
}

.step-index {
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: var(--surface);
  font-size: 11px;
}

.step.is-active,
.step.is-complete {
  color: var(--primary-ink);
  font-weight: 500;
}

.step.is-active .step-index {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
}

.step.is-complete .step-index {
  border-color: #acd2c7;
  background: var(--primary-soft);
}

.flow-workspace {
  max-width: 1000px;
  margin: 0 auto;
  overflow: hidden;
}

.workspace-head {
  padding: 20px 22px 17px;
  border-bottom: 1px solid var(--line);
}

.workspace-head h2 {
  margin: 0 0 5px;
  font-size: 17px;
  font-weight: 500;
}

.workspace-head p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.form-body {
  padding: 22px;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 17px;
}

.field-grid.is-job-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.field,
.field-wide {
  min-width: 0;
}

.field-wide {
  grid-column: 1 / -1;
}

.field label,
.question-block label,
.profile-field label {
  display: block;
  margin-bottom: 7px;
  color: #3d4844;
  font-size: 12px;
  font-weight: 500;
}

.field label span,
.profile-field label span {
  margin-left: 5px;
  color: var(--coral);
}

.input,
.select,
.textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
}

.input,
.select {
  height: 42px;
  padding: 0 11px;
}

.textarea {
  min-height: 210px;
  padding: 12px;
  line-height: 1.72;
  resize: vertical;
}

.input:hover,
.select:hover,
.textarea:hover {
  border-color: #aebbb6;
}

.input:focus,
.select:focus,
.textarea:focus {
  border-color: var(--primary);
  outline: 3px solid rgba(23, 107, 93, 0.12);
}

.field-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 7px;
}

.field-label-row label {
  margin-bottom: 0;
}

.jd-generate-button {
  min-height: 30px;
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 6px;
  padding: 5px 9px;
  border: 1px solid #a9c9c1;
  border-radius: 5px;
  background: var(--primary-soft);
  color: var(--primary-ink);
  font: inherit;
  font-size: 11px;
  cursor: pointer;
}

.jd-generate-button:hover {
  border-color: var(--primary);
  background: #d7e9e3;
}

.jd-generate-button:focus-visible {
  outline: 3px solid rgba(23, 107, 93, 0.14);
  outline-offset: 2px;
}

.jd-generate-button svg {
  width: 13px;
  height: 13px;
}

.field-help {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 7px;
  color: var(--muted-2);
  font-size: 11px;
}

.jd-help-actions {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 10px;
}

.jd-help-actions button {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--primary);
  font: inherit;
  cursor: pointer;
}

.jd-help-actions button:hover {
  color: var(--primary-ink);
}

.jd-help-actions button svg {
  width: 12px;
  height: 12px;
}

.form-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 16px 22px;
  border-top: 1px solid var(--line);
  background: var(--surface-subtle);
}

.form-actions-right {
  display: flex;
  gap: 9px;
}

.privacy-note {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 11px;
}

.analysis-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
}

.analysis-column {
  padding: 22px;
}

.analysis-column + .analysis-column {
  border-left: 1px solid var(--line);
}

.analysis-column h3 {
  margin: 0 0 5px;
  font-size: 14px;
  font-weight: 500;
}

.analysis-caption {
  margin: 0 0 17px;
  color: var(--muted);
  font-size: 12px;
}

.keyword-group + .keyword-group {
  margin-top: 18px;
}

.keyword-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 9px;
  color: var(--muted);
  font-size: 11px;
}

.keyword-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.analysis-empty-copy {
  color: var(--muted-2);
  font-size: 11px;
}

.role-summary {
  margin-top: 18px;
  padding: 13px;
  border-left: 3px solid var(--primary);
  background: var(--surface-subtle);
  color: #46514d;
  font-size: 12px;
  line-height: 1.7;
}

.question-block {
  padding: 15px 0;
  border-bottom: 1px solid var(--line);
}

.question-block:first-of-type {
  padding-top: 0;
}

.question-block:last-of-type {
  border-bottom: 0;
}

.question-block p {
  margin: 0 0 9px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.choice-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.choice {
  min-height: 34px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
}

.choice:hover,
.choice.is-selected {
  border-color: #9cc9bd;
  background: var(--primary-soft);
  color: var(--primary-ink);
}

/* Editor */
.is-editor-view .app-shell {
  min-height: 100vh;
  grid-template-columns: minmax(0, 1fr);
}

.is-editor-view .sidebar,
.is-editor-view .topbar {
  display: none;
}

.is-editor-view .app-area {
  height: 100vh;
  overflow: hidden;
}

.is-editor-view .main-content {
  width: 100%;
  height: 100vh;
  max-width: none;
  margin: 0;
  padding: 0;
  overflow: hidden;
}

.editor-page {
  width: 100%;
  height: 100vh;
  min-height: 620px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #f2f5f4;
}

.editor-toolbar {
  min-height: 66px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  padding: 10px 20px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  box-shadow: 0 1px 7px rgba(31, 45, 40, 0.05);
  z-index: 5;
}

.editor-heading {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
}

.editor-back-button {
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
}

.editor-back-button:hover {
  border-color: var(--line-strong);
  color: var(--primary);
}

.editor-back-button svg {
  width: 17px;
  height: 17px;
}

.editor-title {
  min-width: 0;
}

.editor-title h1 {
  margin: 0 0 2px;
  overflow: hidden;
  font-size: 19px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.save-state {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 11px;
}

.save-state::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--primary);
}

.toolbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.editor-shell {
  min-height: 0;
  flex: 1;
  display: grid;
  grid-template-columns: minmax(360px, 0.96fr) minmax(340px, 1.04fr);
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: var(--surface);
  box-shadow: none;
}

.editor-controls {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--line);
  background: #f6f8f7;
}

.editor-tabs {
  flex: 0 0 auto;
  display: flex;
  gap: 20px;
  padding: 0 20px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.editor-tab {
  min-height: 46px;
  position: relative;
  padding: 10px 2px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
}

.editor-tab.is-active {
  color: var(--primary-ink);
  font-weight: 500;
}

.editor-tab.is-active::after {
  content: "";
  height: 2px;
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  background: var(--primary);
}

.style-panel {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.auto-layout-status {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  margin-bottom: 8px;
  padding: 14px;
  background: var(--primary-soft);
}

.auto-layout-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: var(--surface);
  color: var(--primary);
}

.auto-layout-icon svg {
  width: 18px;
  height: 18px;
}

.auto-layout-status div > strong,
.auto-layout-status div > span {
  display: block;
}

.auto-layout-status strong {
  margin-bottom: 3px;
  font-size: 13px;
  font-weight: 500;
}

.auto-layout-status div > span {
  color: var(--muted);
  font-size: 10px;
}

.style-control-group {
  padding: 18px 4px;
  border-bottom: 1px solid var(--line);
}

.style-control-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 11px;
}

.style-control-head h3 {
  margin: 0;
  font-size: 13px;
  font-weight: 500;
}

.style-control-head span {
  color: var(--muted);
  font-size: 10px;
}

.segmented-control {
  min-height: 38px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f1f4f3;
}

.segmented-control.is-three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.segmented-control button {
  min-width: 0;
  min-height: 30px;
  padding: 5px 7px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  cursor: pointer;
}

.segmented-control button.is-selected {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 1px 3px rgba(34, 49, 44, 0.12);
  font-weight: 500;
}

.color-swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.color-swatch {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  position: relative;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
}

.color-swatch > span {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--swatch-color);
}

.color-swatch.is-selected {
  border-color: var(--swatch-color);
}

.color-swatch svg {
  width: 12px;
  height: 12px;
  position: absolute;
  color: #fff;
  opacity: 0;
}

.color-swatch.is-selected svg {
  opacity: 1;
}

.style-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 15px;
  padding: 17px 4px 4px;
  color: var(--muted);
  font-size: 10px;
}

.style-summary span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.style-summary svg {
  width: 13px;
  height: 13px;
  color: var(--primary);
}

.editor-scroll {
  min-height: 0;
  flex: 1;
  overflow-y: auto;
  padding: 18px 20px 28px;
  scrollbar-gutter: stable;
}

.content-section {
  margin-bottom: 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  box-shadow: 0 1px 3px rgba(31, 45, 40, 0.035);
}

.content-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.content-section-head h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 500;
}

.content-section-head span {
  color: var(--muted-2);
  font-size: 10px;
}

.section-remove-button {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--muted-2);
  cursor: pointer;
}

.section-remove-button:hover {
  background: var(--coral-soft);
  color: #a8452e;
}

.section-remove-button svg {
  width: 14px;
  height: 14px;
}

.content-section-body {
  padding: 12px 14px 14px;
}

.content-input {
  width: 100%;
  min-height: 102px;
  padding: 12px;
  border: 1px solid transparent;
  border-radius: 5px;
  background: #f1f4f3;
  color: var(--ink);
  line-height: 1.66;
  overflow-y: hidden;
  resize: none;
}

.content-input:hover,
.content-input:focus {
  border-color: var(--line-strong);
  background: var(--surface);
  outline: none;
}

.experience-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
  margin-bottom: 8px;
}

.mini-input {
  width: 100%;
  height: 32px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 5px;
  color: var(--ink);
  font-size: 12px;
}

.ai-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 10px;
}

.ai-action {
  min-height: 29px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface);
  color: var(--muted);
  font-size: 10px;
  cursor: pointer;
}

.ai-action:hover {
  border-color: #abcfc6;
  color: var(--primary-ink);
}

.ai-action[data-ai-action="recommend"] {
  border-color: #b8d8d0;
  background: var(--primary-soft);
  color: var(--primary-ink);
}

.ai-action:disabled {
  border-color: var(--line);
  background: #f4f6f5;
  color: #aab2af;
  cursor: not-allowed;
}

.ai-action.is-complete {
  border-color: #8fc5b8;
  background: var(--primary-soft);
  color: var(--primary-ink);
}

.ai-action svg {
  width: 13px;
  height: 13px;
}

.editor-add-prompt {
  min-height: 126px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 6px;
  margin-bottom: 12px;
  border: 1px dashed var(--line-strong);
  border-radius: 7px;
  color: var(--muted);
  text-align: center;
}

.editor-add-prompt svg {
  width: 21px;
  height: 21px;
  color: var(--primary);
}

.editor-add-prompt strong {
  color: var(--ink);
  font-size: 12px;
  font-weight: 500;
}

.editor-add-prompt span {
  max-width: 320px;
  font-size: 10px;
  line-height: 1.55;
}

.module-dock {
  padding: 4px 0 2px;
}

.module-dock-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 10px;
}

.module-dock-head h3 {
  margin: 0 0 3px;
  font-size: 15px;
  font-weight: 500;
}

.module-dock-head p {
  margin: 0;
  color: var(--muted-2);
  font-size: 10px;
}

.module-dock-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}

.module-dock-grid button {
  min-width: 0;
  min-height: 58px;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) 14px;
  align-items: center;
  gap: 8px;
  padding: 8px 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.module-dock-grid button:hover {
  border-color: #9cc9bd;
  background: var(--primary-soft);
}

.module-dock-grid button:disabled {
  background: #eef1f0;
  color: var(--muted-2);
  cursor: not-allowed;
}

.module-dock-icon {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: var(--primary-soft);
  color: var(--primary);
}

.module-dock-grid button > svg,
.module-dock-icon svg {
  width: 14px;
  height: 14px;
}

.module-dock-grid button > span:nth-child(2),
.module-dock-grid strong,
.module-dock-grid small {
  min-width: 0;
  display: block;
}

.module-dock-grid strong {
  overflow: hidden;
  margin-bottom: 2px;
  font-size: 11px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.module-dock-grid small {
  color: var(--muted-2);
  font-size: 9px;
}

.match-panel {
  padding: 4px 2px;
}

.match-overview {
  margin-bottom: 17px;
  padding: 14px;
  border: 1px solid #c8ded8;
  border-radius: 7px;
  background: #f5faf8;
}

.match-overview strong {
  display: block;
  margin-bottom: 5px;
  font-size: 14px;
  font-weight: 500;
}

.match-overview p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
}

.check-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.check-item {
  display: grid;
  grid-template-columns: 17px minmax(0, 1fr);
  gap: 8px;
  padding: 9px;
  border-radius: 5px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.check-item.is-good {
  background: var(--primary-soft);
  color: var(--primary-ink);
}

.check-item.is-warn {
  background: var(--amber-soft);
  color: #725000;
}

.preview-pane {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: #263a35;
}

.preview-toolbar {
  min-height: 62px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 10px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  background: #20322e;
}

.preview-toolbar span {
  color: rgba(255, 255, 255, 0.68);
  font-size: 11px;
}

.preview-command {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 11px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 6px;
  background: transparent;
  color: #ffffff;
  font-size: 11px;
  cursor: pointer;
}

.preview-command:hover {
  background: rgba(255, 255, 255, 0.08);
}

.preview-command.is-primary {
  border-color: var(--coral);
  background: var(--coral);
}

.preview-command.is-primary:hover {
  background: #d95b40;
}

.preview-command svg {
  width: 15px;
  height: 15px;
}

.preview-document-state {
  min-width: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  color: #ffffff;
  text-align: center;
}

.preview-document-state strong {
  overflow: hidden;
  font-size: 11px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.layout-fit {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex: 0 0 auto;
  color: #a9d9cd !important;
}

.layout-fit svg {
  width: 13px;
  height: 13px;
}

.zoom-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.zoom-button {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  cursor: pointer;
}

.preview-stage {
  min-height: 0;
  flex: 1;
  overflow: auto;
  padding: 26px 24px 30px;
  background: #344b45;
  scrollbar-color: rgba(255, 255, 255, 0.28) transparent;
}

.preview-footer {
  min-height: 46px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 7px 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  background: #20322e;
  color: rgba(255, 255, 255, 0.72);
}

.preview-page-count {
  grid-column: 2;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
}

.preview-page-count button {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.38);
}

.preview-page-count svg {
  width: 15px;
  height: 15px;
}

.preview-footer .zoom-controls {
  grid-column: 3;
  justify-self: end;
  color: rgba(255, 255, 255, 0.72);
  font-size: 10px;
}

.is-editor-view .resume-paper {
  width: min(100%, 720px);
  min-width: 0;
}

.resume-paper {
  width: min(100%, 720px);
  min-width: 520px;
  aspect-ratio: 210 / 297;
  margin: 0 auto;
  padding: 7.2% 7.6%;
  background: #fff;
  color: #1c2321;
  box-shadow: 0 8px 25px rgba(31, 45, 40, 0.15);
  transform-origin: top center;
  transition: transform 180ms ease;
}

.resume-paper.resume-font-sans {
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
}

.resume-paper.resume-font-serif {
  font-family: "Songti SC", SimSun, serif;
}

.resume-paper.resume-font-hybrid {
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
}

.resume-paper.resume-font-hybrid .resume-name,
.resume-paper.resume-font-hybrid .resume-section-title,
.resume-paper.resume-font-hybrid .resume-entry-head strong {
  font-family: "Songti SC", SimSun, serif;
}

.resume-paper.resume-density-compact {
  padding: 5.7% 6.2%;
}

.resume-paper.resume-density-compact .resume-header {
  padding-bottom: 10px;
}

.resume-paper.resume-density-compact .resume-name {
  font-size: 22px;
}

.resume-paper.resume-density-compact .resume-section {
  margin-top: 10px;
}

.resume-paper.resume-density-compact .resume-summary,
.resume-paper.resume-density-compact .resume-bullets,
.resume-paper.resume-density-compact .resume-skills {
  font-size: 8px;
  line-height: 1.5;
}

.resume-paper.resume-density-compact .resume-entry + .resume-entry {
  margin-top: 7px;
}

.resume-paper.resume-density-spacious {
  padding: 8% 8.2%;
}

.resume-paper.resume-density-spacious .resume-header {
  padding-bottom: 16px;
}

.resume-paper.resume-density-spacious .resume-name {
  font-size: 27px;
}

.resume-paper.resume-density-spacious .resume-section {
  margin-top: 18px;
}

.resume-paper.resume-density-spacious .resume-summary,
.resume-paper.resume-density-spacious .resume-bullets,
.resume-paper.resume-density-spacious .resume-skills {
  font-size: 9px;
  line-height: 1.72;
}

.resume-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding-bottom: 14px;
  border-bottom: 2px solid #176b5d;
}

.resume-identity {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
}

.resume-identity-copy {
  min-width: 0;
}

.resume-paper.has-resume-photo .resume-header {
  gap: 12px;
}

.resume-paper.has-resume-photo .resume-identity {
  gap: 10px;
}

.resume-photo {
  width: 44px;
  height: 55px;
  flex: 0 0 auto;
  object-fit: cover;
  border: 1px solid #cbd4d1;
  border-radius: 4px;
  background: #f2f5f4;
}

.resume-photo.is-placeholder {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 2px;
  border-style: dashed;
  color: var(--resume-accent);
}

.resume-photo.is-placeholder svg {
  width: 17px;
  height: 17px;
}

.resume-photo.is-placeholder span {
  font-size: 7px;
}

.resume-name {
  margin: 0 0 5px;
  font-size: 25px;
  font-weight: 500;
  white-space: nowrap;
}

.resume-target {
  color: #176b5d;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.45;
}

.resume-contact {
  min-width: 0;
  display: grid;
  grid-template-columns: auto auto;
  align-items: start;
  justify-content: end;
  gap: 4px 12px;
  color: #59615f;
  font-size: 9px;
  text-align: right;
}

.resume-contact span {
  white-space: nowrap;
}

.resume-contact-email {
  grid-column: 1 / -1;
  justify-self: end;
}

.resume-section {
  margin-top: 15px;
}

.resume-section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  color: #176b5d;
  font-size: 11px;
  font-weight: 500;
}

.resume-section-title::after {
  content: "";
  height: 1px;
  flex: 1;
  background: #d6ddda;
}

.resume-summary {
  margin: 0;
  color: #3f4745;
  font-size: 9px;
  line-height: 1.7;
}

.resume-entry + .resume-entry {
  margin-top: 11px;
}

.resume-entry-head {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  margin-bottom: 4px;
  font-size: 9px;
}

.resume-entry-head strong {
  font-weight: 500;
}

.resume-entry-head span {
  color: #67706d;
}

.resume-entry-sub {
  margin-bottom: 4px;
  color: #4c5653;
  font-size: 8.5px;
  font-weight: 500;
}

.resume-bullets {
  margin: 0;
  padding-left: 14px;
  color: #3f4745;
  font-size: 8.5px;
  line-height: 1.65;
}

.resume-skills {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 18px;
  color: #3f4745;
  font-size: 8.5px;
  line-height: 1.6;
}

.resume-paper.template-classic .resume-header {
  display: block;
  text-align: center;
  border-bottom: 1px solid #303836;
}

.resume-paper.template-classic .resume-identity {
  justify-content: center;
}

.resume-paper.template-classic .resume-target {
  color: #4a5350;
}

.resume-paper.template-classic .resume-contact {
  display: flex;
  justify-content: center;
  margin-top: 7px;
  text-align: center;
}

.resume-paper.template-classic .resume-section-title {
  color: #202725;
}

.resume-paper.template-classic .resume-section-title::after {
  background: #9da6a3;
}

.resume-paper.template-compact {
  padding: 5.8% 6.2%;
}

.resume-paper.template-compact .resume-section {
  margin-top: 11px;
}

.resume-paper.template-compact .resume-entry + .resume-entry {
  margin-top: 8px;
}

.resume-accent-teal { --resume-accent: #176b5d; --resume-accent-soft: #e4f1ed; }
.resume-accent-graphite { --resume-accent: #343d3a; --resume-accent-soft: #e5e8e7; }
.resume-accent-blue { --resume-accent: #356b96; --resume-accent-soft: #e4edf4; }
.resume-accent-sky { --resume-accent: #3f7f8d; --resume-accent-soft: #e2f0f2; }
.resume-accent-green { --resume-accent: #477859; --resume-accent-soft: #e3eee7; }
.resume-accent-coral { --resume-accent: #d96549; --resume-accent-soft: #f8e5e0; }
.resume-accent-mustard { --resume-accent: #a87516; --resume-accent-soft: #f4ead3; }
.resume-accent-indigo { --resume-accent: #525f8c; --resume-accent-soft: #e7e9f1; }
.resume-accent-navy { --resume-accent: #334d66; --resume-accent-soft: #e3e9ee; }
.resume-accent-burgundy { --resume-accent: #814b52; --resume-accent-soft: #efe3e5; }

.resume-paper[class*="resume-accent-"] .resume-header {
  border-bottom-color: var(--resume-accent);
}

.resume-paper[class*="resume-accent-"] .resume-target,
.resume-paper[class*="resume-accent-"] .resume-section-title {
  color: var(--resume-accent);
}

.resume-paper.template-sidebar {
  border-left: 18px solid var(--resume-accent);
  padding-left: 6.3%;
}

.resume-paper.template-sidebar .resume-skills {
  padding: 9px;
  background: var(--resume-accent-soft);
}

.resume-paper.template-photo .resume-header {
  min-height: 57px;
}

.resume-paper.template-banner .resume-header {
  padding: 14px;
  border-bottom: 0;
  background: var(--resume-accent);
  color: #fff;
}

.resume-paper.template-banner .resume-target,
.resume-paper.template-banner .resume-contact {
  color: rgba(255, 255, 255, 0.9);
}

.resume-paper.template-banner .resume-photo {
  border-color: rgba(255, 255, 255, 0.75);
}

/* Profile, resumes, templates */
.basic-profile-wrap {
  max-width: 900px;
}

.profile-layout {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  gap: 22px;
}

.profile-nav {
  align-self: start;
  position: sticky;
  top: 88px;
  padding: 8px;
  scrollbar-width: none;
}

.profile-nav::-webkit-scrollbar {
  display: none;
}

.profile-nav button {
  width: 100%;
  min-height: 38px;
  padding: 8px 10px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--muted);
  text-align: left;
  cursor: pointer;
}

.profile-nav button.is-active {
  background: var(--primary-soft);
  color: var(--primary-ink);
}

.profile-form-section {
  margin-bottom: 16px;
  padding: 20px;
  scroll-margin-top: 84px;
}

.profile-form-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.profile-form-head h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 500;
}

.profile-form-head span {
  color: var(--muted);
  font-size: 11px;
}

.profile-form-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.profile-photo-row {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  align-items: center;
  gap: 18px;
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}

.profile-photo-preview {
  width: 88px;
  aspect-ratio: 4 / 5;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px dashed #b8c5c1;
  border-radius: 6px;
  background: #f4f7f6;
  color: var(--muted);
}

.profile-photo-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-photo-empty {
  display: grid;
  place-items: center;
  gap: 7px;
}

.profile-photo-empty svg {
  width: 25px;
  height: 25px;
}

.profile-photo-empty small {
  font-size: 10px;
}

.profile-photo-copy {
  min-width: 0;
}

.profile-photo-copy > strong {
  display: block;
  margin-bottom: 5px;
  font-size: 14px;
  font-weight: 500;
}

.profile-photo-copy p {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.6;
}

.profile-photo-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.profile-photo-actions label.button {
  cursor: pointer;
}

.visually-hidden {
  width: 1px;
  height: 1px;
  position: absolute;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.section-add-button {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface);
  color: var(--primary);
  font-size: 11px;
  cursor: pointer;
}

.section-add-button:hover {
  border-color: #a9c9c1;
  background: var(--primary-soft);
}

.section-add-button svg {
  width: 13px;
  height: 13px;
}

.profile-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 15px;
}

.profile-field.is-wide {
  grid-column: 1 / -1;
}

.profile-textarea {
  min-height: 108px;
}

.profile-entry-block + .profile-entry-block {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.profile-entry-block.is-new {
  animation: profile-entry-in 180ms ease-out;
}

.profile-entry-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 13px;
  color: var(--muted);
  font-size: 11px;
}

.profile-entry-toolbar button {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid #f0caca;
  border-radius: 5px;
  background: var(--danger-soft);
  color: var(--danger);
  cursor: pointer;
}

.profile-entry-toolbar svg {
  width: 14px;
  height: 14px;
}

@keyframes profile-entry-in {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

.resume-table-wrap {
  overflow-x: auto;
}

.resume-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.resume-table th,
.resume-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
}

.resume-table th {
  color: var(--muted);
  font-weight: 500;
}

.resume-table td strong {
  display: block;
  margin-bottom: 3px;
  font-size: 13px;
  font-weight: 500;
}

.resume-table td small {
  color: var(--muted);
}

.resume-table tr:last-child td {
  border-bottom: 0;
}

.table-actions {
  display: flex;
  gap: 5px;
  justify-content: flex-end;
  position: relative;
}

.table-actions > button {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface);
  cursor: pointer;
}

.table-actions > button[aria-expanded="true"] {
  border-color: #9fc8be;
  background: var(--primary-soft);
  color: var(--primary-ink);
}

.resume-row-menu {
  width: 138px;
  position: absolute;
  top: 36px;
  right: 0;
  z-index: 24;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  box-shadow: var(--shadow-md);
}

.resume-row-menu.opens-up {
  top: auto;
  bottom: 36px;
}

.resume-row-menu button {
  width: 100%;
  min-height: 34px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 9px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--danger);
  font-size: 11px;
  text-align: left;
  cursor: pointer;
}

.resume-row-menu button:hover,
.resume-row-menu button:focus-visible {
  background: var(--danger-soft);
  outline: none;
}

.resume-row-menu svg {
  width: 14px;
  height: 14px;
}

.resume-empty-row {
  min-height: 180px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 6px;
  color: var(--muted);
  text-align: center;
}

.resume-empty-row svg {
  width: 25px;
  height: 25px;
  margin-bottom: 4px;
}

.resume-empty-row strong {
  margin: 0 !important;
  color: var(--ink);
}

.resume-empty-row span {
  font-size: 11px;
}

.template-filter-bar {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--line);
}

.template-filters {
  min-width: 0;
  display: flex;
  gap: 24px;
  overflow-x: auto;
  scrollbar-width: none;
}

.template-filters::-webkit-scrollbar {
  display: none;
}

.template-filter {
  min-height: 43px;
  flex: 0 0 auto;
  position: relative;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
}

.template-filter:hover {
  color: var(--ink);
}

.template-filter.is-active {
  color: var(--primary-ink);
  font-weight: 500;
}

.template-filter.is-active::after {
  content: "";
  height: 2px;
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  background: var(--primary);
}

.template-result-count {
  flex: 0 0 auto;
  color: var(--muted-2);
  font-size: 11px;
}

.template-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.template-card {
  min-width: 0;
  overflow: hidden;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.template-card:hover {
  border-color: #a9c9c1;
  box-shadow: var(--shadow-md);
}

.template-card.is-selected {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(23, 107, 93, 0.12);
}

.template-thumb {
  --mini-accent: #176b5d;
  --mini-soft: #dfeee9;
  aspect-ratio: 4 / 3;
  display: grid;
  place-items: center;
  padding: 17px;
  background: #edf0ef;
}

.mini-accent-graphite { --mini-accent: #343d3a; --mini-soft: #e5e8e7; }
.mini-accent-blue { --mini-accent: #356b96; --mini-soft: #e4edf4; }
.mini-accent-sky { --mini-accent: #3f7f8d; --mini-soft: #e2f0f2; }
.mini-accent-green { --mini-accent: #477859; --mini-soft: #e3eee7; }
.mini-accent-coral { --mini-accent: #d96549; --mini-soft: #f8e5e0; }
.mini-accent-mustard { --mini-accent: #a87516; --mini-soft: #f4ead3; }
.mini-accent-indigo { --mini-accent: #525f8c; --mini-soft: #e7e9f1; }
.mini-accent-navy { --mini-accent: #334d66; --mini-soft: #e3e9ee; }
.mini-accent-burgundy { --mini-accent: #814b52; --mini-soft: #efe3e5; }

.template-sheet {
  width: auto;
  max-width: 78%;
  height: 100%;
  aspect-ratio: 210 / 297;
  overflow: hidden;
  padding: 10px;
  background: #fff;
  box-shadow: 0 3px 8px rgba(31, 45, 40, 0.14);
}

.template-sheet span,
.template-sheet b,
.template-sheet i {
  display: block;
  font-style: normal;
}

.mini-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 38%;
  align-items: center;
  gap: 7px;
  padding-bottom: 7px;
  border-bottom: 2px solid var(--mini-accent);
}

.template-sheet .mini-avatar {
  display: none;
  width: 23px;
  height: 23px;
  place-items: center;
  border-radius: 50%;
  background: var(--mini-soft);
  color: var(--mini-accent);
  font-size: 7px;
  font-weight: 500;
}

.mini-identity b {
  width: auto;
  height: auto;
  margin-bottom: 2px;
  background: none;
  color: var(--mini-accent);
  font-size: 7px;
  font-weight: 500;
  line-height: 1.2;
}

.mini-identity i {
  width: auto;
  height: auto;
  background: none;
  color: #66706d;
  font-size: 4.5px;
  line-height: 1.25;
}

.mini-contact {
  display: grid;
  gap: 1px;
  justify-items: end;
}

.mini-contact i {
  width: auto;
  height: auto;
  background: none;
  color: #737d79;
  font-size: 3.7px;
  line-height: 1.25;
  white-space: nowrap;
}

.mini-contact i:nth-child(2) {
  width: auto;
}

.mini-page-body {
  display: block;
  padding-top: 4px;
}

.template-sheet .mini-rail {
  display: none;
}

.mini-main {
  display: block;
}

.mini-section {
  display: block;
  margin-top: 5px;
}

.mini-section b {
  width: auto;
  height: auto;
  margin-bottom: 2px;
  padding-bottom: 1px;
  border-bottom: 1px solid var(--mini-soft);
  background: none;
  color: var(--mini-accent);
  font-size: 5px;
  font-weight: 500;
  line-height: 1.25;
}

.mini-section i {
  width: auto;
  height: auto;
  margin-bottom: 1px;
  overflow: hidden;
  background: none;
  color: #5e6864;
  font-size: 3.8px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mini-section i:nth-child(3) {
  width: auto;
}

.mini-section i:nth-child(4) {
  width: auto;
}

.mini-layout-centered .mini-head {
  display: flex;
  flex-direction: column;
  gap: 3px;
  text-align: center;
}

.mini-layout-centered .mini-identity {
  width: 80%;
}

.mini-layout-centered .mini-identity b,
.mini-layout-centered .mini-identity i {
  margin-right: auto;
  margin-left: auto;
}

.mini-layout-centered .mini-contact {
  width: 80%;
  display: flex;
  justify-content: center;
}

.mini-layout-centered .mini-contact i {
  width: auto;
}

.mini-layout-photo .mini-head {
  grid-template-columns: 23px minmax(0, 1fr) 32%;
}

.mini-layout-photo .mini-avatar {
  display: grid;
}

.mini-layout-sidebar {
  padding: 0;
}

.mini-layout-sidebar .mini-head {
  grid-template-columns: 23px minmax(0, 1fr) 30%;
  margin: 0 9px;
  padding-top: 9px;
}

.mini-layout-sidebar .mini-avatar {
  display: grid;
}

.mini-layout-sidebar .mini-page-body {
  display: grid;
  grid-template-columns: 31% minmax(0, 1fr);
  padding-top: 0;
}

.mini-layout-sidebar .mini-rail {
  min-height: 118px;
  display: block;
  padding: 8px 6px;
  background: var(--mini-soft);
}

.mini-rail-title {
  width: auto;
  height: auto;
  margin: 5px 0 3px;
  background: none;
  color: var(--mini-accent);
  font-size: 4.5px;
  font-weight: 500;
  line-height: 1.2;
}

.mini-rail i {
  width: auto;
  height: auto;
  margin-bottom: 2px;
  background: none;
  color: #5e6864;
  font-size: 3.5px;
  line-height: 1.2;
  white-space: nowrap;
}

.mini-layout-sidebar .mini-main {
  padding: 4px 8px;
}

.mini-layout-banner {
  padding: 0;
}

.mini-layout-banner .mini-head {
  padding: 10px;
  border-bottom: 0;
  background: var(--mini-accent);
}

.mini-layout-banner .mini-identity b,
.mini-layout-banner .mini-identity i,
.mini-layout-banner .mini-contact i {
  background: none;
  color: rgba(255, 255, 255, 0.9);
}

.mini-layout-banner .mini-page-body {
  padding: 6px 10px;
}

.mini-layout-compact .mini-main {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px 7px;
}

.mini-layout-compact .mini-section b {
  width: auto;
}

.template-info {
  min-height: 65px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
}

.template-copy {
  min-width: 0;
}

.template-copy strong {
  display: block;
  margin-bottom: 4px;
  overflow: hidden;
  font-size: 13px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.template-copy > span {
  display: block;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.template-card-end {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.template-card-end svg {
  width: 17px;
  height: 17px;
}

.template-badge {
  padding: 3px 5px;
  border-radius: 4px;
  background: var(--coral-soft);
  color: #a6422d;
  font-size: 10px;
}

.template-badge.is-free {
  background: var(--primary-soft);
  color: var(--primary-ink);
}

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(20, 29, 26, 0.46);
}

.modal-backdrop[hidden] {
  display: none;
}

.modal {
  width: min(100%, 520px);
  max-height: calc(100vh - 36px);
  overflow-y: auto;
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 20px 60px rgba(12, 24, 20, 0.25);
}

.modal.is-wide {
  width: min(100%, 780px);
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 15px;
  padding: 20px 22px 16px;
  border-bottom: 1px solid var(--line);
}

.modal-head h2 {
  margin: 0 0 5px;
  font-size: 18px;
  font-weight: 500;
}

.modal-head p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.modal-close {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  padding: 0;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.modal-close:hover {
  background: #eef1f0;
}

.modal-body {
  padding: 20px 22px;
}

.auth-form {
  display: grid;
  gap: 17px;
  padding: 22px;
}

.auth-field label {
  display: block;
  margin-bottom: 7px;
  color: #3d4844;
  font-size: 12px;
  font-weight: 500;
}

.auth-code-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 128px;
  gap: 9px;
}

.auth-code-row .button {
  min-width: 0;
  padding-inline: 10px;
  white-space: nowrap;
}

.auth-feedback,
.auth-dev-note,
.auth-footnote {
  margin: -4px 0 0;
  font-size: 12px;
  line-height: 1.55;
}

.auth-feedback {
  color: var(--muted);
}

.auth-feedback[data-type="error"] {
  color: var(--danger);
}

.auth-feedback[data-type="success"] {
  color: var(--primary-ink);
}

.auth-dev-note {
  padding: 9px 11px;
  border-left: 3px solid var(--amber);
  background: var(--amber-soft);
  color: #6e4b0b;
}

.auth-dev-note strong {
  font-weight: 600;
}

.auth-consent {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  cursor: pointer;
}

.auth-consent input {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  margin: 1px 0 0;
  accent-color: var(--primary);
}

.auth-footnote {
  color: var(--muted-2);
  text-align: center;
}

.account-summary {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
}

.account-summary-avatar {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary-ink);
  font-size: 18px;
  font-weight: 500;
}

.account-summary > div:nth-child(2) {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.account-summary > div:nth-child(2) strong {
  font-size: 15px;
  font-weight: 500;
}

.account-summary > div:nth-child(2) span {
  color: var(--muted);
  font-size: 12px;
}

.account-summary p {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 5px 0 0;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  color: var(--primary-ink);
  font-size: 13px;
}

.account-summary p svg {
  width: 17px;
  height: 17px;
}

.section-picker-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.section-picker-grid button {
  min-width: 0;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) 16px;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.section-picker-grid button:hover {
  border-color: #a9c9c1;
  background: var(--primary-soft);
}

.section-picker-grid button > svg:first-child {
  width: 18px;
  height: 18px;
  color: var(--primary);
}

.section-picker-grid button > svg:last-child {
  width: 15px;
  height: 15px;
  color: var(--muted-2);
}

.section-picker-grid span,
.section-picker-grid strong,
.section-picker-grid small {
  min-width: 0;
  display: block;
}

.section-picker-grid strong {
  font-size: 12px;
  font-weight: 500;
}

.section-picker-grid small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
}

.suggestion-list {
  display: grid;
  gap: 0;
}

.suggestion-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  padding: 17px 0;
  border-bottom: 1px solid var(--line);
}

.suggestion-row:first-child {
  padding-top: 0;
}

.suggestion-row:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.suggestion-copy span {
  display: block;
  margin-bottom: 6px;
  color: var(--primary);
  font-size: 10px;
  font-weight: 500;
}

.suggestion-copy p {
  margin: 0;
  color: var(--text-soft);
  font-size: 12px;
  line-height: 1.7;
}

.delete-resume-summary {
  display: flex;
  align-items: center;
  gap: 13px;
}

.delete-resume-icon {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 6px;
  background: var(--danger-soft);
  color: var(--danger);
}

.delete-resume-icon svg {
  width: 18px;
  height: 18px;
}

.delete-resume-summary strong,
.delete-resume-summary span {
  display: block;
}

.delete-resume-summary strong {
  margin-bottom: 4px;
  font-size: 14px;
  font-weight: 500;
}

.delete-resume-summary span {
  color: var(--muted);
  font-size: 11px;
}

.template-preview-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 190px;
  gap: 20px;
  align-items: start;
}

.template-preview-stage {
  display: grid;
  place-items: center;
  padding: 18px;
  background: #e8ecea;
}

.template-preview-stage .resume-paper,
.resume-paper.is-modal-preview {
  width: 100%;
  min-width: 0;
  max-width: 440px;
  margin: 0;
  transform: none;
  box-shadow: 0 7px 20px rgba(27, 42, 37, 0.18);
}

.template-preview-details {
  min-width: 0;
}

.template-free-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 16px;
  color: var(--primary);
  font-size: 13px;
  font-weight: 500;
}

.template-free-label svg {
  width: 17px;
  height: 17px;
}

.template-preview-details dl {
  margin: 0;
}

.template-preview-details dl div {
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.template-preview-details dt {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 11px;
}

.template-preview-details dd {
  margin: 0;
  color: var(--text);
  font-size: 13px;
}

.template-preview-checks {
  display: grid;
  gap: 8px;
  margin-top: 16px;
  color: var(--text-soft);
  font-size: 12px;
}

.template-preview-checks span {
  display: flex;
  align-items: center;
  gap: 6px;
}

.template-preview-checks svg {
  width: 14px;
  height: 14px;
  color: var(--primary);
}

.modal-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
  padding: 15px 22px;
  border-top: 1px solid var(--line);
  background: var(--surface-subtle);
}

.export-summary {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 13px;
  align-items: center;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-subtle);
}

.export-file-icon {
  width: 52px;
  height: 64px;
  display: grid;
  place-items: center;
  border: 1px solid #cfdbd7;
  border-radius: 4px;
  background: #fff;
  color: var(--primary);
  font-weight: 500;
}

.export-summary strong {
  display: block;
  margin-bottom: 5px;
  font-size: 13px;
  font-weight: 500;
  word-break: break-all;
}

.export-summary span {
  color: var(--muted);
  font-size: 11px;
}

.export-pdf-card {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  margin-top: 16px;
  padding: 12px;
  border: 1px solid #bcd8d1;
  border-radius: 7px;
  background: var(--primary-soft);
  color: var(--primary-ink);
}

.export-pdf-card > svg {
  width: 18px;
  height: 18px;
}

.export-pdf-card strong {
  display: block;
  margin-bottom: 3px;
  font-size: 12px;
  font-weight: 500;
}

.export-pdf-card small {
  color: var(--muted);
  font-size: 10px;
}

.button.is-loading svg {
  animation: gentle-spin 1s linear infinite;
}

.pdf-export-host {
  position: fixed;
  top: 0;
  left: -10000px;
  z-index: -1;
  width: 210mm;
  height: 297mm;
  overflow: hidden;
  background: #fff;
  pointer-events: none;
}

.resume-paper.is-pdf-export {
  width: 210mm;
  min-width: 210mm;
  height: 297mm;
  min-height: 297mm;
  aspect-ratio: auto;
  margin: 0 !important;
  box-shadow: none;
  transform: none !important;
}

.free-banner {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 16px;
  padding: 11px 12px;
  border: 1px solid #c7ded8;
  border-radius: 6px;
  background: #f4faf8;
  color: var(--primary-ink);
  font-size: 12px;
}

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.price-option {
  min-height: 168px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  text-align: left;
  cursor: pointer;
}

.price-option:hover,
.price-option.is-selected {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(23, 107, 93, 0.1);
}

.price-option.is-selected {
  background: #f5faf8;
}

.price-badge {
  min-height: 21px;
  margin-bottom: 12px;
  padding: 3px 6px;
  border-radius: 4px;
  background: var(--coral-soft);
  color: #a6422d;
  font-size: 10px;
}

.price-option h3 {
  margin: 0 0 7px;
  font-size: 14px;
  font-weight: 500;
}

.price {
  margin-bottom: 10px;
  font-size: 25px;
  font-weight: 500;
}

.price small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 400;
}

.price-option p {
  margin: auto 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.template-modal-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.template-choice {
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  text-align: left;
  cursor: pointer;
}

.template-choice.is-selected {
  border-color: var(--primary);
  background: #f4faf8;
}

.template-choice .template-thumb {
  padding: 12px;
}

.template-choice-copy {
  display: block;
  min-width: 0;
  padding: 9px 3px 4px;
}

.template-choice-copy strong {
  display: block;
  margin-bottom: 3px;
  overflow: hidden;
  font-size: 12px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.template-choice-copy small {
  display: block;
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

button[data-action="browse-templates"] {
  margin-right: auto;
}

.toast-region {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  min-width: 250px;
  max-width: 360px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 12px 14px;
  border: 1px solid #c8ded8;
  border-radius: 7px;
  background: #f6fbf9;
  color: var(--primary-ink);
  box-shadow: var(--shadow-md);
  font-size: 12px;
  animation: toast-in 180ms ease-out;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.generation-stage {
  min-height: 450px;
  display: grid;
  place-items: center;
  padding: 32px;
  text-align: center;
}

.generation-box {
  width: min(100%, 430px);
}

.generation-icon {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  margin: 0 auto 17px;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary);
}

.generation-icon svg {
  width: 23px;
  height: 23px;
  animation: gentle-spin 1.8s linear infinite;
}

@keyframes gentle-spin {
  to { transform: rotate(360deg); }
}

.generation-box h2 {
  margin: 0 0 7px;
  font-size: 18px;
  font-weight: 500;
}

.generation-box p {
  margin: 0 0 19px;
  color: var(--muted);
  font-size: 12px;
}

.generation-progress {
  height: 6px;
  overflow: hidden;
  border-radius: 4px;
  background: #e5ebe8;
}

.generation-progress span {
  display: block;
  width: 12%;
  height: 100%;
  background: var(--primary);
  transition: width 450ms ease;
}

.generation-step-label {
  display: block;
  margin-top: 9px;
  color: var(--muted-2);
  font-size: 11px;
}

.empty-state {
  padding: 55px 24px;
  text-align: center;
}

.empty-state svg {
  width: 30px;
  height: 30px;
  margin-bottom: 10px;
  color: var(--muted-2);
}

.empty-state h3 {
  margin: 0 0 6px;
  font-size: 14px;
  font-weight: 500;
}

.empty-state p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.mobile-backdrop {
  display: none;
}

@media (max-width: 1120px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .side-column {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .editor-shell {
    grid-template-columns: minmax(340px, 0.86fr) minmax(420px, 1.14fr);
  }

  .template-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  :root {
    --sidebar-width: 220px;
  }

  .sidebar {
    position: fixed;
    left: 0;
    transform: translateX(-100%);
    transition: transform 180ms ease;
    box-shadow: var(--shadow-md);
  }

  .sidebar.is-open {
    transform: translateX(0);
  }

  .mobile-backdrop.is-open {
    position: fixed;
    inset: 0;
    z-index: 25;
    display: block;
    background: rgba(20, 29, 26, 0.34);
  }

  .app-shell {
    grid-template-columns: 1fr;
  }

  .mobile-menu {
    display: inline-grid;
  }

  .topbar {
    padding: 0 20px;
  }

  .topbar-crumb {
    flex: 1;
  }

  .main-content {
    padding: 24px 20px;
  }

  .editor-shell {
    min-height: auto;
    grid-template-columns: 1fr;
  }

  .editor-controls {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .editor-scroll {
    max-height: none;
  }

  .preview-stage {
    max-height: 720px;
  }

  .profile-layout {
    grid-template-columns: 1fr;
  }

  .profile-nav {
    position: sticky;
    top: 74px;
    z-index: 12;
    display: flex;
    overflow-x: auto;
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(8px);
  }

  .profile-nav button {
    width: auto;
    flex: 0 0 auto;
  }

  .profile-form-section {
    scroll-margin-top: 130px;
  }
}

@media (max-width: 680px) {
  .topbar {
    padding: 0 14px;
  }

  .topbar-actions .button span {
    display: none;
  }

  .topbar-actions .button {
    width: 38px;
    padding: 0;
  }

  .main-content {
    padding: 20px 14px;
  }

  .page-header,
  .flow-title-row,
  .editor-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .page-header h1 {
    font-size: 22px;
  }

  .metric-row {
    grid-template-columns: 1fr;
  }

  .metric,
  .metric + .metric {
    padding: 14px 0;
    border-left: 0;
    border-bottom: 1px solid var(--line);
  }

  .metric:last-child {
    border-bottom: 0;
  }

  .quick-create {
    grid-template-columns: 42px minmax(0, 1fr);
  }

  .quick-create .button {
    grid-column: 1 / -1;
    width: 100%;
  }

  .project-row {
    grid-template-columns: 38px minmax(0, 1fr) auto;
    padding: 13px;
  }

  .project-row .project-cell,
  .project-row .more-cell {
    display: none;
  }

  .side-column {
    grid-template-columns: 1fr;
  }

  .step {
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
  }

  .step::after {
    position: absolute;
    width: calc(100% - 34px);
    left: 30px;
    top: 12px;
  }

  .step span:last-child {
    max-width: 58px;
    line-height: 1.35;
  }

  .field-grid,
  .analysis-layout,
  .profile-fields,
  .pricing-grid,
  .template-modal-grid,
  .template-grid,
  .section-picker-grid {
    grid-template-columns: 1fr;
  }

  .field-grid.is-job-grid {
    grid-template-columns: 1fr;
  }

  .field-help {
    flex-wrap: wrap;
  }

  .profile-photo-row {
    grid-template-columns: 72px minmax(0, 1fr);
    gap: 14px;
  }

  .profile-photo-preview {
    width: 72px;
  }

  .analysis-column + .analysis-column {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .form-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .privacy-note {
    justify-content: center;
  }

  .form-actions-right {
    width: 100%;
  }

  .form-actions-right .button {
    flex: 1;
  }

  .toolbar-actions {
    width: 100%;
    flex-wrap: wrap;
  }

  .toolbar-actions .button {
    flex: 1;
    gap: 5px;
    padding: 8px 7px;
    font-size: 12px;
    white-space: nowrap;
  }

  .auto-layout-status {
    grid-template-columns: 34px minmax(0, 1fr);
  }

  .auto-layout-status .button {
    grid-column: 1 / -1;
    width: 100%;
  }

  .suggestion-row {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .suggestion-row .button {
    width: 100%;
  }

  .preview-stage {
    padding: 14px;
  }

  .resume-paper {
    min-width: 500px;
  }

  .template-preview-layout {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .template-preview-stage {
    padding: 10px;
  }

  .template-preview-stage .resume-paper {
    min-width: 0;
  }

  .modal-actions {
    align-items: stretch;
    flex-direction: column-reverse;
  }

  .modal-actions .button {
    width: 100%;
  }

  .toast-region {
    right: 14px;
    bottom: 14px;
    left: 14px;
  }

  .toast {
    width: 100%;
    min-width: 0;
  }
}

@media (min-width: 681px) and (max-width: 900px) {
  .is-editor-view .editor-shell {
    min-height: 0;
    grid-template-columns: minmax(365px, 1.06fr) minmax(315px, 0.94fr);
  }

  .is-editor-view .editor-controls {
    border-right: 1px solid var(--line);
    border-bottom: 0;
  }

  .is-editor-view .editor-scroll {
    max-height: none;
    padding: 14px;
  }

  .is-editor-view .preview-stage {
    max-height: none;
    padding: 16px 12px 20px;
  }

  .is-editor-view .preview-toolbar {
    gap: 8px;
    padding: 9px 10px;
  }

  .is-editor-view .preview-command {
    width: 36px;
    padding: 8px;
  }

  .is-editor-view .preview-command span,
  .is-editor-view .layout-fit {
    display: none;
  }

  .is-editor-view .module-dock-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .is-editor-view .app-area,
  .is-editor-view .main-content {
    height: auto;
    overflow: visible;
  }

  .is-editor-view .editor-page {
    height: auto;
    min-height: 100vh;
    overflow: visible;
  }

  .is-editor-view .editor-toolbar {
    min-height: 62px;
    position: sticky;
    top: 0;
    align-items: center;
    flex-direction: row;
    padding: 9px 12px;
  }

  .is-editor-view .editor-title h1 {
    max-width: 190px;
    font-size: 15px;
  }

  .is-editor-view .save-state {
    font-size: 9px;
  }

  .is-editor-view .toolbar-actions {
    width: auto;
    flex: 0 0 auto;
  }

  .is-editor-view .toolbar-actions .button {
    width: 36px;
    flex: 0 0 auto;
    padding: 8px;
    font-size: 0;
  }

  .is-editor-view .editor-shell {
    display: block;
    overflow: visible;
  }

  .is-editor-view .editor-scroll {
    max-height: none;
    overflow: visible;
  }

  .is-editor-view .module-dock-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .is-editor-view .preview-pane {
    min-height: 650px;
  }

  .is-editor-view .preview-toolbar {
    grid-template-columns: 1fr 1fr;
  }

  .is-editor-view .preview-document-state {
    display: none;
  }

  .is-editor-view .preview-command {
    width: 100%;
  }

  .is-editor-view .preview-stage {
    max-height: none;
  }
}

@media print {
  body * {
    visibility: hidden;
  }

  .resume-paper,
  .resume-paper * {
    visibility: visible;
  }

  .resume-paper {
    width: 210mm;
    min-width: 210mm;
    height: 297mm;
    position: absolute;
    inset: 0;
    box-shadow: none;
  }

  .is-editor-view .resume-paper {
    width: 210mm;
    min-width: 210mm;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
