body {
  font-family: Arial, sans-serif;
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  line-height: 1.6;
}

header {
  background: #f5f5f5;
  padding: 0.5em 0;
}

.header-inner {
  width: 90%;
  max-width: 960px;
  margin: 0 auto;
}

.nav {
  text-align: center;
}

.nav a {
  margin: 0 1em;
  color: #333;
  text-decoration: none;
}

.main-nav {
  text-align: center;
  margin-top: 0.3em;
}

.main-nav a {
  margin: 0 1em;
  color: #333;
  text-decoration: none;
  display: inline-block;
  padding: 0.2em 0.4em;
  font-size: 1.15rem;
}

.main-nav a.active {
  font-weight: 700;
  border-bottom: 2px solid #2563eb;
}

.brand-logo {
  display: flex;
  align-items: center;
  font-size: 1.7rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-decoration: none;
  gap: 0.2em;
}

.logo-icon {
  font-size: 2rem;
  margin-right: 0.25em;
}

.brand-english {
  color: #2563eb; /* blue from your site */
}

.brand-n {
  color: #fb923c; /* orange (try #f59e42 or similar for contrast) */
  font-weight: 900;
  font-size: 1.35em;
  margin: 0 0.1em;
}

.brand-spanish {
  color: #16a34a; /* green (echoes Spanish/Mexican palette) */
}

.brand-dot {
  color: #aaa;
  font-size: 0.7em;
  font-weight: 400;
  margin-left: 0.1em;
  letter-spacing: 0;
}




main {
  flex: 1 0 auto;
  width: 90%;
  max-width: 960px;
  margin: 0 auto;
  padding: 1em 0;
}

main h1 {
  font-size: 1.8rem;
  color: #333;
}

main p {
  font-size: 1.1rem;
  color: #555;
}

footer {
  background: #f5f5f5;
  text-align: center;
  padding: 1em 0;
  flex-shrink: 0;
  font-size: 0.8em;
  color: #888;
}

footer p {
  display: inline-block;
  margin: 0 0.5em;
}

footer a {
  color: inherit;
  text-decoration: none;
}

pre {
  white-space: pre-wrap;
}

#quiz-links {
  margin: 1em 0;
  text-align: center;
}

#quiz-links a {
  margin: 0.25em 0.5em;
  display: inline-block;
  color: #222;
  text-decoration: underline;
  font-weight: 600;
  padding: 0;
  background: none;
  border: none;
}

#quiz-links a:hover {
  color: #000;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 2rem;
}

th,
td {
  padding: 8px 12px;
  border: 1px solid #ccc;
}

th {
  background-color: #f2f2f2;
}

#data-list th {
  position: relative;
}

#data-list th button {
  background-color: #79797c;
  color: #fff;
  border: none;
  padding: 0.3em 0.7em;
  margin: 4px;
  font-size: 1em;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

#data-list th button:hover {
  background-color: #5f5f62;
}

.header-buttons {
  display: flex;
  gap: 6px;
}

#action-buttons {
  justify-content: flex-start;
  margin: 0.4em 0;
  width: 100%;
}

#action-buttons button {
  background: none;
  border: none;
  margin: 0 4px;
  color: #444;
  cursor: pointer;
  padding: 0.2em 0.4em;
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 0.9em;
  line-height: 1.1;
}

#action-buttons button:hover {
  color: #000;
}

#action-buttons li {
  display: flex;
  align-items: center;
  gap: 4px;
}

#action-buttons li button {
  margin-right: 4px;
}

#action-buttons .icon {
  font-size: 1.4em;
}

#action-buttons .desc {
  font-size: 0.85em;
  opacity: 0.8;
}

#sort-toggle .icon { color: #2196f3; }
#direction-toggle .icon { color: #e91e63; }
#print-list .icon { color: #4caf50; }
#print-cards .icon { color: #ff9800; }

#begin-quiz {
  display: block;
  margin: 1em auto;
}


.audio-icon,
.translate-icon {
  cursor: pointer;
  margin-right: 4px;
  text-decoration: none;
  display: inline-block;
  vertical-align: middle;
  opacity: 0.4;
  font-size: 1.21em;
}

.num-col {
  font-size: 0.9em;
  color: #777;
}

#quiz-links a.active {
  color: #000;
  font-weight: 700;
  background-color: #ffeb3b;
  border-radius: 4px;
  padding: 0 4px;
  text-decoration: none;
}

.fade {
  transition: opacity 0.5s ease;
}

#data-list tbody tr:nth-child(even) {
  background-color: #f9f9f9;
}

th.checkbox-col,
td.checkbox-col {
  width: 1%;
  white-space: nowrap;
  text-align: center;
}

#quiz-dialog {
  min-width: 700px;
  padding: 0;
  border: 4px double #333;
  border-radius: 8px;
}

@media (max-width: 720px) {
  #quiz-dialog {
    width: 95vw;
    min-width: 0;
  }
}

.quiz-title-line,
.quiz-control-line,
.quiz-stats {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5em;
  padding: 0.3em 0.5em;
}

.quiz-stats {
  margin-bottom: 1em;
}

/* Stack quiz title and help link vertically */
.quiz-title-line {
  flex-direction: column;
  align-items: center;
  padding: 0.2em 0.5em;
}

.quiz-title-line h2 {
  margin: 0.55em 0;
  text-align: center;
}

.quiz-option {
  background: #f5f5f5;
  border: 2px inset #ccc;
  border-radius: 4px;
  padding: 0.6em;
  margin: 0.6em 0;
  cursor: pointer;
  transition: background-color 0.3s ease;
  display: flex;
  align-items: center;
}

.quiz-option.correct {
  background: #d4edda;
}

.quiz-option.incorrect {
  background: #f8d7da;
}

.quiz-option.disabled {
  pointer-events: none;
  opacity: 0.6;
}

.quiz-option:hover {
  background: #e0e0e0;
}

.quiz-progress {
  --segments: 10;
  flex: 2;
  width: 60%;
  background: repeating-linear-gradient(to right,
      #eee,
      #eee calc(100% / var(--segments) - 2px),
      #ddd calc(100% / var(--segments) - 2px),
      #ddd calc(100% / var(--segments)));
  height: 26px;
  padding: 3px;
  border-radius: 5px;
  border: 2px outset #ccc;
  overflow: hidden;
  margin-left: 1em;
  position: relative;
}

.quiz-progress-bar {
  height: 100%;
  width: 0;
  background: repeating-linear-gradient(45deg,
      rgba(255, 255, 255, 0.3) 0,
      rgba(255, 255, 255, 0.3) 10px,
      rgba(0, 0, 0, 0.1) 10px,
      rgba(0, 0, 0, 0.1) 20px),
    #4caf50;
  transition: width 0.3s ease;
}

.quiz-progress-text {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  font-size: 0.8em;
  white-space: nowrap;
  color: #000;
}

/* Styles for quiz completion screen */
.quiz-complete {
  text-align: center;
  margin: 1em 0;
}

.quiz-success {
  text-align: center;
  font-weight: bold;
  margin: 0.5em 0;
}

.quiz-message {
  text-align: center;
  margin: 0.5em 0;
}

.error-list {
  width: 100%;
  border-collapse: collapse;
  margin: 1em 0;
}

.error-list th,
.error-list td {
  border: 1px solid #ccc;
  padding: 4px 8px;
}

/* Button style shared with vocabulary page */
.vocab-btn {
  background-color: #79797c;
  color: #fff;
  border: none;
  padding: 0.5em 1em;
  font-size: 1em;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.vocab-btn:hover {
  background-color: #5f5f62;
}

/* Custom dropdown style */
.quiz-control-line select {
  padding: 0.2em 0.4em;
  border: 1px solid #ccc;
  border-radius: 4px;
  background: #fff;
}

.select-label {
  font-size: 0.9em;
  color: #666;
}

/* Dialog layout styling */
.quiz-title-line {
  background: #f5f5f5;
  padding: 0.2em 0.5em;
}

.quiz-footer {
  background: #f5f5f5;
  text-align: center;
  padding: 0.5em;
}

.quiz-footer button {
  margin: 0 0.5em;
}

#quiz-main {
  background: #fff;
  padding: 1em 0.5em 0.5em;
}

.quiz-stats span {
  margin-right: 0.5em;
  font-weight: bold;
}

.quiz-stats .score-positive {
  color: #28a745;
}

.quiz-stats .score-negative {
  color: #b58900;
}

.quiz-stats .errors {
  color: #d9534f;
}

.score-word {
  color: #28a745;
  font-weight: bold;
}

.errors-word {
  color: #d9534f;
  font-weight: bold;
}

/* Instruction text below titles */
.page-intro {
  font-size: 0.95rem;
  color: #555;
  margin-top: -0.2em;
  margin-bottom: 1em;
}

/* Darken background when quiz dialog is open */
#quiz-dialog::backdrop {
  background: rgba(0, 0, 0, 0.8);
}

body.dialog-open {
  overflow: hidden;
}

/* Help text inside quiz dialog */
.quiz-instructions {
  font-size: 0.85em;
  color: #444;
  margin: 0.3em 0 0;
  text-align: left;
}

#quiz-help-toggle {
  color: #000;
  font-size: 0.85em;
  opacity: 0.65;
  display: block;
  margin-top: 0.2em;
  text-align: left;
  align-self: flex-start;
}

#quiz-help-text ul {
  margin: 0.3em 0 0 1.2em;
  padding-left: 1em;
  text-align: left;
}

#quiz-question {
  font-size: 1.32em;
  font-weight: 600;
  margin-bottom: 0.5em;
}

/* Dark mode styles for quiz dialog */
#quiz-dialog.dark {
  background: #333;
  color: #eee;
}

#quiz-dialog.dark .quiz-title-line,
#quiz-dialog.dark .quiz-control-line,
#quiz-dialog.dark .quiz-stats,
#quiz-dialog.dark .quiz-footer {
  background: #444;
}

#quiz-dialog.dark .quiz-option {
  background: #555;
  border-color: #777;
}

#quiz-dialog.dark .quiz-option:hover {
  background: #666;
}

#quiz-dialog.dark .quiz-progress {
  border-color: #555;
  background: repeating-linear-gradient(to right,
      #444,
      #444 calc(100% / var(--segments) - 2px),
      #3b3b3b calc(100% / var(--segments) - 2px),
      #3b3b3b calc(100% / var(--segments)));
}

#quiz-dialog.dark .quiz-progress-bar {
  background: repeating-linear-gradient(45deg,
      rgba(255, 255, 255, 0.3) 0,
      rgba(255, 255, 255, 0.3) 10px,
      rgba(0, 0, 0, 0.2) 10px,
      rgba(0, 0, 0, 0.2) 20px),
    #2e7d32;
}

#quiz-dialog.dark #quiz-main {
  background: #1E1E1E;
  padding: 1em 0.5em 0.5em;
}

#quiz-dialog.dark #quiz-help-toggle,
#quiz-dialog.dark .quiz-instructions {
  color: #CCCCCC;
}

#quiz-dialog.dark .quiz-progress-text {
  color: #CCCCCC;
}

#quiz-dialog.dark .quiz-complete,
#quiz-dialog.dark .quiz-success,
#quiz-dialog.dark .quiz-message {
  color: #CCCCCC;
}


dialog {
  width: 90%;
  max-width: 600px;
  padding: 20px;
  border: 2px solid #2980b9;
  border-radius: 8px;
  box-shadow: 0 5px 25px rgba(0, 0, 0, 0.2);
  font-family: sans-serif;
}

dialog h3 {
  margin-top: 0;
  color: #2980b9;
}

dialog ul {
  padding-left: 20px;
  margin: 10px 0;
}

dialog menu {
  text-align: right;
  padding: 10px 0 0;
}



.es-category {
  margin: 2em 0 2.5em;
}

.es-category h2 {
  font-size: 1.35rem;
  color: #34495e;
  margin: 0 0 0.25em 0;
}

.es-category .es-category-intro {
  font-size: 1.02em;
  color: #5c5c5c;
  margin-bottom: 0.9em;
  margin-top: 0;
}

.es-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.15em;
  margin: 0;
  padding: 0;
}

.es-card {
  background: #f8f8fa;
  border-radius: 8px;
  box-shadow: 0 2px 7px rgba(140, 140, 140, 0.07);
  border: 1px solid #ededed;
  padding: 0.8em 0.8em 0.5em;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  min-height: 110px;
  transition: box-shadow 0.2s;
  cursor: pointer;
}

.es-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.es-card a {
  font-size: 1.07em;
  font-weight: 700;
  color: #222;
  text-decoration: none;
  margin-bottom: 0.15em;
  transition: color 0.15s;
}

.es-card a:hover {
  color: #2980b9;
}

.es-card p {
  margin: 0;
  color: #555;
  font-size: 0.98em;
  line-height: 1.5;
}

@media (max-width: 600px) {
  .es-category h2 {
    font-size: 1.12rem;
  }

  .es-card {
    padding: 0.95em 0.75em 0.5em;
  }
}

.es-welcome {
  font-size: 1.14em;
  background: #f0f7ff;
  border-radius: 6px;
  padding: 1em 1em 1em 1.2em;
  color: #2d425a;
  margin-bottom: 1.3em;
  line-height: 1.6;
  box-shadow: 0 2px 7px rgba(140, 180, 220, 0.03);
}

.es-main-title {
  font-size: 2em;
  margin-top: 0.2em;
  margin-bottom: 0.05em;
  color: #2c3e50;
}

.es-page-intro {
  color: #5d5d5d;
  margin-top: -0.3em;
  margin-bottom: 1.2em;
  font-size: 1.06em;
}

#toc {
  margin: 0.5em 0 1.2em;
}

#toc ul {
  list-style: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.7em 0.6em;
}

#toc .toc-groups {
  list-style: none;
  padding: 0;
  margin: 0;
  display: block;
}

#toc .toc-groups li {
  margin-bottom: 0.4em;
}

#toc a {
  text-decoration: none;
  background: #f0f0f0;
  padding: 0.3em 0.5em;
  border-radius: 4px;
  font-size: 0.9em;
  color: #333;
  display: inline-block;
  white-space: nowrap;
  margin-right: 0.4em;
  margin-bottom: 0.2em;
}

#toc a:hover {
  background: #e0e0e0;
}

#back-to-top {
  position: fixed;
  right: 20px;
  bottom: 20px;
  background: #2979ff;
  color: #fff;
  padding: 0.5em 0.75em;
  border-radius: 4px;
  text-decoration: none;
  font-size: 0.9em;
  display: none;
}

.resource-list {
  list-style: none;
  padding-left: 0;
}

.resource-list li {
  background: #f8f8fa;
  border: 1px solid #ededed;
  border-radius: 6px;
  padding: 0.6em 0.8em;
  margin-bottom: 0.6em;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.resource-list a {
  font-weight: 700;
  color: #222;
  text-decoration: none;
}

.resource-list a:hover {
  text-decoration: underline;
}

.best-for {
  display: block;
  margin-top: 0.2em;
  font-size: 0.9em;
  color: #555;
}
.addsection {
  margin-top: 10px;
}

/* SEO/AIO blocks: FAQ + related quizzes */
.es-faq,
.es-related {
  margin: 2em 0;
  padding: 1.2em 1.4em;
  background: #f9f9f9;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
}

.es-faq h2,
.es-related h2 {
  font-size: 1.25rem;
  color: #333;
  margin: 0 0 0.6em;
}

.es-faq dt {
  font-weight: 600;
  color: #333;
  margin-top: 0.8em;
}

.es-faq dd {
  margin: 0.2em 0 0;
  color: #555;
}

.es-related ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5em;
}

.es-related li a {
  display: inline-block;
  padding: 0.35em 0.8em;
  background: #fff;
  border: 1px solid #d0d0d0;
  border-radius: 4px;
  font-size: 0.95rem;
  text-decoration: none;
  transition: background-color 0.2s ease;
}

.es-related li a:hover {
  background: #eef;
}
