/* X Scholar — a Google Scholar pastiche for X posts.
   Typography and greys follow Scholar; layout is responsive instead of a
   fixed 2000px canvas. */

html,
body {
  margin: 0;
  padding: 0;
  background: #fff;
  color: #222;
  font-family: Arial, "Helvetica Neue", Helvetica, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}
.u {
  text-decoration: underline;
}

/* ---------- top bar ---------- */

.topbar {
  background: #f5f5f5;
  border-bottom: 1px solid #e0e0e0;
  height: 58px;
  display: flex;
  align-items: center;
  padding: 0 14px;
}
.burger {
  width: 38px;
  height: 40px;
  border: 0;
  background: none;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  gap: 5px;
  padding: 0 8px;
  border-radius: 50%;
}
.burger:hover {
  background: rgba(0, 0, 0, 0.07);
}
.burger i {
  display: block;
  height: 2.5px;
  background: #707070;
  border-radius: 1px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-left: 12px;
  font-size: 26px;
  line-height: 1;
  color: #5f6368;
  letter-spacing: -0.1px;
}
.brand:hover {
  text-decoration: none;
}
.brand svg {
  flex: none;
  width: 19px;
  height: 19.5px;
}
.topbar-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
}
.icon-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
}
.icon-link:hover {
  background: rgba(0, 0, 0, 0.07);
  text-decoration: none;
}
.topbar-right img.avatar-sm {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: block;
  background: #e5e5e5;
  object-fit: cover;
}

/* ---------- profile ---------- */

.wrap {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 22px;
}
.profile {
  display: flex;
  gap: 24px;
  padding: 26px 0 20px;
  align-items: flex-start;
}
.avatar-hd {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  flex: none;
  background: #e5e5e5;
  object-fit: cover;
}
.pinfo {
  flex: 1;
  min-width: 0;
  padding-top: 2px;
}
.pname {
  font-size: 26px;
  font-weight: 400;
  line-height: 1.2;
  color: #222;
  margin: 0 0 9px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.btn-follow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 26px;
  padding: 0 10px;
  background: #4d90fe;
  color: #fff;
  border-radius: 2px;
  font-size: 14px;
  letter-spacing: 0.3px;
  white-space: nowrap;
}
.btn-follow:hover {
  background: #357ae8;
  text-decoration: none;
}
.pmeta {
  font-size: 16px;
  line-height: 1.6;
  color: #222;
  margin: 2px 0;
}
.pmeta a {
  color: #1a0dab;
  text-decoration: underline;
}
.ptopics {
  margin-top: 10px;
  font-size: 16px;
  line-height: 1.5;
}
.ptopics a {
  color: #1a0dab;
  margin-right: 22px;
  display: inline-block;
}

/* ---------- two column body ---------- */

.cols {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 42px;
  align-items: start;
}

/* results table */

.rankbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 0 0 8px;
  font-size: 14.5px;
  color: #777;
}
.mt {
  position: relative;
  display: inline-flex;
  padding: 2px;
  background: #f1f3f4;
  border-radius: 14px;
}
.mt-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 74px;
  height: 22px;
  border-radius: 11px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.22);
  transition: transform 0.18s ease;
}
.mt[data-active="likes"] .mt-thumb {
  transform: translateX(74px);
}
.mt[data-active="reposts"] .mt-thumb {
  transform: translateX(148px);
}
.mt-btn {
  position: relative;
  z-index: 1;
  width: 74px;
  height: 22px;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  font-size: 14.5px;
  color: #5f6368;
  border-radius: 11px;
  cursor: pointer;
  transition: color 0.18s ease;
}
.mt-btn:hover {
  color: #222;
}
.mt-btn.on {
  color: #222;
}


.thead {
  background: #f5f5f5;
  height: 38px;
  display: flex;
  align-items: center;
  font-size: 15.5px;
  color: #222;
}
.c-check {
  width: 40px;
  flex: none;
  display: flex;
  justify-content: flex-end;
  padding-right: 10px;
  box-sizing: border-box;
}
.cb {
  width: 12px;
  height: 12px;
  border: 1px solid #c6c6c6;
  border-radius: 1px;
  background: #fff;
  cursor: pointer;
  position: relative;
  box-sizing: border-box;
}
.cb.on {
  background: #4d90fe;
  border-color: #4d90fe;
}
.cb.on::after {
  content: "";
  position: absolute;
  left: 3px;
  top: 0;
  width: 3px;
  height: 7px;
  border: solid #fff;
  border-width: 0 1.5px 1.5px 0;
  transform: rotate(45deg);
}
.th-title {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.th-title .mini {
  color: #6f6f6f;
  display: flex;
  align-items: center;
}
.th-liked,
.th-year {
  flex: none;
  text-align: right;
  white-space: nowrap;
}
.th-liked {
  width: 112px;
}
.th-year {
  width: 58px;
}
.sortable {
  color: #1a0dab;
  cursor: pointer;
}
.sortable.on {
  color: #222;
  cursor: default;
}
.sortable.on:hover {
  text-decoration: none;
}

#rows {
  white-space: normal;
}
.row {
  display: flex;
  padding: 12px 0 10px;
  position: relative;
}
.row .main {
  flex: 1;
  min-width: 0;
  padding-right: 16px;
}
.row .ttl {
  font-size: 19px;
  line-height: 1.35;
  color: #1a0dab;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.row .ttl a:hover {
  text-decoration: underline;
}
.row .g {
  font-size: 15px;
  line-height: 1.45;
  color: #777;
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.row .g-pin {
  color: #006621;
  border: 1px solid #cfe3d5;
  border-radius: 2px;
  padding: 0 3px;
  margin-right: 5px;
  font-size: 14px;
}
.row .num {
  flex: none;
  width: 112px;
  text-align: right;
  font-size: 15.5px;
  color: #1a0dab;
  padding-top: 1px;
}
.row .yr {
  flex: none;
  width: 58px;
  text-align: right;
  font-size: 15.5px;
  color: #222;
  padding-top: 1px;
}

.pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  height: 54px;
  font-size: 15.5px;
  color: #222;
}
#more {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  height: 36px;
  padding: 0 8px;
  border: 1px solid transparent;
  border-radius: 4px;
  background: none;
  font: inherit;
  color: #444;
  text-transform: uppercase;
  cursor: pointer;
}
#more:hover {
  background: #f1f1f1;
}
#more:disabled {
  color: #b8b8b8;
  cursor: default;
  background: none;
}
#more:disabled path {
  fill: #b8b8b8;
}

/* ---------- sidebar ---------- */

.side {
  border-left: 1px solid #ebebeb;
  padding-left: 26px;
  padding-right: 4px;
  padding-top: 16px;
  font-size: 15.5px;
}
.side h3 {
  font-size: 17.5px;
  font-weight: 400;
  color: #222;
  margin: 0 0 8px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}
.side h3 a {
  font-size: 14.5px;
  color: #1a0dab;
}
.side section {
  margin-bottom: 26px;
}
.metrics {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
}
.metrics th {
  font-weight: 400;
  text-align: right;
  color: #222;
  padding: 5px 0;
}
.metrics th:first-child {
  text-align: left;
}
.metrics td {
  padding: 6px 0;
  border-top: 1px solid #e0e0e0;
}
.metrics td.n {
  text-align: right;
  color: #222;
}
.metrics tr:last-child td {
  border-bottom: 1px solid #e0e0e0;
}

.chart {
  margin-top: 14px;
  position: relative;
  padding-right: 42px;
}
.chart .plot {
  position: relative;
  height: 128px;
}
.chart .grid-line {
  position: absolute;
  left: 0;
  right: 0;
  border-top: 1px solid #e8e8e8;
}
.chart .axis {
  position: absolute;
  right: -42px;
  font-size: 11px;
  color: #777;
  transform: translateY(-50%);
  width: 38px;
  text-align: right;
}
.chart .bars {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  top: 0;
  display: flex;
  align-items: flex-end;
  justify-content: space-around;
}
.chart .bar {
  width: 14px;
  background: #777;
  position: relative;
}
.chart .bar .al {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin-bottom: 3px;
  font-size: 10.5px;
  color: #222;
  border: 1px solid #777;
  border-radius: 2px;
  padding: 0 2px;
  background: #fff;
  visibility: hidden;
  white-space: nowrap;
}
.chart .bar:hover .al {
  visibility: visible;
}
.chart .xlabels {
  display: flex;
  justify-content: space-around;
  font-size: 14px;
  color: #777;
  margin-top: 5px;
}
.chart .xlabels span {
  width: 32px;
  text-align: center;
}

.stack {
  height: 6px;
  display: flex;
  margin: 12px 0 7px;
  background: #dadce0;
}
.stack i {
  display: block;
  height: 6px;
}
.stack-note {
  display: flex;
  justify-content: space-between;
  font-size: 15px;
  color: #777;
}
.stack-note b {
  font-weight: 400;
  color: #006621;
}
.side .fine {
  font-size: 14.5px;
  color: #777;
  margin-top: 5px;
}

.co {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 6px 0;
  color: #222;
}
.co img {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #2b2b2b;
  object-fit: cover;
  flex: none;
}
.co .nm {
  flex: 1;
  min-width: 0;
  font-size: 15.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.co .ext {
  display: block;
  font-size: 14.5px;
  color: #777;
  line-height: 1.4;
}
.co .chev {
  flex: none;
  color: #777;
}

/* ---------- footer ---------- */

footer {
  background: #f2f2f2;
  border-top: 1px solid #e4e4e4;
  padding: 10px 22px;
  font-size: 14.5px;
  color: #666;
  display: flex;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 18px;
}
footer a {
  color: #666;
  text-decoration: none;
  margin-left: 16px;
}
footer a:hover {
  text-decoration: underline;
}

/* ---------- drawer ---------- */

#scrim {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  display: none;
  z-index: 9;
}
#drawer {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  width: 256px;
  background: #fff;
  box-shadow: 0 0 16px rgba(0, 0, 0, 0.3);
  transform: translateX(-110%);
  transition: transform 0.2s;
  z-index: 10;
  padding-top: 16px;
  font-size: 16px;
}
#drawer a {
  display: block;
  padding: 11px 22px;
  color: #222;
}
#drawer a:hover {
  background: #f1f1f1;
  text-decoration: none;
}
body.drawer #drawer {
  transform: none;
}
body.drawer #scrim {
  display: block;
}

/* ---------- responsive ---------- */

@media (max-width: 980px) {
  .cols {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
  }
  .side {
    border-left: 0;
    border-top: 1px solid #ebebeb;
    padding-left: 0;
    padding-top: 22px;
    margin-top: 8px;
  }
  .profile {
    gap: 18px;
  }
  .avatar-hd {
    width: 84px;
    height: 84px;
  }
  .pname {
    font-size: 24px;
  }
  .th-liked,
  .row .num {
    width: 72px;
  }
  .th-year,
  .row .yr {
    width: 44px;
  }
  .c-check {
    width: 28px;
    padding-right: 8px;
  }
}

@media (max-width: 560px) {
  .profile {
    flex-direction: column;
    padding-top: 20px;
  }
  .row .g:nth-of-type(2) {
    display: none;
  }
  .th-title .mini {
    display: none;
  }
}

/* ---------- merged-likes marker + dialog ---------- */

.row .num .star {
  display: inline-block;
  margin-left: 2px;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  font-size: 14px;
  line-height: 1;
  color: #1a0dab;
  vertical-align: super;
  cursor: pointer;
}
.row .num .star:hover {
  text-decoration: underline;
}

#mb-scrim {
  position: fixed;
  inset: 0;
  z-index: 11;
  background: rgba(0, 0, 0, 0.35);
  display: none;
}
#mbox {
  position: fixed;
  left: 50%;
  top: 50%;
  z-index: 12;
  width: 600px;
  max-width: calc(100vw - 24px);
  max-height: 72vh;
  overflow: auto;
  transform: translate(-50%, -50%);
  background: #fff;
  border-radius: 2px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.3);
  display: none;
}
body.mbox #mb-scrim,
body.mbox #mbox {
  display: block;
}
.mb_hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 16px;
  border-bottom: 1px solid #e0e0e0;
  position: sticky;
  top: 0;
  background: #fff;
}
.mb_hdr h2 {
  margin: 0;
  font-size: 19px;
  font-weight: 400;
  color: #222;
}
.mb_x {
  border: 0;
  background: none;
  padding: 3px;
  cursor: pointer;
  line-height: 1;
  border-radius: 50%;
}
.mb_x:hover {
  background: #f1f1f1;
}
.mb_bdy {
  padding: 12px 16px 16px;
  font-size: 15.5px;
  color: #444;
}
.mb_lbl {
  margin: 0 0 10px;
  color: #666;
  line-height: 1.5;
}
#mb_rows td {
  padding: 9px 0;
  border-top: 1px solid #f0f0f0;
  vertical-align: top;
}
#mb_rows tr:first-child td {
  border-top: 0;
}
#mb_rows .mt_t {
  color: #1a0dab;
  font-size: 16px;
  line-height: 1.35;
  display: block;
}
#mb_rows .mt_g {
  color: #777;
  font-size: 14.5px;
  margin-top: 3px;
}
#mb_rows .mt_n {
  text-align: right;
  color: #1a0dab;
  font-size: 15.5px;
  white-space: nowrap;
  padding-left: 14px;
  width: 1%;
}
#mb_rows .mt_k {
  display: inline-block;
  margin-left: 6px;
  padding: 0 4px;
  border: 1px solid #dcdcdc;
  border-radius: 2px;
  color: #777;
  font-size: 13px;
  line-height: 1.5;
}

/* ---------- papers view ---------- */

.thead .th-rt,
.thead .th-lk {
  flex: none;
  width: 100px;
  padding-right: 8px;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  align-self: stretch; /* tint fills the whole header band, not a chip */
}
.thead .th-rt {
  background: #dcebda;
}
.thead .th-lk {
  background: #dde7f7;
}
.thead .th-rt .sortable,
.thead .th-lk .sortable {
  color: #1a0dab;
}
.thead .th-rt .sortable.on,
.thead .th-lk .sortable.on {
  color: #222;
}

.row-paper {
  display: flex;
  align-items: stretch;
}
.row-paper .c-check {
  width: 46px;
  flex: none;
}
.row-paper .main {
  flex: 1;
  min-width: 0;
  padding: 12px 16px 10px 0;
}
.row-paper .ttl {
  font-size: 19px;
  line-height: 1.35;
  color: #1a0dab;
}
.row-paper .ttl a:hover {
  text-decoration: underline;
}
.row-paper .g {
  font-size: 15px;
  line-height: 1.45;
  color: #777;
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.row-paper .rt,
.row-paper .lk {
  flex: none;
  width: 100px;
  text-align: right;
  padding: 12px 8px 10px 0;
  font-size: 15.5px;
  box-sizing: border-box;
}
.row-paper .rt {
  background: #eaf3ea;
  color: #006621;
}
.row-paper .lk {
  background: #eaf0fa;
  color: #1a4fbf;
}
.row-paper .yr {
  flex: none;
  width: 58px;
  text-align: right;
  padding-top: 12px;
  font-size: 15.5px;
  color: #222;
}
.row-paper:hover .ttl a {
  text-decoration: underline;
}

@media (max-width: 980px) {
  .thead .th-rt,
  .thead .th-lk,
  .row-paper .rt,
  .row-paper .lk {
    width: 62px;
    font-size: 14.5px;
  }
  .row-paper .c-check {
    width: 28px;
  }
}

/* paired bars: likes vs reposts */
.chart .bars.pairs {
  justify-content: space-around;
}
.bgroup {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  flex: 1;
  justify-content: center;
}
.bgroup .bar {
  width: 8px;
}
.bgroup .bar.lk {
  background: #7d9ed4;
}
.bgroup .bar.rt {
  background: #7aa982;
}

.chart + .legend,
.legend {
  display: flex;
  gap: 12px;
  margin-top: 6px;
  font-size: 11px;
  color: #777;
}
.legend span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.legend .sw {
  width: 8px;
  height: 8px;
  border-radius: 1px;
  display: inline-block;
}
.legend .sw.lk {
  background: #7d9ed4;
}
.legend .sw.rt {
  background: #7aa982;
}

/* phones keep the original type scale: the desktop bump costs too much room */
@media (max-width: 980px) {
  .row .main .ttl,
  .row-paper .ttl {
    font-size: 16px;
  }
  .row .main .g,
  .row-paper .g {
    font-size: 12.5px;
  }
  .row .num,
  .row .yr,
  .row-paper .rt,
  .row-paper .lk,
  .row-paper .yr {
    font-size: 13px;
  }
  .thead .sortable,
  .thead .th-title {
    font-size: 11.5px;
  }
  .thead .th-rt,
  .thead .th-lk {
    font-size: 11px;
    width: 58px;
  }
  .row-paper .rt,
  .row-paper .lk {
    width: 58px;
  }
  .row .num {
    width: 64px;
  }
  .row .yr,
  .row-paper .yr {
    width: 44px;
  }
  .side {
    font-size: 12.5px;
  }
  .side h3 {
    font-size: 15px;
  }
  .metrics td,
  .metrics th {
    font-size: 12px;
  }
  .pname {
    font-size: 22px;
  }
}
