:root {
  font-family: system-ui, sans-serif;
  color: #26342f;
  background: #f7f8f5;
}

* {
  box-sizing: border-box;
  border-radius: 4px;
}

body {
  margin: 0;
}

header,
main,
.tabs {
  max-width: 1100px;
  margin: auto;
  padding: 1rem;
}

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;

  h1 {
    font-size: 1.5rem;
    margin: .5rem 0;
  }
}

h2 {

  font-size: 1.2rem;

}
h3 {
  font-size: 1rem;
}

button,
ui-button,
input,
textarea,
select {
  font: inherit;
}

button,
ui-button {
  cursor: pointer;
  padding: .55rem .8rem;
}

ui-button {
  display: inline-block;
  background: #efefef;
  border: 1px solid #767676;
  text-align: center;
  user-select: none;

  &[disabled] {
    opacity: .5;
    cursor: default;
  }
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
ui-schedule-entry-face:focus-visible,
ui-checkbox:focus-visible,
ui-button:focus-visible {
  outline: 3px solid #82ab94;
}

main {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  padding-bottom: 6rem;
}

.panel {

  min-width: 0;

}
.tabs {
  display: none;
}

ui-schedule {
  display: block;

  ui-schedule-date {
    display: block;
    margin: 1.4rem 0 .3rem;
    font-size: 1rem;
    font-weight: bold;
  }

  ui-schedule-entry {
    display: flex;
    align-items: center;
    gap: .5rem;
    border-bottom: 1px solid #d6ded8;
    padding: .45rem 0;

    ui-schedule-entry-face {
      display: block;
      flex: 1;
      text-align: left;
      padding: .35rem;
      cursor: pointer;


      background: #ccc;
      box-shadow: inset 0 -2px 0 0 #0004;
  }

    &.paid {
      opacity: .6;
      text-decoration: line-through;
    }


  }
}




.month-divider {
  border: 0;
  border-top: 1px solid #9baea1;
  margin: 2rem 0 1rem;
}

.empty {

  color: #65736b;

}

.add-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  gap: .5rem;
  background: #f7f8f5;
  border-top: 1px solid #d6ded8;
  padding: .75rem;
  text-align: center;

  ui-button {
    display: block;
    width: min(50%, 250px);
    padding: .55rem .8rem;
    cursor: pointer;
    background: #315f49;
    color: white;
    border: 0;
  }
}

ui-dialog {
  position: fixed;
  z-index: 1001;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: block;
  width: min(95%, 650px);
  max-height: 90vh;
  overflow: auto;
  border: 1px solid #a5b4aa;
  padding: 1.25rem;
  background: white;
}

.ui-dialog-backdrop {
  position: fixed;
  z-index: 1000;
  inset: 0;
  background: #0008;
}

textarea,
input,
select {
  display: block;
  width: 100%;
  margin: .3rem 0 1rem;
  padding: .45rem;
  border: 1px solid #aab9af;
  background: white;
}

input[type="checkbox"] {
  display: inline;
  width: auto;
  margin: 0 .5rem 0 0;
}

.actions {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
  margin: 1rem 0;
}

.message {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.error {

  color: #a02626;

}

.review-item {
  border: 1px solid #d6ded8;
  padding: .7rem;
  margin: .6rem 0;

  summary {
    cursor: pointer;
    font-weight: 600;
  }

  label {
    display: block;
    margin-top: .6rem;
  }

  .check {
    display: flex;
    align-items: center;
  }
}

hr {
  border: 0;
  border-top: 1px solid #d6ded8;
}

[hidden] {

  display: none !important;

}

ui-checkbox {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: 1px solid #65736b;
  background: white;
  color: #26342f;
  font-weight: bold;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;

  &[disabled] {
    cursor: wait;
  }
}

.family-member {
  display: flex;
  align-items: end;
  gap: .6rem;
  margin: .6rem 0;

  label:first-child {

    flex: 1;

  }
  input {
    margin-bottom: 0;
  }
  button {
    margin-bottom: 0;
  }

  input[type="color"] {
    width: 4rem;
    height: 2.5rem;
    padding: .15rem;
  }
}

.member-picker {
  border: 0;
  padding: 0;
  margin: .8rem 0;

  legend {
    padding: 0;
    margin-bottom: .4rem;
  }
}

.member-options {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
}

.member-square,
ui-schedule-entry-member {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  flex: none;
  padding: 0;
  border: 1px solid #65736b;
  font-weight: 600;
}

.member-square.selected {
  outline: 3px solid #26342f;
  outline-offset: 2px;
}

.member-none {

  background: white;

}
ui-schedule-entry-member {
  font-size: .85rem;
}

@media (orientation: portrait), (max-width: 650px) {
  main {
    display: block;
  }

  .tabs {
    display: flex;
    gap: .5rem;

    button.active {
      background: #315f49;
      color: white;
    }
  }

  .panel {
    display: none;

    &.active {

      display: block;

    }
  }
}
