:root {
  --text: #1f2d3d;
  --muted: #5a6c80;
  --line: #dbe4ef;
  --primary: #1f5a93;
  --danger: #b91c1c;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  color: var(--text);
  font-family: "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  overflow-x: hidden;
}
.topbar,
.topbar *,
.footer,
.footer * {
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
.page-shell {
  max-width: 1100px;
  margin: 0 auto;
  padding: 16px 12px 28px;
}
.card {
  background: #ffffff;
  border: 1px solid #dbe4ef;
  border-radius: 14px;
}
.hero {
  padding: 18px;
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
  border: 1px solid #2e69a5;
  border-radius: 16px;
  background: linear-gradient(145deg, #2f6fae, #1f5a93);
  color: #ffffff;
}
.hero h1 {
  margin: 2px 0 6px;
  font-size: 40px;
  line-height: 1.1;
  color: #ffffff;
  letter-spacing: .2px;
}
.hero p {
  margin: 0;
  color: #e2eefb;
  max-width: 920px;
  font-size: 18px;
}
.hero, .hero h1, .hero p, .eyebrow, .notice,
.editor-column, .editor-column h2, .editor-column .field-grid span,
.editor-column .helper, .editor-column .btn, .lang-select {
  font-family: Inter, "Noto Sans", Arial, sans-serif;
}
.eyebrow {
  display: inline-flex;
  width: fit-content;
  padding: 6px 11px;
  border: 1px solid rgba(255,255,255,.42);
  border-radius: 999px;
  background: rgba(255,255,255,.14);
  color: #ffffff;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .08em;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.hero-actions .action-pill {
  min-height: 42px;
  border-radius: 999px;
  padding-left: 16px;
  padding-right: 16px;
}
.auth-actions {
  margin-top: 14px;
}
.auth-status {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid #d1d5db;
  border-radius: 999px;
  background: #ffffff;
  font-weight: 700;
}
.auth-modal[hidden] { display: none !important; }
.auth-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 16px;
}
.auth-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.48);
}
.auth-modal__dialog {
  position: relative;
  z-index: 1;
  width: min(560px, calc(100vw - 24px));
  padding: 18px;
}
.language-card {
  margin-bottom: 12px;
}
.cv-review-panel {
  margin-bottom: 16px;
}
.cv-review-panel .check-row {
  min-height: 52px;
}
.language-card .highlight-field {
  display: grid;
  gap: 8px;
  width: 100%;
}
.language-card .highlight-field select {
  width: 100%;
  min-width: 0;
}
.footer-actions {
  display: grid;
  gap: 12px;
}
.footer-save-btn {
  min-height: 52px;
  font-size: 17px;
  font-weight: 900;
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.18);
}
.highlight-field {
  padding: 12px;
  border: 2px solid #1d4ed8;
  border-radius: 16px;
  background: #eff6ff;
}
.highlight-field span {
  color: #1d4ed8;
}
.notice {
  margin: 0;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.45);
  background: rgba(255,255,255,.14);
  color: #ffffff;
  font-weight: 600;
}
.workspace-grid {
  display: grid;
  grid-template-columns: minmax(620px, 1.03fr) minmax(420px, .97fr);
  gap: 20px;
  align-items: start;
}
.workspace-grid > *,
.editor-column,
.preview-column,
.card,
.section-card,
.repeat-item,
.preview-wrap,
.resume-sheet {
  min-width: 0;
  max-width: 100%;
}
.editor-column, .preview-column { display: grid; gap: 16px; }
.section-card { padding: 18px; }
.section-card h2, .preview-head h2 { margin: 0 0 12px; font-size: 20px; color: #111111; }
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}
.field-grid { display: grid; gap: 14px; }
.field-grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.field-grid label { display: grid; gap: 8px; }
.field-grid label.full { grid-column: 1 / -1; }
.field-grid span {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .04em;
  color: #1f2937;
}
input, textarea, select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #ffffff;
  padding: 12px 13px;
  font: inherit;
  color: #1f2937;
}
#userLanguage {
  font-size: 14px;
}
.ym-picker {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 110px;
  gap: 8px;
}
.ym-picker select {
  min-width: 0;
}
textarea { resize: vertical; min-height: 88px; }
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: #64748b;
  box-shadow: 0 0 0 3px rgba(148, 163, 184, 0.18);
}
.helper { color: var(--muted); font-size: 12px; }
.file-picker-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.file-name {
  color: #374151;
  font-size: 14px;
  word-break: break-word;
}
.current-job-helper {
  display: none;
  margin-top: -4px;
  margin-bottom: 2px;
}
.current-job-helper.is-visible {
  display: block;
}
.check-row {
  display: flex !important;
  align-items: center;
  gap: 10px;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  padding: 12px 13px;
  background: #ffffff;
}
.check-row input { width: auto; }
.check-row span {
  margin: 0;
  font-size: 12px;
  font-weight: 800;
  color: #1f2937;
}
.btn {
  border: 1px solid #c7d8eb;
  background: #ffffff;
  color: #1f2d3d;
  padding: 10px 15px;
  border-radius: 10px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.btn.primary {
  background: linear-gradient(180deg, #2f6fae, #1f5a93);
  color: #ffffff;
  border-color: #1f5a93;
}
.btn.danger { color: var(--danger); border-color: #fecaca; background: #ffffff; }
.lang-select { width: auto; min-width: 130px; }
.repeat-list { display: grid; gap: 14px; }
.repeat-item {
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  padding: 14px;
  background: #ffffff;
}
.repeat-item__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}
.preview-wrap { padding: 18px; position: sticky; top: 18px; }
.preview-head p { margin: 0 0 14px; color: var(--muted); }
.resume-sheet {
  width: 100%;
  min-height: 1280px;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 20px;
  padding: 16px;
  overflow: auto;
}
.resume-sheet.mobile-fit {
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: flex-start;
}
.resume-a4 {
  position: relative;
  width: 210mm;
  height: 297mm;
  margin: 0 auto;
  background: #ffffff;
  color: #111111;
  padding: 5.5mm 20mm;
  overflow: hidden;
}
.resume-watermark {
  position: absolute;
  right: 7mm;
  bottom: 5mm;
  font-size: 9px;
  letter-spacing: .08em;
  color: rgba(17, 24, 39, 0.65);
  font-weight: 700;
}
.resume-title-wrap {
  position: relative;
  margin: 0 0 3mm;
  min-height: 11mm;
}
.resume-title {
  text-align: center;
  font-size: 28px;
  font-weight: 900;
  letter-spacing: .18em;
  margin: 0;
}
.resume-date {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  font-size: 10.4px;
  font-weight: 700;
  white-space: nowrap;
}
.resume-header { display: block; margin-bottom: 2.2mm; }
.resume-info-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.68fr) minmax(0, 0.59fr);
  gap: 2.5mm;
  margin-bottom: 2.2mm;
}
.resume-person-grid { margin-bottom: 2.2mm; }
.resume-main-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5mm;
  margin-bottom: 2.2mm;
}
.resume-table,
.resume-list-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  margin-bottom: 2mm;
}
.resume-table th,
.resume-table td,
.resume-list-table th,
.resume-list-table td {
  border: 1px solid #222222;
  padding: 3.2px 4.2px;
  font-size: 10.8px;
  line-height: 1.24;
  vertical-align: middle;
  word-break: break-word;
  background: #ffffff;
}
.resume-table th {
  width: 14%;
  text-align: center;
  font-size: 9.4px;
  font-weight: 900;
}
.resume-table--compact th.short,
.resume-table--compact td.short { width: 8%; }
.resume-list-table th {
  text-align: center;
  font-weight: 900;
  font-size: 9.8px;
}
.resume-photo-cell {
  width: 42mm;
  padding: 0 !important;
  vertical-align: top !important;
}
.photo-box {
  width: 100%;
  height: 100%;
  min-height: 50mm;
  display: grid;
  place-items: center;
  background: #ffffff;
  font-size: 10px;
  text-align: center;
  overflow: hidden;
}
.photo-box img { width: 100%; height: 100%; object-fit: cover; display: block; }
.resume-section-title {
  background: #ffffff !important;
  font-size: 10.2px !important;
  font-weight: 900 !important;
  letter-spacing: .03em;
}
.resume-block {
  border: 1px solid #222222;
  background: #ffffff;
  min-height: 22mm;
}
.resume-block__title {
  padding: 4px 6px;
  border-bottom: 1px solid #222222;
  font-size: 11.2px;
  font-weight: 900;
  background: #ffffff;
}
.resume-block__body {
  padding: 6px 7px;
  font-size: 10.8px;
  line-height: 1.38;
  white-space: pre-wrap;
  background: #ffffff;
}
.resume-block__body.compact {
  min-height: 18mm;
  max-height: 18mm;
  overflow: hidden;
}
.resume-truncate {
  display: block;
  max-height: 2.45em;
  overflow: hidden;
}
.resume-nowrap { white-space: nowrap; display: inline-block; }
.resume-note-row td {
  font-size: 9px;
  color: #111111;
  background: #ffffff;
}
.footer-note {
  text-align: center;
  margin-top: 1.4mm;
  font-size: 8.8px;
  font-weight: 700;
  color: #111111;
}
.input-lang-vi, textarea.input-lang-vi { font-family: "Times New Roman", Times, serif; }
.input-lang-ja, textarea.input-lang-ja { font-family: "Hiragino Sans", "Yu Gothic", "Meiryo", "Noto Sans JP", sans-serif; }
.input-lang-en, textarea.input-lang-en { font-family: Arial, Helvetica, sans-serif; }
.preview-lang-vi { font-family: "Times New Roman", Times, serif; }
.preview-lang-ja { font-family: "Hiragino Sans", "Yu Gothic", "Meiryo", "Noto Sans JP", sans-serif; }
.preview-lang-en { font-family: Arial, Helvetica, sans-serif; }
@media (max-width: 1180px) {
  .workspace-grid { grid-template-columns: 1fr; }
  .preview-wrap { position: static; }
}
@media (max-width: 760px) {
  input, textarea, select {
    font-size: 16px;
    max-width: 100%;
  }
  .page-shell {
    padding: 10px;
    max-width: 100%;
  }
  .workspace-grid {
    gap: 12px;
    grid-template-columns: 1fr;
  }
  .preview-column { order: -1; }
  .hero,
  .section-card,
  .repeat-item,
  .preview-wrap,
  .notice {
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    border-radius: 16px;
  }
  .hero { padding: 14px; }
  .hero h1 { font-size: 22px; }
  .hero-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    width: 100%;
  }
  .hero-actions .btn,
  .auth-status {
    width: 100%;
    min-height: 46px;
    max-width: 100%;
    justify-content: center;
  }
  .auth-modal {
    padding: 12px;
  }
  .auth-modal__dialog {
    width: 100%;
    padding: 14px;
    border-radius: 18px;
  }
  .footer-save-btn {
    min-height: 54px;
    font-size: 18px;
  }
  .field-grid.cols-2 { grid-template-columns: 1fr; }
  .ym-picker {
    grid-template-columns: minmax(0, 1fr) 96px;
    gap: 6px;
  }
  .section-card { padding: 14px; }
  .section-card h2, .preview-head h2 { font-size: 18px; }
  .repeat-item { padding: 12px; }
  .preview-wrap { position: static; padding: 12px; }
  .preview-head p { font-size: 13px; }
  .resume-sheet {
    width: 100%;
    min-height: auto;
    padding: 8px;
    overflow: hidden;
    border-radius: 16px;
  }
  .resume-sheet.mobile-fit {
    width: 100%;
    max-width: 100%;
  }
  .resume-a4 {
    width: 210mm;
    height: 297mm;
    min-height: 297mm;
    margin: 0;
    transform-origin: top center;
  }
  .resume-info-grid, .resume-main-grid { grid-template-columns: 1fr; }
  .highlight-field { padding: 10px; }
}
@media print {
  @page { size: A4 portrait; margin: 0; }
  html, body { width: 210mm; height: 297mm; background: #ffffff; }
  .topbar, .footer, .hero, .cv-review-panel, .editor-column, .preview-head { display: none !important; }
  .page-shell { max-width: none; padding: 0; background: #ffffff; }
  .workspace-grid { display: block; }
  .preview-column { display: block; }
  .preview-wrap { padding: 0; border: none; }
  .resume-sheet { border: none; padding: 0; background: #ffffff; overflow: visible; }
  .resume-a4 { width: 210mm; height: 297mm; margin: 0; }
}
