/* SlideCV builder visual polish — layered after the existing builder styles. */
:root {
  --studio-bg: #f3f5f8;
  --studio-surface: #ffffff;
  --studio-surface-muted: #f8fafc;
  --studio-ink: #111827;
  --studio-muted: #64748b;
  --studio-subtle: #94a3b8;
  --studio-line: #e2e8f0;
  --studio-line-strong: #cbd5e1;
  --studio-accent: #2563eb;
  --studio-accent-soft: #eff6ff;
  --studio-success: #059669;
  --studio-danger: #dc2626;
  --studio-radius-xs: 10px;
  --studio-radius-sm: 12px;
  --studio-radius-md: 16px;
  --studio-radius-lg: 20px;
  --studio-shadow-sm: 0 1px 2px rgba(15, 23, 42, .04), 0 8px 24px rgba(15, 23, 42, .05);
  --studio-shadow-md: 0 18px 50px rgba(15, 23, 42, .10);
  --studio-shadow-page: 0 30px 90px rgba(15, 23, 42, .18), 0 1px 0 rgba(255, 255, 255, .9) inset;
}

html {
  background: var(--studio-bg);
  color-scheme: light;
}

body {
  background:
    radial-gradient(circle at 51% -18%, rgba(37, 99, 235, .055), transparent 34%),
    var(--studio-bg);
  color: var(--studio-ink);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

button,
input,
textarea,
select {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(37, 99, 235, .22);
  outline-offset: 2px;
}

/* Product header */
.topbar {
  height: 64px;
  padding: 0 18px;
  gap: 16px;
  background: rgba(255, 255, 255, .92);
  border-bottom: 1px solid rgba(226, 232, 240, .96);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .8) inset;
  backdrop-filter: saturate(145%) blur(18px);
}

.brand-mark {
  gap: 10px;
}

.brand-mark span {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  background: linear-gradient(145deg, #111827, #1e293b);
  box-shadow: 0 9px 22px rgba(15, 23, 42, .16);
  font-size: 15px;
}

.brand-mark strong {
  font-size: 15px;
  font-weight: 900;
  letter-spacing: -.025em;
}

.brand-mark small {
  margin-top: 0;
  color: var(--studio-subtle);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .025em;
}

.top-center {
  min-height: 34px;
  padding: 6px 11px;
  border-color: rgba(16, 185, 129, .18);
  background: #f0fdf4;
  color: #047857;
  box-shadow: none;
  font-size: 12px;
}

.status-dot {
  width: 7px;
  height: 7px;
  box-shadow: 0 0 0 4px rgba(16, 185, 129, .10);
}

.top-actions {
  gap: 7px;
}

.primary-btn,
.soft-btn,
.add-btn {
  min-height: 38px;
  padding: 8px 12px;
  border-radius: 11px;
  font-size: 12px;
  font-weight: 850;
  box-shadow: none;
  transition: transform .16s ease, border-color .16s ease, background .16s ease, box-shadow .16s ease;
}

.soft-btn {
  border-color: var(--studio-line);
  background: #fff;
  color: #334155;
}

.soft-btn:hover {
  border-color: var(--studio-line-strong);
  background: var(--studio-surface-muted);
}

.primary-btn,
.add-btn {
  border-color: #111827;
  background: #111827;
  color: #fff;
}

.primary-btn:hover,
.add-btn:hover {
  transform: translateY(-1px);
  background: #020617;
  box-shadow: 0 9px 24px rgba(15, 23, 42, .16);
}

/* Desktop studio geometry */
.workspace {
  height: calc(100vh - 64px);
  grid-template-columns: 72px clamp(330px, 24vw, 380px) minmax(540px, 1fr) 286px;
  background: var(--studio-bg);
}

.rail {
  padding: 14px 9px;
  gap: 7px;
  border-right-color: var(--studio-line);
  background: rgba(248, 250, 252, .88);
  backdrop-filter: blur(12px);
}

.rail button {
  width: 52px;
  min-height: 54px;
  padding: 7px 4px;
  gap: 3px;
  border-radius: 14px;
  color: #64748b;
  font-size: 9.5px;
  letter-spacing: .005em;
  transition: background .16s ease, color .16s ease, transform .16s ease, box-shadow .16s ease;
}

.rail button:hover {
  background: #fff;
  color: #0f172a;
  transform: translateY(-1px);
  box-shadow: var(--studio-shadow-sm);
}

.rail button.active {
  background: #111827;
  color: #fff;
  box-shadow: 0 10px 24px rgba(15, 23, 42, .17);
}

.left-panel,
.right-panel {
  background: rgba(255, 255, 255, .94);
  backdrop-filter: none;
}

.left-panel {
  border-right-color: var(--studio-line);
}

.right-panel {
  padding: 14px;
  border-left-color: var(--studio-line);
  background: #f8fafc;
}

.panel-inner {
  padding: 20px 18px 36px;
}

.panel-heading {
  margin-bottom: 16px;
}

.panel-heading p,
.crumb {
  margin-bottom: 6px;
  color: var(--studio-accent);
  font-size: 10px;
  letter-spacing: .14em;
}

.panel-heading h2 {
  font-size: 23px;
  line-height: 1.08;
  letter-spacing: -.045em;
}

.panel-heading span {
  max-width: 44ch;
  margin-top: 7px;
  color: var(--studio-muted);
  font-size: 12.5px;
  line-height: 1.55;
}

/* Builder navigation and forms */
.section-tabs {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  margin-bottom: 12px;
}

.section-tabs button,
.quick-grid button {
  min-height: 38px;
  padding: 8px 9px;
  border-color: var(--studio-line);
  border-radius: 11px;
  background: #fff;
  color: #475569;
  font-size: 12px;
  box-shadow: none;
  transition: border-color .15s ease, background .15s ease, color .15s ease, transform .15s ease;
}

.section-tabs button:hover,
.quick-grid button:hover {
  border-color: var(--studio-line-strong);
  color: #0f172a;
  transform: translateY(-1px);
}

.section-tabs button.selected,
.quick-grid button.active {
  border-color: #111827;
  background: #111827;
  color: #fff;
}

.editor-card,
.collapse-card,
.right-card,
.hint-box {
  border-color: var(--studio-line);
  border-radius: var(--studio-radius-md);
  background: #fff;
  box-shadow: none;
}

.editor-card {
  padding: 12px;
}

.form-stack,
.control-stack,
.repeater {
  gap: 10px;
}

.field {
  gap: 6px;
}

.field span,
.control-field span,
.range-field span {
  color: #334155;
  font-size: 11.5px;
  font-weight: 850;
}

.field input,
.field textarea,
.control-field select,
.search-box input,
.tag-pill-edit input,
.add-inline input {
  min-height: 42px;
  padding: 10px 11px;
  border-color: var(--studio-line);
  border-radius: 11px;
  color: #0f172a;
  font-size: 13px;
  box-shadow: 0 1px 0 rgba(15, 23, 42, .015) inset;
}

.field textarea {
  min-height: 96px;
  line-height: 1.5;
}

.field input:hover,
.field textarea:hover,
.control-field select:hover,
.search-box:hover {
  border-color: var(--studio-line-strong);
}

.field input:focus,
.field textarea:focus,
.search-box input:focus,
.tag-pill-edit input:focus,
.add-inline input:focus,
select:focus {
  border-color: var(--studio-accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .10);
}

.two-col-inputs {
  gap: 8px;
}

.collapse-card {
  overflow: clip;
}

.collapse-card + .collapse-card {
  margin-top: 2px;
}

.collapse-head {
  min-height: 44px;
  border-bottom-color: var(--studio-line);
  background: #fbfcfe;
}

.collapse-head button {
  padding: 11px 12px;
  font-size: 12.5px;
}

.collapse-body {
  padding: 12px;
  gap: 9px;
}

.delete-btn:hover,
.tag-pill-edit button:hover {
  background: #fef2f2;
  color: #b91c1c;
}

.search-box {
  min-height: 42px;
  margin-bottom: 12px;
  padding: 0 10px;
  border-color: var(--studio-line);
  border-radius: 12px;
  background: #fff;
}

/* Template catalogue */
.template-list {
  gap: 9px;
}

.template-card {
  min-height: 132px;
  grid-template-columns: 74px minmax(0, 1fr);
  gap: 11px;
  padding: 10px;
  overflow: hidden;
  border-color: var(--studio-line);
  border-radius: 15px;
  background: #fff;
  box-shadow: none;
  transition: transform .17s ease, border-color .17s ease, box-shadow .17s ease, background .17s ease;
}

.template-card:hover {
  transform: translateY(-2px);
  border-color: #b8c5d6;
  box-shadow: var(--studio-shadow-sm);
}

.template-card.active {
  border-color: #2563eb;
  background: linear-gradient(145deg, #fff, #f8fbff);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, .11), 0 12px 30px rgba(37, 99, 235, .08);
}

.template-card.active::before {
  content: '';
  position: absolute;
  inset: 8px auto 8px 0;
  width: 3px;
  border-radius: 0 999px 999px 0;
  background: #2563eb;
}

.template-thumb {
  width: 74px;
  height: 102px;
  padding: 8px;
  gap: 5px;
  border-color: #dbe4ef;
  border-radius: 8px;
  box-shadow: inset 0 0 0 3px #f8fafc;
}

.template-thumb i {
  height: 14px;
}

.template-thumb b {
  height: 4px;
}

.template-thumb em {
  height: 26px;
}

.template-meta {
  min-width: 0;
}

.template-meta strong {
  padding-right: 22px;
  font-size: 14px;
  letter-spacing: -.025em;
}

.template-meta span {
  margin-top: 2px;
  color: #64748b;
  font-size: 10.5px;
  line-height: 1.35;
}

.template-meta small {
  margin-top: 6px;
  padding: 3px 7px;
  background: #f1f5f9;
  color: #475569;
  font-size: 9.5px;
}

.template-meta p {
  display: -webkit-box;
  margin-top: 6px;
  overflow: hidden;
  color: #64748b;
  font-size: 10.5px;
  line-height: 1.42;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.check-badge {
  right: 10px;
  top: 10px;
  padding: 3px;
  border-radius: 999px;
  background: #ecfdf5;
  color: #047857;
}

/* Design and structure controls */
.control-field input[type='color'] {
  height: 42px;
  border-color: var(--studio-line);
  border-radius: 11px;
}

.control-field select {
  padding: 10px 11px;
  border-color: var(--studio-line);
  border-radius: 11px;
  font-size: 12.5px;
}

.range-field {
  gap: 6px;
}

.range-field div {
  grid-template-columns: 1fr 38px;
}

.range-field input {
  accent-color: #2563eb;
}

.section-manager {
  gap: 7px;
}

.section-row {
  min-height: 48px;
  padding: 8px 9px;
  border-color: var(--studio-line);
  border-radius: 12px;
  transition: border-color .15s ease, background .15s ease;
}

.section-row:hover {
  border-color: var(--studio-line-strong);
  background: #fbfcfe;
}

.section-row > button {
  font-size: 12.5px;
}

.switch {
  width: 38px;
  height: 22px;
}

.switch span::after {
  width: 16px;
  height: 16px;
}

.switch input:checked + span {
  background: #2563eb;
}

.switch input:checked + span::after {
  transform: translateX(16px);
}

.hint-box {
  padding: 12px;
  color: #475569;
  font-size: 11.5px;
}

/* Canvas */
.preview-stage {
  padding: 20px 24px 64px;
  background:
    linear-gradient(rgba(255, 255, 255, .62), rgba(255, 255, 255, .18)),
    radial-gradient(circle at 50% 0, rgba(37, 99, 235, .055), transparent 33%),
    #edf1f5;
  scrollbar-color: #cbd5e1 transparent;
}

.canvas-toolbar {
  max-width: 920px;
  margin-bottom: 14px;
  align-items: center;
}

.canvas-toolbar h1 {
  font-size: 24px;
  line-height: 1.08;
  letter-spacing: -.045em;
}

.zoom-tools {
  padding: 4px;
  gap: 5px;
  border-color: var(--studio-line);
  background: rgba(255, 255, 255, .92);
  box-shadow: var(--studio-shadow-sm);
}

.zoom-tools button {
  width: 29px;
  height: 29px;
  background: #111827;
  font-size: 17px;
  transition: transform .15s ease, background .15s ease;
}

.zoom-tools button:hover {
  transform: scale(1.05);
  background: #2563eb;
}

.zoom-tools span {
  min-width: 44px;
  font-size: 11.5px;
}

.page-wrap {
  min-width: calc(794px * var(--zoom) + 48px);
  min-height: calc(1123px * var(--zoom) + 48px);
  padding: 24px;
}

.resume-page {
  border: 1px solid rgba(203, 213, 225, .72);
  border-radius: 6px;
  box-shadow: var(--studio-shadow-page);
}

/* Right rail summary */
.right-card {
  padding: 14px;
  margin-bottom: 10px;
  border-radius: 14px;
}

.right-card.hero-summary {
  border-color: #dbeafe;
  background: linear-gradient(145deg, #ffffff, #f8fbff);
}

.mini-head {
  margin-bottom: 8px;
  color: #64748b;
  font-size: 9.5px;
  letter-spacing: .12em;
}

.hero-summary strong {
  font-size: 17px;
  line-height: 1.2;
}

.hero-summary p,
.note-card p {
  margin-top: 6px;
  font-size: 11.5px;
  line-height: 1.5;
}

.quick-grid {
  gap: 6px;
  margin-top: 10px;
}

.quick-grid button {
  min-height: 34px;
  padding: 7px;
  font-size: 10.5px;
}

.ats-list {
  gap: 8px;
  font-size: 11.5px;
}

.ok-dot,
.warn-dot {
  width: 7px;
  height: 7px;
}

.resume-check-disclaimer {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--studio-line);
  color: var(--studio-subtle);
  font-size: 10px;
}

/* Onboarding: one premium surface instead of an oversized modal. */
.slidecv-qna-overlay {
  padding: 24px !important;
  background:
    radial-gradient(circle at 18% 2%, rgba(37, 99, 235, .20), transparent 28%),
    rgba(15, 23, 42, .56) !important;
  backdrop-filter: blur(16px) saturate(120%) !important;
}

.slidecv-qna-card {
  width: min(640px, 100%) !important;
  max-height: min(760px, calc(100dvh - 48px)) !important;
  padding: 30px !important;
  border: 1px solid rgba(255, 255, 255, .72) !important;
  border-radius: 24px !important;
  background: #fff !important;
  box-shadow: 0 40px 110px rgba(15, 23, 42, .34) !important;
  scrollbar-color: #cbd5e1 transparent;
}

.slidecv-qna-badge {
  padding: 6px 10px !important;
  border: 1px solid #dbeafe;
  background: #eff6ff !important;
  font-size: 10px !important;
  letter-spacing: .12em !important;
}

.slidecv-qna-card h1 {
  max-width: none !important;
  margin: 14px 0 8px !important;
  font-size: clamp(38px, 5vw, 50px) !important;
  line-height: .98 !important;
  letter-spacing: -.055em !important;
}

.slidecv-qna-card > p:not(.slidecv-qna-note) {
  max-width: 52ch;
  color: #64748b !important;
  font-size: 14px !important;
  line-height: 1.55 !important;
}

.slidecv-qna-grid {
  gap: 12px !important;
  margin-top: 20px !important;
}

.slidecv-qna-field {
  gap: 6px !important;
}

.slidecv-qna-field label {
  color: #334155 !important;
  font-size: 11px !important;
  font-weight: 850 !important;
}

.slidecv-qna-field input,
.slidecv-qna-field textarea {
  min-height: 43px;
  padding: 10px 12px !important;
  border-color: var(--studio-line) !important;
  border-radius: 11px !important;
  font-size: 13px !important;
}

.slidecv-qna-field textarea {
  min-height: 78px !important;
}

.slidecv-qna-field input:focus,
.slidecv-qna-field textarea:focus {
  border-color: #2563eb !important;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .10) !important;
}

.slidecv-qna-actions {
  position: sticky;
  bottom: -30px;
  z-index: 2;
  margin: 18px -30px -30px !important;
  padding: 16px 30px 20px;
  border-top: 1px solid var(--studio-line);
  background: rgba(255, 255, 255, .96);
  backdrop-filter: blur(14px);
}

.slidecv-qna-actions button {
  min-height: 44px !important;
  border-radius: 11px !important;
  padding-inline: 16px !important;
  font-size: 12px;
}

.slidecv-qna-skip {
  border-color: var(--studio-line) !important;
  color: #475569 !important;
}

.slidecv-qna-start {
  border-color: #111827 !important;
  background: #111827 !important;
  box-shadow: none !important;
}

.slidecv-qna-start:hover {
  background: #020617 !important;
  box-shadow: 0 12px 30px rgba(15, 23, 42, .16) !important;
}

.slidecv-qna-note {
  margin-top: 10px !important;
  color: #94a3b8 !important;
  font-size: 10.5px !important;
}

/* Cookie consent: quiet, compact, and subordinate to onboarding. */
.slidecv-cookie-consent {
  left: 16px !important;
  right: 16px !important;
  bottom: 16px !important;
}

.slidecv-cookie-card {
  width: min(100%, 880px) !important;
  grid-template-columns: minmax(0, 1fr) auto !important;
  gap: 14px !important;
  padding: 14px !important;
  border: 1px solid rgba(255, 255, 255, .12) !important;
  border-radius: 18px !important;
  background: rgba(15, 23, 42, .96) !important;
  box-shadow: 0 24px 70px rgba(15, 23, 42, .28) !important;
}

.slidecv-cookie-copy {
  gap: 4px !important;
}

.slidecv-cookie-title {
  font-size: 14px !important;
}

.slidecv-cookie-text {
  font-size: 11.5px !important;
  line-height: 1.5 !important;
}

.slidecv-cookie-actions {
  gap: 7px !important;
}

.slidecv-cookie-btn {
  height: 36px !important;
  padding: 0 12px !important;
  font-size: 10.5px !important;
}

.slidecv-cookie-btn.primary {
  background: #2563eb !important;
  box-shadow: none !important;
}

.slidecv-cookie-btn.secondary {
  background: #fff !important;
}

.slidecv-cookie-btn.ghost {
  background: rgba(255, 255, 255, .08) !important;
}

.slidecv-cookie-floating-settings {
  width: 38px !important;
  height: 38px !important;
  border-radius: 12px !important;
  box-shadow: var(--studio-shadow-sm) !important;
  font-size: 15px !important;
}

/* Toast */
#slidecv-ux-toast {
  bottom: 22px;
  padding: 10px 14px;
  border: 1px solid rgba(255, 255, 255, .10);
  border-radius: 12px;
  background: rgba(15, 23, 42, .96);
  font-size: 11.5px;
  box-shadow: 0 16px 42px rgba(15, 23, 42, .22);
  backdrop-filter: blur(12px);
}

@media (max-width: 1480px) {
  .workspace {
    grid-template-columns: 68px clamp(320px, 25vw, 360px) minmax(520px, 1fr);
  }

  .right-panel {
    display: none;
  }
}

@media (max-width: 1080px) {
  .workspace {
    grid-template-columns: 66px 330px minmax(500px, 1fr);
  }
}

@media (max-width: 900px) {
  body {
    background: #f5f7fa;
  }

  .topbar {
    min-height: 60px;
    padding: 9px 11px;
  }

  .brand-mark span {
    width: 33px;
    height: 33px;
    border-radius: 10px;
  }

  .top-actions .soft-btn,
  .top-actions .primary-btn {
    min-width: 39px;
    min-height: 39px;
    border-radius: 11px;
  }

  .mobile-builder-view-switch {
    top: 60px;
    width: min(100% - 20px, 430px);
    margin-top: 8px;
    padding: 3px;
    border-color: var(--studio-line);
    border-radius: 13px;
    box-shadow: var(--studio-shadow-sm);
  }

  .mobile-builder-view-switch button {
    min-height: 36px;
    border-radius: 10px;
    color: #64748b;
    font-size: 12px;
  }

  .mobile-builder-view-switch button[aria-pressed='true'] {
    background: #111827;
  }

  .workspace {
    min-height: calc(100vh - 60px);
    padding-bottom: 68px;
  }

  .left-panel {
    border-bottom-color: var(--studio-line);
    background: #fff;
  }

  .panel-inner {
    padding: 16px 12px 24px;
  }

  .panel-heading h2 {
    font-size: 23px;
  }

  .panel-heading span {
    font-size: 12px;
  }

  .rail {
    left: 8px;
    right: 8px;
    bottom: 8px;
    padding: 5px;
    gap: 3px;
    border-color: rgba(203, 213, 225, .92);
    border-radius: 17px;
    background: rgba(255, 255, 255, .97);
    box-shadow: 0 16px 40px rgba(15, 23, 42, .16);
  }

  .rail button {
    min-height: 46px;
    border-radius: 12px;
    font-size: 9px;
  }

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

  .field input,
  .field textarea,
  .field select,
  .control-field select {
    min-height: 44px;
    font-size: 16px;
  }

  .template-card {
    min-height: 126px;
    grid-template-columns: 70px minmax(0, 1fr);
  }

  .preview-stage {
    padding: 12px 0 24px;
  }

  html[data-mobile-builder-view='preview'] .canvas-toolbar {
    top: 112px;
    width: calc(100% - 20px);
    margin: 0 auto 8px;
    padding: 9px;
    border-color: var(--studio-line);
    border-radius: 13px;
    box-shadow: var(--studio-shadow-sm);
  }

  .canvas-toolbar h1 {
    font-size: 18px;
  }

  .page-wrap {
    padding-top: 10px;
  }

  .resume-page {
    border-radius: 4px;
    box-shadow: 0 18px 50px rgba(15, 23, 42, .18);
  }

  .slidecv-qna-overlay {
    padding: 8px !important;
    align-items: end !important;
  }

  .slidecv-qna-card {
    max-height: calc(100dvh - 16px) !important;
    padding: 22px 20px 0 !important;
    border-radius: 22px 22px 14px 14px !important;
  }

  .slidecv-qna-card h1 {
    margin-top: 12px !important;
    font-size: 37px !important;
  }

  .slidecv-qna-grid {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }

  .slidecv-qna-actions {
    bottom: 0;
    grid-template-columns: 1fr !important;
    margin: 16px -20px 0 !important;
    padding: 13px 20px calc(14px + env(safe-area-inset-bottom));
  }

  .slidecv-qna-start {
    order: -1;
  }

  .slidecv-cookie-consent {
    left: 8px !important;
    right: 8px !important;
    bottom: 8px !important;
  }

  .slidecv-cookie-card {
    grid-template-columns: 1fr !important;
    gap: 11px !important;
    padding: 14px !important;
    border-radius: 16px !important;
  }

  .slidecv-cookie-actions {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
  }

  .slidecv-cookie-btn.primary {
    grid-column: 1 / -1;
  }
}

@media (max-width: 430px) {
  .brand-mark small {
    display: none;
  }

  .topbar {
    padding-inline: 9px;
  }

  .panel-inner {
    padding-inline: 10px;
  }

  .section-tabs button {
    font-size: 11px;
  }

  .slidecv-qna-card {
    padding-inline: 18px !important;
  }

  .slidecv-qna-actions {
    margin-inline: -18px !important;
    padding-inline: 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
  }
}

@media print {
  .slidecv-qna-overlay,
  .slidecv-cookie-consent,
  .slidecv-cookie-floating-settings,
  #slidecv-ux-toast {
    display: none !important;
  }
}
