
/* 1. Responsive & Clean Table Formatting (fixes theme border:0; padding:0 reset) */
.tta-table-wrap {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 18px 0 24px 0;
    border-radius: 10px;
    border: 1px solid #cbd5e1;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.05);
    background: #ffffff;
}
.entry-content table.tta-auto-table,
.entry-content table:not([style*="border-collapse"]) {
    width: 100%;
    border-collapse: collapse;
    border-spacing: 0;
    font-size: 15px;
    line-height: 1.65;
    color: #1e293b;
    background: #ffffff;
    margin: 0;
}
.entry-content > table:not([style*="border-collapse"]) {
    margin: 18px 0 24px 0;
    border: 1px solid #cbd5e1;
}
.entry-content table.tta-auto-table thead th,
.entry-content table.tta-auto-table thead td,
.entry-content table.tta-auto-table tr > th,
.entry-content table:not([style*="border-collapse"]) thead th,
.entry-content table:not([style*="border-collapse"]) thead td,
.entry-content table:not([style*="border-collapse"]) tr > th {
    background-color: #f1f5f9;
    color: #0f172a;
    font-weight: 700;
    padding: 12px 16px;
    border-bottom: 2px solid #cbd5e1;
    border-right: 1px solid #cbd5e1;
    text-align: left;
    vertical-align: middle;
}
.entry-content table.tta-auto-table tbody td,
.entry-content table:not([style*="border-collapse"]) tbody td {
    padding: 12px 16px;
    border-bottom: 1px solid #e2e8f0;
    border-right: 1px solid #e2e8f0;
    vertical-align: top;
    color: #1e293b;
}
.entry-content table.tta-auto-table th:last-child,
.entry-content table.tta-auto-table td:last-child {
    border-right: none;
}
.entry-content table.tta-auto-table tbody tr:last-child td {
    border-bottom: none;
}
.entry-content table.tta-auto-table tbody tr:nth-child(even) td {
    background-color: #f8fafc;
}
.entry-content table.tta-auto-table tbody tr:hover td {
    background-color: #f0f9ff;
}
.entry-content table td p,
.entry-content table th p {
    margin: 0 0 8px 0;
    line-height: 1.6;
}
.entry-content table td p:last-child,
.entry-content table th p:last-child {
    margin-bottom: 0;
}

/* 2. Monospace Code & ASCII Diagram Blocks */
.entry-content pre,
.entry-content .code-block pre {
    background: #0f172a;
    color: #f8fafc;
    font-family: 'Cascadia Mono', 'Consolas', 'JetBrains Mono', 'Menlo', 'Monaco', 'Courier New', monospace !important;
    font-size: 13.5px;
    line-height: 1.5;
    padding: 18px 20px;
    margin: 16px 0 22px 0;
    border-radius: 10px;
    border: 1px solid #1e293b;
    overflow-x: auto;
    white-space: pre;
    word-wrap: normal;
    word-break: normal;
    tab-size: 4;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.12);
}
.entry-content pre code,
.entry-content .code-block pre code {
    background: transparent !important;
    color: inherit !important;
    font-family: inherit !important;
    font-size: inherit !important;
    padding: 0 !important;
    border: 0 !important;
    white-space: pre !important;
}

/* 3. Restore Subscript, Superscript, Lists, Headings & Blockquotes reset by theme style.css */
.entry-content sub {
    font-size: 75%;
    line-height: 0;
    position: relative;
    vertical-align: baseline;
    bottom: -0.25em;
}
.entry-content sup {
    font-size: 75%;
    line-height: 0;
    position: relative;
    vertical-align: baseline;
    top: -0.5em;
}
.entry-content ol {
    padding-left: 24px;
    margin: 8px 0 14px 0;
}
.entry-content ul {
    padding-left: 22px;
    margin: 8px 0 14px 0;
}
.entry-content li {
    margin-bottom: 6px;
    line-height: 1.68;
}
.entry-content li > p {
    margin-bottom: 6px;
}
.entry-content h2,
.entry-content h3,
.entry-content h4 {
    margin-top: 22px;
    margin-bottom: 10px;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.4;
}
.entry-content blockquote {
    margin: 16px 0;
    padding: 14px 18px;
    background: #f8fafc;
    border-left: 4px solid #0369a1;
    border-radius: 0 8px 8px 0;
    color: #1e293b;
}
.entry-content blockquote p:last-child {
    margin-bottom: 0;
}

/* 4. KaTeX Display & Inline Math Polish */
.tta-math-block {
    margin: 16px 0;
    padding: 8px 4px;
    overflow-x: auto;
    overflow-y: hidden;
    text-align: center;
}
.tta-math-inline .katex,
.tta-math-block .katex,
.katex {
    font-variant-numeric: normal !important;
    letter-spacing: 0 !important;
}
.tta-math-inline .katex {
    font-size: 1.04em;
}
.katex:not(:has(.katex-html)) .katex-mathml {
    position: static !important;
    clip: auto !important;
    clip-path: none !important;
    width: auto !important;
    height: auto !important;
    overflow: visible !important;
    border: 0 !important;
    padding: 0 !important;
}
