/* ===========================================================================
   "Reddit Account Analyzer"  —  /tools/reddit-account-analyzer/
   Loaded on top of site.css. Mirrors tool-best-time.css for UX consistency;
   classes are prefixed .raa-. Bar-chart colours differ per chart.
   ===========================================================================*/

.raa { background: #fff; padding-top: 48px; }
.raa .container { max-width: 900px; }

/* ---- Step 1 form ------------------------------------------------------- */
.raa-form-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 26px 24px;
  box-shadow: 0 20px 45px -30px rgba(15, 23, 42, .35);
}
.raa-field label { display: block; font-size: .85rem; font-weight: 600; margin-bottom: 6px; }
.raa-form__row {
  display: flex;
  gap: 12px;
  align-items: stretch;
  flex-wrap: wrap;
}
.raa-form__row .btn { flex-shrink: 0; }
.raa-prefixed {
  display: flex;
  align-items: stretch;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-page);
  overflow: hidden;
  flex: 1 1 240px;
  max-width: 420px;
}
.raa-prefixed:focus-within { outline: 2px solid var(--orange); outline-offset: 1px; background: #fff; }
.raa-prefixed.raa-invalid { border-color: #FCA5A5; background: #FEF2F2; }
.raa-prefixed span { display: flex; align-items: center; padding: 0 0 0 14px; font-weight: 600; color: var(--text-muted); }
.raa-prefixed input {
  flex: 1; border: 0; outline: 0; background: transparent;
  padding: 12px 14px 12px 1px; font-family: var(--font-body); font-size: .96rem;
}
.raa-hint { display: block; min-height: 1.1em; font-size: .78rem; color: #B91C1C; margin-top: 6px; }
.raa-quota { display: block; font-size: .82rem; color: var(--text-muted); margin-top: 12px; }

/* ---- Loading -------------------------------------------------------------- */
.raa-loading {
  display: none; flex-direction: column; align-items: center; gap: 14px;
  text-align: center; padding: 48px 0; color: var(--text-muted);
}
.raa-loading.is-on { display: flex; }
.raa-spinner {
  width: 38px; height: 38px; border-radius: 50%;
  border: 3px solid var(--border); border-top-color: var(--orange);
  animation: raa-spin .8s linear infinite;
}
@keyframes raa-spin { to { transform: rotate(360deg); } }

/* ---- Alert ------------------------------------------------------------- */
.raa-alert {
  display: none; gap: 12px; align-items: flex-start;
  border-radius: var(--radius-sm); padding: 16px 18px; font-size: .92rem; margin-top: 20px;
  background: #FEF2F2; border: 1px solid #FECACA; color: #991B1B;
}
.raa-alert.is-on { display: flex; }
.raa-alert.is-warn { background: #FFFBEB; border-color: #FDE68A; color: #92400E; }
.raa-alert svg { flex-shrink: 0; margin-top: 1px; }

/* ---- Result ------------------------------------------------------------- */
.raa-result { display: none; }
.raa-result.is-on { display: block; }

.raa-result__head {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 16px; flex-wrap: wrap;
  padding-bottom: 20px; border-bottom: 1px solid var(--border); margin-bottom: 24px;
}
.raa-id { display: flex; align-items: center; gap: 14px; }
.raa-avatar {
  width: 52px; height: 52px; flex-shrink: 0; border-radius: 50%;
  background: #EFF4FF; color: var(--navy);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-head); font-weight: 700; font-size: 1.1rem;
  overflow: hidden;
}
.raa-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.raa-id__name { font-size: clamp(1.3rem, 3vw, 1.7rem); margin: 0 0 4px; line-height: 1.15; }
.raa-id__name a { color: inherit; text-decoration: none; }
.raa-id__name a:hover { text-decoration: underline; }
.raa-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.raa-tag {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: .74rem; font-weight: 600; padding: 3px 9px; border-radius: 999px;
  background: var(--bg-page); color: var(--text-muted); border: 1px solid var(--border);
}
.raa-tag--verified { background: #EFFDF4; color: #166534; border-color: #BBF7D0; }
.raa-tag--mod { background: #EFF4FF; color: #1E3A8A; border-color: #C7D7FE; }
.raa-tag svg { width: 12px; height: 12px; }

.raa-cards { display: grid; gap: 14px; grid-template-columns: repeat(2, 1fr); margin-bottom: 24px; }
@media (min-width: 720px) { .raa-cards { grid-template-columns: repeat(4, 1fr); } }
.raa-card {
  background: var(--bg-page); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px 14px; text-align: center;
}
.raa-card__num { font-family: var(--font-head); font-size: 1.4rem; font-weight: 700; color: var(--navy); line-height: 1.15; }
.raa-card__label { font-size: .76rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); margin-top: 6px; }

.raa-section-label {
  font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em;
  color: var(--text-muted); margin-bottom: 12px;
}

/* two panels: karma split + content balance */
.raa-panels { display: grid; gap: 20px; grid-template-columns: 1fr; margin-bottom: 26px; }
@media (min-width: 720px) { .raa-panels { grid-template-columns: 1fr 1fr; } }
.raa-panel { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; }

.raa-splitbar { display: flex; height: 14px; border-radius: 999px; overflow: hidden; background: var(--bg-page); }
.raa-splitbar i { display: block; height: 100%; }
.raa-splitbar .raa-seg--post { background: #4F46E5; }
.raa-splitbar .raa-seg--comment { background: #0D9488; }
.raa-splitlegend { display: flex; justify-content: space-between; margin-top: 10px; font-size: .82rem; color: var(--text-muted); }
.raa-splitlegend b { color: var(--navy); }
.raa-dot { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 5px; vertical-align: middle; }
.raa-dot--post { background: #4F46E5; }
.raa-dot--comment { background: #0D9488; }
.raa-balance-label { margin: 10px 0 0; font-weight: 600; color: var(--navy); font-size: .95rem; }

/* ---- Most active subreddits table ------------------------------------- */
.raa-tablewrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin-bottom: 26px; }
.raa-table { width: 100%; border-collapse: collapse; min-width: 460px; }
.raa-table th, .raa-table td { text-align: left; padding: 10px 12px; font-size: .9rem; }
.raa-table thead th {
  font-size: .72rem; text-transform: uppercase; letter-spacing: .05em;
  color: var(--text-muted); border-bottom: 1px solid var(--border);
}
.raa-table tbody tr { border-bottom: 1px solid var(--border); }
.raa-table tbody tr:last-child { border-bottom: 0; }
.raa-table th.raa-num,
.raa-table td.raa-num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.raa-num__v { display: block; }
.raa-meter {
  display: block;
  width: 70px;
  height: 3px;
  margin: 5px 0 0 auto;
  border-radius: 2px;
  background: var(--bg-page);
  overflow: hidden;
}
.raa-meter i { display: block; height: 100%; border-radius: 2px; }
.raa-meter--items i { background: #7048E8; }
.raa-meter--up i { background: #0D9488; }
.raa-table a { color: var(--navy); font-weight: 600; text-decoration: none; }
.raa-table a:hover { text-decoration: underline; }
.raa-table .raa-mix { font-size: .78rem; color: var(--text-muted); }

/* ---- Time patterns (bar charts) ------------------------------------- */
.raa-time {
  border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
  padding: 26px 0 28px; margin-bottom: 26px;
}
.raa-time__heads { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.raa-headline {
  background: var(--bg-page); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 12px 16px; flex: 1 1 200px;
}
.raa-headline span { display: block; font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); }
.raa-headline b { font-family: var(--font-head); font-size: 1.15rem; color: var(--navy); }

.raa-charts { display: grid; grid-template-columns: 1fr; gap: 28px 44px; }
@media (min-width: 720px) {
  .raa-charts { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}
.raa-bars { margin: 0; min-width: 0; }
.raa-bars figcaption { margin-bottom: 12px; }
.raa-bars__plot {
  display: flex; align-items: flex-end; gap: 4px;
  overflow-x: auto; overflow-y: hidden; -webkit-overflow-scrolling: touch;
  padding: 4px 2px 0;
}
.raa-bar {
  flex: 1 1 0; min-width: 16px; max-width: 52px;
  display: flex; flex-direction: column; align-items: center; outline: none;
}
.raa-bars--day .raa-bar { max-width: 46px; }
.raa-bars--hour .raa-bars__plot { gap: 2px; }
.raa-bars--hour .raa-bar { min-width: 9px; max-width: 38px; }
.raa-bars--hour .raa-bar__track { width: 82%; }
.raa-bar__track {
  width: 68%; min-width: 8px; height: 100px;
  display: flex; align-items: flex-end; border-bottom: 1px solid var(--border);
}
.raa-bar__fill { width: 100%; min-height: 2px; border-radius: 3px 3px 0 0; transition: filter .12s ease; }
.raa-bars--day  .raa-bar__fill { background: #E8590C; }
.raa-bars--hour .raa-bar__fill { background: #7048E8; }
.raa-bar.is-empty .raa-bar__fill { background: transparent; }
.raa-bar.is-empty .raa-bar__track { position: relative; }
.raa-bar.is-empty .raa-bar__track::after {
  content: ""; position: absolute; left: 50%; bottom: 0;
  width: 4px; height: 4px; margin-left: -2px; border-radius: 50%;
  background: var(--cold); opacity: .55;
}
.raa-bar.is-empty .raa-bar__label { opacity: .5; }
.raa-bar__label {
  margin-top: 6px; font-size: .62rem; height: 12px; line-height: 12px;
  color: var(--text-muted); white-space: nowrap;
}
.raa-bar:hover .raa-bar__fill, .raa-bar:focus .raa-bar__fill { filter: brightness(1.12); }
.raa-bar:focus .raa-bar__track { box-shadow: 0 0 0 2px var(--navy); border-radius: 3px; }

/* ---- Top posts / comments ------------------------------------------- */
.raa-lists { display: grid; grid-template-columns: 1fr; gap: 26px; margin-bottom: 8px; }
@media (min-width: 820px) { .raa-lists { grid-template-columns: 1fr 1fr; } }
.raa-list { display: grid; gap: 10px; }
.raa-item {
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 12px 14px; background: #fff;
}
.raa-item__title { font-weight: 600; font-size: .92rem; line-height: 1.4; margin: 0 0 6px; }
.raa-item__title a { color: var(--navy); text-decoration: none; }
.raa-item__title a:hover { text-decoration: underline; }
.raa-item__body { font-size: .88rem; color: var(--text-muted); line-height: 1.5; margin: 0 0 6px; }
.raa-item__meta { font-size: .78rem; color: var(--text-muted); display: flex; gap: 10px; flex-wrap: wrap; }
.raa-item__meta b { color: var(--navy); }
.raa-item__sub { font-weight: 600; }

/* ---- Disclaimer + freshness ---------------------------------------- */
.raa-disclaimer {
  display: flex; gap: 10px; align-items: flex-start;
  background: var(--bg-page); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 12px 14px; font-size: .84rem; color: var(--text-muted); margin: 24px 0 0;
}
.raa-disclaimer svg { flex-shrink: 0; margin-top: 1px; color: var(--navy); }

/* ---- Tooltip --------------------------------------------------------- */
.raa-tip {
  position: fixed; z-index: 1000; pointer-events: none;
  background: var(--navy); color: #fff; font-size: .78rem; line-height: 1.45;
  padding: 8px 10px; border-radius: 8px; box-shadow: 0 10px 30px -8px rgba(15, 23, 42, .5);
  max-width: 220px; opacity: 0; transition: opacity .1s ease;
}
.raa-tip.is-on { opacity: 1; }
.raa-tip span { color: #CBD5E1; }

/* ---- CTA ----------------------------------------------------------------- */
.raa-cta {
  margin-top: 32px; background: var(--navy); color: #fff;
  border-radius: 20px; padding: 30px 26px; text-align: center;
}
.raa-cta h3 { color: #fff; font-size: 1.25rem; margin-bottom: 8px; }
.raa-cta p { color: #CBD5E1; font-size: .96rem; margin: 0 auto 18px; max-width: 460px; }

/* ---- Article ------------------------------------------------------------- */
.raa-article { background: var(--bg-page); }
.raa-article .container { max-width: 760px; }
.raa-article h2 { font-size: clamp(1.5rem, 3vw, 2rem); }
.raa-article h3 { font-size: 1.15rem; margin-top: 1.8em; }
.raa-article p, .raa-article li { color: var(--text-muted); font-size: 1.02rem; }
.raa-article ul { list-style: disc; padding-left: 22px; margin-bottom: 1em; }
.raa-article li { margin-bottom: .5em; }
.raa-article__cta {
  background: #fff; border: 1px solid var(--border); border-left: 4px solid var(--orange);
  border-radius: var(--radius-sm); padding: 20px 22px; margin-top: 2em;
}
.raa-article__cta p { margin: 0 0 14px; color: var(--navy); font-weight: 500; }
.raa-article__cta p:last-child { margin: 0; }

/* article figure: karma-split archetypes */
.raa-figure {
  margin: 26px 0 10px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px 16px;
}
.raa-figure__title { font-size: .92rem; font-weight: 700; color: var(--navy); margin: 0 0 16px; }
.raa-figure__rows { display: grid; gap: 14px; }
.raa-figure__row { display: grid; grid-template-columns: 1fr; gap: 6px; }
@media (min-width: 600px) { .raa-figure__row { grid-template-columns: 190px 1fr; align-items: center; gap: 14px; } }
.raa-figure__label b { display: block; font-size: .88rem; color: var(--navy); }
.raa-figure__label span { font-size: .78rem; color: var(--text-muted); }
.raa-figure__bar { display: flex; height: 22px; border-radius: 6px; overflow: hidden; background: var(--bg-page); }
.raa-figure__bar i {
  display: flex; align-items: center; justify-content: center;
  font-size: .72rem; font-weight: 700; color: #fff; font-style: normal;
  min-width: 0;
}
.raa-figure__seg--post { background: #4F46E5; }
.raa-figure__seg--comment { background: #0D9488; }
.raa-figure figcaption {
  margin-top: 16px;
  font-size: .82rem;
  color: var(--text-muted);
  line-height: 1.55;
}
.raa-figure figcaption span { font-weight: 600; color: var(--navy); margin-right: 12px; white-space: nowrap; }
