/* AskTheAds app: sign-in, connect flow and the logged-in product.
   Design source: Paper file "AdBeam – Ny design", pages v2 – Dashboard / Chat / Library / Connect. */

:root {
  --ink: #0B0B0B;
  --paper: #FFFFFF;
  --marker: #EDFF3C;
  --graphite: #5C5C5C;
  --muted: #6F6F6F;
  --soft: #F4F4F4;
  --hairline: #E3E3E3;
  --danger: #B42318;

  --serif: "Newsreader", Georgia, serif;
  --sans: "Schibsted Grotesk", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --gutter: 64px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body { background: var(--paper); color: var(--ink); font-family: var(--sans); font-size: 16px; line-height: 1.5;
       -webkit-font-smoothing: antialiased; overflow-x: hidden; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; }
img, svg { display: block; }
[hidden] { display: none !important; }

/* ---------- Type ---------- */
.eyebrow, .label { font-family: var(--mono); font-size: 12.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; line-height: 18px; }
.label--muted { color: var(--graphite); font-weight: 500; }
.mono { font-family: var(--mono); }
.muted { color: var(--graphite); }
.serif { font-family: var(--serif); }
.h1 { font-family: var(--serif); font-weight: 500; font-size: clamp(38px, 4.6vw, 64px); line-height: 1.02; letter-spacing: -.035em; }
.h2 { font-family: var(--serif); font-weight: 500; font-size: clamp(28px, 2.6vw, 36px); line-height: 1.1; letter-spacing: -.025em; }
.h3 { font-family: var(--serif); font-weight: 500; font-size: 24px; line-height: 1.2; letter-spacing: -.02em; }
.question { font-family: var(--serif); font-style: italic; font-size: 28px; line-height: 1.25; letter-spacing: -.015em; }

.mark { position: relative; display: inline; background: linear-gradient(transparent 22%, var(--marker) 22%, var(--marker) 94%, transparent 94%);
        -webkit-box-decoration-break: clone; box-decoration-break: clone; padding: 0 .1em; margin: 0 -.05em; }
.tag { display: inline-flex; align-items: center; gap: 6px; background: var(--marker); color: var(--ink); font-family: var(--mono); font-size: 11.5px;
       font-weight: 600; letter-spacing: .08em; text-transform: uppercase; padding: 3px 8px; line-height: 16px; white-space: nowrap; }
.tag--plain { background: var(--soft); }
.tag--ink { background: var(--ink); color: var(--paper); }
.badge { display: inline-block; background: var(--marker); font-family: var(--mono); font-size: 11px; font-weight: 700; padding: 0 6px; line-height: 18px; margin-left: 6px; }

/* ---------- Wordmark ---------- */
.wordmark { display: inline-flex; align-items: baseline; font-size: 22px; line-height: 1; white-space: nowrap; text-decoration: none; color: var(--ink); }
.wordmark b { font-family: var(--sans); font-weight: 700; letter-spacing: -.04em; }
.wordmark i { font-family: var(--serif); font-style: italic; font-weight: 500; letter-spacing: -.03em; margin: 0 .1em 0 .08em; font-size: 1.04em; }
.wordmark .hl { position: relative; isolation: isolate; padding: 0 .1em 0 .12em; margin-left: .06em; }
.wordmark .hl::before { content: ""; position: absolute; z-index: -1; inset: -.1em 0 -.12em; background: var(--marker); transform: rotate(-1.5deg); }

/* ---------- Buttons & inputs ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; background: var(--ink); color: var(--paper); border: 1px solid var(--ink);
       border-radius: 4px; font-weight: 600; font-size: 15px; line-height: 20px; padding: 11px 18px; text-decoration: none; white-space: nowrap; transition: transform .12s ease, opacity .12s; }
.btn:hover:not(:disabled) { transform: translateY(-1px); }
.btn:disabled { opacity: .35; cursor: not-allowed; }
.btn svg path { stroke: var(--marker); }
.btn--ghost { background: var(--paper); color: var(--ink); border-color: #CFCFCF; }
.btn--ghost svg path { stroke: var(--ink); }
.btn--marker { background: var(--marker); color: var(--ink); border-color: var(--marker); }
.btn--marker svg path { stroke: var(--ink); }
.btn--lg { font-size: 17px; padding: 15px 24px; }
.btn--sm { font-size: 13.5px; padding: 7px 12px; }
.link { background: none; border: 0; padding: 0; text-decoration: underline; text-underline-offset: 3px; font-weight: 500; font-size: 14px; cursor: pointer; }

.field { display: flex; flex-direction: column; gap: 8px; }
.field span { font-family: var(--mono); font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.input { width: 100%; border: 1px solid #CFCFCF; border-radius: 4px; padding: 13px 14px; font-size: 16px; background: var(--paper); outline: none; }
.input:focus { border-color: var(--ink); box-shadow: 0 0 0 3px var(--marker); }
.select { border: 1px solid #CFCFCF; border-radius: 4px; padding: 8px 32px 8px 12px; font-size: 14px; background: var(--paper) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12'%3E%3Cpath d='M2 4l4 4 4-4' fill='none' stroke='%230B0B0B' stroke-width='1.6'/%3E%3C/svg%3E") no-repeat right 10px center; appearance: none; }
.check { width: 18px; height: 18px; accent-color: var(--ink); flex-shrink: 0; }

.notice { border: 1px solid var(--ink); background: var(--marker); padding: 12px 16px; font-size: 14.5px; }
.notice--soft { background: var(--soft); border-color: var(--hairline); }
.error-text { color: var(--danger); font-size: 14px; }

/* ---------- Top bar ---------- */
.topbar { border-bottom: 1px solid var(--hairline); background: var(--paper); position: sticky; top: 0; z-index: 20; }
.topbar__inner { display: flex; align-items: center; gap: 48px; padding: 0 var(--gutter); height: 68px; max-width: 1440px; margin: 0 auto; }
.tabs { display: flex; gap: 32px; flex: 1; height: 100%; }
.tabs > a, .navdrop > a { display: flex; align-items: center; text-decoration: none; color: var(--graphite); font-weight: 500; font-size: 15px; border-bottom: 2px solid transparent; height: 100%; padding-top: 2px; }
.tabs > a:hover, .navdrop > a:hover { color: var(--ink); }
.tabs > a.active, .navdrop > a.active { color: var(--ink); border-bottom-color: var(--ink); }
.who { display: flex; align-items: center; gap: 12px; font-size: 14.5px; font-weight: 500; position: relative; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--ink); color: var(--paper); display: grid; place-items: center; font-family: var(--mono); font-size: 11.5px; font-weight: 600; }
.menu { position: absolute; right: 0; top: 44px; background: var(--paper); border: 1px solid var(--ink); min-width: 200px; padding: 6px 0; box-shadow: 4px 4px 0 var(--ink); }
.menu a, .menu button { display: block; width: 100%; text-align: left; padding: 9px 16px; font-size: 14.5px; text-decoration: none; }
.menu a:hover, .menu button:hover { background: var(--soft); }

/* ---------- Layout ---------- */
.page { max-width: 1440px; margin: 0 auto; padding: 48px var(--gutter) 96px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 40px; margin-bottom: 40px; }
.page-head .eyebrow { margin-bottom: 14px; }
.cols { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 64px; align-items: start; }
.section { border-top: 2px solid var(--ink); padding-top: 18px; margin-bottom: 56px; }
.section__head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.side .section { margin-bottom: 44px; }

/* ---------- Overview ---------- */
.figures { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; padding-bottom: 28px; border-bottom: 1px solid var(--hairline); margin-bottom: 28px; }
.figure > span { display: block; color: var(--graphite); font-size: 14.5px; margin-bottom: 4px; }
.figure b { display: block; font-family: var(--serif); font-weight: 500; font-size: clamp(38px, 3.6vw, 52px); letter-spacing: -.035em; line-height: 1.05; white-space: nowrap; }
.figure small { display: block; font-family: var(--mono); font-size: 12.5px; color: var(--graphite); margin-top: 8px; }
.chart-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 48px; }
.chart svg { width: 100%; height: auto; overflow: visible; }
.legend { display: flex; gap: 18px; align-items: center; margin-bottom: 14px; font-size: 14px; }
.legend i { display: inline-block; width: 10px; height: 10px; margin-right: 6px; vertical-align: -1px; }
.split-row { display: flex; justify-content: space-between; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--hairline); }
.split-row b { font-weight: 600; }

.flag { display: flex; gap: 28px; padding: 22px 0; border-bottom: 1px solid var(--hairline); }
.flag:last-child { border-bottom: 0; }
.flag__body { flex: 1; min-width: 0; }
.flag__title { font-family: var(--serif); font-weight: 500; font-size: 24px; line-height: 1.2; letter-spacing: -.015em; margin-bottom: 6px; }
.flag__meta { font-family: var(--mono); font-size: 12.5px; color: var(--graphite); margin-bottom: 10px; }
.flag__actions { display: flex; gap: 8px; align-items: flex-start; flex-shrink: 0; }

.log-row { display: grid; grid-template-columns: 150px minmax(0, 1fr) 90px 170px; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--hairline); align-items: baseline; font-size: 15px; }
.log-row .mono { font-size: 12.5px; color: var(--graphite); }
.log-row .src { color: var(--graphite); font-size: 14px; text-align: right; }

.acc-row { display: flex; gap: 12px; align-items: flex-start; padding: 13px 0; border-bottom: 1px solid var(--hairline); }
.acc-row .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ink); margin-top: 8px; flex-shrink: 0; }
.acc-row .dot--off { background: transparent; border: 1.5px solid var(--ink); }
.acc-row .dot--err { background: var(--danger); }
.acc-row__body { flex: 1; min-width: 0; }
.acc-row__body small { display: block; font-family: var(--mono); font-size: 12px; color: var(--graphite); overflow: hidden; text-overflow: ellipsis; }

.copybox { display: flex; border: 1px solid var(--ink); }
.copybox code { flex: 1; min-width: 0; padding: 11px 12px; font-family: var(--mono); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.copybox .btn { border-radius: 0; }

.ask-chip { display: flex; justify-content: space-between; gap: 14px; width: 100%; text-align: left; padding: 14px 0; border-bottom: 1px solid var(--hairline); font-family: var(--serif); font-style: italic; font-size: 21px; line-height: 1.25; }
.ask-chip:hover { background: linear-gradient(transparent 60%, var(--marker) 60%); }

table.camps { width: 100%; border-collapse: collapse; font-size: 15px; }
table.camps th { font-family: var(--mono); font-size: 11.5px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; color: var(--graphite); text-align: right; padding: 0 12px 10px; border-bottom: 1px solid var(--ink); white-space: nowrap; }
table.camps td { padding: 12px; border-bottom: 1px solid var(--hairline); text-align: right; font-family: var(--mono); font-size: 14px; white-space: nowrap; }
table.camps th:first-child, table.camps td:first-child { text-align: left; font-family: var(--sans); font-size: 15px; white-space: normal; }
table.camps th:first-child { font-family: var(--mono); font-size: 11.5px; }
table.camps tr.hot td { background: var(--marker); }
table.camps td small { display: block; font-family: var(--mono); font-size: 11.5px; color: var(--graphite); }
.table-scroll { overflow-x: auto; }

.empty { padding: 32px 0; color: var(--graphite); }
.skeleton { background: linear-gradient(90deg, var(--soft), #EAEAEA, var(--soft)); background-size: 200% 100%; animation: sk 1.2s infinite; border-radius: 2px; }
@keyframes sk { to { background-position: -200% 0; } }

/* ---------- Chat ---------- */
.chat-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; padding-bottom: 22px; border-bottom: 2px solid var(--ink); }
.chat-head .h2 { overflow-wrap: anywhere; }
.chat-head__btns { display: flex; gap: 8px; flex-shrink: 0; position: relative; }
.msg { display: grid; grid-template-columns: 132px minmax(0, 1fr); gap: 0; padding: 26px 0; border-bottom: 1px solid var(--hairline); }
.msg__who { font-family: var(--mono); font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; line-height: 20px; }
.msg__who small { display: block; font-weight: 400; color: var(--graphite); }
.msg--user .msg__text { font-family: var(--serif); font-style: italic; font-size: 28px; line-height: 1.25; letter-spacing: -.015em; }
.msg__looked { font-family: var(--mono); font-size: 12px; color: var(--muted); margin-bottom: 10px; }
.prose { font-size: 17px; line-height: 1.6; }
.prose > * + * { margin-top: 12px; }
.prose ul, .prose ol { padding-left: 22px; }
.prose li + li { margin-top: 4px; }
.prose strong { font-weight: 700; }
.prose h3, .prose h4 { font-family: var(--serif); font-weight: 500; font-size: 22px; letter-spacing: -.01em; }
.prose code { font-family: var(--mono); font-size: 14px; background: var(--soft); padding: 1px 5px; }
.prose table { border-collapse: collapse; width: 100%; font-size: 15px; display: block; overflow-x: auto; }
.prose th { font-family: var(--mono); font-size: 11.5px; font-weight: 500; letter-spacing: .06em; text-transform: uppercase; color: var(--graphite); text-align: left; padding: 0 14px 8px 0; border-bottom: 1px solid var(--ink); white-space: nowrap; }
.prose td { padding: 10px 14px 10px 0; border-bottom: 1px solid var(--hairline); }
.prose td.num, .prose th.num { text-align: right; font-family: var(--mono); font-size: 14px; white-space: nowrap; }

.change { border: 1px solid var(--ink); margin-top: 4px; }
.change__top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--hairline); }
.change__body { padding: 16px; display: flex; justify-content: space-between; gap: 18px; align-items: flex-start; }
.change__summary { font-size: 18px; font-weight: 600; line-height: 1.35; }
.change__summary small { display: block; font-family: var(--mono); font-size: 12px; font-weight: 400; color: var(--graphite); margin-top: 6px; }
.change__foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--hairline); }
.change__foot .btns { display: flex; gap: 8px; }
.change--done .change__top { background: var(--soft); }

.composer { position: sticky; bottom: 0; background: var(--paper); padding: 18px 0 20px; border-top: 2px solid var(--ink); margin-top: 8px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.chip-btn { border: 1px solid #CFCFCF; border-radius: 999px; padding: 6px 13px; font-size: 14px; background: var(--paper); }
.chip-btn:hover { border-color: var(--ink); }
.composer__box { display: flex; gap: 10px; align-items: flex-end; border: 1px solid var(--ink); padding: 8px 8px 8px 16px; }
.composer__box textarea { flex: 1; border: 0; outline: none; resize: none; font-family: var(--serif); font-style: italic; font-size: 21px; line-height: 1.35; padding: 6px 0; max-height: 200px; background: transparent; }
.composer__note { font-family: var(--mono); font-size: 11.5px; color: var(--graphite); margin-top: 10px; }
.thinking { display: flex; align-items: center; gap: 10px; font-family: var(--mono); font-size: 13px; color: var(--graphite); }
.thinking i { width: 8px; height: 8px; background: var(--ink); animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: .15; } }
.chat-empty { padding: 56px 0 24px; }
.chat-empty .h1 { margin-bottom: 18px; }
.history { position: absolute; right: 0; top: 46px; width: 340px; max-height: 420px; overflow: auto; background: var(--paper); border: 1px solid var(--ink); box-shadow: 4px 4px 0 var(--ink); z-index: 10; }
.history button { display: block; width: 100%; text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--hairline); font-size: 14.5px; }
.history button:hover { background: var(--soft); }
.history small { display: block; font-family: var(--mono); font-size: 11.5px; color: var(--graphite); }

/* ---------- Library ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: center; padding: 14px 0; border-top: 2px solid var(--ink); border-bottom: 1px solid var(--hairline); margin-bottom: 28px; font-size: 14.5px; }
.seg { display: inline-flex; border: 1px solid #CFCFCF; border-radius: 4px; overflow: hidden; }
.seg button { padding: 7px 12px; font-size: 14px; border-right: 1px solid #CFCFCF; }
.seg button:last-child { border-right: 0; }
.seg button.on { background: var(--ink); color: var(--paper); }
.filters label { display: inline-flex; gap: 8px; align-items: center; }
.filters .spacer { flex: 1; }
.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px 28px; }
.ad { display: flex; flex-direction: column; border-top: 1px solid var(--ink); padding-top: 14px; }
.ad__thumb { min-height: 190px; max-height: 300px; background: var(--soft); margin-bottom: 14px; overflow: hidden; position: relative; display: flex; }
.ad__thumb img { width: 100%; aspect-ratio: 1.25; object-fit: cover; }
.ad__thumb .tag { position: absolute; top: 10px; left: 10px; }
.ad__thumb .fmt { position: absolute; top: 10px; right: 10px; background: var(--paper); font-family: var(--mono); font-size: 11px; padding: 2px 7px; border: 1px solid var(--hairline); }
.textad { padding: 18px; display: flex; flex-direction: column; gap: 6px; background: var(--paper); border: 1px solid var(--hairline); margin: 14px; flex: 1; overflow: hidden; }
.textad small { font-size: 12px; color: var(--graphite); }
.textad b { color: #1A0DAB; font-weight: 500; font-size: 17px; line-height: 1.3; }
.textad p { font-size: 13.5px; color: #4D5156; line-height: 1.45; }
.ad__name { font-weight: 600; font-size: 16px; line-height: 1.3; }
.ad__meta { font-family: var(--mono); font-size: 12px; color: var(--graphite); margin: 4px 0 12px; }
.ad__nums { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--hairline); border-bottom: 1px solid var(--hairline); padding: 10px 0; margin-bottom: 12px; }
.ad__nums span { font-size: 12px; color: var(--graphite); display: block; }
.ad__nums b { font-family: var(--mono); font-size: 14px; font-weight: 500; }
.ad__actions { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: auto; }

/* ---------- Auth & connect ---------- */
.flow-top { border-bottom: 1px solid var(--hairline); }
.flow-top__inner { display: flex; align-items: center; justify-content: space-between; height: 68px; padding: 0 var(--gutter); max-width: 1440px; margin: 0 auto; font-size: 14.5px; }
.flow { max-width: 960px; margin: 0 auto; padding: 40px 24px 96px; }
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 56px; }
.steps div { border-top: 2px solid var(--hairline); padding-top: 10px; font-family: var(--mono); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--graphite); }
.steps div.done, .steps div.on { border-top-color: var(--ink); color: var(--ink); font-weight: 600; }
.flow-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 40px; margin-bottom: 40px; }
.flow-head p { max-width: 340px; font-size: 17px; line-height: 1.55; }
.platforms { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-bottom: 44px; }
.platform { border: 1px solid var(--ink); padding: 26px 28px; display: flex; flex-direction: column; }
.platform .h2 { margin: 6px 0 18px; }
.platform dl { border-top: 1px solid var(--ink); margin-bottom: 22px; }
.platform dl div { display: grid; grid-template-columns: 86px 1fr; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--hairline); font-size: 15px; }
.platform dt { font-family: var(--mono); font-size: 12px; font-weight: 600; letter-spacing: .08em; padding-top: 2px; }
.platform__foot { display: flex; justify-content: space-between; align-items: center; gap: 14px; margin-top: auto; }
.platform__foot small { font-size: 12.5px; color: var(--graphite); text-align: right; }
.connected-note { display: inline-flex; gap: 8px; align-items: center; font-weight: 600; }
.promises { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; margin-bottom: 44px; }
.promises div { border-top: 2px solid var(--ink); padding-top: 14px; }
.promises h3 { font-family: var(--serif); font-weight: 500; font-size: 21px; margin-bottom: 6px; }
.promises p { color: var(--graphite); font-size: 14.5px; }
.flow-foot { display: flex; justify-content: space-between; align-items: center; gap: 16px; border-top: 1px solid var(--hairline); padding-top: 22px; }
.flow-foot .right { display: flex; gap: 16px; align-items: center; }

.overlay { position: fixed; inset: 0; background: rgba(255,255,255,.82); display: grid; place-items: center; z-index: 50; padding: 20px; }
.modal { background: var(--paper); border: 1px solid var(--ink); box-shadow: 8px 8px 0 var(--ink); width: min(620px, 100%); padding: 32px; max-height: 90vh; overflow: auto; }
.modal .h2 { margin: 8px 0 22px; }
.allow { border-top: 1px solid var(--ink); }
.allow > div { display: grid; grid-template-columns: 120px 1fr; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--hairline); font-size: 15px; }
.allow ul { padding-left: 18px; }
.modal__foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 24px; }

.acc-group { border-top: 2px solid var(--ink); padding-top: 14px; margin-bottom: 36px; }
.acc-pick { display: flex; gap: 14px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--hairline); }
.acc-pick--child { padding-left: 32px; }
.acc-pick__name { flex: 1; min-width: 0; }
.acc-pick__name small { display: block; font-family: var(--mono); font-size: 12px; color: var(--graphite); }

.auth { display: grid; grid-template-columns: 1fr 1fr; min-height: calc(100vh - 69px); }
.auth__pitch { background: var(--ink); color: var(--paper); padding: 72px var(--gutter); display: flex; flex-direction: column; justify-content: space-between; gap: 48px; }
.auth__pitch .h1 { color: var(--paper); }
.auth__pitch .mark { color: var(--ink); }
.auth__pitch .q { font-family: var(--serif); font-style: italic; font-size: 24px; line-height: 1.3; color: #D9D9D9; border-top: 1px solid #333; padding-top: 18px; }
.auth__form { padding: 72px var(--gutter); display: flex; flex-direction: column; justify-content: center; max-width: 560px; width: 100%; }
.auth__form form { display: flex; flex-direction: column; gap: 18px; margin-top: 28px; }
.auth__switch { margin-top: 22px; font-size: 15px; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  :root { --gutter: 32px; }
  .cols { grid-template-columns: 1fr; gap: 24px; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .chart-wrap { grid-template-columns: 1fr; gap: 28px; }
  .tabs { gap: 22px; }
}
@media (max-width: 760px) {
  :root { --gutter: 18px; }
  .topbar__inner { gap: 14px; height: auto; flex-wrap: wrap; padding-top: 12px; }
  .tabs { order: 3; width: 100%; overflow-x: auto; gap: 20px; height: 44px; flex: none; }
  .tabs a { white-space: nowrap; }
  .who { margin-left: auto; }
  .who .who__name { display: none; }
  .page { padding-top: 28px; }
  .page-head, .flow-head, .chat-head { flex-direction: column; align-items: flex-start; gap: 16px; }
  .figures { grid-template-columns: 1fr 1fr; gap: 20px; }
  .flag { flex-direction: column; gap: 14px; }
  .log-row { grid-template-columns: 1fr; gap: 2px; }
  .log-row .src { text-align: left; }
  .msg { grid-template-columns: 1fr; gap: 8px; }
  .msg--user .msg__text { font-size: 23px; }
  .change__body { flex-direction: column; }
  .grid { grid-template-columns: 1fr; }
  .steps { grid-template-columns: repeat(2, 1fr); margin-bottom: 36px; }
  .platforms, .promises { grid-template-columns: 1fr; }
  .flow-foot { flex-direction: column-reverse; align-items: stretch; }
  .flow-foot .right { flex-direction: column; align-items: stretch; }
  .auth { grid-template-columns: 1fr; }
  .auth__pitch { padding: 40px var(--gutter); }
  .auth__form { padding: 40px var(--gutter); }
  .history { width: min(340px, calc(100vw - 36px)); }
  .composer__box textarea { font-size: 18px; }
}

/* ---------- Notifications ---------- */
.bell { position: relative; }
.bell__btn { position: relative; width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; }
.bell__btn:hover { background: var(--soft); }
.bell__n { position: absolute; top: 2px; right: 0; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--marker); border: 1px solid var(--ink);
  font-family: var(--mono); font-size: 10.5px; font-weight: 700; display: grid; place-items: center; }
.bell__pop { position: absolute; right: 0; top: 48px; width: min(380px, calc(100vw - 24px)); max-height: 460px; overflow: auto; background: var(--paper); border: 1px solid var(--ink); box-shadow: 6px 6px 0 var(--ink); z-index: 30; }
.bell__head { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--hairline); }
.bell__item { display: flex; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--hairline); text-decoration: none; }
.bell__item:hover { background: var(--soft); }
.bell__item b { display: block; font-weight: 600; font-size: 14.5px; line-height: 1.3; }
.bell__item small { display: block; color: var(--graphite); font-size: 12.5px; margin-top: 2px; }
.bell__ic { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; flex-shrink: 0; background: var(--soft); }
.bell__item--pending .bell__ic { background: var(--marker); } .bell__item--failed .bell__ic { background: var(--ink); color: var(--paper); }

/* ---------- Print: the overview as a clean report ---------- */
@media print {
  .topbar, .no-print, .flag__actions, .composer, button, .side .copybox, .ask-chip, #more-flags, #more-camps { display: none !important; }
  .page { padding: 0; max-width: none; }
  .cols { grid-template-columns: 1fr; }
  .section { break-inside: avoid; margin-bottom: 28px; }
  .h1 { font-size: 34px; }
  .mark, .tag, table.camps tr.hot td { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  a { text-decoration: none; }
}

/* Grid children may not grow past the viewport because of long, unbreakable content. */
.cols > *, .chart-wrap > * { min-width: 0; }
.select { max-width: 100%; }
@media (max-width: 760px) {
  .figures { grid-template-columns: 1fr; gap: 18px; }
  .figure b { white-space: normal; }
  .filters .select { width: 100%; }
}
/* Campaign and ad names are often long underscore_joined strings: let them break. */
.flag__title, .flag__meta, .ad__name, .ad__meta, .acc-row__body, .change__summary, .log-row span, .prose, .h1, .split-row { overflow-wrap: anywhere; }

/* Admin: AI model picker */
.model-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 32px; border-top: 1px solid var(--hairline); }
.model-grid > .label { grid-column: 1 / -1; }
@media (max-width: 760px) { .model-grid { grid-template-columns: 1fr; } }
.allow > div > div { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.allow ul { margin: 0; }
@media (max-width: 760px) { .allow > div { grid-template-columns: 1fr; gap: 6px; } }

/* Chat: which accounts to ask about */
.scope-bar { position: relative; display: flex; align-items: center; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--hairline); flex-wrap: wrap; }
.scope-btn { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--ink); border-radius: 999px; padding: 7px 14px; font-size: 15px; font-weight: 500; background: var(--paper); max-width: 100%; }
.scope-btn:hover { background: var(--marker); }
.scope-pop { position: absolute; top: 56px; left: 0; z-index: 15; width: min(460px, 100%); background: var(--paper); border: 1px solid var(--ink); box-shadow: 6px 6px 0 var(--ink); display: flex; flex-direction: column; max-height: 520px; }
.scope-pop__top { padding: 14px 16px 6px; border-bottom: 1px solid var(--hairline); }
.scope-pop__top .input { padding: 10px 12px; font-size: 15px; }
.scope-pop__quick { display: flex; gap: 16px; padding: 10px 0 6px; }
.scope-pop__list { overflow: auto; padding: 0 16px; flex: 1; }
.scope-pop__foot { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; border-top: 1px solid var(--hairline); }

/* ---------- Tools ---------- */
.tool-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px; }
.tool-card { display: flex; flex-direction: column; gap: 10px; border-top: 2px solid var(--ink); padding: 20px 0 8px; text-decoration: none; }
.tool-card p { color: var(--graphite); max-width: 520px; }
.tool-card__go { display: inline-flex; gap: 8px; align-items: center; font-weight: 600; margin-top: 6px; }
.tool-card__go svg path { stroke: var(--ink); }
.tool-card:hover .h2 { background: linear-gradient(transparent 60%, var(--marker) 60%); display: inline; }
.tool-form { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; padding: 18px 0 28px; border-top: 2px solid var(--ink); }
.track-head { display: flex; gap: 28px; align-items: center; margin: 8px 0 36px; }
.track-score { width: 118px; height: 118px; border-radius: 50%; display: grid; place-content: center; text-align: center; border: 3px solid var(--ink); flex-shrink: 0; }
.track-score b { font-family: var(--serif); font-size: 44px; line-height: 1; font-weight: 500; }
.track-score span { font-family: var(--mono); font-size: 12px; color: var(--graphite); }
.track-score.good { background: var(--marker); }
.todo { display: flex; gap: 16px; align-items: flex-start; padding: 14px 0; border-bottom: 1px solid var(--hairline); }
.todo__n { width: 28px; height: 28px; border-radius: 50%; background: var(--ink); color: var(--paper); display: grid; place-items: center; font-family: var(--mono); font-size: 13px; flex-shrink: 0; }
.todo > div, .todo .todo__t { flex: 1; }
.todo__t { font-size: 16.5px; font-weight: 500; }
.st { font-family: var(--mono); font-size: 11.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; padding: 3px 8px; white-space: nowrap; }
.st--fail { background: var(--ink); color: var(--paper); }
.st--warn { background: var(--marker); }
.st--ok { background: var(--soft); }
.check-row { display: flex; gap: 14px; padding: 10px 0; border-bottom: 1px solid var(--hairline); }
.st-ic { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700; flex-shrink: 0; margin-top: 1px; }
.st-ic--ok { background: var(--soft); } .st-ic--warn { background: var(--marker); } .st-ic--fail { background: var(--ink); color: var(--paper); }
.split-bar { display: flex; height: 38px; overflow: hidden; border: 1px solid var(--ink); }
.split-bar span { display: flex; align-items: center; padding: 0 10px; font-family: var(--mono); font-size: 12px; white-space: nowrap; overflow: hidden; }
.conv-row { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--hairline); align-items: baseline; }
.conv-row code { font-family: var(--mono); font-size: 15px; background: var(--soft); padding: 6px 10px; overflow-wrap: anywhere; }
.create { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 56px; align-items: start; }
.create__preview { position: sticky; top: 92px; }
.fgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.drop { display: block; border: 1.5px dashed #BDBDBD; padding: 28px; text-align: center; color: var(--graphite); cursor: pointer; }
.drop.over, .drop:hover { border-color: var(--ink); background: var(--soft); }
.variants { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 14px; }
.variant { text-align: left; border: 1px solid #CFCFCF; padding: 12px; display: flex; flex-direction: column; gap: 6px; font-size: 14px; background: var(--paper); }
.variant:hover, .variant.on { border-color: var(--ink); box-shadow: 3px 3px 0 var(--ink); }
.fbad { border: 1px solid var(--hairline); background: #fff; font-family: system-ui, -apple-system, Segoe UI, sans-serif; font-size: 14px; color: #050505; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.fbad__top { display: flex; gap: 10px; align-items: center; padding: 12px 12px 8px; }
.fbad__top b { display: block; font-size: 14px; } .fbad__top small { color: #65676B; font-size: 12px; }
.fbad__av { width: 36px; height: 36px; border-radius: 50%; background: #E4E6EB center/cover; flex-shrink: 0; }
.fbad__text { padding: 0 12px 10px; white-space: pre-wrap; line-height: 1.35; max-height: 7.5em; overflow: hidden; }
.fbad__img { aspect-ratio: 1; background: #F0F2F5; display: grid; place-items: center; color: #8A8D91; overflow: hidden; }
.fbad__img img { width: 100%; height: 100%; object-fit: cover; }
.fbad__foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; background: #F0F2F5; padding: 10px 12px; }
.fbad__foot small { display: block; color: #65676B; font-size: 12px; } .fbad__foot b { display: block; font-size: 15px; } .fbad__foot span { color: #65676B; font-size: 13px; }
.fbad__cta { background: #E4E6EB; color: #050505 !important; font-weight: 600; font-size: 14px !important; padding: 8px 12px; border-radius: 6px; white-space: nowrap; }
@media (max-width: 1100px) { .create { grid-template-columns: 1fr; } .create__preview { position: static; max-width: 420px; } }
@media (max-width: 760px) { .tool-grid, .fgrid, .variants { grid-template-columns: 1fr; } .conv-row { grid-template-columns: 1fr; gap: 6px; } .track-head { flex-direction: column; align-items: flex-start; } }

.picker { position: relative; }
.scope-pop--right { left: auto; right: 0; top: 48px; }
@media (max-width: 760px) { .scope-pop--right { right: auto; left: 0; width: calc(100vw - 36px); } }

.seg--sm button { padding: 4px 10px; font-size: 13px; }
.acc-pick .seg--sm { flex-shrink: 0; }

/* KPIs per account */
.kpi-edit { background: var(--soft); padding: 18px 20px; margin: 0 0 12px; border-left: 3px solid var(--ink); }
.kpi-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.kpi-group { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--hairline); font-size: 14.5px; }
.kpi-group .input { width: 140px; padding: 8px 10px; font-size: 14.5px; background: var(--paper); }
.kpi-group .select { font-size: 14px; }
.figure b.on-target { background: linear-gradient(transparent 62%, var(--marker) 62%); display: inline; }
.figure b.off-target::after { content: " ↑"; font-size: .5em; vertical-align: super; }
@media (max-width: 760px) { .kpi-grid { grid-template-columns: 1fr; } }

.before-after { margin-top: 12px; padding: 10px 12px; background: var(--soft); font-size: 16px; }
.before-after s { color: var(--graphite); }
.before-after--big { background: var(--marker); }
.warn-text { font-size: 14px; font-weight: 600; margin-top: 6px; }

/* Account pickers: wide enough to read, with a clear live count */
.scope-pop, .scope-pop--right { width: min(440px, calc(100vw - 32px)); }
.scope-pop__quick { align-items: center; }
.scope-count { margin-left: auto; font-family: var(--mono); font-size: 12.5px; background: var(--marker); padding: 3px 8px; white-space: nowrap; }
.scope-pop .acc-pick__name { font-size: 15.5px; }

/* Create: Google lines + search preview, audience chips */
.g-lines { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 14px; }
.g-line { position: relative; }
.g-line .input { padding-right: 56px; font-size: 15px; }
.g-cnt { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); font-size: 11px; }
.gad { border: 1px solid var(--hairline); background: #fff; padding: 16px; font-family: Arial, system-ui, sans-serif; color: #202124; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.gad__sp { font-weight: 700; font-size: 13px; margin-bottom: 8px; }
.gad__site { display: flex; gap: 10px; align-items: center; margin-bottom: 6px; }
.gad__site b { display: block; font-size: 14px; font-weight: 400; } .gad__site small { color: #4d5156; font-size: 12px; }
.gad__fav { width: 26px; height: 26px; border-radius: 50%; background: #F1F3F4; flex-shrink: 0; }
.gad__h { color: #1a0dab; font-size: 20px; line-height: 1.3; margin-bottom: 4px; }
.gad__d { color: #4d5156; font-size: 14px; line-height: 1.55; }
.chip-btn.on { background: var(--marker); border-color: var(--ink); }
select[multiple].select { background-image: none; padding: 6px; }
@media (max-width: 760px) { .g-lines { grid-template-columns: 1fr; } }

/* Optimise: strong chips and the bar under a plan of several changes */
.chip-btn--strong { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.chip-btn--strong:hover { opacity: .88; }
.ask-chip--strong { font-style: normal; font-family: var(--sans, inherit); font-weight: 600; font-size: 18px; }
.plan-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 8px 0 24px 0; padding: 16px 18px; border: 1px solid var(--ink); border-radius: 10px; background: var(--marker); font-size: 15px; }
@media (max-width: 640px) { .plan-bar { flex-direction: column; align-items: stretch; } }

/* Tool forms: the account picker, text fields and button share one height */
.tool-form .select, .tool-form .input, .tool-form .btn { height: 52px; box-sizing: border-box; font-size: 16px; }
.tool-form .select { padding: 0 40px 0 14px; background-position: right 14px center; }
.tool-form .input { width: auto; padding: 0 14px; }

/* Change cards: exact details (where, keywords, ad texts) */
.details { margin-top: 14px; border-top: 1px solid var(--hairline); }
.detail { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 14px; padding: 10px 0; border-bottom: 1px solid var(--hairline); font-size: 14.5px; overflow-wrap: anywhere; }
.detail > .label { padding-top: 3px; }
.kw { display: inline-flex; align-items: baseline; gap: 6px; margin: 0 6px 6px 0; padding: 3px 9px; border: 1px solid #CFCFCF; border-radius: 999px; background: var(--paper); }
.kw em { font-style: normal; font-family: var(--mono); font-size: 11px; color: var(--muted); }
.adtext { margin: 0; padding-left: 20px; } .adtext li { padding: 1px 0; }
@media (max-width: 640px) { .detail { grid-template-columns: 1fr; gap: 4px; } }

/* Create ad: brief first, details on demand */
.brief { background: var(--soft); padding: 20px 22px 22px; border-radius: 10px; border-top: 0; }
.brief__row { display: flex; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.brief__row .input { flex: 1; min-width: 220px; width: auto; }
details.more { margin-top: 14px; border: 1px solid var(--hairline); border-radius: 8px; padding: 0 16px; }
details.more summary { cursor: pointer; padding: 12px 0; font-size: 14.5px; font-weight: 500; }
details.more[open] summary { border-bottom: 1px solid var(--hairline); }
.kv { padding: 12px 0; } .kv + .kv { border-top: 1px solid var(--hairline); }
.kv > div { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 12px; padding: 4px 0; font-size: 14px; overflow-wrap: anywhere; }
.kv > div span { color: var(--muted); } .kv > div b { font-weight: 500; }
@media (max-width: 640px) { .kv > div { grid-template-columns: 1fr; gap: 0; } }

/* Launch with AI */
.thumbs { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.thumb { position: relative; width: 96px; height: 96px; border-radius: 8px; overflow: hidden; border: 1px solid var(--hairline); }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb button { position: absolute; top: 4px; right: 4px; background: var(--ink); color: var(--paper); border-radius: 999px; width: 22px; height: 22px; font-size: 12px; }
.plan-card { border: 1px solid var(--hairline); border-radius: 10px; padding: 16px 18px; margin-top: 14px; }
.plan-card .h3 { font-size: 20px; margin: 4px 0 6px; }
[contenteditable="true"] { outline: none; border-radius: 4px; } [contenteditable="true"]:focus { box-shadow: 0 0 0 3px var(--marker); }

/* Shopping feed */
.feed-list { margin-top: 16px; border-top: 1px solid var(--hairline); }
.feed-row { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--hairline); }
.feed-row__img { width: 72px; height: 72px; border-radius: 6px; overflow: hidden; background: var(--soft); }
.feed-row__img img { width: 100%; height: 100%; object-fit: cover; }
.feed-row__title { font-weight: 500; overflow-wrap: anywhere; }
.suggest { margin-top: 10px; padding: 10px 14px; background: var(--soft); border-radius: 8px; }
.figures { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.figure { font-family: var(--serif); font-size: 40px; line-height: 1.1; }
@media (max-width: 640px) { .figures { grid-template-columns: 1fr; } }

.sl-row { display: grid; grid-template-columns: 1fr 1fr 1fr 1.3fr; gap: 6px; margin-bottom: 6px; }
@media (max-width: 760px) { .sl-row { grid-template-columns: 1fr 1fr; } }

.rp-list { max-height: 360px; overflow: auto; border: 1px solid var(--hairline); border-radius: 8px; padding: 4px 14px; }

/* Tools dropdown in the top bar */
.navdrop { position: relative; display: flex; height: 100%; }
.navdrop > a { gap: 6px; }
.navdrop__menu { position: absolute; top: 100%; left: -16px; z-index: 30; min-width: 300px; display: none; flex-direction: column; padding: 8px; background: var(--paper); border: 1px solid var(--ink); border-radius: 10px; box-shadow: 0 12px 32px rgba(0,0,0,.12); }
.navdrop:hover .navdrop__menu, .navdrop:focus-within .navdrop__menu { display: flex; }
.navdrop__menu a { display: block; padding: 9px 12px; border-radius: 6px; text-decoration: none; color: var(--ink); }
.navdrop__menu a:hover, .navdrop__menu a:focus { background: var(--soft); }
.navdrop__menu b { display: block; font-weight: 600; font-size: 14.5px; }
.navdrop__menu small { display: block; color: var(--muted); font-size: 12.5px; margin-top: 1px; }
@media (hover: none) { .navdrop:hover .navdrop__menu { display: none; } }
