#grammar-main {
  flex: 1;
  max-width: 1060px;
  margin: 0 auto;
  width: 100%;
  padding: 3rem 2rem 4rem;
}

#grammar-content h1 {
  font-size: 1.7rem;
  font-weight: normal;
  color: var(--text);
  margin: 0 0 2rem;
}
#grammar-content h2 {
  font-size: 1.2rem;
  font-weight: normal;
  color: var(--text);
  margin: 2.5rem 0 1rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--border);
}
#grammar-content h3 {
  font-size: 0.95rem;
  font-weight: 600;
  font-family: system-ui, sans-serif;
  color: var(--gold-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 1.75rem 0 0.6rem;
}

#grammar-content p {
  font-family: system-ui, sans-serif;
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.6;
  margin: 0.5rem 0 1rem;
}

/* ── Tables ── */
.table-wrap {
  overflow-x: auto;
  margin: 0.75rem 0 1.5rem;
}

.grammar-table {
  border-collapse: collapse;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  font-family: system-ui, sans-serif;
  font-size: 0.88rem;
}

.grammar-table thead th {
  background: var(--bg);
  color: var(--muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.5rem 0.9rem;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  font-weight: normal;
  text-align: center;
}
.grammar-table thead th:first-child {
  text-align: left;
}

.grammar-table tbody th {
  color: var(--gold-dim);
  font-style: italic;
  font-weight: normal;
  padding: 0.45rem 0.9rem;
  border-bottom: 1px solid var(--border);
  border-right: 1px solid var(--border);
  white-space: nowrap;
  background: var(--bg);
  text-align: left;
}
.grammar-table tbody th.cell-sublabel {
  font-style: normal;
  font-size: 0.72rem;
  color: var(--muted);
  letter-spacing: 0.03em;
  min-width: 2rem;
}

.grammar-table tbody td {
  padding: 0.45rem 0.9rem;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  text-align: center;
  white-space: nowrap;
}

.grammar-table tbody tr:last-child th,
.grammar-table tbody tr:last-child td {
  border-bottom: none;
}
.grammar-table tbody tr:hover td,
.grammar-table tbody tr:hover th {
  background: rgba(255,255,255,0.02);
}
