/* Arkusz stylów aplikacji (wydzielony z templates/base.html). Tokeny --ew-*, układ, tryb ciemny, wersja mobilna. */
*, *::before, *::after {
    box-sizing: border-box;
}
html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}
body {
    margin: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
input, button, select, optgroup, textarea {
    font-family: inherit;
    font-size: inherit;
    line-height: inherit;
}
button {
    -webkit-appearance: button;
}
input[type="button"], input[type="reset"], input[type="submit"] {
    -webkit-appearance: button;
}
:root {
    color-scheme: light;
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: #eef2ff;
    font-size: clamp(14px, 2.2vw, 16px);
}
body {
    margin: 0;
    min-height: 100vh;
    min-height: 100dvh;
    background: linear-gradient(180deg, #f8fbff 0%, #eef2ff 100%);
    color: #0f172a;
}
.app-shell {
    display: flex;
    min-height: 100vh;
    min-height: 100dvh;
}
.app-sidebar {
    width: 260px;
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    background: #0f172a;
    color: #cbd5e1;
    padding: 1.15rem 1.15rem;
    flex-shrink: 0;
    z-index: 1050;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}
.app-sidebar .brand {
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: #fff;
    margin-bottom: 0.6rem;
}
.app-sidebar hr {
    margin: 0.4rem 0;
}
.app-sidebar .nav-link {
    color: #cbd5e1;
    border-radius: 0.7rem;
    margin-bottom: 0.12rem;
    padding: 0.4rem 0.85rem;
    line-height: 1.25;
    transition: all 0.2s ease;
}
.app-sidebar .nav-link.active,
.app-sidebar .nav-link:hover {
    background: #2563eb;
    color: #fff;
    text-decoration: none;
}
.app-sidebar .btn.mt-auto {
    margin-top: 0.6rem !important;
}
.app-main {
    flex: 1;
    min-width: 0;
    padding: 2rem 2.5rem;
    margin-left: 260px;
}
/* Bootstrap's .row/.col-* are flex items, which default to
   min-width: auto - a wide table (nowrap action buttons, badges)
   inside a column then refuses to shrink and pushes the whole page
   past the viewport width instead of scrolling inside
   .table-responsive as intended. That stray few px of page overflow
   was enough to throw off position:fixed elements (e.g. the mobile
   bottom nav) on pages with wide tables, like "Moje wpisy". */
.app-main .row > [class*="col"] {
    min-width: 0;
}
.page-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.page-title {
    margin: 0;
    font-size: clamp(1.75rem, 2vw, 2.4rem);
    font-weight: 700;
    letter-spacing: -0.02em;
}
.page-subtitle {
    margin: 0.35rem 0 0;
    color: #475569;
}
.page-body {
    display: grid;
    gap: 1.5rem;
}
.page-body > * {
    min-width: 0;
}
.card {
    border: none;
    border-radius: 1rem;
    box-shadow: 0 18px 50px rgba(15, 23, 42, 0.08);
}
.card-soft {
    background: #f8fafc;
}
.badge-soft {
    background: rgba(37, 99, 235, 0.12);
    color: #1d4ed8;
}
.form-control,
.form-select {
    border-radius: 0.85rem;
}
.btn {
    border-radius: 0.85rem;
}
.btn-ghost {
    border: 1px solid rgba(148, 163, 184, 0.3);
    color: #334155;
    background: #fff;
}
.auth-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 2rem;
}
.auth-card {
    max-width: 420px;
    width: 100%;
    border-radius: 1.25rem;
    background: #ffffff;
    box-shadow: 0 24px 90px rgba(15, 23, 42, 0.12);
    overflow: hidden;
}
body.modal-open .mobile-bottom-nav { display: none !important; }
body:has(#mobileMenu.show) .mobile-bottom-nav { display: none !important; }
.mobile-bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    justify-content: space-around;
    background: #ffffff;
    border-top: 1px solid rgba(148, 163, 184, 0.2);
    box-shadow: 0 -4px 20px rgba(15, 23, 42, 0.07);
    padding: 0.5rem 0.25rem calc(0.5rem + env(safe-area-inset-bottom, 0px));
    z-index: 1070;
}
.mobile-bottom-nav .nav-link {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.12rem;
    text-align: center;
    color: #64748b;
    padding: 0.35rem 0.15rem;
    border-radius: 0.65rem;
    transition: color 0.15s ease, background 0.15s ease;
    min-width: 0;
    text-decoration: none;
}
.mobile-bottom-nav .nav-link i {
    font-size: 1.35rem;
    line-height: 1;
}
.mobile-bottom-nav .nav-link .nav-label {
    font-size: 0.67rem;
    font-weight: 500;
    line-height: 1;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}
.mobile-bottom-nav .nav-link.active {
    color: #2563eb;
}
.mobile-bottom-nav .nav-link:hover,
.mobile-bottom-nav .nav-link:focus {
    color: #2563eb;
    background: rgba(37, 99, 235, 0.08);
}
.install-button { min-width: 140px; }
/* Fallback month/year picker for browsers without native
   <input type="month"> UI support (Firefox) - see openDatePicker(). */
.month-picker-panel {
    position: fixed;
    z-index: 1090;
    width: 240px;
    background: #ffffff;
    border-radius: 0.75rem;
    box-shadow: 0 18px 50px rgba(15, 23, 42, 0.18);
    padding: 0.75rem;
    display: none;
}
.month-picker-panel.show { display: block; }
.month-picker-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-weight: 600;
}
.month-picker-panel-header button {
    background: none;
    border: none;
    color: #2563eb;
    font-size: 1.1rem;
    line-height: 1;
    padding: 0.2rem 0.5rem;
    cursor: pointer;
}
.month-picker-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.35rem;
}
.month-picker-cell {
    border: 1px solid rgba(148, 163, 184, 0.35);
    background: #fff;
    border-radius: 0.5rem;
    padding: 0.4rem 0.2rem;
    font-size: 0.85rem;
    cursor: pointer;
}
.month-picker-cell:hover {
    background: rgba(37, 99, 235, 0.08);
    border-color: #2563eb;
}
.month-picker-cell.active {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
}
html[data-bs-theme="dark"] .month-picker-panel {
    background: #1e293b;
    color: #e2e8f0;
}
html[data-bs-theme="dark"] .month-picker-cell {
    background: #1e293b;
    color: #e2e8f0;
    border-color: rgba(148, 163, 184, 0.3);
}
html[data-bs-theme="dark"] .month-picker-cell:hover {
    background: rgba(37, 99, 235, 0.18);
}
/* Touch-friendly form controls */
/* iOS Safari auto-zooms the page when a focused field's font-size is
   below 16px; the root font-size shrinks to 14px on narrow viewports
   (see :root clamp() above), which was triggering that zoom on any
   select/input and leaving fixed elements like the bottom nav
   displaced until the user manually pinched back out. */
.form-control, .form-select { min-height: 44px; font-size: max(16px, 1rem); }
input, select, textarea { font-size: max(16px, 1rem); }
/* Compact icon+label buttons for tables */
.btn-tbl { padding: 0.3rem 0.6rem; }
.btn-tbl .btn-lbl { display: inline; }
@media (max-width: 575px) {
    .btn-tbl .btn-lbl { display: none; }
    .btn-tbl { padding: 0.3rem 0.45rem; }
}
@media (max-width: 992px) {
    .app-sidebar { display: none; }
    .app-main {
        padding: 1.5rem 1.25rem calc(5.5rem + env(safe-area-inset-bottom, 0px));
        margin-left: 0;
    }
}
@media (max-width: 768px) {
    .page-topbar { flex-direction: column; align-items: stretch; }
    .app-main { padding: 1.25rem 1rem calc(6rem + env(safe-area-inset-bottom, 0px)); }
    .page-topbar > div:last-child { width: 100%; justify-content: space-between; }
    .offcanvas-body .nav-link { margin-bottom: 0.5rem; }
}
@media (max-width: 480px) {
    .page-subtitle { font-size: 0.82rem; }
    .app-main { padding: 0.75rem 0.75rem calc(6.5rem + env(safe-area-inset-bottom, 0px)); }
    .offcanvas.offcanvas-start { width: 100%; max-width: 100%; }
    .offcanvas { height: 100vh; }
    .offcanvas-body .nav-link { padding: 0.55rem 0.6rem; font-size: 0.95rem; }
    .install-button { min-width: 100px; font-size: 0.82rem; }
    .page-body { gap: 1rem; }
}

/* ── Dark mode ───────────────────────────────────────────────── */
/* Retune Bootstrap's own dark-mode variables to this app's navy
   palette instead of Bootstrap's neutral gray defaults, so every
   stock component (dropdowns, modals, offcanvas, list groups, form
   controls) stays consistent with the custom .card/.sidebar colors
   instead of two different dark tones sitting side by side. */
html[data-bs-theme="dark"] {
    color-scheme: dark;
    --bs-body-bg: #0b1120;
    --bs-body-color: #e2e8f0;
    --bs-emphasis-color: #f8fafc;
    --bs-secondary-color: #94a3b8;
    --bs-secondary-bg: #1e293b;
    --bs-tertiary-bg: #16213a;
    --bs-border-color: #334155;
    --bs-border-color-translucent: rgba(148, 163, 184, 0.2);
    --bs-link-color: #60a5fa;
    --bs-link-hover-color: #93c5fd;
}
html[data-bs-theme="dark"] .theme-icon-moon {
    display: none;
}
html[data-bs-theme="dark"] .theme-icon-sun {
    display: inline-block !important;
}
html[data-bs-theme="dark"] body {
    background: linear-gradient(180deg, #0f172a 0%, #0a0f1c 100%);
    color: #e2e8f0;
}
html[data-bs-theme="dark"] .page-subtitle {
    color: #94a3b8;
}
html[data-bs-theme="dark"] .card {
    background-color: #1e293b;
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
}
html[data-bs-theme="dark"] .card-soft {
    background: #16213a;
}
/* .bg-white is a Bootstrap utility that means "literally white" and
   is !important - it ignores data-bs-theme entirely, so the many KPI
   tiles built as <div class="card ... bg-white"> stayed bright white
   on a dark page. Force it dark too, with matching readable text. */
html[data-bs-theme="dark"] .bg-white {
    background-color: #1e293b !important;
    color: #e2e8f0 !important;
}
/* Same story as .bg-white above - .bg-light is also a literal,
   theme-blind "light background" utility. Used e.g. for the
   expandable per-user monthly summary row in the admin panel, which
   stayed bright white (with light-on-white-invisible text) in dark
   mode. The color !important is needed too: Bootstrap's own
   .text-dark utility is itself !important, so anything pairing
   bg-light with text-dark (e.g. the hourly-rate badge) would
   otherwise still render dark-on-dark. */
html[data-bs-theme="dark"] .bg-light {
    background-color: #16213a !important;
    color: #e2e8f0 !important;
}
html[data-bs-theme="dark"] .badge-soft {
    background: rgba(96, 165, 250, 0.18);
    color: #93c5fd;
}
html[data-bs-theme="dark"] .btn-ghost {
    border-color: rgba(148, 163, 184, 0.35);
    color: #cbd5e1;
    background: #1e293b;
}
html[data-bs-theme="dark"] .auth-card {
    background: #1e293b;
    box-shadow: 0 24px 90px rgba(0, 0, 0, 0.55);
}
html[data-bs-theme="dark"] .mobile-bottom-nav {
    background: #0f172a;
    border-top-color: rgba(148, 163, 184, 0.15);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.35);
}
html[data-bs-theme="dark"] .mobile-bottom-nav .nav-link {
    color: #94a3b8;
}
html[data-bs-theme="dark"] .mobile-bottom-nav .nav-link.active,
html[data-bs-theme="dark"] .mobile-bottom-nav .nav-link:hover,
html[data-bs-theme="dark"] .mobile-bottom-nav .nav-link:focus {
    color: #60a5fa;
}
html[data-bs-theme="dark"] .mobile-bottom-nav .nav-link:hover,
html[data-bs-theme="dark"] .mobile-bottom-nav .nav-link:focus {
    background: rgba(96, 165, 250, 0.1);
}
/* Bootstrap's contextual table classes (.table-light, .table-warning,
   ...) don't repaint for dark mode on their own - without this a
   table header stays bright white/pastel on a dark card. */
html[data-bs-theme="dark"] .table-light {
    --bs-table-bg: rgba(255, 255, 255, 0.06);
    --bs-table-color: #e2e8f0;
    --bs-table-border-color: rgba(255, 255, 255, 0.12);
}
html[data-bs-theme="dark"] .table-primary {
    --bs-table-bg: rgba(42, 120, 214, 0.22);
    --bs-table-color: #bfdbfe;
    --bs-table-border-color: rgba(96, 165, 250, 0.25);
}
html[data-bs-theme="dark"] .table-info {
    --bs-table-bg: rgba(27, 175, 122, 0.2);
    --bs-table-color: #a7f3d0;
    --bs-table-border-color: rgba(52, 211, 153, 0.25);
}
html[data-bs-theme="dark"] .table-warning {
    --bs-table-bg: rgba(237, 161, 0, 0.2);
    --bs-table-color: #fde68a;
    --bs-table-border-color: rgba(250, 204, 21, 0.25);
}
html[data-bs-theme="dark"] .table-danger {
    --bs-table-bg: rgba(227, 73, 72, 0.2);
    --bs-table-color: #fecaca;
    --bs-table-border-color: rgba(248, 113, 113, 0.25);
}
html[data-bs-theme="dark"] .table-success {
    --bs-table-bg: rgba(0, 131, 0, 0.22);
    --bs-table-color: #bbf7d0;
    --bs-table-border-color: rgba(74, 222, 128, 0.25);
}

/* ── Wygląd z projektu w Claude Design (2026-10) ─────────────────
   Ten sam język co strona /o-aplikacji: granat #0B1220, akcent
   #2B4EFF, nagłówki Space Grotesk, płaskie karty z ramką zamiast
   cienia. Kolory są zmiennymi --ew-*, tryb ciemny tylko je podmienia.
   Blok stoi na końcu, więc nadpisuje wcześniejsze reguły. */
:root {
    --ew-bg: #F5F6F8;
    --ew-card: #FFFFFF;
    --ew-sunken: #F0F2F5;
    --ew-text: #0B1220;
    --ew-c-shift-bg: #EEF1FF; --ew-c-shift-ink: #0B1220; --ew-c-shift-tag: #1A36C7;
    --ew-c-pending-bg: #FFFBEB; --ew-c-pending-ink: #8A4B05;
    --ew-c-leave-bg: #FEF3C7; --ew-c-leave-ink: #8A4B05;
    --ew-c-sick-bg: #E3F4F6; --ew-c-sick-ink: #0E5566;
    --ew-c-red-bg: #FFE4E6; --ew-c-red-ink: #E11D48;
    --ew-c-away-bg: #F1F5F9; --ew-c-away-ink: #475569;
    --ew-muted: #4A5568;
    --ew-border: #E3E6EB;
    --ew-input-border: #D5DAE2;
    --ew-accent: #2B4EFF;
    --ew-accent-hover: #1A36C7;
    --ew-accent-text: #2B4EFF;
    --ew-pay-bg: #0B1220;
    --ew-success: #047857;
    --ew-danger: #B91C1C;
    --ew-warn-bg: #FFFBEB;
    --ew-warn-border: #F6E3A8;
    --ew-warn-text: #8A4B05;
    --ew-display: 'Space Grotesk', Inter, system-ui, sans-serif;
    --bs-primary: #2B4EFF;
    --bs-primary-rgb: 43, 78, 255;
    --bs-link-color: #2B4EFF;
    --bs-link-color-rgb: 43, 78, 255;
    --bs-link-hover-color: #1A36C7;
    --bs-link-hover-color-rgb: 26, 54, 199;
    --bs-body-color: #0B1220;
    --bs-secondary-color: #4A5568;
    --bs-border-color: #E3E6EB;
    background: #F5F6F8;
}
html[data-bs-theme="dark"] {
    --ew-bg: #0B1220;
    --ew-card: #121A2B;
    --ew-sunken: #0F1626;
    --ew-text: #E8ECF3;
    --ew-c-shift-bg: rgba(43,78,255,0.20); --ew-c-shift-ink: #E8ECF3; --ew-c-shift-tag: #9DB0FF;
    --ew-c-pending-bg: rgba(217,119,6,0.14); --ew-c-pending-ink: #FBBF77;
    --ew-c-leave-bg: rgba(217,119,6,0.24); --ew-c-leave-ink: #FCD34D;
    --ew-c-sick-bg: rgba(14,116,144,0.28); --ew-c-sick-ink: #7DD3E6;
    --ew-c-red-bg: rgba(225,29,72,0.22); --ew-c-red-ink: #FB7185;
    --ew-c-away-bg: rgba(148,163,184,0.16); --ew-c-away-ink: #CBD5E1;
    --ew-muted: #A3ADC2;
    --ew-border: #263048;
    --ew-input-border: #33405C;
    --ew-accent-text: #8EA4FF;
    --ew-pay-bg: #2B4EFF;
    --ew-success: #34D399;
    --ew-danger: #F87171;
    --ew-warn-bg: rgba(217, 119, 6, 0.12);
    --ew-warn-border: rgba(217, 119, 6, 0.4);
    --ew-warn-text: #FCD34D;
    --bs-body-bg: #0B1220;
    --bs-body-color: #E8ECF3;
    --bs-secondary-color: #A3ADC2;
    --bs-secondary-bg: #121A2B;
    --bs-tertiary-bg: #0F1626;
    --bs-border-color: #263048;
    --bs-link-color: #8EA4FF;
    --bs-link-color-rgb: 142, 164, 255;
    --bs-link-hover-color: #B4C3FF;
    --bs-link-hover-color-rgb: 180, 195, 255;
    background: #0B1220;
}
body,
html[data-bs-theme="dark"] body {
    background: var(--ew-bg);
    color: var(--ew-text);
    line-height: 1.5;
}
h1, h2, h3, h4, h5, .h1, .h2, .h3, .h4, .h5,
.modal-title, .offcanvas-title {
    font-family: var(--ew-display);
    letter-spacing: -0.02em;
}
.page-topbar { align-items: flex-end; }
.page-eyebrow {
    margin: 0 0 0.2rem;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--ew-accent-text);
}
.page-title {
    font-size: clamp(1.6rem, 2.6vw, 2.5rem);
    line-height: 1.05;
    letter-spacing: -0.03em;
}
.page-subtitle,
html[data-bs-theme="dark"] .page-subtitle { color: var(--ew-muted); }

/* Sidebar */
.app-sidebar {
    background: #0B1220;
    color: #B7C0D1;
    padding: 1.35rem 1rem;
    border-right: 1px solid #1A2440;
}
.app-sidebar .brand {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0 0.5rem;
    margin-bottom: 1.1rem;
    font-family: var(--ew-display);
    font-size: 1.2rem;
    letter-spacing: -0.04em; /* logo: małe litery, światło −4% (Claude Design › Logo) */
    color: #FFFFFF;
    text-decoration: none;
}
.brand-mark {
    width: 36px;
    height: 36px;
    flex: none;
    border-radius: 10px;
    background: #1A2440;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.app-sidebar .nav-link {
    color: #B7C0D1;
    padding: 0.55rem 0.75rem;
    border-radius: 10px;
}
.app-sidebar .nav-link:hover {
    background: rgba(142, 164, 255, 0.08);
    color: #FFFFFF;
}
.app-sidebar .nav-link.active {
    background: rgba(142, 164, 255, 0.14);
    color: #FFFFFF;
    font-weight: 600;
}
.sidebar-status {
    margin-top: auto;
    border: 1px solid #263048;
    border-radius: 14px;
    padding: 0.85rem;
    font-size: 0.8rem;
    color: #A3ADC2;
}
.sidebar-status strong {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.15rem;
    font-size: 0.82rem;
    color: #FFFFFF;
}
.status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #34D399;
}
.status-dot.is-offline { background: #FBBF24; }

/* Karty, przyciski, formularze */
.card,
html[data-bs-theme="dark"] .card {
    background-color: var(--ew-card);
    border: 1px solid var(--ew-border);
    border-radius: 20px;
    box-shadow: none;
}
.card-soft,
html[data-bs-theme="dark"] .card-soft { background: var(--ew-sunken); }
html[data-bs-theme="dark"] .bg-white {
    background-color: var(--ew-card) !important;
    color: var(--ew-text) !important;
}
.badge-soft { background: rgba(43, 78, 255, 0.1); color: #1A36C7; }
html[data-bs-theme="dark"] .badge-soft { background: rgba(142, 164, 255, 0.16); color: #B4C3FF; }
.btn { border-radius: 12px; font-weight: 600; }
.btn-primary {
    --bs-btn-bg: #2B4EFF;
    --bs-btn-border-color: #2B4EFF;
    --bs-btn-hover-bg: #1A36C7;
    --bs-btn-hover-border-color: #1A36C7;
    --bs-btn-active-bg: #1A36C7;
    --bs-btn-active-border-color: #1A36C7;
    --bs-btn-disabled-bg: #2B4EFF;
    --bs-btn-disabled-border-color: #2B4EFF;
    --bs-btn-focus-shadow-rgb: 43, 78, 255;
}
.btn-outline-primary {
    --bs-btn-color: var(--ew-accent-text);
    --bs-btn-border-color: var(--ew-accent-text);
    --bs-btn-hover-bg: #2B4EFF;
    --bs-btn-hover-border-color: #2B4EFF;
    --bs-btn-hover-color: #FFFFFF;
    --bs-btn-active-bg: #1A36C7;
    --bs-btn-active-border-color: #1A36C7;
    --bs-btn-focus-shadow-rgb: 43, 78, 255;
}
.btn-ghost,
html[data-bs-theme="dark"] .btn-ghost {
    background: var(--ew-card);
    border: 1px solid var(--ew-input-border);
    color: var(--ew-text);
}
.btn-ghost:hover,
.btn-ghost:focus-visible {
    background: var(--ew-sunken);
    border-color: var(--ew-input-border);
    color: var(--ew-text);
}
.btn-icon {
    width: 44px;
    height: 44px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.form-control,
.form-select {
    border-radius: 10px;
    border-color: var(--ew-input-border);
}
.form-control:focus,
.form-select:focus {
    border-color: #2B4EFF;
    box-shadow: 0 0 0 0.2rem rgba(43, 78, 255, 0.18);
}
.form-label.small.text-uppercase {
    text-transform: none !important;
    letter-spacing: 0;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--ew-muted) !important;
}
.alert { border-radius: 16px; }
.table > thead.table-light,
html[data-bs-theme="dark"] .table > thead.table-light {
    --bs-table-bg: var(--ew-sunken);
    --bs-table-color: var(--ew-muted);
    --bs-table-border-color: var(--ew-border);
}
.table > thead.table-light th { font-size: 0.82rem; font-weight: 600; }

/* Ekran logowania */
.auth-card,
html[data-bs-theme="dark"] .auth-card {
    background: var(--ew-card);
    border: 1px solid var(--ew-border);
    border-radius: 24px;
    box-shadow: 0 30px 60px -24px rgba(11, 18, 32, 0.22);
}
.auth-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    font-family: var(--ew-display);
    font-weight: 700;
    font-size: 1.2rem;
    letter-spacing: -0.04em;
    color: var(--ew-text);
    text-decoration: none;
}
.auth-brand .brand-mark { background: #0B1220; }
.auth-trust {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.4rem 1.2rem;
    font-size: 0.82rem;
    color: var(--ew-muted);
}
.auth-trust span { display: inline-flex; align-items: center; gap: 0.35rem; }
.auth-trust i { color: var(--ew-success); }

/* Dolna nawigacja na telefonie */
.mobile-bottom-nav,
html[data-bs-theme="dark"] .mobile-bottom-nav {
    background: var(--ew-card);
    border-top: 1px solid var(--ew-border);
    box-shadow: none;
}
.mobile-bottom-nav .nav-link,
html[data-bs-theme="dark"] .mobile-bottom-nav .nav-link { color: var(--ew-muted); }
.mobile-bottom-nav .nav-link.active,
.mobile-bottom-nav .nav-link:hover,
.mobile-bottom-nav .nav-link:focus,
html[data-bs-theme="dark"] .mobile-bottom-nav .nav-link.active,
html[data-bs-theme="dark"] .mobile-bottom-nav .nav-link:hover,
html[data-bs-theme="dark"] .mobile-bottom-nav .nav-link:focus {
    color: var(--ew-accent-text);
    background: transparent;
}
.mobile-bottom-nav .nav-link.active .nav-label { font-weight: 600; }
/* Wszystkie skróty z menu: przewijanie w bok zamiast ściskania ikon. */
.mobile-bottom-nav {
    justify-content: flex-start;
    overflow-x: auto;
    scrollbar-width: none;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
}
.mobile-bottom-nav::-webkit-scrollbar { display: none; }
.mobile-bottom-nav .nav-link {
    flex: 1 0 64px;
    min-width: 64px;
    max-width: 96px;
    scroll-snap-align: center;
}

/* Elementy pulpitu */
.ew-tiles {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 14px;
}
.ew-tile {
    background: var(--ew-card);
    border: 1px solid var(--ew-border);
    border-radius: 20px;
    padding: 1.35rem;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}
.ew-tile-label { font-size: 0.82rem; font-weight: 500; color: var(--ew-muted); }
.ew-tile-value {
    font-family: var(--ew-display);
    font-size: clamp(1.6rem, 2.4vw, 2.1rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.15;
}
.ew-tile-value small { font-size: 0.6em; color: var(--ew-muted); font-weight: 600; }
.ew-tile-note { font-size: 0.82rem; color: var(--ew-muted); }
.ew-tile.is-pay { background: var(--ew-pay-bg); border-color: var(--ew-pay-bg); color: #FFFFFF; }
.ew-tile.is-pay .ew-tile-label,
.ew-tile.is-pay .ew-tile-note { color: #C9D1E0; }
html[data-bs-theme="dark"] .ew-tile.is-pay .ew-tile-label,
html[data-bs-theme="dark"] .ew-tile.is-pay .ew-tile-note { color: #E4E9FF; }
.ew-plus { color: var(--ew-success); }
.ew-minus { color: var(--ew-danger); }
.ew-warn {
    background: var(--ew-warn-bg);
    border: 1px solid var(--ew-warn-border);
    border-radius: 16px;
    padding: 1rem 1.25rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}
.ew-warn-text { color: var(--ew-warn-text); font-size: 0.9rem; }
.ew-warn a { color: var(--ew-warn-text); font-weight: 600; font-size: 0.9rem; padding: 0.6rem 0.25rem; }
.ew-dot {
    display: inline-block;
    flex: none;
    width: 10px;
    height: 10px;
    border-radius: 3px;
}
.ew-nav-row { display: contents; }
@media (min-width: 1200px) { .ew-field-date { width: 200px; } .ew-field-time { width: 128px; } }
.ew-seg {
    display: inline-flex;
    gap: 4px;
    padding: 4px;
    border-radius: 12px;
    background: var(--ew-sunken);
}
.ew-seg button {
    height: 36px;
    padding: 0 14px;
    border: none;
    border-radius: 9px;
    background: transparent;
    color: var(--ew-muted);
    font-size: 0.88rem;
    font-weight: 600;
}
.ew-seg button.is-on {
    background: var(--ew-card);
    color: var(--ew-text);
    box-shadow: 0 1px 3px rgba(11, 18, 32, 0.12);
}
.ew-hint {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    margin: 0;
    font-size: 0.88rem;
    color: var(--ew-muted);
}
.ew-hint > i { color: var(--ew-success); margin-top: 0.1rem; }
.ew-settle-row {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.55rem 0;
    border-bottom: 1px dashed var(--ew-border);
}
.ew-settle-row > span:first-child { color: var(--ew-muted); }
.ew-settle-row > span:last-child { font-weight: 600; white-space: nowrap; }
.ew-settle-total {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.75rem;
    padding: 0.75rem 0 0.25rem;
    border-top: 1px solid var(--ew-border);
    margin-top: -1px;
}
.ew-settle-total > span:last-child {
    font-family: var(--ew-display);
    font-size: 1.6rem;
    font-weight: 700;
    white-space: nowrap;
}
.ew-status {
    display: inline-block;
    padding: 0.2rem 0.65rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
}
.ew-status.is-ok { background: #ECFDF5; color: #047857; }
.ew-status.is-pending { background: #FEF3C7; color: #8A4B05; }
html[data-bs-theme="dark"] .ew-status.is-ok { background: rgba(52, 211, 153, 0.14); color: #6EE7B7; }
html[data-bs-theme="dark"] .ew-status.is-pending { background: rgba(217, 119, 6, 0.18); color: #FCD34D; }
[x-cloak] { display: none !important; }
.ew-status.is-bad { background: #FEF2F2; color: #B91C1C; }
html[data-bs-theme="dark"] .ew-status.is-bad { background: rgba(248, 113, 113, 0.15); color: #FCA5A5; }

/* Interaktywne wykresy (Wypłata, Raporty): oś, linia średniej, słupki, dymek */
.ew-chart { position: relative; margin-top: 4px; }
.ew-chart-plot { position: absolute; }
.ew-chart-tick { position: absolute; left: 0; right: 0; height: 0; border-top: 1px dashed var(--ew-border); }
.ew-chart-tick.is-base { border-top: 1px solid var(--ew-input-border); }
.ew-chart-tick > span { position: absolute; right: 100%; margin-right: 12px; top: -9px; font-size: 0.75rem; color: var(--ew-muted); white-space: nowrap; }
.ew-chart-avg { position: absolute; left: 0; right: 0; height: 0; border-top: 1.5px dashed #8A94A6; z-index: 1; pointer-events: none; }
.ew-chart-avg > span { position: absolute; right: 0; top: -12px; font-size: 0.75rem; font-weight: 600; color: var(--ew-muted); background: var(--ew-card); border: 1px solid var(--ew-border); border-radius: 999px; padding: 1px 8px; }
.ew-chart-cols { position: absolute; inset: 0; display: grid; gap: 6px; }
.ew-chart-col { position: relative; height: 100%; display: flex; align-items: flex-end; justify-content: center; padding: 0; border: none; border-radius: 10px; background: transparent; cursor: pointer; }
.ew-chart-col.is-on { background: rgba(43, 78, 255, 0.06); }
.ew-chart-bar { display: block; position: relative; z-index: 2; width: 56%; max-width: 30px; border-radius: 6px 6px 2px 2px; background: #D3DAFF; transition: background .15s, height .2s; }
.ew-chart-col.is-on .ew-chart-bar { background: #2B4EFF; }
html[data-bs-theme="dark"] .ew-chart-bar { background: #33405C; }
html[data-bs-theme="dark"] .ew-chart-col.is-on .ew-chart-bar { background: #5B78FF; }
.ew-chart-tip { position: absolute; z-index: 3; left: 50%; padding: 8px 12px; border-radius: 12px; background: #0B1220; color: #FFFFFF; text-align: left; white-space: nowrap; pointer-events: none; box-shadow: 0 12px 24px -8px rgba(11, 18, 32, 0.35); }
html[data-bs-theme="dark"] .ew-chart-tip { background: #1E293B; border: 1px solid #33405C; }
.ew-chart-x { position: absolute; bottom: 0; height: 22px; display: grid; gap: 6px; }
.ew-chart-x > * { font-size: 0.75rem; text-align: center; color: var(--ew-muted); font-weight: 500; text-decoration: none; }
.ew-chart-x > .is-on { color: var(--ew-text); font-weight: 700; }
/* ── Wersja mobilna z projektu (Claude Design, rząd „Wersja mobilna”) ── */
@media (max-width: 991.98px) {
    .app-main { padding: 0.75rem 1rem calc(6.5rem + env(safe-area-inset-bottom, 0px)) !important; }
    .ew-mobile-head {
        position: sticky; top: 0; z-index: 1020;
        margin: -0.75rem -1rem 0.75rem; padding: 0.75rem 1rem 0.4rem;
        background: var(--ew-bg, #F5F6F8);
    }
    /* nagłówek strony do lewej (bez tego wygrywał desktopowy align-items: flex-end
       i w kolumnie tytuł był dosunięty do prawej) */
    .page-topbar { flex-direction: column; align-items: stretch !important; gap: 0.75rem; }
    .page-topbar > div:first-child { width: 100%; min-width: 0; text-align: left; }
    .page-topbar > div:last-child { width: 100%; justify-content: flex-start !important; }
    /* przełącznik widoku + strzałki + „Dziś” w jednym rzędzie (Kalendarz, Grafik) */
    .ew-nav-row { display: flex; flex-wrap: nowrap; align-items: center; gap: 6px; width: 100%; }
    .ew-nav-row .ew-seg { flex: 1 1 auto; min-width: 0; gap: 2px; padding: 3px; }
    .ew-nav-row .ew-seg > a { flex: 1 1 0; justify-content: center; padding: 0 2px !important; font-size: 0.78rem !important; }
    .ew-nav-row .btn-icon { width: 38px; height: 38px; flex: none; }
    .ew-nav-row .ew-today { height: 38px !important; padding: 0 10px; flex: none; }
    .page-title { font-size: 1.75rem; letter-spacing: -0.03em; line-height: 1.15; }
    .page-subtitle { font-size: 0.875rem; }
    .page-eyebrow { font-size: 0.75rem; }
    /* zakładki (Administracja, podwidoki) jako przewijane „pigułki” */
    .ew-seg-scroll {
        display: flex !important; flex-wrap: nowrap !important; overflow-x: auto; scrollbar-width: none;
        gap: 8px; padding: 2px 1rem; margin: 0 -1rem; background: transparent; border-radius: 0;
    }
    .ew-seg-scroll::-webkit-scrollbar { display: none; }
    .ew-seg-scroll > a, .ew-seg-scroll > button {
        flex: none; white-space: nowrap; height: 38px !important; padding: 0 14px !important;
        border-radius: 999px !important; border: 1px solid var(--ew-border-strong, #D5DAE2) !important;
        background: var(--ew-card) !important; color: var(--ew-text) !important; box-shadow: none !important;
    }
    .ew-seg-scroll > .is-on, .ew-seg-scroll > [aria-current="page"] {
        background: #0B1220 !important; color: #FFFFFF !important; border-color: #0B1220 !important;
    }
    /* dolny pasek: cieniowanie przy krawędzi = da się przewinąć */
    .mobile-bottom-nav { -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 24px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 24px), transparent); }
}
@media (max-width: 767.98px) {
    .app-main .card { border-radius: 20px; }
    .app-main .card.p-4 { padding: 18px !important; }
    /* filtry typu w Moich wpisach: pigułki w jednym przewijanym rzędzie */
    .ew-chips {
        display: flex !important; overflow-x: auto; scrollbar-width: none; gap: 8px !important;
        margin: 0 -1rem; padding: 2px 1rem;
    }
    .ew-chips::-webkit-scrollbar { display: none; }
    .ew-chips > a {
        flex: none; flex-direction: row !important; align-items: center; gap: 6px !important;
        height: 38px; padding: 0 12px !important; border-radius: 999px !important; white-space: nowrap;
    }
    .ew-chips > a > span:last-child { font-family: inherit !important; font-size: 0.85rem !important; font-weight: 400 !important; opacity: .75; }
    /* tabele -> karty */
    table.ew-stack thead { display: none; }
    table.ew-stack, table.ew-stack tbody { display: block; }
    table.ew-stack tbody { padding: 12px; display: flex; flex-direction: column; gap: 10px; }
    table.ew-stack tbody tr {
        display: grid; gap: 4px 10px; align-items: center;
        padding: 12px 14px; border: 1px solid var(--ew-border); border-radius: 16px; background: var(--ew-card);
    }
    table.ew-stack tbody td { display: block !important; padding: 0 !important; border: 0 !important; background: none !important; text-align: left; white-space: normal; }
    table.ew-stack tbody td[colspan] { grid-column: 1 / -1; text-align: center; }
    table.ew-stack .c-right { justify-self: end; text-align: right !important; }
    table.ew-stack .c-sub { font-size: 0.82rem; color: var(--ew-muted); }
    /* Moje wpisy: typ + kwota / data · godziny + status / notatka / akcje */
    .ew-stack-entries tbody tr { grid-template-columns: auto auto 1fr auto; grid-template-areas: "sel type type value" "sel date hours status" "sel note note note" "sel act act act"; }
    .ew-stack-entries .c-sel { grid-area: sel; align-self: start; padding-top: 3px !important; }
    .ew-stack-entries .c-type { grid-area: type; font-size: 0.95rem; }
    .ew-stack-entries .c-value { grid-area: value; }
    .ew-stack-entries .c-date { grid-area: date; }
    .ew-stack-entries .c-hours { grid-area: hours; }
    .ew-stack-entries .c-status { grid-area: status; }
    .ew-stack-entries .c-note { grid-area: note; font-size: 0.82rem; }
    .ew-stack-entries .c-note.is-empty { display: none !important; }
    .ew-stack-entries .c-act { grid-area: act; display: flex !important; justify-content: flex-end; gap: 4px; }
    /* Paragony i zaliczki: rodzaj + opis + kwota / data · rozliczenie / usuń */
    .ew-stack-money tbody tr { grid-template-columns: auto 1fr auto; grid-template-areas: "kind desc amount" "kind date act"; }
    .ew-stack-money .c-kind { grid-area: kind; align-self: start; }
    .ew-stack-money .c-desc { grid-area: desc; font-weight: 600; color: var(--ew-text) !important; }
    .ew-stack-money .c-amount { grid-area: amount; }
    .ew-stack-money .c-date { grid-area: date; font-weight: 400 !important; }
    .ew-stack-money .c-settle { display: none !important; }
    .ew-stack-money .c-act { grid-area: act; justify-self: end; }
    /* filtry-pigułki (Dziennik, Grafik › Miesiąc): jeden przewijany rząd */
    .ew-pills-scroll { flex-wrap: nowrap !important; overflow-x: auto; scrollbar-width: none; margin: 0 -1rem; padding: 2px 1rem; }
    .ew-pills-scroll::-webkit-scrollbar { display: none; }
    .ew-pills-scroll > * { flex: none; white-space: nowrap; }
    /* wykresy (Wypłata › Historia, Raporty › Trend): bez dymka - wartość jest w nagłówku karty */
    .ew-chart-m { height: 220px !important; }
    .ew-chart-m .ew-chart-plot { left: 40px !important; top: 12px !important; }
    .ew-chart-m .ew-chart-x { left: 40px !important; }
    .ew-chart-m .ew-chart-tip { display: none !important; }
    .ew-chart-m .ew-chart-tick span { font-size: 0.68rem; }
    .ew-chart-m .ew-chart-x > * { font-size: 0.62rem; }
    /* Konta: kto + rola / godziny · urlop · Telegram / akcje */
    .ew-stack-users tbody tr { grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-areas: "who who role" "hours leave tg" "act act act"; gap: 10px; }
    .ew-stack-users .c-who { grid-area: who; }
    .ew-stack-users .c-role { grid-area: role; justify-self: end; text-align: right !important; }
    .ew-stack-users .c-hours { grid-area: hours; }
    .ew-stack-users .c-leave { grid-area: leave; }
    .ew-stack-users .c-tg { grid-area: tg; }
    .ew-stack-users .c-last { display: none !important; }
    .ew-stack-users .c-act { grid-area: act; justify-self: end; }
    .ew-stack .c-stat { background: var(--ew-sunken) !important; border-radius: 10px; padding: 6px 8px !important; font-size: 0.75rem; color: var(--ew-muted); }
    .ew-stack .c-stat::before { content: attr(data-label); display: block; }
    .ew-stack .c-stat > *, .ew-stack .c-stat { font-weight: 600; }
    /* Typy pracy: nazwa + reguła / użycie / mnożnik + akcje */
    .ew-stack-types tbody tr { grid-template-columns: 1fr auto; grid-template-areas: "name usage" "mult act"; }
    .ew-stack-types .c-name { grid-area: name; }
    .ew-stack-types .c-usage { grid-area: usage; justify-self: end; font-weight: 600; }
    .ew-stack-types .c-mult { grid-area: mult; font-size: 0.82rem; color: var(--ew-muted); text-align: left !important; }
    .ew-stack-types .c-mult::before { content: "Mnożnik "; }
    .ew-stack-types .c-color { display: none !important; }
    .ew-stack-types .c-act { grid-area: act; justify-self: end; }
    /* Stawki: osoba + stawka / od kiedy · premie / nowa stawka */
    .ew-stack-rates tbody tr { grid-template-columns: 1fr auto; grid-template-areas: "who rate" "since bonus" "form form"; }
    .ew-stack-rates .c-who { grid-area: who; }
    .ew-stack-rates .c-rate { grid-area: rate; justify-self: end; text-align: right !important; }
    .ew-stack-rates .c-since { grid-area: since; font-size: 0.82rem; }
    .ew-stack-rates .c-bonus { grid-area: bonus; justify-self: end; font-size: 0.82rem; }
    .ew-stack-rates .c-form { grid-area: form; }
    .ew-stack-rates .c-form form { min-width: 0 !important; }
    .ew-stack-rates .c-form input { max-width: none !important; flex: 1 1 0; min-width: 0; }
    /* Dziennik zdarzeń: moduł · kto + godzina / opis */
    .ew-log-row { display: grid !important; grid-template-columns: 1fr auto; grid-template-areas: "mod when" "msg msg"; gap: 2px 10px !important; padding: 12px 16px !important; }
    .ew-log-row .c-when { grid-area: when; width: auto !important; }
    .ew-log-row .c-mod { grid-area: mod; width: auto !important; }
    .ew-log-row .c-mod::after { content: " · " attr(data-who); color: var(--ew-text); }
    .ew-log-row .c-who { display: none !important; }
    .ew-log-row .c-msg { grid-area: msg; min-width: 0 !important; font-size: 0.9rem; }
    /* Przegląd Administracji: karta modułu - metryka po lewej, przycisk po prawej */
    .ew-module .ew-module-foot { flex-direction: row !important; align-items: flex-end; justify-content: space-between; gap: 10px; }
    .ew-module .ew-module-cta { margin-top: 0 !important; }
    .ew-module { padding: 16px !important; gap: 12px !important; }
    /* Raporty › Zespół: awatar, imię + suma, pasek, nadgodziny */
    .ew-team-row { display: grid !important; grid-template-columns: auto 1fr auto; grid-template-areas: "av name total" "av bar bar" "av sub sub"; gap: 4px 12px !important; align-items: center; }
    .ew-team-row .ew-team-av { grid-area: av; display: inline-flex !important; }
    .ew-team-row .ew-team-who { display: contents !important; }
    .ew-team-row .ew-team-name { grid-area: name; }
    .ew-team-row .ew-team-sub { grid-area: sub; }
    .ew-team-row .ew-team-bar { grid-area: bar; }
    .ew-team-row .ew-team-total { grid-area: total; width: auto !important; }
    .ew-team-axis { margin: 2px 0 0 52px !important; }
    /* Grafik › Miesiąc: kropki zamiast nazw osób w kratkach */
    .ew-cal-wrap { min-width: 0 !important; }
    .ew-cal-grid { grid-template-columns: repeat(7, minmax(0, 1fr)) !important; }
    .ew-cal-day { min-height: 52px !important; align-items: center !important; padding: 6px 0 !important; border: none !important; border-radius: 12px; box-shadow: none !important; }
    .ew-cal-day[aria-current="date"] { background: #0B1220 !important; color: #FFFFFF !important; }
    .ew-cal-day[aria-current="date"] .ew-cal-num { color: #FFFFFF !important; background: transparent !important; }
    .ew-cal-chips, .ew-cal-hname { display: none !important; }
    .ew-cal-dots { display: flex !important; }
    .ew-cal-head > span { padding: 4px 0 !important; text-align: center; font-size: 0.68rem !important; }
}
.ew-day-btn.is-sel { background: #0B1220 !important; color: #FFFFFF !important; border-color: #0B1220 !important; }
.ew-day-btn.is-sel .ew-day-mark.is-accent { background: #FFFFFF !important; }
html[data-bs-theme="dark"] .ew-day-btn.is-sel { background: #2B4EFF !important; border-color: #2B4EFF !important; }
.ew-cal-dots { display: none; gap: 3px; justify-content: center; }
.ew-cal-dots > span { width: 5px; height: 5px; border-radius: 50%; }
.ew-team-av { display: none !important; }
@media (max-width: 480px) {
    .ew-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .ew-tile { padding: 0.9rem; border-radius: 16px; }
    .ew-tile.is-pay { grid-column: 1 / -1; }
}


/* Zegar i pogoda na pulpicie: dwa zwykłe kafelki (dashboard.html, js/clock-weather.js) */
.ew-cw-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ew-cw-tiles .ew-tile-value { font-variant-numeric: tabular-nums; }
.ew-cw-icon { display: inline-block; font-size: 0.8em; margin-right: 0.35rem; color: var(--ew-accent-text, #2B4EFF); }

/* Animowana pogoda: ikona + delikatna warstwa opadów w tle kafelka (kierunek wybiera js/clock-weather.js: data-sky) */
#ew-weather { position: relative; overflow: hidden; }
#ew-weather > * { position: relative; z-index: 1; }
#ew-weather::before { content: ''; position: absolute; inset: 0; z-index: 0; pointer-events: none; opacity: 0; }
#ew-weather[data-sky="rain"]::before, #ew-weather[data-sky="storm"]::before {
    opacity: 0.18;
    background-image:
        linear-gradient(105deg, transparent 47%, #5B7CFA 48%, #5B7CFA 52%, transparent 53%),
        linear-gradient(105deg, transparent 47%, #5B7CFA 48%, #5B7CFA 52%, transparent 53%);
    background-size: 37px 46px, 53px 71px;
    background-position: 0 0, 19px 23px;
    animation: ew-rain 0.7s linear infinite;
}
#ew-weather[data-sky="snow"]::before {
    opacity: 0.55;
    background-image: radial-gradient(circle, #9DB2D6 0 2px, transparent 2.5px), radial-gradient(circle, #B9C7E2 0 1.5px, transparent 2px);
    background-size: 34px 34px, 23px 23px;
    background-position: 0 0, 12px 8px;
    animation: ew-snow 5s linear infinite;
}
#ew-weather[data-sky="storm"]::after {
    content: ''; position: absolute; inset: 0; z-index: 0; pointer-events: none; background: #FFE066; opacity: 0;
    animation: ew-flash 5s ease-in-out infinite;
}
#ew-weather[data-sky="clear"][data-day="day"] .ew-cw-icon { color: #F59E0B; animation: ew-spin 24s linear infinite; }
#ew-weather[data-sky="clear"][data-day="night"] .ew-cw-icon { animation: ew-glow 4s ease-in-out infinite; }
#ew-weather[data-sky="partly"] .ew-cw-icon, #ew-weather[data-sky="cloud"] .ew-cw-icon { animation: ew-drift 5s ease-in-out infinite; }
#ew-weather[data-sky="rain"] .ew-cw-icon, #ew-weather[data-sky="snow"] .ew-cw-icon { animation: ew-bob 2.4s ease-in-out infinite; }
#ew-weather[data-sky="storm"] .ew-cw-icon { animation: ew-bolt 5s ease-in-out infinite; }
#ew-weather[data-sky="fog"] .ew-cw-icon { animation: ew-fog 4s ease-in-out infinite; }
/* przesunięcie o równą wielokrotność kafelka tła = pętla bez widocznego skoku */
@keyframes ew-rain { to { background-position: 0 46px, 19px 94px; } }
@keyframes ew-snow { to { background-position: 0 34px, 12px 31px; } }
@keyframes ew-spin { to { transform: rotate(360deg); } }
@keyframes ew-glow { 50% { opacity: 0.55; transform: scale(1.08); } }
@keyframes ew-drift { 50% { transform: translateX(4px); } }
@keyframes ew-bob { 50% { transform: translateY(-3px); } }
@keyframes ew-fog { 50% { opacity: 0.4; } }
@keyframes ew-bolt { 0%, 86%, 92%, 100% { color: var(--ew-accent-text, #2B4EFF); } 88%, 90% { color: #F59E0B; transform: scale(1.12); } }
@keyframes ew-flash { 0%, 86%, 92%, 100% { opacity: 0; } 88% { opacity: 0.14; } 90% { opacity: 0.06; } }
@media (prefers-reduced-motion: reduce) {
    #ew-weather::before, #ew-weather::after, #ew-weather .ew-cw-icon { animation: none !important; }
}
.ew-cw-tiles .is-stale { opacity: 0.65; }
.ew-cw-tiles #ew-clock-date::first-letter { text-transform: uppercase; }
@media (max-width: 480px) { .ew-cw-tiles { gap: 10px; } .ew-cw-tiles .ew-tile { padding: 0.9rem; border-radius: 16px; } }
