.app-shell {
    height: 100dvh;
    display: flex;
    flex-direction: column;
    background: #f4f4f5;
    color: #1f2937;
}

.app-navbar {
    flex: 0 0 auto;
}

.workspace {
    flex: 1;
    min-height: 0;
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr);
    gap: 0.75rem;
    padding: 0.75rem 1rem;
}

.workspace-toolbar,
.toolbar-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.workspace-toolbar {
    flex-wrap: wrap;
}

.file-upload {
    border: 1px dashed #adb5bd;
    border-radius: 6px;
    background: white;
    padding: 0.5rem 1rem;
    cursor: pointer;
}

.file-upload:focus-within {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}

.filename-display {
    max-width: 16rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.model-summary {
    margin-left: auto;
}

.icon-button {
    width: 2.5rem;
    height: 2.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.icon-button img {
    width: 1.25rem;
    height: 1.25rem;
}

.analysis-panels {
    display: grid;
    grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
    gap: 0.75rem;
    min-height: 0;
}

.analysis-panels > .card {
    min-width: 0;
    min-height: 0;
}

.trend-card,
.trend-card .card-body {
    min-height: 0;
}

.trend-card .card-body {
    flex: 1;
    display: flex;
    padding: 0.5rem;
    overflow: hidden;
}

.results-card .card-body {
    overflow: auto;
}

.results-card table {
    white-space: nowrap;
}

.results-card th {
    position: sticky;
    top: -0.5rem;
    z-index: 1;
}

.results-card td {
    vertical-align: middle;
}

.transfer-function {
    display: inline-flex;
    align-items: center;
    gap: 0.2em;
    font-family: "Cambria Math", "Times New Roman", serif;
    font-size: 0.95rem;
    color: #1f2937;
}

.tf-fraction {
    display: inline-flex;
    flex-direction: column;
    text-align: center;
}

.tf-numerator {
    border-bottom: 1px solid currentColor;
}

.tf-numerator,
.tf-denominator {
    padding: 0.1em 0.25em;
}

@media (max-width: 767.98px), (max-height: 599.98px) {
    .app-shell {
        height: auto;
        min-height: 100dvh;
    }

    .workspace {
        grid-template-rows: auto auto auto;
    }

    .analysis-panels {
        grid-template-columns: minmax(0, 1fr);
        grid-template-rows: minmax(300px, 55dvh) auto;
    }

    .results-card .card-body {
        max-height: 24rem;
    }

    .model-summary {
        margin-left: 0;
    }

    .toolbar-actions {
        margin-left: auto;
    }
}
