:root {
  color-scheme: light;
  --bg: #f4f5f2;
  --surface: #ffffff;
  --surface-soft: #f8f9f7;
  --ink: #182019;
  --ink-2: #4f5c52;
  --muted: #849087;
  --line: #e3e7e2;
  --line-strong: #d3d9d3;
  --green: #0b7b46;
  --green-dark: #075d36;
  --green-soft: #e9f4ed;
  --amber: #a16409;
  --amber-soft: #fff5df;
  --red: #b83931;
  --red-soft: #fff0ee;
  --blue: #315f9f;
  --blue-soft: #edf3fb;
  --radius: 16px;
  --shadow: 0 18px 50px rgba(20, 35, 24, .07);
  font-family: Inter, "Segoe UI", Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--bg); }
body { margin: 0; color: var(--ink); background: var(--bg); font-size: 14px; line-height: 1.5; }
button, input, select { font: inherit; }
button { color: inherit; }
.hidden { display: none !important; }

.wordmark {
  display: inline-block;
  color: var(--ink);
  font-size: 30px;
  font-weight: 760;
  letter-spacing: -.055em;
  line-height: 1;
  text-decoration: none;
}
.wordmark span { color: var(--green); }
.wordmark-light { color: #f5f8f4; }

.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(420px, 1.1fr) minmax(440px, .9fr); background: var(--surface); }
.auth-story { min-height: 100vh; padding: 50px clamp(48px, 7vw, 110px); background: #13251b; color: #eff7f1; display: flex; flex-direction: column; justify-content: space-between; overflow: hidden; position: relative; }
.auth-story::after { content: ""; width: 560px; height: 560px; border: 1px solid rgba(255,255,255,.08); border-radius: 50%; position: absolute; right: -260px; top: 18%; box-shadow: 0 0 0 80px rgba(255,255,255,.018), 0 0 0 180px rgba(255,255,255,.014); }
.auth-copy { max-width: 700px; position: relative; z-index: 1; }
.kicker, .eyebrow { margin: 0 0 10px; color: var(--green); font-size: 11px; font-weight: 760; letter-spacing: .14em; text-transform: uppercase; }
.auth-copy .kicker { color: #87d5a6; }
.auth-copy h1 { margin: 0 0 28px; max-width: 660px; font-size: clamp(46px, 5vw, 76px); line-height: .98; letter-spacing: -.065em; font-weight: 690; }
.auth-copy > p:last-child { margin: 0; max-width: 580px; color: #b9c9bf; font-size: 18px; line-height: 1.65; }
.auth-proof { display: flex; flex-wrap: wrap; gap: 9px; position: relative; z-index: 1; }
.auth-proof span { border: 1px solid rgba(255,255,255,.14); border-radius: 999px; padding: 8px 13px; color: #c8d5cd; font-size: 12px; }
.auth-panel { display: grid; place-items: center; padding: 48px; }
.auth-form { width: min(100%, 430px); }
.auth-tabs { display: inline-flex; gap: 4px; padding: 4px; margin-bottom: 42px; border-radius: 11px; background: var(--surface-soft); }
.auth-tab { border: 0; border-radius: 8px; background: transparent; padding: 8px 18px; color: var(--muted); cursor: pointer; }
.auth-tab.active { background: var(--surface); color: var(--ink); box-shadow: 0 2px 8px rgba(0,0,0,.06); }
.auth-heading h2 { margin: 0 0 8px; font-size: 32px; letter-spacing: -.035em; }
.auth-heading p { margin: 0 0 30px; color: var(--ink-2); }

.field { display: grid; gap: 7px; margin-bottom: 17px; }
.field > span { color: var(--ink-2); font-size: 12px; font-weight: 650; }
.field-note { color: var(--muted); font-size: 10px; font-weight: 500; }
input, select { min-width: 0; height: 44px; border: 1px solid var(--line-strong); border-radius: 10px; outline: 0; background: var(--surface); color: var(--ink); padding: 0 13px; transition: border-color .15s, box-shadow .15s; }
input:focus, select:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(11,123,70,.1); }
.form-error { min-height: 20px; margin: -5px 0 10px; color: var(--red); font-size: 12px; }
.legal { margin: 16px 0 0; color: var(--muted); font-size: 11px; text-align: center; }

.button { min-height: 42px; border: 1px solid transparent; border-radius: 10px; padding: 0 17px; font-weight: 680; cursor: pointer; transition: transform .15s, border-color .15s, background .15s, opacity .15s; }
.button:hover:not(:disabled) { transform: translateY(-1px); }
.button:disabled { cursor: not-allowed; opacity: .42; }
.button.primary { background: var(--green); color: white; }
.button.primary:hover:not(:disabled) { background: var(--green-dark); }
.button.quiet { border-color: var(--line-strong); background: var(--surface); }
.button.inverse { background: white; color: #13251b; }
.button.wide { width: 100%; }
.text-button { border: 0; padding: 0; background: none; color: var(--muted); cursor: pointer; }

.shell { min-height: 100vh; display: grid; grid-template-columns: 246px minmax(0, 1fr); }
.sidebar { height: 100vh; position: sticky; top: 0; padding: 32px 22px 24px; border-right: 1px solid var(--line); background: #fafbf9; display: flex; flex-direction: column; justify-content: space-between; z-index: 20; }
.client-switch { margin: 33px 0 24px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); display: flex; align-items: center; gap: 10px; }
.client-avatar { width: 30px; height: 30px; flex: 0 0 30px; border-radius: 9px; display: grid; place-items: center; background: #19251d; color: white; font-size: 12px; font-weight: 750; }
.client-switch div { min-width: 0; display: grid; }
.client-switch strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.client-switch small { color: var(--muted); font-size: 11px; }
.nav { display: grid; gap: 5px; }
.nav-item { width: 100%; height: 43px; border: 0; border-radius: 10px; background: transparent; display: flex; align-items: center; gap: 11px; padding: 0 12px; color: var(--ink-2); cursor: pointer; text-align: left; }
.nav-item:hover { background: #f0f3ef; color: var(--ink); }
.nav-item.active { background: var(--green-soft); color: var(--green-dark); font-weight: 690; }
.nav-glyph { width: 20px; color: currentColor; font-size: 19px; line-height: 1; text-align: center; }
.nav-count { margin-left: auto; min-width: 21px; height: 21px; border-radius: 999px; display: grid; place-items: center; background: var(--green); color: white; font-size: 10px; }
.sidebar-foot { display: grid; gap: 13px; }
.sync-line { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 11px; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: #5eb37d; box-shadow: 0 0 0 4px var(--green-soft); }

.main { min-width: 0; }
.topbar { height: 72px; padding: 0 clamp(24px, 4vw, 64px); border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; background: rgba(244,245,242,.9); backdrop-filter: blur(14px); position: sticky; top: 0; z-index: 15; }
.top-context { color: var(--ink-2); font-size: 12px; font-weight: 650; }
.top-actions { display: flex; align-items: center; gap: 14px; }
.data-badge { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 11px; }
.data-badge span { width: 6px; height: 6px; border-radius: 50%; background: var(--green); }
.profile { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: #dfe5de; color: #334039; font-size: 12px; font-weight: 750; }
.mobile-menu { display: none; border: 0; background: none; font-size: 21px; }

.page { display: none; width: min(1180px, calc(100% - 64px)); margin: 0 auto; padding: 54px 0 90px; }
.page.active { display: block; }
.page-heading { min-height: 70px; margin-bottom: 30px; display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; }
.page-heading h1 { margin: 0; font-size: clamp(32px, 4vw, 48px); line-height: 1; letter-spacing: -.052em; font-weight: 680; }
.heading-note { max-width: 610px; margin: 13px 0 0; color: var(--ink-2); }
.dashboard-actions { display: flex; align-items: center; gap: 10px; }
.period-switch button { padding: 8px 11px; font-size: 11px; }

.empty-report { min-height: 510px; padding: 72px; border: 1px solid var(--line); border-radius: 22px; background: var(--surface); box-shadow: var(--shadow); display: grid; align-content: center; justify-items: start; position: relative; overflow: hidden; }
.empty-report::after { content: ""; position: absolute; width: 420px; height: 420px; right: -110px; bottom: -210px; border-radius: 50%; border: 1px solid var(--line); box-shadow: 0 0 0 60px #fafbf9, 0 0 0 61px var(--line); }
.empty-mark { position: absolute; top: 34px; right: 40px; color: #d9deda; font-size: 78px; font-weight: 760; letter-spacing: -.08em; }
.empty-report h2 { margin: 0 0 18px; max-width: 650px; font-size: clamp(35px, 4.6vw, 62px); line-height: 1.05; letter-spacing: -.055em; font-weight: 660; }
.empty-report > p:not(.eyebrow) { max-width: 600px; margin: 0 0 26px; color: var(--ink-2); font-size: 16px; }
.loading-card { min-height: 120px; margin-bottom: 20px; padding: 26px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); display: flex; align-items: center; gap: 18px; }
.loading-card p { margin: 4px 0 0; color: var(--ink-2); }
.loading-card p.changing { animation: report-status-in .32s ease both; }
.spinner { width: 27px; height: 27px; border: 2px solid var(--line); border-top-color: var(--green); border-radius: 50%; animation: spin .85s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes report-status-in {
  from { opacity: 0; transform: translateY(3px); }
  to { opacity: 1; transform: translateY(0); }
}

.report { display: grid; gap: 20px; }
.report-hero { min-height: 310px; padding: clamp(30px, 4vw, 54px); border-radius: 22px; background: #15251b; color: white; display: flex; flex-direction: column; justify-content: space-between; box-shadow: var(--shadow); }
.report-meta { display: flex; justify-content: space-between; align-items: center; gap: 16px; color: #9fb1a5; font-size: 12px; }
.signal { padding: 7px 11px; border: 1px solid rgba(255,255,255,.14); border-radius: 999px; color: #b9ddc5; }
.report-hero h2 { max-width: 970px; margin: 45px 0; font-size: clamp(34px, 4.1vw, 58px); line-height: 1.04; letter-spacing: -.052em; font-weight: 620; }
.report-quality { color: #aab9af; font-size: 12px; }
.metrics { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.metric { min-height: 122px; padding: 21px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.metric-label { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; }
.metric-value { margin-top: 14px; font-size: clamp(24px, 2.4vw, 34px); font-weight: 680; letter-spacing: -.045em; font-variant-numeric: tabular-nums; }
.metric-value small { color: var(--ink-2); font-size: .45em; font-weight: 600; }
.metric-delta { margin-top: 6px; color: var(--green); font-size: 11px; }
.metric-delta.negative { color: var(--red); }
.metric-note { margin-top: 6px; overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }

.briefing { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.briefing > header { padding: 24px 28px; border-bottom: 1px solid var(--line); display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.briefing h3, .section-heading h3 { margin: 0; font-size: 21px; letter-spacing: -.025em; }
.briefing time { color: var(--muted); font-size: 11px; }
.briefing-sections { padding: 0 28px; }
.report-section { padding: 25px 0; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 28px; }
.report-section:last-child { border-bottom: 0; }
.report-section h4 { margin: 0; font-size: 14px; }
.report-section .verdict { margin: 0 0 8px; color: var(--ink); font-size: 16px; font-weight: 690; }
.report-section .explanation { max-width: 760px; margin: 0; color: var(--ink-2); line-height: 1.65; }
.section-actions { margin-top: 15px; display: flex; gap: 9px; }
.link-button { border: 0; background: none; padding: 0; color: var(--green); font-weight: 680; cursor: pointer; }
.link-button:hover { text-decoration: underline; }

.live-block { padding: 25px 0; }
.live-block > header { margin-bottom: 20px; display: flex; justify-content: space-between; gap: 24px; }
.live-block > header h4 { margin: 0 0 5px; font-size: 17px; }
.live-block > header p { margin: 0; color: var(--ink-2); }
.live-block > header > span { color: var(--muted); font-size: 11px; }
.live-funnel-head, .live-funnel-row { display: grid; grid-template-columns: minmax(190px, 1.2fr) minmax(110px, 1fr) 70px 80px 100px; gap: 14px; align-items: center; }
.live-funnel-head { padding: 0 12px 8px; color: var(--muted); font-size: 9px; text-transform: uppercase; letter-spacing: .06em; }
.live-funnel-row { min-height: 50px; padding: 8px 12px; border-top: 1px solid var(--line); }
.live-funnel-row.primary { margin: 3px 0; border: 1px solid #a9d5ba; border-radius: 10px; background: var(--green-soft); }
.live-funnel-row > div:first-child { display: flex; align-items: center; gap: 7px; }
.live-funnel-row strong { font-size: 12px; }
.live-funnel-row span { border-radius: 999px; padding: 3px 6px; background: var(--green); color: white; font-size: 8px; text-transform: uppercase; }
.live-funnel-row b { font-variant-numeric: tabular-nums; }
.live-funnel-row small { color: var(--ink-2); font-variant-numeric: tabular-nums; }
.live-funnel-bar { height: 5px; border-radius: 999px; background: #edf0ed; overflow: hidden; }
.live-funnel-bar i { display: block; height: 100%; border-radius: inherit; background: var(--green); }
.live-details { border-top: 1px solid var(--line); }
.live-details > summary { padding: 22px 0; display: flex; align-items: center; justify-content: space-between; gap: 20px; cursor: pointer; list-style: none; }
.live-details > summary::-webkit-details-marker { display: none; }
.live-details > summary span { font-size: 14px; font-weight: 700; }
.live-details > summary small { color: var(--green); }
.live-table-wrap { padding-bottom: 24px; overflow: auto; }
.live-table { width: 100%; min-width: 760px; border-collapse: collapse; font-size: 11px; font-variant-numeric: tabular-nums; }
.live-table th { padding: 8px 10px; color: var(--muted); font-size: 9px; text-align: right; text-transform: uppercase; letter-spacing: .06em; }
.live-table th:first-child, .live-table td:first-child { text-align: left; }
.live-table td { padding: 10px; border-top: 1px solid var(--line); text-align: right; }
.live-table td strong, .live-table td small { display: block; }
.live-table td small { color: var(--muted); }
.source-note { padding: 22px 0 25px; border-top: 1px solid var(--line); display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 28px; }
.source-note p { margin: 0; color: var(--ink-2); }

.alerts-wrap { margin-top: 18px; }
.section-heading { margin: 0 0 14px; }
.alerts { display: grid; gap: 9px; }
.alert { min-height: 82px; padding: 17px 19px 17px 22px; border: 1px solid var(--line); border-left: 3px solid var(--amber); border-radius: 12px; background: var(--surface); display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 20px; }
.alert.critical { border-left-color: var(--red); }
.alert.info { border-left-color: var(--blue); }
.alert strong { display: block; margin-bottom: 4px; }
.alert p { margin: 0; color: var(--ink-2); }

.decisions-heading { align-items: flex-end; }
.segmented { flex: 0 0 auto; display: flex; padding: 4px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); }
.segmented button { border: 0; border-radius: 8px; background: transparent; padding: 8px 14px; color: var(--muted); cursor: pointer; }
.segmented button.active { background: #1c2b21; color: white; }
.decision-list { display: grid; gap: 12px; }
.decision-card { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.decision-summary { padding: 25px 27px; display: grid; grid-template-columns: 9px minmax(0, 1fr) auto; gap: 18px; align-items: start; }
.severity { width: 9px; height: 9px; margin-top: 7px; border-radius: 50%; background: var(--amber); }
.severity.critical { background: var(--red); }
.severity.opportunity { background: var(--green); }
.decision-card h2 { margin: 0 0 9px; font-size: 20px; letter-spacing: -.025em; }
.decision-card p { max-width: 780px; margin: 0; color: var(--ink-2); line-height: 1.65; }
.effect { margin-top: 13px; color: var(--green); font-size: 12px; font-weight: 700; }
.decision-actions { display: flex; gap: 8px; }
.decision-details { padding: 0 27px 23px 54px; }
.decision-details details { padding-top: 15px; border-top: 1px solid var(--line); }
.decision-details summary { color: var(--green); cursor: pointer; font-weight: 650; }
.decision-details dl { display: grid; grid-template-columns: 130px 1fr; gap: 8px 15px; color: var(--ink-2); }
.decision-details dt { color: var(--muted); }
.decision-details dd { margin: 0; }
.blank-state { min-height: 260px; border: 1px dashed var(--line-strong); border-radius: var(--radius); display: grid; place-content: center; text-align: center; }
.blank-state p { margin: 5px 0 0; color: var(--muted); }

.filters { margin-bottom: 14px; padding: 13px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); display: grid; grid-template-columns: 1.2fr 1.2fr 1fr 1fr 1fr auto; gap: 8px; }
.filters select, .filters input { height: 40px; font-size: 12px; }
.history-list { display: grid; gap: 9px; }
.history-row { padding: 20px 22px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); display: grid; grid-template-columns: 120px minmax(0, 1fr) 150px; gap: 20px; align-items: center; }
.outcome { width: max-content; border-radius: 999px; padding: 6px 9px; background: var(--surface-soft); color: var(--muted); font-size: 11px; font-weight: 700; }
.outcome.worked { background: var(--green-soft); color: var(--green-dark); }
.outcome.failed { background: var(--red-soft); color: var(--red); }
.outcome.inconclusive { background: var(--amber-soft); color: var(--amber); }
.history-row h3 { margin: 0 0 5px; font-size: 15px; }
.history-row p { margin: 0; color: var(--ink-2); font-size: 12px; }
.history-date { color: var(--muted); font-size: 11px; text-align: right; }

.progress-label { padding-top: 12px; color: var(--green); font-weight: 750; }
.progress-track { height: 3px; margin: -15px 0 34px; background: #dfe4df; }
.progress-track span { display: block; width: 0; height: 100%; background: var(--green); transition: width .25s; }
.settings-layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 28px; align-items: start; }
.setup-steps { position: sticky; top: 102px; margin: 0; padding: 5px 0; list-style: none; display: grid; gap: 5px; }
.setup-steps li { min-height: 57px; padding: 9px 10px; border-radius: 10px; display: flex; align-items: center; gap: 11px; color: var(--muted); }
.setup-steps li > span { width: 27px; height: 27px; flex: 0 0 27px; border: 1px solid var(--line-strong); border-radius: 50%; display: grid; place-items: center; font-size: 10px; }
.setup-steps li div { display: grid; }
.setup-steps li strong { color: var(--ink-2); font-size: 12px; }
.setup-steps li small { font-size: 10px; }
.setup-steps li.done { color: var(--green); }
.setup-steps li.done > span { border-color: var(--green); background: var(--green); color: white; }
.setup-steps li.done > span { font-size: 0; }
.setup-steps li.done > span::after { content: "✓"; font-size: 12px; }
.setup-panels { display: grid; gap: 14px; }
.setup-card { padding: 27px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.setup-card.muted { opacity: .56; }
.setup-card.ready { opacity: 1; }
.setup-card > header { margin-bottom: 23px; display: flex; justify-content: space-between; gap: 20px; }
.setup-card h2, .launch-card h2 { margin: 2px 0 5px; font-size: 20px; letter-spacing: -.025em; }
.setup-card header p, .launch-card p { max-width: 650px; margin: 0; color: var(--ink-2); }
.step-number { color: var(--green); font-size: 10px; font-weight: 780; letter-spacing: .12em; }
.connection-state { height: max-content; flex: 0 0 auto; border-radius: 999px; padding: 6px 9px; background: var(--surface-soft); color: var(--muted); font-size: 10px; font-weight: 680; }
.connection-state.connected { background: var(--green-soft); color: var(--green-dark); }
.connection-state.checking { background: var(--amber-soft); color: var(--amber); }
.connection-state.error { background: var(--red-soft); color: var(--red); }
.connection-state.skipped { background: #f0f2ef; color: #667168; }
.inline-form { display: grid; grid-template-columns: 1fr 1.35fr auto; gap: 10px; align-items: end; }
.inline-form .field { margin: 0; }
.stage-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 3px 12px; }
.mode-selector { margin-bottom: 18px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.mode-selector > button { min-height: 72px; border: 1px solid var(--line); border-radius: 12px; padding: 13px 15px; background: var(--surface); display: grid; align-content: center; gap: 3px; color: var(--ink-2); text-align: left; cursor: pointer; transition: border-color .15s, background .15s, box-shadow .15s; }
.mode-selector > button:hover { border-color: #aab8af; }
.mode-selector > button strong { color: var(--ink); font-size: 13px; }
.mode-selector > button span { color: var(--muted); font-size: 11px; }
.mode-selector > button.active { border-color: var(--green); background: #f4faf6; box-shadow: 0 0 0 3px rgba(11,123,70,.06); }
.mode-selector > button.loading { opacity: .6; }
.optional-panel { border-left: 2px solid var(--green); padding: 4px 0 4px 15px; }
.optional-panel strong { font-size: 13px; }
.optional-panel p { max-width: 680px; margin: 4px 0 0; color: var(--ink-2); font-size: 12px; }
.catalog-empty { color: var(--muted); }
.catalog { display: grid; gap: 25px; }
.picker-heading { margin-bottom: 12px; display: flex; justify-content: space-between; align-items: end; gap: 18px; }
.picker-heading > div { display: grid; gap: 3px; }
.picker-heading strong { font-size: 13px; }
.picker-heading span { color: var(--muted); font-size: 11px; }
.counter-list { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.counter-row { width: 100%; min-height: 58px; border: 0; border-bottom: 1px solid var(--line); padding: 10px 13px; background: var(--surface); display: grid; grid-template-columns: 18px minmax(0, 1fr) minmax(160px, .7fr) auto; align-items: center; gap: 11px; text-align: left; cursor: pointer; }
.counter-row:last-child { border-bottom: 0; }
.counter-row:hover { background: var(--surface-soft); }
.counter-row > i { width: 16px; height: 16px; border: 1px solid var(--line-strong); border-radius: 50%; }
.counter-row > strong { font-size: 13px; font-weight: 650; overflow-wrap: anywhere; }
.counter-row > span { color: var(--muted); font-size: 11px; overflow-wrap: anywhere; }
.counter-row > small { color: var(--muted); font-size: 10px; font-weight: 650; }
.counter-row.active { background: #f7fbf8; }
.counter-row.active > i { border: 4px solid var(--green); background: white; }
.counter-row.active > small { color: var(--green-dark); }
.counter-picker > .field-note { display: block; margin-top: 9px; }
.saved-goals { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.saved-goal { min-height: 61px; border-bottom: 1px solid var(--line); padding: 10px 12px; display: grid; grid-template-columns: 22px minmax(0, 1fr) auto 26px; align-items: center; gap: 10px; }
.saved-goal:last-child { border-bottom: 0; }
.saved-goal > i { width: 20px; height: 20px; border-radius: 6px; background: var(--green); display: grid; place-items: center; color: white; font-size: 11px; font-style: normal; }
.saved-goal > span { display: grid; gap: 1px; }
.saved-goal > span strong { font-size: 13px; font-weight: 650; }
.saved-goal > span small { color: var(--muted); font-size: 10px; }
.primary-goal { border: 0; border-radius: 999px; padding: 5px 9px; background: var(--surface-soft); color: var(--muted); font-size: 10px; cursor: pointer; }
.primary-goal:hover { color: var(--green-dark); }
.primary-goal.active { background: var(--green-soft); color: var(--green-dark); font-weight: 680; }
.remove-goal { width: 26px; height: 26px; border: 0; border-radius: 7px; background: transparent; color: var(--muted); font-size: 18px; cursor: pointer; }
.remove-goal:hover { background: var(--surface-soft); color: var(--ink); }
.saved-goals-empty { padding: 17px; color: var(--muted); font-size: 12px; }
.direct-goal-settings { margin-top: 12px; border: 1px solid var(--line); border-radius: 12px; padding: 14px; background: var(--surface-soft); display: flex; align-items: end; gap: 18px; }
.direct-goal-settings .field { width: min(280px, 100%); margin: 0; }
.direct-goal-settings p { max-width: 460px; margin: 0 0 6px; color: var(--muted); font-size: 11px; }
.goal-editor { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 14px; }
.goal-editor-head { margin-bottom: 9px; display: flex; justify-content: space-between; gap: 16px; }
.goal-editor-head strong { font-size: 12px; }
.goal-editor-head span { color: var(--muted); font-size: 10px; }
.goal-options { display: flex; flex-wrap: wrap; gap: 7px; }
.goal-choice { min-height: 35px; border: 1px solid var(--line); border-radius: 9px; padding: 7px 10px; display: flex; align-items: center; gap: 7px; color: var(--ink-2); font-size: 12px; cursor: pointer; }
.goal-choice:hover { border-color: #aab8af; }
.goal-choice input { position: absolute; opacity: 0; pointer-events: none; }
.goal-choice i { width: 15px; height: 15px; border: 1px solid var(--line-strong); border-radius: 4px; display: grid; place-items: center; color: transparent; font-size: 9px; font-style: normal; }
.goal-choice:has(input:checked) { border-color: rgba(11,123,70,.5); background: #f4faf6; color: var(--ink); }
.goal-choice:has(input:checked) i { border-color: var(--green); background: var(--green); color: white; }
#saveMetrikaGoals { margin-top: 20px; }
.all-goals-picker { display: grid; gap: 14px; }
.goals-overview { display: flex; justify-content: space-between; align-items: end; gap: 20px; }
.goals-overview > div:first-child { display: grid; gap: 3px; }
.goals-overview strong { font-size: 13px; }
.goals-overview span { color: var(--muted); font-size: 11px; }
.goals-overview-actions { display: flex; align-items: center; gap: 16px; white-space: nowrap; }
.counter-goal-groups { display: grid; gap: 11px; }
.counter-goal-group { border: 1px solid var(--line); border-radius: 13px; padding: 15px; background: var(--surface); }
.counter-goal-group > header { margin-bottom: 12px; display: flex; justify-content: space-between; align-items: center; gap: 18px; }
.counter-goal-group > header div { display: grid; gap: 2px; }
.counter-goal-group > header strong { font-size: 13px; font-weight: 680; }
.counter-goal-group > header span,
.counter-goal-group > header small { color: var(--muted); font-size: 10px; }
.goal-pills { display: flex; flex-wrap: wrap; gap: 7px; }
.goal-pill { min-height: 36px; border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; background: var(--surface); color: var(--ink-2); font: inherit; font-size: 12px; line-height: 1.25; text-align: left; cursor: pointer; transition: border-color .15s, background .15s, color .15s, box-shadow .15s; }
.goal-pill:hover { border-color: #9fb1a5; color: var(--ink); }
.goal-pill.selected { border-color: rgba(7, 128, 69, .58); background: #eff8f2; color: #075e36; box-shadow: inset 0 0 0 1px rgba(7, 128, 69, .06); font-weight: 590; }
.settings-action-row { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 14px; display: flex; justify-content: space-between; align-items: center; gap: 18px; }
.settings-action-row > div { display: grid; gap: 3px; }
.settings-action-row strong { font-size: 13px; }
.settings-action-row span { color: var(--muted); font-size: 11px; }
.provider-picker { margin: 15px 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.provider-picker.compact { max-width: 560px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.provider-picker button { min-height: 54px; border: 1px solid var(--line); border-radius: 11px; padding: 10px 12px; background: var(--surface); display: grid; gap: 2px; color: var(--ink); text-align: left; }
.provider-picker button strong { font-size: 12px; }
.provider-picker button span { color: var(--muted); font-size: 10px; }
.provider-picker button.active { border-color: rgba(7, 128, 69, .45); background: #f4faf6; }
.provider-picker button.active span { color: var(--green-dark); }
.provider-picker button:disabled { opacity: .58; }
.target-metrics-modal { width: min(560px, calc(100% - 32px)); }
.target-metrics-body { padding: 24px 27px 2px; display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(150px, .75fr); gap: 14px; }
.target-metrics-body .field { margin: 0; }
.launch-card { min-height: 170px; padding: 30px; border-radius: var(--radius); background: #14271b; color: white; display: flex; justify-content: space-between; align-items: center; gap: 30px; }
.launch-card .eyebrow { color: #83c99d; }
.launch-card p:last-child { color: #a9b9ae; }

.modal { width: min(680px, calc(100% - 32px)); max-height: min(760px, calc(100vh - 40px)); border: 0; border-radius: 18px; padding: 0; color: var(--ink); box-shadow: 0 30px 100px rgba(0,0,0,.22); }
.modal::backdrop { background: rgba(13,22,16,.45); backdrop-filter: blur(4px); }
.modal-head { padding: 25px 27px 20px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: start; }
.modal-head h2 { margin: 0; font-size: 23px; letter-spacing: -.03em; }
.modal-close { width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 50%; background: var(--surface); font-size: 22px; cursor: pointer; }
.evidence-list { max-height: 560px; overflow: auto; padding: 7px 27px 27px; }
.evidence-item { padding: 19px 0; border-bottom: 1px solid var(--line); }
.evidence-item:last-child { border: 0; }
.evidence-item h3 { margin: 0 0 7px; font-size: 15px; }
.evidence-item pre { margin: 0; padding: 12px; border-radius: 9px; overflow: auto; background: var(--surface-soft); color: var(--ink-2); font: 11px/1.5 ui-monospace, SFMono-Regular, Consolas, monospace; }
.confirm-modal > p { padding: 23px 27px 0; color: var(--ink-2); }
.change-preview { margin: 18px 27px; padding: 16px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface-soft); color: var(--ink-2); font-size: 12px; }
.oauth-code-modal { width: min(580px, calc(100% - 32px)); }
.oauth-code-modal .modal-head { padding: 27px 30px 23px; }
.oauth-code-modal .modal-close { width: 30px; height: 30px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font-size: 25px; font-weight: 350; line-height: 1; transition: color .15s, background .15s; }
.oauth-code-modal .modal-close:hover { background: var(--surface-soft); color: var(--ink); }
.oauth-code-body { padding: 25px 30px 4px; }
.oauth-code-body > p { max-width: 500px; margin: 0 0 23px; color: var(--ink-2); }
.oauth-code-body .field { margin: 0 0 12px; }
.oauth-code-field { max-width: 360px; }
.oauth-code-body input { height: 48px; font-size: 15px; font-weight: 560; letter-spacing: .025em; }
.oauth-code-body input::placeholder { color: #9aa29d; font-weight: 480; letter-spacing: 0; }
.oauth-code-modal .modal-actions { padding: 22px 30px 30px; }
.modal-actions { padding: 20px 27px 27px; display: flex; justify-content: flex-end; gap: 9px; }
.toast { position: fixed; right: 24px; bottom: 24px; z-index: 100; max-width: 380px; padding: 13px 16px; border-radius: 11px; background: #17251b; color: white; box-shadow: var(--shadow); opacity: 0; transform: translateY(12px); pointer-events: none; transition: .2s; }
.toast.show { opacity: 1; transform: translateY(0); }
.toast.error { background: #8f2e29; }

@media (max-width: 1080px) {
  .metrics { grid-template-columns: repeat(3, 1fr); }
  .filters { grid-template-columns: repeat(3, 1fr); }
  .settings-layout { grid-template-columns: 1fr; }
  .setup-steps { position: static; grid-template-columns: repeat(3, 1fr); }
  .catalog { gap: 22px; }
}

@media (max-width: 780px) {
  .auth { grid-template-columns: 1fr; }
  .auth-story { min-height: 300px; padding: 34px 28px; }
  .auth-copy h1 { margin-top: 42px; font-size: 42px; }
  .auth-copy > p:last-child, .auth-proof { display: none; }
  .auth-panel { padding: 38px 24px; }
  .shell { grid-template-columns: 1fr; }
  .sidebar { width: 246px; position: fixed; left: -270px; transition: left .2s; box-shadow: var(--shadow); }
  .sidebar.open { left: 0; }
  .mobile-menu { display: block; }
  .top-context { display: none; }
  .page { width: min(100% - 32px, 1180px); padding-top: 34px; }
  .page-heading { flex-direction: column; }
  .dashboard-actions { width: 100%; flex-wrap: wrap; }
  .metrics { grid-template-columns: repeat(2, 1fr); }
  .report-section { grid-template-columns: 1fr; gap: 9px; }
  .live-funnel-head { display: none; }
  .live-funnel-row { grid-template-columns: minmax(140px, 1fr) 60px 70px; }
  .live-funnel-row .live-funnel-bar, .live-funnel-row small:last-child { display: none; }
  .source-note { grid-template-columns: 1fr; gap: 7px; }
  .decision-summary { grid-template-columns: 9px 1fr; }
  .decision-actions { grid-column: 2; }
  .decision-details { padding-left: 54px; }
  .history-row { grid-template-columns: 1fr; gap: 9px; }
  .history-date { text-align: left; }
  .setup-steps { grid-template-columns: repeat(2, 1fr); }
  .inline-form, .stage-grid { grid-template-columns: 1fr; }
  .provider-picker { grid-template-columns: 1fr; }
  .launch-card { align-items: flex-start; flex-direction: column; }
}

@media (max-width: 520px) {
  .auth-story { min-height: 250px; }
  .auth-copy h1 { font-size: 35px; }
  .data-badge { display: none; }
  .empty-report { min-height: 470px; padding: 34px 25px; }
  .empty-mark { display: none; }
  .metrics { grid-template-columns: 1fr; }
  .report-meta { align-items: flex-start; flex-direction: column; }
  .report-hero h2 { margin: 34px 0; font-size: 35px; }
  .period-switch { width: 100%; }
  .period-switch button { flex: 1; }
  .briefing > header { flex-direction: column; }
  .briefing-sections { padding: 0 20px; }
  .alert { grid-template-columns: 1fr; }
  .decisions-heading { align-items: flex-start; }
  .segmented { width: 100%; }
  .segmented button { flex: 1; }
  .decision-actions { flex-wrap: wrap; }
  .filters, .setup-steps { grid-template-columns: 1fr; }
  .setup-card { padding: 22px; }
  .setup-card > header { flex-direction: column; }
  .mode-selector { grid-template-columns: 1fr; }
  .counter-row { grid-template-columns: 18px minmax(0, 1fr) auto; }
  .counter-row > span { grid-column: 2; }
  .counter-row > small { grid-column: 3; grid-row: 1 / span 2; }
  .saved-goal { grid-template-columns: 22px minmax(0, 1fr) 26px; }
  .primary-goal { grid-column: 2; width: max-content; }
  .remove-goal { grid-column: 3; grid-row: 1 / span 2; }
  .direct-goal-settings { align-items: stretch; flex-direction: column; gap: 9px; }
  .picker-heading { align-items: flex-start; }
  .goals-overview { align-items: flex-start; flex-direction: column; gap: 10px; }
  .goals-overview-actions { width: 100%; justify-content: space-between; }
  .counter-goal-group { padding: 13px; }
  .counter-goal-group > header { align-items: flex-start; }
  .goal-pill { width: 100%; }
  .settings-action-row { align-items: flex-start; }
  .target-metrics-body { grid-template-columns: 1fr; padding: 22px 22px 2px; }
  .oauth-code-modal .modal-head { padding: 23px 22px 19px; }
  .oauth-code-body { padding: 22px 22px 3px; }
  .oauth-code-field { max-width: none; }
  .oauth-code-modal .modal-actions { padding: 19px 22px 24px; }
}

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