/* =========================================================
   Real Estate Industry Research Platform - Shared Styles
   ========================================================= */
:root {
  --navy: #2f5d34;
  --navy-deep: #16241b;
  --gold: #8de36b;
  --gold-light: #b9f29e;
  --bg: #eef3e7;
  --card: #ffffff;
  --text: #16241b;
  --muted: #5b6a5c;
  --border: #dde6d2;
  --green: #2f9e63;
  --red: #d6543d;
  --amber: #e0a830;
  --radius: 14px;
  --shadow: 0 6px 24px rgba(22, 36, 27, 0.08);
  --shadow-lg: 0 16px 48px rgba(22, 36, 27, 0.14);
}

* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  scroll-behavior: smooth;
}
a { text-decoration: none; color: inherit; }
img { max-width: 100%; }

.container { max-width: 1160px; margin: 0 auto; padding: 0 24px; }

/* ---------- Nav ---------- */
.nav { position: sticky; top: 0; z-index: 50; background: rgba(255,255,255,0.9); backdrop-filter: blur(8px); border-bottom: 1px solid var(--border); }
.nav-inner { display: flex; align-items: center; justify-content: space-between; padding: 16px 24px; max-width: 1160px; margin: 0 auto; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; color: var(--navy-deep); }
.brand .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--gold); }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 14px 28px; border-radius: 999px; font-weight: 600; font-size: 15px; border: none; cursor: pointer; transition: all .2s ease; }
.btn-primary { background: linear-gradient(135deg, var(--gold) 0%, var(--gold-light) 100%); color: var(--navy-deep); box-shadow: 0 8px 20px rgba(141,227,107,0.35); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(141,227,107,0.45); }
.btn-outline { background: transparent; color: var(--navy-deep); border: 1.5px solid var(--navy-deep); }
.btn-outline:hover { background: var(--navy-deep); color: #fff; }
.btn-block { width: 100%; }
.btn-sm { padding: 8px 16px; font-size: 13px; }
.btn-danger { background: var(--red); color: #fff; }

/* ---------- Hero ---------- */
.hero { background: radial-gradient(circle at 20% 20%, #1f3a23 0%, var(--navy-deep) 60%); color: #fff; padding: 110px 24px 90px; text-align: center; position: relative; overflow: hidden; }
.hero::after { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 80% 80%, rgba(141,227,107,0.25), transparent 60%); }
.hero-tag { display: inline-block; padding: 6px 18px; border-radius: 999px; background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.2); font-size: 13px; letter-spacing: .5px; margin-bottom: 24px; position: relative; z-index: 1; }
.hero h1 { font-size: 46px; line-height: 1.15; max-width: 820px; margin: 0 auto 20px; position: relative; z-index: 1; font-weight: 800; }
.hero h1 span { color: var(--gold-light); }
.hero p.sub { max-width: 640px; margin: 0 auto 36px; font-size: 18px; color: #cfd8e3; position: relative; z-index: 1; }
.hero-cta { position: relative; z-index: 1; display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.hero-meta { margin-top: 40px; display: flex; gap: 36px; justify-content: center; flex-wrap: wrap; position: relative; z-index: 1; color: #aebbcb; font-size: 14px; }

/* ---------- Sections ---------- */
.section { padding: 80px 24px; }
.section-title { text-align: center; max-width: 680px; margin: 0 auto 50px; }
.section-title .eyebrow { color: var(--gold); font-weight: 700; letter-spacing: 1px; font-size: 13px; text-transform: uppercase; }
.section-title h2 { font-size: 32px; margin: 10px 0 12px; color: var(--navy-deep); }
.section-title p { color: var(--muted); font-size: 16px; }

.grid { display: grid; gap: 24px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) { .grid-3, .grid-4 { grid-template-columns: repeat(2,1fr); } }
@media (max-width: 600px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow); }
.card h3 { margin: 14px 0 8px; font-size: 18px; color: var(--navy-deep); }
.card p { color: var(--muted); font-size: 14.5px; line-height: 1.6; margin: 0; }
.icon-circle { width: 46px; height: 46px; border-radius: 12px; background: linear-gradient(135deg, var(--navy) 0%, var(--navy-deep) 100%); display: flex; align-items: center; justify-content: center; font-size: 20px; color: var(--gold-light); }

.alt-bg { background: #fff; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }

.privacy-box { background: var(--navy-deep); color: #fff; border-radius: 20px; padding: 48px; display: flex; gap: 36px; align-items: center; flex-wrap: wrap; }
.privacy-box h2 { color: #fff; }
.privacy-box p { color: #c7d1de; }
.privacy-list { list-style: none; padding: 0; margin: 18px 0 0; }
.privacy-list li { padding: 6px 0; padding-left: 26px; position: relative; color: #dde4ec; }
.privacy-list li::before { content: ""; position: absolute; left: 0; top: 8px; width: 8px; height: 8px; border-radius: 50%; background: var(--gold-light); }

.footer { padding: 40px 24px; text-align: center; color: var(--muted); font-size: 13.5px; border-top: 1px solid var(--border); }

/* ---------- Forms ---------- */
.form-page { max-width: 680px; margin: 60px auto; padding: 0 24px; }
.form-card { background: var(--card); border-radius: 20px; box-shadow: var(--shadow-lg); padding: 44px; }
.form-card h1 { font-size: 26px; margin: 0 0 6px; color: var(--navy-deep); }
.form-card .lead { color: var(--muted); margin-bottom: 30px; font-size: 14.5px; }
.field { margin-bottom: 20px; }
.field label { display: block; font-weight: 600; font-size: 13.5px; margin-bottom: 7px; color: var(--navy-deep); }
.field input, .field select { width: 100%; padding: 13px 14px; border-radius: 10px; border: 1.5px solid var(--border); font-size: 14.5px; font-family: inherit; background: #fbfcfd; transition: border .15s; }
.field input:focus, .field select:focus { outline: none; border-color: var(--gold); background: #fff; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 560px) { .field-row { grid-template-columns: 1fr; } }
.error-banner { background: #fdeceb; color: var(--red); border: 1px solid #f6c4bd; border-radius: 10px; padding: 12px 16px; font-size: 13.5px; margin-bottom: 20px; }

/* ---------- Chat Interview ---------- */
.chat-wrap { max-width: 800px; margin: 0 auto; height: 100vh; display: flex; flex-direction: column; background: #fff; }
.chat-topbar { display: flex; align-items: center; justify-content: space-between; padding: 14px 24px; border-bottom: 1px solid var(--border); background: #fff; }
@media (min-width: 860px) {
  body.chat-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 24px 0; }
  body.chat-page .chat-wrap { height: calc(100vh - 48px); border-radius: 28px; overflow: hidden; border: 1px solid var(--border); box-shadow: var(--shadow-lg); }
}
.chat-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 24px; border-bottom: 1px solid var(--border); background: #fff; }
.chat-header .who { display: flex; align-items: center; gap: 12px; }
.avatar { width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 15px; color: #fff; flex-shrink: 0; }
.avatar.ai { background: linear-gradient(135deg, var(--navy) 0%, var(--navy-deep) 100%); }
.avatar.user { background: linear-gradient(135deg, var(--gold) 0%, #2f5d34 100%); color: var(--navy-deep); }
.chat-header .name { font-weight: 700; font-size: 15px; color: var(--navy-deep); }
.chat-header .status { font-size: 12.5px; color: var(--green); display: flex; align-items: center; gap: 5px; }
.chat-header .status .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); }
.progress-bar-track { height: 4px; background: var(--border); }
.progress-bar-fill { height: 4px; background: linear-gradient(90deg, var(--gold), var(--gold-light)); transition: width .4s ease; }

.chat-body { flex: 1; overflow-y: auto; padding: 24px; background: var(--bg); }
.msg-row { display: flex; gap: 12px; margin-bottom: 18px; align-items: flex-start; animation: fadeUp .25s ease; }
.msg-row.user { flex-direction: row-reverse; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.bubble { max-width: 72%; padding: 13px 17px; border-radius: 16px; font-size: 14.8px; line-height: 1.55; }
.msg-row.ai .bubble { background: #fff; border: 1px solid var(--border); color: var(--text); border-top-left-radius: 4px; }
.msg-row.user .bubble { background: var(--navy-deep); color: #fff; border-top-right-radius: 4px; }
.typing-bubble { display: inline-flex; gap: 4px; padding: 14px 18px; }
.typing-bubble span { width: 7px; height: 7px; border-radius: 50%; background: #aab4c2; animation: blink 1.2s infinite; }
.typing-bubble span:nth-child(2) { animation-delay: .2s; }
.typing-bubble span:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }

.chat-footer { padding: 16px 24px; background: #fff; border-top: 1px solid var(--border); }
.input-hint { display: flex; align-items: center; gap: 7px; background: #f0f8ea; color: #2f5d34; border: 1px solid #d9eec4; border-radius: 10px; padding: 8px 13px; font-size: 12.5px; font-weight: 600; margin-bottom: 10px; }
.input-hint svg { flex-shrink: 0; }
.chat-input-row { display: flex; gap: 10px; align-items: flex-end; }
.chat-input-row textarea { flex: 1; resize: none; border: 1.5px solid var(--border); border-radius: 14px; padding: 13px 16px; font-family: inherit; font-size: 14.5px; max-height: 120px; min-height: 48px; }
.chat-input-row textarea:focus { outline: none; border-color: var(--gold); }
.send-btn { width: 48px; height: 48px; border-radius: 50%; border: none; cursor: pointer; background: var(--navy-deep); color: #fff; font-size: 18px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; transition: transform .15s; }
.send-btn:hover { transform: scale(1.06); }
.send-btn:disabled { opacity: .5; cursor: not-allowed; }
.choice-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 6px; }
.bubble-hint { margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--border); font-size: 12px; color: var(--navy); font-weight: 600; display: flex; align-items: center; gap: 6px; }
.bubble-hint::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--gold); flex-shrink: 0; }
.choice-btn { padding: 9px 18px; border-radius: 999px; border: 1.5px solid var(--navy-deep); background: #fff; color: var(--navy-deep); font-weight: 600; font-size: 13.5px; cursor: pointer; }
.choice-btn:hover { background: var(--navy-deep); color: #fff; }

.done-screen { text-align: center; padding: 60px 24px; }
.done-screen .icon-circle { margin: 0 auto 20px; width: 64px; height: 64px; font-size: 28px; border-radius: 50%; }
.done-screen h2 { color: var(--navy-deep); }
.done-screen p { color: var(--muted); max-width: 460px; margin: 0 auto 24px; }

/* ---------- Admin ---------- */
/* ---------- Admin (modernized + responsive) ---------- */
.admin-shell { display: flex; min-height: 100vh; background: var(--bg); }
.admin-sidebar {
  width: 230px; background: var(--navy-deep); color: #fff; padding: 26px 18px; flex-shrink: 0;
  display: flex; flex-direction: column; gap: 4px; position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.admin-sidebar .brand { color: #fff; margin-bottom: 28px; padding: 0 8px; }
.admin-link { display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-radius: 10px; color: #c7d4c3; font-size: 14px; font-weight: 500; cursor: pointer; transition: background .15s, color .15s; }
.admin-link.active, .admin-link:hover { background: rgba(255,255,255,0.08); color: #fff; }
.admin-link.active { box-shadow: inset 3px 0 0 var(--gold); }

.admin-main { flex: 1; padding: 32px 34px; max-width: calc(100vw - 230px); }
.admin-topbar { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 28px; gap: 16px; flex-wrap: wrap; }
.admin-topbar h1 { font-size: 25px; font-weight: 800; color: var(--navy-deep); margin: 0; letter-spacing: -0.3px; }

/* Mobile sidebar toggle (hidden on desktop) */
.mobile-topbar { display: none; }
.sidebar-toggle { background: var(--navy-deep); color: #fff; border: none; width: 38px; height: 38px; border-radius: 10px; display: flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0; }

.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin-bottom: 24px; }
.kpi-card {
  background: #fff; border: 1px solid var(--border); border-radius: 18px; padding: 22px;
  position: relative; overflow: hidden; transition: transform .15s ease, box-shadow .15s ease;
}
.kpi-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.kpi-card::before { content: ""; position: absolute; top: 0; left: 0; width: 4px; height: 100%; background: var(--gold); }
.kpi-card .label { color: var(--muted); font-size: 12.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; }
.kpi-card .value { font-size: 30px; font-weight: 800; color: var(--navy-deep); margin-top: 8px; letter-spacing: -0.5px; }
.kpi-card .sub { font-size: 12.5px; color: var(--green); margin-top: 6px; font-weight: 600; }

.charts-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; margin-bottom: 24px; }
.chart-card {
  background: #fff; border: 1px solid var(--border); border-radius: 18px; padding: 20px 22px;
  transition: box-shadow .15s ease;
}
.chart-card:hover { box-shadow: var(--shadow); }
.chart-card h3 { margin: 0 0 14px; font-size: 14.5px; font-weight: 700; color: var(--navy-deep); }
.chart-canvas-wrap { position: relative; width: 100%; }
.chart-canvas-wrap canvas { max-width: 100% !important; }

.table-card { background: #fff; border: 1px solid var(--border); border-radius: 18px; overflow: hidden; }
.table-toolbar { display: flex; justify-content: space-between; align-items: center; padding: 18px 22px; border-bottom: 1px solid var(--border); gap: 12px; flex-wrap: wrap; }
.table-toolbar strong { font-size: 14.5px; color: var(--navy-deep); }
.table-toolbar input { padding: 10px 14px 10px 36px; border-radius: 10px; border: 1px solid var(--border); font-size: 13.5px; width: 240px; background-repeat: no-repeat; background-position: 12px center; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235b6a5c' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M21 21l-4.3-4.3'/%3E%3C/svg%3E"); }
.table-scroll { overflow-x: auto; }

@media (max-width: 1000px) {
  .kpi-grid { grid-template-columns: repeat(2,1fr); }
  .charts-grid { grid-template-columns: 1fr; }
  .analysis-grid { grid-template-columns: 1fr !important; }
  .admin-main { max-width: 100%; }
}

@media (max-width: 860px) {
  .admin-sidebar { display: none; }
  .admin-sidebar.open { display: flex; position: fixed; top: 0; left: 0; bottom: 0; z-index: 60; width: 240px; box-shadow: var(--shadow-lg); }
  .sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.4); z-index: 55; }
  .sidebar-overlay.open { display: block; }
  .mobile-topbar { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; background: #fff; border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 40; }
  .admin-main { padding: 20px 16px; max-width: 100%; }
  .kpi-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .kpi-card { padding: 16px; }
  .kpi-card .value { font-size: 24px; }
}

@media (max-width: 520px) {
  .kpi-grid { grid-template-columns: 1fr; }
  .table-toolbar input { width: 100%; }
  .table-toolbar { flex-direction: column; align-items: stretch; }
}
table { width: 100%; border-collapse: collapse; font-size: 13.8px; }
table th { text-align: left; padding: 12px 18px; background: #fafbfc; color: var(--muted); font-weight: 600; font-size: 12.5px; text-transform: uppercase; cursor: pointer; border-bottom: 1px solid var(--border); }
table td { padding: 13px 18px; border-bottom: 1px solid var(--border); color: var(--text); }
table tr:hover td { background: #fafbfc; }
.badge { padding: 4px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 700; }
.badge.green { background: #e3f5ea; color: var(--green); }
.badge.amber { background: #fdf2e0; color: var(--amber); }
.badge.red { background: #fdeceb; color: var(--red); }
.badge.navy { background: #e8edf3; color: var(--navy); }
.severity-pill { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; }

.login-shell { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--navy-deep); }
.login-card { background: #fff; border-radius: 18px; padding: 44px; width: 360px; box-shadow: var(--shadow-lg); }
.login-card h1 { font-size: 22px; color: var(--navy-deep); margin: 6px 0 4px; }
.login-card p.sub { color: var(--muted); font-size: 13.5px; margin-bottom: 26px; }
.warn-box { background: #fdf2e0; border: 1px solid #f3dca6; color: #8a6310; font-size: 12px; border-radius: 10px; padding: 10px 12px; margin-top: 18px; }

.modal-overlay { position: fixed; inset: 0; background: rgba(10,20,35,0.55); display: flex; align-items: center; justify-content: center; z-index: 100; padding: 24px; }
.modal-box { background: #fff; border-radius: 16px; max-width: 640px; width: 100%; max-height: 80vh; overflow-y: auto; padding: 28px; }
.modal-box h2 { margin-top: 0; color: var(--navy-deep); }
.modal-close { float: right; cursor: pointer; font-size: 22px; color: var(--muted); }
.tag-chip { display: inline-block; background: #e8edf3; color: var(--navy); padding: 4px 12px; border-radius: 999px; font-size: 12px; font-weight: 600; margin: 3px; }

/* =========================================================
   LANDING PAGE - sage-green design system (scoped to body.landing)
   ========================================================= */
body.landing {
  background: #eef3e7;
  color: #16241b;
}
body.landing .lp-wrap { max-width: 1180px; margin: 0 auto; padding: 0 28px; }

/* Floating pill nav */
body.landing .lp-nav {
  position: sticky; top: 0; z-index: 50; padding: 22px 28px 0;
}
body.landing .lp-nav-inner {
  max-width: 1180px; margin: 0 auto; background: #f4f8ee; border: 1px solid #dde6d2;
  border-radius: 999px; padding: 14px 14px 14px 22px; display: flex; align-items: center;
  justify-content: space-between; box-shadow: 0 4px 18px rgba(22,36,27,0.05);
}
body.landing .lp-brand { display: flex; align-items: center; gap: 9px; font-weight: 800; font-size: 16px; color: #16241b; }
body.landing .lp-brand .lp-plus { color: #2f5d34; }
body.landing .lp-nav-links { display: flex; gap: 30px; font-size: 14px; font-weight: 600; color: #3a4a3c; }
body.landing .lp-nav-links a:hover { color: #16241b; }
body.landing .lp-btn-pill {
  display: inline-flex; align-items: center; gap: 8px; background: #1f3a23; color: #fff;
  padding: 11px 20px; border-radius: 999px; font-weight: 700; font-size: 13.5px; border: none; cursor: pointer;
}
body.landing .lp-btn-pill .lp-go {
  width: 22px; height: 22px; border-radius: 50%; background: #8de36b; display: flex; align-items: center; justify-content: center; color: #16241b;
}
body.landing .lp-btn-outline {
  display: inline-flex; align-items: center; gap: 8px; background: #fff; color: #16241b; border: 1.5px solid #d8e2cb;
  padding: 11px 20px; border-radius: 999px; font-weight: 700; font-size: 13.5px; cursor: pointer;
}
@media (max-width: 800px) { body.landing .lp-nav-links { display: none; } }

/* Hero */
body.landing .lp-hero { text-align: center; padding: 70px 28px 0; }
body.landing .lp-badge {
  display: inline-flex; align-items: center; gap: 6px; background: #d9eec4; color: #2f5d34;
  padding: 7px 16px; border-radius: 999px; font-size: 12.5px; font-weight: 700; margin-bottom: 26px;
}
body.landing .lp-hero h1 {
  font-size: 54px; line-height: 1.12; font-weight: 800; letter-spacing: -1px; max-width: 800px; margin: 0 auto 22px; color: #16241b;
}
body.landing .lp-highlight {
  background: #d9eec4; color: #1f3a23; padding: 2px 14px; border-radius: 10px; display: inline-block;
  border: 2px dotted #2f5d34;
}
body.landing .lp-hero p.lp-sub { max-width: 560px; margin: 0 auto 30px; font-size: 16.5px; color: #4d5c4e; line-height: 1.6; }
body.landing .lp-cta-row { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin-bottom: 50px; }

/* Gallery strip */
body.landing .lp-gallery {
  border: 3px solid #8de36b; border-radius: 26px; padding: 14px; display: flex; gap: 12px;
  max-width: 980px; margin: 0 auto 50px; background: #fff;
}
body.landing .lp-tile {
  flex: 1; border-radius: 18px; min-height: 230px; display: flex; align-items: center; justify-content: center;
  color: #fff; position: relative; overflow: hidden;
}
body.landing .lp-tile svg { width: 56px; height: 56px; opacity: 0.95; }
body.landing .lp-tile.t1 { background: linear-gradient(150deg,#2f5d34,#163b1c); }
body.landing .lp-tile.t2 { background: linear-gradient(150deg,#3f7a46,#1f3a23); }
body.landing .lp-tile.t3 { background: linear-gradient(150deg,#557d3e,#2c4a23); }
@media (max-width: 700px) { body.landing .lp-gallery { flex-direction: column; } body.landing .lp-tile { min-height: 160px; } }

/* Partners strip */
body.landing .lp-partners { text-align: center; padding: 0 28px 70px; }
body.landing .lp-partners .lp-label { font-size: 13px; color: #6b7a6c; margin-bottom: 22px; }
body.landing .lp-partner-row { display: flex; justify-content: center; gap: 40px; flex-wrap: wrap; }
body.landing .lp-partner-item { display: flex; align-items: center; gap: 8px; color: #4d5c4e; font-weight: 700; font-size: 14px; opacity: 0.75; }
body.landing .lp-partner-item svg { width: 18px; height: 18px; }

/* Dark story-style section */
body.landing .lp-story {
  background: #16241b; border-radius: 30px; padding: 56px; margin: 0 28px 80px; color: #fff;
  display: flex; gap: 50px; align-items: center; max-width: 1180px; margin-left: auto; margin-right: auto;
}
body.landing .lp-story-left { flex: 1; min-width: 280px; }
body.landing .lp-story-badge {
  display: inline-flex; align-items: center; gap: 6px; background: rgba(141,227,107,0.16); color: #8de36b;
  padding: 6px 14px; border-radius: 999px; font-size: 12px; font-weight: 700; margin-bottom: 16px;
}
body.landing .lp-story h2 { font-size: 30px; font-weight: 800; color: #fff; margin: 0 0 14px; line-height: 1.25; }
body.landing .lp-story p { color: #c7d4c3; font-size: 15px; line-height: 1.65; margin-bottom: 22px; }
body.landing .lp-story-right { flex: 1; min-width: 280px; display: flex; flex-direction: column; gap: 14px; }
body.landing .lp-stat-card {
  background: #fff; border-radius: 16px; padding: 18px 22px; display: flex; align-items: center; gap: 14px;
}
body.landing .lp-stat-card .lp-stat-icon { width: 42px; height: 42px; border-radius: 12px; background: #d9eec4; display: flex; align-items: center; justify-content: center; color: #1f3a23; flex-shrink: 0; }
body.landing .lp-stat-card .lp-stat-num { font-size: 22px; font-weight: 800; color: #16241b; }
body.landing .lp-stat-card .lp-stat-label { font-size: 12.5px; color: #6b7a6c; }
@media (max-width: 860px) { body.landing .lp-story { flex-direction: column; padding: 36px 24px; } }

/* Generic landing sections (who/purpose/privacy/duration) restyled in palette */
body.landing .lp-section { padding: 70px 28px; }
body.landing .lp-section-title { text-align: center; max-width: 680px; margin: 0 auto 46px; }
body.landing .lp-section-title .lp-eyebrow { color: #2f5d34; font-weight: 700; letter-spacing: 1px; font-size: 12.5px; text-transform: uppercase; }
body.landing .lp-section-title h2 { font-size: 30px; margin: 10px 0 12px; color: #16241b; font-weight: 800; }
body.landing .lp-section-title p { color: #5b6a5c; font-size: 15.5px; line-height: 1.6; }
body.landing .lp-card {
  background: #fff; border: 1px solid #e3ead9; border-radius: 18px; padding: 26px; box-shadow: 0 4px 18px rgba(22,36,27,0.04);
}
body.landing .lp-card .lp-icon-circle {
  width: 44px; height: 44px; border-radius: 12px; background: #16241b; color: #8de36b;
  display: flex; align-items: center; justify-content: center; margin-bottom: 14px;
}
body.landing .lp-card h3 { margin: 0 0 8px; font-size: 16.5px; color: #16241b; }
body.landing .lp-card p { color: #5b6a5c; font-size: 14px; line-height: 1.6; margin: 0; }
body.landing .lp-grid { display: grid; gap: 20px; }
body.landing .lp-grid-3 { grid-template-columns: repeat(3,1fr); }
body.landing .lp-grid-4 { grid-template-columns: repeat(4,1fr); }
@media (max-width: 900px) { body.landing .lp-grid-3, body.landing .lp-grid-4 { grid-template-columns: repeat(2,1fr); } }
@media (max-width: 600px) { body.landing .lp-grid-3, body.landing .lp-grid-4 { grid-template-columns: 1fr; } }

body.landing .lp-privacy {
  background: #16241b; color: #fff; border-radius: 26px; padding: 46px; display: flex; gap: 36px; align-items: center; flex-wrap: wrap;
}
body.landing .lp-privacy h2 { color: #fff; }
body.landing .lp-privacy p { color: #c7d4c3; }
body.landing .lp-privacy-list { list-style: none; padding: 0; margin: 16px 0 0; }
body.landing .lp-privacy-list li { padding: 6px 0 6px 28px; position: relative; color: #dbe6d6; font-size: 14.5px; }
body.landing .lp-privacy-list li svg { position: absolute; left: 0; top: 9px; color: #8de36b; }

body.landing .lp-footer { padding: 40px 28px; text-align: center; color: #6b7a6c; font-size: 13.5px; border-top: 1px solid #dde6d2; }


/* ================================================================
   NEW v2 ADDITIONS
   ================================================================ */

/* Warning banner (duplicate detection) */
.warning-banner {
  background: #fffbeb;
  border: 1.5px solid #f3dca6;
  color: #7a5c0e;
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 14px;
  margin-bottom: 20px;
}

/* Urgency flag inside AI bubble */
.urgency-flag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  font-weight: 600;
  color: #d6543d;
  background: #fff4f2;
  border: 1px solid #f9c9c0;
  border-radius: 20px;
  padding: 3px 10px;
  margin-top: 10px;
}

/* User bubble urgent highlight */
.bubble-urgent {
  border-left: 3px solid #d6543d !important;
}

/* Share section on completion screen */
.share-section {
  background: var(--sage-light, #f0f7ee);
  border: 1.5px solid var(--sage, #c3e6b0);
  border-radius: 14px;
  padding: 20px 22px;
  margin: 18px 0 8px;
  text-align: center;
}

.share-label {
  font-size: 13.5px;
  color: var(--muted);
  margin-bottom: 14px;
}

.share-buttons {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 16px;
  border-radius: 24px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  border: none;
  transition: opacity 0.2s, transform 0.15s;
}

.share-btn:hover { opacity: 0.85; transform: translateY(-1px); }

.share-wa   { background: #25D366; color: #fff; }
.share-li   { background: #0077B5; color: #fff; }
.share-copy { background: var(--navy); color: #fff; }

/* Duplicate detection checkbox field */
.field input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--green);
  cursor: pointer;
}
/* ================================================================
   TOOLTIP BADGE — popup is injected into body via JS (tooltip-portal)
   so it is never clipped by any overflow:hidden ancestor.
   ================================================================ */
.tip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: #d8e4d8;
  color: #3a4a3c;
  font-size: 9.5px;
  font-weight: 800;
  cursor: help;
  position: relative;
  vertical-align: middle;
  margin-left: 5px;
  flex-shrink: 0;
  transition: background .15s, color .15s;
  line-height: 1;
  font-style: normal;
  border: 1px solid #c0d4c0;
  text-decoration: none;
  font-family: 'Segoe UI', Arial, sans-serif;
  user-select: none;
  z-index: 1;
}
.tip:hover,
.tip.tip-active {
  background: #16241b;
  color: #8de36b;
  border-color: #16241b;
}

/* The JS portal tooltip — injected as #tip-portal into <body> */
#tip-portal {
  position: fixed;
  z-index: 999999;
  background: #16241b;
  color: #e8f5e0;
  font-size: 12.5px;
  font-weight: 400;
  line-height: 1.5;
  padding: 10px 14px;
  border-radius: 9px;
  max-width: 240px;
  box-shadow: 0 4px 24px rgba(0,0,0,.3);
  pointer-events: none;
  opacity: 0;
  transition: opacity .15s;
  font-family: 'Segoe UI', Arial, sans-serif;
  white-space: normal;
  word-break: break-word;
}
#tip-portal.visible {
  opacity: 1;
}
#tip-portal::after {
  content: '';
  position: absolute;
  border: 5px solid transparent;
  border-top-color: #16241b;
  left: 50%;
  transform: translateX(-50%);
  top: 100%;
}
#tip-portal.arrow-up::after {
  top: auto;
  bottom: 100%;
  border-top-color: transparent;
  border-bottom-color: #16241b;
}


/* Old CSS tooltip ::after removed — using JS portal (tooltip.js) instead */

/* If the tip is near the right edge, flip popup left */
/* tip-left removed — portal handles positioning */

/* ================================================================
   GLOBAL MOBILE RESPONSIVE OVERHAUL
   Target breakpoints: 900px (tablet), 600px (mobile), 380px (small)
   ================================================================ */

/* ── Landing / public pages ── */
@media (max-width: 900px) {
  body.landing .lp-hero { padding: 60px 20px 40px; }
  body.landing .lp-hero h1 { font-size: 36px; }
  body.landing .lp-hero p.lp-sub { font-size: 15px; }
  body.landing .lp-nav-inner { padding: 12px 18px; }
  body.landing .lp-badge { font-size: 12px; }
  body.landing .lp-cta-row { flex-direction: column; align-items: center; gap: 10px; }
  body.landing .lp-wrap { padding: 0 16px; }
  body.landing .lp-card { padding: 24px 18px !important; }
  body.landing .lp-story-grid { flex-direction: column; gap: 24px; }
  body.landing .lp-stats-float { position: static; margin-top: 20px; }
  body.landing .lp-partner-strip { gap: 16px; flex-wrap: wrap; justify-content: center; }
}

@media (max-width: 600px) {
  body.landing .lp-hero h1 { font-size: 28px; }
  body.landing .lp-gallery { flex-direction: column; }
  body.landing .lp-tile { min-height: 120px; }
  .field-row { grid-template-columns: 1fr !important; gap: 0 !important; }
  .lp-btn-pill { padding: 12px 20px; font-size: 13.5px; width: 100%; justify-content: center; }
}

/* ── Registration form ── */
@media (max-width: 700px) {
  .form-page { margin: 24px auto; padding: 0 14px; }
  .field-row { grid-template-columns: 1fr; }
}

/* ── Survey chat ── */
@media (max-width: 860px) {
  .chat-wrap { max-width: 100%; border-radius: 0; height: 100dvh; }
  .chat-topbar { padding: 10px 14px; }
  .chat-header { padding: 10px 14px; }
  .chat-body { padding: 14px 12px; }
  .chat-footer { padding: 10px 12px; }
  .bubble { max-width: 88%; font-size: 14px; }
  .choice-row { flex-wrap: wrap; gap: 7px; }
  .choice-btn { font-size: 12.5px; padding: 7px 13px; }
  .done-screen { padding: 24px 18px; }
  .share-buttons { flex-direction: column; align-items: center; }
}

/* ── Admin shell shared ── */
@media (max-width: 900px) {
  /* On mobile: revert to normal body scroll so the page works naturally */
  .admin-shell {
    height: auto !important;
    overflow: visible !important;
    min-height: 100vh;
  }
  .dash-main {
    height: auto !important;
    overflow-y: visible !important;
  }
  /* Sidebar becomes off-canvas drawer */
  .admin-sidebar {
    position: fixed !important;
    left: -260px !important;
    top: 0; bottom: 0; z-index: 200;
    width: 240px !important;
    min-width: 240px !important;
    transition: left .25s ease;
    box-shadow: 4px 0 32px rgba(0,0,0,.25);
  }
  .admin-sidebar.open { left: 0 !important; }

  /* Overlay behind open sidebar */
  .sidebar-overlay, .sb-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,.4); z-index: 199;
    display: none;
  }
  .sidebar-overlay.open, .sb-overlay.open { display: block; }

  /* Mobile topbar visible */
  .mobile-topbar { display: flex !important; }
  .mobile-topbar-dash { display: flex !important; }

  /* Hide sticky desktop topbar on mobile */
  .dash-topbar { display: none !important; }
  .admin-topbar { display: none !important; }

  /* Main content full width */
  .admin-main { padding: 16px 14px !important; max-width: 100% !important; }
  .dash-main { width: 100%; }
}

/* ── Admin dashboard KPI grid ── */
@media (max-width: 900px) {
  .kpi-grid-new { grid-template-columns: repeat(3, 1fr) !important; padding: 16px 14px 0 !important; gap: 12px !important; }
}
@media (max-width: 600px) {
  .kpi-grid-new { grid-template-columns: repeat(2, 1fr) !important; gap: 10px !important; }
  .kpi-val { font-size: 26px !important; }
}
@media (max-width: 380px) {
  .kpi-grid-new { grid-template-columns: 1fr 1fr !important; }
}

/* ── Admin charts grid ── */
@media (max-width: 900px) {
  .chart-grid-new { grid-template-columns: 1fr !important; }
  .chart-card-new.span2,
  .chart-card-new.span3 { grid-column: span 1 !important; }
  .dash-section { padding: 16px 14px 0 !important; }
  .analysis-charts-grid { grid-template-columns: 1fr !important; }
}

/* ── Admin participant table ── */
@media (max-width: 900px) {
  .table-card-new { border-radius: 10px; }
  .table-toolbar-new { flex-direction: column; align-items: flex-start; gap: 10px; }
  .table-search { width: 100% !important; }
  table.dash-table td:nth-child(4),
  table.dash-table th:nth-child(4),
  table.dash-table td:nth-child(5),
  table.dash-table th:nth-child(5) { display: none; } /* hide email/phone on tablet */
}
@media (max-width: 600px) {
  table.dash-table td:nth-child(3),
  table.dash-table th:nth-child(3) { display: none; } /* hide company type on mobile */
  table.dash-table td { font-size: 12px; padding: 9px 10px; }
  table.dash-table th { font-size: 10px; padding: 8px 10px; }
}

/* ── Admin AI analysis card ── */
@media (max-width: 900px) {
  .ai-card { padding: 18px 16px; }
  .analysis-charts-grid { grid-template-columns: 1fr; gap: 12px; }
  .build-first { padding: 12px 14px; }
}

/* ── Builder (bulk email) ── */
@media (max-width: 900px) {
  .builder-shell { grid-template-columns: 1fr !important; }
  .builder-left { position: static !important; height: auto !important; max-height: none; }
  .builder-right { padding: 16px !important; }
  .format-row { flex-direction: column; }
}

/* ── Settings tabs ── */
@media (max-width: 600px) {
  .settings-tabs { padding: 0 14px; gap: 0; }
  .settings-tab { padding: 12px 14px; font-size: 12px; }
  .tab-pane { padding: 16px 14px !important; }
  .s-card { padding: 18px 16px !important; }
  .s-card-header { gap: 10px; }
  .field-row-2 { grid-template-columns: 1fr !important; }
  .export-grid { grid-template-columns: 1fr !important; }
  .format-row { flex-direction: column; }
  .btn-save, .btn-export { width: 100%; justify-content: center; }
}

/* ── Skip analytics ── */
@media (max-width: 900px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr) !important; }
  .chart-card { padding: 16px !important; }
}
@media (max-width: 600px) {
  .kpi-grid { grid-template-columns: 1fr 1fr !important; }
  .kpi-card { padding: 14px 12px !important; }
  .value { font-size: 28px !important; }
}

/* ── Modal ── */
@media (max-width: 700px) {
  .modal-overlay { padding: 20px 10px; align-items: flex-end; }
  .modal-box { border-radius: 16px 16px 0 0; max-height: 90vh; padding: 22px 18px; }
  .modal-close { top: 12px; right: 12px; }
}

/* ── Installer ── */
@media (max-width: 600px) {
  .install-card { padding: 28px 18px !important; border-radius: 14px; }
  .install-shell { padding: 16px; }
  .field-row-2 { grid-template-columns: 1fr !important; }
}

/* ── Login page ── */
@media (max-width: 480px) {
  .login-shell { padding: 20px 14px; }
  .login-card { padding: 28px 20px; border-radius: 14px; }
}

/* ── Completion / done screen ── */
@media (max-width: 600px) {
  .done-screen { padding: 24px 16px; }
  .done-screen h2 { font-size: 22px; }
  .share-buttons { flex-direction: column; gap: 8px; }
  .share-btn { width: 100%; justify-content: center; }
  .icon-circle { width: 54px; height: 54px; }
}

/* ── Utilities ── */
@media (max-width: 600px) {
  .lp-hero h1 { font-size: 28px !important; }
  h1 { font-size: 24px !important; }
  h2 { font-size: 20px !important; }
}

/* Touch target minimums */
@media (max-width: 900px) {
  button, .btn, .lp-btn-pill, .sb-link, .admin-link, .choice-btn {
    min-height: 44px;
  }
  .choice-btn { min-height: 40px; }
}

/* Prevent horizontal scroll globally */
html, body { max-width: 100%; overflow-x: hidden; }
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* ── Shared admin sidebar classes (used across all admin pages) ── */
.sb-brand {
  display: flex; align-items: center; gap: 10px;
  padding: 0 20px 24px; font-size: 15px; font-weight: 800; color: #fff;
  border-bottom: 1px solid rgba(255,255,255,.08); margin-bottom: 12px;
}
.sb-brand svg { color: #8de36b; }
.sb-label {
  font-size: 10px; font-weight: 700; letter-spacing: 1.2px;
  text-transform: uppercase; color: rgba(255,255,255,.35);
  padding: 16px 20px 6px;
}
.sb-link {
  display: flex; align-items: center; gap: 9px;
  padding: 10px 20px; color: rgba(255,255,255,.65);
  font-size: 13.5px; font-weight: 500; text-decoration: none;
  transition: all .15s; border-left: 3px solid transparent; margin: 1px 0;
}
.sb-link:hover { color: #fff; background: rgba(255,255,255,.07); }
.sb-link.active { color: #8de36b; background: rgba(141,227,107,.08); border-left-color: #8de36b; }
.sb-link svg { flex-shrink: 0; opacity: .75; }
.sb-link.active svg { opacity: 1; }
.sb-spacer { flex: 1; }
.sb-divider { border: none; border-top: 1px solid rgba(255,255,255,.08); margin: 10px 0; }
.sb-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.4);
  z-index: 199; display: none;
}
.sb-overlay.open { display: block; }
.hamburger-btn {
  background: none; border: none; cursor: pointer;
  color: #fff; padding: 4px; display: flex;
}
.mobile-topbar-dash {
  display: none; align-items: center;
  justify-content: space-between; padding: 14px 18px;
  background: #16241b; position: sticky; top: 0; z-index: 20;
}
.mobile-topbar-dash .brand {
  color: #fff; font-size: 15px; font-weight: 800;
  display: flex; align-items: center; gap: 8px;
}

/* ================================================================
   STICKY TOPBAR — CORRECT APPROACH
   The admin layout uses two independent scroll containers side by side:
     - .admin-sidebar: height:100vh; overflow-y:auto  (scrolls independently)
     - .dash-main:     height:100vh; overflow-y:auto  (scrolls independently)
   With .admin-shell: height:100vh; overflow:hidden  (clips both columns)
   
   Inside .dash-main, position:sticky; top:0 works correctly because
   .dash-main IS the scroll container — the topbar sticks to its top.
   ================================================================ */

.admin-shell {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

.dash-main {
  flex: 1;
  min-width: 0;
  height: 100vh;
  overflow-y: auto;
  scroll-behavior: smooth;
  display: flex;
  flex-direction: column;
}

/* Topbar sticks to top of .dash-main scroll container */
.dash-topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: #fff;
  border-bottom: 1px solid #e4ebe4;
  box-shadow: 0 1px 8px rgba(0,0,0,.06);
  flex-shrink: 0;
}

/* Settings tabs stick just below the topbar */
.settings-tabs {
  position: sticky;
  top: 65px;
  z-index: 49;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,.04);
  flex-shrink: 0;
}

/* Tooltip overflow fix removed — using JS portal instead */
