:root {
  --standard-gap: 10px;
  --footer-height: 38px;
  --text: #0d0d0f;

  --action: #675681;
  --main-bg: #ececec;
  --main-border: #cccccf;
  --subtle-text: #667;
  --table-stripe-bg: #fcfaff;
  --subtle-background: #fafafa;

  --color-note: #144dd1;
  --color-tip: #090;
  --color-important: #3c14d1;
  --color-warning: #d15614;
  --color-caution: #d11452;

  --notification-badge: #d11452;

  --warning-fg: #e2d8b8;
  --warning-bg: #fffccd;
  --attention-fg: #fab38e;
  --attention-bg: #fadbcb;
  --ok-fg: #a0b4e2;
  --ok-bg: #d0dafa;

  --comment-add-bg: #7ded7d;
  --comment-count-bg: #c0dffa;
  --comment-add-hover-bg: #ffc;

  --review-status-await: #666;
  --review-status-approve: #090;
  --review-status-comment: #c60;
  --review-status-reject: #900;
  --review-status-abstain: #ccc;

  --review-status-required: #909;
  --review-status-optional: #666;

  --flash-warning-bg: #fee;
  --flash-warning-fg: #d11452;
  --flash-warning-border: #fcc;
  --flash-success-bg: #efe;
  --flash-success-fg: #090;
  --flash-success-border: #9f9;
  --flash-neutral-bg: var(--main-bg);
  --flash-neutral-fg: var(--subtle-text);
  --flash-neutral-border: var(--main-border);

  --rfc-status-draft-fg: #666;
  --rfc-status-review-fg: #0d0d0f;
  --rfc-status-published-fg: #090;
  --rfc-status-obsolete-fg: #d11452;
  --rfc-status-deleted-fg: #d11452;
}

body {
  margin: 0;
  padding: 0;
  font-family: system-ui;
  font-size: 16px;
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--main-bg);

  a {
    color: var(--action);
  }
  a[href],
  a[hx-post],
  a[hx-delete],
  a[hx-patch],
  a[hx-get] {
    text-decoration: underline;
    cursor: pointer;
  }
  .has-cursor {
    cursor: pointer;
  }
}

header {
  padding: 10px 10px 8px 10px; /* 8px makes up for nav>a 2px bottom border */
  background: var(--main-bg);
  border-bottom: 1px solid var(--main-border);
  position: sticky;
  top: 0;
  z-index: 1;

  #logo {
    height: 40px;
    width: 181px;
  }
  nav {
    clear: both;
    overflow-x: auto;
    overflow-y: hidden;
    height: 20px;
    white-space: nowrap;
    display: flex;
    padding-top: 5px;

    &> .left {
      flex: 1;
    }

    &> .right {
      text-align: right;
    }

    a {
      display: inline-block;
      margin-right: 10px;
      font-size: 14px;
      text-decoration: none !important;
      color: var(--subtle-text);
      vertical-align: top;
    }
    .right a {
      margin-right: unset;
      margin-left: 10px;
    }
    a.active,
    a:hover {
      color: #000;
    }
    .right {
      margin-right: 0;
      margin-left: 10px;
    }
    .mini-avatar {
      width: 16px;
      height: 16px;
      border-radius: 16px;
      vertical-align: middle;
    }
    .icon {
      position: relative;
      padding-top: 1px;

      img {
        width: 16px;
        height: 16px;
      }
      .badge {
        width: 14px;
        height: 14px;
        line-height: 14px;
        font-size: 8px;
        background-color: var(--notification-badge);
        border-radius: 8px;
        color: #fff;
        display: inline-block;
        text-align: center;
        position: absolute;
        top: -5px;
        left: 8px;
      }
    }
  }
  #search {
    margin-bottom: 10px;
    text-align: right;
    float: right;
  }
  #search input {
    border: 1px solid var(--main-border);
    font-size: 14px;
    line-height: 26px;
    padding: 1px 8px;
  }
  #search input[type=search] {
    border-top-left-radius: 6px;
    border-bottom-left-radius: 6px;
    background-color: #fff;
  }
  #search input[type=submit] {
    border-left: 0;
    border-top-right-radius: 6px;
    border-bottom-right-radius: 6px;
    background-color: #e2e2e2;
    font-weight: bold;
    color: #333;
    width: 50px;
  }
  #search input[type=submit]:hover {
    background-color: #ddd;
  }
}

main {
  flex: 1;
  position: relative;
  padding: 10px;
  background: #fff;

  p, ul, ol {
    line-height: 1.5em;
  }

  h1, h2, h3, h4, h5, h6 {
    margin: 0 0 10px 0;
    padding: 0;
    scroll-margin-top: 106px; /* header height with one flash */

    .header-anchor {
      display: none;
      text-decoration: none;
    }

    &:hover .header-anchor {
      display: unset;
    }
  }

  table + h2 {
    margin-top: 20px;
  }

  table + h3 {
    margin-top: 10px;
  }

  h1 {
    font-size: 40px;
  }

  p {
    margin: 0 0 10px 0;
  }

  a.button,
  button,
  input[type="submit"],
  input[type="button"],
  input[type=file]::file-selector-button {
    background-color: var(--action);
    border-radius: 5px;
    border: 0;
    padding: 10px 15px;
    color: #fff;
    font-weight: bold;
    font-size: 14px;
    cursor: pointer;
    display: inline-block;
    text-decoration: none;
    text-align: center;
    white-space: nowrap;

    &.full-width {
      display: block;
    }
  }
  button.bland,
  a.button.bland,
  button[type="reset"] {
    background-color: var(--subtle-text);
  }
  button[disabled] {
    cursor: not-allowed;
    opacity: 50%;
  }
  #breadcrumbs {
    margin-bottom: 10px;
    font-size: 14px;

    a {
      text-decoration: none;
    }
  }
  #view-rfc {
    display: flex;
    gap: 10px;

    & > article {
      flex: 1 1 auto;
      padding-bottom: 40px;
      overflow-x: auto;
    }
    & > aside {
      width: 300px;
      flex: 0 0 auto;
      font-size: 15px;

      .sticky {
        position: sticky;
        top: 120px;
        background: var(--main-bg);
        border: 1px solid var(--main-border);
        padding: 10px;
        width: 280px;
        box-sizing: content-box;
        border-top-left-radius: 34px;
        margin-top: 10px;

        /* if a window is short enough the full sidebar won't be seen */
        max-height: calc(100vh - 120px - 60px);
        overflow-y: auto;
      }

      .user-info {
        position: relative;
        height: 48px;
        margin-bottom: 4px;

        .avatar {
          width: 48px;
          height: 48px;
          border-radius: 48px;
          position: absolute;
          top: 0;
          left: 0;
        }

        .name {
          position: absolute;
          top: 0;
          left: 58px;
          font-weight: bold;
          line-height: 24px;
          font-size: 18px;
        }

        .username {
          position: absolute;
          top: 24px;
          left: 58px;
          font-size: 14px;
          line-height: 24px;
        }
      }

      .summary {
        font-size: 13px;
        line-height: 18px;
        color: var(--subtle-text);
        font-style: italic;
      }

      .edit-button {
        display: flex;
        gap: 10px;

        .button {
          flex-grow: 1;
          display: block;
          margin-top: 10px;
        }
      }

      .one-line {
        line-height: 26px;

        .pull {
          float: right;
          font-size: 14px;
        }
      }
      .one-line.right {
        text-align: right;
      }
      h6 {
        font-size: 1rem;
        margin-top: 10px;
        margin-bottom: 0;
        line-height: 26px;
      }
      h6.icon {
        background-repeat: no-repeat;
        background-size: 22px 22px;
        padding-left: 24px;
        background-position: 0 center;
      }
      h6.reviewers {
        background-image: url("/static/icons/chevron-up-o.svg");
      }
      h6.watchers {
        background-image: url("/static/icons/eye.svg");
      }
      h6.links {
        background-image: url("/static/icons/link.svg");
      }
      h6.tags {
        background-image: url("/static/icons/tag.svg");
      }
      table {
        width: 100%;
        border-spacing: 0;
      }
      td {
        padding: 0 0 4px 0;
      }
      td.right {
        text-align: right;
      }
      tr.overdue td,
      tr.overdue td a {
        color: var(--color-caution);
      }
      .title-pull .pull {
        margin-top: 10px;
      }
      p.mini-note {
        font-size: 80%;
        color: var(--subtle-text);
        font-style: italic;
      }
      p.nobody {
        margin: 0;
        color: var(--subtle-text);
      }
    }

    h1 {
      font-size: 32px;
    }
    #history-logs {
      font-size: 15px;

      table.listing {
        margin-bottom: 0;
        td {
          padding-top: 3px;
          padding-bottom: 3px;
        }
      }
    }
  }

  .h-scroller {
    overflow-x: auto;
    table.listing {
      width: max-content;
      min-width: 100%;

      &.thin {
        min-width: unset;
      }
      td.center {
        text-align: center;
      }
      tr.highlight td {
        font-weight: bold;
      }
      tr.error td {
        background-color: var(--flash-warning-bg) !important;
      }
      tr td.error {
        color: var(--color-caution);
      }
    }
  }

  #rfc-markdown table,
  table.listing {
    margin-bottom: 10px;
    border-spacing: 0;
    border: 1px solid var(--main-border);
    border-radius: 10px;
    overflow: hidden; /* border-radius and heading background */

    td, th {
      text-align: left;
    }
    th {
      padding: 1px 10px 1px 10px;
      background-color: var(--main-bg);
      height: 30px;
      line-height: 30px; /* helps with icon alignment */
    }
    td {
      padding: 5px 10px 5px 10px;
      background-color: white;
      border-top: 1px solid var(--main-border);
    }
    tr:nth-child(even)>td {
      background-color: var(--table-stripe-bg);
    }
  }
  #rfc-markdown table {
    margin-left: auto;
    margin-right: auto;
  }

  .inputter {
    margin: 10px 0 10px 0;
    border: 1px solid var(--main-border);
    border-radius: 10px;
    padding: 10px;
    background-color: var(--subtle-background);
    max-width: max-content;

    &.wide {
      max-width: unset;
    }

    dt {
      margin: 0 0 5px 0;
      font-weight: bold;
      font-size: 15px;
      color: #444;
    }

    dd {
      margin: 0 0 20px 0;
    }

    .note {
      margin: 5px 0 0 0;
      font-size: 13px;
      font-style: italic;
      color: var(--subtle-text);
    }
  }

  @media print, (max-width:480px) {
    .inputter {
      border: unset;
      border-radius: unset;
      padding: unset;
      background-color: unset;
    }
  }

  .mini-search {
    background: #d2cfd6;
    border: 1px solid #a7a0be;
    padding: 10px;
    border-radius: 20px;
    margin-bottom: 10px;

    table.listing {
      margin-top: 10px;
      margin-bottom: 0;
    }
  }

  /*
  .validate:valid {
    border-color: lime !important;
  }
  .validate:invalid {
    border-color: red !important;
  }
  */
  .validation-error {
    border: 1px solid red;
    padding: 2px 6px;
    background-color: #fff6f6;
    margin: 0 0 10px 0;
  }
  #tags {
    margin: 0 0 10px 0;
  }

  #rfc-markdown {
    max-width: 900px;
    background: #fff;
    padding: var(--standard-gap);
    box-shadow: 0 5px 10px #0003;
    margin: 0 auto 20px;

    & > * {
      position: relative;
    }

    p {
      padding: 0;
      line-height: 1.5em;
    }
    li p {
      margin: 0;
    }
    li p + p {
      margin-top: 10px;
    }
    code {
      background-color: #eee;
    }
    pre {
      margin-left: -10px;
      margin-right: -10px;
    }
    pre code {
      display: block;
      overflow-x: auto;
      overflow-y: hidden; /* prevents scrolljacking */
    }
    pre code.language-mermaid {
      background-color: transparent !important;
    }
    .rcx, .rcc {
      width: 16px;
      height: 16px;
      position: absolute;
      top: calc(50% - 8px);
      cursor: pointer;
      border-radius: 9px;
      border: 1px solid black;
      font-size: 11px;
      text-align: center;
      line-height: 16px;
      font-weight: normal;
      font-family: sans-serif;
    }
    .rcx {
      display: none;
      background-color: var(--comment-add-bg);
      right: 32px;
    }
    .rcc {
      display: inline-block;
      background-color: var(--comment-count-bg);
      right: 8px;
    }
    & > *:hover .rcx {
      display: inline-block;
    }
    /* highlight entire block when hovering on (+) */
    & > *:has(.rcx:nth-of-type(1):hover),
    & > *:has(.rcx:nth-of-type(2):hover) {
      background-color: var(--comment-add-hover-bg);
    }
    .show {
      display: inline-block;
    }
    /* image without alt text is p > img */
    img {
      max-width: 90%;
      display: block;
      margin: 0 auto;
    }
    figure {
      /* image with alt text is figure > img */
      margin: 0 0 10px 0;

      figcaption {
        text-align: center;
        font-style: italic;
        color: var(--subtle-text);
        margin-top: 5px;
        font-size: 14px;
      }
    }
  }
}

.title-pull {
  display: flex;

  h1, h2, h3, h4, h5, h6 {
    height: 28px;
    display: inline-block;
    flex-grow: 1;
    text-align: left;
  }
  .pull {
    height: 28px;
    display: inline-block;
    flex-grow: 1;
    text-align: right;
    font-size: 14px;
    line-height: 28px;
  }
}

footer {
  text-align: center;
  color: var(--subtle-text);
  background: var(--main-bg);
  border-top: 1px solid var(--main-border);
  width: calc(100% - 20px);
  font-size: 14px;
  height: var(--footer-height);
  line-height: var(--footer-height);
  padding: 0 10px;
  overflow-x: auto;
  white-space: nowrap;
}

dialog {
  padding: 10px 10px 0 10px;
  border-radius: 10px;
  background: var(--main-bg);
  border: 1px solid var(--main-border);
  box-shadow: 0 5px 20px #0003;

  .row {
    padding-bottom: 10px;
  }
  .row.content {
    line-height: 1.5em;
  }
  textarea {
    width: 400px;
    height: 100px;
  }
  label {
    color: var(--subtle-text);
  }
  .comments {
    width: 400px;
  }
  .when {
    color: var(--subtle-text);
    font-size: 13px;
  }
  .comment-section {
    border-bottom: 1px solid var(--main-border);
    margin-bottom: 10px;
    position: relative;

    &.dismissed {
      opacity: 0.5;
    }

    .dismisser {
      position: absolute;
      top: 10px;
      right: 10px;
      font-size: 10px;
      line-height: 15px;
      cursor: pointer;
    }
  }
}

/* TODO: colorize icons? https://codepen.io/sosuke/pen/Pjoqqp */
.review-status,
.review-required,
.review-optional {
  background-repeat: no-repeat;
  background-size: 18px 18px;
  padding-left: 21px;
  background-position: left center;
  font-size: 14px;

  &.await {
    color: var(--review-status-await);
    background-image: url("/static/icons/timelapse.svg");
  }
  &.approve {
    color: var(--review-status-approve);
    background-image: url("/static/icons/check-r.svg");
  }
  &.comment {
    color: var(--review-status-comment);
    background-image: url("/static/icons/comment.svg");
  }
  &.reject {
    color: var(--review-status-reject);
    background-image: url("/static/icons/danger.svg");
  }
  &.abstain {
    color: var(--review-status-abstain);
    background-image: url("/static/icons/sleep.svg");
  }
}
.review-required {
  color: var(--review-status-required);
  background-image: url("/static/icons/chevron-double-up-o.svg");
}
.review-optional {
  color: var(--review-status-optional);
  background-image: url("/static/icons/chevron-down-o.svg");
}

.user-role,
.rfc-status,
.rfc-visibility {
  background-repeat: no-repeat;
  background-size: 20px 20px;
  background-position: left center;
  padding-left: 24px;
  min-height: 20px;
}

.rfc-status {
  &.draft {
    background-image: url("/static/icons/pen.svg");
    color: var(--rfc-status-draft-fg);
  }
  &.review {
    background-image: url("/static/icons/eye.svg");
    color: var(--rfc-status-review-fg);
  }
  &.published {
    background-image: url("/static/icons/file-document.svg");
    color: var(--rfc-status-published-fg);
  }
  &.obsolete {
    background-image: url("/static/icons/unavailable.svg");
    color: var(--rfc-status-obsolete-fg);
  }
  &.deleted {
    background-image: url("/static/icons/trash.svg");
    color: var(--rfc-status-deleted-fg);
  }
}

.rfc-visibility {
  &.watchers-only {
    background-image: url("/static/icons/lock.svg");
  }
  &.org-wide {
    background-image: url("/static/icons/organisation.svg");
  }
  &.public {
    background-image: url("/static/icons/globe-alt.svg");
  }
}

.user-role {
  &.admin {
    background-image: url("/static/icons/crown.svg");
  }
  &.basic {
    background-image: url("/static/icons/user.svg");
  }
}

p.warning {
  border: 1px solid var(--warning-fg);
  background-color: var(--warning-bg);
  border-radius: 10px;
  padding: 2px 8px;
}
p.attention {
  border: 1px solid var(--attention-fg);
  background-color: var(--attention-bg);
  border-radius: 10px;
  padding: 2px 8px;
}
p.ok {
  border: 1px solid var(--ok-fg);
  background-color: var(--ok-bg);
  border-radius: 10px;
  padding: 2px 8px;
}
p.note {
  font-size: 13px;
  color: var(--subtle-text);
  font-style: italic;
}

#flash-messages {
  font-size: 14px;
  margin: 3px -10px -10px;
  border-top: 1px solid var(--main-border);

  .message {
    padding: 5px 10px;
    border-bottom-width: 1px;
    border-bottom-style: solid;
    font-style: italic;
  }
  .warning {
    background-color: var(--flash-warning-bg);
    color: var(--flash-warning-fg);
    border-color: var(--flash-warning-border);
  }
  .success {
    background-color: var(--flash-success-bg);
    color: var(--flash-success-fg);
    border-color: var(--flash-success-border);
  }
  .neutral {
    background-color: var(--flash-neutral-bg);
    color: var(--flash-neutral-fg);
    border-color: var(--flash-neutral-border);
  }
}

.simple-float-create {
  background: var(--main-bg);
  border: 1px solid var(--main-border);
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 10px;
  text-align: right;
  border-radius: 10px;
  button {
    margin-left: 10px;
  }
}

.toolbar {
  text-align: right;
  margin-bottom: var(--standard-gap);
}

.language-mermaid {
  background: transparent;
  text-align: center;
}

blockquote {
  margin: 0 0 0 40px;
  color: var(--subtle-text);
}

time {
  cursor: wait;
  text-decoration: underline #0006 dashed 1px;
  text-underline-offset: 2px;
}
time.localized {
  cursor: context-menu;
}
hr {
  border: 0;
  border-bottom: 1px solid var(--main-border);
}

span.sort-down,
span.sort-up {
  background-repeat: no-repeat;
  background-size: 20px 20px;
  background-position: center center;
  width: 20px;
  height: 20px;
  display: inline-block;
  vertical-align: middle;
}
span.sort-down {
  background-image: url("/static/icons/push-chevron-down-r.svg");
}
span.sort-up {
  background-image: url("/static/icons/push-chevron-up-r.svg");
}

.central {
  border: 1px solid var(--main-border);
  border-radius: 10px;
  max-width: 600px;
  margin: calc(25vh - 80px) auto 0 auto;
  background-color: var(--subtle-background);
  box-shadow: 0 10px 20px #0003;
  padding: 10px;

  form {
    margin-bottom: 10px;

    input[type=submit] {
      margin-left: 10px;
    }
    input[type=text] {
      /* if wrapping on mobile add gap between button and input */
      margin-bottom: 10px;
    }
  }

  p {
    font-size: 14px;
  }

  &>p:last-child {
    margin-bottom: 0
  }
}

/*
 * SCREEN SPECIFIC STYLES
 */

main.screen-home {
  .one-column {
    margin: 0 auto;
    max-width: 820px;
  }

  .jumbotron {
    border: 1px solid var(--main-border);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 80px;

    img {
      max-width: 100%;
      height: auto;
      display: block;
    }
  }

  h1 {
    text-align: center;
    margin: 80px 0 50px 0;
    line-height: 1.3;

    span {
      color: var(--action);
    }
  }

  p.subtitle {
    font-size: 20px;
    text-align: center;
    margin-bottom: 50px;
    line-height: 32px;
  }

  .cta {
    text-align: center;
    margin-bottom: 40px;
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-direction: row;
  }

  .more-info {
    margin-bottom: 40px;
    text-align: center;
  }

  a.button.giant {
    padding: 20px 25px;
    font-size: 20px;
    border-radius: 100px;
    font-weight: 500;
  }

  .boxy-three {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-template-rows: 200px 200px; 
    column-gap: 10px;
    row-gap: 10px;
    margin-bottom: var(--standard-gap);

    & > div {
      display: flex;
      align-items: center;
      text-align: center;
      font-size: 20px;
      line-height: 33px;
      background-color: var(--subtle-text);
      border-radius: 5px;
      padding: 20px;
      color: #fff;
      text-shadow: 0 1px 3px #000;
    }
  }

  @media (max-width:700px) {
    .boxy-three {
      grid-template-columns: repeat(2, minmax(0, 1fr));
      grid-template-rows: 200px 200px 200px; 
    }
  }
}

main.screen-profile {
  .avatar {
    float: left;
    width: 82px;
    height: 82px;
    margin-right: 10px;
    border-radius: 82px;
  }

  h1, h2 {
    white-space: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
  }

  #list-rfcs {
    clear: left;
  }
}

main.screen-rfc-status {
  .status-change {
    margin: 50px 0;
    display: flex;
    justify-content: space-evenly;

    .current {
      padding-top: 5px;
      font-size: 13px;
      font-style: italic;
    }
    .status {
      padding: 0 5px;
      vertical-align: top;
      text-align: center;
    }
    span.rfc-status {
      cursor: not-allowed;
    }
    button {
      background-color: #eee;
      background-position: 7px center;
      padding-left: 30px;
      font-weight: normal;
    }
    button.rfc-visibility {
      color: var(--text);
    }
  }
}
@media (max-width:600px) {
  main.screen-rfc-status {
    .status-change {
      margin: 0;
      display: block;
      .status {
        padding: 0 0 10px 0;
        text-align: left;
        button {
          width: 150px;
        }
        .current {
          display: inline-block;
          margin-left: 10px;
        }
      }
    }
  }
}

main.screen-rfc-new,
main.screen-rfc-editor {
  #input-content,
  #input-name,
  #markdown-wysiwyg,
  textarea,
  select {
    width: calc(100% - 5px);
    max-width: 900px;
  }
  #input-content,
  #input-name,
  #markdown-wysiwyg,
  textarea {
    border: 1px solid var(--main-border);
    padding: 2px;
    font-family: monospace;
  }
  #markdown-wysiwyg {
    position: relative;
    height: 400px;
  }
  textarea.hidden {
    display: none;
  }
  .right {
    float: right;
  }

  #image-library {
    form {
      clear: left;

      input[type=file] {
        width: 350px;
        border: 1px solid var(--main-border);
        border-radius: 10px;
        padding: 10px;
        background-color: var(--subtle-background);
        max-width: max-content;
        margin: 0 10px 10px 0;
      }
      input[type=file]::file-selector-button {
        padding: 5px 10px;
        background-color: var(--subtle-text);
      }
    }

    .rfc-files {
      overflow-x: auto;
      margin: 10px 0;

      .rfc-file {
        width: 120px;
        height: 120px;
        overflow: hidden;
        position: relative;
        float: left;
        margin: 0 10px 10px 0;
        border: 1px solid var(--main-border);
        border-radius: 10px;
        background-color: var(--subtle-background);
        cursor: pointer;

        &.recent-upload {
          .name, .created {
            background-color: #000c;
            color: #fff;
          }
        }

        .name, .created {
          position: absolute;
          left: 5px;
          font-size: 10px;
          white-space: nowrap;
          background-color: #fffc;
        }
        .name {
          bottom: 20px;
        }
        .created {
          bottom: 5px;
        }
        .image {
          img {
            max-width: 120px;
            max-height: 120px;
          }
        }
      }
    }
  }
}

main.screen-rfc-view {
  background-color: var(--subtle-background);

  /* move margin from breadcrumbs to rfc-markdown to fix drop shadow */
  #breadcrumbs {
    margin-bottom: 0;
  }
  #rfc-markdown {
    margin-top: 10px;
  }
}

.list-zero {
  text-align: center;
  padding: 100px 0;
  color: var(--subtle-text);
  background: var(--subtle-background);
  font-size: 20px;
  font-style: italic;
}

.markdown-alert {
  padding: var(--standard-gap);
  color: inherit;
  border-left: 2px solid var(--main-border);
  margin: 0 -10px var(--standard-gap) -10px;

  &>:first-child {
    margin-top: 0
  }
  &>:last-child {
    margin-bottom: 0
  }
  .markdown-alert-title {
    display: flex;
    font-weight: bold;
    align-items: center;
    line-height: 1
  }
  .markdown-alert-title .octicon {
    margin-right: var(--standard-gap);
    display: inline-block;
    overflow: visible !important;
    vertical-align: text-bottom;
    fill: currentColor;
  }
  &.markdown-alert-note {
    border-left-color: var(--color-note);
    background-color: color-mix(in srgb, var(--color-note) 5%, transparent);
    .markdown-alert-title {
      color: var(--color-note);
    }
  }
  &.markdown-alert-important {
    border-left-color: var(--color-important);
    background-color: color-mix(in srgb, var(--color-important) 5%, transparent);
    .markdown-alert-title {
      color: var(--color-important);
    }
  }
  &.markdown-alert-warning {
    border-left-color: var(--color-warning);
    background-color: color-mix(in srgb, var(--color-warning) 5%, transparent);
    .markdown-alert-title {
      color: var(--color-warning);
    }
  }
  &.markdown-alert-tip {
    border-left-color: var(--color-tip);
    background-color: color-mix(in srgb, var(--color-tip) 5%, transparent);
    .markdown-alert-title {
      color: var(--color-tip);
    }
  }
  &.markdown-alert-caution {
    border-left-color: var(--color-caution);
    background-color: color-mix(in srgb, var(--color-caution) 5%, transparent);
    .markdown-alert-title {
      color: var(--color-caution);
    }
  }
}

#global-error {
  pointer-events: none;
  font-size: 14px;
  opacity: 0;
  background-color: var(--flash-warning-bg);
  color: var(--flash-warning-fg);
  border: 1px solid var(--flash-warning-border);
  text-align: center;
  border-radius: 10px;
  padding: 10px;
  position: fixed;
  z-index: 2;
  margin: 0 auto;
  bottom: 50px;
  display: block;
  left: 50%;
  transform: translate(-50%);
}

#global-error.show {
  opacity: 1;
  animation: errorFadeIn 0.5s, errorFadeOut 0.5s 2.5s;
}

@keyframes errorFadeIn {
  from {opacity: 0;}
  to {opacity: 1;}
}

@keyframes errorFadeOut {
  from {opacity: 1;}
  to {opacity: 0;}
}

main.screen-blog-list {
  #blog-posts {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;

    .blog-post {
      display: block;
      text-decoration: none;
      width: 400px;
      border: 1px solid var(--main-border);
      background: var(--subtle-background);
      border-top-left-radius: 10px;
      border-top-right-radius: 10px;
      overflow: hidden;

      &:hover {
        border-color: var(--action);
        background-color: var(--main-bg);
      }

      .banner {
        height: 100px;
        position: relative;
        background-color: var(--main-bg);
        background-size: cover;
        background-position: center center;

        .byline {
          position: absolute;
          font-size: 13px;
          right: 10px;
          bottom: 10px;
          color: var(--subtle-text);
          font-weight: 600;
          background-color: #fffc;
        }

        h2 {
          padding: 10px;
          height: 100px;
          color: var(--action);

          span {
            background-color: #fffc;
            line-height: 33px;
          }
        }
      }

      .summary {
        padding: 10px;

        p {
          color: var(--text);
        }
      }
    }
  }
}
@media (max-width:600px) {
  #blog-posts {
    flex-direction: column;
    .blog-post {
      width: unset !important;
    }
  }
}

main.screen-blog-view {
  background-color: var(--subtle-background);

  #rfc-markdown > h1 {
    margin-bottom: 5px;
  }

  h4.date {
    color: var(--subtle-text);
  }
  .user-info {
    margin: 10px 0 10px -10px;
    background-color: var(--main-bg);
    border-top: 1px solid var(--main-border);
    border-right: 1px solid var(--main-border);
    border-bottom: 1px solid var(--main-border);
    max-width: 250px;
    padding: 10px;
    border-top-right-radius: 10px;
    border-bottom-right-radius: 10px;

    .avatar {
      float: left;
      width: 40px;
      height: 40px;
      margin-right: 10px;
      border-radius: 82px;
      margin-right: 10px !important;
    }

    .user-display,
    .user-username {
      display: block;
      height: 20px;
      line-height: 20px;
    }
  }
}

@media print, (max-width:1270px) {
  /* shadow gets cut off when screen is thin */
  #rfc-markdown {
    box-shadow: none !important;
  }
}

@media print, (max-width:480px) {
  header {
    #logo {
      height: 30px;
      width: 120px;
    }
    #search {
      width: calc(100% - 120px - 10px);
      float: right;
      input[type=search] {
        width: calc(100% - 50px);
      }
    }
  }
  main {
    overflow-x: auto;

    &.screen-rfc-view {
      background-color: #fff;
    }
    #view-rfc {
      flex-wrap: wrap;
      & > article {
        width: 100%;
        max-width: inherit;
        order: 2;
        overflow-x: unset; /* fix negative margins on pre / tips */
      }
      & > aside {
        width: unset;
        flex: 1 1 auto;
        order: 1;
        margin-bottom: 10px;

        .sticky {
          border-right: 0;
          border-left: 0;
          width: inherit;
          margin-right: -10px;
          margin-left: -10px;
          border-top-left-radius: 0;
          max-height: unset;
        }
      }
      #rfc-markdown {
        padding: 0;
      }
    }
  }
  .simple-float-create {
    position: unset;
    margin-bottom: 10px;
  }
  main.screen-home {
    .cta {
      flex-direction: column;
    }
  }
}

@media print {
  :root {
    --text: black;
    --action: black;
  }
  html, body {
    margin: 0;
    padding: 0;
  }
  time {
    text-decoration: none;
  }
  header {
    #search {
      display: none;
    }
    nav {
      display: none;
    }
  }
  header,
  #flash-messages {
    border: 0;
  }
  footer {
    display: none;
  }
  main {
    .simple-float-create,
    #breadcrumbs {
      display: none;
    }
    .rfc-status,
    .rfc-visibility {
      padding-left: 0;
    }
    pre code {
      white-space: break-spaces;
      padding: 10px; /* code gets cut off */
    }
    #view-rfc {
      & > article {
        margin: 0;
        padding: 0;
      }
      & > aside {
        a {
          text-decoration: none;
        }
        .edit-button,
        .links br {
          display: none;
        }
        h6.icon {
          padding-left: 0; /* no print background icons */
        }
        .sticky {
          border-width: 0;
          width: inherit;
          .title-pull .pull,
          .one-line .pull {
            display: none;
          }
        }
      }
      #rfc-markdown {
        .rcx, .rcc {
          display: none;
        }
      }
      img {
        max-width: 50%;
      }
      #history-logs {
        display: none;
      }
    }
  }
}
