/* Dedykowany widok code_editor. Wszystkie selektory pozostaja pod prefiksem wtyczki. */
.e-platforma .pawr-code-editor-page { --pawr-code-scale: 1; position: relative; display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; width: 100%; max-width: 100%; min-width: 0; font-size: calc(1rem * var(--pawr-code-scale)); }
.e-platforma .pawr-code-game-cta { display: none; justify-content: center; align-items: center; padding: 12px 0 4px; }
.e-platforma .pawr-code-game-cta:not(:empty) { display: flex; min-height: 76px; }
.e-platforma .pawr-code-game-cta .btn { min-width: min(100%, 280px); text-align: center; }
.e-platforma .pawr-code-editor-heading { display: flex; gap: 18px; align-items: start; justify-content: space-between; padding: 18px 20px; border: 2px solid var(--ink, #222); border-radius: 20px; background: #fff; box-shadow: 5px 5px 0 var(--shadow, rgba(34,34,34,.18)); }
.e-platforma .pawr-code-editor-heading h1 { margin: 5px 0; }
.e-platforma .pawr-code-editor-heading p { margin: 0; color: var(--ink-soft, #555); }
.e-platforma .pawr-code-editor-score { display: grid; gap: 3px; min-width: 120px; justify-items: end; }
.e-platforma .pawr-code-editor-score strong { font-size: 1.45em; }
.e-platforma .pawr-code-editor-score span { color: var(--ink-soft, #555); font-size: .75em; font-weight: 800; }
.e-platforma .pawr-code-editor-sticky { position: sticky; top: 0; z-index: 30; display: grid; gap: 8px; padding: 0 0 8px; background: var(--canvas, #eefaff); }
.e-platforma .pawr-code-editor-toolbar { display: flex; gap: 8px; align-items: center; min-height: 42px; padding: 7px 10px; border: 1px solid #a9bdc6; border-radius: 12px; background: #f6fafb; box-shadow: 0 4px 12px rgba(20, 40, 50, .08); }
.e-platforma .pawr-code-theme-buttons,
.e-platforma .pawr-code-scale-controls,
.e-platforma .pawr-code-history-controls { display: flex; gap: 5px; align-items: center; margin-right: 4px; }
.e-platforma .pawr-code-theme-buttons button { width: 23px; height: 23px; padding: 0; border: 2px solid #53656d; border-radius: 50%; background: #fff; }
.e-platforma .pawr-code-theme-buttons button:nth-child(2) { background: #b0c4cc; }
.e-platforma .pawr-code-theme-buttons button:nth-child(3) { background: #263238; }
.e-platforma .pawr-code-theme-buttons button.is-active,
.e-platforma .pawr-code-theme-buttons button:focus-visible { outline: 3px solid var(--cyan, #168dcc); outline-offset: 2px; }
.e-platforma .pawr-code-scale-controls { padding: 2px 4px; border: 1px solid #c8d8dd; border-radius: 10px; background: #fff; }
.e-platforma .pawr-code-scale-controls .btn { width: 30px; min-width: 30px; height: 30px; padding: 0; font-size: 1.05em; line-height: 1; }
.e-platforma .pawr-code-scale-controls span { min-width: 42px; color: #405a66; font-size: .78em; font-weight: 900; text-align: center; }
.e-platforma .pawr-code-history-controls { padding: 2px 4px; border: 1px solid #c8d8dd; border-radius: 10px; background: #fff; }
.e-platforma .pawr-code-history-controls .btn { min-width: 76px; }
.e-platforma .pawr-code-history-controls .btn:disabled { cursor: not-allowed; opacity: .42; }
.e-platforma .pawr-code-save-status,
.e-platforma .pawr-code-check-status { color: #516a74; font-size: .78em; font-weight: 800; white-space: nowrap; }
.e-platforma .pawr-code-save-status { margin-left: auto; }
.e-platforma .pawr-code-save-status.is-saving,
.e-platforma .pawr-code-check-status.is-waiting,
.e-platforma .pawr-code-check-status.is-checking { color: #936214; }
.e-platforma .pawr-code-save-status.is-saved,
.e-platforma .pawr-code-check-status.is-saved { color: #247653; }
.e-platforma .pawr-code-save-status.is-error,
.e-platforma .pawr-code-check-status.is-error { color: #a22d24; }
.e-platforma .pawr-code-mobile-tabs { display: none; }
.e-platforma .pawr-code-editor-workspace { --pawr-code-left: 42%; display: grid; grid-template-columns: minmax(0, var(--pawr-code-left)) 10px minmax(0, 1fr); width: 100%; max-width: 100%; box-sizing: border-box; height: min(680px, max(280px, calc(100vh - 290px))); min-height: 280px; max-height: calc(100vh - 220px); overflow: hidden; border: 2px solid var(--ink, #222); border-radius: 17px; background: #d8e2e6; box-shadow: 5px 5px 0 var(--shadow, rgba(34,34,34,.18)); }
.e-platforma .pawr-code-editor-pane,
.e-platforma .pawr-code-preview-pane { min-width: 0; min-height: 0; overflow: hidden; background: #fff; }
.e-platforma .pawr-code-editor-pane { display: grid; grid-template-rows: minmax(0, 1fr); }
.e-platforma .pawr-code-editor-pane > div[data-code-mirror],
.e-platforma .pawr-code-editor-pane .cm-editor { width: 100%; max-width: 100%; min-width: 0; min-height: 0; height: 100%; overflow: hidden; }
.e-platforma .pawr-code-editor-pane .cm-scroller { min-width: 0; max-width: 100%; overflow-x: scroll; overflow-y: auto; font: .9em/1.6 Consolas, "Courier New", monospace; scrollbar-width: auto; scrollbar-color: #6f8994 #dce8ec; }
.e-platforma .pawr-code-editor-pane .cm-scroller::-webkit-scrollbar { width: 18px; height: 18px; }
.e-platforma .pawr-code-editor-pane .cm-scroller::-webkit-scrollbar-track { background: #dce8ec; border-radius: 999px; }
.e-platforma .pawr-code-editor-pane .cm-scroller::-webkit-scrollbar-thumb { min-height: 42px; border: 3px solid #dce8ec; border-radius: 999px; background: #6f8994; }
.e-platforma .pawr-code-editor-pane .cm-scroller::-webkit-scrollbar-corner { background: #dce8ec; }
.e-platforma .pawr-code-editor-divider { position: relative; z-index: 2; cursor: col-resize; touch-action: none; background: #8ba3ad; }
.e-platforma .pawr-code-editor-divider::after { content: ""; position: absolute; top: 50%; left: 50%; width: 3px; height: 56px; border-radius: 4px; background: #fff; transform: translate(-50%, -50%); }
.e-platforma .pawr-code-editor-divider:focus-visible { outline: 3px solid var(--cyan, #168dcc); outline-offset: -3px; }
.e-platforma .pawr-code-preview-pane { display: grid; grid-template-rows: auto minmax(0, 1fr); }
.e-platforma .pawr-code-preview-status { padding: 7px 10px; border-bottom: 1px solid #bdd0d7; background: #f5fafb; color: #48616b; font-size: .75em; font-weight: 800; }
.e-platforma .pawr-code-preview-status.is-error { background: #fff0ee; color: #9e2920; }
.e-platforma .pawr-code-preview-pane iframe { display: block; width: 100%; max-width: 100%; height: 100%; min-height: 0; border: 0; background: #fff; }
.e-platforma .pawr-code-step-navigator { position: relative; display: grid; gap: 8px; padding: 10px; border: 2px solid #a6bdc6; border-radius: 15px; background: #f9fcfd; box-shadow: 3px 3px 0 rgba(34,34,34,.1); }
.e-platforma .pawr-code-step-nav-head { position: relative; z-index: 4; }
.e-platforma .pawr-code-step-navigator > [data-code-step-content] { position: relative; z-index: 2; }
.e-platforma .pawr-code-step-nav-head { display: grid; grid-template-columns: 44px minmax(0, 1fr) 44px; gap: 10px; align-items: center; }
.e-platforma .pawr-code-step-arrow { display: grid; width: 44px; height: 44px; padding: 0; place-items: center; border: 2px solid #405a66; border-radius: 11px; background: #fff; color: #173d4d; font-size: 1.5em; font-weight: 900; line-height: 1; box-shadow: 2px 2px 0 rgba(34,34,34,.16); }
.e-platforma .pawr-code-step-arrow:not(:disabled):hover { border-color: var(--cyan, #168dcc); background: #e9f8ff; transform: translateY(-1px); }
.e-platforma .pawr-code-step-arrow:focus-visible { outline: 3px solid var(--cyan, #168dcc); outline-offset: 2px; }
.e-platforma .pawr-code-step-arrow:disabled { cursor: not-allowed; opacity: .34; box-shadow: none; }
.e-platforma .pawr-code-step-progress { position: relative; z-index: 4; display: grid; grid-template-columns: auto minmax(140px, 1fr) auto; gap: 10px; align-items: center; min-width: 0; color: #405861; font-size: .82em; font-weight: 900; }
.e-platforma .pawr-code-step-progress > span { position: relative; z-index: 5; padding: 6px 10px; border-radius: 999px; background: var(--cyan, #168dcc); color: #fff; white-space: nowrap; }
.e-platforma .pawr-code-progress { height: 14px; overflow: hidden; border: 1px solid #9cb2bb; border-radius: 999px; background: #dce6e9; }
.e-platforma .pawr-code-progress > span { display: block; height: 100%; min-width: 0; border-radius: inherit; background: linear-gradient(90deg, #168dcc, #236f4b); transition: width .25s ease; }
.e-platforma .pawr-code-current-step { position: relative; isolation: isolate; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: start; overflow: hidden; padding: 12px; border: 1px solid #b9cdd4; border-left: 6px solid #168dcc; border-radius: 11px; background: #fff; }
.e-platforma .pawr-code-current-step > * { position: relative; z-index: 1; }
.e-platforma .pawr-code-current-step.is-complete { border-left-color: #236f4b; background: #fff; }
.e-platforma .pawr-code-current-step.is-complete:not(.is-success-transition) { background: #e7f4ec; }
.e-platforma .pawr-code-current-step.is-success-transition::before { content: ""; position: absolute; inset: 0; z-index: 0; background: linear-gradient(90deg, rgba(57,166,102,.32), rgba(144,225,165,.48)); transform: scaleX(0); transform-origin: left center; animation: pawr-code-step-green-fill 2s ease-out forwards; pointer-events: none; }
.e-platforma .pawr-code-step-navigator > [data-code-step-content] { overflow: hidden; }
.e-platforma .pawr-code-step-navigator > [data-code-step-content].is-step-transitioning { display: grid; }
.e-platforma .pawr-code-step-navigator > [data-code-step-content].is-step-transitioning > .pawr-code-current-step { grid-area: 1 / 1; }
.e-platforma .pawr-code-current-step.is-step-leaving { animation: pawr-code-step-push-left .72s cubic-bezier(.2,.75,.2,1) both; }
.e-platforma .pawr-code-current-step.is-step-entering { animation: pawr-code-step-push-in .72s cubic-bezier(.2,.75,.2,1) both; }
.e-platforma .pawr-code-current-step.is-pending { border-left-color: #d1962e; background: #fff9eb; }
.e-platforma .pawr-code-step-number { display: grid; width: 30px; height: 30px; place-items: center; border-radius: 50%; background: #dcebf0; font-weight: 900; }
.e-platforma .pawr-code-current-step h3 { margin: 2px 0 4px; font-size: 1em; }
.e-platforma .pawr-code-current-step p { margin: 0; color: var(--ink-soft, #555); }
.e-platforma .pawr-code-current-step details { margin-top: 7px; }
.e-platforma .pawr-code-current-step > strong { display: grid; gap: 3px; justify-items: end; color: #435a64; font-size: .76em; white-space: nowrap; }
.e-platforma .pawr-code-current-step > strong small { color: var(--ink-soft, #666); }
.e-platforma .pawr-code-step-navigator > .result { display: none; }

@keyframes pawr-code-step-green-fill {
  from { opacity: .08; transform: scaleX(0); }
  to { opacity: 1; transform: scaleX(1); }
}
@keyframes pawr-code-step-push-left {
  from { opacity: 1; transform: translateX(0); }
  to { opacity: .92; transform: translateX(-105%); }
}
@keyframes pawr-code-step-push-in {
  from { opacity: .85; transform: translateX(105%); }
  to { opacity: 1; transform: translateX(0); }
}
@media (prefers-reduced-motion: reduce) {
  .e-platforma .pawr-code-current-step.is-success-transition::before { animation-duration: 150ms; }
  .e-platforma .pawr-code-current-step.is-step-leaving,
  .e-platforma .pawr-code-current-step.is-step-entering { animation-duration: 150ms; }
}

.e-platforma .pawr-code-editor-page:fullscreen,
.e-platforma .pawr-code-editor-page:-webkit-full-screen { box-sizing: border-box; width: 100vw; height: 100vh; padding: 12px; overflow: hidden; grid-template-rows: auto minmax(0, 1fr); gap: 10px; background: #edf3f5; }
.e-platforma .pawr-code-editor-page:fullscreen .pawr-code-editor-heading,
.e-platforma .pawr-code-editor-page:-webkit-full-screen .pawr-code-editor-heading { display: none; }
.e-platforma .pawr-code-editor-page:fullscreen .pawr-code-editor-sticky,
.e-platforma .pawr-code-editor-page:-webkit-full-screen .pawr-code-editor-sticky { top: 0; background: #edf3f5; }
.e-platforma .pawr-code-editor-page:fullscreen .pawr-code-editor-workspace,
.e-platforma .pawr-code-editor-page:-webkit-full-screen .pawr-code-editor-workspace { height: auto; max-height: none; min-height: 0; }
.e-platforma .pawr-code-editor-page:fullscreen .pawr-code-editor-pane .cm-scroller,
.e-platforma .pawr-code-editor-page:-webkit-full-screen .pawr-code-editor-pane .cm-scroller { overflow-x: scroll; overflow-y: auto; }
.e-platforma .pawr-code-editor-page:fullscreen .pawr-code-game-cta:not(:empty),
.e-platforma .pawr-code-editor-page:-webkit-full-screen .pawr-code-game-cta:not(:empty) { position: absolute; right: 12px; bottom: 12px; left: 12px; z-index: 40; }

@media (max-width: 820px) {
  .e-platforma .pawr-code-editor-workspace { height: min(620px, max(300px, calc(100vh - 310px))); }
  .e-platforma .pawr-code-editor-toolbar { flex-wrap: wrap; }
  .e-platforma .pawr-code-save-status { margin-left: 0; }
  .e-platforma .pawr-code-save-status,
  .e-platforma .pawr-code-check-status { flex: 1 1 auto; }
}

@media (max-width: 620px) {
  .e-platforma .pawr-code-editor-page > * { min-width: 0; max-width: 100%; }
  .e-platforma .pawr-code-editor-heading { align-items: stretch; flex-direction: column; }
  .e-platforma .pawr-code-editor-heading h1 { overflow-wrap: anywhere; }
  .e-platforma .pawr-code-editor-score { justify-items: start; }
  .e-platforma .pawr-code-editor-sticky { top: 0; }
  .e-platforma .pawr-code-mobile-tabs { display: grid; grid-template-columns: repeat(2, 1fr); overflow: hidden; border: 2px solid var(--ink, #222); border-radius: 12px; }
  .e-platforma .pawr-code-mobile-tabs button { min-width: 0; overflow: hidden; padding: 9px 4px; border: 0; border-right: 1px solid #aebfc6; background: #eef5f7; font-weight: 900; text-overflow: ellipsis; }
  .e-platforma .pawr-code-editor-toolbar .btn { flex: 1 1 calc(50% - 8px); width: auto; }
  .e-platforma .pawr-code-scale-controls .btn { flex: 0 0 30px; }
  .e-platforma .pawr-code-mobile-tabs button:last-child { border-right: 0; }
  .e-platforma .pawr-code-mobile-tabs button.is-active { background: var(--cyan, #168dcc); color: #fff; }
  .e-platforma .pawr-code-editor-workspace { display: block; height: min(540px, max(280px, calc(100vh - 330px))); min-height: 280px; }
  .e-platforma .pawr-code-editor-divider { display: none; }
  .e-platforma .pawr-code-editor-pane,
  .e-platforma .pawr-code-preview-pane { height: 100%; }
  .e-platforma .pawr-code-editor-page[data-mobile-tab="code"] .pawr-code-preview-pane,
  .e-platforma .pawr-code-editor-page[data-mobile-tab="preview"] .pawr-code-editor-pane { display: none; }
  .e-platforma .pawr-code-step-progress { grid-template-columns: minmax(0, 1fr) auto; }
  .e-platforma .pawr-code-step-progress > span { grid-column: 1 / -1; }
  .e-platforma .pawr-code-current-step { grid-template-columns: auto minmax(0, 1fr); }
  .e-platforma .pawr-code-current-step > strong { grid-column: 2; justify-items: start; }
  .e-platforma .pawr-code-editor-page:fullscreen,
  .e-platforma .pawr-code-editor-page:-webkit-full-screen { grid-template-rows: auto auto minmax(0, 1fr); }
}
