    /* ── Reset & Base ─────────────────────────────────────────── */
    *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
    /* ── Global SVG icon sizing ───────────────────────────────── */
    /* Default: all SVGs with icon classes render at a controlled size.
       Specific containers override these with their own rules below. */
    svg.tab-icon    { width: 16px; height: 16px; vertical-align: middle; flex-shrink: 0; }
    svg.nav-icon    { width: 16px; height: 16px; vertical-align: middle; flex-shrink: 0; }
    svg.nav-icon.sm { width: 12px; height: 12px; }
    svg.btn-icon    { width: 16px; height: 16px; vertical-align: middle; flex-shrink: 0; }
    svg.content-icon{ width: 16px; height: 16px; vertical-align: middle; flex-shrink: 0; }
    svg.status-icon { width: 14px; height: 14px; vertical-align: middle; flex-shrink: 0; }
    svg.dz-icon     { width: 40px; height: 40px; flex-shrink: 0; }
    :root {
      --navy:   #0d2b55;
      --blue:   #1a56a0;
      --teal:   #0e7c7b;
      --gold:   #c9a84c;
      --gold-light: #f5e9c8;
      --light:  #f0f3f9;
      --white:  #ffffff;
      --border: #d0d7e3;
      --border-strong: #b0bdd0;
      --text:   #1c2b3a;
      --text-secondary: #374151;
      --muted:  #5a6a7e;
      --red:    #c0392b;
      --green:  #1a7a4a;
      --orange: #c96a00;
      --radius: 10px;
      --radius-lg: 14px;
      --shadow: 0 2px 12px rgba(13,43,85,.10);
      --shadow-md: 0 4px 20px rgba(13,43,85,.13);
      --shadow-lg: 0 8px 40px rgba(13,43,85,.18);
    }
    html { font-size: 16px; }
    body {
      font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
      background: var(--light);
      color: var(--text);
      min-height: 100vh;
      -webkit-font-smoothing: antialiased;
    }

    /* ── Header ───────────────────────────────────────────────── */
    header {
      background: var(--navy);
      color: #fff;
      padding: 10px 20px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      flex-wrap: wrap;
      gap: 10px;
      box-shadow: 0 2px 8px rgba(0,0,0,.25);
      position: sticky; top: 0; z-index: 100;
    }
    header .brand { display: flex; align-items: center; gap: 10px; }
    header .logo-img {
      height: 53px; width: auto; flex-shrink: 0;
      filter: drop-shadow(0 1px 3px rgba(0,0,0,.25));
    }
    header h1 { font-size: 1.15rem; font-weight: 700; letter-spacing: .3px; }
    header p  { font-size: .72rem; opacity: .7; margin-top: 1px; }
    /* Sidebar toggle button */
    .btn-sidebar-toggle {
      background: rgba(255,255,255,.15); border: 1px solid rgba(255,255,255,.25);
      color: #fff; border-radius: var(--radius); padding: 5px 10px;
      cursor: pointer; font-size: .85rem; line-height: 1; transition: background .15s;
    }
    .btn-sidebar-toggle:hover { background: rgba(255,255,255,.28); }
    /* App tabs in header */
    .header-tabs { display: flex; gap: 4px; }
    .header-tab {
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 3px;
      padding: 6px 10px; font-size: .74rem; font-weight: 600; cursor: pointer;
      border: none; background: rgba(255,255,255,.12); color: rgba(255,255,255,.75);
      border-radius: var(--radius);
      transition: background .15s, color .15s;
      position: relative;
      min-width: 76px;
    }
    .header-tab svg.tab-icon {
      width: 20px; height: 20px; flex-shrink: 0;
    }
    .header-tab::after {
      content: ''; position: absolute; bottom: 0; left: 50%; right: 50%;
      height: 3px; background: var(--gold); border-radius: 2px 2px 0 0;
      transition: left .2s, right .2s;
    }
    .header-tab.active { background: rgba(255,255,255,.18); color: #fff; font-weight: 700; }
    .header-tab.active::after { left: 10%; right: 10%; }
    .header-tab:hover:not(.active) { background: rgba(255,255,255,.2); color: #fff; }
    .header-right { display: flex; align-items: center; gap: 8px; }
    .grant-type-selector { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
    .grant-type-selector label { font-size: .78rem; opacity: .8; }
    .grant-type-selector select {
      padding: 5px 10px; border-radius: var(--radius);
      border: 1px solid rgba(255,255,255,.3);
      background: rgba(255,255,255,.12); color: #fff;
      font-size: .82rem; cursor: pointer; outline: none;
    }
    .grant-type-selector select option { background: var(--navy); color: #fff; }

    /* Phase badge in header */
    #phase-badge {
      display: none;
      padding: 4px 12px; border-radius: 20px;
      font-size: .78rem; font-weight: 700; letter-spacing: .5px;
      text-transform: uppercase;
    }
    #phase-badge.phase1  { background: #1a7a4a; color: #fff; }
    #phase-badge.phase2  { background: #1a56a0; color: #fff; }
    #phase-badge.fasttrack { background: #c96a00; color: #fff; }

    /* ── Layout ───────────────────────────────────────────────── */
    .app { display: grid; grid-template-columns: 220px 1fr; min-height: calc(100vh - 56px); transition: grid-template-columns .25s; }
    .app.sidebar-collapsed { grid-template-columns: 0px 1fr; }
    @media (max-width: 860px) { .app { grid-template-columns: 1fr; } }

    /* ── Sidebar ──────────────────────────────────────────────── */
    aside {
      background: var(--white);
      border-right: 1px solid var(--border);
      padding: 0;
      position: sticky; top: 0; height: calc(100vh - 56px);
      overflow: hidden;
      transition: width .25s, opacity .25s;
      display: flex; flex-direction: column;
    }
    .app.sidebar-collapsed aside { width: 0; opacity: 0; pointer-events: none; overflow: hidden; }
    /* Sidebar header: toggle + grant type selector */
    .sidebar-header {
      display: flex; align-items: center; gap: 8px;
      padding: 10px 12px;
      border-bottom: 1px solid var(--border);
      background: var(--light);
      flex-shrink: 0;
    }
    .sidebar-header .btn-sidebar-toggle {
      background: transparent; border: 1px solid var(--border);
      color: var(--navy); border-radius: var(--radius); padding: 5px 9px;
      cursor: pointer; font-size: .85rem; line-height: 1; transition: background .15s;
      flex-shrink: 0;
    }
    .sidebar-header .btn-sidebar-toggle:hover { background: var(--border); }
    .sgt-select {
      flex: 1; min-width: 0;
      padding: 5px 8px; border-radius: var(--radius);
      border: 1px solid var(--border);
      background: var(--white); color: var(--text);
      font-size: .78rem; cursor: pointer; outline: none;
    }
    /* Scrollable middle */
    .sidebar-scroll {
      flex: 1; overflow-y: auto; overflow-x: hidden;
      padding: 12px 0;
    }
    /* Sticky compile footer */
    .sidebar-footer {
      flex-shrink: 0;
      padding: 12px 16px;
      border-top: 1px solid var(--border);
      background: var(--white);
    }
    .sidebar-footer .nav-compile {
      margin: 0; width: 100%;
    }
    aside h2 { font-size: .7rem; text-transform: uppercase; letter-spacing: 1px;
      color: var(--muted); padding: 0 20px 10px; }
    .nav-item {
      display: flex; align-items: center; gap: 10px;
      padding: 11px 20px; cursor: pointer;
      border-left: 3px solid transparent;
      transition: background .15s, border-color .15s;
      font-size: .9rem; color: var(--text);
    }
    .nav-item:hover { background: var(--light); }
    .nav-item.active { border-left-color: var(--blue); background: #eef3fb; color: var(--blue); font-weight: 600; }
    .nav-item.done   { color: var(--green); }
    .nav-item .num {
      width: 24px; height: 24px; border-radius: 50%;
      background: var(--border); color: var(--muted);
      font-size: .75rem; font-weight: 700;
      display: flex; align-items: center; justify-content: center; flex-shrink: 0;
    }
    .nav-item.active .num { background: var(--blue); color: #fff; }
    .nav-item.done   .num { background: var(--green); color: #fff; }
    .nav-divider { height: 1px; background: var(--border); margin: 12px 20px; }
    .nav-compile {
      margin: 16px 20px 0;
      padding: 10px 16px; border-radius: var(--radius);
      background: var(--gold); color: var(--navy);
      font-weight: 700; font-size: .9rem;
      border: none; cursor: pointer; width: calc(100% - 40px);
      transition: background .15s;
    }
    .nav-compile:hover { background: #b8943e; }
    .progress-bar { margin: 0 20px 16px; }
    .progress-bar .label { font-size: .75rem; color: var(--muted); margin-bottom: 4px; }
    .progress-bar .track { height: 6px; background: var(--border); border-radius: 3px; overflow: hidden; }
    .progress-bar .fill  { height: 100%; background: var(--blue); border-radius: 3px; transition: width .3s; }

    /* Phase info box in sidebar */
    .phase-info-box {
      margin: 0 20px 16px;
      padding: 10px 14px;
      border-radius: var(--radius);
      font-size: .78rem;
      line-height: 1.5;
      display: none;
    }
    .phase-info-box.phase1    { background: #e8f5ee; border: 1px solid #a8d5b8; color: #1a5c34; }
    .phase-info-box.phase2    { background: #e8eef8; border: 1px solid #a8c0e0; color: #1a3a6a; }
    .phase-info-box.fasttrack { background: #fff0e0; border: 1px solid #f0c080; color: #7a3c00; }
    .phase-info-box strong { display: block; font-size: .82rem; margin-bottom: 4px; }

    /* ── Sidebar Compliance Checker ──────────────────────────────── */
    .sidebar-compliance {
      margin: 0 12px 16px;
      border: 1px solid var(--border);
      border-radius: var(--radius);
      background: var(--white);
      overflow: hidden;
    }
    .compliance-header {
      display: flex; align-items: center; justify-content: space-between;
      padding: 9px 14px; cursor: pointer;
      background: var(--light); border-bottom: 1px solid var(--border);
      user-select: none;
    }
    .compliance-header .ch-title { font-size: .78rem; font-weight: 700; color: var(--navy); }
    .compliance-header .ch-score {
      font-size: .72rem; font-weight: 800; padding: 2px 8px;
      border-radius: 10px; background: #e2e8f0; color: var(--muted);
    }
    .compliance-header .ch-score.green  { background: #d0f0e0; color: #1a5c34; }
    .compliance-header .ch-score.yellow { background: #fef3c7; color: #92400e; }
    .compliance-header .ch-score.red    { background: #fee2e2; color: #991b1b; }
    .compliance-body { padding: 8px 0; display: none; }
    .compliance-body.open { display: block; }
    .compliance-item {
      display: flex; align-items: flex-start; gap: 8px;
      padding: 5px 14px; font-size: .75rem; line-height: 1.4;
    }
    .compliance-item .ci-dot {
      width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; margin-top: 3px;
    }
    .compliance-item.pass .ci-dot  { background: #22c55e; }
    .compliance-item.warn .ci-dot  { background: #f59e0b; }
    .compliance-item.fail .ci-dot  { background: #ef4444; }
    .compliance-item .ci-text { color: var(--text-secondary); }
    .compliance-item.fail .ci-text { color: #991b1b; font-weight: 600; }
    .compliance-item.warn .ci-text { color: #92400e; }

    /* ── Main Content ─────────────────────────────────────────── */
    main { padding: 20px 24px; overflow-y: auto; max-width: 960px; }

    /* ── Module Panel ─────────────────────────────────────────── */
    .module-panel { display: none; }
    .module-panel.active { display: block; }
    .module-header { margin-bottom: 28px; }
    .module-header .badge {
      display: inline-block; padding: 3px 10px; border-radius: 20px;
      background: #dbe8f8; color: var(--blue); font-size: .75rem;
      font-weight: 600; text-transform: uppercase; letter-spacing: .5px; margin-bottom: 10px;
    }
    .module-header h2 { font-size: 1.5rem; font-weight: 800; color: var(--navy); letter-spacing: -.3px; }
    .module-header p  { color: var(--muted); margin-top: 6px; font-size: .93rem; line-height: 1.65; max-width: 680px; }
    .nih-ref {
      display: inline-flex; align-items: center; gap: 6px;
      background: #fff8e8; border: 1px solid #e8d5a0;
      border-radius: var(--radius); padding: 6px 12px;
      font-size: .8rem; color: #7a5c00; margin-top: 10px;
    }
    .nih-ref svg { width: 14px !important; height: 14px !important; flex-shrink: 0; }

    /* Phase-specific callout inside module */
    .phase-callout {
      border-radius: var(--radius);
      padding: 12px 16px;
      margin-bottom: 18px;
      font-size: .85rem;
      line-height: 1.55;
      display: none;
    }
    .phase-callout.phase1    { background: #e8f5ee; border-left: 4px solid #1a7a4a; color: #1a4a2a; }
    .phase-callout.phase2    { background: #e8eef8; border-left: 4px solid #1a56a0; color: #1a3060; }
    .phase-callout.fasttrack { background: #fff0e0; border-left: 4px solid #c96a00; color: #6a3000; }
    .phase-callout strong { font-weight: 700; }

    /* ── Question Cards ───────────────────────────────────────── */
    .question-card {
      background: var(--white); border: 1px solid var(--border);
      border-radius: var(--radius); padding: 18px 22px;
      margin-bottom: 16px; box-shadow: 0 1px 3px rgba(13,43,85,.06);
      transition: box-shadow .15s;
    }
    .question-card:focus-within { box-shadow: 0 0 0 2px rgba(26,86,160,.2), 0 2px 8px rgba(13,43,85,.1); border-color: #93b4d8; }
    .question-card label {
      font-size: .88rem; font-weight: 700;
      color: var(--navy); margin-bottom: 6px;
    }
    .question-card .hint {
      font-size: .82rem; color: var(--muted); margin-bottom: 10px; line-height: 1.5;
    }
    .question-card .required { color: var(--red); margin-left: 3px; }
    .question-card .phase-tag {
      display: inline-block; font-size: .7rem; font-weight: 700;
      padding: 2px 8px; border-radius: 10px; margin-left: 6px;
      vertical-align: middle; text-transform: uppercase; letter-spacing: .4px;
    }
    .phase-tag.p1  { background: #d0f0e0; color: #1a5c34; }
    .phase-tag.p2  { background: #d0e0f8; color: #1a3a6a; }
    .phase-tag.ft  { background: #ffe0b0; color: #7a3c00; }
    .phase-tag.p2ft { background: linear-gradient(90deg,#d0e0f8,#ffe0b0); color: #3a2a00; }
    .question-card textarea,
    .question-card input[type="text"],
    .question-card input[type="number"],
    .question-card select {
      width: 100%; padding: 10px 13px; border: 1px solid var(--border);
      border-radius: var(--radius); font-size: .92rem; font-family: inherit;
      color: var(--text); background: #fafbfd;
      transition: border-color .15s, box-shadow .15s; outline: none;
    }
    .question-card textarea:focus,
    .question-card input:focus,
    .question-card select:focus {
      border-color: var(--blue); box-shadow: 0 0 0 3px rgba(26,86,160,.12);
    }
    .question-card textarea { resize: vertical; min-height: 110px; line-height: 1.65; }
    .question-card textarea.tall { min-height: 200px; }
    .question-card textarea.xtall { min-height: 300px; }
    .question-card .char-count { font-size: .75rem; color: var(--muted); text-align: right; margin-top: 4px; }
    .question-card .row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
    @media (max-width: 600px) { .question-card .row { grid-template-columns: 1fr; } }
    .question-card .row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }
    @media (max-width: 700px) { .question-card .row-3 { grid-template-columns: 1fr; } }

    /* Aim builder */
    .aim-block {
      border: 1px solid var(--border); border-radius: var(--radius);
      padding: 16px; margin-bottom: 12px; background: #fafbfd;
    }
    .aim-block h4 { font-size: .88rem; font-weight: 700; color: var(--navy); margin-bottom: 10px; }
    .aim-block textarea { min-height: 80px; }
    .add-aim-btn, .remove-aim-btn {
      padding: 6px 14px; border-radius: var(--radius); font-size: .82rem;
      cursor: pointer; border: 1px solid var(--border); background: var(--white);
      color: var(--blue); font-weight: 600; margin-top: 4px;
    }
    .remove-aim-btn { color: var(--red); float: right; }

    /* Go/No-Go milestone block */
    .milestone-block {
      border: 1px solid #f0c080; border-radius: var(--radius);
      padding: 16px; margin-bottom: 12px; background: #fffaf0;
    }
    .milestone-block h4 { font-size: .88rem; font-weight: 700; color: var(--orange); margin-bottom: 10px; }
    .add-milestone-btn {
      padding: 6px 14px; border-radius: var(--radius); font-size: .82rem;
      cursor: pointer; border: 1px solid #f0c080; background: var(--white);
      color: var(--orange); font-weight: 600; margin-top: 4px;
    }
    .remove-milestone-btn { color: var(--red); float: right; padding: 6px 14px;
      border-radius: var(--radius); font-size: .82rem; cursor: pointer;
      border: 1px solid var(--border); background: var(--white); font-weight: 600; }

    /* ── Module Navigation Buttons ────────────────────────────── */
    .module-nav {
      display: flex; justify-content: space-between; align-items: center;
      margin-top: 32px; padding-top: 20px; border-top: 1px solid var(--border);
    }
    .btn-prev, .btn-next, .btn-compile {
      padding: 10px 24px; border-radius: var(--radius);
      font-size: .95rem; font-weight: 600; cursor: pointer; border: none;
      transition: background .15s, transform .1s;
    }
    .btn-prev   { background: var(--white); border: 1px solid var(--border); color: var(--text); }
    .btn-prev:hover { background: var(--light); }
    .btn-next   { background: var(--blue); color: #fff; }
    .btn-next:hover { background: #1448a0; }
    .btn-compile { background: var(--gold); color: var(--navy); }
    .btn-compile:hover { background: #b8943e; }
    .module-nav .step-info { font-size: .85rem; color: var(--muted); }

    /* ── Grant Output Panel ───────────────────────────────────── */
    #grant-output-panel { display: none; }
    #grant-output-panel.active { display: block; }
    .output-toolbar {
      display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 24px; align-items: center;
      background: #fff; padding: 14px 20px; border-radius: var(--radius);
      box-shadow: var(--shadow); border: 1px solid var(--border);
    }
    .output-toolbar h2 { font-size: 1.4rem; font-weight: 700; color: var(--navy); flex: 1; }
    .btn-copy, .btn-print, .btn-back {
      padding: 8px 18px; border-radius: var(--radius); font-size: .88rem;
      font-weight: 600; cursor: pointer; border: none; transition: background .15s;
    }
    .btn-copy  { background: var(--teal); color: #fff; }
    .btn-copy:hover { background: #0a6060; }
    .btn-print { background: var(--navy); color: #fff; }
    .btn-print:hover { background: #0a1f3d; }
    .btn-back  { background: var(--white); border: 1px solid var(--border); color: var(--text); }
    .btn-back:hover { background: var(--light); }
    .btn-export-word { background:#1a56a0;color:#fff;border:none;padding:7px 14px;border-radius:var(--radius);font-size:.82rem;font-weight:700;cursor:pointer;transition:opacity .15s; }
    .btn-export-word:hover { opacity:.85; }
    .btn-export-review { background:#0a6640;color:#fff;border:none;padding:7px 14px;border-radius:var(--radius);font-size:.82rem;font-weight:700;cursor:pointer;transition:opacity .15s; }
    .btn-export-review:hover { opacity:.85; }
    #grant-doc {
      background: var(--white); border: 1px solid var(--border);
      border-radius: var(--radius); padding: 48px 52px;
      box-shadow: var(--shadow); max-width: 860px;
      font-family: "Georgia", "Times New Roman", serif;
      font-size: .95rem; line-height: 1.75; color: #1c2b3a;
    }
    #grant-doc h1 { font-size: 1.3rem; text-align: center; margin-bottom: 4px; }
    #grant-doc .doc-meta { text-align: center; font-size: .85rem; color: var(--muted); margin-bottom: 32px; }
    #grant-doc .doc-phase-banner {
      text-align: center; padding: 8px 16px; border-radius: var(--radius);
      font-size: .85rem; font-weight: 700; margin-bottom: 24px;
    }
    #grant-doc .doc-phase-banner.phase1    { background: #e8f5ee; color: #1a5c34; }
    #grant-doc .doc-phase-banner.phase2    { background: #e8eef8; color: #1a3a6a; }
    #grant-doc .doc-phase-banner.fasttrack { background: #fff0e0; color: #7a3c00; }
    #grant-doc h2 {
      font-size: 1.05rem; font-weight: 700; text-transform: uppercase;
      letter-spacing: .8px; color: var(--navy); margin: 28px 0 10px;
      border-bottom: 2px solid var(--navy); padding-bottom: 4px;
    }
    #grant-doc h3 { font-size: .97rem; font-weight: 700; margin: 18px 0 6px; color: var(--text); }
    #grant-doc h4 { font-size: .92rem; font-weight: 700; margin: 14px 0 4px; color: var(--muted); }
    #grant-doc p  { margin-bottom: 10px; }
    #grant-doc .placeholder { color: #aaa; font-style: italic; }
    #grant-doc .section-divider { border: none; border-top: 1px solid var(--border); margin: 28px 0; }
    #grant-doc .milestone-table { width: 100%; border-collapse: collapse; margin: 12px 0; font-size: .88rem; }
    #grant-doc .milestone-table th { background: #fff0e0; color: var(--orange); padding: 8px 12px; text-align: left; border: 1px solid #f0c080; }
    #grant-doc .milestone-table td { padding: 8px 12px; border: 1px solid var(--border); vertical-align: top; }
    #grant-doc .milestone-table tr:nth-child(even) td { background: #fafbfd; }

    /* ── Toast ────────────────────────────────────────────────── */
    #toast {
      position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%) translateY(20px);
      background: var(--navy); color: #fff; padding: 10px 22px;
      border-radius: 24px; font-size: .88rem; font-weight: 600;
      opacity: 0; transition: opacity .3s, transform .3s; pointer-events: none; z-index: 999;
    }
    #toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

    /* ── AI Assistant Styles ───────────────────────────────── */
    .btn-ai-settings {
      padding: 6px 14px; border-radius: var(--radius);
      background: rgba(255,255,255,.15); color: #fff;
      border: 1px solid rgba(255,255,255,.3); font-size: .82rem;
      font-weight: 600; cursor: pointer; display: flex; align-items: center; gap: 6px;
    }
    .btn-ai-settings:hover { background: rgba(255,255,255,.25); }
    .btn-ai-settings svg.tab-icon { width: 16px; height: 16px; flex-shrink: 0; }
    .ai-dot { width:8px;height:8px;border-radius:50%;background:#666;display:inline-block; }
    .ai-dot.connected { background:#4ade80; }
    /* API Key Modal */
    .modal-overlay { position:fixed;inset:0;background:rgba(13,43,85,.6);display:flex;align-items:flex-start;justify-content:center;padding:40px 16px;z-index:2000;backdrop-filter:blur(3px);overflow-y:auto; }
    .modal-overlay.hidden { display:none; }
    .modal-box { background:#fff;border-radius:12px;padding:32px 36px;max-width:540px;width:90%;box-shadow:0 8px 40px rgba(13,43,85,.3); }
    .modal-box h3 { font-size:1.1rem;color:var(--navy);margin-bottom:8px; }
    .modal-box p  { font-size:.87rem;color:var(--muted);margin-bottom:14px;line-height:1.6; }
    .modal-box label { font-size:.82rem;font-weight:600;color:var(--text);display:block;margin-bottom:4px;margin-top:10px; }
    .modal-box input { width:100%;padding:9px 12px;border:1px solid var(--border);border-radius:var(--radius);font-size:.9rem;font-family:monospace;margin-bottom:4px; }
    .modal-notice { font-size:.76rem;color:var(--muted);background:#f4f6fb;border-radius:6px;padding:8px 12px;line-height:1.55;margin-top:10px; }
    .modal-actions { display:flex;gap:10px;justify-content:flex-end;margin-top:18px; }
    .btn-modal-save { padding:9px 22px;background:var(--blue);color:#fff;border:none;border-radius:var(--radius);font-weight:600;font-size:.9rem;cursor:pointer; }
    .btn-modal-cancel { padding:9px 22px;background:#fff;color:var(--text);border:1px solid var(--border);border-radius:var(--radius);font-weight:600;font-size:.9rem;cursor:pointer; }
    /* AI Simulate button in toolbar */
    .btn-ai-simulate { padding:8px 18px;border-radius:var(--radius);font-size:.88rem;font-weight:700;cursor:pointer;border:none;background:linear-gradient(135deg,#0d2b55,#1a56a0);color:#fff;display:inline-flex;align-items:center;gap:7px;transition:opacity .15s; }
    .btn-ai-simulate:hover { opacity:.88; }
    .btn-ai-simulate.loading { opacity:.6;pointer-events:none; }
    /* AI Generate Button (Abstract, Narrative, etc.) */
    .ai-gen-btn { display:inline-flex;align-items:center;gap:5px;padding:5px 14px;border-radius:20px;font-size:.78rem;font-weight:700;cursor:pointer;border:1.5px solid #1a56a0;background:#eef3fb;color:#1a3a6b;transition:background .15s,opacity .15s;white-space:nowrap; }
    .ai-gen-btn:hover { background:#dce8f8; }
    .ai-gen-btn.loading { opacity:.55;pointer-events:none; }
    /* AI Spinner */
    .ai-spin { display:inline-block;width:13px;height:13px;border:2px solid rgba(255,255,255,.35);border-top-color:#fff;border-radius:50%;animation:spin .7s linear infinite; }
    @keyframes spin { to { transform:rotate(360deg); } }
    /* Study Section Panel */
    #ai-review-panel { background:#fff;border:2px solid var(--navy);border-radius:12px;padding:28px 32px;margin-top:28px;display:none; }
    #ai-review-panel.visible { display:block; }
    #ai-review-panel h3 { font-size:1.05rem;color:var(--navy);margin-bottom:6px;display:flex;align-items:center;gap:8px; }
    .review-meta { font-size:.8rem;color:var(--muted);margin-bottom:20px; }
    /* Tone selector */
    .tone-bar { display:flex;align-items:center;gap:10px;margin-bottom:22px;flex-wrap:wrap; }
    .tone-bar span { font-size:.82rem;font-weight:700;color:var(--navy); }
    .tone-btn { padding:5px 14px;border-radius:20px;font-size:.8rem;font-weight:600;cursor:pointer;border:2px solid var(--border);background:#fff;color:var(--muted);transition:all .15s; }
    .tone-btn.active { border-color:var(--blue);background:#e8f0fe;color:var(--blue); }
    /* Scoring toggle */
    .score-toggle { display:flex;align-items:center;gap:8px;margin-bottom:22px;flex-wrap:wrap; }
    .score-toggle span { font-size:.82rem;font-weight:700;color:var(--navy); }
    .score-tab { padding:5px 14px;border-radius:20px;font-size:.8rem;font-weight:600;cursor:pointer;border:2px solid var(--border);background:#fff;color:var(--muted);transition:all .15s; }
    .score-tab.active { border-color:var(--teal);background:#e0f4f4;color:var(--teal); }
    /* Study section recommendation */
    .study-section-box { background:#f0f6ff;border:1px solid #b8d0f0;border-radius:var(--radius);padding:14px 18px;margin-bottom:22px;font-size:.87rem;line-height:1.6; }
    .study-section-box strong { color:var(--navy); }
    /* Score cards */
    .score-grid { display:grid;grid-template-columns:repeat(auto-fill,minmax(160px,1fr));gap:12px;margin-bottom:22px; }
    .score-card { background:#fff;border:2px solid var(--border);border-radius:10px;padding:18px 14px;text-align:center;box-shadow:0 1px 4px rgba(0,0,0,.07); }
    .score-card .sc-label { font-size:.75rem;text-transform:uppercase;letter-spacing:.6px;color:#4a5568;font-weight:700;margin-bottom:6px; }
    .score-card .sc-val { font-size:2rem;font-weight:900;line-height:1; }
    .score-card .sc-desc { font-size:.78rem;color:#4a5568;margin-top:5px;font-weight:500; }
    .score-card.binary .sc-val { font-size:1.05rem;font-weight:800;padding:6px 0; }
    .score-card.not-evaluated { border-color:#cbd5e0;background:#f7fafc;opacity:.85; }
    .score-card.not-evaluated .sc-label { color:#718096; }
    .not-eval-badge { font-size:.85rem !important;font-weight:700 !important;color:#718096;background:#edf2f7;border-radius:6px;padding:4px 10px;display:inline-block;letter-spacing:.3px; }
    /* Commercialization Scorecard */
    .comm-scorecard { background:rgba(255,255,255,.04);border:1px solid rgba(255,255,255,.12);border-radius:10px;padding:16px;margin-bottom:16px; }
    .comm-sc-header { display:flex;justify-content:space-between;align-items:center;margin-bottom:12px; }
    .comm-sc-title { font-size:.88rem;font-weight:700;color:#93c5fd;letter-spacing:.3px; }
    .comm-sc-total { font-size:.85rem;color:#cbd5e0; }
    .comm-sc-table { width:100%;border-collapse:collapse;font-size:.82rem; }
    .comm-sc-table thead th { text-align:left;padding:5px 8px;color:#94a3b8;font-weight:600;border-bottom:1px solid rgba(255,255,255,.1);font-size:.75rem;text-transform:uppercase;letter-spacing:.5px; }
    .comm-sc-table tbody tr { border-bottom:1px solid rgba(255,255,255,.05); }
    .comm-sc-table tbody tr:last-child { border-bottom:none; }
    .comm-sc-label { padding:7px 8px;color:#e2e8f0;font-weight:500;white-space:nowrap; }
    .comm-sc-label.comm-primary { color:#fde68a;font-weight:700; }
    .comm-primary-badge { background:rgba(251,191,36,.15);color:#fbbf24;font-size:.65rem;font-weight:700;padding:1px 5px;border-radius:4px;margin-left:5px;letter-spacing:.3px;text-transform:uppercase; }
    .comm-weight { color:#64748b;font-size:.72rem;margin-left:6px; }
    .comm-sc-score { padding:7px 8px;text-align:center;white-space:nowrap; }
    .comm-sc-note { padding:7px 8px;color:#94a3b8;font-size:.78rem;line-height:1.4; }
    .comm-sc-footer { margin-top:10px;font-size:.75rem;color:#64748b;text-align:right;border-top:1px solid rgba(255,255,255,.06);padding-top:8px; }
    /* Score color bands — dark enough for WCAG AA on white */
    .sc-val.s1,.sc-val.s2 { color:#0a6640; }  /* Exceptional/Outstanding — deep green */
    .sc-val.s3,.sc-val.s4 { color:#1a6b1a; }  /* Excellent/Very Good — green */
    .sc-val.s5,.sc-val.s6 { color:#a05000; }  /* Good/Satisfactory — dark amber */
    .sc-val.s7,.sc-val.s8,.sc-val.s9 { color:#9b1c1c; }  /* Fair/Poor — dark red */
    .sc-val.ok { color:#0a6640; }
    .sc-val.gap { color:#9b1c1c; }
    /* Reviewer sections */
    /* Dual-panel container styles */
    .panel-section { border:2px solid var(--border);border-radius:var(--radius);margin-bottom:20px;overflow:hidden; }
    .panel-header { background:var(--navy);color:#fff;padding:12px 18px;display:flex;align-items:center;gap:10px;cursor:pointer;user-select:none; }
    .panel-header strong { flex:1;font-size:.95rem; }
    .panel-badge { width:28px;height:28px;border-radius:50%;display:flex;align-items:center;justify-content:center;font-weight:800;font-size:.85rem;flex-shrink:0; }
    .badge-bethesda { background:#1a4b8c;color:#fff; }
    .badge-rockville { background:#c0392b;color:#fff; }
    .panel-count { font-size:.75rem;opacity:.7; }
    .panel-chevron { font-size:.8rem;transition:transform .2s; }
    .panel-body { display:none;padding:16px; }
    .panel-body.open { display:block; }
    .reviewer-block { border:1px solid var(--border);border-radius:var(--radius);margin-bottom:16px;overflow:hidden; }
    .reviewer-header { background:var(--light);padding:12px 16px;display:flex;align-items:center;gap:10px;cursor:pointer;user-select:none; }
    .reviewer-header .rv-icon { width:32px;height:32px;border-radius:50%;display:flex;align-items:center;justify-content:center;font-size:.85rem;font-weight:800;flex-shrink:0; }
    .rv-icon.rv1 { background:#dbeafe;color:#1e40af; }
    .rv-icon.rv2 { background:#dcfce7;color:#166534; }
    .rv-icon.rv3 { background:#fef3c7;color:#92400e; }
    .rv-icon.rv4 { background:#fce7f3;color:#9d174d; }
    .rv-icon.rv5 { background:#ede9fe;color:#5b21b6; }
    .rv-icon.rv6 { background:#cffafe;color:#0e7490; }
    .rv-icon.sro { background:#0d2b55;color:#fff; }
    .reviewer-header .rv-name { font-size:.9rem;font-weight:700;color:var(--navy); }
    .reviewer-header .rv-score { margin-left:auto;font-size:.85rem;font-weight:700;padding:3px 10px;border-radius:12px; }
    .rv-score.good { background:#d1fae5;color:#064e3b; }   /* WCAG AA */
    .rv-score.ok   { background:#fef3c7;color:#78350f; }   /* WCAG AA */
    .rv-score.weak { background:#fee2e2;color:#7f1d1d; }   /* WCAG AA */
    .rv-score.bin-ok  { background:#d1fae5;color:#064e3b; }
    .rv-score.bin-gap { background:#fee2e2;color:#7f1d1d; }
    .reviewer-body { padding:18px 20px;font-size:.9rem;line-height:1.75;display:none;color:#1a202c; }
    .reviewer-body.open { display:block; }
    .reviewer-body h5 { font-size:.78rem;font-weight:800;text-transform:uppercase;letter-spacing:.7px;color:#2d3748;margin:14px 0 7px;border-bottom:1px solid var(--border);padding-bottom:4px; }
    .reviewer-body ul { padding-left:20px;margin:0; }
    .reviewer-body li { margin-bottom:7px;color:#1a202c; }
    .strength-li { color:#065f46;font-weight:500; }   /* deep green, WCAG AA */
    .weakness-li { color:#7f1d1d;font-weight:500; }   /* deep red, WCAG AA */
    /* Rewrite buttons */
    .rewrite-btn { display:inline-flex;align-items:center;gap:5px;padding:4px 12px;border-radius:20px;font-size:.76rem;font-weight:600;cursor:pointer;border:1px solid #b8d0f0;background:#e8f0fe;color:#1a56a0;margin-top:4px;transition:background .15s; }
    .rewrite-btn:hover { background:#d0e4ff; }
    .rewrite-btn.loading { opacity:.6;pointer-events:none; }
    /* Rewrite result box */
    .rewrite-result { background:#f8fbff;border:1px solid #c0d8f8;border-radius:var(--radius);padding:14px 16px;margin-top:10px;font-size:.87rem;line-height:1.65;display:none; }
    .rewrite-result.visible { display:block; }
    .rewrite-result .rr-actions { display:flex;gap:8px;margin-top:10px;flex-wrap:wrap; }
    .btn-rr-accept { padding:4px 12px;border-radius:20px;font-size:.76rem;font-weight:700;cursor:pointer;border:1.5px solid #2e7d32;background:#e8f5e9;color:#1b5e20;transition:background .15s; }
    .btn-rr-accept:hover { background:#c8e6c9; }
    .btn-rr-accept.accepted { background:#2e7d32;color:#fff;pointer-events:none; }
    .btn-rr-copy { padding:5px 14px;background:var(--teal);color:#fff;border:none;border-radius:var(--radius);font-size:.82rem;font-weight:600;cursor:pointer; }
    .btn-rr-dismiss { padding:5px 14px;background:#fff;color:var(--muted);border:1px solid var(--border);border-radius:var(--radius);font-size:.82rem;font-weight:600;cursor:pointer; }
    /* Grant Readiness Panel */
    .readiness-header { display:flex;align-items:center;justify-content:space-between;background:#fff;border:1.5px solid #dde3ef;border-radius:var(--radius);padding:16px 20px;margin-bottom:12px;box-shadow:0 1px 4px rgba(0,0,0,.06); }
    .readiness-icon { font-size:1.6rem; }
    .readiness-score-badge { font-size:1.5rem;font-weight:900;color:#0d2b55;background:#eef2ff;border-radius:50%;width:60px;height:60px;display:flex;align-items:center;justify-content:center;border:2px solid #c7d2fe;flex-shrink:0; }
    .readiness-bar-wrap { display:flex;align-items:center;gap:12px;margin-bottom:16px; }
    .readiness-bar-track { flex:1;height:10px;background:#e2e8f0;border-radius:99px;overflow:hidden; }
    .readiness-bar-fill { height:100%;border-radius:99px;transition:width .6s ease;background:linear-gradient(90deg,#e53e3e,#dd6b20,#d69e2e,#38a169); }
    .readiness-bar-fill.ready { background:linear-gradient(90deg,#38a169,#2f855a); }
    .readiness-bar-label { font-size:.82rem;font-weight:700;color:#4a5568;white-space:nowrap;min-width:90px; }
    .readiness-grid { display:grid;grid-template-columns:repeat(auto-fill,minmax(220px,1fr));gap:10px;margin-bottom:14px; }
    .readiness-card { background:#fff;border:1.5px solid #e2e8f0;border-radius:8px;padding:12px 14px;display:flex;flex-direction:column;gap:4px; }
    .readiness-card.pass { border-color:#68d391;background:#f0fff4; }
    .readiness-card.warn { border-color:#fbd38d;background:#fffbeb; }
    .readiness-card.fail { border-color:#fc8181;background:#fff5f5; }
    .readiness-card .rc-label { font-size:.75rem;font-weight:700;text-transform:uppercase;letter-spacing:.04em;color:#718096; }
    .readiness-card .rc-status { font-size:.85rem;font-weight:700; }
    .readiness-card.pass .rc-status { color:#276749; }
    .readiness-card.warn .rc-status { color:#975a16; }
    .readiness-card.fail .rc-status { color:#9b2c2c; }
    .readiness-card .rc-detail { font-size:.78rem;color:#718096;line-height:1.4; }
    .readiness-gaps { background:#fff5f5;border:1.5px solid #fc8181;border-radius:8px;padding:14px 18px;margin-top:4px; }
    /* SRO Summary — Hero Section */
    .sro-summary { background:linear-gradient(135deg,#0a2040 0%,#0d2b55 50%,#1a4080 100%);color:#fff;border-radius:var(--radius-lg);padding:32px 36px;margin-bottom:28px;box-shadow:var(--shadow-lg);position:relative;overflow:hidden; }
    .sro-summary::before { content:'';position:absolute;top:-40px;right:-40px;width:200px;height:200px;background:rgba(201,168,76,.08);border-radius:50%;pointer-events:none; }
    .sro-summary::after { content:'';position:absolute;bottom:-60px;left:-20px;width:160px;height:160px;background:rgba(26,86,160,.15);border-radius:50%;pointer-events:none; }
    .sro-summary h4 { font-size:.78rem;font-weight:700;text-transform:uppercase;letter-spacing:1.2px;margin-bottom:16px;color:#94b4d8;display:flex;align-items:center;gap:8px; }
    .sro-hero-row { display:flex;align-items:flex-start;gap:24px;margin-bottom:20px;position:relative;z-index:1; }
    .sro-score-circle { width:90px;height:90px;border-radius:50%;border:3px solid rgba(255,255,255,.25);display:flex;flex-direction:column;align-items:center;justify-content:center;flex-shrink:0;background:rgba(255,255,255,.08); }
    .sro-overall { font-size:2.8rem;font-weight:900;line-height:1; }
    .sro-overall-label { font-size:.7rem;color:#94b4d8;margin-top:2px;font-weight:600;text-transform:uppercase;letter-spacing:.5px; }
    .sro-verdict-block { flex:1; }
    .sro-verdict-text { font-size:1.5rem;font-weight:800;color:#fff;line-height:1.2;margin-bottom:6px; }
    .sro-verdict-sub { font-size:.85rem;color:#94b4d8;line-height:1.5; }
    .sro-narrative { font-size:.93rem;line-height:1.8;color:#dde8f5;border-top:1px solid rgba(255,255,255,.12);padding-top:18px;position:relative;z-index:1; }
    .sro-summary strong { color:#fff;font-weight:700; }
    .sro-summary ul { padding-left:20px;margin:8px 0; }
    .sro-summary li { margin-bottom:6px;color:#dde8f5;font-size:.9rem;line-height:1.55; }
    .sro-panels-row { display:flex;gap:16px;margin-top:18px;position:relative;z-index:1;flex-wrap:wrap; }
    .sro-panel-chip { background:rgba(255,255,255,.1);border:1px solid rgba(255,255,255,.18);border-radius:20px;padding:5px 14px;font-size:.78rem;font-weight:600;color:#c5d8ef; }
    /* Progress overlay */
    #ai-progress-overlay { position:fixed;inset:0;background:rgba(13,43,85,.5);display:flex;flex-direction:column;align-items:center;justify-content:center;z-index:3000;backdrop-filter:blur(4px);display:none; }
    #ai-progress-overlay.visible { display:flex; }
    .ai-progress-box { background:#fff;border-radius:12px;padding:32px 40px;max-width:420px;width:90%;text-align:center;box-shadow:0 8px 40px rgba(13,43,85,.3); }
    .ai-progress-box h4 { font-size:1rem;color:var(--navy);margin-bottom:16px; }
    .ai-progress-steps { list-style:none;text-align:left;font-size:.87rem;line-height:2; }
    .ai-progress-steps li { display:flex;align-items:center;gap:10px;color:var(--muted); }
    .ai-progress-steps li.active { color:var(--navy);font-weight:600; }
    .ai-progress-steps li.done { color:var(--green); }
    .step-dot { width:10px;height:10px;border-radius:50%;background:var(--border);flex-shrink:0; }
    .step-dot.active { background:var(--blue);animation:pulse .8s ease-in-out infinite; }
    .step-dot.done { background:var(--green); }
    @keyframes pulse { 0%,100%{opacity:1}50%{opacity:.4} }

    /* ── Focus Mode ───────────────────────────────────────────── */
    .focus-mode-overlay { position:fixed;inset:0;background:rgba(8,18,36,.92);z-index:5000;display:none;flex-direction:column;padding:40px; }
    .focus-mode-overlay.active { display:flex; }
    .focus-mode-header { display:flex;align-items:center;gap:12px;margin-bottom:16px; }
    .focus-mode-label { color:#94b4d8;font-size:.82rem;font-weight:700;text-transform:uppercase;letter-spacing:.8px;flex:1; }
    .focus-mode-close { background:rgba(255,255,255,.12);border:1px solid rgba(255,255,255,.2);color:#fff;border-radius:var(--radius);padding:6px 16px;font-size:.82rem;font-weight:600;cursor:pointer; }
    .focus-mode-close:hover { background:rgba(255,255,255,.2); }
    .focus-mode-textarea { flex:1;width:100%;background:rgba(255,255,255,.04);border:1px solid rgba(255,255,255,.15);border-radius:var(--radius);color:#e8eef8;font-size:1rem;line-height:1.85;padding:24px 28px;font-family:inherit;resize:none;outline:none; }
    .focus-mode-textarea:focus { border-color:rgba(201,168,76,.5);box-shadow:0 0 0 2px rgba(201,168,76,.15); }
    .focus-mode-footer { display:flex;justify-content:space-between;align-items:center;margin-top:12px; }
    .focus-mode-count { color:#5a6a7e;font-size:.8rem; }
    .focus-mode-save { background:var(--gold);color:var(--navy);border:none;border-radius:var(--radius);padding:8px 22px;font-size:.88rem;font-weight:700;cursor:pointer; }
    .focus-mode-save:hover { background:#d4b060; }
    /* Focus mode trigger button */
    .btn-focus { display:inline-flex;align-items:center;gap:4px;padding:3px 9px;border-radius:6px;font-size:.72rem;font-weight:600;cursor:pointer;border:1px solid var(--border);background:var(--light);color:var(--muted);transition:all .15s;margin-left:6px; }
    .btn-focus:hover { background:#e0e8f4;color:var(--navy);border-color:#93b4d8; }

    /* ── About / Methodology Panel ──────────────────────────────── */
    .about-panel { background:linear-gradient(135deg,#f8faff,#eef3fb);border:1px solid #c7d8ef;border-radius:var(--radius-lg);padding:24px 28px;margin-bottom:24px;display:none; }
    .about-panel.visible { display:block; }
    .about-panel h4 { font-size:.95rem;font-weight:800;color:var(--navy);margin-bottom:12px;display:flex;align-items:center;gap:8px; }
    .about-panel p { font-size:.87rem;color:var(--text-secondary);line-height:1.7;margin-bottom:10px; }
    .about-panel .disclaimer { background:#fff8e8;border:1px solid #e8d5a0;border-radius:8px;padding:12px 16px;font-size:.82rem;color:#7a5c00;line-height:1.6;margin-top:12px; }

    /* ── Print ───────────────────────────────────────────────── */
    #upload-view { display: none; }
    #upload-view.active { display: block; }
    #convert-view { display: none; padding: 24px 20px; }
    #convert-view.active { display: block; }
    .header-tab:last-child { border-radius: 0 var(--radius) var(--radius) 0; border-left: none; }
    .mechanism-card { border: 2px solid #dde3ef; border-radius: 10px; padding: 14px 16px; cursor: pointer; transition: all .15s; background: #fff; }
    .mechanism-card:hover { border-color: var(--navy); background: #f0f4fa; }
    .mechanism-card.selected { border-color: var(--gold); background: #fffbf0; }
    .mechanism-card.fit-strong { border-left: 4px solid #0a6640; }
    .mechanism-card.fit-conditional { border-left: 4px solid #a05000; }
    .mechanism-card.fit-poor { border-left: 4px solid #9b1c1c; opacity: .65; }
    .mechanism-card .mech-name { font-weight: 800; font-size: .92rem; color: var(--navy); margin-bottom: 3px; }
    .mechanism-card .mech-desc { font-size: .78rem; color: var(--muted); }
    .mechanism-card .fit-badge { font-size: .72rem; font-weight: 700; padding: 2px 7px; border-radius: 20px; margin-top: 6px; display: inline-block; }
    .fit-badge.strong { background: #d1fae5; color: #065f46; }
    .fit-badge.conditional { background: #fef3c7; color: #92400e; }
    .fit-badge.poor { background: #fee2e2; color: #7f1d1d; }
    .conversion-section { border: 1px solid #dde3ef; border-radius: 10px; margin-bottom: 14px; overflow: hidden; }
    .conversion-section .cs-header { display: flex; align-items: center; gap: 10px; padding: 12px 16px; background: #f8faff; border-bottom: 1px solid #dde3ef; }
    .conversion-section .cs-label { flex: 1; font-weight: 700; font-size: .92rem; color: var(--navy); }
    .conversion-section .cs-flag { font-size: .75rem; padding: 2px 8px; border-radius: 20px; background: #fef3c7; color: #92400e; font-weight: 700; }
    .conversion-section .cs-body { display: grid; grid-template-columns: 1fr 1fr; gap: 0; }
    .conversion-section .cs-original { padding: 14px 16px; background: #fafafa; border-right: 1px solid #dde3ef; font-size: .83rem; line-height: 1.65; color: #555; }
    .conversion-section .cs-converted { padding: 14px 16px; background: #fff; font-size: .83rem; line-height: 1.65; color: #1a202c; }
    .conversion-section .cs-col-label { font-size: .72rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 6px; }
    .conversion-section .cs-accept-btn { margin-top: 10px; background: var(--navy); color: #fff; border: none; padding: 6px 14px; border-radius: 6px; font-size: .8rem; font-weight: 700; cursor: pointer; }
    .tra-dimension { display: flex; align-items: flex-start; gap: 10px; padding: 10px 0; border-bottom: 1px solid #eee; }
    .tra-dimension:last-child { border-bottom: none; }
    .tra-dim-score { font-size: 1.2rem; font-weight: 900; min-width: 32px; text-align: center; }
    .tra-dim-label { font-weight: 700; font-size: .88rem; color: var(--navy); margin-bottom: 2px; }
    .tra-dim-note { font-size: .82rem; color: var(--muted); line-height: 1.5; }
    #builder-view { display: flex; }
    #builder-view.hidden { display: none; }

    /* ── Upload Panel ───────────────────────────────────────────────── */
    .upload-panel { max-width: 860px; margin: 28px auto; padding: 0 24px; }
    /* Supporting document mini drop zones */
    .support-drop-zone {
      border: 1.5px dashed var(--border); border-radius: var(--radius);
      padding: 10px 16px; background: var(--light); cursor: pointer;
      display: flex; align-items: center; gap: 10px;
      transition: border-color .2s, background .2s; font-size: .85rem;
    }
    .support-drop-zone:hover, .support-drop-zone.drag-over { border-color: var(--blue); background: #eef3fb; }
    .support-drop-zone.has-file { border-color: var(--green); background: #f0faf5; }
    .support-drop-zone input[type=file] { display: none; }
    .sdz-icon { font-size: 1.2rem; flex-shrink: 0; }
    .sdz-label { color: var(--muted); flex: 1; }
    .sdz-label.loaded { color: var(--green); font-weight: 600; }
    .sdz-remove { background: none; border: none; color: var(--red); cursor: pointer; font-size: .85rem; padding: 2px 6px; }
    /* Dynamic slots for key personnel / letters / ancillary */
    .support-slot { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
    .support-slot input[type=text] { flex: 1; padding: 7px 10px; border: 1px solid var(--border); border-radius: var(--radius); font-size: .85rem; font-family: inherit; }
    .support-slot .support-drop-zone { flex: 2; margin: 0; }
    .btn-remove-slot { background: none; border: none; color: var(--red); cursor: pointer; font-size: 1rem; padding: 4px; flex-shrink: 0; }
    .upload-panel h2 { font-size: 1.5rem; font-weight: 700; color: var(--navy); margin-bottom: 6px; }
    .upload-panel .subtitle { color: var(--muted); font-size: .92rem; margin-bottom: 28px; }
    .upload-step { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius);
      padding: 24px; margin-bottom: 20px; box-shadow: var(--shadow); }
    .upload-step h3 { font-size: 1rem; font-weight: 700; color: var(--navy); margin-bottom: 14px;
      display: flex; align-items: center; gap: 8px; }
    .step-num { width: 26px; height: 26px; border-radius: 50%; background: var(--navy); color: #fff;
      display: inline-flex; align-items: center; justify-content: center; font-size: .8rem; font-weight: 800; flex-shrink: 0; }
    .drop-zone { border: 2px dashed var(--border); border-radius: var(--radius); padding: 40px 24px;
      text-align: center; cursor: pointer; transition: border-color .2s, background .2s; background: var(--light); }
    .drop-zone:hover, .drop-zone.drag-over { border-color: var(--blue); background: #eef3fb; }
    .drop-zone .dz-icon { font-size: 2.5rem; margin-bottom: 10px; }
    .drop-zone .dz-icon svg,
    .drop-zone .drop-icon svg { width: 36px !important; height: 36px !important; flex-shrink: 0; }
    .drop-zone .dz-label { font-size: .95rem; font-weight: 600; color: var(--navy); margin-bottom: 4px; }
    .drop-zone .dz-sub { font-size: .82rem; color: var(--muted); }
    .drop-zone input[type=file] { display: none; }
    .dz-file-name { margin-top: 12px; font-size: .85rem; color: var(--teal); font-weight: 600; }
    .paste-area { width: 100%; min-height: 160px; padding: 12px; border: 1px solid var(--border);
      border-radius: var(--radius); font-size: .88rem; font-family: inherit; resize: vertical;
      background: #fafbfd; color: var(--text); }
    .paste-area:focus { border-color: var(--blue); outline: none; box-shadow: 0 0 0 3px rgba(26,86,160,.12); }
    .or-divider { text-align: center; color: var(--muted); font-size: .85rem; margin: 14px 0;
      display: flex; align-items: center; gap: 10px; }
    .or-divider::before, .or-divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }
    .btn-extract { cursor: pointer; transition: opacity .15s; }
    .btn-extract:disabled { cursor: not-allowed; }
    .extract-status { margin-top: 14px; font-size: .88rem; color: var(--muted); min-height: 1.4em; }
    .extract-status.error { color: var(--red); }
    .extract-status.success { color: var(--green); }

    /* ── Preview / Confirm Table ──────────────────────────────── */
    #preview-panel { display: none; margin-top: 24px; }
    #preview-panel.visible { display: block; }
    .preview-header { display: flex; align-items: center; justify-content: space-between;
      margin-bottom: 16px; flex-wrap: wrap; gap: 10px; }
    .preview-header h3 { font-size: 1.1rem; font-weight: 700; color: var(--navy); }
    .btn-confirm-import { padding: 10px 28px; background: var(--green); color: #fff; border: none;
      border-radius: var(--radius); font-size: .95rem; font-weight: 700; cursor: pointer; transition: background .15s; }
    .btn-confirm-import:hover { background: #145e38; }
    .btn-cancel-import { padding: 10px 20px; background: var(--white); border: 1px solid var(--border);
      color: var(--text); border-radius: var(--radius); font-size: .88rem; cursor: pointer; }
    .preview-table { width: 100%; border-collapse: collapse; font-size: .85rem; }
    .preview-table th { background: var(--navy); color: #fff; padding: 10px 14px; text-align: left; }
    .preview-table td { padding: 10px 14px; border-bottom: 1px solid var(--border); vertical-align: top; }
    .preview-table tr:nth-child(even) td { background: var(--light); }
    .preview-table td:first-child { font-weight: 600; color: var(--navy); white-space: nowrap; width: 180px; }
    .preview-table td textarea { width: 100%; min-height: 80px; padding: 8px; border: 1px solid var(--border);
      border-radius: 4px; font-size: .82rem; font-family: inherit; resize: vertical; background: #fafbfd; }
    .preview-table td textarea:focus { border-color: var(--blue); outline: none; }
    .preview-badge { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: .72rem;
      font-weight: 700; margin-left: 6px; }
    .badge-found { background: #dcfce7; color: #166534; }
    .badge-missing { background: #fee2e2; color: #991b1b; }
    .badge-partial { background: #fef9c3; color: #854d0e; }

    @media print {
      header, aside, .output-toolbar, #toast { display: none !important; }
      .app { display: block; }
      main { padding: 0; }
      #grant-doc { border: none; box-shadow: none; padding: 0; max-width: 100%; }
      #grant-output-panel { display: block !important; }
      .module-panel { display: none !important; }
    }

    /* ── Pre-Scan Panel ───────────────────────────────────────────── */
    .prescan-item {
      display: flex; align-items: flex-start; gap: 10px;
      padding: 7px 12px; border-radius: 8px; font-size: .82rem; line-height: 1.4;
    }
    .prescan-item.pass  { background: #f0faf4; }
    .prescan-item.warn  { background: #fffbeb; }
    .prescan-item.fail  { background: #fef2f2; }
    .prescan-item .pi-icon { font-size: 1rem; flex-shrink: 0; margin-top: 1px; }
    .prescan-item .pi-label { font-weight: 700; color: var(--navy); }
    .prescan-item.fail .pi-label { color: #991b1b; }
    .prescan-item.warn .pi-label { color: #92400e; }
    .prescan-item .pi-detail { color: var(--muted); margin-top: 1px; }
    .prescan-item.fail .pi-detail { color: #b91c1c; }
    .prescan-item.warn .pi-detail { color: #78350f; }

    /* ── Discover Tab ─────────────────────────────────────────────── */
    #discover-view { display: none; padding: 0; min-height: 100vh; background: var(--light); }
    #discover-view.active { display: block; }
    .discover-container { max-width: 1300px; margin: 0 auto; padding: 28px 24px; }
    .discover-search-bar { background: var(--white); border: 1px solid var(--border); border-radius: 12px; padding: 24px 28px; margin-bottom: 24px; box-shadow: 0 2px 8px rgba(0,0,0,.06); }
    .discover-title { font-size: 1.4rem; font-weight: 800; color: var(--navy); margin: 0 0 6px; }
    .discover-subtitle { font-size: .88rem; color: var(--muted); margin: 0 0 18px; }
    .discover-search-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
    .discover-input { flex: 1; min-width: 240px; padding: 11px 14px; border: 1.5px solid var(--border); border-radius: var(--radius); font-size: .95rem; font-family: inherit; background: #fafbfd; color: var(--text); transition: border-color .15s; }
    .discover-input:focus { outline: none; border-color: var(--blue); }
    .discover-select { padding: 11px 14px; border: 1.5px solid var(--border); border-radius: var(--radius); font-size: .88rem; font-family: inherit; background: #fafbfd; color: var(--text); cursor: pointer; }
    .btn-discover-search { padding: 11px 22px; background: var(--navy); color: #fff; border: none; border-radius: var(--radius); font-size: .92rem; font-weight: 700; cursor: pointer; white-space: nowrap; transition: background .15s; }
    .btn-discover-search:hover { background: var(--blue); }
    .btn-discover-search:disabled { opacity: .6; cursor: not-allowed; }
    .discover-results-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
    .discover-col { background: var(--white); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; box-shadow: 0 2px 8px rgba(0,0,0,.05); }
    .discover-col-header { display: flex; align-items: center; gap: 12px; padding: 16px 20px; background: var(--navy); color: #fff; }
    .discover-col-icon { font-size: 1.5rem; }
    .discover-col-title { font-weight: 700; font-size: 1rem; }
    .discover-col-sub { font-size: .78rem; opacity: .8; margin-top: 2px; }
    #discover-grants-results, #discover-reporter-results { padding: 14px; max-height: 680px; overflow-y: auto; }
    .discover-loading { padding: 20px; text-align: center; color: var(--muted); font-size: .88rem; }
    .discover-empty { padding: 20px; text-align: center; color: var(--muted); font-size: .88rem; }
    .discover-error { padding: 14px; color: #c0392b; font-size: .85rem; background: #fdf0ee; border-radius: 8px; }
    .discover-card { border: 1.5px solid var(--border); border-radius: 10px; padding: 14px 16px; margin-bottom: 12px; background: #fafbfd; transition: border-color .15s, box-shadow .15s; }
    .discover-card:hover { border-color: var(--blue); box-shadow: 0 2px 8px rgba(13,43,85,.08); }
    .discover-card.selected { border-color: var(--gold); background: #fffdf0; }
    .discover-card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; flex-wrap: wrap; gap: 6px; }
    .discover-number { font-size: .78rem; font-weight: 700; color: var(--navy); }
    .discover-dates { font-size: .75rem; color: var(--muted); }
    .discover-card-title { font-weight: 700; font-size: .92rem; color: var(--text); margin-bottom: 4px; line-height: 1.4; }
    .discover-card-agency { font-size: .78rem; color: var(--muted); margin-bottom: 10px; }
    .discover-card-actions { display: flex; gap: 8px; flex-wrap: wrap; }
    .btn-discover-select { padding: 6px 14px; background: var(--navy); color: #fff; border: none; border-radius: 6px; font-size: .8rem; font-weight: 700; cursor: pointer; }
    .btn-discover-select:hover { background: var(--blue); }
    .btn-discover-link { padding: 6px 14px; background: transparent; color: var(--blue); border: 1px solid var(--blue); border-radius: 6px; font-size: .8rem; font-weight: 600; text-decoration: none; cursor: pointer; }
    .handoff-box { background: linear-gradient(135deg, #fffdf0, #fff9e0); border: 2px solid var(--gold); border-radius: 12px; padding: 20px 24px; margin-bottom: 20px; }
    .handoff-title { font-size: .78rem; font-weight: 700; color: var(--gold); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 6px; }
    .handoff-foa-name { font-size: 1.05rem; font-weight: 800; color: var(--navy); margin-bottom: 4px; }
    .handoff-foa-meta { font-size: .82rem; color: var(--muted); margin-bottom: 8px; }
    .handoff-deadline { font-size: .88rem; color: #c0392b; font-weight: 600; margin-bottom: 14px; }
    .handoff-actions { display: flex; gap: 10px; flex-wrap: wrap; }
    .btn-handoff-primary { padding: 10px 22px; background: var(--navy); color: #fff; border: none; border-radius: 8px; font-size: .92rem; font-weight: 700; cursor: pointer; }
    .btn-handoff-primary:hover { background: var(--blue); }
    .btn-handoff-link { padding: 10px 18px; background: transparent; color: var(--navy); border: 1.5px solid var(--navy); border-radius: 8px; font-size: .88rem; font-weight: 600; text-decoration: none; display: inline-block; }
    .reporter-card { border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; margin-bottom: 10px; background: #fafbfd; }
    .reporter-card-top { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
    .reporter-mechanism { background: var(--navy); color: #fff; font-size: .72rem; font-weight: 700; padding: 2px 8px; border-radius: 10px; }
    .reporter-amount { font-size: .85rem; font-weight: 700; color: #22863a; }
    .reporter-year { font-size: .75rem; color: var(--muted); margin-left: auto; }
    .reporter-card-title { font-weight: 700; font-size: .88rem; color: var(--text); margin-bottom: 4px; line-height: 1.4; }
    .reporter-card-meta { font-size: .75rem; color: var(--muted); margin-bottom: 8px; }
    .reporter-abstract-toggle { font-size: .78rem; color: var(--blue); cursor: pointer; font-weight: 600; margin-bottom: 4px; user-select: none; }
    .reporter-abstract { font-size: .8rem; color: var(--text); line-height: 1.6; padding: 8px 0; display: none; }
    .reporter-link { font-size: .78rem; color: var(--blue); text-decoration: none; font-weight: 600; }
    .reporter-total-bar { display: flex; gap: 16px; flex-wrap: wrap; padding: 10px 0 14px; border-bottom: 1px solid var(--border); margin-bottom: 12px; }
    .reporter-stat .rs-val { font-size: 1.1rem; font-weight: 800; color: var(--navy); }
    .reporter-stat .rs-lbl { font-size: .7rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }


/* ══════════════════════════════════════════════════════════════════
   GRANT INTELLIGENCE HUB — Sub-tabs, FOA Parser, Winners, Citations, Feed
   ══════════════════════════════════════════════════════════════════ */

/* ── Intelligence Sub-tabs ────────────────────────────────────────── */
.intel-tabs {
  display: flex;
  gap: 4px;
  padding: 0 0 0 0;
  margin: 12px 0 0 0;
  border-bottom: 2px solid var(--border);
  overflow-x: auto;
  scrollbar-width: none;
}
.intel-tabs::-webkit-scrollbar { display: none; }
.intel-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 10px 18px;
  border: none;
  background: none;
  border-radius: 8px 8px 0 0;
  font-size: .8rem;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s, color .15s;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  min-width: 80px;
}
.itab-icon { font-size: 1.2rem; line-height: 1; }
.itab-label { font-size: .75rem; font-weight: 600; }
.intel-tab:hover { background: var(--light); color: var(--navy); }
.intel-tab.active {
  background: #fff;
  color: var(--blue);
  border-bottom-color: var(--blue);
  font-weight: 700;
}

/* ── Intelligence Panels ──────────────────────────────────────────── */
.intel-panel { display: none; padding: 20px 0 0 0; }
.intel-panel.active { display: block; }
.intel-panel-header { margin-bottom: 16px; }
.intel-panel-title { font-size: 1.05rem; font-weight: 700; color: var(--navy); margin-bottom: 4px; }
.intel-panel-sub { font-size: .84rem; color: var(--muted); }

/* ── Action Bar ───────────────────────────────────────────────────── */
.intel-action-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: #f8faff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 16px;
}
.btn-intel-action {
  padding: 9px 20px;
  background: var(--blue);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: .88rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s;
  white-space: nowrap;
}
.btn-intel-action:hover { background: #1a56db; }
.btn-intel-action:disabled { background: #93c5fd; cursor: not-allowed; }
.btn-intel-secondary {
  padding: 9px 16px;
  background: #fff;
  color: var(--navy);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: .85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s;
}
.btn-intel-secondary:hover { background: var(--bg); }
.intel-action-hint { font-size: .8rem; color: var(--muted); }

/* ── Shared Intel States ──────────────────────────────────────────── */
.intel-loading { padding: 24px; text-align: center; color: var(--muted); font-size: .9rem; }
.intel-error { padding: 16px; background: #fef2f2; color: #991b1b; border-radius: var(--radius); font-size: .88rem; }
.intel-empty { padding: 24px; text-align: center; color: var(--muted); font-size: .9rem; }

/* ══════════════════════════════════════════════════════════════════
   FOA RUBRIC STYLES
   ══════════════════════════════════════════════════════════════════ */
.rubric-container { max-width: 860px; }
.rubric-header { margin-bottom: 20px; padding-bottom: 16px; border-bottom: 2px solid var(--border); }
.rubric-title { font-size: 1.1rem; font-weight: 800; color: var(--navy); margin-bottom: 4px; }
.rubric-subtitle { font-size: .9rem; color: var(--muted); }

.rubric-section { margin-bottom: 20px; }
.rubric-section-title { font-size: .88rem; font-weight: 700; color: var(--navy); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 10px; }
.rubric-section-inline { display: flex; align-items: baseline; gap: 6px; font-size: .88rem; }
.rubric-section-inline .rubric-section-title { margin-bottom: 0; }

.rubric-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.rubric-tag { padding: 4px 12px; background: #eff6ff; color: var(--blue); border-radius: 20px; font-size: .8rem; font-weight: 600; }

.rubric-list { margin: 0; padding-left: 20px; }
.rubric-list li { font-size: .88rem; color: var(--text); margin-bottom: 4px; line-height: 1.5; }
.rubric-list-red li::marker { color: #dc2626; }
.rubric-list-green li::marker { color: #16a34a; }

.rubric-criterion { border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; margin-bottom: 12px; }
.rubric-criterion-header { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.rubric-criterion-name { font-weight: 700; font-size: .95rem; color: var(--navy); }
.rubric-weight { padding: 2px 10px; border-radius: 12px; font-size: .72rem; font-weight: 700; color: #fff; }
.rubric-guidance { font-size: .86rem; color: var(--text); line-height: 1.5; margin-bottom: 10px; }
.rubric-flags { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.rubric-green, .rubric-red { padding: 10px 12px; border-radius: 8px; }
.rubric-green { background: #f0fdf4; }
.rubric-red { background: #fff5f5; }
.rubric-flag-label { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; margin-bottom: 6px; }
.rubric-green .rubric-flag-label { color: #16a34a; }
.rubric-red .rubric-flag-label { color: #dc2626; }
.rubric-flag-item { font-size: .82rem; color: var(--text); margin-bottom: 4px; padding-left: 12px; position: relative; }
.rubric-flag-item::before { content: '•'; position: absolute; left: 0; }
.rubric-green .rubric-flag-item::before { color: #16a34a; }
.rubric-red .rubric-flag-item::before { color: #dc2626; }

.rubric-actions { display: flex; gap: 10px; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border); }
.btn-rubric-copy { padding: 8px 18px; background: #fff; color: var(--navy); border: 1px solid var(--border); border-radius: var(--radius); font-size: .85rem; font-weight: 600; cursor: pointer; }
.btn-rubric-copy:hover { background: var(--bg); }
.btn-rubric-builder { padding: 8px 18px; background: var(--blue); color: #fff; border: none; border-radius: var(--radius); font-size: .85rem; font-weight: 600; cursor: pointer; }
.btn-rubric-builder:hover { background: #1a56db; }

/* ══════════════════════════════════════════════════════════════════
   WINNING GRANT ANALYSIS STYLES
   ══════════════════════════════════════════════════════════════════ */
.winner-container { max-width: 860px; }
.winner-header { margin-bottom: 20px; padding-bottom: 16px; border-bottom: 2px solid var(--border); }
.winner-title { font-size: 1.1rem; font-weight: 800; color: var(--navy); margin-bottom: 8px; }
.winner-stats { display: flex; flex-wrap: wrap; gap: 12px; }
.winner-stat { font-size: .82rem; color: var(--muted); background: var(--bg); padding: 3px 10px; border-radius: 12px; }

.winner-section { margin-bottom: 20px; }
.winner-section-title { font-size: .88rem; font-weight: 700; color: var(--navy); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 10px; }
.winner-text { font-size: .88rem; color: var(--text); line-height: 1.6; margin: 0; }

.winner-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.winner-tag { padding: 4px 12px; background: #eff6ff; color: var(--blue); border-radius: 20px; font-size: .8rem; font-weight: 600; }
.winner-tag-green { background: #f0fdf4; color: #16a34a; }
.winner-tag-red { background: #fff5f5; color: #dc2626; }

.winner-pattern { border-left: 3px solid var(--blue); padding: 10px 14px; margin-bottom: 10px; background: #f8faff; border-radius: 0 8px 8px 0; }
.winner-pattern-name { font-size: .85rem; font-weight: 700; color: var(--navy); margin-bottom: 4px; }
.winner-pattern-example { font-size: .88rem; font-style: italic; color: #1e40af; margin-bottom: 4px; }
.winner-pattern-why { font-size: .82rem; color: var(--muted); }

.winner-two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 20px; }
.winner-col { }
.winner-list { margin: 0; padding-left: 20px; }
.winner-list li { font-size: .86rem; color: var(--text); margin-bottom: 5px; line-height: 1.5; }

.winner-positioning { background: #fffbeb; border: 1px solid #fde68a; border-radius: var(--radius); padding: 14px 16px; }
.winner-positioning .winner-section-title { color: #92400e; }

/* ══════════════════════════════════════════════════════════════════
   PUBMED CITATION SEARCH STYLES
   ══════════════════════════════════════════════════════════════════ */
.pubmed-search-row {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  align-items: center;
}
.pubmed-search-row .discover-input { flex: 1; }

.pubmed-header { margin-bottom: 12px; }
.pubmed-count { font-size: .88rem; color: var(--muted); }

.pubmed-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 10px;
  background: #fff;
}
.pubmed-card-meta { display: flex; gap: 10px; align-items: center; margin-bottom: 6px; flex-wrap: wrap; }
.pubmed-year { font-size: .78rem; font-weight: 700; color: #fff; background: var(--navy); padding: 2px 8px; border-radius: 10px; }
.pubmed-journal { font-size: .8rem; color: var(--muted); font-style: italic; }
.pubmed-pmid { font-size: .78rem; color: var(--muted); background: var(--bg); padding: 2px 8px; border-radius: 10px; }
.pubmed-title { font-size: .9rem; font-weight: 600; color: var(--navy); margin-bottom: 4px; line-height: 1.4; }
.pubmed-authors { font-size: .82rem; color: var(--muted); margin-bottom: 10px; }

.pubmed-citation-box { background: #f8faff; border: 1px solid #dbeafe; border-radius: 6px; padding: 10px 12px; margin-bottom: 10px; }
.pubmed-citation-label { font-size: .72rem; font-weight: 700; color: var(--blue); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 4px; }
.pubmed-citation-text { font-size: .82rem; color: var(--text); line-height: 1.5; font-family: 'Georgia', serif; }

.pubmed-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.btn-pubmed-copy { padding: 5px 14px; background: var(--blue); color: #fff; border: none; border-radius: var(--radius); font-size: .8rem; font-weight: 600; cursor: pointer; }
.btn-pubmed-copy:hover { background: #1a56db; }
.btn-pubmed-link { padding: 5px 14px; background: #fff; color: var(--navy); border: 1px solid var(--border); border-radius: var(--radius); font-size: .8rem; font-weight: 600; text-decoration: none; }
.btn-pubmed-link:hover { background: var(--bg); }

.pubmed-footer { padding: 12px 0; text-align: center; font-size: .84rem; }
.pubmed-footer a { color: var(--blue); text-decoration: none; }
.pubmed-footer a:hover { text-decoration: underline; }

/* ══════════════════════════════════════════════════════════════════
   NEWS / RECENT PUBLICATIONS FEED STYLES
   ══════════════════════════════════════════════════════════════════ */
.feed-header { margin-bottom: 16px; }
.feed-title { font-size: 1rem; font-weight: 700; color: var(--navy); margin-bottom: 4px; }
.feed-count { font-size: .84rem; color: var(--muted); }

.feed-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  margin-bottom: 8px;
  background: #fff;
  transition: border-color .15s;
}
.feed-card:hover { border-color: var(--blue); }
.feed-card-meta { display: flex; gap: 8px; align-items: center; margin-bottom: 6px; flex-wrap: wrap; }
.feed-journal { font-size: .8rem; color: var(--muted); font-style: italic; }
.feed-time { font-size: .78rem; font-weight: 700; color: #fff; background: #16a34a; padding: 2px 8px; border-radius: 10px; }
.feed-date { font-size: .78rem; color: var(--muted); }
.feed-card-title { font-size: .9rem; font-weight: 600; color: var(--navy); margin-bottom: 4px; line-height: 1.4; }
.feed-card-authors { font-size: .8rem; color: var(--muted); margin-bottom: 8px; }
.feed-card-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.btn-feed-link { padding: 4px 12px; background: #fff; color: var(--navy); border: 1px solid var(--border); border-radius: var(--radius); font-size: .78rem; font-weight: 600; text-decoration: none; }
.btn-feed-link:hover { background: var(--bg); }
.btn-feed-cite { padding: 4px 12px; background: var(--blue); color: #fff; border: none; border-radius: var(--radius); font-size: .78rem; font-weight: 600; cursor: pointer; }
.btn-feed-cite:hover { background: #1a56db; }

.feed-footer { padding: 12px 0; text-align: center; font-size: .84rem; }
.feed-footer a { color: var(--blue); text-decoration: none; }
.feed-footer a:hover { text-decoration: underline; }

@media (max-width: 640px) {
  .intel-tabs { gap: 2px; }
  .intel-tab { padding: 6px 10px; font-size: .76rem; }
  .rubric-flags { grid-template-columns: 1fr; }
  .winner-two-col { grid-template-columns: 1fr; }
  .pubmed-search-row { flex-wrap: wrap; }
  .intel-action-bar { flex-wrap: wrap; }
}

/* == AI Grant Drafter Panel == */
#grant-drafter-panel {
  background: linear-gradient(135deg, #0d2b55 0%, #1a4a8a 100%);
  border-radius: 14px; padding: 28px 32px; color: #fff;
}
.drafter-header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 20px; flex-wrap: wrap; margin-bottom: 24px;
}
.drafter-header h3 { color: #fff !important; }
.drafter-header p  { color: #a8c4e8 !important; }
.btn-run-drafter {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #fff; border: none; border-radius: 8px;
  padding: 12px 24px; font-size: .95rem; font-weight: 700;
  cursor: pointer; white-space: nowrap;
  box-shadow: 0 4px 12px rgba(245,158,11,.4);
  transition: transform .15s, box-shadow .15s;
}
.btn-run-drafter:hover:not(:disabled) {
  transform: translateY(-1px); box-shadow: 0 6px 18px rgba(245,158,11,.5);
}
.btn-run-drafter:disabled { opacity: .6; cursor: not-allowed; }
.drafter-options {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 14px; background: rgba(255,255,255,.08);
  border-radius: 10px; padding: 20px; margin-bottom: 4px;
}
.drafter-option-row { display: flex; flex-direction: column; gap: 6px; }
.drafter-option-row label {
  font-size: .78rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .5px; color: #a8c4e8;
}
.drafter-option-row input, .drafter-option-row select {
  background: rgba(255,255,255,.12); color: #fff;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 6px; padding: 8px 12px; font-size: .9rem;
}
.drafter-option-row select option { background: #1a3a6b; color: #fff; }
.drafter-spinner {
  width: 40px; height: 40px;
  border: 4px solid rgba(255,255,255,.2); border-top-color: #f59e0b;
  border-radius: 50%; animation: drafter-spin .8s linear infinite; margin: 0 auto;
}
@keyframes drafter-spin { to { transform: rotate(360deg); } }
.drafter-output-toolbar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 4px;
}
.drafter-score-badge {
  display: none; background: #10b981; color: #fff;
  font-weight: 700; font-size: .85rem; padding: 5px 14px; border-radius: 20px;
}
@media (max-width: 640px) {
  .drafter-options { grid-template-columns: 1fr; }
  .drafter-header  { flex-direction: column; align-items: flex-start; }
}

/* == Commercialization Plan AI Generator Panel == */
.comm-ai-panel {
  background: linear-gradient(135deg, #0d2a4a 0%, #1a4a7a 100%);
  border-radius: 12px;
  padding: 20px 24px;
  margin-bottom: 24px;
  border: 1px solid rgba(255,255,255,0.12);
}
.comm-ai-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}
.comm-ai-icon {
  font-size: 2rem;
  flex-shrink: 0;
}
.comm-ai-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
}
.comm-ai-subtitle {
  font-size: 0.8rem;
  color: rgba(255,255,255,0.7);
  margin-top: 2px;
}
.comm-ai-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.comm-ai-field label {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  color: rgba(255,255,255,0.75);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 4px;
}
.comm-ai-field input,
.comm-ai-field select {
  width: 100%;
  padding: 7px 10px;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.1);
  color: #fff;
  font-size: 0.82rem;
}
.comm-ai-field input::placeholder { color: rgba(255,255,255,0.45); }
.comm-ai-field select option { background: #1a3a5c; color: #fff; }
.comm-ai-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.btn-comm-gen-all {
  background: var(--gold, #c8a84b);
  color: #1a2a3a;
  border: none;
  border-radius: 8px;
  padding: 10px 20px;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}
.btn-comm-gen-all:hover { background: #d4b45a; }
.btn-comm-gen-all:disabled { opacity: 0.6; cursor: not-allowed; }
.comm-ai-note {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.55);
}
.comm-progress-bar {
  height: 6px;
  background: rgba(255,255,255,0.15);
  border-radius: 3px;
  margin-top: 14px;
  overflow: hidden;
}
.comm-progress-fill {
  height: 100%;
  background: var(--gold, #c8a84b);
  border-radius: 3px;
  transition: width 0.4s ease;
  width: 0%;
}
.comm-progress-label {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.7);
  margin-top: 6px;
}

/* Per-section generate button */
.btn-gen-section {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(200,168,75,0.15);
  color: var(--gold, #c8a84b);
  border: 1px solid rgba(200,168,75,0.4);
  border-radius: 5px;
  padding: 3px 9px;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  margin-left: 8px;
  vertical-align: middle;
  transition: background 0.15s;
}
.btn-gen-section:hover { background: rgba(200,168,75,0.28); }
.btn-gen-section:disabled { opacity: 0.5; cursor: not-allowed; }


/* ══════════════════════════════════════════════════════════════════
   STUDY SECTION RECOMMENDER STYLES
   ══════════════════════════════════════════════════════════════════ */

/* Input area */
.ss-input-area {
  background: #f8fafc;
  border: 1px solid #d1dce8;
  border-radius: 10px;
  padding: 16px 20px;
  margin-bottom: 16px;
}

.ss-input-notice {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  font-size: .85rem;
  color: #4a5568;
}

.ss-notice-icon { font-size: 1.1rem; }

.ss-manual-inputs { display: flex; flex-direction: column; gap: 12px; }

.ss-input-row { display: flex; flex-direction: column; gap: 4px; }

.ss-input-label {
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: #374151;
}

.ss-input-hint { font-weight: 400; color: #6b7280; text-transform: none; letter-spacing: 0; }

.ss-text-input, .ss-select, .ss-textarea {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #d1dce8;
  border-radius: 6px;
  font-size: .88rem;
  font-family: inherit;
  color: #1a202c;
  background: #fff;
  box-sizing: border-box;
}

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

.ss-text-input:focus, .ss-select:focus, .ss-textarea:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}

/* Results container */
.ss-results-container { display: flex; flex-direction: column; gap: 20px; }

.ss-results-header {
  border-bottom: 2px solid #e2e8f0;
  padding-bottom: 12px;
}

.ss-results-title {
  font-size: 1.1rem;
  font-weight: 800;
  color: #0d2b55;
  margin-bottom: 4px;
}

.ss-results-sub { font-size: .85rem; color: #4a5568; }

/* Routing rationale */
.ss-routing-rationale {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  padding: 14px 18px;
}

.ss-routing-label {
  font-size: .72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: #1e40af;
  margin-bottom: 6px;
}

.ss-routing-text { font-size: .88rem; color: #1e3a5f; line-height: 1.65; }

/* Recommendation cards */
.ss-recs-list { display: flex; flex-direction: column; gap: 16px; }

.ss-rec-card {
  background: #fff;
  border: 1px solid #d1dce8;
  border-radius: 12px;
  overflow: hidden;
  transition: box-shadow .15s;
}

.ss-rec-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,.08); }

.ss-rec-top {
  border: 2px solid #0d2b55;
  box-shadow: 0 2px 12px rgba(13,43,85,.12);
}

.ss-rec-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  flex-wrap: wrap;
}

/* Rank badge */
.ss-rank-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 64px;
  padding: 8px 10px;
  border-radius: 8px;
  color: #fff;
  flex-shrink: 0;
}

.ss-rank-num { font-size: 1.3rem; font-weight: 900; line-height: 1; }
.ss-rank-label { font-size: .62rem; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; opacity: .85; margin-top: 2px; }

/* Section identity */
.ss-rec-identity { flex: 1; min-width: 180px; }

.ss-rec-name {
  font-size: .95rem;
  font-weight: 800;
  color: #0d2b55;
  margin-bottom: 4px;
  line-height: 1.3;
}

.ss-rec-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.ss-rec-code {
  font-size: .75rem;
  font-weight: 700;
  background: #e2e8f0;
  color: #374151;
  padding: 2px 8px;
  border-radius: 4px;
  font-family: monospace;
}

.ss-rec-irg { font-size: .78rem; color: #6b7280; }

.ss-rec-badge-sbir {
  font-size: .68rem;
  font-weight: 700;
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fcd34d;
  padding: 2px 7px;
  border-radius: 10px;
  text-transform: uppercase;
  letter-spacing: .4px;
}

/* Fit score */
.ss-fit-score {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 72px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 2px solid;
  flex-shrink: 0;
  text-align: center;
}

.ss-fit-num { font-size: 1.5rem; font-weight: 900; line-height: 1; }
.ss-fit-label { font-size: .62rem; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; margin-top: 3px; }

/* Card body */
.ss-rec-body { padding: 18px 20px; display: flex; flex-direction: column; gap: 14px; }

.ss-rec-rationale {
  font-size: .88rem;
  color: #1a202c;
  line-height: 1.7;
  font-style: italic;
}

.ss-rec-section-block { display: flex; flex-direction: column; gap: 6px; }

.ss-rec-section-label {
  font-size: .72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: #374151;
}

.ss-rec-points { display: flex; flex-direction: column; gap: 5px; }

.ss-rec-point {
  font-size: .84rem;
  padding: 6px 12px;
  border-radius: 6px;
  line-height: 1.5;
}

.ss-point-green { background: #f0fdf4; color: #166534; border-left: 3px solid #22c55e; }
.ss-point-blue  { background: #eff6ff; color: #1e40af; border-left: 3px solid #3b82f6; }

.ss-rec-concern {
  font-size: .84rem;
  background: #fff7ed;
  color: #9a3412;
  border-left: 3px solid #f97316;
  padding: 8px 12px;
  border-radius: 0 6px 6px 0;
  line-height: 1.55;
}

.ss-rec-advice {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  background: #fefce8;
  border: 1px solid #fde047;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: .84rem;
  color: #713f12;
  line-height: 1.55;
}

.ss-rec-advice-icon { font-size: 1rem; flex-shrink: 0; margin-top: 1px; }

/* Institutes */
.ss-institutes {
  background: #f8fafc;
  border: 1px solid #d1dce8;
  border-radius: 8px;
  padding: 14px 18px;
}

.ss-institutes-label {
  font-size: .72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: #374151;
  margin-bottom: 10px;
}

.ss-institutes-list { display: flex; flex-wrap: wrap; gap: 8px; }

.ss-institute-tag {
  background: #dbeafe;
  color: #1e40af;
  border: 1px solid #bfdbfe;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: .8rem;
  font-weight: 600;
}

/* Program officer tip */
.ss-po-tip {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 8px;
  padding: 14px 18px;
}

.ss-po-tip-icon { font-size: 1.2rem; flex-shrink: 0; margin-top: 2px; }

.ss-po-tip-label {
  font-size: .72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: #166534;
  margin-bottom: 4px;
}

.ss-po-tip-text { font-size: .85rem; color: #14532d; line-height: 1.6; }

/* Action buttons */
.ss-results-actions { display: flex; gap: 10px; flex-wrap: wrap; padding-top: 4px; }

.btn-ss-copy, .btn-ss-use {
  padding: 9px 18px;
  border-radius: 7px;
  font-size: .85rem;
  font-weight: 700;
  cursor: pointer;
  border: none;
  transition: opacity .15s;
}

.btn-ss-copy {
  background: #e2e8f0;
  color: #374151;
}

.btn-ss-use {
  background: #0d2b55;
  color: #fff;
}

.btn-ss-copy:hover { opacity: .8; }
.btn-ss-use:hover  { opacity: .85; }

/* NCI Division badge on study section cards */
.ss-rec-badge-nci {
  font-size: .68rem;
  font-weight: 700;
  border: 1px solid;
  padding: 2px 7px;
  border-radius: 10px;
  text-transform: uppercase;
  letter-spacing: .4px;
}

/* ══════════════════════════════════════════════════════════════════
   MODULE 7 — DOCUMENT UPLOADS
   ══════════════════════════════════════════════════════════════════ */

.m7-upload-section {
  margin-bottom: 20px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  overflow: hidden;
}

.m7-upload-section-header {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #f8fafc;
  padding: 12px 16px;
  border-bottom: 1px solid #e2e8f0;
  flex-wrap: wrap;
}

.m7-upload-section-icon {
  font-size: 1.1rem;
  flex-shrink: 0;
}

.m7-upload-section-title {
  font-size: .9rem;
  font-weight: 800;
  color: #0d2b55;
}

.m7-upload-section-sub {
  font-size: .78rem;
  color: #6b7280;
  flex: 1;
}

.btn-m7-add {
  margin-left: auto;
  padding: 5px 14px;
  font-size: .78rem;
  font-weight: 700;
  background: #fff;
  color: #2563eb;
  border: 1px solid #bfdbfe;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s;
}

.btn-m7-add:hover { background: #eff6ff; }

.m7-upload-slot {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid #f1f5f9;
  flex-wrap: wrap;
}

.m7-upload-slot:last-child { border-bottom: none; }

.m7-slot-label {
  flex: 1;
  min-width: 180px;
  padding: 7px 10px;
  border: 1px solid #d1dce8;
  border-radius: 6px;
  font-size: .84rem;
  font-family: inherit;
  color: #1a202c;
  background: #fff;
}

.m7-slot-label:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37,99,235,.1);
}

.m7-upload-slot .support-drop-zone {
  flex: 2;
  min-width: 220px;
  margin: 0;
  padding: 8px 14px;
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Facilities drop zone (no slot wrapper) */
#m7-doc-uploads .support-drop-zone:not(.m7-upload-slot .support-drop-zone) {
  margin: 10px 14px 14px;
}

.btn-m7-remove {
  background: none;
  border: none;
  color: #9ca3af;
  font-size: 1rem;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 4px;
  flex-shrink: 0;
  transition: color .15s;
}

.btn-m7-remove:hover { color: #dc2626; }

/* ══════════════════════════════════════════════════════════════════
   MODULE 7 — AI TEAM REVIEW PANEL
   ══════════════════════════════════════════════════════════════════ */

.btn-team-review {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  background: linear-gradient(135deg, #0d2b55, #1a56a0);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: .95rem;
  font-weight: 700;
  cursor: pointer;
  margin-top: 8px;
  transition: opacity .15s;
}
.btn-team-review:hover { opacity: .88; }
.btn-team-review:disabled { opacity: .5; cursor: not-allowed; }

/* Section wrappers */
.tr-section {
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 18px;
}

.tr-section-header {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #f8fafc;
  padding: 12px 16px;
  border-bottom: 1px solid #e2e8f0;
  flex-wrap: wrap;
}

.tr-section-icon { font-size: 1.1rem; }

.tr-section-title {
  font-size: .92rem;
  font-weight: 800;
  color: #0d2b55;
  flex: 1;
}

.tr-section-body {
  padding: 16px 18px;
}

/* Verdict badge */
.tr-verdict-badge {
  padding: 4px 14px;
  border-radius: 20px;
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .02em;
}
.tr-verdict-green  { background: #dcfce7; color: #15803d; }
.tr-verdict-yellow { background: #fef9c3; color: #92400e; }
.tr-verdict-red    { background: #fee2e2; color: #b91c1c; }

.tr-verdict-summary {
  font-size: .9rem;
  font-weight: 600;
  color: #1e293b;
  margin: 0 0 14px;
  line-height: 1.5;
}

/* Strengths / Concerns lists */
.tr-list-block {
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 12px;
}
.tr-strengths { background: #f0fdf4; border: 1px solid #bbf7d0; }
.tr-concerns  { background: #fff7ed; border: 1px solid #fed7aa; }

.tr-list-title {
  font-size: .8rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: 8px;
  color: #374151;
}
.tr-list-block ul { margin: 0; padding-left: 18px; }
.tr-list-block li { font-size: .85rem; color: #374151; margin-bottom: 4px; line-height: 1.5; }

/* Member cards */
.tr-members { display: flex; flex-direction: column; gap: 12px; margin-top: 14px; }

.tr-member-card {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 12px 16px;
  background: #fafbfd;
}

.tr-member-header {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.tr-member-name { font-weight: 800; font-size: .9rem; color: #0d2b55; }
.tr-member-role { font-size: .78rem; color: #6b7280; background: #f1f5f9; padding: 2px 8px; border-radius: 4px; }

.tr-tag {
  font-size: .72rem;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: 12px;
}
.tr-tag-green  { background: #dcfce7; color: #15803d; }
.tr-tag-yellow { background: #fef9c3; color: #92400e; }
.tr-tag-red    { background: #fee2e2; color: #b91c1c; }

.tr-member-summary { font-size: .84rem; color: #374151; line-height: 1.55; margin: 0 0 6px; }
.tr-member-strengths { font-size: .8rem; color: #15803d; margin-bottom: 4px; }
.tr-member-concerns  { font-size: .8rem; color: #b45309; }

/* Gap Analysis */
.tr-gap-summary {
  font-size: .88rem;
  color: #374151;
  line-height: 1.55;
  margin: 0 0 14px;
}

.tr-coverage-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
}
.tr-coverage-label { font-size: .8rem; font-weight: 700; color: #374151; }
.tr-coverage-tag { font-size: .75rem; padding: 3px 10px; border-radius: 12px; }

.tr-gaps-list { display: flex; flex-direction: column; gap: 10px; }

.tr-gap-item {
  border-radius: 8px;
  padding: 12px 16px;
  border-left: 4px solid transparent;
}
.tr-gap-critical  { background: #fff1f2; border-left-color: #ef4444; }
.tr-gap-important { background: #fffbeb; border-left-color: #f59e0b; }
.tr-gap-optional  { background: #f8fafc; border-left-color: #94a3b8; }

.tr-gap-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}
.tr-gap-priority { font-size: .8rem; font-weight: 800; }
.tr-gap-role     { font-size: .82rem; color: #374151; }
.tr-gap-expertise { font-size: .83rem; color: #1e293b; margin-bottom: 4px; }
.tr-gap-why      { font-size: .8rem; color: #6b7280; line-height: 1.5; }

/* Biosketch Quality Cards */
.tr-biosketch-card {
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 16px 18px;
  margin-bottom: 14px;
  background: #fafbfd;
}

.tr-biosketch-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.tr-biosketch-name { font-weight: 800; font-size: .92rem; color: #0d2b55; flex: 1; }
.tr-biosketch-role { font-size: .78rem; color: #6b7280; background: #f1f5f9; padding: 2px 8px; border-radius: 4px; }

.tr-overall-score {
  font-size: 1.05rem;
  font-weight: 900;
  padding: 4px 14px;
  border-radius: 20px;
}
.tr-score-green  { background: #dcfce7; color: #15803d; }
.tr-score-yellow { background: #fef9c3; color: #92400e; }
.tr-score-red    { background: #fee2e2; color: #b91c1c; }

/* Score bars */
.tr-score-grid { display: flex; flex-direction: column; gap: 7px; margin-bottom: 14px; }

.tr-score-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.tr-score-label {
  font-size: .78rem;
  color: #374151;
  width: 160px;
  flex-shrink: 0;
}
.tr-score-bar-wrap {
  flex: 1;
  height: 8px;
  background: #e2e8f0;
  border-radius: 4px;
  overflow: hidden;
}
.tr-score-bar {
  height: 100%;
  border-radius: 4px;
  transition: width .4s ease;
}
.tr-bar-green  { background: #22c55e; }
.tr-bar-yellow { background: #f59e0b; }
.tr-bar-red    { background: #ef4444; }
.tr-score-val  { font-size: .78rem; font-weight: 700; color: #374151; width: 32px; text-align: right; }

/* Bio section blocks */
.tr-bio-section { border-radius: 6px; padding: 10px 14px; margin-bottom: 8px; }
.tr-bio-strengths   { background: #f0fdf4; border: 1px solid #bbf7d0; }
.tr-bio-improvements { background: #fff7ed; border: 1px solid #fed7aa; }

.tr-bio-section-title {
  font-size: .75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: 6px;
  color: #374151;
}
.tr-bio-section ul { margin: 0; padding-left: 16px; }
.tr-bio-section li { font-size: .82rem; color: #374151; margin-bottom: 3px; line-height: 1.5; }

.tr-priority-action {
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 6px;
  padding: 10px 14px;
  font-size: .83rem;
  color: #7f1d1d;
  line-height: 1.5;
}
.tr-priority-label {
  font-weight: 800;
  margin-right: 6px;
}

/* ── Multi-file Drop Zone ─────────────────────────────────────── */
.multi-drop-zone {
  border: 2px dashed var(--blue);
  background: #f0f6ff;
  padding: 18px 16px;
  text-align: center;
  cursor: pointer;
  border-radius: var(--radius);
  transition: background .15s, border-color .15s;
}
.multi-drop-zone:hover,
.multi-drop-zone.drag-over {
  background: #dceeff;
  border-color: var(--navy);
}
.multi-drop-zone .sdz-label {
  display: block;
  font-size: .82rem;
  color: var(--blue);
  font-weight: 600;
  margin-top: 4px;
}
.multi-drop-zone .sdz-icon {
  font-size: 1.4rem;
}
.multi-drop-zone input[type="file"] {
  display: none;
}


/* Module 0: Import from Document */
.btn-import-doc {
  display: block;
  width: calc(100% - 24px);
  margin: 0 12px;
  padding: 10px 14px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: .9rem;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
  letter-spacing: .02em;
  transition: opacity .15s;
}
.btn-import-doc:hover { opacity: .88; }
.btn-import-doc.active { box-shadow: 0 0 0 3px rgba(99,102,241,.35); }
.import-success-box { background: #f0fdf4; border: 1.5px solid #86efac; border-radius: 12px; padding: 24px; margin-top: 16px; }
.import-success-header { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 20px; }
.import-check { display: flex; align-items: center; justify-content: center; width: 36px; height: 36px; min-width: 36px; background: #16a34a; color: #fff; border-radius: 50%; font-size: 1.2rem; font-weight: 700; }
.import-preview-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 16px; }
.import-preview-item { background: #fff; border: 1px solid #d1fae5; border-radius: 8px; padding: 12px 14px; }
.import-preview-label { font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: #6b7280; margin-bottom: 4px; }
.import-preview-value { font-size: .92rem; color: #111827; line-height: 1.5; }
.import-aims-preview { background: #fff; border: 1px solid #d1fae5; border-radius: 8px; padding: 14px 16px; margin-bottom: 16px; }
.import-aim-preview { margin-bottom: 12px; padding-bottom: 12px; border-bottom: 1px solid #f0fdf4; }
.import-aim-preview:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.import-aim-preview strong { font-size: .93rem; color: #1e3a5f; }
.import-aim-preview p { font-size: .88rem; color: #374151; margin: 4px 0 0; line-height: 1.55; }
.import-modules-populated { background: #fff; border: 1px solid #d1fae5; border-radius: 8px; padding: 14px 16px; margin-bottom: 16px; }
.import-module-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.imp-tag { display: inline-block; padding: 4px 10px; border-radius: 20px; font-size: .8rem; font-weight: 600; }
.imp-tag.green { background: #dcfce7; color: #166534; }
.imp-tag.yellow { background: #fef9c3; color: #854d0e; }
.imp-tag.grey { background: #f3f4f6; color: #6b7280; }
.import-error-box { background: #fef2f2; border: 1.5px solid #fca5a5; border-radius: 10px; padding: 16px 20px; color: #991b1b; font-size: .93rem; margin-top: 16px; }
.import-upload-zone {
  border: 2px dashed #c7d2fe;
  border-radius: 10px;
  padding: 24px;
  text-align: center;
  cursor: pointer;
  background: #f5f3ff;
  transition: border-color .15s, background .15s;
  margin-bottom: 14px;
}
.import-upload-zone:hover, .import-upload-zone.drag-over {
  border-color: #6366f1;
  background: #ede9fe;
}
    .import-upload-zone .upload-icon { font-size: 2rem; margin-bottom: 8px; }
    .import-upload-zone .upload-icon svg { width: 32px !important; height: 32px !important; }
    .import-upload-zone .upload-text { font-size: .9rem; color: #4b5563; }
    .import-upload-zone .upload-sub { font-size: .8rem; color: #9ca3af; margin-top: 4px; }


    /* Module 0: Import from Document */
.btn-import-doc {
  display: block;
  width: calc(100% - 24px);
  margin: 0 12px;
  padding: 10px 14px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: .9rem;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
  letter-spacing: .02em;
  transition: opacity .15s;
}
.btn-import-doc:hover { opacity: .88; }
.btn-import-doc.active { box-shadow: 0 0 0 3px rgba(99,102,241,.35); }
.import-success-box { background: #f0fdf4; border: 1.5px solid #86efac; border-radius: 12px; padding: 24px; margin-top: 16px; }
.import-success-header { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 20px; }
.import-check { display: flex; align-items: center; justify-content: center; width: 36px; height: 36px; min-width: 36px; background: #16a34a; color: #fff; border-radius: 50%; font-size: 1.2rem; font-weight: 700; }
.import-preview-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 16px; }
.import-preview-item { background: #fff; border: 1px solid #d1fae5; border-radius: 8px; padding: 12px 14px; }
.import-preview-label { font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: #6b7280; margin-bottom: 4px; }
.import-preview-value { font-size: .92rem; color: #111827; line-height: 1.5; }
.import-aims-preview { background: #fff; border: 1px solid #d1fae5; border-radius: 8px; padding: 14px 16px; margin-bottom: 16px; }
.import-aim-preview { margin-bottom: 12px; padding-bottom: 12px; border-bottom: 1px solid #f0fdf4; }
.import-aim-preview:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.import-aim-preview strong { font-size: .93rem; color: #1e3a5f; }
.import-aim-preview p { font-size: .88rem; color: #374151; margin: 4px 0 0; line-height: 1.55; }
.import-modules-populated { background: #fff; border: 1px solid #d1fae5; border-radius: 8px; padding: 14px 16px; margin-bottom: 16px; }
.import-module-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.imp-tag { display: inline-block; padding: 4px 10px; border-radius: 20px; font-size: .8rem; font-weight: 600; }
.imp-tag.green { background: #dcfce7; color: #166534; }
.imp-tag.yellow { background: #fef9c3; color: #854d0e; }
.imp-tag.grey { background: #f3f4f6; color: #6b7280; }
.import-error-box { background: #fef2f2; border: 1.5px solid #fca5a5; border-radius: 10px; padding: 16px 20px; color: #991b1b; font-size: .93rem; margin-top: 16px; }
.import-upload-zone {
  border: 2px dashed #c7d2fe;
  border-radius: 10px;
  padding: 24px;
  text-align: center;
  cursor: pointer;
  background: #f5f3ff;
  transition: border-color .15s, background .15s;
  margin-bottom: 14px;
}
.import-upload-zone:hover, .import-upload-zone.drag-over {
  border-color: #6366f1;
  background: #ede9fe;
}
.import-upload-zone .upload-icon { font-size: 2rem; margin-bottom: 8px; }
.import-upload-zone .upload-icon svg { width: 32px !important; height: 32px !important; }
.import-upload-zone .upload-text { font-size: .9rem; color: #4b5563; }
.import-upload-zone .upload-sub { font-size: .8rem; color: #9ca3af; margin-top: 4px; }


/* ═══════════════════════════════════════════════════════════════════════════
   DRAFT STUDIO — v2.8
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── View Container ─────────────────────────────────────────────────────── */
#draftstudio-view {
  display: none;
  min-height: 100vh;
  background: #f8fafc;
  padding: 0 0 60px;
}
#draftstudio-view.active {
  display: block;
}

/* ── Main Container ─────────────────────────────────────────────────────── */
.ds-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 32px 28px;
}

/* ── Header ─────────────────────────────────────────────────────────────── */
.ds-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}
.ds-title {
  font-size: 1.85rem;
  font-weight: 700;
  color: #1e293b;
  margin: 0 0 6px;
  letter-spacing: -.02em;
}
.ds-subtitle {
  font-size: .95rem;
  color: #64748b;
  margin: 0;
  max-width: 520px;
  line-height: 1.5;
}
.ds-header-right {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 240px;
}
.ds-label {
  font-size: .8rem;
  font-weight: 600;
  color: #374151;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.ds-select {
  padding: 8px 12px;
  border: 1.5px solid #d1d5db;
  border-radius: 8px;
  font-size: .9rem;
  color: #1e293b;
  background: #fff;
  cursor: pointer;
}
.ds-select:focus { outline: none; border-color: #6366f1; }
.ds-progress-bar {
  background: #e0e7ff;
  border-radius: 6px;
  padding: 7px 12px;
  font-size: .82rem;
  color: #3730a3;
  font-weight: 500;
}

/* ── Title Panel ────────────────────────────────────────────────────────── */
.ds-title-panel {
  background: #fff;
  border: 1.5px solid #e0e7ff;
  border-radius: 14px;
  margin-bottom: 28px;
  overflow: hidden;
}
.ds-panel-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 22px;
  background: linear-gradient(135deg, #6366f1 0%, #818cf8 100%);
  color: #fff;
}
.ds-panel-icon { font-size: 1.2rem; }
.ds-panel-label { font-size: 1rem; font-weight: 700; }
.ds-panel-hint { font-size: .82rem; color: #c7d2fe; margin-left: auto; }
.ds-panel-body { padding: 20px 22px; }
.ds-title-chosen-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.ds-chosen-title-text {
  font-size: .95rem;
  color: #1e293b;
  font-style: italic;
}
.ds-btn-generate-titles {
  background: linear-gradient(135deg, #6366f1 0%, #818cf8 100%);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 10px 20px;
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity .15s;
}
.ds-btn-generate-titles:hover { opacity: .88; }
.ds-btn-generate-titles:disabled { opacity: .5; cursor: not-allowed; }

/* ── Title Results ──────────────────────────────────────────────────────── */
.ds-titles-list { margin-top: 18px; display: flex; flex-direction: column; gap: 12px; }
.ds-title-row {
  border: 1.5px solid #e5e7eb;
  border-radius: 10px;
  padding: 14px 16px;
  background: #f9fafb;
  transition: border-color .15s;
}
.ds-title-row:hover { border-color: #a5b4fc; }
.ds-title-row.ds-title-chosen { border-color: #6366f1; background: #eef2ff; }
.ds-title-row.ds-title-over { border-color: #f87171; background: #fff1f2; }
.ds-title-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}
.ds-title-type {
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: #6366f1;
  background: #e0e7ff;
  padding: 2px 8px;
  border-radius: 4px;
}
.ds-title-chars {
  font-size: .78rem;
  color: #6b7280;
  margin-left: auto;
}
.ds-title-chars.over { color: #dc2626; font-weight: 700; }
.ds-title-text {
  font-size: 1rem;
  font-weight: 600;
  color: #1e293b;
  margin-bottom: 6px;
  outline: none;
  border-bottom: 1px dashed #d1d5db;
  padding-bottom: 4px;
  min-height: 1.4em;
}
.ds-title-text:focus { border-bottom-color: #6366f1; }
.ds-title-rationale { font-size: .82rem; color: #6b7280; margin-bottom: 10px; }
.ds-btn-use-title {
  background: #fff;
  border: 1.5px solid #6366f1;
  color: #6366f1;
  border-radius: 7px;
  padding: 6px 14px;
  font-size: .83rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.ds-btn-use-title:hover { background: #6366f1; color: #fff; }
.ds-title-row.ds-title-chosen .ds-btn-use-title { background: #6366f1; color: #fff; }

/* ── Section Cards Grid ─────────────────────────────────────────────────── */
.ds-sections-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(420px, 1fr));
  gap: 22px;
  margin-bottom: 28px;
}

/* ── Section Card ───────────────────────────────────────────────────────── */
.ds-section-card {
  background: #fff;
  border: 1.5px solid #e5e7eb;
  border-radius: 14px;
  overflow: hidden;
  transition: border-color .15s, box-shadow .15s;
}
.ds-section-card:hover { border-color: #a5b4fc; box-shadow: 0 2px 12px rgba(99,102,241,.08); }
.ds-section-card.has-content { border-color: #6366f1; }
.ds-section-card.version-chosen { border-color: #16a34a; }
.ds-card-approach { border-left: 4px solid #f59e0b; }

.ds-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  background: #f8fafc;
  border-bottom: 1px solid #e5e7eb;
  flex-wrap: wrap;
}
.ds-card-num {
  font-size: .75rem;
  font-weight: 800;
  color: #fff;
  background: #6366f1;
  border-radius: 5px;
  padding: 2px 7px;
  letter-spacing: .03em;
}
.ds-card-label {
  font-size: .95rem;
  font-weight: 700;
  color: #1e293b;
}
.ds-card-hint {
  font-size: .78rem;
  color: #6b7280;
  margin-left: auto;
}

.ds-approach-notice {
  background: #fffbeb;
  border-bottom: 1px solid #fde68a;
  padding: 10px 18px;
  font-size: .82rem;
  color: #92400e;
  line-height: 1.5;
}

.ds-card-body { padding: 16px 18px; }

.ds-upload-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.ds-upload-btn {
  display: inline-block;
  background: #f0f4ff;
  border: 1.5px solid #c7d2fe;
  color: #4338ca;
  border-radius: 7px;
  padding: 7px 14px;
  font-size: .84rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s;
  white-space: nowrap;
}
.ds-upload-btn:hover { background: #e0e7ff; }
.ds-upload-status {
  font-size: .8rem;
  color: #6b7280;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ds-paste-label { font-size: .78rem; color: #6b7280; margin-bottom: 6px; }
.ds-paste-area {
  width: 100%;
  min-height: 90px;
  border: 1.5px solid #e5e7eb;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: .85rem;
  color: #1e293b;
  resize: vertical;
  font-family: inherit;
  line-height: 1.5;
  box-sizing: border-box;
  transition: border-color .15s;
}
.ds-paste-area:focus { outline: none; border-color: #6366f1; }

.ds-card-footer {
  padding: 12px 18px;
  border-top: 1px solid #f1f5f9;
  background: #f8fafc;
}
.ds-btn-generate-section {
  background: linear-gradient(135deg, #6366f1 0%, #818cf8 100%);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 9px 18px;
  font-size: .88rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity .15s;
  width: 100%;
}
.ds-btn-generate-section:hover:not(:disabled) { opacity: .88; }
.ds-btn-generate-section:disabled { opacity: .4; cursor: not-allowed; }

/* ── Version Compare ────────────────────────────────────────────────────── */
.ds-result-area { padding: 0 18px 18px; }
.ds-versions-wrap { margin-top: 14px; }
.ds-versions-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 14px;
}
@media (max-width: 700px) { .ds-versions-grid { grid-template-columns: 1fr; } }

.ds-version-col {
  border: 1.5px solid #e5e7eb;
  border-radius: 10px;
  overflow: hidden;
  transition: border-color .15s, box-shadow .15s;
}
.ds-version-col.ds-version-chosen { border-color: #16a34a; box-shadow: 0 0 0 3px rgba(22,163,74,.12); }
.ds-version-col.ds-version-unchosen { opacity: .65; }

.ds-version-header {
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.ds-ver-a { background: linear-gradient(135deg, #3b82f6 0%, #60a5fa 100%); color: #fff; }
.ds-ver-b { background: linear-gradient(135deg, #8b5cf6 0%, #a78bfa 100%); color: #fff; }
.ds-ver-label { font-size: .88rem; font-weight: 700; }
.ds-ver-sub { font-size: .76rem; opacity: .88; }

.ds-version-body { padding: 10px; }
.ds-version-textarea {
  width: 100%;
  min-height: 180px;
  border: 1px solid #e5e7eb;
  border-radius: 7px;
  padding: 10px;
  font-size: .83rem;
  color: #1e293b;
  resize: vertical;
  font-family: Georgia, 'Times New Roman', serif;
  line-height: 1.65;
  box-sizing: border-box;
}
.ds-version-textarea:focus { outline: none; border-color: #6366f1; }

.ds-version-footer { padding: 10px 12px; border-top: 1px solid #f1f5f9; }
.ds-btn-choose {
  width: 100%;
  border: none;
  border-radius: 7px;
  padding: 8px;
  font-size: .85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.ds-btn-choose-a { background: #dbeafe; color: #1d4ed8; }
.ds-btn-choose-a:hover { background: #3b82f6; color: #fff; }
.ds-version-col.ds-version-chosen .ds-btn-choose-a { background: #16a34a; color: #fff; }
.ds-btn-choose-b { background: #ede9fe; color: #6d28d9; }
.ds-btn-choose-b:hover { background: #8b5cf6; color: #fff; }
.ds-version-col.ds-version-chosen .ds-btn-choose-b { background: #16a34a; color: #fff; }

/* ── Changes Panel ──────────────────────────────────────────────────────── */
.ds-changes-panel {
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 14px 16px;
  margin-top: 8px;
}
.ds-changes-title {
  font-size: .82rem;
  font-weight: 700;
  color: #374151;
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.ds-change-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px solid #f1f5f9;
  font-size: .82rem;
}
.ds-change-item:last-child { border-bottom: none; }
.ds-change-badge {
  font-size: .7rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  text-transform: uppercase;
  white-space: nowrap;
  background: #e0e7ff;
  color: #3730a3;
}
.ds-change-structural .ds-change-badge { background: #fce7f3; color: #9d174d; }
.ds-change-language .ds-change-badge { background: #d1fae5; color: #065f46; }
.ds-change-compliance .ds-change-badge { background: #fef3c7; color: #92400e; }
.ds-change-milestone .ds-change-badge { background: #fee2e2; color: #991b1b; }
.ds-change-quantitative .ds-change-badge { background: #e0f2fe; color: #0c4a6e; }
.ds-change-desc { color: #374151; flex: 1; }
.ds-change-ver { font-size: .72rem; color: #9ca3af; white-space: nowrap; }

/* ── Generate All Bar ───────────────────────────────────────────────────── */
.ds-generate-all-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  background: #fff;
  border: 1.5px solid #e0e7ff;
  border-radius: 12px;
  padding: 18px 24px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}
.ds-btn-generate-all {
  background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
  color: #fff;
  border: none;
  border-radius: 9px;
  padding: 12px 24px;
  font-size: .95rem;
  font-weight: 700;
  cursor: pointer;
  transition: opacity .15s;
  white-space: nowrap;
}
.ds-btn-generate-all:hover { opacity: .88; }
.ds-generate-all-hint { font-size: .85rem; color: #6b7280; }

/* ── Compile Panel ──────────────────────────────────────────────────────── */
.ds-compile-panel {
  background: #fff;
  border: 1.5px solid #e0e7ff;
  border-radius: 14px;
  padding: 28px;
}
.ds-compile-panel-header {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 20px;
}
.ds-compile-icon { font-size: 2rem; }
.ds-compile-panel-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 4px;
}
.ds-compile-panel-sub { font-size: .88rem; color: #6b7280; line-height: 1.5; }
.ds-btn-compile {
  background: linear-gradient(135deg, #16a34a 0%, #22c55e 100%);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 14px 28px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: opacity .15s;
  width: 100%;
  margin-bottom: 20px;
}
.ds-btn-compile:hover:not(:disabled) { opacity: .88; }
.ds-btn-compile:disabled { opacity: .4; cursor: not-allowed; }

/* ── Compile Result ─────────────────────────────────────────────────────── */
.ds-compile-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  flex-wrap: wrap;
  gap: 10px;
}
.ds-compile-title { font-size: 1.1rem; font-weight: 700; color: #1e293b; }
.ds-coherence-score { font-size: 1.05rem; font-weight: 700; }
.ds-coherence-notes {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: .87rem;
  color: #166534;
  margin-bottom: 16px;
  line-height: 1.5;
}
.ds-output-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
  border-bottom: 2px solid #e5e7eb;
}
.ds-tab-btn {
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  padding: 8px 16px;
  font-size: .88rem;
  font-weight: 600;
  color: #6b7280;
  cursor: pointer;
  margin-bottom: -2px;
  transition: color .15s, border-color .15s;
}
.ds-tab-btn.active { color: #6366f1; border-bottom-color: #6366f1; }
.ds-tab-btn:hover:not(.active) { color: #374151; }
.ds-output-toolbar {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.ds-action-btn {
  background: #f1f5f9;
  border: 1.5px solid #e2e8f0;
  color: #374151;
  border-radius: 7px;
  padding: 7px 14px;
  font-size: .84rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s;
}
.ds-action-btn:hover { background: #e2e8f0; }
.ds-clean-output {
  background: #fafafa;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 20px 24px;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: .92rem;
  line-height: 1.75;
  color: #1e293b;
  white-space: pre-wrap;
  max-height: 600px;
  overflow-y: auto;
}

/* ── Annotation Layer ───────────────────────────────────────────────────── */
.ds-annot-legend {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.ds-annot-type {
  font-size: .72rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.ds-annot-type.terminology { background: #e0e7ff; color: #3730a3; }
.ds-annot-type.alignment { background: #d1fae5; color: #065f46; }
.ds-annot-type.compliance { background: #fef3c7; color: #92400e; }
.ds-annot-type.voice { background: #fce7f3; color: #9d174d; }
.ds-annot-type.cross-reference { background: #e0f2fe; color: #0c4a6e; }
.ds-annotations-list { display: flex; flex-direction: column; gap: 10px; }
.ds-annot-item {
  border: 1px solid #e5e7eb;
  border-radius: 9px;
  padding: 12px 14px;
  background: #fafafa;
}
.ds-annot-terminology { border-left: 4px solid #6366f1; }
.ds-annot-alignment { border-left: 4px solid #16a34a; }
.ds-annot-compliance { border-left: 4px solid #d97706; }
.ds-annot-voice { border-left: 4px solid #db2777; }
.ds-annot-cross-reference { border-left: 4px solid #0284c7; }
.ds-annot-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.ds-annot-section {
  font-size: .78rem;
  font-weight: 700;
  color: #374151;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.ds-annot-original, .ds-annot-revised {
  font-size: .83rem;
  margin-bottom: 5px;
  line-height: 1.5;
}
.ds-annot-original { color: #dc2626; }
.ds-annot-revised { color: #16a34a; }
.ds-annot-label { font-weight: 700; margin-right: 4px; }
.ds-annot-reason { font-size: .82rem; color: #6b7280; font-style: italic; margin-top: 4px; }

/* ── Generating / Error States ──────────────────────────────────────────── */
.ds-generating {
  text-align: center;
  padding: 28px 20px;
  color: #6b7280;
  font-size: .9rem;
}
.ds-error {
  background: #fef2f2;
  border: 1.5px solid #fca5a5;
  border-radius: 9px;
  padding: 14px 16px;
  color: #991b1b;
  font-size: .88rem;
  margin-top: 12px;
}

/* ── Draft Studio: Manual Title Input ─────────────────────────────────── */
.ds-manual-title-row {
  margin-bottom: 18px;
}
.ds-manual-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 8px 0 6px;
}
.ds-manual-title-input {
  flex: 1;
  padding: 10px 14px;
  border: 1.5px solid #c7d2fe;
  border-radius: 8px;
  font-size: .97rem;
  font-family: inherit;
  color: #1e293b;
  background: #fff;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.ds-manual-title-input:focus {
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99,102,241,.12);
}
.ds-manual-title-chars {
  font-size: .8rem;
  font-weight: 600;
  color: #6b7280;
  white-space: nowrap;
  min-width: 52px;
  text-align: right;
}
.ds-manual-title-chars.over {
  color: #dc2626;
}
.ds-manual-title-hint {
  font-size: .78rem;
  color: #6b7280;
  line-height: 1.5;
}


/* ═══════════════════════════════════════════════════════════════════════════
   WORKFLOW GUIDE
   ═══════════════════════════════════════════════════════════════════════════ */

/* Header button */
.btn-workflow-guide {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  background: linear-gradient(135deg, #0d2b55, #1a4a8a);
  color: #fff;
  border: none;
  border-radius: 20px;
  font-size: .82rem;
  font-weight: 600;
  cursor: pointer;
  letter-spacing: .02em;
  transition: opacity .15s;
  white-space: nowrap;
}
.btn-workflow-guide:hover { opacity: .88; }

/* Backdrop */
.wfg-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.55);
  z-index: 1100;
  transition: opacity .2s;
}
.wfg-backdrop.hidden { display: none; }

/* Panel */
.wfg-panel {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(720px, 96vw);
  max-height: 88vh;
  overflow-y: auto;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 24px 64px rgba(0,0,0,.22);
  z-index: 1101;
  display: flex;
  flex-direction: column;
}
.wfg-panel.hidden { display: none; }

/* Header */
.wfg-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 28px 18px;
  border-bottom: 1px solid #e8edf4;
  background: linear-gradient(135deg, #0d2b55 0%, #1a4a8a 100%);
  border-radius: 16px 16px 0 0;
  color: #fff;
}
.wfg-header-left { display: flex; align-items: center; gap: 14px; }
.wfg-logo { font-size: 2rem; line-height: 1; }
.wfg-title { font-size: 1.15rem; font-weight: 700; letter-spacing: .01em; }
.wfg-sub { font-size: .82rem; opacity: .85; margin-top: 2px; }
.wfg-close {
  background: rgba(255,255,255,.15);
  border: none;
  color: #fff;
  font-size: 1.4rem;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s;
  flex-shrink: 0;
}
.wfg-close:hover { background: rgba(255,255,255,.28); }

/* Steps */
.wfg-steps {
  padding: 24px 28px 8px;
  display: flex;
  flex-direction: column;
  gap: 0;
}
.wfg-step {
  display: flex;
  gap: 18px;
  padding: 18px 0;
  border-bottom: 1px solid #f0f4fa;
}
.wfg-step:last-child { border-bottom: none; }
.wfg-step-num {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .95rem;
  font-weight: 700;
  margin-top: 2px;
}
.wfg-step-body { flex: 1; }
.wfg-step-title {
  font-size: .97rem;
  font-weight: 700;
  color: #0d2b55;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.wfg-step-desc {
  font-size: .85rem;
  color: #4b5563;
  line-height: 1.65;
  margin-bottom: 10px;
}
.wfg-goto-btn {
  display: inline-block;
  padding: 6px 16px;
  background: #0d2b55;
  color: #fff;
  border: none;
  border-radius: 20px;
  font-size: .8rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity .15s;
}
.wfg-goto-btn:hover { opacity: .82; }

/* Tab badges */
.wfg-tab-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .03em;
  text-transform: uppercase;
}
.wfg-tab-badge.draft-studio { background: #ede9fe; color: #5b21b6; }
.wfg-tab-badge.build-grant  { background: #dbeafe; color: #1e40af; }
.wfg-tab-badge.review       { background: #dcfce7; color: #166534; }
.wfg-tab-badge.discover     { background: #fef9c3; color: #854d0e; }
.wfg-tab-badge.convert      { background: #ffe4e6; color: #9f1239; }

/* Footer */
.wfg-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 28px 20px;
  border-top: 1px solid #e8edf4;
  background: #f8fafc;
  border-radius: 0 0 16px 16px;
}
.wfg-dont-show {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .82rem;
  color: #6b7280;
  cursor: pointer;
}
.wfg-close-btn {
  padding: 8px 22px;
  background: #e2e8f0;
  color: #1e293b;
  border: none;
  border-radius: 20px;
  font-size: .85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s;
}
.wfg-close-btn:hover { background: #cbd5e1; }


/* ═══════════════════════════════════════════════════════════════════
   DOCUMENT STUDIO
   ═══════════════════════════════════════════════════════════════════ */

.docst-container {
  max-width: 960px;
  margin: 0 auto;
  padding: 32px 24px 60px;
}

.docst-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}

.docst-header-left { flex: 1; min-width: 260px; }

.docst-title {
  font-size: 1.6rem;
  font-weight: 900;
  color: var(--navy);
  margin: 0 0 8px;
}

.docst-subtitle {
  font-size: .88rem;
  color: var(--muted);
  line-height: 1.55;
  margin: 0;
}

.docst-header-right {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 200px;
}

.docst-mech-label {
  font-size: .78rem;
  font-weight: 700;
  color: var(--navy);
  text-transform: uppercase;
  letter-spacing: .04em;
}

.docst-mech-select {
  padding: 9px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: .92rem;
  font-family: inherit;
  background: #fff;
  color: var(--text);
  cursor: pointer;
}

/* Progress bar */
.docst-progress {
  margin-bottom: 28px;
}

.docst-prog-bar-wrap {
  height: 8px;
  background: #e2e8f0;
  border-radius: 99px;
  overflow: hidden;
  margin-bottom: 10px;
}

.docst-prog-bar {
  height: 100%;
  background: linear-gradient(90deg, #1a56a0, #0d9488);
  border-radius: 99px;
  transition: width .4s ease;
}

.docst-prog-stats {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.docst-stat {
  font-size: .78rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 99px;
}

.docst-stat.complete  { background: #d1fae5; color: #065f46; }
.docst-stat.draft     { background: #dbeafe; color: #1e40af; }
.docst-stat.pending   { background: #f1f5f9; color: #64748b; }
.docst-stat.total     { background: #f8fafc; color: #334155; border: 1px solid #e2e8f0; }

/* Section headers */
.docst-section-header {
  font-size: .72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--muted);
  padding: 20px 0 8px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 12px;
}

/* Document cards */
.docst-doc-card {
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 16px 18px;
  margin-bottom: 10px;
  transition: border-color .15s;
}

.docst-doc-card[data-status="draft_ready"]  { border-left: 4px solid #3b82f6; }
.docst-doc-card[data-status="sent"]         { border-left: 4px solid #f59e0b; }
.docst-doc-card[data-status="received"]     { border-left: 4px solid #8b5cf6; }
.docst-doc-card[data-status="complete"]     { border-left: 4px solid #10b981; }
.docst-doc-card[data-status="not_started"]  { border-left: 4px solid #e2e8f0; }

.docst-doc-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.docst-doc-info { flex: 1; min-width: 200px; }

.docst-doc-title {
  font-size: .95rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 4px;
}

.docst-doc-desc {
  font-size: .8rem;
  color: var(--muted);
  line-height: 1.5;
}

.docst-doc-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  flex-shrink: 0;
}

.docst-btn-generate {
  background: linear-gradient(135deg, #1a56a0, #0d2b55);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  padding: 7px 14px;
  font-size: .82rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity .15s;
}

.docst-btn-generate:hover { opacity: .88; }

.docst-btn-view {
  background: #f1f5f9;
  color: var(--navy);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 7px 14px;
  font-size: .82rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.docst-gather-note {
  font-size: .78rem;
  color: var(--muted);
  font-style: italic;
}

/* Status badge */
.docst-status-badge {
  font-size: .72rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 99px;
  white-space: nowrap;
}

.status-not_started { background: #f1f5f9; color: #64748b; }
.status-draft_ready { background: #dbeafe; color: #1e40af; }
.status-sent        { background: #fef3c7; color: #92400e; }
.status-received    { background: #ede9fe; color: #5b21b6; }
.status-complete    { background: #d1fae5; color: #065f46; }

/* Status row */
.docst-status-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #f1f5f9;
}

.docst-status-label {
  font-size: .78rem;
  font-weight: 700;
  color: var(--muted);
  white-space: nowrap;
}

.docst-status-select {
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: .8rem;
  font-family: inherit;
  background: #fafbfd;
  color: var(--text);
  cursor: pointer;
}

/* Modal backdrop */
.docst-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 1100;
  display: none;
}
.docst-backdrop.visible {
  display: block;
}
.docst-backdrop.hidden {
  display: none !important;
}

/* Generator modal */
.docst-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(760px, 94vw);
  max-height: 88vh;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 24px 60px rgba(0,0,0,.22);
  z-index: 1101;
  display: none;
  flex-direction: column;
  overflow: hidden;
}

.docst-modal.hidden { display: none !important; }
.docst-modal.visible { display: flex; }

.docst-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px 14px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.docst-modal-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--navy);
  margin: 0;
}

.docst-modal-close {
  background: none;
  border: none;
  font-size: 1.1rem;
  cursor: pointer;
  color: var(--muted);
  padding: 4px 8px;
  border-radius: 6px;
  transition: background .12s;
}

.docst-modal-close:hover { background: #f1f5f9; }

.docst-modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px 22px;
}

.docst-form-group {
  margin-bottom: 14px;
}

.docst-form-group label {
  display: block;
  font-size: .8rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 5px;
}

.docst-form-group input,
.docst-form-group textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: .88rem;
  font-family: inherit;
  color: var(--text);
  background: #fafbfd;
  box-sizing: border-box;
  resize: vertical;
  transition: border-color .15s;
}

.docst-form-group input:focus,
.docst-form-group textarea:focus {
  outline: none;
  border-color: #1a56a0;
}

.docst-modal-actions {
  margin: 16px 0 10px;
}

.docst-modal-output {
  margin-top: 16px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}

.docst-draft-text {
  padding: 18px 20px;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 11pt;
  line-height: 1.4;
  color: #000;
  min-height: 200px;
  outline: none;
  white-space: pre-wrap;
}

.docst-draft-text:focus {
  background: #fafffe;
}

.docst-generating {
  padding: 24px 20px;
  text-align: center;
  color: var(--muted);
  font-size: .9rem;
  font-style: italic;
}

.docst-error {
  padding: 16px 20px;
  color: #dc2626;
  font-size: .88rem;
}

.docst-modal-export {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.docst-export-btn {
  background: #f1f5f9;
  color: var(--navy);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 16px;
  font-size: .84rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .12s;
}

.docst-export-btn:hover { background: #e2e8f0; }



/* ═══════════════════════════════════════════════════════════════════════
   DRAFT STUDIO v2 — Redesigned Layout (ds2- prefix)
   ═══════════════════════════════════════════════════════════════════════ */

/* Page wrapper */
.ds2-page {
  max-width: 900px;
  margin: 0 auto;
  padding: 32px 24px 64px;
  font-family: 'Inter', 'Segoe UI', Arial, sans-serif;
}

/* ── Page Header ─────────────────────────────────────────────────────── */
.ds2-page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}
.ds2-page-header-left { flex: 1; min-width: 280px; }
.ds2-page-title {
  font-size: 28px;
  font-weight: 700;
  color: #1a1a2e;
  margin: 0 0 6px;
  letter-spacing: -0.5px;
}
.ds2-page-sub {
  font-size: 14px;
  color: #666;
  line-height: 1.5;
  margin: 0;
}
.ds2-page-header-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  flex-shrink: 0;
}
.ds2-mechanism-block { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.ds2-mech-label { font-size: 11px; font-weight: 600; color: #888; text-transform: uppercase; letter-spacing: 0.5px; }
.ds2-mech-select {
  font-size: 13px;
  padding: 7px 12px;
  border: 1.5px solid #d0d5e8;
  border-radius: 8px;
  background: #fff;
  color: #1a1a2e;
  cursor: pointer;
  min-width: 220px;
}
.ds2-mech-select:focus { outline: none; border-color: #4a6cf7; }
.ds2-progress-pill {
  font-size: 12px;
  color: #4a6cf7;
  background: #eef1ff;
  padding: 5px 12px;
  border-radius: 20px;
  font-weight: 500;
}

/* ── Step Blocks ─────────────────────────────────────────────────────── */
.ds2-step-block {
  background: #fff;
  border: 1.5px solid #e8eaf6;
  border-radius: 14px;
  margin-bottom: 24px;
  overflow: hidden;
}
.ds2-step-label-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 22px;
  background: #f8f9ff;
  border-bottom: 1.5px solid #e8eaf6;
  flex-wrap: wrap;
}
.ds2-step-num {
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  background: #4a6cf7;
  padding: 3px 10px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  flex-shrink: 0;
}
.ds2-step-name {
  font-size: 15px;
  font-weight: 700;
  color: #1a1a2e;
  flex-shrink: 0;
}
.ds2-step-desc {
  font-size: 13px;
  color: #777;
  flex: 1;
  min-width: 200px;
}
.ds2-collapse-btn {
  background: none;
  border: none;
  font-size: 18px;
  color: #aaa;
  cursor: pointer;
  padding: 0 4px;
  margin-left: auto;
  flex-shrink: 0;
}
.ds2-collapse-btn:hover { color: #4a6cf7; }

/* Standalone step label (for section grid) */
.ds2-step-label-standalone {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

/* ── Import Body ─────────────────────────────────────────────────────── */
.ds2-import-body { padding: 22px; }
.ds2-import-row {
  display: flex;
  gap: 16px;
  align-items: stretch;
  margin-bottom: 16px;
}
.ds2-dropzone {
  flex: 0 0 240px;
  border: 2px dashed #c5cae9;
  border-radius: 10px;
  padding: 24px 16px;
  text-align: center;
  background: #fafbff;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}
.ds2-dropzone:hover { border-color: #4a6cf7; background: #f0f3ff; }
.ds2-dropzone-icon { font-size: 28px; margin-bottom: 8px; }
.ds2-dropzone-icon svg { width: 28px !important; height: 28px !important; }
.ds2-dropzone-text { font-size: 13px; color: #555; margin-bottom: 4px; }
.ds2-dropzone-link { color: #4a6cf7; cursor: pointer; text-decoration: underline; }
.ds2-dropzone-sub { font-size: 11px; color: #aaa; }
.ds2-import-divider {
  display: flex;
  align-items: center;
  flex-direction: column;
  justify-content: center;
  color: #bbb;
  font-size: 12px;
  font-weight: 600;
  padding: 0 4px;
}
.ds2-import-paste {
  flex: 1;
  min-height: 120px;
  padding: 12px;
  border: 1.5px solid #d0d5e8;
  border-radius: 10px;
  font-size: 13px;
  color: #333;
  resize: vertical;
  font-family: inherit;
}
.ds2-import-paste:focus { outline: none; border-color: #4a6cf7; }
.ds2-import-file-status { font-size: 12px; color: #4a6cf7; margin-bottom: 12px; min-height: 16px; }
.ds2-import-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.ds2-action-hint { font-size: 12px; color: #999; }
.ds2-import-progress {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  font-size: 13px;
  color: #4a6cf7;
}
.ds2-spinner {
  width: 18px; height: 18px;
  border: 2.5px solid #c5cae9;
  border-top-color: #4a6cf7;
  border-radius: 50%;
  animation: ds2spin 0.8s linear infinite;
  flex-shrink: 0;
}
@keyframes ds2spin { to { transform: rotate(360deg); } }

/* ── Title Body ──────────────────────────────────────────────────────── */
.ds2-title-body { padding: 22px; }
.ds2-title-input-wrap {
  position: relative;
  margin-bottom: 10px;
}
.ds2-title-input {
  width: 100%;
  padding: 12px 60px 12px 14px;
  font-size: 15px;
  font-weight: 500;
  border: 1.5px solid #d0d5e8;
  border-radius: 10px;
  color: #1a1a2e;
  font-family: inherit;
  box-sizing: border-box;
}
.ds2-title-input:focus { outline: none; border-color: #4a6cf7; }
.ds2-title-chars {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 11px;
  color: #aaa;
  pointer-events: none;
}
.ds2-title-chars.over { color: #e53935; }
.ds2-title-active-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  font-size: 13px;
}
.ds2-title-active-label { font-weight: 600; color: #555; }
.ds2-title-active-value { color: #4a6cf7; font-style: italic; }

/* ── Sections ────────────────────────────────────────────────────────── */
.ds2-sections {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 24px;
}
.ds2-section {
  background: #fff;
  border: 1.5px solid #e8eaf6;
  border-radius: 14px;
  overflow: hidden;
}
.ds2-section-approach { border-color: #ffe0b2; }
.ds2-section-head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 20px;
  background: #f8f9ff;
  border-bottom: 1.5px solid #e8eaf6;
}
.ds2-section-approach .ds2-section-head { background: #fff8f0; border-bottom-color: #ffe0b2; }
.ds2-section-badge {
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  background: #4a6cf7;
  padding: 3px 9px;
  border-radius: 6px;
  flex-shrink: 0;
  letter-spacing: 0.3px;
}
.ds2-badge-approach { background: #f57c00; }
.ds2-section-head-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}
.ds2-section-title { font-size: 14px; font-weight: 700; color: #1a1a2e; }
.ds2-section-meta { font-size: 12px; color: #888; }
.ds2-section-status {
  font-size: 11px;
  color: #bbb;
  flex-shrink: 0;
  font-style: italic;
}
.ds2-section-status.loaded { color: #43a047; font-style: normal; font-weight: 600; }

.ds2-approach-notice {
  background: #fff3e0;
  border-left: 4px solid #f57c00;
  padding: 10px 16px;
  font-size: 12px;
  color: #5d4037;
  line-height: 1.5;
}

.ds2-section-body { padding: 16px 20px; }
.ds2-upload-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.ds2-upload-btn {
  font-size: 12px;
  font-weight: 600;
  color: #4a6cf7;
  background: #eef1ff;
  border: 1.5px solid #c5cae9;
  border-radius: 7px;
  padding: 6px 14px;
  cursor: pointer;
  transition: background 0.15s;
  white-space: nowrap;
}
.ds2-upload-btn:hover { background: #dde3ff; }
.ds2-upload-or { font-size: 12px; color: #aaa; }
.ds2-section-textarea {
  width: 100%;
  min-height: 90px;
  padding: 10px 12px;
  border: 1.5px solid #d0d5e8;
  border-radius: 8px;
  font-size: 13px;
  color: #333;
  resize: vertical;
  font-family: inherit;
  box-sizing: border-box;
}
.ds2-section-textarea:focus { outline: none; border-color: #4a6cf7; }

.ds2-section-foot {
  padding: 12px 20px;
  border-top: 1px solid #f0f0f8;
  background: #fafbff;
}

/* ── Buttons ─────────────────────────────────────────────────────────── */
.ds2-btn-primary {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #4a6cf7 0%, #6a3de8 100%);
  border: none;
  border-radius: 9px;
  padding: 11px 22px;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.1s;
}
.ds2-btn-primary:hover { opacity: 0.92; transform: translateY(-1px); }
.ds2-btn-primary:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }

.ds2-btn-extract { font-size: 14px; }

.ds2-btn-secondary {
  font-size: 13px;
  font-weight: 600;
  color: #4a6cf7;
  background: #eef1ff;
  border: 1.5px solid #c5cae9;
  border-radius: 8px;
  padding: 9px 18px;
  cursor: pointer;
  transition: background 0.15s;
}
.ds2-btn-secondary:hover { background: #dde3ff; }

.ds2-btn-generate {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #4a6cf7 0%, #6a3de8 100%);
  border: none;
  border-radius: 8px;
  padding: 9px 20px;
  cursor: pointer;
  transition: opacity 0.2s;
  width: 100%;
}
.ds2-btn-generate:hover { opacity: 0.9; }
.ds2-btn-generate:disabled { opacity: 0.4; cursor: not-allowed; }

/* ── Generate All Bar ────────────────────────────────────────────────── */
.ds2-generate-all-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  background: #f8f9ff;
  border: 1.5px solid #e8eaf6;
  border-radius: 12px;
  padding: 16px 22px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.ds2-btn-generate-all {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #1565c0 0%, #4a6cf7 100%);
  border: none;
  border-radius: 9px;
  padding: 11px 22px;
  cursor: pointer;
  transition: opacity 0.2s;
  white-space: nowrap;
}
.ds2-btn-generate-all:hover { opacity: 0.9; }
.ds2-generate-all-hint { font-size: 12px; color: #888; }

/* ── Compile Block ───────────────────────────────────────────────────── */
.ds2-compile-block {
  background: #fff;
  border: 2px solid #4a6cf7;
  border-radius: 14px;
  padding: 24px;
}
.ds2-compile-header { margin-bottom: 18px; }
.ds2-compile-header-text {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}
.ds2-compile-title { font-size: 16px; font-weight: 700; color: #1a1a2e; }
.ds2-compile-sub { font-size: 13px; color: #666; line-height: 1.5; margin: 0; }
.ds2-btn-compile {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #4a6cf7 0%, #6a3de8 100%);
  border: none;
  border-radius: 10px;
  padding: 13px 28px;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.1s;
  width: 100%;
}
.ds2-btn-compile:hover { opacity: 0.92; transform: translateY(-1px); }
.ds2-btn-compile:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }

/* ── Result Areas ────────────────────────────────────────────────────── */
.ds2-result-area {
  padding: 0;
  margin-top: 0;
}
.ds2-result-area:not(:empty) { padding: 16px 20px; border-top: 1px solid #f0f0f8; }



/* ══════════════════════════════════════════════════════════════════════════════
   GUIDED BUILD MODE — DRAFT STUDIO
   ══════════════════════════════════════════════════════════════════════════════ */

/* Mode switcher */
.ds2-mode-switcher {
  display: flex;
  gap: 0;
  background: #f0f0f0;
  border-radius: 8px;
  padding: 3px;
  margin-bottom: 24px;
  width: fit-content;
}
.ds2-mode-btn {
  padding: 8px 20px;
  border: none;
  background: transparent;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  color: #555;
  cursor: pointer;
  transition: all 0.2s;
}
.ds2-mode-btn.active {
  background: #fff;
  color: #1a237e;
  font-weight: 700;
  box-shadow: 0 1px 4px rgba(0,0,0,0.12);
}

/* Guided Build panel */
#gb-panel { display: none; }
#gb-panel.active { display: block; }

/* Step cards */
.gb-step {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 10px;
  margin-bottom: 20px;
  overflow: hidden;
  transition: border-color 0.2s;
}
.gb-step.gb-step-locked { opacity: 0.6; pointer-events: none; }
.gb-step.gb-step-unlocked { opacity: 1; pointer-events: all; border-color: #3949ab; }
.gb-step.gb-step-accepted { border-color: #2e7d32; }

.gb-step-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  background: #f8f9ff;
  border-bottom: 1px solid #e8eaf6;
}
.gb-step-num {
  background: #3949ab;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
  white-space: nowrap;
}
.gb-step-accepted .gb-step-num { background: #2e7d32; }
.gb-step-title {
  font-size: 15px;
  font-weight: 700;
  color: #1a237e;
  flex: 1;
}
.gb-step-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 12px;
  background: #f5f5f5;
  color: #757575;
}
.gb-step-accepted .gb-step-badge { background: #e8f5e9; color: #2e7d32; }
.gb-step-unlocked .gb-step-badge { background: #e8eaf6; color: #3949ab; }

.gb-phase-badge {
  font-size: 10px;
  background: #fff3e0;
  color: #e65100;
  border: 1px solid #ffcc80;
  padding: 2px 7px;
  border-radius: 10px;
  margin-left: 8px;
  font-weight: 600;
}

.gb-step-body {
  padding: 18px 20px;
}
.gb-lock-msg {
  color: #9e9e9e;
  font-size: 13px;
  font-style: italic;
  margin: 0;
}
.gb-step-unlocked .gb-lock-msg,
.gb-step-accepted .gb-lock-msg { display: none; }

/* Overview inputs */
.gb-overview-fields { display: flex; flex-direction: column; gap: 14px; }
.gb-field-label {
  font-size: 13px;
  font-weight: 600;
  color: #424242;
  margin-bottom: 4px;
  display: block;
}
.gb-field-hint { font-size: 11px; color: #757575; margin-bottom: 6px; display: block; }
.gb-overview-textarea {
  width: 100%;
  min-height: 100px;
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 13px;
  font-family: Arial, sans-serif;
  resize: vertical;
  box-sizing: border-box;
}
.gb-grant-type-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.gb-grant-type-select {
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 13px;
  min-width: 200px;
}
.gb-char-counter {
  font-size: 11px;
  color: #9e9e9e;
  margin-top: 3px;
  display: block;
  text-align: right;
}
.gb-char-counter.over { color: #c62828; font-weight: 700; }

/* Title alternatives */
.gb-title-alts { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.gb-title-alt-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  background: #fafafa;
}
.gb-title-alt-label {
  font-size: 11px;
  font-weight: 700;
  color: #5c6bc0;
  min-width: 130px;
}
.gb-title-alt-text { flex: 1; font-size: 13px; color: #212121; }
.gb-title-alt-chars { font-size: 11px; color: #9e9e9e; }
.gb-title-use-btn {
  padding: 5px 12px;
  background: #3949ab;
  color: #fff;
  border: none;
  border-radius: 5px;
  font-size: 12px;
  cursor: pointer;
}
.gb-title-use-btn:hover { background: #283593; }

/* Version A/B display */
.gb-versions-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 14px;
}
@media (max-width: 900px) { .gb-versions-grid { grid-template-columns: 1fr; } }
.gb-version-card {
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  overflow: hidden;
}
.gb-version-card.selected { border-color: #2e7d32; }
.gb-version-card-header {
  padding: 10px 14px;
  background: #f5f5f5;
  font-size: 13px;
  font-weight: 700;
  color: #424242;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.gb-version-card.selected .gb-version-card-header { background: #e8f5e9; color: #2e7d32; }
.gb-version-desc { font-size: 11px; color: #757575; font-weight: 400; }
.gb-version-textarea {
  width: 100%;
  min-height: 220px;
  padding: 12px;
  border: none;
  border-top: 1px solid #e0e0e0;
  font-size: 12px;
  font-family: Arial, sans-serif;
  resize: vertical;
  box-sizing: border-box;
  background: #fff;
}
.gb-version-textarea-lg { min-height: 340px; }
.gb-btn-accept-a, .gb-btn-accept-b {
  display: block;
  width: 100%;
  padding: 10px;
  border: none;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s;
}
.gb-btn-accept-a { background: #e8eaf6; color: #3949ab; }
.gb-btn-accept-a:hover { background: #c5cae9; }
.gb-btn-accept-b { background: #e8eaf6; color: #3949ab; }
.gb-btn-accept-b:hover { background: #c5cae9; }

/* Generate button */
.gb-generate-btn {
  display: block;
  width: 100%;
  padding: 12px;
  background: linear-gradient(135deg, #3949ab, #5c35a0);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  margin-top: 14px;
  transition: opacity 0.2s;
}
.gb-generate-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.gb-generate-btn:hover:not(:disabled) { opacity: 0.9; }

/* Accept button */
.gb-btn-accept {
  display: block;
  width: 100%;
  padding: 11px;
  background: #2e7d32;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  margin-top: 12px;
}
.gb-btn-accept:hover { background: #1b5e20; }

/* Loading */
.gb-loading { display: flex; align-items: center; gap: 12px; padding: 16px 0; }
.gb-spinner {
  width: 22px; height: 22px;
  border: 3px solid #e0e0e0;
  border-top-color: #3949ab;
  border-radius: 50%;
  animation: gb-spin 0.8s linear infinite;
}
@keyframes gb-spin { to { transform: rotate(360deg); } }
.gb-loading-msg { font-size: 13px; color: #5c6bc0; }
.gb-error { color: #c62828; font-size: 13px; padding: 10px; background: #ffebee; border-radius: 6px; margin-top: 10px; }

/* Human subjects */
.gb-hs-intro { font-size: 13px; color: #424242; margin-bottom: 16px; line-height: 1.5; }
.gb-hs-questions { display: flex; flex-direction: column; gap: 16px; }
.gb-hs-q { display: flex; flex-direction: column; gap: 6px; }
.gb-hs-label { font-size: 13px; font-weight: 600; color: #424242; }
.gb-hs-textarea {
  width: 100%;
  min-height: 70px;
  padding: 9px 11px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 13px;
  font-family: Arial, sans-serif;
  resize: vertical;
  box-sizing: border-box;
}
.gb-hs-select {
  padding: 8px 11px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 13px;
  background: #fff;
  margin-bottom: 6px;
}
.gb-hs-sub-questions { margin-top: 8px; padding-left: 16px; border-left: 3px solid #e8eaf6; }
.gb-hs-toggle-btn {
  background: none;
  border: none;
  color: #3949ab;
  font-size: 12px;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
}

/* Biosketch upload */
.gb-bio-dropzone {
  border: 2px dashed #9fa8da;
  border-radius: 8px;
  padding: 24px;
  text-align: center;
  background: #f8f9ff;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}
.gb-bio-dropzone:hover, .gb-bio-drag-over { border-color: #3949ab; background: #e8eaf6; }
.gb-bio-drop-icon { font-size: 28px; margin-bottom: 8px; }
.gb-bio-drop-icon svg { width: 28px !important; height: 28px !important; }
.gb-bio-drop-text { font-size: 13px; color: #5c6bc0; }
.gb-bio-browse-btn {
  display: inline-block;
  margin-top: 10px;
  padding: 8px 18px;
  background: #3949ab;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
}
.gb-bio-role-checklist {
  display: flex;
  gap: 16px;
  margin: 14px 0;
  flex-wrap: wrap;
}
.gb-bio-role-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #424242;
}
.gb-bio-file-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  background: #fafafa;
  margin-bottom: 6px;
  flex-wrap: wrap;
}
.gb-bio-file-icon { font-size: 18px; }
.gb-bio-file-name { font-size: 13px; color: #212121; flex: 1; min-width: 120px; }
.gb-bio-role-select, .gb-bio-name-input {
  padding: 6px 10px;
  border: 1px solid #ddd;
  border-radius: 5px;
  font-size: 12px;
}
.gb-bio-name-input { min-width: 140px; }
.gb-bio-remove-btn {
  background: none;
  border: none;
  color: #c62828;
  font-size: 16px;
  cursor: pointer;
  padding: 0 4px;
}
.gb-bio-result-card {
  border-radius: 7px;
  padding: 12px 14px;
  margin-bottom: 10px;
  border-left: 4px solid #9e9e9e;
}
.gb-bio-status-pass { border-left-color: #2e7d32; background: #f1f8e9; }
.gb-bio-status-minor { border-left-color: #f57f17; background: #fffde7; }
.gb-bio-status-fail { border-left-color: #c62828; background: #ffebee; }
.gb-bio-status-error { border-left-color: #757575; background: #f5f5f5; }
.gb-bio-result-header { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.gb-bio-result-name { font-weight: 700; font-size: 14px; }
.gb-bio-result-role { font-size: 11px; background: #e8eaf6; color: #3949ab; padding: 2px 7px; border-radius: 10px; }
.gb-bio-result-status { font-size: 12px; font-weight: 700; margin-left: auto; }
.gb-bio-result-section { font-size: 12px; color: #424242; margin-top: 4px; }
.gb-bio-missing { color: #c62828; }
.gb-bio-strengths { color: #2e7d32; }
.gb-bio-missing-alert {
  background: #fff3e0;
  border: 1px solid #ffcc80;
  border-radius: 6px;
  padding: 10px 14px;
  font-size: 13px;
  color: #e65100;
  margin-bottom: 12px;
}

/* Compile layout */
.gb-compile-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 20px;
  margin-bottom: 20px;
}
@media (max-width: 1000px) { .gb-compile-layout { grid-template-columns: 1fr; } }
.gb-compile-doc-panel { display: flex; flex-direction: column; gap: 10px; }
.gb-compile-doc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: #f5f5f5;
  border-radius: 7px;
}
.gb-compile-doc-title { font-size: 14px; font-weight: 700; color: #1a237e; }
.gb-btn-download {
  padding: 7px 14px;
  background: #1a237e;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
}
.gb-btn-download:hover { background: #0d1b6e; }
.gb-compile-textarea {
  width: 100%;
  min-height: 500px;
  padding: 14px;
  border: 1px solid #ddd;
  border-radius: 7px;
  font-size: 12px;
  font-family: Arial, sans-serif;
  resize: vertical;
  box-sizing: border-box;
  line-height: 1.6;
}

/* Score panel */
.gb-score-panel {
  background: #f8f9ff;
  border: 1px solid #c5cae9;
  border-radius: 10px;
  padding: 16px;
  height: fit-content;
}
.gb-score-panel-header {
  font-size: 15px;
  font-weight: 700;
  color: #1a237e;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid #e8eaf6;
}
.gb-score-overall {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border-radius: 8px;
  margin-bottom: 12px;
  background: #fff;
  border: 2px solid #9fa8da;
}
.gb-score-exceptional { border-color: #1b5e20; background: #e8f5e9; }
.gb-score-excellent { border-color: #2e7d32; background: #f1f8e9; }
.gb-score-verygood { border-color: #558b2f; background: #f9fbe7; }
.gb-score-good { border-color: #f57f17; background: #fffde7; }
.gb-score-satisfactory { border-color: #e65100; background: #fff3e0; }
.gb-score-poor { border-color: #c62828; background: #ffebee; }
.gb-score-overall-label { font-size: 12px; font-weight: 700; color: #424242; flex: 1; }
.gb-score-overall-num { font-size: 28px; font-weight: 900; color: #1a237e; }
.gb-score-overall-desc { font-size: 12px; font-weight: 600; color: #424242; }
.gb-score-rationale { font-size: 12px; color: #424242; line-height: 1.5; margin-bottom: 14px; }
.gb-score-criteria { display: flex; flex-direction: column; gap: 10px; }
.gb-score-criterion {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 7px;
  padding: 10px 12px;
}
.gb-score-crit-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.gb-score-crit-name { font-size: 13px; font-weight: 700; color: #212121; }
.gb-score-crit-num {
  font-size: 16px;
  font-weight: 900;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #e8eaf6;
  color: #3949ab;
}
.gb-score-strengths { font-size: 11px; color: #2e7d32; margin-bottom: 3px; }
.gb-score-weaknesses { font-size: 11px; color: #c62828; margin-bottom: 3px; }
.gb-score-suggestions { font-size: 11px; color: #e65100; }
.gb-score-top-concerns, .gb-score-top-strengths {
  margin-top: 12px;
  font-size: 12px;
  padding: 10px;
  border-radius: 6px;
}
.gb-score-top-concerns { background: #ffebee; color: #c62828; }
.gb-score-top-strengths { background: #e8f5e9; color: #2e7d32; }
.gb-score-top-concerns ul, .gb-score-top-strengths ul { margin: 4px 0 0 16px; padding: 0; }
.gb-score-unavail { font-size: 13px; color: #757575; font-style: italic; }

/* Ancillary checklist */
.gb-checklist-panel {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 10px;
  padding: 18px 20px;
  margin-top: 20px;
}
.gb-checklist-header {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid #e8eaf6;
}
.gb-checklist-title { font-size: 16px; font-weight: 700; color: #1a237e; }
.gb-checklist-subtitle { font-size: 12px; color: #757575; }
.gb-checklist-category { margin-bottom: 18px; }
.gb-checklist-cat-header {
  font-size: 12px;
  font-weight: 700;
  color: #5c6bc0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
  padding-bottom: 4px;
  border-bottom: 1px solid #e8eaf6;
}
.gb-checklist-items { display: flex; flex-direction: column; gap: 6px; }
.gb-checklist-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 6px;
  background: #fafafa;
  border: 1px solid #f0f0f0;
}
.gb-checklist-required { border-left: 3px solid #3949ab; }
.gb-checklist-optional { border-left: 3px solid #bdbdbd; }
.gb-checklist-check { margin-top: 2px; flex-shrink: 0; }
.gb-checklist-item-body { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; flex: 1; }
.gb-checklist-item-name { font-size: 13px; color: #212121; font-weight: 500; flex: 1; min-width: 180px; }
.gb-checklist-item-limit { font-size: 11px; color: #757575; }
.gb-checklist-req-badge {
  font-size: 10px;
  background: #e8eaf6;
  color: #3949ab;
  padding: 2px 7px;
  border-radius: 10px;
  font-weight: 700;
}
.gb-checklist-opt-badge {
  font-size: 10px;
  background: #f5f5f5;
  color: #9e9e9e;
  padding: 2px 7px;
  border-radius: 10px;
}
.gb-checklist-studio-btn {
  font-size: 11px;
  background: none;
  border: 1px solid #3949ab;
  color: #3949ab;
  padding: 3px 9px;
  border-radius: 5px;
  cursor: pointer;
  white-space: nowrap;
}
.gb-checklist-studio-btn:hover { background: #e8eaf6; }

/* Refs list */
#gb-comm-refs-list {
  margin-top: 12px;
  padding: 12px;
  background: #f5f5f5;
  border-radius: 6px;
  font-size: 12px;
  color: #424242;
}

/* ── Tab subtitles (Wave 1 Fix 6) ─────────────────────────────── */
.header-tab .tab-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1.2;
  text-align: center;
}
.header-tab .tab-sub {
  font-size: .58rem;
  font-weight: 400;
  color: rgba(255,255,255,0.50);
  letter-spacing: 0;
  margin-top: 1px;
  white-space: nowrap;
}
.header-tab.active .tab-sub {
  color: rgba(255,255,255,0.72);
}


/* ── Onboarding modal (Wave 2 Fix 7) ─────────────────────────── */
.ob-choice {
  display: flex; flex-direction: column; align-items: flex-start;
  padding: 16px 18px; border: 2px solid #d0d7e3; border-radius: 12px;
  background: #fafbfd; cursor: pointer; text-align: left;
  font-family: inherit; transition: border-color .15s, background .15s;
}
.ob-choice:hover { border-color: #1a56a0; background: #eef3fb; }
.ob-choice.selected { border-color: #1a56a0; background: #eef3fb; }
.ob-choice strong { font-size: .9rem; font-weight: 700; color: #0d2b55; margin-bottom: 3px; display: block; }
.ob-choice span { font-size: .78rem; color: #5a6a7e; line-height: 1.4; }
.ob-action-btn {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 18px; border: 2px solid #d0d7e3; border-radius: 12px;
  background: #fafbfd; cursor: pointer; text-align: left; width: 100%;
  font-family: inherit; transition: border-color .15s, background .15s;
}
.ob-action-btn:hover { border-color: #1a56a0; background: #eef3fb; }
.ob-action-btn .ob-ab-text strong { font-size: .92rem; font-weight: 700; color: #0d2b55; display: block; margin-bottom: 2px; }
.ob-action-btn .ob-ab-text span { font-size: .78rem; color: #5a6a7e; }

/* ── Preliminary Data section ────────────────────────────────── */
.ds2-section-prelim { border-left: 4px solid #f59e0b; }
.ds2-badge-prelim { background: #f59e0b !important; color: #fff !important; }

.ds2-prelim-notice {
  display: flex; align-items: flex-start; gap: 6px;
  background: #fffbeb; border: 1px solid #fcd34d; border-radius: 8px;
  padding: 10px 14px; margin: 0 20px 0 20px; font-size: .8rem;
  color: #78350f; line-height: 1.5;
}
.ds2-prelim-notice svg { margin-top: 1px; color: #d97706; }

.ds-prelim-file-list {
  margin-top: 12px; display: flex; flex-direction: column; gap: 8px;
}
.ds-prelim-empty { font-size: .82rem; color: #94a3b8; font-style: italic; margin: 0; }

.ds-prelim-item {
  display: flex; align-items: center; gap: 10px;
  background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 8px;
  padding: 8px 12px;
}
.ds-prelim-item-error { background: #fff5f5; border-color: #fca5a5; color: #b91c1c; font-size: .8rem; }

.ds-prelim-thumb {
  width: 64px; height: 48px; object-fit: cover; border-radius: 4px;
  border: 1px solid #e2e8f0; flex-shrink: 0;
}
.ds-prelim-doc-icon {
  width: 40px; height: 40px; display: flex; align-items: center; justify-content: center;
  font-size: 22px; flex-shrink: 0;
}
.ds-prelim-item-meta { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.ds-prelim-fname { font-size: .8rem; font-weight: 600; color: #1e293b; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ds-prelim-chars { font-size: .75rem; color: #64748b; }
.ds-prelim-desc {
  font-size: .78rem; padding: 4px 8px; border: 1px solid #cbd5e1; border-radius: 5px;
  font-family: inherit; color: #334155; background: #fff; width: 100%;
}
.ds-prelim-desc:focus { outline: none; border-color: #4a6cf7; }
.ds-prelim-remove {
  background: none; border: none; cursor: pointer; color: #94a3b8; font-size: 14px;
  padding: 2px 4px; border-radius: 4px; flex-shrink: 0;
}
.ds-prelim-remove:hover { color: #ef4444; background: #fee2e2; }

/* ── Fast Track guidance banner ──────────────────────────────── */
.ds2-ft-guidance {
  display: flex; gap: 12px; align-items: flex-start;
  background: #eff6ff; border: 1px solid #bfdbfe; border-radius: 10px;
  padding: 14px 18px; margin-bottom: 12px; font-size: .82rem; color: #1e3a5f;
  line-height: 1.6;
}
.ds2-ft-guidance-icon { font-size: 18px; flex-shrink: 0; margin-top: 1px; }
.ds2-ft-guidance-body strong { display: block; margin-bottom: 6px; font-size: .85rem; }
.ds2-ft-guidance-body ul { margin: 0; padding-left: 18px; }
.ds2-ft-guidance-body li { margin-bottom: 3px; }
