.content {
  display: grid;
  row-gap: var(--row-gap-1);
  -moz-column-gap: var(--margin);
       column-gap: var(--margin);
  grid-template-columns: 0 minmax(0, var(--max-width)) 0;
  justify-content: space-between;
  padding: var(--row-gap-0) 0 var(--row-gap-1);

  & > * {
    grid-column: 2;
  }
}

.content-header {
  position: relative;

  & .title {
    margin: 0;
    font: var(--text-display);
    color: var(--color-foreground);
  }
}

.content-hr {
  box-sizing: content-box;
  overflow: hidden;
  background: transparent;
  border-bottom: 1px solid var(--color-border-muted);
  height: 0.1em;
  padding: 0;
  background-color: var(--color-border-default);
  border: 0;
}

.content-footer {
  position: relative;
  color: var(--color-foreground);
  & * {
    list-style: none;
  }
  & details {
    cursor: pointer;
  }
  & summary {
    cursor: pointer;
    text-decoration: underline;
    padding-left: 10px;
  }
  & details[open] {
    & summary {
      padding-left: 0;
    }
    padding: 10px;
    padding-top: 0;
    border-radius: var(--border-radius);
    background: var(--color-background-1);
  }
}

/* Markdown CSS */

.content-body {
  /* Ref. github-markdown-css (MIT): https://github.com/sindresorhus/github-markdown-css */
  /* Tweaked by @uta8a */
  &:not(pre > code) {
    color: var(--color-fg-default);
    font: var(--text-body-size);
    line-height: 1.5;
    word-wrap: break-word;
  }

  & details,
  & figcaption,
  & figure {
    display: block;
  }

  & summary {
    display: list-item;
  }

  & a {
    background-color: transparent;
    color: var(--color-accent-fg);
    text-decoration: none;
  }

  & a:active,
  & a:hover {
    outline-width: 0;
  }

  & abbr[title] {
    border-bottom: none;
    -webkit-text-decoration: underline dotted;
            text-decoration: underline dotted;
  }

  & b,
  & strong {
    font-weight: 600;
  }

  & dfn {
    font-style: italic;
  }

  & mark {
    background-color: var(--color-attention-subtle);
    color: var(--color-text-primary);
  }

  & small {
    font-size: 90%;
  }

  & sub,
  & sup {
    font-size: 75%;
    line-height: 0;
    position: relative;
    vertical-align: baseline;
  }

  & sub {
    bottom: -0.25em;
  }

  & sup {
    top: -0.5em;
  }

  & img {
    display: block;
    margin: auto;
    border-style: none;
    width: 60%;
    box-sizing: content-box;
    background-color: var(--color-canvas-default);
    padding-bottom: 10px;
  }

  & code,
  & kbd,
  & pre,
  & samp {
    font-family: monospace, monospace;
  }

  & figure {
    margin: 1em 40px;
  }

  & hr {
    box-sizing: content-box;
    overflow: hidden;
    background: transparent;
    border-bottom: 1px solid var(--color-border-muted);
    height: 0.1em;
    padding: 0;
    background-color: var(--color-border-default);
    border: 0;
  }

  & input {
    font: inherit;
    margin: 0;
    overflow: visible;
    font-family: inherit;
    line-height: inherit;
  }

  & [type="checkbox"],
  & [type="radio"] {
    box-sizing: border-box;
    padding: 0;
  }

  & [type="number"]::-webkit-inner-spin-button,
  & [type="number"]::-webkit-outer-spin-button {
    height: auto;
  }

  & [type="search"]::-webkit-search-cancel-button,
  & [type="search"]::-webkit-search-decoration {
    -webkit-appearance: none;
  }

  & ::-webkit-input-placeholder {
    color: inherit;
    opacity: 0.54;
  }

  & ::-webkit-file-upload-button {
    -webkit-appearance: button;
    font: inherit;
  }

  & a:hover {
    text-decoration: underline;
  }

  & hr::before {
    display: table;
    content: "";
  }

  & hr::after {
    display: table;
    clear: both;
    content: "";
  }

  & table {
    border-spacing: 0;
    border-collapse: collapse;
    display: block;
    width: -moz-max-content;
    width: max-content;
    max-width: 100%;
    overflow: auto;
  }

  & td,
  & th {
    padding: 0;
  }

  & details summary {
    cursor: pointer;
  }

  & details:not([open]) > *:not(summary) {
    display: none !important;
  }

  & kbd {
    display: inline-block;
    padding: 3px 5px;
    font: 11px ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas,
      Liberation Mono, monospace;
    line-height: 10px;
    color: var(--color-fg-default);
    vertical-align: middle;
    background-color: var(--color-canvas-subtle);
    border: solid 1px var(--color-neutral-muted);
    border-bottom-color: var(--color-neutral-muted);
    border-radius: 6px;
    box-shadow: inset 0 -1px 0 var(--color-neutral-muted);
  }

  & h1,
  & h2,
  & h3,
  & h4,
  & h5,
  & h6 {
    margin-top: 24px;
    margin-bottom: 16px;
    font-weight: 600;
    line-height: 1.25;
  }

  & h1 {
    margin: 0.67em 0;
    font-weight: 600;
    padding-bottom: 0.2em;
    font-size: var(--text-title-size);
  }

  & h2 {
    font-weight: 400;
    font-size: var(--text-title-size);
  }

  & h3 {
    font-weight: 400;
    font-size: var(--text-title-size);
  }

  & h4 {
    font-weight: 400;
    font-size: var(--text-title-size);
  }

  & h5 {
    font-weight: 400;
    font-size: var(--text-title-size);
  }

  & h6 {
    font-weight: 400;
    font-size: var(--text-title-size);
    color: var(--color-fg-muted);
  }

  & p {
    margin-top: 0;
    margin-bottom: 14px;
  }

  & blockquote {
    margin: 0;
    padding: 0 1em;
    color: var(--color-fg-muted);
    border-left: 0.25em solid var(--color-border-default);
  }

  & ul,
  & ol {
    margin-top: 1em;
    margin-bottom: 1em;
    padding-left: 2em;
  }

  & ul ul,
  & ul ol {
    margin-top: 0;
    margin-bottom: 0;
  }

  & ol ol,
  & ul ol {
    list-style-type: lower-roman;
  }

  & ul ul ol,
  & ul ol ol,
  & ol ul ol,
  & ol ol ol {
    list-style-type: lower-alpha;
  }

  & dd {
    margin-left: 0;
  }

  & tt,
  & code {
    font-family: ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas,
      Liberation Mono, monospace;
  }

  & pre {
    margin-top: 0;
    margin-bottom: 0;
    font-family: ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas,
      Liberation Mono, monospace;
    word-wrap: normal;
  }

  & ::-moz-placeholder {
    color: var(--color-fg-subtle);
    opacity: 1;
  }

  & ::placeholder {
    color: var(--color-fg-subtle);
    opacity: 1;
  }

  & input::-webkit-outer-spin-button,
  & input::-webkit-inner-spin-button {
    margin: 0;
    -webkit-appearance: none;
    appearance: none;
  }

  & .pl-c {
    color: var(--color-prettylights-syntax-comment);
  }

  & .pl-c1,
  & .pl-s .pl-v {
    color: var(--color-prettylights-syntax-constant);
  }

  & .pl-e,
  & .pl-en {
    color: var(--color-prettylights-syntax-entity);
  }

  & .pl-smi,
  & .pl-s .pl-s1 {
    color: var(--color-prettylights-syntax-storage-modifier-import);
  }

  & .pl-ent {
    color: var(--color-prettylights-syntax-entity-tag);
  }

  & .pl-k {
    color: var(--color-prettylights-syntax-keyword);
  }

  & .pl-s,
  & .pl-pds,
  & .pl-s .pl-pse .pl-s1,
  & .pl-sr,
  & .pl-sr .pl-cce,
  & .pl-sr .pl-sre,
  & .pl-sr .pl-sra {
    color: var(--color-prettylights-syntax-string);
  }

  & .pl-v,
  & .pl-smw {
    color: var(--color-prettylights-syntax-variable);
  }

  & .pl-bu {
    color: var(--color-prettylights-syntax-brackethighlighter-unmatched);
  }

  & .pl-ii {
    color: var(--color-prettylights-syntax-invalid-illegal-text);
    background-color: var(--color-prettylights-syntax-invalid-illegal-bg);
  }

  & .pl-c2 {
    color: var(--color-prettylights-syntax-carriage-return-text);
    background-color: var(--color-prettylights-syntax-carriage-return-bg);
  }

  & .pl-sr .pl-cce {
    font-weight: bold;
    color: var(--color-prettylights-syntax-string-regexp);
  }

  & .pl-ml {
    color: var(--color-prettylights-syntax-markup-list);
  }

  & .pl-mh,
  & .pl-mh .pl-en,
  & .pl-ms {
    font-weight: bold;
    color: var(--color-prettylights-syntax-markup-heading);
  }

  & .pl-mi {
    font-style: italic;
    color: var(--color-prettylights-syntax-markup-italic);
  }

  & .pl-mb {
    font-weight: bold;
    color: var(--color-prettylights-syntax-markup-bold);
  }

  & .pl-md {
    color: var(--color-prettylights-syntax-markup-deleted-text);
    background-color: var(--color-prettylights-syntax-markup-deleted-bg);
  }

  & .pl-mi1 {
    color: var(--color-prettylights-syntax-markup-inserted-text);
    background-color: var(--color-prettylights-syntax-markup-inserted-bg);
  }

  & .pl-mc {
    color: var(--color-prettylights-syntax-markup-changed-text);
    background-color: var(--color-prettylights-syntax-markup-changed-bg);
  }

  & .pl-mi2 {
    color: var(--color-prettylights-syntax-markup-ignored-text);
    background-color: var(--color-prettylights-syntax-markup-ignored-bg);
  }

  & .pl-mdr {
    font-weight: bold;
    color: var(--color-prettylights-syntax-meta-diff-range);
  }

  & .pl-ba {
    color: var(--color-prettylights-syntax-brackethighlighter-angle);
  }

  & .pl-sg {
    color: var(--color-prettylights-syntax-sublimelinter-gutter-mark);
  }

  & .pl-corl {
    text-decoration: underline;
    color: var(--color-prettylights-syntax-constant-other-reference-link);
  }

  & [data-catalyst] {
    display: block;
  }

  & g-emoji {
    font-family: "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
    font-size: var(--text-body-size);
    font-style: normal !important;
    font-weight: 400;
    line-height: 1;
    vertical-align: -0.075em;
  }

  & g-emoji img {
    width: 1em;
    height: 1em;
  }

  &::before {
    display: table;
    content: "";
  }

  &::after {
    display: table;
    clear: both;
    content: "";
  }

  & > *:first-child {
    margin-top: 0 !important;
  }

  & > *:last-child {
    margin-bottom: 0 !important;
  }

  & a:not([href]) {
    color: inherit;
    text-decoration: none;
  }

  & .absent {
    color: var(--color-danger-fg);
  }

  & .anchor {
    float: left;
    padding-right: 4px;
    margin-left: -20px;
    line-height: 1;
  }

  & .anchor:focus {
    outline: none;
  }

  & p,
  & blockquote,
  & ul,
  & ol,
  & dl,
  & table,
  & pre,
  & details {
    margin-top: 0;
    margin-bottom: 16px;
  }

  & blockquote > :first-child {
    margin-top: 0;
  }

  & blockquote > :last-child {
    margin-bottom: 0;
  }

  & sup > a::before {
    content: "[";
  }

  & sup > a::after {
    content: "]";
  }

  & h1:hover .anchor,
  & h2:hover .anchor,
  & h3:hover .anchor,
  & h4:hover .anchor,
  & h5:hover .anchor,
  & h6:hover .anchor {
    text-decoration: none;
  }

  & h1 tt,
  & h1 code,
  & h2 tt,
  & h2 code,
  & h3 tt,
  & h3 code,
  & h4 tt,
  & h4 code,
  & h5 tt,
  & h5 code,
  & h6 tt,
  & h6 code {
    padding: 0 0.2em;
    font-size: inherit;
  }

  & ul.no-list,
  & ol.no-list {
    padding: 0;
    list-style-type: none;
  }

  & ol[type="1"] {
    list-style-type: decimal;
  }

  & ol[type="a"] {
    list-style-type: lower-alpha;
  }

  & ol[type="i"] {
    list-style-type: lower-roman;
  }

  & div > ol:not([type]) {
    list-style-type: decimal;
  }

  & ul ul,
  & ul ol,
  & ol ol,
  & ol ul {
    margin-top: 0;
    margin-bottom: 0;
  }

  & li > p {
    margin-top: 16px;
  }

  & li + li {
    margin-top: 0.25em;
  }

  & dl {
    padding: 0;
  }

  & dl dt {
    padding: 0;
    margin-top: 16px;
    font-style: italic;
    font-weight: 600;
  }

  & dl dd {
    padding: 0 16px;
    margin-bottom: 16px;
  }

  & table th {
    font-weight: 600;
  }

  & table th,
  & table td {
    padding: 6px 13px;
    border: 1px solid var(--color-border-default);
  }

  & table tr {
    background-color: var(--color-canvas-default);
    border-top: 1px solid var(--color-border-muted);
  }

  & table tr:nth-child(2n) {
    background-color: var(--color-canvas-subtle);
  }

  & table img {
    background-color: transparent;
  }

  & img[align="right"] {
    padding-left: 20px;
  }

  & img[align="left"] {
    padding-right: 20px;
  }

  & .emoji {
    max-width: none;
    vertical-align: text-top;
    background-color: transparent;
  }

  & span.frame {
    display: block;
    overflow: hidden;
  }

  & span.frame > span {
    display: block;
    float: left;
    width: auto;
    padding: 7px;
    margin: 13px 0 0;
    overflow: hidden;
    border: 1px solid var(--color-border-default);
  }

  & span.frame span img {
    display: block;
    float: left;
  }

  & span.frame span span {
    display: block;
    padding: 5px 0 0;
    clear: both;
    color: var(--color-fg-default);
  }

  & span.align-center {
    display: block;
    overflow: hidden;
    clear: both;
  }

  & span.align-center > span {
    display: block;
    margin: 13px auto 0;
    overflow: hidden;
    text-align: center;
  }

  & span.align-center span img {
    margin: 0 auto;
    text-align: center;
  }

  & span.align-right {
    display: block;
    overflow: hidden;
    clear: both;
  }

  & span.align-right > span {
    display: block;
    margin: 13px 0 0;
    overflow: hidden;
    text-align: right;
  }

  & span.align-right span img {
    margin: 0;
    text-align: right;
  }

  & span.float-left {
    display: block;
    float: left;
    margin-right: 13px;
    overflow: hidden;
  }

  & span.float-left span {
    margin: 13px 0 0;
  }

  & span.float-right {
    display: block;
    float: right;
    margin-left: 13px;
    overflow: hidden;
  }

  & span.float-right > span {
    display: block;
    margin: 13px auto 0;
    overflow: hidden;
    text-align: right;
  }

  & code,
  & tt {
    padding: 0.2em 0.4em;
    margin: 0;
    background-color: var(--color-neutral-muted);
    border-radius: 6px;
  }

  & code br,
  & tt br {
    display: none;
  }

  & del code {
    text-decoration: inherit;
  }

  & pre code {
    font-size: 100%;
  }

  & pre > code {
    padding: 0;
    margin: 0;
    word-break: normal;
    white-space: pre;
    background: transparent;
    border: 0;
  }

  & .highlight {
    margin-bottom: 16px;
  }

  & .highlight pre {
    margin-bottom: 0;
    word-break: normal;
  }

  & .highlight pre,
  & pre {
    padding: 16px;
    overflow: auto;
    line-height: 1.45;
    background-color: var(--color-canvas-subtle);
    border-radius: 6px;
  }

  & pre code,
  & pre tt {
    display: inline;
    max-width: auto;
    padding: 0;
    margin: 0;
    overflow: visible;
    line-height: inherit;
    word-wrap: normal;
    background-color: transparent;
    border: 0;
  }

  & .csv-data td,
  & .csv-data th {
    padding: 5px;
    overflow: hidden;
    line-height: 1;
    text-align: left;
    white-space: nowrap;
  }

  & .csv-data .blob-num {
    padding: 10px 8px 9px;
    text-align: right;
    background: var(--color-canvas-default);
    border: 0;
  }

  & .csv-data tr {
    border-top: 0;
  }

  & .csv-data th {
    font-weight: 600;
    background: var(--color-canvas-subtle);
    border-top: 0;
  }

  & .footnotes {
    font-size: var(--text-body-size);
    color: var(--color-fg-muted);
    border-top: 1px solid var(--color-border-default);
  }

  & .footnotes ol {
    padding-left: 16px;
  }

  & .footnotes li {
    position: relative;
  }

  & .footnotes li:target::before {
    position: absolute;
    top: -8px;
    right: -8px;
    bottom: -8px;
    left: -24px;
    pointer-events: none;
    content: "";
    border: 2px solid var(--color-accent-emphasis);
    border-radius: 6px;
  }

  & .footnotes li:target {
    color: var(--color-fg-default);
  }

  & .footnotes .data-footnote-backref g-emoji {
    font-family: monospace;
  }

  & .task-list-item {
    list-style-type: none;
  }

  & .task-list-item label {
    font-weight: 400;
  }

  & .task-list-item.enabled label {
    cursor: pointer;
  }

  & .task-list-item + .task-list-item {
    margin-top: 3px;
  }

  & .task-list-item .handle {
    display: none;
  }

  & .task-list-item-checkbox {
    margin: 0 0.2em 0.25em -1.6em;
    vertical-align: middle;
  }

  & .contains-task-list:dir(rtl) .task-list-item-checkbox {
    margin: 0 -1.6em 0.25em 0.2em;
  }

  & ::-webkit-calendar-picker-indicator {
    filter: invert(50%);
  }
}

.content-table {
  margin: var(--row-gap-0) 0;
  padding: 5px var(--row-gap-0);
  border: max(1px, 0.1em) var(--color-fg-subtle) solid;
  display: grid;
  grid-template-columns: minmax(150px, 1.5fr) 8.5fr;
  grid-template-areas: "title description" "body body";
  & > .content-table-title {
    grid-area: title;
    font-weight: bold;
  }
  & > .content-table-description {
    grid-area: description;
    overflow: hidden;
    overflow-x: scroll;
    word-wrap: normal;
    white-space: nowrap;
    &::-webkit-scrollbar {
      display: none; /* only chrome */
    }
  }
  & > .content-table-body {
    grid-area: body;
    margin: 0;
    padding: 0;
    & .row-name {
      padding: 0;
    }
    & li {
      margin: 0;
      padding: 4px 0;
      list-style: none;
      display: grid;
      grid-template-columns: 2fr 6fr 2fr 0.3fr;
      grid-template-areas: "title description tags status";
      & > * {
        overflow: hidden;
        overflow-x: scroll;
        word-wrap: normal;
        white-space: nowrap;
        margin-left: 5px;
        &::-webkit-scrollbar {
          display: none; /* only chrome */
        }
      }
      & .row-status {
        grid-area: status;
      }
      & .row-title {
        grid-area: title;
      }
      & .row-description {
        grid-area: description;
      }
      & .row-tags {
        grid-area: tags;
        display: flex;
      }
      & .row-tag {
        padding-left: 2px;
        overflow: hidden;
        overflow-x: scroll;
        white-space: nowrap;
        word-wrap: normal;
        grid-area: tags;
        flex-shrink: 0;
        &::before {
          content: "#";
        }
      }
      @media (max-width: 600px) {
        grid-template-columns: 1fr 1fr 0.2fr;
        grid-template-areas: "title description status";
        & .row-tags {
          display: none;
        }
      }
    }
  }
}
