/* /analyse/ — builds on index.css (no 3D background) */
html.pre-light body { background: #f2f0f7; }
body { min-height: 100vh; display: flex; flex-direction: column; }
.an-main { position: relative; z-index: 20; flex: 1; width: 100%; max-width: 1200px; margin: 0 auto; padding: 96px 40px 80px; }

.nav-pill { text-decoration: none; color: inherit; font-weight: 600; font-size: 14px; margin-right: 15px; padding: 6px 14px; border-radius: 20px; background: rgba(128,128,128,.1); border: 1px solid rgba(128,128,128,.2); transition: opacity .2s; font-family: var(--font-body); }
.nav-pill:hover { opacity: .8; color: inherit; }
.nav-user { display: flex; align-items: center; gap: 8px; padding: 4px 12px 4px 4px; }
.nav-links a.nav-active { color: var(--text); }
.nav-links a.bmc-btn { color: #000; }

/* Hero / form */
.an-hero { margin-bottom: 28px; transition: margin .2s; }
.an-hero h1 { margin-bottom: 20px; }
.an-hero h1 .slant { margin-left: .1em; }
body.light-mode .an-hero h1 { color: #1a1726; }
.an-sub { font-size: 13px; line-height: 1.85; color: var(--muted); max-width: 560px; margin-bottom: 28px; }
.an-hero.compact .hero-eyebrow, .an-hero.compact h1, .an-hero.compact .an-sub { display: none; }
.an-form { display: flex; gap: 10px; max-width: 760px; }
.an-input { flex: 1; min-width: 0; background: var(--surface); color: var(--text); border: 1px solid var(--border2); border-radius: 2px; padding: 12px 16px; font-family: var(--font-mono); font-size: 13px; outline: none; transition: border-color .15s; }
.an-input::placeholder { color: var(--muted2); }
.an-input:focus { border-color: var(--accent); }
.an-btn:disabled { opacity: .55; cursor: not-allowed; }
.an-error { margin-top: 14px; max-width: 760px; font-family: var(--font-mono); font-size: 12px; color: var(--accent2); background: rgba(255,0,64,.08); border: 1px solid rgba(255,0,64,.3); border-radius: 2px; padding: 10px 14px; }

/* Loading */
.an-loading { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 56px 0; }
.an-spin { font-family: var(--font-mono); font-size: 26px; color: var(--accent); width: 1ch; line-height: 1; }
.an-loading-text { font-family: var(--font-mono); font-size: 12px; color: var(--muted); letter-spacing: 1px; }

/* display: flex/grid on these would otherwise override the [hidden] attribute */
.an-loading[hidden], .an-result[hidden], .an-error[hidden] { display: none; }

/* Result layout */
.an-result { display: flex; flex-direction: column; gap: 16px; animation: an-in .35s ease both; }
@keyframes an-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.an-status { display: flex; align-items: center; gap: 12px; padding: 14px 22px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); font-size: 13px; }
.an-status b { font-weight: 700; }
.an-status span { color: var(--muted); font-size: 12px; }
.an-check { width: 22px; height: 22px; border-radius: 50%; background: #2ecc71; display: grid; place-items: center; flex-shrink: 0; }

.an-layout { display: grid; grid-template-columns: 270px 1fr; gap: 28px; align-items: start; }
.an-side { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.an-cover { position: relative; width: 100%; border-radius: 16px; overflow: hidden; background: var(--surface2); border: 1px solid var(--border); max-height: 480px; }
.an-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.an-cover.playable { cursor: pointer; }
.an-cover.playing { background: #000; }
.an-cover video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #000; display: block; }
.an-play { pointer-events: none; position: absolute; inset: 0; display: grid; place-items: center; background: linear-gradient(to top, rgba(0,0,0,.35), transparent 55%); transition: background .15s; }
.an-play[hidden] { display: none; }
.an-play-btn { width: 60px; height: 60px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: rgba(0,0,0,.6); border: 1px solid rgba(255,255,255,.35); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); transition: transform .15s, background .15s; }
.an-play-btn svg { width: 26px; height: 26px; display: block; }
.an-cover.playable:hover .an-play-btn, .an-cover.playable:focus-visible .an-play-btn { transform: scale(1.08); background: var(--accent); border-color: var(--accent); }
.an-cover:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.an-ctrl { position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; display: flex; align-items: center; gap: 10px; padding: 26px 12px 10px; background: linear-gradient(to top, rgba(0,0,0,.78), transparent); cursor: default; }
.an-time { font-family: var(--font-mono); font-size: 11px; color: #fff; white-space: nowrap; font-variant-numeric: tabular-nums; }
.an-seek { --p: 0%; flex: 1; min-width: 0; height: 16px; margin: 0; background: transparent; cursor: pointer; -webkit-appearance: none; appearance: none; }
.an-seek:focus { outline: none; }
.an-seek::-webkit-slider-runnable-track { height: 4px; border-radius: 2px; background: linear-gradient(to right, var(--accent) var(--p), rgba(255,255,255,.3) var(--p)); }
.an-seek::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 12px; height: 12px; margin-top: -4px; border-radius: 50%; background: #fff; border: 0; box-shadow: 0 0 0 2px rgba(0,0,0,.25); }
.an-seek::-moz-range-track { height: 4px; border-radius: 2px; background: rgba(255,255,255,.3); }
.an-seek::-moz-range-progress { height: 4px; border-radius: 2px; background: var(--accent); }
.an-seek::-moz-range-thumb { width: 12px; height: 12px; border-radius: 50%; background: #fff; border: 0; }
.an-seek:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 3px var(--accent); }
.an-play-err { position: absolute; left: 10px; right: 10px; bottom: 10px; font-family: var(--font-mono); font-size: 11px; text-align: center; background: rgba(0,0,0,.8); color: #fff; padding: 6px 10px; border-radius: 8px; }
.an-dur { position: absolute; left: 10px; bottom: 10px; font-family: var(--font-mono); font-size: 11px; font-weight: 600; background: rgba(0,0,0,.72); color: #fff; padding: 3px 8px; border-radius: 8px; }
.an-author { display: flex; align-items: center; gap: 12px; }
.an-avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; font-family: var(--font-display); font-weight: 800; font-size: 18px; flex-shrink: 0; }
.an-avatar.has-img { background: var(--surface2); overflow: hidden; }
.an-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.an-handle { font-weight: 700; font-size: 14px; word-break: break-all; }
.an-verified { display: inline-block; width: 13px; height: 13px; vertical-align: -1px; margin-left: 4px; }
.an-sm { font-size: 11px; color: var(--muted); font-family: var(--font-mono); }
.an-caption { font-size: 12.5px; line-height: 1.65; color: var(--text); word-break: break-word; }
.an-caption .ht { color: var(--muted); }
.an-sound { font-size: 12px; color: var(--muted); }
.an-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.an-tag { font-size: 11px; padding: 4px 11px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border2); color: var(--text); }

.an-main-col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.an-two { display: grid; grid-template-columns: 1.25fr 1fr; gap: 16px; }
.an-card { background: var(--surface); border: 1px solid var(--border); border-radius: 22px; padding: 26px 28px; min-width: 0; }
.an-label { font-family: var(--font-mono); font-size: 10px; color: var(--muted); letter-spacing: 1.5px; text-transform: uppercase; margin-bottom: 22px; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.an-label .r { text-transform: none; letter-spacing: 0; font-size: 12px; }
.an-label .r b { color: var(--text); margin-left: 6px; }

/* Method detector + For You */
.an-method { display: flex; align-items: center; gap: 18px; }
.an-tile { width: 56px; height: 56px; border-radius: 14px; flex-shrink: 0; display: grid; place-items: center; background: var(--surface2); border: 1px solid var(--border2); color: var(--muted); font-family: var(--font-display); font-weight: 900; font-size: 28px; line-height: 1; }
.an-tile.tq { background: rgba(255,0,64,.08); border-color: rgba(255,0,64,.4); }
.an-tile.logo { padding: 0; overflow: hidden; background: #000; border-color: var(--border2); }
.an-tile.logo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.an-tile svg { width: 30px; height: 30px; }
.an-m-title { font-family: var(--font-display); font-weight: 800; font-size: clamp(28px, 3.2vw, 40px); line-height: 1; letter-spacing: -.3px; margin-bottom: 8px; word-break: break-word; }
.an-m-sub { font-size: 13px; color: var(--muted); line-height: 1.6; }
.an-fy { display: flex; align-items: center; gap: 14px; }
.an-fy-ic { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0; border: 1px solid; }
.an-fy-ic.ok { color: #2ecc71; background: rgba(46,204,113,.1); border-color: rgba(46,204,113,.45); }
.an-fy-ic.bad { color: var(--accent2); background: rgba(255,0,64,.1); border-color: rgba(255,0,64,.45); }
.an-fy-ic svg { width: 20px; height: 20px; }
.an-fy-t { font-weight: 700; font-size: 15px; margin-bottom: 2px; }

/* Serves */
.an-serve { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.an-big { font-family: var(--font-display); font-weight: 800; font-size: 40px; line-height: 1; letter-spacing: -.5px; }
.an-big small { font-family: var(--font-mono); font-size: 13px; font-weight: 600; margin-left: 4px; letter-spacing: 0; }
.an-big.hl { color: var(--accent); }
.an-cap { margin-top: 8px; font-size: 11px; color: var(--muted); }
.an-ladder { margin-top: 28px; display: grid; grid-template-columns: 74px 1fr 118px; align-items: center; gap: 0 14px; }
.an-ladder .nm { font-size: 12px; color: var(--muted); }
.an-bars { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
.an-bars i { display: block; height: 8px; border-radius: 4px; border: 1px solid var(--border2); background: transparent; }
.an-bars i.past { background: var(--border2); border-color: var(--border2); }
.an-bars i.now { background: var(--accent); border-color: var(--accent); }
.an-ladder .rt { text-align: right; font-size: 12px; font-weight: 700; line-height: 1.3; }
.an-ladder .rt span { display: block; font-weight: 400; font-family: var(--font-mono); font-size: 10px; color: var(--muted); }
.an-ticks { grid-column: 2; display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; margin-top: 8px; font-family: var(--font-mono); font-size: 10px; color: var(--muted2); }

/* Engagement */
.an-eng { display: grid; grid-template-columns: repeat(6, 1fr); border: 1px solid var(--border2); border-radius: 16px; overflow: hidden; }
.an-eng > div { padding: 16px 18px; border-left: 1px solid var(--border2); min-width: 0; }
.an-eng > div:first-child { border-left: 0; }
.an-eng .l { font-size: 11px; color: var(--muted); margin-bottom: 8px; }
.an-eng .n { font-family: var(--font-display); font-weight: 800; font-size: 28px; line-height: 1; letter-spacing: -.3px; }
.an-meter { margin-top: 18px; height: 4px; border-radius: 2px; background: var(--border); overflow: hidden; }
.an-meter i { display: block; height: 100%; background: var(--accent); border-radius: 2px; }

/* Actions */
.an-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.an-act { display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-body); font-size: 13px; font-weight: 600; padding: 12px 20px; border-radius: 12px; background: var(--surface); color: var(--text); border: 1px solid var(--border2); cursor: pointer; transition: background .12s, transform .1s; }
.an-act:hover { background: var(--surface2); }
.an-act:active { transform: translateY(1px); }
.an-act svg { width: 14px; height: 14px; }
.an-act.primary { margin-left: auto; background: var(--text); color: var(--bg); border-color: var(--text); }
.an-act.primary:hover { opacity: .88; background: var(--text); }

/* Download split button */
.an-split { position: relative; display: inline-flex; }
.an-split .an-split-main { border-radius: 12px 0 0 12px; border-right: 0; }
.an-split .an-split-caret { border-radius: 0 12px 12px 0; padding: 12px 11px; border-left: 1px solid var(--border2); }
.an-split .an-split-main:disabled { opacity: .7; cursor: progress; }
.an-split.open .an-split-caret { background: var(--surface2); }
.an-split-caret svg { transition: transform .15s; }
.an-split.open .an-split-caret svg { transform: rotate(180deg); }
.an-menu { position: absolute; top: calc(100% + 8px); left: 0; z-index: 50; min-width: 280px; max-width: calc(100vw - 32px); background: var(--surface); border: 1px solid var(--border2); border-radius: 14px; padding: 6px; box-shadow: 0 14px 40px rgba(0,0,0,.45); }
body.light-mode .an-menu { box-shadow: 0 14px 40px rgba(26,23,38,.18); }
.an-menu.up { top: auto; bottom: calc(100% + 8px); }
.an-menu[hidden] { display: none; }
.an-menu-h { font-family: var(--font-mono); font-size: 10px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--muted); padding: 8px 10px 6px; }
.an-menu-it { display: block; width: 100%; text-align: left; background: none; border: 0; color: var(--text); padding: 9px 10px; border-radius: 9px; cursor: pointer; font-family: var(--font-body); }
.an-menu-it:hover, .an-menu-it:focus-visible { background: var(--surface2); outline: none; }
.an-menu-it .l { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; }
.an-menu-it .bd { font-family: var(--font-mono); font-size: 9px; letter-spacing: .5px; text-transform: uppercase; padding: 1px 7px; border-radius: 999px; color: var(--accent); border: 1px solid rgba(255,0,64,.4); background: rgba(255,0,64,.08); }
.an-menu-it .m { margin-top: 2px; font-family: var(--font-mono); font-size: 11px; color: var(--muted); }

.an-raw-toggle { cursor: pointer; background: none; border: none; color: var(--muted); font-family: var(--font-mono); font-size: 11px; letter-spacing: 1px; padding: 0; align-self: flex-start; }
.an-raw-toggle:hover { color: var(--text); }
.an-raw { max-height: 420px; overflow: auto; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 16px; font-family: var(--font-mono); font-size: 11px; line-height: 1.6; color: var(--muted); white-space: pre-wrap; word-break: break-all; }

@media (max-width: 960px) {
  .an-layout { grid-template-columns: 1fr; }
  .an-cover { max-width: 260px; }
  .an-two { grid-template-columns: 1fr; }
  .an-serve { grid-template-columns: repeat(2, 1fr); }
  .an-eng { grid-template-columns: repeat(3, 1fr); }
  .an-eng > div:nth-child(4) { border-left: 0; }
  .an-eng > div:nth-child(n+4) { border-top: 1px solid var(--border2); }
}
@media (max-width: 860px) {
  .an-main { padding: 80px 16px 56px; }
  .an-form { flex-direction: column; }
  .an-btn { width: 100%; justify-content: center; }
  .an-card { padding: 20px 18px; border-radius: 18px; }
  .an-ladder { grid-template-columns: 56px 1fr; }
  .an-ladder .rt { grid-column: 1 / -1; text-align: left; margin: 6px 0 0 70px; }
  .an-ticks { grid-column: 2; }
  .an-act.primary { margin-left: 0; }
  .nav-links { gap: 14px; }
  .nav-links > a:not(.nav-pill):not(.nav-active):not(.bmc-btn) { display: none; }
}
