/* 1. Use a more-intuitive box-sizing model */
*,
*::before,
*::after {
  box-sizing: border-box;
}

/* 2. Remove default margin */
* {
  margin: 0;
}

body {
  /* 3. Add accessible line-height */
  line-height: 1.5;
  /* 4. Improve text rendering */
  -webkit-font-smoothing: antialiased;
  font-size: 14px;
  font-family: "Inter", serif;
}

/* 5. Improve media defaults */
img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
}

/* 6. Inherit fonts for form controls */
input,
button,
textarea,
select {
  font: inherit;
}

/* 7. Avoid text overflows */
p,
h1,
h2,
h3,
h4,
h5,
h6 {
  overflow-wrap: break-word;
}

/* 8. Improve line wrapping */
p {
  text-wrap: pretty;
}
h1,
h2,
h3,
h4,
h5,
h6 {
  text-wrap: balance;
}

/*
  9. Create a root stacking context
*/
#root,
#__next {
  isolation: isolate;
}

/*
* remove dumb stuff
*/
/* Chrome, Safari, Edge, Opera */
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Firefox */
input[type="number"] {
  -moz-appearance: textfield;
}

li {
  list-style-type: none;
}

ul {
  display: flex;
  justify-content: space-evenly;
  margin: 0;
  padding: 0;
}

td {
  text-align: center;
}

th,
td {
  border-bottom: 1px solid #ddd;
}

tr:nth-child(even) {
  background-color: #f2f2f2;
}

thead {
  text-transform: uppercase;
}

main {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 5em;
}

nav {
  font-size: 1.5rem;
  margin: 1em 0;
}

a {
  text-decoration: none;
}

.container {
  width: 100%;
  margin: 0.25em 0;
}

.flex {
  display: flex;
}

.btn {
  padding: 0.5em 1em;
  /*width: 100%;*/
}

.container.flex {
  width: 100%;
}

.container.flex p {
  align-self: center;
}

.container.flex p,
.container.flex button {
  flex: 1;
}

.items-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.form-item {
  display: flex;
  flex-direction: column;
  margin: 0.7em 0;
  width: 100%;
}

.form-item.btn-row {
  justify-content: center;
  width: 100%;
}

.btn-row button {
  flex: 1;
}

.add-form {
  display: none;
}

@media only screen and (min-width: 778px) {
  body {
    font-size: 18px;
  }
  ul {
    display: flex;
    justify-content: space-around;
    max-width: 50vw;
    margin: 0 auto;
  }

  td {
    text-align: center;
  }

  th,
  td {
    border-bottom: 1px solid #ddd;
  }

  tr:nth-child(even) {
    background-color: #f2f2f2;
  }

  thead {
    text-transform: uppercase;
  }

  main {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 5em;
  }

  nav {
    font-size: 1.5rem;
    margin: 1em 0;
  }

  a {
    text-decoration: none;
  }

  .container {
    width: 100%;
    max-width: 800px;
    margin: 0.25em 0;
  }

  .flex {
    display: flex;
  }

  .btn {
    padding: 0.5em 1em;
    width: 100%;
  }

  .container.flex {
    width: 100%;
  }

  .container.flex p {
    align-self: center;
  }

  .container.flex p,
  .container.flex button {
    flex: 1;
  }

  .items-table {
    width: 80%;
    border-collapse: collapse;
    table-layout: fixed;
  }

  .form-item {
    display: flex;
    flex-direction: column;
    margin: 0.7em 0;
    width: 100%;
  }

  .form-item.btn-row {
    justify-content: center;
    width: 100%;
  }

  .btn-row button {
    flex: 1;
  }

  .add-form {
    display: none;
  }
}
