/* Modify your app page (customize.html): the hero is the homepage's customize demo (css/customize-demo.css),
   and the two sections under it are demos the visitor drives (js/customize-page.js):
     - .dp-demo  the website team's own Deploys screen, inside Zigzag: deploy the next commit on main to
                 staging, promote staging to production, roll production back. Made up for the demo team,
                 drawn like screenshot-sources/team-screen.html.
     - .vw-demo  Zigzag's website room, with a switch between the standard Zigzag (the room's chat) and the
                 team's own, which adds views of the same work: Kanban (click a card to move it), Timeline,
                 Schedule and AI, which answers from the board.
   Both copy the app's dark look (screenshot-sources/app.css); sizes are in rem, so they scale with the page. */

.dp-demo,
.vw-demo {
  position: relative;
  overflow: hidden;
  background: #0d0f12;
  color: #e9ecef;
  font-size: 0.875rem;
  line-height: 1.45;
  text-align: left;
}

.dp-demo p,
.vw-demo p { margin: 0; }

.dp-demo ul,
.vw-demo ul { list-style: none; margin: 0; padding: 0; }

.dp-demo button,
.vw-demo button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.dp-demo button:disabled { cursor: default; }

.dp-demo button:focus-visible,
.vw-demo button:focus-visible { outline: 2px solid #748ffc; outline-offset: 2px; }

.dp-path { font-family: var(--font-mono); }

.dp-n-alice { color: oklch(0.78 0.14 96); }
.dp-n-matt { color: oklch(0.78 0.14 29); }
.dp-n-bob { color: oklch(0.78 0.14 309); }
.dp-n-richard { color: oklch(0.78 0.14 229); }
.dp-n-you { color: #b197fc; }

/* ---- The bar under each demo: what to try ---- */

.dp-hint,
.vw-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem 0.75rem;
  min-height: 2.75rem;
  padding: 0.5rem 1rem;
  border-top: 1px solid #22262c;
  background: #15181d;
  color: #c9ced4;
  font-size: 0.8125rem;
}

.dp-hint b {
  padding: 0.0625rem 0.5rem;
  border-radius: 999px;
  background: rgb(37 99 235 / 0.25);
  color: #a5d8ff;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* The control to try next: a ring that breathes (css/motion.css), a still ring without motion */
.is-next { box-shadow: 0 0 0 2px #339af0; }

/* ======================================================================================
   Deploys: a screen the team added, at its own address in Zigzag
   ====================================================================================== */

.dp-demo {
  display: grid;
  grid-template-rows: auto 1fr auto;
  max-width: 44rem;
  margin-inline: auto;
}

.dp-top {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 2.75rem;
  padding: 0 1rem;
  border-bottom: 1px solid #343a40;
  background: #212529;
  white-space: nowrap;
}

.dp-title { font-weight: 600; }
.dp-path { overflow: hidden; text-overflow: ellipsis; color: #868e96; font-size: 0.75rem; }
.dp-spacer { flex: 1; }

.dp-tag {
  padding: 0.0625rem 0.5rem;
  border: 1px solid #495057;
  border-radius: 0.375rem;
  color: #868e96;
  font-size: 0.75rem;
}

.dp-screen {
  display: grid;
  gap: 1rem;
  padding: 1rem;
}

.dp-envs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.dp-env {
  --ec: #748ffc;
  display: grid;
  gap: 0.25rem;
  min-width: 0;
  padding: 0.75rem;
  border: 1px solid #343a40;
  border-top: 3px solid var(--ec);
  border-radius: 0.5rem;
  background: #16191d;
  transition: border-color 0.3s;
}

.dp-env.is-production { --ec: #40c057; }

.dp-env-head { display: flex; align-items: center; gap: 0.375rem; }
.dp-env-name { margin-right: auto; font-size: 1rem; font-weight: 700; }

.dp-live { color: #40c057; font-size: 0.75rem; font-weight: 600; white-space: nowrap; }
.dp-live.is-busy { color: #fab005; }

.dp-commit { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.8125rem; }
.dp-sha { color: #868e96; font-family: var(--font-mono); font-size: 0.75rem; }
.dp-meta { color: #868e96; font-size: 0.75rem; }

.dp-acts { display: flex; flex-wrap: wrap; gap: 0.375rem; margin-top: 0.25rem; }

/* What deploying to staging would take next: main's oldest commit not on staging yet */
.dp-next { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #adb5bd; font-size: 0.75rem; }

.dp-act {
  padding: 0.25rem 0.75rem !important;
  border: 1px solid #495057 !important;
  border-radius: 999px;
  font-size: 0.75rem !important;
  font-weight: 600 !important;
  white-space: nowrap;
  transition: background-color 0.2s, border-color 0.2s, opacity 0.2s;
}

.dp-act.is-primary {
  border-color: #748ffc !important;
  background: rgb(116 143 252 / 0.14) !important;
  color: #91a7ff !important;
}

.dp-act:disabled { opacity: 0.5; }

@media (hover: hover) {
  .dp-act:enabled:hover { border-color: #868e96 !important; }
  .dp-act.is-primary:enabled:hover { background: rgb(116 143 252 / 0.26) !important; }
}

.dp-label {
  margin-bottom: 0.375rem !important;
  color: #868e96;
  font-size: 0.6875rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.dp-list {
  border: 1px solid #343a40;
  border-radius: 0.5rem;
  background: #16191d;
}

.dp-list li {
  display: grid;
  grid-template-columns: 1rem 4.25rem minmax(0, 1fr) 5.5rem 3.5rem 4rem;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.75rem;
}

.dp-list li + li { border-top: 1px solid #343a40; }
.dp-list .dp-msg { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dp-when { color: #868e96; text-align: right; white-space: nowrap; }
.dp-ok { color: #40c057; }
.dp-busy { color: #fab005; }
.dp-back { color: #91a7ff; }

.dp-chip {
  justify-self: start;
  padding: 0 0.375rem;
  border-radius: 0.375rem;
  background: rgb(116 143 252 / 0.18);
  color: #91a7ff;
  font-size: 0.6875rem;
}

.dp-chip.is-production { background: rgb(64 192 87 / 0.18); color: #69db7c; }

/* ======================================================================================
   Standard vs yours: one room, two versions of Zigzag. The team's version (.is-yours) adds views to the
   room, all on the same work: Kanban, Timeline, Schedule and AI. Its color (--vw-team) marks what it added
   ====================================================================================== */

.vw-demo {
  --vw-team: #20c997;
  --vw-accent: #748ffc;
  --vw-side: #111317;
  display: grid;
  grid-template-rows: auto 22rem auto;
  max-width: 48rem;
  margin-inline: auto;
}

.vw-demo [hidden] { display: none !important; }

.vw-demo.is-yours {
  --vw-accent: var(--vw-team);
  --vw-side: color-mix(in srgb, var(--vw-team) 9%, #0d0f12);
}

.vw-titlebar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  height: 2.375rem;
  padding: 0 0.875rem;
  border-bottom: 1px solid #22262c;
  background: #15181d;
  font-size: 0.8125rem;
  white-space: nowrap;
}

.vw-spacer { flex: 1; }

.vw-team {
  padding: 0.0625rem 0.5rem;
  border: 1px solid #30363d;
  border-radius: 0.375rem;
  transition: border-color 0.3s, color 0.3s;
}

.vw-demo.is-yours .vw-team { border-color: var(--vw-team); color: var(--vw-team); }

.vw-body {
  display: grid;
  grid-template-columns: 9rem minmax(0, 1fr);
  min-height: 0;
}

/* The sidebar: the team's rooms */
.vw-side {
  display: grid;
  align-content: start;
  gap: 0.25rem;
  padding: 0.75rem 0.5rem;
  border-right: 1px solid #22262c;
  background: var(--vw-side);
  font-size: 0.8125rem;
  transition: background-color 0.4s;
}

.vw-label {
  padding: 0.25rem 0.5rem;
  color: #868e96;
  font-size: 0.6875rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.vw-side li { padding: 0.25rem 0.5rem; border-radius: 0.375rem; color: #adb5bd; white-space: nowrap; }

.vw-side li.is-on {
  background: color-mix(in srgb, var(--vw-accent) 20%, transparent);
  color: #e9ecef;
  box-shadow: inset 2px 0 var(--vw-accent);
  transition: background-color 0.4s, box-shadow 0.4s;
}

/* The room, as the app draws it today: an island with its head (settings, name, the views the team
   added, the actions) and the view on show, on the window's colour; in the chat, the composer has an
   island of its own */
.vw-main {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  grid-template-columns: minmax(0, 1fr);
  min-width: 0;
  min-height: 0;
  padding: 0.25rem;
  background: #212529;
}

.vw-head {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  min-height: 2.25rem;
  padding: 0 0.75rem 0 0.5rem;
  border-radius: 0.5rem 0.5rem 0 0;
  background: #0d0f12;
  white-space: nowrap;
}

.vw-head > b { margin: 0 0.5rem 0 0.125rem; font-size: 0.9375rem; font-weight: 600; }

.vw-demo .vw-main svg {
  width: 1rem;
  height: 1rem;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* In the team's version the views it added get a row of their own under the room's name (wrapping
   again where the room is narrow), so every tab shows at any width; the head's actions step aside */
.vw-demo.is-yours .vw-head-extra,
.vw-demo.is-yours .vw-head > .vw-spacer { display: none; }
.vw-demo.is-yours .vw-head { flex-wrap: wrap; row-gap: 0.25rem; padding-block: 0.375rem; }
.vw-demo.is-yours .vw-tabs { flex: 1 0 100%; flex-wrap: wrap; overflow: visible; }

.vw-icon { display: grid; place-items: center; width: 1.5rem; height: 1.5rem; flex: none; color: #868e96; }

.vw-chip {
  display: inline-flex;
  align-items: center;
  height: 1.5rem;
  padding: 0 0.625rem;
  border: 1px solid #495057;
  border-radius: 0.25rem;
  font-size: 0.75rem;
  font-weight: 500;
}

.vw-tabs {
  display: flex;
  gap: 0.125rem;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.vw-tabs button {
  padding: 0.25rem 0.625rem !important;
  border-radius: 0.375rem;
  color: #adb5bd !important;
  font-size: 0.8125rem !important;
  white-space: nowrap;
  transition: background-color 0.2s, color 0.2s;
}

.vw-tabs button[aria-selected="true"] {
  background: color-mix(in srgb, var(--vw-accent) 22%, transparent) !important;
  color: #fff !important;
}

@media (hover: hover) {
  .vw-tabs button[aria-selected="false"]:hover { background: rgb(255 255 255 / 0.06) !important; color: #fff !important; }
}

/* A view the team added: a dot in the team's color */
.vw-tabs .is-added::after {
  content: "";
  display: inline-block;
  width: 0.375rem;
  height: 0.375rem;
  margin-left: 0.375rem;
  border-radius: 50%;
  background: var(--vw-team);
  vertical-align: 0.125rem;
}

.vw-view { min-height: 0; overflow: hidden; border-radius: 0 0 0.5rem 0.5rem; background: #0d0f12; }

/* ---- Chat (every Zigzag has it) ---- */

.vw-chat { display: grid; grid-template-rows: minmax(0, 1fr) auto; gap: 0.25rem; border-radius: 0; background: none; }

.vw-feed {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 0.625rem;
  padding: 0.5rem 1rem 0.625rem 0.75rem;
  overflow: hidden;
  border-radius: 0 0 0.5rem 0.5rem;
  background: #0d0f12;
}

/* A message: the sender's disc on the left, the name and time over the body, in the sender's color
   (--who, set by the name classes below) */
.vw-msg { position: relative; padding-left: 2.75rem; line-height: 1.4; }
.vw-feed .vw-msg { color: #e9ecef; }

.vw-avatar {
  position: absolute;
  left: 0;
  top: 0.25rem;
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: color-mix(in oklab, var(--who) 50%, #000);
  color: oklch(0.98 0 0);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.vw-meta { display: flex; align-items: baseline; gap: 0.5rem; }
.vw-meta b { font-weight: 700; color: var(--who); }
.vw-time { font-size: 0.6875rem; color: #495057; }

/* The composer's island: AI, the message box, attach */
.vw-composer {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 3rem;
  margin: 0 !important;
  padding: 0 0.5rem;
  border-radius: 0.5rem;
  background: #0d0f12;
  color: #868e96;
}

.vw-compose-ai { display: inline-flex; align-items: center; gap: 0.125rem; padding: 0 0.375rem; font-size: 0.8125rem; }
.vw-ph { flex: 1; padding-left: 0.375rem; }

/* People, by the app's name colors */
.vw-n-alice { color: oklch(0.78 0.14 96); --who: oklch(0.78 0.14 96); }
.vw-n-matt { color: oklch(0.78 0.14 29); --who: oklch(0.78 0.14 29); }
.vw-n-bob { color: oklch(0.78 0.14 309); --who: oklch(0.78 0.14 309); }
.vw-n-richard { color: oklch(0.78 0.14 229); --who: oklch(0.78 0.14 229); }

/* ---- Kanban ---- */

.vw-kanban {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.625rem;
  padding: 0.75rem;
  align-items: start;
}

.vw-col {
  display: grid;
  gap: 0.375rem;
  min-width: 0;
  padding: 0.5rem;
  border-radius: 0.5rem;
  background: #15181d;
}

.vw-col-head {
  display: flex;
  justify-content: space-between;
  padding: 0 0.25rem 0.125rem;
  color: #868e96;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.vw-card {
  display: grid !important;
  gap: 0.125rem;
  width: 100%;
  padding: 0.5rem 0.625rem !important;
  border: 1px solid #30363d !important;
  border-left: 3px solid var(--who, #495057) !important;
  border-radius: 0.375rem;
  background: #1b1f24 !important;
  font-size: 0.8125rem !important;
  text-align: left;
  transition: border-color 0.2s, transform 0.15s;
}

.vw-card small { color: #868e96; font-size: 0.6875rem; }
.vw-card.is-done { opacity: 0.7; cursor: default !important; }
.vw-card.is-done span::before { content: "✓ "; color: #69db7c; }

@media (hover: hover) {
  .vw-card:not(.is-done):hover { transform: translateY(-1px); border-color: #4b535d !important; }
}

/* ---- Timeline: the week, one bar per task ---- */

.vw-timeline {
  display: grid;
  grid-template-columns: 9.5rem repeat(5, minmax(0, 1fr));
  grid-auto-rows: min-content;
  align-content: start;
  row-gap: 0.5rem;
  padding: 0.75rem 1rem;
  font-size: 0.75rem;
}

.vw-day {
  padding-bottom: 0.25rem;
  border-bottom: 1px solid #22262c;
  color: #868e96;
  text-align: center;
}

.vw-day.is-today { color: var(--vw-team); font-weight: 600; }

.vw-task { overflow: hidden; color: #ced4da; text-overflow: ellipsis; white-space: nowrap; align-self: center; }

.vw-bar-row {
  position: relative;
  height: 1.375rem;
  border-radius: 0.375rem;
  background: color-mix(in srgb, var(--who) 30%, #15181d);
  box-shadow: inset 3px 0 var(--who);
  color: #e9ecef;
  line-height: 1.375rem;
  padding-left: 0.5rem;
  overflow: hidden;
  white-space: nowrap;
}

.vw-bar-row.is-done { background: color-mix(in srgb, var(--who) 14%, #15181d); color: #69db7c; }

/* ---- Schedule: the team's week ---- */

.vw-schedule {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.5rem;
  padding: 0.75rem;
  align-items: start;
}

.vw-sday { display: grid; gap: 0.375rem; min-width: 0; }

.vw-sday > p {
  padding-bottom: 0.25rem;
  border-bottom: 1px solid #22262c;
  color: #868e96;
  font-size: 0.75rem;
  text-align: center;
}

.vw-sday.is-today > p { color: var(--vw-team); font-weight: 600; }

.vw-event {
  display: grid;
  gap: 0.0625rem;
  padding: 0.375rem 0.5rem;
  border-radius: 0.375rem;
  background: #1b1f24;
  border-left: 3px solid var(--who, #495057);
  font-size: 0.75rem;
}

.vw-event time { color: #868e96; font-size: 0.6875rem; }
.vw-event.is-away { background: repeating-linear-gradient(135deg, #1b1f24 0 6px, #16191d 6px 12px); }
.vw-event.is-release { border-left-color: var(--vw-team); background: color-mix(in srgb, var(--vw-team) 14%, #1b1f24); }

/* ---- AI: asks about the room's work, answers from its board and schedule ---- */

.vw-ai {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
}

.vw-answer {
  display: grid;
  align-content: end;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  overflow: hidden;
  font-size: 0.8125rem;
}

.vw-ai-intro { color: #868e96; }

.vw-q {
  justify-self: end;
  max-width: 85%;
  padding: 0.375rem 0.75rem;
  border-radius: 0.75rem 0.75rem 0.25rem 0.75rem;
  background: #343a40;
}

.vw-a {
  max-width: 92%;
  padding: 0.5rem 0.75rem;
  border: 1px solid color-mix(in srgb, var(--vw-team) 40%, #30363d);
  border-radius: 0.75rem 0.75rem 0.75rem 0.25rem;
  background: color-mix(in srgb, var(--vw-team) 8%, #15181d);
  white-space: pre-line;
}

.vw-a b { display: block; margin-bottom: 0.125rem; color: var(--vw-team); font-size: 0.75rem; }

.vw-asks {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
  padding: 0 1rem 0.75rem;
}

.vw-asks button {
  padding: 0.25rem 0.75rem !important;
  border: 1px solid color-mix(in srgb, var(--vw-team) 50%, #30363d) !important;
  border-radius: 999px;
  color: #e9ecef !important;
  font-size: 0.75rem !important;
}

.vw-asks button:disabled { opacity: 0.5; cursor: default !important; }

@media (hover: hover) {
  .vw-asks button:enabled:hover { background: color-mix(in srgb, var(--vw-team) 15%, transparent) !important; }
}

/* ---- The bar: which Zigzag ---- */

.vw-switch {
  display: inline-flex;
  padding: 0.1875rem;
  border: 1px solid #30363d;
  border-radius: 999px;
  background: #0d0f12;
}

.vw-switch button {
  padding: 0.25rem 0.875rem !important;
  border-radius: 999px;
  color: #adb5bd !important;
  font-weight: 600 !important;
  white-space: nowrap;
  transition: background-color 0.25s, color 0.25s;
}

.vw-switch button[aria-pressed="true"] { background: #343a40 !important; color: #fff !important; }
.vw-switch button[data-version="yours"][aria-pressed="true"] { background: var(--vw-team) !important; color: #0d0f12 !important; }

@media (hover: hover) {
  .vw-switch button[aria-pressed="false"]:hover { color: #fff !important; }
}

.vw-hint { flex: 1 1 14rem; }

/* Tablets and phones: no sidebar, so the views have the width; the timeline's names get narrower */
@media (max-width: 760px) {
  .vw-body { grid-template-columns: minmax(0, 1fr); }
  .vw-side { display: none; }
  .vw-demo { grid-template-rows: auto 24rem auto; }
  .vw-head { padding-inline: 0.5rem; }
  .vw-head-extra { display: none; }
  .vw-timeline { grid-template-columns: 6.5rem repeat(5, minmax(0, 1fr)); padding-inline: 0.75rem; }
  .vw-kanban { gap: 0.375rem; padding: 0.5rem; }
  .vw-col { padding: 0.375rem; }
  .vw-card { padding: 0.375rem 0.5rem !important; font-size: 0.75rem !important; }
  .vw-schedule { gap: 0.25rem; padding: 0.5rem; }
  .vw-event { padding: 0.25rem 0.375rem; font-size: 0.6875rem; }
  .vw-bar-row { font-size: 0; padding: 0; }
}

@media (max-width: 560px) {
  .dp-envs { grid-template-columns: minmax(0, 1fr); }
  .dp-list li { grid-template-columns: 1rem 3.75rem minmax(0, 1fr) 3.5rem; }
  .dp-list .dp-chip,
  .dp-list .dp-who { display: none; }
  .dp-path { display: none; }
}
