body {
    font-family: sans-serif;
    margin: 0;
}

.container {
    display: flex;
    width: 100vw;
    height: 100vh;
}

#sidebar {
    width: 180px;
    flex-shrink: 0;
    /* Prevents the sidebar from being shrunk */
    background-color: #f4f4f4;
    padding: 15px;
    overflow-y: auto;
}

#sidebar h2 {
    margin-top: 0;
}

#sidebar img {
    width: 50px;
    height: 50px;
    object-fit: cover;
    cursor: grab;
    margin-bottom: 10px;
}

/* Main logo is absolutely positioned; padding-top reserves space so title/table never sit under it */
#main-content {
    position: relative;
    flex-grow: 1;
    padding: 20px;
    padding-top: 152px;
    min-width: 0;
    /* Prevents table from expanding flex container */
    overflow-x: auto;
    /* Allows table to scroll if it overflows */
}

#icon {
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 2;
    display: block;
    height: 120px;
    width: auto;
    /* Leave room for .help-link on the right */
    max-width: calc(100% - 40px - 52px);
    object-fit: contain;
}

.help-link {
    position: absolute;
    /* Vertically centered with 120px-tall #icon (both start at top 20px in main column) */
    top: 60px;
    right: 20px;
    z-index: 2;
    box-sizing: border-box;
    width: 40px;
    height: 40px;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #ccc;
    border-radius: 50%;
    background: #fff;
    color: #333;
    font-family: inherit;
    font-size: 1.25rem;
    font-weight: bold;
    line-height: 1;
    text-decoration: none;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

.help-link:hover {
    background: #f5f5f5;
    border-color: #bbb;
}

.help-link:focus-visible {
    outline: 2px solid #4a90d9;
    outline-offset: 2px;
}

.help-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    box-sizing: border-box;
}

.help-modal[hidden] {
    display: none !important;
}

.help-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
}

.help-modal__panel {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 520px;
    max-height: min(90vh, 640px);
    overflow: auto;
    margin: 0;
    padding: 20px 44px 20px 20px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.help-modal__panel h2 {
    margin: 0 0 12px;
    font-size: 1.25rem;
}

.help-modal__body {
    font-size: 0.95rem;
    line-height: 1.45;
    color: #222;
}

.help-modal__body ul {
    margin: 0;
    padding-left: 1.25rem;
}

.help-modal__body li {
    margin-bottom: 8px;
}

.help-modal__more {
    margin: 16px 0 0;
    padding-top: 12px;
    border-top: 1px solid #eee;
    font-size: 0.95rem;
}

.help-modal__more a {
    color: #1a73e8;
}

.help-modal__close {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 36px;
    height: 36px;
    margin: 0;
    padding: 0;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: #666;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
}

.help-modal__close:hover {
    background: #f0f0f0;
    color: #333;
}

.help-modal__close:focus-visible {
    outline: 2px solid #4a90d9;
    outline-offset: 2px;
}

h1 {
    margin: 0;
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    clear: both;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    table-layout: fixed;
}

th,
td {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: left;
    vertical-align: top;
}

.cell-content-wrapper {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
}

th {
    background-color: #f2f2f2;
}

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

tr:hover {
    background-color: #f1f1f1;
}

td input {
    width: 100%;
    box-sizing: border-box;
}

td img {
    width: 50px;
    height: 50px;
    object-fit: cover;
}

button {
    margin-top: 20px;
    padding: 10px 15px;
    cursor: pointer;
}

.brush-active {
    background-color: #f0ad4e;
    color: white;
    border-color: #eea236;
}

.painted-top {
    border-top: 3px solid orange !important;
}

.painted-right {
    border-right: 3px solid orange !important;
}

.painted-bottom {
    border-bottom: 3px solid orange !important;
}

.painted-left {
    border-left: 3px solid orange !important;
}

.export-hidden {
    display: none !important;
}