/* ═══════════════════════════════════════════════════════════════════════════
   GIST - Go-to Intelligence & Sales Technology Hub
   assets/css/app.css - Complete design system
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── CSS Variables - Dark theme (default) ─────────────────────────────── */
:root, [data-theme="dark"] {
  --bg:    #06080b;
  --bg1:   #0b0f17;
  --bg2:   #0f1420;
  --bg3:   #131926;
  --bg4:   #171e2e;
  --line:  #1a2236;
  --line2: #1f2a42;
  --line3: #263350;
  --a:     #e8893a;
  --a2:    #f5a623;
  --adim:  rgba(232,137,58,.1);
  --ahl:   rgba(232,137,58,.18);
  --txt:   #eceef6;
  --txt2:  #8a93ad;
  --txt3:  #424d66;
  --g:     #34d399;
  --gdim:  rgba(52,211,153,.1);
  --r:     #f87171;
  --rdim:  rgba(248,113,113,.1);
  --pu:    #a78bfa;
  --pudim: rgba(167,139,250,.1);
  --y:     #fbbf24;
  --ydim:  rgba(251,191,36,.1);
  --mono: 'JetBrains Mono','Fira Mono',Consolas,monospace;
  --ui:   -apple-system,BlinkMacSystemFont,'Segoe UI',Helvetica,Arial,sans-serif;
  --nav-h:  56px;
  --rad:    8px;
  --rad2:   12px;
  --rad3:   16px;
  --shadow: 0 4px 24px rgba(0,0,0,.4);
}

/* ── Light theme ──────────────────────────────────────────────────────── */
[data-theme="light"] {
  --bg:    #f5f6fa;
  --bg1:   #ffffff;
  --bg2:   #f0f2f8;
  --bg3:   #e8eaf2;
  --bg4:   #dde0ee;
  --line:  #e2e4ef;
  --line2: #d4d7e8;
  --line3: #c4c8dc;
  --txt:   #1a1f36;
  --txt2:  #4a5270;
  --txt3:  #8890ae;
  --shadow: 0 4px 24px rgba(0,0,0,.1);
}

/* ── Reset ────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 15px; -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg);
  color: var(--txt);
  font-family: var(--ui);
  line-height: 1.7;
  min-height: 100vh;
  overflow-x: hidden; /* prevent horizontal scroll on mobile */
  transition: background .2s, color .2s;
}
img { max-width: 100%; display: block; }
a { color: var(--a); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, textarea, select { font-family: inherit; }

/* ── Scroll progress bar ─────────────────────────────────────────────── */
.top-bar {
  position: fixed; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, var(--a), var(--a2), #f87171);
  transform-origin: left; transform: scaleX(0); z-index: 200;
  transition: transform .1s linear;
}

/* ── Top navigation ──────────────────────────────────────────────────── */
.topnav {
  position: sticky; top: 0; z-index: 100;
  background: var(--bg1);
  border-bottom: 1px solid var(--line);
  height: var(--nav-h);
}
.topnav-inner {
  display: flex; align-items: center;
  height: 100%; padding: 0 16px;
  max-width: 1600px; margin: 0 auto;
  gap: 0;
}
.topnav-left  { display: flex; align-items: center; gap: 10px; margin-right: 24px; }
.topnav-right { display: flex; align-items: center; gap: 8px; margin-left: auto; }

.topnav-logo {
  display: flex; align-items: baseline; gap: 6px;
  text-decoration: none;
}
.logo-mark {
  font-family: var(--mono);
  font-size: 17px; font-weight: 700; letter-spacing: 4px;
  background: linear-gradient(135deg, var(--a) 0%, var(--a2) 50%, #f87171 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.logo-sub {
  font-size: 10px; color: var(--txt3); letter-spacing: .04em;
  display: none;
}
@media (min-width: 1024px) { .logo-sub { display: inline; } }

.topnav-links {
  display: none; align-items: center; gap: 0; height: var(--nav-h);
}
@media (min-width: 1024px) { .topnav-links { display: flex; } }

.nav-link {
  display: flex; align-items: center; gap: 5px;
  padding: 0 14px; height: var(--nav-h);
  font-size: 13.5px; color: var(--txt2);
  text-decoration: none; transition: color .12s;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}
.nav-link:hover { color: var(--txt); text-decoration: none; }
.nav-link.active { color: var(--a); border-bottom-color: var(--a); font-weight: 500; }

.nav-badge {
  min-width: 18px; height: 18px; padding: 0 5px;
  background: var(--r); color: #fff;
  border-radius: 9px; font-size: 10px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--mono);
}

.icon-btn {
  width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--rad); font-size: 16px;
  color: var(--txt2); transition: all .12s;
  text-decoration: none;
}
.icon-btn:hover { background: var(--bg2); color: var(--txt); text-decoration: none; }

.user-chip {
  display: flex; align-items: center; gap: 7px;
  padding: 4px 10px 4px 4px;
  border: 1px solid var(--line2); border-radius: 100px;
  background: var(--bg2);
}
.user-avatar {
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--adim); border: 1px solid rgba(232,137,58,.3);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--mono); font-size: 11px; font-weight: 700; color: var(--a);
  flex-shrink: 0;
}
.user-name { font-size: 12.5px; color: var(--txt2); }
.signout-link {
  font-size: 13px; color: var(--txt3);
  text-decoration: none; transition: color .12s;
}
.signout-link:hover { color: var(--r); text-decoration: none; }

.hamburger {
  width: 36px; height: 36px;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 5px;
  border-radius: var(--rad); transition: background .12s;
}
@media (min-width: 1024px) { .hamburger { display: none; } }
.hamburger:hover { background: var(--bg2); }
.hamburger span {
  display: block; width: 18px; height: 1.5px;
  background: var(--txt2); border-radius: 2px;
  transition: all .2s;
}

/* ── Mobile drawer ────────────────────────────────────────────────────── */
.drawer-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.6); z-index: 110;
  backdrop-filter: blur(2px);
}
.drawer-overlay.open { display: block; }

.drawer {
  position: fixed; top: 0; left: 0; bottom: 0;
  width: min(300px, 85vw);
  background: var(--bg1); z-index: 120;
  display: flex; flex-direction: column;
  transform: translateX(-100%); transition: transform .25s cubic-bezier(.4,0,.2,1);
  border-right: 1px solid var(--line);
  overflow-y: auto;
}
.drawer.open { transform: translateX(0); }

.drawer-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 20px; border-bottom: 1px solid var(--line);
}
.drawer-close {
  width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--rad); color: var(--txt3); font-size: 14px;
  transition: all .12s;
}
.drawer-close:hover { background: var(--bg2); color: var(--txt); }

.drawer-nav { flex: 1; padding: 8px 0; }
.drawer-footer { padding: 8px 0; border-top: 1px solid var(--line); }

.drawer-link {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 20px; font-size: 14px; color: var(--txt2); /* larger touch target */
  text-decoration: none; transition: all .12s;
  border-left: 2px solid transparent;
  min-height: 44px; /* touch target */
}
.drawer-link:hover { background: var(--bg2); color: var(--txt); text-decoration: none; }
.drawer-link.active { color: var(--a); background: var(--adim); border-left-color: var(--a); font-weight: 500; }
.drawer-icon { font-size: 15px; opacity: .7; flex-shrink: 0; }
.drawer-badge {
  margin-left: auto; min-width: 18px; height: 18px; padding: 0 5px;
  background: var(--r); color: #fff; border-radius: 9px;
  font-size: 10px; font-weight: 700; display: flex; align-items: center; justify-content: center;
}

/* ── Page body ────────────────────────────────────────────────────────── */
.page-body { min-height: calc(100vh - var(--nav-h)); }

/* Breathing room below topnav */
.layout-main,
.dash,
.tp-page,
[style*="max-width:1100px"],
[style*="max-width:860px"] {
  padding-top: max(20px, env(safe-area-inset-top));
}
@media(max-width:640px){
  .layout-main { padding-top: 16px; }
}

/* ── Two-column layout ────────────────────────────────────────────────── */
.layout-split {
  display: grid;
  grid-template-columns: 220px 1fr;
  min-height: calc(100vh - var(--nav-h));
}
@media (max-width: 1023px) { .layout-split { grid-template-columns: 1fr; } }

.layout-sidebar {
  border-right: 1px solid var(--line);
  background: var(--bg1);
  position: sticky; top: var(--nav-h); height: calc(100vh - var(--nav-h));
  overflow-y: auto; flex-shrink: 0;
  scrollbar-width: thin; scrollbar-color: var(--line2) transparent;
}
@media (max-width: 1023px) { .layout-sidebar { display: none; } }

.layout-main { padding: 28px 32px 80px; }
@media (max-width: 640px) { .layout-main { padding: 14px 14px 60px; } }

.sb-group { margin-top: 4px; }
.sb-group-label {
  font-family: var(--mono); font-size: 9px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .12em;
  color: var(--txt3); padding: 10px 16px 4px;
}
.sb-link {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 16px; font-size: 12.5px; color: var(--txt2);
  text-decoration: none; transition: all .12s;
  border-left: 2px solid transparent; cursor: pointer;
}
.sb-link:hover { color: var(--txt); background: var(--bg2); border-left-color: var(--line2); text-decoration: none; }
.sb-link.active { color: var(--a); background: var(--adim); border-left-color: var(--a); font-weight: 500; }
.sb-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.sb-badge {
  margin-left: auto; min-width: 18px; height: 16px; padding: 0 4px;
  background: var(--rdim); border: 1px solid rgba(248,113,113,.2);
  color: var(--r); border-radius: 8px; font-family: var(--mono);
  font-size: 10px; display: flex; align-items: center; justify-content: center;
}

/* ── Typography ───────────────────────────────────────────────────────── */
.page-title   { font-size: 22px; font-weight: 700; color: var(--txt); margin-bottom: 6px; }
.page-subtitle { font-size: 14px; color: var(--txt2); margin-bottom: 24px; }

h2 {
  font-size: 18px; font-weight: 600; color: var(--txt);
  margin-bottom: 16px; padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 8px;
}
h3 { font-size: 14px; font-weight: 600; color: var(--txt); margin: 22px 0 8px; }
h4 {
  font-family: var(--mono); font-size: 9.5px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .1em;
  color: var(--txt3); margin: 18px 0 6px;
}
p { color: var(--txt2); font-size: 14px; margin-bottom: 10px; line-height: 1.7; }
strong { color: var(--txt); }

/* ── Cards ────────────────────────────────────────────────────────────── */
.card {
  background: var(--bg1); border: 1px solid var(--line);
  border-radius: var(--rad2); padding: 18px 20px; margin-bottom: 12px;
}
.card-hd {
  font-size: 13.5px; font-weight: 600; color: var(--txt);
  margin-bottom: 8px; display: flex; align-items: center; gap: 8px;
}
.card-bd { font-size: 13px; color: var(--txt2); line-height: 1.65; }
.card-muted { background: var(--bg2); border-color: var(--line); }
.card-accent { border-left: 3px solid var(--a); }

/* ── Feature grid ─────────────────────────────────────────────────────── */
.feat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px; margin: 14px 0 24px;
}
.feat {
  background: var(--bg1); border: 1px solid var(--line);
  border-radius: var(--rad2); padding: 16px;
  transition: border-color .15s;
}
.feat:hover { border-color: var(--line2); }
.feat-ico  { font-size: 20px; margin-bottom: 8px; }
.feat-name { font-size: 13px; font-weight: 600; color: var(--txt); margin-bottom: 4px; }
.feat-desc { font-size: 12px; color: var(--txt2); line-height: 1.6; }

/* ── Tables ───────────────────────────────────────────────────────────── */
.tbl-wrap { overflow-x: auto; margin: 12px 0 20px; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
thead tr { background: var(--bg2); }
th {
  font-family: var(--mono); font-size: 9.5px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .1em; color: var(--txt3);
  padding: 9px 12px; text-align: left; border-bottom: 2px solid var(--line);
  white-space: nowrap;
}
td { padding: 9px 12px; border-bottom: 1px solid var(--line); color: var(--txt2); vertical-align: top; }
tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: var(--bg2); }
td code {
  font-family: var(--mono); font-size: 11px;
  background: var(--bg2); border: 1px solid var(--line2);
  padding: 1px 6px; border-radius: 4px; color: var(--a);
}

/* ── Code ─────────────────────────────────────────────────────────────── */
pre {
  background: var(--bg1); border: 1px solid var(--line);
  border-radius: var(--rad2); padding: 18px; overflow-x: auto;
  margin: 12px 0 20px;
  font-family: var(--mono); font-size: 12px; line-height: 1.8;
}
code {
  font-family: var(--mono); font-size: 12px;
  background: var(--bg2); border: 1px solid var(--line2);
  padding: 2px 6px; border-radius: 4px; color: var(--a);
}

/* ── Forms ────────────────────────────────────────────────────────────── */
.form-group { margin-bottom: 16px; }
.form-label {
  display: block; font-size: 12px; font-weight: 600;
  color: var(--txt2); margin-bottom: 6px;
  text-transform: uppercase; letter-spacing: .06em;
}
.form-input, .form-select, .form-textarea {
  width: 100%; padding: 9px 12px;
  background: var(--bg2); border: 1px solid var(--line2);
  border-radius: var(--rad); color: var(--txt); font-size: 13.5px;
  transition: border-color .12s;
  appearance: none;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none; border-color: var(--a);
  box-shadow: 0 0 0 3px var(--adim);
}
.form-textarea { resize: vertical; min-height: 80px; font-family: var(--ui); }
.form-error { font-size: 12px; color: var(--r); margin-top: 4px; }
.form-help  { font-size: 12px; color: var(--txt3); margin-top: 4px; }

/* ── Buttons ──────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 18px; border-radius: var(--rad);
  font-size: 13px; font-weight: 500; cursor: pointer;
  transition: all .12s; text-decoration: none; white-space: nowrap;
  border: 1px solid transparent;
  min-height: 36px; /* touch target */
}
.btn:hover { text-decoration: none; }
.btn-primary   { background: var(--a); color: #fff; border-color: var(--a); }
.btn-primary:hover { background: var(--a2); border-color: var(--a2); }
.btn-secondary { background: var(--bg2); color: var(--txt); border-color: var(--line2); }
.btn-secondary:hover { background: var(--bg3); border-color: var(--line3); }
.btn-ghost     { background: transparent; color: var(--txt2); border-color: var(--line); }
.btn-ghost:hover { background: var(--bg2); color: var(--txt); }
.btn-danger    { background: var(--rdim); color: var(--r); border-color: rgba(248,113,113,.3); }
.btn-danger:hover { background: rgba(248,113,113,.2); }
.btn-sm { padding: 5px 12px; font-size: 12px; min-height: 30px; }
.btn-xs { padding: 4px 9px; font-size: 11px; min-height: 28px; }
.btn-full { width: 100%; justify-content: center; }

/* ── Pills / badges ───────────────────────────────────────────────────── */
.pill {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 10px; border-radius: 100px;
  font-size: 11px; font-family: var(--mono); border: 1px solid;
  white-space: nowrap;
}
.pill-a  { background: var(--adim);  border-color: rgba(232,137,58,.25); color: var(--a); }
.pill-g  { background: var(--gdim);  border-color: rgba(52,211,153,.25);  color: var(--g); }
.pill-r  { background: var(--rdim);  border-color: rgba(248,113,113,.25); color: var(--r); }
.pill-pu { background: var(--pudim); border-color: rgba(167,139,250,.25); color: var(--pu); }
.pill-y  { background: var(--ydim);  border-color: rgba(251,191,36,.25);  color: var(--y); }
.pill-dim { background: var(--bg2); border-color: var(--line2); color: var(--txt3); }

/* ── Alerts ───────────────────────────────────────────────────────────── */
.alert { border-radius: var(--rad); padding: 12px 14px; margin: 12px 0; font-size: 13px; line-height: 1.6; }
.alert-info  { background: var(--adim); border: 1px solid rgba(232,137,58,.2); color: var(--txt2); }
.alert-tip   { background: var(--gdim); border: 1px solid rgba(52,211,153,.2);  color: var(--txt2); }
.alert-warn  { background: var(--rdim); border: 1px solid rgba(248,113,113,.2); color: var(--txt2); }
.alert-error { background: var(--rdim); border: 1px solid rgba(248,113,113,.4); color: var(--r); }

/* ── Steps ────────────────────────────────────────────────────────────── */
.steps { margin: 12px 0 22px; counter-reset: step; }
.step { display: flex; gap: 14px; margin-bottom: 14px; align-items: flex-start; counter-increment: step; }
.step-n {
  width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, var(--a), var(--a2));
  display: flex; align-items: center; justify-content: center;
  font-family: var(--mono); font-size: 11px; font-weight: 700; color: #fff;
}
.step-n::before { content: counter(step); }
.step-bd { flex: 1; padding-top: 3px; }
.step-title { font-size: 13px; font-weight: 600; color: var(--txt); margin-bottom: 2px; }
.step-desc  { font-size: 13px; color: var(--txt2); }

/* ── Article card - list view ─────────────────────────────────────────── */
.article-card {
  background: var(--bg1); border: 1px solid var(--line);
  border-radius: var(--rad2); padding: 14px 16px; margin-bottom: 8px;
  transition: border-color .12s;
}
.article-card:hover { border-color: var(--line2); }
.article-card.watched { border-left: 3px solid var(--a); }
.article-card.read    { opacity: .55; }

.article-hd {
  display: flex; align-items: center; gap: 7px;
  margin-bottom: 6px; flex-wrap: wrap;
}
.article-time { font-size: 11px; color: var(--txt3); margin-left: auto; }
.article-title {
  font-size: 13.5px; font-weight: 600; color: var(--txt);
  margin-bottom: 4px; line-height: 1.5;
}
.article-title a { color: var(--txt); text-decoration: none; }
.article-title a:hover { color: var(--a); }
.article-summary { font-size: 12.5px; color: var(--txt2); line-height: 1.6; }
.article-actions {
  display: flex; gap: 6px; margin-top: 10px; align-items: center; flex-wrap: wrap;
}
.read-dot {
  width: 8px; height: 8px; border-radius: 50%;
  border: 1.5px solid var(--txt3); cursor: pointer;
  flex-shrink: 0; margin-left: auto; transition: all .12s;
}
.read-dot.read { background: var(--txt3); }
.read-dot:hover { border-color: var(--a); }

/* ── Article grid / card view ─────────────────────────────────────────── */
.article-grid-view {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 10px;
}
/* In grid view, cards have no bottom margin (gap handles spacing) */
.article-grid-view .article-card {
  margin-bottom: 0;
  display: flex; flex-direction: column;
}
.article-grid-view .article-title { font-size: 13px; }
.article-grid-view .article-summary {
  font-size: 12px; flex: 1;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical;
  overflow: hidden;
}
.article-grid-view .article-actions { margin-top: auto; padding-top: 10px; }
/* Favicon-style source indicator in grid mode */
.article-source-indicator {
  width: 14px; height: 14px; border-radius: 2px;
  background: var(--bg2); border: 1px solid var(--line2);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 9px; color: var(--txt3); flex-shrink: 0;
  font-family: var(--mono);
}

/* ── Vendor chip ──────────────────────────────────────────────────────── */
.vendor-chip {
  font-size: 11px; padding: 2px 8px; border-radius: 100px;
  font-weight: 500; white-space: nowrap;
}
.vendor-chip-active {
  background: var(--adim); border: 1px solid rgba(232,137,58,.25); color: var(--a);
}
.vendor-chip-competitor {
  background: var(--bg2); border: 1px solid var(--line2); color: var(--txt3);
}

/* ── Knowledge score bar ──────────────────────────────────────────────── */
.kscore-wrap { display: flex; align-items: center; gap: 10px; }
.kscore-bar-bg { flex: 1; height: 5px; background: var(--line2); border-radius: 3px; overflow: hidden; }
.kscore-bar-fill { height: 100%; border-radius: 3px; background: linear-gradient(90deg, var(--a), var(--a2)); transition: width .4s ease; }
.kscore-bar-fill.low  { background: var(--r); }
.kscore-bar-fill.mid  { background: var(--y); }
.kscore-bar-fill.high { background: linear-gradient(90deg, var(--a), var(--a2)); }
.kscore-pct { font-family: var(--mono); font-size: 12px; color: var(--txt2); flex-shrink: 0; min-width: 36px; text-align: right; }

/* ── Vendor grid card ─────────────────────────────────────────────────── */
.vendor-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 10px; margin: 16px 0;
}
.vendor-card {
  background: var(--bg1); border: 1px solid var(--line);
  border-radius: var(--rad2); padding: 18px;
  cursor: pointer; transition: border-color .12s;
  text-decoration: none; display: block;
}
.vendor-card:hover { border-color: var(--line2); text-decoration: none; }
.vendor-card-hd { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 12px; }
.vendor-logo-sq {
  width: 42px; height: 42px; border-radius: var(--rad);
  border: 1px solid var(--line2);
  background: var(--bg2);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--mono); font-size: 12px; font-weight: 700;
  color: var(--a); flex-shrink: 0;
}
.vendor-card-name { font-size: 14px; font-weight: 600; color: var(--txt); margin-bottom: 2px; }
.vendor-card-cat  { font-size: 11px; color: var(--txt3); }

/* ── Page tabs ────────────────────────────────────────────────────────── */
.page-tabs {
  display: flex; border-bottom: 1px solid var(--line);
  margin-bottom: 22px; gap: 0; overflow-x: auto;
  scrollbar-width: none;
}
.page-tabs::-webkit-scrollbar { display: none; }
.page-tab {
  padding: 10px 18px; font-size: 13px; color: var(--txt2);
  cursor: pointer; border-bottom: 2px solid transparent;
  white-space: nowrap; transition: all .12s; text-decoration: none;
  min-height: 44px; display: flex; align-items: center; /* touch target */
}
.page-tab:hover { color: var(--txt); text-decoration: none; }
.page-tab.active { color: var(--a); border-bottom-color: var(--a); font-weight: 500; }
.tab-count { font-size: 11px; color: var(--txt3); margin-left: 4px; }

/* ── Upload zone ──────────────────────────────────────────────────────── */
.upload-zone {
  border: 1.5px dashed var(--line2); border-radius: var(--rad2);
  padding: 28px; text-align: center; cursor: pointer;
  transition: all .15s; color: var(--txt3); font-size: 13px;
}
.upload-zone:hover { border-color: var(--a); background: var(--adim); color: var(--txt2); }
.upload-zone.drag-over { border-color: var(--a); background: var(--adim); }
.upload-icon { font-size: 28px; margin-bottom: 8px; opacity: .6; }

/* ── Note item ────────────────────────────────────────────────────────── */
.note-item { padding: 12px 0; border-bottom: 1px solid var(--line); }
.note-item:last-child { border-bottom: none; }
.note-meta { display: flex; align-items: center; gap: 8px; margin-bottom: 5px; flex-wrap: wrap; }
.note-author { font-size: 12px; font-weight: 600; color: var(--txt); }
.note-date   { font-size: 11px; color: var(--txt3); }
.note-tag {
  font-size: 10px; padding: 1px 8px; border-radius: 100px;
  background: var(--bg2); border: 1px solid var(--line2);
  color: var(--txt3); font-family: var(--mono);
}
.note-body { font-size: 13px; color: var(--txt2); line-height: 1.6; }

/* ── Coach messages ───────────────────────────────────────────────────── */
.msg-wrap { display: flex; flex-direction: column; gap: 14px; }
.msg-user .msg-bubble {
  background: var(--bg2); border: 1px solid var(--line2);
  border-radius: var(--rad2); padding: 12px 16px;
  font-size: 13px; color: var(--txt); line-height: 1.65;
  max-width: 85%; align-self: flex-end;
}
.msg-ai .msg-bubble {
  background: var(--bg1); border: 1px solid var(--line);
  border-radius: var(--rad2); padding: 16px 18px;
font-size: 13px; color: var(--txt2); line-height: 1.7;
}
.msg-label {
font-size: 10px; text-transform: uppercase; letter-spacing: .08em;
color: var(--txt3); margin-bottom: 5px; font-weight: 600;
}
.source-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.source-chip-item {
font-size: 11px; padding: 2px 9px; border-radius: 100px;
background: var(--bg2); border: 1px solid var(--line2); color: var(--txt3);
}
.followup-chips { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.followup-chip {
font-size: 12px; padding: 5px 12px;
border: 1px solid var(--line2); border-radius: 100px;
cursor: pointer; color: var(--txt2); transition: all .12s;
background: transparent; min-height: 36px;
}
.followup-chip:hover { border-color: var(--a); color: var(--a); background: var(--adim); }/* ── Mode cards (Coach) ───────────────────────────────────────────────── */
.mode-grid {
display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 20px;
}
@media (max-width: 640px) { .mode-grid { grid-template-columns: 1fr; } }
.mode-card {
border: 1px solid var(--line2); border-radius: var(--rad2);
padding: 18px; cursor: pointer; transition: all .15s;
background: var(--bg1);
}
.mode-card:hover { border-color: var(--line3); }
.mode-card.selected { border-color: var(--a); border-width: 1.5px; background: var(--adim); }
.mode-card-icon { font-size: 22px; margin-bottom: 8px; }
.mode-card-name { font-size: 14px; font-weight: 600; color: var(--txt); margin-bottom: 4px; }
.mode-card-desc { font-size: 12px; color: var(--txt2); line-height: 1.55; }/* ── Loader ───────────────────────────────────────────────────────────── */
.loader {
display: flex; align-items: center; justify-content: center;
padding: 40px; color: var(--txt3); font-size: 13px; gap: 10px;
}
.spinner {
width: 20px; height: 20px; border-radius: 50%;
border: 2px solid var(--line2); border-top-color: var(--a);
animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }/* ── Empty state ──────────────────────────────────────────────────────── */
.empty-state { text-align: center; padding: 60px 20px; color: var(--txt3); }
.empty-icon  { font-size: 40px; margin-bottom: 12px; opacity: .5; }
.empty-title { font-size: 16px; font-weight: 600; color: var(--txt2); margin-bottom: 6px; }
.empty-desc  { font-size: 13px; color: var(--txt3); max-width: 360px; margin: 0 auto 16px; }/* ── Auth pages ───────────────────────────────────────────────────────── */
.auth-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.auth-box {
background: var(--bg1); border: 1px solid var(--line);
border-radius: var(--rad3); padding: 36px 40px;
width: 100%; max-width: 420px;
}
@media (max-width: 480px) { .auth-box { padding: 28px 20px; } }
.auth-logo { text-align: center; margin-bottom: 28px; }
.auth-logo .logo-mark { font-size: 28px; letter-spacing: 6px; }
.auth-logo-sub { font-size: 12px; color: var(--txt3); margin-top: 4px; }
.auth-title { font-size: 18px; font-weight: 600; color: var(--txt); margin-bottom: 4px; }
.auth-sub   { font-size: 13px; color: var(--txt2); margin-bottom: 24px; }/* ── Pipeline steps ───────────────────────────────────────────────────── */
.pipe { margin: 16px 0 24px; position: relative; }
.pipe-row { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 4px; position: relative; }
.pipe-row:not(:last-child)::after {
content: ''; position: absolute; left: 16px; top: 34px; bottom: -4px;
width: 2px; background: var(--line2);
}
.pipe-num {
width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0;
background: linear-gradient(135deg, var(--a), var(--a2));
display: flex; align-items: center; justify-content: center;
font-family: var(--mono); font-size: 12px; font-weight: 700; color: #fff;
box-shadow: 0 0 0 3px var(--bg);
}
.pipe-body { padding: 4px 0 20px; }
.pipe-title { font-size: 13px; font-weight: 600; color: var(--txt); margin-bottom: 2px; }
.pipe-desc  { font-size: 13px; color: var(--txt2); line-height: 1.6; }/* ── Divider ──────────────────────────────────────────────────────────── */
hr { border: none; border-top: 1px solid var(--line); margin: 32px 0; }
.divider { height: 1px; background: var(--line); margin: 20px 0; }/* ── Utilities ────────────────────────────────────────────────────────── */
.text-muted  { color: var(--txt3); }
.text-sm     { font-size: 12px; }
.text-xs     { font-size: 11px; }
.text-mono   { font-family: var(--mono); }
.text-right  { text-align: right; }
.text-center { text-align: center; }
.mt-1 { margin-top: 4px; }  .mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 16px; } .mt-4 { margin-top: 24px; }
.mb-1 { margin-bottom: 4px; }  .mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 16px; } .mb-4 { margin-bottom: 24px; }
.flex         { display: flex; }
.flex-center  { display: flex; align-items: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-1 { gap: 4px; } .gap-2 { gap: 8px; } .gap-3 { gap: 12px; }
.flex-wrap { flex-wrap: wrap; }
.ml-auto { margin-left: auto; }/* ── Mobile improvements ─────────────────────────────────────────────── /
@media (max-width: 1023px) {
html { font-size: 15px; }
.article-title   { font-size: 15px; }
.article-summary { font-size: 13.5px; }
.card-hd { font-size: 15px; }
.card-bd { font-size: 14px; }
.nav-link { font-size: 14px; }
.btn { font-size: 14px; }
.form-input { font-size: 16px; } / prevents iOS zoom on focus */
.vendor-card-name { font-size: 15px; }
}@media (max-width: 640px) {
/* Prevent horizontal overflow /
.article-grid-view {
grid-template-columns: 1fr;
}
/ Larger tap targets for article actions */
.article-actions .btn { min-height: 36px; padding: 6px 12px; font-size: 13px; }
.read-dot { width: 10px; height: 10px; }/* Tighter padding */
.card { padding: 14px; }/* Vendor grid single column on very small screens */
.vendor-grid { grid-template-columns: 1fr; }/* Better form spacing on mobile */
.form-input, .form-select { padding: 10px 12px; }/* Page title smaller */
.page-title { font-size: 19px; }
}/* ── Print ────────────────────────────────────────────────────────────── */
@media print {
.topnav, .top-bar, .layout-sidebar, .drawer, .drawer-overlay { display: none !important; }
.page-body { padding: 0; }
body { background: #fff; color: #000; }
.card { border: 1px solid #ccc; }
}/* ── Scrollbar ────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--line2); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--line3); }/* ── Logo powered ─────────────────────────────────────────────────────── */
.logo-powered {
display: block; font-size: 9px; letter-spacing: .08em;
color: var(--txt3); text-transform: uppercase;
font-family: var(--mono); margin-top: 1px; opacity: .7;
}
.topnav-logo:hover .logo-powered { opacity: 1; }

/* ── Company logo: mobile optimizations ── */
.topnav-logo {
  align-items: center !important;  /* center vertically when logo is image */
}
.topnav-logo img {
  max-height: 32px !important;
  max-width: 110px !important;
}
/* Hide "Powered by GIST" on mobile — too cluttered */
@media(max-width:640px) {
  .logo-powered { display: none !important; }
  .topnav-logo img { max-height: 28px !important; max-width: 90px !important; }
}
@media(min-width:641px) and (max-width:1023px) {
  .logo-powered { display: none !important; }
  .topnav-logo img { max-height: 30px !important; max-width: 120px !important; }
}
/* ══════════════════════════════════════════════
   MOBILE OPTIMIZATIONS (added 2026-04)
══════════════════════════════════════════════ */

/* Topnav: tighter on mobile */
@media(max-width:640px){
  .topnav { padding:0 12px; height:52px; }
  .topnav-logo .logo-mark { font-size:18px; }
  .page-title { font-size:20px; }
  .page-subtitle { font-size:12px; }
}

/* Bottom nav: larger tap targets */
@media(max-width:1023px){
  .bottom-nav-link { min-width:48px; padding:8px 4px; }
  .bottom-nav-icon { font-size:20px; }
  .bottom-nav-label { font-size:10px; }
}

/* Cards: reduce padding on mobile */
@media(max-width:480px){
  .card { border-radius:10px; }
  .card-bd { padding:14px; }
  .card-hd { padding:12px 14px; font-size:13px; }
}

/* Buttons: full-width on small screens where appropriate */
@media(max-width:400px){
  .btn-primary { padding:10px 16px; font-size:13px; }
}

/* Vendor grid: 1 col on mobile */
@media(max-width:540px){
  .vendor-grid { grid-template-columns:1fr !important; }
}

/* Feed sidebar: hide on mobile (handled by JS toggle) */
@media(max-width:768px){
  .layout-sidebar { padding:0; }
}

/* Article cards: tighter */
@media(max-width:480px){
  .article-card { padding:12px 12px; }
  .article-title { font-size:13px; }
  .article-summary { font-size:12px; -webkit-line-clamp:2; }
}

/* Coach modes: 2x2 grid on mobile */
@media(max-width:480px){
  .coach-modes { grid-template-columns:1fr 1fr !important; gap:6px; }
  .mode-card { padding:10px 6px; }
  .mode-icon { font-size:18px; }
  .mode-label { font-size:10px; }
}

/* Coach selects: stack on mobile */
@media(max-width:480px){
  .coach-selects { grid-template-columns:1fr !important; }
}

/* Dashboard KPI strip: 2x2 on mobile */
@media(max-width:480px){
  .kpi-strip { grid-template-columns:1fr 1fr !important; gap:8px; }
  .kpi-val { font-size:26px; }
}

/* Vendor health grid: 1 col on small mobile */
@media(max-width:400px){
  .vh-card { padding:12px; }
  .vh-name { font-size:12px; }
}

/* Topics notes grid: full width */
@media(max-width:640px){
  .notes-stats { grid-template-columns:repeat(2,1fr) !important; }
  .note-card { padding:14px; border-radius:10px; }
  .note-form-row { flex-direction:column; }
  .note-form-row .btn { width:100%; }
  .note-form-row input, .note-form-row select { width:100% !important; min-width:unset !important; }
}

/* Modal: full-screen on mobile */
@media(max-width:480px){
  .modal-box { width:100vw; max-height:90vh; border-radius:14px 14px 0 0; position:fixed; bottom:0; }
  .modal-overlay { align-items:flex-end; }
}

/* Vendor page tabs: scroll horizontally */
@media(max-width:600px){
  .vendor-tabs { overflow-x:auto; -webkit-overflow-scrolling:touch; flex-wrap:nowrap !important; }
  .vendor-tabs .tab-link { white-space:nowrap; padding:8px 10px; font-size:12px; }
}

/* Vendor overview 2-col: stack on mobile */
@media(max-width:600px){
  .ov-grid { grid-template-columns:1fr !important; }
  .ov-kpi-strip { grid-template-columns:repeat(2,1fr) !important; }
  .ov-kpi-val { font-size:22px; }
}

/* Input sizing on mobile */
@media(max-width:480px){
  .form-input { font-size:16px !important; } /* prevents iOS zoom */
}

/* Fix overflow on auth pages */
@media(max-width:400px){
  .auth-box { margin:8px; padding:24px 16px; }
}
