/* ================================================================
   user-styles.css — McGheeLab User System
   Dashboard, Story Editor, Admin Panel, Auth Forms, Opportunities
   ── Dark theme to match main site (--bg, --surface, --accent, etc.)
   ================================================================ */

/* ─── Auth Page ──────────────────────────────────────────────── */
.user-auth-page {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 2rem 1rem;
  min-height: 50vh;
}

.auth-card {
  background: var(--surface, #121620);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: var(--radius, 12px);
  padding: 2rem;
  max-width: 420px;
  width: 100%;
  box-shadow: var(--shadow, 0 10px 30px rgba(0,0,0,.25));
}

.auth-card h2 {
  margin: 0 0 .5rem;
  color: var(--text, #eef2f7);
}

.auth-subtitle {
  color: var(--muted, #a8b3c7);
  margin-bottom: 1.5rem;
}

.auth-form .form-group {
  margin-bottom: 1rem;
}

.auth-error {
  background: rgba(185,28,28,.15);
  color: #fca5a5;
  padding: .75rem 1rem;
  border-radius: 6px;
  margin-bottom: 1rem;
  font-size: .9rem;
}

/* ─── Forms (shared) ─────────────────────────────────────────── */
.form-group {
  display: flex;
  flex-direction: column;
  gap: .35rem;
}

.form-group label {
  font-weight: 600;
  font-size: .875rem;
  color: var(--text, #eef2f7);
}

.form-group input,
.form-group textarea,
.form-group select {
  padding: .6rem .75rem;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 6px;
  font-size: .95rem;
  font-family: inherit;
  background: rgba(255,255,255,.04);
  color: var(--text, #eef2f7);
  transition: border-color .15s;
}

.form-group select option {
  background: var(--surface, #121620);
  color: var(--text, #eef2f7);
}

/* Page-level text colors */
.dashboard-page,
.story-editor-page,
.admin-page,
.user-auth-page,
.guide-page,
.opportunities-page {
  color: var(--text, #eef2f7);
}

.dash-card h3,
.editor-header h2,
.admin-page h2 {
  color: var(--text, #eef2f7);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--accent, #5baed1);
  box-shadow: 0 0 0 3px rgba(91,174,209,.2);
}

.form-status {
  margin-top: .75rem;
  padding: .5rem .75rem;
  border-radius: 6px;
  font-size: .875rem;
}

.form-status.success {
  background: rgba(22,101,52,.2);
  color: #86efac;
}

.form-status.error {
  background: rgba(185,28,28,.15);
  color: #fca5a5;
}

/* ─── Buttons ────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  padding: .6rem 1.25rem;
  border: none;
  border-radius: 6px;
  font-size: .9rem;
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, opacity .15s, filter .15s;
  text-decoration: none;
}

.btn:disabled {
  opacity: .5;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--accent, #5baed1);
  color: #031a16;
}

.btn-primary:hover:not(:disabled) {
  filter: brightness(1.15);
}

.btn-secondary {
  background: var(--surface-2, #1a2030);
  color: var(--text, #eef2f7);
  border: 1px solid rgba(255,255,255,.1);
}

.btn-secondary:hover:not(:disabled) {
  background: rgba(255,255,255,.08);
}

.btn-danger {
  background: rgba(185,28,28,.15);
  color: #fca5a5;
}

.btn-danger:hover:not(:disabled) {
  background: rgba(185,28,28,.25);
}

.btn-small {
  padding: .35rem .75rem;
  font-size: .8rem;
}

.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 6px;
  background: var(--surface-2, #1a2030);
  color: var(--text, #eef2f7);
  cursor: pointer;
  font-size: 1rem;
  transition: background .15s;
}

.btn-icon:hover {
  background: rgba(255,255,255,.08);
}

.btn-danger-icon {
  color: #fca5a5;
  border-color: rgba(185,28,28,.3);
}

.btn-danger-icon:hover {
  background: rgba(185,28,28,.15);
}

/* ─── Dashboard ──────────────────────────────────────────────── */
.dashboard-page {
  padding: 1.5rem 1rem;
  max-width: 1000px;
  margin: 0 auto;
}

.dash-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.dash-header h2 {
  margin: 0;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

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

.dash-card {
  background: linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.02));
  border: 1px solid rgba(255,255,255,.08);
  border-radius: var(--radius, 12px);
  padding: 1.5rem;
  box-shadow: var(--shadow, 0 10px 30px rgba(0,0,0,.25));
}

.dash-card-full {
  grid-column: 1 / -1;
}

.dash-card h3 {
  margin: 0 0 1rem;
}

.card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.card-head h3 {
  margin: 0;
}

.card-head-actions {
  display: flex;
  gap: .35rem;
  align-items: center;
}

/* Profile */
.profile-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.profile-photo-section {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.profile-photo-preview {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--surface-2, #1a2030);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.profile-photo-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-placeholder {
  font-size: .75rem;
  color: var(--muted, #a8b3c7);
  text-align: center;
}

.upload-label {
  cursor: pointer;
}

/* Stories list */
.stories-list {
  display: flex;
  flex-direction: column;
  gap: .5rem;
}

.story-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: .75rem;
  background: rgba(255,255,255,.03);
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 8px;
  gap: .5rem;
}

.story-item-info {
  display: flex;
  align-items: center;
  gap: .75rem;
  min-width: 0;
}

.story-item-info strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text, #eef2f7);
}

.story-item-actions {
  display: flex;
  gap: .35rem;
  flex-shrink: 0;
}

.empty-state {
  color: var(--muted, #a8b3c7);
  text-align: center;
  padding: 2rem 1rem;
}

.loading-text {
  color: var(--muted, #a8b3c7);
  text-align: center;
}

.error-text {
  color: #fca5a5;
}

/* ─── Status Badges ──────────────────────────────────────────── */
.status-badge {
  display: inline-block;
  padding: .2rem .6rem;
  border-radius: 9999px;
  font-size: .75rem;
  font-weight: 600;
  text-transform: capitalize;
}

.status-draft    { background: rgba(255,255,255,.06); color: var(--muted, #a8b3c7); }
.status-pending  { background: rgba(234,179,8,.15); color: #fde68a; }
.status-published { background: rgba(34,197,94,.15); color: #86efac; }
.status-active   { background: rgba(34,197,94,.15); color: #86efac; }
.status-used     { background: rgba(255,255,255,.04); color: rgba(168,179,199,.5); }
.status-expired  { background: rgba(185,28,28,.15); color: #fca5a5; }

/* ─── Story Editor ───────────────────────────────────────────── */
.story-editor-page {
  padding: 1.5rem 1rem;
  max-width: 800px;
  margin: 0 auto;
}

.editor-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.editor-header h2 {
  margin: 0;
}

.story-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.story-form h3 {
  margin: 1rem 0 0;
  color: var(--text, #eef2f7);
}

.hint {
  color: var(--muted, #a8b3c7);
  font-size: .85rem;
  margin: 0;
}

.page-subtitle {
  color: var(--muted, #a8b3c7);
  margin-bottom: 1.5rem;
}

/* Section blocks */
.sections-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.section-block {
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 10px;
  padding: 1rem;
  background: rgba(255,255,255,.02);
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: .75rem;
}

.section-label {
  font-weight: 600;
  font-size: .875rem;
  color: var(--muted, #a8b3c7);
}

.section-controls {
  display: flex;
  gap: .25rem;
}

.section-image-area,
.section-media-area {
  display: flex;
  flex-direction: column;
  gap: .5rem;
  margin-top: .5rem;
}

.image-upload-zone,
.media-upload-zone {
  border: 2px dashed rgba(255,255,255,.15);
  border-radius: 8px;
  padding: 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: border-color .15s, background .15s;
  min-height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.image-upload-zone:hover,
.image-upload-zone.drag-over,
.media-upload-zone:hover,
.media-upload-zone.drag-over {
  border-color: var(--accent, #5baed1);
  background: rgba(91,174,209,.06);
}

.upload-hint {
  color: var(--muted, #a8b3c7);
  font-size: .85rem;
  margin: 0;
}

.section-img-preview {
  max-width: 100%;
  max-height: 240px;
  border-radius: 6px;
  object-fit: contain;
}

.section-video-preview,
.preview-video {
  max-width: 100%;
  max-height: 300px;
  border-radius: 6px;
}

.story-video {
  width: 100%;
  max-height: 400px;
  border-radius: 6px;
  object-fit: contain;
}

.image-progress,
.media-progress {
  font-size: .85rem;
  color: var(--accent, #5baed1);
}

/* Editor actions bar */
.editor-actions {
  display: flex;
  gap: .75rem;
  flex-wrap: wrap;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255,255,255,.08);
}

/* ─── Preview Modal ──────────────────────────────────────────── */
.modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,.7);
  padding: 1rem;
}

.modal[hidden] {
  display: none;
}

.modal-content {
  background: var(--surface, #121620);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: var(--radius, 12px);
  max-width: 800px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  padding: 1.5rem;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.modal-header h3 {
  margin: 0;
  color: var(--text, #eef2f7);
}

.preview-media {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin: 1rem 0;
  align-items: start;
}

.preview-media.text-only {
  grid-template-columns: 1fr;
}

.preview-img {
  max-width: 100%;
  border-radius: 8px;
}

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

/* ─── Admin Panel ────────────────────────────────────────────── */
.admin-page {
  padding: 1.5rem 1rem;
  max-width: 1000px;
  margin: 0 auto;
}

.admin-page h2 {
  margin: 0 0 1rem;
}

.admin-tabs {
  display: flex;
  gap: .5rem;
  margin-bottom: 1.5rem;
  border-bottom: 2px solid rgba(255,255,255,.08);
  padding-bottom: 0;
  overflow-x: auto;
}

.tab-btn {
  padding: .5rem 1.25rem;
  border: none;
  background: none;
  font-size: .9rem;
  font-weight: 600;
  font-family: inherit;
  color: var(--muted, #a8b3c7);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color .15s, border-color .15s;
  white-space: nowrap;
}

.tab-btn:hover {
  color: var(--text, #eef2f7);
}

.tab-btn.active {
  color: var(--accent, #5baed1);
  border-bottom-color: var(--accent, #5baed1);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .875rem;
}

.admin-table th {
  text-align: left;
  padding: .5rem .75rem;
  border-bottom: 2px solid rgba(255,255,255,.08);
  font-weight: 600;
  color: var(--muted, #a8b3c7);
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .03em;
}

.admin-table td {
  padding: .6rem .75rem;
  border-bottom: 1px solid rgba(255,255,255,.04);
  vertical-align: middle;
}

.admin-table tr.row-used td,
.admin-table tr.row-expired td {
  opacity: .5;
}

.role-select {
  padding: .3rem .5rem;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 4px;
  font-size: .85rem;
  font-family: inherit;
  background: rgba(255,255,255,.04);
  color: var(--text, #eef2f7);
}

.role-select option {
  background: var(--surface, #121620);
}

/* Invitation form */
.inv-form-section {
  background: rgba(255,255,255,.02);
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 10px;
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}

.inv-form-section h3 {
  margin: 0 0 .75rem;
}

.inline-form {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
  align-items: flex-end;
}

.inline-form input,
.inline-form select {
  padding: .5rem .6rem;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 6px;
  font-size: .85rem;
  font-family: inherit;
  background: rgba(255,255,255,.04);
  color: var(--text, #eef2f7);
}

.inline-form select option {
  background: var(--surface, #121620);
}

.inline-form input[type="email"] {
  min-width: 180px;
}

.copy-row {
  display: flex;
  gap: .5rem;
  margin-top: .5rem;
}

.copy-row input {
  flex: 1;
  padding: .5rem .75rem;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 6px;
  font-size: .85rem;
  font-family: monospace;
  background: rgba(255,255,255,.04);
  color: var(--text, #eef2f7);
}

/* Pending stories */
.pending-card {
  background: rgba(255,255,255,.02);
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 10px;
  padding: 1.25rem;
  margin-bottom: 1rem;
}

.pending-info strong {
  font-size: 1.05rem;
  color: var(--text, #eef2f7);
}

.pending-author {
  color: var(--muted, #a8b3c7);
  font-size: .85rem;
  margin-left: .5rem;
}

.pending-sections {
  margin: .75rem 0;
}

.pending-section-preview {
  display: flex;
  gap: .75rem;
  align-items: flex-start;
  margin-bottom: .5rem;
}

.pending-section-preview p {
  flex: 1;
  font-size: .85rem;
  color: var(--muted, #a8b3c7);
  margin: 0;
}

.pending-section-preview img {
  width: 60px;
  height: 60px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
}

.pending-actions {
  display: flex;
  gap: .5rem;
  margin-top: .75rem;
}

/* Opportunity form in admin */
.opp-form {
  display: flex;
  flex-direction: column;
  gap: .75rem;
}

/* ─── Guide Page ─────────────────────────────────────────────── */
.guide-page {
  padding: 1.5rem 1rem;
  max-width: 760px;
  margin: 0 auto;
}

.guide-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.guide-header h2 {
  margin: 0;
}

.guide-content {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.guide-section {
  background: linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.02));
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 10px;
  padding: 1.5rem;
  box-shadow: var(--shadow, 0 10px 30px rgba(0,0,0,.25));
}

.guide-section h3 {
  margin: 0 0 .75rem;
  color: var(--text, #eef2f7);
  font-size: 1.15rem;
}

.guide-section p {
  margin: .5rem 0;
  line-height: 1.6;
}

.guide-section ul {
  margin: .5rem 0;
  padding-left: 1.5rem;
}

.guide-section li {
  margin-bottom: .4rem;
  line-height: 1.5;
}

.guide-section .highlight {
  background: rgba(91,174,209,.15);
  color: var(--accent, #5baed1);
  padding: .1rem .4rem;
  border-radius: 4px;
  font-weight: 600;
}

.guide-tip {
  background: rgba(34,197,94,.1);
  border-left: 3px solid #22c55e;
  padding: .75rem 1rem;
  border-radius: 0 6px 6px 0;
  margin-top: .75rem;
  font-size: .9rem;
  line-height: 1.5;
  color: #86efac;
}

.guide-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: .75rem;
  font-size: .9rem;
}

.guide-table th {
  text-align: left;
  padding: .5rem .75rem;
  border-bottom: 2px solid rgba(255,255,255,.08);
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .03em;
  color: var(--muted, #a8b3c7);
}

.guide-table td {
  padding: .6rem .75rem;
  border-bottom: 1px solid rgba(255,255,255,.04);
  vertical-align: top;
}

.guide-checklist {
  display: flex;
  flex-direction: column;
  gap: .5rem;
}

.guide-checklist label {
  display: flex;
  align-items: flex-start;
  gap: .5rem;
  font-size: .9rem;
  line-height: 1.5;
  cursor: default;
}

.guide-checklist input[type="checkbox"] {
  margin-top: .25rem;
  flex-shrink: 0;
}

.guide-cta {
  text-align: center;
  background: rgba(91,174,209,.08);
  border: 1px solid rgba(91,174,209,.2);
}

.guide-cta p {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.guide-cta .btn {
  margin: 0 .35rem;
}

/* ─── Opportunities Page ─────────────────────────────────────── */
.opportunities-page {
  padding: 1.5rem 1rem;
  max-width: 900px;
  margin: 0 auto;
}

.opportunities-page h2 {
  margin: 0 0 .25rem;
}

.opportunities-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
  gap: 1.25rem;
}

.opportunity-card {
  background: linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.02));
  border: 1px solid rgba(255,255,255,.08);
  border-radius: var(--radius, 12px);
  padding: 1.5rem;
  box-shadow: var(--shadow, 0 10px 30px rgba(0,0,0,.25));
}

.opportunity-card h3 {
  margin: .5rem 0;
  color: var(--text, #eef2f7);
}

.opp-type-badge {
  display: inline-block;
  padding: .2rem .6rem;
  border-radius: 4px;
  font-size: .7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .03em;
  background: var(--accent, #5baed1);
  color: #031a16;
}

.opp-requirements {
  font-size: .9rem;
  color: var(--muted, #a8b3c7);
  margin: .5rem 0;
  line-height: 1.5;
}

.opp-deadline {
  font-size: .85rem;
  color: var(--muted, #a8b3c7);
}

.opp-contact a {
  color: var(--link, #7cc4ff);
  text-decoration: underline;
  font-weight: 600;
}

.empty-state-card {
  text-align: center;
  padding: 3rem 1.5rem;
  background: linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.02));
  border: 1px solid rgba(255,255,255,.08);
  border-radius: var(--radius, 12px);
  grid-column: 1 / -1;
}

.empty-state-card h3 {
  color: var(--text, #eef2f7);
  margin: 0 0 .5rem;
}

.empty-state-card p {
  color: var(--muted, #a8b3c7);
}

/* ─── Responsive adjustments ─────────────────────────────────── */
@media (max-width: 600px) {
  .inline-form {
    flex-direction: column;
  }

  .inline-form input,
  .inline-form select {
    width: 100%;
  }

  .admin-table {
    font-size: .8rem;
  }

  .admin-table th,
  .admin-table td {
    padding: .4rem .5rem;
  }

  .story-item {
    flex-direction: column;
    align-items: flex-start;
  }

  .story-item-actions {
    width: 100%;
  }
}

/* ================================================================
   STORY TEAM SECTION (expanded view in research/projects)
   ================================================================ */

.story-team {
  padding: 1rem 0;
  border-bottom: 1px solid rgba(255,255,255,.08);
  margin-bottom: 1rem;
}

.story-team-heading,
.story-refs-heading {
  font-size: 1rem;
  font-weight: 600;
  color: var(--accent, #5baed1);
  margin: 0 0 .75rem;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.story-team-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.story-team-member {
  display: flex;
  align-items: center;
  gap: .6rem;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 8px;
  padding: .5rem .75rem;
  min-width: 160px;
}

.story-team-photo {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.story-team-photo-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent, #5baed1);
  color: #031a16;
  font-weight: 700;
  font-size: 1.1rem;
}

.story-team-info {
  display: flex;
  flex-direction: column;
}

.story-team-name {
  font-weight: 600;
  font-size: .9rem;
  color: var(--text, #eef2f7);
}

.story-team-role {
  font-size: .75rem;
  color: var(--muted, #a8b3c7);
  text-transform: uppercase;
  letter-spacing: .03em;
}

/* ================================================================
   STORY REFERENCES (expanded view)
   ================================================================ */

.story-refs {
  padding: 1rem 0 0;
  border-top: 1px solid rgba(255,255,255,.08);
  margin-top: 1rem;
}

.story-refs-category {
  margin-bottom: .75rem;
}

.story-refs-category h5 {
  font-size: .85rem;
  font-weight: 600;
  color: var(--text, #eef2f7);
  margin: 0 0 .35rem;
}

.story-refs-category ul {
  list-style: disc;
  margin: 0;
  padding-left: 1.25rem;
}

.story-refs-category li {
  font-size: .85rem;
  line-height: 1.5;
  margin-bottom: .25rem;
}

.story-refs-category a {
  color: var(--link, #7cc4ff);
  text-decoration: underline;
}

.ref-detail {
  color: var(--muted, #a8b3c7);
  font-size: .8rem;
}

/* ================================================================
   REF BADGES (on unopened cards)
   ================================================================ */

.ref-badges {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
  margin: .5rem 0;
}

.ref-badge {
  display: inline-block;
  padding: .2rem .6rem;
  font-size: .7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .03em;
  border-radius: 4px;
  background: var(--accent, #5baed1);
  color: #031a16;
  text-decoration: none;
  transition: opacity .15s;
}

.ref-badge:hover {
  opacity: .8;
}

/* ================================================================
   STORY EDITOR — TEAM FIELDS & REFERENCE BLOCKS
   ================================================================ */

.team-fields {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.team-fields .form-group {
  flex: 1 1 200px;
}

.team-readonly {
  background: rgba(255,255,255,.02) !important;
  color: var(--muted, #a8b3c7) !important;
  cursor: default;
}

.contributor-select-row {
  display: flex;
  gap: .5rem;
}

.contributor-select-row select {
  flex: 1;
}

.contributor-chips {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
  margin-top: .5rem;
}

.contributor-chip {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  background: var(--accent, #5baed1);
  color: #031a16;
  padding: .25rem .6rem;
  border-radius: 16px;
  font-size: .8rem;
  font-weight: 600;
}

.chip-remove {
  background: none;
  border: none;
  color: #031a16;
  font-size: 1rem;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  opacity: .7;
}

.chip-remove:hover {
  opacity: 1;
}

/* Reference blocks in editor */
.refs-container {
  margin-bottom: 1rem;
}

.ref-block {
  margin-bottom: .5rem;
}

.ref-block-row {
  display: flex;
  gap: .5rem;
  align-items: center;
  flex-wrap: wrap;
}

.ref-block-row select {
  width: 140px;
  flex-shrink: 0;
}

.ref-block-row input[type="text"],
.ref-block-row input[type="url"] {
  flex: 1;
  min-width: 120px;
}

/* Story checkboxes in project editor */
.stories-pool {
  display: flex;
  flex-direction: column;
  gap: .35rem;
  max-height: 240px;
  overflow-y: auto;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 8px;
  padding: .75rem;
}

.story-checkbox {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: .9rem;
  cursor: pointer;
  padding: .35rem;
  border-radius: 4px;
  transition: background .1s;
}

.story-checkbox:hover {
  background: rgba(255,255,255,.04);
}

.story-checkbox input {
  flex-shrink: 0;
}

@media (max-width: 600px) {
  .story-team-grid {
    flex-direction: column;
  }

  .ref-block-row {
    flex-direction: column;
    align-items: stretch;
  }

  .ref-block-row select {
    width: 100%;
  }

  .team-fields {
    flex-direction: column;
  }

  .wizard-steps {
    flex-wrap: wrap;
  }

  .wizard-step {
    font-size: .75rem;
    padding: .4rem .6rem;
  }

  .proj-story-row {
    flex-wrap: wrap;
  }

  .proj-story-add-row {
    flex-direction: column;
  }
}

/* ================================================================
   PROJECT WIZARD
   ================================================================ */

.project-wizard .wizard-steps {
  display: flex;
  gap: .25rem;
  margin-bottom: 1.5rem;
  border-bottom: 2px solid rgba(255,255,255,.08);
  padding-bottom: 0;
  overflow-x: auto;
}

.wizard-step {
  display: flex;
  align-items: center;
  gap: .4rem;
  padding: .6rem 1rem;
  border: none;
  background: none;
  font-size: .85rem;
  font-weight: 600;
  font-family: inherit;
  color: var(--muted, #a8b3c7);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color .15s, border-color .15s;
  white-space: nowrap;
}

.wizard-step:hover {
  color: var(--text, #eef2f7);
}

.wizard-step.active {
  color: var(--accent, #5baed1);
  border-bottom-color: var(--accent, #5baed1);
}

.wizard-step.completed {
  color: #86efac;
}

.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(255,255,255,.06);
  font-size: .7rem;
  font-weight: 700;
}

.wizard-step.active .step-num {
  background: var(--accent, #5baed1);
  color: #031a16;
}

.wizard-step.completed .step-num {
  background: rgba(34,197,94,.2);
  color: #86efac;
}

.wizard-panel {
  display: none;
}

.wizard-panel.active {
  display: block;
}

.wizard-panel h3 {
  margin: 0 0 1rem;
  color: var(--text, #eef2f7);
}

.wizard-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255,255,255,.08);
}

.wizard-nav-right {
  display: flex;
  gap: .5rem;
}

/* ── Assigned stories list (Step 3) ── */

.proj-story-add-row {
  display: flex;
  gap: .5rem;
  margin-bottom: 1rem;
  align-items: flex-end;
}

.proj-story-add-row select {
  flex: 1;
  padding: .5rem .6rem;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 6px;
  font-size: .85rem;
  font-family: inherit;
  background: rgba(255,255,255,.04);
  color: var(--text, #eef2f7);
}

.proj-story-add-row select option {
  background: var(--surface, #121620);
}

.proj-story-list {
  display: flex;
  flex-direction: column;
  gap: .35rem;
}

.proj-story-row {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .6rem .75rem;
  background: rgba(255,255,255,.03);
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 8px;
}

.proj-story-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--accent, #5baed1);
  color: #031a16;
  font-size: .75rem;
  font-weight: 700;
  flex-shrink: 0;
}

.proj-story-title {
  flex: 1;
  font-weight: 600;
  color: var(--text, #eef2f7);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.proj-story-controls {
  display: flex;
  gap: .2rem;
  flex-shrink: 0;
}

/* ── Review summary (Step 5) ── */

.review-summary {
  display: flex;
  flex-direction: column;
  gap: .5rem;
}

.review-row {
  padding: .5rem 0;
  border-bottom: 1px solid rgba(255,255,255,.04);
  font-size: .9rem;
  line-height: 1.5;
}

.review-row strong {
  color: var(--accent, #5baed1);
  margin-right: .3rem;
}

.review-row a {
  color: var(--link, #7cc4ff);
}
