/* Analysis page: a single chat-style stream on white */
body.az { background: #fff; min-height: 100dvh; }
.az-top { position: sticky; top: 0; z-index: 5; display: flex; justify-content: space-between; align-items: center; padding: 16px 24px; background: rgba(255,255,255,.92); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.az-new { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 14.5px; font-weight: 500; }
.az-new:hover { color: var(--ink); }
.az-new[hidden] { display: none; }
.az-main { width: 100%; max-width: 700px; margin: 0 auto; padding: 20px 20px 120px; }

/* Start */
.az-start { text-align: center; padding-top: 16vh; }
.az-start[hidden], .chat[hidden] { display: none; }
.az-start h1 { font: 800 clamp(32px, 5vw, 48px)/1.05 var(--display); letter-spacing: -.03em; margin: 0 0 26px; }

/* Chat */
.chat { padding-top: 6vh; }
.ask-bubble { width: fit-content; margin: 0 0 34px auto; padding: 10px 16px; border-radius: 20px; background: #f1f2f6; color: var(--ink); font-size: 16px; }
.stream { font-size: 16.5px; line-height: 1.7; color: #1f2233; }

/* A working line: spinner + shimmer text, collapses to a quiet gray line when done */
.st { display: flex; align-items: center; gap: 10px; min-height: 28px; font-size: 15px; color: var(--muted); margin: 22px 0 6px; }
.st:first-child { margin-top: 0; }
.st .sp { width: 15px; height: 15px; flex: none; border-radius: 50%; border: 2px solid #e3e5ee; border-top-color: #3a3f5c; animation: spin .75s linear infinite; }
.st.done .sp { display: none; }
.st .ok { display: none; font-size: 15px; color: #a4a9c2; }
.st.done .ok { display: inline; }
.st .t { transition: color .3s; }
.st.live .t { color: #3a3f5c; font-weight: 500; }
.st em { font-style: normal; font: 500 12.5px var(--mono); color: #b0b4c8; margin-left: 2px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Sources read, like search result chips */
.src { display: flex; flex-wrap: wrap; gap: 6px; margin: 2px 0 12px 25px; }
.src a, .src span { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 4px 10px 4px 6px; border-radius: 999px; background: #f4f5f8; color: #50556f; font-size: 13px; line-height: 1.4; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.src a:hover { background: #eceef4; color: var(--ink); }
.src img { width: 16px; height: 16px; border-radius: 4px; flex: none; }
.src .bad { color: #b3261e; }
.src .bad i, .src .good i { font-size: 12px; }
.src .good i { color: var(--green); }

/* Streamed findings */
.stream p { margin: 4px 0 14px 25px; }
.stream p b { font-weight: 600; color: var(--ink); }
.stream p .x { color: #c02b20; font-weight: 600; }
.stream p .y { color: #0b8a55; font-weight: 600; }
.cur { display: inline-block; width: 9px; height: 9px; margin-left: 4px; border-radius: 50%; background: var(--ink); vertical-align: middle; animation: pulse 1s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(.7); opacity: .5; } }

/* The result: small score and one button */
.result { display: flex; align-items: center; gap: 18px; margin: 34px 0 0; padding: 18px 18px 18px 20px; border: 1px solid var(--line); border-radius: 18px; background: #fff; box-shadow: 0 1px 2px rgba(20,22,60,.04), 0 12px 30px -18px rgba(20,22,60,.22); }
.ring { position: relative; width: 62px; height: 62px; flex: none; display: grid; place-items: center; }
.ring svg { position: absolute; inset: 0; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 6; }
.ring .tr { stroke: #eef0f5; }
.ring .br { stroke: var(--c); stroke-linecap: round; stroke-dasharray: 164; stroke-dashoffset: 164; transition: stroke-dashoffset 1.2s cubic-bezier(.65,0,.35,1); }
.ring b { font: 800 20px/1 var(--display); color: var(--ink); }
.result .txt { flex: 1; min-width: 0; }
.result .txt b { display: block; font-size: 16px; color: var(--ink); }
.result .txt span { font-size: 14.5px; color: var(--muted); }
.fix-now { flex: none; display: inline-flex; align-items: center; gap: 8px; padding: 13px 22px; border-radius: 12px; background: var(--ink); color: #fff; font-weight: 600; font-size: 16px; transition: transform .15s, background .15s; }
.fix-now:hover { background: var(--brand); transform: translateY(-1px); }
.fix-now:active { transform: translateY(1px); }
.more { margin: 12px 0 0 4px; }
.more summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; font-size: 14px; color: var(--muted); }
.more summary::-webkit-details-marker { display: none; }
.more summary:hover { color: var(--ink); }
.more[open] summary i { transform: rotate(180deg); }
.more summary i { transition: transform .2s; }
.more ul { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 7px; font-size: 14.5px; color: #50556f; }
.more li { display: flex; gap: 9px; align-items: baseline; }
.more li::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--d, #e29a00); flex: none; transform: translateY(-2px); }
.more li.high { --d: #d92d20; }

.err { margin: 4px 0 0 25px; }
.err a { color: var(--brand); font-weight: 600; }

@media (prefers-reduced-motion: no-preference) {
  .st.live .t {
    background: linear-gradient(100deg, #9aa0ba 0%, #9aa0ba 40%, #1f2233 50%, #9aa0ba 60%, #9aa0ba 100%);
    background-size: 250% 100%; -webkit-background-clip: text; background-clip: text; color: transparent;
    animation: shimmer 1.7s linear infinite;
  }
  @keyframes shimmer { from { background-position: 100% 0; } to { background-position: -150% 0; } }
  .src > * , .result, .more { animation: rise .4s cubic-bezier(.16,1,.3,1) both; }
  .src > *:nth-child(2) { animation-delay: .08s; } .src > *:nth-child(3) { animation-delay: .16s; } .src > *:nth-child(4) { animation-delay: .24s; }
  @keyframes rise { from { opacity: 0; transform: translateY(4px); } }
}
@media (prefers-reduced-motion: reduce) { .st .sp, .cur { animation: none; } }

@media (max-width: 560px) {
  .az-top { padding: 12px 16px; }
  .az-new span { display: none; }
  .az-main { padding: 12px 16px 80px; }
  .chat { padding-top: 2vh; }
  .stream { font-size: 16px; }
  .stream p, .src, .err { margin-left: 0; }
  .result { flex-wrap: wrap; }
  .fix-now { width: 100%; justify-content: center; }
}
