/* CSS Resets */

html {
  box-sizing: border-box;
  font-family: sans-serif;
  overflow-y: scroll;  /* For Firefox, etc. */
  overflow-y: overlay; /* For Chrome, etc. */
}

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

[hidden] {
  display: none;
}

/* General element styles */

a {
  color: white;
}

button, .button {
  display: inline-block;
  padding: 8px 16px;
  background-color: rgb(50, 65, 80);
  color: rgb(231, 232, 233);
  border-style: solid;
  border-width: 2px;
  border-color: rgb(118, 118, 118);
  cursor: pointer;
  text-decoration: none;
  font-size: 12pt;
  margin-right: 0.25em;
}

button.secondary, .button.secondary {
  background-color: rgb(81, 88, 94);
}

button.danger, .button.danger {
  background-color: rgb(94, 64, 64);
}

button[disabled] {
  color: rgb(131, 132, 133);
  cursor: not-allowed;
}

input, select {
  background-color: rgb(46, 55, 64);
  color: rgb(231, 232, 233);
  padding: 8px;
  border-style: solid;
  border-width: 2px;
  border-color: rgb(118, 118, 118);
  font-size: 12pt;
}

/* Modals */

.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.5)
}

.modal > .modal-content {
  background-color: rgb(46, 55, 64);
  margin: 10% auto;
  margin-top: calc(70vh / 2);
  max-width: calc(768px - 20em);
  padding: 1em;
}

.modal > .modal-content > .modal-actions {
  display: flex;
  justify-content: space-between;
  flex-wrap: nowrap;
}

/* Body and navigation */

body {
  background-color: rgb(46, 55, 64);
  color: rgb(231, 232, 233);
  margin: 0;
  font-size: 12pt;
}

header {
  background-color: rgb(40, 50, 60);
  margin-bottom: 1em;
  display: flex;
  flex-wrap: wrap;
  margin: 0 auto;
  padding: 1em 1em 0 1em;
  max-width: 768px;
}

header > h1 {
  margin: 0 auto 0.5em 0;
}

header > nav > * {
  margin-bottom: 0.5em;
}

.breadcrumbs {
  padding: 1em;
  max-width: 768px;
  margin: auto;
  background-color: rgb(40, 50, 60);
}

.breadcrumbs > .crumb {
  padding: 0px;
}

.breadcrumbs > .crumb:after {
  padding-left: 8px;
  content: ">"
}

.breadcrumbs > .crumb:last-child:after {
  padding-left: 0px;
  content: ""
}

main {
  margin: auto;
  max-width: 768px;
  padding: 1em;
}

/* form styles */

table + form {
  margin-top: 1em;
}

form .field-wrapper {
  margin-bottom: 0.25em;
}

form .field-wrapper input, form .field-wrapper select, form .field-wrapper button {
  margin-bottom: 0.5em;
}

form .field-wrapper input {
  display: block;
}

.line-wrap-form .field-wrapper input, .line-wrap-form .field-wrapper select {
  display: inline-block;
}

.line-wrap-form input.price {
  width: 5em;
}

/* Alert page */

.price-table {
  background-color: rgb(40, 50, 60);
  width: 100%;
  border-collapse: collapse;
}

.price-table tr td, .price-table tr th {
  height: 54px;
  padding: 2px 12px 2px 12px;
}

.price-table tr td {
  border-style: solid;
  border-width: 2px 0 0 0;
}

.price-table tr th {
  text-align: left;
}

.price-table tr th.align-right, .price-table tr td.align-right {
  text-align: right;
}

.price-table .fill {
  width: 100%;
}

.alert-description.sent {
  text-decoration: line-through;
}

.alert-description .direction {
  font-weight: bold;
}

/* Portfolio page */

.portfolio-summary-table th {
  text-align: right;
  padding-right: 0.5em;
}

.portfolio-top {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
}

.portfolio-top > * {
  display: inline-block;
}

.small-name {
  display: none;
}

.large-name {
  display: initial;
}

@media only screen and (max-width: 490px) {
  .asset-table .value {
    display: none;
  }

  .small-name {
    display: initial;
  }

  .large-name {
    display: none;
  }
}
