/* akaturk.com — academic comparison v3 (2026-11-22)
   Loaded after akaturk-comparison.css and akaturk-comparison-v2.css (search box, chips, radar, trend and the table
   keep those rules). New here: the picker is the only card on the hero; the result sits on the page as a summary in
   two lenses, unit cards, a sticky numbered colour key, bar sections with a one-line explanation, and the full
   table folded away. Every unit keeps one colour (--cmp-c) and one number everywhere, so colour is never the only cue. */

.aka-cmp--v3 {
  --c3-radius: 16px;
  --c3-shadow: 0 1px 2px rgba(20, 26, 43, 0.04), 0 10px 28px rgba(20, 26, 43, 0.06);
  --c3-track: #f2eeee;
  --c3-pad: 1.4rem;
}

/* the number that stands for a unit */
.c3-n { flex: none; display: inline-grid; place-items: center; width: 1.3rem; height: 1.3rem; border-radius: 50%; background: var(--cmp-c, var(--cmp-red)); color: #ffffff; font-size: 0.7rem; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.c3-h2 { margin: 0; font-size: 1.12rem; font-weight: 800; letter-spacing: -0.015em; line-height: 1.25; color: var(--cmp-ink); }
.c3-note { margin: 0.85rem 0 0; font-size: 0.78rem; line-height: 1.5; color: var(--cmp-faint); }
.c3-panel { background: #ffffff; border: 1px solid var(--cmp-line); border-radius: var(--c3-radius); box-shadow: var(--c3-shadow); padding: 1.25rem var(--c3-pad); }

/* picker */
.aka-cmp--v3 .c3-picker { padding: 1.35rem 1.5rem 1.4rem; border-radius: 18px; }
.aka-cmp--v3 .cmp-toolbar[hidden] { display: none; }
.aka-cmp--v3 .cmp-selected.is-empty { display: block; }

/* how to use (before the first comparison) */
.c3-empty { margin-top: 1rem; padding: 1.1rem 1.3rem 1.2rem; border: 1px dashed #dcd2d4; border-radius: var(--c3-radius); background: rgba(255, 255, 255, 0.65); }
.c3-empty[hidden] { display: none; }
.c3-empty__t { margin: 0 0 0.7rem; font-size: 0.72rem; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: var(--cmp-muted); }
.c3-empty ol { list-style: none; counter-reset: c3s; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.75rem 1.25rem; }
.c3-empty li { counter-increment: c3s; display: flex; align-items: flex-start; gap: 0.6rem; font-size: 0.9rem; line-height: 1.4; color: var(--cmp-ink); }
.c3-empty li::before { content: counter(c3s); flex: none; display: grid; place-items: center; width: 1.6rem; height: 1.6rem; border-radius: 50%; background: var(--cmp-red); color: #ffffff; font-size: 0.8rem; font-weight: 800; }

/* result: on the page, not inside the picker card */
.aka-cmp--v3 .cmp-result-wrap { margin-top: 1.5rem; padding-top: 0; border-top: 0; }
.aka-cmp--v3 .cmp-summary { margin-bottom: 1.5rem; }

/* summary: two lenses */
.c3-lenses { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; margin-top: 0.9rem; }
.c3-lens { padding: 1rem 1.1rem 1.05rem; border: 1px solid var(--cmp-line); border-radius: 14px; background: var(--cmp-soft); }
.c3-lens__t { margin: 0; display: flex; align-items: baseline; justify-content: space-between; gap: 0.5rem; font-size: 0.98rem; font-weight: 800; color: var(--cmp-ink); }
.c3-lens__t small { font-size: 0.72rem; font-weight: 600; color: var(--cmp-faint); white-space: nowrap; }
.c3-lens__hint { margin: 0.3rem 0 0.85rem; font-size: 0.8rem; line-height: 1.45; color: var(--cmp-muted); }
.c3-lens__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.55rem; }
.c3-lens__row { display: grid; grid-template-columns: auto minmax(0, max(11rem, var(--cmp-namew, 11rem))) minmax(2.5rem, 1fr) auto; align-items: center; gap: 0.6rem; font-size: 0.86rem; }
.c3-lens__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; color: var(--cmp-ink); }
.c3-lens__row.is-top .c3-lens__name { font-weight: 800; }
.c3-lens__track { display: block; height: 0.6rem; border-radius: 999px; background: #ebe6e6; overflow: hidden; }
.c3-lens__track span { display: block; height: 100%; border-radius: 999px; background: color-mix(in srgb, var(--cmp-c) 45%, #ffffff); }
.c3-lens__row.is-top .c3-lens__track span { background: var(--cmp-c); }
.c3-lens__num { font-size: 0.8rem; color: var(--cmp-muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.c3-lens__num b { font-size: 1.05rem; font-weight: 800; color: var(--cmp-ink); }

/* unit cards */
.aka-cmp--v3 .c3-glance { margin-top: 0; }
.c3-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: 1rem; margin-top: 0.8rem; }
.c3-card { position: relative; display: flex; flex-direction: column; overflow: hidden; padding: 1.15rem 1.15rem 1rem; background: #ffffff; border: 1px solid var(--cmp-line); border-radius: var(--c3-radius); box-shadow: var(--c3-shadow); }
.c3-card::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 4px; background: var(--cmp-c); }
.c3-card__head { display: flex; align-items: flex-start; gap: 0.6rem; }
.c3-card__head .c3-n { width: 1.6rem; height: 1.6rem; font-size: 0.82rem; }
.c3-card__titles { min-width: 0; }
.c3-card__titles strong { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; font-size: 1rem; font-weight: 800; line-height: 1.25; color: var(--cmp-ink); }
.c3-card__titles small { display: block; margin-top: 0.15rem; font-size: 0.76rem; line-height: 1.35; color: var(--cmp-muted); }
.c3-card__kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; margin: 0.9rem 0 0.9rem; }
.c3-card__kpis div { padding: 0.5rem 0.65rem 0.55rem; border: 1px solid transparent; border-radius: 10px; background: var(--cmp-soft); }
.c3-card__kpis dt { font-size: 0.66rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--cmp-faint); }
.c3-card__kpis dd { margin: 0.1rem 0 0; font-size: 1.3rem; font-weight: 800; letter-spacing: -0.02em; color: var(--cmp-ink); font-variant-numeric: tabular-nums; }
.c3-card__kpis .is-best { background: color-mix(in srgb, var(--cmp-c) 7%, #ffffff); border-color: color-mix(in srgb, var(--cmp-c) 26%, #ffffff); }
.c3-card__kpis .is-best dd { color: var(--cmp-c); }
.c3-card__st { margin: 0 0 0.3rem; font-size: 0.68rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--cmp-faint); }
.c3-card__st small { font-weight: 600; letter-spacing: 0; text-transform: none; }
.c3-card__chips { list-style: none; margin: 0 0 0.9rem; padding: 0; }
.c3-card__chips li { display: flex; align-items: baseline; justify-content: space-between; gap: 0.6rem; padding: 0.34rem 0; border-bottom: 1px dashed var(--cmp-line); font-size: 0.84rem; line-height: 1.3; color: var(--cmp-ink); }
.c3-card__chips li:last-child { border-bottom: 0; }
.c3-card__chips b { flex: none; padding: 0.12rem 0.45rem; border-radius: 999px; background: color-mix(in srgb, var(--cmp-c) 10%, #ffffff); color: var(--cmp-c); font-size: 0.74rem; font-weight: 800; white-space: nowrap; }
.c3-card__chips .is-none { color: var(--cmp-faint); font-size: 0.8rem; }
.c3-card__link { margin-top: auto; align-self: flex-start; font-size: 0.82rem; font-weight: 700; color: var(--cmp-red); text-decoration: none; }
.c3-card__link:hover { text-decoration: underline; }

/* colour key: stays in view while the sections scroll */
.c3-keys { position: sticky; top: calc(var(--aka-nav-h, 52px) + 0.5rem); z-index: 6; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem 1rem; margin: 1.5rem 0 1rem; padding: 0.55rem 0.6rem 0.55rem 0.9rem; border: 1px solid var(--cmp-line); border-radius: 14px; background: rgba(255, 255, 255, 0.95); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); box-shadow: 0 6px 20px rgba(20, 26, 43, 0.08); }
.c3-keys__list { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem 1rem; min-width: 0; }
.c3-keys__t { font-size: 0.66rem; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: var(--cmp-faint); }
.c3-keys__item { display: inline-flex; align-items: center; gap: 0.4rem; min-width: 0; font-size: 0.84rem; font-weight: 700; color: var(--cmp-ink); }
.c3-keys__name { max-width: 15rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.c3-keys .cmp-mode { background: #ffffff; }

/* charts keep their v2 drawing; the frame follows the new cards */
.aka-cmp--v3 .cmp-viz { margin-top: 0; gap: 1rem; }
.aka-cmp--v3 .cmp-viz .cmp-block { margin-top: 0; padding: 1.2rem var(--c3-pad) 1rem; border-radius: var(--c3-radius); box-shadow: var(--c3-shadow); }
.aka-cmp--v3 .cmp-block__title { font-size: 1.12rem; font-weight: 800; letter-spacing: -0.015em; text-transform: none; color: var(--cmp-ink); }
.aka-cmp--v3 .cmp-block__title::before { display: none; }
.aka-cmp--v3 .cmp-block__note { font-size: 0.82rem; color: var(--cmp-muted); }

/* metric sections */
.c3-sections { display: grid; gap: 1rem; margin-top: 1rem; }
.c3-sec { padding: 1.2rem var(--c3-pad) 0.5rem; background: #ffffff; border: 1px solid var(--cmp-line); border-radius: var(--c3-radius); box-shadow: var(--c3-shadow); }
.c3-sec__head { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 0.35rem 0.8rem; padding-bottom: 0.9rem; border-bottom: 1px solid var(--cmp-line); }
.c3-sec__head p { grid-column: 1 / -1; margin: 0; max-width: 78ch; font-size: 0.84rem; line-height: 1.5; color: var(--cmp-muted); }
.c3-src { padding: 0.22rem 0.6rem; border-radius: 999px; font-size: 0.68rem; font-weight: 800; letter-spacing: 0.03em; white-space: nowrap; }
.c3-src--yok { color: #8a1620; background: #fdecee; border: 1px solid #f6c9ce; }
.c3-src--oa { color: #0f4c81; background: #eaf2fb; border: 1px solid #c5dbf1; }
.c3-sec > .c3-note { margin: 0.9rem 0 0.8rem; }

.c3-row { display: grid; grid-template-columns: minmax(0, 15rem) minmax(0, 1fr); align-items: center; gap: 0.4rem 1.5rem; padding: 0.8rem 0; border-bottom: 1px solid #f4efef; }
.c3-row:last-child { border-bottom: 0; }
.c3-row__label > span { display: block; font-size: 0.92rem; font-weight: 700; line-height: 1.3; color: var(--cmp-ink); }
.c3-row__hint { display: block; margin-top: 0.2rem; font-size: 0.74rem; font-weight: 500; line-height: 1.4; color: var(--cmp-faint); }
.c3-row__per { display: block; margin-top: 0.1rem; font-size: 0.72rem; font-weight: 700; color: var(--cmp-red); }
.c3-row__bars { display: grid; gap: 0.32rem; }

/* one bar per unit; the value column is fixed so every track in the page has the same length */
/* 2026-11-23: every bar carries the written name of its unit next to the number; colour is never the only cue.
   The name column takes its width from --cmp-namew (set by the script from the longest name). */
.c3-bar { display: grid; grid-template-columns: 1.15rem var(--cmp-namew, 9rem) minmax(0, 1fr) 9.5rem; align-items: center; gap: 0.6rem; }
.c3-bar .c3-n { width: 1.15rem; height: 1.15rem; font-size: 0.64rem; }
.c3-bar__name { min-width: 0; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; overflow-wrap: anywhere; font-size: 0.74rem; font-weight: 700; line-height: 1.2; color: var(--cmp-muted); }
.c3-bar.is-lead .c3-bar__name { color: var(--cmp-ink); }
.c3-bar.is-empty .c3-bar__name { color: var(--cmp-faint); }
.c3-keys__more { min-width: 0; max-width: 16rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.74rem; font-weight: 500; color: var(--cmp-muted); }
.c3-chartkey { list-style: none; display: flex; flex-wrap: wrap; justify-content: center; gap: 0.35rem 1rem; margin: 0.6rem 0 0; padding: 0; font-size: 0.78rem; font-weight: 700; color: var(--cmp-ink); }
.c3-chartkey li { display: inline-flex; align-items: center; gap: 0.4rem; min-width: 0; }
.c3-chartkey li > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 18rem; }
.c3-chartkey .c3-n { width: 1.15rem; height: 1.15rem; font-size: 0.64rem; }
.c3-bar__track { display: block; height: 0.95rem; border-radius: 6px; background: var(--c3-track); overflow: hidden; }
.c3-bar__fill { display: block; height: 100%; border-radius: 6px; background: color-mix(in srgb, var(--cmp-c) 40%, #ffffff); transition: width 0.45s ease; }
.c3-bar.is-lead .c3-bar__fill { background: var(--cmp-c); }
.c3-bar.is-plain .c3-bar__fill { background: color-mix(in srgb, var(--cmp-c) 62%, #ffffff); }
.c3-bar__val { display: flex; align-items: center; justify-content: flex-end; gap: 0.4rem; font-size: 0.9rem; font-weight: 600; color: var(--cmp-muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.c3-bar__val small { font-size: 0.72rem; font-weight: 600; color: var(--cmp-faint); }
.c3-bar.is-lead .c3-bar__val, .c3-bar.is-plain .c3-bar__val, .c3-bar--q .c3-bar__val { color: var(--cmp-ink); }
.c3-bar.is-lead .c3-bar__val { font-weight: 800; }
.c3-bar__x { order: -1; padding: 0.1rem 0.42rem; border-radius: 999px; background: color-mix(in srgb, var(--cmp-c) 10%, #ffffff); color: var(--cmp-c); font-size: 0.68rem; font-weight: 800; }
.c3-bar.is-empty .c3-bar__val { color: var(--cmp-faint); }

/* quartile mix: one stacked bar per unit */
.c3-q { display: flex; gap: 2px; height: 1.5rem; border-radius: 6px; overflow: hidden; background: var(--c3-track); }
.c3-q__seg { display: flex; align-items: center; justify-content: center; min-width: 2px; overflow: hidden; }
.c3-q__seg i { padding: 0 0.3rem; font-style: normal; font-size: 0.68rem; font-weight: 700; white-space: nowrap; }
.c3-q__seg i b { font-weight: 800; }
.c3-q__seg--q1 { background: #047857; color: #ffffff; }
.c3-q__seg--q2 { background: #62b99c; color: #06281e; }
.c3-q__seg--q3 { background: #f3c66b; color: #4a3305; }
.c3-q__seg--q4 { background: #e9967f; color: #4a1509; }
.c3-qkey { display: flex; flex-wrap: wrap; gap: 0.2rem 0.6rem; margin-top: 0.35rem; font-size: 0.7rem; font-weight: 700; color: var(--cmp-muted); }
.c3-qkey span { display: inline-flex; align-items: center; gap: 0.25rem; }
.c3-qkey span::before { content: ""; width: 0.6rem; height: 0.6rem; border-radius: 2px; background: currentColor; }
.c3-qkey .q1::before { background: #047857; }
.c3-qkey .q2::before { background: #62b99c; }
.c3-qkey .q3::before { background: #f3c66b; }
.c3-qkey .q4::before { background: #e9967f; }

/* folds */
.c3-more { margin: 0 calc(-1 * var(--c3-pad)); padding: 0 var(--c3-pad); border-top: 1px solid var(--cmp-line); }
.c3-more > summary, .c3-tablefold > summary { display: flex; align-items: center; gap: 0.5rem; padding: 0.8rem 0; list-style: none; cursor: pointer; font-size: 0.84rem; font-weight: 700; color: var(--cmp-muted); }
.c3-more > summary::-webkit-details-marker, .c3-tablefold > summary::-webkit-details-marker { display: none; }
.c3-more > summary::before, .c3-tablefold > summary::before { content: ""; flex: none; width: 0.45rem; height: 0.45rem; margin: 0 0.2rem 0 0.1rem; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-45deg); transition: transform 0.2s ease; }
.c3-more[open] > summary::before, .c3-tablefold[open] > summary::before { transform: rotate(45deg); }
.c3-more > summary:hover, .c3-tablefold > summary:hover { color: var(--cmp-red); }
.c3-more > summary:focus-visible, .c3-tablefold > summary:focus-visible { outline: 2px solid rgba(193, 18, 31, 0.35); outline-offset: 2px; border-radius: 6px; }
.c3-more > summary small { padding: 0.05rem 0.45rem; border: 1px solid var(--cmp-line); border-radius: 999px; background: var(--cmp-soft); font-size: 0.7rem; font-weight: 700; color: var(--cmp-faint); }
.c3-more[open] { padding-bottom: 0.2rem; }
.c3-tablefold { margin-top: 1rem; padding: 0; overflow: hidden; }
.c3-tablefold > summary { padding: 1rem var(--c3-pad); font-size: 0.92rem; color: var(--cmp-ink); }
.c3-tablefold .cmp-table-scroll { border: 0; border-top: 1px solid var(--cmp-line); border-radius: 0; box-shadow: none; }
.aka-cmp--v3 .cmp-foot-note { margin: 1rem 0.2rem 0; font-size: 0.78rem; }

@media (max-width: 900px) {
  .c3-lenses { grid-template-columns: 1fr; }
  .c3-row { grid-template-columns: minmax(0, 11rem) minmax(0, 1fr); gap: 0.4rem 1rem; }
}
@media (max-width: 700px) {
  .aka-cmp--v3 { --c3-pad: 1rem; }
  .aka-cmp--v3 .c3-picker { padding: 1rem; }
  .c3-empty ol { grid-template-columns: 1fr; }
  .c3-lens__row { grid-template-columns: auto minmax(0, 1fr) auto; }
  .c3-lens__track { grid-column: 1 / -1; grid-row: 2; }
  .c3-cards { grid-template-columns: 1fr; }
  .c3-keys { gap: 0.4rem; padding: 0.45rem 0.5rem; }
  .c3-keys__t { display: none; }
  .c3-keys__list { flex-wrap: nowrap; gap: 0.8rem; width: 100%; padding: 0 0.2rem; overflow-x: auto; scrollbar-width: none; }
  .c3-keys__list::-webkit-scrollbar { display: none; }
  .c3-keys__item { flex: none; font-size: 0.8rem; }
  .c3-keys__name { max-width: 8rem; }
  .c3-keys .cmp-mode { display: flex; width: 100%; }
  .c3-keys .cmp-mode__btn { flex: 1; padding: 0.3rem 0.5rem; }
  .c3-bar--q .c3-bar__val { flex-direction: column; }
  .c3-row { grid-template-columns: 1fr; gap: 0.45rem; padding: 0.75rem 0; }
  .c3-bar { grid-template-columns: 1.15rem minmax(0, 1fr) 5.4rem; grid-template-areas: "n name name" ". track val"; gap: 0.2rem 0.5rem; }
  .c3-bar > .c3-n { grid-area: n; }
  .c3-bar__name { grid-area: name; font-size: 0.76rem; }
  .c3-bar__track, .c3-bar > .c3-q { grid-area: track; }
  .c3-bar__val { grid-area: val; }
  .c3-row__bars { gap: 0.5rem; }
  .c3-keys__more { display: none; }
  .c3-chartkey { justify-content: flex-start; }
  .c3-bar__val { flex-direction: column-reverse; align-items: flex-end; gap: 0.1rem; font-size: 0.86rem; }
  .c3-bar__x { order: 0; }
  .c3-q__seg i b { display: none; }
  .c3-q__seg i { padding: 0 0.15rem; font-size: 0.64rem; }
}
@media (prefers-reduced-motion: reduce) {
  .c3-bar__fill, .c3-more > summary::before, .c3-tablefold > summary::before { transition: none; }
}
@media print {
  .c3-keys { position: static; box-shadow: none; }
  .c3-more:not([open]) > :not(summary) { display: block; }
}
