﻿/* ----- Light Theme ----- */
:root {
  --color: #000;
  --bg: #fff;
  /* --btn-bg: #f5f5f5; */
  --btn-hover: #555;
  --btn-border: #ddd;
  --border: #ddd;
  --link: #08f;
  --dim: #777;
  --head: #777;
  --bg-even: #eee;
  --shadow: #0004;
}

/* ----- Dark Theme ----- */
@media screen and (prefers-color-scheme: dark) {
  :root {
    --color: #fff;
    --bg: #000;
    /* --btn-bg: #666; */
    /* --btn-hover: #888; */
    --border: #777;
    --link: #0ef;
    --dim: #ccc;
    --bg-even: #444;
    --shadow: #fff8;
  }
}

/* ----- General ----- */
body {
  color: var(--color);
  background: var(--bg);
  padding: 0;
  margin: 0;
  font-family: sans-serif;
}

* {
  box-sizing: border-box;
}

a {
  color: var(--link);
  text-decoration: none;
}

/* article {

} */

h1 {
  color: #fff;
  background: #444;
  margin: 0;
  padding: 0.2em 0.5em;
  font-size: 1.5em;
  font-weight: normal;
  text-align: center;
}

h1 img {
  width: 1em;
  filter: invert(1);
}

h1 span {
  font-size: 0.5em;
}

div.head {
  display: grid;
  grid-template-columns: auto auto auto 1fr auto auto;
  gap: 0.5em;
  padding: 0.5em;
  background-color: var(--head);
  color: #fff;
  font-size: 0.9em;
}

.head select {
  color: inherit;
  background: inherit;
  border: 1px solid var(--btn-border);
  border-radius: 0.3em;
}

div.content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.2em;
  padding: 0.5em 0;
}

.content label {
  padding: 0.2em 0.5em;
}

.content label:nth-of-type(even) {
  background: var(--bg-even);
}

input {
  border: 1px solid var(--border);
  padding: 0.2em;
  color: inherit;
  background: transparent;
}

/* ----- button ----- */
input[type="file"] {
  display: none;
}

label[for="file"],
button {
  color: inherit;
  background: inherit;
  border-radius: 5px;
  border: 1px solid var(--btn-border);
  cursor: pointer;
  font-size: 0.9em;
  font-family: sans-serif;
  padding: 0.5em 1em;
  text-align: center;
  transition: 0.5s;
}

label[for="file"]:hover,
button:hover {
  background-color: var(--btn-hover);
}

label[for="file"] > *,
button > * {
  pointer-events: none;
}
/* ----- button ----- */

/* ----- Help ----- */
details {
  position: relative;
}

summary {
  list-style: none;
  outline: 0;
  padding: 0.4em 0.6em;
  cursor: pointer;
  transition: 0.5s;
}

summary img {
  width: 1em;
  vertical-align: bottom;
  filter: invert(1);
}

summary:hover, details[open] {
  background-color: var(--btn-hover);
}

details[open] summary ~ * {
  animation: fade-in 0.5s ease-in-out;
}

@keyframes fade-in {
    0%  { opacity: 0; transform: translateY(-1em); }
  100%  { opacity: 1; transform: translateY(0); }
}

details > div {
  color: var(--color);
  background: var(--bg);
  margin: 0;
  padding: 0;
  width: 40vw;
  font-size: 0.9em;
  position: absolute;
  top: 3.5em;
  right: 0.6em;
  z-index: 10;
  border-radius: 5px;
  box-shadow: 0 8px 16px 0 var(--shadow);
  transition: 0.5s;
  text-align: initial;
}

details > div::after {
  content: '';
  position: absolute;
  top: -1.5em;
  right: 0.5em;
  border-width: 0.8em;
  border-style: solid;
  border-color: transparent transparent #777 transparent;
}

h3 {
  color: #fff;
  background-color: var(--head);
  margin: 0;
  padding: 0.2em 0.5em;
  font-size: 1.2em;
  font-weight: normal;
}

h3:first-of-type {
  border-radius: 5px 5px 0 0;
}

dl {
  margin: 0;
  padding: 0.5em;
  max-height: 30vh;
  overflow-y: auto;
}

dt span {
  font-size: 0.7em;
  color: var(--dim);
}

dd + dt {
  margin-top: 0.5em;
}
/* ----- /Help ----- */