
@media (prefers-color-scheme: dark) {
  body {
    color-scheme: dark;
    --color-fg-default: #c9d1d9;
    --color-fg-muted: #8b949e;
    --color-fg-subtle: #484f58;
    --color-canvas-default: #0d1117;
    --color-canvas-subtle: #24282f;
    --color-canvas-muted: #2c2d2e;
    --color-border-default: #30363d;
    --color-border-muted: #555;
    --color-neutral-muted: rgba(110,118,129,0.4);
    --color-accent-fg: #759dc6;
    --color-strong-fg: #759dc6;
    --color-accent-emphasis: #1f6feb;
    --color-attention-subtle: rgba(187,128,9,0.15);
    --color-danger-fg: #f85149;
    --color-button-lite: #666;
    --color-button-lite-hover: #161c1c;
    --color-input-bg: #1e1e1e;
    --color-input-border: #555;
  }
}

@media (prefers-color-scheme: light) {
  body {
    /* color-scheme: light; */
    --color-fg-default: #24292f;
    --color-fg-muted: #57606a;
    --color-fg-subtle: #6e7781;
    --color-canvas-default: #fff;
    --color-canvas-muted: #eaf4fb;
    --color-canvas-subtle: #f6f8fa;
    --color-border-default: #d0d7de;
    --color-border-muted: hsla(210,18%,87%,1);
    --color-neutral-muted: rgba(175,184,193,0.2);
    --color-accent-fg: #336791;
    --color-strong-fg: #336791;
    --color-accent-emphasis: #0969da;
    --color-attention-subtle: #fff8c5;
    --color-danger-fg: #cf222e;
    --color-button-lite: #bbb;
    --color-button-lite-hover: #eee;
    --color-input-bg: #fff;
    --color-input-border: #ccc;
  }
}

body {
  -ms-text-size-adjust: 100%;
  -webkit-text-size-adjust: 100%;
  --font: ui-monospace,SFMono-Regular,SF Mono,Menlo,Consolas,Liberation Mono,monospace;
  --color-button: #eee;
  --color-button-bg: #336791;
  --color-button-hover-bg: #2b4661;
  --color-button-disabled-bg: #485871;
  margin: 2rem;
  color: var(--color-fg-default);
  background-color: var(--color-canvas-subtle);
  font-family: var(--font);
  line-height: 1.5;
  word-wrap: break-word;
}

body [hidden] {
  display: none !important;
}

body a {
  background-color: transparent;
  color: var(--color-accent-fg);
  text-decoration: underline;
  text-underline-offset: 3px;
}

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

body a.disable{
  pointer-events: none;
  color:var(--color-fg-subtle);
}

body b,
body strong {
  font-weight: 600;
  color: var(--color-strong-fg);
}

body dfn {
  font-style: italic;
}

body h1 {
  margin: .67em 0;
  font-weight: 600;
  font-size: 2em;
}

body header {
  width: 100%;
  display:flex;
  flex-wrap: wrap;
  align-items: center;
  padding-bottom: .3em;
  color: var(--color-strong-fg);
}

body header h1 {
  flex-direction: column;
  width: 100%;
  flex: 1 0;
  font-weight: 600;
}

body header button {
  flex: 0 0 auto;
  padding: .5rem;
  line-height: 0;
  color: var(--color-button-lite);
  background-color: var(--color-canvas-subtle);
  border: 1px solid var(--color-button-lite);
  border-radius: .5rem;
}

body header button:hover {
  background-color: var(--color-button-lite-hover);
}

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

body input, body button, body table {
  font: inherit;
  margin: 0;
  overflow: scroll;
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
}

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

body h2 {
  color: var(--color-strong-fg);
  font-weight: 400;
  padding-bottom: .3em;
  font-size: 1.5em;
}

body h3 {
  font-weight: 400;
  font-size: 1.25em;
}

body h4 {
  font-weight: 400;
  font-size: 1em;
}

body h5 {
  font-weight: 400;
  font-size: .875em;
}

body h6 {
  font-weight: 400;
  font-size: .85em;
  color: var(--color-fg-muted);
}

body p {
  margin-top: 0;
  margin-bottom: 10px;
}

body textarea, body input, body tt, body code {
  font-family: var(--font);
  font-size: inherit;
  width:100%;
}

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

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

body ul, body ol {
  list-style-position: inside;
  padding-left: 0;
}

#about ul {
  list-style: none;
}

@media screen and (min-width: 768px) {
  .container {
    display: flex;
    flex-direction: row;
  }

  .container textarea {
    max-height: 70vh !important;
  }

  .left {
    flex-direction: column;
    padding-top: 1em;
    width: 50%;
  }

  label {
    font-weight: bold;
  }

  .right {
    flex-direction: column;
    width: 50%;
    height: 100%;
    padding: 1rem 0 .5rem 1rem;
  }
  #options {
    float:right;
    text-align:right;
  }
}

@media screen and (max-width: 768px) {
  body {
    margin: 1rem;
  }
  .container {
    display: flex;
    flex-direction: column;
  }

  .left, .right {
    flex-direction: column;
    width: 100%;
    padding: 1rem 0;
  }
}

.left div {
  margin-bottom: 1em;
}

#clear {
  background-color: transparent;
  color: var(--color-accent-fg);
  text-decoration: none;
  cursor: pointer;
}

#clear:hover {
  text-decoration: underline;
}

#fluid {
  width: 100%;
  display:flex;
  flex-wrap: wrap;
}

#path {
  width: 100%;
  flex: 1 0;
  padding-left: .5rem;
  background-color: var(--color-input-bg);
  border: 1px solid var(--color-input-border);
  border-radius: .5rem;
  box-sizing: border-box;
}

#go {
  display: flex;
}

#go button {
  line-height: 1.5rem;
  margin-left: .5rem;
  font-size: inherit;
  padding: 0 1rem;
  color: var(--color-button);
  background-color: var(--color-button-bg);
  border: 1px solid var(--color-button-bg);
  border-radius: .5rem;
}

#go button:hover {
  background-color: var(--color-button-hover-bg)
}

#go button:disabled {
  background-color: var(--color-disabled-hover-bg)
}

@media screen and (max-width:576px) {
  #fluid {
    flex-flow: column;
  }
  #go {
    padding-top: .5rem;
    flex: 0 0 auto;
    height: 2.5rem;
  }
  #go button {
    flex: 1 0;
  }
  #go button:first-child {
    margin: 0;
  }
}

.nowrap {
  white-space: nowrap;
}

#actions > * {
  margin-right: 0.5em;
}

.right input {
  width: auto;
}

#mode-box {
  display: flex;
  flex-direction: row;
  align-items: center;
  margin-top: .5rem;
}

#mode-box > label {
  padding: 0.25rem 0.5rem;
}

#options {
  border:none;
  margin: 0;
  padding: .5rem 0 .5rem .5rem;
}

#mode {
  background-color:var(--color-canvas-subtle);
  display: inline-block;
  border: 1px solid var(--color-border-muted);
  border-radius: .5rem;
  overflow: hidden;
}

#mode input[type="radio"] {
  display: none;
}

#mode label.nowrap {
  text-align: center;
  font-weight: normal;
  margin: 0;
  display: inline-block;
  padding: 0.25rem 0.5rem;
  cursor: pointer;
}

#mode label.nowrap:hover {
  background-color: var(--color-button-lite-hover);
}

#mode label.nowrap:nth-child(2) {
  border-left: 1px solid var(--color-border-muted);
  border-right: 1px solid var(--color-border-muted);
}

#mode label.nowrap:has(> input:checked) {
  color: var(--color-button);
  background-color: var(--color-button-bg);
}

.container textarea {
  margin-top: .3rem;
  background-color: var(--color-canvas-subtle);
  border: 1px solid var(--color-input-border);
  padding: .5rem;
  border-radius: .5rem;
  max-height: 40vh;
  box-sizing: border-box;
}

footer {
  margin: 1rem;
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  text-align: center;
}

footer > * {
  width: 100%;
}

#refs a {
  text-decoration: none;
}

details[open], .warn {
  background-color: var(--color-canvas-muted);
  padding: .75rem;
  border: 1px solid var(--color-input-border);
  border-radius: .5rem;
}

#about h2 {
  margin-top: 0;
}

details summary {
  display: none;
}

body table {
  width: 100%;
  border-collapse: collapse;
}

body thead th {
  border-bottom: 1px solid var(--color-fg-default);
  padding-bottom: .5rem;
  font-weight: bold;
}

td, th {
  vertical-align:top;
}

body tbody td {
  border-bottom: 1px solid var(--color-border-default);
  padding: .25rem;
}

body tbody tr td:first-child{
  font-weight: bold;
}
