html, body {
  font-family: sans-serif;
  margin: 0 .5rem;
  height: 100%;
}

#page {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.tabbar {
  display: flex;
  flex-wrap: wrap;
  overflow: auto;
}

.tabbar > details {
  display: contents;
}

.tabbar > details[open] > summary {
  background-color: lightgray;
  z-index: 1;
  border-bottom: none;
}

.tabbar > details[open]::details-content {
  display: contents;
}

.tabbar > details > summary {
  order: 0;
  display: block;
  padding: .5rem 1rem;
  
  cursor: pointer;
  /*border: 1px solid grey;*/
  border-bottom: none;
  border-radius: .5rem .5rem 0 0;
  border: 1px solid grey;
  margin-right: -1px;
}

.tabbar > details > section {
  margin-top: -1px;
  order: 1;
  padding: 1rem;
  width: 100%;
  background-color: lightgrey;
  border: 1px solid grey
}

.container {
  display: flex;
  flex-direction: row;
  margin: 1rem 0;
  overflow: hidden;
}

.container > div {
  background: #eee;
  width: 50%;
  padding: 1rem;
  overflow: auto;
  display: flex;
  flex-direction: column;
}

.zone {
  border: 1px solid grey;
  background-color: #4442;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-height: 3rem;
  margin-top: .5rem;
  flex: 1;
  overflow: auto;
}

.zone .element > summary {
  padding: 1rem;
  cursor: grab;
  display: flex;
  justify-content: space-between;
  flex-direction: row;
  align-items: center;
}

.zone .element.added > summary,
.zone .element.merged > summary {
  cursor: pointer;
}

.zone .element > summary, .zone .element {
  background: rgb(245, 245, 255);
  border: 1px solid transparent;
  border-radius: 5px;
  box-shadow: 0 0 5px darkgray;
}
.zone .element > section {
  padding: 1rem;
}

summary > .thumbnail {
  margin-left: .5rem;
}

.thumbnail {
  height: 3rem;
  width: 4rem;
  background-color: lightgray;
  border: 1px solid darkgray;
  border-radius: 2px;
  object-fit: cover;
}

:not(summary) > .thumbnail {
  margin-right: .25rem;
}

.thumbnail-full {
  max-width: 100%;
  max-height: 100%;
}

.imageedit[data-active="true"] {
  border: 2px dashed rgb(122, 122, 255);
  border-radius: .5rem;
  padding: .2rem;
  margin: -.1rem;
  display: flex;
  flex-wrap: wrap;
  gap: .25rem;
}

.zone > div.dragg {
  box-shadow: 0 0 10px rgb(36, 166, 210) !important;
}

.zone.drag {
  box-shadow: 0 0 10px #0f08;
}

.draghandle {
  float: right;
  padding: .1rem .5rem;
  height: 1.25rem;
}

.dragging {
  opacity: .5;
  border: 1px dashed darkgray !important;
}

[data-role='finding'].drag,
[data-role='finding']:has(.draghandle.drag) {
  box-shadow: 0 0 10px #00f8;
}

::backdrop {
  background: rgb(222, 222, 222);
  opacity: 0.8;
}

dialog {
  border: none;
  max-height: 90vh;
  max-width: 90vw;
  border-radius: .5rem;
  box-shadow: 0 0 10px darkgray;
}

#detailsselector {
  display: none;
  height: auto;
  padding: .5rem;
  margin-bottom: .5rem;
  font-size: 1rem;
  font-family: sans-serif;
  width: 100%;
  padding-left: 1rem;
}

.tablist.compact {
  > #detailsselector {
    display: block;
  }
  .tabbar > details > summary {
    height: 1px;
    opacity: 0  ;
    padding-bottom: 0;
    padding-top: 0;
    pointer-events: none;
  }
}

p {
  margin-top: 0;
}

#undo::before {
  content: url(icons/undo.svg);
  float: left;
  margin-right: .5rem;
  height: 1rem;
  width: 1rem;
}

#redo::before {
  content: url(icons/redo.svg);
  float: left;
  margin-right: .5rem;
  height: 1rem;
  width: 1rem;
}

.save::before {
  content: url(icons/save.svg);
  float: left;
  margin-right: .5rem;
  height: 1rem;
  width: 1rem;
}

.open::before {
  content: url(icons/openfile.svg);
  float: left;
  margin-right: .5rem;
  height: 1rem;
  width: 1rem;
}

.moveall::before {
  content: url(icons/moveall.svg);
  float: left;
  margin-right: .5rem;
  height: 1rem;
  width: 1rem;
}

button.icontext {
  float: none;
}

button.icontext::before {
  margin-right: .5rem;
}

dialog .buttons button {
  margin-left: .5rem;
}

button.merge::before {
  content: url(icons/merge.svg);
  float: left;
  margin-right: .5rem;
  height: 1rem;
  width: 1rem;
}

.close {
  float: right;
}
.close::before {
  content: url(icons/close.svg);
  float: left;
  height: 1rem;
  width: 1rem;
}

dialog .buttons {
  display: flex;
  justify-content: end;
}

button {
  padding: .5rem;
}

button:disabled::before {
  filter: opacity(.5);
}


.zone .element summary::before {
  color: grey;
  content: url(icons/caret.svg);
  margin-right: 1rem;
  height: 1rem;
  width: 1rem;
  transition: .1s all ease-in-out;
  vertical-align: center;
}

.zone .element[open] summary::before {
  transform: rotate(90deg);
}

.added, .merged {
  color: #999;
  cursor: not-allowed;
  opacity: .7;
}

.zone:not(#mlist) .element.added summary span::after {
  content: url(icons/check.svg);
  height: 1rem;
  width: 1rem;
  margin-left: .5rem;
  display: inline-block;
}

.zone:not(#mlist) .element.merged summary span::after {
  content: url(icons/merge.svg);
  height: 1rem;
  width: 1rem;
  margin-left: .5rem;
  display: inline-block;
}

.element span {
  flex: 1;
}
.element img[src=""] {
  height: 0;
  opacity: 0;
}


.indicator {
  background-color: darkgray;
  padding: .1rem .4rem;
  border-radius: 1rem;
  font-size: .7rem;
  font-weight: bold;
  color: white;
  display: inline-block;
  vertical-align: middle;
  margin-left: .2rem;
  margin-top: -.2rem;
}


.mergecontainer {
  display: flex;
  gap: 1rem;
}

.mergecontainer > div {
  flex: 1;
}

.mergecontainer > div:nth-child(2) {
  flex: 2;
  padding: 0 1rem;
  border-left: 1px solid darkgray;
  border-right: 1px solid darkgray;
}

details > section > div {
  margin-bottom: .75rem;
}

label {
  display: block;
  margin-bottom: .25rem;
  color: darkgray;
  font-size: .75rem;
  text-transform: uppercase;
  flex: 0 0 100%;
}

.formgroup {
  display: flex;
  flex-wrap: wrap;
  gap: 0 .25rem;
  margin: 1rem 0;
  align-items: center;

  input, textarea, select {
    padding: .25rem;
    box-sizing: border-box;
    flex-grow: 1;
    min-height: 2rem;
    font-family: inherit;
    font-size: 1rem;
    resize: vertical;
  }
}

dialog div {
  margin-bottom: .5rem;
}

.enum:not(:last-of-type)::after {
  content: ', ';
}

hr {
  border: #9999 solid 1px;
  margin: .5rem 0;
}

select {
  width: 100%;
}

.severity::before {
  padding: .1rem .4rem;
  border-radius: 1rem;
  font-size: .7rem;
  font-weight: bold;
  color: white;
  display: inline-block;
  vertical-align: middle;
  margin-left: .2rem;
  margin-top: -.2rem;
}

.severity.severity-4::before {
  content: "Very High";
  background-color: red;
}
.severity.severity-3::before {
  content: "High";
  background-color: orange;
}
.severity.severity-2::before {
  content: "Medium";
  background-color: lightskyblue;
}
.severity.severity-1::before {
  content: "Low";
  background-color: lightgreen;
}
.severity.severity-0::before {
  content: "Very Low";
  background-color: darkgreen;
}