
:host {
  display: grid;
  grid-template-columns: minmax(0, 320px) 16px minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  width: 100%;
  height: 100%;
  overflow: hidden;
}
:host .master {
  position: relative;
  display: block;
  will-change: transform;
  transition: transform 0.2s ease-in;
}
:host .md-splitter {
  display: flex;
  align-items: center;
  margin: 0 -0.25rem;
  z-index: 1;
}
:host .md-splitter svg {
  height: 1.5rem;
  width: 1rem;
  padding-left: 0.5rem;
  fill: var(--c-border);
}
:host .md-splitter svg:hover {
  cursor: pointer;
}

:host(.master-closed) {
  grid-template-columns: 16px minmax(0, 1fr);
}
:host(.master-closed) .master {
  display: none;
}
:host(.master-closed) .md-splitter {
  margin: 0 -1rem 0 0;
}
:host(.master-closed) .md-splitter svg {
  height: 1.5rem;
  width: 1rem;
  padding: 0.5rem;
  margin-right: -0.25rem;
}

::slotted([slot=master]), ::slotted([slot=detail]) {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.master, .detail {
  width: 100%;
  height: 100%;
}
.master > div, .detail > div {
  width: 100%;
  height: 100%;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-orient: vertical;
  -webkit-box-direction: normal;
  -ms-flex-direction: column;
  flex-direction: column;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  will-change: transform;
}

.master-out {
  -webkit-transform: translateX(-100%);
  transform: translateX(-100%);
}

:not(.master-out) {
  -webkit-transform: translateX(0);
  transform: translateX(0);
}

@media screen and (max-width: 500px) {
  :host {
    grid-template-columns: minmax(0, 1fr) 16px;
  }
  :host .detail {
    display: none;
  }
  :host .md-splitter {
    margin: 0 0rem 0 -0.75rem;
  }
  :host .md-splitter svg {
    margin-right: -0.2rem;
    padding-left: 0.4rem;
  }

  :host(.master-closed) {
    grid-template-columns: 16px minmax(0, 1fr);
  }
  :host(.master-closed) .detail {
    display: block;
  }
  :host(.master-closed) .md-splitter {
    margin: 0 -1rem 0 0rem;
    z-index: 1;
  }

  .master {
    flex: 1;
  }

  .md-splitter {
    z-index: 1;
  }
}
