:root {
  --bg: #060b08;
  --bg-soft: #0d1511;
  --panel: rgba(14, 24, 19, 0.9);
  --panel-strong: rgba(17, 29, 23, 0.96);
  --line: rgba(190, 255, 77, 0.16);
  --line-strong: rgba(190, 255, 77, 0.35);
  --text: #edf5ef;
  --muted: #98a89d;
  --accent: #bfff4d;
  --accent-2: #64ff9d;
  --danger: #ff8e73;
  --shadow: 0 28px 80px rgba(0, 0, 0, 0.36);
  --radius: 28px;
  --sheet-radius: 30px;
  --font-sans: "Aptos", "Trebuchet MS", "Segoe UI Variable Text", sans-serif;
  --font-display: "Bahnschrift", "Aptos Display", "Arial Narrow", sans-serif;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: var(--font-sans);
  color: var(--text);
  background:
    radial-gradient(circle at 15% 15%, rgba(191, 255, 77, 0.14), transparent 24%),
    radial-gradient(circle at 85% 10%, rgba(100, 255, 157, 0.08), transparent 22%),
    linear-gradient(180deg, #050906 0%, #0a100d 55%, #090f0c 100%);
  position: relative;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 38px 38px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.7), transparent 90%);
  pointer-events: none;
  z-index: -3;
}

.page-noise,
.page-glow {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

.page-noise {
  background:
    linear-gradient(140deg, transparent 0 64%, rgba(191, 255, 77, 0.05) 64.5%, transparent 65%),
    linear-gradient(40deg, transparent 0 74%, rgba(100, 255, 157, 0.04) 74.5%, transparent 75%);
  background-size: 420px 420px, 320px 320px;
  opacity: 0.55;
  z-index: -2;
}

.page-glow {
  z-index: -1;
}

.glow-one {
  background: radial-gradient(circle at 10% 32%, rgba(191, 255, 77, 0.14), transparent 30%);
}

.glow-two {
  background: radial-gradient(circle at 85% 72%, rgba(100, 255, 157, 0.08), transparent 28%);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 28px;
  border-bottom: 1px solid var(--line);
  background: rgba(7, 13, 10, 0.76);
  backdrop-filter: blur(22px);
}

.brand-lockup,
.sheet-brand {
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand-logo,
.sheet-logo {
  display: block;
  width: auto;
  height: 40px;
}

.eyebrow,
.panel-kicker,
.group-label,
.section-title,
.sheet-badge,
.subtle-tag {
  font-family: var(--font-display);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.eyebrow,
.panel-kicker {
  font-size: 11px;
  color: var(--accent);
  font-weight: 700;
}

.brand-title,
.sheet-brand-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
}

.topbar-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

button,
input,
textarea {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

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

.primary-button,
.ghost-button,
.light-export-button,
.mini-button,
.danger-button {
  border-radius: 999px;
  padding: 12px 18px;
  font-weight: 700;
}

.primary-button {
  background: linear-gradient(135deg, var(--accent), #85d51a);
  color: #071008;
  box-shadow: 0 12px 28px rgba(191, 255, 77, 0.18);
}

.ghost-button,
.light-export-button,
.mini-button {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
  color: var(--text);
}

.light-export-button {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(236, 242, 237, 0.94));
  border-color: rgba(255, 255, 255, 0.42);
  color: #122018;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.16);
}

.danger-button {
  background: rgba(255, 142, 115, 0.09);
  border: 1px solid rgba(255, 142, 115, 0.28);
  color: #ffd7cb;
  padding: 10px 14px;
}

.wide-button {
  width: 100%;
  justify-content: center;
}

.app-shell {
  display: grid;
  grid-template-columns: minmax(360px, 460px) minmax(0, 1fr);
  gap: 22px;
  padding: 24px;
  align-items: start;
}

.control-column,
.preview-column {
  display: grid;
  gap: 18px;
}

.panel {
  background: linear-gradient(180deg, var(--panel), var(--panel-strong));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
}

.intro-panel h1,
.preview-toolbar h2,
.panel-heading h2 {
  margin: 10px 0 0;
  font-family: var(--font-display);
}

.intro-panel h1 {
  font-size: clamp(28px, 3vw, 40px);
  line-height: 1.02;
}

.intro-panel p,
.preview-toolbar p,
.helper-text,
.status-message {
  color: var(--muted);
  line-height: 1.6;
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.subtle-tag {
  display: inline-flex;
  align-items: center;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  background: rgba(191, 255, 77, 0.08);
}

.dropzone,
.field-grid label,
.editor-group,
.engagement-editor,
.list-editor-card,
.tag-editor-card {
  display: grid;
  gap: 8px;
}

.dropzone {
  padding: 18px;
  border-radius: 20px;
  border: 1px dashed var(--line-strong);
  background: rgba(255, 255, 255, 0.025);
}

.dropzone-label,
.field-grid span,
.editor-label {
  color: var(--muted);
  font-size: 13px;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.upload-inline-actions,
.photo-upload-inline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.upload-button-stack {
  display: grid;
  gap: 12px;
}

.photo-upload-copy {
  color: var(--muted);
  line-height: 1.5;
}

input[type="file"],
input[type="text"],
input[type="password"],
textarea {
  width: 100%;
  background: rgba(3, 6, 5, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  color: var(--text);
  padding: 13px 14px;
}

textarea {
  resize: vertical;
}

#structuredOutput {
  min-height: 340px;
  font-family: "Consolas", "Courier New", monospace;
  line-height: 1.55;
}

#specialProjectRequirements {
  min-height: 112px;
  line-height: 1.55;
}

.output-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 14px;
}

.requirements-matches {
  margin-top: 12px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.03);
}

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

.template-option {
  width: 100%;
  display: grid;
  gap: 4px;
  text-align: left;
  padding: 15px 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text);
}

.template-option strong {
  font-family: var(--font-display);
  font-size: 14px;
}

.template-option span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.template-option.is-active {
  border-color: var(--line-strong);
  background: linear-gradient(180deg, rgba(191, 255, 77, 0.14), rgba(255, 255, 255, 0.04));
  box-shadow: 0 12px 28px rgba(191, 255, 77, 0.08);
}

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

.status-metadata div {
  padding: 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.status-metadata dt {
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 6px;
}

.status-metadata dd {
  margin: 0;
  font-weight: 700;
}

.editor-stack {
  display: grid;
  gap: 16px;
}

.editor-group textarea {
  min-height: 116px;
}

.editor-group input,
.editor-group textarea {
  background: rgba(2, 5, 4, 0.64);
}

.editor-card-grid,
.engagement-editor-grid {
  display: grid;
  gap: 12px;
}

.list-editor-row,
.tag-editor-row,
.language-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.language-row {
  grid-template-columns: minmax(0, 1fr) 90px auto;
}

.engagement-editor textarea {
  min-height: 120px;
}

.editor-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.sheet-stage {
  display: grid;
  justify-items: center;
  padding-bottom: 36px;
}

.profile-sheet {
  position: relative;
  display: grid;
  grid-template-columns: 68mm 1fr;
  width: min(100%, 210mm);
  min-height: 297mm;
  overflow: hidden;
  border-radius: var(--sheet-radius);
  background:
    radial-gradient(circle at 20% 10%, rgba(191, 255, 77, 0.12), transparent 22%),
    linear-gradient(180deg, #0b110e 0%, #0e1511 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 38px 90px rgba(0, 0, 0, 0.45);
}

.profile-sidebar {
  position: relative;
  padding: 26px 20px 24px;
  background:
    linear-gradient(180deg, rgba(12, 18, 14, 0.97), rgba(8, 12, 10, 0.98)),
    radial-gradient(circle at top, rgba(191, 255, 77, 0.08), transparent 32%);
  border-right: 1px solid rgba(191, 255, 77, 0.12);
}

.sidebar-accent {
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
}

.profile-main {
  display: grid;
  gap: 14px;
  padding: 22px 24px 20px;
}

.photo-card,
.identity-card,
.sidebar-group,
.content-section,
.engagement-card,
.bullet-card {
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.028);
}

.photo-card,
.identity-card,
.sidebar-group {
  padding: 16px;
}

.photo-card {
  display: grid;
  justify-items: center;
  gap: 12px;
}

.photo-placeholder {
  width: 88px;
  height: 88px;
  display: grid;
  place-items: center;
  border-radius: 28px;
  background:
    linear-gradient(135deg, rgba(191, 255, 77, 0.24), rgba(100, 255, 157, 0.18)),
    #142019;
  border: 1px solid rgba(191, 255, 77, 0.34);
  color: var(--accent);
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 700;
}

.photo-placeholder.has-photo {
  padding: 0;
  overflow: hidden;
  color: transparent;
}

.candidate-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.photo-caption {
  text-align: center;
  color: var(--muted);
  font-size: 12px;
}

.identity-card {
  margin-top: 14px;
}

.identity-name {
  font-family: var(--font-display);
  font-size: 26px;
  line-height: 1;
}

.identity-title {
  margin-top: 10px;
  color: #d9e7dd;
  line-height: 1.4;
}

.sidebar-group {
  margin-top: 14px;
}

.group-label {
  margin-bottom: 12px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
}

.tag-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: 7px 11px;
  border-radius: 999px;
  border: 1px solid rgba(191, 255, 77, 0.24);
  background: rgba(191, 255, 77, 0.08);
  color: #eff7f1;
  font-size: 12px;
}

.sidebar-list,
.main-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 10px;
}

.sidebar-list li,
.main-list li {
  position: relative;
  padding-left: 16px;
  color: #e0ede3;
  line-height: 1.45;
}

.sidebar-list li::before,
.main-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.66em;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
}

.sheet-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding-bottom: 4px;
}

.sheet-badge {
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid rgba(191, 255, 77, 0.18);
  background: rgba(191, 255, 77, 0.08);
  color: var(--accent);
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}

.content-section {
  padding: 16px 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.028), rgba(255, 255, 255, 0.018)),
    rgba(255, 255, 255, 0.015);
}

.section-title {
  margin-bottom: 12px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
}

.summary-copy,
.engagement-card p,
.bullet-card {
  margin: 0;
  color: #e6efe8;
  line-height: 1.58;
}

.engagement-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.engagement-card {
  padding: 14px;
  min-height: 0;
  background:
    linear-gradient(180deg, rgba(191, 255, 77, 0.05), rgba(255, 255, 255, 0.02)),
    rgba(255, 255, 255, 0.02);
}

.engagement-title {
  margin-bottom: 6px;
  font-family: var(--font-display);
  font-size: 16px;
  line-height: 1.1;
}

.engagement-role {
  margin-bottom: 10px;
  color: var(--accent);
  line-height: 1.45;
}

.engagement-tech-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

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

.bullet-card {
  padding: 14px;
  min-height: 92px;
}

.sheet-footer {
  margin-top: auto;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.main-area-gap {
  height: 10px;
}

.empty-state {
  color: var(--muted);
  font-style: italic;
}

.pdf-export {
  background: #0b110e;
}

.pdf-export .profile-sheet {
  width: 210mm;
  min-height: 297mm;
  margin: 0;
  border-radius: 0;
  border: 0;
  box-shadow: none;
}

@page {
  size: A4;
  margin: 0;
}

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

  .profile-sheet {
    width: min(100%, 920px);
  }
}

@media (max-width: 900px) {
  .topbar {
    flex-direction: column;
    align-items: flex-start;
    padding: 16px 18px;
  }

  .field-grid,
  .status-metadata,
  .bullet-grid {
    grid-template-columns: 1fr;
  }

  .profile-sheet {
    grid-template-columns: 1fr;
  }

  .profile-sidebar {
    border-right: 0;
    border-bottom: 1px solid rgba(191, 255, 77, 0.12);
  }
}

@media (max-width: 720px) {
  .app-shell {
    padding: 16px;
  }

  .panel {
    padding: 18px;
    border-radius: 22px;
  }

  .intro-panel h1 {
    font-size: 30px;
  }

  .language-row,
  .list-editor-row,
  .tag-editor-row {
    grid-template-columns: 1fr;
  }

  .upload-inline-actions,
  .photo-upload-inline {
    align-items: stretch;
  }
}
