/* Brioli AI consultant: the chat page and the manager's desk share this sheet.
   Light theme only. One accent (the raspberry of brioli.by, deepened for contrast),
   used for sale prices, lead readiness and the focus ring. */

:root {
  color-scheme: light;

  --surface: #F1EFEB;      /* warm grey, like undyed linen */
  --paper: #FFFFFF;        /* bubbles, cards, the lead document; product photos are shot on white */
  --sunk: #E7E3DC;         /* hover, spec tags */
  --ink: #26231F;          /* deep charcoal: text, the wordmark, the visitor's messages */
  --ink-2: #5F5951;        /* secondary text, 6:1 on the surface */
  --placeholder: #716A61;
  --line: #DAD5CD;         /* hairlines */
  --line-strong: #8E867A;  /* control borders, stitches */
  --accent: #AF2D4B;       /* brioli.by raspberry #D34564, deepened to 5.5:1 */
  --accent-tint: #F6E5E9;

  --gutter: 24px;
  --col: 760px;
  --top-h: 61px;

  --font: "Golos Text", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mark: "Oswald", "Arial Narrow", "Roboto Condensed", "Helvetica Neue", Arial, sans-serif;
  --font-code: ui-monospace, "Cascadia Mono", Consolas, "Liberation Mono", Menlo, monospace;

  --ease: cubic-bezier(.2, .7, .2, 1);
}

@media (max-width: 520px) {
  :root { --gutter: 16px; }
}

/* ---------- Base ---------- */

*, *::before, *::after { box-sizing: border-box; }

[hidden] { display: none !important; }

html {
  background: var(--surface);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  color: var(--ink);
  font: 400 16px/1.55 var(--font);
  font-kerning: normal;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; }
img { max-width: 100%; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip {
  position: absolute;
  left: 8px; top: -48px;
  z-index: 50;
  padding: 8px 12px;
  background: var(--ink);
  color: var(--paper);
  text-decoration: none;
  border-radius: 3px;
}
.skip:focus { top: 8px; }

.wrap {
  width: 100%;
  max-width: calc(var(--col) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.i { display: inline-block; flex: none; vertical-align: -2px; }

@keyframes rise {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: none; }
}

@keyframes fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* A running stitch: the typing indicator is a seam being sewn. */
@keyframes sew {
  to { background-position: 12px 0; }
}

/* ---------- Header ---------- */

.top {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.top__in {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 60px;
}

.top--wide .top__in,
.wrap--wide { max-width: calc(1200px + 2 * var(--gutter)); }

/* The wordmark echoes the factory's logo: a charcoal block with a framed edge. */
.mark {
  flex: none;
  display: inline-block;
  margin: 3px;
  padding: 5px 7px 4px;
  background: var(--ink);
  color: var(--surface);
  font: 600 19px/1 var(--font-mark);
  letter-spacing: .035em;
  text-decoration: none;
  box-shadow: 0 0 0 2px var(--surface), 0 0 0 3.5px var(--ink);
}
.mark:focus-visible { outline-offset: 5px; }

.top__title {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  font-size: 15px;
  font-weight: 500;
  white-space: nowrap;
}

.top__title-muted { color: var(--ink-2); font-weight: 400; }

.badge {
  display: inline-block;
  padding: 3px 6px;
  border: 1px solid var(--line-strong);
  border-radius: 2px;
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.1;
}

.btn-quiet {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 10px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--ink);
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  transition: background-color .15s;
}
.btn-quiet:hover:not(:disabled) { background: var(--sunk); }
.btn-quiet:disabled { color: var(--ink-2); opacity: .5; }

.top__link {
  margin-left: auto;
  padding: 8px 4px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  text-decoration: underline;
  text-decoration-color: var(--line-strong);
  text-underline-offset: 3px;
}
.top__link:hover { text-decoration-color: currentColor; }
.top__link + .btn-quiet { margin-left: 0; }

.back-link {
  text-decoration: none;
}

@media (max-width: 440px) {
  .btn-quiet__label {
    position: absolute;
    width: 1px; height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
  .btn-quiet { padding: 10px 6px; }
  .back-link .btn-quiet__label { position: static; width: auto; height: auto; clip: auto; overflow: visible; }
  .top__in { gap: 6px; }
  .mark { margin: 2px; font-size: 17px; padding: 4px 5px 3px; }
  .top__title { font-size: 14px; gap: 4px; }
  .top__title .badge { padding: 2px 4px; font-size: 11px; }
  .top__link { font-size: 13.5px; padding-inline: 0; }
}

@media (max-width: 440px) {
  .top--examples .top__title .badge { display: none; }
}

@media (max-width: 350px) {
  .top__title .badge { display: none; }
  .top--examples .top__title { white-space: normal; line-height: 1.2; }
}

/* ---------- Demo bar (§7b, only with a valid demo code) ---------- */

.demo {
  background: var(--ink);
  color: var(--paper);
  font-size: 13.5px;
  line-height: 1.3;
  animation: fade .2s ease both;
}

.demo__in {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 20px;
  min-height: 40px;
  padding-block: 6px;
}

.demo__mode { margin: 0; font-weight: 500; }

.demo__tg {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 12px;
}
.demo__tg:empty { display: none; }

.demo__note { color: #D9D4CC; }

.demo__btn,
.demo__link {
  padding: 4px 0;
  border: 0;
  background: none;
  color: var(--paper);
  font-size: 13.5px;
  font-weight: 500;
  text-decoration: underline;
  text-decoration-color: rgba(255, 255, 255, .45);
  text-underline-offset: 3px;
}
.demo__btn:hover,
.demo__link:hover { text-decoration-color: currentColor; }
.demo__btn:disabled { opacity: .6; }
.demo__btn--quiet { color: #D9D4CC; font-weight: 400; }

.demo__links {
  margin-left: auto;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 20px;
}

.demo :focus-visible { outline-color: var(--paper); }

@media (max-width: 520px) {
  .demo__links { margin-left: 0; }
}

/* ---------- Chat column ---------- */

.chat {
  flex: 1 0 auto;
  padding-top: 44px;
  padding-bottom: 28px;
}

.intro__text {
  margin: 0;
  max-width: 33em;
  font-size: 22px;
  line-height: 1.42;
  letter-spacing: -.005em;
  text-wrap: pretty;
}

@media (max-width: 520px) {
  .chat { padding-top: 28px; }
  .intro__text { font-size: 19px; line-height: 1.45; }
}

.intro__start { margin-top: 24px; }
.intro__start[hidden] { display: none; }

.chips {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--paper);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.3;
  text-align: left;
  transition: border-color .15s;
}
.chip:hover:not(:disabled) { border-color: var(--ink); }
.chip:disabled { color: var(--ink-2); }

.intro__hint {
  margin: 14px 0 0;
  font-size: 14px;
  color: var(--ink-2);
}

/* ---------- Messages ---------- */

.log { margin-top: 12px; }

.turn { margin-top: 30px; }

.slot:empty { display: none; }

.msg--user {
  display: flex;
  justify-content: flex-end;
}

.bubble {
  animation: rise .22s var(--ease) both;
}

.bubble--user {
  margin: 0;
  max-width: min(80%, 560px);
  padding: 11px 15px;
  border-radius: 6px;
  background: var(--ink);
  color: var(--paper);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.reply { margin-top: 14px; }
.reply:empty { display: none; }

.bubble--bot {
  max-width: 620px;
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--paper);
  overflow-wrap: break-word;
}

/* Markdown-lite output */
.md p { margin: 0 0 .7em; }
.md p:last-child,
.md ul:last-child,
.md ol:last-child { margin-bottom: 0; }
.md ul, .md ol { margin: 0 0 .7em; padding-left: 1.3em; }
.md li { margin: .3em 0; padding-left: .15em; }
.md li::marker { color: var(--ink-2); }
.md strong { font-weight: 600; }
.md .md-h { font-weight: 600; }
.md a {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: var(--line-strong);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
.md a:hover { text-decoration-color: currentColor; }

/* ---------- Typing indicator and status ---------- */

.typing {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 12px;
  margin-top: 14px;
  min-height: 24px;
  color: var(--ink-2);
  font-size: 14px;
}

.stitch {
  flex: none;
  width: 48px;
  height: 2px;
  background: repeating-linear-gradient(90deg, var(--ink) 0 7px, transparent 7px 12px);
  background-size: 12px 2px;
  opacity: .75;
  animation: sew .7s linear infinite;
}

.typing__status { animation: fade .25s ease both; }

.typing__hint {
  flex-basis: 100%;
  padding-left: 60px;
  font-size: 13.5px;
}

/* ---------- System lines ---------- */

.sys {
  margin: 16px 0 0;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 12px;
  font-size: 14px;
  color: var(--ink-2);
  animation: fade .2s ease both;
}

.sys--error .sys__text::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 9px;
  background: var(--accent);
  vertical-align: 2px;
}

.sys__action {
  padding: 4px 0;
  border: 0;
  background: none;
  color: var(--ink);
  font-size: 14px;
  font-weight: 500;
  text-decoration: underline;
  text-decoration-color: var(--line-strong);
  text-underline-offset: 3px;
}
.sys__action:hover:not(:disabled) { text-decoration-color: currentColor; }
.sys__action:disabled { color: var(--ink-2); opacity: .6; }

.handoff {
  margin-top: 22px;
  text-align: center;
  animation: fade .25s ease both;
}

.handoff__rule {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 14px;
  font-weight: 500;
}
.handoff__rule::before,
.handoff__rule::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line-strong);
}

.handoff__summary {
  margin: 8px auto 0;
  max-width: 34em;
  font-size: 14px;
  color: var(--ink-2);
  text-wrap: pretty;
}

/* ---------- Product cards ---------- */

.prow {
  display: flex;
  gap: 12px;
  margin: 14px calc(var(--gutter) * -1) 0;
  padding: 2px var(--gutter) 12px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: var(--gutter);
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}
.prow:focus-visible { outline-offset: -2px; }

.pcard {
  flex: 0 0 236px;
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--paper);
  overflow: hidden;
  animation: rise .25s var(--ease) both;
}

.pcard__media {
  display: block;
  aspect-ratio: 3 / 2;
  border-bottom: 1px solid var(--line);
  background: var(--paper);
}
.pcard__media img {
  display: block;
  width: 100%;
  height: 100%;
  padding: 8px;
  object-fit: contain;
}
.pcard__media.is-empty {
  background: var(--sunk);
}

.pcard__body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 14px 14px;
}

.pcard__name {
  margin: 0;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.pcard__price {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 8px;
  font-variant-numeric: lining-nums tabular-nums;
}

.price { font-size: 16px; font-weight: 600; }
.price--sale { color: var(--accent); }
.price--none { font-size: 14px; font-weight: 500; color: var(--ink-2); }
.price-old { font-size: 13.5px; color: var(--ink-2); }

.specs {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.specs li {
  padding: 3px 6px;
  border-radius: 2px;
  background: var(--surface);
  font-size: 12.5px;
  line-height: 1.3;
}

.pcard__link,
.lead a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--line-strong);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
.pcard__link:hover,
.lead a:hover { text-decoration-color: currentColor; }

.pcard__link {
  margin-top: auto;
  padding-top: 4px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  align-self: flex-start;
  font-size: 14px;
  font-weight: 500;
}

/* ---------- The lead card: a filled-in order slip ---------- */

.lead {
  max-width: 620px;
  margin-top: 16px;
  border: 1px solid var(--ink);
  border-radius: 2px;
  background: var(--paper);
  animation: rise .3s var(--ease) both;
}

.lead__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 16px;
  padding: 18px 22px 14px;
}

.lead__title {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  line-height: 1.3;
}

.lead__meta {
  margin: 0;
  font-size: 13.5px;
  color: var(--ink-2);
  font-variant-numeric: lining-nums tabular-nums;
}

.lead__id {
  color: var(--ink);
  font-weight: 500;
  letter-spacing: .02em;
}

.seam {
  height: 2px;
  margin: 0 22px;
  background: repeating-linear-gradient(90deg, var(--line-strong) 0 7px, transparent 7px 12px);
}

.lead__sub {
  margin: 14px 22px 2px;
  font-size: 14px;
  color: var(--ink-2);
}

.lead__summary {
  margin: 8px 22px 4px;
  font-size: 15px;
  text-wrap: pretty;
}

.lead__group {
  padding: 12px 22px 14px;
}
.lead__group + .lead__group { border-top: 1px solid var(--line); }

.lead__group-h {
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: 600;
}

.kv {
  margin: 0;
  display: grid;
  grid-template-columns: 9.5em minmax(0, 1fr);
  gap: 6px 16px;
}
.kv dt {
  padding-top: 1px;
  font-size: 14px;
  color: var(--ink-2);
}
.kv dd {
  margin: 0;
  font-size: 15px;
  overflow-wrap: anywhere;
}

.lead__text { margin: 0; font-size: 15px; }

.picks {
  list-style: none;
  margin: 0;
  padding: 0;
}
.picks li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  padding: 6px 0;
  font-size: 15px;
}
.picks li + li { border-top: 1px dashed var(--line); }
.picks__price {
  flex: none;
  font-weight: 500;
  font-variant-numeric: lining-nums tabular-nums;
}

.heat {
  display: inline-block;
  padding: 3px 7px;
  border-radius: 2px;
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1.2;
}
.heat--hot { background: var(--accent); color: var(--paper); }
.heat--warm { background: var(--accent-tint); color: var(--accent); }
.heat--cold { background: var(--sunk); color: var(--ink-2); }

.lead__foot {
  margin: 0;
  padding: 10px 22px 14px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  color: var(--ink-2);
}

@media (max-width: 520px) {
  .lead__head, .lead__group { padding-inline: 16px; }
  .lead__sub, .lead__summary { margin-inline: 16px; }
  .seam { margin-inline: 16px; }
  .lead__foot { padding-inline: 16px; }
  .kv { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .kv dt { margin-top: 8px; }
  .kv dt:first-child { margin-top: 0; }
}

/* ---------- Composer ---------- */

.dock {
  position: sticky;
  bottom: 0;
  z-index: 10;
  padding: 12px 0 calc(12px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--line);
  background: var(--surface);
}

.composer { margin: 0 auto; }

.composer__box {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 5px 5px 5px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--paper);
  transition: border-color .15s, box-shadow .15s;
}
.composer__box:focus-within {
  border-color: var(--ink);
  box-shadow: 0 0 0 1px var(--ink);
}

.composer__input {
  flex: 1;
  min-width: 0;
  min-height: 40px;
  max-height: 180px;
  padding: 8px 0;
  border: 0;
  outline: 0;
  resize: none;
  background: transparent;
  color: var(--ink);
  font-size: 16px;
  line-height: 1.5;
}
.composer__input:focus-visible { outline: 0; }
.composer__input::placeholder { color: var(--placeholder); opacity: 1; }
.composer__input:disabled { color: var(--ink-2); background: transparent; }

.composer__count {
  align-self: center;
  font-size: 12.5px;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.composer__count.is-limit { color: var(--accent); }

.send {
  flex: none;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 4px;
  background: var(--ink);
  color: var(--paper);
  transition: background-color .15s;
}
.send:disabled { background: var(--sunk); color: var(--ink-2); }

/* ---------- Footer ---------- */

.foot { padding-top: 6px; padding-bottom: 18px; }
.foot p {
  margin: 0;
  font-size: 13px;
  color: var(--ink-2);
}
.foot a {
  color: inherit;
  text-underline-offset: 3px;
  white-space: nowrap;
}

/* ---------- Manager's desk ---------- */

.desk {
  flex: 1 0 auto;
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(300px, 380px) minmax(0, 1fr);
}

.desk__list {
  position: sticky;
  top: var(--top-h);
  align-self: start;
  max-height: calc(100vh - var(--top-h));
  max-height: calc(100dvh - var(--top-h));
  overflow: auto;
  padding: 20px 20px 32px var(--gutter);
  border-right: 1px solid var(--line);
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}

.desk__section + .desk__section { margin-top: 28px; }

.desk__h {
  margin: 0 0 6px;
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 15px;
  font-weight: 600;
}
.desk__count { color: var(--ink-2); font-weight: 400; font-variant-numeric: tabular-nums; }

.items { list-style: none; margin: 0; padding: 0; }

.item {
  display: block;
  width: 100%;
  padding: 11px 10px 12px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  text-align: left;
  transition: background-color .12s;
}
.item:hover { background: var(--paper); }
.item[aria-current="true"] {
  background: var(--paper);
  box-shadow: inset 3px 0 0 var(--ink);
}

.item__row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
}
.item__title { font-weight: 500; overflow-wrap: anywhere; }
.item__sub {
  display: block;
  margin-top: 2px;
  font-size: 13.5px;
  color: var(--ink-2);
  overflow-wrap: anywhere;
}
.item__row.item__sub { display: flex; }
.item__when {
  flex: none;
  font-size: 13px;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}

.desk__empty { margin: 8px 0 0; font-size: 14px; color: var(--ink-2); }

.desk__detail {
  min-width: 0;
  padding: 24px var(--gutter) 56px 36px;
}

.detail { max-width: 760px; }
.detail:focus { outline: none; }

.detail__back { display: none; margin: 0 0 12px -10px; }

.detail__h {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  line-height: 1.3;
  overflow-wrap: anywhere;
}
.detail__meta {
  margin: 4px 0 0;
  font-size: 14px;
  color: var(--ink-2);
}

.detail__placeholder {
  margin: 40px 0 0;
  color: var(--ink-2);
}

.transcript { margin-top: 28px; }
.transcript__h {
  margin: 0 0 4px;
  font-size: 16px;
  font-weight: 600;
}

.trow {
  padding: 18px 0 20px;
  border-top: 1px solid var(--line);
}
.trow__meta {
  margin: 0 0 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  font-size: 13px;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}
.trow .bubble { animation: none; }
.trow__flag { color: var(--accent); font-weight: 500; }

.tcalls {
  margin: 12px 0;
  display: grid;
  gap: 6px;
}

.tcall,
.tbrief {
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--paper);
}

.tcall > summary,
.tbrief > summary {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 12px;
  padding: 8px 12px;
  font-size: 14px;
  cursor: pointer;
}
.tcall > summary::-webkit-details-marker,
.tbrief > summary::-webkit-details-marker { display: none; }

.tcall > summary::before,
.tbrief > summary::before {
  content: "";
  flex: none;
  width: 6px;
  height: 6px;
  border-right: 1.5px solid var(--ink-2);
  border-bottom: 1.5px solid var(--ink-2);
  transform: translateY(-2px) rotate(-45deg);
  transition: transform .15s;
}
.tcall[open] > summary::before,
.tbrief[open] > summary::before { transform: translateY(-3px) rotate(45deg); }

.tcall__name {
  font: 500 13.5px/1.4 var(--font-code);
}
.tcall__meta {
  font-size: 13px;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}
.tcall__status { font-size: 13px; font-weight: 500; }
.tcall__status.is-bad { color: var(--accent); }

.tcall__body {
  padding: 2px 12px 12px;
  border-top: 1px solid var(--line);
}
.tcall__label {
  margin: 10px 0 4px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-2);
}

.json {
  margin: 0;
  padding: 10px 12px;
  max-height: 380px;
  overflow: auto;
  border-radius: 3px;
  background: var(--surface);
  font: 12.5px/1.5 var(--font-code);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.tbrief { margin-top: 12px; }
.tbrief .json { margin: 0 12px 12px; }

.trow__foot {
  margin: 10px 0 0;
  font-size: 13px;
  color: var(--ink-2);
}

.denied {
  flex: 1 0 auto;
  display: grid;
  place-content: center;
  padding: 48px var(--gutter);
  text-align: center;
}
.denied[hidden] { display: none; }
.denied__h {
  margin: 0;
  font-size: 28px;
  font-weight: 600;
  line-height: 1.2;
}
.denied__p {
  margin: 10px 0 0;
  max-width: 28em;
  color: var(--ink-2);
}

@media (max-width: 860px) {
  .desk { grid-template-columns: minmax(0, 1fr); }
  .desk__list {
    position: static;
    max-height: none;
    padding: 16px var(--gutter) 32px;
    border-right: 0;
  }
  .desk__detail { padding: 16px var(--gutter) 48px; }
  .desk[data-view="detail"] .desk__list { display: none; }
  .desk:not([data-view="detail"]) .desk__detail { display: none; }
  .detail__back { display: inline-flex; }
}

/* ---------- Examples page ---------- */

.ex {
  flex: 1 0 auto;
  width: 100%;
  padding-top: 32px;
  padding-bottom: 48px;
}

.ex__intro {
  margin: 0 0 28px;
  max-width: 36em;
  font-size: 19px;
  line-height: 1.45;
  text-wrap: pretty;
}

.ex__layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 24px;
}

.ex__select-label {
  display: block;
  margin-bottom: 6px;
  font-size: 14px;
  color: var(--ink-2);
}

.ex__select {
  width: 100%;
  padding: 11px 40px 11px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  background: var(--paper) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5 8l5 5 5-5' fill='none' stroke='%2326231F' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 12px center / 16px;
  color: var(--ink);
  font-size: 16px;
  line-height: 1.3;
  -webkit-appearance: none;
  appearance: none;
}

.ex__list { display: none; }

.ex__list .item__sub { margin-top: 3px; }

.ex__head { margin-bottom: 8px; }

.ex__title {
  margin: 0;
  font-size: 24px;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -.01em;
  text-wrap: balance;
}

.ex__subtitle {
  margin: 6px 0 0;
  font-size: 16px;
  color: var(--ink-2);
}

.ex__summary {
  margin: 14px 0 0;
  max-width: 40em;
  font-size: 16px;
  text-wrap: pretty;
}

.ex__dialog {
  margin-top: 8px;
  padding-top: 4px;
  border-top: 1px solid var(--line);
}

.ex-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  margin-top: 24px;
}

.ex-row__main { min-width: 0; }

.ex-row .bubble { animation: none; }

.stage {
  display: inline-block;
  margin-bottom: 8px;
  padding: 2px 7px;
  border: 1px solid var(--line-strong);
  border-radius: 2px;
  color: var(--ink-2);
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1.4;
  font-variant-numeric: lining-nums;
}

.ex-note {
  margin: 0;
  padding: 2px 0 2px 12px;
  border-left: 2px solid var(--line-strong);
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink-2);
}
.ex-note__label {
  display: block;
  margin-bottom: 2px;
  font-size: 12.5px;
  font-weight: 600;
}
.ex-note p { margin: 0; }

.ex-row--visitor .ex-note { justify-self: end; max-width: 30em; }

.ex__status { margin: 8px 0 0; color: var(--ink-2); }

.ex__body:focus { outline: none; }

@media (min-width: 860px) {
  .ex__layout {
    grid-template-columns: 260px minmax(0, 1fr);
    gap: 40px;
    align-items: start;
  }
  .ex__nav {
    position: sticky;
    top: calc(var(--top-h) + 16px);
  }
  .ex__select-label,
  .ex__select { display: none; }
  .ex__list { display: block; border-top: 1px solid var(--line); }
  .ex .prow {
    margin-inline: 0;
    padding-inline: 0;
    scroll-padding-inline: 0;
  }
}

@media (min-width: 1180px) {
  .ex-row {
    grid-template-columns: minmax(0, 1fr) 220px;
    column-gap: 32px;
    align-items: start;
  }
  .ex-row__main { grid-column: 1; }
  .ex-note { grid-column: 2; margin-top: 30px; }
  .ex-row--nostage .ex-note { margin-top: 0; }
  .ex-row--visitor .ex-note { justify-self: stretch; margin-top: 0; }
}

/* ---------- Motion preferences ---------- */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
}
