html, body {
  height: 100%;
  margin: 0;
  overflow: hidden; /* prevent overall scroll */
}

body {
  background-color: #fafaf8;
  font-family: Arial, Helvetica, sans-serif;
  margin: 0;
  color: #222;
  display: flex;
  flex-direction: column;
}

/* --- Toolbar --- */
.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 800px;
  padding: 24px 24px;
  background: #fafaf8;
  border-top: 2px solid #FAFAF8;
  box-sizing: border-box;
  z-index: 10;
  background-color: white;
}

/* --- Word Count --- */
.word-count {
  font-size: 13px;
  color: #9D9393;
  user-select: none;
}

/* --- Submit Button --- */
.submit-btn {
  background-color: #9D9393;
  color: #FAFAF8;
  border: none;
  border-radius: 24px;
  font-size: 15px;
  font-weight: bold;
  padding: 8px 18px;
  cursor: pointer;
  transition: background-color 0.2s, transform 0.1s;
  box-shadow: 0 1px 2px rgba(0,0,0,0.08);
}

.submit-btn:hover {
  background-color: #9EDAE5;
  color: #0056A8;
}

.submit-btn:active {
  transform: translateY(1px);
}


.btn {
       /* border-radius: 24px; */
    padding: 0;
    border: 0;
    cursor: pointer;
    font-size: 17px;
    transition: background 0.2s, border 0.2s;
    background-color: #fafaf8;
    color: #9D9393;
    font-weight: bold;
}

.btn:hover {
  color: #1f1f20;
}

.btn.solid {
    color: #9D9393;
    border: 0px;
    font-weight: bold;
}

.btn.solid:hover {
  color: #0961F9;
}

main {
  display: flex;
  flex-direction: column;
  width: 800px;
  margin: 40px auto 0 auto;
  padding: 50px;
  box-sizing: border-box;
  border-radius: 24px;
  background-color: white;
  height: calc(100vh - 40px - 50px); /* keep the panel inside viewport */
  overflow: hidden; /* prevent body scroll */
}

textarea {
  flex: 1;
  width: 100%;
  box-sizing: border-box;
  border: none;
  resize: none;
  outline: none;
  font-size: 16px;
  line-height: 1.5;
  background: transparent;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: anywhere;

  /* ✅ only the textarea scrolls */
  overflow-y: auto;
  overflow-x: hidden;

  padding-bottom: 120px; /* space before toolbar */
}


#toast {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: #FC64AD;
  color: white;
  font-weight: bold;
  text-align: center;
  border-radius: 32px;
  padding: 10px 28px;
  font-size: 15px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  z-index: 9999;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
}

#toast.show {
  opacity: 1;
  visibility: visible;
}

/* --- Metadata Inputs --- */
.meta-fields {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 20px;
}

/* Title input */
#titleInput,
#nameInput,
textarea {
  font-family: Menlo, Consolas, "Courier New", monospace;
}

#titleInput {
  border: none;
  outline: none;
  background: transparent;
  width: 100%;
  font-size: 24px;
  font-weight: bold;
  color: #1f1f20;
  padding: 4px 0;
  transition: border-color 0.2s;
}

/* Name input */
#nameInput {
  border: none;
  outline: none;
  background: transparent;
  width: 100%;
  font-size: 14px;
  color: #7a7a7a;
  padding: 2px 0 8px 0;
  transition: border-color 0.2s;
}

/* Remove the ugly blue focus ring */
#titleInput:focus,
#nameInput:focus {
  outline: none;
  border-bottom: 1px solid #ddd; /* subtle hint, optional */
}

/* Optional: remove even that focus line */
#titleInput:focus,
#nameInput:focus {
  border-bottom: none;
}

/* --- Mobile & Tablet Responsive Adjustments --- */
@media (max-width: 900px) {
  main {
    width: 100%;
    margin: 0;
    padding: 16px;
    border-radius: 0;
    height: 100vh;
  }

  textarea {
    font-size: 16px;
    padding-bottom: 80px; /* still space for toolbar */
  }

  .meta-fields {
    gap: 8px;
  }

  #titleInput {
    font-size: 20px;
  }

  #nameInput {
    font-size: 13px;
  }

  /* Toolbar fixed to bottom */
  .toolbar {
    width: 100%;
    left: 0;
    transform: none;
    bottom: 0;
    border-top: 1px solid #eee;
    padding: 16px;
  }

  .submit-btn {
    font-size: 14px;
    padding: 10px 16px;
  }

  .word-count {
    font-size: 12px;
  }
}

@media (max-width: 500px) {
  textarea {
    font-size: 15px;
  }

  #toast {
    font-size: 13px;
    padding: 8px 20px;
  }

  .toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .submit-btn {
    width: 100%;
  }
}

