:root {
  --hcr-bottom-frame-height: 35px;
}

.desktop-titlebar {
  display: none;
}

.desktop-resize-handle {
  display: none;
}

body.desktop-mode {
  overflow: hidden;
}

body.desktop-mode::before {
  position: fixed;
  z-index: 2147483646;
  inset: 0;
  box-sizing: border-box;
  border: 1px solid #8297b0;
  content: "";
  pointer-events: none;
}

body.desktop-mode #app {
  height: calc(100vh - 35px);
  min-height: 0;
  margin-top: 35px;
  overflow: auto;
}

body.desktop-mode:not(.auth-mode) #app {
  overflow: hidden;
}

.desktop-bottom-frame {
  position: fixed;
  z-index: 9999;
  right: 0;
  bottom: 0;
  left: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 28px;
  padding: 0 34px;
  height: var(--hcr-bottom-frame-height) !important;
  min-height: var(--hcr-bottom-frame-height) !important;
  max-height: var(--hcr-bottom-frame-height) !important;
  box-sizing: border-box;
  border-top: 1px solid #d7e0eb;
  background: #fff;
  box-shadow: 0 -1px 4px rgba(39, 70, 107, .05);
  pointer-events: none;
}

.desktop-status-note,
.desktop-status-meta,
.desktop-status-item {
  display: flex;
  min-width: 0;
  align-items: center;
  color: #72869f;
  font: 400 12px/1.2 "Microsoft YaHei", "Segoe UI", sans-serif;
  white-space: nowrap;
}

.desktop-status-note {
  gap: 10px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.desktop-status-note-icon {
  display: inline-grid;
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  place-items: center;
  color: #7189a4;
  font-family: "Segoe Fluent Icons", "Segoe MDL2 Assets";
  font-size: 13px;
  line-height: 1;
}

.desktop-status-note-icon::before {
  content: attr(data-glyph);
}

.desktop-status-meta {
  justify-content: flex-end;
  gap: 18px;
}

.desktop-status-item {
  gap: 7px;
}

.desktop-status-label,
.desktop-status-value {
  color: #71849c;
  font-weight: 400;
}

.desktop-status-divider {
  width: 1px;
  height: 18px;
  background: #cbd6e2;
}

.desktop-status-value {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.desktop-status-item[data-status-tone="ok"] .desktop-status-value {
  color: #71849c;
}

.desktop-status-item[data-status-tone="warn"] .desktop-status-value {
  color: #8a806f;
}

.desktop-status-item[data-status-tone="error"] .desktop-status-value {
  color: #9c7373;
}

.desktop-status-dot {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #aebdcb;
}

.desktop-status-item[data-status-tone="ok"] .desktop-status-dot {
  background: #1dac72;
}

.desktop-status-item[data-status-tone="warn"] .desktop-status-dot {
  background: #d7a154;
}

.desktop-status-item[data-status-tone="error"] .desktop-status-dot {
  background: #d27777;
}

.desktop-status-item[data-status-tone="pending"] .desktop-status-dot {
  background: #aebdcb;
}

body.auth-mode .desktop-bottom-frame {
  display: none;
}

body.desktop-mode:not(.auth-mode) #app {
  box-sizing: border-box;
  padding-bottom: var(--hcr-bottom-frame-height);
}

body.desktop-mode:not(.auth-mode) #app > :is(.project-workbench, .workbench),
body.desktop-mode:not(.auth-mode) #app > :is(.project-workbench, .workbench) > .project-side {
  min-height: 0 !important;
}

body.desktop-mode .desktop-resize-handle {
  position: fixed;
  z-index: 2147483647;
  display: block;
  background: transparent;
  touch-action: none;
}

body.desktop-mode .desktop-resize-handle.resize-n { top: 0; right: 10px; left: 10px; height: 6px; cursor: n-resize; }
body.desktop-mode .desktop-resize-handle.resize-ne { top: 0; right: 0; width: 10px; height: 10px; cursor: ne-resize; }
body.desktop-mode .desktop-resize-handle.resize-e { top: 10px; right: 0; bottom: 10px; width: 6px; cursor: e-resize; }
body.desktop-mode .desktop-resize-handle.resize-se { right: 0; bottom: 0; width: 10px; height: 10px; cursor: se-resize; }
body.desktop-mode .desktop-resize-handle.resize-s { right: 10px; bottom: 0; left: 10px; height: 6px; cursor: s-resize; }
body.desktop-mode .desktop-resize-handle.resize-sw { bottom: 0; left: 0; width: 10px; height: 10px; cursor: sw-resize; }
body.desktop-mode .desktop-resize-handle.resize-w { top: 10px; bottom: 10px; left: 0; width: 6px; cursor: w-resize; }
body.desktop-mode .desktop-resize-handle.resize-nw { top: 0; left: 0; width: 10px; height: 10px; cursor: nw-resize; }

body.desktop-mode .desktop-titlebar {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 10000;
  display: flex;
  height: 35px;
  align-items: center;
  color: #fff;
  background: #073da9;
  border-bottom: 1px solid rgba(255, 255, 255, .16);
  box-shadow: 0 1px 5px rgba(4, 30, 91, .18);
  user-select: none;
}

.desktop-titlebar-brand {
  padding-left: 14px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

.desktop-titlebar-drag {
  align-self: stretch;
  flex: 1;
}

.desktop-titlebar-actions {
  display: flex;
  align-self: stretch;
  align-items: stretch;
  flex: 0 0 auto;
}

.desktop-titlebar-actions button {
  width: 46px;
  padding: 0;
  border: 0;
  color: #fff;
  background: transparent;
  font: 16px/1 "Microsoft YaHei", sans-serif;
  cursor: default;
}

.desktop-titlebar-actions button:hover {
  background: rgba(255, 255, 255, .14);
}

.desktop-titlebar-actions .desktop-titlebar-close:hover {
  background: #d83b3b;
}

body.desktop-mode .workbench,
body.desktop-mode .project-workbench,
body.desktop-mode .project-side,
body.desktop-mode .status-page,
body.desktop-mode .auth-shell {
  min-height: calc(100vh - 35px);
}

body.auth-mode .desktop-titlebar-actions button[data-window-action="maximize"] {
  display: none;
}

/* The approved compact login sample is the whole auth window, not a card on a large canvas. */
body.desktop-mode #app {
  height: calc(100vh - 35px);
  margin-top: 35px;
}

body.desktop-mode .desktop-titlebar {
  height: 35px;
  background: linear-gradient(135deg, #246fc9 0%, #155bb7 100%);
  box-shadow: 0 1px 5px rgba(4, 30, 91, .18);
}

.desktop-titlebar-brand {
  padding-left: 14px;
  font-size: 12px;
  letter-spacing: .1px;
}

.desktop-titlebar-actions button {
  position: relative;
  display: grid;
  place-items: center;
  width: 34px;
  min-width: 34px;
  height: 100%;
  flex: 0 0 auto;
  padding: 0;
  margin: 0;
  box-sizing: border-box;
  font-size: 0;
  line-height: 0;
  appearance: none;
}

.desktop-titlebar-actions svg {
  display: block;
  width: 13px;
  height: 13px;
  margin: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.35;
  stroke-linecap: square;
  vector-effect: non-scaling-stroke;
  pointer-events: none;
}

.desktop-titlebar-actions .desktop-titlebar-icon-restore { display: none; }
.desktop-titlebar[data-window-maximized="true"] .desktop-titlebar-icon-maximize { display: none; }
.desktop-titlebar[data-window-maximized="true"] .desktop-titlebar-icon-restore { display: block; }

body.desktop-mode .workbench,
body.desktop-mode .project-workbench,
body.desktop-mode .project-side,
body.desktop-mode .status-page,
body.desktop-mode .auth-shell {
  min-height: calc(100vh - 35px);
}

body.auth-mode.desktop-mode #app,
body.auth-mode.desktop-mode .auth-shell {
  background: #f8fafc;
  overflow: auto;
}

body.auth-mode.desktop-mode .auth-brand {
  display: none;
}

.auth-card .notice.error {
  min-height: 0;
  padding: 7px 10px;
  border: 1px solid #ecd3d1;
  background: #fff8f7;
  color: #a52b27;
  font-size: 12px;
  line-height: 1.4;
}

.auth-card .notice:focus {
  outline: 2px solid rgba(216, 91, 87, .3);
  outline-offset: 2px;
}

.data-disconnected-workbench .project-main {
  min-width: 0;
}

.data-disconnected-workbench .project-top {
  display: flex;
  align-items: center;
  min-height: 54px;
  padding: 0 24px;
  color: #304766;
  font-size: 14px;
}

.data-disconnected-workbench .project-workspace {
  display: grid;
  min-height: calc(100% - 54px);
  place-items: center;
  padding: 32px;
}

.data-disconnected {
  width: min(560px, 100%);
  padding: 34px 38px;
  border: 1px solid #dbe3ec;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 4px 14px rgba(34, 62, 96, .05);
  text-align: center;
}

.data-disconnected h2 {
  margin: 0;
  color: #243d60;
  font-size: 21px;
  font-weight: 400;
}

.data-disconnected-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 22px;
}

.data-disconnected-actions .btn {
  font-weight: 400;
}

.cloud-initialization-workspace {
  overflow: auto;
}

.cloud-initialization-entry {
  width: min(760px, calc(100% - 48px));
  padding: 34px;
  border: 1px solid #d8e2ef;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 16px 38px rgba(38, 67, 105, .08);
}

.cloud-initialization-heading {
  text-align: center;
}

.cloud-initialization-heading h2 {
  margin: 13px 0 8px;
  color: #243d60;
  font-size: 24px;
  font-weight: 400;
}

.cloud-initialization-heading p {
  margin: 0;
  color: #71839c;
  font-size: 14px;
}

.cloud-initialization-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 26px;
}

.cloud-initialization-option {
  display: flex;
  min-height: 132px;
  padding: 22px 18px;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 9px;
  border: 1px solid #cfdbea;
  border-radius: 9px;
  background: #fff;
  color: #22508f;
  text-align: left;
  cursor: pointer;
}

.cloud-initialization-option:hover,
.cloud-initialization-option:focus-visible {
  border-color: #70a1ed;
  box-shadow: 0 0 0 3px rgba(11, 99, 236, .09);
  outline: none;
}

.cloud-initialization-option strong {
  font-size: 16px;
  font-weight: 400;
}

.cloud-initialization-option span {
  color: #71839c;
  font-size: 12px;
  line-height: 1.65;
}

.cloud-initialization-option-primary {
  border-color: #0b63ec;
  background: #0b63ec;
  color: #fff;
}

.cloud-initialization-option-primary span {
  color: rgba(255, 255, 255, .82);
}

.cloud-initialization-option-primary:hover,
.cloud-initialization-option-primary:focus-visible {
  border-color: #0758d7;
  background: #0758d7;
  box-shadow: 0 0 0 3px rgba(11, 99, 236, .18);
}

@media (max-width: 1100px) {
  .desktop-bottom-frame {
    gap: 14px;
    padding-right: 16px;
    padding-left: 16px;
  }

  .desktop-status-note,
  .desktop-status-meta,
  .desktop-status-item {
    font-size: 11px;
  }

  .desktop-status-meta {
    gap: 11px;
  }

  .desktop-status-item {
    gap: 6px;
  }

  .desktop-status-note {
    gap: 8px;
  }

  .desktop-status-divider {
    height: 16px;
  }
}
