body {
    background-color: #f5f5f5;
    margin: 40px;
    display: flex;
    justify-content: center;
    font-family: 'Times New Roman', Times, serif;
    color: black;
}

.app-window {
    background: #ffffff;
    border: 2px solid #d1d1d1;
    border-radius: 8px;
    padding: 30px 40px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    min-width: 720px;
    box-sizing: border-box;
    display: inline-block;
}

.layout-wrapper {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
}

.side-panel {
    width: 380px;
    padding-right: 35px;
    margin-right: 35px;
    border-right: 1px solid #d1d1d1;
    color: #333;
}

.side-panel h2 {
    margin: 0 0 20px 0;
    font-size: 26px;
    line-height: 1.2;
    font-weight: bold;
}

.explanation p {
    font-size: 15px;
    line-height: 1.5;
    margin-bottom: 15px;
    text-align: justify;
}

.credits {
    margin-top: 30px;
    font-size: 14px;
    color: #666;
    border-top: 1px solid #eee;
    padding-top: 15px;
}

.credits p {
    margin: 0;
}

.credits a {
    color: #0366d6;
    text-decoration: none;
}

.credits a:hover {
    text-decoration: underline;
}

.app-container {
    display: flex;
    flex-direction: column;
}

.section {
    display: flex;
    margin-bottom: 35px;
    align-items: flex-start;
}

.section.center-align {
    align-items: center;
}

.error-check-sect {
    margin-bottom: 35px;
}

.label {
    width: 130px;
    text-align: right;
    margin-right: 15px;
    font-size: 18px;
    padding-top: 8px;
    /* align with first row of table */
}

.section.center-align .label {
    padding-top: 0;
}

.grid-table {
    border-collapse: collapse;
    font-size: 18px;
    text-align: center;
}

.cell {
    width: 38px;
    height: 38px;
    border: 1px solid black;
    box-sizing: border-box;
}

.cell.empty {
    border: none;
    background: transparent;
}

.no-border {
    border: none;
}

.arrow {
    padding: 0 10px;
    width: 20px;
}

.text-label {
    padding-left: 5px;
    text-align: left;
}

/* Colors matching Mathematica notebook */
.bg-gray {
    background-color: #dfdfdf;
}

.bg-pink {
    background-color: #ffe1e1;
}

.bg-green {
    background-color: #e2f5e2;
}

.bg-blue {
    background-color: #dbeaff;
}

.bg-rx-pink {
    background-color: #fae1f6;
}

.bg-rx-yellow {
    background-color: #fffacd;
}

.bg-rx-cyan {
    background-color: #e0faff;
}

/* Interactive elements */
.clickable {
    cursor: pointer;
    font-weight: bold;
}

.clickable:hover {
    background-color: #c9c9c9;
}

/* Error selectors */
.no-border-table .empty-cell {
    width: 38px;
    height: 38px;
    padding: 0;
    margin: 0;
    text-align: center;
    border: none;
}

.err-btn {
    width: 30px;
    height: 30px;
    border: 1px solid transparent;
    background-color: #f3f4f6;
    border-radius: 4px;
    cursor: pointer;
    font-family: inherit;
    font-size: 16px;
    outline: none;
}

.err-btn:hover {
    background-color: #e5e7eb;
}

.err-btn.active {
    background-color: #ffffff;
    border: 1px solid #d1d1d1;
    border-radius: 8px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.err-btn.none {
    width: 50px;
}

/* Check section */
.err-check-display {
    display: flex;
    align-items: center;
}

.inline-table {
    display: inline-table;
    vertical-align: middle;
}

.small-cell {
    width: 25px;
    height: 25px;
    font-size: 16px;
}

.subscript {
    font-size: 12px;
    align-self: flex-end;
    margin-bottom: -5px;
    margin-left: 2px;
}

.equals {
    margin-left: 10px;
    font-size: 18px;
}

.text-red {
    color: red;
    font-weight: bold;
}