html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    overflow: hidden;
}

/* ── Two-column layout ── */
.crafting-layout {
    display: flex;
    height: 100%;
    overflow: hidden;
}

/* ── Left panel ── */
.item-panel {
    width: 300px;
    min-width: 240px;
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--mud-palette-divider);
    background: var(--mud-palette-surface);
    overflow: hidden;
}

.item-panel-search {
    padding: 8px 8px 4px;
    flex-shrink: 0;
}

.item-search-field {
    width: 100%;
}

.item-list-scroll {
    flex: 1;
    overflow-y: auto;
}

.item-row {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 36px;
}

.item-icon {
    width: 28px;
    height: 28px;
    object-fit: contain;
    flex-shrink: 0;
}

.item-icon-empty {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
    border-radius: 4px;
    background: var(--mud-palette-action-disabled-background);
}

.item-name {
    font-size: 0.875rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── Right panel ── */
.detail-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--mud-palette-background);
}

.empty-state {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* ── Tabs wrapper ── */
.detail-tabs-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.detail-tabs-wrapper .mud-tabs {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
}

.detail-tabs-wrapper .mud-tabs-panels {
    flex: 1;
    overflow: hidden;
}

.detail-tab-panel {
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* ── Detail tab ── */
.detail-scroll {
    flex: 1;
    overflow-y: auto;
    padding-bottom: 24px;
}

.detail-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    border-bottom: 1px solid var(--mud-palette-divider);
    margin-bottom: 8px;
}

.detail-icon {
    width: 56px;
    height: 56px;
    object-fit: contain;
    flex-shrink: 0;
}

/* ── Configurator tab ── */
.config-scroll {
    flex: 1;
    overflow-y: auto;
    padding-bottom: 24px;
}

/* ── Config tree ── */
.ctree-root {
    padding: 8px 0;
}

.ctree-node {
    display: flex;
    flex-direction: column;
}

.ctree-row {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    padding: 6px 16px 6px 0;
    border-bottom: 1px solid var(--mud-palette-divider);
    min-height: 44px;
    transition: background 0.1s;
}

.ctree-row:hover {
    background: var(--mud-palette-action-default-hover);
}

.ctree-row--bought {
    opacity: 0.6;
}

.ctree-chevron {
    flex-shrink: 0;
    width: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-top: 2px;
}

.ctree-chevron-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 2px 4px;
    color: var(--mud-palette-text-secondary);
    font-size: 1.1rem;
    line-height: 1;
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ctree-chevron-btn:hover {
    background: var(--mud-palette-action-default-hover);
    color: var(--mud-palette-text-primary);
}

.ctree-chevron-open {
    display: inline-block;
    transform: rotate(90deg);
    transition: transform 0.15s;
}

.ctree-chevron-closed {
    display: inline-block;
    transform: rotate(0deg);
    transition: transform 0.15s;
}

.ctree-icon {
    width: 28px;
    height: 28px;
    object-fit: contain;
    flex-shrink: 0;
    margin-top: 2px;
}

.ctree-icon-empty {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
    border-radius: 4px;
    background: var(--mud-palette-action-disabled-background);
    margin-top: 2px;
}

.ctree-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.ctree-name-row {
    display: flex;
    align-items: baseline;
    gap: 6px;
    flex-wrap: wrap;
}

.ctree-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--mud-palette-text-primary);
}

.ctree-qty {
    font-size: 0.8rem;
    color: var(--mud-palette-text-secondary);
}

.ctree-skill {
    font-size: 0.75rem;
    color: #f5a623;
    font-weight: 500;
}

.ctree-skill--green { color: #4caf50; }
.ctree-skill--red   { color: #f44336; }

.ctree-recipe-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 3px;
    flex-wrap: wrap;
}

.ctree-recipe-label {
    font-size: 0.75rem;
    color: var(--mud-palette-text-secondary);
    flex-shrink: 0;
}

.ctree-recipe-select {
    font-size: 0.8rem;
    border: 1px solid var(--mud-palette-divider);
    border-radius: 4px;
    background: var(--mud-palette-surface);
    color: var(--mud-palette-text-primary);
    padding: 2px 6px;
    cursor: pointer;
    max-width: 360px;
}

.ctree-recipe-select:focus {
    outline: 2px solid var(--mud-palette-primary);
    outline-offset: 1px;
}

.ctree-provided-label {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.8rem;
    color: var(--mud-palette-text-secondary);
    cursor: pointer;
    flex-shrink: 0;
    white-space: nowrap;
    padding-top: 4px;
}

.ctree-provided-label:hover {
    color: var(--mud-palette-text-primary);
}

.ctree-checkbox {
    width: 15px;
    height: 15px;
    cursor: pointer;
    accent-color: var(--mud-palette-primary);
}

.ctree-children {
    padding-left: 34px;
}

/* ── Craft-status dot (item list) ── */
.craft-dot {
    flex-shrink: 0;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-left: auto;
}

.craft-dot--green { background: #4caf50; }
.craft-dot--red   { background: #f44336; }

/* ── Seedlings page ── */
.seedlings-layout {
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.seedlings-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    border-bottom: 1px solid var(--mud-palette-divider);
    flex-shrink: 0;
}

.seedlings-empty {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.seedlings-cards {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: flex-start;
}

.seedling-card {
    background: var(--mud-palette-surface);
    border: 1px solid var(--mud-palette-divider);
    border-radius: 8px;
    width: 340px;
    min-width: 280px;
    overflow: hidden;
}

.seedling-card-header {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    border-bottom: 1px solid var(--mud-palette-divider);
    background: var(--mud-palette-background-grey);
    gap: 4px;
}

.seedling-name-field {
    flex: 1;
}

.seedling-skills {
    padding: 8px 0;
}

.skill-group {
    padding: 4px 0;
}

.skill-group-header {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px 2px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--mud-palette-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.skill-group-icon {
    width: 16px;
    height: 16px;
    object-fit: contain;
    opacity: 0.7;
}

.skill-group-name { }

.skill-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 3px 12px;
    min-height: 36px;
}

.skill-name {
    flex: 1;
    font-size: 0.85rem;
    color: var(--mud-palette-text-primary);
}

.skill-controls {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.skill-level-field {
    width: 72px;
}

.skill-max {
    font-size: 0.75rem;
    color: var(--mud-palette-text-secondary);
    white-space: nowrap;
}

.skill-speed-chip {
    font-size: 0.7rem !important;
}
