/* Form Journey Tracker — admin */

.fjt {
    --fjt-surface: #ffffff;
    --fjt-page: #f6f7f7;
    --fjt-ink: #0b0b0b;
    --fjt-ink-2: #52514e;
    --fjt-ink-3: #7a7974;
    --fjt-line: #e4e4e1;
    --fjt-line-soft: #f0f0ee;
    --fjt-s1: #2a78d6;  /* sessions  */
    --fjt-s2: #eb6834;  /* form starts */
    --fjt-s3: #1baf7a;  /* conversions */
    --fjt-bar: #2a78d6;
    --fjt-warn-bar: #eb6834;
    --fjt-good: #0e7a3f;
    --fjt-bad: #b42318;
    --fjt-radius: 10px;
    color: var(--fjt-ink);
    max-width: 1440px;
}
.fjt *, .fjt *::before, .fjt *::after { box-sizing: border-box; }
.fjt small { display: block; color: var(--fjt-ink-3); font-size: 12px; line-height: 1.4; margin-top: 2px; }
.fjt .fjt-muted { color: var(--fjt-ink-3); }
.fjt .fjt-mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 11.5px; }
.fjt .fjt-strong { font-weight: 600; }

/* Header */
.fjt-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin: 8px 0 18px; border-bottom: 1px solid var(--fjt-line); }
.fjt-head-title { display: flex; align-items: center; gap: 14px; padding-bottom: 12px; }
.fjt-head h1 { font-size: 22px; font-weight: 600; margin: 0; padding: 0; }
.fjt-live { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--fjt-ink-2); background: var(--fjt-surface); border: 1px solid var(--fjt-line); border-radius: 999px; padding: 3px 10px; }
.fjt-live i { width: 8px; height: 8px; border-radius: 50%; background: var(--fjt-s3); box-shadow: 0 0 0 0 rgba(27, 175, 122, .5); animation: fjt-pulse 2s infinite; }
.fjt-live[hidden] { display: none; }
.fjt-live.is-zero i { background: #b9b8b2; animation: none; }
.fjt-live span { font-weight: 600; color: var(--fjt-ink); }
@keyframes fjt-pulse { 0% { box-shadow: 0 0 0 0 rgba(27,175,122,.45); } 70% { box-shadow: 0 0 0 7px rgba(27,175,122,0); } 100% { box-shadow: 0 0 0 0 rgba(27,175,122,0); } }
@media (prefers-reduced-motion: reduce) { .fjt-live i { animation: none; } }
.fjt-tabs { display: flex; gap: 2px; }
.fjt-tabs a { padding: 10px 14px; font-size: 13.5px; font-weight: 500; color: var(--fjt-ink-2); text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.fjt-tabs a:hover { color: var(--fjt-ink); }
.fjt-tabs a.is-active { color: var(--fjt-ink); border-bottom-color: var(--fjt-s1); }
.fjt-tabs a:focus { box-shadow: none; outline: 2px solid var(--fjt-s1); outline-offset: -2px; }

/* Toolbar */
.fjt-toolbar { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 10px 14px; margin-bottom: 18px; }
.fjt-ctl { display: flex; flex-direction: column; gap: 4px; font-size: 11.5px; font-weight: 600; color: var(--fjt-ink-2); text-transform: uppercase; letter-spacing: .03em; }
.fjt-ctl select, .fjt-ctl input { min-height: 32px; font-size: 13px; text-transform: none; letter-spacing: 0; font-weight: 400; }
.fjt-search input { width: 240px; }
.fjt-custom { display: inline-flex; align-items: center; gap: 6px; }
.fjt-custom[hidden] { display: none; }
.fjt-toolbar-end { margin-left: auto; }

/* Cards + grid */
.fjt-card { background: var(--fjt-surface); border: 1px solid var(--fjt-line); border-radius: var(--fjt-radius); padding: 16px 18px 18px; margin-bottom: 16px; min-width: 0; }
.fjt-card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.fjt-card h2 { font-size: 14.5px; font-weight: 600; margin: 0; }
.fjt-hint { color: var(--fjt-ink-3); font-size: 12.5px; margin: 4px 0 0; }
.fjt-card-body { margin-top: 14px; }
.fjt-card.fjt-flush { padding: 0; overflow: hidden; }
.fjt-flush-body .fjt-card-body { margin-left: -18px; margin-right: -18px; margin-bottom: -18px; }
.fjt-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.fjt-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.fjt-grid > .fjt-card { margin-bottom: 0; }
.fjt-grid + .fjt-grid, .fjt-grid + .fjt-card, .fjt-card + .fjt-grid { margin-top: 16px; }
@media (max-width: 1100px) { .fjt-grid, .fjt-grid-3 { grid-template-columns: minmax(0, 1fr); } }
.fjt-loading, .fjt-empty { color: var(--fjt-ink-3); font-size: 13px; padding: 24px 4px; text-align: center; }
.fjt-title { font-size: 18px; margin: 0 0 14px; }

/* KPIs */
.fjt-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 16px; }
.fjt-kpi { background: var(--fjt-surface); border: 1px solid var(--fjt-line); border-radius: var(--fjt-radius); padding: 14px 16px; }
.fjt-kpi-label { font-size: 12px; color: var(--fjt-ink-2); font-weight: 500; }
.fjt-kpi-value { font-size: 26px; font-weight: 600; line-height: 1.2; margin: 6px 0 4px; font-variant-numeric: tabular-nums; }
.fjt-kpi-foot { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; font-size: 12px; color: var(--fjt-ink-3); }
.fjt-kpi-foot span:not(.fjt-delta) { color: var(--fjt-ink-3); }
.fjt-delta { font-weight: 600; color: var(--fjt-ink-3); }
.fjt-delta.is-good { color: var(--fjt-good); }
.fjt-delta.is-bad { color: var(--fjt-bad); }

/* Line chart */
.fjt-line-chart { position: relative; width: 100%; min-height: 260px; }
.fjt-line-chart svg { display: block; width: 100%; height: auto; overflow: visible; }

.fjt-gridline { stroke: var(--fjt-line-soft); stroke-width: 1; }
.fjt-axis { fill: var(--fjt-ink-3); font-size: 11px; font-variant-numeric: tabular-nums; }
.fjt-line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.fjt-line.s1, .fjt-dot.s1 { stroke: var(--fjt-s1); }
.fjt-line.s2, .fjt-dot.s2 { stroke: var(--fjt-s2); }
.fjt-line.s3, .fjt-dot.s3 { stroke: var(--fjt-s3); }
.fjt-dot { fill: var(--fjt-surface); stroke-width: 2; }
.fjt-cross { stroke: var(--fjt-ink-3); stroke-width: 1; stroke-dasharray: 3 3; }
.fjt-hit { fill: transparent; cursor: crosshair; }
.fjt-tip { position: absolute; z-index: 5; pointer-events: none; background: var(--fjt-ink); color: #fff; border-radius: 8px; padding: 8px 10px; font-size: 12px; min-width: 170px; box-shadow: 0 6px 20px rgba(0,0,0,.18); }
.fjt-tip strong { display: block; margin-bottom: 4px; }
.fjt-tip div { display: flex; align-items: center; gap: 6px; }
.fjt-tip b { margin-left: auto; font-variant-numeric: tabular-nums; }
.fjt-tip i, .fjt-legend i { width: 10px; height: 3px; border-radius: 2px; display: inline-block; }
.fjt-tip .fjt-tip-sub { margin-top: 4px; padding-top: 4px; border-top: 1px solid rgba(255,255,255,.2); color: #d6d5cf; }
i.s1 { background: var(--fjt-s1); } i.s2 { background: var(--fjt-s2); } i.s3 { background: var(--fjt-s3); }
.fjt-legend { display: flex; gap: 14px; font-size: 12px; color: var(--fjt-ink-2); }
.fjt-legend span { display: inline-flex; align-items: center; gap: 6px; }

/* Bars */
.fjt-bars, .fjt-funnel { list-style: none; margin: 0; padding: 0; }
.fjt-bars li, .fjt-funnel-step { margin: 0 0 12px; }
.fjt-bars li:last-child { margin-bottom: 0; }
.fjt-bar-top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-size: 13px; }
.fjt-bar-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.fjt-bar-val { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; display: inline-flex; gap: 8px; align-items: baseline; }
.fjt-bar-val small { display: inline; margin: 0; font-weight: 400; }
.fjt-bar-sub { font-size: 11.5px; color: var(--fjt-ink-3); margin-top: 1px; }
.fjt-bar-track { height: 8px; background: var(--fjt-line-soft); border-radius: 4px; margin-top: 5px; overflow: hidden; }
.fjt-bar-track i { display: block; height: 100%; background: var(--fjt-bar); border-radius: 4px; }
.fjt-bars.is-warn .fjt-bar-track i { background: var(--fjt-warn-bar); }
.fjt-funnel-drop { font-size: 11.5px; color: var(--fjt-ink-3); margin: -4px 0 8px 2px; padding-left: 10px; border-left: 2px solid var(--fjt-line); }

/* Tables */
.fjt-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.fjt-table th { text-align: left; font-size: 11.5px; font-weight: 600; color: var(--fjt-ink-2); text-transform: uppercase; letter-spacing: .03em; padding: 10px 12px; border-bottom: 1px solid var(--fjt-line); background: #fafaf9; white-space: nowrap; }
.fjt-table td { padding: 10px 12px; border-bottom: 1px solid var(--fjt-line-soft); vertical-align: top; }
.fjt-table tr:last-child td { border-bottom: 0; }
.fjt-table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.fjt-card-body > .fjt-dim th:first-child, .fjt-card-body > .fjt-dim td:first-child { padding-left: 0; }
.fjt-card-body > .fjt-dim th:last-child, .fjt-card-body > .fjt-dim td:last-child { padding-right: 0; }
.fjt-dim th { background: none; }
.fjt-cell-label { max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fjt-mini { height: 4px; background: var(--fjt-line-soft); border-radius: 2px; margin-top: 5px; max-width: 280px; }
.fjt-mini i { display: block; height: 100%; background: var(--fjt-bar); border-radius: 2px; }
.fjt-sessions tbody tr, .fjt-forms tbody tr { cursor: pointer; }
.fjt-sessions tbody tr:hover td, .fjt-forms tbody tr:hover td, .fjt-sessions tbody tr:focus td { background: #f6f9fe; }
.fjt-sessions tbody tr:focus { outline: none; }
.fjt-fields tr.is-hot td { background: #fff6f1; }
.fjt-field { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; background: #f6f6f4; border-radius: 4px; padding: 1px 6px; display: inline-block; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: top; }
.fjt-err { color: var(--fjt-bad); font-weight: 600; }
.fjt-answer { display: inline-flex; gap: 5px; align-items: baseline; background: #f2f6fc; border-radius: 999px; padding: 2px 9px; margin: 0 4px 4px 0; font-size: 12px; }
.fjt-answer b { color: var(--fjt-ink-2); font-weight: 600; }
.fjt-pager { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 12px; border-top: 1px solid var(--fjt-line); font-size: 12.5px; color: var(--fjt-ink-2); background: #fafaf9; }

/* Badges + chips */
.fjt-badge { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.fjt-badge i { width: 8px; height: 8px; border-radius: 50%; background: #b9b8b2; }
.fjt-badge.is-active i { background: var(--fjt-s1); }
.fjt-badge.is-converted { color: var(--fjt-good); }
.fjt-badge.is-converted i { background: var(--fjt-good); }
.fjt-badge.is-abandoned { color: var(--fjt-bad); }
.fjt-badge.is-abandoned i { background: var(--fjt-bad); border-radius: 1px; }
.fjt-badge.is-left { color: var(--fjt-ink-2); }
.fjt-chip { display: inline-block; font-size: 11.5px; font-weight: 600; padding: 1px 8px; border-radius: 999px; background: #f0f0ee; color: var(--fjt-ink-2); }
.fjt-chip.ch-paid { background: #fdf0e9; color: #9a3d14; }
.fjt-chip.ch-organic { background: #e7f6ef; color: #0f6e4b; }
.fjt-chip.ch-social { background: #efedfb; color: #4636a6; }
.fjt-chip.ch-email { background: #e9f1fc; color: #1c5cab; }
.fjt-chip.ch-ai { background: #fceaf1; color: #a0305b; }
.fjt-chip.ch-referral { background: #fdf5e0; color: #7a5300; }
.fjt-chip.ch-campaign { background: #fdf5e0; color: #7a5300; }

/* Heatmap */
.fjt-heat { display: flex; flex-direction: column; gap: 3px; font-size: 11px; color: var(--fjt-ink-3); }
.fjt-heat-row { display: grid; grid-template-columns: 34px repeat(24, minmax(0, 1fr)); gap: 3px; align-items: center; }
.fjt-heat-cell { aspect-ratio: 1; border-radius: 3px; background: var(--fjt-line-soft); }
.fjt-heat-hours span { text-align: left; white-space: nowrap; overflow: visible; }
.fjt-heat-scale { display: flex; align-items: center; gap: 3px; margin-top: 8px; justify-content: flex-end; }
.fjt-heat-scale i { width: 14px; height: 10px; border-radius: 2px; display: inline-block; }
.fjt-heat-scale span { margin: 0 4px; }

/* Drawer */
.fjt-drawer { position: fixed; inset: 0; z-index: 100000; background: rgba(11, 11, 11, .35); display: flex; justify-content: flex-end; }
.fjt-drawer[hidden] { display: none; }
.fjt-drawer-panel { background: var(--fjt-surface); width: min(640px, 100vw); height: 100%; overflow-y: auto; padding: 20px 24px 32px; box-shadow: -10px 0 40px rgba(0,0,0,.15); }
body.fjt-noscroll { overflow: hidden; }
.fjt-drawer-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.fjt-drawer-head h2 { font-size: 17px; margin: 0 0 6px; }
.fjt-drawer-head > div > div { display: flex; gap: 10px; align-items: center; }
.fjt-x { border: 0; background: #f0f0ee; border-radius: 8px; width: 32px; height: 32px; font-size: 20px; line-height: 1; cursor: pointer; color: var(--fjt-ink-2); }
.fjt-x:hover { background: #e4e4e1; color: var(--fjt-ink); }
.fjt-conv { background: #eaf6ef; color: var(--fjt-good); border-radius: 8px; padding: 10px 12px; font-weight: 600; margin-bottom: 14px; }
.fjt-conv small { display: inline; margin-left: 6px; font-weight: 400; }
.fjt-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 18px; margin: 0 0 20px; }
.fjt-facts div { min-width: 0; }
.fjt-facts dt { font-size: 11.5px; color: var(--fjt-ink-3); font-weight: 500; }
.fjt-facts dd { margin: 2px 0 0; font-size: 13px; word-break: break-word; }
.fjt-drawer h3 { font-size: 13.5px; margin: 0 0 10px; display: flex; gap: 8px; align-items: baseline; }
.fjt-drawer h3 small { display: inline; font-weight: 400; }
.fjt-tl-group { margin-bottom: 14px; }
.fjt-tl-path { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; color: var(--fjt-ink-2); background: #f6f6f4; border-radius: 6px; padding: 4px 8px; margin-bottom: 6px; word-break: break-all; }
.fjt-tl { list-style: none; margin: 0 0 0 8px; padding: 0 0 0 14px; border-left: 2px solid var(--fjt-line); }
.fjt-tl li { position: relative; display: flex; gap: 10px; font-size: 13px; padding: 4px 0; margin: 0; }
.fjt-tl li::before { content: ""; position: absolute; left: -20px; top: 10px; width: 8px; height: 8px; border-radius: 50%; background: #c9c8c2; border: 2px solid var(--fjt-surface); }
.fjt-tl li.ev-input::before, .fjt-tl li.ev-choice::before, .fjt-tl li.ev-select::before, .fjt-tl li.ev-focus::before { background: var(--fjt-s1); }
.fjt-tl li.ev-step::before, .fjt-tl li.ev-formview::before { background: var(--fjt-s2); }
.fjt-tl li.ev-error::before { background: var(--fjt-bad); border-radius: 1px; }
.fjt-tl li.ev-error span { color: var(--fjt-bad); }
.fjt-tl li.ev-submit::before, .fjt-tl li.ev-order::before { background: var(--fjt-good); }
.fjt-tl time { color: var(--fjt-ink-3); font-size: 11.5px; min-width: 78px; font-variant-numeric: tabular-nums; padding-top: 1px; }
.fjt-tl q { quotes: "“" "”"; color: var(--fjt-ink-2); }
.fjt-drawer-foot { border-top: 1px solid var(--fjt-line); margin-top: 20px; padding-top: 14px; }

/* Settings */
.fjt-flash { background: #eaf6ef; border: 1px solid #b6e0c7; color: #0e5a31; border-radius: 8px; padding: 10px 14px; margin-bottom: 16px; }
.fjt-settings .fjt-card { max-width: 920px; }
.fjt-settings h2 { margin-bottom: 6px; }
.fjt-setting { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 16px; padding: 14px 0; border-top: 1px solid var(--fjt-line-soft); }
.fjt-setting:first-of-type { border-top: 0; }
.fjt-setting-label { font-weight: 600; font-size: 13px; padding-top: 2px; }
.fjt-choice { display: flex; gap: 8px; align-items: flex-start; margin-bottom: 10px; }
.fjt-choice input { margin-top: 2px; }
.fjt-choice span strong { font-weight: 500; }
.fjt-note { color: var(--fjt-ink-3); font-size: 12.5px; margin: 6px 0 0; }
.fjt-tools { max-width: 920px; }
.fjt-tool { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 14px 0; border-top: 1px solid var(--fjt-line-soft); }
.fjt-tool:first-of-type { border-top: 0; }
.fjt-tool p { margin: 2px 0 0; color: var(--fjt-ink-2); font-size: 12.5px; }
.fjt-tool-actions { display: flex; gap: 8px; flex-shrink: 0; }
.fjt-tool.is-danger strong { color: var(--fjt-bad); }
.fjt-progress { height: 6px; background: var(--fjt-line-soft); border-radius: 3px; margin-top: 8px; max-width: 360px; overflow: hidden; }
.fjt-progress span { display: block; height: 100%; width: 0; background: var(--fjt-s1); transition: width .3s; }
@media (max-width: 782px) {
    .fjt-setting { grid-template-columns: minmax(0, 1fr); gap: 6px; }
    .fjt-tool { flex-direction: column; align-items: flex-start; }
    .fjt-facts { grid-template-columns: minmax(0, 1fr); }
    .fjt-table { display: block; overflow-x: auto; }
}

/* ── Standalone shell: login, logout, footer ── */
body { margin: 0; background: #f6f7f7; }
.ja { max-width: 1440px; margin: 0 auto; padding: 20px 24px 48px; font: 14px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; color: #0b0b0b; }
.ja .fjt-head { margin-top: 0; }
.ja-logout { margin-left: 10px; padding: 10px 14px; font-size: 13.5px; color: #7a7974 !important; text-decoration: none; }
.ja-logout:hover { color: #0b0b0b !important; }
.ja-foot { margin-top: 28px; padding-top: 14px; border-top: 1px solid #e4e4e1; color: #9b9a94; font-size: 12px; }

.ja-login-body { display: flex; min-height: 100vh; align-items: center; justify-content: center; margin: 0; background: #f0f1f1; font: 14px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; }
.ja-login { background: #fff; border: 1px solid #e4e4e1; border-radius: 14px; padding: 32px 30px; width: 340px; max-width: calc(100vw - 32px); box-shadow: 0 10px 40px rgba(0,0,0,.06); }
.ja-login h1 { font-size: 19px; font-weight: 600; margin: 0 0 20px; text-align: center; }
.ja-login label { display: block; font-size: 12.5px; font-weight: 600; color: #52514e; margin-bottom: 14px; }
.ja-login input { display: block; width: 100%; margin-top: 5px; padding: 9px 11px; font-size: 14px; border: 1px solid #d0d0cc; border-radius: 8px; box-sizing: border-box; }
.ja-login input:focus { outline: 2px solid #2a78d6; outline-offset: -1px; border-color: #2a78d6; }
.ja-login button { width: 100%; margin-top: 4px; padding: 10px; font-size: 14px; font-weight: 600; color: #fff; background: #2a78d6; border: 0; border-radius: 8px; cursor: pointer; }
.ja-login button:hover { background: #2369bd; }
.ja-login-error { background: #fdecea; color: #b42318; border-radius: 8px; padding: 9px 12px; font-size: 13px; margin: 0 0 16px; }
