.wb-project-settings .wb-settings-group {
  margin: 18px 12px 6px;
  color: var(--wl-text-3);
  font-size: var(--t-help);
  font-weight: 600;
}
.wb-project-settings .wb-settings-group:first-child { margin-top: 6px; }
.wb-project-settings .vertical-tab-header-group.wb-empty-group { display: none; }
/* A section's heading, in the inherited shell's box or the own window's. */
:is(.wb-settings-content, .wl-settings-section) > h2 { margin: 0 0 6px; padding: 0; }
.wb-settings-description { color: var(--wl-text-2); margin: 0 0 24px; }

/* Project settings: simplified visibility, cloning, platform tags/genres/rating, and local folder. */
.wb-ps {
  width: min(760px, 100%);
  margin-inline: auto;
  padding: 40px 44px 70px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
body.wb-shell .wb-ps :is(button, select, input, [tabindex]):focus-visible {
  outline: 2px solid var(--wl-selection);
  outline-offset: 2px;
  box-shadow: none;
}
.wb-ps > h2 { margin: 0; padding: 0; }
.wb-ps > .wb-settings-description { margin: -12px 0 6px; max-width: 620px; font-size: 14px; }

.wb-ps-section { display: flex; flex-direction: column; gap: 10px; }
.wb-ps-label { font-size: 14px; font-weight: 600; color: var(--wl-text); }

/* Visibility select with leading status icon */
.wb-ps-select-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.wb-ps-select-icon,
.wb-ps-select-caret {
  position: absolute;
  display: inline-grid;
  place-items: center;
  pointer-events: none;
  color: var(--wl-text-2);
}
.wb-ps-select-icon { left: 13px; }
.wb-ps-select-caret { right: 13px; color: var(--wl-text-3); }
.wb-ps-select-icon svg,
.wb-ps-select-caret svg { width: 16px; height: 16px; }
.wb-ps-select {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  height: 44px;
  padding: 0 38px 0 40px;
  border: 1px solid var(--wl-line-strong);
  border-radius: var(--r-md);
  background: var(--wl-surface);
  color: var(--wl-text);
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color var(--wl-quick) var(--wl-ease), background var(--wl-quick) var(--wl-ease);
}
.wb-ps-select:hover:not(:disabled) {
  background: var(--wl-raised);
  border-color: color-mix(in srgb, var(--wl-line-strong) 55%, var(--wl-text-3));
}
.wb-ps-select:disabled { opacity: 0.6; cursor: wait; }
.wb-ps-help {
  margin: 0;
  color: var(--wl-text-2);
  font-size: 13px;
  line-height: 1.5;
}
body.wb-shell .wb-ps-policy-link {
  display: inline;
  height: auto;
  padding: 0;
  border: 0;
  background: none;
  box-shadow: none;
  color: var(--wl-text);
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
body.wb-shell .wb-ps-policy-link:hover { color: var(--wl-selection); }

/* Live published status strip */
.wb-ps-live-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 2px;
  padding: 10px 14px;
  border: 1px solid color-mix(in srgb, var(--wl-success) 30%, var(--wl-line));
  border-radius: var(--r-md);
  background: color-mix(in srgb, var(--wl-success) 7%, var(--wl-surface));
}
.wb-ps-live-bar.has-update {
  border-color: color-mix(in srgb, var(--wl-warning) 35%, var(--wl-line));
  background: color-mix(in srgb, var(--wl-warning) 7%, var(--wl-surface));
}
.wb-ps-live-pill {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--wl-success) 16%, transparent);
  color: var(--wl-success);
  font-family: var(--wl-font-mono);
  font-size: 11.5px;
  font-weight: 600;
}
.wb-ps-live-pill.is-unlisted {
  background: color-mix(in srgb, var(--wl-text-2) 14%, transparent);
  color: var(--wl-text-2);
}
.wb-ps-live-note {
  flex: 1;
  min-width: 140px;
  color: var(--wl-text-2);
  font-size: 12.5px;
}

/* Allow Cloning toggle card */
.wb-ps-toggle-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  border: 1px solid var(--wl-line);
  border-radius: var(--r-lg);
  background: var(--wl-surface);
}
.wb-ps-toggle-text {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.wb-ps-toggle-text strong { font-size: 14px; font-weight: 600; color: var(--wl-text); }
.wb-ps-toggle-text span { font-size: 13px; color: var(--wl-text-2); }

body.wb-shell .wb-ps-switch {
  position: relative;
  flex: none;
  width: 42px;
  height: 24px;
  padding: 0;
  border: 1px solid var(--wl-line-strong);
  border-radius: 999px;
  background: var(--wl-inset);
  box-shadow: none;
  cursor: pointer;
  transition: background var(--wl-quick) var(--wl-ease), border-color var(--wl-quick) var(--wl-ease);
}
body.wb-shell .wb-ps-switch.is-on {
  border-color: transparent;
  background: var(--wl-selection);
}
.wb-ps-switch-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: var(--wl-text-2);
  transition: transform var(--wl-quick) var(--wl-ease), background var(--wl-quick) var(--wl-ease);
}
body.wb-shell .wb-ps-switch.is-on .wb-ps-switch-thumb {
  transform: translateX(18px);
  background: var(--wl-bg);
}

/* Discovery metadata card: Content Rating, Genres, Platform Tags */
.wb-ps-card-block {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 18px;
  border: 1px solid var(--wl-line);
  border-radius: var(--r-lg);
  background: var(--wl-surface);
}
.wb-ps-field { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.wb-ps-field-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.wb-ps-count { color: var(--wl-text-3); font-family: var(--wl-font-mono); font-size: 11.5px; }

.wb-ps-pills { display: flex; flex-wrap: wrap; gap: 6px; }
body.wb-shell .wb-ps-pill {
  height: 30px;
  padding: 0 12px;
  border: 1px solid var(--wl-line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--wl-text) 2.5%, transparent);
  box-shadow: none;
  color: var(--wl-text-2);
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--wl-quick) var(--wl-ease), color var(--wl-quick) var(--wl-ease), border-color var(--wl-quick) var(--wl-ease);
}
body.wb-shell .wb-ps-pill:hover { background: var(--wl-raised); color: var(--wl-text); }
body.wb-shell .wb-ps-pill.is-active {
  border-color: color-mix(in srgb, var(--wl-selection) 60%, transparent);
  background: var(--wl-selection-soft);
  color: var(--wl-text);
  font-weight: 600;
}

.wb-ps-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.wb-ps-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 28px;
  padding: 0 9px 0 11px;
  border: 1px solid var(--wl-line-strong);
  border-radius: 999px;
  background: var(--wl-raised);
  color: var(--wl-text);
  font-size: 12.5px;
  font-weight: 500;
}
.wb-ps-chip.is-selected {
  border-color: color-mix(in srgb, var(--wl-selection) 50%, transparent);
  background: var(--wl-selection-soft);
}
body.wb-shell .wb-ps-chip-x {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  box-shadow: none;
  color: var(--wl-text-3);
  cursor: pointer;
}
body.wb-shell .wb-ps-chip-x:hover { background: color-mix(in srgb, var(--wl-text) 10%, transparent); color: var(--wl-text); }
.wb-ps-chip-icon { display: inline-grid; place-items: center; }
.wb-ps-chip-icon svg { width: 12px; height: 12px; }

body.wb-shell .wb-ps-chip-add {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 28px;
  padding: 0 11px;
  border: 1px dashed var(--wl-line-strong);
  border-radius: 999px;
  background: transparent;
  box-shadow: none;
  color: var(--wl-text-2);
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
}
body.wb-shell .wb-ps-chip-add:hover,
body.wb-shell .wb-ps-chip-add.is-open {
  border-style: solid;
  background: var(--wl-raised);
  color: var(--wl-text);
}

.wb-ps-genre-picker {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--wl-line);
  border-radius: var(--r-md);
  background: var(--wl-inset);
}
.wb-ps-genre-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-height: 156px;
  overflow-y: auto;
  padding: 2px;
}

.wb-ps-tag-entry { display: flex; gap: 8px; align-items: center; }
.wb-ps-input {
  flex: 1;
  min-width: 0;
  height: 34px;
  padding: 0 11px;
  border: 1px solid var(--wl-line);
  border-radius: var(--r-md);
  background: var(--wl-inset);
  color: var(--wl-text);
  font: inherit;
  font-size: 13px;
}
.wb-ps-input::placeholder { color: var(--wl-text-3); }

body.wb-shell .wb-ps-subtle-btn {
  height: 32px;
  padding: 0 12px;
  border: 1px solid var(--wl-line-strong);
  border-radius: var(--r-md);
  background: var(--wl-surface);
  box-shadow: none;
  color: var(--wl-text);
  font-size: var(--t-ui);
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
}
body.wb-shell .wb-ps-subtle-btn:hover:not(:disabled) {
  background: var(--wl-raised);
  border-color: color-mix(in srgb, var(--wl-line-strong) 60%, var(--wl-text-3));
}
body.wb-shell .wb-ps-subtle-btn.is-accent {
  border-color: color-mix(in srgb, var(--wl-selection) 55%, transparent);
  background: var(--wl-selection-soft);
}
body.wb-shell .wb-ps-subtle-btn:disabled { opacity: 0.45; cursor: not-allowed; }

/* Compact local folder row */
.wb-ps-folder {
  display: grid;
  grid-template-columns: 34px 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid var(--wl-line);
  border-radius: var(--r-lg);
  background: var(--wl-surface);
}
.wb-ps-folder > .wb-ps-glyph {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: var(--r-md);
  color: var(--wl-text-2);
  background: var(--wl-raised);
}
.wb-ps-glyph svg { width: 18px; height: 18px; }
.wb-ps-folder-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.wb-ps-folder-text strong { font-size: var(--t-title-card); font-weight: 600; }
.wb-ps-folder-text span.is-path {
  color: var(--wl-text-3);
  font-family: var(--wl-font-mono);
  font-size: var(--t-help);
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

/* Moderation policy dialog */
.wb-ps-policy-modal { width: min(500px, calc(100vw - 32px)) !important; }
.wb-ps-policy-body { display: flex; flex-direction: column; gap: 12px; margin-top: 10px; color: var(--wl-text-2); font-size: 13.5px; line-height: 1.55; }
.wb-ps-policy-body p { margin: 0; }
.wb-ps-policy-list { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 7px; color: var(--wl-text); }
.wb-ps-policy-foot { display: flex; justify-content: flex-end; margin-top: 8px; }

@container (max-width: 700px) {
  .wb-ps { padding: 28px 24px 50px; }
}
@container (max-width: 480px) {
  .wb-ps-folder { grid-template-columns: 34px 1fr; }
  .wb-ps-folder > button { grid-column: 2; justify-self: start; }
}
@media (pointer: coarse) {
  .wb-ps-select { height: 46px; }
  .wb-ps-input, .wb-ps-subtle-btn { height: 38px; }
}

/* Keep native settings panels, but size their host as a workspace page. */
:is(.workspace-leaf-content, .wl-page)[data-type="world-builder-settings"] :is(.view-header, .wl-page-header) { display: none; }
.wb-settings-page { padding: 0; overflow: hidden; }
.wb-settings-page > .modal.mod-settings {
  position: relative;
  inset: auto;
  width: 100%;
  height: 100%;
  min-height: 0;
  max-width: none;
  max-height: none;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}
.wb-settings-page > .modal > .modal-header,
.wb-settings-page > .modal > .modal-close-button { display: none; }
.wb-settings-page .modal.mod-settings > .modal-content {
  flex: 1;
  min-height: 0;
  margin: 0;
}
.wb-settings-page .vertical-tab-content-container { min-width: 0; }
.wb-settings-page .vertical-tab-content { padding-inline: clamp(20px, 4vw, 48px); }
.wb-settings-page .modal.mod-settings .vertical-tab-header { flex-basis: 180px; min-width: 150px; }
/* On a phone the pages become a strip above the page shown. */
.wb-settings-page { container-type: inline-size; }
@container (max-width: 640px) {
  .wb-settings-page .modal.mod-settings > .modal-content { flex-direction: column; }
  .wb-settings-page .modal.mod-settings .vertical-tab-header { flex: 0 0 auto; width: 100%; min-width: 0; max-width: none; padding: 8px 12px; overflow-x: auto; overflow-y: hidden; border-right: 0; border-bottom: 1px solid var(--wl-line); scrollbar-width: none; }
  .wb-settings-page .vertical-tab-header-group { margin: 0; padding: 0; }
  .wb-settings-page .vertical-tab-header-group-title, .wb-settings-page .wb-settings-group, .wb-settings-page .vertical-tab-nav-item-chevron { display: none; }
  .wb-settings-page .vertical-tab-header-group-items { display: flex; flex-direction: row; gap: 4px; }
  .wb-settings-page .vertical-tab-nav-item { flex: 0 0 auto; margin: 0; white-space: nowrap; }
  .wb-settings-page .vertical-tab-content-container { flex: 1; min-height: 0; }
  .wb-settings-page .vertical-tab-content { padding-inline: 16px; }
}
