*,
*::before,
*::after {
  box-sizing: border-box;
}

* {
  padding: 0;
  margin: 0;
}

html, body {
  height: 100%;
}

body {
  background-color: #DFDBE5;
  background-image: url(shape.svg);
  font-family: Helvetica, Arial;
  overflow: hidden;
  font-size: 90%;
}

textarea {
  border: 0;
  min-height: 66vh;
  min-width: 380px;
  max-width: 90vw;
  max-height: 72vh;
}
textarea:focus {
  outline: 0;
}
textarea.invalid {
  color: #b34045;
}
@media screen and (min-width: 760px) {
  textarea {
    max-width: 760px;
  }
}
fieldset {
  border: none;
}
ul {
  list-style: none;
}

.pad {
  padding: 10px;
}

.max {
  width: 100%;
  height: 100%;
}

.max-w {
  width: 100%;
}

.max-h {
  height: 100%;
}

.flex {
  display: flex;
}

.auto {
  flex: 1 1 auto;
}

.center {
  align-items: center;
  justify-content: center;
}

.top {
  align-items: top;
}

.group {
  border: 1px solid silver;
  border-radius: 5px;
}

.group.clean {
  border: none;
}
.group.clean label::before {
  display: none;
}

.group > label {
  display: inline-block;
  position: relative;
  padding: 0 5px;
}

.group > label > input {
  margin-right: 5px;
}

.group + .group {
  margin-left: 10px;
}

.toolbar {
  background-color: #FFF;
}

.nested {
  margin: 5px 0 0 10px;
}
.nested > ul + ul {
  margin-top: 10px;
}
.nested div > ul > li {
  padding: 10px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .2);
}
.nested > label {
  position: absolute;
  right: 0;
  top: 0;
}
.nested > label input {
  margin-left: 10px;
  vertical-align: middle;
}

.menu {
  position: relative;
}
.notify,
.menu > ul {
  box-shadow: 0 1px 3px rgba(0, 0, 0, .3);
  background-color: #FFF;
  position: absolute;
  display: none;
  z-index: 1;
  min-width: 260px;
  max-height: 260px;
  overflow: auto;
}
.notify {
  transition: all .2s;
  padding: 10px;
  display: block;
  opacity: 0;
  right: -200px;
  top: 45px;
}
.notify.display {
  opacity: 1;
  right: 0;
}
.menu:hover > ul {
  display: block;
}
.menu li {
  display: flex;
}
.menu li a {
  padding: 5px 10px;
  flex: 1 1 auto;
}
.menu li a:hover {
  background-color: #FAFAFA;
  color: gray;
}
.menu li small {
  display: block;
}

#app {
  height: 100vh;
  display: grid;
  grid-template-columns: auto;
  grid-template-rows: 50px auto 50px;
  grid-template-areas:
  'l'
  'm'
  'o'
  ;
}

@media screen and (min-width: 960px) {
  #app {
    grid-template-columns: auto;
    grid-template-rows: 50px auto;
    grid-template-areas:
      'l o'
      'm m'
      ;
  }
}

#list {
  grid-area: l;
}

#opts {
  grid-area: o;
}

#main {
  border-top: 1px solid #C1B0CB;
  border-bottom: 1px solid #C1B0CB;
  grid-area: m;
  overflow: auto;
}

@media screen and (min-width: 720px) {
  #main {
    border-bottom: 0;
  }
}

#main > iframe,
#main > fieldset {
  box-shadow: 0 1px 3px rgb(0, 0, 0, .5);
  max-height: 85%;
  overflow: auto;
}

#toggle ~ #input { display: none; }
#toggle ~ #preview { display: flex; }

#toggle:checked ~ #input { display: flex; }
#toggle:checked ~ #preview { display: none; }

#list select {
  margin-left: 10px;
  max-width: 200px;
}

#list h1 {
  font-size: 1.3em;
  margin-right: 1em;
  border: 1px dashed silver;
  padding: 0 5px;
}
#list .inbox {
  width: 20px;
  height: 1em;
  line-height: 1;
  vertical-align: top;
  display: inline-block;
  background-image: url(inbox.svg);
  background-size: 15px 1em;
  background-repeat: no-repeat;
}
#list .inbox.empty::before {
  visibility: none;
  top: 50px;
  opacity: 0;
}
#list .inbox::before {
  transition: all .2s;
  content: attr(data-count);
  position: absolute;
  border: 1px solid silver;
  background-color: white;
  color: gray;
  padding: 2px 5px;
  font-size: .75em;
  text-align: center;
  border-radius: 15px;
  opacity: 1;
  min-width: 1em;
  left: -1em;
  top: -5px;
}

a {
  color: silver;
  text-decoration: none;
}

#opts a {
  padding: 0 10px;
  line-height: 2;
  position: relative;
}

#opts a + a::before,
#opts input + button::before,
#input .group label + label::before {
  height: 100%;
  left: 0;
  top: 0;
  content: '';
  position: absolute;
  border-left: 1px solid silver;
}

#input > div { width: 100%; }

textarea + button:hover {
  cursor: pointer;
  color: red;
}

input, button, select, textarea {
  font-family: Helvetica, Arial;
  background: transparent;
  position: relative;
  padding: 5px;
  border: none;
}

ul + button {
  margin-left: 0 !important;
  margin-top: 10px;
  padding: 5px;
  border: 1px solid silver;
  border-radius: 5px;
}

select {
  background: transparent;
  border-radius: 5px;
  padding: 5px;
}

button {
  padding: 0 10px;
}

a.active {
  color: gray;
}

#opts input {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' width='16' height='16'%3E%3Cpath fill-rule='evenodd' d='M1.75 2A1.75 1.75 0 000 3.75v.736a.75.75 0 000 .027v7.737C0 13.216.784 14 1.75 14h12.5A1.75 1.75 0 0016 12.25v-8.5A1.75 1.75 0 0014.25 2H1.75zM14.5 4.07v-.32a.25.25 0 00-.25-.25H1.75a.25.25 0 00-.25.25v.32L8 7.88l6.5-3.81zm-13 1.74v6.441c0 .138.112.25.25.25h12.5a.25.25 0 00.25-.25V5.809L8.38 9.397a.75.75 0 01-.76 0L1.5 5.809z'%3E%3C/path%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 5px 50%;
  padding-left: 25px;
}

#input {
  min-width: 400px;
}

#input {
  border: 0;
}

#input li {
  margin-bottom: 10px;
  position: relative;
}

#input button {
  margin-left: 5px;
  cursor: pointer;
}
#input summary {
  cursor: default;
}
#input textarea {
  border-bottom: 1px dashed #C1B0CB;
}
#input textarea:focus {
  border-color: transparent;
}
#input li:last-child {
  margin-bottom: 0;
}

#input li > label {
  display: block;
  color: gray;
}
#input li > div > input {
  margin-top: 5px;
}
#input textarea {
  width: 100%;
}
