.dashboard-page {
  position: relative;
  grid-column: 2 / 5;
  grid-row: 1;
  z-index: 75;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 14px;
  min-width: 0;
  height: 100%;
  overflow: hidden;
  padding: 18px 20px;
  background: var(--app-bg);
}

.dashboard-header {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  min-width: 0;
}

.dashboard-header > div {
  min-width: 0;
}

.dashboard-header h1 {
  font-size: 24px;
}

.dashboard-header p:not(.panel-label) {
  max-width: 780px;
  margin: 5px 0 0;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.35;
}

.dashboard-agent-button {
  display: inline-flex;
  flex: 0 0 auto;
  gap: 7px;
  align-items: center;
}

.dashboard-view-tabs {
  display: flex;
  gap: 6px;
  align-items: center;
  min-width: 0;
  overflow-x: auto;
}

.dashboard-view-tabs button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  gap: 6px;
  height: 30px;
  padding: 0 10px;
  color: var(--text-muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
}

.dashboard-view-tabs button.active,
.dashboard-view-tabs button:hover {
  color: var(--accent);
  background: var(--accent-soft);
  border-color: var(--accent);
}

.dashboard-view-tabs .dashboard-add-view {
  color: var(--text);
  background: var(--surface-muted);
}

.dashboard-layout {
  display: grid;
  grid-template-columns: 326px minmax(0, 1fr);
  gap: 14px;
  min-width: 0;
  min-height: 0;
}

.dashboard-catalog,
.dashboard-playground {
  min-width: 0;
  min-height: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.dashboard-catalog {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 10px;
  padding: 12px;
  overflow: hidden;
}

.dashboard-catalog-header,
.dashboard-playground-header,
.dashboard-widget-card > header,
.dashboard-agent-dialog header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}

.dashboard-catalog-header h2,
.dashboard-playground-header h2,
.dashboard-widget-card h3,
.dashboard-agent-dialog h2 {
  margin: 0;
}

.dashboard-catalog-header span,
.dashboard-playground-header p,
.dashboard-widget-card-title p,
.dashboard-agent-dialog header p {
  margin: 3px 0 0;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.35;
}

.dashboard-category-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.dashboard-category-tabs button {
  height: 28px;
  padding: 0 9px;
  color: var(--text-muted);
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
}

.dashboard-category-tabs button.active,
.dashboard-category-tabs button:hover {
  color: var(--accent);
  background: var(--accent-soft);
  border-color: var(--accent);
}

.dashboard-widget-list {
  display: grid;
  align-content: start;
  gap: 8px;
  min-height: 0;
  overflow: auto;
}

.dashboard-catalog-item {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) 30px;
  gap: 9px;
  align-items: center;
  min-width: 0;
  padding: 9px;
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: 7px;
}

.dashboard-catalog-item strong {
  display: block;
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}

.dashboard-catalog-item p {
  display: -webkit-box;
  min-width: 0;
  margin: 2px 0 0;
  overflow: hidden;
  color: var(--text-muted);
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  font-size: 12px;
  line-height: 1.3;
}

.dashboard-widget-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid var(--border);
  border-radius: 7px;
}

.dashboard-add-widget {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  color: var(--text-muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
}

.dashboard-add-widget.selected {
  color: var(--green);
  background: var(--green-soft);
  cursor: default;
}

.dashboard-playground {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 12px;
  padding: 14px;
  overflow: hidden;
}

.dashboard-widget-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(320px, 1fr));
  gap: 12px;
  min-height: 0;
  overflow: auto;
  padding-right: 3px;
}

.dashboard-widget-card {
  display: grid;
  gap: 12px;
  align-content: start;
  min-width: 0;
  padding: 12px;
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.dashboard-widget-card-title {
  display: flex;
  gap: 10px;
  min-width: 0;
}

.dashboard-widget-card-title > div {
  min-width: 0;
}

.dashboard-widget-card h3 {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
}

.dashboard-widget-actions {
  display: inline-flex;
  gap: 6px;
  flex: 0 0 auto;
}

.dashboard-widget-actions .icon-button {
  width: 28px;
  height: 28px;
}

.dashboard-widget-body {
  display: grid;
  gap: 10px;
}

.dw-script-frame {
  width: 100%;
  height: 100%;
  background: transparent;
  border: 0;
}

.dw-script-capped {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  color: var(--text-muted);
  cursor: pointer;
  opacity: 0.65;
  user-select: none;
  font-size: 12px;
}

.dw-script-capped:hover,
.dw-script-capped:focus-visible {
  color: var(--text);
  opacity: 0.9;
}

.dw-script-capped:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.dashboard-field,
.dashboard-field-row {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.dashboard-field span {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 800;
}

.dashboard-field input,
.dashboard-field select,
.dashboard-field textarea {
  width: 100%;
  min-width: 0;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  outline: none;
  font-size: 12px;
}

.dashboard-field input,
.dashboard-field select {
  height: 30px;
  padding: 0 9px;
}

.dashboard-field textarea {
  resize: vertical;
  min-height: 70px;
  padding: 8px 9px;
  line-height: 1.35;
}

.dashboard-field input:focus,
.dashboard-field select:focus,
.dashboard-field textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.dashboard-output-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
}

.dashboard-output-grid > div {
  min-width: 0;
  padding: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
}

.dashboard-output-grid dt {
  margin: 0 0 4px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.dashboard-output-grid dd {
  display: flex;
  gap: 6px;
  align-items: center;
  min-width: 0;
  margin: 0;
}

.dashboard-output-grid code {
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: 12px;
}

.dashboard-copy-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  color: var(--text-muted);
  background: transparent;
  border: 0;
  border-radius: 5px;
  cursor: pointer;
}

.dashboard-copy-button:hover {
  color: var(--text);
  background: var(--surface-muted);
}

.dashboard-error {
  margin: 0;
  color: var(--red);
  font-size: 12px;
  font-weight: 700;
}

.dashboard-report-body {
  display: grid;
  gap: 7px;
}

.dashboard-report-body p {
  margin: 0;
  color: var(--text);
  font-size: 13px;
  line-height: 1.4;
}

.dashboard-empty {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  min-height: 0;
  color: var(--text-muted);
  text-align: center;
}

.dashboard-empty h2,
.dashboard-empty p {
  margin: 0;
}

.dashboard-empty p {
  max-width: 360px;
  font-size: 13px;
  line-height: 1.4;
}

.dashboard-dialog-backdrop {
  z-index: 100;
}

.dashboard-agent-dialog {
  display: grid;
  gap: 12px;
  width: min(680px, calc(100vw - 96px));
  max-height: calc(100vh - 80px);
  overflow: auto;
  padding: 14px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.dashboard-agent-dialog .dashboard-field textarea {
  min-height: 250px;
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
}

.dashboard-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

main.dashboard-page {
  --dashboard-shadow-card:
    0 1px 0 rgb(20 30 60 / 4%),
    0 4px 14px -8px rgb(20 30 60 / 18%);
  --dashboard-shadow-ambient: 0 24px 60px -28px rgb(20 30 60 / 30%);
  --dashboard-radius: 10px;
  --dashboard-radius-lg: 14px;
  position: relative;
  grid-column: 2 / 5;
  grid-row: 1;
  z-index: 75;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 0;
  min-width: 0;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  padding: 0;
  color: var(--text);
  background: var(--app-bg);
}

main.dashboard-page.dashboard-page-hidden,
.dashboard-loading.dashboard-page-hidden {
  visibility: hidden;
  pointer-events: none;
}

.dashboard-loading {
  grid-column: 2 / 5;
  grid-row: 1;
  display: grid;
  align-items: end;
  height: 100%;
  padding: 0 0 12px;
  color: var(--text);
  background: var(--app-bg);
  font-size: 13px;
}

.dashboard-topbar {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  padding: 12px 20px 10px;
  background: linear-gradient(180deg, var(--chrome) 0%, var(--app-bg) 100%);
  border-bottom: 1px solid var(--border);
}

.dashboard-brand {
  display: flex;
  flex: 0 0 auto;
  align-items: baseline;
  min-width: 0;
}

.dashboard-brand .crumb {
  color: var(--text);
  font-size: 16px;
  font-weight: 750;
  letter-spacing: 0;
}

.dashboard-brand .crumb::after {
  content: none;
}

.dashboard-view-pills {
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  gap: 4px;
  min-width: 0;
  padding: 3px;
  overflow-x: auto;
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  scrollbar-width: none;
}

.dashboard-view-pills::-webkit-scrollbar {
  display: none;
}

.dashboard-pill,
.dashboard-pill-add {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 6px;
  min-height: 30px;
  padding: 6px 12px;
  color: var(--text-muted);
  white-space: nowrap;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 999px;
  cursor: pointer;
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1;
}

.dashboard-pill {
  position: relative;
  padding-left: 14px;
}

.dashboard-pill-main {
  min-width: 0;
  padding: 0;
  color: inherit;
  background: transparent;
  border: 0;
  cursor: pointer;
  font: inherit;
}

.dashboard-pill:hover,
.dashboard-pill-add:hover {
  color: var(--text);
  background: rgb(255 255 255 / 48%);
}

.dashboard-pill.active {
  color: var(--text);
  background: var(--surface);
  border-color: var(--border);
  box-shadow: 0 1px 2px rgb(0 0 0 / 6%);
  font-weight: 650;
}

.dashboard-pill.has-tab-color {
  color: var(--dashboard-pill-text);
  background: var(--dashboard-pill-bg);
  border-color: rgb(0 0 0 / 12%);
}

.dashboard-pill.has-tab-color:hover,
.dashboard-pill.has-tab-color.active {
  color: var(--dashboard-pill-text);
  background: var(--dashboard-pill-bg);
  border-color: rgb(0 0 0 / 16%);
  box-shadow:
    0 1px 2px rgb(0 0 0 / 10%),
    inset 0 0 0 1px rgb(255 255 255 / 18%);
}

.dashboard-pill-dot {
  flex: 0 0 auto;
  width: 6px;
  height: 6px;
  padding: 0;
  background: var(--accent);
  border: 0;
  border-radius: 50%;
}

button.dashboard-pill-dot {
  width: 14px;
  height: 14px;
  background: var(--accent);
  border: 1px solid rgb(0 0 0 / 14%);
  cursor: pointer;
}

.dashboard-pill.has-tab-color .dashboard-pill-dot {
  background: currentColor;
}

button.dashboard-pill-dot:hover,
button.dashboard-pill-dot:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.dashboard-pill-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  padding: 0;
  color: var(--text-faint);
  background: transparent;
  border: 0;
  border-radius: 4px;
  cursor: pointer;
  opacity: 0;
}

.dashboard-pill:hover .dashboard-pill-close,
.dashboard-pill.active .dashboard-pill-close {
  opacity: 1;
}

.dashboard-pill-close:hover {
  color: var(--red);
  background: var(--surface-muted);
}

.dashboard-pill.has-tab-color .dashboard-pill-close {
  color: var(--dashboard-pill-muted);
}

.dashboard-pill.has-tab-color .dashboard-pill-close:hover {
  color: var(--dashboard-pill-text);
  background: rgb(255 255 255 / 20%);
}

.dashboard-tab-gradient-popover {
  position: fixed;
  z-index: 210;
  display: grid;
  grid-template-columns: repeat(5, 24px);
  gap: 6px;
  width: max-content;
  padding: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 9px;
  box-shadow: var(--dashboard-shadow-ambient);
}

.dashboard-tab-gradient-popover button {
  width: 24px;
  height: 24px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 5px;
  cursor: pointer;
}

.dashboard-tab-gradient-popover .dashboard-tab-gradient-none {
  position: relative;
  overflow: hidden;
  background: #ffffff;
}

.dashboard-tab-gradient-popover .dashboard-tab-gradient-none::after {
  content: "";
  position: absolute;
  top: 50%;
  left: -4px;
  width: 34px;
  height: 2px;
  background: #dc2626;
  transform: rotate(-45deg);
  transform-origin: center;
}

.dashboard-tab-gradient-popover button:hover,
.dashboard-tab-gradient-popover button:focus-visible {
  border-color: var(--border-strong);
  outline: none;
}

.dashboard-tab-gradient-popover button.active {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.dashboard-pill-add {
  color: var(--text-muted);
}

.dashboard-pill-add:hover {
  color: var(--accent);
  background: var(--accent-soft);
}

.dashboard-pill-rename {
  width: 8ch;
  min-width: 5ch;
  padding: 0;
  color: inherit;
  background: transparent;
  border: 0;
  outline: 0;
  font: inherit;
}

.dashboard-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 6px;
}

.dashboard-density {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px;
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.dashboard-density button {
  min-height: 24px;
  padding: 0 8px;
  color: var(--text-muted);
  background: transparent;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
  font-size: 11.5px;
}

.dashboard-density button.active {
  color: var(--accent);
  background: var(--accent-soft);
  font-weight: 650;
}

.btn-ghost,
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 30px;
  padding: 6px 10px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 12.5px;
  line-height: 1;
}

.btn-ghost {
  color: var(--text-muted);
  background: transparent;
  border: 1px solid transparent;
}

.btn-ghost:hover {
  color: var(--text);
  background: var(--surface-muted);
  border-color: var(--border);
}

.btn-primary {
  color: var(--surface);
  background: var(--accent);
  border: 1px solid rgb(0 0 0 / 4%);
  box-shadow:
    0 1px 2px rgb(0 0 0 / 8%),
    inset 0 0 0 1px rgb(0 0 0 / 4%);
  font-weight: 700;
}

.btn-primary:hover {
  filter: brightness(1.05);
}

.dw-canvas-stack {
  position: relative;
  min-height: 0;
  overflow: hidden;
}

.dw-canvas-scroll {
  box-sizing: border-box;
  position: relative;
  --dw-canvas-padding-x: 20px;
  --dw-canvas-padding-top: 18px;
  --dw-canvas-padding-bottom: 60px;
  --dw-grid-dot: rgb(23 32 43 / 14%);
  --dw-grid-dot-soft: rgb(23 32 43 / 5%);
  --dw-grid-column-width: calc((100% - (var(--dw-grid-gap-x, 16px) * 13)) / 12);
  --dw-grid-step-x: calc(var(--dw-grid-column-width) + var(--dw-grid-gap-x, 16px));
  --dw-grid-step-y: calc(var(--dw-row-height, 68px) + var(--dw-grid-gap-y, 16px));
  height: 100%;
  min-height: 0;
  padding: var(--dw-canvas-padding-top) var(--dw-canvas-padding-x) var(--dw-canvas-padding-bottom);
  overflow-x: hidden;
  overflow-y: auto;
}

.dw-canvas-scroll.is-cached-view {
  position: absolute;
  inset: 0;
  visibility: hidden;
  pointer-events: none;
}

.dw-canvas {
  min-height: 100%;
}

/* Custom per-view background layer: expands across the scroll padding so no page background shows around the canvas. */
.dw-canvas-bg,
.dw-canvas-blueprint {
  position: absolute;
  top: calc(-1 * var(--dw-canvas-padding-top, 18px));
  right: calc(-1 * var(--dw-canvas-padding-x, 20px));
  bottom: calc(-1 * var(--dw-canvas-padding-bottom, 60px));
  left: calc(-1 * var(--dw-canvas-padding-x, 20px));
  pointer-events: none;
}

.dw-canvas-bg {
  z-index: 0;
  background-repeat: no-repeat;
  background-position: center;
  background-size: cover;
}

.dw-canvas-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--dw-bg-dim-color, transparent);
}

.dw-canvas-bg-video {
  overflow: hidden;
}

.dw-dashboard-background-host {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.dw-canvas-bg-video-layer {
  position: absolute;
  inset: 0;
  visibility: hidden;
  opacity: 0;
}

.dw-canvas-bg-video-layer.active {
  visibility: visible;
  opacity: 1;
}

.dw-canvas-bg-video-layer::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--dw-bg-dim-color, transparent);
}

.dw-canvas-bg-video video {
  display: block;
  width: 100%;
  height: 100%;
}

.dw-dynamic-bg-layer {
  overflow: hidden;
}

.dw-dynamic-bg-layer > * {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.dw-dynamic-bg-canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.dw-dynamic-bg-canvas-matrix {
  background: #050a08;
}

.dw-bg-aurora {
  overflow: hidden;
  background: linear-gradient(180deg, #0b1023 0%, #131a36 60%, #0a0f24 100%);
}

.dw-aurora-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  opacity: 0.85;
  mix-blend-mode: screen;
  will-change: transform;
}

.dw-aurora-1 {
  top: -10%;
  left: -8%;
  width: 60%;
  height: 55%;
  background: radial-gradient(circle, #4dd0e1 0%, transparent 70%);
  animation: dw-aurora-drift-1 22s ease-in-out infinite alternate;
}

.dw-aurora-2 {
  top: 10%;
  right: -12%;
  width: 70%;
  height: 60%;
  background: radial-gradient(circle, #a78bfa 0%, transparent 70%);
  animation: dw-aurora-drift-2 28s ease-in-out infinite alternate;
}

.dw-aurora-3 {
  bottom: -15%;
  left: 20%;
  width: 55%;
  height: 50%;
  background: radial-gradient(circle, #34d399 0%, transparent 70%);
  animation: dw-aurora-drift-3 30s ease-in-out infinite alternate;
}

.dw-aurora-grain {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgb(255 255 255 / 8%) 1px, transparent 1px);
  background-size: 3px 3px;
  opacity: 0.18;
  mix-blend-mode: overlay;
}

@keyframes dw-aurora-drift-1 {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(15%, 10%, 0) scale(1.15); }
}

@keyframes dw-aurora-drift-2 {
  from { transform: translate3d(0, 0, 0) scale(1.1); }
  to { transform: translate3d(-10%, 18%, 0) scale(0.95); }
}

@keyframes dw-aurora-drift-3 {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(-20%, -12%, 0) scale(1.2); }
}

.dw-bg-synthwave {
  overflow: hidden;
  background: #0a0420;
}

.dw-sw-sky {
  position: absolute;
  inset: 0 0 50%;
  background:
    radial-gradient(ellipse at 50% 100%, rgb(255 100 200 / 35%) 0%, transparent 60%),
    linear-gradient(180deg, #0a0420 0%, #2c0a4a 60%, #5b1268 100%);
}

.dw-sw-sun {
  position: absolute;
  top: 26%;
  left: 50%;
  width: 280px;
  height: 280px;
  background: linear-gradient(180deg, #ffb84d 0%, #ff5e9c 50%, #c026d3 100%);
  border-radius: 50%;
  box-shadow: 0 0 80px rgb(255 94 156 / 55%), 0 0 200px rgb(255 94 156 / 35%);
  transform: translate(-50%, 0);
}

.dw-sw-sun::before,
.dw-sw-sun::after {
  content: "";
  position: absolute;
  right: 0;
  left: 0;
  background: #0a0420;
}

.dw-sw-sun::before {
  top: 56%;
  height: 6px;
  box-shadow: 0 16px 0 0 #0a0420, 0 38px 0 0 #0a0420, 0 66px 0 0 #0a0420;
}

.dw-sw-mountains {
  position: absolute;
  top: 42%;
  right: 0;
  left: 0;
  height: 10%;
  background: linear-gradient(180deg, transparent 0%, #1a0838 100%);
  clip-path: polygon(0 100%, 8% 30%, 16% 70%, 24% 20%, 32% 60%, 40% 25%, 48% 70%, 56% 30%, 64% 65%, 72% 20%, 80% 55%, 88% 25%, 96% 65%, 100% 30%, 100% 100%);
}

.dw-sw-grid {
  position: absolute;
  top: 50%;
  right: 0;
  bottom: 0;
  left: 0;
  background:
    linear-gradient(rgb(255 94 156 / 55%) 1px, transparent 1px) 0 0 / 100% 40px,
    linear-gradient(90deg, rgb(255 94 156 / 55%) 1px, transparent 1px) 0 0 / 40px 100%;
  transform: perspective(380px) rotateX(60deg);
  transform-origin: center top;
  -webkit-mask-image: linear-gradient(180deg, transparent 0%, #000 25%, #000 100%);
  mask-image: linear-gradient(180deg, transparent 0%, #000 25%, #000 100%);
  animation: dw-sw-grid 2.4s linear infinite;
}

@keyframes dw-sw-grid {
  from { background-position: 0 0, 0 0; }
  to { background-position: 0 40px, 0 0; }
}

.dw-sw-scan {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(180deg, rgb(255 255 255 / 2.5%) 0, rgb(255 255 255 / 2.5%) 1px, transparent 1px, transparent 3px);
}

.dw-canvas-blueprint {
  z-index: 1;
  background-image:
    radial-gradient(circle, var(--dw-grid-dot) 1px, transparent 1.4px),
    radial-gradient(circle, var(--dw-grid-dot-soft) 1px, transparent 1.4px);
  background-size:
    var(--dw-grid-step-x) var(--dw-grid-step-y),
    16px 16px;
  background-position: var(--dw-canvas-padding-x, 20px) var(--dw-canvas-padding-top, 18px), 0 0;
}

.dw-canvas-host {
  position: relative;
  z-index: 1;
  min-height: 100%;
}

.dw-canvas-host > .dw-canvas {
  position: relative;
  z-index: 2;
}

.react-grid-layout.dw-canvas {
  overflow: visible;
}

.dw-canvas .react-grid-item.react-grid-placeholder {
  background: var(--accent);
  border: 1px solid var(--accent);
  border-radius: var(--dashboard-radius-lg);
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / 45%);
  opacity: 0.14;
}

.dw-instance {
  --w-accent: var(--accent);
  --w-accent-soft: var(--accent-soft);
  --w-title-text: var(--text);
  position: relative;
  display: flex;
  height: 100%;
  color: var(--text);
  animation: dw-widget-fade-in 100ms ease-out;
}

.dw-custom-widget.dw-reveal-space-warp {
  overflow: hidden;
  animation: dw-widget-space-warp 1000ms cubic-bezier(0.16, 1, 0.3, 1);
}

.dw-custom-widget.dw-reveal-space-warp::before,
.dw-custom-widget.dw-reveal-space-warp::after {
  position: absolute;
  inset: 0;
  z-index: 8;
  pointer-events: none;
  content: "";
  border-radius: inherit;
}

.dw-custom-widget.dw-reveal-space-warp::before {
  background:
    radial-gradient(circle at 50% 50%, rgb(255 255 255 / 88%) 0 2%, rgb(125 211 252 / 44%) 7%, transparent 28%),
    conic-gradient(from 90deg at 50% 50%, transparent 0 8%, rgb(96 165 250 / 74%) 10%, transparent 13% 23%, rgb(45 212 191 / 56%) 25%, transparent 28% 40%, rgb(167 139 250 / 62%) 43%, transparent 46% 100%);
  filter: blur(0.5px) saturate(1.28);
  opacity: 0;
  transform: scale(0.2) rotate(-14deg);
  animation: dw-widget-space-warp-flare 1000ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.dw-custom-widget.dw-reveal-space-warp::after {
  background:
    linear-gradient(90deg, transparent 0 18%, rgb(255 255 255 / 62%) 22%, transparent 26% 100%),
    linear-gradient(66deg, transparent 0 35%, rgb(125 211 252 / 56%) 40%, transparent 45% 100%),
    linear-gradient(114deg, transparent 0 38%, rgb(196 181 253 / 46%) 42%, transparent 47% 100%);
  background-size: 190% 100%, 160% 100%, 170% 100%;
  mix-blend-mode: screen;
  opacity: 0;
  transform: scaleX(0.18);
  animation: dw-widget-space-warp-streaks 1000ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes dw-widget-fade-in {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes dw-widget-space-warp {
  0% {
    opacity: 0;
    filter: brightness(1.45) saturate(1.45);
    transform: perspective(700px) translateZ(-56px) scale(0.9);
  }

  34% {
    opacity: 1;
    filter: brightness(1.22) saturate(1.24);
    transform: perspective(700px) translateZ(18px) scale(1.025);
  }

  62% {
    filter: brightness(1.08) saturate(1.08);
    transform: perspective(700px) translateZ(0) scale(0.998);
  }

  100% {
    opacity: 1;
    filter: none;
    transform: perspective(700px) translateZ(0) scale(1);
  }
}

@keyframes dw-widget-space-warp-flare {
  0% {
    opacity: 0;
    transform: scale(0.16) rotate(-16deg);
  }

  24% {
    opacity: 0.95;
  }

  68% {
    opacity: 0.32;
  }

  100% {
    opacity: 0;
    transform: scale(2.8) rotate(8deg);
  }
}

@keyframes dw-widget-space-warp-streaks {
  0% {
    opacity: 0;
    background-position: 115% 0, -60% 0, 140% 0;
    transform: scaleX(0.18);
  }

  18% {
    opacity: 0.86;
  }

  58% {
    opacity: 0.34;
    transform: scaleX(1);
  }

  100% {
    opacity: 0;
    background-position: -45% 0, 120% 0, -80% 0;
    transform: scaleX(1.08);
  }
}

@media (prefers-reduced-motion: reduce) {
  .dw-instance {
    animation: none;
  }

  .dw-custom-widget.dw-reveal-space-warp,
  .dw-custom-widget.dw-reveal-space-warp::before,
  .dw-custom-widget.dw-reveal-space-warp::after {
    animation: none;
    transform: none;
    filter: none;
  }

  .dw-custom-widget.dw-reveal-space-warp::before,
  .dw-custom-widget.dw-reveal-space-warp::after {
    opacity: 0;
  }
}

.dw-instance.dw-edit {
  outline: 1px dashed var(--border-strong);
  outline-offset: 2px;
  border-radius: var(--dashboard-radius-lg);
}

.dw-instance.dw-edit .drag-handle {
  cursor: grab;
}

.react-grid-item.react-draggable-dragging .dw-instance.dw-edit .drag-handle {
  cursor: grabbing;
}

.react-grid-item > .react-resizable-handle {
  z-index: 3;
  background-image: none !important;
  opacity: 1;
  padding: 0 !important;
}

.react-grid-item > .react-resizable-handle::after {
  display: none;
}

.react-grid-item > .react-resizable-handle.react-resizable-handle-e,
.react-grid-item > .react-resizable-handle.react-resizable-handle-w {
  top: 0 !important;
  width: 10px !important;
  height: 100% !important;
  margin-top: 0 !important;
  transform: none !important;
}

.react-grid-item > .react-resizable-handle.react-resizable-handle-e {
  right: -5px !important;
}

.react-grid-item > .react-resizable-handle.react-resizable-handle-w {
  left: -5px !important;
}

.react-grid-item > .react-resizable-handle.react-resizable-handle-n,
.react-grid-item > .react-resizable-handle.react-resizable-handle-s {
  left: 0 !important;
  width: 100% !important;
  height: 10px !important;
  margin-left: 0 !important;
  transform: none !important;
}

.react-grid-item > .react-resizable-handle.react-resizable-handle-n {
  top: -5px !important;
}

.react-grid-item > .react-resizable-handle.react-resizable-handle-s {
  bottom: -5px !important;
}

.react-grid-item > .react-resizable-handle.react-resizable-handle-nw,
.react-grid-item > .react-resizable-handle.react-resizable-handle-ne,
.react-grid-item > .react-resizable-handle.react-resizable-handle-sw,
.react-grid-item > .react-resizable-handle.react-resizable-handle-se {
  width: 16px !important;
  height: 16px !important;
  margin: 0 !important;
  transform: none !important;
}

.react-grid-item > .react-resizable-handle.react-resizable-handle-nw {
  top: -6px !important;
  left: -6px !important;
  cursor: nwse-resize;
}

.react-grid-item > .react-resizable-handle.react-resizable-handle-ne {
  top: -6px !important;
  right: -6px !important;
  cursor: nesw-resize;
}

.react-grid-item > .react-resizable-handle.react-resizable-handle-sw {
  bottom: -6px !important;
  left: -6px !important;
  cursor: nesw-resize;
}

.react-grid-item > .react-resizable-handle.react-resizable-handle-se {
  right: -6px !important;
  bottom: -6px !important;
  cursor: nwse-resize;
}

.dw-preset {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--dashboard-radius-lg);
  box-shadow: var(--dashboard-shadow-card);
}

.dw-head {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 50px;
  padding: 10px 12px;
  background: linear-gradient(180deg, var(--surface) 0%, var(--surface-muted) 100%);
  border-bottom: 1px solid var(--border);
}

.dw-preset-panel .dw-head {
  color: var(--w-title-text);
  background:
    linear-gradient(
      135deg,
      color-mix(in srgb, var(--w-accent) 82%, var(--surface) 18%) 0%,
      color-mix(in srgb, var(--w-accent) 64%, black) 100%
    );
  border-bottom-color: color-mix(in srgb, var(--w-accent) 60%, transparent);
}

.dw-title,
.dw-hero-title {
  margin: 0;
  overflow: hidden;
  color: var(--text);
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 650;
  letter-spacing: 0;
}

.dw-preset-panel .dw-title {
  color: var(--w-title-text);
  text-shadow: 0 1px 1px rgb(0 0 0 / 22%);
}

.dw-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  color: var(--w-accent);
  background: var(--w-accent-soft);
  border-radius: 8px;
}

.dw-preset-panel .dw-icon {
  color: var(--w-title-text);
  background: rgb(255 255 255 / 18%);
}

.dw-body,
.dw-hero-body {
  flex: 1 1 auto;
  min-height: 0;
  padding: 12px;
  overflow: auto;
  color: var(--text-muted);
  font-size: 12.5px;
  line-height: 1.55;
}

/* Panel preset: the body owns its own surface so --w-body-opacity can fade
   only the canvas, leaving the accent-colored head fully opaque. */
.dw-preset-panel {
  background: transparent;
}

.dw-preset-panel .dw-body {
  position: relative;
  z-index: 0;
  background: transparent;
}

.dw-preset-panel .dw-body::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: var(--surface);
  opacity: calc(var(--w-body-opacity, 100) / 100);
}

.dw-custom-widget .dw-head {
  min-height: 38px;
  padding: 5px 6px;
}

.dw-custom-widget .dw-body {
  padding: 6px;
}

.dw-custom-widget.dw-instance .dw-preset-ambient {
  gap: 5px;
  padding: 8px 9px;
}

.dw-custom-widget.dw-instance .dw-preset-ambient--glass {
  padding: 9px;
}

.dw-custom-widget .dw-hero-head {
  padding: 9px 9px 0;
}

.dw-custom-widget .dw-hero-body {
  padding: 6px 9px 9px;
}

.dw-controls {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  display: inline-flex;
  gap: 2px;
  opacity: 0;
  transition: opacity 120ms ease;
}

.dw-instance:hover .dw-controls,
.dw-instance.dw-edit .dw-controls {
  opacity: 1;
}

.dw-ctrl {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  padding: 0;
  color: var(--text-muted);
  background: rgb(255 255 255 / 78%);
  border: 1px solid var(--border);
  border-radius: 5px;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  cursor: pointer;
}

.dw-ctrl:hover {
  color: var(--text);
  background: var(--surface);
}

.dw-ctrl-properties {
  color: var(--text-muted);
  background: transparent;
  border-color: transparent;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

.dw-ctrl-properties:hover {
  color: var(--text);
  background: transparent;
}

.dw-ctrl.danger:hover,
.dw-ctrl.danger.confirming {
  color: var(--red);
  border-color: var(--red);
}

.dw-preset-ambient {
  gap: 10px;
  padding: 16px 18px;
  overflow: visible;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.dw-ambient-label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-faint);
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.dw-dot {
  width: 6px;
  height: 6px;
  background: var(--w-accent);
  border-radius: 50%;
}

.dw-preset-ambient--glass {
  position: relative;
  isolation: isolate;
  padding: 18px;
  overflow: hidden;
  color: var(--text);
  background:
    linear-gradient(180deg, rgb(255 255 255 / 55%) 0%, rgb(255 255 255 / 18%) 38%, rgb(255 255 255 / 8%) 100%),
    radial-gradient(120% 80% at 0% 0%, color-mix(in srgb, var(--w-accent) 28%, transparent) 0%, transparent 60%),
    radial-gradient(120% 90% at 100% 100%, color-mix(in srgb, var(--w-accent) 18%, transparent) 0%, transparent 65%),
    rgb(255 255 255 / 42%);
  border: 1px solid rgb(255 255 255 / 55%);
  border-radius: 22px;
  box-shadow:
    inset 0 1px 0 rgb(255 255 255 / 85%),
    inset 0 -10px 24px -12px rgb(0 0 0 / 18%),
    0 1px 1px rgb(20 30 55 / 4%),
    0 8px 24px -10px rgb(20 30 55 / 18%),
    0 24px 48px -24px rgb(20 30 55 / 22%);
  -webkit-backdrop-filter: blur(28px) saturate(180%) brightness(1.04);
  backdrop-filter: blur(28px) saturate(180%) brightness(1.04);
}

.dw-preset-ambient--glass::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(50% 60% at 20% 25%, color-mix(in srgb, var(--w-accent) 55%, transparent) 0%, transparent 70%),
    radial-gradient(60% 60% at 85% 80%, color-mix(in srgb, var(--w-accent) 35%, transparent) 0%, transparent 70%);
  border-radius: 22px;
  opacity: 0.85;
  filter: blur(22px);
}

.dw-preset-ambient--glass::after {
  content: "";
  position: absolute;
  top: 1px;
  right: 10%;
  left: 10%;
  z-index: 0;
  height: 40%;
  pointer-events: none;
  background: radial-gradient(60% 100% at 50% 0%, rgb(255 255 255 / 55%) 0%, rgb(255 255 255 / 0%) 70%);
  border-radius: 50%;
}

.dw-preset-ambient--glass > * {
  position: relative;
  z-index: 1;
}

.dw-preset-hero {
  position: relative;
  min-height: 130px;
  color: #fff;
  background: linear-gradient(135deg, var(--w-accent) 0%, color-mix(in srgb, var(--w-accent) 70%, black) 100%);
  border: 0;
}

.dw-preset-hero::before {
  content: "";
  position: absolute;
  top: -40px;
  right: -40px;
  width: 160px;
  height: 160px;
  pointer-events: none;
  background: rgb(255 255 255 / 8%);
  border-radius: 50%;
}

.dw-hero-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 18px 0;
}

.dw-hero-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: rgb(255 255 255 / 18%);
  border-radius: 8px;
}

.dw-hero-title,
.dw-hero-body {
  color: #fff;
}

.dw-hero-body {
  position: relative;
  padding: 12px 18px 18px;
  opacity: 0.92;
  font-size: 13px;
}

.dw-stack-fields {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.dw-field {
  display: grid;
  gap: 4px;
  min-width: 0;
  margin: 0;
}

.dw-field > span {
  color: var(--text-faint);
  font-size: 10.5px;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.dw-field input,
.dw-field textarea,
.dw-field select,
.dw-customize input {
  width: 100%;
  min-width: 0;
  padding: 7px 9px;
  color: var(--text);
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: 7px;
  outline: 0;
  font-size: 12.5px;
}

.dw-field textarea {
  min-height: 60px;
  resize: vertical;
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 12px;
}

.dw-field input:focus,
.dw-field textarea:focus,
.dw-field select:focus,
.dw-customize input:focus {
  border-color: var(--w-accent, var(--accent));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--w-accent, var(--accent)) 18%, transparent);
}

.dw-secondary-button {
  min-height: 28px;
  padding: 5px 9px;
  color: var(--text);
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: 7px;
  font-size: 12px;
  font-weight: 650;
}

.dw-kv {
  display: grid;
  grid-template-columns: minmax(0, 0.75fr) minmax(0, 1.25fr);
  gap: 8px;
}

.dw-kv > span:nth-child(odd),
.dw-kv-label {
  color: var(--text-faint);
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.dw-kv > span:nth-child(even),
.dw-kv > code,
.dw-kv-value {
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 12px;
}

.dw-kv-row {
  display: contents;
}

.dw-checklist {
  margin: 0;
  padding-left: 18px;
  color: var(--text-muted);
  font-size: 12.5px;
  line-height: 1.65;
}

.dw-content-rich {
  min-width: 0;
  color: var(--text-muted);
  font-size: 12.5px;
  line-height: 1.5;
}

.dw-content-rich > :first-child {
  margin-top: 0;
}

.dw-content-rich > :last-child {
  margin-bottom: 0;
}

.dw-content-rich h1,
.dw-content-rich h2,
.dw-content-rich h3,
.dw-content-rich h4,
.dw-content-rich h5,
.dw-content-rich h6,
.dw-content-rich p,
.dw-content-rich ul,
.dw-content-rich ol,
.dw-content-rich blockquote,
.dw-content-rich table {
  margin: 0 0 0.65em;
}

.dw-content-rich h1,
.dw-content-rich h2,
.dw-content-rich h3,
.dw-content-rich h4,
.dw-content-rich h5,
.dw-content-rich h6 {
  color: var(--text);
  font-weight: 750;
  line-height: 1.2;
}

.dw-content-rich h1 { font-size: 17px; }
.dw-content-rich h2 { font-size: 15px; }
.dw-content-rich h3,
.dw-content-rich h4,
.dw-content-rich h5,
.dw-content-rich h6 { font-size: 13px; }

.dw-content-rich ul,
.dw-content-rich ol {
  padding-left: 18px;
}

.dw-content-rich a {
  color: var(--accent);
  font-weight: 650;
}

.dw-content-rich :not(pre) > code {
  padding: 1px 4px;
  color: var(--text);
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: 5px;
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 0.92em;
}

.dw-content-rich pre {
  max-width: 100%;
  overflow: auto;
  padding: 8px;
  color: var(--text);
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.dw-content-rich img,
.dw-content-rich table {
  max-width: 100%;
}

.dw-empty,
.dw-muted {
  margin: 0;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.45;
}

.dw-muted a {
  color: var(--accent);
  font-weight: 650;
  text-decoration: none;
}

.dw-muted a:hover,
.dw-muted a:focus-visible {
  text-decoration: underline;
  outline: none;
}

.dw-warning-text {
  margin: 0;
  color: var(--amber);
  font-size: 12px;
  line-height: 1.45;
}

.dw-customize {
  position: fixed;
  z-index: 160;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow:
    0 16px 48px -12px rgb(0 0 0 / 28%),
    inset 0 0 0 1px rgb(255 255 255 / 5%);
  font-size: 12.5px;
  overflow: hidden;
}

.dw-customize-dismiss-layer {
  position: fixed;
  inset: 0;
  z-index: 159;
  background: transparent;
}

.dw-customize-tabs {
  display: flex;
  gap: 3px;
  padding: 3px;
  background: var(--surface-muted);
  border-radius: 8px;
}

.dw-customize-tabs button {
  flex: 1 1 0;
  min-width: 0;
  padding: 6px 8px;
  color: var(--text-muted);
  background: transparent;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  text-align: center;
}

.dw-customize-tabs button:hover {
  color: var(--text);
}

.dw-customize-tabs button.active {
  color: var(--text);
  background: var(--surface);
  box-shadow: var(--dashboard-shadow-card);
  font-weight: 600;
}

.dw-customize-pane {
  max-height: min(560px, 80vh);
  padding: 14px;
  overflow-y: auto;
}

.dw-customize-pane section + section {
  margin-top: 12px;
}

.dw-customize-pane h4 {
  margin: 0 0 10px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.dw-field-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.dw-field-row > span {
  flex: 1 1 auto;
}

.dw-preset-picker,
.dw-accent-picker,
.dw-icon-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.dw-icon-picker {
  max-height: 120px;
  overflow: auto;
}

.dw-preset-picker button,
.dw-icon-picker button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  padding: 4px 8px;
  color: var(--text-muted);
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: 5px;
  cursor: pointer;
  font-size: 11px;
}

.dw-icon-picker button {
  width: 28px;
  height: 28px;
  padding: 0;
}

.dw-preset-picker button.active,
.dw-icon-picker button.active {
  color: var(--accent);
  background: var(--accent-soft);
  border-color: var(--accent);
}

.dw-accent-picker {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
}

.dw-accent-picker button {
  width: 100%;
  aspect-ratio: 1;
  border: 2px solid transparent;
  border-radius: 6px;
  cursor: pointer;
}

.dw-accent-picker button.active {
  border-color: var(--text);
  box-shadow: inset 0 0 0 2px var(--surface);
}

.dw-source-view {
  max-height: 160px;
  margin: 0;
  padding: 8px;
  overflow: auto;
  color: var(--text);
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 11px;
}

.dw-catalog-backdrop {
  position: fixed;
  inset: 0;
  z-index: 150;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 24px;
  overflow: auto;
  background: color-mix(in srgb, var(--app-bg) 60%, transparent);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.dw-catalog {
  display: flex;
  flex-direction: column;
  width: min(940px, 100%);
  max-height: 82vh;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow:
    0 30px 80px -20px rgb(0 0 0 / 25%),
    inset 0 0 0 1px rgb(255 255 255 / 4%);
}

.dw-catalog header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 22px 12px;
  border-bottom: 1px solid var(--border);
}

.dw-catalog header h2 {
  flex: 1 1 auto;
  margin: 0;
  color: var(--text);
  font-size: 16px;
  font-weight: 650;
}

.dw-catalog header input {
  flex: 0 0 260px;
  min-width: 160px;
  padding: 7px 10px;
  color: var(--text);
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: 8px;
  outline: 0;
  font-size: 12.5px;
}

.dw-catalog header button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  color: var(--text-muted);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
}

.dw-catalog header button:hover {
  color: var(--text);
  background: var(--surface-muted);
  border-color: var(--border);
}

.dw-catalog-tabs {
  display: flex;
  gap: 2px;
  padding: 10px 22px;
  overflow-x: auto;
  border-bottom: 1px solid var(--border);
}

.dw-catalog-tabs button {
  flex: 0 0 auto;
  padding: 5px 10px;
  color: var(--text-muted);
  background: transparent;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12.5px;
}

.dw-catalog-tabs button.active {
  color: var(--accent);
  background: var(--accent-soft);
  font-weight: 650;
}

.dw-catalog-tabs button:hover:not(.active) {
  color: var(--text);
  background: var(--surface-muted);
}

.dw-catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
  padding: 18px 22px 22px;
  overflow: auto;
}

.dw-catalog-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 12px;
  height: 220px;
  overflow: hidden;
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  transition:
    transform 120ms ease,
    box-shadow 120ms ease,
    border-color 120ms ease;
}

.dw-catalog-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--dashboard-shadow-card);
  transform: translateY(-2px);
}

.dw-catalog-card h4 {
  margin: 0;
  color: var(--text);
  font-size: 13px;
  font-weight: 650;
}

.dw-catalog-card p {
  margin: 0;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.dw-catalog-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  margin-top: auto;
}

.dw-catalog-delete {
  position: absolute;
  bottom: 6px;
  right: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  color: var(--red);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  cursor: pointer;
  z-index: 1;
  transition:
    background 100ms ease,
    border-color 100ms ease;
}

.dw-catalog-delete:hover,
.dw-catalog-delete:focus-visible {
  background: color-mix(in srgb, var(--red) 12%, transparent);
  border-color: color-mix(in srgb, var(--red) 25%, transparent);
  outline: none;
}

.dw-catalog-tag {
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.dw-catalog-tag--builtIn {
  color: var(--accent);
  background: var(--accent-soft);
}

.dw-catalog-tag--custom {
  color: #7c3aed;
  background: rgba(124, 58, 237, 0.12);
}

.dw-badge {
  padding: 1px 5px;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 3px;
  font-size: 10px;
  font-weight: 700;
}

.dw-badge--ai {
  color: var(--amber);
  background: var(--amber-soft);
}

.dw-badge--check {
  color: var(--green);
  background: var(--green-soft);
}

.dw-catalog-thumb {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  height: 80px;
  background: var(--w-accent-soft, var(--surface-muted));
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--w-accent, var(--accent));
}

.app-launcher-widget {
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 10px;
  height: 100%;
  border-radius: 8px;
  transition:
    background-color 120ms ease,
    box-shadow 120ms ease;
}

.app-launcher-widget.is-drop-target {
  background: color-mix(in srgb, var(--w-accent-soft) 72%, transparent);
  box-shadow: inset 0 0 0 1px var(--w-accent);
}

.app-launcher-widget-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.app-launcher-view-mode {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px;
  pointer-events: none;
  opacity: 0;
  transform: translateY(-2px);
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: 7px;
  transition:
    opacity 120ms ease,
    transform 120ms ease;
}

.app-launcher-view-mode button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  color: var(--text-muted);
  background: transparent;
  border: 0;
  border-radius: 5px;
  cursor: pointer;
}

.app-launcher-view-mode button:hover,
.app-launcher-view-mode button:focus-visible {
  color: var(--text);
  background: var(--surface);
  outline: none;
}

.app-launcher-view-mode button.active {
  color: var(--w-accent);
  background: var(--surface);
  box-shadow: var(--dashboard-shadow-card);
}

.app-launcher-widget:hover .app-launcher-view-mode,
.app-launcher-widget:focus-within .app-launcher-view-mode,
.app-launcher-widget.is-adding .app-launcher-view-mode,
.app-launcher-widget.is-drop-target .app-launcher-view-mode {
  pointer-events: auto;
  opacity: 1;
  transform: translateY(0);
}

.app-launcher-widget .app-launcher-add {
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  pointer-events: none;
  opacity: 0;
  transform: translateY(-2px);
  transition:
    opacity 120ms ease,
    transform 120ms ease;
}

.app-launcher-widget:hover .app-launcher-add,
.app-launcher-widget:focus-within .app-launcher-add,
.app-launcher-widget.is-adding .app-launcher-add,
.app-launcher-widget.is-drop-target .app-launcher-add {
  pointer-events: auto;
  opacity: 1;
  transform: translateY(0);
}

.app-launcher-tile-grid {
  display: grid;
  align-content: start;
  align-items: start;
  grid-auto-rows: max-content;
  grid-template-columns: repeat(auto-fill, minmax(86px, 1fr));
  gap: 10px;
}

.app-launcher-tile-grid[data-view-mode="list"],
.app-launcher-tile-grid[data-view-mode="details"] {
  align-items: stretch;
  grid-template-columns: minmax(0, 1fr);
  gap: 5px;
}

.app-launcher-sort-header {
  display: grid;
  gap: 10px;
  padding: 0 10px 2px 48px;
  color: var(--text-faint);
  font-size: 10.5px;
  font-weight: 650;
}

.app-launcher-list-header {
  grid-template-columns: minmax(0, 1fr);
}

.app-launcher-details-header {
  grid-template-columns:
    minmax(96px, 1.1fr)
    minmax(72px, 0.7fr)
    minmax(58px, 0.45fr)
    minmax(88px, 0.75fr)
    minmax(0, 1.25fr);
}

.app-launcher-sort-header button {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 4px;
  min-width: 0;
  padding: 0;
  overflow: hidden;
  color: inherit;
  text-align: left;
  background: transparent;
  border: 0;
  cursor: pointer;
  font: inherit;
}

.app-launcher-sort-header button:hover,
.app-launcher-sort-header button:focus-visible,
.app-launcher-sort-header button.active {
  color: var(--text);
  outline: none;
}

.app-launcher-sort-header button span:first-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-launcher-sort-indicator {
  display: inline-flex;
  flex: 0 0 auto;
}

.app-launcher-tile {
  position: relative;
  --app-launcher-tile-scale: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-width: 0;
  padding: 0;
  color: var(--text);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: default;
  transition:
    border-color 120ms ease,
    box-shadow 120ms ease,
    opacity 120ms ease,
    transform 120ms ease;
}

.app-launcher-widget-list .app-launcher-tile,
.app-launcher-widget-details .app-launcher-tile {
  background: var(--surface);
  border-color: var(--border);
}

.app-launcher-widget.is-managing .app-launcher-tile {
  cursor: grab;
  animation: app-launcher-tile-wiggle 180ms ease-in-out infinite alternate;
}

.app-launcher-widget.is-managing .app-launcher-tile:nth-child(2n) {
  animation-direction: alternate-reverse;
}

.app-launcher-widget.is-managing .app-launcher-tile:active {
  cursor: grabbing;
}

.app-launcher-tile-launch {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 100%;
  height: 92px;
  min-width: 0;
  padding: 10px 6px;
  color: inherit;
  font: inherit;
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
}

.app-launcher-widget-list .app-launcher-tile-launch,
.app-launcher-widget-details .app-launcher-tile-launch {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  height: auto;
  padding: 7px 9px;
  text-align: left;
  background: transparent;
  border: 0;
}

.app-launcher-widget-details .app-launcher-tile-launch {
  grid-template-columns:
    30px
    minmax(96px, 1.1fr)
    minmax(72px, 0.7fr)
    minmax(58px, 0.45fr)
    minmax(88px, 0.75fr)
    minmax(0, 1.25fr);
  gap: 10px;
}

.app-launcher-widget-icons .app-launcher-tile:hover .app-launcher-tile-launch,
.app-launcher-widget-icons .app-launcher-tile:focus-within .app-launcher-tile-launch {
  border-color: var(--border-strong);
  box-shadow: var(--dashboard-shadow-card);
}

.app-launcher-widget-list .app-launcher-tile:hover,
.app-launcher-widget-list .app-launcher-tile:focus-within,
.app-launcher-widget-details .app-launcher-tile:hover,
.app-launcher-widget-details .app-launcher-tile:focus-within {
  border-color: var(--border-strong);
  box-shadow: var(--dashboard-shadow-card);
}

.app-launcher-widget.is-managing .app-launcher-tile-launch {
  cursor: grab;
}

.app-launcher-tile-remove {
  position: absolute;
  top: -7px;
  right: -7px;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  padding: 0;
  color: #fff;
  background: var(--red);
  border: 1px solid rgb(255 255 255 / 85%);
  border-radius: 999px;
  box-shadow: 0 4px 10px rgb(0 0 0 / 20%);
  cursor: pointer;
}

.app-launcher-tile-remove:hover,
.app-launcher-tile-remove:focus-visible {
  filter: brightness(1.04);
}

.app-launcher-tile.is-reordering {
  opacity: 0.55;
  --app-launcher-tile-scale: 0.98;
}

.app-launcher-tile.is-reorder-before,
.app-launcher-tile.is-reorder-after {
  border-color: var(--w-accent);
  box-shadow:
    inset 0 0 0 1px var(--w-accent),
    var(--dashboard-shadow-card);
}

.app-launcher-tile.is-reorder-before::before,
.app-launcher-tile.is-reorder-after::after {
  position: absolute;
  top: 8px;
  bottom: 8px;
  width: 3px;
  content: "";
  background: var(--w-accent);
  border-radius: 999px;
}

.app-launcher-tile.is-reorder-before::before {
  left: -6px;
}

.app-launcher-tile.is-reorder-after::after {
  right: -6px;
}

.app-launcher-widget-list .app-launcher-tile.is-reorder-before::before,
.app-launcher-widget-list .app-launcher-tile.is-reorder-after::after,
.app-launcher-widget-details .app-launcher-tile.is-reorder-before::before,
.app-launcher-widget-details .app-launcher-tile.is-reorder-after::after {
  right: 8px;
  left: 8px;
  width: auto;
  height: 3px;
}

.app-launcher-widget-list .app-launcher-tile.is-reorder-before::before,
.app-launcher-widget-details .app-launcher-tile.is-reorder-before::before {
  top: -5px;
  bottom: auto;
}

.app-launcher-widget-list .app-launcher-tile.is-reorder-after::after,
.app-launcher-widget-details .app-launcher-tile.is-reorder-after::after {
  top: auto;
  bottom: -5px;
}

@keyframes app-launcher-tile-wiggle {
  from {
    transform: rotate(-1deg) scale(var(--app-launcher-tile-scale));
  }

  to {
    transform: rotate(1deg) scale(var(--app-launcher-tile-scale));
  }
}

@media (prefers-reduced-motion: reduce) {
  .app-launcher-widget.is-managing .app-launcher-tile {
    animation: none;
  }
}

.app-launcher-tile-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  color: var(--w-accent);
  background: var(--w-accent-soft);
  border-radius: 8px;
  box-shadow: inset 0 0 0 1px rgb(0 0 0 / 4%);
}

.app-launcher-widget-list .app-launcher-tile-icon,
.app-launcher-widget-details .app-launcher-tile-icon {
  width: 30px;
  height: 30px;
  border-radius: 6px;
}

.app-launcher-tile-icon img {
  max-width: 30px;
  max-height: 30px;
}

.app-launcher-widget-list .app-launcher-tile-icon img,
.app-launcher-widget-details .app-launcher-tile-icon img {
  max-width: 22px;
  max-height: 22px;
}

.app-launcher-tile-label {
  max-width: 100%;
  color: var(--text);
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  font-size: 10.5px;
  font-weight: 700;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.app-launcher-widget-list .app-launcher-tile-label,
.app-launcher-widget-details .app-launcher-tile-label {
  justify-self: start;
}

.app-launcher-tile-type,
.app-launcher-tile-size,
.app-launcher-tile-modified,
.app-launcher-tile-path {
  min-width: 0;
  overflow: hidden;
  color: var(--text-faint);
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 10.5px;
  line-height: 1.2;
}

.app-launcher-tile-size {
  justify-self: end;
}

.app-launcher-widget-empty {
  display: grid;
  justify-items: center;
  gap: 6px;
  padding: 18px 14px;
  color: var(--text-muted);
  text-align: center;
  background: var(--surface-muted);
  border: 1px dashed var(--border-strong);
  border-radius: 8px;
}

.app-launcher-widget-empty h4,
.app-launcher-widget-empty p {
  margin: 0;
}

.app-launcher-widget-empty h4 {
  color: var(--text);
  font-size: 13px;
}

.app-launcher-widget-empty p {
  max-width: 28rem;
  font-size: 12px;
  line-height: 1.45;
}

.dashboard-widget-icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 31px;
  padding: 7px 10px;
  color: var(--text);
  white-space: nowrap;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 7px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 650;
}

.dashboard-widget-icon-button:hover,
.dashboard-widget-icon-button:focus-visible {
  border-color: var(--border-strong);
  box-shadow: var(--dashboard-shadow-card);
  outline: none;
}

.dashboard-widget-icon-button.compact {
  min-height: 26px;
  padding: 5px 8px;
  color: var(--text-muted);
  font-size: 11.5px;
}

.dashboard-widget-empty-state {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 6px;
  min-height: 150px;
  padding: 18px 14px;
  color: var(--text-muted);
  text-align: center;
  background: var(--surface-muted);
  border: 1px dashed var(--border-strong);
  border-radius: 8px;
}

.dashboard-widget-empty-state h4,
.dashboard-widget-empty-state p,
.dashboard-widget-error {
  margin: 0;
}

.dashboard-widget-empty-state h4 {
  color: var(--text);
  font-size: 13px;
}

.dashboard-widget-empty-state p,
.dashboard-widget-error {
  font-size: 12px;
  line-height: 1.45;
}

.dashboard-widget-error {
  padding: 8px 10px;
  color: var(--red);
  background: var(--surface-muted);
  border: 1px solid color-mix(in srgb, var(--red) 35%, transparent);
  border-radius: 7px;
}

.dashboard-connection-widget {
  position: relative;
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  height: 100%;
  min-height: 0;
}

.dashboard-connection-widget-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
}

.dashboard-connection-add {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 18px;
  color: var(--text-muted);
  background: var(--surface-muted);
  border: 1px dashed var(--border);
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
}

.dashboard-connection-add:hover {
  color: var(--text);
  background: var(--surface);
  border-color: var(--w-accent);
}

.dashboard-connection-launcher {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--nav-toolbar-bg);
  border: 1px solid var(--terminal-border);
  border-radius: 9px;
}

.dashboard-connection-launcher-search {
  display: flex;
  align-items: center;
  gap: 7px;
  flex: 0 0 auto;
  padding: 6px 8px;
  color: color-mix(in srgb, var(--nav-toolbar-text) 50%, transparent);
  border-bottom: 1px solid var(--terminal-border);
}

.dashboard-connection-launcher-search input {
  flex: 1 1 0;
  min-width: 0;
  padding: 0;
  color: var(--nav-toolbar-text);
  background: transparent;
  border: none;
  outline: none;
  font-size: 13px;
}

.dashboard-connection-launcher-search input::placeholder {
  color: color-mix(in srgb, var(--nav-toolbar-text) 40%, transparent);
}

.dashboard-connection-launcher-list {
  flex: 1 1 0;
  overflow-y: auto;
  padding: 4px;
}

.dashboard-connection-launcher-list button {
  display: flex;
  align-items: center;
  gap: 7px;
  width: 100%;
  padding: 6px 9px;
  color: var(--nav-toolbar-text);
  background: transparent;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12.5px;
  text-align: left;
}

.dashboard-connection-launcher-list button:hover {
  background: color-mix(in srgb, var(--nav-toolbar-text) 10%, transparent);
}

.dashboard-connection-launcher-list button.active {
  background: color-mix(in srgb, var(--w-accent, var(--accent)) 12%, transparent);
}

.dashboard-connection-launcher-name {
  flex: 1 1 0;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-connection-launcher-sub {
  flex: 1 1 0;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-faint);
  font-size: 11.5px;
}

.dashboard-connection-launcher-empty {
  margin: 12px;
  color: color-mix(in srgb, var(--nav-toolbar-text) 50%, transparent);
  font-size: 12px;
}

.dashboard-url-widget {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 10px;
  height: 100%;
  min-height: 0;
}

.dashboard-url-controls {
  display: flex;
  align-items: end;
  gap: 8px;
  min-width: 0;
}

.dashboard-url-field {
  flex: 1 1 220px;
}

.dashboard-connection-tab-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  color: color-mix(in srgb, var(--nav-toolbar-text) 45%, transparent);
  border-radius: 5px;
}

.dashboard-connection-tab-remove:hover,
.dashboard-connection-tab-remove:focus-visible {
  color: var(--red);
  background: color-mix(in srgb, var(--red) 10%, transparent);
  outline: none;
}

.dashboard-connection-pane {
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  min-height: 0;
  overflow: hidden;
  background: var(--terminal);
  border: 1px solid var(--terminal-border);
  border-radius: 9px;
}

.dashboard-connection-pane-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  min-height: 32px;
  padding: 4px 6px;
  color: var(--text-muted);
  background: var(--nav-toolbar-bg);
  border-bottom: 1px solid var(--terminal-border);
  font-size: 11.5px;
}

.dashboard-connection-pane-name {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 5px;
  max-width: 160px;
  padding: 2px 7px;
  color: var(--text);
  background: transparent;
  border: 1px solid color-mix(in srgb, var(--terminal-border) 70%, transparent);
  border-radius: 5px;
  cursor: pointer;
  font-size: 11.5px;
}

.dashboard-connection-pane-name:hover {
  background: color-mix(in srgb, var(--text) 7%, transparent);
}

.dashboard-connection-pane-name > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-connection-pane-toolbar > span {
  flex: 1 1 0;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-connection-pane .terminal-workspace,
.dashboard-connection-pane .webview-workspace,
.dashboard-connection-pane .remote-desktop-workspace {
  position: relative;
  display: flex;
  width: 100%;
  height: 100%;
  min-height: 0;
}

.dashboard-connection-pane .terminal-workspace {
  grid-row: auto;
}

.dashboard-connection-pane .terminal-pane {
  border: 0;
  border-radius: 0;
}

.dashboard-connection-pane .terminal-pane-close {
  display: none;
}

.dashboard-url-controls {
  flex-wrap: wrap;
}

.dashboard-url-controls .dw-field {
  min-width: 92px;
}

.dashboard-url-controls .dw-field:not(.dashboard-url-field) {
  flex: 0 0 112px;
}

.dashboard-url-webview-shell {
  position: relative;
  display: flex;
  min-height: 180px;
  min-width: 0;
  overflow: hidden;
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.dashboard-url-webview-shell .webview-workspace {
  position: relative;
  display: flex;
  width: 100%;
  height: 100%;
  min-height: 0;
  padding: 0;
}

.dashboard-url-webview-shell .terminal-pane {
  border: 0;
  border-radius: 0;
}

[data-color-scheme="dark"] .dw-preset-ambient--glass,
[data-color-scheme="purple"] .dw-preset-ambient--glass,
[data-color-scheme="blue-see"] .dw-preset-ambient--glass {
  background:
    linear-gradient(180deg, rgb(255 255 255 / 12%) 0%, rgb(255 255 255 / 4%) 40%, rgb(255 255 255 / 2%) 100%),
    radial-gradient(120% 80% at 0% 0%, color-mix(in srgb, var(--w-accent) 32%, transparent) 0%, transparent 60%),
    radial-gradient(120% 90% at 100% 100%, color-mix(in srgb, var(--w-accent) 22%, transparent) 0%, transparent 65%),
    rgb(20 24 36 / 45%);
  border-color: rgb(255 255 255 / 18%);
}

  @media (prefers-color-scheme: dark) {
  .dw-preset-ambient--glass {
    background:
      linear-gradient(180deg, rgb(255 255 255 / 12%) 0%, rgb(255 255 255 / 4%) 40%, rgb(255 255 255 / 2%) 100%),
      radial-gradient(120% 80% at 0% 0%, color-mix(in srgb, var(--w-accent) 32%, transparent) 0%, transparent 60%),
      radial-gradient(120% 90% at 100% 100%, color-mix(in srgb, var(--w-accent) 22%, transparent) 0%, transparent 65%),
      rgb(20 24 36 / 45%);
    border-color: rgb(255 255 255 / 18%);
  }
}

.dw-bg-popover {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 200;
  width: 320px;
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--dashboard-radius-lg);
  box-shadow: var(--dashboard-shadow-ambient);
  display: flex;
  flex-direction: column;
  gap: 12px;
  font-size: 13px;
  color: var(--text);
}

.dw-bg-popover-head {
  font-weight: 650;
}

.dw-bg-seg {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  padding: 3px;
  background: var(--surface-muted);
  border-radius: 8px;
}

.dw-bg-seg button {
  flex: 1 1 calc(50% - 3px);
  padding: 5px 4px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text-muted, var(--text));
  font-size: 12px;
  cursor: pointer;
}

.dw-bg-seg button.active {
  background: var(--surface);
  box-shadow: var(--dashboard-shadow-card);
  font-weight: 600;
}

.dw-bg-preset-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.dw-bg-preset-grid button {
  aspect-ratio: 1.4;
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
}

.dw-bg-preset-grid button.active {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.dw-bg-dynamic {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.dw-bg-dynamic-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.dw-bg-dynamic-grid button {
  min-width: 0;
  min-height: 30px;
  padding: 6px 8px;
  overflow: hidden;
  color: var(--text-muted);
  text-overflow: ellipsis;
  white-space: nowrap;
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
}

.dw-bg-dynamic-grid button:hover {
  color: var(--text);
  border-color: var(--border-strong);
}

.dw-bg-dynamic-grid button.active {
  color: var(--accent);
  background: var(--accent-soft);
  border-color: var(--accent);
  font-weight: 650;
}

.dw-bg-image {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.dw-bg-image-actions {
  display: flex;
  gap: 8px;
}

.dw-bg-popover input[type="range"] {
  width: 100%;
  margin: 0;
  accent-color: var(--accent);
}

/* Notes widget: post-it style paper note. The Ambient preset hosts this with a
   transparent frame, so the .dw-notes element paints the entire visible note. */
.dw-notes {
  --note-paper: #fff59d;
  --note-paper-edge: #f4dc66;
  --note-ink: #2a2620;
  --note-font: "Segoe Script", "Bradley Hand", "Comic Sans MS", "Apple Chancery", cursive;
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  min-height: 0;
  padding: 14px 14px 10px;
  background:
    linear-gradient(160deg, rgb(255 255 255 / 18%) 0%, rgb(0 0 0 / 0%) 35%) var(--note-paper);
  color: var(--note-ink);
  border-radius: 2px 14px 2px 2px;
  box-shadow:
    0 1px 1px rgb(0 0 0 / 10%),
    0 8px 18px -6px rgb(0 0 0 / 22%),
    inset 0 0 0 1px rgb(0 0 0 / 4%);
  transform: rotate(-0.6deg);
  transform-origin: 50% 0;
  overflow: hidden;
  font-family: var(--note-font);
}

.dw-notes::before {
  /* Folded corner */
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 22px;
  height: 22px;
  background: linear-gradient(225deg, rgb(0 0 0 / 12%) 0%, rgb(0 0 0 / 0%) 55%),
    linear-gradient(225deg, transparent 50%, var(--note-paper-edge) 50%);
  pointer-events: none;
}

.dw-notes-text {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  background: transparent;
  border: 0;
  outline: none;
  resize: none;
  color: inherit;
  font: inherit;
  font-size: 18px;
  line-height: 1.45;
  padding: 0;
  letter-spacing: 0.1px;
}

.dw-notes-text::placeholder {
  color: rgb(0 0 0 / 35%);
  font-style: italic;
}

.dw-notes-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px dashed rgb(0 0 0 / 12%);
  opacity: 0;
  transition: opacity 120ms ease;
}

.dw-notes:hover .dw-notes-toolbar,
.dw-notes:focus-within .dw-notes-toolbar {
  opacity: 1;
}

.dw-notes-colors {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}

.dw-notes-swatch {
  width: 14px;
  height: 14px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid rgb(0 0 0 / 18%);
  background: var(--swatch);
  cursor: pointer;
  transition: transform 100ms ease, box-shadow 100ms ease;
}

.dw-notes-swatch:hover {
  transform: scale(1.15);
}

.dw-notes-swatch.is-active {
  box-shadow: 0 0 0 2px rgb(0 0 0 / 55%);
}

.dw-notes-swatch--yellow { --swatch: #fff59d; }
.dw-notes-swatch--pink   { --swatch: #f8bbd0; }
.dw-notes-swatch--blue   { --swatch: #bbdefb; }
.dw-notes-swatch--green  { --swatch: #c8e6c9; }
.dw-notes-swatch--orange { --swatch: #ffcc80; }
.dw-notes-swatch--purple { --swatch: #e1bee7; }
.dw-notes-swatch--white  { --swatch: #fafafa; }

.dw-notes-font-select {
  font-family: var(--font, system-ui);
  font-size: 11px;
  padding: 2px 4px;
  background: rgb(255 255 255 / 55%);
  color: var(--note-ink);
  border: 1px solid rgb(0 0 0 / 15%);
  border-radius: 3px;
  max-width: 110px;
}

/* Color modifiers — paper color and matching folded-edge tint. */
.dw-notes--color-yellow { --note-paper: #fff59d; --note-paper-edge: #f4dc66; }
.dw-notes--color-pink   { --note-paper: #f8bbd0; --note-paper-edge: #ec9bb8; }
.dw-notes--color-blue   { --note-paper: #bbdefb; --note-paper-edge: #8fc1ee; }
.dw-notes--color-green  { --note-paper: #c8e6c9; --note-paper-edge: #9fcfa3; }
.dw-notes--color-orange { --note-paper: #ffcc80; --note-paper-edge: #f0ad55; }
.dw-notes--color-purple { --note-paper: #e1bee7; --note-paper-edge: #c294cd; }
.dw-notes--color-white  { --note-paper: #fafafa; --note-paper-edge: #d8d8d8; }

/* Font modifiers — only --note-font, so .dw-notes and .dw-notes-text inherit. */
.dw-notes--font-handwriting {
  --note-font: "Segoe Script", "Bradley Hand", "Comic Sans MS", "Apple Chancery", cursive;
}
.dw-notes--font-marker {
  --note-font: "Permanent Marker", "Segoe Print", "Marker Felt", "Comic Sans MS", cursive;
}
.dw-notes--font-system {
  --note-font: var(--font, system-ui, -apple-system, "Segoe UI", sans-serif);
}
.dw-notes--font-serif {
  --note-font: Georgia, "Times New Roman", serif;
}
.dw-notes--font-mono {
  --note-font: Consolas, "Courier New", monospace;
}

