/* =============================================================================
   MEAP — Design System & Styles
   Multilingual Evaluation Annotation Platform
   =============================================================================
   Table of Contents:
   1. Design Tokens (CSS Custom Properties)
   2. Reset & Base
   3. Layout (App Shell, Sidebar, Main Content)
   4. Components — Cards & Surfaces
   5. Components — Brand / Logo
   6. Components — Typography
   7. Components — Forms & Inputs
   8. Components — Buttons
   9. Components — Alerts & Toasts
   10. Components — Tags & Badges
   11. Components — Toggle Switch
   12. Components — Star Rating
   13. Components — Progress Bar
   14. Components — Spinner
   15. Components — Tables & Tabs
   16. Screens — Auth (Login, Signup, Forgot, Reset, Consent)
   17. Screens — Dashboard (Profile, Annotation, Creator, Admin, Done)
   18. Utilities
   19. Animations & Keyframes
   20. Responsive
   ============================================================================= */


/* =============================================================================
   1. DESIGN TOKENS
   ============================================================================= */
:root {
  /* Surfaces */
  --bg-base:        #0c1218;
  --bg-surface:     #121a22;
  --bg-card:        #161f29;
  --bg-card-hover:  #1e2a36;

  /* Borders */
  --border:         rgba(255, 255, 255, 0.1);
  --border-focus:   #f0a8c0;

  /* Glass */
  --glass-blur:     blur(22px);

  /* Accent palette — blossom rose + lake teal */
  --accent-1:       #e85a8c;
  --accent-2:       #c43d6e;
  --accent-3:       #2ec4a0;

  /* Semantic colors */
  --accent-err:     #f06070;
  --accent-warn:    #f5a623;
  --accent-ok:      #4cdf8a;

  /* Text hierarchy */
  --text-primary:   #f2f5f8;
  --text-secondary: #a8b6c7;
  --text-muted:     #6b7c90;

  /* Radii */
  --radius-sm:  8px;
  --radius-md:  14px;
  --radius-lg:  20px;
  --radius-xl:  28px;

  /* Shadows */
  --shadow-card: 0 16px 48px rgba(0, 0, 0, 0.45);
  --shadow-glow: 0 0 32px rgba(232, 90, 140, 0.18);

  /* Typography */
  --font-display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --font-ui:      'Plus Jakarta Sans', system-ui, sans-serif;
  --font-arabic:  'Noto Sans Arabic', sans-serif;
  --font-bengali: 'Noto Sans Bengali', sans-serif;
  --font-other:   'Noto Sans', sans-serif;

  /* Motion */
  --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);

  /* Layout */
  --sidebar-width: 260px;

  /* Auth imagery */
  --auth-bg: url('../img/auth-bg.jpg');
}


/* =============================================================================
   2. RESET & BASE
   ============================================================================= */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-ui);
  background: var(--bg-base);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
  overflow-x: hidden;
  margin: 0;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.is-auth {
  background: #0a1016;
}

body.is-auth #site-footer {
  display: none !important;
}


/* =============================================================================
   3. LAYOUT — App Shell, Sidebar, Main Content
   ============================================================================= */

/* App container */
#app {
  position: relative;
  z-index: 1;
  min-height: 0;
  flex: 1 0 auto;
  display: flex;
  width: 100%;
}

/* Main content area */
#main-content {
  flex: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: margin-left var(--transition);
}

body.has-sidebar #main-content {
  margin-left: var(--sidebar-width);
}

/* Generic screen container */
.screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
  width: 100%;
}

/* --- Sidebar --- */
#sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--sidebar-width);
  background: rgba(7, 11, 20, 0.6);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-right: 1px solid var(--border);
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  z-index: 100;
  transform: translateX(-100%);
  transition: transform var(--transition);
}

body.has-sidebar #sidebar {
  transform: translateX(0);
}

.sidebar-brand {
  margin-bottom: 40px;
  padding: 0 8px;
}

.sidebar-brand .brand {
  margin-bottom: 0;
}

/* Sidebar user card */
.sidebar-user {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.03);
  margin-bottom: 24px;
  border: 1px solid var(--border);
}

.sidebar-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.sidebar-user-info {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sidebar-user-name {
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-role-badge {
  font-size: 10px;
  color: var(--accent-1);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 700;
  margin-top: 2px;
}

/* Sidebar navigation links */
.sidebar-nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
  border-left: 3px solid transparent;
}

.sidebar-link:hover {
  background: rgba(255, 255, 255, 0.06);
}

.sidebar-link.active {
  background: rgba(79, 156, 249, 0.12);
  color: var(--accent-1);
  border-left-color: var(--accent-1);
}

.sidebar-link.danger {
  color: var(--accent-err);
  margin-top: auto;
}

.sidebar-link.danger:hover {
  background: rgba(240, 96, 112, 0.1);
}


/* =============================================================================
   4. COMPONENTS — Cards & Surfaces
   ============================================================================= */

/* Glass card (auth screens) */
.glass-card {
  background: var(--bg-card);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-card), var(--shadow-glow);
  padding: 40px 44px;
  width: 100%;
  max-width: 480px;
  animation: fadeSlideUp 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.glass-card.wide      { max-width: 680px; }
.glass-card.fullwidth { max-width: 1000px; }

/* Section card (dashboard panels) */
.section-card {
  width: 100%;
  max-width: 680px;
  background: var(--bg-card);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px 28px;
  margin: 0 auto 24px;
  box-shadow: var(--shadow-card);
}

.section-card.wide { max-width: 1000px; }

.section-title {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* Prompt display card (annotation screen) */
.prompt-card {
  background: var(--bg-card);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 22px;
  box-shadow: var(--shadow-card);
}

.prompt-header {
  padding: 16px 22px;
  background: rgba(255, 255, 255, 0.025);
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
}

.prompt-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* Annotation form card */
.ann-form-card {
  background: var(--bg-card);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  margin-bottom: 22px;
  box-shadow: var(--shadow-card);
}

.ann-form-title {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-transform: none;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.ann-form-header {
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.ann-form-sub {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin: 0;
}


/* =============================================================================
   5. COMPONENTS — Brand / Logo
   ============================================================================= */
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 32px;
}

.brand-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  box-shadow: 0 4px 16px rgba(232, 90, 140, 0.35);
  flex-shrink: 0;
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-name {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  -webkit-text-fill-color: unset;
  background: none;
}

.brand-sub {
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.brand-hero {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 36px;
}

.brand-mark {
  font-family: var(--font-display);
  font-size: clamp(3rem, 8vw, 3.85rem);
  font-weight: 600;
  font-optical-sizing: auto;
  letter-spacing: -0.04em;
  line-height: 0.95;
  color: #fff;
  text-shadow: 0 2px 28px rgba(0, 0, 0, 0.35);
}

.brand-tagline {
  margin: 0;
  max-width: 22em;
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1.45;
  color: var(--text-secondary);
  letter-spacing: 0.01em;
}

.brand-hero-compact .brand-mark {
  font-size: clamp(2.25rem, 5vw, 2.75rem);
}

.brand-hero-compact {
  margin-bottom: 24px;
}


/* =============================================================================
   6. COMPONENTS — Typography
   ============================================================================= */
h1, h2, h3 {
  font-weight: 700;
  letter-spacing: -0.03em;
}

h1 {
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 600;
  line-height: 1.2;
}

h2 { font-size: 22px; line-height: 1.3; }
h3 { font-size: 16px; font-weight: 600; }

.screen-title { margin-bottom: 8px; }
.screen-sub   { color: var(--text-secondary); font-size: 14.5px; margin-bottom: 28px; line-height: 1.55; }


/* =============================================================================
   7. COMPONENTS — Forms & Inputs
   ============================================================================= */
.form-group { margin-bottom: 18px; }

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
  letter-spacing: 0.02em;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
select,
textarea {
  width: 100%;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-ui);
  font-size: 14px;
  padding: 10px 14px;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
  appearance: none;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(79, 156, 249, 0.12);
}

select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%238a9bbf' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}

select option { background: #1a2035; }

textarea {
  resize: vertical;
  min-height: 80px;
}

.input-hint {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Checkbox row (consent) */
.checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 20px;
}

.checkbox-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: var(--accent-1);
  flex-shrink: 0;
}

.checkbox-row label {
  font-size: 13.5px;
  color: var(--text-primary);
  font-weight: 500;
  margin: 0;
  cursor: pointer;
}

/* Radio / Yes-No groups */
.radio-group,
.yn-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.radio-btn,
.yn-btn,
.sev-btn {
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  font-family: var(--font-ui);
}

.radio-btn:hover,
.yn-btn:hover,
.sev-btn:hover {
  border-color: rgba(79, 156, 249, 0.4);
  color: var(--text-primary);
}

.radio-btn.selected,
.yn-btn.selected {
  background: rgba(79, 156, 249, 0.15);
  border-color: rgba(79, 156, 249, 0.5);
  color: var(--accent-1);
}

/* Severity color states */
.sev-btn.selected-1 { background: rgba(76, 223, 138, 0.15);  border-color: rgba(76, 223, 138, 0.4);  color: #4cdf8a; }
.sev-btn.selected-2 { background: rgba(245, 166, 35, 0.15);  border-color: rgba(245, 166, 35, 0.4);  color: var(--accent-warn); }
.sev-btn.selected-3 { background: rgba(240, 96, 112, 0.15);  border-color: rgba(240, 96, 112, 0.4); color: var(--accent-err); }

/* Severity group layout */
.sev-group { display: flex; gap: 10px; flex-wrap: wrap; }
.sev-item  { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.sev-item .sev-desc { font-size: 10.5px; color: var(--text-muted); text-align: center; max-width: 120px; }

/* Annotation field blocks */
.ann-field {
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}

.ann-field:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.ann-field-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 10px;
}

.ann-field-num {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(79, 156, 249, 0.15);
  border: 1px solid rgba(79, 156, 249, 0.3);
  color: var(--accent-1);
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}

.ann-field-name {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-primary);
}

.ann-field-copy {
  flex: 1;
  min-width: 0;
}

.ann-field-hint {
  margin: 4px 0 0;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--text-secondary);
  font-weight: 400;
}

.ann-field-req {
  font-size: 10.5px;
  color: var(--accent-err);
  margin-left: 5px;
}

.ann-field-optional {
  font-size: 10.5px;
  color: var(--text-muted);
  margin-left: 5px;
  font-weight: 500;
}

.conditional-area {
  margin-top: 10px;
  animation: fadeSlideUp 0.15s ease;
}


/* =============================================================================
   8. COMPONENTS — Buttons
   ============================================================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 22px;
  border-radius: var(--radius-md);
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all var(--transition);
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
  color: #fff;
  box-shadow: 0 8px 22px rgba(232, 90, 140, 0.32);
}

.btn-primary:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(232, 90, 140, 0.4);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
}

.btn-ghost {
  background: transparent;
  color: var(--accent-1);
  padding: 6px 0;
  font-size: 13px;
  font-weight: 500;
}

.btn-ghost:hover { color: var(--accent-3); }

.btn-danger {
  background: rgba(240, 96, 112, 0.15);
  color: var(--accent-err);
  border: 1px solid rgba(240, 96, 112, 0.3);
}

.btn-danger:hover { background: rgba(240, 96, 112, 0.25); }

.btn-success {
  background: rgba(76, 223, 138, 0.15);
  color: var(--accent-ok);
  border: 1px solid rgba(76, 223, 138, 0.3);
}

.btn-success:hover { background: rgba(76, 223, 138, 0.25); }

.btn-full { width: 100%; }
.btn-sm   { padding: 7px 14px; font-size: 12px; border-radius: 8px; }


/* =============================================================================
   9. COMPONENTS — Alerts & Toasts
   ============================================================================= */

/* Inline alerts */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 18px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  animation: fadeSlideUp 0.15s ease;
}

.alert-error   { background: rgba(240, 96, 112, 0.12); border: 1px solid rgba(240, 96, 112, 0.3); color: #f5a3af; }
.alert-success { background: rgba(76, 223, 138, 0.10);  border: 1px solid rgba(76, 223, 138, 0.3);  color: #7ee8a2; }
.alert-info    { background: rgba(79, 156, 249, 0.10);  border: 1px solid rgba(79, 156, 249, 0.25); color: #a3c9f5; }
.alert-warn    { background: rgba(245, 166, 35, 0.10);  border: 1px solid rgba(245, 166, 35, 0.25); color: #f5c77a; }

/* Toast notifications */
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 12px;
  pointer-events: none;
}

.toast {
  background: var(--bg-card);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 20px;
  color: var(--text-primary);
  box-shadow: var(--shadow-card);
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13.5px;
  font-weight: 500;
  animation: slideInRight 0.15s ease forwards;
  pointer-events: auto;
}

.toast.success  { border-left: 4px solid var(--accent-ok); }
.toast.error    { border-left: 4px solid var(--accent-err); }
.toast.fade-out { animation: fadeOutRight 0.15s ease forwards; }


/* =============================================================================
   10. COMPONENTS — Tags & Badges
   ============================================================================= */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.tag-id {
  background: rgba(79, 156, 249, 0.12);
  color: var(--accent-1);
  border: 1px solid rgba(79, 156, 249, 0.2);
}

.tag-lang {
  background: rgba(124, 92, 191, 0.12);
  color: #b09ce0;
  border: 1px solid rgba(124, 92, 191, 0.25);
}

.harm-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
}


/* =============================================================================
   11. COMPONENTS — Toggle Switch
   ============================================================================= */
.toggle-row {
  display: flex;
  align-items: center;
  gap: 14px;
}

.toggle-switch {
  position: relative;
  width: 48px;
  height: 26px;
  flex-shrink: 0;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.toggle-slider {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border);
  border-radius: 13px;
  cursor: pointer;
  transition: all var(--transition);
}

.toggle-slider::before {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--text-muted);
  top: 3px;
  left: 3px;
  transition: all var(--transition);
}

.toggle-switch input:checked + .toggle-slider {
  background: rgba(79, 156, 249, 0.25);
  border-color: rgba(79, 156, 249, 0.5);
}

.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(22px);
  background: var(--accent-1);
}

.toggle-labels { display: flex; flex-direction: column; }
.toggle-title  { font-size: 13px; font-weight: 500; color: var(--text-primary); }
.toggle-desc   { font-size: 11.5px; color: var(--text-muted); }


/* =============================================================================
   12. COMPONENTS — Star Rating
   ============================================================================= */
.star-group {
  display: flex;
  gap: 6px;
}

.star-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-muted);
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}

.star-btn.active {
  color: #f5a623;
  border-color: rgba(245, 166, 35, 0.4);
  background: rgba(245, 166, 35, 0.08);
}

.star-btn:hover {
  transform: scale(1.12);
}


/* =============================================================================
   13. COMPONENTS — Progress Bar
   ============================================================================= */
#progress-bar-container {
  position: sticky;
  top: calc(64px + env(safe-area-inset-top));
  z-index: 99;
  background: rgba(7, 11, 20, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 12px 24px;
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
}

.progress-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 88px;
}

.progress-label {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
}

.progress-track {
  flex: 1;
  height: 6px;
  background: rgba(255, 255, 255, 0.07);
  border-radius: 10px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-1), var(--accent-3));
  border-radius: 10px;
  transition: width 0.6s ease;
}

.progress-pct {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent-1);
  white-space: nowrap;
}


/* =============================================================================
   14. COMPONENTS — Spinner
   ============================================================================= */
.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid rgba(79, 156, 249, 0.2);
  border-top-color: var(--accent-1);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto;
}


/* =============================================================================
   15. COMPONENTS — Tables & Tabs
   ============================================================================= */
.tab-bar {
  display: flex;
  gap: 10px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 12px;
}

.tab-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  padding: 8px 16px;
  border-radius: var(--radius-md);
  transition: all var(--transition);
  font-family: var(--font-ui);
}

.tab-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
}

.tab-btn.active {
  background: rgba(79, 156, 249, 0.15);
  color: var(--accent-1);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  text-align: left;
}

.data-table th,
.data-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}

.data-table th {
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 11px;
}

.data-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

/* =============================================================================
   ADMIN PANEL
   ============================================================================= */
.section-card.admin-panel {
  max-width: 1180px;
  width: calc(100% - 32px);
}

.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.admin-stat-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.admin-pill {
  font-size: 12px;
  font-weight: 600;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-secondary);
}

.admin-pill.warn { color: #f5a623; border-color: rgba(245, 166, 35, 0.35); }
.admin-pill.ok   { color: #4cdf8a; border-color: rgba(76, 223, 138, 0.35); }
.admin-pill.bad  { color: #f06070; border-color: rgba(240, 96, 112, 0.35); }

.admin-toolbar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 8px 0 14px;
}

.admin-segment-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 6px 0 10px;
}

.admin-segment {
  appearance: none;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.admin-segment:hover {
  color: var(--text-primary);
  border-color: var(--text-muted);
}

.admin-segment.active {
  color: #fff;
  background: rgba(232, 90, 140, 0.2);
  border-color: rgba(232, 90, 140, 0.55);
}

.admin-segment-hint {
  margin: 0 0 12px;
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.45;
}

.segment-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
}

.segment-badge.segment-seed {
  color: #7ec8ff;
  background: rgba(126, 200, 255, 0.1);
  border-color: rgba(126, 200, 255, 0.3);
}

.segment-badge.segment-user {
  color: #f5c26b;
  background: rgba(245, 194, 107, 0.1);
  border-color: rgba(245, 194, 107, 0.3);
}

.admin-locked-note {
  font-size: 11px;
  color: var(--text-muted);
  align-self: center;
}

.admin-search,
.admin-filter {
  background: var(--bg);
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  font-size: 13px;
}

.admin-search {
  flex: 1 1 240px;
  min-width: 200px;
}

.admin-filter {
  flex: 0 0 auto;
  min-width: 140px;
}

.admin-table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.admin-prompts-table td,
.admin-prompts-table th {
  vertical-align: top;
}

.admin-prompts-table .preview-cell {
  max-width: 320px;
  white-space: normal;
  overflow: hidden;
}

.admin-prompts-table .preview-en {
  margin-top: 4px;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
}

.admin-turn-en {
  color: var(--text-secondary);
  font-style: italic;
}
  color: var(--text-secondary);
}

.mono-id {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 11px;
  color: var(--text-secondary);
}

.status-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
}

.status-badge.status-pending  { color: #f5a623; background: rgba(245,166,35,0.1); border-color: rgba(245,166,35,0.3); }
.status-badge.status-approved { color: #4cdf8a; background: rgba(76,223,138,0.1); border-color: rgba(76,223,138,0.3); }
.status-badge.status-rejected { color: #f06070; background: rgba(240,96,112,0.1); border-color: rgba(240,96,112,0.3); }

.admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.admin-empty {
  color: var(--text-muted);
  font-size: 13px;
  margin-top: 14px;
}

/* Analytics charts */
.analytics-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
}

.kpi-card {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
}

.kpi-card.warn .kpi-value { color: #f06070; }

.kpi-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.kpi-value {
  margin-top: 6px;
  font-size: 28px;
  font-weight: 800;
  color: var(--accent-1);
}

.analytics-chart-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
}

.chart-card {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
}

.chart-card h3 {
  margin: 0 0 14px;
  font-size: 14px;
  font-weight: 700;
}

.chart-row {
  display: grid;
  grid-template-columns: 110px 1fr 36px;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}

.chart-label {
  font-size: 11px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chart-track {
  height: 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.06);
  overflow: hidden;
}

.chart-fill {
  height: 100%;
  border-radius: 999px;
  min-width: 2px;
}

.chart-value {
  font-size: 12px;
  font-weight: 700;
  text-align: right;
  color: var(--text-secondary);
}

.donut-wrap {
  display: flex;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
}

.donut {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  mask: radial-gradient(circle at center, transparent 48%, #000 49%);
  -webkit-mask: radial-gradient(circle at center, transparent 48%, #000 49%);
}

.donut-legend {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
  min-width: 140px;
}

.donut-legend-item {
  display: grid;
  grid-template-columns: 12px 1fr auto;
  gap: 8px;
  align-items: center;
  font-size: 12px;
  color: var(--text-secondary);
}

.donut-swatch {
  width: 10px;
  height: 10px;
  border-radius: 2px;
}

.admin-prompt-modal {
  max-width: 720px;
  width: calc(100% - 24px);
  max-height: 85vh;
  overflow-y: auto;
}

.admin-detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
  font-size: 13px;
}

.admin-detail-grid strong {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.admin-turn-block {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 10px;
  overflow: hidden;
}

.admin-turn-label {
  padding: 7px 12px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  background: rgba(255,255,255,0.03);
  border-bottom: 1px solid var(--border);
}

.admin-turn-block pre {
  margin: 0;
  padding: 12px 14px;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: inherit;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--text-primary);
}


/* =============================================================================
   16. SCREENS — Auth
   ============================================================================= */

.auth-screen {
  position: relative;
  isolation: isolate;
  min-height: 100vh;
  min-height: 100dvh;
  width: 100%;
  padding: 0;
  justify-content: stretch;
  align-items: stretch;
  overflow: hidden;
}

.auth-screen::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -2;
  background-image: var(--auth-bg);
  background-size: cover;
  background-position: center 40%;
  background-repeat: no-repeat;
  transform: scale(1.02);
  animation: authBgDrift 28s ease-in-out infinite alternate;
}

.auth-screen::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(
      108deg,
      rgba(6, 12, 18, 0.88) 0%,
      rgba(8, 14, 22, 0.72) 38%,
      rgba(10, 18, 26, 0.28) 68%,
      rgba(12, 20, 28, 0.18) 100%
    ),
    radial-gradient(ellipse 70% 55% at 72% 42%, rgba(232, 90, 140, 0.16), transparent 60%);
  pointer-events: none;
}

.auth-shell {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 520px;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(28px, 5vh, 56px) clamp(20px, 5vw, 64px);
  animation: authShellIn 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.auth-shell-wide {
  max-width: 760px;
}

.auth-card {
  max-width: none;
  background: rgba(10, 16, 24, 0.58);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow:
    0 28px 80px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(28px) saturate(1.25);
  -webkit-backdrop-filter: blur(28px) saturate(1.25);
}

.auth-card input[type="text"],
.auth-card input[type="email"],
.auth-card input[type="password"],
.auth-card input[type="number"],
.auth-card select,
.auth-card textarea {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.14);
}

.auth-card input:focus,
.auth-card select:focus,
.auth-card textarea:focus {
  border-color: rgba(232, 90, 140, 0.65);
  box-shadow: 0 0 0 3px rgba(232, 90, 140, 0.18);
}

.auth-forgot {
  text-align: right;
  margin-top: 8px;
}

.auth-forgot .link {
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  color: var(--accent-1);
}

.auth-forgot .link:hover {
  color: #f3a0bc;
}

.auth-footer {
  text-align: center;
  margin-top: 22px;
  font-size: 13.5px;
  color: var(--text-secondary);
}

.auth-footer .link {
  cursor: pointer;
  color: var(--accent-1);
  font-weight: 600;
}

.auth-footer .link:hover {
  color: #f3a0bc;
}

/* Project attribution (auth landing screens) */
.project-credit {
  max-width: none;
  margin: 22px 0 0;
  padding: 0 4px;
  text-align: left;
  font-size: 12px;
  line-height: 1.55;
  color: rgba(232, 238, 245, 0.58);
}

.project-credit p {
  margin: 0 0 4px;
}

.project-credit a {
  color: rgba(242, 245, 248, 0.82);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.project-credit a:hover {
  color: #f3a0bc;
}

.project-credit strong {
  color: rgba(242, 245, 248, 0.9);
  font-weight: 600;
}

@keyframes authBgDrift {
  from { transform: scale(1.02) translate3d(0, 0, 0); }
  to   { transform: scale(1.06) translate3d(-1.2%, -0.8%, 0); }
}

@keyframes authShellIn {
  from { opacity: 0; transform: translateX(-18px); }
  to   { opacity: 1; transform: translateX(0); }
}

@media (prefers-reduced-motion: reduce) {
  .auth-screen::before,
  .auth-shell,
  .glass-card {
    animation: none !important;
  }
}

/* Site-wide footer */
.site-footer {
  border-top: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.35);
  padding: 22px 4%;
  margin-top: auto;
}

.site-footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px 28px;
}

.site-footer-brand {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--accent-1);
}

.site-footer-copy {
  flex: 1 1 280px;
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--text-muted);
}

.site-footer-copy p {
  margin: 0 0 4px;
}

.site-footer-copy a,
.site-footer-links a {
  color: var(--text-secondary);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.site-footer-copy a:hover,
.site-footer-links a:hover {
  color: var(--accent-1);
}

.site-footer-copy strong {
  color: var(--text-secondary);
  font-weight: 600;
}

.site-footer-links {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12.5px;
}

/* Consent box */
.consent-box {
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 8px;
  margin-bottom: 20px;
  max-height: 420px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.consent-block {
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid transparent;
}

.consent-block h3 {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 6px;
  letter-spacing: -0.01em;
}

.consent-block p {
  font-size: 13.5px;
  line-height: 1.65;
  color: var(--text-secondary);
  margin: 0;
}

.consent-block-warn {
  border-color: rgba(245, 166, 35, 0.35);
  background: rgba(245, 166, 35, 0.06);
}

.consent-block-warn h3 {
  color: var(--accent-warn);
}


/* =============================================================================
   17. SCREENS — Dashboard
   ============================================================================= */

/* Profile, Creator, Admin screens start from the top */
#profile-screen,
#creator-screen,
#admin-screen {
  justify-content: flex-start;
  padding-top: 40px;
}

/* Profile header */
.profile-header {
  width: 100%;
  max-width: 680px;
  padding: 0 16px;
  margin-bottom: 28px;
}

.profile-avatar-ring {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 700;
  color: #fff;
  box-shadow: 0 0 0 4px rgba(79, 156, 249, 0.2);
  margin-bottom: 16px;
}

/* Annotation screen */
#annotation-screen {
  padding-top: 0;
  justify-content: flex-start;
}

.ann-container {
  width: 100%;
  max-width: 860px;
  padding: 0 16px;
  margin: 0 auto;
}

/* Turn blocks (prompt content) */
.turn-blocks {
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.turn-block {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.turn-label {
  padding: 7px 14px;
  background: rgba(255, 255, 255, 0.028);
  border-bottom: 1px solid var(--border);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  text-transform: uppercase;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.turn-text {
  padding: 14px 16px;
  font-size: 14.5px;
  line-height: 1.75;
  color: var(--text-primary);
}

/* RTL / multilingual font support */
.rtl        { direction: rtl; text-align: right; font-family: var(--font-arabic); }
.ltr-bangla { font-family: var(--font-bengali); }
.ltr-other  { font-family: var(--font-other); }

/* English equivalent collapse */
.en-toggle-btn {
  background: none;
  border: none;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: color var(--transition);
  padding: 0;
}

.en-toggle-btn:hover { color: var(--accent-1); }

.en-equiv {
  padding: 10px 16px 14px;
  font-size: 13px;
  color: var(--text-secondary);
  font-style: italic;
  border-top: 1px solid var(--border);
}

/* Action bar (annotation footer) */
.ann-action-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  background: var(--bg-card);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 24px;
  margin-bottom: 40px;
  box-shadow: var(--shadow-card);
}

.ann-action-info { font-size: 13px; color: var(--text-secondary); }
.ann-action-btns { display: flex; gap: 10px; flex-wrap: wrap; }

/* Done screen */
.done-icon {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: rgba(76, 223, 138, 0.12);
  border: 2px solid rgba(76, 223, 138, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 38px;
  margin: 0 auto 24px;
  box-shadow: 0 0 40px rgba(76, 223, 138, 0.15);
}


/* =============================================================================
   18. UTILITIES
   ============================================================================= */
/* =============================================================================
   MODALS
   ============================================================================= */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.modal-backdrop.hidden {
  display: none !important;
}

.modal-content {
  width: 100%;
  max-width: 560px;
  max-height: 85vh;
  overflow-y: auto;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.55);
  color: var(--text-primary);
}

/* Help modal */
.help-modal {
  max-width: 720px;
  padding: 0;
  display: flex;
  flex-direction: column;
  max-height: min(88vh, 820px);
}

.help-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding: 22px 24px 12px;
  border-bottom: 1px solid var(--border);
}

.help-kicker {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-3);
  margin: 0 0 4px;
}

.help-modal-header h2 {
  margin: 0;
  font-size: 20px;
}

.help-close-btn {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-primary);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
}

.help-close-btn:hover {
  background: rgba(255, 255, 255, 0.08);
}

.help-tabs {
  display: flex;
  gap: 6px;
  padding: 12px 24px 0;
  flex-wrap: wrap;
}

.help-tab {
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-secondary);
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}

.help-tab:hover {
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.2);
}

.help-tab.active {
  background: rgba(232, 90, 140, 0.12);
  border-color: rgba(232, 90, 140, 0.45);
  color: #f3a0bc;
}

.help-body {
  padding: 16px 24px 8px;
  overflow-y: auto;
  flex: 1;
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.6;
}

.help-modal-footer {
  padding: 12px 24px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
}

.help-callout {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin-bottom: 16px;
  font-size: 13.5px;
}

.help-callout-accent {
  border-color: rgba(0, 212, 170, 0.35);
  background: rgba(0, 212, 170, 0.07);
  color: var(--text-primary);
}

.help-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.help-card {
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px;
}

.help-card h4 {
  margin: 0 0 6px;
  font-size: 13px;
  color: var(--text-primary);
}

.help-card p {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--text-secondary);
}

.help-steps {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: help-step;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.help-steps li {
  counter-increment: help-step;
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 10px;
  align-items: start;
}

.help-steps li::before {
  content: counter(help-step);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(232, 90, 140, 0.12);
  border: 1px solid rgba(232, 90, 140, 0.35);
  color: #f3a0bc;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.help-steps strong {
  display: block;
  color: var(--text-primary);
  font-size: 13.5px;
  margin-bottom: 2px;
}

.help-steps span {
  display: block;
  font-size: 12.5px;
  color: var(--text-secondary);
}

.help-checklist {
  margin: 0;
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.help-checklist li {
  font-size: 13.5px;
  color: var(--text-secondary);
}

.help-checklist-warn li::marker {
  color: var(--accent-warn);
}

.guide-banner {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  margin-bottom: 18px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(0, 212, 170, 0.28);
  background: linear-gradient(135deg, rgba(0, 212, 170, 0.08), rgba(255, 255, 255, 0.02));
}

.guide-banner-compact {
  margin-bottom: 22px;
}

.guide-banner-icon {
  font-size: 18px;
  line-height: 1.2;
  flex-shrink: 0;
}

.guide-banner-text {
  flex: 1;
  font-size: 13px;
  line-height: 1.55;
  color: var(--text-secondary);
}

.guide-banner-text strong {
  color: var(--text-primary);
}

.guide-banner-link {
  border: none;
  background: transparent;
  color: var(--accent-3);
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  font-family: inherit;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.help-trigger-btn {
  margin-left: auto;
  gap: 6px;
}

.help-trigger-btn span {
  display: inline-flex;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1px solid currentColor;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
}

.tag-blind {
  background: rgba(0, 212, 170, 0.1);
  color: var(--accent-3);
  border: 1px solid rgba(0, 212, 170, 0.28);
}

.prompt-blind-note {
  margin: 0;
  font-size: 12.5px;
  color: var(--text-secondary);
  line-height: 1.45;
}

.twin-prompt-block {
  margin-top: 8px;
  border-top: 1px solid var(--border);
  padding-top: 8px;
}

.twin-prompt-title {
  margin: 0;
  padding: 12px 22px 4px;
  font-size: 14px;
  color: var(--accent-3);
}

.twin-check-section {
  margin-top: 8px;
  border-top: 1px dashed var(--border);
  padding-top: 16px;
}

.twin-check-header {
  margin-bottom: 8px;
}

.twin-check-title {
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.creator-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 16px;
}

.creator-lead {
  font-size: 13.5px;
  color: var(--text-secondary);
  line-height: 1.55;
  margin: 0;
  max-width: 52ch;
}

.creator-example {
  margin-bottom: 20px;
  padding: 16px 18px;
  background: rgba(46, 196, 160, 0.08);
  border: 1px solid rgba(46, 196, 160, 0.22);
  border-left: 4px solid var(--accent-3);
  border-radius: var(--radius-md);
}

.creator-example-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.creator-example-title {
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent-3);
}

.creator-example-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.creator-example-turn p {
  margin: 4px 0 0;
  font-size: 14.5px;
  line-height: 1.65;
  color: var(--text-primary);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.creator-example-label {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.creator-example-note {
  margin: 12px 0 0;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.45;
}

.sev-item .sev-desc {
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
  max-width: 130px;
  line-height: 1.35;
}

.sev-item .sev-desc strong {
  color: var(--text-secondary);
  font-weight: 600;
}

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

  .guide-banner {
    flex-direction: column;
  }

  .creator-header {
    flex-direction: column;
  }

  #progress-bar-container {
    flex-wrap: wrap;
  }

  .help-trigger-btn {
    margin-left: 0;
  }
}

.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); }


/* =============================================================================
   19. ANIMATIONS & KEYFRAMES
   ============================================================================= */
@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(100%); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes fadeOutRight {
  from { opacity: 1; transform: translateX(0); }
  to   { opacity: 0; transform: translateX(100%); }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}


/* =============================================================================
   20. RESPONSIVE
   ============================================================================= */
@media (max-width: 900px) {
  .nav-toggle {
    display: inline-flex;
  }

  .nav-drawer {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 8px 4% 20px;
    padding-bottom: calc(20px + env(safe-area-inset-bottom));
    background: rgba(10, 16, 24, 0.98);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
  }

  body.nav-open .nav-drawer {
    display: flex;
  }

  .nav-links {
    flex-direction: column;
    gap: 0;
    width: 100%;
  }

  .nav-link {
    padding: 14px 4px;
    font-size: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    white-space: normal;
  }

  .nav-link-mobile-only {
    display: block;
  }

  .nav-right {
    margin: 14px 0 0;
    justify-content: space-between;
    width: 100%;
    padding-top: 6px;
  }

  .nav-signout {
    font-size: 14px;
    opacity: 1;
  }

  .nav-brand {
    margin-right: 0;
    font-size: 24px;
  }
}

@media (max-width: 768px) {
  :root {
    --sidebar-width: 220px;
  }

  .screen {
    padding: 24px 14px;
  }

  .glass-card {
    padding: 28px 22px;
  }

  .auth-shell {
    max-width: 100%;
    padding: max(24px, env(safe-area-inset-top)) 16px max(28px, env(safe-area-inset-bottom));
  }

  .auth-shell-wide {
    max-width: 100%;
  }

  .auth-card {
    padding: 26px 18px;
    border-radius: 22px;
  }

  .auth-screen::after {
    background:
      linear-gradient(
        180deg,
        rgba(6, 12, 18, 0.78) 0%,
        rgba(8, 14, 22, 0.86) 45%,
        rgba(8, 14, 22, 0.92) 100%
      ),
      radial-gradient(ellipse 90% 50% at 50% 0%, rgba(232, 90, 140, 0.18), transparent 55%);
  }

  .auth-screen::before {
    background-position: 62% center;
    animation: none;
  }

  .brand-mark {
    font-size: clamp(2.4rem, 11vw, 3.2rem);
  }

  .project-credit {
    text-align: center;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  /* Prevent iOS zoom on focus */
  input[type="text"],
  input[type="email"],
  input[type="password"],
  input[type="number"],
  select,
  textarea {
    font-size: 16px !important;
    min-height: 48px;
  }

  textarea {
    min-height: 120px;
  }

  .btn {
    min-height: 48px;
    padding: 12px 18px;
  }

  .btn-full {
    width: 100%;
  }

  .radio-btn,
  .yn-btn,
  .sev-btn {
    min-height: 44px;
    padding: 10px 14px;
    flex: 1 1 auto;
    justify-content: center;
  }

  .yn-group,
  .radio-group {
    width: 100%;
  }

  .yn-group .yn-btn,
  .radio-group .radio-btn {
    flex: 1;
    text-align: center;
  }

  .sev-group {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }

  .sev-item {
    width: 100%;
  }

  .sev-item .sev-btn {
    width: 100%;
  }

  .sev-item .sev-desc {
    max-width: none;
    font-size: 10px;
  }

  .ann-action-bar {
    flex-direction: column;
    align-items: stretch;
    position: sticky;
    bottom: env(safe-area-inset-bottom);
    z-index: 40;
    margin-left: -2px;
    margin-right: -2px;
    border-radius: 18px;
    padding: 14px 16px;
  }

  .ann-action-btns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .ann-action-btns .btn {
    flex: 1;
    width: 100%;
  }

  .ann-container,
  .section-card,
  .section-card.wide,
  .section-card.admin-panel {
    width: 100%;
    max-width: 100%;
    padding-left: 16px;
    padding-right: 16px;
    margin-left: 0;
    margin-right: 0;
  }

  .section-card.admin-panel {
    width: 100%;
  }

  .ann-form-card,
  .prompt-card {
    padding-left: 16px;
    padding-right: 16px;
  }

  .turn-blocks {
    padding: 16px;
  }

  .turn-text {
    font-size: 15px;
    overflow-wrap: anywhere;
  }

  #progress-bar-container {
    flex-wrap: wrap;
    padding: 10px 14px;
    gap: 10px;
  }

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

  .admin-toolbar,
  .admin-header,
  .admin-segment-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .admin-search,
  .admin-filter {
    width: 100%;
    min-width: 0;
  }

  .admin-table-wrap,
  .table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 0 -4px;
    padding-bottom: 4px;
  }

  .data-table,
  .admin-prompts-table {
    min-width: 640px;
  }

  .site-footer {
    padding: 20px 16px calc(20px + env(safe-area-inset-bottom));
  }

  .site-footer-inner {
    flex-direction: column;
    gap: 14px;
  }

  .modal-backdrop {
    padding: 10px;
    align-items: flex-end;
  }

  .modal-content,
  .help-modal,
  .admin-prompt-modal {
    max-width: 100%;
    max-height: min(92vh, 920px);
    border-radius: 18px 18px 10px 10px;
    margin: 0;
  }

  .help-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 8px;
  }

  .help-tab {
    flex: 0 0 auto;
  }

  .help-grid {
    grid-template-columns: 1fr;
  }

  .tab-bar {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .star-group {
    gap: 6px;
  }

  .star-btn {
    min-width: 44px;
    min-height: 44px;
  }
}

@media (max-width: 480px) {
  body.has-sidebar #main-content {
    margin-left: 0;
  }

  #sidebar {
    width: 100%;
  }

  .glass-card {
    padding: 22px 16px;
    border-radius: var(--radius-lg);
  }

  h1 { font-size: 22px; }

  .screen-title {
    font-size: 1.45rem;
  }

  .screen-sub {
    font-size: 13.5px;
  }

  .brand-tagline {
    font-size: 12.5px;
  }

  .ann-action-btns {
    grid-template-columns: 1fr;
  }

  .sev-group {
    grid-template-columns: 1fr;
  }

  .sev-item {
    flex-direction: row;
    align-items: center;
    gap: 10px;
  }

  .sev-item .sev-btn {
    flex: 0 0 72px;
  }

  .sev-item .sev-desc {
    text-align: left;
  }

  .billboard {
    height: 48vh;
    width: 100%;
  }

  .billboard-content {
    max-width: 90%;
    bottom: 12%;
    left: 5%;
  }

  .billboard-title {
    font-size: 1.8rem;
  }

  .billboard-desc {
    font-size: 0.95rem;
  }

  .media-card,
  .skeleton-card {
    flex: 0 0 72%;
  }

  .swimlane-title {
    font-size: 1.05rem;
  }
}

/* Touch devices: disable hover card scale that overflows */
@media (hover: none), (pointer: coarse) {
  .media-card:hover {
    transform: none;
    box-shadow: none;
  }

  .media-card:hover .media-card-footer {
    opacity: 0;
    pointer-events: none;
  }

  .btn-white:hover,
  .btn-gray:hover {
    transform: none;
  }
}

/* =============================================================================
   NETFLIX OVERRIDES & COMPONENTS
   ============================================================================= */

/* Hide scrollbars globally for horizontal swimlanes */
::-webkit-scrollbar {
  display: none;
}

/* Navbar (replaces Sidebar) */
#sidebar {
  display: none !important; /* Hide old sidebar */
}
body.has-sidebar #main-content {
  margin-left: 0 !important;
}

.netflix-navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  min-height: 64px;
  height: auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  padding: 0 max(4%, env(safe-area-inset-right)) 0 max(4%, env(safe-area-inset-left));
  padding-top: env(safe-area-inset-top);
  z-index: 1000;
  background: linear-gradient(to bottom, rgba(0,0,0,0.78) 10%, transparent);
  transition: background-color 0.4s ease;
}
.netflix-navbar.scrolled,
body.nav-open .netflix-navbar {
  background-color: #0c1218;
}
.nav-brand {
  font-family: var(--font-display);
  color: var(--accent-1);
  font-size: 26px;
  font-weight: 600;
  margin-right: 28px;
  letter-spacing: -0.03em;
  text-transform: none;
  cursor: pointer;
  flex-shrink: 0;
  line-height: 64px;
}
.nav-drawer {
  display: flex;
  align-items: center;
  flex: 1;
  min-width: 0;
  gap: 12px;
}
.nav-links {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  align-items: center;
}
.nav-link {
  color: #e5e5e5;
  font-size: 14px;
  cursor: pointer;
  transition: color 0.3s;
  padding: 8px 0;
  white-space: nowrap;
}
.nav-link:hover, .nav-link.active {
  color: #ffffff;
  font-weight: 500;
}
.nav-link-mobile-only {
  display: none;
}
.nav-signout {
  font-size: 12px;
  opacity: 0.85;
}
.nav-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
}

.nav-toggle {
  display: none;
  margin-left: auto;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  padding: 0;
  z-index: 1002;
}

.nav-toggle-bar {
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

body.nav-open .nav-toggle-bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
body.nav-open .nav-toggle-bar:nth-child(2) {
  opacity: 0;
}
body.nav-open .nav-toggle-bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.nav-backdrop {
  position: fixed;
  inset: 0;
  z-index: 999;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(2px);
}

/* Dashboard offset for fixed navbar */
body:not(.is-auth) #main-content {
  padding-top: calc(64px + env(safe-area-inset-top));
}

/* Billboard Hero */
.billboard {
  position: relative;
  width: 100%;
  height: 70vh;
  background-image: url('../hero_bg.png');
  background-size: cover;
  background-position: center;
  margin-top: calc(-64px - env(safe-area-inset-top)); /* Pull under navbar */
}
.billboard-vignette {
  position: absolute;
  inset: 0;
  background: linear-gradient(to right, #141414 10%, transparent 50%),
              linear-gradient(to top, #141414 0%, transparent 30%);
}
.billboard-content {
  position: absolute;
  bottom: 20%;
  left: 4%;
  max-width: 40%;
  z-index: 10;
}
.billboard-title {
  font-size: 3.5rem;
  font-weight: 900;
  margin-bottom: 20px;
  line-height: 1.1;
}
.billboard-desc {
  font-size: 1.2rem;
  color: #fff;
  margin-bottom: 30px;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.45);
}
.billboard-btns {
  display: flex;
  gap: 16px;
}
.btn-white {
  background: white;
  color: black;
  border: none;
  padding: 12px 28px;
  font-size: 1.1rem;
  font-weight: 600;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: transform 0.2s, background 0.2s;
}
.btn-white:hover {
  background: rgba(255,255,255,0.7);
  transform: scale(1.05);
}
.btn-gray {
  background: rgba(109, 109, 110, 0.7);
  color: white;
  border: none;
  padding: 12px 28px;
  font-size: 1.1rem;
  font-weight: 600;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: transform 0.2s, background 0.2s;
}
.btn-gray:hover {
  background: rgba(109, 109, 110, 0.4);
  transform: scale(1.05);
}

/* Swimlanes */
.swimlane-section {
  padding: 0 4%;
  position: relative;
  z-index: 20;
  margin-bottom: 40px;
}
.billboard + .swimlane-section {
  margin-top: -60px; /* pull up into billboard slightly */
}
.swimlane-title {
  font-size: 1.4vw;
  font-weight: 600;
  margin-bottom: 12px;
}
.swimlane-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  overflow-y: visible;
  padding: 20px 0;
  scroll-behavior: smooth;
}

/* Media Card (16:9) */
.media-card {
  position: relative;
  flex: 0 0 18%;
  aspect-ratio: 16/9;
  border-radius: var(--radius-sm);
  background-image: url('../card_bg.png');
  background-size: cover;
  background-position: center;
  cursor: pointer;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1) 0.3s, box-shadow 0.3s 0.3s;
}
.media-card:hover {
  transform: scale(1.25);
  box-shadow: 0 10px 20px rgba(0,0,0,0.8);
  z-index: 50;
}
.media-card-footer {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #181818;
  padding: 12px;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  opacity: 0;
  transition: opacity 0.3s 0.3s;
  pointer-events: none;
  box-shadow: 0 10px 20px rgba(0,0,0,0.8);
}
.media-card:hover .media-card-footer {
  opacity: 1;
  pointer-events: auto;
}
.media-card-title {
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.media-card-meta {
  display: flex;
  gap: 8px;
  font-size: 11px;
  color: var(--text-secondary);
}

/* Skeleton Loaders */
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .4; }
}
.skeleton-card {
  position: relative;
  flex: 0 0 18%;
  aspect-ratio: 16/9;
  border-radius: var(--radius-sm);
  background-color: #333;
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}
