/* A prompt to paste into an AI agent: a light input box under the agent's
   window bar. It matches the ```text Agent
   blocks lessons draw with pre.is-prompt. */
.lesson-prompt {
  position: relative;
  margin: 1.25rem 0;
  background: var(--bg, #ffffff);
  color: var(--ink, #10283d);
  border: 1px solid var(--rule, rgba(16, 40, 61, 0.12));
  border-radius: 10px;
  box-shadow: 0 1px 2px rgba(16, 40, 61, 0.04), 0 12px 32px rgba(16, 40, 61, 0.10);
  overflow: hidden;
}

.lesson-prompt-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.75rem 0.5rem 1.25rem;
  /* The warm off-white agent apps use, shared with the prompt blocks. */
  background: #f3f1ec;
  border-bottom: 1px solid rgba(31, 30, 27, 0.10);
  font-size: 0.75rem;
  color: var(--ink-soft, #4b5d6e);
}


.lesson-prompt-title { flex: 1; min-width: 0; white-space: nowrap; }

.lesson-prompt-os { display: inline-flex; gap: 2px; }

.lesson-prompt-pill,
.lesson-prompt-pill:hover,
.lesson-prompt-pill:focus {
  height: 24px;
  min-height: 0;
  padding: 0 0.6rem;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 0.75rem;
  color: var(--ink-soft, #4b5d6e);
  box-shadow: none;
}
.lesson-prompt-pill:hover { color: var(--ink, #10283d); }
.lesson-prompt-pill.is-on,
.lesson-prompt-pill.is-on:hover {
  background: var(--bg, #ffffff);
  border-color: var(--rule, rgba(16, 40, 61, 0.15));
  color: var(--ink, #10283d);
}

.lesson-prompt-copy,
.lesson-prompt-copy:hover,
.lesson-prompt-copy:focus {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  min-height: 0;
  padding: 0;
  background: transparent;
  border: 1px solid var(--rule, rgba(16, 40, 61, 0.18));
  border-radius: var(--radius-sm);
  color: var(--ink-soft, #4b5d6e);
  box-shadow: none;
}
.lesson-prompt-copy:hover { color: var(--ink, #10283d); border-color: var(--ink-soft, #4b5d6e); }
.lesson-prompt-copy.is-copied { color: var(--success); }
.lesson-prompt-copy svg { width: 14px; height: 14px; }

.post-body .lesson-prompt-text,
.lesson-prompt-text {
  margin: 0;
  /* The bottom padding is where an overlay scrollbar lands, under the last
     line rather than over it. */
  padding: 1rem 1.25rem 1.75rem;
  background: transparent;
  color: inherit;
  border-radius: 0;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  line-height: 1.6;
  white-space: pre;
  overflow-x: auto;
}

/* One line stays one line and scrolls; a wrapped command reads as two. The
   fade on the right says there is more, the same as the install panel's. */
.lesson-prompt-text {
  -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 56px), transparent);
          mask-image: linear-gradient(to right, #000 calc(100% - 56px), transparent);
}

/* Click anywhere to copy. The box lifts off the page on hover to say so,
   like the install panel, without recolouring what you are reading. */
.lesson-prompt {
  cursor: pointer;
}
.lesson-prompt:hover {
  box-shadow: 0 1px 2px rgba(16, 40, 61, 0.04), 0 18px 40px -8px rgba(16, 40, 61, 0.22);
}
.lesson-prompt.is-terminal:hover {
  box-shadow: 0 18px 40px -10px rgba(7, 12, 19, 0.55);
}
/* Selected text keeps an explicit colour; see the ::selection note in
   app/lib/copy-code-buttons.css. */
.lesson-prompt ::selection {
  background: var(--accent-soft, #ebf6fc);
  color: #10283d;
}
.lesson-prompt.is-terminal ::selection {
  background: rgba(73, 169, 231, 0.42);
  color: #f2f7fb;
}
@media (prefers-reduced-motion: no-preference) {
  .lesson-prompt { transition: box-shadow 140ms ease-out; }
}


/* Terminal mode: the same box on the dark surface the lesson's code blocks
   use, since these are commands for a shell rather than words for an agent. */
.lesson-prompt.is-terminal {
  background: #1e1e1e;
  color: #d4d4d4;
  border-color: #1e1e1e;
}
.lesson-prompt.is-terminal .lesson-prompt-bar {
  background: rgba(255, 255, 255, 0.04);
  border-bottom-color: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.62);
}
.lesson-prompt.is-terminal .lesson-prompt-pill,
.lesson-prompt.is-terminal .lesson-prompt-copy {
  color: rgba(255, 255, 255, 0.62);
}
.lesson-prompt.is-terminal .lesson-prompt-pill:hover,
.lesson-prompt.is-terminal .lesson-prompt-copy:hover {
  color: #ffffff;
}
.lesson-prompt.is-terminal .lesson-prompt-pill.is-on {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.18);
  color: #ffffff;
}
.lesson-prompt.is-terminal .lesson-prompt-copy {
  border-color: rgba(255, 255, 255, 0.18);
}

/* On a phone the three platform pills and the title do not fit one row, so
   the pills give way to a native select, which also gives a phone its own
   picker. */
.lesson-prompt-select { display: none; }

@media (max-width: 30rem) {
  .lesson-prompt-os { display: none; }

  .lesson-prompt-select {
    display: block;
    height: 26px;
    min-height: 0;
    padding: 0 1.5rem 0 0.6rem;
    font-size: 0.75rem;
    color: var(--ink, #10283d);
    background-color: var(--bg, #ffffff);
    border: 1px solid var(--rule, rgba(16, 40, 61, 0.15));
    border-radius: 999px;
    box-shadow: none;
    width: auto;
  }

  .lesson-prompt.is-terminal .lesson-prompt-select {
    color: #ffffff;
    background-color: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.18);
    color-scheme: dark;
  }
}

/* Each box carries the icon of what it is, a speech bubble for the agent
   chat and a prompt for a terminal, rather than window dots. */
.lesson-prompt-icon {
  width: 14px;
  height: 14px;
  flex: none;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='1.5' stroke-linejoin='round'%3E%3Cpath d='M2.5 3.5h11v7h-6l-3 2.5v-2.5h-2z'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='1.5' stroke-linejoin='round'%3E%3Cpath d='M2.5 3.5h11v7h-6l-3 2.5v-2.5h-2z'/%3E%3C/svg%3E") center / contain no-repeat;
}
.lesson-prompt-icon.is-terminal-icon {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 4.5 6.5 8 3 11.5M8.5 11.5h4.5'/%3E%3C/svg%3E");
          mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 4.5 6.5 8 3 11.5M8.5 11.5h4.5'/%3E%3C/svg%3E");
}
