/* Try it yourself: a docs example's code is editable where it stands, and
   the picture beside it becomes the real card, drawn by the web app. */

.doc .example.try { border-color: var(--night3); }
.doc .example.try > figure { align-content: start; gap: 12px; padding: 20px 16px; }
.doc .example.try > figure .live { width: 100%; display: grid; justify-items: center; }
.doc .example.try > figure iframe { display: block; width: 100%; height: 240px; border: 0; background: transparent; }
.doc .example.try > figure iframe.waiting { position: absolute; left: 16px; right: 16px; top: 20px; width: calc(100% - 32px); opacity: 0; pointer-events: none; }

/* Who taps: the three people the card is tried by. */
.doc .try .who { display: flex; gap: 6px; justify-content: center; }
.doc .try .who button {
  width: 30px; height: 30px; border-radius: 50%; border: 2px solid transparent; padding: 0; cursor: pointer;
  font: 700 12px/1 var(--sans); color: #fff; opacity: .5; transition: opacity .15s, border-color .15s;
}
.doc .try .who button:hover { opacity: .8; }
.doc .try .who button[aria-pressed="true"] { opacity: 1; border-color: var(--paper); }

/* The divider between the card and the code; drag it to resize. */
.doc .try .vdiv { display: none; }

/* The editor. */
.doc .ide { display: flex; flex-direction: column; min-width: 0; background: #0b1a33; color: #eaf1fb; }
.doc .ide .ebar { display: flex; align-items: center; gap: 6px; height: 42px; padding: 0 8px 0 0; background: #081428; border-bottom: 1px solid #1a2b4d; flex: none; }
.doc .ide .etab {
  align-self: stretch; display: flex; align-items: center; gap: 8px; padding: 0 16px; background: #0b1a33;
  font: 500 13px var(--mono); border-right: 1px solid #1a2b4d; position: relative;
}
.doc .ide .etab::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 2px; background: linear-gradient(90deg, #0473f5, #02d9fa); }
.doc .ide .etab::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px; background: #0b1a33; }
.doc .ide .etab b { font: 700 10px/1.3 var(--sans); color: #0b1a33; background: #ffd37a; border-radius: 3px; padding: 1px 3px; }
.doc .ide .etab b.json { background: #8fd3ff; }
.doc .ide .estat { margin-left: auto; display: flex; align-items: center; gap: 6px; font: 600 12px var(--sans); color: #7ee2b8; padding: 0 6px; }
.doc .ide .estat i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.doc .ide .estat.bad { color: #ff8a94; }
.doc .ide .estat.warn { color: #ffd37a; }
.doc .ide .tool {
  height: 28px; min-width: 32px; padding: 0 9px; border-radius: 8px; border: 1px solid rgb(255 255 255 / .18);
  background: rgb(255 255 255 / .06); color: #eaf1fb; display: grid; place-items: center; cursor: pointer;
}
.doc .ide .tool:hover { background: rgb(255 255 255 / .14); }
.doc .ide .tool svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.doc .ide .tool.done { color: #7ee2b8; border-color: #7ee2b8; }

.doc .ide .scroll { overflow: auto; flex: 1; max-height: 760px; }
.doc .ide .ed { position: relative; display: grid; grid-template-columns: auto 1fr; min-width: 100%; width: max-content; min-height: 100%; }
.doc .ide .gut {
  position: sticky; left: 0; z-index: 3; background: #0b1a33; border-right: 1px solid #16264a; padding: 20px 0;
  font: 13.5px/1.7 var(--mono); color: #43567d; text-align: right; user-select: none; min-width: 48px;
}
.doc .ide .gut div { padding: 0 12px 0 18px; position: relative; }
.doc .ide .gut .on { color: #c9d6ee; }
.doc .ide .gut .error { color: #ff8a94; }
.doc .ide .gut .warning, .doc .ide .gut .info { color: #ffd37a; }
.doc .ide .gut .error::before, .doc .ide .gut .warning::before {
  content: ""; position: absolute; left: 6px; top: 50%; width: 6px; height: 6px; margin-top: -3px; border-radius: 50%; background: #ff6b78;
}
.doc .ide .gut .warning::before { background: #ffc94d; }
.doc .ide .body { position: relative; }
.doc .ide .body pre, .doc .ide .body textarea {
  margin: 0; padding: 20px 120px 20px 20px; border: 0; border-radius: 0; background: none; color: #eaf1fb;
  font: 13.5px/1.7 var(--mono); tab-size: 2; white-space: pre; overflow: visible; max-height: none; height: auto;
}
.doc .ide .body pre { pointer-events: none; position: relative; z-index: 1; }
.doc .ide .body textarea {
  position: absolute; inset: 0; width: 100%; height: 100%; z-index: 2; color: transparent; caret-color: #7ee2b8;
  resize: none; outline: none; overflow: hidden;
}
.doc .ide .body textarea::selection { background: rgb(95 176 255 / .35); }
.doc .ide .line { position: absolute; left: 0; right: 0; height: calc(13.5px * 1.7); pointer-events: none; }
.doc .ide .line.cur { background: rgb(255 255 255 / .04); }
.doc .ide .line.error { background: rgb(255 107 120 / .1); }
.doc .ide .squig {
  position: absolute; height: 4px; pointer-events: none; z-index: 1;
  background: radial-gradient(circle at 2px -1px, transparent 2px, #ff6b78 2px 3px, transparent 3px) 0 0 / 4px 4px repeat-x;
}
.doc .ide .squig.warning, .doc .ide .squig.info { background-image: radial-gradient(circle at 2px -1px, transparent 2px, #ffc94d 2px 3px, transparent 3px); }

/* Code colours, as everywhere in the docs. */
.doc .ide .k { color: #8fd3ff; }
.doc .ide .s { color: #ffd37a; }
.doc .ide .n { color: #ffb86b; }
.doc .ide .c { color: #93a1be; font-style: italic; }
.doc .ide .f { color: #c9b6ff; }
.doc .ide .p { color: #7ee2b8; }

/* Suggestions and what a call takes. */
.doc .ide .ac {
  position: absolute; z-index: 6; min-width: 300px; max-width: 460px; max-height: 260px; overflow: auto; background: #13244a;
  border: 1px solid #2b4372; border-radius: 10px; box-shadow: 0 12px 30px rgb(0 0 0 / .4); padding: 4px; font: 13px/1.4 var(--mono);
}
.doc .ide .ac div { display: flex; gap: 10px; align-items: baseline; padding: 5px 8px; border-radius: 6px; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.doc .ide .ac div.sel { background: #1f3a6e; }
.doc .ide .ac b { font-weight: 600; color: #7ee2b8; }
.doc .ide .ac span { color: #8fa3c8; font-size: 12px; overflow: hidden; text-overflow: ellipsis; }
.doc .ide .sig {
  position: absolute; z-index: 5; background: #13244a; border: 1px solid #2b4372; border-radius: 8px; padding: 5px 10px;
  font: 12.5px/1.4 var(--mono); color: #b4c1da; white-space: nowrap; box-shadow: 0 8px 20px rgb(0 0 0 / .35); pointer-events: none;
}
.doc .ide .sig b { color: #ffd37a; font-weight: 600; }

/* The console: every problem, then what was tapped. */
.doc .ide .console { flex: none; background: #071226; border-top: 1px solid #1a2b4d; font: 12.5px/1.6 var(--mono); color: #8fa3c8; }
.doc .ide .chead { display: flex; align-items: center; gap: 10px; height: 34px; padding: 0 8px 0 14px; font: 600 12px var(--sans); color: #b4c1da; cursor: pointer; user-select: none; }
.doc .ide .chead svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; transition: transform .15s; }
.doc .ide .console.closed .chead svg { transform: rotate(-90deg); }
.doc .ide .console.closed .clines { display: none; }
.doc .ide .chead .n { font: 700 11px/18px var(--sans); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; text-align: center; background: #ff6b78; color: #071226; }
.doc .ide .chead .n.warn { background: #ffc94d; }
.doc .ide .chead .clr { margin-left: auto; background: none; border: 0; color: #7f8fae; cursor: pointer; padding: 4px 8px; border-radius: 6px; font: 600 12px var(--sans); }
.doc .ide .chead .clr:hover { color: #eaf1fb; background: rgb(255 255 255 / .06); }
.doc .ide .clines { max-height: 150px; overflow: auto; padding: 2px 0 8px; border-top: 1px solid #12223f; }
.doc .ide .cl { display: flex; gap: 10px; padding: 2px 14px; white-space: pre-wrap; }
.doc .ide .cl .t { color: #4d5f84; flex: none; }
.doc .ide .cl .at { flex: none; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.doc .ide .cl.error { color: #ff8a94; background: rgb(255 107 120 / .07); }
.doc .ide .cl.warning, .doc .ide .cl.info { color: #ffd37a; }
.doc .ide .cl b { color: #eaf1fb; font-weight: 600; }

@media (min-width: 1100px) {
  .doc .example.side.try { grid-template-columns: var(--left, 300px) 1px minmax(0, 1fr); }
  .doc .try .vdiv { display: block; background: var(--night3); position: relative; cursor: col-resize; z-index: 4; touch-action: none; }
  .doc .try .vdiv::before { content: ""; position: absolute; inset: 0 -5px; }
  .doc .try .vdiv::after {
    content: ""; position: absolute; left: -2px; top: 50%; width: 5px; height: 36px; margin-top: -18px; border-radius: 3px;
    background: var(--night3); transition: background .15s;
  }
  .doc .try .vdiv:hover, .doc .try .vdiv.drag, .doc .try .vdiv:hover::after, .doc .try .vdiv.drag::after { background: var(--signal); }
}
/* With room to spare, the playground reaches past the text column. */
@media (min-width: 1440px) {
  .doc.wide .example.try { margin-right: calc(-1 * min(300px, (100vw - 1180px) / 2)); }
}

/* Full screen: the same example, pinned over the page. */
.try-full { overflow: hidden; }
.try-veil { position: fixed; inset: 0; z-index: 59; background: rgb(3 10 23 / .55); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
.doc .example.try.full {
  position: fixed; inset: 24px; z-index: 60; margin: 0; background: var(--night0);
  grid-template-columns: var(--left, 36%) 1px minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); box-shadow: 0 30px 80px rgb(0 0 0 / .45);
}
.doc .example.try.full > figure { overflow: auto; align-content: center; }
.doc .example.try.full > .caption { display: none; }
.doc .example.try.full .vdiv { display: block; background: var(--night3); position: relative; cursor: col-resize; z-index: 4; touch-action: none; }
.doc .example.try.full .ide { min-height: 0; }
.doc .example.try.full .ide .scroll { max-height: none; }
@media (max-width: 700px) {
  .doc .example.try.full { inset: 0; border-radius: 0; border: 0; grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 42%) minmax(0, 1fr); }
  .doc .example.try.full .vdiv { display: none; }
}
