html,
body {
    margin: 0;
    height: 100vh;
    overflow: hidden;
}

#app {
    display: flex;
    height: 100vh;
}

#ui {
    width: 280px;
    padding: 12px;
    box-sizing: border-box;
    overflow-y: auto;
    border-right: 1px solid var(--border);
    background: var(--bg-panel);
}

#canvasWrap {
    flex: 1;
    position: relative;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
    background: var(--bg-deep);
}

#canvasWrap canvas {
    display: block;
    width: 100%;
    height: 100%;
}

#status {
    position: absolute;
    left: 12px;
    bottom: 12px;
    z-index: 5;
    padding: 8px 10px;
    white-space: pre-line;
}

.section {
    margin-bottom: 18px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-soft);
}

.tile-btn,
.btn {
    width: 100%;
    margin-bottom: 8px;
    text-align: left;
}

.small {
    font-size: 13px;
    color: var(--text-dim);
    line-height: 1.4;
}

.toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: #222;
    color: #fff;
    padding: 10px 16px;
    border-radius: 6px;
    font-size: 14px;
    opacity: 0;
    pointer-events: none;
    transition: all 0.25s ease;
    z-index: 9999;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.toast.info {
    background: #333;
}

.toast.error {
    background: #c0392b;
}

.toast.success {
    background: #27ae60;
}

.custom-tile-row {
    display: flex;
    gap: 6px;
    align-items: stretch;
}

.custom-tile-row .tile-btn {
    flex: 1;
}

.remove-tile-btn {
    width: 34px;
    border: 1px solid #8a4444;
    background: #5a2525;
    color: white;
    border-radius: 6px;
    cursor: pointer;
}

.remove-tile-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}