.hidden {
  display: none;
}

@media (prefers-color-scheme: dark) {
  body {
    background-color: #333;
    color: #fff;
  }

  a:link, a:visited {
    color: #0cf;
  }

  table {
    background-color: #444;
    color: #fff;
    border: 1px solid #555;
  }

  table th {
    background-color: #666;
    color: #fff;
  }

  table td {
    border: 1px solid #555;
  }

  table tr:nth-child(even) {
    background-color: #555;
  }

  table tr:nth-child(odd) {
    background-color: #444;
  }

  table tr:hover {
    background-color: #666;
  }

  [data-contenteditable] {
    background-color: #555;
    color: #fff;
    border: 1px dashed #888;
  }

  [data-contenteditable]:focus {
    background-color: #666;
    outline: 2px solid #0cf;
  }
}

@media (prefers-color-scheme: light) {
  body {
    background-color: #fff;
    color: #000;
  }

  a:link, a:visited {
    color: #007BFF;
  }

  table {
    background-color: #f9f9f9;
    color: #000;
    border: 1px solid #ddd;
  }

  table th {
    background-color: #4CAF50;
    color: #fff;
  }

  table td {
    border: 1px solid #ddd;
  }

  table tr:nth-child(even) {
    background-color: #f2f2f2;
  }

  table tr:nth-child(odd) {
    background-color: #ffffff;
  }

  table tr:hover {
    background-color: #e6f7ff;
  }

  [data-contenteditable] {
    background-color: #fffbea;
    color: #000;
    border: 1px dashed #ccc;
  }

  [data-contenteditable]:focus {
    background-color: #fffdd0;
    outline: 2px solid #4CAF50;
  }
}

/* General table styling for both themes */
table {
  border-collapse: collapse;
  width: 100%;
  margin: 1em 0;
  font-size: 14px;
  text-align: left;
}

table th, table td {
  padding: 0.5em;
}

[data-contenteditable] {
  cursor: pointer;
}

/* Responsive table for smaller screens */
@media (max-width: 600px) {
  table {
    font-size: 12px;
  }

  table th, table td {
    padding: 0.25em;
  }
}

.error {
  border: 2px solid #f00;
  padding: 1em;
  color: #f00;
  font-weight: bold;
}
