* { box-sizing: border-box; } body { margin:0; font-family: system-ui, sans-serif; background:#f5f6f8; color:#1c1e21; }

/* ===== Landing Page — Modern Redesign ===== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

.landing {
  min-height:100vh; display:flex; flex-direction:column;
  background:#0a0f1e; color:#e2e8f0;
  font-family:'Inter',system-ui,sans-serif;
}

/* Top Bar */
.land-top {
  display:flex; align-items:center; justify-content:space-between;
  padding:20px 40px;
  backdrop-filter:blur(10px);
  background:rgba(10,15,30,0.8);
  position:fixed;top:0;left:0;right:0;z-index:100;
  border-bottom:1px solid rgba(251,191,36,0.1);
}
.land-brand {
  font-weight:900; letter-spacing:3px; font-size:16px;
  background:linear-gradient(135deg,#fbbf24 0%,#f59e0b 50%,#fbbf24 100%);
  -webkit-background-clip:text; -webkit-text-fill-color:transparent; background-clip:text;
}
.land-brand span {
  -webkit-text-fill-color:#94a3b8; font-weight:400; letter-spacing:0.5px; margin-left:8px; font-size:12px;
}
.land-login-link {
  color:#fbbf24; cursor:pointer; font-size:14px; text-decoration:none;
  padding:8px 22px; border-radius:999px;
  border:1px solid rgba(251,191,36,0.5); transition:all 0.3s ease;
  font-weight:500; letter-spacing:0.5px;
}
.land-login-link:hover {
  background:rgba(251,191,36,0.15); border-color:#fbbf24; box-shadow:0 0 20px rgba(251,191,36,0.2);
}

/* Hero Section */
.land-hero {
  flex:1; display:grid; grid-template-columns:1fr;
  gap:40px; align-items:center;
  padding:160px 48px 80px;
  max-width:1280px; margin:0 auto; width:100%;
  position:relative; border-radius:0 0 0 0;
  min-height:820px;
  background-color:#0a0f1e;
  background-image:url('/static/img/crew2.png');
  background-position:center 20px; background-repeat:no-repeat;
  background-size:cover;
}
.land-hero::before {
  content:''; position:absolute; inset:0;
  background:linear-gradient(
    180deg,
    rgba(10,15,30,0.7) 0%,
    rgba(10,15,30,0.4) 30%,
    rgba(10,15,30,0.5) 60%,
    rgba(10,15,30,0.95) 100%
  );
  z-index:1;
}
.land-hero > div { position:relative; z-index:2; max-width:680px; }
.land-hero h1 {
  font-size:52px; line-height:1.08; margin:0 0 20px;
  color:#fff; font-weight:800; letter-spacing:-0.5px;
}
.land-hero h1 em {
  color:#fbbf24; font-style:normal; font-weight:900;
  background:linear-gradient(135deg,#fbbf24,#f59e0b);
  -webkit-background-clip:text; -webkit-text-fill-color:transparent; background-clip:text;
}
.land-hero p.lead {
  font-size:19px; line-height:1.7; color:#cbd5e1;
  margin:0 0 32px; max-width:540px; font-weight:400;
}
.land-badges { display:flex; gap:12px; flex-wrap:wrap; }
.land-badge {
  background:rgba(251,191,36,0.08); border:1px solid rgba(251,191,36,0.25);
  color:#fbbf24; padding:10px 18px; border-radius:999px;
  font-size:13px; font-weight:600; backdrop-filter:blur(4px);
  transition:all 0.3s ease;
}
.land-badge:hover {
  background:rgba(251,191,36,0.18); border-color:#fbbf24;
  transform:translateY(-2px); box-shadow:0 4px 12px rgba(251,191,36,0.15);
}

/* Story Section */
.land-story {
  background:#fff; color:#1c1e21;
  padding:80px 48px;
  position:relative;
}
.land-story::before {
  content:''; position:absolute; top:0; left:0; right:0; height:4px;
  background:linear-gradient(90deg, transparent, #fbbf24, transparent);
}
.land-story-inner {
  max-width:1060px; margin:0 auto;
  display:grid; grid-template-columns:1fr 1fr; gap:56px; align-items:start;
}
.land-story h2 {
  font-size:34px; margin:0 0 16px; color:#0f172a; font-weight:800; line-height:1.15;
}
.land-story p {
  font-size:16px; line-height:1.75; color:#475569; margin:0 0 16px; font-weight:400;
}
.land-story .pull {
  font-size:21px; font-weight:600; color:#0f172a;
  border-left:4px solid #fbbf24; padding:4px 0 4px 20px; margin:16px 0 24px;
  line-height:1.5;
}

/* Value Cards */
.land-values { display:grid; grid-template-columns:repeat(3,1fr); gap:20px; margin-top:8px; }
.land-value {
  background:#f8fafc; border:1px solid #e2e8f0; border-radius:16px;
  padding:28px; transition:all 0.35s cubic-bezier(0.4,0,0.2,1);
  position:relative; overflow:hidden;
}
.land-value::before {
  content:''; position:absolute; top:0; left:0; right:0; height:3px;
  background:linear-gradient(90deg,#fbbf24,#f59e0b);
  transform:scaleX(0); transform-origin:left; transition:transform 0.35s ease;
}
.land-value:hover {
  transform:translateY(-8px); box-shadow:0 20px 40px rgba(15,23,42,0.1);
  border-color:rgba(251,191,36,0.3); background:#fff;
}
.land-value:hover::before { transform:scaleX(1); }
.land-value .v-ico {
  font-size:28px; width:56px;height:56px;
  display:flex;align-items:center;justify-content:center;
  background:linear-gradient(135deg,rgba(251,191,36,0.15),rgba(245,158,11,0.05));
  border-radius:14px; margin-bottom:16px;
}
.land-value h3 { margin:0 0 8px; font-size:17px; color:#0f172a; font-weight:700; }
.land-value p { font-size:14px; color:#64748b; margin:0; line-height:1.6; font-weight:400; }

/* Logo Section */
.land-logo-section {
  background:linear-gradient(180deg,#0f172a 0%,#1e293b 100%);
  color:#e2e8f0; padding:80px 48px;
  position:relative; overflow:hidden;
}
.land-logo-section::before {
  content:''; position:absolute; width:600px; height:600px;
  background:radial-gradient(circle, rgba(251,191,36,0.04) 0%, transparent 70%);
  top:-200px; right:-100px; pointer-events:none;
}
.land-logo-inner {
  max-width:1060px; margin:0 auto; position:relative; z-index:2;
  display:grid; grid-template-columns:320px 1fr; gap:56px; align-items:center;
}
.land-logo-img {
  border-radius:20px; overflow:hidden; background:#fff; padding:24px;
  border:1px solid rgba(251,191,36,0.15);
  box-shadow:0 20px 60px rgba(0,0,0,0.4);
  transition:transform 0.4s ease;
}
.land-logo-img:hover { transform:scale(1.02) rotate(0deg); }
.land-logo-img img { width:100%; height:auto; object-fit:contain; }

.land-logo-text h2 {
  font-size:32px; margin:0 0 8px; font-weight:800;
  background:linear-gradient(135deg,#fbbf24,#f59e0b);
  -webkit-background-clip:text; -webkit-text-fill-color:transparent; background-clip:text;
}
.land-logo-text .logo-since {
  font-size:14px; color:#64748b; margin:0 0 6px; letter-spacing:2px; font-weight:600; text-transform:uppercase;
}
.land-logo-text .logo-tagline {
  font-size:20px; color:#e2e8f0; margin:0 0 28px; font-weight:500;
}
.land-logo-text .logo-tagline em {
  color:#fbbf24; font-style:italic; font-weight:600;
}
.logo-values { display:flex; flex-direction:column; gap:16px; }
.logo-value {
  background:rgba(255,255,255,0.04); border:1px solid rgba(255,255,255,0.08);
  border-radius:14px; padding:18px 20px;
  transition:all 0.3s ease;
}
.logo-value:hover {
  background:rgba(255,255,255,0.08); border-color:rgba(251,191,36,0.2);
  transform:translateX(4px);
}
.logo-value strong {
  font-size:15px; color:#fbbf24; display:block; margin-bottom:6px; font-weight:700;
}
.logo-value p { font-size:14px; color:#94a3b8; margin:0; line-height:1.55; font-weight:400; }

/* Footer */
.land-foot {
  background:#070b16; color:#64748b; text-align:center;
  padding:28px 40px; font-size:13px; font-weight:400;
  border-top:1px solid rgba(251,191,36,0.08);
}
.land-foot b { color:#fbbf24; }

/* Logo section (below What You Can Expect) */
.land-logo-section { background:#0f172a; color:#e2e8f0; padding:56px 56px; }
.land-logo-inner { max-width:1000px; margin:0 auto; display:grid; grid-template-columns:300px 1fr; gap:48px; align-items:center; }
.land-logo-img { border-radius:16px; overflow:hidden; background:#fff; padding:20px; border:1px solid rgba(255,255,255,.15); box-shadow:0 10px 30px rgba(0,0,0,.35); }
.land-logo-img img { width:100%; height:auto; object-fit:contain; }
.land-logo-text h2 { font-size:28px; margin:0 0 8px; color:#fbbf24; }
.land-logo-text .logo-since { font-size:15px; color:#94a3b8; margin:0 0 10px; letter-spacing:1px; }
.land-logo-text .logo-tagline { font-size:18px; color:#e2e8f0; margin:0 0 20px; font-weight:500; }
.land-logo-text .logo-tagline em { color:#fbbf24; font-style:italic; }
.logo-values { display:flex; flex-direction:column; gap:14px; }
.logo-value { background:rgba(255,255,255,.06); border:1px solid rgba(255,255,255,.12); border-radius:10px; padding:14px 16px; }
.logo-value strong { font-size:15px; color:#fbbf24; display:block; margin-bottom:4px; }
.logo-value p { font-size:13px; color:#94a3b8; margin:0; line-height:1.5; }

@media (max-width: 768px) {
  .land-hero, .land-story-inner { grid-template-columns:1fr; }
  .land-hero {
    padding:24px;
    min-height:auto;
    background-size: contain;
    background-position: center top;
    background-repeat: no-repeat;
  }
  .land-story { padding:36px 22px; }
  .land-values { grid-template-columns:1fr; }
  .land-hero h1 { font-size:32px; }
  .land-logo-section { padding:36px 22px; }
  .land-logo-inner { grid-template-columns:1fr; gap:24px; text-align:center; }
  .land-logo-img { max-width:260px; margin:0 auto; }
}
.login-screen { display:flex; align-items:center; justify-content:center; height:100vh; background:#1c1e21; }
.login-box { background:#fff; padding:32px; border-radius:12px; width:320px; text-align:center; }
.login-box h1 { margin:0 0 4px; letter-spacing:2px; }
.login-box .tagline { color:#888; margin:0 0 20px; font-size:13px; }
.login-box input { width:100%; margin:8px 0; padding:10px; border:1px solid #ddd; border-radius:8px; }
.login-box button { width:100%; padding:10px; background:#1338be; color:#fff; border:none; border-radius:8px; cursor:pointer; }
.error { color:#e5484d; font-size:13px; margin-top:8px; min-height:16px; }
.status-dropdown { padding:3px 6px; border:1px solid #cbd5e1; border-radius:4px; font-size:13px; background:#fff; cursor:pointer; }
.btn-ssn { padding:4px 10px; background:#1338be; color:#fff; border:none; border-radius:4px; cursor:pointer; font-size:12px; white-space:nowrap; }
.btn-ssn:hover { background:#1a4be0; }
.editable-date { cursor:pointer; border-bottom:1px dashed #94a3b8; padding:2px 4px; }
.editable-date:hover { background:#f1f5f9; border-radius:3px; }
.date-input-inline { width:130px; padding:2px 4px; border:1px solid #1338be; border-radius:4px; font-size:13px; }
.build-notes-popup { position:fixed; top:56px; right:44px; width:380px; max-height:60vh; background:#fff; border:1px solid #e2e8f0; border-radius:8px; box-shadow:0 4px 20px rgba(0,0,0,.15); z-index:999; display:flex; flex-direction:column; }
.build-notes-popup.hidden { display:none; }
.bn-header { padding:12px 14px 8px; border-bottom:1px solid #e2e8f0; font-size:14px; }
.bn-header .muted { font-size:12px; }
.bn-list { flex:1; overflow-y:auto; padding:8px 14px; max-height:35vh; }
.bn-item { display:flex; gap:6px; align-items:flex-start; padding:6px 0; border-bottom:1px solid #f1f5f9; }
.bn-item-text { flex:1; font-size:13px; line-height:1.4; padding:4px 6px; border-radius:4px; cursor:text; word-break:break-word; }
.bn-item-text:focus { outline:2px solid #1338be; background:#f8fafc; }
.bn-item-meta { font-size:11px; color:#94a3b8; white-space:nowrap; margin-top:4px; }
.bn-del { background:none; border:none; color:#94a3b8; cursor:pointer; font-size:14px; padding:2px 4px; }
.bn-del:hover { color:#e5484d; }
.bn-footer { padding:8px 14px 12px; border-top:1px solid #e2e8f0; display:flex; gap:6px; }
.bn-footer textarea { flex:1; padding:6px; border:1px solid #cbd5e1; border-radius:6px; font-size:13px; resize:none; }
.bn-footer .btn { white-space:nowrap; }
.main-app { display:flex; flex-direction:column; height:100vh; }
.topbar { display:flex; align-items:center; gap:16px; background:#1338be; color:#fff; padding:10px 16px; }
.topbar .brand { font-weight:700; letter-spacing:1px; }
.global-search { flex:1; max-width:420px; padding:8px 12px; border-radius:8px; border:none; }
.user-area { margin-left:auto; display:flex; align-items:center; gap:10px; }
.user-area button { background:#fff; color:#1338be; border:none; padding:6px 12px; border-radius:6px; cursor:pointer; }
.layout { display:flex; flex:1; overflow:hidden; }
.nav { width:200px; background:#fff; border-right:1px solid #e5e7eb; padding:8px; overflow:auto; }
.nav-item { padding:9px 12px; border-radius:6px; cursor:pointer; font-size:14px; }
.nav-item:hover, .nav-item.active { background:#eef2ff; color:#1338be; }
.content { flex:1; padding:20px; overflow:auto; }
.page-title { font-size:20px; margin:0 0 12px; }
.muted { color:#888; font-size:13px; }
.grid { width:100%; border-collapse:collapse; background:#fff; }
.grid th, .grid td { border:1px solid #e5e7eb; padding:6px 10px; font-size:13px; text-align:left; }
.grid thead th { position:sticky; top:0; background:#f3f4f6; z-index:2; box-shadow:0 1px 0 #e5e7eb; }

.tree { font-size:13px; }
.tree-group { font-weight:600; margin:4px 0; cursor:pointer; }
.tree-children { margin-left:16px; }
.tree-file { padding:3px 0 3px 8px; cursor:pointer; color:#1338be; }
.tree-file:hover { text-decoration:underline; }
.sheet-grid { border-collapse:collapse; }
.sheet-grid td { border:1px solid #ccc; padding:4px 8px; min-width:60px; font-size:12px; }
.ai-wrap { max-width:640px; }
.ai-chat { background:#fff; border:1px solid #e5e7eb; border-radius:8px; padding:12px; margin:10px 0; min-height:80px; white-space:pre-wrap; }
.ai-input textarea, #ai-msg { width:100%; }
.hidden { display:none !important; }
.back-btn { background:#2b6cb0; color:#fff; border:none; border-radius:4px; padding:6px 12px; cursor:pointer; margin:0 8px 8px 0; font-size:13px; }
.back-btn:hover { background:#234e7a; }
.xls { border-collapse: collapse; font-size: 12px; }
.xls th.corner { background:#e8eaed; border:1px solid #ccc; width:36px; }
.xls th.colh { background:#e8eaed; border:1px solid #ccc; padding:2px 6px; min-width:60px; text-align:center; position:sticky; top:0; z-index:2; }
.xls th.rownum { background:#e8eaed; border:1px solid #ccc; padding:2px 6px; text-align:right; position:sticky; left:0; z-index:1; }
.xls td { border:1px solid #d6d9dc; padding:2px 6px; min-width:60px; white-space:nowrap; }
.xls td:focus { outline:2px solid #1338be; background:#fff; }
.stat-grid { display:grid; grid-template-columns:repeat(auto-fill, minmax(200px,1fr)); gap:14px; margin:8px 0 16px; }
.stat-card { background:#fff; border:1px solid #e5e7eb; border-radius:10px; padding:16px; box-shadow:0 1px 2px rgba(0,0,0,.04); }
.stat-value { font-size:24px; font-weight:700; color:#1338be; }
.stat-label { font-size:13px; color:#555; margin-top:4px; }
.stat-sub { font-size:12px; color:#888; margin-top:2px; }
.stat-note { font-size:13px; margin:6px 0; }
.stat-note .ok { color:#1a7f37; font-weight:600; }
.stat-note .warn { color:#b7791f; font-weight:600; }

/* ===== AR Aging (Dashboard bottom) ===== */
.ar-aging { background:#fff; border:1px solid #e5e7eb; border-radius:10px; padding:16px; margin:12px 0 4px; box-shadow:0 1px 2px rgba(0,0,0,.04); }
.ar-title { font-size:16px; margin:0 0 10px; color:#1f2937; }
.ar-title .muted { font-weight:400; }
.ar-sub { font-size:14px; margin:16px 0 8px; color:#374151; }
.ar-grid { margin-bottom:6px; }
.ar-grid th { background:#f3f4f6; font-weight:600; color:#374151; }
.ar-amt { text-align:right; font-variant-numeric:tabular-nums; white-space:nowrap; }
.ar-cnt { text-align:right; color:#6b7280; }
.ar-total td { font-weight:700; background:#eef2ff; border-top:2px solid #c7d2fe; }
.ar-total .ar-amt { color:#1338be; }

/* ===== Cards & buttons (shared) ===== */
.card { background:#fff; border:1px solid #e5e7eb; border-radius:10px; padding:16px; box-shadow:0 1px 2px rgba(0,0,0,.04); margin:8px 0; }
.card-head { font-weight:600; font-size:15px; margin-bottom:10px; color:#1f2937; }
.btn { background:#1338be; color:#fff; border:none; border-radius:6px; padding:8px 14px; font-size:13px; cursor:pointer; }
.btn:hover { background:#0f2da0; }
.btn-secondary { background:#eef2ff; color:#1338be; }
.btn-secondary:hover { background:#e0e7ff; }

/* ===== John Sermons workspace ===== */
.sermon-workspace { display:flex; gap:14px; align-items:stretch; }
.sermon-list-card { width:300px; flex:0 0 300px; display:flex; flex-direction:column; max-height:70vh; }
.sermon-editor-card { flex:1; display:flex; flex-direction:column; min-width:0; }
.sermon-filter { width:100%; padding:7px 10px; border:1px solid #d1d5db; border-radius:6px; margin-bottom:8px; font-size:13px; box-sizing:border-box; }
.sermon-list { overflow:auto; flex:1; }
.sermon-item { padding:7px 9px; border-radius:6px; cursor:pointer; font-size:13px; color:#1338be; }
.sermon-item:hover { background:#f3f4f6; }
.sermon-item.active { background:#eef2ff; font-weight:600; }
.sermon-doc { min-height:48vh; max-height:60vh; overflow:auto; border:1px solid #d1d5db; border-radius:8px; padding:28px 34px; background:#fff; font:15px/1.7 Georgia, 'Times New Roman', serif; color:#111827; white-space:pre-wrap; outline:none; box-shadow:inset 0 1px 3px rgba(0,0,0,.03); }
.sermon-doc:focus { border-color:#1338be; }
.sermon-editor-actions { margin-top:10px; display:flex; gap:8px; align-items:center; }
.sermon-ai-card { margin-top:14px; }
.sermon-ai-controls { margin-top:8px; }
.sermon-ai-controls textarea { width:100%; padding:8px; border:1px solid #d1d5db; border-radius:6px; font-size:13px; box-sizing:border-box; }
.sermon-ai-btns { display:flex; gap:6px; flex-wrap:wrap; margin:8px 0; }
.ai-msg { margin:6px 0; padding:8px 10px; border-radius:8px; font-size:13px; }
.ai-user { background:#eef2ff; }
.ai-bot { background:#f0fdf4; }
.sermon-voice { margin-top:16px; padding-top:14px; border-top:1px solid #e5e7eb; }
@media (max-width: 900px){ .sermon-workspace{flex-direction:column;} .sermon-list-card{width:auto;flex:auto;max-height:none;} }

/* ===== Vault document viewer toolbars ===== */
.doc-toolbar { display:flex; gap:6px; margin:8px 0; flex-wrap:wrap; align-items:center; }
.tb-btn { font:600 13px/1 system-ui; padding:6px 10px; border:1px solid #d1d5db;
  background:#fff; border-radius:6px; cursor:pointer; min-width:30px; }
.tb-btn:hover { background:#f3f4f6; }
.tb-note { font-size:12px; color:#b7791f; font-style:italic; }
.doc-editor, .pdf-text { background:#fff; border:1px solid #e5e7eb; border-radius:8px;
  padding:14px 18px; line-height:1.6; }
.doc-editor:focus { outline:2px solid #2563eb33; }
.pdf-text { white-space:pre-wrap; font-family:ui-monospace,Menlo,monospace; font-size:12px; }
#sheet td.edited { background:#fffbe6; }
#sheet td.sel { outline:2px solid #2563eb; background:#eff6ff; }
#sheet.freeze thead, #sheet.freeze tr:first-child { position:sticky; top:0; background:#eef2ff; z-index:2; }
.formula-bar { display:flex; gap:8px; align-items:center; margin:6px 0; padding:4px 6px; background:#f8fafc; border:1px solid #e5e7eb; border-radius:6px; }
.formula-bar #fb-cell { font:600 12px/1 ui-monospace,monospace; color:#6b7280; min-width:36px; }
.formula-bar #fb-input { flex:1; border:1px solid #cbd5e1; border-radius:4px; padding:5px 8px; font:13px/1.4 ui-monospace,monospace; }
.tb-select { padding:5px 8px; border:1px solid #cbd5e1; border-radius:6px; font-size:13px; background:#fff; }
.tb-sep { width:1px; height:22px; background:#cbd5e1; margin:0 4px; display:inline-block; }
.tb-color { width:30px; height:28px; border:1px solid #cbd5e1; border-radius:6px; padding:0; cursor:pointer; vertical-align:middle; }
.tb-input { padding:5px 8px; border:1px solid #cbd5e1; border-radius:6px; font-size:13px; width:90px; }
#sheet td.merged { background:#eef6ff; }
#sheet td.find-hit { outline:2px solid #f59e0b; background:#fff7ed; }

/* AI Companion chat */
.ai-layout { display:flex; gap:12px; align-items:stretch; }
.ai-sidebar { width:230px; flex:0 0 230px; display:flex; flex-direction:column; gap:8px; }
.ai-sidebar.ai-sidebar-collapsed { display:none; }
.ai-sidebar-head { display:flex; gap:6px; align-items:center; }
.ai-sidebar-head .btn-sm { font-size:12px; padding:6px 10px; flex:1; }
.ai-conv-list { flex:1; overflow:auto; max-height:62vh; display:flex; flex-direction:column; gap:6px; }
.ai-conv-item { position:relative; background:#fff; border:1px solid #e5e7eb; border-radius:8px; padding:8px 26px 8px 10px; cursor:pointer; }
.ai-conv-item:hover { border-color:#1338be; background:#f1f5ff; }
.ai-conv-item.ai-conv-active { border-color:#1338be; background:#e0e7ff; }
.ai-conv-title { font-size:13px; font-weight:600; color:#1f2937; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.ai-conv-preview { font-size:11px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.ai-conv-del { position:absolute; top:6px; right:6px; border:none; background:transparent; cursor:pointer; font-size:12px; opacity:.5; }
.ai-conv-del:hover { opacity:1; }
.ai-main { flex:1; min-width:0; display:flex; flex-direction:column; }
.ai-head { display:flex; justify-content:space-between; align-items:flex-end; gap:12px; margin-bottom:8px; }
.ai-chat { display:flex; flex-direction:column; gap:10px; height:58vh; overflow:auto; padding:10px; background:#f8fafc; border:1px solid #e5e7eb; border-radius:10px; }
.ai-bubble { max-width:82%; padding:10px 13px; border-radius:14px; line-height:1.45; white-space:normal; word-wrap:break-word; font-size:14px; }
.ai-ai { align-self:flex-start; background:#fff; border:1px solid #e5e7eb; border-bottom-left-radius:4px; }
.ai-user { align-self:flex-end; background:#2563eb; color:#fff; border-bottom-right-radius:4px; }
.ai-user b { color:#fff; }
.ai-typing { display:flex; gap:4px; padding:6px 4px 0 6px; }
.ai-typing.hidden { display:none; }
.ai-typing span { width:7px; height:7px; border-radius:50%; background:#94a3b8; animation:ai-bounce 1.2s infinite; }
.ai-typing span:nth-child(2){ animation-delay:.2s; } .ai-typing span:nth-child(3){ animation-delay:.4s; }
@keyframes ai-bounce { 0%,60%,100%{ transform:translateY(0); opacity:.5 } 30%{ transform:translateY(-5px); opacity:1 } }
.ai-input-row { display:flex; gap:8px; margin-top:8px; align-items:flex-end; }
.ai-input-row textarea { flex:1; resize:none; padding:10px 12px; border:1px solid #cbd5e1; border-radius:10px; font:14px/1.4 system-ui, sans-serif; }
.ai-input-row .btn { padding:10px 16px; border-radius:10px; font-size:15px; white-space:nowrap; }
.ai-input-row .btn-books { background:#15803d; font-size:13px; padding:8px 12px; }
.ai-input-row .btn-books:hover { background:#166534; }

/* Help box (per-page how-to) */
.help-box { background:#eef6ff; border:1px solid #bcd4f6; border-left:4px solid #1338be; border-radius:8px; padding:10px 14px; margin-bottom:12px; font-size:13px; color:#1e3a5f; position:relative; }
.help-box b { color:#1338be; }
.help-box .help-x { position:absolute; top:6px; right:10px; cursor:pointer; color:#90a4c4; font-weight:700; }
.help-box .help-x:hover { color:#1338be; }
.help-box ol { margin:6px 0 0; padding-left:20px; }
.help-box li { margin:3px 0; }
.help-dropdown { position:fixed; top:46px; right:12px; z-index:60; }
.help-card { background:#fff; border:1px solid #c3d4ee; border-top:3px solid #1338be; border-radius:10px; box-shadow:0 12px 30px rgba(0,0,0,.18); width:320px; max-width:90vw; font-size:13px; color:#1e3a5f; }
.help-card-head { font-weight:700; color:#1338be; padding:10px 12px; border-bottom:1px solid #e3ecf7; display:flex; justify-content:space-between; align-items:center; }
.help-card-body { padding:12px 14px; line-height:1.55; }
.help-card-body b { color:#1338be; }
.help-x { cursor:pointer; color:#90a4c4; font-weight:700; }
.help-x:hover { color:#1338be; }
#help-btn { background:#fff; color:#1338be; border:1px solid #1338be; padding:6px 12px; border-radius:6px; cursor:pointer; font-weight:600; }
#help-btn:hover { background:#1338be; color:#fff; }

/* Reports page */
.report-grid { display:grid; grid-template-columns:repeat(auto-fit, minmax(360px, 1fr)); gap:14px; margin-top:10px; }
.report-card { background:#fff; border:1px solid #e5e7eb; border-radius:12px; padding:14px 16px; box-shadow:0 1px 3px rgba(0,0,0,.04); }
.report-title { font-size:15px; font-weight:700; color:#1f2937; margin:0 0 10px; }
.legend { margin-top:8px; font-size:12px; color:#374151; display:flex; flex-direction:column; gap:3px; }
.legend-row { display:flex; align-items:center; gap:6px; }
.legend-dot { width:10px; height:10px; border-radius:50%; display:inline-block; flex:0 0 auto; }

/* Reports: clickable cards + detail modal */
.report-card.report-click { cursor:pointer; transition:box-shadow .15s, transform .15s; }
.report-card.report-click:hover { box-shadow:0 4px 16px rgba(19,56,190,.18); transform:translateY(-2px); }
.report-card-head { display:flex; align-items:center; justify-content:space-between; gap:8px; }
.report-more { font-size:12px; font-weight:600; color:#1338be; white-space:nowrap; }
.report-modal { position:fixed; inset:0; background:rgba(15,23,42,.55); display:flex; align-items:center; justify-content:center; z-index:200; padding:20px; }
.report-modal-box { background:#fff; border-radius:14px; max-width:640px; width:100%; max-height:82vh; overflow:auto; padding:20px 22px; box-shadow:0 10px 40px rgba(0,0,0,.3); }
.detail-table { width:100%; border-collapse:collapse; margin-top:10px; font-size:13px; }
.detail-table th, .detail-table td { text-align:left; padding:6px 8px; border-bottom:1px solid #eef0f3; }
.detail-table th { background:#f6f8fc; color:#475569; font-weight:700; }
.detail-table tr:hover td { background:#f9fbff; }

/* Reconcile page */
.rec-wrap { background:#fff; border:1px solid #e5e7eb; border-radius:12px; padding:16px; }
.rec-table { width:100%; border-collapse:collapse; margin-top:8px; }
.rec-table th, .rec-table td { text-align:left; padding:9px 10px; border-bottom:1px solid #eef0f3; font-size:14px; }
.rec-table th { background:#f8fafc; color:#475569; font-weight:700; font-size:12px; text-transform:uppercase; letter-spacing:.03em; }
.rec-num { text-align:right; font-variant-numeric:tabular-nums; }
.rec-ok { color:#15803d; font-weight:700; }
.rec-bad { color:#dc2626; font-weight:700; }
.rec-unknown { color:#9a3412; font-weight:600; }
.rec-note { background:#fff7ed; border:1px solid #fed7aa; border-radius:8px; padding:8px 12px; margin-top:12px; font-size:12px; color:#9a3412; }

.detail-table thead th { position:sticky; top:0; z-index:2; }

.rec-table thead th { position:sticky; top:0; z-index:2; }

.ar-grid thead th { position:sticky; top:0; z-index:2; }

/* inline help links */
.help-link { color:#2563eb; font-size:12px; font-weight:400; text-decoration:underline; cursor:pointer; margin-left:4px; }
.help-link:hover { color:#1d4ed8; }
.help-pop { position:absolute; z-index:9999; background:#fff; border:1px solid #cbd5e1; border-radius:8px; box-shadow:0 6px 24px rgba(0,0,0,.14); padding:10px 12px; font-size:13px; line-height:1.45; color:#1f2937; }

/* ============ MOBILE RESPONSIVE ============ */
.hamburger-btn {
  display:none;
  background:none;
  border:none;
  color:#fff;
  font-size:24px;
  cursor:pointer;
  padding:4px 8px;
  margin-right:8px;
}

@media (max-width: 768px) {
  /* Show hamburger */
  .hamburger-btn {
    display:block;
  }
  
  /* Topbar adjustments */
  .topbar {
    flex-wrap:wrap;
    gap:8px;
    padding:8px 12px;
  }
  
  .topbar .brand {
    font-size:14px;
  }
  
  #back-btn {
    font-size:12px;
    padding:4px 8px;
    margin:0;
  }
  
  .global-search {
    order:99;
    width:100%;
    max-width:100%;
    font-size:13px;
  }
  
  .user-area {
    margin-left:0;
    gap:6px;
  }
  
  .user-area button {
    font-size:11px;
    padding:4px 8px;
  }
  
  #user-name {
    font-size:12px;
  }
  
  /* Nav drawer */
  .nav {
    position:fixed;
    top:0;
    left:-280px;
    width:260px;
    height:100vh;
    background:#fff;
    box-shadow:2px 0 12px rgba(0,0,0,.15);
    transition:left 0.3s ease;
    z-index:9999;
    padding:60px 12px 12px;
    overflow-y:auto;
  }
  
  .nav.open {
    left:0;
  }
  
  .nav-overlay {
    position:fixed;
    top:0;
    left:0;
    width:100%;
    height:100%;
    background:rgba(0,0,0,.4);
    z-index:9998;
    display:none;
  }
  
  .nav-overlay.open {
    display:block;
  }
  
  .nav-item {
    padding:12px 14px;
    font-size:15px;
  }
  
  /* Content padding */
  .content {
    padding:12px;
  }
  
  /* Page title */
  .page-title {
    font-size:18px;
    margin:0 0 10px;
  }
  
  /* Tables - make scrollable */
  .grid {
    display:block;
    overflow-x:auto;
    white-space:nowrap;
    font-size:12px;
  }
  
  .grid th, .grid td {
    padding:6px 8px;
    font-size:12px;
  }
  
  /* Stat cards stack */
  .stat-grid {
    grid-template-columns:1fr;
    gap:10px;
  }
  
  .stat-card {
    padding:12px;
  }
  
  .stat-card .stat-value {
    font-size:24px;
  }
  
  .stat-card .stat-label {
    font-size:13px;
  }
  
  /* Landing page fixes */
  .landing-hero h1 {
    font-size:28px;
  }
  
  .landing-hero p {
    font-size:16px;
  }
  
  .landing-story h2,
  .landing-values h2 {
    font-size:24px;
  }
  
  /* AI chat fixes */
  .ai-chat {
    min-height:120px;
    max-height:300px;
  }
  
  #ai-msg {
    font-size:14px;
  }
  
  /* Build notes popup */
  .build-notes-popup {
    width:95%;
    max-width:95%;
  }
}