:root{
    --fs-smol: 0.85rem;
    --fs-tiny: 1.1rem;
    --fs-small: 1.3rem;
    --fs-medium: 1.6rem;
    --max-width: 900px;
}

html {
  font-size:62.5%;
  font-family: monospace, sans-serif;
  background:#1e1e1e; 
  color:#eee;
  }
  
* {
  box-sizing: border-box;
}
  
#form {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
}

.topbar, #form {
  max-width: var(--max-width);
  margin: 0 auto;
  width: 100%;
}

.topbar {
  margin-bottom: 10px;
  position: sticky;
  top: 0;
  z-index: 1000;
  background: #2a2a2a;
  padding: 5px;
  padding-inline: 10px;
  border-bottom: 3px solid #444;
}

.sectionButtonsWrapper {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.sectionButtons {
  display: flex;
  justify-content: flex-start;
  text-align: center;
  margin-inline: 5px;
  margin-top: 2px;
  margin-bottom: 2px;
  gap: 10px;
}

.sectionBtn {
  all: unset;
  cursor: pointer;
  font-size: var(--fs-small);
  color: white;
  padding: 1px 6px;
  border-radius: 4px;
  min-height: 20px;
  background: #444;
  text-align: center;
}

.templateButtons {
  display: flex;
  justify-content: right;
  text-align: center;
  margin-inline: 5px;
  margin-top: 2px;
  margin-bottom: 2px;
  gap: 10px;
}

.templateBtn {
  all: unset;
  cursor: pointer;
  font-size: var(--fs-small);
  color: white;
  padding: 1px 6px;
  border-radius: 4px;
  min-height: 20px;
  border:none;
  background:none; 
}

button.active {
  background: #444;
  color: white;
}

button { 
  background:#3a7bd5; 
  color:white; 
  border:none; 
  padding: 4px 10px; 
  border-radius: 6px; 
  margin-top: 6px; 
  margin-inline: 10px;
  cursor:pointer;
  min-height: 32px;
  font-family: monospace, sans-serif;
  font-size: var(--fs-medium);
}

.buttons {
  width: 100%;
  max-width: var(--max-width);
  display: flex;
  justify-content: center;
  gap: 50px;
  margin-top: 10px;
  margin-bottom: 10px;
}

.toggles {
  display: flex;
  justify-content: center;
  column-gap: 0px;
  margin-top: 15px;
  margin-bottom: 15px;
  width: 100%;
  flex-wrap: wrap;
}

.toggles label {
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  margin-left: 10px;
  margin-right: 10px;
  font-family: monospace, sans-serif;
  font-size: var(--fs-medium);
}

.toggleItem {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

.toggleItem span {
  white-space: nowrap;
}

.toggleItem input {
  margin: 0;
}

.search {
  width: 100%;
  max-width: var(--max-width);
  min-height: 25px;
  display: block;
  margin: 5px 0;
  font-size: var(--fs-medium);
}

.search::placeholder {
  font-size: var(--fs-medium);
}

.field {  
  display: grid;
  grid-template-columns: 1fr minmax(100px,35%) 30px;
  align-items: center;
  gap: 8px;
  margin-top: 0px;
  max-width: var(--max-width);
  min-height: 28px; 
  width: 100%;
  border-radius: 5px; 
  font-family: monospace;
  font-size: var(--fs-medium);
}

.field span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.field:nth-of-type(odd) { background:#2f2f2f; }
.field:nth-of-type(even) { background:#262626; }

.sectionDivider {
  border-top: 3px solid #555;
  margin-top: 4px;
  padding-top: 5px;
  width: 100%;
}

details { 
  margin-bottom: 10px; 
  border: 1px solid #444; 
  border-radius: 5px; 
  background: #2a2a2a;
}

summary { 
  font-weight: bold; 
  cursor: pointer; 
  padding: 6px;
  padding-inline: 10px;
  font-size: 17px;
}

details > *:not(summary) {
  padding: 0px 0px 0px 10px;
}

select, input { 
  background:#111; 
  color:#eee; 
  border:2px solid #555; 
  height: 25px;  
  border-radius:5px; 
  padding-left:5px; 
  width: 100%;
  box-sizing: border-box;
  font-family: monospace;
  font-size: var(--fs-medium);
  vertical-align: middle;
}

.helpBtn { 
  margin-left: 2px; 
  cursor:pointer; 
  background:#555; 
  border-radius:50%; 
  width:20px; 
  height:20px; 
  display:flex; 
  align-items:center; 
  justify-content:center;
  font-family: Arial, Helvetica, sans-serif;
}

.helpButtonWrap {
  display: flex;
  justify-content: center;
}

.helpBox {
  background: #262626;
  padding: 15px;
  border-radius: 10px;
  width: 90%;
  max-width: 650px;
  color: #eee;

  display: flex;
  flex-direction: column;
  gap: 15px;
}

.helpText {
  line-height: 1.4;
  background: #2f2f2f;
  padding: 10px;
  border-radius: 10px;
  font: message-box;
  font-family: monospace, sans-serif;
  font-size: var(--fs-medium);
}

.helpBox button {
  border: none;
}

.helpOverlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

@media (max-width: 520px) {

  button,
  input,
  select,
  summary,
  .field,
  .toggles label,
  .helpText,
  .search,
  .search::placeholder{
    font-size: var(--fs-tiny);
  }
  .sectionBtn,
  .templateBtn{
    font-size: var(--fs-smol);
  }
  .toggles{
    margin-top: 5px;
    margin-bottom: 5px;
  }
}