/* Geekcon AI Studio — the output document: warm paper on the dark lab, so AI work reads like a real brief.
   Also the streaming run panel that hosts it. */

.rp { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; min-height: 0; overflow: hidden; }
.rp::before { /* activity edge: amber shimmer while writing, green when done, red on error */
  content: "";
  position: absolute;
  left: 22px;
  right: 22px;
  top: 0;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, transparent, var(--rp-c, rgba(255, 241, 210, 0.3)), transparent);
  opacity: 0.9;
}
.rp[data-state="running"] { --rp-c: var(--amber-500); }
.rp[data-state="running"]::before { background-size: 200% 100%; background-image: linear-gradient(90deg, transparent 0%, var(--amber-500) 25%, var(--cyan-400) 50%, var(--amber-500) 75%, transparent 100%); animation: shimmer 1.6s linear infinite; }
.rp[data-state="done"] { --rp-c: var(--ok); }
.rp[data-state="error"] { --rp-c: var(--stop); }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }
.rp-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 18px 22px 14px; flex-wrap: wrap; }
.rp-title { display: flex; align-items: center; gap: 12px; min-width: 0; }
.rp-title h2 { font: 500 19px/1.3 var(--font-display); white-space: nowrap; }
.rp-state { color: var(--mute); font-size: 14px; white-space: nowrap; }
.rp-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--rp-c, var(--mute)); flex: none; box-shadow: 0 0 12px var(--rp-c, transparent); }
.rp[data-state="running"] .rp-dot { animation: pulse 1.2s ease-in-out infinite; }
.rp-meta { display: flex; align-items: center; gap: 10px; }
.rp-timer { display: inline-flex; align-items: center; gap: 8px; min-width: 92px; justify-content: flex-end; font: 500 22px/1 var(--font-display); font-variant-numeric: tabular-nums; color: var(--paper); }
.rp-timer svg { width: 18px; height: 18px; color: var(--mute); }
.rp[data-state="running"] .rp-timer { color: var(--amber-300); }
.rp-scroll { min-height: 0; overflow: auto; padding: 0 18px 18px; scrollbar-width: thin; scrollbar-color: #4A4445 transparent; }
.rp-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 14px 18px 18px; border-top: 1px solid var(--line-soft); }
.rp-foot .spacer { flex: 1 1 auto; }
.rp-err { margin: 0 18px 14px; padding: 12px 16px; border-radius: 12px; background: rgba(255, 107, 107, 0.1); border: 1px solid rgba(255, 107, 107, 0.45); color: #FFC9C9; font-size: 14.5px; }

/* ---------- paper document ---------- */
.doc {
  --ink: #1B1819;
  --ink-2: #4A4245;
  --rule: #D9D0BF;
  position: relative;
  min-height: 280px;
  padding: clamp(22px, 2.2vw, 40px) clamp(20px, 2.4vw, 44px) 36px;
  border-radius: 18px;
  background:
    radial-gradient(120% 60% at 0% 0%, rgba(253, 178, 25, 0.1), transparent 55%),
    linear-gradient(180deg, #FBF8F1, var(--paper-doc));
  color: var(--ink);
  box-shadow: 0 30px 60px -30px rgba(0, 0, 0, 0.9), 0 0 0 1px rgba(255, 255, 255, 0.6) inset;
  font: 400 clamp(15px, 0.2vw + 12.5px, 17px) / 1.72 var(--font-body);
  overflow-wrap: anywhere;
}
.doc > :first-child { margin-top: 0; }
.doc h1, .doc h2, .doc h3, .doc h4 { font-family: var(--font-display); font-weight: 500; color: var(--ink); line-height: 1.32; }
.doc h1 { font-size: 1.6em; margin: 0 0 0.6em; padding-bottom: 0.45em; border-bottom: 3px solid transparent; border-image: linear-gradient(90deg, var(--amber-500) 0 72px, var(--rule) 72px) 1; }
.doc h2 { font-size: 1.22em; margin: 1.5em 0 0.5em; display: flex; gap: 10px; align-items: baseline; }
.doc h2::before { content: ""; flex: none; width: 8px; height: 8px; border-radius: 2px; background: var(--amber-500); transform: translateY(-2px) rotate(45deg); }
.doc h3 { font-size: 1.06em; margin: 1.2em 0 0.4em; color: #6E4700; }
.doc h4 { font-size: 1em; margin: 1em 0 0.3em; }
.doc p { margin: 0.6em 0; }
.doc strong { font-weight: 600; color: #000; }
.doc a { color: #0B6D80; text-decoration: underline; text-underline-offset: 3px; }
.doc a:hover { color: #08515F; }
.doc code { font: 500 0.86em/1 var(--font-mono); padding: 2px 6px; border-radius: 6px; background: rgba(33, 29, 30, 0.07); color: #6E4700; }
.doc pre { margin: 1em 0; padding: 14px 16px; border-radius: 12px; background: #211D1E; color: var(--paper); overflow: auto; }
.doc pre code { background: none; color: inherit; padding: 0; font-size: 13px; line-height: 1.6; }
.doc ul, .doc ol { margin: 0.5em 0; padding-left: 1.4em; }
.doc ul { list-style: none; }
.doc ul > li { position: relative; }
.doc ul > li::before { content: ""; position: absolute; left: -1em; top: 0.72em; width: 6px; height: 6px; border-radius: 50%; background: #B97C00; }
.doc ol { list-style: decimal; }
.doc ol > li::marker { color: #9A6400; font-family: var(--font-display); font-weight: 500; }
.doc li { margin: 0.28em 0; }
.doc li.task { display: flex; gap: 10px; align-items: flex-start; margin-left: -1.2em; }
.doc li.task::before { display: none; }
.doc li.task .box { flex: none; width: 18px; height: 18px; margin-top: 0.3em; border-radius: 5px; border: 2px solid #B97C00; background: #fff; }
.doc li.task.done .box { background: #13885B url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12.5 4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / 13px no-repeat; border-color: #13885B; }
.doc blockquote { margin: 1em 0; padding: 10px 16px; border-left: 4px solid var(--amber-500); background: rgba(253, 178, 25, 0.1); border-radius: 0 10px 10px 0; color: var(--ink-2); }
.doc hr { border: 0; height: 1px; margin: 1.6em 0; background: var(--rule); }
.doc .tbl { margin: 1em 0; overflow-x: auto; border-radius: 12px; border: 1px solid var(--rule); background: #fff; }
.doc table { width: 100%; border-collapse: collapse; font-size: 0.93em; line-height: 1.5; }
.doc th { text-align: left; font: 500 0.92em/1.35 var(--font-display); color: var(--paper); background: #211D1E; padding: 10px 12px; white-space: nowrap; }
.doc td { padding: 9px 12px; border-top: 1px solid #ECE5D8; vertical-align: top; min-width: 90px; }
.doc tbody tr:nth-child(even) td { background: #FBF8F2; }
.doc .pf { display: inline-block; padding: 1px 9px; border-radius: 6px; font: 600 0.82em/1.6 var(--font-mono); letter-spacing: 0.06em; }
.doc .pf.pass { background: #13885B; color: #fff; }
.doc .pf.fail { background: #C43B3B; color: #fff; }
.doc .caret { display: inline-block; width: 9px; height: 1.1em; margin-left: 3px; vertical-align: -0.18em; border-radius: 2px; background: var(--amber-500); animation: blink 1s steps(2, start) infinite; }
@keyframes blink { to { visibility: hidden; } }
@media (prefers-reduced-motion: reduce) { .doc .caret, .rp[data-state="running"]::before { animation: none; } }

/* empty / waiting skeleton */
.doc-empty { display: grid; gap: 14px; color: #8B8279; }
.doc-empty .ln { height: 12px; border-radius: 6px; background: linear-gradient(90deg, #E9E1D2, #F1EBDF); }
.doc-empty .ln.h { height: 22px; width: 46%; background: linear-gradient(90deg, #E2D6BF, #EFE7D8); }
.doc-empty p { margin-top: 10px; font: 400 15px/1.6 var(--font-body); }
.doc-meta { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: -0.4em 0 1.2em; font-size: 13px; color: #7A7068; }
