h1 a:hover, h2 a:hover, h3 a, h3 a:hover {
    text-decoration: none;
    border-bottom: none;
}

body{
    overflow-x: hidden;
}

.invisible-introduction {
    position: absolute;
    margin-left: -9999px;
}
.invisible-introduction > * { display: none; }
.invisible-introduction h2 { display: block; }

.toc-counter {
    opacity: 0.5;
    font-weight: normal;
    font-variant-numeric: tabular-nums;
    font-size: 14px;
    position: relative;
    width: 58px;
    display: none;
}
.toc .toc-counter { width: 35px; }

h1, h2{
    text-wrap: balance;
}

@media (min-width: 768px) {
    .toc a, h2, h3, h4 { position: relative; /* so toc-counter is relative to this */ }
    .toc-counter {
        position: absolute;
        right: 100%;
        margin-right: 0.3em;
        display: inline;
    }
}

@media (min-width: 1000px) {
    d-appendix h3 + h4 .toc-counter {
        display: none;
    }
}

    .comment {
    background-color: hsl(54, 78%, 96%);
    border-left: solid hsl(54, 33%, 67%) 1px;
    padding: 1em;
    color: hsla(0, 0%, 0%, 0.67);
    margin-top: 1em;
    }
    .comment h3 {
    font-size: 100%;
    font-weight: bold;
    text-transform: uppercase;
    margin-top: 0px;
    }
    .comment .commenter-description {
    font-style: italic;
    margin-bottom: 1em;
    margin-top: 0px;
    }
    .comment .commenter-description, .comment .commenter-description a {
    color: #777;
    font-size: 80%;
    line-height: 160%;
    }
    .comment div {
    margin-top: 1em;
    }
    .comment code {
    background: #FFF5;
    border-color: #EEEA;
    }

/* delete? */
.evidence-table {
    display: grid;
    grid-template-columns: auto 1fr 1fr 1fr;
    grid-gap: 4px;
    margin: 40px 0px 40px 0px;
    width: 100%;
    min-width: 700px;
    border-radius: 1px;
}
.evidence-table > .title {
    grid-column: 1 / span 4;
    font-weight: 500;
    text-transform: uppercase;
    border-bottom: 1px solid #CCC;
}
.evidence-table > div:not(.title) {
    font-size: 75%;
}
.evidence-table > div {
    background: #FFF;
    padding: 1px 2px 1px 4px;
    border-radius: 2px;
}
.evidence-table > div.title, .evidence-table > div.model {
  padding-left: 0px !important;
}
.evidence-table > div:not(.evidence):not(.title) {
    color: #666;
}
.evidence-table > .evidence {
    color: #000;
}
.evidence.strong.causal{
   background: hsl(180, 50%, 65%);
}
.evidence.strong{
   background: hsl(125, 45%, 65%);
}
.evidence.medium.causal{
   background: hsl(180, 42%, 80%);
}
.evidence.medium{
   background: hsl(125, 40%, 80%);
}
.evidence.suggestive.causal{
   background: hsl(180, 35%, 90%);
}
.evidence.suggestive{
   background: hsl(125, 30%, 90%);
}
.evidence.na{
   background: hsl(125, 0%, 90%);
}

d-article h2 {border-bottom: none !important;}
d-article h3 {font-size: 26px !important;}
d-article h4 {font-size: 16px !important; margin-top: 30px !important;}
@media(min-width: 600px){
    d-article hr {margin-top: 140px; margin-bottom: 120px;}
}
@media(max-width: 600px){
    d-article hr {margin-top: 80px; margin-bottom: 80px;}
}
d-appendix ul {
    padding-left: 0px;
    padding-left: 0px;
    margin-top: 0px;
    margin-bottom: 0px;
}
@media(max-width: 600px){
    d-citation-list, d-footnote-list {padding-left: 10px;}
}
d-article > ol, d-appendix ol {padding-left: 0px !important;}
d-article ol {padding-left: 36pt;}
d-article ul li, d-article ol li {margin-bottom: 8px;}
d-footnote {margin-left: -3px; margin-right: 2px;}

.math-grid {display: grid; grid-auto-flow: column; grid-gap: 8px 12px; width: min-content; margin: 0px; margin-bottom: 1em; /*max-width: 100%; grid-column: text-start / gutter-end; overflow: scroll;*/}
.math-grid > d-math {grid-row: 1; margin: 0px; display: flex; align-items: center;}
.math-grid > d-math[block] {margin-left: -1em; margin-top: calc( -0.5em - 8px); margin-bottom: calc( -0.5em - 8px);} d-math[sub] {padding-top: 12px;}
.math-grid > .figcaption {grid-row: 2; margin: 0px; grid-column: auto / span 1; min-width: 100px; line-height: 120%; border-top: 1px solid #CCC; padding-top: 8px;}

.gdoc-image, .gdoc-image-gutter, .gdoc-image-flex {width: 100%; max-width: calc(var(--img-width) / 1.5);}

@media(max-width: 800px){
    .gdoc-image, .gdoc-image-gutter, .gdoc-image-flex {padding-right: 2%;}
}

@media(min-width: 800px){
    .gdoc-image, .gdoc-image-gutter, .gdoc-image-flex {padding-right: 8px;}
}

.gdoc-image {grid-column: text-start / screen-end; image-rendering: -webkit-optimize-contrast;}
.gdoc-image-gutter {grid-column: gutter / screen-end; margin: 0px; padding: 0px; margin-top: 6px;}
.gdoc-image-flex {margin: 0px; padding: 0px;}
d-appendix .gdoc-image img, d-appendix .gdoc-image-flex img { mix-blend-mode: darken; }

.gdoc-image, .gdoc-image-gutter, .gdoc-image-flex{
  width: min(calc(var(--img-width) / 2), 100%);
  margin-left: auto;
  margin-right: auto;
  grid-column: screen;
  display: block;
  padding-right: 0;
}

figure.gdoc-image {
  margin: 1.5em auto 2.5em; 
  padding: 0;
}

.sn-figma-div{
  width: fit-content;
  margin-left: auto; 
  margin-right: auto;
  grid-column: 1 / -1;
  display: block;
}

p > sup, h1 > sup, h2 > sup, h3 > sup, h4 > sup, li > sup {display: none;}

pre.citation {
    font-size: 11px;
    line-height: 15px;
    border-left: 1px solid rgba(0, 0, 0, 0.1);
    padding-left: 18px;
    border: 1px solid rgba(0,0,0,0.1);
    background: rgba(255,255,255,0.4);
    padding: 10px 18px;
    border-radius: 3px;
    color: rgba(150, 150, 150, 1);
    overflow: hidden;
    margin-top: -12px;
    white-space: pre-wrap;
    word-wrap: break-word;
}


@media print {
    @page {
        margin: 0cm;
    }
    hr {
        margin: 0px;
        padding: 0px;
        opacity: 0.0;
        height: 0px;
        page-break-after: always;
    }
    h2 {
        display: block;
        page-break-before:always;
    }
    .gdoc-image {
        break-inside: avoid;
    }
    .base-grid,
    distill-header,
    d-title,
    d-abstract,
    d-article,
    d-appendix,
    distill-appendix,
    d-byline,
    d-footnote-list,
    d-citation-list,
    distill-footer {
        --grid-template-columns: [screen-start] 1fr [page-start kicker-start middle-start text-start] 45px 45px 45px 45px 45px 45px 45px 45px [ kicker-end text-end gutter-start] 45px [middle-end] 45px [page-end gutter-end] 1fr [screen-end];
        --grid-column-gap: 16px;
        grid-template-columns: [screen-start] 60px [page-start kicker-start middle-start text-start] 80px 60px 60px 60px 60px 60px 60px 60px [ kicker-end text-end gutter-start] 60px [middle-end] 60px [page-end gutter-end] 1fr [screen-end];
        grid-column-gap: 32px;
    }

    d-contents {
        display: block;
        justify-self: start;
        align-self: start;
        padding-bottom: 0.5em;
        margin-bottom: 1em;
        padding-left: 0.25em;
        border-bottom: 1px solid rgba(0, 0, 0, 0.1);
        border-bottom-width: 1px;
        border-bottom-style: solid;
        border-bottom-color: rgba(0, 0, 0, 0.1);
    }

}


table p {min-height: 16px; line-height: 1.2;}
table td {vertical-align: top;}
table td > * {margin: 0px; margin-top: 8px; margin-bottom: 8px; font-size: 90%;}

.video-ref {
    color: rgba(0,0,0,0.6);
    font-size: 87%;
    font-style: italic;
    margin-top: -10px;
    margin-bottom: 30px;
}
code {
    white-space: pre;
    background: #FAFAFA;
    border-radius: 2px;
    padding: 2px;
    padding-top: 1px;
    margin-left: 2px;
    margin-right: 2px;
    border: 1px solid #EEE;
}
code p { display: inline; }

/* ****************************************
 * TOC
 ******************************************/
@media(max-width: 1199px){
  d-contents {
    display: none;
    justify-self: start;
    align-self: start;
    padding-bottom: 0.5em;
    margin-bottom: 1em;
    padding-left: 0.25em;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    border-bottom-width: 1px;
    border-bottom-style: solid;
    border-bottom-color: rgba(0, 0, 0, 0.1);
  }
  
  body{
    margin: 2px;
  }
  .real-title {
    margin-left: -2px;
  }
  
}

@media(max-width: 1800px){
    d-contents .toc-counter{
        display: none;
    }
}


.real-title {
    width: 100vw;
    margin-left: -10px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.d-byline-container{
    border-width: 0px !important;
}

d-contents a:hover {
  border-bottom: none;
}

@media (min-width: 1200px){
  d-contents {
    align-self: start;
    grid-column-start: 1 !important;
    grid-column-end: 4 !important;
    grid-row: auto / span 6;
    justify-self: end;
    margin-top:  0em;
    padding-right: 3em;
    padding-left: 2em;
    border-right: 1px solid rgba(0, 0, 0, 0.1);
    border-right-width: 1px;
    border-right-style: solid;
    border-right-color: rgba(0, 0, 0, 0.1);
  }
}

d-contents nav h3 {
  margin-top: 0;
  margin-bottom: 1em;
}

d-contents nav div {
  color: rgba(0, 0, 0, 0.8);
  font-weight: bold;
}

d-contents nav a {
  color: rgba(0, 0, 0, 0.8);
  border-bottom: none;
  text-decoration: none;
}

d-contents li {
  list-style-type: none;
}

d-contents ul, d-article d-contents ul {
  padding-left: 1em;
}

d-contents nav ul li {
  margin-bottom: .25em;
}

d-contents nav a:hover {
  text-decoration: underline solid rgba(0, 0, 0, 0.6);
}

d-contents nav ul {
  margin-top: 0;
  margin-bottom: 6px;
}


d-contents nav>div {
  display: block;
  outline: none;
  margin-bottom: 0.5em;
}

d-contents nav>div>a {
  font-size: 13px;
  font-weight: 600;
}

d-contents nav>div>a:hover,
d-contents nav>ul>li>a:hover {
    text-decoration: none;
}

.visual-toc {
    counter-reset: toc-heading;
    display: grid;
    grid-auto-flow: dense;
    grid-template-columns: 1fr 1fr 1fr;
    grid-column-gap: 8px;
    grid-row-gap: 16px;

    max-width: 1180px;
    margin: auto;
    margin-bottom: 30px;
    padding-left: 30px;
    padding-right: 30px;
}

@media (min-width: 850px) {
    .visual-toc {
        /* grid-gap: 8px; */
        grid-template-columns: 1fr 1fr 1fr 1fr 1fr 1fr;
    }
}
@media (min-width: 1180px) {
    .visual-toc {
        grid-gap: 20px;
    }
}
.visual-toc-item {
    display: flex;
    flex-flow: column;
}
.visual-toc-top {
    flex-grow: 1;
    border: 1px solid #e5e5e5;
    border-radius: 5px;
    overflow: hidden;
    text-decoration: none;
    /* box-shadow: 0px 1px 4px rgba(0,0,0,0.05); */
    transition: box-shadow 0.35s, transform 0.35s;
    transform: scale(1);
    display: flex;
    flex-flow: column;
}
.visual-toc-top:hover {
    box-shadow: 0px 1px 4px rgba(0, 0, 0, 0.05);
    transform: scale(1.02);
    transition: box-shadow 0.15s, transform 0.15s;
}
.visual-toc d-tochead,
.visual-toc d-subhead {
    display: block;
    line-height: 1.3em;
    font-size: 85%;
    padding: 0.5em .5em 1em 1em;
}

.visual-toc d-tochead {
    color: #333;
    font-weight: 600;
    display: block;
    line-height: 1.3em;
    font-size: 85%;
    padding: 1em 1em;
}

.visual-toc d-tochead {
    color: #333;
    font-weight: 600;
    /* padding: 0.8em 1em; */
}

.visual-toc figure {
    line-height: 0em;
}

.visual-toc figure.gdoc-image {
    max-width: none;
    padding-right: 0;
    margin: 0; /* Add if needed */
}

/* .visual-toc d-tochead::before {
    display: block;
    content: "Section " counter(toc-heading);
    font-weight: 400;
    text-transform: uppercase;
    font-size: 0.6rem;
    color: #666;
} */
.visual-toc d-subhead {
    display: none;
    color: #666;
    font-size: 75%;
}
.visual-toc-colab {
    border-radius: 5px;
    border: solid 1px rgba(0, 0, 0, 0.1);
    margin-top: 1em;
    padding-left: 1.2em;
    padding-right: 1.2em;
    padding-top: 0.25em;
    padding-bottom: 0.25em;
    text-transform: uppercase;
    color: #aaa;
    font-size: 10.5px;
    line-height: 24px;
    /* background-color: yellow; */
}
.visual-toc-colab > img {
    position: relative;
    top: 4px;
    /* filter: grayscale(); */
}
.visual-toc-item:hover .visual-toc-colab > img {
    filter: unset;
}

/* .visual-toc-top:hover,  */
.visual-toc-colab:hover {
    background-color: hsl(0, 0%, 97%);
    border-color: rgba(0, 0, 0, 0.2);
    color: #888;
}

.visual-toc a {
    display: block;
    text-decoration: none;
    cursor: pointer;
}

.visual-toc a :global(img) {
    width: 100%;
}

.visual-toc figure {
    margin: 0;
}

.visual-toc figure.gdoc-image {
    max-width: none;
    padding-right: 0;
}
.visual-toc-top img {
    border-bottom: 1px solid #EEE;
}

h1 > a, h2 > a, h3 > a, h4 > a {
    text-decoration: none;
    border-bottom: none;
}


.ha-block{
    font-family: monospace;
    font-size: 14px;
    line-height: 1.5em;
    text-wrap: wrap;
    /* white-space: pre-wrap; */
    margin-bottom: 1em;
    background: #F6F6F3;
    ouline: 1px solid #B8B6AE;
    padding: 12px;
    border-radius: 2fr;
    font-weight: 300;
    
    p{
        margin-bottom: 0;
        margin-block-start: 0;
        margin-block-end: 0;
    }
    
    b.max-act{
        border-radius: 4px;
        padding: 1px;
        cursor: default;
        white-space: pre;
        outline: 1px solid #000;
        background: rgb(222, 82, 7);
    }
}

.prompt-inline, kbd, code{
    background: #F6F6F3;
    font-family: monospace;
    padding: 2px 4px;
    border-radius: 2px;
    border: 1px solid #B8B6AE;
    font-weight: 100;
    margin-left: 2px;
    margin-right: 2px;
    box-decoration-break: clone;
}

kbd {
    box-shadow: 0 1px 1px rgba(0,0,0,0.8);
}

.sn-figma-div{
    margin-top: 1em;
    margin-bottom: 2em;
}

@media (max-width: 1048px) {
    .sn-figma-div {
        padding-left: 4px;
        padding-right: 4px;
    }
}

.prune-code{
    overflow-x: scroll;
}

* > * {
    /* outline: 1px solid #f00; */
}
