/* Resume Builder studio */
.resume-page .workspace-inner { max-width: 1180px; }

.resume-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.85rem 1.25rem;
  margin-bottom: 0.5rem;
  padding: 0.85rem 1rem;
  background: var(--bg-elev, #15202b);
  border: 1px solid var(--line, rgba(255,255,255,0.08));
  border-radius: 14px;
}

.rs-pick {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted, #9aa7b5);
}

.rs-pick select,
.rs-pick input[type="color"] {
  min-width: 140px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.12);
  background: #0f1720;
  color: #e8eef4;
  padding: 0.4rem 0.55rem;
  font: inherit;
}

.rs-pick input[type="color"] {
  height: 36px;
  padding: 0.2rem;
  min-width: 64px;
  cursor: pointer;
}

.rs-toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-left: auto;
}

.rs-keep-hint {
  margin: 0.35rem 0 1rem;
  min-height: 1.2em;
  font-size: 0.86rem;
  color: var(--muted, #9aa7b5);
}

.resume-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 380px);
  gap: 1.25rem;
  align-items: start;
  margin-bottom: 1.25rem;
}

.resume-editor {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.rs-section {
  margin: 0;
  padding: 1.15rem 1.2rem 1.25rem;
  border: 1px solid rgba(28, 36, 48, 0.12);
  border-radius: 16px;
  background: #fffdf9;
  color: #1c2430;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
}

.rs-section-title {
  display: block;
  margin: 0 0 0.95rem;
  padding: 0.35rem 0.65rem;
  border-radius: 8px;
  background: #e8f3ef;
  border-left: 4px solid #1a6b5c;
  font-family: var(--display, Georgia, serif);
  font-size: 1.12rem;
  font-weight: 700;
  line-height: 1.3;
  color: #0b3d36 !important;
}

.rs-section-title span {
  margin-left: 0.4rem;
  font-family: var(--sans, inherit);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #5a726c;
  vertical-align: middle;
}

.rs-section label {
  display: block;
  margin-bottom: 0.65rem;
  font-size: 0.84rem;
  font-weight: 600;
  color: #4a5565;
}

.rs-section label em {
  font-style: normal;
  font-weight: 500;
  color: #8a949f;
  font-size: 0.78rem;
}

.rs-section input[type="text"],
.rs-section input[type="email"],
.rs-section input[type="tel"],
.rs-section input[type="url"],
.rs-section input[type="month"],
.rs-section select,
.rs-section textarea {
  display: block;
  width: 100%;
  margin-top: 0.28rem;
  border: 1px solid rgba(28, 36, 48, 0.14);
  border-radius: 8px;
  padding: 0.48rem 0.65rem;
  font: inherit;
  font-weight: 400;
  color: #1c2430;
  background: #f5f8f7;
}

.rs-section input:focus,
.rs-section select:focus,
.rs-section textarea:focus {
  outline: 2px solid rgba(26, 107, 92, 0.35);
  border-color: #1a6b5c;
  background: #fff;
}

.rs-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem 0.85rem;
}

.rs-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.65rem 0.85rem;
}

.rs-check {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.35rem;
  font-size: 0.8rem;
  font-weight: 500;
}

.rs-check input { width: auto; margin: 0; }

.rs-file-input {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  border: 0 !important;
  opacity: 0 !important;
}

.rs-photo-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
}

.rs-photo-hint {
  margin: 0;
  flex: 1;
  min-width: 160px;
  font-size: 0.86rem;
  font-weight: 500;
  color: #5c6978;
  line-height: 1.45;
}

.rs-photo-box {
  position: relative;
  width: 132px;
  height: 132px;
  border-radius: 16px;
  border: 2px dashed rgba(26, 107, 92, 0.45);
  overflow: hidden;
  background: #eef4f2;
  flex-shrink: 0;
  cursor: pointer;
}

.rs-photo-box.has-photo {
  border-style: solid;
  border-color: #1a6b5c;
  cursor: default;
}

.rs-photo-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  margin: 0 !important;
  padding: 0.75rem;
  border: 0;
  background: transparent;
  cursor: pointer;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  color: #1a6b5c;
  text-align: center;
  line-height: 1.35;
  appearance: none;
  -webkit-appearance: none;
}

.rs-photo-btn small {
  display: block;
  margin-top: 0.35rem;
  opacity: 0.8;
  font-size: 0.7rem;
  font-weight: 500;
  color: #5c6978;
}

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

.rs-photo-remove {
  position: absolute;
  top: 6px;
  right: 6px;
  z-index: 3;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 50%;
  background: rgba(21, 32, 43, 0.8);
  color: #fff;
  cursor: pointer;
  font-size: 1.05rem;
  line-height: 1;
}

.rs-sig-block {
  padding: 0.85rem;
  border-radius: 12px;
  border: 1px solid rgba(28, 36, 48, 0.1);
  background: rgba(255, 255, 255, 0.72);
}

.rs-sig-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.55rem;
}

.rs-sig-label {
  font-size: 0.84rem;
  font-weight: 700;
  color: #1a6b5c;
}

.rs-sig-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}

.rs-sig-btn {
  display: inline-flex;
  align-items: center;
  margin: 0 !important;
  padding: 0.35rem 0.7rem;
  border-radius: 8px;
  border: 1px solid rgba(28, 36, 48, 0.16);
  background: #f5f8f7;
  color: #1c2430;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
}

.rs-sig-btn:hover { border-color: #1a6b5c; color: #1a6b5c; }

.rs-sig-pad-wrap {
  position: relative;
  border-radius: 10px;
  border: 1px solid rgba(28, 36, 48, 0.14);
  background: #fff;
  overflow: hidden;
  margin-bottom: 0.75rem;
}

#rs-sig-canvas {
  display: block;
  width: 100%;
  height: 150px;
  cursor: crosshair;
  touch-action: none;
}

#rs-sig-image {
  display: block;
  max-width: 100%;
  max-height: 150px;
  margin: 0 auto;
  padding: 0.5rem;
  object-fit: contain;
}

.rs-preview-page .rp-sig {
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid #e2ddd4;
}

.rs-preview-page .rp-sig img {
  display: block;
  max-width: 180px;
  max-height: 56px;
  margin-bottom: 0.25rem;
}

.rs-preview-page .rp-sig-line {
  width: 160px;
  border-top: 1px solid #c5c0b6;
  margin-top: 0.15rem;
  padding-top: 0.25rem;
  font-size: 0.78em;
  color: #5c6978;
}

.rs-preview-page .rp-sig-name {
  font-weight: 700;
  color: #15202b;
}

.rs-repeat-list { display: flex; flex-direction: column; gap: 0.75rem; margin-bottom: 0.75rem; }

.rs-card {
  padding: 0.85rem 0.9rem;
  border-radius: 12px;
  border: 1px solid rgba(28, 36, 48, 0.1);
  background: rgba(255, 255, 255, 0.7);
}

.rs-card-sm { padding: 0.7rem 0.8rem; }

.rs-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.55rem;
}

.rs-card-top strong { font-size: 0.82rem; color: #1a6b5c; }

.rs-remove {
  border: 0;
  background: transparent;
  color: #a14b3a;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0.15rem 0.35rem;
}

.btn-sm { padding: 0.4rem 0.85rem; font-size: 0.85rem; min-width: 0; }

.resume-side-preview {
  position: sticky;
  top: 1rem;
  border-radius: 16px;
  border: 1px solid var(--line, rgba(255,255,255,0.08));
  background: #0e151c;
  overflow: hidden;
  max-height: calc(100vh - 2rem);
  display: flex;
  flex-direction: column;
}

.rs-side-head {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.rs-side-head strong { font-size: 0.92rem; }
.rs-side-head span { font-size: 0.75rem; color: var(--muted, #9aa7b5); }

.rs-side-scroll {
  overflow: auto;
  padding: 0.85rem;
  background: #121a20;
}

.resume-actions {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin-bottom: 2rem;
}

.resume-action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.resume-actions .btn { min-width: 150px; }
.rs-status { margin: 0; color: var(--muted, #9aa7b5); font-size: 0.9rem; }

/* Preview page (inline + modal) */
.rs-preview-page {
  background: #fffdf9;
  color: #1c2430;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.35);
  font-size: 0.78rem;
  line-height: 1.45;
}

.rs-side-scroll .rs-preview-page {
  transform-origin: top center;
  font-size: 0.68rem;
}

.rs-preview-page .rp-accent { height: 7px; }
.rs-preview-page .rp-body { padding: 1.15rem 1.25rem 1.4rem; }
.rs-preview-page .rp-head { display: flex; gap: 0.85rem; align-items: flex-start; margin-bottom: 0.85rem; }
.rs-preview-page .rp-photo {
  width: 64px;
  height: 64px;
  border-radius: 10px;
  object-fit: cover;
  flex-shrink: 0;
  background: #e8efec;
}
.rs-preview-page .rp-name {
  margin: 0;
  font-family: var(--display, Georgia, serif);
  font-size: 1.45em;
  line-height: 1.15;
  color: #15202b;
}
.rs-preview-page .rp-title { margin: 0.15rem 0 0.35rem; font-weight: 600; color: var(--rs-accent, #1a6b5c); }
.rs-preview-page .rp-contact { margin: 0; color: #5c6978; font-size: 0.92em; }
.rs-preview-page .rp-contact a { color: inherit; text-decoration: none; }
.rs-preview-page .rp-sec { margin-top: 0.85rem; }
.rs-preview-page .rp-sec-title {
  margin: 0 0 0.4rem;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--rs-accent, #1a6b5c);
  border-bottom: 1.5px solid rgba(26, 107, 92, 0.25);
  padding-bottom: 0.2rem;
}
.rs-preview-page .rp-item { margin-bottom: 0.55rem; }
.rs-preview-page .rp-item-top {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.25rem 0.75rem;
}
.rs-preview-page .rp-item-top strong { color: #15202b; }
.rs-preview-page .rp-meta { color: #5c6978; font-size: 0.92em; }
.rs-preview-page .rp-bullets { margin: 0.25rem 0 0; padding-left: 1.1em; }
.rs-preview-page .rp-bullets li { margin-bottom: 0.15rem; }
.rs-preview-page .rp-chips { display: flex; flex-wrap: wrap; gap: 0.3rem; margin: 0; padding: 0; list-style: none; }
.rs-preview-page .rp-chips li {
  background: #eef5f2;
  border-radius: 999px;
  padding: 0.15rem 0.55rem;
  font-size: 0.88em;
}
.rs-preview-page.tpl-classic .rp-name { text-align: center; }
.rs-preview-page.tpl-classic .rp-head { flex-direction: column; align-items: center; text-align: center; }
.rs-preview-page.tpl-classic .rp-contact { text-align: center; }
.rs-preview-page.tpl-compact .rp-body { padding: 0.9rem 1rem; }
.rs-preview-page.tpl-compact .rp-sec { margin-top: 0.55rem; }
.rs-preview-page.tpl-compact .rp-name { font-size: 1.25em; }

.rs-preview-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(8, 14, 18, 0.72);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: stretch;
  justify-content: center;
  padding: 1rem;
}

.rs-preview-overlay[hidden] { display: none !important; }

.rs-preview-dialog {
  width: min(860px, 100%);
  max-height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--bg-elev, #15202b);
  border: 1px solid var(--line, rgba(255,255,255,0.08));
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.45);
}

.rs-preview-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 1.1rem;
  border-bottom: 1px solid var(--line, rgba(255,255,255,0.08));
}

.rs-preview-bar h2 {
  margin: 0;
  font-size: 1.05rem;
  font-family: var(--display, Georgia, serif);
}

.rs-preview-bar-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }

.rs-preview-scroll {
  overflow: auto;
  padding: 1.25rem;
  background: #121a20;
}

.rs-preview-scroll .rs-preview-page {
  width: min(720px, 100%);
  margin: 0 auto;
  font-size: 0.92rem;
}

@media (max-width: 960px) {
  .resume-layout { grid-template-columns: 1fr; }
  .resume-side-preview {
    position: relative;
    top: 0;
    max-height: 420px;
  }
}

@media (max-width: 720px) {
  .rs-grid-2, .rs-grid-3 { grid-template-columns: 1fr; }
  .rs-toolbar-actions { margin-left: 0; width: 100%; }
}
