:root {
  --cyan: #0acdd4;
  --blue: #0798e8;
  --ink: #28212f;
  --ink-2: #3f3747;
  --muted: #706979;
  --paper: #f6f8fb;
  --white: #fff;
  --line: #dbe7ed;
  --soft: #eaf8fb;
  --gradient: linear-gradient(110deg, #0acdd4, #0798e8);
  --shadow: 0 18px 50px rgba(35, 57, 82, .09);
  --shadow-soft: 0 8px 24px rgba(35, 57, 82, .07);
  --radius: 22px;
  --font-ui: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --text-micro: 10px;
  --text-caption: 11px;
  --text-label: 12px;
  --text-body: 13px;
  --text-card-title: 18px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--paper); font-family: var(--font-ui); font-size: var(--text-body); line-height: 1.45; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
[hidden] { display: none !important; }

.auth-gate { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(circle at 18% 10%, rgba(10,205,212,.2), transparent 34%), radial-gradient(circle at 88% 86%, rgba(7,152,232,.2), transparent 35%), var(--ink); }
.auth-card { width: min(440px, 100%); padding: 40px; border: 1px solid rgba(255,255,255,.16); border-radius: 28px; background: #fff; box-shadow: 0 35px 100px rgba(0,0,0,.34); }
.auth-logo { display: block; width: 190px; margin-bottom: 35px; }
.auth-card h1 { margin: 8px 0 10px; font-size: 36px; letter-spacing: -.055em; }
.auth-copy { margin: 0 0 25px; color: var(--muted); font-size: 13px; line-height: 1.65; }
.auth-card form { display: grid; gap: 14px; }
.auth-card label { color: var(--ink-2); font-size: var(--text-label); font-weight: 800; }
.auth-card input { width: 100%; min-height: 50px; margin-top: 7px; padding: 0 14px; font-size: 14px; }
.auth-card .button { width: 100%; min-height: 48px; }
.auth-card .text-link { justify-self: center; }
.turnstile-widget { min-height: 1px; }
.turnstile-widget iframe { max-width: 100%; }
.auth-status { min-height: 19px; margin: 16px 0 0; color: #087368; font-size: var(--text-caption); font-weight: 750; line-height: 1.5; }
.auth-status.error { color: #b43b48; }
.auth-footnote { display: block; margin-top: 22px; padding-top: 18px; color: #938c99; border-top: 1px solid var(--line); text-align: center; font-size: var(--text-micro); }
.powered-by { display: flex; align-items: center; justify-content: center; gap: 9px; max-width: 100%; margin-top: 15px; overflow: hidden; color: #938c99; font-size: var(--text-micro); font-weight: 700; }
.powered-by span { flex: 0 0 auto; }
.powered-by img { display: block; flex: 0 1 142px; width: 142px; max-width: 142px; height: auto; object-fit: contain; }

.app-shell { min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 30; width: 252px; display: flex; flex-direction: column; padding: 27px 18px 20px; color: #fff; background: radial-gradient(circle at 10% 4%, rgba(10, 205, 212, .14), transparent 32%), var(--ink); }
.brand { display: block; min-height: 55px; padding: 2px 9px 26px; border-bottom: 1px solid rgba(255,255,255,.09); }
.brand-lockup { display: block; width: 178px; height: auto; padding: 8px 11px; border-radius: 13px; background: #fff; }
.brand-icon { display: none; width: 44px; height: 44px; }
.main-nav { display: grid; gap: 6px; padding: 25px 0; }
.nav-link { position: relative; display: grid; grid-template-columns: 26px 1fr auto; align-items: center; min-height: 46px; padding: 0 13px; color: rgba(255,255,255,.69); text-decoration: none; border-radius: 13px; font-size: 14px; font-weight: 650; transition: .2s ease; }
.nav-link:hover { color: #fff; background: rgba(255,255,255,.06); transform: translateX(2px); }
.nav-link.active { color: #fff; background: linear-gradient(100deg, rgba(10,205,212,.19), rgba(7,152,232,.13)); box-shadow: inset 3px 0 var(--cyan); }
.nav-link b { min-width: 22px; padding: 3px 7px; color: var(--cyan); background: rgba(10,205,212,.12); border: 1px solid rgba(10,205,212,.2); border-radius: 999px; text-align: center; font-size: 10px; }
.nav-icon { width: 24px; font-size: 19px; font-weight: 500; }
.sidebar-footer { display: grid; gap: 13px; margin-top: auto; }
.system-card, .account-card { display: flex; align-items: center; gap: 11px; padding: 12px; border: 1px solid rgba(255,255,255,.1); border-radius: 15px; background: rgba(255,255,255,.045); }
.system-card strong, .account-card strong { display: block; color: #fff; font-size: 12px; }
.system-card small, .account-card small { display: block; margin-top: 2px; color: rgba(255,255,255,.53); font-size: 10px; }
.status-pulse { width: 10px; height: 10px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 0 6px rgba(10,205,212,.1); animation: pulse 2.2s infinite; }
.avatar { display: grid; place-items: center; width: 35px; height: 35px; border-radius: 11px; color: var(--ink); background: var(--gradient); font-size: 11px; font-weight: 900; }
.account-card > div { flex: 1; }
.icon-button { border: 0; color: rgba(255,255,255,.6); background: transparent; cursor: pointer; }

.main-content { min-height: 100vh; margin-left: 252px; padding: 0 34px 60px; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; min-height: 104px; padding: 23px 0; background: rgba(246,248,251,.88); border-bottom: 1px solid rgba(219,231,237,.7); backdrop-filter: blur(18px); }
.topbar h1 { margin: 5px 0 0; font-size: clamp(23px, 2vw, 30px); letter-spacing: -.035em; }
.breadcrumb { margin: 0; color: var(--muted); font-size: 11px; font-weight: 600; }
.breadcrumb span { margin: 0 5px; color: #b6b1bb; }
.breadcrumb strong { color: var(--blue); }
.top-actions, .hero-actions, .inline-actions, .modal-actions, .filter-actions { display: flex; align-items: center; gap: 10px; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 42px; padding: 0 17px; border: 1px solid transparent; border-radius: 12px; font-size: 12px; font-weight: 800; cursor: pointer; transition: transform .18s ease, box-shadow .18s ease, opacity .18s ease; }
.button:hover:not(:disabled) { transform: translateY(-1px); }
.button:disabled { opacity: .5; cursor: not-allowed; }
.button.primary { color: #fff; background: var(--gradient); box-shadow: 0 10px 24px rgba(7,152,232,.2); }
.button.secondary { color: var(--ink); background: #fff; border-color: var(--line); }
.button.light { color: var(--ink); background: #fff; box-shadow: 0 10px 22px rgba(0,0,0,.1); }
.button.hero-ghost { color: #fff; border-color: rgba(255,255,255,.25); background: rgba(255,255,255,.06); }
.text-link { padding: 0; border: 0; color: var(--blue); background: transparent; font-size: 12px; font-weight: 800; cursor: pointer; }
.mobile-menu { display: none; }

.view { display: none; animation: fade-in .22s ease; }
.view.active { display: block; }
.hero-card { position: relative; display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(280px, .65fr); min-height: 350px; margin: 28px 0 22px; overflow: hidden; padding: 50px 52px; color: #fff; border-radius: 28px; background: radial-gradient(circle at 86% 23%, rgba(10,205,212,.22), transparent 31%), linear-gradient(135deg, #28212f 0%, #2e2737 59%, #183d59 100%); box-shadow: var(--shadow); }
.hero-card::after { content: ""; position: absolute; right: -70px; bottom: -140px; width: 410px; height: 410px; border: 1px solid rgba(10,205,212,.12); border-radius: 50%; }
.hero-copy { position: relative; z-index: 2; }
.live-badge { display: inline-flex; align-items: center; gap: 8px; padding: 7px 11px; color: #c8fbfc; border: 1px solid rgba(10,205,212,.25); border-radius: 999px; background: rgba(10,205,212,.09); font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.live-badge i { width: 7px; height: 7px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 0 5px rgba(10,205,212,.1); }
.hero-card h2 { margin: 25px 0 18px; max-width: 650px; font-size: clamp(38px, 5vw, 67px); line-height: .99; letter-spacing: -.063em; }
.hero-card h2 span { color: var(--cyan); }
.hero-card p { max-width: 620px; margin: 0 0 28px; color: rgba(255,255,255,.68); font-size: 15px; line-height: 1.65; }
.signal-visual { position: relative; z-index: 2; min-height: 260px; align-self: center; }
.signal-ring { position: absolute; inset: 50% auto auto 50%; border: 1px solid rgba(10,205,212,.14); border-radius: 50%; transform: translate(-50%,-50%); }
.ring-one { width: 290px; height: 290px; }
.ring-two { width: 220px; height: 220px; }
.ring-three { width: 150px; height: 150px; }
.signal-mark { position: absolute; inset: 50% auto auto 50%; display: grid; place-items: center; width: 112px; height: 112px; border-radius: 29px; background: #fff; box-shadow: 0 24px 60px rgba(0,0,0,.24); transform: translate(-50%,-50%) rotate(-3deg); }
.signal-mark img { width: 95px; height: 95px; }
.signal-dot { position: absolute; top: 50%; left: 50%; width: 10px; height: 10px; margin: -5px 0 0 -5px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 0 6px rgba(10,205,212,.09); animation: signal-orbit 10s linear infinite; will-change: transform; }
.signal-dot.one { --orbit-radius: 145px; animation-duration: 13s; animation-delay: -3.25s; }
.signal-dot.two { --orbit-radius: 110px; animation-duration: 9s; animation-delay: -5.5s; animation-direction: reverse; }
.signal-dot.three { --orbit-radius: 75px; animation-duration: 7s; animation-delay: -1.75s; }

.metric-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 15px; margin-bottom: 22px; }
.metric-card { display: grid; grid-template-columns: 48px 1fr auto; align-items: center; gap: 13px; min-height: 98px; padding: 19px; border: 1px solid var(--line); border-radius: 18px; background: #fff; box-shadow: var(--shadow-soft); }
.metric-icon { display: grid; place-items: center; width: 47px; height: 47px; border-radius: 14px; font-weight: 900; }
.metric-icon.cyan { color: #087d82; background: #dcfafa; }.metric-icon.blue { color: #096fa8; background: #e3f3fe; }.metric-icon.violet { color: #6b49ae; background: #f0eafd; }.metric-icon.gold { color: #8a5f00; background: #fff3d6; }
.metric-card small { display: block; margin-bottom: 4px; color: var(--muted); font-size: var(--text-caption); font-weight: 700; }
.metric-card strong { font-size: 22px; letter-spacing: -.04em; }
.trend { align-self: end; padding: 4px 7px; border-radius: 999px; font-size: var(--text-micro); font-weight: 800; white-space: nowrap; }
.trend.positive { color: #087368; background: #e6f8f4; }

.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(320px, .7fr); gap: 22px; margin-bottom: 22px; }
.panel { border: 1px solid var(--line); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow-soft); }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 24px 25px 17px; }
.panel-heading h3, .settings-card h3, .connection-card h3 { margin: 3px 0 0; font-size: var(--text-card-title); line-height: 1.2; letter-spacing: -.035em; }
.eyebrow { margin: 0; color: var(--blue); font-size: var(--text-micro); font-weight: 900; letter-spacing: .15em; text-transform: uppercase; }
.segmented { display: inline-flex; padding: 3px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); }
.segmented button { padding: 6px 9px; border: 0; border-radius: 7px; color: var(--muted); background: transparent; font-size: var(--text-caption); font-weight: 800; cursor: pointer; }
.segmented button.active { color: var(--ink); background: #fff; box-shadow: 0 2px 7px rgba(0,0,0,.06); }
.chart-wrap { display: grid; grid-template-columns: 34px 1fr; min-height: 230px; padding: 8px 22px 0 18px; }
.chart-y { display: flex; flex-direction: column; justify-content: space-between; padding: 6px 0 27px; color: #a19aa7; font-size: var(--text-micro); }
.chart { position: relative; }
.chart svg { position: absolute; inset: 0 0 25px; width: 100%; height: calc(100% - 25px); overflow: visible; }
.chart-area { fill: url(#area); }.chart-line { fill: none; stroke: var(--blue); stroke-width: 3.5; stroke-linecap: round; filter: drop-shadow(0 5px 8px rgba(7,152,232,.2)); }
.grid-line { position: absolute; left: 0; right: 0; height: 1px; background: #edf2f5; }.g1{top:8px}.g2{top:55px}.g3{top:102px}.g4{top:149px}
.chart-labels { position: absolute; right: 0; bottom: 0; left: 0; display: flex; justify-content: space-between; color: #a19aa7; font-size: var(--text-micro); }
.chart-legend { display: flex; align-items: center; gap: 17px; padding: 13px 25px 23px; color: var(--muted); border-top: 1px solid #edf2f5; font-size: var(--text-caption); }
.chart-legend i { display: inline-block; width: 8px; height: 8px; margin-right: 6px; border-radius: 50%; }.legend-blue{background:var(--blue)}.legend-cyan{background:var(--cyan)}
.chart-legend b { margin-left: auto; color: #a19aa7; font-size: var(--text-micro); text-transform: uppercase; }
.opportunity-list { padding: 0 15px 15px; }
.opportunity { display: grid; grid-template-columns: 37px 1fr auto; align-items: start; gap: 12px; padding: 15px 10px; border-top: 1px solid #edf2f5; }
.opportunity:first-child { border-top: 0; }
.opportunity-icon { display: grid; place-items: center; width: 37px; height: 37px; border-radius: 12px; color: #087f85; background: #e1fafa; font-weight: 900; }
.opportunity strong { display: block; margin-bottom: 4px; font-size: var(--text-label); }
.opportunity small { display: block; color: var(--muted); font-size: var(--text-caption); line-height: 1.5; }
.impact { padding: 4px 7px; border-radius: 999px; color: #087368; background: #e6f8f4; font-size: var(--text-micro); font-weight: 800; white-space: nowrap; }
.campaigns-preview { margin-bottom: 30px; }

.section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; padding: 35px 2px 24px; }
.section-heading h2 { margin: 5px 0 7px; font-size: clamp(30px, 4vw, 44px); letter-spacing: -.055em; }
.section-heading > div > p:last-child { margin: 0; color: var(--muted); font-size: var(--text-body); line-height: 1.55; }
.filter-row { display: flex; justify-content: space-between; gap: 15px; margin-bottom: 15px; }
.search-control { display: flex; align-items: center; gap: 9px; min-width: 300px; padding: 0 14px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.search-control input { width: 100%; min-height: 43px; border: 0; outline: 0; background: transparent; }
.filter { min-height: 42px; padding: 0 14px; border: 1px solid var(--line); border-radius: 11px; color: var(--muted); background: #fff; font-size: var(--text-caption); font-weight: 800; cursor: pointer; }
.filter.active { color: var(--blue); border-color: rgba(7,152,232,.28); background: #edf8ff; }
.table-panel { overflow: hidden; }
.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; }
th { padding: 11px 18px; color: #938c99; background: #f9fbfc; border-bottom: 1px solid var(--line); font-size: var(--text-micro); font-weight: 850; letter-spacing: .08em; text-transform: uppercase; white-space: nowrap; }
td { padding: 16px 18px; border-bottom: 1px solid #edf2f5; font-size: var(--text-label); white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fbfdfe; }
.campaign-name, .keyword-name { display: flex; align-items: center; gap: 10px; }
.campaign-name i { width: 8px; height: 8px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 0 4px rgba(10,205,212,.1); }
.campaign-name strong, .keyword-name strong { display: block; font-size: var(--text-label); }.campaign-name small, .keyword-name small { display: block; margin-top: 3px; color: var(--muted); font-size: var(--text-micro); }
.status-pill { display: inline-flex; align-items: center; padding: 5px 8px; border-radius: 999px; font-size: var(--text-micro); font-weight: 850; text-transform: uppercase; }
.status-pill.enabled { color: #087368; background: #e6f8f4; }.status-pill.paused { color: #855e0c; background: #fff4dc; }.status-pill.draft { color: #5f6570; background: #eef1f4; }
.row-menu { border: 0; background: transparent; cursor: pointer; }

.research-bar { display: grid; grid-template-columns: minmax(300px, 1fr) auto; gap: 20px; margin-bottom: 16px; padding: 19px; }
.research-input { display: flex; align-items: center; gap: 10px; padding-left: 13px; border: 1px solid var(--line); border-radius: 13px; background: #fff; }
.research-input input { flex: 1; min-width: 0; min-height: 44px; border: 0; outline: 0; }
.research-input .button { border-radius: 10px; }
.research-settings { display: flex; gap: 12px; }
.research-settings label { min-width: 120px; color: var(--muted); font-size: var(--text-micro); font-weight: 800; text-transform: uppercase; }
.research-settings select { display: block; width: 100%; min-height: 30px; margin-top: 4px; padding: 0 6px; border: 0; color: var(--ink); background: transparent; font-size: var(--text-label); font-weight: 700; }
.keyword-summary { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }
.keyword-summary article { padding: 17px 19px; border: 1px solid var(--line); border-radius: 15px; background: #fff; }
.keyword-summary small { display: block; margin-bottom: 5px; color: var(--muted); font-size: var(--text-caption); }.keyword-summary strong { font-size: 20px; letter-spacing: -.04em; }
.intent { padding: 4px 7px; border-radius: 7px; color: #6450a1; background: #f0ecfb; font-size: var(--text-micro); font-weight: 800; }
.keyword-action { padding: 6px 9px; border: 1px solid var(--line); border-radius: 8px; color: var(--blue); background: #fff; font-size: var(--text-micro); font-weight: 850; cursor: pointer; }

.approval-summary { text-align: right; }.approval-summary span { display: block; color: var(--blue); font-size: 14px; font-weight: 850; }.approval-summary small { color: var(--muted); font-size: var(--text-caption); }
.optimisation-layout { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 22px; }
.recommendation-list { display: grid; gap: 14px; }
.recommendation-card { padding: 23px; border: 1px solid var(--line); border-radius: 20px; background: #fff; box-shadow: var(--shadow-soft); }
.recommendation-top { display: flex; align-items: flex-start; gap: 14px; }
.recommendation-symbol { display: grid; flex: 0 0 auto; place-items: center; width: 42px; height: 42px; border-radius: 13px; color: #fff; background: var(--gradient); font-weight: 900; }
.recommendation-copy { flex: 1; }.recommendation-copy h3 { margin: 1px 0 6px; font-size: 16px; line-height: 1.25; }.recommendation-copy p { margin: 0; color: var(--muted); font-size: var(--text-label); line-height: 1.55; }
.recommendation-impact { text-align: right; }.recommendation-impact strong { display: block; color: #087368; font-size: var(--text-body); }.recommendation-impact small { color: var(--muted); font-size: var(--text-micro); }
.evidence { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; margin: 18px 0; }
.evidence div { padding: 10px; border-radius: 11px; background: var(--paper); }.evidence small { display: block; color: var(--muted); font-size: var(--text-micro); }.evidence strong { display: block; margin-top: 3px; font-size: var(--text-label); }
.recommendation-footer { display: flex; align-items: center; gap: 9px; padding-top: 16px; border-top: 1px solid #edf2f5; }
.guardrail-pass { margin-right: auto; color: #087368; font-size: var(--text-caption); font-weight: 800; }
.decision { min-height: 34px; padding: 0 12px; border-radius: 9px; font-size: var(--text-caption); }.decision.reject { border: 1px solid var(--line); background: #fff; }.decision.approve { color: #fff; border: 0; background: var(--gradient); }
.audit-panel { align-self: start; position: sticky; top: 123px; }
.audit-list { padding: 0 22px 20px; }
.audit-item { position: relative; padding: 13px 0 13px 20px; border-left: 1px solid var(--line); }
.audit-item::before { content: ""; position: absolute; left: -4px; top: 17px; width: 7px; height: 7px; border: 2px solid #fff; border-radius: 50%; background: var(--blue); box-shadow: 0 0 0 1px var(--line); }
.audit-item strong { display: block; font-size: var(--text-caption); }.audit-item small { display: block; margin-top: 4px; color: var(--muted); font-size: var(--text-micro); line-height: 1.45; }

.connection-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 17px; }
.connection-card { display: grid; grid-template-columns: 54px 1fr auto; align-items: center; gap: 16px; padding: 22px; border: 1px solid var(--line); border-radius: 19px; background: #fff; box-shadow: var(--shadow-soft); }
.connection-logo { display: grid; place-items: center; width: 54px; height: 54px; border-radius: 15px; font-size: 20px; font-weight: 900; }.connection-logo.google{color:#4285f4;background:#edf4ff}.connection-logo.uber{color:#088386;background:#e3fafa}.connection-logo.openai{color:#6d4fc0;background:#f0ebfd}.connection-logo.cloudflare{color:#e8781d;background:#fff0e2}
.connection-card p { max-width: 430px; margin: 7px 0 0; color: var(--muted); font-size: var(--text-label); line-height: 1.5; }
.connection-status { display: inline-block; margin-bottom: 3px; font-size: var(--text-micro); font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }.connection-status.ready{color:#087368}.connection-status.disconnected{color:#9a6711}
.flow-panel { display: flex; align-items: center; justify-content: space-between; gap: 25px; margin-top: 20px; padding: 25px; }
.flow { display: flex; align-items: center; gap: 10px; }.flow span { min-width: 110px; padding: 11px 16px; border: 1px solid var(--line); border-radius: 12px; text-align: center; font-size: var(--text-label); font-weight: 800; }.flow small { color: var(--muted); font-size: var(--text-micro); font-weight: 600; }.flow b { color: var(--cyan); }

.safe-badge { padding: 8px 11px; color: #087368; border: 1px solid #c9eee8; border-radius: 999px; background: #e9f9f5; font-size: var(--text-caption); font-weight: 850; }
.guardrail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-areas: "budget approval" "performance destination" "actions actions"; gap: 17px; }
.guardrail-column { display: contents; }
.guardrail-budget { grid-area: budget; }.guardrail-approval { grid-area: approval; }.guardrail-performance { grid-area: performance; }.guardrail-destination { grid-area: destination; }
.settings-card { padding: 23px; }
.setting-icon { display: grid; place-items: center; width: 39px; height: 39px; margin-bottom: 16px; border-radius: 12px; color: #087f85; background: #e3fafa; font-weight: 900; }
.settings-card > p { margin: 6px 0 20px; color: var(--muted); font-size: var(--text-caption); line-height: 1.55; }
.settings-card > label:not(.toggle-row) { display: grid; grid-template-columns: minmax(0, 1fr) 170px; align-items: center; gap: 16px; margin-top: 11px; color: var(--ink-2); font-size: var(--text-caption); font-weight: 750; }
input, select, textarea { border: 1px solid var(--line); border-radius: 10px; color: var(--ink); background: #fff; outline: 0; font-size: var(--text-body); }
input:focus, select:focus, textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(7,152,232,.1); }
.settings-card input, .settings-card select { width: 100%; min-height: 38px; padding: 0 11px; }
.currency-input { display: flex; align-items: center; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.currency-input:focus-within { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(7,152,232,.1); }
.currency-input span { padding-left: 11px; color: var(--muted); font-size: 10px; }
.currency-input input { border: 0; box-shadow: none; }
.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 12px 0; border-top: 1px solid #edf2f5; cursor: pointer; }
.toggle-row:first-of-type { border-top: 0; }.toggle-row strong { display: block; font-size: var(--text-label); }.toggle-row small { display: block; margin-top: 3px; color: var(--muted); font-size: var(--text-caption); }
.toggle-row input { appearance: none; flex: 0 0 38px; width: 38px; min-width: 38px; height: 21px; min-height: 21px; padding: 2px; border: 0; border-radius: 999px; background: #d6dce0; cursor: pointer; transition: .2s; }.toggle-row input::before { content: ""; display: block; width: 17px; height: 17px; border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.18); transition: .2s; }.toggle-row input:checked { background: var(--gradient); }.toggle-row input:checked::before { transform: translateX(17px); }
.settings-actions { grid-area: actions; display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 13px 2px; }.settings-actions p { flex: 1; color: var(--muted); font-size: var(--text-caption); }

.modal { width: min(610px, calc(100vw - 30px)); padding: 0; border: 0; border-radius: 24px; color: var(--ink); background: #fff; box-shadow: 0 30px 90px rgba(20,18,25,.28); }
.modal::backdrop { background: rgba(28,24,33,.58); backdrop-filter: blur(6px); }
.modal form, .modal .modal-form { padding: 28px; }
.modal-heading { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 7px; }.modal-heading h2 { margin: 5px 0 0; font-size: 27px; letter-spacing: -.05em; }
.modal-close { width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 10px; background: #fff; font-size: 22px; cursor: pointer; }
.modal-intro, #connection-dialog-copy { margin: 0 0 20px; color: var(--muted); font-size: var(--text-label); line-height: 1.55; }
.modal label { display: block; margin-top: 13px; color: var(--ink-2); font-size: var(--text-caption); font-weight: 800; }.modal input, .modal select { width: 100%; min-height: 42px; margin-top: 6px; padding: 0 12px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.check-row { display: flex!important; align-items: flex-start; gap: 10px; padding: 13px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); }.check-row input { width: auto; min-height: auto; margin: 1px 0 0; }.check-row strong, .check-row small { display: block; }.check-row small { margin-top: 3px; color: var(--muted); font-size: var(--text-micro); font-weight: 500; }
.modal-actions { justify-content: flex-end; margin-top: 24px; padding-top: 18px; border-top: 1px solid #edf2f5; }
.compact-modal { width: min(480px, calc(100vw - 30px)); }.connection-notice { display: flex; gap: 11px; margin: 19px 0; padding: 14px; border-radius: 13px; color: #1e607d; background: #edf8ff; }.connection-notice > span { display: grid; place-items: center; flex: 0 0 auto; width: 25px; height: 25px; border-radius: 50%; color: #fff; background: var(--blue); font-weight: 900; }.connection-notice p { margin: 0; font-size: var(--text-caption); line-height: 1.5; }.connection-notice small { color: #537589; }
.toast { position: fixed; z-index: 100; right: 25px; bottom: 25px; max-width: 390px; padding: 13px 17px; color: #fff; border-radius: 12px; background: var(--ink); box-shadow: 0 18px 50px rgba(0,0,0,.22); font-size: var(--text-label); font-weight: 700; opacity: 0; pointer-events: none; transform: translateY(12px); transition: .22s; }.toast.show { opacity: 1; transform: translateY(0); }
.empty-state { padding: 30px; color: var(--muted); text-align: center; font-size: var(--text-label); }

@keyframes fade-in { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 5px rgba(10,205,212,.1); } 50% { box-shadow: 0 0 0 9px rgba(10,205,212,0); } }
@keyframes signal-orbit { from { transform: rotate(0deg) translateX(var(--orbit-radius)); } to { transform: rotate(360deg) translateX(var(--orbit-radius)); } }

@media (max-width: 1120px) {
  .sidebar { width: 88px; padding-inline: 13px; }
  .main-content { margin-left: 88px; }
  .brand { padding-inline: 7px; }.brand-lockup { display: none; }.brand-icon { display: block; }
  .nav-link { grid-template-columns: 1fr; justify-items: center; padding: 0; }.nav-link span:not(.nav-icon), .nav-link b { display: none; }.nav-icon { text-align: center; }
  .system-card div, .account-card div, .account-card button { display: none; }.system-card, .account-card { justify-content: center; padding: 12px 0; }
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .dashboard-grid, .optimisation-layout { grid-template-columns: 1fr; }.audit-panel { position: static; }
  .connection-grid { grid-template-columns: 1fr; }
  .research-bar { grid-template-columns: 1fr; }.research-settings { justify-content: space-between; }
}

@media (max-width: 760px) {
  .auth-card { padding: 29px 23px; border-radius: 22px; }.auth-card h1 { font-size: 31px; }
  .sidebar { width: 252px; transform: translateX(-100%); transition: .22s ease; }.sidebar.open { transform: translateX(0); box-shadow: 30px 0 80px rgba(0,0,0,.22); }
  .main-content { margin-left: 0; padding: 0 17px 42px; }
  .mobile-menu { display: grid; place-items: center; width: 39px; height: 39px; margin-right: 10px; border: 1px solid var(--line); border-radius: 11px; background: #fff; }
  .topbar { min-height: 86px; }.topbar > div:nth-child(2) { flex: 1; }.topbar h1 { font-size: 20px; }.top-actions .secondary { display: none; }
  .hero-card { grid-template-columns: 1fr; min-height: 0; padding: 34px 26px; }.hero-card h2 { font-size: 42px; }.signal-visual { display: none; }
  .metric-grid, .keyword-summary { grid-template-columns: 1fr; }
  .guardrail-grid { grid-template-columns: 1fr; grid-template-areas: "budget" "approval" "performance" "destination" "actions"; }
  .metric-card { min-height: 86px; }
  .section-heading { align-items: flex-start; flex-direction: column; }
  .filter-row { align-items: stretch; flex-direction: column; }.search-control { min-width: 0; }
  .research-settings { display: grid; grid-template-columns: 1fr 1fr; }.research-settings label:last-child { grid-column: 1/-1; }
  .connection-card { grid-template-columns: 48px 1fr; }.connection-card .button { grid-column: 1/-1; }.connection-logo { width: 48px; height: 48px; }
  .flow-panel { align-items: flex-start; flex-direction: column; }.flow { width: 100%; overflow-x: auto; padding-bottom: 5px; }.flow span { min-width: 100px; }
  .settings-card > label:not(.toggle-row) { grid-template-columns: 1fr; gap: 6px; }.settings-actions { align-items: stretch; flex-direction: column; gap: 10px; }.settings-actions .button { width: 100%; }
  .form-grid { grid-template-columns: 1fr; }.hero-actions { align-items: stretch; flex-direction: column; }.hero-actions .button { width: 100%; }
}

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto!important; animation-duration: .01ms!important; animation-iteration-count: 1!important; transition-duration: .01ms!important; } }
