/* ============================================================
   EMAROX PROFIT — full-screen orders & profitability workspace
   Dark-only, built on the :root tokens from style.css.
   NEVER hardcode #3cbfda here: body.tir-mode swaps --neon-cyan
   to amber, and PROFIT should follow the map's mode for free.
   ============================================================ */

#profit-view {
    /* Above all map chrome (.mission-bar 999, .header-controls 1001) but BELOW
       .modal-overlay (9999) so SETTINGS / AI scanner / CyberModal still open on
       top of PROFIT without any stacking rewrite. */
    position: fixed;
    inset: 0;
    z-index: 9000;
    display: none;
    flex-direction: column;
    background: var(--bg-deep);
    color: var(--text-main);
    font-family: 'Inter', sans-serif;
}

#profit-view.active {
    display: flex;
    animation: pfViewIn 0.22s cubic-bezier(0.23, 1, 0.32, 1) both;
}

@keyframes pfViewIn {
    from { opacity: 0; transform: scale(0.985); }
    to   { opacity: 1; transform: scale(1); }
}

/* Ambient wash so the flat #1b1b1f doesn't read as dead space */
#profit-view::before {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(900px 420px at 18% -8%, rgba(31, 164, 194, 0.07), transparent 70%),
        radial-gradient(700px 380px at 88% 4%, rgba(52, 211, 153, 0.045), transparent 70%);
}

/* ─────────────────────────────────────────────
   HEADER — modes + section tabs + close
   ───────────────────────────────────────────── */

#profit-header {
    position: relative;
    z-index: 2;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 22px;
    padding: 0 22px;
    height: 60px;
    background: #1b1b1f;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

/* Mode switch — the "map is just a mode" model, surfaced where there is room */
.pf-modes {
    display: flex;
    gap: 3px;
    padding: 3px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 22px;
    flex-shrink: 0;
}

.pf-mode {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 7px 15px;
    border: none;
    border-radius: 18px;
    background: transparent;
    color: var(--text-muted);
    font-family: 'Inter', sans-serif;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    cursor: pointer;
    white-space: nowrap;
    transition: color 0.2s ease, background 0.2s ease;
}

.pf-mode i { font-size: 12px; }
.pf-mode:hover { color: var(--text-main); background: rgba(255, 255, 255, 0.04); }
.pf-mode:active { transform: scale(0.96); }

.pf-mode.is-active {
    background: var(--neon-cyan);
    color: #04121a;
    box-shadow: none;
}

.pf-mode.is-active:hover { background: var(--neon-cyan); color: #04121a; }

/* Section tabs with a sliding ink bar */
#profit-tabs {
    position: relative;
    display: flex;
    align-items: center;
    gap: 2px;
    flex: 1;
    min-width: 0;
    height: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
}

#profit-tabs::-webkit-scrollbar { display: none; }

.pf-tab {
    position: relative;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    height: 100%;
    padding: 0 15px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-family: 'Inter', sans-serif;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.9px;
    text-transform: uppercase;
    cursor: pointer;
    white-space: nowrap;
    transition: color 0.2s ease;
}

.pf-tab i { font-size: 12px; opacity: 0.75; transition: opacity 0.2s ease; }
.pf-tab:hover { color: var(--text-main); }
.pf-tab:hover i { opacity: 1; }
.pf-tab.is-active { color: var(--neon-cyan); }
.pf-tab.is-active i { opacity: 1; }

.pf-tab-ink {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 2px;
    width: 0;
    border-radius: 2px 2px 0 0;
    background: var(--neon-cyan);
    box-shadow: none;
    /* transform-driven so the slide stays on the compositor */
    transform: translateX(0);
    transition: transform 0.28s cubic-bezier(0.23, 1, 0.32, 1),
                width 0.28s cubic-bezier(0.23, 1, 0.32, 1);
    pointer-events: none;
}

.pf-header-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.pf-icon-btn {
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-muted);
    font-size: 14px;
    cursor: pointer;
    transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.pf-icon-btn:hover {
    color: var(--text-main);
    border-color: rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.07);
}

.pf-icon-btn:active { transform: scale(0.94); }

/* ─────────────────────────────────────────────
   SUBBAR — month picker, fx chip, actions
   ───────────────────────────────────────────── */

#profit-subbar {
    position: relative;
    z-index: 2;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    /* Wraps because the scope picker made this row long enough to overflow on a
       laptop; the spacer keeps the right-hand chips pinned while it fits. */
    flex-wrap: wrap;
    gap: 10px 14px;
    padding: 12px 22px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    background: rgba(27, 27, 31, 0.5);
    backdrop-filter: blur(10px);
}

.pf-month {
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 3px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 10px;
}

.pf-month button {
    width: 28px;
    height: 26px;
    border: none;
    border-radius: 7px;
    background: transparent;
    color: var(--text-muted);
    font-size: 11px;
    cursor: pointer;
    transition: color 0.15s ease, background 0.15s ease;
}

.pf-month button:hover:not(:disabled) { color: var(--neon-cyan); background: rgba(255, 255, 255, 0.06); }
.pf-month button:active:not(:disabled) { transform: scale(0.9); }
.pf-month button:disabled { opacity: 0.25; cursor: default; }

.pf-month-label {
    min-width: 132px;
    text-align: center;
    font-family: var(--emx-font-num);
    font-weight: 700;
    font-size: 12px;
    letter-spacing: 0.6px;
    color: var(--text-main);
    text-transform: uppercase;
}

.pf-chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 6px 12px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.07);
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.7px;
    text-transform: uppercase;
}

.pf-chip b {
    font-family: var(--emx-font-num);
    color: var(--text-main);
    font-weight: 700;
}

.pf-chip i { color: var(--neon-cyan); font-size: 11px; }
.pf-spacer { flex: 1; }

/* ── scope picker (date range / all orders) ──────────────────
   Sits next to the month stepper because it replaces it: these controls decide
   which documents are loaded, unlike the per-screen filter bar which only
   narrows what is already in memory. */

.pf-scope {
    display: flex;
    align-items: center;
    gap: 10px;
}

.pf-scope .glass-input {
    margin-bottom: 0;
    height: 32px;
    padding: 0 10px;
    font-size: 11px;
}

.pf-scope-date { width: 138px; }

.pf-scope-chip {
    text-transform: none;
    letter-spacing: 0.4px;
}

@media (max-width: 900px) {
    .pf-scope { flex-wrap: wrap; gap: 8px; }
    .pf-scope-date { width: 122px; }
}

/* ─────────────────────────────────────────────
   SCREEN CANVAS
   ───────────────────────────────────────────── */

#profit-screen {
    position: relative;
    z-index: 1;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 22px;
    outline: none;
}

#profit-screen::-webkit-scrollbar { width: 8px; }
#profit-screen::-webkit-scrollbar-track { background: transparent; }
#profit-screen::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.09);
    border-radius: 10px;
}
#profit-screen::-webkit-scrollbar-thumb:hover { background: rgba(31, 164, 194, 0.45); }

.pf-section-title {
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 2.2px;
    text-transform: uppercase;
    color: var(--text-muted);
    margin: 0 0 12px;
    display: flex;
    align-items: center;
    gap: 9px;
}

.pf-section-title::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.09), transparent);
}

/* House entrance: fadeUp with a 70ms stagger, matching .tool-tile */
.pf-stagger > * {
    opacity: 0;
    transform: translateY(10px);
    animation: pfFadeUp 0.45s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
    animation-delay: calc(var(--order, 0) * 55ms);
}

@keyframes pfFadeUp {
    to { opacity: 1; transform: translateY(0); }
}

/* ─────────────────────────────────────────────
   KPI CARDS
   ───────────────────────────────────────────── */

.pf-kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 14px;
    margin-bottom: 26px;
}

/* No backdrop-filter on the cards and panels: they sit on the flat, opaque
   #profit-view, so the blur showed nothing, yet it was re-rendered every
   frame while the KPIs counted up and the charts drew in, which made the
   opening stutter. */
.pf-kpi {
    position: relative;
    overflow: hidden;
    padding: 18px 20px 16px;
    border-radius: 18px;
    background: rgba(27, 27, 31, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.05);
    /* the house signature: accent hairline on the top edge only */
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    /* L1 dashboard rule: hover highlights the border, it does NOT lift the card —
       lifting hurts scanability in a dense information grid */
    transition: border-color 0.25s ease, background 0.25s ease;
}

.pf-kpi:hover {
    border-color: rgba(255, 255, 255, 0.14);
    background: rgba(27, 27, 31, 0.62);
}

.pf-kpi::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.05), transparent 72%);
}

.pf-kpi-label {
    font-size: 9.5px;
    font-weight: 800;
    letter-spacing: 1.6px;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 7px;
}

.pf-kpi-value {
    font-family: var(--emx-font-num);
    font-weight: 700;
    font-size: 26px;
    line-height: 1.05;
    letter-spacing: -0.4px;
    color: var(--text-main);
    font-variant-numeric: tabular-nums;
}

.pf-kpi-sub {
    margin-top: 7px;
    font-size: 10.5px;
    font-weight: 600;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
}

.pf-kpi.accent-cyan  { border-top-color: rgba(31, 164, 194, 0.55); }
.pf-kpi.accent-green { border-top-color: rgba(52, 211, 153, 0.5); }
.pf-kpi.accent-red   { border-top-color: rgba(248, 113, 113, 0.5); }
.pf-kpi.accent-amber { border-top-color: rgba(232, 146, 42, 0.5); }

.pf-kpi.accent-cyan  .pf-kpi-label i { color: var(--neon-cyan); }
.pf-kpi.accent-green .pf-kpi-label i { color: var(--neon-green); }
.pf-kpi.accent-red   .pf-kpi-label i { color: var(--neon-red); }
.pf-kpi.accent-amber .pf-kpi-label i { color: var(--neon-amber); }

.pf-pos { color: var(--neon-green); }
.pf-neg { color: var(--neon-red); }

/* ─────────────────────────────────────────────
   PANELS & CHARTS
   ───────────────────────────────────────────── */

.pf-grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: 16px;
    margin-bottom: 26px;
}

.pf-panel {
    padding: 20px;
    border-radius: 18px;
    background: rgba(27, 27, 31, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: border-color 0.25s ease;
}

.pf-panel:hover { border-color: rgba(255, 255, 255, 0.1); }

.pf-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 2.2px;
    text-transform: uppercase;
    color: var(--text-muted);
}

.pf-panel-head i { filter: drop-shadow(0 0 8px currentColor); }

.pf-chart-wrap {
    position: relative;
    width: 100%;
    height: 250px;
}

/* ─────────────────────────────────────────────
   TABLES
   ───────────────────────────────────────────── */

.pf-table-wrap {
    border-radius: 18px;
    background: rgba(27, 27, 31, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.05);
    overflow: hidden;
}

/* This element is the scroll container, which is what makes `position:sticky`
   on <th> actually work: sticking to #profit-screen instead would fail, because
   an ancestor with overflow already captures the sticky context. */
.pf-table-scroll {
    overflow: auto;
    max-height: calc(100vh - 268px);
    overscroll-behavior: contain;
}

.pf-table-scroll::-webkit-scrollbar { width: 8px; height: 8px; }
.pf-table-scroll::-webkit-scrollbar-track { background: transparent; }
.pf-table-scroll::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.09);
    border-radius: 10px;
}
.pf-table-scroll::-webkit-scrollbar-thumb:hover { background: rgba(31, 164, 194, 0.45); }

.pf-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12.5px;
}

.pf-table th {
    position: sticky;
    top: 0;
    z-index: 1;
    text-align: left;
    padding: 13px 16px;
    font-size: 9.5px;
    font-weight: 800;
    letter-spacing: 1.3px;
    text-transform: uppercase;
    color: var(--text-muted);
    background: #212124;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    white-space: nowrap;
    user-select: none;
}

.pf-table th.sortable { cursor: pointer; transition: color 0.15s ease; }
.pf-table th.sortable:hover { color: var(--text-main); }
.pf-table th .pf-sort { margin-left: 5px; opacity: 0.35; font-size: 9px; }
.pf-table th.sorted .pf-sort { opacity: 1; color: var(--neon-cyan); }
.pf-table th.sorted { color: var(--text-main); }

.pf-table td {
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    color: var(--text-main);
    vertical-align: middle;
}

.pf-table tbody tr {
    transition: background 0.15s ease;
    cursor: pointer;
}

.pf-table tbody tr:hover { background: rgba(255, 255, 255, 0.035); }
.pf-table tbody tr:last-child td { border-bottom: none; }

/* Every number is mono — the app's strongest visual signature */
.pf-num {
    font-family: var(--emx-font-num);
    font-weight: 700;
    text-align: right;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

th.pf-num { text-align: right; }

.pf-muted { color: var(--text-muted); }
.pf-strong { font-weight: 600; }

.pf-route-cell {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 12px;
}

.pf-route-cell i { font-size: 8px; color: var(--neon-cyan); opacity: 0.7; }

.pf-cc {
    font-family: var(--emx-font-num);
    font-weight: 700;
    font-size: 11px;
    color: var(--text-main);
}

.pf-route-cities {
    margin-left: 4px;
    max-width: 210px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Status + margin pills */
.pf-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 9px;
    border-radius: 5px;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    white-space: nowrap;
}

.pf-pill.ok   { background: rgba(52, 211, 153, 0.1);  border: 1px solid rgba(52, 211, 153, 0.35);  color: var(--neon-green); }
.pf-pill.warn { background: rgba(232, 146, 42, 0.1);  border: 1px solid rgba(232, 146, 42, 0.35);  color: var(--neon-amber); }
.pf-pill.bad  { background: rgba(248, 113, 113, 0.1);  border: 1px solid rgba(248, 113, 113, 0.35);  color: var(--neon-red); }
.pf-pill.neutral { background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.12); color: var(--text-muted); }

/* Inline margin bar — reads faster than a bare percentage.
   Fixed width, or it stretches the cell and overflows the table. */
.pf-margin-cell {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 5px;
    width: 76px;
    margin-left: auto;
}

.pf-bar {
    position: relative;
    width: 76px;
    height: 4px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.07);
    overflow: hidden;
}

.pf-bar span {
    position: absolute;
    inset: 0 auto 0 0;
    border-radius: 3px;
    transform-origin: left center;
    transform: scaleX(0);
    animation: pfBarIn 0.55s cubic-bezier(0.23, 1, 0.32, 1) forwards;
    animation-delay: 0.1s;
}

@keyframes pfBarIn { to { transform: scaleX(1); } }

.pf-bar span.ok   { background: var(--neon-green); }
.pf-bar span.warn { background: var(--neon-amber); }
.pf-bar span.bad  { background: var(--neon-red); }

/* ─────────────────────────────────────────────
   BUTTONS
   ───────────────────────────────────────────── */

.pf-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 16px;
    border-radius: 9px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-main);
    font-family: 'Inter', sans-serif;
    font-size: 10.5px;
    font-weight: 800;
    letter-spacing: 1px;
    text-transform: uppercase;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.pf-btn:hover { background: rgba(255, 255, 255, 0.09); border-color: rgba(255, 255, 255, 0.22); }
.pf-btn:active { transform: scale(0.97); }

.pf-btn.primary {
    background: var(--neon-cyan);
    border-color: var(--neon-cyan);
    color: #04121a;
    box-shadow: 0 4px 18px rgba(31, 164, 194, 0.28);
}

.pf-btn.primary:hover { filter: brightness(1.1); background: var(--neon-cyan); }
.pf-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.pf-btn:disabled:active { transform: none; }

/* ─────────────────────────────────────────────
   SKELETONS / EMPTY / ERROR
   ───────────────────────────────────────────── */

.pf-skel {
    border-radius: 8px;
    background: linear-gradient(90deg,
        rgba(255, 255, 255, 0.045) 25%,
        rgba(255, 255, 255, 0.09) 37%,
        rgba(255, 255, 255, 0.045) 63%);
    background-size: 400% 100%;
    animation: pfShimmer 1.3s ease-in-out infinite;
}

@keyframes pfShimmer {
    0%   { background-position: 100% 50%; }
    100% { background-position: 0 50%; }
}

.pf-skel-line { height: 12px; margin: 9px 0; }
.pf-skel-kpi  { height: 104px; border-radius: 18px; }
.pf-skel-row  { height: 44px; margin: 0 0 1px; border-radius: 0; }

.pf-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 66px 24px;
    text-align: center;
    color: var(--text-muted);
}

.pf-empty i { font-size: 34px; opacity: 0.28; }
.pf-empty h4 {
    margin: 0;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 1.4px;
    text-transform: uppercase;
    color: var(--text-main);
}
.pf-empty p { margin: 0; font-size: 12px; max-width: 400px; line-height: 1.6; }

.pf-error {
    border-color: rgba(248, 113, 113, 0.3);
}
.pf-error .pf-empty i { color: var(--neon-red); opacity: 0.5; }

/* ─────────────────────────────────────────────
   RESPONSIVE
   ───────────────────────────────────────────── */

@media (max-width: 1024px) {
    .pf-tab span { display: none; }
    .pf-tab { padding: 0 14px; }
    .pf-tab i { font-size: 14px; opacity: 0.9; }
}

@media (max-width: 768px) {
    #profit-header { height: 54px; padding: 0 12px; gap: 12px; }
    .pf-mode span { display: none; }
    .pf-mode { padding: 7px 12px; }
    #profit-subbar { padding: 10px 12px; gap: 10px; flex-wrap: wrap; }
    .pf-month-label { min-width: 104px; font-size: 11px; }
    #profit-screen { padding: 14px; }
    .pf-kpi-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .pf-kpi { padding: 14px; border-radius: 14px; }
    .pf-kpi-value { font-size: 19px; }
    .pf-grid-2 { grid-template-columns: 1fr; }
    .pf-chart-wrap { height: 210px; }

    /* Tables become cards — a 9-column financial table is unusable at 375px */
    .pf-table thead { display: none; }
    .pf-table, .pf-table tbody, .pf-table tr, .pf-table td { display: block; width: 100%; }
    /* Each row becomes its own card, so the eye can tell where one order ends
       and the next begins without a header to align against. */
    .pf-table-wrap {
        background: transparent;
        backdrop-filter: none;
        border: none;
        overflow: visible;
    }

    .pf-table tr {
        padding: 12px 14px;
        margin-bottom: 10px;
        border-radius: 14px;
        background: rgba(27, 27, 31, 0.55);
        border: 1px solid rgba(255, 255, 255, 0.06);
        border-top: 1px solid rgba(255, 255, 255, 0.11);
    }

    .pf-table tbody tr:hover { background: rgba(27, 27, 31, 0.55); }
    .pf-table tbody tr:active { background: rgba(31, 164, 194, 0.07); }
    .pf-margin-cell { flex-direction: row; align-items: center; gap: 9px; width: auto; }
    .pf-bar { width: 60px; }
    .pf-table td {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 14px;
        padding: 4px 0;
        border: none;
        font-size: 12px;
    }
    .pf-table td::before {
        content: attr(data-label);
        flex-shrink: 0;
        font-size: 9px;
        font-weight: 800;
        letter-spacing: 1px;
        text-transform: uppercase;
        color: var(--text-muted);
    }
    .pf-table td.pf-hide-mobile { display: none; }
    .pf-num { text-align: right; }
    .pf-table-scroll { max-height: none; }
    .pf-route-cities { max-width: 150px; }
}

@media (max-width: 480px) {
    .pf-kpi-grid { grid-template-columns: 1fr; }
}

/* ─────────────────────────────────────────────
   MAP-SIDE CHROME
   Two small additions to the map screen. The map layout itself is
   deliberately untouched — no repositioned HUD, no new floating bar.
   ───────────────────────────────────────────── */

/* PROFIT reads as the second half of the product, not as one more modal
   sitting between HISTORY and SETTINGS. */
.header-controls .nav-btn-profit {
    position: relative;
    color: var(--neon-cyan);
    border-color: rgba(31, 164, 194, 0.4) !important;
    background: linear-gradient(135deg, rgba(31, 164, 194, 0.16), rgba(31, 164, 194, 0.04)) !important;
}

.header-controls .nav-btn-profit:hover {
    color: var(--text-main);
    border-color: var(--neon-cyan) !important;
    box-shadow: none;
}

.header-controls .nav-btn-profit:active { transform: scale(0.96); }

/* ZAPISZ ZLECENIE — the single bridge from a calculation into the register */
.save-order-btn {
    width: 100%;
    margin-top: 16px;
    padding: 13px 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    border-radius: 9px;
    border: 1px solid rgba(31, 164, 194, 0.45);
    background: linear-gradient(135deg, rgba(31, 164, 194, 0.18), rgba(31, 164, 194, 0.05));
    color: var(--neon-cyan);
    font-family: 'Inter', sans-serif;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 1.3px;
    text-transform: uppercase;
    cursor: pointer;
    transition: background 0.22s ease, border-color 0.22s ease,
                color 0.22s ease, box-shadow 0.22s ease;
}

.save-order-btn:hover:not(:disabled) {
    background: var(--neon-cyan);
    border-color: var(--neon-cyan);
    color: #04121a;
    box-shadow: 0 6px 22px rgba(31, 164, 194, 0.32);
}

.save-order-btn:active:not(:disabled) { transform: scale(0.98); }

.save-order-btn:disabled {
    opacity: 0.38;
    cursor: not-allowed;
    border-color: rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-muted);
}

.save-order-btn.is-saved {
    border-color: rgba(52, 211, 153, 0.5);
    background: linear-gradient(135deg, rgba(52, 211, 153, 0.16), rgba(52, 211, 153, 0.04));
    color: var(--neon-green);
}

.save-order-btn.is-saved:hover:not(:disabled) {
    background: var(--neon-green);
    border-color: var(--neon-green);
    color: #04140c;
    box-shadow: 0 6px 22px rgba(52, 211, 153, 0.3);
}

/* After an AI scan: "review the route, then save here". */
.save-order-btn.attention:not(:disabled) {
    animation: pf-save-attention 1.1s ease-in-out infinite;
}

@keyframes pf-save-attention {
    0%, 100% { box-shadow: 0 0 0 0 rgba(31, 164, 194, 0.55); }
    50% { box-shadow: 0 0 0 7px rgba(31, 164, 194, 0); }
}

@keyframes pf-save-attention-tir {
    0%, 100% { box-shadow: 0 0 0 0 rgba(232, 146, 42, 0.55); }
    50% { box-shadow: 0 0 0 7px rgba(232, 146, 42, 0); }
}

@media (prefers-reduced-motion: reduce) {
    .save-order-btn.attention:not(:disabled) { animation: none; }
}

/* ─────────────────────────────────────────────
   TIR MODE
   --neon-cyan already turns amber in TIR; these are the places that had the
   cyan hardcoded as rgba(6,182,212,…). Disabled / ZAPISANE keep their looks.
   ───────────────────────────────────────────── */

body.tir-mode .save-order-btn:not(:disabled):not(.is-saved) {
    border-color: rgba(232, 146, 42, 0.45);
    background: linear-gradient(135deg, rgba(232, 146, 42, 0.18), rgba(232, 146, 42, 0.05));
}

body.tir-mode .save-order-btn:not(.is-saved):hover:not(:disabled) {
    background: var(--neon-cyan);
    box-shadow: 0 6px 22px rgba(232, 146, 42, 0.32);
}

body.tir-mode .save-order-btn.attention:not(:disabled) {
    animation-name: pf-save-attention-tir;
}

body.tir-mode #pf-modal .modal-content {
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.9);
}

body.tir-mode .pf-btn.primary {
    box-shadow: 0 4px 18px rgba(232, 146, 42, 0.28);
}

body.tir-mode .pf-dup-note {
    border-color: rgba(232, 146, 42, 0.28);
    border-left-color: var(--neon-cyan);
    background: rgba(232, 146, 42, 0.06);
}

body.tir-mode .pf-preview-card {
    border-top-color: rgba(232, 146, 42, 0.4);
}

/* Amber is the TIR accent, so "missing" switches to red to stay distinct. */
body.tir-mode .pf-missing,
body.tir-mode .pf-combo.pf-missing > .glass-input {
    border-color: #ff5a5a !important;
    box-shadow: 0 0 0 1px rgba(255, 90, 90, 0.18) inset;
}

body.tir-mode .pf-combo.pf-missing {
    box-shadow: none;
}

body.tir-mode .pf-missing-note {
    border-color: rgba(255, 90, 90, 0.3);
    border-left-color: #ff5a5a;
    background: rgba(255, 90, 90, 0.07);
    color: #ff7a7a;
}

body.tir-mode .pf-combo-list {
    border-color: rgba(232, 146, 42, 0.35);
}

body.tir-mode .pf-combo-opt:hover,
body.tir-mode .pf-combo-opt.is-active {
    background: rgba(232, 146, 42, 0.14);
}

/* Result preview at the top of the save modal */
.pf-preview-card {
    padding: 14px 16px;
    margin-bottom: 18px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-top: 1px solid rgba(31, 164, 194, 0.4);
}

/* ── type-ahead picker (vehicle / driver) ── */

.pf-combo {
    position: relative;
}

.pf-combo > .glass-input {
    width: 100%;
    padding-right: 34px;
}

.pf-combo-toggle {
    position: absolute;
    top: 50%;
    right: 4px;
    transform: translateY(-50%);
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: var(--neon-cyan);
    font-size: 11px;
    cursor: pointer;
}

.pf-combo-toggle:hover {
    background: rgba(255, 255, 255, 0.06);
}

/* The flag class sits on the wrapper; draw it on the input. */
.pf-combo.pf-missing {
    box-shadow: none;
}

.pf-combo.pf-missing > .glass-input {
    border-color: var(--neon-amber, #e8922a) !important;
    box-shadow: 0 0 0 1px rgba(232, 146, 42, 0.18) inset;
}

.pf-combo-list {
    position: fixed;
    z-index: 10060;
    max-height: 240px;
    overflow-y: auto;
    padding: 4px;
    border-radius: 10px;
    background: rgba(22, 22, 26, 0.98);
    border: 1px solid rgba(31, 164, 194, 0.35);
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.6);
}

.pf-combo-opt {
    padding: 8px 10px;
    border-radius: 7px;
    font-size: 12.5px;
    color: var(--text-main);
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pf-combo-opt:hover,
.pf-combo-opt.is-active {
    background: rgba(31, 164, 194, 0.14);
}

.pf-combo-opt.is-current {
    color: var(--neon-cyan);
    font-weight: 700;
}

.pf-combo-empty {
    padding: 8px 10px;
    font-size: 12px;
    color: var(--text-muted);
}

/* Figure + small second line (empty km, rate per km) in table cells */
.pf-cell-stack {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
}

.pf-cell-sub {
    font-size: 10px;
    font-weight: 600;
    color: var(--text-muted);
    white-space: nowrap;
}

/* ── vehicle window tiles ── */

.pf-vtile {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
    padding: 10px 12px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.pf-vtile-label {
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: var(--text-muted);
}

.pf-vtile-value {
    font-family: var(--emx-font-num);
    font-size: 14px;
    font-weight: 700;
    color: var(--text-main);
    white-space: nowrap;
}

.pf-vtile-value.pf-pos { color: var(--neon-green); }
.pf-vtile-value.pf-neg { color: var(--neon-red); }

.pf-vtile-sub {
    font-size: 10px;
    color: var(--text-muted);
}

/* ── vehicle window ── */

.pf-vtiles {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 18px;
}

@media (max-width: 600px) {
    .pf-vtiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.pf-vsection {
    margin: 4px 0 10px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 1.4px;
    text-transform: uppercase;
    color: var(--text-muted);
}

.pf-vsummary .pf-cbars { margin-bottom: 20px; }

/* Order cards: collapsed = scan line, open = route + costs + actions */
.pf-order-cards {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.pf-ocard {
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.07);
    background: rgba(255, 255, 255, 0.025);
    overflow: hidden;
    transition: border-color 0.2s ease, background 0.2s ease;
}

.pf-ocard:hover { border-color: rgba(255, 255, 255, 0.14); }

.pf-ocard.is-open {
    border-color: rgba(31, 164, 194, 0.45);
    background: rgba(31, 164, 194, 0.04);
}

.pf-ocard.is-cancelled { opacity: 0.55; }

.pf-ocard-head {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border: none;
    background: none;
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.pf-ocard-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.pf-ocard-date {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 1px;
    color: var(--text-muted);
}

.pf-ocard-client {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pf-ocard-route {
    font-size: 11px;
    color: var(--text-muted);
}

.pf-ocard-figs {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 3px;
    flex-shrink: 0;
}

.pf-ocard-rev {
    font-family: var(--emx-font-num);
    font-size: 13px;
    font-weight: 700;
    color: var(--text-main);
}

.pf-ocard-margin {
    font-family: var(--emx-font-num);
    font-size: 11px;
    font-weight: 700;
}

.pf-ocard-chev {
    color: var(--text-muted);
    font-size: 11px;
    transition: transform 0.2s ease;
}

.pf-ocard.is-open .pf-ocard-chev {
    transform: rotate(180deg);
    color: var(--neon-cyan);
}

.pf-ocard-body {
    display: none;
    padding: 12px 14px 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.pf-ocard.is-open .pf-ocard-body { display: block; }

.pf-ocard-actions,
.pf-doc-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.pf-ocard-actions {
    justify-content: flex-end;
    margin-top: 14px;
}

.pf-doc-row { margin-bottom: 14px; }
.pf-ocard-actions .pf-doc-row { margin-bottom: 0; }

.pf-vempty {
    padding: 14px;
    font-size: 12px;
    color: var(--text-muted);
    text-align: center;
}

/* Attachment toggle in the save modal */
.pf-attach {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px dashed rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.02);
    cursor: pointer;
}

.pf-attach input {
    margin-top: 2px;
    accent-color: var(--neon-cyan);
}

.pf-attach-body {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.pf-attach-title {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-main);
}

.pf-attach-files {
    font-size: 11px;
    color: var(--text-muted);
    word-break: break-all;
}

body.tir-mode .pf-ocard.is-open {
    border-color: rgba(232, 146, 42, 0.45);
    background: rgba(232, 146, 42, 0.04);
}

/* ─────────────────────────────────────────────
   REDUCED MOTION
   The rest of the app has no such block. A financial dashboard is the
   wrong place to keep that gap: numbers must be legible immediately.
   ───────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
    #profit-view.active,
    .pf-stagger > *,
    .pf-bar span,
    .pf-skel {
        animation: none !important;
    }
    .pf-stagger > * { opacity: 1 !important; transform: none !important; }
    .pf-bar span { transform: scaleX(1) !important; }
    .pf-skel { background: rgba(255, 255, 255, 0.06); }
    .pf-tab-ink { transition: none !important; }
    #profit-view *, #profit-view *::before, #profit-view *::after {
        transition-duration: 0.01ms !important;
    }
}

/* ── filter bar ──────────────────────────────────────────────
   Shared by Zlecenia / Flota / Klienci. Filtering is client-side on the
   month already loaded, so these controls never wait on the network. */

.pf-filterbar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 16px;
}

.pf-filterbar .glass-input {
    margin-bottom: 0;
    height: 34px;
    padding: 0 12px;
    font-size: 12px;
}

.pf-filter-search {
    flex: 1 1 240px;
    min-width: 180px;
    max-width: 420px;
}

.pf-filter-select { flex: 0 0 auto; }

.pf-filter-dates {
    display: flex;
    align-items: center;
    gap: 7px;
}

.pf-filter-date {
    width: 145px;
    font-family: var(--emx-font-num);
}

/* Pushed to the far end: it reports on the row above rather than being
   another control to operate. */
.pf-filter-count {
    margin-left: auto;
    font-family: var(--emx-font-num);
    font-size: 11px;
    color: var(--text-muted);
    white-space: nowrap;
}

/* Cyan only while a filter is actually narrowing the list, so "you are looking
   at a subset" reads at a glance. */
.pf-filter-count.active {
    color: var(--neon-cyan);
    font-weight: 700;
}

@media (max-width: 768px) {
    .pf-filter-search { max-width: none; flex-basis: 100%; }
    .pf-filter-dates { flex: 1 1 100%; }
    .pf-filter-date { flex: 1 1 0; width: auto; }
    .pf-filter-count { margin-left: 0; flex-basis: 100%; }
}

/* ── missing / duplicate notices in the save modal ────────────
   The scanner fills this form from OCR, so "what did it fail to
   find?" has to be visible at a glance rather than discovered
   after saving. */

.pf-missing {
    border-color: var(--neon-amber, #e8922a) !important;
    box-shadow: 0 0 0 1px rgba(232, 146, 42, 0.18) inset;
}

/* Blocking: the save button is disabled until these are filled. */
.pf-missing-note {
    margin-top: 2px;
    padding: 9px 12px;
    border-radius: 9px;
    border: 1px solid rgba(232, 146, 42, 0.3);
    border-left: 3px solid var(--neon-amber, #e8922a);
    background: rgba(232, 146, 42, 0.07);
    color: var(--neon-amber, #e8922a);
    font-size: 11.5px;
    line-height: 1.5;
}

/* Non-blocking: order numbers legitimately repeat between clients, so this
   informs rather than prevents. */
.pf-dup-note {
    margin-top: 2px;
    padding: 9px 12px;
    border-radius: 9px;
    border: 1px solid rgba(31, 164, 194, 0.28);
    border-left: 3px solid var(--neon-cyan, #3cbfda);
    background: rgba(31, 164, 194, 0.06);
    color: var(--text-muted);
    font-size: 11.5px;
    line-height: 1.5;
}

/* ─────────────────────────────────────────────
   PRZEGLĄD v2 — cost bars, KPI deltas, period presets,
   "EMAROX widzi", drill-down windows
   ───────────────────────────────────────────── */

/* Cost bars. Deliberately NOT .pf-bar: that name is the 76 px margin bar in
   the tables, and sharing it clipped these rows to 4 px. */
.pf-cbars {
    display: flex;
    flex-direction: column;
    gap: 9px;
}

.pf-cbars-lead {
    margin: 0 0 4px;
    font-size: 12px;
    line-height: 1.5;
    color: var(--text-muted);
}

.pf-cbars-lead b { color: var(--text-main); font-weight: 700; }

.pf-cbar {
    display: grid;
    grid-template-columns: minmax(90px, 130px) minmax(40px, 1fr) auto 52px;
    align-items: center;
    gap: 12px;
    font-size: 12px;
}

.pf-cbar-label {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    color: var(--text-main);
}

.pf-cbar-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.pf-cbar-track {
    height: 8px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.06);
    overflow: hidden;
}

.pf-cbar-fill {
    height: 100%;
    border-radius: 4px;
}

.pf-cbar-amt,
.pf-cbar-pct {
    font-family: var(--emx-font-num);
    font-variant-numeric: tabular-nums;
    text-align: right;
    white-space: nowrap;
}

.pf-cbar-amt { color: var(--text-main); font-weight: 700; }
.pf-cbar-pct { color: var(--text-muted); font-size: 11px; }

.pf-cbar-total {
    margin-top: 2px;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.pf-cbar-total .pf-cbar-label {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: var(--text-muted);
}

.pf-cbar-total .pf-cbar-track { background: none; height: 0; }

@media (max-width: 600px) {
    .pf-cbar {
        grid-template-columns: 1fr auto 46px;
        grid-template-areas: "label amt pct" "track track track";
        row-gap: 6px;
    }
    .pf-cbar-label { grid-area: label; }
    .pf-cbar-track { grid-area: track; }
    .pf-cbar-amt { grid-area: amt; }
    .pf-cbar-pct { grid-area: pct; }
}

/* KPI: change vs the previous period, and the clickable variant */
.pf-kpi-delta {
    margin-top: 6px;
    display: flex;
    align-items: center;
    gap: 5px;
    font-family: var(--emx-font-num);
    font-size: 10.5px;
    font-weight: 700;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pf-kpi-delta .pf-kpi-vs {
    font-family: Inter, sans-serif;
    font-weight: 600;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
}

.pf-kpi-delta.good { color: var(--neon-green); }
.pf-kpi-delta.bad  { color: var(--neon-red); }

.pf-kpi.is-link { cursor: pointer; }

.pf-kpi.is-link:focus-visible {
    outline: 2px solid var(--neon-cyan);
    outline-offset: 2px;
}

.pf-kpi .pf-kpi-label i.pf-kpi-go {
    margin-left: auto;
    font-size: 9px;
    color: var(--text-muted);
    opacity: 0.45;
    filter: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.pf-kpi.is-link:hover .pf-kpi-label i.pf-kpi-go {
    opacity: 1;
    transform: translateX(2px);
}

.pf-kpi-row2 { margin-top: -12px; }
.pf-kpi-row2 .pf-kpi-value { font-size: 21px; }

/* Conclusion above the trend chart: the sentence first, the chart as proof. */
.pf-trend-head {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 6px 8px;
    margin: -4px 0 12px;
    font-size: 13px;
    font-weight: 800;
    color: var(--text-main);
}

.pf-trend-head i { font-size: 12px; }
.pf-trend-num { font-family: var(--emx-font-num); }
.pf-trend-head.good i, .pf-trend-head.good .pf-trend-num { color: var(--neon-green); }
.pf-trend-head.bad i, .pf-trend-head.bad .pf-trend-num { color: var(--neon-red); }
.pf-trend-sub { font-size: 11px; font-weight: 600; color: var(--text-muted); }

/* Quick periods. Scrolls sideways on a phone instead of wrapping into rows. */
.pf-presets {
    display: flex;
    gap: 2px;
    max-width: 100%;
    padding: 3px;
    overflow-x: auto;
    scrollbar-width: none;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 10px;
}

.pf-presets::-webkit-scrollbar { display: none; }

.pf-presets button {
    flex-shrink: 0;
    height: 26px;
    padding: 0 10px;
    border: none;
    border-radius: 7px;
    background: transparent;
    color: var(--text-muted);
    font-family: Inter, sans-serif;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.4px;
    white-space: nowrap;
    cursor: pointer;
    transition: color 0.2s ease, background 0.2s ease;
}

.pf-presets button:hover { color: var(--text-main); background: rgba(255, 255, 255, 0.06); }
.pf-presets button.is-active { color: #121215; background: var(--neon-cyan); }

/* ── the ANALIZA button ──────────────────────────────────────
   One thing to press. The working animation is cosmetic — the analysis itself
   takes milliseconds — so JS skips it entirely under reduced motion. */

.pf-analyze-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin: 6px 0 30px;
    padding: 26px 20px;
    border-radius: 18px;
    background: rgba(27, 27, 31, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.pf-analyze {
    position: relative;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 260px;
    padding: 18px 40px;
    border: 1px solid rgba(31, 164, 194, 0.5);
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(31, 164, 194, 0.22), rgba(31, 164, 194, 0.06));
    color: var(--text-main);
    font-family: Inter, sans-serif;
    font-size: 15px;
    font-weight: 800;
    letter-spacing: 2px;
    cursor: pointer;
    box-shadow: 0 10px 30px rgba(31, 164, 194, 0.15);
    transition: transform 0.2s ease, box-shadow 0.25s ease, border-color 0.25s ease, background 0.25s ease;
}

.pf-analyze:hover {
    transform: translateY(-1px);
    border-color: var(--neon-cyan);
    box-shadow: 0 16px 40px rgba(31, 164, 194, 0.3);
}

.pf-analyze:active { transform: translateY(0) scale(0.99); }
.pf-analyze:focus-visible { outline: 2px solid var(--neon-cyan); outline-offset: 3px; }

.pf-analyze-face { display: inline-flex; align-items: center; gap: 12px; }
.pf-analyze-face i { color: var(--neon-cyan); font-size: 16px; }

.pf-analyze-bar {
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 3px;
    transform: scaleX(0);
    transform-origin: left center;
    background: var(--neon-cyan);
}

.pf-analyze.is-working { cursor: progress; border-color: var(--neon-cyan); }
.pf-analyze.is-working .pf-analyze-face { opacity: 0.75; }
.pf-analyze.is-working .pf-analyze-bar { animation: pfScan 1.1s cubic-bezier(0.4, 0, 0.2, 1) forwards; }

.pf-analyze.is-working::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(100deg, transparent 20%, rgba(31, 164, 194, 0.2) 50%, transparent 80%);
    animation: pfSweep 1.1s linear infinite;
}

@keyframes pfScan { to { transform: scaleX(1); } }
@keyframes pfSweep { from { transform: translateX(-100%); } to { transform: translateX(100%); } }

.pf-analyze-hint { font-size: 12px; color: var(--text-muted); }

.pf-analyze-status {
    min-height: 14px;
    font-family: var(--emx-font-num);
    font-size: 11px;
    letter-spacing: 0.6px;
    color: var(--neon-cyan);
}

body.tir-mode .pf-analyze {
    border-color: rgba(232, 146, 42, 0.5);
    background: linear-gradient(135deg, rgba(232, 146, 42, 0.22), rgba(232, 146, 42, 0.06));
    box-shadow: 0 10px 30px rgba(232, 146, 42, 0.15);
}

body.tir-mode .pf-analyze:hover {
    border-color: var(--neon-amber, #e8922a);
    box-shadow: 0 16px 40px rgba(232, 146, 42, 0.3);
}

body.tir-mode .pf-analyze-face i,
body.tir-mode .pf-analyze-status { color: var(--neon-amber, #e8922a); }
body.tir-mode .pf-analyze-bar { background: var(--neon-amber, #e8922a); }
body.tir-mode .pf-analyze.is-working::after {
    background: linear-gradient(100deg, transparent 20%, rgba(232, 146, 42, 0.2) 50%, transparent 80%);
}

@media (max-width: 600px) {
    .pf-analyze-wrap { padding: 20px 14px; }
    .pf-analyze { min-width: 0; width: 100%; padding: 16px 18px; font-size: 14px; }
}

/* ── the analysis report ─────────────────────────────────────
   Semantic levels, one colour per meaning: green fine, yellow watch,
   amber worth fixing, red act now. */

.lvl-ok      { --lvl: var(--neon-green); }
.lvl-watch   { --lvl: #FACC15; }
.lvl-improve { --lvl: var(--neon-amber, #e8922a); }
.lvl-problem { --lvl: var(--neon-red); }

.pf-rep-head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-bottom: 14px;
    margin-bottom: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.pf-rep-head > i { color: var(--lvl); font-size: 18px; }
.pf-rep-title { font-size: 15px; font-weight: 800; color: var(--text-main); }
.pf-rep-sub { font-size: 12px; line-height: 1.5; color: var(--text-muted); }
.pf-rep-sub b { color: var(--text-main); }

.pf-rep-kpis {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
    margin-bottom: 22px;
}

.pf-rep-kpi {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 10px 12px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.pf-rep-kpi-label {
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: var(--text-muted);
}

.pf-rep-kpi-value {
    font-family: var(--emx-font-num);
    font-size: 15px;
    font-weight: 700;
    color: var(--text-main);
}

.pf-rep-kpi .pf-kpi-delta { margin-top: 2px; font-size: 10px; }

.pf-fcards { display: flex; flex-direction: column; gap: 10px; }

.pf-fcard {
    padding: 13px 15px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.025);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-left: 3px solid var(--lvl);
}

.pf-fcard-head {
    display: grid;
    grid-template-columns: 12px 1fr;
    gap: 10px;
    align-items: start;
    font-size: 13px;
    line-height: 1.55;
    color: var(--text-main);
}

.pf-fcard-head .pf-ins-dot { margin-top: 5px; }

.pf-fcard-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed rgba(255, 255, 255, 0.08);
}

.pf-fcard-do {
    display: flex;
    align-items: baseline;
    gap: 9px;
    flex: 1;
    min-width: 220px;
    font-size: 12.5px;
    line-height: 1.5;
    color: var(--text-muted);
}

.pf-fcard-do-label {
    flex-shrink: 0;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 1.1px;
    text-transform: uppercase;
    color: var(--lvl);
}

.pf-fcard-do b { color: var(--text-main); font-weight: 700; }
.pf-fcard-note { margin-top: 7px; font-size: 10px; color: var(--text-muted); }

.pf-ins-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--lvl);
    box-shadow: none;
}

.pf-goods { display: flex; flex-direction: column; gap: 9px; margin-bottom: 18px; }

.pf-good {
    display: grid;
    grid-template-columns: 14px 1fr;
    gap: 10px;
    align-items: start;
    font-size: 12.5px;
    line-height: 1.5;
    color: var(--text-muted);
}

.pf-good > i { margin-top: 3px; font-size: 11px; color: var(--neon-green); }
.pf-good b { color: var(--text-main); font-weight: 700; }
.pf-dq > i { color: var(--neon-cyan); }

.pf-rep-foot { margin-top: 20px; }

.pf-copy-area {
    width: 100%;
    margin-top: 14px;
    font-family: var(--emx-font-num);
    font-size: 11px;
}

.pf-btn.pf-btn-sm { padding: 6px 11px; font-size: 10px; }
.pf-ins-more { margin-top: 12px; }

.pf-ins-note {
    padding: 10px 0 2px;
    font-size: 12px;
    color: var(--text-muted);
}

/* On a phone the fix and the button stack; side by side, the sentence was
   squeezed into a column two words wide. */
@media (max-width: 600px) {
    .pf-fcard-foot { flex-direction: column; align-items: stretch; gap: 10px; }
    .pf-fcard-do { min-width: 0; flex-direction: column; gap: 4px; }
    .pf-fcard-foot .pf-btn { align-self: flex-start; }
}

/* The sheet the PDF is rendered on. Off-screen, A4 wide, and light: a dark
   dashboard palette on paper is unreadable, so the tokens are redefined here
   instead of fighting every component. */
.pf-pdf-surface {
    position: absolute;
    left: -10000px;
    top: 0;
    width: 794px;             /* A4 at 96 dpi */
    padding: 28px 32px;
    background: #ffffff;
    color: #1b1b1f;
    font-family: Inter, sans-serif;
    --text-main: #1b1b1f;
    --text-muted: #4b5563;
}

.pf-pdf-title {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin-bottom: 18px;
    padding-bottom: 12px;
    border-bottom: 2px solid #1b1b1f;
}

.pf-pdf-title strong { font-size: 15px; font-weight: 800; letter-spacing: 1.4px; }
.pf-pdf-title span { font-size: 12px; color: #4b5563; }

.pf-pdf-surface .pf-fcard,
.pf-pdf-surface .pf-rep-kpi { background: #fff; border-color: #d1d5db; }

.pf-pdf-surface .pf-rep-head { border-bottom-color: #e5e7eb; }
.pf-pdf-surface .pf-fcard-foot { border-top-color: #d1d5db; }
.pf-pdf-surface .pf-why-track,
.pf-pdf-surface .pf-cbar-track { background: #e5e7eb; }
.pf-pdf-surface .pf-ins-dot { box-shadow: none; }
.pf-pdf-surface .pf-btn { display: none; }

/* Neon on white is unreadable; darker equivalents keep the same meaning. */
.pf-pdf-surface .lvl-ok      { --lvl: #047857; }
.pf-pdf-surface .lvl-watch   { --lvl: #b45309; }
.pf-pdf-surface .lvl-improve { --lvl: #c2410c; }
.pf-pdf-surface .lvl-problem { --lvl: #b91c1c; }

.pf-pdf-surface .pf-pos,
.pf-pdf-surface .pf-kpi-delta.good,
.pf-pdf-surface .pf-good > i { color: #047857; }

.pf-pdf-surface .pf-neg,
.pf-pdf-surface .pf-kpi-delta.bad { color: #b91c1c; }

.pf-pdf-surface .pf-dq > i { color: #1d4ed8; }
.pf-pdf-surface .pf-why-fill.good { background: #047857; }
.pf-pdf-surface .pf-why-fill.bad { background: #b91c1c; }
@media (prefers-reduced-motion: reduce) {
    .pf-analyze.is-working .pf-analyze-bar,
    .pf-analyze.is-working::after { animation: none !important; }
}

/* Drill-down windows: ranked rows and the margin-change breakdown */
.pf-rank {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 18px;
}

.pf-rank-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 14px;
    width: 100%;
    padding: 10px 12px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    color: var(--text-main);
    font-family: inherit;
    font-size: 12px;
    text-align: left;
}

button.pf-rank-row { cursor: pointer; transition: border-color 0.2s ease, background 0.2s ease; }
button.pf-rank-row:hover { border-color: rgba(31, 164, 194, 0.4); background: rgba(31, 164, 194, 0.05); }

.pf-rank-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pf-rank-title { font-weight: 700; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.pf-rank-sub { font-size: 10.5px; color: var(--text-muted); }

.pf-rank-fig {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
    font-family: var(--emx-font-num);
    font-weight: 700;
    white-space: nowrap;
}

.pf-rank-fig small { font-size: 10.5px; font-weight: 600; color: var(--text-muted); }
.pf-rank-row.is-flag .pf-rank-sub { color: var(--neon-amber, #e8922a); }

/* Fleet table: the vehicle clearly above the fleet's empty share */
.pf-cell-sub.pf-flag { color: var(--neon-amber, #e8922a); font-weight: 700; }

.pf-why-lead {
    margin: 0 0 14px;
    font-size: 13px;
    line-height: 1.55;
    color: var(--text-muted);
}

.pf-why-lead b { color: var(--text-main); }

.pf-why {
    display: flex;
    flex-direction: column;
    gap: 9px;
    margin-bottom: 20px;
}

.pf-why-row {
    display: grid;
    grid-template-columns: minmax(96px, 150px) minmax(60px, 1fr) 72px;
    align-items: center;
    gap: 12px;
    font-size: 12px;
    color: var(--text-main);
}

.pf-why-track {
    position: relative;
    height: 8px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.05);
}

.pf-why-track::before {
    content: '';
    position: absolute;
    left: 50%;
    top: -3px;
    bottom: -3px;
    width: 1px;
    background: rgba(255, 255, 255, 0.25);
}

.pf-why-fill { position: absolute; top: 0; bottom: 0; border-radius: 4px; }
.pf-why-fill.good { left: 50%; background: var(--neon-green); }
.pf-why-fill.bad  { right: 50%; background: var(--neon-red); }

.pf-why-val {
    font-family: var(--emx-font-num);
    font-weight: 700;
    text-align: right;
    white-space: nowrap;
}

.pf-note-small {
    margin: -8px 0 16px;
    font-size: 10.5px;
    line-height: 1.5;
    color: var(--text-muted);
}

body.tir-mode .pf-presets button.is-active { background: var(--neon-amber, #e8922a); }
body.tir-mode .pf-kpi.is-link:focus-visible { outline-color: var(--neon-amber, #e8922a); }
body.tir-mode button.pf-rank-row:hover { border-color: rgba(232, 146, 42, 0.45); background: rgba(232, 146, 42, 0.05); }

/* ── Driver periods: alerts, idle band, day calendar ─────────
   Every day a driver is on the road costs the day rate; these show the
   days that carried no load (profit-periods.js). */

.pf-dr-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
    margin-bottom: 14px;
}

.pf-palerts {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}

.pf-palert {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 12px;
    background: rgba(232, 146, 42, 0.07);
    border: 1px solid rgba(232, 146, 42, 0.35);
    font-size: 12.5px;
    line-height: 1.5;
    color: var(--text-main);
}

.pf-palert > i { color: var(--neon-amber, #e8922a); flex-shrink: 0; }
.pf-palert-text { flex: 1; min-width: 0; }
.pf-palert .pf-btn { flex-shrink: 0; }

.pf-idle-band {
    margin: 0 0 18px;
    padding: 16px 20px;
    border-radius: 18px;
    background: rgba(27, 27, 31, 0.4);
    border: 1px solid rgba(213, 122, 217, 0.22);
    border-left: 3px solid #d57ad9;
    transition: border-color 0.25s ease;
}

.pf-idle-band.is-link { cursor: pointer; }
.pf-idle-band.is-link:hover { border-color: rgba(213, 122, 217, 0.45); }
.pf-idle-band.is-link:focus-visible { outline: 2px solid #d57ad9; outline-offset: 2px; }

.pf-idle-lead {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: var(--text-main);
    margin-bottom: 12px;
}

.pf-idle-lead > i:first-child { color: #d57ad9; }
.pf-idle-lead > span { flex: 1; }

.pf-idle-figs {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 12px;
}

.pf-idle-fig { display: flex; flex-direction: column; gap: 3px; min-width: 0; }

.pf-idle-fig-label {
    font-size: 9.5px;
    font-weight: 800;
    letter-spacing: 1.1px;
    text-transform: uppercase;
    color: var(--text-muted);
}

.pf-idle-fig-value {
    font-family: var(--emx-font-num);
    font-size: 15px;
    font-weight: 700;
    color: var(--text-main);
}

.pf-active-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px; }

.pf-active-period {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.07);
    background: rgba(255, 255, 255, 0.025);
}

.pf-active-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; font-size: 13px; }
.pf-active-main .pf-muted { font-size: 11.5px; }

.pf-active-amt {
    font-family: var(--emx-font-num);
    font-weight: 700;
    white-space: nowrap;
}

.pf-active-btns { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }

.pf-period-block {
    padding: 14px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.pf-period-block:first-child { padding-top: 0; }

.pf-period-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    font-size: 13px;
}

.pf-period-btns { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }

.pf-days {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(54px, 1fr));
    gap: 6px;
}

.pf-day {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 7px 4px;
    border-radius: 9px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-main);
    font: inherit;
    font-size: 11px;
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.pf-day i { font-size: 10px; }
.pf-day-d { font-family: var(--emx-font-num); font-weight: 700; }

.pf-day.is-loaded { border-color: rgba(52, 211, 153, 0.3); background: rgba(52, 211, 153, 0.06); }
.pf-day.is-loaded i { color: var(--neon-green); }

.pf-day.is-idle {
    border-color: color-mix(in srgb, var(--reason, #8a8a90) 55%, transparent);
    background: color-mix(in srgb, var(--reason, #8a8a90) 12%, transparent);
}

.pf-day.is-idle i { color: var(--reason, #8a8a90); }
.pf-day.is-unspec { border-style: dashed; }
.pf-day.is-marked::after { content: '•'; line-height: 0.6; color: var(--text-muted); }
.pf-day:hover { border-color: rgba(255, 255, 255, 0.35); }
.pf-day.is-sel { outline: 2px solid var(--neon-cyan); outline-offset: 1px; }

.pf-day-editor-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-top: 12px;
    font-size: 12.5px;
}

.pf-crew { display: flex; flex-direction: column; gap: 6px; margin-bottom: 6px; }

.pf-crew-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12.5px;
}

.pf-crew-row > i { color: var(--text-muted); width: 16px; text-align: center; }
.pf-crew-row .pf-crew-swap { color: var(--neon-amber, #e8922a); }
.pf-crew-amt { margin-left: auto; font-family: var(--emx-font-num); font-weight: 700; }

.pf-idle-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    border-radius: 12px;
    border: 1px dashed color-mix(in srgb, var(--reason, #8a8a90) 60%, transparent);
    background: color-mix(in srgb, var(--reason, #8a8a90) 8%, transparent);
}

.pf-idle-card > i { color: var(--reason, #8a8a90); }
.pf-idle-card-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; font-size: 12.5px; }
.pf-idle-card-main .pf-muted { font-size: 11px; }
.pf-idle-card-amt { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; font-size: 12.5px; }
.pf-idle-card-amt .pf-neg { font-family: var(--emx-font-num); font-weight: 700; }
.pf-idle-card-amt .pf-muted { font-size: 10.5px; white-space: nowrap; }

@media (max-width: 900px) {
    .pf-idle-figs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 600px) {
    .pf-active-period { flex-wrap: wrap; }
    .pf-active-btns { width: 100%; justify-content: flex-start; }
    .pf-palert { flex-wrap: wrap; }
    .pf-idle-card { flex-wrap: wrap; }
    .pf-idle-card-amt { align-items: flex-start; }
}

/* ── Paid add-ons (js/addons.js) ──────────────────────────────
   Tone: inform, never alarm. One muted lock icon everywhere, no red, no
   glow, no countdowns. */

.addon-lock { font-size: 10px; margin-left: 6px; color: var(--text-muted); opacity: 0.85; }
.hud-sub.is-locked { cursor: pointer; color: var(--text-muted); }

/* Shared by the Settings panel and the add-on windows */
.addon-error { margin: 10px 0 0; font-size: 12px; color: #f87171; font-weight: 400; line-height: 1.5; }
.addon-link {
    background: none; border: 0; padding: 0; font: inherit; font-size: inherit;
    color: #3cbfda; text-decoration: underline; text-underline-offset: 3px; cursor: pointer;
}
.addon-link:focus-visible, .addon-switch:focus-visible, .addon-portal:focus-visible {
    outline: 2px solid #3cbfda; outline-offset: 2px;
}

/* Settings → Subskrypcja. Matches the Settings window: neutral, the Map's
   enamel cyan (not the neon) only where something is on. */
.addon-panel { margin-top: 20px; padding-top: 18px; border-top: 1px solid rgba(255, 255, 255, 0.08); }
.addon-panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.addon-panel-next { font-size: 11px; color: var(--text-muted); }
.addon-panel-loading { font-size: 12px; color: var(--text-muted); padding: 10px 0; display: flex; gap: 8px; align-items: center; }
.addon-panel-note { margin: 10px 0 0; font-size: 11.5px; color: var(--text-muted); line-height: 1.5; }
.addon-row {
    display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 14px;
    min-height: 44px; padding: 8px 0; border-bottom: 1px solid var(--glass-border);
}
.addon-row-name { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.addon-row-name b { font-size: 13px; color: var(--text-main); }
.addon-row-name small { font-size: 11px; color: var(--text-muted); }
.addon-row-price { font-family: var(--emx-font-num); font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--text-main); }
.addon-row-status { font-size: 11.5px; color: var(--text-muted); white-space: nowrap; }
.addon-row-status.is-on { color: #3cbfda; }
.addon-row-total { border-bottom: 0; }
.addon-row-total .addon-row-price { font-weight: 700; }
.addon-switch {
    position: relative; width: 40px; height: 22px; border-radius: 11px; padding: 0; cursor: pointer;
    background: transparent; border: 1px solid var(--glass-border);
    transition: background 0.2s ease, border-color 0.2s ease;
}
.addon-switch-knob {
    position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%;
    background: var(--text-muted); transition: transform 0.2s cubic-bezier(0.23, 1, 0.32, 1), background 0.2s ease;
}
.addon-switch.is-on { background: linear-gradient(180deg, #63d4e7 0%, #27abc8 55%, #1689a7 100%); border-color: transparent; }
.addon-switch.is-on .addon-switch-knob { transform: translateX(18px); background: rgba(255, 255, 255, 0.92); }
.addon-portal {
    display: flex; align-items: center; justify-content: space-between; width: 100%; min-height: 44px;
    margin-top: 6px; padding: 0; background: none; border: 0; cursor: pointer;
    color: #3cbfda; font: inherit; font-size: 12px; font-weight: 700; letter-spacing: 0.4px;
}

/* ── EMAROX PROFIT in the family style (STYL-EMAROX.md) ─────────
   The lock screen, the three add-on windows and the purchase scene.
   Local tokens, like #auth-modal in app-shell.css: the landing's neutral
   black and the Map's cyan as metal. Dark only, like PROFIT itself.
   Motion: transform, opacity, filter (and the ring's stroke-dashoffset). */

.emx-addon {
    --emx-surface: #1b1b1f;
    --emx-line: rgba(255, 255, 255, .08);
    --emx-line-2: rgba(255, 255, 255, .14);
    --emx-text: #f4f3f0;
    --emx-text-2: #a3a3a7;
    --emx-text-3: #8a8a90;
    --emx-accent: #3cbfda;
    --emx-accent-base: #1fa4c2;
    --emx-accent-ink: #02151b;
    --emx-tint: rgba(31, 164, 194, .08);
    --emx-metal: linear-gradient(180deg, #a4ecf4 0%, #4cc9e0 38%, #1c97b5 68%, #0d5f77 100%);
    --emx-sheen: rgba(236, 252, 255, .9);
    --emx-btn-fill: linear-gradient(180deg, #63d4e7 0%, #27abc8 55%, #1689a7 100%);
    --emx-btn-shine: rgba(225, 250, 255, .55);
    --emx-btn-shadow: rgba(31, 164, 194, .5);
    --emx-shadow: 0 30px 80px rgba(0, 0, 0, .55);
    --emx-ease: cubic-bezier(.22, 1, .36, 1);
    --emx-head: 'EMX Jakarta', 'Plus Jakarta Sans', system-ui, sans-serif;
    --emx-body: 'EMX Inter', 'Inter', system-ui, 'Segoe UI', Arial, sans-serif;
    font-family: var(--emx-body);
    color: var(--emx-text);
    -webkit-font-smoothing: antialiased;
}

/* name in metal beside the EX mark (landing: .l-nav-logo / .logo-metal) */
.emx-brand { display: flex; align-items: center; gap: 10px; margin: 0 0 22px; padding-right: 48px; }
.emx-mark {
    display: block; flex-shrink: 0; height: 22px; aspect-ratio: 108 / 64;
    background: var(--emx-metal);
    -webkit-mask: url("landing/assets/img/logo-mark.webp") center / contain no-repeat;
            mask: url("landing/assets/img/logo-mark.webp") center / contain no-repeat;
}
.emx-brand-name {
    font-family: var(--emx-head); font-weight: 700; font-size: 1.0625rem; letter-spacing: -.01em; white-space: nowrap;
    background-image: linear-gradient(100deg, transparent 40%, var(--emx-sheen) 50%, transparent 60%), var(--emx-metal);
    background-size: 260% 100%, 100% 100%;
    background-position: 160% 0, 0 0;
    background-repeat: no-repeat;
    -webkit-background-clip: text; background-clip: text; color: transparent;
    padding-bottom: .1em;
}
/* one sheen as the card or window arrives */
.addon-lock-layer:not(.is-static) .emx-brand-name,
.emx-modal.is-in .emx-brand-name { animation: emxSheen 1.3s var(--emx-ease) .45s; }
@keyframes emxSheen { from { background-position: 160% 0, 0 0; } to { background-position: -60% 0, 0 0; } }

.emx-title {
    margin: 0 0 14px; font-family: var(--emx-head); font-weight: 700;
    font-size: 1.6rem; letter-spacing: -.032em; line-height: 1.08;
    color: var(--emx-text); text-wrap: balance;
}
.emx-title .dot { margin-left: -.07em; }
.emx-text, .emx-lead { margin: 0 0 12px; font-size: 1.0625rem; line-height: 1.6; color: var(--emx-text-2); text-wrap: pretty; }
.emx-text:last-child { margin-bottom: 0; }
.emx-text > p { margin: 0 0 10px; }
.emx-text > p:last-child { margin-bottom: 0; }
.emx-text .fa-spin { margin-right: 8px; }
.emx-amount {
    font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap;
    background: var(--emx-metal); -webkit-background-clip: text; background-clip: text; color: transparent;
    padding-bottom: .06em;
}
.emx-note { margin: 0 0 12px; font-size: 1.0625rem; line-height: 1.6; color: var(--emx-text-3); }
.emx-price { margin: 0 0 12px; font-size: 1.0625rem; font-weight: 600; color: var(--emx-text); font-variant-numeric: tabular-nums; }
.emx-addon .addon-error { margin: 12px 0 0; font-size: 1.0625rem; }

/* buttons: one metal pill, one glass */
.emx-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }
.emx-btn {
    position: relative; isolation: isolate; overflow: hidden;
    display: inline-flex; align-items: center; justify-content: center; gap: 10px;
    min-height: 52px; padding: 0 26px; border-radius: 999px; border: 1px solid transparent;
    font-family: var(--emx-body); font-weight: 600; font-size: 1rem; letter-spacing: -.005em; line-height: 1; white-space: nowrap;
    cursor: pointer;
    transition: transform .4s var(--emx-ease), box-shadow .4s var(--emx-ease),
                border-color .2s, color .2s, opacity .2s;
}
.emx-btn-primary {
    color: var(--emx-accent-ink); background: var(--emx-btn-fill);
    box-shadow: inset 0 1px 0 var(--emx-btn-shine), inset 0 -1px 0 rgba(0, 40, 55, .35), 0 10px 30px -12px var(--emx-btn-shadow);
}
.emx-btn-primary::after {
    content: ''; position: absolute; inset: 0; z-index: -1;
    background: linear-gradient(105deg, transparent 30%, rgba(235, 252, 255, .55) 50%, transparent 70%);
    transform: translateX(-120%); transition: transform .9s var(--emx-ease);
}
.emx-btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: inset 0 1px 0 var(--emx-btn-shine), inset 0 -1px 0 rgba(0, 40, 55, .35), 0 16px 36px -14px var(--emx-btn-shadow);
}
.emx-btn-primary:hover:not(:disabled)::after { transform: translateX(120%); }
.emx-btn-ghost {
    color: var(--emx-text); background: rgba(255, 255, 255, .035); border-color: var(--emx-line-2);
    -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.emx-btn-ghost:hover:not(:disabled) { border-color: var(--emx-accent-base); color: var(--emx-accent); transform: translateY(-2px); }
.emx-btn-danger:hover:not(:disabled) { border-color: rgba(248, 113, 113, .6); color: #fca5a5; }
.emx-btn:active:not(:disabled) { transform: scale(.98); }
.emx-btn:disabled { opacity: .5; cursor: default; }
.emx-btn .fa-spin { font-size: .9em; }

/* × in a circle, turns 90° on hover */
.emx-x {
    position: absolute; top: 18px; right: 18px; z-index: 2;
    width: 40px; height: 40px; padding: 0; border-radius: 50%;
    border: 1px solid var(--emx-line-2); background: rgba(255, 255, 255, .03); color: var(--emx-text-2);
    cursor: pointer;
    transition: transform .4s var(--emx-ease), border-color .2s, color .2s, background-color .2s, opacity .2s;
}
.emx-x::before, .emx-x::after {
    content: ''; position: absolute; left: 50%; top: 50%; width: 14px; height: 1.5px; border-radius: 1px; background: currentColor;
}
.emx-x::before { transform: translate(-50%, -50%) rotate(45deg); }
.emx-x::after { transform: translate(-50%, -50%) rotate(-45deg); }
.emx-x:hover:not(:disabled) { transform: rotate(90deg); color: var(--emx-accent); border-color: var(--emx-accent-base); background: var(--emx-tint); }
.emx-x:disabled { opacity: .3; cursor: default; }

.emx-btn:focus-visible, .emx-x:focus-visible, .emx-link:focus-visible { outline: 2px solid var(--emx-accent); outline-offset: 3px; }

/* ── add-on windows (enable / disable / offer) ── */
#addon-modal.emx-modal {
    /* above every other window, the AI scanner (.ai-overlay 9999999) included,
       since that is where the offer is often opened from */
    z-index: 10000000;
    padding: 16px;
    background: rgba(5, 5, 6, .72);
    -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
    animation: none;
    opacity: 0;
    transition: opacity .32s var(--emx-ease);
}
#addon-modal.emx-modal.is-in { opacity: 1; }
.emx-panel {
    position: relative; width: min(480px, 100%); max-height: calc(100dvh - 32px); overflow-y: auto;
    padding: 30px 32px 30px;
    border-radius: 24px; border: 1px solid var(--emx-line-2);
    background: radial-gradient(ellipse 80% 55% at 0% 0%, var(--emx-tint), transparent 60%), var(--emx-surface);
    box-shadow: var(--emx-shadow);
    opacity: 0; transform: translateY(18px) scale(.98);
    transition: opacity .5s var(--emx-ease), transform .5s var(--emx-ease);
}
.emx-modal.is-in .emx-panel { opacity: 1; transform: none; }
.emx-modal .emx-actions { justify-content: flex-end; }

/* the purchase scene shares one grid cell with the content: no jump */
.emx-stage { display: grid; }
.emx-stage > * { grid-area: 1 / 1; min-width: 0; }
.emx-content {
    transition: opacity .45s var(--emx-ease), transform .55s var(--emx-ease), filter .45s var(--emx-ease), visibility 0s linear 0s;
}
.emx-stage.is-scene .emx-content {
    opacity: 0; transform: scale(.97); filter: blur(8px); visibility: hidden;
    transition: opacity .45s var(--emx-ease), transform .55s var(--emx-ease), filter .45s var(--emx-ease), visibility 0s linear .45s;
}

/* purchase scene: no words while it runs, only light going round */
.emx-scene {
    position: relative; align-self: center;
    display: flex; flex-direction: column; align-items: center; gap: 26px; text-align: center;
    padding: 8px 0 6px;
}
.emx-orb {
    position: relative; width: 120px; height: 120px;
    opacity: 0; transform: scale(.8); filter: blur(8px);
    transition: opacity .6s var(--emx-ease) .15s, transform .8s var(--emx-ease) .15s, filter .6s var(--emx-ease) .15s;
}
.emx-stage.is-scene .emx-orb { opacity: 1; transform: none; filter: none; }

.emx-ring-svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.emx-ring-track { stroke: rgba(255, 255, 255, .06); }
.emx-ring-done { transform-box: view-box; transform-origin: 60px 60px; }

/* the comet: a conic tail fading into a bright head, cut to a 3px ring */
.emx-comet {
    position: absolute; inset: 0; border-radius: 50%;
    background: conic-gradient(from 0deg,
        rgba(60, 191, 218, 0) 0deg, rgba(60, 191, 218, 0) 140deg,
        rgba(60, 191, 218, .28) 250deg, #6fd8ea 340deg, #d4f7fc 360deg);
    -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 2.5px));
            mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 2.5px));
    will-change: transform;
}
/* round head, like a line cap */
.emx-comet::after {
    content: ''; position: absolute; left: 50%; top: 0; width: 3px; height: 3px; margin-left: -1.5px;
    border-radius: 50%; background: #d4f7fc;
}

.emx-scene-lock {
    position: absolute; left: 50%; top: 50%; width: 56px; height: 60px; margin: -32px 0 0 -28px;
    overflow: visible; transform-origin: 50% 60%;
}
.emx-scene-lock .emx-green { opacity: 0; }
.emx-shackle { transform-box: view-box; transform-origin: 58px 47px; }

.emx-bloom {
    position: absolute; inset: -34px; border-radius: 50%; pointer-events: none; opacity: 0;
    background: radial-gradient(closest-side, rgba(52, 211, 153, .32), rgba(52, 211, 153, .1) 50%, transparent 72%);
}
.emx-sparks { position: absolute; inset: 0; pointer-events: none; }
.emx-sparks span {
    position: absolute; left: 50%; top: 50%; translate: -50% -50%;
    border-radius: 50%; background: #bbf7d0; opacity: 0;
}

/* words: the title comes out of a blur; a quiet line only if it is slow */
.emx-scene-text { display: grid; justify-items: center; min-height: 5.4em; }
.emx-scene-text > * { grid-area: 1 / 1; }
.emx-scene-done { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.emx-scene-title {
    margin: 0; font-family: var(--emx-head); font-weight: 700; font-size: 1.55rem; letter-spacing: -.024em; line-height: 1.15;
    text-wrap: balance; opacity: 0;
    background-image: linear-gradient(100deg, var(--emx-text) 40%, #ffffff 47%, #c8f5e3 50%, #ffffff 53%, var(--emx-text) 60%);
    background-size: 250% 100%; background-position: 100% 0;
    -webkit-background-clip: text; background-clip: text; color: transparent;
    padding-bottom: .08em;
}
.emx-scene-feat { white-space: nowrap; }
.emx-scene-sep { color: var(--emx-line-2); }
.emx-scene-sub { margin: 0; max-width: 44ch; font-size: .9375rem; line-height: 1.55; color: var(--emx-text-3); opacity: 0; text-wrap: balance; }
.emx-scene-wait {
    margin: 0; align-self: start; font-size: .9375rem; color: var(--emx-text-3);
    opacity: 0; transition: opacity .8s var(--emx-ease);
}
.emx-scene.is-slow .emx-scene-wait { opacity: 1; }
.emx-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* light that runs once round the window's edge when it is done (addons.js) */
@property --emx-sweep { syntax: '<angle>'; inherits: false; initial-value: 0deg; }
.emx-panel::after {
    content: ''; position: absolute; inset: 0; border-radius: inherit; padding: 1px; pointer-events: none;
    background: conic-gradient(from var(--emx-sweep),
        transparent 0deg, transparent 250deg, rgba(52, 211, 153, .55) 320deg, #d1fae5 352deg, transparent 360deg);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor; mask-composite: exclude;
    opacity: 0;
}

/* reduced motion: the finished picture at once */
.emx-scene.is-final .emx-comet { display: none; }
.emx-scene.is-final .emx-ring-done { stroke-dashoffset: 0; }
.emx-scene.is-final .emx-scene-lock .emx-green { opacity: 1; }
.emx-scene.is-final .emx-shackle { transform: translateY(-7px) rotate(24deg); }
.emx-scene.is-final :is(.emx-scene-title, .emx-scene-sub) { opacity: 1; }

/* enable window: what is paid now and what after, as two plain rows */
.emx-bill { border: 1px solid var(--emx-line); border-radius: 16px; background: rgba(255, 255, 255, .025); }
.emx-bill-row {
    display: flex; align-items: center; justify-content: space-between; gap: 16px;
    padding: 14px 18px;
}
.emx-bill-row + .emx-bill-row { border-top: 1px solid var(--emx-line); }
.emx-bill-name { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.emx-bill-name span { font-size: 1rem; font-weight: 600; color: var(--emx-text); }
.emx-bill-name small { font-size: .9375rem; line-height: 1.4; color: var(--emx-text-3); }
.emx-bill-value {
    flex-shrink: 0; font-size: 1.15rem; font-weight: 700; color: var(--emx-text);
    font-variant-numeric: tabular-nums; white-space: nowrap;
}
.emx-bill-value.emx-amount { color: transparent; }
/* phones: the amount beside the row's name, the explanation full width under both */
@media (max-width: 480px) {
    .emx-bill-row:not(.emx-bill-then) { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: baseline; gap: 4px 12px; }
    .emx-bill-row:not(.emx-bill-then) .emx-bill-name { display: contents; }
    .emx-bill-row:not(.emx-bill-then) .emx-bill-name small { grid-column: 1 / -1; grid-row: 2; }
}
/* the recurring part as a small sum: Map + add-on = total */
.emx-bill-then { display: block; }
.emx-bill-lines { display: grid; gap: 7px; margin-top: 10px; }
.emx-bill-line {
    display: flex; align-items: baseline; justify-content: space-between; gap: 16px;
    font-size: .9375rem; color: var(--emx-text-3);
}
.emx-bill-num { font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--emx-text-2); }
.emx-bill-line.is-new, .emx-bill-line.is-new .emx-bill-num { color: var(--emx-accent); }
.emx-bill-line.is-total {
    margin-top: 3px; padding-top: 10px; border-top: 1px solid var(--emx-line);
    font-size: 1rem; font-weight: 600; color: var(--emx-text);
}
.emx-bill-line.is-total .emx-bill-num { font-size: 1.15rem; font-weight: 700; color: var(--emx-text); }
.emx-body > .emx-text + .emx-note { margin-top: 14px; }

/* ── PROFIT lock screen ──
   One layer over the whole workspace, header and tabs included. Its
   backdrop blur is the blur; when the add-on comes on the layer fades
   and takes the blur with it. */
.addon-lock-layer {
    position: absolute; inset: 0; z-index: 20;
    display: grid; place-items: center; padding: 24px 16px; overflow-y: auto;
    background: rgba(18, 18, 21, .42);
    -webkit-backdrop-filter: blur(8px) saturate(1.1); backdrop-filter: blur(8px) saturate(1.1);
    animation: emxFadeIn .4s var(--emx-ease) backwards;
    transition: opacity .6s var(--emx-ease);
}
.addon-lock-card {
    position: relative; width: min(560px, 100%);
    padding: 36px 40px 30px;
    border-radius: 24px; border: 1px solid var(--emx-line-2);
    background: radial-gradient(ellipse 80% 55% at 0% 0%, var(--emx-tint), transparent 60%), var(--emx-surface);
    box-shadow: var(--emx-shadow);
    animation: emxCardIn .5s var(--emx-ease) .05s backwards;
    transition: opacity .45s var(--emx-ease), transform .45s var(--emx-ease);
}
.addon-lock-layer.is-static, .addon-lock-layer.is-static .addon-lock-card { animation: none; }
@keyframes emxFadeIn { from { opacity: 0; } }
@keyframes emxCardIn { from { opacity: 0; transform: translateY(18px) scale(.98); } }
.addon-lock-layer.is-unlocking { opacity: 0; }
.addon-lock-layer.is-unlocking .addon-lock-card { opacity: 0; transform: scale(.98); }

.addon-lock-card .emx-title { font-size: clamp(1.9rem, 3.4vw, 2.45rem); max-width: 15ch; }
.addon-lock-card .emx-lead { max-width: 46ch; }
.emx-facts { list-style: none; margin: 22px 0 10px; padding: 0; border-top: 1px solid var(--emx-line); }
.emx-facts li {
    display: grid; grid-template-columns: 7.5rem minmax(0, 1fr); align-items: baseline; gap: 16px;
    padding: 12px 0; border-bottom: 1px solid var(--emx-line);
}
.emx-facts b {
    font-family: var(--emx-head); font-weight: 700; font-size: 1.35rem; letter-spacing: -.03em;
    font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--emx-text);
}
.emx-facts span { font-size: 1.0625rem; line-height: 1.45; color: var(--emx-text-2); }
.emx-eg { margin: 0 0 18px; font-size: .9rem; color: var(--emx-text-3); }
.emx-link {
    display: inline-flex; align-items: center; gap: 8px; min-height: 44px; margin-top: 10px; padding: 0;
    background: none; border: 0; cursor: pointer;
    font: inherit; font-size: 1rem; color: var(--emx-text-2);
    transition: color .2s;
}
.emx-link:hover { color: var(--emx-accent); }

/* blurred stand-in: the overview with the example month */
.addon-ghost { display: flex; flex-direction: column; gap: 16px; pointer-events: none; user-select: none; }
.addon-ghost-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 16px; }
.addon-ghost-two { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 16px; }
.addon-ghost-card {
    display: flex; flex-direction: column; gap: 10px; padding: 18px 20px;
    border-radius: 16px; background: rgba(255, 255, 255, .035); border: 1px solid rgba(255, 255, 255, .06);
}
.addon-ghost-label { font-size: 11px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--text-muted); }
.addon-ghost-value { font-size: 26px; font-weight: 800; color: var(--text-main); font-variant-numeric: tabular-nums; }
.addon-ghost-trend { flex-direction: row; align-items: flex-end; gap: 14px; height: 220px; }
.addon-ghost-trend span {
    flex: 1; height: calc(var(--h) * 100%); border-radius: 8px 8px 3px 3px;
    background: linear-gradient(180deg, rgba(60, 191, 218, .55), rgba(60, 191, 218, .12));
}
.addon-ghost-lanes { justify-content: center; gap: 18px; }
.addon-ghost-lane { display: grid; grid-template-columns: 70px minmax(0, 1fr) 48px; align-items: center; gap: 12px; font-size: 13px; font-weight: 700; color: var(--text-main); }
.addon-ghost-bar { height: 8px; border-radius: 4px; width: calc(var(--w) * 100%); background: rgba(60, 191, 218, .5); }

/* ── header: PROFIT without the add-on is grey; the chart gives way to a
   lock on hover, in the same spot, nothing moves ── */
body.addon-profit-locked .header-controls .nav-btn-profit {
    color: var(--text-muted);
    border-color: rgba(255, 255, 255, .1) !important;
    background: rgba(255, 255, 255, .03) !important;
}
body.addon-profit-locked .header-controls .nav-btn-profit:hover {
    color: var(--text-main); box-shadow: none; border-color: rgba(255, 255, 255, .22) !important;
}
body.addon-profit-locked .nav-btn-profit::after { background: rgba(255, 255, 255, .35); box-shadow: none; }
body.addon-profit-locked .nav-btn-profit > i { position: relative; color: var(--text-muted); }
body.addon-profit-locked .nav-btn-profit:hover > i { transform: none; filter: none; opacity: 1; }
body.addon-profit-locked .nav-btn-profit > i::before {
    display: inline-block;
    transition: opacity .25s cubic-bezier(.22, 1, .36, 1), transform .25s cubic-bezier(.22, 1, .36, 1);
}
body.addon-profit-locked .nav-btn-profit > i::after {
    content: "\f023"; position: absolute; left: 0; right: 0; top: 0; text-align: center;
    opacity: 0; transform: translateY(4px);
    transition: opacity .25s cubic-bezier(.22, 1, .36, 1), transform .25s cubic-bezier(.22, 1, .36, 1);
}
body.addon-profit-locked .nav-btn-profit:is(:hover, :focus-visible) > i::before { opacity: 0; transform: translateY(-4px); }
body.addon-profit-locked .nav-btn-profit:is(:hover, :focus-visible) > i::after { opacity: 1; transform: none; }

/* ── AI scanner: "Pełne zlecenie" waits for EMAROX PROFIT ── */
.ai-zone-lock, #ai-btn-order .ai-order-locked { display: none; }
body.addon-profit-locked .ai-zone-lock {
    display: inline-flex; align-items: center; gap: 6px; margin-left: auto; flex-shrink: 0;
    padding: 5px 10px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, .1);
    font-size: 11px; font-weight: 600; color: var(--text-muted); white-space: nowrap;
}
body.addon-profit-locked #ai-btn-order .ai-order-locked { display: inline-block; }
body.addon-profit-locked #ai-btn-order .ai-order-open { display: none; }
body.addon-profit-locked .ai-zone-full {
    border-color: rgba(255, 255, 255, .075); background: rgba(255, 255, 255, .014); box-shadow: none;
}
body.addon-profit-locked .ai-zone-full .ai-zone-badge.full {
    color: rgba(255, 255, 255, .45); background: rgba(255, 255, 255, .04); border-color: rgba(255, 255, 255, .08);
}
body.addon-profit-locked .ai-zone-full .ai-input-box { opacity: .45; }
body.addon-profit-locked #ai-btn-order {
    background: rgba(255, 255, 255, .035); border-color: rgba(255, 255, 255, .14); color: rgba(255, 255, 255, .8); box-shadow: none;
}
body.addon-profit-locked #ai-btn-order:hover { background: rgba(255, 255, 255, .07); border-color: rgba(255, 255, 255, .24); color: #fff; }
body.addon-profit-locked #ai-btn-order .ai-btn-glow { display: none; }

@media (max-width: 560px) {
    .addon-lock-card { padding: 28px 20px 22px; }
    .emx-panel { padding: 26px 20px 22px; }
    .emx-actions .emx-btn { flex: 1 1 100%; }
    .emx-facts li { grid-template-columns: 1fr; gap: 2px; }
    .addon-ghost-two { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
    .addon-lock-layer, .addon-lock-card, .emx-brand-name { animation: none !important; }
    .emx-addon *, .emx-addon *::before, .emx-addon *::after,
    #addon-modal.emx-modal, .addon-lock-layer, .addon-lock-card,
    body.addon-profit-locked .nav-btn-profit > i::before,
    body.addon-profit-locked .nav-btn-profit > i::after { transition: none !important; }
}

/* PROFIT: read-only / trial notice, pinned to the bottom of the workspace in
   the toasts' look, for as long as PROFIT is open */
.addon-status-bar {
    position: absolute; left: 50%; bottom: 24px; z-index: 30;
    transform: translateX(-50%);
    display: flex; align-items: center; gap: 12px;
    width: max-content; max-width: calc(100% - 32px);
    padding: 10px 22px; border-radius: 999px;
    background: var(--emx-glass);
    -webkit-backdrop-filter: blur(20px) saturate(1.4); backdrop-filter: blur(20px) saturate(1.4);
    border: 1px solid var(--emx-line-2);
    box-shadow: var(--emx-shadow-sm);
    font-size: 14.5px; font-weight: 500; line-height: 1.4; color: var(--emx-text);
    animation: addonNoticeIn .5s var(--emx-ease) .35s backwards;
}
.addon-status-bar > i { flex-shrink: 0; font-size: 15px; color: var(--emx-accent); }
.addon-status-bar.is-readonly { padding-right: 8px; border-color: rgba(232, 163, 61, .32); }
.addon-status-bar.is-readonly > i { color: var(--emx-warn); }
.addon-status-btn {
    flex-shrink: 0; min-height: 36px; padding: 0 16px; margin-left: 4px; border-radius: 999px;
    border: 1px solid transparent; cursor: pointer;
    font: inherit; font-size: 14px; font-weight: 600; color: var(--emx-accent-ink);
    background: var(--emx-btn-fill);
    box-shadow: inset 0 1px 0 var(--emx-btn-shine);
    transition: transform .3s var(--emx-ease), filter .2s;
}
.addon-status-btn:hover { transform: translateY(-1px); filter: brightness(1.06); }
/* room under the last row so the notice never covers it */
#profit-addon-bar:has(.addon-status-bar) + #profit-screen { padding-bottom: 96px; }
@keyframes addonNoticeIn { from { opacity: 0; transform: translateX(-50%) translateY(14px); } }
@media (max-width: 640px) {
    /* above the round feedback button in the corner */
    .addon-status-bar { bottom: 84px; border-radius: 18px; flex-wrap: wrap; justify-content: center; text-align: center; padding: 12px 16px; }
    .addon-status-bar.is-readonly { padding-right: 16px; }
    #profit-addon-bar:has(.addon-status-bar) + #profit-screen { padding-bottom: 240px; }
}
@media (prefers-reduced-motion: reduce) {
    .addon-status-bar { animation: none; }
}

/* "Nieudana płatność" (js/addons.js paymentIssueBar): the same notice in the
   bad colour, and over the map too, in the same spot. PROFIT shows its own
   copy, the Hangar needs none. */
.addon-status-bar.is-payment { border-color: rgba(248, 113, 113, .38); }
.addon-status-bar.is-payment > i { color: var(--emx-bad); }
.addon-status-bar.is-payment b { font-weight: 700; }
.addon-status-bar.is-floating { position: fixed; z-index: 8000; }
body:has(#profit-view.active) #addon-payment-bar,
body.system-hard-locked #addon-payment-bar { display: none; }
.addon-status-btn.is-quiet {
    background: transparent; color: var(--emx-text);
    border-color: var(--emx-line-2); box-shadow: none;
}

/* Settings → Subskrypcja: the same failed payment, as a line above the rows */
.addon-panel-alert {
    display: flex; align-items: flex-start; gap: 10px; margin: 4px 0 10px; padding: 10px 12px;
    border-radius: 12px; border: 1px solid rgba(248, 113, 113, .32); background: rgba(248, 113, 113, .07);
    font-size: 12px; line-height: 1.5; color: var(--text-main);
}
.addon-panel-alert > i { margin-top: 2px; color: var(--emx-bad); }
.addon-row-status.is-readonly { color: var(--emx-warn); }
/* "Pobierz dane": below the total, one quiet glass pill, the size of the row's text */
.addon-row-export { grid-template-columns: minmax(0, 1fr) auto; border-top: 1px solid var(--glass-border); }
.addon-export-btn {
    display: inline-flex; align-items: center; gap: 8px; min-height: 34px; padding: 0 14px;
    border-radius: 999px; border: 1px solid var(--emx-line-2); background: transparent; cursor: pointer;
    font: inherit; font-size: 12px; font-weight: 600; color: var(--emx-text);
    transition: border-color .2s, background .2s;
}
.addon-export-btn:hover:not(:disabled) { border-color: var(--emx-accent); background: var(--emx-tint); }
.addon-export-btn > i { color: var(--emx-accent); }
.addon-export-btn:focus-visible { outline: 2px solid #3cbfda; outline-offset: 2px; }
/* "Zmień" next to the seats: same pill, a touch smaller so it lines up with the switch */
.addon-change-btn { min-height: 30px; padding: 0 12px; justify-self: end; }
.addon-change-btn > i { font-size: 11px; }

/* Hangar after the whole Map was cancelled: the 30-day download card */
.hangar-export {
    display: flex; flex-direction: column; align-items: flex-start; gap: 12px;
    margin: 18px 0; padding: 22px 24px; border-radius: 18px;
    border: 1px solid var(--emx-line-2); background: var(--emx-surface); text-align: left;
}
.hangar-export .emx-title { margin: 0; font-size: 1.25rem; }
.hangar-export .emx-text { margin: 0; }

@media (max-width: 560px) {
    .addon-row { grid-template-columns: minmax(0, 1fr) auto; }
    .addon-row .addon-row-price { grid-column: 1; grid-row: 2; }
}

@media (prefers-reduced-motion: reduce) {
    .addon-switch, .addon-switch-knob { transition: none; }
}

/* ── seats window: − number + (js/addons.js openSeats) ── */
.emx-stepper { display: flex; align-items: center; justify-content: center; gap: 18px; margin: 6px 0 10px; }
.emx-stepper button {
    width: 46px; height: 46px; flex: 0 0 46px; border-radius: 50%;
    border: 1px solid var(--emx-line-2); background: rgba(255, 255, 255, .03);
    color: var(--emx-text); font-size: 15px; cursor: pointer;
    transition: background-color .2s, border-color .2s, color .2s;
}
.emx-stepper button:hover:not(:disabled) { background: var(--emx-tint-2); border-color: var(--emx-accent); color: var(--emx-accent); }
.emx-stepper button:focus-visible { outline: 2px solid var(--emx-accent); outline-offset: 3px; }
.emx-stepper button:disabled { opacity: .35; cursor: default; }
.emx-stepper output {
    min-width: 84px; text-align: center;
    font: 700 2.6rem/1 var(--emx-font-num); font-variant-numeric: tabular-nums; color: var(--emx-text);
}
.emx-stepper-note { text-align: center; margin: 0 0 16px; }

/* ── thank-you window after Stripe Checkout: three numbered steps ── */
.emx-steps { margin: 14px 0 4px; padding: 0; list-style: none; display: grid; gap: 12px; counter-reset: emx-step; }
.emx-steps li {
    counter-increment: emx-step; display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 12px;
    align-items: start; font-size: 1rem; line-height: 1.5; color: var(--emx-text-2);
}
.emx-steps li::before {
    content: counter(emx-step); width: 30px; height: 30px; border-radius: 50%;
    display: grid; place-items: center;
    background: var(--emx-tint-2); color: var(--emx-accent); font-weight: 700; font-size: .875rem;
}
