html {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
}

body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  
  display: flex;
  flex-direction: column;
}

#history {
  flex: 1;
  padding: 16px;
}

#history > .empty-state-message {
  margin: 0;
  height: 100%;
  width: 100%;

  display: flex;
  align-items: center;
  justify-content: center;
}

#history > section:first-of-type {
  margin-top: auto;
}

#history > section {
  margin-top: 64px;
}

#history > section > h2 {
  text-align: center;
  font-size: 1em;
}

.data-point {
  display: grid;
  grid-template:
    "intensity timestamp note"
    "intensity path path"
    "message message message"
    / 60px 1fr auto;
  gap: 4px;

  padding: 16px;
  margin: 16px 0;
  border-radius: 8px;

  font-size: 80%;
}

.data-point > .intensity {
  grid-area: intensity;
  margin: 0;
  justify-self: start;
  align-self: center;
}

.data-point > .timestamp {
  grid-area: timestamp;
  margin: 0;
  align-self: end;
}

.data-point > .path {
  grid-area: path;
  margin: 0;
  align-self: start;
}

.data-point > .path > .feeling-separator {
  display: inline-block;
  margin: 0 8px;
  vertical-align: baseline;
  opacity: 50%;
}

.data-point > .path > span:last-of-type {
  font-weight: bold;
}

.data-point > .note-icon {
  grid-area: note;
  filter: drop-shadow(0 0 1px #0008);
}

.data-point > .message {
  grid-area: message;

  box-shadow: inset 0 0 4px 2px #0001;
  border-radius: 8px;
  background: #0001;

  margin: 16px 0 0 0;
  padding: 0 16px;
}

.data-point > .message.hidden {
  height: 0;
  overflow: hidden;
  margin-top: 0;
}

.add-message {
  border-radius: 8px;

  box-sizing: border-box;
  width: 100%;
  margin: 16px;
  padding: 8px;

  height: 100svh;
}

.add-message[open] {
  display: grid;
  grid-template:
    "text text" 1fr
    "cancel add"
    / 1fr 1fr;
  gap: 8px;
}

.add-message > textarea {
  grid-area: text;

  border: 0;
  border-radius: 8px;
  box-shadow: inset 0 0 3px 1px #0002;
  background: #f8f8f8;

  padding: 16px;

  font-family: sans-serif;
}

.add-message > button {
  text-transform: uppercase;
  font-size: 80%;
  padding: 8px;
}

.add-message > button.add {
  grid-area: add;

  border: 0;
  border-radius: 4px;
}

.add-message > button.cancel {
  grid-area: cancel;

  background: transparent;
  border: 0;
  color: #00f;
}

.add-message::backdrop {
  background: #0002;
}

#bottom-matter {
  margin: 0;
  padding: 16px;
  text-align: center;
}
