:root {
  --bg: #f6f2ec;
  --paper: rgba(255, 255, 255, 0.78);
  --paper-strong: #ffffff;
  --text: #1f1b18;
  --muted: #6f655d;
  --line: rgba(110, 96, 86, 0.14);
  --accent: #b66d48;
  --accent-soft: rgba(182, 109, 72, 0.12);
  --accent-2: #284b63;
  --shadow: 0 18px 60px rgba(48, 32, 18, 0.08);
  --radius: 22px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: Inter, system-ui, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(182, 109, 72, 0.12), transparent 30%),
    radial-gradient(circle at right 20%, rgba(40, 75, 99, 0.12), transparent 24%),
    var(--bg);
}

.shell {
  max-width: 1480px;
  margin: 0 auto;
  padding: 28px;
  display: grid;
  grid-template-columns: 390px minmax(0, 1fr);
  gap: 24px;
  min-height: 100vh;
}

.card {
  background: var(--paper);
  backdrop-filter: blur(20px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.sidebar {
  padding: 26px;
  position: sticky;
  top: 24px;
  height: calc(100vh - 56px);
  overflow: auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}

.brand-mark {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  font-family: "Playfair Display", serif;
  font-size: 30px;
  color: white;
  background: linear-gradient(140deg, var(--accent), #d39a79);
  box-shadow: 0 14px 34px rgba(182, 109, 72, 0.28);
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 1.8px;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  margin: 0 0 6px;
}

h1, h2, h3 { margin: 0; }
h1 {
  font-family: "Playfair Display", serif;
  font-size: 30px;
  line-height: 1.02;
}

h2 {
  font-family: "Playfair Display", serif;
  font-size: 32px;
}

h3 {
  font-size: 21px;
  line-height: 1.2;
}

.intro,
.muted,
.sidebar-note,
.rendered-output,
.control,
textarea,
input,
button {
  font-size: 15px;
  line-height: 1.55;
}

.intro {
  color: var(--muted);
  margin-bottom: 22px;
}

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

.control {
  width: 100%;
  border: 1px solid rgba(83, 69, 58, 0.13);
  background: rgba(255, 255, 255, 0.82);
  border-radius: 16px;
  padding: 14px 16px;
  color: var(--text);
  outline: none;
}

.control:focus {
  border-color: rgba(182, 109, 72, 0.45);
  box-shadow: 0 0 0 4px rgba(182, 109, 72, 0.12);
}

.textarea {
  min-height: 280px;
  resize: vertical;
}

.button-row,
.hero-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.button {
  appearance: none;
  border: 0;
  border-radius: 999px;
  padding: 12px 18px;
  background: linear-gradient(140deg, var(--accent), #c98a66);
  color: white;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 12px 28px rgba(182, 109, 72, 0.22);
}

.button:hover { transform: translateY(-1px); }
.button-ghost {
  background: rgba(255, 255, 255, 0.82);
  color: var(--text);
  border: 1px solid var(--line);
  box-shadow: none;
}

.sidebar-note {
  margin-top: 18px;
  color: var(--muted);
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.56);
  border: 1px dashed rgba(83, 69, 58, 0.16);
}

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

.hero {
  padding: 24px 26px;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
}

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

.insights-grid .card,
.preview {
  padding: 22px 24px;
}

.chips {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 8px 12px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
}

.chips.empty { color: var(--muted); }

.preview-header {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: end;
  margin-bottom: 20px;
}

.preview {
  background: linear-gradient(180deg, rgba(255,255,255,0.9), rgba(255,255,255,0.82));
}

.rendered-output {
  background: var(--paper-strong);
  border: 1px solid rgba(83, 69, 58, 0.1);
  border-radius: 20px;
  padding: 28px;
}

.placeholder {
  min-height: 380px;
  display: grid;
  place-content: center;
  text-align: center;
  color: var(--muted);
}

.doc-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
  margin-bottom: 18px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(83, 69, 58, 0.12);
}

.doc-name {
  font-family: "Playfair Display", serif;
  font-size: 30px;
  margin-bottom: 5px;
}

.doc-role {
  font-size: 16px;
  font-weight: 700;
}

.doc-contact {
  color: var(--muted);
  text-align: right;
}

.doc-section {
  margin-top: 22px;
}

.doc-section h4 {
  margin: 0 0 10px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--muted);
}

.doc-section p { margin: 0 0 10px; }
.doc-section ul { margin: 0; padding-left: 18px; }
.doc-section li { margin-bottom: 7px; }

.experience-item {
  margin-top: 16px;
}

.experience-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: baseline;
  margin-bottom: 6px;
}

.experience-title { font-weight: 800; }
.experience-meta { color: var(--muted); white-space: nowrap; }
.experience-company { color: #3c342f; margin-bottom: 8px; }
.cover-note {
  padding: 16px 18px;
  background: rgba(40, 75, 99, 0.06);
  border-radius: 16px;
  border: 1px solid rgba(40, 75, 99, 0.1);
}

.inline-actions {
  margin-top: 18px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

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

  .sidebar {
    position: static;
    height: auto;
  }

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

@media print {
  body {
    background: white;
  }

  .sidebar,
  .hero,
  .insights-grid,
  .inline-actions {
    display: none !important;
  }

  .shell {
    display: block;
    max-width: none;
    padding: 0;
  }

  .main,
  .preview,
  .rendered-output {
    display: block;
    background: white;
    box-shadow: none;
    border: 0;
    padding: 0;
  }

  .rendered-output {
    font-size: 11pt;
  }
}
