/* AI handoff on Apps. A text card, not a download chip (.fmt). */

.agent-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.15rem;
  box-sizing: border-box;
  max-width: var(--measure);
  margin: 0 0 1.35rem;
  padding: 0.9rem 1.1rem 1rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--panel);
  color: var(--text);
  text-decoration: none;
}

.agent-card:hover,
.agent-card:focus-visible {
  border-color: var(--accent);
}

.agent-card .agent-kicker {
  font-family: var(--font-sans);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  color: var(--accent-text);
}

.agent-card strong {
  font-size: 1.12rem;
  font-weight: 700;
  color: var(--text-strong);
}

.agent-card strong::after {
  content: " \2192";
}

.agent-card > span:last-child {
  color: var(--text-soft);
  line-height: 1.5;
  max-width: 36rem;
}

/* The prompt sits in the reading measure. Copy stays above the block so the
   text is not squeezed beside the button. Lines are wrapped in the source. */
.cmd.agent-prompt {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: 100%;
  max-width: min(100%, var(--prose, 65ch));
  box-sizing: border-box;
}

.cmd.agent-prompt .copy-btn {
  order: -1;
  align-self: flex-start;
  max-height: none;
  margin-bottom: 0.45rem;
}

.cmd.agent-prompt pre {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow-x: auto;
}

.cmd.agent-prompt pre code {
  white-space: pre-wrap;
  overflow-wrap: normal;
  word-break: normal;
  hyphens: manual;
  -webkit-hyphens: manual;
}

/* Three paths, choosable on one row once the page is wide enough. */
body main.works .agent-paths {
  max-width: min(100%, var(--band));
  margin: 0.35rem 0 0.4rem;
  grid-template-columns: minmax(0, 1fr);
}

body main.works .agent-paths a {
  min-height: 44px;
}

body main.works .agent-paths strong::after {
  content: " \2192";
}

@media (min-width: 800px) {
  body main.works .agent-paths {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* ===== Apps shell components (ported from pages.css; Apps-scoped) ===== */
main.works .platforms {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 0 0 1.25rem;
}
main.works .platforms button {
  min-height: 44px;
  min-width: 44px;
  width: 7rem;
  padding: 0 0.75rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font: 650 0.95rem/1 var(--font, system-ui, sans-serif);
  cursor: pointer;
  text-align: center;
}
main.works .platforms button:hover { border-color: var(--accent); }
main.works .platforms button[aria-selected="true"] {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
}
main.works .platforms button.tab-lead:not([aria-selected="true"]) {
  border-color: var(--accent);
}
main.works .app-layout { display: block; min-width: 0; max-width: 100%; }
main.works section.app-panel { margin: 0; min-width: 0; max-width: 100%; }
main.works .app-panel[hidden] { display: none; }
main.works a.cta {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; margin: 0.35rem 0 0.85rem;
}

main.works .formats {
  display: flex; flex-wrap: wrap; gap: 0.75rem; margin: 0 0 0.9rem;
}
main.works .fmt {
  display: flex; flex-direction: column; justify-content: center;
  min-width: min(12rem, 100%); min-height: 64px;
  padding: 0.7rem 1.2rem; border-radius: 12px;
  text-decoration: none; border: 1px solid var(--line);
  color: var(--ink); background: var(--surface);
}
main.works .fmt strong { font-size: 1.1rem; }
main.works .fmt small { font-size: 0.85rem; color: var(--muted); margin-top: 0.15rem; }
main.works a.fmt.main {
  background: var(--accent); border-color: var(--accent); color: var(--accent-ink);
}
main.works a.fmt.main small { color: var(--accent-ink); opacity: 0.9; }
main.works .fmt.soon { border-style: dashed; opacity: 0.75; }
main.works .release-line { color: var(--muted); font-size: 0.95rem; margin: 0.25rem 0 1rem; }
main.works .app-details { max-width: none; }

main.works .facts {
  display: grid; grid-template-columns: 7rem 1fr; gap: 0.35rem 0.9rem;
  max-width: none; margin: 0.75rem 0 1rem; font-size: 0.95rem;
}
main.works .facts dt { margin: 0; color: var(--muted); }
main.works .facts dd { margin: 0; overflow-wrap: anywhere; }
main.works details.more { max-width: none; margin: 1.5rem 0; }
main.works details.more > summary {
  cursor: pointer; font-weight: 700; font-size: 1.05rem;
  min-height: 44px; display: flex; align-items: center; gap: 0.5rem; list-style: none;
}
main.works details.more > summary::-webkit-details-marker { display: none; }
main.works details.more > summary::before { content: "\25B8"; color: var(--accent); font-size: 0.9em; }
main.works details.more[open] > summary::before { content: "\25BE"; }
main.works .poster {
  display: inline-flex; flex-direction: column; gap: 0.4rem;
  margin: 0.5rem 0 1rem; text-decoration: none; color: var(--ink); font-weight: 600;
}
main.works .poster img {
  width: 16rem; max-width: 100%; height: auto;
  border-radius: 8px; border: 1px solid var(--line);
}

main.works .setup { max-width: 100%; margin: 1.25rem 0 2rem; min-width: 0; }
main.works .setup-meta {
  display: grid; grid-template-columns: 6.5rem 1fr; gap: 0.3rem 0.9rem;
  margin: 0 0 0.5rem; padding: 0.9rem 1.1rem;
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
  font-size: 0.95rem; min-width: 0;
}
main.works .setup-meta dt { margin: 0; color: var(--muted); }
main.works .setup-meta dd { margin: 0; }
main.works .tested-line { margin: 0 0 1.25rem; font-size: 0.88rem; color: var(--muted); }
main.works .cmd {
  display: flex; align-items: flex-start; gap: 0.5rem;
  margin: 0 0 0.5rem; min-width: 0; max-width: 100%;
}
main.works .cmd pre {
  flex: 1 1 auto; min-width: 0; max-width: 100%;
  margin: 0; padding: 0.85rem 1rem;
  background: var(--code-bg, var(--surface));
  border: 1px solid var(--line); border-radius: 8px;
  overflow-x: auto; font-size: 0.86rem; line-height: 1.55;
}
main.works .cmd code,
main.works pre.expect code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  white-space: pre; background: none; padding: 0; border: 0; color: var(--ink);
}
main.works .cmd .copy-btn {
  flex: none; min-width: 4.6rem; min-height: 44px;
  padding: 0 0.75rem; border: 1px solid var(--line); border-radius: 8px;
  background: var(--surface); color: var(--ink);
  font: 600 0.85rem/1 var(--font, system-ui, sans-serif); cursor: pointer;
}
main.works .cmd .copy-btn:hover { border-color: var(--accent); }
main.works .cmd .copy-btn.done { border-color: var(--accent); color: var(--accent); }
main.works .expect-label { margin: 0.4rem 0 0.3rem; font-size: 0.85rem; color: var(--muted); font-weight: 600; }
main.works pre.expect {
  margin: 0 0 0.5rem; padding: 0.85rem 1rem;
  border: 1px dashed var(--line); border-radius: 8px;
  background: transparent; overflow-x: auto; max-width: 100%; min-width: 0;
}
@media (max-width: 720px) {
  main.works .setup-meta, main.works .facts { grid-template-columns: 1fr; }
  main.works .platforms button { width: auto; min-width: 5.5rem; padding: 0 1rem; }
}
