:root {
  --bg: #f6f4ef;
  --ink: #17171a;
  --soft: rgba(23, 23, 26, 0.58);
  --line: rgba(23, 23, 26, 0.1);
  --accent: #d8402f;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: "Mona Sans Variable", "Mona Sans", system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

.stage {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  place-items: center;
  padding: 8px 12px;
}
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; outline: none; touch-action: manipulation; -webkit-tap-highlight-color: transparent; text-align: left; }
.live { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.tr { position: relative; display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; width: min(348px, 100%); padding: 16px 16px 16px; border-radius: 26px; background: #ffffff; box-shadow: inset 0 0 0 1px var(--line), 0 30px 44px -30px rgba(60, 50, 30, 0.45); }
.tr__head { display: grid; justify-items: start; gap: 6px; padding: 0 2px; }
.tr__kind { display: block; height: 22px; padding: 0 9px; border-radius: 11px; background: color-mix(in srgb, var(--accent) 12%, #ffffff); color: var(--accent); font-family: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace; font-size: 11.500px; line-height: 22px; font-weight: 700; white-space: nowrap; }
.tr__head strong { max-width: 100%; font-size: 16px; line-height: 20px; font-weight: 740; letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* the stack: one row per call, the newest first. The library calls sit folded in a single row that opens */
.tr__frames { list-style: none; display: grid; grid-template-columns: minmax(0, 1fr); border-radius: 14px; background: rgba(23, 23, 26, 0.04); padding: 3px; font-family: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace; }
.tr__f { display: block; overflow: hidden; }
.tr__b { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; column-gap: 10px; width: 100%; height: 30px; padding: 0 10px; border-radius: 11px; font-size: 11.500px; white-space: nowrap; transition: background-color 0.2s ease, box-shadow 0.2s ease; }
.tr__b b { font-weight: 700; overflow: hidden; text-overflow: ellipsis; }
.tr__b i { font-style: normal; font-size: 10.500px; color: rgba(23, 23, 26, 0.5); font-variant-numeric: tabular-nums; }
.tr__f.is-on .tr__b { background: #ffffff; box-shadow: inset 0 0 0 1.500px var(--accent), 0 6px 10px -6px rgba(23, 23, 26, 0.35); }
.tr__f.is-peek:not(.is-on) .tr__b { background: rgba(23, 23, 26, 0.06); }
.tr__f--lib .tr__b { height: 22px; font-size: 10.500px; color: rgba(23, 23, 26, 0.55); padding-left: 22px; }
.tr__f--lib .tr__b b { font-weight: 600; }
.tr__f--fold .tr__b { grid-template-columns: 12px minmax(0, 1fr) auto; column-gap: 6px; color: rgba(23, 23, 26, 0.6); font-family: "Mona Sans Variable", "Mona Sans", system-ui, sans-serif; font-size: 12px; font-weight: 650; }
.tr__f--fold svg { display: block; width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 1.800; stroke-linecap: round; stroke-linejoin: round; }
.tr__f--fold i { font-family: inherit; font-size: 11.500px; font-weight: 700; color: var(--ink); }
.tr__b:focus-visible { box-shadow: inset 0 0 0 2px var(--ink); }

/* the code of the frame in view: three lines, the one that threw in the middle, a wavy mark under the exact spot */
.tr__code { display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px; padding: 9px 12px 10px; border-radius: 14px; background: #17171a; color: rgba(255, 255, 255, 0.9); font-family: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace; }
.tr__clip { display: block; height: 14px; line-height: 14px; overflow: hidden; white-space: nowrap; font-size: 10.500px; color: rgba(255, 255, 255, 0.5); }
.tr__clip span { display: block; overflow: hidden; text-overflow: ellipsis; }
.tr__lines { display: grid; grid-template-columns: minmax(0, 1fr); height: 48px; font-size: 10.500px; line-height: 16px; }
.tr__ln { display: grid; grid-template-columns: 24px minmax(0, 1fr); column-gap: 8px; height: 16px; white-space: pre; }
.tr__ln span:first-child { text-align: right; color: rgba(255, 255, 255, 0.32); font-variant-numeric: tabular-nums; }
.tr__ln span:last-child { overflow: hidden; color: rgba(255, 255, 255, 0.55); }
.tr__ln.is-hit span:first-child { color: color-mix(in srgb, var(--accent) 55%, #ffffff); }
.tr__ln.is-hit span:last-child { color: #ffffff; }
.tr__bad { display: inline-block; color: inherit; background: none; text-decoration: underline wavy color-mix(in srgb, var(--accent) 60%, #ffffff); text-decoration-thickness: 1.200px; text-underline-offset: 2.500px; }
.tr__note { height: 48px; display: grid; align-content: center; font-family: "Mona Sans Variable", "Mona Sans", system-ui, sans-serif; font-size: 12px; line-height: 16px; font-weight: 600; color: rgba(255, 255, 255, 0.6); white-space: normal; }

.ghost { position: absolute; left: 0; top: 0; width: 24px; height: 24px; margin: -3px 0 0 -5px; transform-origin: 20% 15%; pointer-events: none; opacity: 0; fill: #17171a; stroke: #ffffff; stroke-width: 1.300; stroke-linejoin: round; filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3)); z-index: 6; }

@media (max-width: 350px) { .tr { padding: 14px 13px 14px; } .tr__head strong { font-size: 15px; } .tr__b { padding: 0 8px; column-gap: 8px; font-size: 11px; } .tr__lines, .tr__clip { font-size: 10px; } }
@media (prefers-reduced-motion: reduce) { .tr__b { transition: none; } }
