/* Wolfram Academy tab on the right screen edge and its window, on every
   shop page except the Academy itself. Round 14e: rounded and floating (see the end of the file); the tab
   and the header label keep their slanted shapes (the only ones in the
   Academy). Prefixed .wcd; the app inside brings community.css (loaded on
   first open) and looks the same as the Academy page. */

.wcd {
  font-family: "Source Sans 3", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* ---- Tab: a vertical rectangle in the middle of the right edge, an
   ombre from burnt orange into the brand teal; the logo keeps its own
   colours. */
.wcd-tab {
  position: fixed;
  top: 50%;
  right: 0;
  z-index: 1039;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 22px 9px 24px 11px;
  border: 0;
  border-radius: 0;
  background: none;
  color: #fff;
  font-family: inherit;
  transform: translateY(-50%);
  cursor: pointer;
}
.wcd-tab::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(180deg, #ff8a00 0%, #f99a0c 22%, #c9a21c 44%, #6fa047 66%, #1f8f74 84%, #00847e 100%);
  transition: filter 0.16s ease;
}
.wcd-tab:hover::before {
  filter: brightness(1.08) saturate(1.05);
}
.wcd-tab:focus-visible {
  outline: 0;
}
.wcd-tab:focus-visible::before {
  outline: 2px solid #1c2524;
  outline-offset: 2px;
}
.wcd-tab__mark {
  display: block;
  width: 26px;
  height: 26px;
}
.wcd-tab__label {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  line-height: 1;
}
.wcd-tab__badge {
  position: absolute;
  top: -4px;
  left: -2px;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border: 2px solid #fff;
  border-radius: 999px;
  background: #b9531a;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
}
.wcd-tab__badge[hidden],
.wcd.is-open .wcd-tab {
  display: none;
}

/* ---- Window: bottom right corner, as large as the chat window on the
   Academy page; under Shopware's off-canvas cart and modals (1040+). */
.wcd-panel {
  position: fixed;
  right: 0;
  bottom: 0;
  z-index: 1039;
  width: min(600px, 100vw);
  height: min(860px, calc(100vh - 96px));
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #fff;
  border: 1px solid #d2d7d7;
  border-right: 0;
  border-bottom: 0;
  border-radius: 0;
  color: #1c2524;
  text-align: left;
}
.wcd-panel[hidden] {
  display: none;
}
/* Header: the shop's section label ("KAUFMÄNNISCH" on the FAQ page),
   flush with the window's left edge. */
.wcd-bar {
  flex: none;
  display: flex;
  align-items: stretch;
  height: 48px;
  padding: 0 4px 0 0;
  background: #fff;
  border-bottom: 1px solid #e2e4e4;
}
.wcd-bar__title {
  display: flex;
  align-items: center;
  margin-right: auto;
  padding: 0 40px 0 16px;
  background: #00847e;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  white-space: nowrap;
  clip-path: polygon(0 0, 100% 0, calc(100% - 22px) 100%, 0 100%);
}
.wcd-bar__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  color: #55605f;
  cursor: pointer;
}
.wcd-bar__btn:hover {
  background: #f0f2f2;
  color: #1c2524;
}
.wcd-bar__btn:focus-visible {
  outline: 2px solid #c4cbca;
  outline-offset: -2px;
}
.wcd-body {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: #eef6f5; /* the Academy canvas; the app paints its picture over it */
}
.wcd-state {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 24px;
  color: #1c2524;
  font-size: 15px;
  text-align: center;
}
.wcd-state p {
  margin: 0;
}
.wcd-spin {
  width: 26px;
  height: 26px;
  border: 3px solid #d0e5e4;
  border-top-color: #00847e;
  border-radius: 50%;
  animation: wcd-spin 0.8s linear infinite;
}
@keyframes wcd-spin {
  to {
    transform: rotate(360deg);
  }
}
@media (prefers-reduced-motion: reduce) {
  .wcd-spin {
    animation-duration: 2.4s;
  }
  .wcd-tab::before {
    transition: none;
  }
}
.wcd-retry {
  padding: 9px 24px;
  border: 0;
  border-radius: 0;
  background: #008c8c;
  color: #fff;
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}
.wcd-retry:hover {
  background: #006b66;
}

/* ---- Phones: a smaller tab; the window takes the whole screen. */
@media (max-width: 767.98px) {
  .wcd-tab {
    top: 62%;
    gap: 8px;
    padding: 16px 6px 18px 8px;
  }
  .wcd-tab__mark {
    width: 22px;
    height: 22px;
  }
  .wcd-tab__label {
    font-size: 12px;
  }
  .wcd-panel {
    inset: 0;
    z-index: 2100;
    width: auto;
    height: 100vh;
    height: 100dvh;
    border: 0;
  }
}

/* The chatbot button would cover the window's bottom right corner (the
   post editor's publish button, the chat input). It comes back when the
   window is minimised. */
body:has(.wcd.is-open) #wolfram-chatbot {
  display: none !important;
}

/* ==========================================================================
   Round 14e: the small Academy window in the soft Academy look — it floats
   16px off the screen edges with rounded corners, a hairline and a quiet
   shadow; header buttons and the retry button rounded; the edge tab rounds
   only its corners towards the page. Phones keep the full-screen window.
   ========================================================================== */
.wcd-panel {
  right: 16px;
  bottom: 16px;
  width: min(600px, calc(100vw - 32px));
  height: min(860px, calc(100vh - 112px));
  border: 1px solid #e0e4e7;
  border-radius: 16px;
  box-shadow: 0 18px 48px rgba(0, 40, 38, 0.18), 0 2px 6px rgba(0, 40, 38, 0.08);
}
.wcd-bar {
  height: 50px;
  padding: 0 8px 0 0;
}
.wcd-bar__btn {
  width: 38px;
  height: 38px;
  align-self: center;
  border-radius: 10px;
}
.wcd-bar__btn:focus-visible {
  outline-offset: 0;
}
.wcd-retry {
  border-radius: 10px;
}
.wcd-tab,
.wcd-tab::before {
  border-radius: 12px 0 0 12px;
}
.wcd-tab:focus-visible::before {
  outline-offset: 2px;
}
@media (max-width: 767.98px) {
  .wcd-panel {
    inset: 0;
    width: auto;
    height: 100vh;
    height: 100dvh;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }
}
