@import url("https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,600;9..144,700&family=IBM+Plex+Mono:wght@400;500&family=Manrope:wght@400;500;600;700;800&family=Source+Serif+4:opsz,wght@8..60,500;8..60,600;8..60,700&display=swap");

:root {
  --bg: #eef2f8;
  --bg-deep: #dbe4f4;
  --surface: #ffffff;
  --surface-strong: #f8fbff;
  --surface-soft: #f1f5fc;
  --text: #162236;
  --text-soft: #51617a;
  --line: #d5deeb;
  --line-strong: #b8c8df;
  --primary: #1f5aa8;
  --primary-strong: #173f75;
  --accent: #0f7a6a;
  --danger: #9f2f33;
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --shadow-soft: 0 12px 38px rgba(26, 49, 86, 0.08);
  --shadow-strong: 0 18px 50px rgba(19, 40, 71, 0.16);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  font-family: "Manrope", "Segoe UI", sans-serif;
  color: var(--text);
  -webkit-text-size-adjust: 100%;
}

body {
  background:
    radial-gradient(1300px 520px at -5% -12%, rgba(34, 102, 183, 0.18) 0%, rgba(34, 102, 183, 0) 58%),
    radial-gradient(900px 460px at 104% 3%, rgba(25, 145, 128, 0.14) 0%, rgba(25, 145, 128, 0) 62%),
    linear-gradient(180deg, var(--bg) 0%, #edf1f7 55%, var(--bg-deep) 100%);
  overflow-x: hidden;
}

img,
svg {
  max-width: 100%;
  height: auto;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(23, 44, 77, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(23, 44, 77, 0.05) 1px, transparent 1px);
  background-size: 32px 32px;
  opacity: 0.35;
  pointer-events: none;
  z-index: -1;
}

a {
  color: var(--primary);
  text-underline-offset: 2px;
}

.site-header {
  padding: 34px 20px 8px;
}

.header-content {
  max-width: 1360px;
  margin: 0 auto;
  padding: 22px 24px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(173, 194, 223, 0.75);
  background:
    linear-gradient(116deg, rgba(255, 255, 255, 0.9) 0%, rgba(243, 249, 255, 0.92) 60%, rgba(232, 245, 242, 0.9) 100%);
  box-shadow: var(--shadow-soft);
  position: relative;
  overflow: hidden;
}

.header-account {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
  margin: 0 0 10px;
}

.header-auth {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
}

.header-auth-email {
  display: inline-block;
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 800;
  font-size: 0.85rem;
  color: #17365f;
}

.header-content::after {
  content: "Professional CV Studio";
  position: absolute;
  left: 18px;
  top: 14px;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #2e5f8c;
  border: 1px solid rgba(54, 107, 157, 0.4);
  border-radius: 999px;
  padding: 5px 10px;
  background: rgba(231, 242, 255, 0.78);
}

.header-content h1 {
  margin: 0;
  font-family: "Fraunces", "Times New Roman", serif;
  font-size: clamp(2rem, 3.1vw, 3rem);
  letter-spacing: -0.02em;
  color: #152743;
}

.header-content p {
  margin: 8px 0 0;
  font-size: 1.02rem;
  color: var(--text-soft);
  max-width: 62ch;
}

.header-actions {
  margin-top: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.builder-layout {
  max-width: 1360px;
  margin: 0 auto;
  padding: 14px 20px 28px;
  display: grid;
  grid-template-columns: minmax(380px, 500px) minmax(480px, 1fr);
  gap: 18px;
  align-items: start;
}

.builder-layout > * {
  min-width: 0;
}

.account-layout {
  max-width: 860px;
  margin: 0 auto;
  padding: 14px 20px 44px;
}

.account-panel {
  padding: 18px;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(600px 340px at 0% 0%, rgba(37, 94, 168, 0.08), transparent 62%),
    radial-gradient(460px 320px at 100% 10%, rgba(15, 122, 106, 0.07), transparent 58%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 251, 255, 0.98));
}

.account-panel::after {
  content: "";
  position: absolute;
  right: -120px;
  top: -140px;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(31, 90, 168, 0.14) 0%, rgba(31, 90, 168, 0) 68%);
  pointer-events: none;
}

.account-top {
  border-top: 0;
  margin-top: 0;
  padding-top: 0;
}

.account-title {
  margin: 0;
  font-family: "Fraunces", "Times New Roman", serif;
  letter-spacing: -0.02em;
  font-size: 1.55rem;
}

.account-hint {
  margin: 10px 0 0;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid #c6d6eb;
  background: #eff5ff;
  color: #2a4d79;
  font-weight: 700;
  font-size: 0.9rem;
}

.account-quota {
  margin: 10px 0 0;
  color: #1b2e49;
  font-size: 0.92rem;
  font-weight: 600;
}

.account-quota .muted {
  margin-left: 6px;
  color: #5c728f;
  font-weight: 600;
  font-size: 0.86rem;
}

.billing-wrap {
  margin-top: 14px;
}

.billing-grid {
  margin-top: 10px;
  display: grid;
  gap: 12px;
}

.billing-card {
  border: 1px solid #cdd9ea;
  border-radius: 16px;
  background: linear-gradient(180deg, #ffffff, #f4f8ff);
  padding: 16px;
  box-shadow: 0 10px 24px rgba(24, 52, 87, 0.09);
}

.billing-card.featured {
  border-color: #8db3df;
  background: linear-gradient(180deg, #f3f8ff, #ebf3ff);
  box-shadow: 0 14px 32px rgba(31, 82, 144, 0.15);
}

.billing-tag {
  margin: 0;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 800;
  color: #2f639a;
}

.billing-card h4 {
  margin: 8px 0 0;
  font-size: 1.5rem;
  letter-spacing: -0.02em;
  color: #1c4f8b;
  font-family: "Fraunces", "Times New Roman", serif;
}

.billing-desc {
  margin: 8px 0 0;
  color: #4b6080;
  font-size: 0.92rem;
  max-width: 62ch;
}

.billing-list {
  margin: 12px 0 0;
  padding-left: 18px;
  color: #4b6080;
  display: grid;
  gap: 6px;
  font-size: 0.9rem;
}

.panel {
  border: 1px solid rgba(174, 194, 220, 0.82);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  animation: rise-in 420ms cubic-bezier(0.2, 0.65, 0.2, 1);
}

.form-panel {
  padding: 18px;
  max-height: calc(100vh - 128px);
  overflow: auto;
  width: 100%;
}

.preview-panel {
  padding: 20px;
  width: 100%;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.section-head-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.draft-status {
  font-size: 0.82rem;
  font-weight: 800;
  color: #567091;
}

.section-head h2 {
  margin: 0;
  font-family: "Fraunces", "Times New Roman", serif;
  letter-spacing: -0.02em;
  font-size: 1.45rem;
}

.section-head h3 {
  margin: 0;
  font-size: 1rem;
  letter-spacing: 0.01em;
}

.tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: #20446d;
  border: 1px solid #bdd0e9;
  background: linear-gradient(180deg, #eef4ff, #e6f1ff);
}

.tag-neutral {
  color: #2a3f5e;
  border-color: #cad7ea;
  background: linear-gradient(180deg, #f6f9ff, #eef3fb);
}

.preview-head-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.doc-switch {
  display: inline-flex;
  align-items: center;
  border: 1px solid #bfd0e8;
  border-radius: 999px;
  background: #f4f8ff;
  padding: 3px;
  gap: 2px;
}

.doc-switch-btn {
  border: 0;
  background: transparent;
  color: #2a4d79;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 6px 10px;
  border-radius: 999px;
  cursor: pointer;
}

.doc-switch-btn.active {
  background: #1f5aa8;
  color: #fff;
}

.form-section {
  margin-top: 15px;
  padding-top: 15px;
  border-top: 1px solid #e5ebf4;
}

.form-section h3 {
  margin: 0 0 10px;
  font-size: 1rem;
  color: #1b2e49;
}

.section-note {
  margin: -2px 0 10px;
  color: #5f7494;
  font-size: 0.86rem;
}

.form-start-mode {
  border-top: 0;
  margin-top: 12px;
  padding-top: 2px;
}

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

.start-mode-btn {
  text-align: left;
  border: 1px solid #c9d7ea;
  border-radius: 12px;
  background: linear-gradient(180deg, #fcfeff, #f4f9ff);
  padding: 12px;
  display: grid;
  gap: 5px;
  cursor: pointer;
}

.start-mode-btn strong {
  font-size: 0.9rem;
  color: #17365f;
}

.start-mode-btn span {
  color: #5a7091;
  font-size: 0.8rem;
}

.start-mode-btn.active {
  border-color: #2f67b0;
  background: linear-gradient(180deg, #ecf4ff, #e4efff);
  box-shadow: inset 0 0 0 1px rgba(47, 103, 176, 0.25);
}

label {
  display: grid;
  gap: 6px;
  font-size: 0.86rem;
  font-weight: 600;
  color: #2b3d59;
}

.field-help {
  font-size: 0.78rem;
  font-weight: 700;
  color: #5a7091;
}

input,
textarea {
  width: 100%;
  border-radius: var(--radius-sm);
  border: 1px solid #c9d5e6;
  background: linear-gradient(180deg, #ffffff, #fbfdff);
  color: #112036;
  font: inherit;
  font-weight: 500;
  padding: 11px 12px;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

input:focus,
textarea:focus {
  outline: none;
  border-color: #84a7de;
  box-shadow: 0 0 0 3px rgba(61, 113, 181, 0.18);
  transform: translateY(-1px);
}

input:disabled {
  color: #3e5576;
  background: #f0f5ff;
}

.input-action-wrap {
  position: relative;
  display: grid;
}

.input-action-wrap input {
  padding-right: 86px;
}

.input-action-btn {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  border: 1px solid #c8d7eb;
  border-radius: 999px;
  background: rgba(246, 250, 255, 0.95);
  color: #1a355d;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  padding: 7px 10px;
  cursor: pointer;
  transition: background-color 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.input-action-btn:hover {
  background: #eef5ff;
  border-color: #b6c8e2;
  transform: translateY(calc(-50% - 1px));
}

.input-action-btn:active {
  transform: translateY(-50%);
}

.input-action-btn:focus-visible {
  outline: 3px solid rgba(61, 113, 181, 0.22);
  outline-offset: 2px;
}

textarea {
  resize: vertical;
  line-height: 1.45;
}

.photo-upload {
  margin-top: 12px;
  border: 1px dashed #bfd0e8;
  border-radius: 13px;
  background: linear-gradient(180deg, #fbfdff, #f2f7ff);
  padding: 12px;
  display: grid;
  gap: 9px;
}

.photo-upload-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.photo-status {
  font-size: 0.8rem;
  font-weight: 700;
  color: #35567f;
}

.photo-thumb {
  width: 92px;
  height: 92px;
  border-radius: 14px;
  object-fit: cover;
  border: 1px solid #b9cbe5;
  box-shadow: 0 8px 20px rgba(23, 62, 110, 0.16);
}

.signature-pad-wrap {
  margin-top: 10px;
  border: 1px dashed #bfd1e8;
  border-radius: 12px;
  background: linear-gradient(180deg, #fbfdff, #f1f7ff);
  padding: 10px;
  display: grid;
  gap: 8px;
}

.signature-canvas {
  width: 100%;
  height: 150px;
  border-radius: 10px;
  border: 1px solid #c8d7ea;
  background: #fff;
  touch-action: none;
  cursor: crosshair;
}

.signature-pad-actions {
  display: flex;
  justify-content: flex-end;
}

.grid {
  display: grid;
  gap: 10px;
}

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

.button-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.btn {
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  transition: transform 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
  touch-action: manipulation;
}

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

.btn:active {
  transform: translateY(0);
}

.btn.small {
  font-size: 0.8rem;
  padding: 7px 11px;
  min-height: 36px;
}

.btn.primary {
  background: linear-gradient(180deg, #2667bb, #1f5498);
  color: #fff;
  box-shadow: 0 8px 20px rgba(30, 76, 140, 0.22);
}

.btn.primary:hover {
  background: linear-gradient(180deg, #235ba6, #1c497f);
}

.btn.secondary {
  background: linear-gradient(180deg, #17856d, #126d59);
  color: #fff;
  box-shadow: 0 8px 18px rgba(20, 97, 80, 0.2);
}

.btn.secondary:hover {
  background: linear-gradient(180deg, #157960, #105f4d);
}

.btn.ghost {
  background: linear-gradient(180deg, #fdfefe, #f5f9ff);
  border-color: #c8d7eb;
  color: #1a355d;
}

.btn.ghost:hover {
  background: #eef5ff;
}

.btn.danger {
  background: #a8323b;
  color: #fff;
}

.btn:disabled {
  opacity: 0.6;
  transform: none;
  cursor: not-allowed;
  box-shadow: none;
}

.publish-result {
  margin-top: 12px;
  border-radius: var(--radius-md);
  border: 1px solid #cfdaea;
  background: #f3f7ff;
  padding: 12px;
  font-size: 0.91rem;
}

.publish-result h4,
.publish-result p {
  margin: 0 0 7px;
}

.publish-result p:last-child {
  margin-bottom: 0;
}

.publish-result .muted {
  color: #5c728f;
  font-size: 0.86rem;
}

.error-details {
  margin-top: 10px;
  border: 1px solid #d5deeb;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.75);
  padding: 10px 12px;
}

.error-details summary {
  cursor: pointer;
  font-weight: 800;
  color: #1b2e49;
  outline: none;
}

.error-details pre {
  margin: 10px 0 0;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 0.82rem;
  line-height: 1.35;
  color: #22324a;
}

.publish-result.success {
  border-color: #b9ddca;
  background: #edf9f2;
}

.publish-result.error {
  border-color: #ebc2c5;
  background: #fff2f3;
}

.publish-result.info {
  border-color: #c6d6eb;
  background: #eff5ff;
}

.auth-box {
  border-radius: var(--radius-md);
  border: 1px solid #d5deeb;
  background: rgba(245, 250, 255, 0.82);
  padding: 12px;
}

.auth-form {
  display: grid;
  gap: 12px;
}

.auth-line {
  margin: 0;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.92rem;
  color: #1b2e49;
}

.auth-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #2a4d79;
  border: 1px solid #bdd0e9;
  background: rgba(238, 245, 255, 0.82);
}

.auth-pill:empty {
  display: none;
}

.auth-message {
  margin-top: 10px;
  font-size: 0.88rem;
  color: #5c728f;
}

.header-account .auth-message {
  margin-top: 4px;
  flex: 0 0 100%;
  text-align: right;
  font-size: 0.82rem;
  font-weight: 700;
  color: #2a4d79;
}

.header-account .auth-message:empty {
  display: none;
}

.auth-message.success {
  color: #0e6b4e;
}

.auth-message.error {
  color: #8a2d32;
}

.auth-message.info {
  color: #2a4d79;
}

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

.template-card {
  position: relative;
  overflow: hidden;
  text-align: left;
  border: 1px solid #ccdaee;
  border-radius: 13px;
  background: linear-gradient(140deg, #ffffff 0%, #f4f8ff 100%);
  padding: 11px 12px;
  display: grid;
  gap: 4px;
  cursor: pointer;
  transition: transform 170ms ease, border-color 170ms ease, box-shadow 170ms ease;
  min-height: 96px;
}

.template-card[data-template-locked="1"] {
  opacity: 0.72;
  filter: saturate(0.85);
  border-style: dashed;
}

.template-card[data-template-locked="1"]::before {
  content: "Upgrade";
  position: absolute;
  left: 12px;
  top: 10px;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(23, 54, 95, 0.92);
  color: #fff;
  font-weight: 800;
  font-size: 0.72rem;
  letter-spacing: 0.02em;
  z-index: 2;
}

.template-card::after {
  content: "";
  position: absolute;
  right: -20px;
  top: -30px;
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(81, 132, 214, 0.23) 0%, rgba(81, 132, 214, 0) 72%);
}

.template-card strong {
  position: relative;
  font-size: 0.92rem;
  z-index: 1;
}

.template-card span {
  position: relative;
  z-index: 1;
  font-size: 0.8rem;
  color: #5a6e8f;
}

.template-card:hover {
  transform: translateY(-1px);
  border-color: #93b4de;
}

.template-card[data-template-locked="1"]:hover {
  transform: none;
  border-color: #ccdaee;
  box-shadow: none;
}

.template-card.active {
  border-color: #2f67b0;
  box-shadow: inset 0 0 0 1px rgba(47, 103, 176, 0.36), 0 10px 18px rgba(42, 87, 155, 0.13);
  background: linear-gradient(140deg, #eef4ff, #e8f1ff);
}

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

.editor-item {
  border-radius: var(--radius-md);
  border: 1px solid #d3dfef;
  background: linear-gradient(180deg, #fdfefe, #f4f8ff);
  padding: 11px;
  display: grid;
  gap: 8px;
}

.preview-panel .section-head {
  margin-bottom: 12px;
}

.preview-frame {
  border: 1px solid #c8d8ec;
  border-radius: var(--radius-lg);
  padding: 22px;
  background:
    radial-gradient(900px 260px at 20% -12%, rgba(44, 98, 178, 0.12) 0%, rgba(44, 98, 178, 0) 58%),
    linear-gradient(180deg, #f8fbff, #eef3fb);
  min-height: calc(100vh - 218px);
  max-height: calc(100vh - 218px);
  overflow: auto;
}

.paper-wrap {
  width: min(860px, 100%);
  margin: 0 auto;
  background: #ffffff;
  border-radius: 14px;
  border: 1px solid #d5dfed;
  box-shadow: var(--shadow-strong);
  overflow: hidden;
}

.cover-letter {
  --letter-accent: #2a5f98;
  padding: 34px 34px 38px;
  color: #1d2d43;
  border-top: 8px solid var(--letter-accent);
  font-family: "Source Serif 4", "Times New Roman", serif;
  min-height: 980px;
}

.letter-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid #d5e0ee;
  margin-bottom: 16px;
}

.letter-profile h1 {
  margin: 0;
  font-family: "Manrope", "Segoe UI", sans-serif;
  font-size: 1.55rem;
  letter-spacing: -0.02em;
}

.letter-profile p {
  margin: 6px 0 0;
  color: #59718f;
  font-family: "Manrope", "Segoe UI", sans-serif;
  font-size: 0.86rem;
}

.letter-photo {
  width: 86px;
  height: 86px;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid #bfd0e7;
}

.letter-body {
  font-size: 1rem;
  line-height: 1.6;
}

.letter-date,
.letter-to,
.letter-greeting,
.letter-signoff,
.letter-signature {
  margin: 0 0 14px;
}

.letter-date {
  color: #4f6788;
  font-family: "Manrope", "Segoe UI", sans-serif;
  font-size: 0.9rem;
}

.letter-to {
  color: #2a3f5e;
}

.letter-meta {
  margin: 0 0 14px;
  padding: 10px 12px;
  border: 1px solid #d8e2f0;
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(247, 250, 255, 0.92), rgba(240, 246, 255, 0.88));
  font-family: "Manrope", "Segoe UI", sans-serif;
}

.letter-meta-line {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 10px;
  align-items: baseline;
  margin: 0;
  font-size: 0.9rem;
  color: #294565;
}

.letter-meta-line span {
  color: #5a7395;
  font-weight: 700;
}

.letter-meta-line strong {
  color: #1b385f;
  font-weight: 800;
}

.letter-attachments {
  margin: 12px 0 14px;
  padding: 10px 12px;
  border: 1px solid #d8e2f0;
  border-radius: 12px;
  background: rgba(248, 251, 255, 0.9);
}

.letter-attachments-title {
  margin: 0 0 8px;
  color: #2a3f5e;
  font-weight: 700;
}

.letter-attachments-list {
  margin: 0;
  padding-left: 18px;
  color: #1d2d43;
}

.letter-attachments-list li {
  margin: 0 0 6px;
}

.letter-signoff {
  margin-top: 18px;
  margin-bottom: 6px;
}

.letter-sign-block {
  margin-left: auto;
  width: min(260px, 100%);
  text-align: right;
}

.letter-sign-image {
  width: 170px;
  max-width: 100%;
  height: auto;
  margin: 0 0 6px auto;
  object-fit: contain;
  display: block;
}

.letter-signature {
  font-family: "Manrope", "Segoe UI", sans-serif;
  font-size: 1.04rem;
  font-weight: 800;
  color: #1b385f;
}

.letter-modern,
.letter-skyline {
  --letter-accent: #2d5f98;
}

.letter-minimal,
.letter-nordic {
  --letter-accent: #355f92;
}

.letter-executive,
.letter-charcoal,
.letter-mono {
  --letter-accent: #263344;
}

.letter-timeline,
.letter-oceanic {
  --letter-accent: #1f6f88;
}

.letter-creative,
.letter-terracotta {
  --letter-accent: #b15338;
}

.letter-luxe {
  --letter-accent: #8b6e36;
}

.cv-template {
  padding: 32px;
  color: #1b293d;
  font-family: "Source Serif 4", "Times New Roman", serif;
}

.cv-template h1,
.cv-template h2,
.cv-template h3,
.cv-template h4,
.cv-template p {
  margin: 0;
}

.cv-template h1,
.cv-template h4 {
  font-family: "Manrope", "Segoe UI", sans-serif;
}

.cv-template p,
.cv-template li,
.cv-template span {
  line-height: 1.45;
}

.cv-template .cv-head {
  margin-bottom: 20px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
}

.cv-template .cv-head > div {
  min-width: 0;
}

.cv-template .headline {
  margin-top: 7px;
  font-family: "Manrope", "Segoe UI", sans-serif;
  font-size: 1.02rem;
  letter-spacing: 0.01em;
}

.cv-template .contact-line {
  margin-top: 8px;
  font-family: "Manrope", "Segoe UI", sans-serif;
  color: #586f91;
  font-size: 0.82rem;
}

.cv-template .cv-grid {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 22px;
}

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

.cv-template .cv-section {
  margin-bottom: 16px;
}

.cv-template .cv-section h3 {
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  font-family: "Manrope", "Segoe UI", sans-serif;
  font-size: 0.79rem;
  font-weight: 800;
}

.cv-template .item-block {
  margin-bottom: 12px;
  break-inside: avoid;
}

.cv-template .item-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 5px;
}

.cv-template .item-head h4 {
  font-size: 0.98rem;
  line-height: 1.3;
}

.cv-template .item-head span {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.74rem;
}

.cv-template .item-sub {
  margin-bottom: 4px;
  color: #5a6f8f;
  font-family: "Manrope", "Segoe UI", sans-serif;
  font-size: 0.85rem;
}

.plain-list {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 5px;
}

.chip-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.chip {
  border-radius: 999px;
  border: 1px solid #cad7ea;
  background: #f0f5fd;
  color: #243c61;
  padding: 4px 10px;
  font-family: "Manrope", "Segoe UI", sans-serif;
  font-size: 0.75rem;
  font-weight: 700;
}

.chip.soft {
  border-color: #cbe0d7;
  background: #edf7f2;
  color: #2a5a4c;
}

.cv-avatar {
  width: 96px;
  height: 96px;
  border-radius: 14px;
  border: 2px solid rgba(45, 85, 133, 0.22);
  overflow: hidden;
  margin: 0;
  flex: 0 0 auto;
}

.cv-avatar img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.avatar-round {
  border-radius: 50%;
}

.avatar-square {
  border-radius: 12px;
}

.avatar-mono {
  border-radius: 0;
  border-color: #111;
}

.tpl-modern .cv-head {
  background: linear-gradient(122deg, #1f3b67 0%, #265a8d 55%, #2f786f 100%);
  color: #ffffff;
  border-radius: 14px;
  padding: 20px 20px 22px;
}

.tpl-modern .headline {
  color: #dce9ff;
}

.tpl-modern .cv-section h3 {
  color: #254a80;
}

.tpl-minimal {
  font-family: "Source Serif 4", serif;
}

.tpl-minimal .cv-head {
  border-bottom: 1px solid #d1dae8;
  padding-bottom: 12px;
}

.tpl-minimal .mini-contact {
  margin-top: 10px;
  font-family: "Manrope", sans-serif;
  color: #586a85;
  font-size: 0.88rem;
}

.tpl-minimal .cv-grid {
  grid-template-columns: 1fr;
}

.tpl-minimal .cv-section h3 {
  color: #24466f;
}

.tpl-executive {
  font-family: "Manrope", sans-serif;
}

.tpl-executive .cv-head {
  border-radius: 13px;
  padding: 17px;
  color: #ffffff;
  background: linear-gradient(132deg, #101927, #1d3556 55%, #22516f 100%);
}

.tpl-executive .headline {
  color: #c8d7f3;
}

.tpl-executive .inline-list {
  margin-top: 12px;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 4px;
}

.tpl-executive .inline-list li {
  color: #e2ebfc;
  font-size: 0.84rem;
}

.tpl-executive .name-stack .cv-avatar {
  margin-top: 10px;
  border-color: rgba(255, 255, 255, 0.45);
}

.tpl-executive .cv-section h3 {
  color: #20446e;
}

.tpl-timeline .cv-head {
  border-left: 7px solid #2d5fb0;
  padding-left: 14px;
}

.tpl-timeline .timeline {
  border-left: 2px solid #bfd0ea;
  margin-left: 8px;
  padding-left: 16px;
  display: grid;
  gap: 13px;
}

.tpl-timeline .time-item {
  position: relative;
}

.tpl-timeline .time-item::before {
  content: "";
  position: absolute;
  left: -22px;
  top: 5px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #2d5fb0;
  box-shadow: 0 0 0 3px rgba(45, 95, 176, 0.19);
}

.tpl-timeline .time-range {
  margin-bottom: 4px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.74rem;
  color: #2a5ba8;
}

.tpl-creative {
  font-family: "Manrope", sans-serif;
}

.tpl-creative .cv-head {
  border-radius: 16px;
  padding: 20px;
  color: #ffffff;
  background: linear-gradient(125deg, #b44f2a, #c6502e 40%, #a31f4d 100%);
}

.tpl-creative .kicker {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.68rem;
  opacity: 0.9;
}

.tpl-creative .headline {
  color: #fee6dc;
}

.tpl-creative .cv-section h3 {
  color: #913a2b;
}

.tpl-mono {
  font-family: "IBM Plex Mono", monospace;
}

.tpl-mono .cv-head {
  border: 2px solid #141414;
  padding: 14px;
}

.tpl-mono .headline {
  color: #222;
}

.tpl-mono .mono-summary {
  margin-bottom: 14px;
  border-left: 3px solid #0f0f0f;
  padding-left: 10px;
}

.tpl-mono .cv-section h3 {
  color: #111;
}

.tpl-mono .chip {
  font-family: "IBM Plex Mono", monospace;
}

.tpl-mono .cv-avatar {
  border-color: #111;
}

.tpl-nordic {
  font-family: "Manrope", sans-serif;
}

.tpl-nordic .cv-head {
  border-bottom: 1px solid #d4e1f2;
  padding-bottom: 12px;
}

.tpl-nordic .headline {
  color: #27538b;
}

.tpl-nordic .cv-section h3 {
  color: #2a5387;
}

.tpl-nordic .chip {
  background: #eaf2ff;
  border-color: #bfd3f0;
}

.tpl-skyline {
  font-family: "Manrope", sans-serif;
}

.tpl-skyline .cv-head {
  border-radius: 14px;
  padding: 18px;
  color: #fff;
  background: linear-gradient(130deg, #1e2f4f, #2b4b79 58%, #3f7898 100%);
}

.tpl-skyline .headline {
  color: #d9e6ff;
}

.tpl-skyline .cv-aside {
  background: #f4f8ff;
  border-radius: 12px;
  padding: 12px;
}

.tpl-skyline .cv-section h3 {
  color: #2e557f;
}

.tpl-terracotta {
  font-family: "Source Serif 4", serif;
}

.tpl-terracotta .cv-head {
  border-top: 6px solid #b85a3d;
  background: linear-gradient(180deg, #fff8f5, #fff);
  border-radius: 12px;
  padding: 14px;
}

.tpl-terracotta .kicker {
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #9f4d36;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.68rem;
}

.tpl-terracotta .headline {
  color: #8f4d3a;
}

.tpl-terracotta .cv-section h3 {
  color: #9f4f3c;
}

.tpl-charcoal {
  font-family: "Manrope", sans-serif;
}

.tpl-charcoal .cv-head {
  border-bottom: 3px solid #1f2734;
  padding-bottom: 12px;
}

.tpl-charcoal .headline {
  color: #2c3a4f;
}

.tpl-charcoal .cv-section h3 {
  color: #2b3648;
}

.tpl-charcoal .chip {
  background: #f2f4f8;
  border-color: #d3d9e2;
  color: #2b3443;
}

.tpl-oceanic {
  font-family: "Manrope", sans-serif;
}

.tpl-oceanic .cv-head {
  border-radius: 14px;
  padding: 16px;
  background: linear-gradient(125deg, #0f4f6b, #1c6b86 48%, #2f8e98 100%);
  color: #fff;
}

.tpl-oceanic .headline {
  color: #d6f2ff;
}

.tpl-oceanic .cv-main {
  padding-right: 4px;
}

.tpl-oceanic .cv-aside {
  border-left: 1px solid #cce0ea;
  padding-left: 12px;
}

.tpl-oceanic .cv-section h3 {
  color: #25607d;
}

.tpl-luxe {
  font-family: "Source Serif 4", serif;
}

.tpl-luxe .cv-head {
  border: 1px solid #d9c79f;
  background: linear-gradient(180deg, #fffdf6, #fff9e8);
  border-radius: 12px;
  padding: 14px;
}

.tpl-luxe .kicker {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #8f7740;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.66rem;
}

.tpl-luxe .headline {
  color: #745f34;
}

.tpl-luxe .contact-line {
  color: #6c5a35;
}

.tpl-luxe .cv-section h3 {
  color: #7d6839;
}

.tpl-luxe .chip {
  border-color: #d8c693;
  background: #fcf7e5;
  color: #5c4e2f;
}

.public-page {
  padding: 20px;
}

.public-wrapper {
  max-width: 1020px;
  margin: 0 auto;
  width: 100%;
}

.public-app.loading-state {
  padding: 18px;
  border: 1px solid #cad7ea;
  border-radius: var(--radius-md);
  background: #ffffff;
}

.public-toolbar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.public-note {
  margin-top: 12px;
  font-size: 0.82rem;
  color: #4f6486;
}

.error-card {
  max-width: 560px;
  border-radius: var(--radius-md);
  border: 1px solid #e8c8ca;
  background: #fff;
  box-shadow: var(--shadow-soft);
  padding: 18px;
  display: grid;
  gap: 10px;
}

.error-card h1 {
  margin: 0;
  font-family: "Fraunces", serif;
}

.print-body {
  background: #fff;
}

.print-main {
  width: 100%;
}

.no-print {
  display: initial;
}

@keyframes rise-in {
  0% {
    opacity: 0;
    transform: translateY(8px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1180px) {
  .builder-layout {
    grid-template-columns: 1fr;
  }

  .form-panel {
    max-height: none;
    overflow: visible;
  }

  .preview-frame {
    min-height: 560px;
    max-height: none;
  }
}

@media (max-width: 980px) {
  .template-picker {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .site-header {
    padding: 20px 12px 8px;
  }

  .header-content {
    padding: 18px;
  }

  .header-content::after {
    position: static;
    display: inline-flex;
    margin-top: 10px;
  }

  .builder-layout {
    padding: 10px 12px 18px;
    gap: 12px;
  }

  .account-layout {
    padding: 10px 12px 26px;
  }

  .account-panel {
    padding: 14px;
  }

  .form-panel,
  .preview-panel {
    padding: 14px;
  }

  .preview-frame {
    padding: 12px;
    border-radius: 14px;
    min-height: 420px;
  }

  .paper-wrap {
    border-radius: 11px;
  }

  .cover-letter {
    min-height: 0;
    padding: 22px;
  }

  .letter-top {
    flex-wrap: wrap;
  }

  .letter-photo {
    width: 74px;
    height: 74px;
  }

  .letter-sign-block {
    width: min(220px, 100%);
  }

  .letter-sign-image {
    width: 150px;
  }

  .two-col,
  .start-mode-grid,
  .template-picker,
  .cv-template .cv-grid,
  .cv-template .cv-grid.compact {
    grid-template-columns: 1fr;
  }

  .cv-template {
    padding: 20px;
  }

  .cv-template .item-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .cv-template .cv-head {
    flex-wrap: wrap;
  }

  .cv-avatar {
    width: 84px;
    height: 84px;
  }

  .button-row .btn {
    flex: 1 1 calc(50% - 8px);
  }

  .public-toolbar {
    flex-wrap: wrap;
    justify-content: stretch;
  }

  .public-toolbar .btn {
    flex: 1 1 calc(50% - 8px);
  }

  .public-toolbar .doc-switch {
    width: 100%;
    justify-content: center;
  }

  .photo-upload-meta {
    align-items: flex-start;
  }

  .cv-template .contact-line,
  .cv-template .item-sub {
    word-break: break-word;
  }
}

@media (max-width: 520px) {
  .site-header {
    padding: 12px 10px 6px;
  }

  .header-content {
    padding: 14px;
  }

  .header-actions .btn {
    flex: 1 1 100%;
    width: 100%;
  }

  .builder-layout {
    padding: 8px 10px 16px;
  }

  .account-layout {
    padding: 8px 10px 22px;
  }

  .account-panel {
    padding: 12px;
  }

  .form-panel,
  .preview-panel {
    padding: 12px;
  }

  .button-row .btn,
  .public-toolbar .btn {
    flex: 1 1 100%;
    width: 100%;
  }

  .section-head h2 {
    font-size: 1.2rem;
  }

  .tag {
    max-width: 100%;
  }

  .photo-upload-meta {
    gap: 8px;
  }

  .photo-thumb {
    width: 76px;
    height: 76px;
  }

  .cover-letter {
    padding: 16px;
  }

  .letter-profile h1 {
    font-size: 1.25rem;
  }

  .signature-canvas {
    height: 130px;
  }

  .letter-sign-block {
    width: min(190px, 100%);
  }

  .letter-sign-image {
    width: 130px;
  }
}

@media (hover: none) {
  .btn:hover,
  .template-card:hover {
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}

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

  * {
    animation: none !important;
    box-shadow: none !important;
  }

  body {
    background: #fff !important;
  }

  body::before {
    display: none !important;
  }

  .no-print {
    display: none !important;
  }

  /* When printing from the builder page, only print the preview document. */
  .builder-layout {
    display: block !important;
    padding: 0 !important;
  }

  .site-header,
  .form-panel,
  .preview-panel .section-head {
    display: none !important;
  }

  .preview-panel {
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
  }

  .preview-frame {
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow: visible !important;
  }

  /* Demo/free: block PDF output (including browser menu print) with a paywall notice. */
  body[data-access="demo"] .paper-wrap,
  body[data-access="free"] .paper-wrap {
    display: none !important;
  }

  body[data-access="demo"] .preview-frame::before,
  body[data-access="free"] .preview-frame::before {
    content: "Mode Demo/Gratis\\AUpgrade untuk download PDF\\A\\Acv-online-builder-andri14.vercel.app/akun";
    display: block;
    white-space: pre-line;
    border: 2px dashed #c6d6eb;
    border-radius: 10px;
    padding: 18mm 14mm;
    font-family: "Manrope", "Segoe UI", sans-serif;
    font-weight: 800;
    font-size: 18pt;
    line-height: 1.25;
    color: #1b385f;
  }

  .paper-wrap {
    width: auto;
    max-width: none;
    border: 0;
    border-radius: 0;
  }

  .cv-template {
    padding: 0;
  }

  .cv-template .cv-section,
  .cv-template .item-block {
    break-inside: avoid;
    page-break-inside: avoid;
  }
}
