/* "Try it live" playground window (js/playground.js): home page and Components page. */
.hw-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
  margin-bottom: 16px;
}
.hw-title {
  color: var(--ink);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.hw-sub {
  color: var(--ink-3);
  font-size: 14px;
}
/* ---------- live component window ---------- */
.hp {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--dk-bg-ffffff, #fff);
  box-shadow: 0 1px 2px rgba(9, 9, 11, 0.04), 0 40px 80px -48px rgba(9, 9, 11, 0.35);
  text-align: start;
}
.hp-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 42px;
  padding: 0 14px;
  border-bottom: 1px solid var(--line);
  background: var(--muted-bg);
  font-size: 12.5px;
  color: var(--ink-3);
}
.hp-dots {
  display: inline-flex;
  gap: 6px;
}
.hp-dots i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--line);
}
.hp-url {
  flex: 1;
  text-align: center;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
}
.hp-url b {
  color: var(--ink);
  font-weight: 500;
}
.hp-live {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.hp-live i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.18);
}
.hp-body {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr) 264px;
  height: 560px;
}
.hp-side {
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 14px 10px;
  border-inline-end: 1px solid var(--line);
  background: var(--muted-bg);
  font-size: 13px;
}
.hp-brand {
  padding: 2px 8px 12px;
}
.hp-brand img {
  height: 20px;
  width: auto;
}
.hp-search {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 6px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--dk-bg-ffffff, #fff);
  color: var(--ink-3);
}
.hp-search:focus-within {
  border-color: var(--ink-3);
}
.hp-search svg {
  flex: none;
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}
.hp-search input {
  width: 100%;
  min-width: 0;
  height: 30px;
  border: 0;
  outline: 0;
  background: none;
  color: var(--ink);
  font: 12.5px var(--font-family);
}
.hp-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: thin;
}
.hp-side__g {
  margin: 12px 8px 4px !important;
  color: var(--ink-3);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.hp-item {
  display: flex;
  align-items: center;
  width: 100%;
  height: 30px;
  padding: 0 8px;
  border: 0;
  border-radius: 6px;
  background: none;
  color: var(--ink-2);
  font: 13px var(--font-family);
  text-align: start;
  cursor: pointer;
}
.hp-item:hover {
  background: var(--line-soft);
  color: var(--ink);
}
.hp-item[aria-current='true'] {
  background: var(--dk-bg-ffffff, #fff);
  box-shadow: inset 0 0 0 1px var(--line);
  color: var(--ink);
  font-weight: 500;
}
.hp-item:focus-visible,
.hp-tab:focus-visible,
.hp-chip:focus-visible,
.hp-copy:focus-visible,
.hp-pick:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 1px;
}
.hp-empty {
  padding: 8px;
  color: var(--ink-3);
  font-size: 12.5px;
}
.hp-canvas {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  grid-template-columns: minmax(0, 1fr);
  min-width: 0;
  min-height: 0;
}
.hp-tools {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 46px;
  padding: 0 12px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}
.hp-tabs {
  display: inline-flex;
  gap: 2px;
}
.hp-tab {
  height: 28px;
  padding: 0 10px;
  border: 0;
  border-radius: 6px;
  background: none;
  color: var(--ink-3);
  font: 500 13px var(--font-family);
  cursor: pointer;
}
.hp-tab[aria-selected='true'] {
  background: var(--line-soft);
  color: var(--ink);
}
.hp-pick {
  display: none;
  height: 30px;
  min-width: 0;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--dk-bg-ffffff, #fff);
  color: var(--ink);
  font: 13px var(--font-family);
}
.hp-sp {
  flex: 1;
}
.hp-chip {
  height: 28px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--dk-bg-ffffff, #fff);
  color: var(--ink-2);
  font: 500 12px var(--font-family);
  cursor: pointer;
}
.hp-chip[aria-pressed='true'] {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--dk-bg-ffffff, #fff);
}
.hp-stage {
  display: grid;
  place-items: center;
  min-height: 0;
  overflow: auto;
  padding: 32px;
  background-color: var(--dk-bg-ffffff, #fff);
  background-image: radial-gradient(var(--line) 1px, transparent 1px);
  background-size: 16px 16px;
}
.hp-stage[hidden] {
  display: none;
}

.hp-code {
  min-height: 0;
  margin: 0;
  overflow: auto;
  padding: 16px 18px;
  background: #09090b;
  color: #e4e4e7;
  font: 12.5px/1.65 ui-monospace, SFMono-Regular, Menlo, monospace;
  white-space: pre;
}
.hp-code[hidden] {
  display: none;
}
.hp-code .t,
.hp-line .t {
  color: #7dd3fc;
}
.hp-code .a,
.hp-line .a {
  color: #c4b5fd;
}
.hp-code .v,
.hp-line .v {
  color: #86efac;
}

.hp-props {
  min-height: 0;
  overflow-y: auto;
  padding: 16px;
  border-inline-start: 1px solid var(--line);
}
.hp-props__h {
  margin-bottom: 14px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
}
.hp-props__in {
  display: grid;
  gap: 14px;
}
.hp-ctl {
  display: grid;
  gap: 6px;
}
.hp-ctl__l {
  color: var(--ink-3);
  font-size: 12px;
  font-weight: 500;
}
.hp-seg {
  display: flex;
  gap: 2px;
  padding: 2px;
  border-radius: 8px;
  background: var(--line-soft);
}
.hp-seg button {
  flex: 1;
  min-width: 0;
  height: 28px;
  padding: 0 4px;
  border: 0;
  border-radius: 6px;
  background: none;
  color: var(--ink-2);
  font: 500 12px var(--font-family);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}
.hp-seg button[aria-checked='true'] {
  background: var(--dk-bg-ffffff, #fff);
  color: var(--ink);
  box-shadow: 0 1px 2px rgba(9, 9, 11, 0.08);
}
.hp-seg button:focus-visible,
.hp-input:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 1px;
}
.hp-input {
  width: 100%;
  min-width: 0;
  height: 32px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--dk-bg-ffffff, #fff);
  color: var(--ink);
  font: 13px var(--font-family);
}

@media (max-width: 1100px) {
  .hp-body {
    grid-template-columns: minmax(0, 1fr) 240px;
  }
  .hp-side {
    display: none;
  }
  .hp-pick {
    display: block;
  }
}
@media (max-width: 760px) {
  .hp-body {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: 440px auto;
    height: auto;
  }
  .hp-props {
    border-inline-start: 0;
    border-top: 1px solid var(--line);
  }
  .hp-props__in {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .hp-stage {
    padding: 20px;
  }
  .hp-url,
  .hp-live {
    display: none;
  }

}
@media (max-width: 520px) {
  .hp-props__in {
    grid-template-columns: minmax(0, 1fr);
  }
  .hp-tools {
    gap: 4px;
    padding: 0 8px;
  }
  .hw-head--try .hw-sub {
    display: none;
  }
}

@media (max-width: 520px) {
  .hp-props {
    grid-template-columns: minmax(0, 1fr);
  }
}
/* phone: keep the window toolbar and the play button on one line */
.hp-canvas {
  overflow: hidden;
}
@media (max-width: 1100px) {
  .hp-pick {
    flex: 1;
    max-width: 200px;
  }
  .hp-sp {
    display: none;
  }
}
@media (max-width: 520px) {
  .hp-tab,
  .hp-chip {
    padding: 0 8px;
  }
}

/* Live stage: the real @pixelsds/react components in an iframe (explore/play.html) */
.hp-stage.is-frame {
  position: relative;
  display: block;
  padding: 0;
  overflow: hidden;
}
.hp-frame {
  position: absolute;
  top: 0;
  left: 0;
  border: 0;
  transform-origin: 0 0;
  background: transparent;
  opacity: 0;
  transition: opacity 0.25s ease;
}
.hp-stage.is-ready .hp-frame {
  opacity: 1;
}
.hp-wait {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  margin: 0;
  color: var(--ink-3);
  font-size: 13px;
}
.hp-stage.is-ready .hp-wait {
  display: none;
}
.hp-item {
  gap: 6px;
}
.hp-pro {
  margin-inline-start: auto;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--line-soft);
  color: var(--ink-3);
  font-size: 10.5px;
  font-weight: 600;
}
.hp-brand .logo-dark,
.hp-brand .logo-light {
  height: 22px;
  width: auto;
}
.hp-stage.is-frame[hidden] {
  display: none;
}
.hp-item {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* code tab copy button lives in the toolbar */
.hp-copy[hidden] {
  display: none;
}
