/* ═══════════════════════════════════════════════════════════════
   PANASONIC LIVE PRESENTATIONS — Design System
   Kolory wyekstrahowane z test.pptx (Refrigeration 25 template)
   ═══════════════════════════════════════════════════════════════ */

:root {
    /* Brand — z PPTX */
    --pres-cover-bg:    #E8EDE9;   /* tło slajdu tytułowego */
    --pres-cover-bar:   #93A496;   /* pasek dekoracyjny cover */
    --pres-brand-green: #65903A;   /* gradient lewy */
    --pres-brand-blue:  #179EC8;   /* Panasonic Blue — gradient prawy */
    --pres-brand-amber: #F8AB3C;   /* akcent złoty */
    --pres-brand-orange:#E0592A;   /* akcent "heating" */

    /* Slide */
    --pres-data-bg:     #FFFFFF;
    --pres-text-dark:   #1A1A1A;
    --pres-text-muted:  #5A6475;
    --pres-separator:   #D0D5CC;   /* 1px linie header/footer */

    /* UI — konfigurator */
    --pres-ui-bg:       #F4F6F8;
    --pres-panel-bg:    #FFFFFF;
    --pres-border:      #E2E6EA;
    --pres-selected-bg: #EBF5FB;
    --pres-accent:      #179EC8;
    --pres-accent-dark: #0E7FA8;
    --pres-radius:      8px;
    --pres-shadow:      0 1px 4px rgba(0,0,0,.10);
    --pres-shadow-md:   0 4px 16px rgba(0,0,0,.14);
}

/* ══ CLOUD SYNC INDICATOR ═══════════════════════════════════════ */
.pres-sync-dot {
    width: 10px; height: 10px; border-radius: 50%;
    display: inline-block; flex-shrink: 0;
    background: #CBD5E1;
    transition: background .4s;
    position: relative;
}
.pres-sync-dot.saved   { background: var(--pres-brand-green); }
.pres-sync-dot.saving  {
    background: var(--pres-brand-amber);
    animation: presSyncPulse .9s ease-in-out infinite;
}
.pres-sync-dot.error   { background: var(--pres-brand-orange); }

.pres-sync-label {
    font-size: 11px; color: var(--pres-text-muted);
    transition: color .3s;
}
.pres-sync-label.saved   { color: var(--pres-brand-green); }
.pres-sync-label.saving  { color: #B07F2A; }
.pres-sync-label.error   { color: var(--pres-brand-orange); }

@keyframes presSyncPulse {
    0%, 100% { opacity: 1; transform: scale(1.1); }
    50%       { opacity: .35; transform: scale(.8); }
}

/* ══ TOOLBAR ════════════════════════════════════════════════════ */
.pres-toolbar {
    display: flex; align-items: center; gap: 8px;
    padding: 10px 16px;
    background: var(--pres-panel-bg);
    border-bottom: 1px solid var(--pres-border);
    flex-wrap: wrap;
}
.pres-toolbar-right {
    margin-left: auto; display: flex; align-items: center; gap: 8px;
}
.pres-btn {
    padding: 6px 14px; border: none; border-radius: 5px;
    font-size: 12px; font-weight: 600; cursor: pointer;
    transition: all .15s; white-space: nowrap;
}
.pres-btn-primary {
    background: var(--pres-accent); color: #fff;
}
.pres-btn-primary:hover { background: var(--pres-accent-dark); }
.pres-btn-success {
    background: var(--pres-brand-green); color: #fff;
}
.pres-btn-success:hover { background: #4e7a2c; }
.pres-btn-ghost {
    background: transparent; color: var(--pres-text-muted);
    border: 1px solid var(--pres-border);
}
.pres-btn-ghost:hover { background: var(--pres-ui-bg); color: var(--pres-text-dark); }
.pres-btn-danger {
    background: #fff; color: #C00; border: 1px solid #FECACA;
}
.pres-btn-danger:hover { background: #FEF2F2; }
.pres-btn-player {
    background: linear-gradient(135deg, var(--pres-brand-green), var(--pres-brand-blue));
    color: #fff; padding: 7px 18px;
}
.pres-profile-sel {
    padding: 5px 8px; font-size: 12px;
    border: 1px solid var(--pres-border); border-radius: 5px;
    background: #fff; min-width: 180px;
}
.pres-profile-name {
    padding: 5px 8px; font-size: 12px;
    border: 1px solid var(--pres-border); border-radius: 5px;
    width: 200px;
}

/* ══ KONFIGURATOR — 3-COLUMN LAYOUT ════════════════════════════ */
.pres-konfig-layout {
    display: grid;
    grid-template-columns: 230px 1fr 290px;
    grid-template-rows: 1fr;
    height: calc(100vh - 220px);
    min-height: 560px;
    background: var(--pres-ui-bg);
    border-top: none;
    overflow: hidden;
}

/* ── Panel Zasoby (lewy) ── */
.pres-panel-zasoby {
    background: var(--pres-panel-bg);
    border-right: 1px solid var(--pres-border);
    display: flex; flex-direction: column;
    overflow: hidden;
}
.pres-panel-title {
    padding: 12px 14px 10px;
    font-size: 11px; font-weight: 700; color: var(--pres-text-muted);
    text-transform: uppercase; letter-spacing: .6px;
    border-bottom: 1px solid var(--pres-border);
    display: flex; align-items: center; gap: 7px;
    flex-shrink: 0;
}
.pres-zasoby-list {
    overflow-y: auto; flex: 1; padding: 10px 8px; display: flex; flex-direction: column; gap: 4px;
}
.pres-resource-card {
    display: flex; align-items: center; gap: 9px;
    padding: 8px 10px; border-radius: 6px; cursor: pointer;
    border: 1px solid var(--pres-border); background: #fff;
    transition: all .13s; user-select: none;
}
.pres-resource-card:hover {
    background: var(--pres-selected-bg); border-color: var(--pres-accent);
}
.pres-resource-card:active { transform: scale(.98); }
.pres-resource-icon { font-size: 18px; flex-shrink: 0; }
.pres-resource-name {
    flex: 1; font-size: 12px; font-weight: 600; color: var(--pres-text-dark);
    line-height: 1.3;
}
.pres-resource-add {
    font-size: 16px; color: var(--pres-accent); font-weight: 700;
    opacity: 0; transition: opacity .13s;
}
.pres-resource-card:hover .pres-resource-add { opacity: 1; }
.pres-resource-divider {
    height: 1px; background: var(--pres-border); margin: 6px 4px;
}

/* ── Panel Środkowy: Timeline + Podgląd ── */
.pres-panel-center {
    display: flex; flex-direction: column; overflow: hidden;
}

/* Oś czasu (filmstrip) */
.pres-timeline-strip {
    display: flex; align-items: flex-end; gap: 0;
    padding: 14px 16px 12px; overflow-x: auto;
    background: var(--pres-panel-bg);
    border-bottom: 1px solid var(--pres-border);
    min-height: 120px; flex-shrink: 0;
    scrollbar-width: thin;
}
.pres-timeline-strip::-webkit-scrollbar { height: 4px; }
.pres-timeline-strip::-webkit-scrollbar-thumb { background: #CBD5E1; border-radius: 2px; }

.pres-timeline-add {
    display: flex; align-items: center; justify-content: center;
    width: 28px; flex-shrink: 0; height: 68px;
    color: #CBD5E1; font-size: 20px; cursor: pointer;
    border-radius: 4px; transition: all .13s;
}
.pres-timeline-add:hover { color: var(--pres-accent); background: var(--pres-selected-bg); }

.pres-thumb-wrap {
    display: flex; flex-direction: column; align-items: center;
    gap: 5px; flex-shrink: 0; cursor: pointer;
    padding: 0 2px;
}
.pres-thumb {
    width: 128px; height: 72px;
    border-radius: 4px;
    border: 2px solid var(--pres-border);
    overflow: hidden; position: relative;
    background: #fff;
    transition: all .13s;
    box-shadow: var(--pres-shadow);
}
.pres-thumb.active {
    border-color: var(--pres-brand-blue);
    box-shadow: 0 0 0 3px rgba(23,158,200,.25), var(--pres-shadow);
}
.pres-thumb:hover:not(.active) {
    border-color: #93C5FD;
    box-shadow: var(--pres-shadow-md);
}
.pres-thumb.dragging { opacity: .4; }
.pres-thumb-inner {
    width: 1280px; height: 720px;
    transform: scale(0.1);
    transform-origin: top left;
    pointer-events: none;
}
.pres-thumb-num {
    font-size: 10px; color: var(--pres-text-muted); font-weight: 600;
}
.pres-thumb-label {
    font-size: 10px; color: var(--pres-text-dark); max-width: 128px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    text-align: center; font-weight: 600;
}
.pres-thumb-del {
    position: absolute; top: 2px; right: 2px;
    background: rgba(220,38,38,.85); color: #fff;
    border: none; border-radius: 3px; width: 16px; height: 16px;
    font-size: 10px; cursor: pointer; display: none;
    align-items: center; justify-content: center; line-height: 1;
}
.pres-thumb:hover .pres-thumb-del { display: flex; }

/* Obszar podglądu */
.pres-preview-area {
    flex: 1; display: flex; align-items: center; justify-content: center;
    background: #4A5568; overflow: hidden; position: relative; min-height: 0;
}
.pres-preview-label {
    position: absolute; top: 8px; left: 12px;
    font-size: 10px; color: rgba(255,255,255,.6); font-weight: 600;
    text-transform: uppercase; letter-spacing: .5px;
}
.pres-preview-slide-wrap {
    width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
    padding: 16px; box-sizing: border-box;
}
#presPreviewSlide {
    transform-origin: center center;
}

/* ── Panel Właściwości (prawy) ── */
.pres-panel-props {
    background: var(--pres-panel-bg);
    border-left: 1px solid var(--pres-border);
    display: flex; flex-direction: column;
    overflow: hidden;
}
.pres-props-content {
    flex: 1; overflow-y: auto; padding: 14px 14px 20px;
    display: flex; flex-direction: column; gap: 14px;
}
.pres-no-slide {
    color: var(--pres-text-muted); font-size: 12px;
    font-style: italic; text-align: center; padding: 24px 0;
}
.pres-prop-group { display: flex; flex-direction: column; gap: 5px; }
.pres-prop-label {
    font-size: 11px; font-weight: 700; color: var(--pres-text-muted);
    text-transform: uppercase; letter-spacing: .5px;
}
.pres-prop-input {
    padding: 7px 9px; font-size: 12px;
    border: 1px solid var(--pres-border); border-radius: 5px;
    background: #fff; width: 100%; box-sizing: border-box;
    font-family: inherit; color: var(--pres-text-dark);
    transition: border-color .13s;
}
.pres-prop-input:focus {
    outline: none; border-color: var(--pres-accent);
    box-shadow: 0 0 0 2px rgba(23,158,200,.15);
}
.pres-prop-textarea {
    resize: vertical; min-height: 70px; line-height: 1.5;
}

/* Sync Status w panelu właściwości */
.pres-sync-row {
    display: flex; align-items: center; gap: 7px;
    padding: 9px 12px; border-radius: 6px;
    background: var(--pres-ui-bg); border: 1px solid var(--pres-border);
    margin-top: auto; flex-shrink: 0;
}

/* Ustawienia globalne (profil) */
.pres-settings-section {
    background: var(--pres-ui-bg); border-radius: 6px;
    padding: 10px 12px; display: flex; flex-direction: column; gap: 8px;
    border: 1px solid var(--pres-border);
}
.pres-settings-title {
    font-size: 11px; font-weight: 700; color: var(--pres-text-muted);
    text-transform: uppercase; letter-spacing: .5px;
}

/* ══ PLAYER VIEW ════════════════════════════════════════════════ */
.pres-player-toolbar {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 16px; background: #0F172A; border-radius: 8px 8px 0 0;
    flex-wrap: wrap;
}
.pres-player-counter {
    color: #94A3B8; font-size: 13px; font-weight: 600;
}
#presPlayerArea {
    background: #1E293B; border-radius: 0 0 8px 8px;
    min-height: 520px; display: flex; align-items: center;
    justify-content: center; overflow: hidden; position: relative;
}
#presPlayerSlide {
    display: flex; align-items: center; justify-content: center;
    width: 100%; height: 100%;
}
.pres-player-hint {
    text-align: center; margin-top: 8px;
    font-size: 11px; color: #94A3B8;
}

/* ══ FULLSCREEN OVERLAY ═════════════════════════════════════════ */
#presFullscreenOverlay {
    display: none; position: fixed; inset: 0;
    background: #000; z-index: 99999;
    flex-direction: column; align-items: center; justify-content: center;
}
#presFullscreenSlide {
    width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
}
.pres-fs-controls {
    position: absolute; bottom: 0; left: 0; right: 0;
    display: flex; justify-content: space-between; align-items: center;
    padding: 8px 20px; background: rgba(0,0,0,.75);
}
.pres-fs-btn {
    padding: 7px 20px; background: #334155; color: #fff;
    border: none; border-radius: 5px; cursor: pointer; font-size: 15px;
}
.pres-fs-close {
    position: absolute; top: -44px; right: 12px;
    padding: 5px 14px; background: #7F1D1D; color: #fff;
    border: none; border-radius: 4px; cursor: pointer; font-size: 12px;
}

/* ══ SLAJD PANASONIC — Shell 1280×720 ══════════════════════════ */
.pres-slide-shell {
    width: 1280px; height: 720px;
    font-family: Arial, Helvetica, sans-serif;
    display: flex; flex-direction: column;
    overflow: hidden; position: relative;
    box-sizing: border-box;
}

/* --- Type A: Cover / Transition (tło korporacyjne) --- */
.pres-slide-shell.type-cover {
    background: var(--pres-cover-bg);
}
.pres-slide-shell.type-end {
    background: var(--pres-cover-bg);
}

/* --- Type B: Data Slide (białe tło) --- */
.pres-slide-shell.type-chart {
    background: var(--pres-data-bg);
    box-shadow: 0 4px 32px rgba(0,0,0,.30);
}

/* Wspólny header */
.pres-slide-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 36px; height: 56px; min-height: 56px; flex-shrink: 0;
}
.pres-slide-header.with-border {
    border-bottom: 1px solid var(--pres-separator);
}
.pres-slide-header-title {
    font-size: 17px; font-weight: 700; color: var(--pres-text-dark);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    max-width: 820px; outline: none; flex: 1;
}
.pres-slide-header-title[contenteditable="true"]:focus {
    background: rgba(23,158,200,.08); border-radius: 3px; padding: 2px 6px;
}
.pres-slide-logo { flex-shrink: 0; }
.pres-slide-logo img { height: 28px; width: auto; display: block; }

/* Content */
.pres-slide-content {
    flex: 1; padding: 10px 36px 8px;
    display: flex; flex-direction: column; overflow: hidden; min-height: 0;
}
.pres-slide-chart-wrap {
    flex: 1; min-height: 0; position: relative;
    border-radius: 2px; overflow: hidden;
}
.pres-slide-chart-wrap canvas { width: 100% !important; height: 100% !important; }
.pres-slide-desc {
    margin-top: 8px; min-height: 48px; max-height: 80px;
    font-size: 13px; color: var(--pres-text-muted); line-height: 1.55;
    border: none; border-top: 1px dashed #B8BDB9; padding-top: 7px;
    background: transparent; resize: none; width: 100%; box-sizing: border-box;
    font-family: Arial, Helvetica, sans-serif; outline: none;
}
.pres-slide-desc::placeholder { color: #B0BAC5; font-style: italic; }

/* Footer */
.pres-slide-footer {
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 36px; height: 38px; min-height: 38px; flex-shrink: 0;
    font-size: 11px; color: var(--pres-text-muted);
}
.pres-slide-footer.with-border {
    border-top: 1px solid var(--pres-separator);
}
.pres-footer-num { font-weight: 700; color: var(--pres-text-dark); }
.pres-footer-right { color: #888; font-size: 10px; }

/* Slajd COVER */
.pres-cover-wave-bar {
    position: absolute; bottom: 0; left: 0; right: 0; height: 8px;
    background: linear-gradient(90deg, var(--pres-brand-green), var(--pres-brand-blue));
}
.pres-cover-body {
    flex: 1; display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    padding: 20px 60px; text-align: center; position: relative;
}
.pres-cover-logo-big { margin-bottom: 28px; }
.pres-cover-logo-big img { height: 54px; width: auto; }
.pres-cover-title {
    font-size: 36px; font-weight: 700; color: var(--pres-text-dark);
    line-height: 1.2; margin-bottom: 12px; outline: none;
}
.pres-cover-subtitle {
    font-size: 20px; font-weight: 400; color: var(--pres-cover-bar);
    outline: none;
}
.pres-cover-wave {
    position: absolute; bottom: 8px; left: 0; right: 0; pointer-events: none;
}

/* Slajd END */
.pres-end-body {
    flex: 1; display: flex; flex-direction: column;
    align-items: center; justify-content: center;
}
.pres-end-logo img { height: 80px; width: auto; }
.pres-end-tagline {
    margin-top: 16px; font-size: 16px; color: var(--pres-cover-bar);
}

/* Slajd EMPTY */
.pres-slide-empty {
    display: flex; align-items: center; justify-content: center;
    height: 100%; color: #94A3B8; font-size: 16px; font-style: italic;
    flex-direction: column; gap: 12px;
}

/* Fullscreen slide size override */
#presFullscreenOverlay .pres-slide-shell {
    width: 100vw !important; height: 100vh !important;
    box-shadow: none;
}

/* ═══════════════════════════════════════════════════════════════
   SILNIK PREZENTACJI v2 — PowerPoint Pro (uzupełnienie stylów)
   Uwaga: główne style overlay (#pv2Overlay, #pv2SlideWrap, #pv2Nav
   itp.) są zdefiniowane inline w index.html <style>. Tu są TYLKO
   style nieobecne w inline: Master Slide, Section Toolbar, Sidebar,
   Toolbar profili, pv2-tb-save/danger.
   ═══════════════════════════════════════════════════════════════ */

/* ── Sidebar ── */
#pv2Sidebar {
    position: fixed;
    left: 0; top: 0; bottom: 64px;
    width: 148px;
    background: rgba(8, 10, 20, 0.92);
    border-right: 1px solid rgba(255,255,255,0.06);
    overflow-y: auto;
    display: flex; flex-direction: column;
    padding: 52px 0 6px;
    gap: 2px;
    z-index: 9;
    scrollbar-width: thin;
}
#pv2Sidebar:empty { display: none; }
#pv2Sidebar::-webkit-scrollbar { width: 3px; }
#pv2Sidebar::-webkit-scrollbar-thumb { background: #334155; border-radius: 2px; }

.pv2-sb-item {
    display: flex; align-items: flex-start; gap: 7px;
    padding: 7px 10px; cursor: pointer;
    border-radius: 4px; margin: 0 4px;
    transition: background 0.13s;
    color: #94a3b8; font-size: 10px; font-weight: 600;
    font-family: Arial, Helvetica, sans-serif;
    line-height: 1.3;
}
.pv2-sb-item:hover { background: rgba(255,255,255,0.07); }
.pv2-sb-item.active {
    background: rgba(23,158,200,0.18);
    color: #38bdf8;
}
.pv2-sb-num {
    width: 18px; height: 18px; min-width: 18px;
    background: #1e293b; border-radius: 3px;
    display: flex; align-items: center; justify-content: center;
    font-size: 9px; font-weight: 800; color: #64748b;
}
.pv2-sb-item.active .pv2-sb-num {
    background: #0c4a6e; color: #38bdf8;
}
.pv2-sb-label {
    flex: 1;
    overflow: hidden; text-overflow: ellipsis;
    display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical;
}

/* ═══════════════════════════════════════════════════════════════
   MASTER SLIDE — Premium PowerPoint layout v2
   Top accent: 5px Panasonic gradient
   Header: tytuł (lewo) + PANASONIC czarny duży (prawo)
   Rule top/bottom: 2px czarny (#0f172a)
   Chart area: ~78% slajdu, bez nagłówka sekcji (ukryty przy capture)
   Comment: italic edytowalny
   Footer: "1 / N" lewo + "Panasonic Manufacturing" prawo
   ═══════════════════════════════════════════════════════════════ */
/* ── SLAJD WYKRESU — 16:9, czyste białe tło ────────────────────────────
   Proporcje: accent(8) | header(86) | rule(3) | chart(1fr) | comment(auto) | rule(3) | footer(52)
   3cm wizualne marginesy w obszarze wykresu (padding: 4.5% 4%)
   ═══════════════════════════════════════════════════════════════════════ */
.pv2-ms-slide {
    width: 100%; height: 100%;
    background: #ffffff;
    display: grid;
    /* baseline — Smart Layout Engine nadpisuje per-slajd via inline style */
    grid-template-rows: 8px 72px 1px 1fr auto 1px 44px;
    font-family: 'Segoe UI', Calibri, Arial, Helvetica, sans-serif;
    overflow: hidden; box-sizing: border-box;
    position: relative;
}

/* Gradient accent bar — Panasonic brand */
.pv2-ms-top-accent {
    height: 8px;
    background: linear-gradient(90deg, #179EC8 0%, #65903A 100%);
    flex-shrink: 0;
}

/* Header — duży tytuł + logo CZARNE */
.pv2-ms-header {
    display: flex; align-items: center;
    padding: 0 4%;
    flex-shrink: 0;
    background: #ffffff;
}
.pv2-ms-title-text {
    flex: 1;
    font-size: clamp(18px, 3vw, 28px);
    font-weight: 700;
    color: #111111; line-height: 1.15;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    padding-right: 28px;
    letter-spacing: -0.4px;
    outline: none;
}
.pv2-ms-logo {
    font-size: clamp(20px, 3.2vw, 32px);
    font-weight: 900;
    color: #000000;          /* CZARNE jak w oryginalnym PPTX */
    letter-spacing: -0.8px;
    white-space: nowrap; flex-shrink: 0;
    font-style: italic;      /* Panasonic używa italic w logo tekstowym */
}

/* Linia oddzielająca — elegancka, 1px, nie nachodzi na etykiety */
.pv2-ms-rule-top {
    height: 1px;
    background: #D0D5CC;
    margin: 0;
    flex-shrink: 0;
}

/* Obszar wykresu — padding kontrolowany przez Smart Layout Engine (inline style) */
.pv2-ms-chart-area {
    overflow: hidden;
    padding: 3.5% 3.5% 4.5% 3.5%; /* fallback — JS nadpisuje per chart-type */
    display: flex; align-items: center; justify-content: center;
    min-height: 0;
    background: #ffffff;
}
.pv2-ms-chart-area img {
    max-width: 100%; max-height: 100%;
    width: auto; height: auto;
    object-fit: contain; display: block;
}
.pv2-ph {
    display: flex; flex-direction: column; align-items: center;
    justify-content: center; gap: 12px; width: 100%;
    color: #94a3b8; font-size: clamp(12px, 1.5vw, 15px);
}

/* ── Komentarz — stały pasek na dole ─────────────────────────────────── */
.pv2-ms-comment-bar {
    display: none;
    padding: 10px 4% 10px calc(4% + 18px);
    font-size: clamp(12px, 1.4vw, 16px);
    font-style: italic;
    color: #475569;
    background: #f8fafc;
    border-left: 5px solid #179EC8;
    outline: none;
    white-space: pre-wrap;
    word-break: break-word;
    line-height: 1.5;
    min-height: 44px; max-height: 72px;
    overflow: hidden;
}
.pv2-ms-comment-bar.pv2-comment-visible { display: block; }
.pv2-ms-comment-bar:empty::before {
    content: attr(data-placeholder);
    color: #cbd5e1; font-style: italic; pointer-events: none;
}
.pv2-ms-comment-bar:focus {
    background: #eff6ff;
    border-left-color: #1d4ed8;
    max-height: 120px;
}

/* Linia dolna — elegancka, 1px */
.pv2-ms-rule-bottom {
    height: 1px;
    background: #D0D5CC;
    margin: 0;
}

/* Footer — numer strony + brand */
.pv2-ms-footer {
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 4%;
    background: #ffffff;
}
.pv2-ms-pgnum {
    font-size: clamp(12px, 1.4vw, 15px);
    font-weight: 700;
    color: #111111;
}
.pv2-ms-footer-brand {
    font-size: clamp(9px, 1vw, 12px);
    color: #94a3b8;
    font-weight: 500;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

/* ── Sekcja toolbar (nad każdym wykresem) ── */
.pv2-ct-wrap {
    background: #f8fafc;
    border: 1px solid #e2e6ea;
    border-bottom: none;
    border-radius: 7px 7px 0 0;
    padding: 6px 14px;
    margin-top: 8px;
}
.pv2-ct-inner {
    display: flex; align-items: center; gap: 8px;
}
.pv2-ct-name {
    font-size: 11px; font-weight: 700; color: #5a6475;
    text-transform: uppercase; letter-spacing: 0.5px;
    flex: 1;
}
.pv2-ct-actions { display: flex; align-items: center; gap: 6px; }
.pv2-ct-btn {
    padding: 4px 12px; border: 1px solid #e2e6ea;
    border-radius: 4px; background: #fff;
    font-size: 11px; font-weight: 600; color: #5a6475;
    cursor: pointer; transition: all 0.13s; white-space: nowrap;
}
.pv2-ct-btn:hover { border-color: #179EC8; color: #179EC8; background: #ebf5fb; }
.pv2-ct-btn.pv2-ct-btn-added {
    background: #179EC8; color: #fff; border-color: #179EC8;
}
.pv2-ct-btn.pv2-ct-btn-added:hover { background: #0e7fa8; border-color: #0e7fa8; }
.pv2-ct-order {
    font-size: 11px; font-weight: 800; color: #179EC8;
    min-width: 20px; text-align: center;
}

/* ── Toolbar pv2 główny — uzupełnienie brakujących klas ── */
.pv2-toolbar-row {
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.pv2-toolbar-profiles {
    border-bottom: 1px solid rgba(255,255,255,0.08);
    padding-bottom: 7px;
}
.pv2-profile-sel {
    padding: 4px 7px; font-size: 11px;
    border: 1px solid #334155; border-radius: 4px;
    background: #1e293b; color: #e2e8f0;
    min-width: 160px;
}
.pv2-profile-name {
    padding: 4px 8px; font-size: 11px;
    border: 1px solid #334155; border-radius: 4px;
    background: #1e293b; color: #e2e8f0;
    width: 150px;
}
/* Uzupełnienie dla .pv2-tb — index.html definiuje ghost/prim/ok/div, tu dodajemy save/danger */
.pv2-tb-save { background: #0ea5e9; color: #fff; border-color: #0ea5e9; }
.pv2-tb-save:hover { background: #0284c7; border-color: #0284c7; }
.pv2-tb-danger { background: transparent; color: #f87171; border: 1px solid #7f1d1d; }
.pv2-tb-danger:hover { background: #7f1d1d; color: #fff; }

/* ═══════════════════════════════════════════════════════════════
   v3 — WYSIWYG: Tytuł, Comment Overlay, Mini-Toolbar, Edit Mode
   ═══════════════════════════════════════════════════════════════ */

/* Tytuł — większy, czytelny z dużej odległości */
.pv2-ms-title-text {
    font-size: clamp(16px, 2.8vw, 26px) !important;
    font-weight: 800;
    outline: none;
    transition: background .15s;
}
.pv2-ms-title-text[contenteditable="true"] {
    cursor: text;
    border-radius: 3px;
    white-space: normal;
    overflow: visible;
}
.pv2-ms-title-text[contenteditable="true"]:focus {
    background: rgba(0,104,181,0.07);
    box-shadow: 0 0 0 2px rgba(0,104,181,0.25);
    padding: 2px 6px;
}

/* ── Draggable Comment Overlay ── */
.pv2-comment-overlay {
    position: absolute;
    display: none;                        /* ukryty domyślnie */
    min-width: 160px;
    max-width: 88%;
    padding: 5px 12px 5px 10px;
    background: rgba(255,255,255,0.92);
    border-left: 3px solid #0068b5;
    border-radius: 0 4px 4px 0;
    font-family: 'Segoe UI', Arial, sans-serif;
    font-size: 13px;
    color: #0f172a;
    font-style: italic;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
    outline: none;
    box-shadow: 0 2px 10px rgba(0,0,0,0.18);
    cursor: default;
    user-select: text;
    z-index: 10;
    transition: box-shadow .15s, border-color .15s;
}
.pv2-comment-overlay.pv2-comment-visible {
    display: block;
}
.pv2-comment-overlay:empty::before {
    content: attr(data-placeholder);
    color: #94a3b8;
    pointer-events: none;
    font-style: italic;
}
.pv2-comment-overlay:focus {
    background: rgba(255,255,255,0.98);
    box-shadow: 0 2px 12px rgba(0,104,181,0.22);
    border-left-color: #0068b5;
    cursor: text;
}

/* Edit mode — komentarz zawsze widoczny, z uchwytem drag */
.pv2-comment-overlay.pv2-comment-edit-mode {
    display: block !important;
    cursor: grab;
    border: 1px dashed rgba(124,58,237,0.55);
    border-left: 3px solid #7c3aed;
    box-shadow: 0 0 0 2px rgba(124,58,237,0.15), 0 2px 10px rgba(0,0,0,0.15);
}
.pv2-comment-overlay.pv2-comment-edit-mode:active {
    cursor: grabbing;
}

/* ── WYSIWYG Controls — DOLNY LEWY RÓG slajdu (nie koliduje z ESC/fullscreen) ── */
.pv2-wysiwyg-controls {
    position: absolute;
    bottom: 58px;           /* nad footrem */
    left: 16px;             /* lewo — z dala od ESC (prawy górny róg) */
    display: flex;
    gap: 5px;
    z-index: 20;
    opacity: 0;
    transition: opacity .2s;
    pointer-events: none;
}
#pv2SlideEl:hover .pv2-wysiwyg-controls,
#pv2Overlay.pv2-edit-mode-on .pv2-wysiwyg-controls {
    opacity: 1;
    pointer-events: auto;
}
.pv2-comment-btn {
    padding: 4px 8px;
    background: rgba(15,23,42,0.65);
    color: rgba(255,255,255,0.85);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 5px;
    font-size: 13px;
    cursor: pointer;
    backdrop-filter: blur(4px);
    transition: all .15s;
    line-height: 1;
}
.pv2-comment-btn:hover {
    background: rgba(0,104,181,0.75);
    border-color: rgba(0,164,212,0.6);
}
.pv2-edit-toggle {
    padding: 4px 11px;
    background: rgba(15,23,42,0.65);
    color: rgba(255,255,255,0.85);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 5px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    backdrop-filter: blur(4px);
    transition: all .15s;
    white-space: nowrap;
}
.pv2-edit-toggle:hover {
    background: rgba(30,58,138,0.75);
    border-color: rgba(96,165,250,0.6);
    color: #fff;
}
.pv2-edit-toggle.active {
    background: rgba(109,28,207,0.85);
    border-color: rgba(168,85,247,0.7);
    color: #fff;
}

/* Edit mode — globalne wskazanie na overlay */
#pv2Overlay.pv2-edit-mode-on #pv2SlideEl {
    outline: 2px solid rgba(109,28,207,0.4);
    outline-offset: -2px;
}

/* ── Mini-Toolbar — floating nad edytowanym elementem ── */
.pv2-mini-toolbar {
    position: absolute;
    display: none;
    align-items: center;
    gap: 3px;
    padding: 5px 8px;
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 7px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.5);
    z-index: 100001;
    pointer-events: auto;
    flex-wrap: nowrap;
    animation: pv2MtReveal .18s ease;
}
@keyframes pv2MtReveal {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: none; }
}
.pv2-mt-btn {
    padding: 3px 8px;
    border: 1px solid #475569;
    border-radius: 4px;
    background: #0f172a;
    color: #e2e8f0;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: all .12s;
    line-height: 1.4;
    flex-shrink: 0;
}
.pv2-mt-btn:hover   { background: #1e3a5f; border-color: #60a5fa; color: #fff; }
.pv2-mt-btn.active  { background: #4f46e5; border-color: #818cf8; color: #fff; }
.pv2-mt-color, .pv2-mt-bg {
    width: 16px; height: 16px;
    border-radius: 3px;
    border: 1px solid rgba(255,255,255,0.2);
    cursor: pointer;
    flex-shrink: 0;
    transition: transform .12s, border-color .12s;
}
.pv2-mt-color:hover, .pv2-mt-bg:hover {
    transform: scale(1.3);
    border-color: #fff;
}
.pv2-mt-sep {
    width: 1px; height: 14px;
    background: #334155;
    margin: 0 3px;
    flex-shrink: 0;
}
.pv2-mt-label {
    font-size: 9px;
    color: #64748b;
    white-space: nowrap;
    flex-shrink: 0;
}
.pv2-mt-slider {
    width: 64px;
    accent-color: #3b82f6;
    flex-shrink: 0;
    cursor: pointer;
}

/* ── Placeholder komentarza w edit mode ── */
#pv2Overlay.pv2-edit-mode-on .pv2-comment-overlay:empty::before {
    content: '✏️ Kliknij by wpisać komentarz...';
    color: rgba(124,58,237,0.5);
}

/* ── Ph placeholder gdy brak obrazu ── */
.pv2-ph {
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    width: 100%; height: 100%;
    color: #94a3b8; gap: 12px;
    font-family: 'Segoe UI', Arial, sans-serif;
    font-size: 14px;
}

/* ══════════════════════════════════════════════════════════════════════
   PANEL EDYCJI SLAJDU — pełne opcje formatowania
   Pojawia się w trybie Edit Mode jako pasek na dole ekranu (poza slajdem)
   ══════════════════════════════════════════════════════════════════════ */
#pv2EditPanel {
    display: none;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    background: #0f172a;
    border-top: 2px solid #179EC8;
    padding: 8px 20px;
    z-index: 100010;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.5);
}
#pv2Overlay.pv2-edit-mode-on #pv2EditPanel {
    display: flex;
}
.pv2-ep-label {
    font-size: 10px; font-weight: 700; color: #64748b;
    text-transform: uppercase; letter-spacing: 0.5px;
    white-space: nowrap;
}
.pv2-ep-sep {
    width: 1px; height: 20px; background: #1e293b; flex-shrink: 0;
    margin: 0 4px;
}
.pv2-ep-btn {
    padding: 5px 12px;
    background: #1e293b;
    color: #e2e8f0;
    border: 1px solid #334155;
    border-radius: 5px;
    font-size: 11px; font-weight: 600;
    cursor: pointer; white-space: nowrap;
    transition: all .13s;
    line-height: 1.4;
}
.pv2-ep-btn:hover { background: #1e3a5f; border-color: #179EC8; color: #fff; }
.pv2-ep-btn.active { background: #179EC8; border-color: #0e7fa8; color: #fff; }
.pv2-ep-btn-export {
    background: #065f46; border-color: #065f46; color: #fff;
}
.pv2-ep-btn-export:hover { background: #047857; border-color: #047857; }
.pv2-ep-color {
    width: 22px; height: 22px;
    border-radius: 4px; border: 2px solid #334155;
    cursor: pointer; flex-shrink: 0;
    transition: transform .13s, border-color .13s;
}
.pv2-ep-color:hover { transform: scale(1.25); border-color: #fff; }
.pv2-ep-range {
    width: 80px; accent-color: #179EC8; cursor: pointer;
}
.pv2-ep-title-row {
    display: flex; align-items: center; gap: 6px;
    flex-wrap: nowrap;
}
/* Toast potwierdzenia eksportu */
.pv2-export-toast {
    position: fixed;
    bottom: 70px; left: 50%;
    transform: translateX(-50%);
    background: #065f46; color: #fff;
    padding: 8px 20px; border-radius: 8px;
    font-size: 13px; font-weight: 600;
    z-index: 100020;
    animation: pv2ToastIn .2s ease;
}
@keyframes pv2ToastIn {
    from { opacity:0; transform: translateX(-50%) translateY(10px); }
    to   { opacity:1; transform: translateX(-50%) translateY(0); }
}

/* ── Edit Mode — slajd ma fioletowy ring ── */
#pv2Overlay.pv2-edit-mode-on #pv2SlideEl {
    outline: 3px solid rgba(23,158,200,0.55);
    outline-offset: -3px;
}

/* ── Tytuł — kursor text w edit mode ── */
.pv2-ms-title-text[contenteditable="true"] {
    cursor: text;
    border-radius: 3px;
    white-space: normal;
    overflow: visible;
    transition: background .15s;
}
.pv2-ms-title-text[contenteditable="true"]:focus {
    background: rgba(23,158,200,0.08);
    box-shadow: 0 0 0 2px rgba(23,158,200,0.25);
    padding: 2px 6px;
}
