  :root {
    --navy: #003DB8;
    --navy-light: #1a56c9;
    --navy-dark: #002a80;
    --gold: #EB8A2A;
    --gold-light: #fef0e0;
    --cream: #F9FAFB;
    --white: #ffffff;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --green: #22b573;
    --green-light: #e0f5ff;
    --amber: #d97706;
    --amber-light: #fef3c7;
    --red: #dc2626;
    --red-light: #fee2e2;
    --blue-light: #dbeafe;
    --ivy-blue: #003DB8;
    --ivy-cyan: #A2E9FE;
    --ivy-orange: #EB8A2A;
    --ivy-green: #22b573;
    --ivy-dark: #002a80;
  }

  * { margin: 0; padding: 0; box-sizing: border-box; }

  body {
    font-family: 'Georgia', 'Times New Roman', serif;
    background: var(--cream);
    color: var(--gray-800);
    line-height: 1.6;
  }

  /* TOP BAR */
  .topbar {
    background: var(--navy-dark);
    color: var(--white);
    padding: 12px 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: 'Helvetica Neue', Arial, sans-serif;
    font-size: 13px;
    letter-spacing: 0.5px;
  }
  .topbar .brand { font-weight: 600; letter-spacing: 1.5px; text-transform: uppercase; font-size: 12px; }
  .topbar .demo-badge {
    background: var(--ivy-orange);
    color: white;
    padding: 3px 12px;
    border-radius: 3px;
    font-weight: 700;
    font-size: 11px;
    letter-spacing: 1px;
    text-transform: uppercase;
  }

  /* LAYOUT */
  .app-container { display: flex; min-height: calc(100vh - 42px); }

  /* SIDEBAR */
  .sidebar {
    width: 280px;
    background: var(--navy);
    color: var(--white);
    padding: 0;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
  }
  .sidebar-header {
    padding: 28px 24px 20px;
    border-bottom: 1px solid var(--navy-light);
  }
  .sidebar-header h2 {
    font-size: 16px;
    font-weight: 600;
    font-family: 'Helvetica Neue', Arial, sans-serif;
    letter-spacing: 0.3px;
    margin-bottom: 4px;
  }
  .sidebar-header .student-name {
    font-size: 13px;
    color: var(--gold-light);
    font-family: 'Helvetica Neue', Arial, sans-serif;
  }

  .module-nav { padding: 16px 0; flex: 1; }
  .module-item {
    padding: 14px 24px;
    cursor: pointer;
    font-family: 'Helvetica Neue', Arial, sans-serif;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: background 0.15s;
    border-left: 3px solid transparent;
  }
  .module-item:hover { background: var(--navy-light); }
  .module-item.active {
    background: var(--navy-light);
    border-left-color: var(--gold);
  }
  .module-item.completed .mod-status { color: var(--green); }
  .module-item.locked { opacity: 0.45; cursor: default; }
  .module-item.locked:hover { background: transparent; }

  .mod-number {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid var(--gray-400);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    flex-shrink: 0;
  }
  .module-item.active .mod-number { border-color: var(--gold); color: var(--gold); }
  .module-item.completed .mod-number { border-color: var(--green); background: var(--green); color: white; }

  .mod-info { flex: 1; }
  .mod-title { font-weight: 600; margin-bottom: 1px; }
  .mod-subtitle { font-size: 11px; color: var(--gray-400); }
  .module-item.active .mod-subtitle { color: var(--gold-light); }

  .handoff-arrow {
    text-align: center;
    padding: 4px 0;
    color: var(--gray-500);
    font-size: 11px;
    font-family: 'Helvetica Neue', Arial, sans-serif;
  }
  .handoff-arrow.active-arrow { color: var(--gold); }

  .sidebar-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--navy-light);
    font-size: 11px;
    color: var(--gray-400);
    font-family: 'Helvetica Neue', Arial, sans-serif;
  }

  /* MAIN CONTENT */
  .main-content {
    flex: 1;
    padding: 40px 56px;
    max-width: 820px;
    overflow-y: auto;
    max-height: calc(100vh - 42px);
  }

  .module-header {
    margin-bottom: 36px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--navy);
  }
  .module-header .module-label {
    font-family: 'Helvetica Neue', Arial, sans-serif;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--gray-500);
    margin-bottom: 6px;
  }
  .module-header h1 {
    font-size: 28px;
    color: var(--navy);
    font-weight: 700;
    margin-bottom: 8px;
  }
  .module-header .module-desc {
    font-size: 15px;
    color: var(--gray-600);
    max-width: 600px;
  }

  /* SECTIONS */
  .section {
    margin-bottom: 36px;
  }
  .section-title {
    font-family: 'Helvetica Neue', Arial, sans-serif;
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--navy);
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--gray-200);
  }
  .section-intro {
    font-size: 15px;
    color: var(--gray-600);
    margin-bottom: 20px;
    line-height: 1.7;
  }

  /* FORM ELEMENTS */
  .field-group {
    margin-bottom: 24px;
  }
  .field-label {
    font-family: 'Helvetica Neue', Arial, sans-serif;
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 4px;
  }
  .field-hint {
    font-size: 13px;
    color: var(--gray-500);
    margin-bottom: 8px;
    font-style: italic;
  }
  textarea, input[type="text"], input[type="email"], input[type="tel"], input[type="number"] {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--gray-300);
    border-radius: 4px;
    font-family: 'Georgia', serif;
    font-size: 14px;
    line-height: 1.6;
    color: var(--gray-800);
    background: var(--white);
    transition: border-color 0.15s;
    resize: vertical;
    box-sizing: border-box;
  }
  textarea:focus, input[type="text"]:focus {
    outline: none;
    border-color: var(--navy);
    box-shadow: 0 0 0 2px rgba(30, 58, 95, 0.1);
  }
  textarea { min-height: 100px; }
  textarea.short { min-height: 60px; }

  .numbered-inputs {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }
  .numbered-input {
    display: flex;
    gap: 10px;
    align-items: flex-start;
  }
  .input-number {
    width: 28px;
    height: 28px;
    background: var(--gray-100);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Helvetica Neue', Arial, sans-serif;
    font-size: 12px;
    font-weight: 700;
    color: var(--gray-500);
    flex-shrink: 0;
    margin-top: 8px;
  }
  .numbered-input input {
    flex: 1;
  }

  /* DISCIPLINE TABLE */
  .discipline-grid {
    display: grid;
    grid-template-columns: 160px 1fr;
    gap: 1px;
    background: var(--gray-200);
    border: 1px solid var(--gray-200);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 16px;
  }
  .discipline-grid .dg-header {
    background: var(--navy);
    color: white;
    padding: 10px 14px;
    font-family: 'Helvetica Neue', Arial, sans-serif;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
  }
  .discipline-grid .dg-field {
    background: var(--gray-50);
    padding: 10px 14px;
    font-family: 'Helvetica Neue', Arial, sans-serif;
    font-size: 13px;
    font-weight: 600;
    color: var(--navy);
    display: flex;
    align-items: center;
  }
  .discipline-grid .dg-input {
    background: white;
    padding: 6px;
  }
  .discipline-grid .dg-input input {
    border: 1px solid var(--gray-200);
    padding: 8px 10px;
    font-size: 13px;
  }

  /* BUTTONS */
  .btn {
    font-family: 'Helvetica Neue', Arial, sans-serif;
    font-size: 14px;
    font-weight: 600;
    padding: 12px 28px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s;
    letter-spacing: 0.3px;
  }
  .btn-primary {
    background: var(--navy);
    color: white;
  }
  .btn-primary:hover { background: var(--navy-light); }
  .btn-primary:disabled { background: var(--gray-300); cursor: default; }
  .btn-secondary {
    background: transparent;
    color: var(--navy);
    border: 2px solid var(--navy);
  }
  .btn-secondary:hover { background: var(--navy); color: white; }
  .btn-gold {
    background: var(--gold);
    color: white;
  }
  .btn-gold:hover { background: #c97a1e; }

  .btn-row {
    display: flex;
    gap: 12px;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--gray-200);
  }
  .btn-row .spacer { flex: 1; }

  /* ANALYSIS CARD */
  .analysis-card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: 6px;
    padding: 28px;
    margin-bottom: 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  }
  .analysis-card.highlight {
    border-left: 4px solid var(--gold);
  }
  .analysis-card h3 {
    font-family: 'Helvetica Neue', Arial, sans-serif;
    font-size: 15px;
    font-weight: 700;
    color: var(--navy);
    margin-bottom: 12px;
  }
  .analysis-card p {
    font-size: 14px;
    line-height: 1.7;
    color: var(--gray-700);
    margin-bottom: 12px;
  }
  .analysis-card p:last-child { margin-bottom: 0; }

  /* TAGS */
  .tag-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
  .tag {
    font-family: 'Helvetica Neue', Arial, sans-serif;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 20px;
    letter-spacing: 0.3px;
  }
  .tag-navy { background: var(--navy); color: white; }
  .tag-gold { background: var(--gold-light); color: var(--navy-dark); }
  .tag-green { background: var(--green-light); color: #002a80; }

  /* STRESS TEST */
  .stress-row {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 0;
    border-bottom: 1px solid var(--gray-100);
  }
  .stress-row:last-child { border-bottom: none; }
  .stress-label {
    font-family: 'Helvetica Neue', Arial, sans-serif;
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-700);
    width: 180px;
    flex-shrink: 0;
  }
  .stress-bar-bg {
    flex: 1;
    height: 8px;
    background: var(--gray-200);
    border-radius: 4px;
    overflow: hidden;
  }
  .stress-bar {
    height: 100%;
    border-radius: 4px;
    transition: width 0.6s ease;
  }
  .stress-bar.strong { background: var(--green); }
  .stress-bar.developing { background: var(--amber); }
  .stress-bar.weak { background: var(--red); }
  .stress-rating {
    font-family: 'Helvetica Neue', Arial, sans-serif;
    font-size: 12px;
    font-weight: 700;
    width: 80px;
    text-align: right;
  }
  .stress-rating.strong { color: var(--green); }
  .stress-rating.developing { color: var(--amber); }
  .stress-rating.weak { color: var(--red); }
  .stress-row.clickable { cursor: pointer; border-radius: 6px; transition: background 0.15s; }
  .stress-row.clickable:hover { background: var(--gray-50); }
  .stress-hint { font-size: 10px; font-weight: 500; color: var(--gray-400); margin-left: 6px; letter-spacing: 0; text-transform: none; }
  .stress-feedback { padding: 14px 16px 16px; border-left: 3px solid var(--amber); background: #fffbf0; border-radius: 0 0 6px 6px; margin-top: -2px; margin-bottom: 6px; }
  .stress-feedback.weak { border-left-color: var(--red); background: #fff5f5; }
  .stress-revision-card:hover { border-color: var(--navy) !important; box-shadow: 0 2px 8px rgba(0,0,0,0.06); }

  /* CASE STUDY VIEW */
  .cs-container { max-width: 760px; margin: 0 auto; padding: 8px 0 40px; }
  .cs-header { text-align: center; margin-bottom: 32px; }
  .cs-header .cs-overtitle { font-family: 'Helvetica Neue', Arial, sans-serif; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 2px; color: var(--gold); margin-bottom: 6px; }
  .cs-header h1 { font-size: 26px; color: var(--navy); margin-bottom: 4px; }
  .cs-header .cs-subtitle { font-size: 14px; color: var(--gray-500); }
  .cs-phase { margin-bottom: 36px; }
  .cs-phase-label {
    font-family: 'Helvetica Neue', Arial, sans-serif;
    font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 1.5px;
    color: var(--white); background: var(--navy); display: inline-block;
    padding: 4px 14px; border-radius: 3px; margin-bottom: 14px;
  }
  .cs-phase h2 { font-size: 18px; color: var(--navy); margin-bottom: 6px; }
  .cs-phase .cs-phase-desc { font-size: 13px; color: var(--gray-500); margin-bottom: 16px; line-height: 1.5; }
  .cs-ba { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
  .cs-ba-col { background: var(--white); border: 1px solid var(--gray-200); border-radius: 8px; padding: 16px 18px; }
  .cs-ba-label {
    font-family: 'Helvetica Neue', Arial, sans-serif;
    font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px;
    margin-bottom: 8px; padding-bottom: 6px; border-bottom: 1px solid var(--gray-200);
  }
  .cs-ba-label.before { color: var(--gray-400); }
  .cs-ba-label.after { color: var(--green); }
  .cs-ba-col p, .cs-ba-col div { font-size: 13px; line-height: 1.6; color: var(--gray-700); }
  .cs-ba-col .cs-quote { font-style: italic; color: var(--gray-500); font-size: 12px; line-height: 1.5; }
  .cs-arrow-row { text-align: center; margin: 12px 0; }
  .cs-arrow { display: inline-block; font-size: 20px; color: var(--gold); }
  .cs-result-card {
    background: var(--white); border: 1px solid var(--gray-200); border-radius: 8px;
    padding: 16px 18px; margin-bottom: 12px;
  }
  .cs-result-label {
    font-family: 'Helvetica Neue', Arial, sans-serif;
    font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.8px;
    color: var(--gray-400); margin-bottom: 6px;
  }
  .cs-result-value { font-size: 15px; color: var(--navy); font-weight: 600; line-height: 1.5; }
  .cs-result-sub { font-size: 12px; color: var(--gray-500); margin-top: 4px; line-height: 1.5; }
  .cs-divider { border: none; border-top: 1px solid var(--gray-200); margin: 32px 0; }
  .cs-act-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--gray-100); font-size: 13px; }
  .cs-act-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
  .cs-act-name { color: var(--gray-700); font-weight: 600; }
  .cs-act-tag { margin-left: auto; flex-shrink: 0; }
  .cs-act-reason { font-size: 11px; color: var(--gray-500); font-style: italic; padding: 2px 0 6px 17px; }
  .cs-hl { border-left: 3px solid var(--gold); padding-left: 14px; margin: 12px 0; }
  .cs-hl p { font-size: 14px; color: var(--navy); font-weight: 600; line-height: 1.6; }

  /* DELIVERABLE CARDS */
  .format-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 20px;
  }
  .format-card {
    border: 2px solid var(--gray-200);
    border-radius: 6px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.15s;
  }
  .format-card:hover { border-color: var(--navy-light); }
  .format-card.selected { border-color: var(--navy); background: var(--blue-light); }
  .format-card h4 {
    font-family: 'Helvetica Neue', Arial, sans-serif;
    font-size: 14px;
    font-weight: 700;
    color: var(--navy);
    margin-bottom: 4px;
  }
  .format-card p {
    font-size: 12px;
    color: var(--gray-500);
    font-family: 'Helvetica Neue', Arial, sans-serif;
  }

  /* FRAMING TYPE SELECTOR */
  .framing-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
  }
  .framing-option {
    border: 2px solid var(--gray-200);
    border-radius: 6px;
    padding: 14px 18px;
    cursor: pointer;
    transition: all 0.15s;
    display: flex;
    gap: 14px;
  }
  .framing-option { cursor: pointer; transition: all 0.15s ease; position: relative; }
  .framing-option:hover { border-color: var(--navy-light); }
  .framing-option.selected {
    border-color: var(--navy);
    border-width: 2px;
    background: var(--blue-light);
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
  }
  .framing-option.selected::after {
    content: '\2713';
    position: absolute;
    top: 8px;
    right: 12px;
    color: var(--navy);
    font-weight: 700;
    font-size: 14px;
  }
  .framing-option .fo-label {
    font-family: 'Helvetica Neue', Arial, sans-serif;
    font-size: 14px;
    font-weight: 700;
    color: var(--navy);
    min-width: 110px;
  }
  .framing-option .fo-desc {
    font-size: 13px;
    color: var(--gray-600);
  }

  /* ESSAY CATEGORY BADGES */
  .essay-cat {
    display: inline-block;
    font-family: 'Helvetica Neue', Arial, sans-serif;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 3px 10px;
    border-radius: 3px;
  }
  .cat-whyus { background: #dbeafe; color: #1e40af; }
  .cat-contribution { background: #fce7f3; color: #9d174d; }
  .cat-curiosity { background: #ede9fe; color: #5b21b6; }
  .cat-identity { background: #fef3c7; color: #92400e; }
  .cat-challenge { background: #fee2e2; color: #991b1b; }
  .cat-community { background: #dbeafe; color: #002a80; }
  .cat-activity { background: #fdf4ff; color: #86198f; }

  /* POSITIONING STATEMENT BUILDER */
  .ps-component {
    background: var(--gray-50);
    border-left: 3px solid var(--navy);
    padding: 16px 20px;
    margin-bottom: 16px;
    border-radius: 0 4px 4px 0;
  }
  .ps-component .ps-label {
    font-family: 'Helvetica Neue', Arial, sans-serif;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--gray-500);
    margin-bottom: 4px;
  }
  .ps-component .ps-stem {
    font-size: 14px;
    color: var(--gray-600);
    margin-bottom: 8px;
    font-style: italic;
  }

  /* FINAL OUTPUT CARD */
  .output-card {
    background: var(--navy);
    color: white;
    border-radius: 8px;
    padding: 32px;
    margin-bottom: 24px;
  }
  .output-card h3 {
    font-family: 'Helvetica Neue', Arial, sans-serif;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--gold);
    margin-bottom: 12px;
  }
  .output-card .output-text {
    font-size: 16px;
    line-height: 1.8;
    font-style: italic;
  }

  /* PROGRESS INDICATOR */
  .phase-indicator {
    display: flex;
    gap: 0;
    margin-bottom: 32px;
  }
  .phase-step {
    flex: 1;
    padding: 10px 16px;
    font-family: 'Helvetica Neue', Arial, sans-serif;
    font-size: 12px;
    font-weight: 600;
    text-align: center;
    background: var(--gray-100);
    color: var(--gray-400);
    border-right: 2px solid var(--cream);
    letter-spacing: 0.3px;
  }
  .phase-step:first-child { border-radius: 4px 0 0 4px; }
  .phase-step:last-child { border-radius: 0 4px 4px 0; border-right: none; }
  .phase-step.active { background: var(--navy); color: white; cursor: default; }
  .phase-step.done { background: var(--green); color: white; cursor: pointer; transition: background 0.15s; }
  .phase-step.done:hover { background: #1a5f2e; }
  /* Future (not active, not done) steps are not navigable — show as locked */
  .phase-step:not(.active):not(.done) { cursor: default; opacity: 0.7; }

  /* WELCOME SCREEN */
  .welcome-screen {
    max-width: 640px;
    margin: 0 auto;
    padding-top: 40px;
  }
  .welcome-screen h1 {
    font-size: 32px;
    color: var(--navy);
    margin-bottom: 16px;
  }
  .welcome-screen p {
    font-size: 15px;
    color: var(--gray-600);
    line-height: 1.7;
    margin-bottom: 16px;
  }
  .welcome-screen .welcome-modules {
    margin: 32px 0;
  }
  .welcome-module-item {
    display: flex;
    gap: 16px;
    padding: 18px 0;
    border-bottom: 1px solid var(--gray-200);
  }
  .welcome-module-item:last-child { border-bottom: none; }
  .wm-num {
    width: 36px;
    height: 36px;
    background: var(--navy);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Helvetica Neue', Arial, sans-serif;
    font-size: 14px;
    font-weight: 700;
    flex-shrink: 0;
  }
  .wm-info h3 {
    font-family: 'Helvetica Neue', Arial, sans-serif;
    font-size: 15px;
    font-weight: 700;
    color: var(--navy);
    margin-bottom: 2px;
  }
  .wm-info p {
    font-size: 13px;
    color: var(--gray-500);
    margin-bottom: 0;
  }

  /* GUIDANCE BOX */
  .guidance-box {
    background: var(--amber-light);
    border: 1px solid #fcd34d;
    border-radius: 6px;
    padding: 16px 20px;
    margin-bottom: 20px;
  }
  .guidance-box .gb-title {
    font-family: 'Helvetica Neue', Arial, sans-serif;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--amber);
    margin-bottom: 6px;
  }
  .guidance-box p {
    font-size: 13px;
    color: var(--gray-700);
    line-height: 1.6;
  }

  /* ACTIVITY TABLE */
  .activity-row {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 6px;
    padding: 20px;
    margin-bottom: 12px;
  }
  .activity-row .ar-top {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
  }
  .activity-row .ar-top input { flex: 1; }
  .ar-cat-select {
    font-family: 'Helvetica Neue', Arial, sans-serif;
    font-size: 13px;
    padding: 8px 12px;
    border: 1px solid var(--gray-300);
    border-radius: 4px;
    background: white;
    color: var(--gray-700);
    min-width: 140px;
  }

  /* HIDDEN STATES */
  .hidden { display: none !important; }

  /* SCROLLBAR */
  .main-content::-webkit-scrollbar { width: 6px; }
  .main-content::-webkit-scrollbar-track { background: transparent; }
  .main-content::-webkit-scrollbar-thumb { background: var(--gray-300); border-radius: 3px; }

  /* TRANSITIONS */
  .fade-in { animation: fadeIn 0.3s ease-in; }
  @keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

  /* ============ ARC TRACKER (sidebar) ============ */
  .arc-tracker {
    padding: 16px 20px;
    border-top: 1px solid var(--navy-light);
    max-height: 38vh;
    overflow-y: auto;
  }
  .arc-tracker::-webkit-scrollbar { width: 4px; }
  .arc-tracker::-webkit-scrollbar-thumb { background: var(--navy-light); border-radius: 2px; }
  .arc-tracker-title {
    font-family: 'Helvetica Neue', Arial, sans-serif;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--gold);
    margin-bottom: 14px;
    font-weight: 700;
  }
  .arc-item {
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
  }
  .arc-item:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
  .arc-label {
    font-family: 'Helvetica Neue', Arial, sans-serif;
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--gold-light);
    margin-bottom: 3px;
    font-weight: 600;
  }
  .arc-value {
    font-size: 12px;
    color: rgba(255,255,255,0.8);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.15s ease;
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  /* Prevent long unbroken strings in student-rendered content from overflowing
     containers. Also clamp monster paste dumps in render contexts where we
     show the student's own text back to them. */
  .analysis-card p, .analysis-card textarea, .analysis-card input,
  .output-card p, .output-card div,
  .field-group textarea, .field-group input,
  .onepager p, .onepager-act-name, .onepager-pos,
  .framing-option, .activity-row, .numbered-input input {
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  /* Cap the rendered height of student text blocks that might have been
     pasted massively. Student can still scroll the textarea itself; the
     READ-BACK display (e.g., quoted lens statement, selected observation)
     gets a max-height with overflow indicator. */
  .student-content-display {
    max-height: 280px;
    overflow-y: auto;
    overflow-wrap: anywhere;
    word-break: break-word;
    padding-right: 6px;
  }
  .arc-value:hover {
    color: rgba(255,255,255,1);
  }
  .arc-value.arc-value-expanded {
    -webkit-line-clamp: unset;
    overflow: visible;
    color: rgba(255,255,255,1);
  }
  .arc-empty {
    font-size: 11px;
    color: rgba(255,255,255,0.25);
    font-family: 'Helvetica Neue', Arial, sans-serif;
    font-style: italic;
  }

  /* ============ EXAMPLE PANELS ============ */
  .example-toggle {
    font-family: 'Helvetica Neue', Arial, sans-serif;
    font-size: 12px;
    color: var(--navy-light);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 0;
    margin-top: -8px;
    margin-bottom: 4px;
    user-select: none;
    transition: color 0.15s;
    font-weight: 600;
    letter-spacing: 0.3px;
  }
  .example-toggle:hover { color: var(--navy); }
  .example-toggle .ex-arrow { display: inline-block; transition: transform 0.2s; font-size: 10px; }
  .example-toggle.open .ex-arrow { transform: rotate(90deg); }
  .example-panel {
    background: linear-gradient(135deg, #f0f4ff 0%, #faf8f4 100%);
    border-left: 3px solid var(--navy-light);
    padding: 16px 20px;
    margin: 4px 0 20px;
    border-radius: 0 8px 8px 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease, padding 0.35s ease, opacity 0.25s ease;
    opacity: 0;
    padding-top: 0;
    padding-bottom: 0;
    font-size: 14px;
    line-height: 1.7;
    color: var(--gray-700);
  }
  .example-panel.visible {
    max-height: 2000px;
    opacity: 1;
    padding: 16px 20px;
  }
  .example-panel .ex-label {
    font-family: 'Helvetica Neue', Arial, sans-serif;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--navy);
    font-weight: 700;
    margin-bottom: 8px;
  }
  .ex-domain-tab {
    font-family: 'Helvetica Neue', Arial, sans-serif;
    font-size: 11px;
    font-weight: 600;
    padding: 5px 12px;
    border-radius: 4px;
    cursor: pointer;
    color: var(--gray-400);
    background: var(--gray-200);
    transition: all 0.15s;
    letter-spacing: 0.3px;
  }
  .ex-domain-tab:hover { color: var(--navy); background: rgba(44,62,80,0.12); }
  .ex-domain-tab.active { color: #fff; background: var(--navy); }

  /* ============ STRATEGY ONE-PAGER ============ */
  .onepager {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 4px;
    padding: 48px 52px;
    box-shadow: 0 2px 16px rgba(0,0,0,0.06);
    margin-bottom: 24px;
    position: relative;
  }
  .onepager-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding-bottom: 20px;
    border-bottom: 3px solid var(--navy);
    margin-bottom: 32px;
  }
  .onepager-brand {
    font-family: 'Helvetica Neue', Arial, sans-serif;
  }
  .onepager-brand .brand-name {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 2.5px;
    color: var(--navy);
    font-weight: 700;
  }
  .onepager-brand .brand-sub {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--gold);
    font-weight: 600;
    margin-top: 2px;
  }
  .onepager-student { text-align: right; font-family: 'Helvetica Neue', Arial, sans-serif; }
  .onepager-student .name { font-size: 18px; font-weight: 700; color: var(--navy); }
  .onepager-student .info { font-size: 11px; color: var(--gray-500); margin-top: 2px; }
  .onepager-section { margin-bottom: 28px; }
  .onepager-section:last-child { margin-bottom: 0; }
  .onepager-section-title {
    font-family: 'Helvetica Neue', Arial, sans-serif;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--gold);
    font-weight: 700;
    margin-bottom: 10px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--gray-100);
  }
  .onepager-pos {
    font-size: 15px;
    line-height: 1.8;
    color: var(--gray-800);
    font-style: italic;
  }
  .onepager-arc-step {
    display: flex;
    gap: 14px;
    margin-bottom: 14px;
    align-items: flex-start;
  }
  .onepager-arc-num {
    width: 24px;
    height: 24px;
    background: var(--navy);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Helvetica Neue', Arial, sans-serif;
    font-size: 11px;
    font-weight: 700;
    flex-shrink: 0;
    margin-top: 2px;
  }
  .onepager-arc-num.final { background: var(--gold); color: white; }
  .onepager-arc-text { font-size: 13px; line-height: 1.6; color: var(--gray-700); }
  .onepager-arc-label {
    font-family: 'Helvetica Neue', Arial, sans-serif;
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--gray-400);
    font-weight: 600;
    margin-bottom: 2px;
  }
  .onepager-activity {
    display: flex;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid var(--gray-50);
    align-items: baseline;
  }
  .onepager-activity:last-child { border-bottom: none; }
  .onepager-act-rank {
    font-family: 'Helvetica Neue', Arial, sans-serif;
    font-size: 11px;
    font-weight: 700;
    color: var(--gray-400);
    width: 20px;
    text-align: right;
    flex-shrink: 0;
  }
  .onepager-act-name { font-size: 13px; font-weight: 600; color: var(--navy); }
  .onepager-act-cat {
    font-family: 'Helvetica Neue', Arial, sans-serif;
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 700;
    margin-left: auto;
    flex-shrink: 0;
  }
  .onepager-essay-item {
    padding: 8px 0;
    border-bottom: 1px solid var(--gray-50);
    font-size: 13px;
    line-height: 1.6;
  }
  .onepager-essay-item:last-child { border-bottom: none; }
  .onepager-coherence {
    display: flex;
    gap: 10px;
    align-items: center;
    padding: 6px 0;
  }
  .onepager-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
  }
  .onepager-footer {
    margin-top: 32px;
    padding-top: 16px;
    border-top: 1px solid var(--gray-200);
    display: flex;
    justify-content: space-between;
    font-family: 'Helvetica Neue', Arial, sans-serif;
    font-size: 10px;
    color: var(--gray-400);
    letter-spacing: 0.5px;
  }
  /* ============ FIELD INFO MODAL ============ */
  .field-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .field-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(21,42,69,0.55);
    backdrop-filter: blur(3px);
    cursor: pointer;
  }
  .field-modal-inner {
    position: relative;
    background: white;
    border-radius: 12px;
    padding: 36px 40px 32px;
    max-width: 540px;
    width: calc(100% - 48px);
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.18);
  }
  .field-modal-close {
    position: absolute;
    top: 16px;
    right: 20px;
    background: none;
    border: none;
    font-size: 22px;
    color: var(--gray-400);
    cursor: pointer;
    line-height: 1;
    padding: 4px;
  }
  .field-modal-close:hover { color: var(--navy); }
  .field-modal-field-name {
    font-family: 'Helvetica Neue', Arial, sans-serif;
    font-size: 22px;
    font-weight: 700;
    color: var(--navy);
    margin-bottom: 6px;
  }
  .field-modal-parent {
    font-family: 'Helvetica Neue', Arial, sans-serif;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--gold);
    font-weight: 600;
    margin-bottom: 20px;
  }
  .field-modal-section-label {
    font-family: 'Helvetica Neue', Arial, sans-serif;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--gray-400);
    font-weight: 700;
    margin-bottom: 6px;
    margin-top: 16px;
  }
  .field-modal-text {
    font-size: 14px;
    line-height: 1.7;
    color: var(--gray-700);
  }
  .field-modal-video-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-top: 20px;
    padding: 12px 20px;
    background: #ff0000;
    color: white;
    border-radius: 6px;
    text-decoration: none;
    font-family: 'Helvetica Neue', Arial, sans-serif;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.3px;
    transition: background 0.15s;
  }
  .field-modal-video-btn:hover { background: #cc0000; }
  .field-modal-video-btn .yt-icon { font-size: 16px; }

  /* Clickable sub-field chips */
  .sub-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 14px;
    background: var(--blue-light);
    color: var(--navy);
    border-radius: 20px;
    font-family: 'Helvetica Neue', Arial, sans-serif;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, transform 0.1s;
    border: 1px solid transparent;
    user-select: none;
  }
  .sub-chip:hover {
    background: var(--navy);
    color: white;
    transform: translateY(-1px);
  }
  .sub-chip .chip-info { font-size: 10px; opacity: 0.7; }

  /* MOBILE MENU BUTTON (hidden on desktop) */
  .mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: var(--white);
    font-size: 22px;
    cursor: pointer;
    /* 44x44 min tap target per WCAG 2.1 AAA */
    min-width: 44px;
    min-height: 44px;
    padding: 10px 12px;
    line-height: 1;
  }
  .mobile-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 998;
  }
  .mobile-overlay.visible { display: block; }

  @media (max-width: 768px) {
    /* Show hamburger, hide demo badge */
    .mobile-menu-btn { display: block; }
    .demo-badge { display: none; }

    /* Topbar adjustments */
    .topbar {
      display: flex;
      align-items: center;
      gap: 8px;
      padding: 10px 16px;
    }
    .topbar .brand { font-size: 12px; }

    /* Sidebar becomes slide-out drawer */
    .sidebar {
      position: fixed;
      top: 0; left: 0; bottom: 0;
      width: 280px;
      z-index: 999;
      transform: translateX(-100%);
      transition: transform 0.25s ease;
      overflow-y: auto;
    }
    .sidebar.mobile-open { transform: translateX(0); }

    /* App container goes vertical */
    .app-container { flex-direction: column; }

    /* Main content fills screen */
    .main-content {
      padding: 20px 16px;
      max-width: 100%;
      max-height: none;
      overflow-y: visible;
    }

    /* Module header */
    .module-header h1 { font-size: 22px; }
    .module-desc { font-size: 13px; }

    /* Phase indicators stack */
    .phase-indicator { flex-wrap: wrap; gap: 4px; }
    .phase-step { font-size: 10px; padding: 4px 8px; }

    /* Format grid and inline grids → single column */
    .format-grid { grid-template-columns: 1fr; }
    [style*="grid-template-columns: 1fr 1fr 1fr"],
    [style*="grid-template-columns:1fr 1fr 1fr"],
    [style*="grid-template-columns:1fr 1fr 1fr 1fr"],
    [style*="grid-template-columns: 1fr 1fr 1fr 1fr"] { grid-template-columns: 1fr !important; }
    [style*="grid-template-columns:140px 120px 1fr"] { grid-template-columns: 1fr !important; }

    /* Analysis cards */
    .analysis-card { padding: 14px 16px; }

    /* Sections */
    .section { margin-bottom: 20px; padding-bottom: 16px; }
    .section-title { font-size: 16px; }

    /* Buttons */
    .btn { min-height: 44px; font-size: 13px; padding: 10px 18px; }
    .btn-row { flex-wrap: wrap; gap: 8px; padding-top: 16px; }
    .btn-row .spacer { display: none; }

    /* Inputs and textareas */
    input[type="text"], textarea, select { font-size: 16px !important; }
    textarea { min-height: 100px; }
    textarea.short { min-height: 80px; }

    /* Tag rows */
    .tag-row { flex-wrap: wrap; }
    .tag { font-size: 11px; padding: 3px 8px; }

    /* PS components (question builder) */
    .ps-component { padding: 12px; }
    .ps-label { font-size: 13px; }

    /* Stress test rows */
    .stress-row { flex-wrap: wrap; gap: 4px; }

    /* Framing options */
    .framing-option { padding: 12px; }

    /* Numbered inputs */
    .numbered-input { flex-wrap: nowrap; }
    .numbered-input input { min-width: 0; }

    /* Example panels */
    .example-panel { padding: 12px 14px; }

    /* Guidance boxes */
    .guidance-box { padding: 14px 16px; }

    /* Output cards */
    .output-card { padding: 20px 16px; }

    /* Welcome screen buttons */
    .btn-row button { width: 100%; }

    /* Case study */
    .cs-container { padding: 8px 0; }

    /* Arc tracker / progress items */
    .arc-module { padding: 10px 12px; }

    /* Field modal */
    .field-modal-inner { width: 95%; max-width: 95%; padding: 20px; }

    /* Activity inputs (M4) */
    .activity-row { flex-direction: column; gap: 8px; }
    .activity-row input[style*="max-width"] { max-width: 100% !important; }
  }

  @media (max-width: 480px) {
    .main-content { padding: 16px 12px; }
    .module-header h1 { font-size: 20px; }
    .section-title { font-size: 15px; }
    .topbar .brand { font-size: 11px; letter-spacing: 0; }
  }

  /* TOAST NOTIFICATIONS */
  .toast-message {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: var(--red);
    color: white;
    padding: 12px 24px;
    border-radius: 6px;
    font-family: 'Helvetica Neue', Arial, sans-serif;
    font-size: 13px;
    font-weight: 600;
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.3s, transform 0.3s;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  }
  .toast-message.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }

  /* SHAKE ANIMATION for validation */
  @keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-4px); }
    40%, 80% { transform: translateX(4px); }
  }
  .shake { animation: shake 0.4s ease; }

  @media print {
    /* Hide chrome */
    .topbar, .sidebar, .btn-row, .phase-indicator,
    .mobile-menu-btn, .mobile-overlay, .module-header,
    .toast-message, .field-modal { display: none !important; }

    /* Hide non-onepager phases and revision buttons */
    [id="screen-welcome"], [id="screen-casestudy"],
    [id="screen-mod1"], [id="screen-mod2"], [id="screen-mod3"] { display: none !important; }
    .btn-primary, .btn-outline, .btn-gold { display: none !important; }

    /* Layout reset */
    .app-container { display: block !important; }
    .main-content { max-width: 100% !important; padding: 0 !important; max-height: none !important; overflow: visible !important; }
    body { background: white !important; }

    /* One-pager card */
    .onepager, .one-pager-card { box-shadow: none !important; border: 1px solid #ccc !important; padding: 24px !important; }

    /* Page break control */
    .onepager h3, .onepager h4, [style*="ETHOS"], [style*="INTELLECTUAL ARC"],
    [style*="PRIMARY ACTIVITIES"], [style*="ESSAY STRATEGY"] { page-break-after: avoid; }
    .onepager > div { page-break-inside: avoid; }

    /* Keep the "THE TEST" callout visible but no bg on print */
    [style*="border-left: 4px solid var(--gold)"] { border-left: 4px solid #c99700 !important; }
  }
