/* Variant B: core. Edit component rules here; do not append override patches. */
:root {
  --ui-ink: #102a42;
  --ui-muted: #566779;
  --ui-paper: #fffaf2;
  --ui-background: #f4f0e6;
  --ui-line: #ded8cc;
  --ui-green: #277b55;
  --ui-activity: var(--ui-green);
  --ui-step-done: var(--ui-activity);
  --ui-orange: #fa841e;
  --ui-blue: #20536d;
  --ui-radius: 18px;
  --ui-shadow: 0 8px 26px #18354b04;
}

body:has(#app.workspace) {
  background: var(--ui-background);
  color: var(--ui-ink);
  font-family: "Segoe UI", system-ui, sans-serif;
}

body:has(#app.workspace)::before {
  content: none;
}

body:has(#app.workspace)::after {
  content: none;
}

@media screen and (prefers-reduced-motion: no-preference) {
  :is(.study-dialog, .account-confirmation-dialog)[open] {
    animation: izi-dialog-open 300ms cubic-bezier(.22,.72,.18,1);
  }
  :is(.study-dialog, .account-confirmation-dialog)[open]::backdrop {
    animation: izi-backdrop-open 220ms ease-out;
  }
  @keyframes izi-dialog-open {
    from { translate: 0 12px; scale: .985; }
    to { translate: 0 0; scale: 1; }
  }
  @keyframes izi-backdrop-open { from { opacity: 0; } to { opacity: 1; } }

  @supports (interpolate-size: allow-keywords) and selector(details::details-content) {
    :is(.account-setting, .builder-upload-help, .builder-notes-disclosure, .parent-note)::details-content {
      interpolate-size: allow-keywords;
      overflow: clip;
      block-size: 0;
      transition: block-size 310ms cubic-bezier(.22,.72,.18,1), content-visibility 310ms allow-discrete;
    }
    :is(.account-setting, .builder-upload-help, .builder-notes-disclosure, .parent-note)[open]::details-content {
      block-size: auto;
    }
  }
}

#app.workspace {
  display: block;
  width: min(1120px, calc(100% - 40px));
  max-width: 1120px;
  margin: 0 auto;
  padding: 30px 0 48px;
  color: var(--ui-ink);
  font: 16px/1.5 "Segoe UI", system-ui, sans-serif;
}

#app.workspace * {
  box-sizing: border-box;
}

#app.workspace *::before {
  box-sizing: border-box;
}

#app.workspace *::after {
  box-sizing: border-box;
}

#app.workspace [hidden] {
  display: none !important;
}

#app.workspace h1 {
  color: var(--ui-ink);
  font-family: inherit;
  font-weight: 750;
  text-wrap: pretty;
  max-width: none;
  font-size: 30px;
  line-height: 1.2;
  letter-spacing: -.8px;
  margin: 0;
}

#app.workspace .rich-text.task-instruction {
  margin: 8px 0 20px;
  color: var(--ui-muted);
  font-size: 14px;
  line-height: 1.5;
  font-weight: 400;
}

#app.workspace h2 {
  color: var(--ui-ink);
  font-family: inherit;
  font-weight: 700;
  text-wrap: pretty;
  max-width: none;
  font-size: 22px;
  line-height: 1.3;
  letter-spacing: -.4px;
  margin: 0;
}

#app.workspace h3 {
  color: var(--ui-ink);
  font-family: inherit;
  font-weight: 700;
  text-wrap: pretty;
  max-width: none;
  font-size: 19px;
  line-height: 1.35;
  margin: 0;
}

#app.workspace p {
  line-height: 1.5;
  margin: 8px 0 0;
  color: inherit;
  overflow-wrap: anywhere;
}

#app.workspace .study-footer {
  border-top: 1px solid #dcd5c8;
  margin-top: 32px;
  padding: 18px 0 26px;
  color: var(--ui-muted);
  font-size: 12px;
}

#app.workspace .study-footer p {
  color: var(--ui-muted);
  font-size: 12px;
  line-height: 1.6;
  margin: 0 0 12px;
}

#app.workspace .study-footer a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: 13px;
}

#app.workspace .rich-text {
  color: var(--ui-ink);
}

#app.workspace .money-row { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 16px 0; font-size: 14px; }
#app.workspace .money-row.total { border-top: 1px solid var(--ui-line); margin-top: 18px; }
#app.workspace .money-row strong { white-space: nowrap; }
#app.workspace .actions.stack { display: flex; flex-direction: column; align-items: stretch; gap: 10px; }
#app.workspace .actions.stack>.btn { width: 100%; }

#app.workspace .rich-text p {
  color: inherit;
  font: inherit;
  margin: 0;
}

#app.workspace .rich-text > * + * {
  margin-top: .56em;
}

#app.workspace a {
  text-underline-offset: 3px;
}

#app.workspace .help {
  color: var(--ui-muted);
  font-size: 14px;
  line-height: 1.5;
  font-family: inherit;
}

#app.workspace small {
  color: var(--ui-muted);
  font-size: 14px;
  line-height: 1.5;
  font-family: inherit;
}

#app.workspace .hint {
  color: var(--ui-muted);
  font-size: 14px;
  line-height: 1.5;
  font-family: inherit;
}

#app.workspace .module-eyebrow {
  color: var(--ui-muted);
  font: 700 12px/1.5 "Segoe UI", sans-serif;
  letter-spacing: .08em;
  text-transform: uppercase;
  margin: 0 0 8px;
}

#app.workspace .ui-eyebrow {
  color: var(--ui-muted);
  font: 700 12px/1.5 "Segoe UI", sans-serif;
  letter-spacing: .08em;
  text-transform: uppercase;
  margin: 0 0 8px;
}

#app.workspace .card {
  min-width: 0;
  padding: 24px;
  border: 1px solid var(--ui-line);
  border-radius: var(--ui-radius);
  background: var(--ui-paper);
  color: var(--ui-ink);
  box-shadow: var(--ui-shadow);
  transform: none;
}

#app.workspace .card::before {
  content: none;
}

#app.workspace .card::after {
  content: none;
}

#app.workspace .card .card {
  box-shadow: none;
}

#app.workspace .header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 16px;
  margin-bottom: 16px;
}

#app.workspace .header h2 {
  margin-bottom: 0;
}

#app.workspace .btn {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 16px;
  border: 1px solid #b8c4c8;
  border-radius: 11px;
  color: var(--ui-ink);
  background: var(--ui-paper);
  box-shadow: none;
  font: 700 15px/1.45 "Segoe UI", sans-serif;
  text-align: center;
  text-decoration: none;
  white-space: normal;
  overflow-wrap: anywhere;
  transition: background-color .16s, border-color .16s;
}

#app.workspace .btn.primary {
  color: #10273c;
  border-color: #dc741b;
  background: var(--ui-orange);
  box-shadow: 0 4px 10px #d6741810;
}

#app.workspace .btn.primary:hover:not(:disabled) {
  background: #f7943e;
}

#app.workspace .btn.ghost {
  border-color: transparent;
  background: transparent;
  color: var(--ui-blue);
}

#app.workspace .btn.danger {
  color: #9e392c;
}

#app.workspace .btn.small {
  min-height: 44px;
  font-size: 14px;
  padding: 9px 12px;
}

#app.workspace .btn:disabled {
  opacity: .55;
  cursor: default;
  transform: none;
}

#app.workspace :is(button, input, select, textarea, a, summary):focus-visible {
  outline: 3px solid #21658e;
  outline-offset: 3px;
}

/* Nagłówki otrzymują fokus po zmianie widoku dla czytników ekranu. */
html :is(h1, h2, h3, strong)[tabindex="-1"]:focus {
  outline: none;
  box-shadow: none;
}

#app.workspace :is(button, a, summary) {
  touch-action: manipulation;
}

#app.workspace .actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 18px;
}

#app.workspace .actions > * {
  min-width: 0;
}

#app.workspace :where(input:not([type=checkbox]):not([type=radio]):not([type=file]):not([type=range]), select, textarea) {
  min-height: 49px;
  max-width: 100%;
  width: 100%;
  border: 1px solid #b8c2c8;
  background: #fff;
  color: var(--ui-ink);
  border-radius: 10px;
  padding: 11px 12px;
  font: 16px/1.45 "Segoe UI", sans-serif;
  box-shadow: none;
}

#app.workspace :is(input[type=checkbox],input[type=radio]) {
  accent-color: var(--ui-green);
  width: 19px;
  height: 19px;
  flex: 0 0 19px;
}

#app.workspace .label {
  color: var(--ui-ink);
  font: 650 14px/1.5 "Segoe UI", sans-serif;
  margin-bottom: 7px;
}

#app.workspace .fields {
  gap: 20px;
}

#app.workspace .choices {
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 10px;
}

#app.workspace .builder-option {
  display: flex;
  align-items: stretch;
  cursor: pointer;
  position: relative;
  min-width: 0;
}

#app.workspace .builder-option input {
  min-height: 0;
  min-width: 0;
  margin: 0;
  position: absolute;
  top: 17px;
  right: 12px;
  left: auto;
  opacity: 1;
  clip: auto;
}

#app.workspace .builder-option-card {
  display: flex;
  flex-direction: column;
  min-height: 58px;
  justify-content: center;
  padding: 14px 34px 14px 13px;
  border: 1px solid #d6d0c4;
  border-radius: 11px;
  background: var(--ui-paper);
  box-shadow: none;
  width: 100%;
  font-size: 14px;
  font-weight: 650;
}

#app.workspace .builder-option-card strong {
  font-size: 14px;
}

#app.workspace .builder-option-card > span {
  margin-top: 4px;
  color: var(--ui-muted);
  font-size: 13px;
}

#app.workspace .builder-option input:checked + .builder-option-card {
  background: #fff0df;
  border-color: #de7b2b;
  box-shadow: none;
  border: 2px solid #ed8128;
  padding: 13px 33px 13px 12px;
}

#app.workspace .notice {
  display: block;
  margin: 14px 0;
  padding: 14px 16px;
  font-size: 14px;
  border: 1px solid #bed0d9;
  border-radius: 12px;
  background: #edf3f6;
  color: #29536c;
  box-shadow: none;
}

#app.workspace .notice::before {
  content: none;
}

#app.workspace .notice::after {
  content: none;
}

#app.workspace .notice.warn {
  background: #fff1df;
  color: #78491f;
  border-color: #e7c79d;
}

#app.workspace .notice.error {
  background: #fff0e9;
  color: #8f3c29;
  border-color: #e1b9a7;
}

#app.workspace .notice.ok {
  background: #edf4e9;
  color: #275d42;
  border-color: #bbd3bb;
}

#app.workspace .notice.success {
  background: #edf4e9;
  color: #275d42;
  border-color: #bbd3bb;
}

#app.workspace .pill {
  font: 650 13px/1.35 "Segoe UI", sans-serif;
  border: 0;
  border-radius: 7px;
  padding: 5px 9px;
  background: #eae7df;
  color: #5b6268;
}

#app.workspace .pill.ok {
  background: #eaf2e7;
  color: #276547;
}

#app.workspace .pill.warn {
  background: #fff0dc;
  color: #8c4a19;
}

#app.workspace .empty {
  padding: 28px 16px;
  border: 1px dashed #c4ccbc;
  border-radius: 14px;
  background: #f3f5ec;
  color: var(--ui-muted);
}

#app.workspace .empty strong {
  display: block;
  color: var(--ui-ink);
  margin-bottom: 8px;
}

#app.workspace details > summary {
  cursor: pointer;
  min-height: 44px;
  padding: 12px 0;
  color: var(--ui-blue);
  font-size: 14px;
}

#app.workspace .ui-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-bottom: 24px;
}

#app.workspace .ui-description {
  color: var(--ui-muted);
  max-width: 600px;
}

#app.workspace .ui-heading-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.ui-icon {
  width: 21px;
  height: 21px;
  flex: 0 0 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

#app.workspace .ui-steps {
  display: flex;
  list-style: none;
  margin: 0 0 24px;
  padding: 0;
  gap: 12px;
  font-size: 13px;
  color: var(--ui-muted);
}

#app.workspace .ui-steps li {
  display: flex;
  align-items: center;
  gap: 7px;
  flex: 1;
  position: relative;
}

#app.workspace .ui-steps li:not(:last-child)::after {
  content: "";
  height: 1px;
  background: var(--ui-line);
  flex: 1;
  margin-left: 4px;
}

#app.workspace .ui-step-number {
  display: grid;
  place-items: center;
  width: 23px;
  height: 23px;
  flex: 0 0 23px;
  border-radius: 50%;
  background: #e4e4d9;
  font-size: 11px;
  font-weight: 700;
}

#app.workspace .ui-step-number .ui-icon {
  width: 14px;
  height: 14px;
}

#app.workspace .ui-steps .is-current {
  color: var(--ui-ink);
  font-weight: 650;
}

#app.workspace .is-current .ui-step-number {
  color: white;
  background: var(--ui-blue);
}

#app.workspace .is-done .ui-step-number {
  color: var(--ui-green);
  background: #e4eedf;
}

#app.workspace .ui-step-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  color: var(--ui-blue);
  font-size: 14px;
  background: none;
  border: 0;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 3px;
}

#app.workspace .ui-surface-heading {
  margin-bottom: 18px;
}

#app.workspace .ui-compact-footer {
  margin-top: 24px;
  color: var(--ui-muted);
  font-size: 13px;
}

#app.workspace .ui-result-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

#app.workspace .ui-result-pair > div {
  padding: 16px;
  border: 1px solid var(--ui-line);
  border-radius: 12px;
  min-width: 0;
  overflow-wrap: anywhere;
  background: #f2efe7;
}

#app.workspace .ui-result-pair > div:last-child {
  background: #edf4e8;
  border-color: #ccddc3;
}

#app.workspace .ui-result-pair small {
  display: block;
  margin-bottom: 7px;
}

#app.workspace .reveal-on-scroll {
  opacity: 1;
  transform: none;
}

.workspace-footer {
  display: none;
}

body:has(#app.workspace) #appFooter {
  display: none;
}

body:has(#app.workspace) .workspace-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  width: min(1120px,calc(100% - 40px));
  margin: 0 auto;
  padding: 20px 0 28px;
  border-top: 1px solid var(--ui-line);
  color: var(--ui-muted);
  font: 13px/1.5 "Segoe UI",sans-serif;
}

html[data-app-view=public-link] body:has(#app.workspace) .workspace-footer,
html[data-app-view=classroom-panel] body:has(#app.workspace) .workspace-footer {
  display: none;
}

.workspace-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}

.workspace-footer a {
  color: var(--ui-blue);
  text-underline-offset: 3px;
}

#app.workspace strong {
  color: inherit;
  font-family: inherit;
}

#app.workspace b {
  color: inherit;
  font-family: inherit;
}

#app.workspace button {
  font-family: inherit;
}

#app.workspace input {
  font-family: inherit;
}

#app.workspace select {
  font-family: inherit;
}

#app.workspace textarea {
  min-height: 104px;
  resize: vertical;
  font-family: inherit;
}

#app.workspace .eyebrow {
  font-size: 12px;
  letter-spacing: .08em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--ui-muted);
  margin: 0 0 8px;
}

#app.workspace .text-btn {
  border: 0;
  background: none;
  box-shadow: none;
  display: inline-flex;
  gap: 6px;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 8px 4px;
  color: var(--ui-blue);
  font: 650 14px/1.5 "Segoe UI",sans-serif;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

#app.workspace .text-btn::before {
  content: none;
}

#app.workspace .text-btn::after {
  content: none;
}

#app.workspace .feature-icon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  display: grid;
  place-content: center;
  color: var(--ui-green);
  background: #e9f1e5;
  margin: 0 0 18px;
}

#app.workspace .feature-icon .icon {
  width: 29px;
  height: 29px;
}

#app.workspace .full {
  width: 100%;
}

#app.workspace .fine {
  font-size: 13px;
  color: var(--ui-muted);
  font-weight: 400;
}

#app.workspace .tiny {
  font-size: 13px;
  color: var(--ui-muted);
  font-weight: 400;
}

#app.workspace .paper {
  background: var(--ui-paper);
  border: 1px solid var(--ui-line);
  border-radius: 18px;
  padding: 24px;
  box-shadow: var(--ui-shadow);
}

#app.workspace .badge.warn {
  color: #8c4a19;
  background: #fff0dc;
}

#app.workspace .badge.blue {
  color: #285e7a;
  background: #e8eff3;
}

#app.workspace .summary-list {
  margin: 14px 0 0;
  padding: 0;
}

#app.workspace .summary-list>div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 13px 0;
  border-top: 1px solid #ddd6c8;
}

#app.workspace .summary-list dt {
  color: var(--ui-muted);
  font-size: 14px;
}

#app.workspace .summary-list dd {
  margin: 0;
  text-align: right;
  font-size: 14px;
  font-weight: 600;
  max-width: 65%;
  overflow-wrap: anywhere;
}

#app.workspace .badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  line-height: 1.3;
  color: var(--ui-green);
  background: #eaf2e7;
  border-radius: 7px;
  padding: 5px 9px;
  font-weight: 650;
  font-family: "Segoe UI",Arial,sans-serif;
  letter-spacing: 0;
  text-transform: none;
  border: 0;
}

#app.workspace .badge::before {
  content: none;
}

#app.workspace .chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 16px;
}

#app.workspace .chip {
  padding: 5px 9px;
  border: 1px solid var(--ui-line);
  border-radius: 7px;
  background: #f5f1e8;
  font-size: 12px;
  color: var(--ui-muted);
}

#app.workspace .small {
  font-size: 14px;
}

#app.workspace .muted {
  color: var(--ui-muted);
}

#app.workspace .center {
  text-align: center;
}

#app.workspace .below {
  margin-top: 20px;
}

#app.workspace .section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

#app.workspace .section-head h2 {
  margin-bottom: 0;
}

@media (max-width: 760px) {
  #app.workspace {
    width: calc(100% - 32px);
    padding-top: 22px;
  }

  #app.workspace .card {
    padding: 20px;
  }

  #app.workspace h2 {
    font-size: 20px;
  }

  #app.workspace .ui-heading {
    align-items: start;
    gap: 12px;
  }

  #app.workspace .ui-steps {
    gap: 8px;
    font-size: 11px;
  }

  #app.workspace .ui-steps li {
    gap: 5px;
  }

  #app.workspace .ui-result-pair {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  #app.workspace * {
    scroll-behavior: auto;
    animation: none;
    transition: none;
  }

  #app.workspace *::before {
    scroll-behavior: auto;
    animation: none;
    transition: none;
  }

  #app.workspace *::after {
    scroll-behavior: auto;
    animation: none;
    transition: none;
  }
}

@media (max-width:360px) {
  #app.workspace .ui-steps {
    gap: 5px;
    font-size: 10px;
  }

  #app.workspace .ui-steps li {
    gap: 3px;
  }

  #app.workspace .ui-step-number {
    width: 20px;
    height: 20px;
    flex-basis: 20px;
  }
}

@media (max-width:800px) {
  body:has(#app.workspace) .workspace-footer {
    width: calc(100% - 32px);
    display: block;
  }

  .workspace-footer nav {
    margin-top: 20px;
  }

  #app.workspace {
    padding-bottom: 36px;
  }

  #app.workspace .paper {
    padding: 20px;
  }
}
