:root {
  --builder-pink-50: #fff0f7;
  --builder-pink-100: #ffd6e7;
  --builder-pink-500: #ff4fa0;
  --builder-yellow-50: #fffceb;
  --builder-yellow-100: #fff4b8;
  --builder-ink: #1f2937;
  --builder-muted: #6b7280;
  --builder-border: rgba(255, 79, 160, 0.28);
  --builder-shadow: 0 16px 40px rgba(17, 24, 39, 0.10);
  --builder-card: rgba(255, 255, 255, 0.92);
  --builder-card-border: rgba(31, 41, 55, 0.10);
  --app-accent: #2563eb;
  --app-accent-2: #06b6d4;
}

html {
  font-size: 14px;
  position: relative;
  min-height: 100%;
}

@media (min-width: 768px) {
  html { font-size: 16px; }
}

body {
  margin-bottom: 60px;
  font-family: Inter, "Segoe UI", system-ui, -apple-system, Arial, sans-serif;
  color: var(--builder-ink);
  background:
    radial-gradient(900px 420px at 12% 0%, rgba(37, 99, 235, 0.10), transparent 60%),
    radial-gradient(820px 420px at 92% 6%, rgba(255, 79, 160, 0.10), transparent 58%),
    linear-gradient(180deg, rgba(248, 250, 252, 1), rgba(255, 255, 255, 1));
}

.text-muted { color: var(--builder-muted) !important; }

.app-shell {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.app-main {
  flex: 1;
}

.app-topbar {
  position: sticky;
  top: 0;
  z-index: 1030;
}

.app-bottom-nav {
  display: none;
}

.app-bottom-link {
  text-decoration: none;
}

.app-bottom-link[aria-current="page"] {
  color: var(--builder-ink) !important;
  opacity: 1;
}

.app-bottom-link:not([aria-current="page"]) {
  color: var(--builder-muted) !important;
  opacity: 0.9;
}

.builder-nav {
  background: rgba(255, 255, 255, 0.86);
  border-bottom: 1px solid rgba(31, 41, 55, 0.08);
  box-shadow: 0 10px 24px rgba(17, 24, 39, 0.06);
  backdrop-filter: blur(8px);
}

.navbar .nav-link {
  color: var(--builder-ink) !important;
  font-weight: 600;
  opacity: 0.92;
}

.navbar .nav-link:hover { opacity: 1; }

.app-upload-tile {
  display: block;
  padding: 14px 14px;
  border-radius: 16px;
  border: 1px dashed rgba(37, 99, 235, 0.38);
  background: rgba(255, 255, 255, 0.70);
  box-shadow: 0 12px 30px rgba(17, 24, 39, 0.06);
  cursor: pointer;
  user-select: none;
}

.app-upload-wrap {
  position: relative;
}

.app-upload-input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.app-upload-title {
  font-weight: 900;
  letter-spacing: -0.01em;
}

.app-upload-sub {
  color: var(--builder-muted);
  font-size: 12px;
  margin-top: 2px;
}

.app-upload-tile:active {
  transform: scale(0.99);
}

.app-upload-tile:focus {
  outline: none;
}

.app-upload-tile:focus-visible {
  box-shadow: 0 0 0 0.1rem rgba(239, 246, 255, 0.95), 0 0 0 0.25rem rgba(37, 99, 235, 0.22);
}

.app-page-strip {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  padding: 14px 14px;
  border-radius: 18px;
  border: 1px solid rgba(31, 41, 55, 0.08);
  background:
    radial-gradient(480px 220px at 12% 0%, rgba(37, 99, 235, 0.10), transparent 60%),
    radial-gradient(420px 220px at 92% 0%, rgba(255, 79, 160, 0.12), transparent 55%),
    rgba(255, 255, 255, 0.78);
  box-shadow: 0 14px 38px rgba(17, 24, 39, 0.08);
}

.app-page-strip-title {
  font-weight: 950;
  letter-spacing: -0.02em;
  grid-column: 1 / 2;
}

.app-page-strip-sub {
  grid-column: 1 / 2;
  color: var(--builder-muted);
  font-size: 13px;
  margin-top: 2px;
}

.app-page-strip-actions {
  grid-row: 1 / span 2;
  display: flex;
  align-items: center;
  grid-column: 2 / 3;
  justify-self: end;
}

@media (max-width: 576px) {
  .app-page-strip { grid-template-columns: 1fr; }
  .app-page-strip-actions { grid-row: auto; grid-column: 1 / -1; justify-self: start; }
}

/* Builder wizard (step-by-step) */
.builder-wizard-header {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px 12px;
  align-items: center;
  padding: 8px 10px;
  border-radius: 16px;
  border: 1px solid rgba(31, 41, 55, 0.08);
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 14px 38px rgba(17, 24, 39, 0.06);
}

.builder-wizard-meta { min-width: 0; }
.builder-wizard-step {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.10);
  color: #1d4ed8;
  font-weight: 950;
  letter-spacing: -0.02em;
  font-size: 12px;
}
.builder-wizard-title { margin-top: 6px; font-size: 16px; font-weight: 950; letter-spacing: -0.03em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.builder-wizard-progress {
  grid-column: 1 / -1;
  height: 8px;
  border-radius: 999px;
  background: rgba(31, 41, 55, 0.08);
  overflow: hidden;
}

.builder-wizard-progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--app-accent), var(--app-accent-2));
  border-radius: 999px;
  transition: width 180ms ease;
}

.builder-wizard-count { justify-self: end; }

.builder-step { display: none; }
.builder-step.is-active { display: block; }

.builder-wizard-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 14px;
}

.builder-wizard-actions .btn {
  flex: 0 0 auto;
  min-width: 124px;
  padding-top: 9px;
  padding-bottom: 9px;
}

/* Hide non-active column based on step */
.builder-wizard:not(.is-export) .builder-col-right { display: none; }
.builder-wizard.is-export .builder-col-left { display: none; }

.builder-wizard:not(.is-export) .builder-col-left {
  flex: 0 0 100%;
  max-width: 100%;
}

.builder-wizard:not(.is-export) .builder-col-left .card.builder-step.is-active {
  max-width: 780px;
  margin-left: auto;
  margin-right: auto;
}

.builder-wizard-header,
.builder-wizard-actions {
  max-width: 780px;
  margin-left: auto;
  margin-right: auto;
}

.builder-wizard .builder-step.is-active .card-header { display: none; }
.builder-wizard .card-body { padding: 12px; }
.builder-wizard .form-label { margin-bottom: 6px; font-weight: 800; }
.builder-wizard .form-control,
.builder-wizard .form-select { border-radius: 12px; }

.page-builder .app-page-strip { display: none; }

/* Token input (autocomplete + chips) */
.token-input {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  min-height: 44px;
}

.token-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.token-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.10);
  border: 1px solid rgba(37, 99, 235, 0.20);
  color: #1d4ed8;
  font-weight: 900;
  font-size: 13px;
}

.token-remove {
  width: 20px;
  height: 20px;
  border-radius: 999px;
  border: 0;
  background: rgba(29, 78, 216, 0.10);
  color: #1d4ed8;
  line-height: 1;
  font-weight: 900;
}

.token-text {
  border: 0;
  outline: none;
  background: transparent;
  min-width: 120px;
  flex: 1;
  padding: 6px 2px;
}

.token-suggest {
  margin-top: 8px;
  border-radius: 14px;
  border: 1px solid rgba(31, 41, 55, 0.10);
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 18px 46px rgba(17, 24, 39, 0.12);
  overflow: hidden;
}

.token-option {
  padding: 10px 12px;
  cursor: pointer;
  font-weight: 800;
}

.token-option:hover,
.token-option.is-active {
  background: rgba(37, 99, 235, 0.10);
}

/* Admin pages */
.page-admin .app-topbar { display: none; }

.admin-auth {
  padding-top: 28px;
  padding-bottom: 28px;
}

.admin-side {
  border-radius: 22px;
  padding: 20px 18px;
  border: 1px solid rgba(31, 41, 55, 0.10);
  background:
    radial-gradient(680px 360px at 10% 0%, rgba(37, 99, 235, 0.14), transparent 60%),
    radial-gradient(580px 320px at 92% 10%, rgba(6, 182, 212, 0.16), transparent 58%),
    rgba(255, 255, 255, 0.80);
  box-shadow: 0 18px 52px rgba(17, 24, 39, 0.10);
}

.admin-side-badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.10);
  border: 1px solid rgba(37, 99, 235, 0.18);
  color: #1d4ed8;
  font-weight: 950;
  letter-spacing: -0.02em;
}

.admin-side-points {
  display: grid;
  gap: 12px;
}

.admin-point {
  display: grid;
  grid-template-columns: 14px 1fr;
  gap: 12px;
  align-items: start;
  padding: 12px 12px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(31, 41, 55, 0.08);
}

.admin-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  margin-top: 4px;
  background: linear-gradient(90deg, var(--app-accent), var(--app-accent-2));
}

.admin-card {
  border-radius: 22px;
}

.page-admin .input-group-text {
  border-radius: 12px;
  background: rgba(248, 250, 252, 0.95);
  border-color: rgba(31, 41, 55, 0.10);
  font-weight: 900;
  color: rgba(17, 24, 39, 0.70);
}

.page-admin .input-group > .form-control {
  border-radius: 12px;
  border-color: rgba(31, 41, 55, 0.12);
}

.page-admin .input-group > .btn {
  border-radius: 12px;
}

.admin-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 14px;
  border-radius: 22px;
  border: 1px solid rgba(31, 41, 55, 0.10);
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 14px 38px rgba(17, 24, 39, 0.06);
}

.admin-strip-kicker {
  display: inline-flex;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.10);
  color: #1d4ed8;
  font-weight: 950;
  font-size: 12px;
}

@media (max-width: 576px) {
  .admin-strip { flex-direction: column; align-items: flex-start; }
}

@media (min-width: 992px) {
  .builder-wizard.is-export .builder-col-right {
    flex: 0 0 100%;
    max-width: 100%;
  }
  .builder-wizard.is-export .builder-col-right .card { max-width: 760px; margin-left: auto; margin-right: auto; }
}

@media (max-width: 576px) {
  .builder-wizard-actions {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: 84px;
    padding: 10px;
    border-radius: 18px;
    border: 1px solid rgba(31, 41, 55, 0.10);
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 18px 46px rgba(17, 24, 39, 0.14);
    backdrop-filter: blur(12px);
    z-index: 2200;
    margin-top: 0;
  }
  .builder-wizard-actions .btn { flex: 1; min-width: 0; }
  .builder-wizard { padding-bottom: 90px; }
}

.card {
  background: var(--builder-card);
  border: 1px solid var(--builder-card-border);
  border-radius: 18px;
  box-shadow: 0 14px 38px rgba(17, 24, 39, 0.08);
}

.card-header {
  background: rgba(248, 250, 252, 0.95);
  border-bottom: 1px solid rgba(31, 41, 55, 0.08);
}

.btn-primary {
  background: linear-gradient(90deg, var(--app-accent), var(--app-accent-2));
  border: 0;
  font-weight: 850;
}

.btn-primary:hover,
.btn-primary:focus {
  background: linear-gradient(90deg, #1d4ed8, #0891b2);
}

.btn-dark {
  background-color: #111827;
  border-color: #111827;
}

.btn:focus,
.btn:active:focus,
.btn-link.nav-link:focus,
.form-control:focus,
.form-check-input:focus {
  border-color: rgba(37, 99, 235, 0.55);
  box-shadow: 0 0 0 0.1rem rgba(239, 246, 255, 0.95), 0 0 0 0.25rem rgba(37, 99, 235, 0.22);
}

pre {
  border-radius: 12px;
  border: 1px solid rgba(31, 41, 55, 0.10) !important;
  background: rgba(255, 255, 255, 0.75) !important;
}

.badge.builder-badge {
  background: linear-gradient(90deg, rgba(219, 234, 254, 0.95), rgba(207, 250, 254, 0.95));
  color: var(--builder-ink);
  border: 1px solid rgba(37, 99, 235, 0.22);
}

.alert-danger {
  background: rgba(255, 214, 231, 0.55);
  border-color: rgba(255, 79, 160, 0.35);
  color: #7a0034;
}

.alert-success {
  background: rgba(255, 244, 184, 0.65);
  border-color: rgba(234, 179, 8, 0.40);
  color: #6b4b00;
}

a { color: #1d4ed8; }
a:hover { color: #1e40af; }

.btn-outline-primary {
  border-color: rgba(37, 99, 235, 0.45);
  color: #1d4ed8;
  font-weight: 850;
}

.btn-outline-primary:hover,
.btn-outline-primary:focus {
  background: rgba(37, 99, 235, 0.08);
  border-color: rgba(37, 99, 235, 0.55);
  color: #1d4ed8;
}

/* Landing page */
.app-hero {
  background:
    radial-gradient(820px 420px at 15% 0%, rgba(37, 99, 235, 0.10), transparent 60%),
    radial-gradient(740px 400px at 92% 5%, rgba(255, 79, 160, 0.14), transparent 55%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0));
  border-bottom: 1px solid rgba(31, 41, 55, 0.06);
}

.app-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.10);
  color: #1d4ed8;
  font-weight: 900;
  letter-spacing: -0.01em;
}

.app-cta {
  border-radius: 14px;
  padding-left: 18px;
  padding-right: 18px;
}

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

.app-trust-item {
  padding: 12px 12px;
  border-radius: 16px;
  border: 1px solid rgba(31, 41, 55, 0.08);
  background: rgba(255, 255, 255, 0.74);
  box-shadow: 0 10px 30px rgba(17, 24, 39, 0.06);
}

.app-trust-badge {
  font-weight: 950;
  letter-spacing: -0.02em;
  font-size: 18px;
}

.app-resume-mock {
  border-radius: 22px;
  border: 1px solid rgba(31, 41, 55, 0.10);
  background: rgba(255, 255, 255, 0.85);
  box-shadow: 0 18px 52px rgba(17, 24, 39, 0.12);
  padding: 18px 18px;
  transform: rotate(1.2deg);
}

.app-resume-mock-head {
  display: flex;
  gap: 14px;
  align-items: center;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(31, 41, 55, 0.08);
}

.app-resume-avatar {
  width: 54px;
  height: 54px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.18), rgba(255, 79, 160, 0.18));
  border: 1px solid rgba(31, 41, 55, 0.08);
}

.app-resume-headlines { flex: 1; }

.app-resume-line {
  height: 10px;
  border-radius: 999px;
  margin-top: 8px;
  background: rgba(31, 41, 55, 0.10);
}

.app-resume-line--lg { height: 12px; width: 72%; }
.app-resume-line--md { width: 62%; }
.app-resume-line--sm { width: 42%; }

.app-resume-block {
  margin-top: 14px;
  padding: 12px 12px;
  border-radius: 18px;
  background: rgba(255, 240, 247, 0.42);
  border: 1px solid rgba(255, 79, 160, 0.14);
}

.app-resume-chip {
  display: inline-block;
  height: 10px;
  width: 72px;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.12);
  border: 1px solid rgba(37, 99, 235, 0.08);
  margin: 6px 8px 0 0;
}

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

.template-card {
  display: block;
  padding: 14px 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid rgba(31, 41, 55, 0.10);
  box-shadow: 0 14px 38px rgba(17, 24, 39, 0.08);
  text-decoration: none;
  color: inherit;
  transition: transform 120ms ease, box-shadow 120ms ease;
}

.template-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 46px rgba(17, 24, 39, 0.12);
}

.builder-template-card {
  width: 100%;
  text-align: left;
  cursor: pointer;
}

.builder-template-card.is-active,
.builder-template-card[aria-pressed="true"] {
  border-color: rgba(37, 99, 235, 0.38);
  box-shadow: 0 18px 46px rgba(37, 99, 235, 0.10), 0 18px 46px rgba(17, 24, 39, 0.10);
}

.builder-template-card:active {
  transform: translateY(0);
}

.template-thumb {
  height: 160px;
  border-radius: 16px;
  border: 1px solid rgba(31, 41, 55, 0.10);
  background: rgba(248, 250, 252, 1);
  position: relative;
  overflow: hidden;
}

.template-thumb-inner {
  position: absolute;
  top: 10px;
  left: 10px;
  transform-origin: top left;
  transform: scale(0.16);
  pointer-events: none;
}

.template-thumb .resume-paper.resume-paper--thumb {
  transform: none;
  box-shadow: 0 10px 28px rgba(17, 24, 39, 0.10);
  border-radius: 10px;
  padding: 12mm 12mm 10mm 12mm;
}

.template-thumb .resume-name { font-size: 20px; }
.template-thumb .resume-contact { font-size: 11px; }
.template-thumb .resume-role { font-size: 12px; }
.template-thumb .resume-section { margin-top: 10px; }
.template-thumb .resume-p { font-size: 11px; }

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

@media (max-width: 576px) {
  .template-grid { grid-template-columns: 1fr; }
  .template-thumb { height: 180px; }
  .template-thumb-inner { transform: scale(0.20); }
  .app-trust { grid-template-columns: 1fr; }
}

#builderTemplateGrid .template-thumb { height: 150px; }
#builderTemplateGrid .template-thumb-inner { transform: scale(0.135); }

/* Polished dashboard-like stat cards */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

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

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

.stat-card {
  background: var(--builder-card);
  border: 1px solid var(--builder-card-border);
  border-radius: 16px;
  box-shadow: 0 12px 28px rgba(17, 24, 39, 0.08);
  padding: 14px 14px 12px 14px;
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: "";
  position: absolute;
  inset: 10px auto 10px 0;
  width: 4px;
  border-radius: 999px;
  background: #3b82f6;
}

.stat-blue::before { background: #3b82f6; }
.stat-green::before { background: #22c55e; }
.stat-orange::before { background: #f59e0b; }
.stat-red::before { background: #ef4444; }
.stat-purple::before { background: #8b5cf6; }
.stat-teal::before { background: #14b8a6; }

.stat-title { font-size: 12px; color: var(--builder-muted); font-weight: 700; }
.stat-value { font-size: 22px; font-weight: 900; letter-spacing: -0.02em; margin-top: 6px; }
.stat-sub { font-size: 12px; color: var(--builder-muted); margin-top: 4px; }

/* Tables */
.table {
  --bs-table-bg: transparent;
}

.table thead th {
  font-size: 12px;
  text-transform: none;
  letter-spacing: 0.01em;
  color: rgba(31, 41, 55, 0.75);
  border-bottom: 1px solid rgba(31, 41, 55, 0.12);
}

.table tbody td {
  border-top: 1px solid rgba(31, 41, 55, 0.08);
  vertical-align: middle;
}

/* Resume A4 preview */
.resume-a4-stage {
  overflow: auto;
  padding: 8px;
  background: rgba(255, 255, 255, 0.55);
  border-radius: 14px;
  border: 1px solid rgba(31, 41, 55, 0.08);
}

.resume-paper {
  width: 210mm;
  min-height: 297mm;
  background: white;
  border: 1px solid rgba(31, 41, 55, 0.10);
  border-radius: 10px;
  padding: 14mm 14mm 12mm 14mm;
  display: flex;
  flex-direction: column;
  transform-origin: top left;
  transform: scale(0.75);
  box-shadow: 0 18px 46px rgba(17, 24, 39, 0.18);
}

@media (max-width: 992px) {
  .resume-paper { transform: scale(0.68); }
}

.resume-head { margin-bottom: 10px; }
.resume-name { font-size: 22px; font-weight: 800; line-height: 1.1; }
.resume-contact { color: var(--builder-muted); font-size: 12px; margin-top: 3px; }
.resume-role { font-size: 13px; font-weight: 700; margin-top: 4px; color: #111827; }

.resume-section { margin-top: 12px; }
.resume-h {
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 6px;
}

.resume-p { font-size: 11.5px; line-height: 1.4; white-space: pre-wrap; }
.resume-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 10px; }
.resume-k { font-weight: 800; }
.resume-sub { font-size: 11px; color: #374151; margin-top: 2px; white-space: pre-wrap; }
.resume-item { margin-top: 6px; }

.resume-skill-pill {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.10);
  border: 1px solid rgba(37, 99, 235, 0.18);
  color: #1d4ed8;
  font-weight: 900;
  margin: 0 4px 4px 0;
}

/* Template variants */
.tpl-modern .resume-h { color: #ff2e8f; }
.tpl-modern .resume-name { color: #111827; }

.tpl-ats { font-family: Calibri, Arial, sans-serif; }
.tpl-ats .resume-h { color: #111827; }
.tpl-ats .resume-head { padding-bottom: 6px; border-bottom: 1px solid rgba(31, 41, 55, 0.12); }

.tpl-simple { font-family: Arial, sans-serif; }
.tpl-simple .resume-h { color: #111827; }

.tpl-classic { font-family: Georgia, \"Times New Roman\", Times, serif; }
.tpl-classic .resume-h { color: #111827; border-bottom: 2px solid rgba(214, 31, 122, 0.45); padding-bottom: 2px; }
.tpl-classic .resume-name { color: #111827; }

.tpl-minimal { font-family: Calibri, Arial, sans-serif; }
.tpl-minimal .resume-h { color: #111827; opacity: 0.9; }
.tpl-minimal .resume-paper { border-radius: 0; box-shadow: 0 10px 26px rgba(17, 24, 39, 0.12); }

.tpl-creative { font-family: \"Segoe UI\", system-ui, -apple-system, Arial, sans-serif; }
.tpl-creative .resume-h { color: #ff2e8f; }
.tpl-creative .resume-head { padding: 10px 12px; border-radius: 10px; background: linear-gradient(90deg, rgba(255, 214, 231, 0.75), rgba(255, 244, 184, 0.75)); }
.tpl-creative .resume-contact { color: rgba(17, 24, 39, 0.65); }

.tpl-executive { font-family: \"Segoe UI\", system-ui, -apple-system, Arial, sans-serif; }
.tpl-executive .resume-head { padding: 10px 12px; border-radius: 10px; background: #111827; }
.tpl-executive .resume-name { color: white; }
.tpl-executive .resume-contact { color: rgba(255, 255, 255, 0.78); }
.tpl-executive .resume-role { color: rgba(255, 255, 255, 0.88); }
.tpl-executive .resume-h { color: #ff2e8f; }

.tpl-blue { font-family: "Segoe UI", system-ui, -apple-system, Arial, sans-serif; }
.tpl-blue .resume-head {
  padding: 12px 12px;
  border-radius: 12px;
  background: #1d4ed8;
}
.tpl-blue .resume-name { color: white; }
.tpl-blue .resume-contact { color: rgba(255, 255, 255, 0.82); }
.tpl-blue .resume-role { color: rgba(255, 255, 255, 0.90); }
.tpl-blue .resume-h { color: #1d4ed8; }

.tpl-sidebar { font-family: "Segoe UI", system-ui, -apple-system, Arial, sans-serif; }
.tpl-sidebar {
  display: grid;
  grid-template-columns: 1.75fr 1fr;
  column-gap: 10mm;
  align-content: start;
}
.tpl-sidebar .resume-head { grid-column: 1 / -1; }
.tpl-sidebar #resumeSummary,
.tpl-sidebar #resumeExperience,
.tpl-sidebar #resumeProjects { grid-column: 1 / 2; }
.tpl-sidebar #resumeSkills,
.tpl-sidebar #resumeEducation,
.tpl-sidebar #resumeCertifications,
.tpl-sidebar #resumeCustom { grid-column: 2 / 3; }
.tpl-sidebar #resumeFooter { grid-column: 1 / -1; }
.tpl-sidebar .resume-section { margin-top: 10px; }
.tpl-sidebar .resume-h { color: #1d4ed8; }
.tpl-sidebar .resume-footer { margin-top: 16px; }

/* Template thumbnails use wrapper class on `.template-thumb-inner` */
.tpl-blue .resume-paper--thumb .resume-head { background: #1d4ed8; }
.tpl-blue .resume-paper--thumb .resume-h { color: #1d4ed8; }

.tpl-sidebar .resume-paper--thumb {
  display: grid;
  grid-template-columns: 1.75fr 1fr;
  column-gap: 10mm;
  align-content: start;
}

/* Loader overlay */
.builder-loader {
  position: fixed;
  inset: 0;
  background: rgba(17, 24, 39, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3000;
  backdrop-filter: blur(6px);
}

.builder-loader-card {
  background: rgba(255, 255, 255, 0.92);
  border-radius: 18px;
  padding: 20px 22px;
  width: min(360px, calc(100vw - 40px));
  text-align: center;
  border: 1px solid rgba(31, 41, 55, 0.10);
  box-shadow: 0 18px 46px rgba(17, 24, 39, 0.20);
}

/* ATS meter + progress */
.builder-progress .progress-bar {
  background: linear-gradient(90deg, #ff4fa0, #ffd24d);
}

.ats-meter {
  --p: 0;
  width: 132px;
  height: 132px;
  border-radius: 50%;
  background: conic-gradient(#ff4fa0 calc(var(--p) * 1%), rgba(17, 24, 39, 0.10) 0);
  display: grid;
  place-items: center;
  border: 1px solid rgba(31, 41, 55, 0.08);
  box-shadow: 0 14px 34px rgba(17, 24, 39, 0.12);
}

.ats-meter-inner {
  width: 104px;
  height: 104px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  display: grid;
  place-items: center;
  border: 1px solid rgba(31, 41, 55, 0.08);
}

.ats-score { font-weight: 900; font-size: 24px; line-height: 1; }
.ats-sub { font-size: 12px; color: var(--builder-muted); margin-top: -4px; }

.builder-inner-card {
  box-shadow: none;
  border-radius: 14px;
}

.ats-summary { min-width: 220px; }

.resume-footer {
  margin-top: auto;
  padding-top: 18px;
  border-top: 1px dashed rgba(31, 41, 55, 0.18);
}

.resume-footer-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  align-items: end;
}

/* Mobile polish */
@media (max-width: 768px) {
  .container { padding-left: 14px; padding-right: 14px; }
  .navbar-brand { letter-spacing: -0.01em; }
  .navbar .nav-link { padding: 10px 10px; }
  .card { border-radius: 16px; }
  .card-body { padding: 14px; }
  .card-header { padding: 12px 14px; }
  h1.h3 { font-size: 1.35rem; }
}

@media (max-width: 576px) {
  .app-bottom-nav {
    display: flex;
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: 12px;
    height: 58px;
    padding: 8px;
    gap: 8px;
    border-radius: 18px;
    border: 1px solid rgba(31, 41, 55, 0.10);
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 18px 46px rgba(17, 24, 39, 0.14);
    backdrop-filter: blur(12px);
    z-index: 2100;
  }

  .app-bottom-link {
    flex: 1;
    display: grid;
    place-items: center;
    border-radius: 14px;
    font-weight: 900;
    letter-spacing: -0.01em;
    font-size: 13px;
    background: rgba(248, 250, 252, 0.95);
    border: 1px solid rgba(31, 41, 55, 0.08);
  }

  .app-bottom-link[aria-current=\"page\"] {
    background: linear-gradient(90deg, rgba(37, 99, 235, 0.12), rgba(6, 182, 212, 0.12));
    border-color: rgba(37, 99, 235, 0.22);
  }

  body { margin-bottom: 72px; }
  .container { padding-left: 12px; padding-right: 12px; }

  .btn { border-radius: 12px; }
  .btn-sm { border-radius: 10px; }

  .stat-grid { gap: 10px; }
  .stat-card { padding: 12px 12px 10px 12px; }
  .stat-value { font-size: 20px; }

  .table thead th { font-size: 11px; }
  .table tbody td { font-size: 12px; }
  .table .btn { padding: 0.28rem 0.5rem; font-size: 12px; }

  .ats-meter { width: 112px; height: 112px; }
  .ats-meter-inner { width: 88px; height: 88px; }
  .ats-score { font-size: 20px; }
  .ats-summary { min-width: 0; width: 100%; }

  .builder-loader-card { width: min(320px, calc(100vw - 28px)); }

  .resume-a4-stage { padding: 6px; }
  .resume-paper { transform: scale(0.52); }
  .resume-grid { grid-template-columns: 1fr; }
  .resume-name { font-size: 20px; }
  .resume-p { font-size: 11px; }

  /* Mobile app-like shell */
  body { margin-bottom: 0; }
  .app-main { padding-bottom: 86px; }
  footer.footer { display: none; }
  .app-topbar { margin-bottom: 10px !important; }

  .app-bottom-nav {
    display: flex;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    height: 70px;
    padding: 10px 12px 12px 12px;
    gap: 10px;
    background: rgba(255, 255, 255, 0.92);
    border-top: 1px solid rgba(31, 41, 55, 0.08);
    box-shadow: 0 -12px 36px rgba(17, 24, 39, 0.12);
    backdrop-filter: blur(12px);
    z-index: 2100;
  }

  .app-bottom-link {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 48px;
    border-radius: 16px;
    font-weight: 800;
    letter-spacing: -0.01em;
    background: rgba(255, 240, 247, 0.55);
    border: 1px solid rgba(255, 79, 160, 0.20);
  }

  .app-bottom-link[aria-current="page"] {
    background: linear-gradient(90deg, rgba(255, 214, 231, 0.92), rgba(255, 244, 184, 0.92));
    border-color: rgba(255, 79, 160, 0.28);
  }

  /* Prevent tiny font sizes / improve tap targets */
  .form-control,
  .form-select,
  .btn { font-size: 16px; }
}

@media (max-width: 420px) {
  .resume-paper { transform: scale(0.46); }
}

@media (max-width: 576px) {
  .modal-fullscreen-sm-down .modal-content { border-radius: 0 !important; }
  .modal-fullscreen-sm-down .modal-body { padding: 12px; }
}
