/* Lens: modern app shell. Light by default; dark is its own selected palette. */
:root {
  color-scheme: light;
  --bg: #f6f5f2;
  --surface: #ffffff;
  --surface-2: #fbfaf8;
  --line: #e9e6e0;
  --line-strong: #d9d5cc;
  --text: #17160f;
  --text-2: #57544c;
  --text-3: #8b877c;
  --accent: #a8741a;          /* brass */
  --accent-ink: #7d5512;
  --accent-soft: #f6ecd9;
  --good: #13795b; --good-soft: #e3f3ec;
  --bad: #b4372f;  --bad-soft: #fbe9e7;
  --warn: #9a6400; --warn-soft: #fbf0d9;
  --s1: #2a78d6; --s2: #eb6834; --s3: #1baf7a; --s4: #eda100;
  --shadow: 0 1px 2px rgba(23, 22, 15, .04), 0 4px 16px rgba(23, 22, 15, .05);
  --radius: 16px;
  --radius-sm: 10px;
  --font: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
}
@supports (font-variation-settings: normal) { :root { --font: 'InterVariable', 'Inter', ui-sans-serif, system-ui, sans-serif; } }
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #121210;
  --surface: #1b1b18;
  --surface-2: #20201d;
  --line: #2c2b27;
  --line-strong: #3a3934;
  --text: #f0efec;
  --text-2: #c3c2b7;
  --text-3: #8f8d84;
  --accent: #d9a548;
  --accent-ink: #e8bd6c;
  --accent-soft: #2d2617;
  --good: #4cc79a; --good-soft: #15291f;
  --bad: #ef7d74;  --bad-soft: #301b19;
  --warn: #e0ad4a; --warn-soft: #2c2414;
  --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 20px rgba(0, 0, 0, .25);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--text); font: 15px/1.5 var(--font); font-feature-settings: 'cv11', 'ss01'; -webkit-font-smoothing: antialiased; }
a { color: inherit; }
.hidden { display: none !important; }
.muted { color: var(--text-2); }
.faint { color: var(--text-3); }
.num { font-variant-numeric: tabular-nums; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ---------- logo ---------- */
.logo { display: flex; align-items: center; gap: 10px; font-weight: 650; font-size: 18px; letter-spacing: -.01em; }
.logo-mark { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: linear-gradient(140deg, #c9952f, #8a5d12); color: #fff; font-weight: 700; font-size: 16px; box-shadow: inset 0 1px 0 rgba(255,255,255,.25); }

/* ---------- gate ---------- */
.gate { min-height: 100%; display: grid; place-items: center; padding: 24px; }
.gate-card { width: 100%; max-width: 380px; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 32px; box-shadow: var(--shadow); }
.gate-card h1 { font-size: 24px; letter-spacing: -.02em; margin: 28px 0 6px; }
.gate-card p { margin: 0 0 20px; }
.gate-card input { width: 100%; margin-bottom: 12px; }
.gate-error { color: var(--bad); font-size: 14px; min-height: 20px; margin-top: 10px; }

/* ---------- controls ---------- */
input, select { font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius-sm); padding: 10px 12px; outline: none; transition: border-color .15s, box-shadow .15s; }
input:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.btn { font: inherit; font-weight: 550; border: 1px solid var(--line-strong); background: var(--surface); color: var(--text); padding: 9px 14px; border-radius: var(--radius-sm); cursor: pointer; display: inline-flex; align-items: center; gap: 8px; transition: background .15s, border-color .15s; }
.btn:hover { background: var(--surface-2); border-color: var(--text-3); }
.btn-primary { background: var(--text); color: var(--bg); border-color: var(--text); }
.btn-primary:hover { background: var(--text-2); border-color: var(--text-2); }
.btn-block { width: 100%; justify-content: center; padding: 12px; }
.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 3px; gap: 2px; }
.seg button { font: inherit; font-size: 14px; font-weight: 550; border: 0; background: transparent; color: var(--text-2); padding: 6px 12px; border-radius: 9px; cursor: pointer; }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.search { position: relative; }
.search svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--text-3); width: 18px; height: 18px; }
.search input { padding-left: 36px; width: 260px; }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: 248px 1fr; min-height: 100%; }
.side { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 28px; padding: 22px 14px; border-right: 1px solid var(--line); background: var(--bg); }
.side > .logo { padding: 0 10px; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-group { font-size: 12px; font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: .06em; padding: 16px 12px 6px; }
.nav-link { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 10px; color: var(--text-2); text-decoration: none; font-weight: 520; font-size: 15px; border: 0; background: none; cursor: pointer; width: 100%; text-align: left; font-family: inherit; }
.nav-link:hover { background: var(--surface); color: var(--text); }
.nav-link.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.nav-link.on svg { color: var(--accent); }
.nav-link.subtle { font-size: 14px; padding: 7px 12px; }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 2px; }

.main { min-width: 0; padding: 28px 40px 80px; max-width: 1320px; width: 100%; }
.top { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.top h1 { margin: 0; font-size: 28px; letter-spacing: -.025em; line-height: 1.15; font-weight: 680; }
.eyebrow { color: var(--text-3); font-size: 14px; font-weight: 520; margin-bottom: 4px; }
.top-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

.tabbar { display: none; }

/* ---------- layout ---------- */
.grid { display: grid; gap: 16px; }
.g-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-main { grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); }
.g-stack { grid-template-columns: 1fr; }
@media (min-width: 1101px) { .g-stack table th.r, .g-stack table td.r { width: 1%; white-space: nowrap; padding-left: 36px; } }
@media (min-width: 1101px) { .g-stack .chart-box { height: 360px; } }
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; align-items: center; gap: 10px; }
.between { justify-content: space-between; }
.wrap { flex-wrap: wrap; }
.mt { margin-top: 16px; } .mt-l { margin-top: 28px; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); min-width: 0; }
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card-title { font-size: 16px; font-weight: 640; letter-spacing: -.01em; margin: 0; }
.card-sub { font-size: 13px; color: var(--text-3); }
.card-link { font-size: 14px; color: var(--accent-ink); text-decoration: none; font-weight: 550; cursor: pointer; background: none; border: 0; font-family: inherit; }
.card-link:hover { text-decoration: underline; }

/* ---------- stat tiles ---------- */
.stat-label { font-size: 13px; color: var(--text-2); font-weight: 520; }
.stat-value { font-size: 30px; font-weight: 680; letter-spacing: -.03em; margin: 6px 0 8px; font-variant-numeric: tabular-nums; line-height: 1.1; }
.stat-foot { display: flex; gap: 8px; flex-wrap: wrap; font-size: 13px; color: var(--text-3); }
.pill { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); color: var(--text-2); border: 1px solid var(--line); white-space: nowrap; }
.pill.up { background: var(--good-soft); color: var(--good); border-color: transparent; }
.pill.down { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
.pill.neutral { background: var(--surface-2); }
.pill.brass { background: var(--accent-soft); color: var(--accent-ink); border-color: transparent; }

/* ---------- welcome / hero ---------- */
.hero { background: linear-gradient(135deg, var(--accent-soft), var(--surface) 60%); border: 1px solid var(--line); border-radius: 20px; padding: 24px 26px; display: flex; gap: 18px; align-items: flex-start; box-shadow: var(--shadow); }
.hero-icon { width: 44px; height: 44px; border-radius: 12px; background: var(--surface); display: grid; place-items: center; color: var(--accent); border: 1px solid var(--line); flex: none; }
.hero h2 { margin: 0 0 6px; font-size: 19px; letter-spacing: -.015em; }
.hero p { margin: 0; color: var(--text-2); max-width: 760px; }

/* ---------- change feed ---------- */
.feed { display: flex; flex-direction: column; }
.feed-item { display: grid; grid-template-columns: 40px 1fr auto; gap: 14px; padding: 14px 0; border-top: 1px solid var(--line); align-items: start; }
.feed-item:first-child { border-top: 0; padding-top: 4px; }
.feed-ic { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--line); color: var(--text-2); }
.feed-ic svg { width: 18px; height: 18px; }
.feed-ic.budget { color: var(--s1); } .feed-ic.bidding { color: var(--s2); } .feed-ic.promotion { color: var(--accent); } .feed-ic.targeting { color: var(--s3); }
.feed-title { font-weight: 600; letter-spacing: -.005em; }
.feed-detail { color: var(--text-2); font-size: 14px; margin-top: 2px; overflow-wrap: anywhere; }
.feed-meta { font-size: 13px; color: var(--text-3); text-align: right; white-space: nowrap; }
.feed-extra { margin-top: 10px; display: flex; flex-direction: column; gap: 8px; }
.why { background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; font-size: 14px; color: var(--text-2); }
.why b { color: var(--text); font-weight: 600; }
.why .quote { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; margin-top: 2px; white-space: pre-wrap; }
.why.open .quote { -webkit-line-clamp: unset; }
.effect { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; font-size: 13px; color: var(--text-3); }

/* day header in timeline */
.day { font-size: 13px; font-weight: 650; color: var(--text-3); text-transform: uppercase; letter-spacing: .05em; margin: 24px 0 6px; }
.day:first-child { margin-top: 0; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; margin: 0 -20px; padding: 0 20px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-weight: 600; color: var(--text-3); font-size: 12.5px; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 11px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
td.r, th.r { text-align: right; font-variant-numeric: tabular-nums; }
tr.ours td { background: var(--accent-soft); }
tr.ours td:first-child { border-radius: 10px 0 0 10px; } tr.ours td:last-child { border-radius: 0 10px 10px 0; }
.rank { width: 28px; height: 28px; border-radius: 8px; display: inline-grid; place-items: center; font-weight: 650; background: var(--surface-2); border: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.bar { height: 8px; border-radius: 4px; background: var(--surface-2); overflow: hidden; min-width: 80px; }
.bar > span { display: block; height: 100%; border-radius: 4px; background: var(--s1); }

/* ---------- conversations ---------- */
.msg { display: grid; grid-template-columns: 40px 1fr; gap: 12px; padding: 16px 0; border-top: 1px solid var(--line); }
.msg:first-child { border-top: 0; }
.avatar { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-weight: 650; font-size: 14px; color: #fff; }
.av-Nick { background: #2a78d6; } .av-Guy { background: #6250d6; } .av-Mohammed { background: #13795b; } .av-Zak { background: #a8741a; } .av-Someone, .av-Unknown { background: #8b877c; }
.msg-head { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.msg-name { font-weight: 640; }
.msg-time { font-size: 13px; color: var(--text-3); }
.msg-body { white-space: pre-wrap; overflow-wrap: anywhere; margin-top: 2px; color: var(--text); font-size: 14.5px; }
.msg-body.clamp { display: -webkit-box; -webkit-line-clamp: 8; -webkit-box-orient: vertical; overflow: hidden; }
.msg-more { font-size: 13px; color: var(--accent-ink); cursor: pointer; background: none; border: 0; padding: 4px 0; font-weight: 550; font-family: inherit; }
.thread { margin-top: 10px; border-left: 2px solid var(--line-strong); padding-left: 14px; display: flex; flex-direction: column; gap: 10px; }
.file-chip { display: inline-flex; gap: 6px; align-items: center; font-size: 13px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 3px 8px; margin: 6px 6px 0 0; color: var(--text-2); }
.file-chip svg { width: 14px; height: 14px; }

/* ---------- chat ---------- */
.chat { display: flex; flex-direction: column; height: calc(100vh - 150px); min-height: 480px; }
.chat-log { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; padding: 4px 2px 20px; }
.bubble { max-width: 760px; padding: 12px 16px; border-radius: 16px; font-size: 15px; line-height: 1.55; }
.bubble.me { align-self: flex-end; background: var(--text); color: var(--bg); border-bottom-right-radius: 6px; }
.bubble.ai { align-self: flex-start; background: var(--surface); border: 1px solid var(--line); border-bottom-left-radius: 6px; box-shadow: var(--shadow); }
.bubble.ai p:first-child { margin-top: 0; } .bubble.ai p:last-child { margin-bottom: 0; }
.bubble.ai table { font-size: 13px; margin: 8px 0; }
.bubble.ai th, .bubble.ai td { padding: 6px 8px; }
.tools-used { font-size: 12.5px; color: var(--text-3); margin-top: 8px; }
.chat-box { display: flex; gap: 10px; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 18px; padding: 8px 8px 8px 16px; box-shadow: var(--shadow); align-items: flex-end; }
.chat-box textarea { flex: 1; border: 0; outline: 0; resize: none; font: inherit; background: transparent; color: var(--text); padding: 8px 0; max-height: 160px; }
.suggest { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 14px; }
.suggest button { font: inherit; font-size: 14px; border: 1px solid var(--line); background: var(--surface); padding: 8px 12px; border-radius: 12px; cursor: pointer; color: var(--text-2); text-align: left; }
.suggest button:hover { border-color: var(--accent); color: var(--text); }
.typing { display: inline-flex; gap: 4px; }
.typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--text-3); animation: blink 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: .2s; } .typing i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }

/* ---------- health ---------- */
.src { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.src:first-child { border-top: 0; }
.dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.dot.ok { background: var(--good); box-shadow: 0 0 0 4px var(--good-soft); }
.dot.bad { background: var(--bad); box-shadow: 0 0 0 4px var(--bad-soft); }
.dot.none { background: var(--text-3); }

/* ---------- misc ---------- */
.chart-box { position: relative; height: 300px; }
.chart-box.sm { height: 220px; }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 13px; color: var(--text-2); margin-bottom: 10px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 14px; height: 3px; border-radius: 2px; display: inline-block; }
.empty { text-align: center; padding: 40px 20px; color: var(--text-2); }
.empty svg { width: 36px; height: 36px; color: var(--text-3); margin-bottom: 10px; }
.skeleton { background: linear-gradient(90deg, var(--surface-2), var(--line), var(--surface-2)); background-size: 200% 100%; animation: sk 1.4s infinite; border-radius: 10px; }
@keyframes sk { to { background-position: -200% 0; } }
.tooltip { position: fixed; pointer-events: none; background: var(--text); color: var(--bg); font-size: 13px; padding: 6px 10px; border-radius: 8px; z-index: 50; }
.note { font-size: 13px; color: var(--text-3); margin-top: 10px; }
.link-btn { background: none; border: 0; padding: 0; font: inherit; color: var(--accent-ink); cursor: pointer; font-weight: 550; }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .g-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g-main { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  .shell { grid-template-columns: 1fr; }
  .side { display: none; }
  .main { padding: 18px 16px 100px; }
  .top h1 { font-size: 24px; }
  .g-3, .g-2 { grid-template-columns: 1fr; }
  .search input { width: 100%; }
  .search { flex: 1 1 100%; }
  .card { padding: 16px; }
  .stat-value { font-size: 24px; }
  .stat-label { font-size: 12.5px; }
  .stat-foot .pill { white-space: normal; }
  .hero { padding: 18px; }
  .hero-icon { display: none; }
  .grid { gap: 12px; }
  .bar { min-width: 36px; }
  td { overflow-wrap: anywhere; }
  .seg { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
  .seg button { white-space: nowrap; }
  .top-actions select { flex: 1 1 auto; min-width: 0; max-width: 100%; }
  .top-actions { width: 100%; }
  .tabbar { display: flex; position: fixed; bottom: 0; left: 0; right: 0; background: var(--surface); border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); z-index: 20; justify-content: space-around; }
  .tabbar a { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11px; color: var(--text-3); text-decoration: none; padding: 4px 8px; font-weight: 550; }
  .tabbar a.on { color: var(--accent); }
  .feed-item { grid-template-columns: 36px 1fr; }
  .feed-meta { grid-column: 2; text-align: left; }
  .chat { height: calc(100vh - 210px); }
}

/* ---------- taking over guide ---------- */
.guide-intro { font-size: 15.5px; line-height: 1.6; }
.guide-intro p { margin: 0 0 10px; } .guide-intro ul { margin: 0 0 10px; padding-left: 20px; }
.guide-progress { height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; margin-top: 10px; }
.guide-progress > i { display: block; height: 100%; background: var(--accent); border-radius: 99px; transition: width .3s; }
.guide-sec { padding: 0; overflow: hidden; }
.guide-sec > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 12px; padding: 16px 20px; font-weight: 640; font-size: 16px; }
.guide-sec > summary::-webkit-details-marker { display: none; }
.guide-sec > summary .num { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); font-size: 13.5px; flex: none; }
.guide-sec.done > summary .num { background: var(--good); color: #fff; }
.guide-sec > summary .chev { margin-left: auto; transition: transform .2s; color: var(--text-3); }
.guide-sec[open] > summary .chev { transform: rotate(90deg); }
.guide-body { padding: 0 20px 18px 62px; font-size: 15px; line-height: 1.6; }
.guide-body ol, .guide-body ul { padding-left: 20px; margin: 6px 0 12px; } .guide-body li { margin: 6px 0; }
.guide-body p { margin: 8px 0; } .guide-body table { font-size: 14px; margin: 10px 0; } .guide-body td { vertical-align: top; }
.guide-body h4 { margin: 14px 0 4px; font-size: 14.5px; }
.who { display: inline-block; font-size: 11.5px; font-weight: 700; letter-spacing: .02em; padding: 2px 8px; border-radius: 99px; margin-right: 4px; vertical-align: 1px; }
.who.lens { background: var(--s1-soft, rgba(42,120,214,.14)); color: var(--s1, #2a78d6); }
.who.you { background: var(--accent-soft); color: var(--accent-ink); }
.guide-done { margin-top: 6px; }
@media (max-width: 820px) { .guide-body { padding: 0 16px 16px 16px; } .guide-sec > summary { padding: 14px 16px; font-size: 15px; } }

/* Google Ads news page */
.nw-todo { margin: 4px 0 0; padding-left: 22px; font-size: 15px; line-height: 1.55; }
.nw-todo li { margin: 8px 0; }
.nw-todo .who { margin-left: 6px; }
.nw-todo .pill { margin-left: 2px; vertical-align: 1px; }
.nw-find p { margin: 8px 0; font-size: 15px; line-height: 1.6; }
.nw-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.nw-do { margin-top: 12px; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--accent-soft); font-size: 15px; line-height: 1.55; }
.nw-src { margin-top: 10px; font-size: 13.5px; }
.nw-pulse { padding: 12px 0; border-top: 1px solid var(--line); font-size: 14.5px; line-height: 1.55; }
.nw-pulse:first-of-type { border-top: 0; padding-top: 0; }
.nw-skip { margin: 0; padding-left: 20px; font-size: 14px; line-height: 1.55; color: var(--text-2); }
.nw-skip li { margin: 6px 0; }
.nw-raw > summary { cursor: pointer; list-style: none; display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.nw-raw > summary::-webkit-details-marker { display: none; }
.nw-raw[open] > summary { margin-bottom: 12px; }
.nw-raw a { color: var(--text); }
#page-actions select { max-width: 220px; }
