/* ═══════════════════════════════════════════════════
   OmicsLab — Grant Text Generator styles (Prompt 9)
   ═══════════════════════════════════════════════════ */

.grant-wrap {
  max-width: 960px;
  margin: 0 auto;
  padding: 2rem 1.25rem 4rem;
  color: #e6edf3;
}

/* ─── Header ─── */
.grant-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}
.grant-badge {
  display: inline-block;
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .12em;
  color: #e3b341;
  background: rgba(227,179,65,.1);
  border: 1px solid rgba(227,179,65,.25);
  border-radius: 4px;
  padding: .2rem .55rem;
  margin-bottom: .5rem;
}
.grant-title {
  font-size: 1.8rem;
  font-weight: 700;
  color: #e6edf3;
  margin: 0 0 .35rem;
}
.grant-subtitle {
  font-size: .875rem;
  color: #8b949e;
  max-width: 600px;
  line-height: 1.5;
}
.grant-funders {
  display: flex;
  flex-direction: column;
  gap: .35rem;
  flex-shrink: 0;
}
.grant-funder-tag {
  font-size: .7rem;
  font-weight: 600;
  color: #8b949e;
  background: #161b22;
  border: 1px solid #30363d;
  border-radius: 4px;
  padding: .2rem .55rem;
  white-space: nowrap;
  text-align: center;
}

/* ─── Form grid ─── */
.grant-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}
@media (max-width: 700px) { .grant-form-grid { grid-template-columns: 1fr; } }

/* ─── Cards ─── */
.grant-card {
  background: #161b22;
  border: 1px solid #30363d;
  border-radius: 12px;
  padding: 1.25rem;
}
.grant-card-title {
  font-size: .875rem;
  font-weight: 700;
  color: #e6edf3;
  margin-bottom: 1rem;
  padding-bottom: .6rem;
  border-bottom: 1px solid #21262d;
}

/* ─── Fields ─── */
.grant-field { flex: 1; display: flex; flex-direction: column; gap: .35rem; }
.grant-field-row { display: flex; gap: .75rem; margin-bottom: .65rem; }
.grant-field + .grant-field { margin-top: 0; }
.grant-card > .grant-field { margin-bottom: .65rem; }

.grant-label {
  font-size: .72rem;
  font-weight: 600;
  color: #8b949e;
  text-transform: uppercase;
  letter-spacing: .08em;
}
.grant-input {
  background: #0d1117;
  border: 1px solid #30363d;
  border-radius: 6px;
  color: #e6edf3;
  font-size: .85rem;
  padding: .5rem .7rem;
  width: 100%;
  box-sizing: border-box;
  transition: border-color .2s;
  font-family: inherit;
}
.grant-input:focus { outline: none; border-color: #e3b341; }
select.grant-input { cursor: pointer; }

/* ─── Section checkboxes ─── */
.grant-sections-grid {
  display: flex;
  flex-direction: column;
  gap: .5rem;
  margin-bottom: 1rem;
}
.grant-sec-check {
  display: flex;
  align-items: flex-start;
  gap: .65rem;
  cursor: pointer;
  padding: .5rem .6rem;
  border-radius: 7px;
  border: 1px solid #21262d;
  background: #0d1117;
  transition: border-color .18s, background .18s;
}
.grant-sec-check:hover { border-color: #e3b341; background: rgba(227,179,65,.04); }
.grant-sec-check input[type=checkbox] {
  flex-shrink: 0;
  width: 15px;
  height: 15px;
  margin-top: 2px;
  accent-color: #e3b341;
  cursor: pointer;
}
.grant-sec-body { display: flex; flex-direction: column; gap: .15rem; }
.grant-sec-label { font-size: .82rem; font-weight: 600; color: #e6edf3; }
.grant-sec-desc  { font-size: .72rem; color: #8b949e; }

/* ─── Actions ─── */
.grant-actions {
  display: flex;
  gap: .65rem;
  flex-wrap: wrap;
  margin-top: .5rem;
}
.grant-autofill-btn {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  background: #21262d;
  border: 1px solid #30363d;
  border-radius: 7px;
  color: #e6edf3;
  font-size: .8rem;
  font-weight: 600;
  padding: .55rem .9rem;
  cursor: pointer;
  transition: background .2s, border-color .2s;
  font-family: inherit;
}
.grant-autofill-btn:hover { background: #30363d; }
.grant-generate-btn {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  background: linear-gradient(135deg, #c99a00, #e3b341);
  border: none;
  border-radius: 7px;
  color: #0d1117;
  font-size: .85rem;
  font-weight: 700;
  padding: .6rem 1.2rem;
  cursor: pointer;
  transition: opacity .2s, transform .15s;
  font-family: inherit;
  flex: 1;
  justify-content: center;
}
.grant-generate-btn:hover { opacity: .88; transform: translateY(-1px); }

/* ─── Output panel ─── */
.grant-output-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: .75rem;
  gap: 1rem;
}
.grant-output-label {
  font-size: .875rem;
  font-weight: 700;
  color: #e6edf3;
}
.grant-output-actions { display: flex; gap: .5rem; }
.grant-out-btn {
  background: #21262d;
  border: 1px solid #30363d;
  border-radius: 6px;
  color: #e6edf3;
  font-size: .78rem;
  font-weight: 600;
  padding: .4rem .8rem;
  cursor: pointer;
  transition: background .2s;
  font-family: inherit;
}
.grant-out-btn:hover { background: #30363d; }
.grant-output {
  background: #0d1117;
  border: 1px solid #30363d;
  border-radius: 10px;
  color: #c9d1d9;
  font-family: 'JetBrains Mono', 'Courier New', monospace;
  font-size: .75rem;
  line-height: 1.65;
  padding: 1.25rem;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 600px;
  overflow-y: auto;
  tab-size: 2;
}
.grant-disclaimer {
  display:flex;align-items:flex-start;gap:.5rem;
  font-size: .75rem;
  color: #6e7681;
  background: rgba(249,115,22,.07);
  border: 1px solid rgba(249,115,22,.18);
  border-radius: 6px;
  padding: .6rem .9rem;
  margin-top: .75rem;
  line-height: 1.5;
}
.grant-disclaimer svg { flex-shrink:0;margin-top:.1rem;color:rgba(249,115,22,.7); }

/* ─── Tips ─── */
.grant-tips {
  margin-top: 2rem;
  background: #161b22;
  border: 1px solid #30363d;
  border-radius: 12px;
  padding: 1.5rem;
}
.grant-tips-title {
  font-size: .95rem;
  font-weight: 700;
  color: #e6edf3;
  margin-bottom: 1rem;
}
.grant-tips-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: .85rem;
}
.grant-tip {
  display: flex;
  gap: .75rem;
  align-items: flex-start;
  background: #0d1117;
  border: 1px solid #21262d;
  border-radius: 8px;
  padding: .85rem;
}
.grant-tip-icon { display:flex;align-items:center;flex-shrink:0;color:var(--text-muted,#8b949e); }
.grant-tip-text { font-size: .8rem; color: #8b949e; line-height: 1.5; }
.grant-tip-text strong { color: #e6edf3; }

/* ── AI Polish button ── */
.grant-ai-polish-btn { background: rgba(88,166,255,.08) !important; color: #58a6ff !important; border-color: rgba(88,166,255,.2) !important; }
.grant-ai-polish-btn:hover { background: rgba(88,166,255,.18) !important; }

/* ── Grants database ── */
.grant-db-wrap { margin-top: 2.5rem; }
.grant-db-hdr { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; margin-bottom: 1rem; flex-wrap: wrap; }
.grant-db-title { font-size: 1rem; font-weight: 700; color: #e6edf3; }
.grant-db-sub { font-size: .75rem; color: #8b949e; margin-top: .15rem; }
.grant-db-controls { display: flex; gap: .5rem; flex-wrap: wrap; }
.grant-db-search { padding: .38rem .7rem; background: #161b22; border: 1px solid #30363d; border-radius: 6px; color: #c9d1d9; font-size: .8rem; font-family: inherit; outline: none; width: 220px; transition: border-color .15s; }
.grant-db-search:focus { border-color: #58a6ff; }
.grant-db-filter { padding: .38rem .6rem; background: #161b22; border: 1px solid #30363d; border-radius: 6px; color: #c9d1d9; font-size: .8rem; font-family: inherit; outline: none; cursor: pointer; }
.grant-db-list { display: grid; grid-template-columns: repeat(auto-fill,minmax(340px,1fr)); gap: .75rem; }
.grant-db-empty { color: #484f58; font-size: .82rem; padding: 1rem; }
.grant-db-card { background: #161b22; border: 1px solid #21262d; border-radius: 8px; padding: .9rem; display: flex; flex-direction: column; gap: .45rem; transition: border-color .15s; }
.grant-db-card:hover { border-color: #30363d; }
.grant-db-card-hdr { display: flex; justify-content: space-between; align-items: flex-start; gap: .5rem; }
.grant-db-funder { font-size: .68rem; color: #8b949e; text-transform: uppercase; letter-spacing: .04em; }
.grant-db-name { font-size: .85rem; font-weight: 700; color: #e6edf3; line-height: 1.3; margin-top: .15rem; }
.grant-db-type-badge { padding: .15rem .45rem; border: 1px solid; border-radius: 20px; font-size: .65rem; font-weight: 600; flex-shrink: 0; }
.grant-db-meta { display: flex; gap: .75rem; font-size: .72rem; flex-wrap: wrap; }
.grant-db-amount { color: #3fb950; font-weight: 600; }
.grant-db-regions { color: #484f58; }
.grant-db-focus { font-size: .75rem; color: #8b949e; line-height: 1.45; }
.grant-db-footer { display: flex; justify-content: space-between; align-items: center; margin-top: .1rem; }
.grant-db-deadline { font-size: .7rem; color: #484f58; }
.grant-db-link { font-size: .72rem; color: #58a6ff; text-decoration: none; }
.grant-db-link:hover { text-decoration: underline; }
