:root {
  --page-bg: #eef2f6;
  --panel-bg: #ffffff;
  --text: #1e2a36;
  --muted: #5a6a79;
  --line: #d9e0e7;
  --accent: #1d5d9b;
  --shadow: 0 10px 28px rgba(0, 0, 0, 0.12);
  --a4-width-screen: 794px;
  --a4-height-screen: 1123px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", Tahoma, Arial, sans-serif;
  background: var(--page-bg);
  color: var(--text);
  line-height: 1.45;
}

.container {
  max-width: 1500px;
  margin: 0 auto;
  padding: 20px;
  display: grid;
  grid-template-columns: minmax(380px, 0.9fr) minmax(820px, 1.1fr);
  gap: 20px;
  align-items: start;
}

.panel {
  background: var(--panel-bg);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 0;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
  max-height: calc(100vh - 40px);
  overflow: auto;
  position: sticky;
  top: 20px;
}

h1 {
  margin: 0 0 6px;
  font-size: 1.55rem;
}

.hint {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 0.95rem;
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 4px 0 10px;
}

.meta-top {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.meta-main {
  min-width: 0;
  flex: 1 1 260px;
}

.meta-side {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-top: 2px;
  max-width: 180px;
  text-align: center;
}

.qr-code {
  width: 88px;
  height: 88px;
  object-fit: contain;
  border: 1px solid #cfd9e3;
  border-radius: 10px;
  background: #fff;
  padding: 6px;
}

.contribution {
  margin: 0;
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.25;
}

.meta-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 7px 11px;
  border: 1px solid #cfd9e3;
  border-radius: 999px;
  background: #f8fbfe;
  color: #2a3a4b;
  font-size: 0.84rem;
  font-weight: 600;
  text-decoration: none;
  cursor: default;
}

.meta-pill-link {
  cursor: pointer;
  transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease;
}

.meta-pill-link:hover,
.meta-pill-link:focus-visible {
  background: #eef5fb;
  border-color: #b8cde0;
  color: #143a60;
  outline: none;
}

.group-title {
  margin: 14px 0 8px;
  font-size: 1rem;
  color: #143a60;
}

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

label {
  display: block;
  font-size: 0.88rem;
  color: var(--muted);
  font-weight: 600;
}

input,
textarea,
button {
  font: inherit;
}

input,
textarea {
  width: 100%;
  margin-top: 5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 10px;
  color: var(--text);
  background: #fff;
}

input::placeholder,
textarea::placeholder {
  color: rgba(30, 42, 54, 0.26);
  opacity: 1;
}

input:focus::placeholder,
textarea:focus::placeholder {
  color: rgba(30, 42, 54, 0.18);
}

textarea {
  resize: vertical;
  min-height: 70px;
}

input:focus,
textarea:focus {
  outline: 2px solid #c5ddf6;
  border-color: #8eb9e0;
}

.entry-list {
  display: grid;
  gap: 10px;
  margin-bottom: 8px;
}

.entry-card {
  border: 1px dashed var(--line);
  border-radius: 9px;
  padding: 10px;
  background: #fcfdff;
}

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

.entry-header strong {
  font-size: 0.88rem;
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.btn {
  border: 0;
  border-radius: 8px;
  padding: 10px 14px;
  cursor: pointer;
  font-weight: 600;
}

.btn-add {
  background: #e8f1fb;
  color: #194f82;
}

.btn-remove {
  background: #fdebec;
  color: #8c2a30;
  padding: 6px 10px;
  font-size: 0.83rem;
}

.btn-download {
  background: #2a6f44;
  color: #fff;
}

.entry-header-end {
  justify-content: flex-end;
}

.tip {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.cv-paper {
  background: #fff;
  width: var(--a4-width-screen);
  max-width: 100%;
  margin: 0 auto;
  min-height: var(--a4-height-screen);
  padding: 14mm;
  box-shadow: 0 14px 34px rgba(10, 28, 46, 0.14);
  border: 1px solid #d6dce3;
  --cv-accent: var(--accent);
}

.cv-paper.font-modern-serif {
  font-family: Georgia, "Times New Roman", serif;
}

.cv-paper.font-clean-sans {
  font-family: "Segoe UI", Tahoma, Arial, sans-serif;
}

.cv-paper.font-classic-serif {
  font-family: Cambria, Georgia, "Times New Roman", serif;
}

.cv-paper.font-garamond {
  font-family: Garamond, "Times New Roman", serif;
}

.cv-paper.font-humanist-sans {
  font-family: Calibri, Candara, "Segoe UI", sans-serif;
}

.cv-paper.font-helvetica {
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
}

.cv-header h2 {
  margin: 0;
  font-size: 2rem;
  letter-spacing: 0.2px;
}

.cv-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid #cfd9e3;
}

.profile-photo {
  width: 30mm;
  height: 30mm;
  object-fit: cover;
  object-position: center;
  border: 1px solid #d5dde6;
  border-radius: 8px;
  flex: 0 0 auto;
}

.cv-header .title {
  margin: 4px 0 9px;
  color: var(--cv-accent);
  font-size: 1.05rem;
  font-weight: 600;
}

.cv-header .contact {
  margin: 0;
  color: var(--muted);
  white-space: pre-line;
}

.cv-section {
  margin-top: 12px;
}

.cv-header + .cv-section {
  margin-top: 8px;
}

.cv-section h3 {
  margin: 0 0 8px;
  font-size: 0.98rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--cv-accent);
  border-bottom: 1px solid #cfd9e3;
  padding-bottom: 4px;
}

.cv-section p {
  margin: 0;
  white-space: pre-line;
}

#cvSummary,
#cvDeclaration {
  text-align: justify;
  text-justify: inter-word;
  white-space: normal;
  line-height: 1.55;
}

.cv-item {
  margin-bottom: 9px;
}

.cv-item .head {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: baseline;
  gap: 2px 12px;
}

.cv-item .head strong {
  font-size: 0.98rem;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.cv-item .head span {
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 600;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  justify-self: end;
  text-align: right;
}

.cv-item .meta {
  margin: 2px 0;
  color: var(--muted);
  font-size: 0.92rem;
  font-variant-numeric: proportional-nums;
}

.cv-item ul,
.list-block {
  margin: 0;
  padding-left: 18px;
}

.hidden {
  display: none;
}

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

  .panel {
    position: static;
    max-height: none;
  }

  .cv-paper {
    margin: 0 auto;
  }
}

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

  .cv-paper {
    padding: 22px;
    min-height: auto;
  }
}

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

  body {
    background: #fff;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .panel {
    display: none;
  }

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

  .cv-paper {
    width: auto;
    max-width: none;
    box-shadow: none;
    border: none;
    margin: 0;
    padding: 0;
    min-height: auto;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .cv-header .title,
  .cv-section h3 {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}
