/* Layout */
.rb-container {
  display: grid;
  grid-template-columns: 420px 1fr;
  gap: 1.5rem;
  align-items: start;
}
@media (max-width: 960px) {
  .rb-container { grid-template-columns: 1fr; }
}

/* Form panel */
.rb-form-panel { display: flex; flex-direction: column; gap: 0.75rem; }

.rb-section-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  font-weight: 700;
  opacity: 0.55;
  margin-bottom: 0.65rem;
}
.rb-optional { font-weight: 400; opacity: 0.5; text-transform: none; letter-spacing: 0; }

/* Profile bar */
.rb-profile-bar { display: flex; align-items: center; gap: 0.5rem; padding: 0.7rem 0.85rem; flex-wrap: wrap; }
.rb-profile-select { flex: 1 1 140px; min-width: 0; background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.12);
  color: inherit; font-family: inherit; font-size: 0.85rem; padding: 0.5rem 0.6rem; border-radius: 8px; cursor: pointer; }
.rb-profile-select:focus { outline: none; border-color: rgba(96,213,250,0.4); }
.rb-profile-btn { padding: 0.5rem 0.65rem; font-size: 0.8rem; white-space: nowrap; }
.rb-profile-del { padding: 0.5rem 0.7rem; }
.rb-profile-del:disabled { opacity: 0.35; cursor: not-allowed; }
@media (max-width: 480px) { .rb-profile-bar { gap: 0.4rem; } .rb-profile-select { flex-basis: 100%; } }

/* Template buttons */
.rb-templates { padding: 0.85rem 1.25rem; }
.rb-tmpl-btns { display: flex; gap: 0.5rem; }
.rb-tmpl-btn {
  flex: 1;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.04);
  color: inherit;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.rb-tmpl-btn:hover { background: rgba(255,255,255,0.08); }
.rb-tmpl-btn.active {
  background: rgba(96,213,250,0.15);
  border-color: rgba(96,213,250,0.5);
  color: #60d5fa;
}

/* Section cards */
.rb-section-card { padding: 1rem 1.25rem; }

.rb-field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}
.rb-field { display: flex; flex-direction: column; gap: 0.25rem; }
.rb-field-full { grid-column: 1 / -1; }
.rb-field label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  opacity: 0.5;
  font-weight: 600;
}
.rb-section-card input[type="text"],
.rb-section-card input[type="email"],
.rb-section-card input[type="tel"],
.rb-section-card textarea {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  padding: 0.45rem 0.65rem;
  color: inherit;
  font-family: inherit;
  font-size: 0.88rem;
  outline: none;
  width: 100%;
  box-sizing: border-box;
  resize: vertical;
  transition: border-color 0.15s;
}
.rb-section-card input:focus,
.rb-section-card textarea:focus { border-color: rgba(96,213,250,0.4); }
.rb-hint { font-size: 0.74rem; opacity: 0.4; margin-top: 0.25rem; }

/* Repeating entries (experience / education) */
.rb-entry {
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  padding: 0.75rem;
  margin-bottom: 0.6rem;
  background: rgba(255,255,255,0.02);
  transition: box-shadow .15s, border-color .15s;
}
.rb-entry:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.rb-entry.dragging { box-shadow: var(--shadow); border-color: var(--accent); }
.rb-entry-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  user-select: none;
}
.rb-entry-handle { color: rgba(255,255,255,0.4); flex-shrink: 0; display: grid; place-items: center; }
.rb-entry-handle:hover { color: rgba(255,255,255,0.75); }
.rb-entry-title-input {
  flex: 1;
  background: transparent;
  border: none;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  border-radius: 0;
  color: inherit;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.2rem 0;
  outline: none;
}
.rb-entry-del {
  background: none;
  border: none;
  cursor: pointer;
  opacity: 0.35;
  color: inherit;
  font-size: 0.9rem;
  padding: 0.15rem;
  line-height: 1;
  border-radius: 4px;
  transition: opacity 0.15s;
}
.rb-entry-del:hover { opacity: 0.9; }
.rb-entry .rb-field-grid { margin-top: 0.5rem; }
.rb-entry textarea { min-height: 70px; }

.rb-add-btn {
  width: 100%;
  text-align: center;
  background: rgba(255,255,255,0.04);
  border: 1px dashed rgba(255,255,255,0.15);
  font-size: 0.85rem;
  padding: 0.5rem;
  margin-top: 0.25rem;
}
.rb-add-btn:hover { background: rgba(255,255,255,0.08); }

.rb-download-btn {
  width: 100%;
  padding: 0.85rem;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

/* Preview panel */
.rb-preview-panel {
  position: sticky;
  top: 80px;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
@media (max-width: 960px) {
  .rb-preview-panel { position: static; }
}
.rb-preview-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8rem;
  opacity: 0.5;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.rb-fullscreen-btn {
  font-size: 0.78rem;
  padding: 0.25rem 0.6rem;
  opacity: 1;
}
.rb-preview-wrap {
  background: #f5f5f5;
  border-radius: 12px;
  overflow: hidden;
  aspect-ratio: 8.5 / 11;
  box-shadow: 0 8px 40px rgba(0,0,0,0.4);
}
.rb-preview-frame {
  width: 100%;
  height: 100%;
  border: none;
  background: white;
}
