/* Przykładowa strona (przyklad.html): pasek EventSlot, panel wyglądu i pływający przycisk.
   Kolory marki: stalowy niebieski jako tło, biały tekst, czerwony na przyciski. */
:root { --ex-blue: #1b4461; --ex-blue2: #24557a; --ex-red: #e3343a; --ex-ease: cubic-bezier(.2, .7, .2, 1); }
.ex-strip, .ex-panel, .ex-pill, .ex-note { font-family: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; -webkit-font-smoothing: antialiased; }

/* ---------- pasek u góry (przewija się razem ze stroną) */
.ex-strip { background: var(--ex-blue); color: #fff; box-shadow: inset 0 -1px 0 rgb(255 255 255 / .1); position: relative; z-index: 25; }
.ex-strip-in { max-width: 1160px; margin: 0 auto; padding: 10px clamp(12px, 4vw, 32px); padding-top: max(10px, env(safe-area-inset-top)); display: flex; align-items: center; gap: 16px; min-height: 56px; }
.ex-brand { display: inline-flex; align-items: center; gap: 8px; color: #fff; text-decoration: none; font-weight: 800; font-size: 17px; letter-spacing: -.01em; flex: none; }
.ex-brand b { color: #ff7a7e; font-weight: 800; }
.ex-brand img { border-radius: 7px; }
.ex-label { margin: 0; display: flex; align-items: center; gap: 8px; font-size: 14px; color: rgb(255 255 255 / .82); min-width: 0; }
.ex-dot { width: 8px; height: 8px; border-radius: 50%; background: #5fd38a; box-shadow: 0 0 0 4px rgb(95 211 138 / .18); flex: none; animation: exPulse 2.4s ease-in-out infinite; }
.ex-actions { margin-left: auto; display: flex; gap: 8px; flex: none; }
.ex-short { display: none; }

.ex-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: 999px; font-weight: 700; font-size: 14px; line-height: 1; font-family: inherit; text-decoration: none; cursor: pointer; border: 0; white-space: nowrap;
  transition: transform .25s var(--ex-ease), box-shadow .25s var(--ex-ease), background .2s, color .2s; }
.ex-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ex-btn:hover { transform: translateY(-1px) scale(1.03); }
.ex-btn:active { transform: scale(.97); }
.ex-btn:focus-visible, .ex-tpl:focus-visible, .ex-theme:focus-visible, .ex-pill:focus-visible, .ex-x:focus-visible { outline: 3px solid #fff; outline-offset: 2px; box-shadow: 0 0 0 6px var(--ex-red); }
.ex-btn-ghost { background: rgb(255 255 255 / .12); color: #fff; box-shadow: inset 0 0 0 1px rgb(255 255 255 / .22); }
.ex-btn-ghost:hover { background: rgb(255 255 255 / .2); }
.ex-btn-red { background: var(--ex-red); color: #fff; box-shadow: 0 6px 18px rgb(227 52 58 / .35); }
.ex-btn-red:hover { box-shadow: 0 10px 26px rgb(227 52 58 / .45); }
.ex-block { width: 100%; height: 50px; font-size: 15px; }

/* ---------- panel wyglądu: z prawej na komputerze, od dołu na telefonie */
.ex-backdrop { position: fixed; inset: 0; z-index: 60; background: rgb(8 20 30 / .45); backdrop-filter: blur(3px); opacity: 0; pointer-events: none; transition: opacity .35s var(--ex-ease); }
.ex-backdrop.open { opacity: 1; pointer-events: auto; }
.ex-panel { position: fixed; z-index: 61; top: 12px; right: 12px; bottom: 12px; width: min(420px, calc(100vw - 24px)); display: flex; flex-direction: column;
  background: var(--ex-blue); color: #fff; border-radius: 22px; box-shadow: 0 30px 80px rgb(0 0 0 / .4), inset 0 0 0 1px rgb(255 255 255 / .1);
  transform: translateX(calc(100% + 24px)); visibility: hidden; transition: transform .5s var(--ex-ease), visibility 0s linear .5s; }
.ex-panel.open { transform: none; visibility: visible; transition: transform .5s var(--ex-ease), visibility 0s; }
.ex-grab { display: none; }
.ex-panel-head { display: flex; gap: 12px; align-items: flex-start; padding: 22px 22px 14px; }
.ex-panel-head h2 { margin: 0 0 4px; font-size: 21px; letter-spacing: -.02em; }
.ex-panel-head p { margin: 0; font-size: 14px; color: rgb(255 255 255 / .72); line-height: 1.45; }
.ex-x { margin-left: auto; flex: none; width: 38px; height: 38px; border-radius: 50%; border: 0; background: rgb(255 255 255 / .12); color: #fff; display: grid; place-items: center; cursor: pointer; transition: background .2s, transform .25s var(--ex-ease); }
.ex-x:hover { background: rgb(255 255 255 / .22); transform: rotate(90deg); }
.ex-x svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
.ex-panel-body { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 4px 22px 18px; }
.ex-panel-body h3 { margin: 18px 0 10px; font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: rgb(255 255 255 / .6); }
.ex-panel-foot { padding: 14px 22px 22px; padding-bottom: max(22px, env(safe-area-inset-bottom)); border-top: 1px solid rgb(255 255 255 / .1); }

.ex-themes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.ex-theme { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 14px; border: 0; cursor: pointer; text-align: left; font-weight: 600; font-size: 13px; line-height: 1.25; font-family: inherit; color: #fff;
  background: rgb(255 255 255 / .07); box-shadow: inset 0 0 0 1px rgb(255 255 255 / .1); transition: background .2s, box-shadow .2s, transform .25s var(--ex-ease); }
.ex-theme:hover { background: rgb(255 255 255 / .13); transform: translateY(-1px); }
.ex-theme[aria-pressed="true"] { background: rgb(255 255 255 / .16); box-shadow: inset 0 0 0 2px #fff; }
.ex-sw { width: 34px; height: 34px; flex: none; border-radius: 10px; background: linear-gradient(135deg, var(--c1) 0 50%, var(--c2) 50% 78%, var(--c3) 78%); box-shadow: inset 0 0 0 1px rgb(255 255 255 / .25); }

.ex-tpls { display: grid; gap: 8px; }
.ex-tpl { display: grid; gap: 2px; text-align: left; padding: 12px 14px; border-radius: 14px; border: 0; cursor: pointer; color: #fff; font-family: inherit;
  background: rgb(255 255 255 / .07); box-shadow: inset 0 0 0 1px rgb(255 255 255 / .1); transition: background .2s, box-shadow .2s, transform .25s var(--ex-ease); }
.ex-tpl strong { font-size: 15px; }
.ex-tpl span { font-size: 13px; color: rgb(255 255 255 / .68); line-height: 1.4; }
.ex-tpl:hover { background: rgb(255 255 255 / .13); transform: translateX(3px); }
.ex-tpl[aria-pressed="true"] { background: #fff; color: var(--ex-blue); box-shadow: 0 8px 22px rgb(0 0 0 / .2); }
.ex-tpl[aria-pressed="true"] span { color: #4d6578; }
.ex-tpl[aria-pressed="true"] strong::after { content: ''; display: inline-block; width: 8px; height: 8px; margin-left: 8px; border-radius: 50%; background: var(--ex-red); vertical-align: middle; }

/* ---------- pływający przycisk "Wygląd" */
.ex-pill { position: fixed; z-index: 35; right: 20px; bottom: 20px; display: inline-flex; align-items: center; gap: 8px; height: 48px; padding: 0 20px 0 16px; border-radius: 999px; border: 0; cursor: pointer;
  background: var(--ex-blue); color: #fff; font-weight: 700; font-size: 15px; line-height: 1; box-shadow: 0 14px 36px rgb(0 0 0 / .3), inset 0 0 0 1px rgb(255 255 255 / .16);
  opacity: 0; transform: translateY(16px) scale(.94); pointer-events: none; transition: opacity .35s var(--ex-ease), transform .45s var(--ex-ease), box-shadow .25s; }
.ex-pill.show { opacity: 1; transform: none; pointer-events: auto; }
.ex-pill.show:hover { transform: translateY(-2px) scale(1.04); box-shadow: 0 18px 44px rgb(0 0 0 / .35), inset 0 0 0 1px rgb(255 255 255 / .2); }
.ex-pill svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.ex-note { margin: 4px 0 14px; padding: 10px 14px; border-radius: 12px; font-size: 14px; line-height: 1.45; background: color-mix(in srgb, var(--ink, #000) 7%, transparent); color: var(--ink, inherit); }

/* ---------- tablet */
@media (max-width: 900px) {
  .ex-label .ex-long { display: none; } .ex-label .ex-short { display: inline; }
}
/* ---------- telefon */
@media (max-width: 700px) {
  .ex-strip-in { gap: 10px; min-height: 52px; padding-top: max(8px, env(safe-area-inset-top)); padding-bottom: 8px; }
  .ex-brand span { display: none; }
  .ex-btn { height: 38px; padding: 0 13px; font-size: 13px; }
  .ex-actions .ex-long { display: none; } .ex-actions .ex-short { display: inline; }
  .ex-pill { right: 14px; bottom: calc(84px + env(safe-area-inset-bottom)); height: 44px; font-size: 14px; }

  .ex-panel { top: auto; left: 0; right: 0; bottom: 0; width: 100%; max-height: 86vh; max-height: 86dvh; border-radius: 24px 24px 0 0; transform: translateY(105%); }
  .ex-grab { display: block; width: 40px; height: 5px; border-radius: 3px; background: rgb(255 255 255 / .3); margin: 10px auto 0; }
  .ex-panel-head { padding: 12px 18px 10px; }
  .ex-panel-body { padding: 0 18px 14px; }
  .ex-panel-foot { padding: 12px 18px; padding-bottom: max(14px, env(safe-area-inset-bottom)); }
  .ex-tpls { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ex-tpl span { display: none; }
  .ex-tpl:hover { transform: none; }
}
@media (max-width: 360px) { .ex-label { display: none; } }

/* ---------- podgląd w oknie na stronie głównej: bez paska i przycisków */
.ex-windowed .es-mbar { display: none !important; }
.ex-windowed { scrollbar-width: none; }
.ex-windowed::-webkit-scrollbar { display: none; }

@keyframes exPulse { 50% { box-shadow: 0 0 0 7px rgb(95 211 138 / 0); } }
@media (prefers-reduced-motion: reduce) {
  .ex-panel, .ex-backdrop, .ex-pill, .ex-btn, .ex-tpl, .ex-theme, .ex-x { transition: none !important; }
  .ex-dot { animation: none; }
}
