#buddy-layout {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 5rem); /* Keep layout */
    padding: 1.5rem; /* Keep padding */
    background-color: var(--clay-darkest); /* Use theme variable */
    color: var(--clay-text-primary); /* Use theme variable */
}

#buddy-header {
    display: flex; /* Keep layout */
    align-items: center; /* Keep layout */
    margin-bottom: 1.5rem; /* Keep spacing */
    padding-bottom: 1rem; /* Keep padding */
    border-bottom: 1px solid var(--clay-border); /* Use theme variable */
}
#buddy-header .back-button {
    /* Styles handled by clay-theme.css */
    margin-right: 1rem; /* Add margin */
}

#buddy-header h1 {
    font-size: 1.5rem; /* Adjusted size */
    font-weight: 600; /* Adjusted weight */
    color: var(--clay-text-primary); /* Use theme variable */
    margin: 0; /* Remove default margin */
}

#buddy-content {
    flex-grow: 1; /* Keep layout */
    background: var(--gradient-surface); /* Use theme variable */
    border: 1px solid var(--clay-border); /* Use theme variable */
    border-radius: 0.75rem; /* Keep rounding */
    padding: 1.5rem; /* Keep padding */
    display: flex; /* Keep layout */
    flex-direction: column; /* Keep layout */
    overflow: hidden; /* Keep layout */
    box-shadow: var(--clay-shadow); /* Use theme variable */
}

#buddy-tabs {
    display: flex; /* Keep layout */
    border-bottom: 1px solid var(--clay-border); /* Use theme variable */
    flex-shrink: 0; /* Keep layout */
    margin-bottom: 1.5rem; /* Add margin below tabs */
}

.buddy-tab {
    /* Styles handled by clay-theme.css */
    padding: 0.75rem 1.25rem; /* Adjusted padding */
    font-size: 0.9rem; /* Adjusted size */
}

#buddy-tab-content {
    flex-grow: 1; /* Keep layout */
    overflow-y: auto; /* Keep layout */
    padding-right: 0.5rem; /* Add padding for scrollbar */
}

.buddy-tab-pane {
    display: none; /* Keep layout */
}

.buddy-tab-pane.active {
    display: block; /* Keep layout */
}

.buddy-grid {
    display: grid; /* Keep layout */
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); /* Adjusted min size */
    gap: 1rem; /* Adjusted gap */
}

.buddy-card {
    background: var(--clay-dark); /* Use theme variable */
    border: 1px solid var(--clay-border); /* Use theme variable */
    border-radius: 0.5rem; /* Adjusted rounding */
    padding: 1rem; /* Keep padding */
    display: flex; /* Keep layout */
    gap: 1rem; /* Keep spacing */
    align-items: center; /* Keep layout */
    box-shadow: var(--clay-shadow); /* Use theme variable */
}

.buddy-image {
    width: 70px; /* Adjusted size */
    height: 70px; /* Adjusted size */
    object-fit: contain; /* Keep layout */
    flex-shrink: 0; /* Keep layout */
    background-color: var(--clay-darker); /* Add background */
    border-radius: 0.375rem; /* Add rounding */
    padding: 0.25rem; /* Add padding */
    border: 1px solid var(--clay-border); /* Add border */
}

.buddy-info {
    flex-grow: 1; /* Keep layout */
}

.buddy-name {
    font-size: 1rem; /* Adjusted size */
    font-weight: 600; /* Keep weight */
    margin: 0 0 0.5rem 0; /* Keep spacing */
    color: var(--clay-text-primary); /* Use theme variable */
}

.buddy-production {
    display: flex; /* Keep layout */
    align-items: center; /* Keep layout */
    gap: 0.5rem; /* Keep spacing */
    font-size: 0.8rem; /* Adjusted size */
    color: var(--clay-text-secondary); /* Use theme variable */
}

.buddy-crop-icon { /* Reusing class for resource icon */
    width: 20px; /* Adjusted size */
    height: 20px; /* Adjusted size */
    object-fit: contain; /* Keep layout */
}
.buddy-production span:last-child {
    margin-left: auto; /* Push rate to the right */
    font-family: monospace;
    font-weight: 500;
    color: var(--clay-text-tertiary);
}

.buddy-progress-bar-container {
    width: 100%; /* Keep layout */
    height: 8px; /* Adjusted height */
    background-color: var(--clay-darker); /* Use theme variable */
    border-radius: 4px; /* Keep rounding */
    overflow: hidden; /* Keep layout */
    margin-top: 0.75rem; /* Keep spacing */
    border: 1px solid var(--clay-border); /* Add border */
}

.buddy-progress-bar {
    height: 100%; /* Keep layout */
    background: var(--gradient-accent); /* Use theme variable */
    border-radius: 4px; /* Keep rounding */
    transition: width 0.5s ease; /* Keep transition */
}
