.app {
    height: 100%;
    display: grid;
    grid-template-rows: auto 1fr auto;
}
.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1.5rem;
    background: var(--bg);
    box-shadow: 0 1px 0 var(--border), 0 4px 16px rgba(31, 58, 95, 0.05);
    position: relative;
    z-index: 1;
}
.header-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.brand {
    width: 2rem;
    height: 2rem;
}
.exercise-map-link {
    padding: 0.1875rem 0.75rem;
    border: 1px solid var(--border-strong);
    border-radius: 999px;
    font-family: var(--font-mono);
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    transition: border-color 0.2s, color 0.2s;
}
.exercise-map-link:hover {
    border-color: var(--primary);
    color: var(--primary-dark);
    text-decoration: none;
}
.header h1 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}
.header-controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.user-name {
    color: var(--text-muted);
    font-size: 0.8125rem;
    font-weight: 500;
}
.footer {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.25rem 1.5rem;
    padding: 0.5rem 1.5rem;
    background: var(--bg);
    box-shadow: 0 -1px 0 var(--border);
    font-size: 0.75rem;
    color: var(--text-muted);
}
.footer p {
    margin: 0;
}
.main {
    min-height: 0;
    display: grid;
    grid-template-columns: 1fr 25rem;
}
.canvas {
    overflow-y: auto;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;

    /* One view at a time: the welcome text, or what the agent found. The script sets data-view. */
    & > [data-canvas-view] {
        display: none;
    }
    &[data-view='welcome'] > [data-canvas-view='welcome'],
    &[data-view='results'] > [data-canvas-view='results'] {
        display: flex;
    }
}
.sidebar {
    min-height: 0;
    display: flex;
    flex-direction: column;
    background: var(--bg);
    box-shadow: -8px 0 24px rgba(31, 58, 95, 0.05);
}

.tabs {
    display: flex;
    border-bottom: 1px solid var(--border);
}
.tab {
    flex: 1;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    padding: 0.75rem;
    font-weight: 500;
    color: var(--text-muted);
    transition: color 0.2s;
}
.tab:hover {
    color: var(--text);
}
.tab.active {
    color: var(--text);
    font-weight: 700;
    border-bottom-color: var(--primary);
}
