:root {
  --ftn-green: #1B4332;
  --ftn-green-lt: #40916C;
  --ftn-green-pale: #D8EDE0;
  --ftn-gold: #C4922A;
  --ftn-gold-lt: #E8C97A;
  --ftn-cream: #F6F2EB;
  --ftn-cream-dk: #EDE8DF;
  --ftn-ink: #1A1814;
  --ftn-ink2: #3D3A34;
  --ftn-ink3: #7A7670;
  --ftn-ink4: #B8B4AC;
  --border-c: rgba(0,0,0,0.1);
  --display: 'Cormorant Garamond', Georgia, serif;
  --sans: 'Archivo', -apple-system, sans-serif;
  --narrow: 'Archivo Narrow', sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body { margin: 0; background: var(--ftn-cream-dk); font-family: var(--sans); color: var(--ftn-ink); }
/* Chat-agent pages (jd/screening/culture/mdm/pipeline) use #app as a
   full-viewport shell with its own internal scroll region — html/body
   themselves should never scroll there, so THAT specific case opts into
   overflow:hidden explicitly via body.app-shell, applied by those pages.
   Plain content pages (home, admin, clients, login) are normal documents
   and must scroll the ordinary way — body was previously overflow:hidden
   globally, which silently clipped anything below one viewport's height on
   every non-chat page (e.g. the home page's agent tiles wrapping past the
   fold became completely unreachable once a 7th tile was added, with no
   visible error — just a page that "wouldn't scroll at all").
*/
body.app-shell { overflow: hidden; }
#app {
  background: var(--ftn-cream);
  display: flex; flex-direction: column; height: 100vh; height: 100dvh;
}
/* Pages that use the narrow chat-widget look (none currently) can opt back in
   with .app-boxed on #app. Agent/admin pages use the full-viewport layout above. */
#app.app-boxed {
  max-width: 760px; margin: 32px auto; border: 1px solid var(--border-c);
  border-radius: 4px; overflow: hidden; height: 82vh; min-height: 560px;
}
.ftn-header {
  background: var(--ftn-green); padding: 14px 20px; display: flex; align-items: center;
  justify-content: space-between; gap: 12px; flex-shrink: 0;
}
.ftn-mark { font-family: var(--display); font-size: 20px; font-weight: 700; color: #fff; }
.ftn-mark .t { font-style: italic; font-weight: 300; color: var(--ftn-green-lt); }
.ftn-mark .subtitle { font-family: var(--narrow); font-size: 11px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: rgba(255,255,255,0.4); margin-left: 8px; }
.ftn-header-right { display: flex; gap: 10px; align-items: center; }
.client-select {
  font-family: var(--narrow); font-size: 12px; font-weight: 600; background: rgba(255,255,255,0.08);
  color: #fff; border: 1px solid rgba(255,255,255,0.2); border-radius: 3px; padding: 6px 10px; max-width: 160px;
}
.client-select option { color: var(--ftn-ink); }
.ghost-btn {
  font-family: var(--narrow); font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  background: transparent; color: var(--ftn-gold-lt); border: 1px solid rgba(196,146,42,0.5);
  border-radius: 3px; padding: 6px 12px; cursor: pointer; white-space: nowrap;
}
.ghost-btn:hover { background: rgba(196,146,42,0.12); }
.text-btn {
  font-family: var(--narrow); font-size: 11px; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase;
  background: none; border: none; color: var(--ftn-ink3); cursor: pointer; text-decoration: underline; margin-left: 14px;
}
main { flex: 1; overflow: hidden; display: flex; flex-direction: column; min-height: 0; }
/* Non-chat pages (admin, clients, home) scroll their own content instead of
   locking to the viewport like the chat agent layouts do. */
main.page-scroll { overflow-y: auto; display: block; }

.empty-view { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 20px; gap: 6px; }
.empty-title { font-family: var(--display); font-size: 20px; font-weight: 700; color: var(--ftn-green); }
.empty-body { font-size: 12px; color: var(--ftn-ink3); max-width: 320px; line-height: 1.5; }

.onboard-view { padding: 24px 28px; overflow-y: auto; }
.onboard-title { font-family: var(--display); font-size: 24px; font-weight: 700; color: var(--ftn-green); margin: 0 0 4px 0; }
.onboard-sub { font-size: 12px; color: var(--ftn-ink3); margin-bottom: 20px; line-height: 1.6; }
.field { margin-bottom: 16px; }
.field label { display: block; font-family: var(--narrow); font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ftn-ink); margin-bottom: 4px; }
.field .hint { display: block; font-size: 11px; color: var(--ftn-ink4); margin-bottom: 6px; }
.field input[type="text"], .field textarea {
  width: 100%; font-family: var(--sans); font-size: 13px; border: 1px solid var(--border-c);
  border-radius: 3px; padding: 8px 10px; background: #fff; margin-bottom: 6px;
}
.field input[type="file"] { font-size: 12px; margin-bottom: 6px; }
.field-section { border: 1px solid var(--border-c); border-radius: 3px; margin-bottom: 12px; padding: 0; }
.field-section summary { cursor: pointer; padding: 10px 14px; font-family: var(--narrow); font-size: 12px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ftn-ink2); background: var(--ftn-cream-dk); border-radius: 3px; }
.field-section[open] summary { border-bottom: 1px solid var(--border-c); border-radius: 3px 3px 0 0; }
.field-section > .field, .field-section > .field-row { padding: 12px 14px 0 14px; }
.field-section > .field-row.checkbox-row:last-of-type, .field-section > .field:last-of-type { padding-bottom: 12px; }
.checkbox-row { display: flex; gap: 20px; align-items: center; padding-bottom: 12px; }
.checkbox-row label { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 400; text-transform: none; letter-spacing: normal; color: var(--ftn-ink2); }
.checkbox-row input[type="checkbox"] { width: auto; margin: 0; }
.actions { display: flex; gap: 10px; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border-c); }
.btn-primary {
  font-family: var(--narrow); font-size: 12px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase;
  background: var(--ftn-green); color: #fff; border: none; border-radius: 3px; padding: 10px 18px; cursor: pointer;
}
.btn-secondary {
  font-family: var(--narrow); font-size: 12px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase;
  background: transparent; color: var(--ftn-ink3); border: 1px solid var(--border-c); border-radius: 3px; padding: 10px 18px; cursor: pointer;
}
.err-note { font-size: 12px; color: #B94040; margin-bottom: 12px; }

.chat-view { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.chat-subheader {
  padding: 8px 20px; background: var(--ftn-cream-dk); border-bottom: 1px solid var(--border-c);
  font-family: var(--narrow); font-size: 11px; font-weight: 600; color: var(--ftn-ink3); display: flex; justify-content: space-between; flex-shrink: 0;
}
.messages { flex: 1; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.msg-row { display: flex; flex-direction: column; max-width: 84%; }
.msg-row.user { align-self: flex-end; align-items: flex-end; }
.msg-row.assistant { align-self: flex-start; align-items: flex-start; }
.msg-label { font-family: var(--narrow); font-size: 10px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ftn-ink4); margin-bottom: 4px; }
.msg-bubble { padding: 12px 15px; border-radius: 4px; font-size: 13.5px; line-height: 1.65; }
.msg-row.user .msg-bubble { background: var(--ftn-green); color: #fff; white-space: pre-wrap; }
.msg-row.assistant .msg-bubble { background: #fff; border: 1px solid var(--border-c); border-left: 3px solid var(--ftn-gold); }
.thinking { font-family: var(--narrow); font-size: 11px; color: var(--ftn-ink4); padding: 0 16px; }
.input-area { display: flex; gap: 10px; padding: 14px 16px; border-top: 1px solid var(--border-c); background: #fff; flex-shrink: 0; }
.input-area textarea { flex: 1; font-family: var(--sans); font-size: 13.5px; border: 1px solid var(--border-c); border-radius: 4px; padding: 10px 12px; resize: none; min-height: 40px; max-height: 100px; }
.send-btn {
  font-family: var(--narrow); font-size: 12px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase;
  background: var(--ftn-green); color: #fff; border: none; border-radius: 4px; padding: 0 20px; cursor: pointer;
}
/* collapsible sidebar */
.agent-layout { display: flex; flex: 1; overflow: hidden; min-height: 0; }
.agent-main { flex: 1; display: flex; flex-direction: column; overflow: hidden; min-width: 0; min-height: 0; }
.sidebar {
  width: 240px; flex-shrink: 0; border-left: 1px solid var(--border-c);
  background: var(--ftn-cream-dk); display: flex; flex-direction: column;
  transition: width 0.2s ease, opacity 0.2s ease; overflow-y: auto; min-height: 0;
}
.sidebar.collapsed { width: 0; opacity: 0; border-left: none; }
.sidebar-inner { padding: 16px; width: 240px; }
.sidebar-title { font-family: var(--narrow); font-size: 10px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ftn-ink4); margin: 0 0 12px 0; }
.sidebar-section { margin-bottom: 16px; }
.sidebar-section-label { font-family: var(--narrow); font-size: 10px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ftn-gold); margin-bottom: 6px; }
.sidebar-item { font-size: 11.5px; color: var(--ftn-ink2); line-height: 1.5; margin-bottom: 4px; }
.sidebar-item b { color: var(--ftn-ink); font-weight: 600; }
.sidebar-item.ok::before { content: '✓ '; color: var(--ftn-green-lt); }
.sidebar-item.missing::before { content: '○ '; color: var(--ftn-ink4); }
.sidebar-jd-list { margin-top: 6px; display: flex; flex-direction: column; gap: 3px; }
.sidebar-jd-item {
  font-size: 11.5px; color: var(--ftn-ink2); line-height: 1.5; padding: 3px 8px;
  background: #fff; border: 1px solid var(--border-c); border-radius: 3px;
}
.sidebar-toggle {
  background: none; border: none; cursor: pointer; padding: 6px 8px;
  color: var(--ftn-ink3); font-size: 14px; line-height: 1; flex-shrink: 0;
}
.sidebar-toggle:hover { color: var(--ftn-ink); }

/* document preview panel */
.preview-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.45); z-index: 100;
  display: flex; align-items: center; justify-content: center;
}
.preview-panel {
  background: #fff; border-radius: 6px; width: 680px; max-width: 95vw;
  max-height: 88vh; display: flex; flex-direction: column;
  box-shadow: 0 24px 64px rgba(0,0,0,0.18);
}
.preview-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px; border-bottom: 1px solid var(--border-c); flex-shrink: 0;
}
.preview-header-title { font-family: var(--display); font-size: 17px; font-weight: 700; color: var(--ftn-green); }
.preview-header-actions { display: flex; gap: 10px; align-items: center; }
.preview-close { background: none; border: none; font-size: 18px; cursor: pointer; color: var(--ftn-ink3); line-height: 1; padding: 2px 6px; }
.preview-close:hover { color: var(--ftn-ink); }
.preview-body { flex: 1; overflow-y: auto; padding: 24px 28px; font-size: 13.5px; line-height: 1.7; color: var(--ftn-ink); }
.preview-body h1 { font-family: var(--display); font-size: 22px; font-weight: 700; color: var(--ftn-green); margin: 0 0 8px 0; }
.preview-body h2 { font-family: var(--display); font-size: 16px; font-weight: 700; color: var(--ftn-green); margin: 18px 0 6px 0; }
.preview-body h3 { font-family: var(--display); font-size: 14px; font-weight: 700; color: var(--ftn-green); margin: 14px 0 4px 0; }
.preview-body p { margin: 0 0 8px 0; }
.preview-body ul { margin: 4px 0 10px 20px; }
.preview-body li { margin-bottom: 4px; }
.preview-body strong { color: var(--ftn-green); }
.preview-body .preview-section { border-top: 1px solid var(--border-c); padding-top: 14px; margin-top: 14px; }
.preview-body .candidate-card { background: var(--ftn-cream); border: 1px solid var(--border-c); border-left: 3px solid var(--ftn-gold); border-radius: 3px; padding: 12px 14px; margin-bottom: 10px; }
.preview-body .candidate-name { font-family: var(--narrow); font-size: 13px; font-weight: 700; color: var(--ftn-green); margin-bottom: 4px; }

/* file-link updated to show preview */
.msg-bubble .file-link {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; padding: 8px 12px;
  background: var(--ftn-cream); border: 1px solid var(--ftn-gold); border-radius: 3px;
  font-family: var(--narrow); font-size: 12px; font-weight: 700; letter-spacing: 0.03em;
  color: var(--ftn-green); text-decoration: none; cursor: pointer;
}
.msg-bubble .file-link:hover { background: var(--ftn-green-pale); }
.msg-bubble p { margin: 0 0 8px 0; }
.msg-bubble p:last-child { margin-bottom: 0; }
.msg-bubble h2, .msg-bubble h3, .msg-bubble h4 { font-family: var(--display); color: var(--ftn-green); margin: 12px 0 6px 0; line-height: 1.25; }
.msg-bubble h2:first-child, .msg-bubble h3:first-child, .msg-bubble h4:first-child { margin-top: 0; }
.msg-bubble h2 { font-size: 19px; } .msg-bubble h3 { font-size: 16px; } .msg-bubble h4 { font-size: 14px; }
.msg-bubble ul { margin: 4px 0 10px 18px; padding: 0; }
.msg-bubble li { margin-bottom: 5px; line-height: 1.55; }
.msg-bubble strong { color: var(--ftn-green); }
.msg-bubble .md-table { width: 100%; border-collapse: collapse; margin: 8px 0 12px; font-size: 12.5px; }
.msg-bubble .md-table th, .msg-bubble .md-table td { padding: 8px 10px; border: 1px solid var(--border-c); text-align: left; vertical-align: top; }
.msg-bubble .md-table th { background: var(--ftn-cream-dk); font-family: var(--narrow); font-weight: 700; font-size: 11px; letter-spacing: 0.03em; text-transform: uppercase; color: var(--ftn-ink2); }
.msg-bubble .md-table tr:nth-child(even) td { background: var(--ftn-cream); }
.send-btn:disabled { background: var(--ftn-ink4); }

/* pending profile update confirmation cards */
.pending-update {
  align-self: flex-start; max-width: 84%; background: var(--ftn-cream);
  border: 1px solid var(--ftn-gold); border-radius: 4px; padding: 12px 15px;
}
.pending-update-head { font-family: var(--narrow); font-size: 12px; font-weight: 700; letter-spacing: 0.03em; color: var(--ftn-green); margin-bottom: 6px; }
.pending-update-body { font-size: 12.5px; color: var(--ftn-ink2); line-height: 1.55; margin-bottom: 10px; white-space: pre-wrap; }
.pending-update-actions { display: flex; gap: 8px; }

/* hero band (home page) */
.hero-band {
  background: var(--ftn-green); position: relative; overflow: hidden;
  padding: 72px 24px 56px; text-align: center;
}
.hero-grid {
  position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 48px 48px;
}
.hero-circles { position: absolute; top: -260px; left: 50%; transform: translateX(-50%); pointer-events: none; }
.hero-circles circle { fill: none; stroke: rgba(255,255,255,0.05); stroke-width: 1; }
.hero-inner { position: relative; z-index: 1; max-width: 620px; margin: 0 auto; }
.hero-mark { font-family: var(--display); font-size: 22px; font-weight: 700; color: rgba(255,255,255,0.5); margin-bottom: 20px; letter-spacing: -0.01em; }
.hero-mark .t { font-style: italic; font-weight: 300; color: var(--ftn-green-lt); }
.hero-title { font-family: var(--display); font-size: clamp(34px, 5.5vw, 54px); font-weight: 700; color: #fff; line-height: 1.08; letter-spacing: -0.02em; margin-bottom: 20px; }
.hero-title em { font-style: italic; color: var(--ftn-gold-lt); font-weight: 400; }
.hero-sub { font-size: 14.5px; font-weight: 300; color: rgba(255,255,255,0.55); line-height: 1.75; max-width: 480px; margin: 0 auto; }
.hero-gold-bar { height: 4px; background: var(--ftn-gold); width: 100%; position: relative; z-index: 1; }

/* home page card grid */
.home-wrap { max-width: 900px; margin: -28px auto 60px; padding: 0 24px; position: relative; z-index: 2; }
.home-section { margin-bottom: 32px; }
.home-section:first-child { margin-top: 28px; }
.home-section:last-child { margin-bottom: 0; }
.home-section-header {
  display: flex; align-items: baseline; gap: 10px; margin-bottom: 14px;
  padding-bottom: 8px; border-bottom: 1px solid rgba(27,67,50,0.15);
}
.home-section-title {
  font-family: var(--narrow); font-size: 12px; font-weight: 700; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--ftn-green);
}
.home-section-sub { font-size: 11.5px; color: var(--ftn-ink4); }
.home-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.agent-card {
  display: block; text-align: left; background: var(--ftn-cream); border: 1px solid var(--border-c);
  border-radius: 4px; padding: 22px 20px; text-decoration: none; color: inherit; position: relative;
  box-shadow: 0 8px 24px rgba(27,67,50,0.08); transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
}
.agent-card:hover { border-color: var(--ftn-gold); transform: translateY(-2px); box-shadow: 0 12px 28px rgba(27,67,50,0.12); }
.agent-card-number {
  position: absolute; top: 18px; right: 18px; width: 22px; height: 22px; border-radius: 50%;
  background: var(--ftn-green); color: #fff; font-family: var(--narrow); font-size: 11px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; line-height: 1;
}
.agent-card-eyebrow { font-family: var(--narrow); font-size: 10px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ftn-gold); margin-bottom: 8px; padding-right: 30px; }
.agent-card-title { font-family: var(--display); font-size: 20px; font-weight: 700; color: var(--ftn-green); margin-bottom: 6px; padding-right: 30px; }
.agent-card-body { font-size: 12px; color: var(--ftn-ink3); line-height: 1.5; }

/* client list (clients.html) */
.client-list { border: 1px solid var(--border-c); border-radius: 3px; overflow: hidden; }
.client-row {
  display: flex; justify-content: space-between; align-items: center; padding: 10px 14px;
  border-bottom: 1px solid var(--border-c); font-size: 13px;
}
.client-row:last-child { border-bottom: none; }

/* CV upload bar (screening-agent.html) */
.cv-upload-bar {
  display: flex; align-items: center; gap: 10px; padding: 10px 16px;
  background: var(--ftn-cream-dk); border-top: 1px solid var(--border-c); flex-shrink: 0;
  flex-wrap: wrap; row-gap: 6px;
}
.cv-upload-bar input[type="file"] { font-size: 11px; flex: 1; }
.cv-count {
  font-family: var(--narrow); font-size: 11px; color: var(--ftn-ink3); white-space: nowrap;
}
.cv-count.template-status {
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  max-width: 260px; flex-shrink: 1; display: inline-block; vertical-align: middle;
}
@media (max-width: 720px) {
  .cv-count.template-status { max-width: 100%; flex-basis: 100%; }
}
