/* appstats.css: "Mobile app" dashboard (EA v2, web/appstats.js): only what is the page's own; the rest
   is the kit (web/ea-ui.css). Colour carries meaning: people = sky blue (the app's brand blue),
   new people = mint, orders = green, nothing found / errors = rose. */
.au {
    --au-people: #38bdf8;
    --au-new: #5eead4;
    --au-order: #4ade80;
    --au-bad: #fb7185;
    --ea-accent: #38bdf8;
}

/* top bar: the mark glows in the app's colour */
.au .au-mark { filter: drop-shadow(0 0 10px rgba(56, 189, 248, 0.45)); }

/* hero: shadow in the page colour, the number in a soft gradient; under it three small counts */
.au .au-hero { box-shadow: 0 24px 60px -30px rgba(56, 189, 248, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.05); }
.au .au-big { background: linear-gradient(180deg, #ffffff 30%, #bae6fd 100%); -webkit-background-clip: text; background-clip: text; }
.au .ea-big__sub { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.au .au-trio { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 14px; }
.au .au-trio__c { display: grid; gap: 2px; padding: 9px 10px; border-radius: 12px; background: rgba(255, 255, 255, 0.04); }
.au .au-trio__c b { font-size: 20px; font-weight: 700; line-height: 1.1; color: var(--ea-ink); font-variant-numeric: tabular-nums; }
.au .au-trio__c span { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; font-size: 12px; color: var(--ea-ink-3); }
.au .au-trio__c--order b { color: var(--au-order); }

/* period switch (sticky) and the platform switch inside the hero */
.au .au-switch-wrap { margin-top: 2px; margin-bottom: 10px; }
.au .au-switch--plat { flex: 1; padding: 3px; border-radius: 12px; }
.au .au-switch--plat .ea-switch__thumb { top: 3px; bottom: 3px; left: 3px; width: calc((100% - 6px) / 3); border-radius: 9px; }
.au .au-switch--plat .ea-switch__btn { height: 30px; font-size: 12.5px; }

/* change chips: an arrow + «9%» */
.au-trend {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 1px 6px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.5;
    white-space: nowrap;
}
.au-trend--good { color: #4ade80; background: rgba(74, 222, 128, 0.12); }
.au-trend--bad { color: #fb7185; background: rgba(244, 63, 94, 0.13); }
.au-trend--flat { color: rgba(236, 236, 248, 0.5); background: rgba(255, 255, 255, 0.06); font-weight: 600; }

/* chart: tap a column to read it */
.au .au-chart { margin-top: 14px; }
.au .au-chart--still .ea-col rect { animation: none; }
.au .au-chart .ea-col { cursor: pointer; }
.au .au-cap-new b { color: var(--au-new); }
.au .au-cap-order b { color: var(--au-order); }
.au .au-legend { margin-top: 8px; }
.au .au-legend .au-dot { border-radius: 50%; }
.au .au-stats { grid-template-rows: auto auto auto; }
.au .au-stats .ea-stat { display: grid; grid-row: span 3; grid-template-rows: subgrid; align-content: start; }
.au .au-stats .ea-stat__k { align-self: end; white-space: normal; line-height: 1.25; letter-spacing: 0.06em; }
.au .au-stats .ea-stat__s { white-space: normal; line-height: 1.3; }

/* panels: small headings between lists, compact key / value pairs */
.au .au-sub { margin: 18px 0 2px; font-size: 11.5px; font-weight: 650; letter-spacing: 0.07em; text-transform: uppercase; color: var(--ea-ink-3); }
.au .au-lead-sm { margin-top: 6px; font-size: 12.5px; color: var(--ea-ink-3); }
.au .au-kvs { margin-top: 10px; }
.au .au-row .ea-row__name { white-space: normal; overflow-wrap: anywhere; line-height: 1.3; }
.au .au-row .ea-row__top { align-items: center; }
.au .au-tile--warn .ea-tile__v { color: #fde68a; }
.au .au-zero-val { color: var(--au-bad); }
.au .au-x { margin-left: 1px; font-size: 11px; font-weight: 500; color: var(--ea-ink-4); }

/* search rows are buttons that copy the query */
.au .au-row--copy {
    display: block;
    width: calc(100% + 16px);
    margin: -6px -8px;
    padding: 6px 8px;
    border: 0;
    border-radius: 12px;
    background: none;
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
    transition: background 0.2s;
}
.au .au-row--copy:active, .au .au-row--copy.is-copied { background: rgba(56, 189, 248, 0.1); }

/* who came back: one line per week of first visit */
.au .au-co { margin-top: 8px; display: grid; gap: 2px; }
.au .au-co__row { display: grid; grid-template-columns: 1.1fr 0.8fr 1fr 1fr 1fr; align-items: center; min-height: 30px; padding: 0 2px; font-size: 13px; font-variant-numeric: tabular-nums; border-bottom: 1px solid var(--ea-line); }
.au .au-co__row > * { text-align: right; }
.au .au-co__row > :first-child { text-align: left; color: var(--ea-ink-2); }
.au .au-co__head { min-height: 24px; font-size: 11px; color: var(--ea-ink-3); border-bottom-color: transparent; }
.au .au-co__size { color: var(--ea-ink-2); }
.au .au-co__na { color: var(--ea-ink-4); }

/* what the app brings (the shop's numbers): a quiet chart and the last days as a small table (same grid as the cohort table) */
.au .au-hchart { margin-top: 16px; }
.au .au-shop__track { fill: rgba(255, 255, 255, 0.035); }
.au .au-sd__row { grid-template-columns: 1.2fr 0.6fr 0.7fr 0.8fr 1.4fr; }
.au .au-sd__row b { font-weight: 650; }
.au .au-tile .ea-tile__v { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }

/* visits by hour and by weekday */
.au .au-hr { margin-top: 18px; }
.au .au-hr__head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 8px; font-size: 11.5px; color: var(--ea-ink-3); }
.au .au-hr__head b { color: var(--ea-ink); font-weight: 650; }
.au .au-hr svg { display: block; width: 100%; height: auto; overflow: visible; }
.au .au-hr__track { fill: rgba(255, 255, 255, 0.035); }
.au .au-hr__bar { fill: #ff8a5b; opacity: 0.8; }
.au .au-hr__bar.is-peak { opacity: 1; filter: drop-shadow(0 0 4px rgba(255, 138, 91, 0.6)); }
.au .au-hr__axis { display: flex; justify-content: space-between; margin-top: 4px; font-size: 11px; color: var(--ea-ink-4); }
.au .au-dow { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; margin-top: 16px; }
.au .au-dow__d { display: grid; justify-items: center; gap: 3px; }
.au .au-dow__bar { display: flex; align-items: flex-end; width: 100%; height: 44px; border-radius: 6px; background: rgba(255, 255, 255, 0.035); overflow: hidden; }
.au .au-dow__bar span { display: block; width: 100%; height: calc(var(--h) * 1%); border-radius: 6px; background: linear-gradient(180deg, #ffb38a, #ff6b4a); }
.au .au-dow__d b { font-size: 12.5px; font-weight: 650; font-variant-numeric: tabular-nums; }
.au .au-dow__d small { font-size: 11px; color: var(--ea-ink-3); }

.au .au-msg-ico { color: #7dd3fc; }
.au .au-note { margin: 0 0 12px; }
.ea-toast.au-toast { border-color: rgba(56, 189, 248, 0.35); }

/* Integrations card */
.integration-card__icon--appstats {
    border-radius: 14px;
    background: radial-gradient(circle at 30% 25%, rgba(125, 211, 252, 0.28), rgba(14, 165, 233, 0.08));
    color: #38bdf8;
}
.integration-card__metric-pill--appstats { color: #38bdf8; background: rgba(56, 189, 248, 0.13); }
.au-cardspark { display: flex; align-items: flex-end; gap: 1.5px; height: 36px; }
.au-cardspark__bar { flex: 1; display: flex; align-items: flex-end; height: 100%; }
.au-cardspark__bar span {
    display: block;
    width: 100%;
    height: calc(var(--h) * 1%);
    min-height: 1px;
    border-radius: 2px;
    background: linear-gradient(180deg, #7dd3fc, #0ea5e9);
    transform-origin: bottom;
    animation: eaGrowY 0.6s cubic-bezier(0.22, 1, 0.36, 1) both;
    animation-delay: calc(var(--k, 0) * 18ms);
}
#integration-appstats-card .ea-cardmeta .au-trend { padding: 0 5px; font-size: 10.5px; }

@media (prefers-reduced-motion: reduce) {
    #integration-appstats-card * {
        animation: none !important;
        transition: none !important;
    }
}
