/* Shared Excalidraw whiteboard — canvas-first layout with the live call docked right. */

.desktop-icon--whiteboard .desktop-icon__image svg {
  filter: drop-shadow(0 2px 3px rgba(40, 24, 108, .42));
}

/* Keep every desktop app reachable when the desktop is shorter than one icon column. */
@media (max-height: 560px) {
  .desktop-icons {
    bottom: 8px;
    width: calc(100vw - 10px);
    height: calc(100% - 16px);
    flex-wrap: wrap;
    align-content: flex-start;
  }
}

body.whiteboard-open .taskbar,
body.whiteboard-open .start-menu,
body.whiteboard-open .desktop-toast {
  display: none !important;
}

body.whiteboard-open #skype-window {
  display: none !important;
  pointer-events: none !important;
}

body.whiteboard-open .desktop-surface {
  inset: 0;
}

.whiteboard-window,
.whiteboard-window.is-active,
.whiteboard-window.is-maximized {
  position: fixed;
  inset: 0 !important;
  z-index: 121 !important;
  display: flex;
  width: 100vw;
  height: 100dvh;
  min-width: 0;
  min-height: 0;
  max-width: none;
  max-height: none;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  outline: 0;
  color: #242038;
  background: #f5f4fb;
  box-shadow: none;
  font-family: "Segoe UI", Inter, Arial, sans-serif;
  resize: none;
}

.whiteboard-window[hidden] {
  display: none;
}

.whiteboard-shell,
.whiteboard-layout {
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
}

.whiteboard-shell {
  display: flex;
  background: #f8f7fc;
}

.whiteboard-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(280px, 22vw, 340px);
}

.whiteboard-workspace {
  display: flex;
  min-width: 0;
  min-height: 0;
  flex-direction: column;
  border-right: 1px solid #dcd8e9;
  background: #f7f6fb;
}

.whiteboard-topbar {
  position: relative;
  z-index: 3;
  display: flex;
  height: 58px;
  min-height: 58px;
  padding: 0 20px;
  align-items: center;
  gap: 11px;
  border-bottom: 1px solid #e5e2ef;
  background: rgba(255, 255, 255, .95);
  box-shadow: 0 2px 12px rgba(46, 36, 83, .055);
  backdrop-filter: blur(12px);
}

.whiteboard-logo,
.whiteboard-logo svg {
  width: 36px;
  height: 36px;
}

.whiteboard-logo {
  display: grid;
  flex: 0 0 36px;
  place-items: center;
}

.whiteboard-brand {
  min-width: 0;
}

.whiteboard-brand h2,
.whiteboard-brand p {
  margin: 0;
}

.whiteboard-brand h2 {
  color: #26213a;
  font-size: 15px;
  font-weight: 750;
  letter-spacing: -.02em;
}

.whiteboard-brand p {
  display: flex;
  margin-top: 3px;
  align-items: center;
  gap: 6px;
  color: #817b94;
  font-size: 9px;
}

.whiteboard-brand p strong {
  overflow: hidden;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#whiteboard-sync-dot {
  width: 6px;
  height: 6px;
  flex: 0 0 6px;
  border-radius: 50%;
  background: #d5a52b;
  box-shadow: 0 0 0 3px rgba(213, 165, 43, .12);
}

#whiteboard-sync-dot.is-online {
  background: #38b878;
  box-shadow: 0 0 0 3px rgba(56, 184, 120, .14);
}

#whiteboard-sync-dot.is-error {
  background: #dc5360;
  box-shadow: 0 0 0 3px rgba(220, 83, 96, .14);
}

.whiteboard-powered {
  margin-left: auto;
  padding: 6px 10px;
  border: 1px solid #e4e0f1;
  border-radius: 999px;
  color: #77708c;
  background: #faf9fd;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.whiteboard-canvas-wrap {
  position: relative;
  min-width: 0;
  min-height: 0;
  flex: 1;
  overflow: hidden;
  background: #fbfaff;
}

.whiteboard-frame {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: #fbfaff;
}

.whiteboard-gate {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  padding: 30px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  color: #38314f;
  background:
    radial-gradient(circle at 50% 36%, rgba(112, 93, 226, .13), transparent 27%),
    linear-gradient(145deg, #fdfcff, #f2f0fa);
  text-align: center;
  transition: opacity 180ms ease, visibility 180ms ease;
}

.whiteboard-gate[hidden] {
  display: none;
}

.whiteboard-loader {
  display: flex;
  height: 22px;
  margin-bottom: 18px;
  align-items: center;
  gap: 6px;
}

.whiteboard-loader span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #6c5ce7;
  animation: whiteboard-pulse 1s ease-in-out infinite;
}

.whiteboard-loader span:nth-child(2) { animation-delay: 120ms; }
.whiteboard-loader span:nth-child(3) { animation-delay: 240ms; }

.whiteboard-gate.is-error .whiteboard-loader {
  display: none;
}

.whiteboard-gate h3,
.whiteboard-gate p {
  margin: 0;
}

.whiteboard-retry {
  min-height: 36px;
  margin-top: 18px;
  padding: 0 18px;
  border: 1px solid #5948cf;
  border-radius: 999px;
  color: #fff;
  background: #6c5ce7;
  box-shadow: 0 7px 18px rgba(68, 50, 164, .2);
  font: 700 10px/1 "Segoe UI", Arial, sans-serif;
  cursor: pointer;
}

.whiteboard-retry:hover {
  background: #5b4bd8;
}

.whiteboard-retry[hidden] {
  display: none;
}

.whiteboard-gate h3 {
  font-size: clamp(19px, 2vw, 25px);
  font-weight: 750;
  letter-spacing: -.03em;
}

.whiteboard-gate p {
  margin-top: 8px;
  color: #807991;
  font-size: 11px;
}

.whiteboard-call-sidebar {
  position: relative;
  display: flex;
  min-width: 0;
  min-height: 0;
  padding: 18px 16px 14px;
  flex-direction: column;
  color: #f3efff;
  background:
    radial-gradient(circle at 50% 0, rgba(108, 92, 231, .24), transparent 35%),
    linear-gradient(180deg, #191527, #0f0d18);
}

.whiteboard-close {
  position: absolute;
  z-index: 4;
  top: max(10px, env(safe-area-inset-top));
  right: max(12px, env(safe-area-inset-right));
  display: grid;
  width: 40px;
  height: 40px;
  padding: 0;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 11px;
  color: #bdb6cf;
  background: rgba(255, 255, 255, .065);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .2);
  font: 300 27px/1 "Segoe UI", Arial, sans-serif;
  cursor: pointer;
  transition: color 140ms ease, background-color 140ms ease, transform 140ms ease;
}

.whiteboard-close:hover {
  color: #fff;
  background: #e54855;
}

.whiteboard-close:active {
  transform: scale(.94);
}

.whiteboard-call-heading {
  display: flex;
  height: 50px;
  min-height: 50px;
  padding: 0 48px 0 3px;
  align-items: flex-start;
  justify-content: space-between;
}

.whiteboard-call-heading > div {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 5px;
}

.whiteboard-call-heading__live {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #948ca9;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: .15em;
}

.whiteboard-call-heading__live i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #43d883;
  box-shadow: 0 0 10px rgba(67, 216, 131, .72);
}

.whiteboard-call-heading strong {
  overflow: hidden;
  color: #f6f3fc;
  font-size: 13px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.whiteboard-call-heading__quality {
  padding: 5px 8px;
  border: 1px solid rgba(150, 134, 238, .19);
  border-radius: 999px;
  color: #afa4e3;
  background: rgba(108, 92, 231, .1);
  font-size: 8px;
  font-weight: 700;
}

.whiteboard-call-stage {
  min-width: 0;
  min-height: 0;
  flex: 1;
}

.whiteboard-call-stage .skype-video-stack {
  position: relative;
  display: flex;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  flex-direction: column;
  gap: 8px;
  overflow: hidden;
  background: transparent;
}

.whiteboard-call-stage .skype-video-stack > video,
.whiteboard-call-stage .skype-video-stack > #remote-video,
.whiteboard-call-stage .skype-video-stack > .skype-local-video,
.whiteboard-call-stage .skype-video-stack > .skype-local-video:not(.has-stream) {
  position: static;
  inset: auto;
  z-index: auto;
  display: block;
  width: 100%;
  height: 0;
  min-height: 0;
  flex: 1 1 0;
  aspect-ratio: auto;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 14px;
  object-fit: cover;
  background: #211d30;
  box-shadow: 0 14px 36px rgba(0, 0, 0, .28);
}

.whiteboard-call-stage .skype-video-stack > .skype-local-video,
.whiteboard-call-stage .skype-video-stack > .skype-local-video:not(.has-stream) {
  transform: scaleX(-1);
}

.whiteboard-call-stage .skype-video-placeholder {
  inset: 0 0 calc(50% + 4px);
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 14px;
  color: #aaa2ba;
  background: #211d30;
}

.whiteboard-call-stage .skype-connect {
  display: none !important;
}

.whiteboard-call-controls {
  display: flex;
  height: 78px;
  min-height: 78px;
  align-items: center;
  justify-content: center;
  gap: 14px;
}

.whiteboard-call-controls button {
  display: flex;
  width: 76px;
  height: 48px;
  padding: 0 10px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid rgba(255, 255, 255, .11);
  border-radius: 14px;
  color: #eeeaf8;
  background: rgba(255, 255, 255, .07);
  font: 600 9px/1 "Segoe UI", Arial, sans-serif;
  cursor: pointer;
  transition: border-color 140ms ease, background-color 140ms ease, transform 140ms ease;
}

.whiteboard-call-controls button:hover {
  border-color: rgba(154, 137, 244, .44);
  background: rgba(108, 92, 231, .2);
  transform: translateY(-2px);
}

.whiteboard-call-controls button.is-off {
  border-color: rgba(226, 76, 84, .38);
  background: rgba(174, 45, 54, .56);
}

.whiteboard-call-controls svg {
  width: 21px;
  height: 21px;
  fill: currentColor;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.whiteboard-call-note {
  min-height: 12px;
  margin: -5px 0 0;
  overflow: hidden;
  color: #8f879f;
  font-size: 8px;
  line-height: 1.35;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.whiteboard-enable-media {
  min-height: 34px;
  margin: -4px auto 9px;
  padding: 0 15px;
  border: 1px solid rgba(159, 143, 248, .42);
  border-radius: 999px;
  color: #fff;
  background: #6c5ce7;
  box-shadow: 0 7px 18px rgba(54, 38, 137, .3);
  font: 700 9px/1 "Segoe UI", Arial, sans-serif;
  cursor: pointer;
}

.whiteboard-enable-media:hover {
  background: #7b6bed;
}

.whiteboard-enable-media[hidden] {
  display: none;
}

@keyframes whiteboard-pulse {
  0%, 100% { opacity: .35; transform: translateY(0); }
  50% { opacity: 1; transform: translateY(-4px); }
}

@media (max-width: 820px) {
  .whiteboard-layout {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr) 210px;
  }

  .whiteboard-workspace {
    border-right: 0;
    border-bottom: 1px solid #282238;
  }

  .whiteboard-topbar {
    height: 52px;
    min-height: 52px;
    padding: 0 14px;
  }

  .whiteboard-powered {
    margin-right: 48px;
  }

  .whiteboard-call-sidebar {
    display: grid;
    padding: 10px 12px max(9px, env(safe-area-inset-bottom));
    grid-template-columns: 125px minmax(0, 1fr) 166px;
    grid-template-rows: minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
  }

  .whiteboard-close {
    position: fixed;
    top: max(6px, env(safe-area-inset-top));
    right: max(8px, env(safe-area-inset-right));
    color: #696277;
    border-color: #e2deea;
    background: rgba(255, 255, 255, .96);
    box-shadow: 0 4px 14px rgba(42, 33, 72, .13);
  }

  .whiteboard-call-heading {
    height: auto;
    min-height: 0;
    padding: 0;
  }

  .whiteboard-call-heading__quality,
  .whiteboard-call-note {
    display: none;
  }

  .whiteboard-enable-media {
    display: block;
    grid-column: 1 / -1;
    min-height: 28px;
    margin: -3px auto 0;
  }

  .whiteboard-enable-media[hidden] {
    display: none;
  }

  .whiteboard-call-stage {
    height: 100%;
  }

  .whiteboard-call-stage .skype-video-stack {
    flex-direction: row;
  }

  .whiteboard-call-stage .skype-video-stack > video,
  .whiteboard-call-stage .skype-video-stack > #remote-video,
  .whiteboard-call-stage .skype-video-stack > .skype-local-video,
  .whiteboard-call-stage .skype-video-stack > .skype-local-video:not(.has-stream) {
    width: 0;
    height: 100%;
  }

  .whiteboard-call-stage .skype-video-placeholder {
    inset: 0 calc(50% + 4px) 0 0;
  }

  .whiteboard-call-controls {
    height: auto;
    min-height: 0;
    gap: 8px;
  }
}

@media (max-width: 560px) {
  .whiteboard-layout {
    grid-template-rows: minmax(0, 1fr) 164px;
  }

  .whiteboard-topbar {
    padding: 0 8px;
  }

  .whiteboard-logo,
  .whiteboard-logo svg {
    width: 32px;
    height: 32px;
    flex-basis: 32px;
  }

  .whiteboard-powered {
    display: none;
  }

  .whiteboard-call-sidebar {
    padding: 8px;
    grid-template-columns: minmax(0, 1fr) 104px;
    gap: 8px;
  }

  .whiteboard-call-heading {
    display: none;
  }

  .whiteboard-call-stage .skype-video-stack {
    gap: 5px;
  }

  .whiteboard-call-stage .skype-video-stack > video,
  .whiteboard-call-stage .skype-video-stack > #remote-video,
  .whiteboard-call-stage .skype-video-stack > .skype-local-video,
  .whiteboard-call-stage .skype-video-stack > .skype-local-video:not(.has-stream) {
    border-radius: 10px;
  }

  .whiteboard-call-controls {
    flex-direction: column;
  }

  .whiteboard-call-controls button {
    width: 96px;
    height: 48px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .whiteboard-loader span {
    animation: none;
    opacity: .7;
  }
}
