/* Project collection and creation dialog. */
.wp-dialog {
  --wp-ink: var(--ui-ink);
  --wp-muted: var(--ui-muted);
  --wp-line: var(--ui-line);
  --wp-tint: var(--ui-tint);
  --wp-accent: var(--ui-accent);
  color-scheme: light;
  width: min(620px, calc(100vw - 28px));
  max-height: min(84dvh, 760px);
  margin: auto;
  padding: 0;
  overflow: hidden;
  border: 1px solid #adc1d0;
  border-radius: 16px;
  background: #fbfdfc;
  color: var(--wp-ink);
  box-shadow: 0 24px 90px #061d2d55;
  font:
    14px/1.45 Inter,
    "Segoe UI",
    Arial,
    sans-serif;
  text-align: left;
}
.wp-dialog::backdrop {
  background: #071e2bb0;
  backdrop-filter: blur(3px);
}
.wp-dialog .wp-wrap {
  max-height: inherit;
  display: flex;
  flex-direction: column;
}
.wp-top {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 22px 24px 18px;
  background: #fff;
}
.wp-dialog svg {
  width: 17px;
  height: 17px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.65;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.wp-brand-icon,
.wp-file-icon {
  display: grid;
  flex: none;
  place-items: center;
  color: var(--wp-accent);
  background: var(--wp-tint);
  border-radius: 10px;
}
.wp-brand-icon {
  width: 40px;
  height: 40px;
  border: 1px solid var(--ui-line);
}
.wp-brand-icon svg {
  width: 22px;
  height: 22px;
}
.wp-heading {
  flex: auto;
}
.wp-dialog .wp-heading h2,
.wp-dialog .wp-body h3 {
  color: var(--wp-ink);
  margin: 0;
  letter-spacing: -0.035em;
  font:
    700 22px/1.2 Inter,
    "Segoe UI",
    Arial,
    sans-serif;
}
.wp-dialog .wp-heading p {
  color: var(--wp-muted);
  margin: 3px 0 0;
  font-size: 13px;
}
.wp-dialog .wp-button,
.wp-dialog .wp-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  box-sizing: border-box;
  min-height: 34px;
  padding: 6px 10px;
  border: 1px solid var(--wp-line);
  border-radius: 7px;
  background: #fff;
  color: var(--wp-ink);
  font:
    600 12px/1.3 Inter,
    "Segoe UI",
    Arial,
    sans-serif;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: none;
}
.wp-dialog .wp-button:hover,
.wp-dialog .wp-icon:hover {
  background: var(--ui-wash);
  border-color: #9fb6c8;
  color: var(--ui-navy);
}
.wp-dialog .wp-icon {
  width: 32px;
  min-height: 32px;
  padding: 0;
  color: var(--wp-muted);
  border-color: transparent;
}
.wp-dialog :is(button, summary, input, select):focus-visible {
  outline: 3px solid #5c87a6;
  outline-offset: 2px;
}
.wp-dialog .wp-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 22px;
  border-block: 1px solid var(--wp-line);
  background: #fff;
}
.wp-dialog .wp-tab {
  background: none;
  color: var(--wp-muted);
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  padding: 11px 9px;
  min-height: 42px;
}
.wp-dialog .wp-tab[aria-current] {
  color: var(--wp-accent);
  border-bottom-color: var(--wp-accent);
}
.wp-dialog .wp-import {
  margin-left: auto;
  min-height: 28px;
  font-size: 11px;
}
.wp-body {
  overflow: auto;
  overscroll-behavior: contain;
  padding: 17px 22px 20px;
  min-height: 100px;
  scrollbar-width: thin;
}
.wp-dialog .wp-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--wp-ink);
  font-size: 12px;
  font-weight: 650;
}
.wp-dialog :is(.wp-field, .wp-filter) :is(input, select) {
  width: 100%;
  height: 38px;
  box-sizing: border-box;
  min-width: 0;
  border: 1px solid var(--wp-line);
  border-radius: 7px;
  background: #fff;
  padding: 7px 10px;
  color: var(--wp-ink);
  font:
    400 13px/1.35 Inter,
    "Segoe UI",
    Arial,
    sans-serif;
}
.wp-dialog select {
  appearance: auto;
}
.wp-filter {
  position: relative;
  display: block;
  margin: 0 0 12px;
}
.wp-filter > svg {
  position: absolute;
  top: 11px;
  left: 10px;
  color: #70848a;
}
.wp-dialog .wp-filter input {
  padding-left: 34px;
}
.wp-rows {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.wp-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  background: #fff;
  border: 1px solid var(--wp-line);
  border-radius: 9px;
}
.wp-row:has(details[open]) {
  flex-wrap: wrap;
}
.wp-file-icon {
  height: 33px;
  width: 30px;
  color: #526c72;
  background: #edf2f3;
}
.wp-project-info {
  flex: 1;
  min-width: 0;
}
.wp-project-heading {
  display: flex;
  gap: 7px;
  align-items: center;
  flex-wrap: wrap;
}
.wp-project-heading strong,
.wp-dialog .wp-body .wp-preview strong {
  color: var(--wp-ink);
  font:
    650 14px/1.3 Inter,
    "Segoe UI",
    Arial,
    sans-serif;
  overflow-wrap: anywhere;
}
.wp-current {
  color: #08624f;
  font-size: 10px;
  padding: 1px 5px;
  background: #def4e8;
  border-radius: 4px;
  font-weight: 650;
}
.wp-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  color: var(--wp-muted);
  font-size: 11px;
  margin-top: 3px;
}
.wp-dates {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 14px;
  margin-top: 4px;
  font-size: 11px;
  color: var(--wp-muted);
  font-variant-numeric: tabular-nums;
}
.wp-lang {
  font:
    600 10px/1.4 ui-monospace,
    monospace;
  color: #476169;
}
.wp-field[hidden] { display:none; }
.wp-dialog .wp-open {
  color: var(--wp-accent);
  font-size: 11px;
  flex-direction: row-reverse;
  min-height: 29px;
  padding: 4px 8px;
}
.wp-options {
  position: relative;
}
.wp-options summary {
  list-style: none;
}
.wp-options summary::-webkit-details-marker {
  display: none;
}
.wp-options[open] {
  width: 100%;
  margin-top: 3px;
}
.wp-options[open] summary {
  display: none;
}
.wp-menu {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  padding-top: 7px;
  border-top: 1px solid var(--wp-line);
}
.wp-dialog .wp-menu button {
  font-size: 11px;
  min-height: 30px;
  border-color: transparent;
  padding: 4px 7px;
}
.wp-dialog .wp-menu .wp-danger {
  color: #933a34;
}
.wp-empty,
.wp-description {
  color: var(--wp-muted);
  margin: 10px 0;
}
.wp-form {
  display: grid;
  gap: 15px;
}
.wp-grid {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 12px;
}
.wp-preview {
  display: grid;
  grid-template-columns: minmax(0, 29%) minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  background: var(--ui-wash);
  border: 1px solid var(--ui-line);
  border-radius: 9px;
  padding: 10px;
}
.wp-model-cover {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1.85;
  object-fit: cover;
  border-radius: 5px;
}
@media (max-width: 500px) {
  .wp-preview { grid-template-columns: 1fr; }
  .wp-model-cover { aspect-ratio: 4.2; }
}
.wp-dialog .wp-preview p {
  font-size: 12px;
  color: var(--ui-muted);
  margin: 3px 0;
  line-height: 1.5;
}
.wp-model-files {
  font:
    500 11px/1.5 ui-monospace,
    monospace;
  color: var(--ui-accent);
  overflow-wrap: anywhere;
}
.wp-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 4px;
}
.wp-dialog .wp-primary,
.wp-dialog .wp-primary:hover {
  background: var(--ui-navy);
  color: #fff;
  border-color: var(--ui-navy);
}
.wp-dialog .wp-negative,
.wp-dialog .wp-negative:hover {
  background: #a63f3c;
  color: #fff;
  border-color: #a63f3c;
}
.wp-dialog .wp-back {
  color: var(--wp-muted);
  border: 0;
  background: transparent;
  padding-left: 0;
}
.wp-dialog .wp-body h3 {
  font-size: 18px;
  margin: 8px 0 15px;
}
.wp-msg {
  color: #8d3b2c;
  font-size: 12px;
  padding: 0 22px 12px;
}
.wp-msg:empty {
  display: none;
}
@media (max-width: 520px) {
  .wp-dialog {
    max-height: 91dvh;
  }
  .wp-top {
    padding: 15px 14px;
  }
  .wp-dialog .wp-tabs {
    padding: 0 8px;
    gap: 1px;
  }
  .wp-dialog .wp-tab {
    font-size: 11px;
    padding-inline: 6px;
  }
  .wp-dialog .wp-import {
    font-size: 10px;
    padding: 3px 5px;
  }
  .wp-body {
    padding: 12px;
  }
  .wp-grid {
    grid-template-columns: 1fr;
  }
  .wp-row {
    padding: 9px;
    gap: 6px;
  }
  .wp-file-icon {
    display: none;
  }
  .wp-meta {
    font-size: 10px;
    gap: 5px;
  }
}
/* Inline project explorer in the editor navigation. */
body:not(:has(main[data-view="bench"])) #projectExplorer {
  display: none;
}
#projectExplorer {
  min-width: 0;
  margin: 4px 0 10px;
  border: 1px solid var(--ui-line);
  border-radius: 8px;
  background: #fcfdff;
  color: var(--ui-ink);
  font: 13px/1.45 "DM Sans", "Segoe UI", Arial, sans-serif;
  text-align: left;
}
#projectExplorer:empty,
#projectExplorer .tree-body[hidden] {
  display: none;
}
#projectExplorer * {
  box-sizing: border-box;
}
#projectExplorer svg {
  display: block;
  flex: none;
  width: 16px;
  height: 16px;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linejoin: round;
  stroke-linecap: round;
  fill: none;
}
#projectExplorer button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 0;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: inherit;
  font: inherit;
  letter-spacing: normal;
  box-shadow: none;
  cursor: pointer;
  text-align: left;
}
#projectExplorer button:enabled:hover {
  background: var(--ui-tint);
  color: var(--ui-navy);
}
#projectExplorer button:focus-visible,
#projectExplorer input:focus-visible {
  outline: 2px solid var(--ui-accent);
  outline-offset: -2px;
}
#projectExplorer .tree-header {
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 4px 6px;
  background: var(--ui-wash);
  border-radius: 7px;
}
#projectExplorer .tree-title {
  flex: 1;
  justify-content: flex-start;
  min-height: 32px;
  gap: 7px;
  padding: 4px;
  color: var(--ui-navy);
  font-size: 14px;
  font-weight: 680;
  line-height: 1.25;
}
#projectExplorer .tree-title svg,
#projectExplorer .tree-toggle svg {
  width: 13px;
  height: 13px;
}
#projectExplorer .tree-title[aria-expanded="false"] svg {
  transform: rotate(-90deg);
}
#projectExplorer .tree-action,
#projectExplorer .tree-toggle {
  flex: none;
  width: 30px;
  height: 30px;
  color: var(--ui-muted);
}
#projectExplorer .tree-filter {
  position: relative;
  display: block;
  margin: 8px 7px 5px;
}
#projectExplorer .tree-filter svg {
  position: absolute;
  top: 50%;
  left: 8px;
  width: 15px;
  height: 15px;
  transform: translateY(-50%);
  color: var(--ui-muted);
  pointer-events: none;
}
#projectExplorer .tree-filter input {
  display: block;
  width: 100%;
  height: 33px;
  min-height: 0;
  margin: 0;
  padding: 4px 7px 4px 29px;
  border: 1px solid var(--ui-line);
  border-radius: 5px;
  background: #fff;
  color: var(--ui-ink);
  font: inherit;
}
#projectExplorer ul {
  display: block;
  padding: 0;
  margin: 0;
  list-style: none;
}
#projectExplorer .tree-list {
  overflow: auto;
  max-height: clamp(210px, 50vh, 680px);
  padding: 2px 4px 5px;
  scrollbar-width: thin;
  scrollbar-color: #94aabd transparent;
  scrollbar-gutter: stable;
}
#projectExplorer li {
  display: block;
  margin: 0;
  padding: 0;
}
#projectExplorer li > ul {
  padding-left: 4px;
  margin-left: 9px;
  border-left: 1px solid var(--ui-line);
}
/* Keep deeply nested paths readable even with a narrow navigation panel. */
#projectExplorer .tree-list ul ul ul li > ul {
  padding-left: 0;
  margin-left: 0;
  border-left: 0;
}
#projectExplorer .tree-row {
  display: flex;
  align-items: center;
  min-height: 33px;
  gap: 1px;
  border-radius: 4px;
}
#projectExplorer .tree-row:hover:not(.is-selected),
#projectExplorer .tree-row:focus-within:not(.is-selected) {
  background: var(--ui-wash);
}
#projectExplorer .tree-row .tree-toggle {
  width: 24px;
}
#projectExplorer .tree-toggle[aria-expanded="true"] svg {
  transform: rotate(90deg);
}
#projectExplorer .tree-label {
  flex: 1;
  justify-content: flex-start;
  align-self: stretch;
  padding: 4px 3px;
  gap: 7px;
  color: var(--ui-ink);
  font-weight: 550;
  line-height: 1.4;
}
#projectExplorer .tree-text {
  min-width: 0;
  overflow-wrap: anywhere;
  white-space: normal;
}
#projectExplorer .tree-row[data-kind="project"] .tree-label {
  font-size: 14px;
  font-weight: 620;
}
#projectExplorer .tree-project-active > .tree-label {
  color: var(--ui-navy);
}
#projectExplorer .tree-row[data-kind="folder"] .tree-label svg {
  color: #8b6a29;
}
#projectExplorer .tree-row > .tree-action {
  width: 25px;
}
#projectExplorer .tree-file {
  padding-left: 16px;
}
#projectExplorer .tree-file .tree-label {
  color: var(--ui-ink);
  font: 400 13px/1.45 var(--mono, ui-monospace, monospace);
}
#projectExplorer .tree-file[data-kind="code"] svg {
  color: #366b8a;
}
#projectExplorer .tree-file[data-kind="header"] svg {
  color: #806291;
}
#projectExplorer .tree-file.is-selected {
  background: var(--ui-tint);
  box-shadow: inset 3px 0 var(--ui-accent);
}
#projectExplorer .tree-file.is-selected .tree-label {
  color: var(--ui-navy);
  font-weight: 650;
}
#projectExplorer .tree-entry {
  flex: none;
  padding-right: 5px;
  color: var(--ui-muted);
  font-size: 10.5px;
}
#projectExplorer .tree-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  padding: 4px 6px;
  border-top: 1px solid var(--ui-line);
}
#projectExplorer .tree-tools button:disabled {
  opacity: 0.4;
  cursor: default;
}
#projectExplorer .tree-empty {
  padding: 10px;
  color: var(--ui-muted);
}
@media (max-width: 760px) {
  #projectExplorer .tree-list {
    max-height: clamp(170px, 46dvh, 450px);
  }
}
@media (pointer: coarse) {
  #projectExplorer .tree-row,
  #projectExplorer .tree-title {
    min-height: 40px;
  }
  #projectExplorer .tree-action,
  #projectExplorer .tree-toggle {
    min-height: 36px;
    min-width: 32px;
  }
}

.wp-system-note { margin: -4px 0 2px; color: var(--wp-muted); font-size: .82rem; line-height: 1.45; }
