body.dark-mode {
  background: #121212;
  color: #f2f2f2;
}

body.dark-mode a {
  color: #9ecaff;
}

body.dark-mode h1,
body.dark-mode h2,
body.dark-mode h3,
body.dark-mode h4,
body.dark-mode h5,
body.dark-mode h6 {
  color: #f2f2f2;
}

body.dark-mode #text-accessibility-bar {
  background: #1f1f1f;
  border-color: #444;
  color: #f2f2f2;
}

body.dark-mode #text-accessibility-bar button {
  background: #2c2c2c;
  color: #f2f2f2;
  border-color: #444;
}

body.dark-mode #text-accessibility-bar button:hover {
  background: #3a3a3a;
}

body.dark-mode header {
  background: #1f1f1f;
  border-bottom: 1px solid #444;
  color: #f2f2f2;
}

body.dark-mode header a {
  color: #9ecaff;
  text-decoration: none;
}

body.dark-mode header a:hover {
  text-decoration: underline;
}

body.dark-mode header input[type="text"] {
  background: #2c2c2c;
  color: #f2f2f2;
  border: 1px solid #444;
}

body.dark-mode header button {
  background: #2c2c2c;
  color: #f2f2f2;
  border: 1px solid #444;
}

body.dark-mode header button:hover {
  background: #3a3a3a;
}

header {
  display: flex;
  align-items: center;
  gap: 1em;
  padding: 1em;
  border-bottom: 1px solid #ccc;
  background: #f9f9f9;
}

.logo-text {
  font-weight: bold;
  font-size: 1.2em;
}

.logo-text a {
  text-decoration: none;
  color: black;
}

.search-bar {
  flex: 1;
}

.search-bar input[type="text"] {
  width: 100%;
  padding: 0.4em;
}

.infobox {
  float: right;
  margin: 0 0 1em 1em;
  width: 22em;
  background-color: #f9f9f9;
  border: 1px solid #aaa;
  border-collapse: collapse;
  font-size: 90%;
  line-height: 1.5em;
}

.infobox caption {
  font-size: 110%;
  font-weight: bold;
  padding: 0.5em;
  text-align: center;
}

.infobox th {
  background-color: #f2f2f2;
  text-align: left;
  padding: 0.5em;
  vertical-align: top;
}

.infobox td {
  padding: 0.5em;
  vertical-align: top;
}

#text-accessibility-bar {
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  background: #f4f4f4;
  border: 1px solid #ccc;
  border-radius: 6px;
  padding: 0.5rem 1rem;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  z-index: 9999;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

#text-accessibility-bar button {
  margin: 0;
  padding: 0.25rem 0.6rem;
  font-size: 0.9em;
  font-family: inherit;
  border: 1px solid #aaa;
  border-radius: 4px;
  background: #e0e0e0;
  cursor: pointer;
}

#text-accessibility-bar button:hover {
  background: #d5d5d5;
}

body.dark-mode #text-accessibility-bar {
  background: #1f1f1f;
  border: 1px solid #444;
  border-radius: 6px;
  color: #f2f2f2;
}

body.dark-mode #text-accessibility-bar button {
  background: #2c2c2c;
  color: #f2f2f2;
  border: 1px solid #444;
  border-radius: 4px;
}

body.dark-mode #text-accessibility-bar button:hover {
  background: #3a3a3a;
}

/* Light Mode (default appearance can be customized if desired) */
textarea,
input[type="text"] {
  background: #ffffff;
  color: #000000;
  border: 1px solid #ccc;
  padding: 0.5em;
  font-family: inherit;
  font-size: 1em;
  width: 100%;
  box-sizing: border-box;
}

/* Dark Mode */
body.dark-mode textarea,
body.dark-mode input[type="text"] {
  background: #2c2c2c;
  color: #f2f2f2;
  border: 1px solid #444;
}

body.dark-mode textarea::placeholder,
body.dark-mode input[type="text"]::placeholder {
  color: #888;
}

/* Light mode preview (default, optional tweak) */
#preview {
  background: #ffffff;
  color: #000000;
  padding: 1em;
  border: 1px solid #ccc;
  margin-top: 1em;
  border-radius: 6px;
}

/* Dark mode preview styling */
body.dark-mode #preview {
  background: #1e1e1e;
  color: #f2f2f2;
  border: 1px solid #444;
}
body.dark-mode #preview a {
  color: #9ecaff;
}

body.dark-mode #preview h1,
body.dark-mode #preview h2,
body.dark-mode #preview h3 {
  color: #f2f2f2;
}
