/* ==========================================================================
   ANALYSIS «an» — Views/Analysis/Show.cshtml (single user analysis)
   Loaded only on that page (@section PageStyles). Comments use css/ds/comments.css.
   ========================================================================== */
.an { --an-gap: clamp(16px, 10px + 1.2vw, 28px); padding-block: clamp(10px, 6px + 1vw, 22px) clamp(48px, 30px + 3vw, 80px); }
.an-grid { display: grid; grid-template-columns: minmax(0, 52rem) 300px; justify-content: center; gap: var(--an-gap) clamp(24px, 12px + 2vw, 48px); align-items: start; }
.an-main { display: grid; gap: var(--an-gap); min-width: 0; }

/* ---------- header ---------- */
.an-head { display: grid; gap: 14px; min-width: 0; }
.an-kicker { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.an-sym { display: inline-flex; align-items: center; min-height: 30px; padding: 3px 12px; border-radius: var(--ds-r-md); font-size: var(--ds-fs-xs); font-weight: 900; letter-spacing: .02em;
  color: var(--ds-primary-ink); background: var(--ds-primary-soft); box-shadow: inset 0 0 0 1px hsl(199 89% 48% / .28); font-variant-numeric: tabular-nums; }
html.dark-theme .an-sym { color: hsl(199 89% 72%); }
.an-sym-label { font-size: var(--ds-fs-xs); font-weight: 700; color: var(--ds-text-2); }
.an-dir { display: inline-flex; align-items: center; gap: 6px; min-height: 30px; padding: 3px 12px; border-radius: var(--ds-r-pill); font-size: var(--ds-fs-xs); font-weight: 900; }
.an-dir .icon { width: 15px; height: 15px; }
.an-dir--up { color: var(--ds-up-ink); background: var(--ds-up-soft); }
.an-dir--down { color: var(--ds-down-ink); background: var(--ds-down-soft); }
.an-dir--down .icon { transform: scaleY(-1); }
.an-title { margin: 0; font-size: clamp(1.45rem, 1.05rem + 1.7vw, 2.25rem); font-weight: 900; line-height: 1.5; color: var(--ds-text); text-wrap: balance; overflow-wrap: anywhere; }
.an-meta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 18px; padding-top: 14px; border-top: 1px solid var(--ds-line-soft); }
html.dark-theme .an-meta { border-top-color: hsl(0 0% 100% / .07); }
.an-by { display: inline-flex; align-items: center; gap: 10px; min-width: 0; text-decoration: none; }
.an-by > span:last-child { display: grid; line-height: 1.6; min-width: 0; }
.an-by b { display: inline-flex; align-items: center; gap: 6px; font-size: var(--ds-fs-sm); font-weight: 900; color: var(--ds-text); }
.an-by small { font-size: var(--ds-fs-2xs); font-weight: 600; color: var(--ds-text-2); }
.an-by:hover b { color: var(--ds-link); }
.an-av { flex: none; display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; font-size: 1rem; font-weight: 900; color: #fff;
  background: linear-gradient(135deg, hsl(199 89% 48%), hsl(221 83% 53%)); box-shadow: 0 0 0 2px var(--ds-surface-1), 0 0 0 3px hsl(199 89% 48% / .4); }
.an-av--lg { width: 52px; height: 52px; font-size: 1.3rem; }
.an-stats { display: flex; flex-wrap: wrap; gap: 8px; }
.an-stat { display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 0 12px; border-radius: var(--ds-r-pill); font-size: var(--ds-fs-xs); font-weight: 700;
  color: var(--ds-text-2); background: var(--ds-surface-1); border: 1px solid var(--ds-line); text-decoration: none; }
html.dark-theme .an-stat { background: hsl(0 0% 100% / .03); border-color: hsl(0 0% 100% / .1); }
.an-stat .icon { width: 15px; height: 15px; }
.an-stat .num { color: var(--ds-text); font-weight: 900; font-variant-numeric: tabular-nums; }
a.an-stat:hover { border-color: hsl(199 89% 48% / .5); }

/* ---------- chart ---------- */
.an-chart { margin: 0; border-radius: var(--ds-r-xl); overflow: hidden; background: hsl(222 47% 7%); border: 1px solid var(--ds-line); box-shadow: var(--ds-shadow-2); }
html.dark-theme .an-chart { border-color: hsl(0 0% 100% / .08); }
.an-chart img { display: block; width: 100%; height: auto; max-height: 620px; object-fit: contain; margin-inline: auto; cursor: zoom-in; }
.an-chart figcaption { padding: 8px 12px; font-size: var(--ds-fs-2xs); font-weight: 600; text-align: center; color: hsl(215 20% 70%); border-top: 1px solid hsl(0 0% 100% / .07); }
.an-chart--empty { display: grid; justify-items: center; gap: 6px; padding: clamp(32px, 20px + 4vw, 64px) 20px; text-align: center; background: var(--ds-surface-2); box-shadow: none; }
html.dark-theme .an-chart--empty { background: hsl(0 0% 100% / .02); }
.an-chart__ic { display: grid; place-items: center; width: 56px; height: 56px; margin-bottom: 6px; border-radius: var(--ds-r-lg); color: var(--ds-primary-ink); background: var(--ds-primary-soft); }
.an-chart__ic .icon { width: 28px; height: 28px; }
.an-chart--empty b { font-size: var(--ds-fs-sm); font-weight: 900; color: var(--ds-text); }
.an-chart--empty small { font-size: var(--ds-fs-xs); color: var(--ds-text-2); }

/* ---------- body ---------- */
.an-body { min-width: 0; overflow-x: auto; overflow-wrap: anywhere; font-size: clamp(.95rem, .92rem + .15vw, 1.03rem); line-height: 2.05; color: var(--ds-text); }
.an-body > :first-child { margin-top: 0; }
.an-body > :last-child { margin-bottom: 0; }
.an-body p { margin: 0 0 1em; }
.an-body :is(h2, h3, h4) { margin: 1.4em 0 .5em; font-weight: 900; line-height: 1.6; color: var(--ds-text); }
.an-body h2 { font-size: 1.3em; } .an-body h3 { font-size: 1.15em; }
.an-body :is(ul, ol) { margin: 0 0 1em; padding-inline-start: 1.4em; }
.an-body ul { list-style: disc; } .an-body ol { list-style: decimal; }
.an-body li { margin-bottom: .35em; }
.an-body a { color: var(--ds-link); text-decoration: underline; text-underline-offset: 3px; }
.an-body img { max-width: 100%; height: auto; border-radius: var(--ds-r-lg); }
.an-body pre { overflow-x: auto; padding: 12px 14px; border-radius: var(--ds-r-md); background: var(--ds-surface-2); direction: ltr; }
.an-body table { width: 100%; border-collapse: collapse; }
.an-body :is(td, th) { padding: 8px 10px; border: 1px solid var(--ds-line); }
.an-body blockquote { margin: 0 0 1em; padding: 4px 16px; border-inline-start: 3px solid hsl(199 89% 48%); color: var(--ds-text-2); }

.an-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.an-tags li { padding: 4px 10px; border-radius: var(--ds-r-pill); font-size: var(--ds-fs-2xs); font-weight: 800; color: var(--ds-text-2); background: var(--ds-surface-2); }
html.dark-theme .an-tags li { background: hsl(0 0% 100% / .05); }

/* ---------- cards (vote, live links, aside) ---------- */
.an-vote, .an-live, .an-card { padding: clamp(16px, 12px + 1vw, 24px); border-radius: var(--ds-r-xl); background: var(--ds-surface-1); border: 1px solid var(--ds-line); box-shadow: var(--ds-shadow-1); }
html.dark-theme :is(.an-vote, .an-live, .an-card) { background: hsl(0 0% 100% / .025); border-color: hsl(0 0% 100% / .08); box-shadow: none; }
.an-vote { display: grid; gap: 10px; }
.an-vote__head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 12px; }
.an-vote__head h2, .an-live h2 { margin: 0; font-size: var(--ds-fs-body); font-weight: 900; color: var(--ds-text); }
.an-vote__head span { font-size: var(--ds-fs-xs); font-weight: 700; color: var(--ds-text-2); }
.an-meter { display: flex; height: 10px; border-radius: var(--ds-r-pill); overflow: hidden; background: var(--ds-surface-3); gap: 3px; }
.an-meter span { display: block; min-width: 4px; transition: width .4s ease; }
.an-meter__up { background: hsl(152 69% 40%); border-radius: var(--ds-r-pill); }
.an-meter__down { background: hsl(351 83% 55%); border-radius: var(--ds-r-pill); }
.an-meter__k { display: flex; justify-content: space-between; font-size: var(--ds-fs-xs); font-weight: 800; }
.is-up { color: var(--ds-up-ink); } .is-down { color: var(--ds-down-ink); }
.an-vote__opts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 4px; }
.an-vote__opts form { margin: 0; }
.an-opt { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 46px; padding: 0 14px; border-radius: var(--ds-r-lg); font: inherit; font-size: var(--ds-fs-sm); font-weight: 900; cursor: pointer;
  background: transparent; border: 1.5px solid currentColor; transition: background-color .2s ease, color .2s ease, transform .15s ease; }
.an-opt:active { transform: scale(.98); }
.an-opt--up { color: var(--ds-up-ink); } .an-opt--down { color: var(--ds-down-ink); }
.an-opt--up:hover { background: var(--ds-up-soft); } .an-opt--down:hover { background: var(--ds-down-soft); }
.an-opt.is-active { color: #fff; border-color: transparent; }
.an-opt--up.is-active { background: hsl(152 69% 34%); } .an-opt--down.is-active { background: hsl(351 75% 48%); }
.an-opt__n { padding: 1px 8px; border-radius: var(--ds-r-pill); font-size: var(--ds-fs-2xs); background: color-mix(in srgb, currentColor 14%, transparent); font-variant-numeric: tabular-nums; }
.an-opt:focus-visible { outline: 2px solid var(--ds-link); outline-offset: 2px; }

.an-live { display: grid; gap: 12px; }
.an-live__links { display: flex; flex-wrap: wrap; gap: 8px; }
.an-live__links .icon { width: 15px; height: 15px; }

/* ---------- aside ---------- */
.an-side { position: sticky; top: 96px; display: grid; gap: 16px; }
.an-card { display: grid; gap: 14px; }
.an-card__k { font-size: var(--ds-fs-2xs); font-weight: 900; letter-spacing: .02em; color: var(--ds-text-2); }
.an-author__who { display: flex; align-items: center; gap: 12px; min-width: 0; text-decoration: none; }
.an-author__txt { display: grid; gap: 2px; min-width: 0; }
.an-author__txt b { display: flex; align-items: center; gap: 6px; min-width: 0; font-size: var(--ds-fs-body); font-weight: 900; color: var(--ds-text); }
.an-author__n { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.an-author__txt small { font-size: var(--ds-fs-xs); color: var(--ds-text-2); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.8; }
.an-author__who:hover .an-author__n { color: var(--ds-link); }
.an-author__since { display: inline-flex; align-items: center; gap: 6px; font-size: var(--ds-fs-xs); font-weight: 600; color: var(--ds-text-2); }
.an-author__since .icon { width: 14px; height: 14px; }
.an-dl { display: grid; margin: 0; }
.an-dl > div { display: flex; align-items: center; justify-content: space-between; padding: 9px 0; border-bottom: 1px dashed var(--ds-line); }
.an-dl > div:last-child { border-bottom: 0; padding-bottom: 0; }
.an-dl > div:first-child { padding-top: 0; }
.an-dl dt { font-size: var(--ds-fs-xs); font-weight: 700; color: var(--ds-text-2); }
.an-dl dd { margin: 0; font-size: var(--ds-fs-sm); font-weight: 900; color: var(--ds-text); font-variant-numeric: tabular-nums; }
.an-dl dd.is-up { color: var(--ds-up-ink); } .an-dl dd.is-down { color: var(--ds-down-ink); }
.an-cta { display: grid; gap: 10px; padding: 20px; border-radius: var(--ds-r-xl); color: #fff;
  background: radial-gradient(120% 90% at 100% 0%, hsl(199 89% 48% / .35), transparent 60%), linear-gradient(160deg, hsl(222 47% 13%), hsl(222 47% 8%)); border: 1px solid hsl(199 89% 48% / .25); }
.an-cta__t { display: flex; align-items: center; gap: 8px; font-size: var(--ds-fs-sm); font-weight: 900; }
.an-cta__t .icon { width: 17px; height: 17px; color: hsl(45 93% 58%); }
.an-cta p { margin: 0; font-size: var(--ds-fs-xs); line-height: 1.9; color: hsl(215 25% 78%); }
.an-back { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; border-radius: var(--ds-r-lg); font-size: var(--ds-fs-sm); font-weight: 800; color: var(--ds-text-2); text-decoration: none; border: 1px dashed var(--ds-line-strong); }
.an-back .icon { width: 16px; height: 16px; }
.an-back:hover { color: var(--ds-link); border-color: hsl(199 89% 48% / .5); }

@media (max-width: 1023px) {
  .an-grid { grid-template-columns: minmax(0, 1fr); }
  .an-side { position: static; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
  .an-back { grid-column: 1 / -1; }
}
@media (max-width: 479px) {
  .an-meta { flex-direction: column; align-items: flex-start; }
  .an-chart { margin-inline: calc(-1 * var(--page-x, 16px)); border-radius: 0; border-inline: 0; }
}
@media (prefers-reduced-motion: reduce) { .an-meter span, .an-opt { transition: none; } }

/* phase27: follow analysts (per-device, Views/Shared/_FollowAuthors.cshtml) */
.af-btn { gap: 6px; }
.af-btn .icon { width: 15px; height: 15px; }
.af-btn.is-on { background: var(--ds-surface-2); color: var(--ds-text); border: 1px solid var(--ds-line-strong); box-shadow: none; }
.af-btn.is-on .icon { color: hsl(350 80% 55%); fill: currentColor; }
.af-strip { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin: -12px 0 20px; padding: 10px 14px; border: 1px solid var(--ds-line); border-radius: var(--ds-r-lg); background: var(--ds-surface-1); }
.af-strip[hidden], .af-none[hidden] { display: none; }
.af-strip__t { display: inline-flex; align-items: center; gap: 6px; font-size: var(--ds-fs-xs); font-weight: 900; color: var(--ds-text-2); }
.af-strip__t .icon { width: 14px; height: 14px; color: hsl(350 80% 55%); }
.af-chips { display: flex; flex-wrap: wrap; gap: 6px; flex: 1; min-width: 0; }
.af-chip { padding: 3px 10px; border-radius: var(--ds-r-pill); background: var(--ds-surface-2); border: 1px solid var(--ds-line-soft); font-size: var(--ds-fs-xs); font-weight: 800; color: var(--ds-text); text-decoration: none; }
.af-chip:hover, .af-chip:focus-visible { color: var(--ds-link); border-color: var(--ds-primary); }
.af-only { padding: 5px 12px; border-radius: var(--ds-r-pill); border: 1px solid var(--ds-line-strong); background: transparent; color: var(--ds-text-2); font: inherit; font-size: var(--ds-fs-xs); font-weight: 900; cursor: pointer; }
.af-only[aria-pressed="true"] { background: var(--ds-primary-soft); color: var(--ds-primary-ink); border-color: var(--ds-primary); }
.af-none { margin: 0 0 20px; padding: 14px; text-align: center; border: 1px dashed var(--ds-line); border-radius: var(--ds-r-lg); font-size: var(--ds-fs-sm); font-weight: 700; color: var(--ds-text-2); }

/* p35 (7.5): share card */
.an-share { display: grid; gap: 10px; }
.an-share__row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.an-share__row .ds-btn { justify-content: center; }
